n8n/packages/nodes-base/nodes/Google/GSuiteAdmin/UserDescription.ts

940 lines
19 KiB
TypeScript
Raw Normal View History

import {
INodeProperties,
} from 'n8n-workflow';
export const userOperations: INodeProperties[] = [
{
displayName: 'Operation',
name: 'operation',
type: 'options',
displayOptions: {
show: {
resource: [
'user',
],
},
},
options: [
{
name: 'Create',
value: 'create',
description: 'Create a user',
},
{
name: 'Delete',
value: 'delete',
description: 'Delete a user',
},
{
name: 'Get',
value: 'get',
description: 'Get a user',
},
{
name: 'Get All',
value: 'getAll',
description: 'Get all users',
},
{
name: 'Update',
value: 'update',
description: 'Update a user',
},
],
default: 'create',
2020-10-22 06:46:03 -07:00
description: 'The operation to perform.',
},
];
export const userFields: INodeProperties[] = [
/* -------------------------------------------------------------------------- */
/* user:create */
/* -------------------------------------------------------------------------- */
{
displayName: 'First Name',
name: 'firstName',
type: 'string',
required: true,
displayOptions: {
show: {
operation: [
'create',
],
resource: [
'user',
],
},
},
default: '',
},
{
displayName: 'Last Name',
name: 'lastName',
type: 'string',
required: true,
displayOptions: {
show: {
operation: [
2020-10-22 06:46:03 -07:00
'create',
],
resource: [
2020-10-22 06:46:03 -07:00
'user',
],
},
},
2020-10-22 06:46:03 -07:00
default: '',
},
{
displayName: 'Password',
name: 'password',
type: 'string',
typeOptions: {
password: true,
},
required: true,
displayOptions: {
show: {
operation: [
'create',
],
resource: [
'user',
],
},
},
default: '',
2020-10-22 06:46:03 -07:00
description: 'Stores the password for the user account. A minimum of 8 characters is required. The maximum length is 100 characters.',
},
{
displayName: 'Domain',
name: 'domain',
type: 'options',
typeOptions: {
loadOptionsMethod: 'getDomains',
},
required: true,
displayOptions: {
show: {
operation: [
'create',
],
resource: [
'user',
],
},
},
default: '',
},
{
displayName: 'Username',
name: 'username',
type: 'string',
displayOptions: {
show: {
operation: [
'create',
],
resource: [
'user',
],
},
},
default: '',
2020-10-22 06:46:03 -07:00
description: `The username that will be set to the user. Example: If you domain is example.com and you set the username to jhon then the user's final email address will be jhon@example.com.`,
},
{
displayName: 'Make Admin',
name: 'makeAdmin',
type: 'boolean',
required: true,
displayOptions: {
show: {
operation: [
'create',
],
resource: [
'user',
],
},
},
default: false,
description: 'Makes a user a super administrator',
},
{
displayName: 'Additional Fields',
name: 'additionalFields',
type: 'collection',
placeholder: 'Add Field',
default: {},
displayOptions: {
show: {
operation: [
'create',
],
resource: [
'user',
],
},
},
options: [
{
displayName: 'Change Password At Next Login',
name: 'changePasswordAtNextLogin',
type: 'boolean',
default: false,
description: 'Indicates if the user is forced to change their password at next login.',
},
{
displayName: 'Phones',
name: 'phoneUi',
placeholder: 'Add Phone',
type: 'fixedCollection',
typeOptions: {
multipleValues: true,
},
default: {},
options: [
{
name: 'phoneValues',
displayName: 'Phone',
values: [
{
displayName: 'Type',
name: 'type',
type: 'options',
options: [
{
name: 'Assistant',
value: 'assistant',
},
{
name: 'Callback',
value: 'callback',
},
{
name: 'Car',
value: 'car',
},
{
name: 'Company Main',
value: 'company_main',
},
{
name: 'Custom',
value: 'custom',
},
{
name: 'Grand Central',
value: 'grand_central',
},
{
name: 'Home',
value: 'home',
},
{
name: 'Home Fax',
value: 'home_fax',
},
{
name: 'isdn',
value: 'isdn',
},
{
name: 'Main',
value: 'main',
},
{
name: 'Mobile',
value: 'mobile',
},
{
name: 'Other',
value: 'other',
},
{
name: 'Other Fax',
value: 'other_fax',
},
{
name: 'Pager',
value: 'pager',
},
{
name: 'Radio',
value: 'radio',
},
{
name: 'Telex',
value: 'telex',
},
{
name: 'tty tdd',
value: 'tty_tdd',
},
{
name: 'Work',
value: 'work',
},
{
name: 'Work Fax',
value: 'work_fax',
},
{
name: 'Work Mobile',
value: 'work_mobile',
},
{
name: 'Work Pager',
value: 'work_pager',
},
],
default: 'work',
description: 'The type of phone number',
},
{
displayName: 'Phone Number',
name: 'value',
type: 'string',
default: '',
},
{
displayName: 'Primary',
name: 'primary',
type: 'boolean',
default: false,
description: `Indicates if this is the user's primary phone number. A user may only have one primary phone number.`,
},
],
},
],
},
{
displayName: 'Secondary Emails',
name: 'emailUi',
placeholder: 'Add Email',
type: 'fixedCollection',
typeOptions: {
multipleValues: true,
},
default: {},
options: [
{
name: 'emailValues',
displayName: 'Email',
values: [
{
displayName: 'Type',
name: 'type',
type: 'options',
options: [
{
name: 'Home',
value: 'home',
},
{
name: 'Work',
value: 'work',
},
{
name: 'Other',
value: 'other',
},
],
default: 'work',
description: 'The type of the email account',
},
{
displayName: 'Email',
name: 'address',
type: 'string',
default: '',
},
],
},
],
},
],
},
/* -------------------------------------------------------------------------- */
/* user:delete */
/* -------------------------------------------------------------------------- */
{
displayName: 'User ID',
name: 'userId',
type: 'string',
required: true,
displayOptions: {
show: {
operation: [
'delete',
],
resource: [
'user',
],
},
},
default: '',
description: `The value can be the user's primary email address, alias email address, or unique user ID.`,
},
/* -------------------------------------------------------------------------- */
/* user:get */
/* -------------------------------------------------------------------------- */
{
displayName: 'User ID',
name: 'userId',
type: 'string',
required: true,
displayOptions: {
show: {
operation: [
'get',
],
resource: [
'user',
],
},
},
default: '',
description: `The value can be the user's primary email address, alias email address, or unique user ID.`,
},
{
displayName: 'Projection',
name: 'projection',
type: 'options',
required: true,
options: [
{
name: 'Basic',
value: 'basic',
description: 'Do not include any custom fields for the user',
},
{
name: 'Custom',
value: 'custom',
description: 'Include custom fields from schemas requested in customField',
},
{
name: 'Full',
value: 'full',
description: 'Include all fields associated with this user',
},
],
displayOptions: {
show: {
operation: [
'get',
],
resource: [
'user',
],
},
},
default: 'basic',
description: 'What subset of fields to fetch for this user',
},
{
displayName: 'Options',
name: 'options',
type: 'collection',
placeholder: 'Add Options',
default: {},
displayOptions: {
show: {
operation: [
'get',
],
resource: [
'user',
],
},
},
options: [
{
displayName: 'Custom Schemas',
name: 'customFieldMask',
type: 'multiOptions',
displayOptions: {
show: {
'/projection': [
'custom',
],
},
},
typeOptions: {
loadOptionsMethod: 'getSchemas',
},
default: [],
description: `A comma-separated list of schema names. All fields from these schemas are fetched. This should only be set when projection=custom.`,
},
{
displayName: 'View Type',
name: 'viewType',
type: 'options',
options: [
{
name: 'Admin View',
value: 'admin_view',
description: 'Results include both administrator-only and domain-public fields for the user',
},
{
name: 'Descending',
value: 'DESCENDING',
description: 'Results only include fields for the user that are publicly visible to other users in the domain',
},
],
default: 'admin_view',
description: 'Whether to fetch the administrator-only or domain-wide public view of the user. For more information, see Retrieve a user as a non-administrator.',
},
],
},
/* -------------------------------------------------------------------------- */
/* user:getAll */
/* -------------------------------------------------------------------------- */
{
displayName: 'Return All',
name: 'returnAll',
type: 'boolean',
displayOptions: {
show: {
operation: [
'getAll',
],
resource: [
'user',
],
},
},
default: false,
description: 'If all results should be returned or only up to a given limit.',
},
{
displayName: 'Limit',
name: 'limit',
type: 'number',
displayOptions: {
show: {
operation: [
'getAll',
],
resource: [
'user',
],
returnAll: [
false,
],
},
},
typeOptions: {
minValue: 1,
maxValue: 500,
},
default: 100,
description: 'How many results to return.',
},
{
displayName: 'Projection',
name: 'projection',
type: 'options',
required: true,
options: [
{
name: 'Basic',
value: 'basic',
description: 'Do not include any custom fields for the user',
},
{
name: 'Custom',
value: 'custom',
description: 'Include custom fields from schemas requested in customField',
},
{
name: 'Full',
value: 'full',
description: 'Include all fields associated with this user',
},
],
displayOptions: {
show: {
operation: [
'getAll',
],
resource: [
'user',
],
},
},
default: 'basic',
description: 'What subset of fields to fetch for this user',
},
{
displayName: 'Options',
name: 'options',
type: 'collection',
placeholder: 'Add Option',
default: {},
displayOptions: {
show: {
operation: [
'getAll',
],
resource: [
'user',
],
},
},
options: [
{
displayName: 'Custom Schemas',
name: 'customFieldMask',
type: 'multiOptions',
displayOptions: {
show: {
'/projection': [
'custom',
],
},
},
typeOptions: {
loadOptionsMethod: 'getSchemas',
},
default: [],
description: `A comma-separated list of schema names. All fields from these schemas are fetched. This should only be set when projection=custom.`,
},
{
displayName: 'Customer',
name: 'customer',
type: 'string',
default: '',
refactor: Apply `eslint-plugin-n8n-nodes-base` autofixable rules (#3174) * :zap: Initial setup * :shirt: Update `.eslintignore` * :shirt: Autofix node-param-default-missing (#3173) * :fire: Remove duplicate key * :shirt: Add exceptions * :package: Update package-lock.json * :shirt: Apply `node-class-description-inputs-wrong-trigger-node` (#3176) * :shirt: Apply `node-class-description-inputs-wrong-regular-node` (#3177) * :shirt: Apply `node-class-description-outputs-wrong` (#3178) * :shirt: Apply `node-execute-block-double-assertion-for-items` (#3179) * :shirt: Apply `node-param-default-wrong-for-collection` (#3180) * :shirt: Apply node-param-default-wrong-for-boolean (#3181) * Autofixed default missing * Autofixed booleans, worked well * :zap: Fix params * :rewind: Undo exempted autofixes * :package: Update package-lock.json * :shirt: Apply node-class-description-missing-subtitle (#3182) * :zap: Fix missing comma * :shirt: Apply `node-param-default-wrong-for-fixed-collection` (#3184) * :shirt: Add exception for `node-class-description-missing-subtitle` * :shirt: Apply `node-param-default-wrong-for-multi-options` (#3185) * :shirt: Apply `node-param-collection-type-unsorted-items` (#3186) * Missing coma * :shirt: Apply `node-param-default-wrong-for-simplify` (#3187) * :shirt: Apply `node-param-description-comma-separated-hyphen` (#3190) * :shirt: Apply `node-param-description-empty-string` (#3189) * :shirt: Apply `node-param-description-excess-inner-whitespace` (#3191) * Rule looks good * Add whitespace rule in eslint config * :zao: fix * :shirt: Apply `node-param-description-identical-to-display-name` (#3193) * :shirt: Apply `node-param-description-missing-for-ignore-ssl-issues` (#3195) * :rewind: Revert ":zao: fix" This reverts commit ef8a76f3dfedffd1bdccf3178af8a8d90cf5a55c. * :shirt: Apply `node-param-description-missing-for-simplify` (#3196) * :shirt: Apply `node-param-description-missing-final-period` (#3194) * Rule working as intended * Add rule to eslint * :shirt: Apply node-param-description-missing-for-return-all (#3197) * :zap: Restore `lintfix` command Co-authored-by: agobrech <45268029+agobrech@users.noreply.github.com> Co-authored-by: Omar Ajoue <krynble@gmail.com> Co-authored-by: agobrech <ael.gobrecht@gmail.com> Co-authored-by: Michael Kret <michael.k@radency.com>
2022-04-22 09:29:51 -07:00
description: 'The unique ID for the customer\'s G Suite account. In case of a multi-domain account, to fetch all groups for a customer, fill this field instead of domain.',
},
{
displayName: 'Domain',
name: 'domain',
type: 'string',
default: '',
description: 'The domain name. Use this field to get fields from only one domain.',
},
{
displayName: 'Order By',
name: 'orderBy',
type: 'options',
options: [
{
name: 'Email',
value: 'email',
},
{
name: 'Family Name',
value: 'familyName',
},
{
name: 'Given Name',
value: 'givenName',
},
],
default: '',
description: 'Property to use for sorting results.',
},
{
displayName: 'Query',
name: 'query',
type: 'string',
default: '',
refactor: Apply `eslint-plugin-n8n-nodes-base` autofixable rules (#3174) * :zap: Initial setup * :shirt: Update `.eslintignore` * :shirt: Autofix node-param-default-missing (#3173) * :fire: Remove duplicate key * :shirt: Add exceptions * :package: Update package-lock.json * :shirt: Apply `node-class-description-inputs-wrong-trigger-node` (#3176) * :shirt: Apply `node-class-description-inputs-wrong-regular-node` (#3177) * :shirt: Apply `node-class-description-outputs-wrong` (#3178) * :shirt: Apply `node-execute-block-double-assertion-for-items` (#3179) * :shirt: Apply `node-param-default-wrong-for-collection` (#3180) * :shirt: Apply node-param-default-wrong-for-boolean (#3181) * Autofixed default missing * Autofixed booleans, worked well * :zap: Fix params * :rewind: Undo exempted autofixes * :package: Update package-lock.json * :shirt: Apply node-class-description-missing-subtitle (#3182) * :zap: Fix missing comma * :shirt: Apply `node-param-default-wrong-for-fixed-collection` (#3184) * :shirt: Add exception for `node-class-description-missing-subtitle` * :shirt: Apply `node-param-default-wrong-for-multi-options` (#3185) * :shirt: Apply `node-param-collection-type-unsorted-items` (#3186) * Missing coma * :shirt: Apply `node-param-default-wrong-for-simplify` (#3187) * :shirt: Apply `node-param-description-comma-separated-hyphen` (#3190) * :shirt: Apply `node-param-description-empty-string` (#3189) * :shirt: Apply `node-param-description-excess-inner-whitespace` (#3191) * Rule looks good * Add whitespace rule in eslint config * :zao: fix * :shirt: Apply `node-param-description-identical-to-display-name` (#3193) * :shirt: Apply `node-param-description-missing-for-ignore-ssl-issues` (#3195) * :rewind: Revert ":zao: fix" This reverts commit ef8a76f3dfedffd1bdccf3178af8a8d90cf5a55c. * :shirt: Apply `node-param-description-missing-for-simplify` (#3196) * :shirt: Apply `node-param-description-missing-final-period` (#3194) * Rule working as intended * Add rule to eslint * :shirt: Apply node-param-description-missing-for-return-all (#3197) * :zap: Restore `lintfix` command Co-authored-by: agobrech <45268029+agobrech@users.noreply.github.com> Co-authored-by: Omar Ajoue <krynble@gmail.com> Co-authored-by: agobrech <ael.gobrecht@gmail.com> Co-authored-by: Michael Kret <michael.k@radency.com>
2022-04-22 09:29:51 -07:00
description: 'Free text search terms to find users that match these terms in any field, except for extended properties. For more information on constructing user queries, see <a href="https://developers.google.com/admin-sdk/directory/v1/guides/search-users">Search for Users</a>.',
},
{
displayName: 'Show Deleted',
name: 'showDeleted',
type: 'boolean',
default: false,
description: 'If set to true, retrieves the list of deleted users.',
},
{
displayName: 'Sort Order',
name: 'sortOrder',
type: 'options',
options: [
{
name: 'Ascending',
value: 'ASCENDING',
},
{
name: 'Descending',
value: 'DESCENDING',
},
],
default: '',
description: 'Whether to return results in ascending or descending order',
},
{
displayName: 'View Type',
name: 'viewType',
type: 'options',
options: [
{
name: 'Admin View',
value: 'admin_view',
description: 'Results include both administrator-only and domain-public fields for the user',
},
{
name: 'Descending',
value: 'DESCENDING',
description: 'Results only include fields for the user that are publicly visible to other users in the domain',
},
],
default: 'admin_view',
description: 'Whether to fetch the administrator-only or domain-wide public view of the user. For more information, see Retrieve a user as a non-administrator.',
},
],
},
/* -------------------------------------------------------------------------- */
/* user:update */
/* -------------------------------------------------------------------------- */
{
displayName: 'User ID',
name: 'userId',
type: 'string',
required: true,
displayOptions: {
show: {
operation: [
'update',
],
resource: [
'user',
],
},
},
default: '',
description: `The value can be the user's primary email address, alias email address, or unique user ID.`,
},
{
displayName: 'Update Fields',
name: 'updateFields',
type: 'collection',
placeholder: 'Add Field',
default: {},
displayOptions: {
show: {
operation: [
'update',
],
resource: [
'user',
],
},
},
options: [
{
displayName: 'Archived',
name: 'archived',
type: 'boolean',
default: false,
description: 'Indicates if user is archived.',
},
{
displayName: 'Change Password At Next Login',
name: 'changePasswordAtNextLogin',
type: 'boolean',
default: false,
description: 'Indicates if the user is forced to change their password at next login.',
},
{
displayName: 'First Name',
name: 'firstName',
type: 'string',
default: '',
},
{
displayName: 'Last Name',
name: 'lastName',
type: 'string',
2020-10-22 06:46:03 -07:00
default: '',
},
{
displayName: 'Password',
name: 'password',
type: 'string',
default: '',
2020-10-22 06:46:03 -07:00
description: 'Stores the password for the user account. A minimum of 8 characters is required. The maximum length is 100 characters.',
},
{
displayName: 'Phones',
name: 'phoneUi',
placeholder: 'Add Phone',
type: 'fixedCollection',
typeOptions: {
multipleValues: true,
},
default: {},
options: [
{
name: 'phoneValues',
displayName: 'Phone',
values: [
{
displayName: 'Type',
name: 'type',
type: 'options',
options: [
{
name: 'Assistant',
value: 'assistant',
},
{
name: 'Callback',
value: 'callback',
},
{
name: 'Car',
value: 'car',
},
{
name: 'Company Main',
value: 'company_main',
},
{
name: 'Custom',
value: 'custom',
},
{
name: 'Grand Central',
value: 'grand_central',
},
{
name: 'Home',
value: 'home',
},
{
name: 'Home Fax',
value: 'home_fax',
},
{
name: 'isdn',
value: 'isdn',
},
{
name: 'Main',
value: 'main',
},
{
name: 'Mobile',
value: 'mobile',
},
{
name: 'Other',
value: 'other',
},
{
name: 'Other Fax',
value: 'other_fax',
},
{
name: 'Pager',
value: 'pager',
},
{
name: 'Radio',
value: 'radio',
},
{
name: 'Telex',
value: 'telex',
},
{
name: 'tty tdd',
value: 'tty_tdd',
},
{
name: 'Work',
value: 'work',
},
{
name: 'Work Fax',
value: 'work_fax',
},
{
name: 'Work Mobile',
value: 'work_mobile',
},
{
name: 'Work Pager',
value: 'work_pager',
},
],
default: 'work',
description: 'The type of phone number',
},
{
displayName: 'Phone Number',
name: 'value',
type: 'string',
default: '',
},
{
displayName: 'Primary',
name: 'primary',
type: 'boolean',
default: false,
description: `Indicates if this is the user's primary phone number. A user may only have one primary phone number.`,
},
],
},
],
},
{
displayName: 'Primary Email',
name: 'primaryEmail',
type: 'string',
default: '',
description: `The user's primary email address. This property is required in a request to create a user account. The primaryEmail must be unique and cannot be an alias of another user.`,
},
{
displayName: 'Secondary Emails',
name: 'emailUi',
placeholder: 'Add Email',
type: 'fixedCollection',
typeOptions: {
multipleValues: true,
},
default: {},
options: [
{
name: 'emailValues',
displayName: 'Email',
values: [
{
displayName: 'Type',
name: 'type',
type: 'options',
options: [
{
name: 'Home',
value: 'home',
},
{
name: 'Work',
value: 'work',
},
{
name: 'Other',
value: 'other',
},
],
default: 'work',
description: 'The type of the email account',
},
{
displayName: 'Email',
name: 'address',
type: 'string',
default: '',
},
],
},
],
},
],
},
];