n8n/packages/nodes-base/nodes/Zammad/descriptions/UserDescription.ts

663 lines
12 KiB
TypeScript
Raw Normal View History

import {
INodeProperties,
} from 'n8n-workflow';
export const userDescription: INodeProperties[] = [
// ----------------------------------
// operations
// ----------------------------------
{
displayName: 'Operation',
name: 'operation',
type: 'options',
noDataExpression: true,
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: 'Retrieve a user',
},
{
name: 'Get All',
value: 'getAll',
description: 'Retrieve all users',
},
{
name: 'Get Self',
value: 'getSelf',
description: 'Retrieve currently logged-in user',
},
{
name: 'Update',
value: 'update',
description: 'Update a user',
},
],
default: 'create',
},
// ----------------------------------
// fields
// ----------------------------------
{
displayName: 'First Name',
name: 'firstname',
type: 'string',
default: '',
placeholder: 'John',
required: true,
displayOptions: {
show: {
resource: [
'user',
],
operation: [
'create',
],
},
},
},
{
displayName: 'Last Name',
name: 'lastname',
type: 'string',
default: '',
placeholder: 'Smith',
required: true,
displayOptions: {
show: {
resource: [
'user',
],
operation: [
'create',
],
},
},
},
{
displayName: 'User ID',
name: 'id',
type: 'string',
description: 'User to update. Specify an ID using an <a href="https://docs.n8n.io/nodes/expressions.html#expressions">expression</a>.',
default: '',
required: true,
displayOptions: {
show: {
resource: [
'user',
],
operation: [
'update',
],
},
},
},
{
displayName: 'User ID',
name: 'id',
type: 'string',
description: 'User to delete. Specify an ID using an <a href="https://docs.n8n.io/nodes/expressions.html#expressions">expression</a>.',
default: '',
required: true,
displayOptions: {
show: {
resource: [
'user',
],
operation: [
'delete',
],
},
},
},
{
displayName: 'User ID',
name: 'id',
type: 'string',
description: 'User to retrieve. Specify an ID using an <a href="https://docs.n8n.io/nodes/expressions.html#expressions">expression</a>.',
default: '',
required: true,
displayOptions: {
show: {
resource: [
'user',
],
operation: [
'get',
],
},
},
},
{
displayName: 'Additional Fields',
name: 'additionalFields',
type: 'collection',
displayOptions: {
show: {
resource: [
'user',
],
operation: [
'create',
],
},
},
default: {},
placeholder: 'Add Field',
options: [
{
displayName: 'Active',
name: 'active',
type: 'boolean',
default: true,
},
{
displayName: 'Address',
name: 'addressUi',
type: 'fixedCollection',
placeholder: 'Add Address',
default: {},
options: [
{
displayName: 'Address Details',
name: 'addressDetails',
values: [
{
displayName: 'City',
name: 'city',
type: 'string',
default: '',
placeholder: 'Berlin',
},
{
displayName: 'Country',
name: 'country',
type: 'string',
default: '',
placeholder: 'Germany',
},
{
displayName: 'Street & Number',
name: 'address',
type: 'string',
default: '',
placeholder: 'Borsigstr. 27',
},
{
displayName: 'Zip Code',
name: 'zip',
type: 'string',
default: '',
placeholder: '10115',
},
],
},
],
},
{
displayName: 'Custom Fields',
name: 'customFieldsUi',
type: 'fixedCollection',
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
default: {},
placeholder: 'Add Custom Field',
typeOptions: {
multipleValues: true,
},
options: [
{
name: 'customFieldPairs',
displayName: 'Custom Field',
values: [
{
displayName: 'Field Name',
name: 'name',
type: 'options',
typeOptions: {
loadOptionsMethod: 'loadUserCustomFields',
},
default: '',
description: 'Name of the custom field to set',
},
{
displayName: 'Field Value',
name: 'value',
type: 'string',
default: '',
description: 'Value to set on the custom field',
},
],
},
],
},
{
displayName: 'Department',
name: 'department',
type: 'string',
default: '',
placeholder: 'Finance',
},
{
displayName: 'Email Address',
name: 'email',
type: 'string',
default: '',
},
{
displayName: 'Fax',
name: 'fax',
type: 'string',
default: '',
placeholder: '+49 30 901820',
},
{
displayName: 'Notes',
name: 'note',
type: 'string',
default: '',
typeOptions: {
alwaysOpenEditWindow: true,
},
},
{
displayName: 'Organization Name/ID',
name: 'organization',
type: 'options',
description: 'Name of the organization to assign to the user. Choose from the list or specify an ID using an <a href="https://docs.n8n.io/nodes/expressions.html#expressions">expression</a>.',
default: '',
typeOptions: {
loadOptionsMethod: 'loadOrganizations',
},
},
{
displayName: 'Phone (Landline)',
name: 'phone',
type: 'string',
default: '',
placeholder: '+49 30 901820',
},
{
displayName: 'Phone (Mobile)',
name: 'mobile',
type: 'string',
default: '',
placeholder: '+49 1522 3433333',
},
{
displayName: 'Verified',
name: 'verified',
type: 'boolean',
default: false,
description: 'Whether the user has been verified',
},
{
displayName: 'VIP',
name: 'vip',
type: 'boolean',
default: false,
description: 'Whether the user is a Very Important Person',
},
{
displayName: 'Website',
name: 'web',
type: 'string',
default: '',
placeholder: 'https://n8n.io',
},
],
},
{
displayName: 'Update Fields',
name: 'updateFields',
type: 'collection',
displayOptions: {
show: {
operation: [
'update',
],
resource: [
'user',
],
},
},
default: {},
placeholder: 'Add Field',
options: [
{
displayName: 'Active',
name: 'active',
type: 'boolean',
default: true,
},
{
displayName: 'Address',
name: 'addressUi',
type: 'fixedCollection',
placeholder: 'Add Address',
default: {},
options: [
{
displayName: 'Address Details',
name: 'addressDetails',
values: [
{
displayName: 'City',
name: 'city',
type: 'string',
default: '',
placeholder: 'Berlin',
},
{
displayName: 'Country',
name: 'country',
type: 'string',
default: '',
placeholder: 'Germany',
},
{
displayName: 'Street & Number',
name: 'address',
type: 'string',
default: '',
placeholder: 'Borsigstr. 27',
},
{
displayName: 'Zip Code',
name: 'zip',
type: 'string',
default: '',
placeholder: '10115',
},
],
},
],
},
{
displayName: 'Custom Fields',
name: 'customFieldsUi',
type: 'fixedCollection',
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
default: {},
placeholder: 'Add Custom Field',
typeOptions: {
multipleValues: true,
},
options: [
{
name: 'customFieldPairs',
displayName: 'Custom Field',
values: [
{
displayName: 'Field Name',
name: 'name',
type: 'options',
typeOptions: {
loadOptionsMethod: 'loadUserCustomFields',
},
default: '',
description: 'Name of the custom field to set',
},
{
displayName: 'Field Value',
name: 'value',
type: 'string',
default: '',
description: 'Value to set on the custom field',
},
],
},
],
},
{
displayName: 'Department',
name: 'department',
type: 'string',
default: '',
placeholder: 'Finance',
},
{
displayName: 'Email Address',
name: 'email',
type: 'string',
default: '',
placeholder: 'hello@n8n.io',
},
{
displayName: 'Fax',
name: 'fax',
type: 'string',
default: '',
placeholder: '+49 30 901820',
},
{
displayName: 'First Name',
name: 'firstname',
type: 'string',
default: '',
placeholder: 'John',
},
{
displayName: 'Last Name',
name: 'lastname',
type: 'string',
default: '',
placeholder: 'Smith',
},
{
displayName: 'Notes',
name: 'note',
type: 'string',
default: '',
typeOptions: {
alwaysOpenEditWindow: true,
},
},
{
displayName: 'Organization Name/ID',
name: 'organization',
type: 'options',
description: 'Name of the organization to assign to the user. Choose from the list or specify an ID using an <a href="https://docs.n8n.io/nodes/expressions.html#expressions">expression</a>.',
default: '',
typeOptions: {
loadOptionsMethod: 'loadOrganizationNames',
},
},
{
displayName: 'Phone (Landline)',
name: 'phone',
type: 'string',
default: '',
placeholder: '+49 30 901820',
},
{
displayName: 'Phone (Mobile)',
name: 'mobile',
type: 'string',
default: '',
placeholder: '+49 1522 3433333',
},
{
displayName: 'Verified',
name: 'verified',
type: 'boolean',
default: false,
description: 'Whether the user has been verified',
},
{
displayName: 'VIP',
name: 'vip',
type: 'boolean',
default: false,
description: 'Whether the user is a Very Important Person',
},
{
displayName: 'Website',
name: 'web',
type: 'string',
default: '',
placeholder: 'https://n8n.io',
},
],
},
{
displayName: 'Query',
name: 'query',
type: 'string',
default: '',
required: true,
displayOptions: {
show: {
operation: [
'search',
],
resource: [
'user',
],
},
},
},
{
displayName: 'Limit',
name: 'limit',
type: 'number',
default: 50,
typeOptions: {
minValue: 1,
},
displayOptions: {
show: {
operation: [
'search',
],
resource: [
'user',
],
},
},
description: 'Max number of results to return',
},
{
displayName: 'Return All',
name: 'returnAll',
type: 'boolean',
default: false,
description: 'Whether to return all results or only up to a given limit',
displayOptions: {
show: {
resource: [
'user',
],
operation: [
'getAll',
],
},
},
},
{
displayName: 'Limit',
name: 'limit',
type: 'number',
default: 50,
description: 'Max number of results to return',
typeOptions: {
minValue: 1,
},
displayOptions: {
show: {
resource: [
'user',
],
operation: [
'getAll',
],
returnAll: [
false,
],
},
},
},
{
displayName: 'Filters',
name: 'filters',
type: 'collection',
displayOptions: {
show: {
resource: [
'user',
],
operation: [
'getAll',
],
},
},
default: {},
placeholder: 'Add Filter',
options: [
{
displayName: 'Query',
name: 'query',
type: 'string',
default: '',
description: 'Query to filter results by',
placeholder: 'user.firstname:john',
},
{
displayName: 'Sort',
name: 'sortUi',
type: 'fixedCollection',
placeholder: 'Add Sort Options',
default: {},
options: [
{
displayName: 'Sort Options',
name: 'sortDetails',
values: [
{
displayName: 'Sort Key',
name: 'sort_by',
type: 'options',
typeOptions: {
loadOptionsMethod: 'loadUserFields',
},
default: '',
},
{
displayName: 'Sort Order',
name: 'order_by',
type: 'options',
options: [
{
name: 'Ascending',
value: 'asc',
},
{
name: 'Descending',
value: 'desc',
},
],
default: 'asc',
},
],
},
],
},
],
},
];