diff --git a/packages/nodes-base/credentials/ERPNextApi.credentials.ts b/packages/nodes-base/credentials/ERPNextApi.credentials.ts index 9d9b35dc3be6e..f0ff8c5fb596b 100644 --- a/packages/nodes-base/credentials/ERPNextApi.credentials.ts +++ b/packages/nodes-base/credentials/ERPNextApi.credentials.ts @@ -83,7 +83,8 @@ export class ERPNextApi implements ICredentialType { }; test: ICredentialTestRequest = { request: { - baseURL: '={{$credentials.environment === "cloudHosted" ? "https://" + $credentials.subdomain + ".erpnext.com" : $credentials.domain}}', + baseURL: + '={{$credentials.environment === "cloudHosted" ? "https://" + $credentials.subdomain + ".erpnext.com" : $credentials.domain}}', url: '/api/resource/Doctype', skipSslCertificateValidation: '={{ $credentials.allowUnauthorizedCerts }}', }, diff --git a/packages/nodes-base/nodes/ActionNetwork/descriptions/AttendanceDescription.ts b/packages/nodes-base/nodes/ActionNetwork/descriptions/AttendanceDescription.ts index 0124675925ff5..2e498181859be 100644 --- a/packages/nodes-base/nodes/ActionNetwork/descriptions/AttendanceDescription.ts +++ b/packages/nodes-base/nodes/ActionNetwork/descriptions/AttendanceDescription.ts @@ -1,10 +1,6 @@ -import { - INodeProperties, -} from 'n8n-workflow'; +import { INodeProperties } from 'n8n-workflow'; -import { - makeSimpleField, -} from './SharedFields'; +import { makeSimpleField } from './SharedFields'; export const attendanceOperations: INodeProperties[] = [ { @@ -14,9 +10,7 @@ export const attendanceOperations: INodeProperties[] = [ noDataExpression: true, displayOptions: { show: { - resource: [ - 'attendance', - ], + resource: ['attendance'], }, }, options: [ @@ -53,12 +47,8 @@ export const attendanceFields: INodeProperties[] = [ required: true, displayOptions: { show: { - resource: [ - 'attendance', - ], - operation: [ - 'create', - ], + resource: ['attendance'], + operation: ['create'], }, }, }, @@ -71,12 +61,8 @@ export const attendanceFields: INodeProperties[] = [ required: true, displayOptions: { show: { - resource: [ - 'attendance', - ], - operation: [ - 'create', - ], + resource: ['attendance'], + operation: ['create'], }, }, }, @@ -94,12 +80,8 @@ export const attendanceFields: INodeProperties[] = [ required: true, displayOptions: { show: { - resource: [ - 'attendance', - ], - operation: [ - 'get', - ], + resource: ['attendance'], + operation: ['get'], }, }, }, @@ -112,12 +94,8 @@ export const attendanceFields: INodeProperties[] = [ required: true, displayOptions: { show: { - resource: [ - 'attendance', - ], - operation: [ - 'get', - ], + resource: ['attendance'], + operation: ['get'], }, }, }, @@ -135,12 +113,8 @@ export const attendanceFields: INodeProperties[] = [ required: true, displayOptions: { show: { - resource: [ - 'attendance', - ], - operation: [ - 'getAll', - ], + resource: ['attendance'], + operation: ['getAll'], }, }, }, @@ -152,12 +126,8 @@ export const attendanceFields: INodeProperties[] = [ description: 'Whether to return all results or only up to a given limit', displayOptions: { show: { - resource: [ - 'attendance', - ], - operation: [ - 'getAll', - ], + resource: ['attendance'], + operation: ['getAll'], }, }, }, @@ -172,15 +142,9 @@ export const attendanceFields: INodeProperties[] = [ }, displayOptions: { show: { - resource: [ - 'attendance', - ], - operation: [ - 'getAll', - ], - returnAll: [ - false, - ], + resource: ['attendance'], + operation: ['getAll'], + returnAll: [false], }, }, }, diff --git a/packages/nodes-base/nodes/ActionNetwork/descriptions/EventDescription.ts b/packages/nodes-base/nodes/ActionNetwork/descriptions/EventDescription.ts index a13396d08a6e7..eb8af46a559f3 100644 --- a/packages/nodes-base/nodes/ActionNetwork/descriptions/EventDescription.ts +++ b/packages/nodes-base/nodes/ActionNetwork/descriptions/EventDescription.ts @@ -1,11 +1,6 @@ -import { - INodeProperties, -} from 'n8n-workflow'; +import { INodeProperties } from 'n8n-workflow'; -import { - eventAdditionalFieldsOptions, - makeSimpleField, -} from './SharedFields'; +import { eventAdditionalFieldsOptions, makeSimpleField } from './SharedFields'; export const eventOperations: INodeProperties[] = [ { @@ -15,9 +10,7 @@ export const eventOperations: INodeProperties[] = [ noDataExpression: true, displayOptions: { show: { - resource: [ - 'event', - ], + resource: ['event'], }, }, options: [ @@ -54,12 +47,8 @@ export const eventFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'event', - ], - operation: [ - 'create', - ], + resource: ['event'], + operation: ['create'], }, }, }, @@ -72,12 +61,8 @@ export const eventFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'event', - ], - operation: [ - 'create', - ], + resource: ['event'], + operation: ['create'], }, }, }, @@ -90,12 +75,8 @@ export const eventFields: INodeProperties[] = [ default: {}, displayOptions: { show: { - resource: [ - 'event', - ], - operation: [ - 'create', - ], + resource: ['event'], + operation: ['create'], }, }, options: eventAdditionalFieldsOptions, @@ -113,12 +94,8 @@ export const eventFields: INodeProperties[] = [ required: true, displayOptions: { show: { - resource: [ - 'event', - ], - operation: [ - 'get', - ], + resource: ['event'], + operation: ['get'], }, }, }, @@ -135,12 +112,8 @@ export const eventFields: INodeProperties[] = [ description: 'Whether to return all results or only up to a given limit', displayOptions: { show: { - resource: [ - 'event', - ], - operation: [ - 'getAll', - ], + resource: ['event'], + operation: ['getAll'], }, }, }, @@ -155,15 +128,9 @@ export const eventFields: INodeProperties[] = [ }, displayOptions: { show: { - resource: [ - 'event', - ], - operation: [ - 'getAll', - ], - returnAll: [ - false, - ], + resource: ['event'], + operation: ['getAll'], + returnAll: [false], }, }, }, diff --git a/packages/nodes-base/nodes/ActionNetwork/descriptions/PersonDescription.ts b/packages/nodes-base/nodes/ActionNetwork/descriptions/PersonDescription.ts index 41797ef7479c5..4e4202a4c0906 100644 --- a/packages/nodes-base/nodes/ActionNetwork/descriptions/PersonDescription.ts +++ b/packages/nodes-base/nodes/ActionNetwork/descriptions/PersonDescription.ts @@ -1,11 +1,6 @@ -import { - INodeProperties, -} from 'n8n-workflow'; +import { INodeProperties } from 'n8n-workflow'; -import { - makeSimpleField, - personAdditionalFieldsOptions, -} from './SharedFields'; +import { makeSimpleField, personAdditionalFieldsOptions } from './SharedFields'; export const personOperations: INodeProperties[] = [ { @@ -15,9 +10,7 @@ export const personOperations: INodeProperties[] = [ noDataExpression: true, displayOptions: { show: { - resource: [ - 'person', - ], + resource: ['person'], }, }, options: [ @@ -60,12 +53,8 @@ export const personFields: INodeProperties[] = [ description: 'Person’s email addresses', displayOptions: { show: { - resource: [ - 'person', - ], - operation: [ - 'create', - ], + resource: ['person'], + operation: ['create'], }, }, options: [ @@ -78,14 +67,14 @@ export const personFields: INodeProperties[] = [ name: 'address', type: 'string', default: '', - description: 'Person\'s email address', + description: "Person's email address", }, { displayName: 'Primary', name: 'primary', type: 'hidden', default: true, - description: 'Whether this is the person\'s primary email address', + description: "Whether this is the person's primary email address", }, { displayName: 'Status', @@ -132,12 +121,8 @@ export const personFields: INodeProperties[] = [ default: {}, displayOptions: { show: { - resource: [ - 'person', - ], - operation: [ - 'create', - ], + resource: ['person'], + operation: ['create'], }, }, options: personAdditionalFieldsOptions, @@ -155,12 +140,8 @@ export const personFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'person', - ], - operation: [ - 'get', - ], + resource: ['person'], + operation: ['get'], }, }, }, @@ -177,12 +158,8 @@ export const personFields: INodeProperties[] = [ description: 'Whether to return all results or only up to a given limit', displayOptions: { show: { - resource: [ - 'person', - ], - operation: [ - 'getAll', - ], + resource: ['person'], + operation: ['getAll'], }, }, }, @@ -198,15 +175,9 @@ export const personFields: INodeProperties[] = [ }, displayOptions: { show: { - resource: [ - 'person', - ], - operation: [ - 'getAll', - ], - returnAll: [ - false, - ], + resource: ['person'], + operation: ['getAll'], + returnAll: [false], }, }, }, @@ -224,12 +195,8 @@ export const personFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'person', - ], - operation: [ - 'update', - ], + resource: ['person'], + operation: ['update'], }, }, }, @@ -242,12 +209,8 @@ export const personFields: INodeProperties[] = [ default: {}, displayOptions: { show: { - resource: [ - 'person', - ], - operation: [ - 'update', - ], + resource: ['person'], + operation: ['update'], }, }, options: personAdditionalFieldsOptions, diff --git a/packages/nodes-base/nodes/ActionNetwork/descriptions/PersonTagDescription.ts b/packages/nodes-base/nodes/ActionNetwork/descriptions/PersonTagDescription.ts index 4c47e1b0587ca..e14555f01aace 100644 --- a/packages/nodes-base/nodes/ActionNetwork/descriptions/PersonTagDescription.ts +++ b/packages/nodes-base/nodes/ActionNetwork/descriptions/PersonTagDescription.ts @@ -1,6 +1,4 @@ -import { - INodeProperties, -} from 'n8n-workflow'; +import { INodeProperties } from 'n8n-workflow'; export const personTagOperations: INodeProperties[] = [ { @@ -10,9 +8,7 @@ export const personTagOperations: INodeProperties[] = [ noDataExpression: true, displayOptions: { show: { - resource: [ - 'personTag', - ], + resource: ['personTag'], }, }, options: [ @@ -38,7 +34,8 @@ export const personTagFields: INodeProperties[] = [ { displayName: 'Tag Name or ID', name: 'tagId', - description: 'ID of the tag to add. Choose from the list, or specify an ID using an expression.', + description: + 'ID of the tag to add. Choose from the list, or specify an ID using an expression.', type: 'options', typeOptions: { loadOptionsMethod: 'getTags', @@ -47,12 +44,8 @@ export const personTagFields: INodeProperties[] = [ default: [], displayOptions: { show: { - resource: [ - 'personTag', - ], - operation: [ - 'add', - ], + resource: ['personTag'], + operation: ['add'], }, }, }, @@ -65,12 +58,8 @@ export const personTagFields: INodeProperties[] = [ required: true, displayOptions: { show: { - resource: [ - 'personTag', - ], - operation: [ - 'add', - ], + resource: ['personTag'], + operation: ['add'], }, }, }, @@ -81,7 +70,8 @@ export const personTagFields: INodeProperties[] = [ { displayName: 'Tag Name or ID', name: 'tagId', - description: 'ID of the tag whose tagging to delete. Choose from the list, or specify an ID using an expression.', + description: + 'ID of the tag whose tagging to delete. Choose from the list, or specify an ID using an expression.', type: 'options', typeOptions: { loadOptionsMethod: 'getTags', @@ -90,36 +80,27 @@ export const personTagFields: INodeProperties[] = [ required: true, displayOptions: { show: { - resource: [ - 'personTag', - ], - operation: [ - 'remove', - ], + resource: ['personTag'], + operation: ['remove'], }, }, }, { displayName: 'Tagging Name or ID', name: 'taggingId', - description: 'ID of the tagging to remove. Choose from the list, or specify an ID using an expression.', + description: + 'ID of the tagging to remove. Choose from the list, or specify an ID using an expression.', type: 'options', typeOptions: { - loadOptionsDependsOn: [ - 'tagId', - ], + loadOptionsDependsOn: ['tagId'], loadOptionsMethod: 'getTaggings', }, required: true, default: [], displayOptions: { show: { - resource: [ - 'personTag', - ], - operation: [ - 'remove', - ], + resource: ['personTag'], + operation: ['remove'], }, }, }, diff --git a/packages/nodes-base/nodes/ActionNetwork/descriptions/PetitionDescription.ts b/packages/nodes-base/nodes/ActionNetwork/descriptions/PetitionDescription.ts index 9a83e21b554d2..463a4851808b5 100644 --- a/packages/nodes-base/nodes/ActionNetwork/descriptions/PetitionDescription.ts +++ b/packages/nodes-base/nodes/ActionNetwork/descriptions/PetitionDescription.ts @@ -1,11 +1,6 @@ -import { - INodeProperties, -} from 'n8n-workflow'; +import { INodeProperties } from 'n8n-workflow'; -import { - makeSimpleField, - petitionAdditionalFieldsOptions, -} from './SharedFields'; +import { makeSimpleField, petitionAdditionalFieldsOptions } from './SharedFields'; export const petitionOperations: INodeProperties[] = [ { @@ -15,9 +10,7 @@ export const petitionOperations: INodeProperties[] = [ noDataExpression: true, displayOptions: { show: { - resource: [ - 'petition', - ], + resource: ['petition'], }, }, options: [ @@ -59,12 +52,8 @@ export const petitionFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'petition', - ], - operation: [ - 'create', - ], + resource: ['petition'], + operation: ['create'], }, }, }, @@ -77,12 +66,8 @@ export const petitionFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'petition', - ], - operation: [ - 'create', - ], + resource: ['petition'], + operation: ['create'], }, }, }, @@ -95,12 +80,8 @@ export const petitionFields: INodeProperties[] = [ default: {}, displayOptions: { show: { - resource: [ - 'petition', - ], - operation: [ - 'create', - ], + resource: ['petition'], + operation: ['create'], }, }, options: petitionAdditionalFieldsOptions, @@ -118,12 +99,8 @@ export const petitionFields: INodeProperties[] = [ required: true, displayOptions: { show: { - resource: [ - 'petition', - ], - operation: [ - 'get', - ], + resource: ['petition'], + operation: ['get'], }, }, }, @@ -140,12 +117,8 @@ export const petitionFields: INodeProperties[] = [ description: 'Whether to return all results or only up to a given limit', displayOptions: { show: { - resource: [ - 'petition', - ], - operation: [ - 'getAll', - ], + resource: ['petition'], + operation: ['getAll'], }, }, }, @@ -160,15 +133,9 @@ export const petitionFields: INodeProperties[] = [ }, displayOptions: { show: { - resource: [ - 'petition', - ], - operation: [ - 'getAll', - ], - returnAll: [ - false, - ], + resource: ['petition'], + operation: ['getAll'], + returnAll: [false], }, }, }, @@ -186,12 +153,8 @@ export const petitionFields: INodeProperties[] = [ required: true, displayOptions: { show: { - resource: [ - 'petition', - ], - operation: [ - 'update', - ], + resource: ['petition'], + operation: ['update'], }, }, }, @@ -204,12 +167,8 @@ export const petitionFields: INodeProperties[] = [ default: {}, displayOptions: { show: { - resource: [ - 'petition', - ], - operation: [ - 'update', - ], + resource: ['petition'], + operation: ['update'], }, }, options: petitionAdditionalFieldsOptions, diff --git a/packages/nodes-base/nodes/ActionNetwork/descriptions/SharedFields.ts b/packages/nodes-base/nodes/ActionNetwork/descriptions/SharedFields.ts index bb177112944d1..99e6995b011e3 100644 --- a/packages/nodes-base/nodes/ActionNetwork/descriptions/SharedFields.ts +++ b/packages/nodes-base/nodes/ActionNetwork/descriptions/SharedFields.ts @@ -1,11 +1,6 @@ -import { - INodeProperties, -} from 'n8n-workflow'; +import { INodeProperties } from 'n8n-workflow'; -import { - Operation, - Resource, -} from '../types'; +import { Operation, Resource } from '../types'; export const languageOptions: INodeProperties['options'] = [ { @@ -80,21 +75,22 @@ const postalAddressesFields: INodeProperties[] = [ name: 'primary', type: 'boolean', default: false, - description: 'Whether this is the person\'s primary address', + description: "Whether this is the person's primary address", }, { displayName: 'Address Line', name: 'address_lines', type: 'string', // The Action Network API expects a string array but ignores any string beyond the first, so this input field is simplified to string. default: '', - description: 'Line for a person\'s address', + description: "Line for a person's address", }, { displayName: 'Locality', name: 'locality', type: 'string', default: '', - description: 'City or other local administrative area. If blank, this will be filled in based on Action Network\'s geocoding.', + description: + "City or other local administrative area. If blank, this will be filled in based on Action Network's geocoding.", }, { displayName: 'Region', @@ -188,7 +184,7 @@ export const eventAdditionalFieldsOptions: INodeProperties['options'] = [ name: 'instructions', type: 'string', default: '', - description: 'Event\'s instructions for activists, visible after they RSVP. HTML supported.', + description: "Event's instructions for activists, visible after they RSVP. HTML supported.", }, { displayName: 'Location', @@ -265,14 +261,14 @@ export const personAdditionalFieldsOptions: INodeProperties['options'] = [ name: 'number', type: 'string', default: '', - description: 'Person\'s mobile number, in international format without the plus sign', + description: "Person's mobile number, in international format without the plus sign", }, { displayName: 'Primary', name: 'primary', type: 'hidden', default: true, - description: 'Whether this is the person\'s primary phone number', + description: "Whether this is the person's primary phone number", }, { displayName: 'Status', @@ -367,12 +363,8 @@ export const makeSimpleField = (resource: Resource, operation: Operation): INode type: 'boolean', displayOptions: { show: { - resource: [ - resource, - ], - operation: [ - operation, - ], + resource: [resource], + operation: [operation], }, }, default: true, diff --git a/packages/nodes-base/nodes/ActionNetwork/descriptions/SignatureDescription.ts b/packages/nodes-base/nodes/ActionNetwork/descriptions/SignatureDescription.ts index ba8414365820c..f86d867c5fcee 100644 --- a/packages/nodes-base/nodes/ActionNetwork/descriptions/SignatureDescription.ts +++ b/packages/nodes-base/nodes/ActionNetwork/descriptions/SignatureDescription.ts @@ -1,10 +1,6 @@ -import { - INodeProperties, -} from 'n8n-workflow'; +import { INodeProperties } from 'n8n-workflow'; -import { - makeSimpleField, -} from './SharedFields'; +import { makeSimpleField } from './SharedFields'; export const signatureOperations: INodeProperties[] = [ { @@ -14,9 +10,7 @@ export const signatureOperations: INodeProperties[] = [ noDataExpression: true, displayOptions: { show: { - resource: [ - 'signature', - ], + resource: ['signature'], }, }, options: [ @@ -58,12 +52,8 @@ export const signatureFields: INodeProperties[] = [ required: true, displayOptions: { show: { - resource: [ - 'signature', - ], - operation: [ - 'create', - ], + resource: ['signature'], + operation: ['create'], }, }, }, @@ -76,12 +66,8 @@ export const signatureFields: INodeProperties[] = [ required: true, displayOptions: { show: { - resource: [ - 'signature', - ], - operation: [ - 'create', - ], + resource: ['signature'], + operation: ['create'], }, }, }, @@ -94,12 +80,8 @@ export const signatureFields: INodeProperties[] = [ default: {}, displayOptions: { show: { - resource: [ - 'signature', - ], - operation: [ - 'create', - ], + resource: ['signature'], + operation: ['create'], }, }, options: [ @@ -125,12 +107,8 @@ export const signatureFields: INodeProperties[] = [ required: true, displayOptions: { show: { - resource: [ - 'signature', - ], - operation: [ - 'get', - ], + resource: ['signature'], + operation: ['get'], }, }, }, @@ -143,12 +121,8 @@ export const signatureFields: INodeProperties[] = [ required: true, displayOptions: { show: { - resource: [ - 'signature', - ], - operation: [ - 'get', - ], + resource: ['signature'], + operation: ['get'], }, }, }, @@ -166,12 +140,8 @@ export const signatureFields: INodeProperties[] = [ required: true, displayOptions: { show: { - resource: [ - 'signature', - ], - operation: [ - 'getAll', - ], + resource: ['signature'], + operation: ['getAll'], }, }, }, @@ -183,12 +153,8 @@ export const signatureFields: INodeProperties[] = [ description: 'Whether to return all results or only up to a given limit', displayOptions: { show: { - resource: [ - 'signature', - ], - operation: [ - 'getAll', - ], + resource: ['signature'], + operation: ['getAll'], }, }, }, @@ -203,15 +169,9 @@ export const signatureFields: INodeProperties[] = [ }, displayOptions: { show: { - resource: [ - 'signature', - ], - operation: [ - 'getAll', - ], - returnAll: [ - false, - ], + resource: ['signature'], + operation: ['getAll'], + returnAll: [false], }, }, }, @@ -229,12 +189,8 @@ export const signatureFields: INodeProperties[] = [ required: true, displayOptions: { show: { - resource: [ - 'signature', - ], - operation: [ - 'update', - ], + resource: ['signature'], + operation: ['update'], }, }, }, @@ -247,12 +203,8 @@ export const signatureFields: INodeProperties[] = [ required: true, displayOptions: { show: { - resource: [ - 'signature', - ], - operation: [ - 'update', - ], + resource: ['signature'], + operation: ['update'], }, }, }, @@ -265,12 +217,8 @@ export const signatureFields: INodeProperties[] = [ default: {}, displayOptions: { show: { - resource: [ - 'signature', - ], - operation: [ - 'update', - ], + resource: ['signature'], + operation: ['update'], }, }, options: [ diff --git a/packages/nodes-base/nodes/ActionNetwork/descriptions/TagDescription.ts b/packages/nodes-base/nodes/ActionNetwork/descriptions/TagDescription.ts index 8da632c7ab331..cc50219116a4c 100644 --- a/packages/nodes-base/nodes/ActionNetwork/descriptions/TagDescription.ts +++ b/packages/nodes-base/nodes/ActionNetwork/descriptions/TagDescription.ts @@ -1,10 +1,6 @@ -import { - INodeProperties, -} from 'n8n-workflow'; +import { INodeProperties } from 'n8n-workflow'; -import { - makeSimpleField, -} from './SharedFields'; +import { makeSimpleField } from './SharedFields'; export const tagOperations: INodeProperties[] = [ { @@ -14,9 +10,7 @@ export const tagOperations: INodeProperties[] = [ noDataExpression: true, displayOptions: { show: { - resource: [ - 'tag', - ], + resource: ['tag'], }, }, options: [ @@ -53,12 +47,8 @@ export const tagFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'tag', - ], - operation: [ - 'create', - ], + resource: ['tag'], + operation: ['create'], }, }, }, @@ -76,12 +66,8 @@ export const tagFields: INodeProperties[] = [ required: true, displayOptions: { show: { - resource: [ - 'tag', - ], - operation: [ - 'get', - ], + resource: ['tag'], + operation: ['get'], }, }, }, @@ -98,12 +84,8 @@ export const tagFields: INodeProperties[] = [ description: 'Whether to return all results or only up to a given limit', displayOptions: { show: { - resource: [ - 'tag', - ], - operation: [ - 'getAll', - ], + resource: ['tag'], + operation: ['getAll'], }, }, }, @@ -118,15 +100,9 @@ export const tagFields: INodeProperties[] = [ }, displayOptions: { show: { - resource: [ - 'tag', - ], - operation: [ - 'getAll', - ], - returnAll: [ - false, - ], + resource: ['tag'], + operation: ['getAll'], + returnAll: [false], }, }, }, diff --git a/packages/nodes-base/nodes/Aws/Comprehend/AwsComprehend.node.ts b/packages/nodes-base/nodes/Aws/Comprehend/AwsComprehend.node.ts index f8e5d1c721004..97bc35de7f8ac 100644 --- a/packages/nodes-base/nodes/Aws/Comprehend/AwsComprehend.node.ts +++ b/packages/nodes-base/nodes/Aws/Comprehend/AwsComprehend.node.ts @@ -1,17 +1,8 @@ -import { - IExecuteFunctions, -} from 'n8n-core'; +import { IExecuteFunctions } from 'n8n-core'; -import { - IDataObject, - INodeExecutionData, - INodeType, - INodeTypeDescription, -} from 'n8n-workflow'; +import { IDataObject, INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow'; -import { - awsApiRequestREST, -} from './GenericFunctions'; +import { awsApiRequestREST } from './GenericFunctions'; export class AwsComprehend implements INodeType { description: INodeTypeDescription = { @@ -132,13 +123,8 @@ export class AwsComprehend implements INodeType { default: 'en', displayOptions: { show: { - resource: [ - 'text', - ], - operation: [ - 'detectSentiment', - 'detectEntities', - ], + resource: ['text'], + operation: ['detectSentiment', 'detectEntities'], }, }, description: 'The language code for text', @@ -153,9 +139,7 @@ export class AwsComprehend implements INodeType { default: '', displayOptions: { show: { - resource: [ - 'text', - ], + resource: ['text'], }, }, description: 'The text to send', @@ -166,16 +150,13 @@ export class AwsComprehend implements INodeType { type: 'boolean', displayOptions: { show: { - resource: [ - 'text', - ], - operation: [ - 'detectDominantLanguage', - ], + resource: ['text'], + operation: ['detectDominantLanguage'], }, }, default: true, - description: 'Whether to return a simplified version of the response instead of the raw data', + description: + 'Whether to return a simplified version of the response instead of the raw data', }, { displayName: 'Additional Fields', @@ -184,12 +165,8 @@ export class AwsComprehend implements INodeType { placeholder: 'Add Field', displayOptions: { show: { - resource: [ - 'text', - ], - operation: [ - 'detectEntities', - ], + resource: ['text'], + operation: ['detectEntities'], }, }, default: {}, @@ -202,7 +179,8 @@ export class AwsComprehend implements INodeType { alwaysOpenEditWindow: true, }, default: '', - description: 'The Amazon Resource Name of an endpoint that is associated with a custom entity recognition model', + description: + 'The Amazon Resource Name of an endpoint that is associated with a custom entity recognition model', }, ], }, @@ -227,13 +205,23 @@ export class AwsComprehend implements INodeType { Text: text, }; const action = 'Comprehend_20171127.DetectDominantLanguage'; - responseData = await awsApiRequestREST.call(this, 'comprehend', 'POST', '', JSON.stringify(body), { 'x-amz-target': action, 'Content-Type': 'application/x-amz-json-1.1' }); + responseData = await awsApiRequestREST.call( + this, + 'comprehend', + 'POST', + '', + JSON.stringify(body), + { 'x-amz-target': action, 'Content-Type': 'application/x-amz-json-1.1' }, + ); if (simple === true) { - responseData = responseData.Languages.reduce((accumulator: { [key: string]: number }, currentValue: IDataObject) => { - accumulator[currentValue.LanguageCode as string] = currentValue.Score as number; - return accumulator; - }, {}); + responseData = responseData.Languages.reduce( + (accumulator: { [key: string]: number }, currentValue: IDataObject) => { + accumulator[currentValue.LanguageCode as string] = currentValue.Score as number; + return accumulator; + }, + {}, + ); } } @@ -246,7 +234,14 @@ export class AwsComprehend implements INodeType { Text: text, LanguageCode: languageCode, }; - responseData = await awsApiRequestREST.call(this, 'comprehend', 'POST', '', JSON.stringify(body), { 'x-amz-target': action, 'Content-Type': 'application/x-amz-json-1.1' }); + responseData = await awsApiRequestREST.call( + this, + 'comprehend', + 'POST', + '', + JSON.stringify(body), + { 'x-amz-target': action, 'Content-Type': 'application/x-amz-json-1.1' }, + ); } //https://docs.aws.amazon.com/comprehend/latest/dg/API_DetectEntities.html @@ -265,7 +260,14 @@ export class AwsComprehend implements INodeType { body.EndpointArn = additionalFields.endpointArn; } - responseData = await awsApiRequestREST.call(this, 'comprehend', 'POST', '', JSON.stringify(body), { 'x-amz-target': action, 'Content-Type': 'application/x-amz-json-1.1' }); + responseData = await awsApiRequestREST.call( + this, + 'comprehend', + 'POST', + '', + JSON.stringify(body), + { 'x-amz-target': action, 'Content-Type': 'application/x-amz-json-1.1' }, + ); responseData = responseData.Entities; } } diff --git a/packages/nodes-base/nodes/Aws/Comprehend/GenericFunctions.ts b/packages/nodes-base/nodes/Aws/Comprehend/GenericFunctions.ts index 7c326694709b8..0bae9e9cd0dc9 100644 --- a/packages/nodes-base/nodes/Aws/Comprehend/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Aws/Comprehend/GenericFunctions.ts @@ -1,19 +1,10 @@ -import { - URL, -} from 'url'; +import { URL } from 'url'; -import { - Request, - sign, -} from 'aws4'; +import { Request, sign } from 'aws4'; -import { - OptionsWithUri, -} from 'request'; +import { OptionsWithUri } from 'request'; -import { - parseString, -} from 'xml2js'; +import { parseString } from 'xml2js'; import { IExecuteFunctions, @@ -22,11 +13,12 @@ import { IWebhookFunctions, } from 'n8n-core'; -import { - ICredentialDataDecryptedObject, NodeApiError, NodeOperationError, -} from 'n8n-workflow'; +import { ICredentialDataDecryptedObject, NodeApiError, NodeOperationError } from 'n8n-workflow'; -function getEndpointForService(service: string, credentials: ICredentialDataDecryptedObject): string { +function getEndpointForService( + service: string, + credentials: ICredentialDataDecryptedObject, +): string { let endpoint; if (service === 'lambda' && credentials.lambdaEndpoint) { endpoint = credentials.lambdaEndpoint; @@ -38,7 +30,15 @@ function getEndpointForService(service: string, credentials: ICredentialDataDecr return (endpoint as string).replace('{region}', credentials.region as string); } -export async function awsApiRequest(this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions | IWebhookFunctions, service: string, method: string, path: string, body?: string, headers?: object): Promise { // tslint:disable-line:no-any +export async function awsApiRequest( + this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions | IWebhookFunctions, + service: string, + method: string, + path: string, + body?: string, + headers?: object, + // tslint:disable-next-line:no-any +): Promise { const credentials = await this.getCredentials('aws'); // Concatenate path and instantiate URL object so it parses correctly query strings @@ -49,7 +49,9 @@ export async function awsApiRequest(this: IHookFunctions | IExecuteFunctions | I const securityHeaders = { accessKeyId: `${credentials.accessKeyId}`.trim(), secretAccessKey: `${credentials.secretAccessKey}`.trim(), - sessionToken: credentials.temporaryCredentials ? `${credentials.sessionToken}`.trim() : undefined, + sessionToken: credentials.temporaryCredentials + ? `${credentials.sessionToken}`.trim() + : undefined, }; sign(signOpts, securityHeaders); @@ -68,7 +70,15 @@ export async function awsApiRequest(this: IHookFunctions | IExecuteFunctions | I } } -export async function awsApiRequestREST(this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions, service: string, method: string, path: string, body?: string, headers?: object): Promise { // tslint:disable-line:no-any +export async function awsApiRequestREST( + this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions, + service: string, + method: string, + path: string, + body?: string, + headers?: object, + // tslint:disable-next-line:no-any +): Promise { const response = await awsApiRequest.call(this, service, method, path, body, headers); try { return JSON.parse(response); @@ -77,7 +87,15 @@ export async function awsApiRequestREST(this: IHookFunctions | IExecuteFunctions } } -export async function awsApiRequestSOAP(this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions | IWebhookFunctions, service: string, method: string, path: string, body?: string, headers?: object): Promise { // tslint:disable-line:no-any +export async function awsApiRequestSOAP( + this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions | IWebhookFunctions, + service: string, + method: string, + path: string, + body?: string, + headers?: object, + // tslint:disable-next-line:no-any +): Promise { const response = await awsApiRequest.call(this, service, method, path, body, headers); try { return await new Promise((resolve, reject) => { diff --git a/packages/nodes-base/nodes/Aws/DynamoDB/AwsDynamoDB.node.ts b/packages/nodes-base/nodes/Aws/DynamoDB/AwsDynamoDB.node.ts index 88a9ac8f2f404..65ccd619c6471 100644 --- a/packages/nodes-base/nodes/Aws/DynamoDB/AwsDynamoDB.node.ts +++ b/packages/nodes-base/nodes/Aws/DynamoDB/AwsDynamoDB.node.ts @@ -1,7 +1,5 @@ /* eslint-disable n8n-nodes-base/node-filename-against-convention */ -import { - IExecuteFunctions, -} from 'n8n-core'; +import { IExecuteFunctions } from 'n8n-core'; import { IDataObject, @@ -12,15 +10,9 @@ import { NodeParameterValue, } from 'n8n-workflow'; -import { - awsApiRequest, - awsApiRequestAllItems, -} from './GenericFunctions'; +import { awsApiRequest, awsApiRequestAllItems } from './GenericFunctions'; -import { - itemFields, - itemOperations, -} from './ItemDescription'; +import { itemFields, itemOperations } from './ItemDescription'; import { FieldsUiValues, @@ -102,22 +94,30 @@ export class AwsDynamoDB implements INodeType { const returnData: IDataObject[] = []; for (let i = 0; i < items.length; i++) { - try { - if (resource === 'item') { - if (operation === 'upsert') { - // ---------------------------------- // upsert // ---------------------------------- // https://docs.aws.amazon.com/amazondynamodb/latest/APIReference/API_PutItem.html - const eavUi = this.getNodeParameter('additionalFields.eavUi.eavValues', i, []) as IAttributeValueUi[]; - const conditionExpession = this.getNodeParameter('conditionExpression', i, '') as string; - const eanUi = this.getNodeParameter('additionalFields.eanUi.eanValues', i, []) as IAttributeNameUi[]; + const eavUi = this.getNodeParameter( + 'additionalFields.eavUi.eavValues', + i, + [], + ) as IAttributeValueUi[]; + const conditionExpession = this.getNodeParameter( + 'conditionExpression', + i, + '', + ) as string; + const eanUi = this.getNodeParameter( + 'additionalFields.eanUi.eanValues', + i, + [], + ) as IAttributeNameUi[]; const body: IRequestBody = { TableName: this.getNodeParameter('tableName', i) as string, @@ -139,14 +139,15 @@ export class AwsDynamoDB implements INodeType { body.ConditionExpression = conditionExpession; } - const dataToSend = this.getNodeParameter('dataToSend', 0) as 'defineBelow' | 'autoMapInputData'; + const dataToSend = this.getNodeParameter('dataToSend', 0) as + | 'defineBelow' + | 'autoMapInputData'; const item: { [key: string]: string } = {}; if (dataToSend === 'autoMapInputData') { - const incomingKeys = Object.keys(items[i].json); const rawInputsToIgnore = this.getNodeParameter('inputsToIgnore', i) as string; - const inputsToIgnore = rawInputsToIgnore.split(',').map(c => c.trim()); + const inputsToIgnore = rawInputsToIgnore.split(',').map((c) => c.trim()); for (const key of incomingKeys) { if (inputsToIgnore.includes(key)) continue; @@ -154,13 +155,10 @@ export class AwsDynamoDB implements INodeType { } body.Item = adjustPutItem(item as PutItemUi); - } else { - const fields = this.getNodeParameter('fieldsUi.fieldValues', i, []) as FieldsUiValues; - fields.forEach(({ fieldId, fieldValue }) => item[fieldId] = fieldValue); + fields.forEach(({ fieldId, fieldValue }) => (item[fieldId] = fieldValue)); body.Item = adjustPutItem(item as PutItemUi); - } const headers = { @@ -170,9 +168,7 @@ export class AwsDynamoDB implements INodeType { responseData = await awsApiRequest.call(this, 'dynamodb', 'POST', '/', body, headers); responseData = item; - } else if (operation === 'delete') { - // ---------------------------------- // delete // ---------------------------------- @@ -186,12 +182,22 @@ export class AwsDynamoDB implements INodeType { ReturnValues: this.getNodeParameter('returnValues', 0) as string, }; - const eavUi = this.getNodeParameter('additionalFields.eavUi.eavValues', i, []) as IAttributeValueUi[]; - const eanUi = this.getNodeParameter('additionalFields.eanUi.eanValues', i, []) as IAttributeNameUi[]; + const eavUi = this.getNodeParameter( + 'additionalFields.eavUi.eavValues', + i, + [], + ) as IAttributeValueUi[]; + const eanUi = this.getNodeParameter( + 'additionalFields.eanUi.eanValues', + i, + [], + ) as IAttributeNameUi[]; const additionalFields = this.getNodeParameter('additionalFields', i) as IDataObject; const simple = this.getNodeParameter('simple', 0, false) as boolean; - const items = this.getNodeParameter('keysUi.keyValues', i, []) as [{ key: string, type: string, value: string }]; + const items = this.getNodeParameter('keysUi.keyValues', i, []) as [ + { key: string; type: string; value: string }, + ]; for (const item of items) { let value = item.value as NodeParameterValue; @@ -229,9 +235,7 @@ export class AwsDynamoDB implements INodeType { } else if (simple === true) { responseData = decodeItem(responseData.Attributes); } - } else if (operation === 'get') { - // ---------------------------------- // get // ---------------------------------- @@ -242,7 +246,11 @@ export class AwsDynamoDB implements INodeType { const simple = this.getNodeParameter('simple', 0, false) as boolean; const select = this.getNodeParameter('select', 0) as string; const additionalFields = this.getNodeParameter('additionalFields', i) as IDataObject; - const eanUi = this.getNodeParameter('additionalFields.eanUi.eanValues', i, []) as IAttributeNameUi[]; + const eanUi = this.getNodeParameter( + 'additionalFields.eanUi.eanValues', + i, + [], + ) as IAttributeNameUi[]; // tslint:disable-next-line: no-any const body: { [key: string]: any } = { @@ -289,9 +297,7 @@ export class AwsDynamoDB implements INodeType { if (simple && responseData) { responseData = decodeItem(responseData); } - } else if (operation === 'getAll') { - // ---------------------------------- // getAll // ---------------------------------- @@ -303,7 +309,11 @@ export class AwsDynamoDB implements INodeType { const select = this.getNodeParameter('select', 0) as string; const returnAll = this.getNodeParameter('returnAll', 0) as boolean; const scan = this.getNodeParameter('scan', 0) as boolean; - const eanUi = this.getNodeParameter('options.eanUi.eanValues', i, []) as IAttributeNameUi[]; + const eanUi = this.getNodeParameter( + 'options.eanUi.eanValues', + i, + [], + ) as IAttributeNameUi[]; const body: IRequestBody = { TableName: this.getNodeParameter('tableName', i) as string, @@ -315,14 +325,16 @@ export class AwsDynamoDB implements INodeType { body['FilterExpression'] = filterExpression; } } else { - body['KeyConditionExpression'] = this.getNodeParameter('keyConditionExpression', i) as string; + body['KeyConditionExpression'] = this.getNodeParameter( + 'keyConditionExpression', + i, + ) as string; } - const { - indexName, - projectionExpression, - filterExpression, - } = this.getNodeParameter('options', i) as { + const { indexName, projectionExpression, filterExpression } = this.getNodeParameter( + 'options', + i, + ) as { indexName: string; projectionExpression: string; filterExpression: string; @@ -358,11 +370,18 @@ export class AwsDynamoDB implements INodeType { const headers = { 'Content-Type': 'application/json', - 'X-Amz-Target': (scan) ? 'DynamoDB_20120810.Scan' : 'DynamoDB_20120810.Query', + 'X-Amz-Target': scan ? 'DynamoDB_20120810.Scan' : 'DynamoDB_20120810.Query', }; if (returnAll === true && select !== 'COUNT') { - responseData = await awsApiRequestAllItems.call(this, 'dynamodb', 'POST', '/', body, headers); + responseData = await awsApiRequestAllItems.call( + this, + 'dynamodb', + 'POST', + '/', + body, + headers, + ); } else { body.Limit = this.getNodeParameter('limit', 0, 1) as number; responseData = await awsApiRequest.call(this, 'dynamodb', 'POST', '/', body, headers); @@ -373,14 +392,12 @@ export class AwsDynamoDB implements INodeType { if (simple === true) { responseData = responseData.map(simplify); } - } Array.isArray(responseData) ? returnData.push(...responseData) : returnData.push(responseData); } - } catch (error) { if (this.continueOnFail()) { returnData.push({ error: error.message }); diff --git a/packages/nodes-base/nodes/Aws/DynamoDB/GenericFunctions.ts b/packages/nodes-base/nodes/Aws/DynamoDB/GenericFunctions.ts index c55fcfc6a1630..e3657c9505775 100644 --- a/packages/nodes-base/nodes/Aws/DynamoDB/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Aws/DynamoDB/GenericFunctions.ts @@ -1,10 +1,6 @@ -import { - URL, -} from 'url'; +import { URL } from 'url'; -import { - sign, -} from 'aws4'; +import { sign } from 'aws4'; import { IExecuteFunctions, @@ -13,17 +9,14 @@ import { IWebhookFunctions, } from 'n8n-core'; -import { - ICredentialDataDecryptedObject, - IDataObject, - INodeExecutionData, -} from 'n8n-workflow'; +import { ICredentialDataDecryptedObject, IDataObject, INodeExecutionData } from 'n8n-workflow'; -import { - IRequestBody, -} from './types'; +import { IRequestBody } from './types'; -function getEndpointForService(service: string, credentials: ICredentialDataDecryptedObject): string { +function getEndpointForService( + service: string, + credentials: ICredentialDataDecryptedObject, +): string { let endpoint; if (service === 'lambda' && credentials.lambdaEndpoint) { endpoint = credentials.lambdaEndpoint; @@ -35,7 +28,15 @@ function getEndpointForService(service: string, credentials: ICredentialDataDecr return (endpoint as string).replace('{region}', credentials.region as string); } -export async function awsApiRequest(this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions | IWebhookFunctions, service: string, method: string, path: string, body?: object | IRequestBody, headers?: object): Promise { // tslint:disable-line:no-any +export async function awsApiRequest( + this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions | IWebhookFunctions, + service: string, + method: string, + path: string, + body?: object | IRequestBody, + headers?: object, + // tslint:disable-next-line:no-any +): Promise { const credentials = await this.getCredentials('aws'); // Concatenate path and instantiate URL object so it parses correctly query strings @@ -43,18 +44,23 @@ export async function awsApiRequest(this: IHookFunctions | IExecuteFunctions | I const securityHeaders = { accessKeyId: `${credentials.accessKeyId}`.trim(), secretAccessKey: `${credentials.secretAccessKey}`.trim(), - sessionToken: credentials.temporaryCredentials ? `${credentials.sessionToken}`.trim() : undefined, + sessionToken: credentials.temporaryCredentials + ? `${credentials.sessionToken}`.trim() + : undefined, }; - const options = sign({ - // @ts-ignore - uri: endpoint, - service, - region: credentials.region as string, - method, - path: '/', - headers: { ...headers }, - body: JSON.stringify(body), - }, securityHeaders); + const options = sign( + { + // @ts-ignore + uri: endpoint, + service, + region: credentials.region as string, + method, + path: '/', + headers: { ...headers }, + body: JSON.stringify(body), + }, + securityHeaders, + ); try { return JSON.parse(await this.helpers.request!(options)); @@ -66,7 +72,11 @@ export async function awsApiRequest(this: IHookFunctions | IExecuteFunctions | I if (error.statusCode === 403) { if (errorMessage === 'The security token included in the request is invalid.') { throw new Error('The AWS credentials are not valid!'); - } else if (errorMessage.startsWith('The request signature we calculated does not match the signature you provided')) { + } else if ( + errorMessage.startsWith( + 'The request signature we calculated does not match the signature you provided', + ) + ) { throw new Error('The AWS credentials are not valid!'); } } @@ -75,9 +85,15 @@ export async function awsApiRequest(this: IHookFunctions | IExecuteFunctions | I } } - -export async function awsApiRequestAllItems(this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions | IWebhookFunctions, service: string, method: string, path: string, body?: IRequestBody, headers?: object): Promise { // tslint:disable-line:no-any - +export async function awsApiRequestAllItems( + this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions | IWebhookFunctions, + service: string, + method: string, + path: string, + body?: IRequestBody, + headers?: object, + // tslint:disable-next-line:no-any +): Promise { const returnData: IDataObject[] = []; let responseData; @@ -88,9 +104,7 @@ export async function awsApiRequestAllItems(this: IHookFunctions | IExecuteFunct body!.ExclusiveStartKey = responseData.LastEvaluatedKey; } returnData.push(...responseData.Items); - } while ( - responseData.LastEvaluatedKey !== undefined - ); + } while (responseData.LastEvaluatedKey !== undefined); return returnData; } diff --git a/packages/nodes-base/nodes/Aws/DynamoDB/ItemDescription.ts b/packages/nodes-base/nodes/Aws/DynamoDB/ItemDescription.ts index b18eb16f6d719..e9305372d0ad5 100644 --- a/packages/nodes-base/nodes/Aws/DynamoDB/ItemDescription.ts +++ b/packages/nodes-base/nodes/Aws/DynamoDB/ItemDescription.ts @@ -1,6 +1,4 @@ -import { - INodeProperties, -} from 'n8n-workflow'; +import { INodeProperties } from 'n8n-workflow'; export const itemOperations: INodeProperties[] = [ { @@ -10,9 +8,7 @@ export const itemOperations: INodeProperties[] = [ noDataExpression: true, displayOptions: { show: { - resource: [ - 'item', - ], + resource: ['item'], }, }, options: [ @@ -52,14 +48,13 @@ export const itemFields: INodeProperties[] = [ { displayName: 'Table Name or ID', name: 'tableName', - description: 'Table to operate on. Choose from the list, or specify an ID using an expression.', + description: + 'Table to operate on. Choose from the list, or specify an ID using an expression.', type: 'options', required: true, displayOptions: { show: { - resource: [ - 'item', - ], + resource: ['item'], }, }, default: [], @@ -89,9 +84,7 @@ export const itemFields: INodeProperties[] = [ ], displayOptions: { show: { - operation: [ - 'upsert', - ], + operation: ['upsert'], }, }, default: 'defineBelow', @@ -103,16 +96,13 @@ export const itemFields: INodeProperties[] = [ type: 'string', displayOptions: { show: { - operation: [ - 'upsert', - ], - dataToSend: [ - 'autoMapInputData', - ], + operation: ['upsert'], + dataToSend: ['autoMapInputData'], }, }, default: '', - description: 'List of input properties to avoid sending, separated by commas. Leave empty to send all properties.', + description: + 'List of input properties to avoid sending, separated by commas. Leave empty to send all properties.', placeholder: 'Enter properties...', }, { @@ -126,12 +116,8 @@ export const itemFields: INodeProperties[] = [ }, displayOptions: { show: { - operation: [ - 'upsert', - ], - dataToSend: [ - 'defineBelow', - ], + operation: ['upsert'], + dataToSend: ['defineBelow'], }, }, default: {}, @@ -164,19 +150,16 @@ export const itemFields: INodeProperties[] = [ default: {}, displayOptions: { show: { - resource: [ - 'item', - ], - operation: [ - 'upsert', - ], + resource: ['item'], + operation: ['upsert'], }, }, options: [ { displayName: 'Expression Attribute Values', name: 'eavUi', - description: 'Substitution tokens for attribute names in an expression. Only needed when the parameter "condition expression" is set.', + description: + 'Substitution tokens for attribute names in an expression. Only needed when the parameter "condition expression" is set.', placeholder: 'Add Attribute Value', type: 'fixedCollection', default: {}, @@ -227,7 +210,8 @@ export const itemFields: INodeProperties[] = [ name: 'conditionExpression', type: 'string', default: '', - description: 'A condition that must be satisfied in order for a conditional upsert to succeed. View details.', + description: + 'A condition that must be satisfied in order for a conditional upsert to succeed. View details.', }, { displayName: 'Expression Attribute Names', @@ -258,7 +242,8 @@ export const itemFields: INodeProperties[] = [ ], }, ], - description: 'One or more substitution tokens for attribute names in an expression. View details.', + description: + 'One or more substitution tokens for attribute names in an expression. View details.', }, ], }, @@ -272,12 +257,8 @@ export const itemFields: INodeProperties[] = [ type: 'options', displayOptions: { show: { - resource: [ - 'item', - ], - operation: [ - 'delete', - ], + resource: ['item'], + operation: ['delete'], }, }, options: [ @@ -293,7 +274,8 @@ export const itemFields: INodeProperties[] = [ }, ], default: 'NONE', - description: 'Use ReturnValues if you want to get the item attributes as they appeared before they were deleted', + description: + 'Use ReturnValues if you want to get the item attributes as they appeared before they were deleted', }, { displayName: 'Keys', @@ -306,12 +288,8 @@ export const itemFields: INodeProperties[] = [ }, displayOptions: { show: { - resource: [ - 'item', - ], - operation: [ - 'delete', - ], + resource: ['item'], + operation: ['delete'], }, }, options: [ @@ -354,7 +332,8 @@ export const itemFields: INodeProperties[] = [ ], }, ], - description: 'Item\'s primary key. For example, with a simple primary key, you only need to provide a value for the partition key. For a composite primary key, you must provide values for both the partition key and the sort key.', + description: + "Item's primary key. For example, with a simple primary key, you only need to provide a value for the partition key. For a composite primary key, you must provide values for both the partition key and the sort key.", }, { displayName: 'Simplify', @@ -362,15 +341,9 @@ export const itemFields: INodeProperties[] = [ type: 'boolean', displayOptions: { show: { - resource: [ - 'item', - ], - operation: [ - 'delete', - ], - returnValues: [ - 'ALL_OLD', - ], + resource: ['item'], + operation: ['delete'], + returnValues: ['ALL_OLD'], }, }, default: true, @@ -384,12 +357,8 @@ export const itemFields: INodeProperties[] = [ default: {}, displayOptions: { show: { - resource: [ - 'item', - ], - operation: [ - 'delete', - ], + resource: ['item'], + operation: ['delete'], }, }, options: [ @@ -398,7 +367,8 @@ export const itemFields: INodeProperties[] = [ name: 'conditionExpression', type: 'string', default: '', - description: 'A condition that must be satisfied in order for a conditional delete to succeed', + description: + 'A condition that must be satisfied in order for a conditional delete to succeed', }, { displayName: 'Expression Attribute Names', @@ -429,12 +399,14 @@ export const itemFields: INodeProperties[] = [ ], }, ], - description: 'One or more substitution tokens for attribute names in an expression. Check Info.', + description: + 'One or more substitution tokens for attribute names in an expression. Check Info.', }, { displayName: 'Expression Attribute Values', name: 'expressionAttributeUi', - description: 'Substitution tokens for attribute names in an expression. Only needed when the parameter "condition expression" is set.', + description: + 'Substitution tokens for attribute names in an expression. Only needed when the parameter "condition expression" is set.', placeholder: 'Add Attribute Value', type: 'fixedCollection', default: {}, @@ -492,12 +464,8 @@ export const itemFields: INodeProperties[] = [ type: 'options', displayOptions: { show: { - resource: [ - 'item', - ], - operation: [ - 'get', - ], + resource: ['item'], + operation: ['get'], }, }, options: [ @@ -523,16 +491,9 @@ export const itemFields: INodeProperties[] = [ type: 'boolean', displayOptions: { show: { - resource: [ - 'item', - ], - operation: [ - 'get', - ], - select: [ - 'ALL_PROJECTED_ATTRIBUTES', - 'ALL_ATTRIBUTES', - ], + resource: ['item'], + operation: ['get'], + select: ['ALL_PROJECTED_ATTRIBUTES', 'ALL_ATTRIBUTES'], }, }, default: true, @@ -549,12 +510,8 @@ export const itemFields: INodeProperties[] = [ }, displayOptions: { show: { - resource: [ - 'item', - ], - operation: [ - 'get', - ], + resource: ['item'], + operation: ['get'], }, }, options: [ @@ -597,7 +554,8 @@ export const itemFields: INodeProperties[] = [ ], }, ], - description: 'Item\'s primary key. For example, with a simple primary key, you only need to provide a value for the partition key. For a composite primary key, you must provide values for both the partition key and the sort key.', + description: + "Item's primary key. For example, with a simple primary key, you only need to provide a value for the partition key. For a composite primary key, you must provide values for both the partition key and the sort key.", }, { displayName: 'Additional Fields', @@ -607,12 +565,8 @@ export const itemFields: INodeProperties[] = [ default: {}, displayOptions: { show: { - resource: [ - 'item', - ], - operation: [ - 'get', - ], + resource: ['item'], + operation: ['get'], }, }, options: [ @@ -653,7 +607,8 @@ export const itemFields: INodeProperties[] = [ ], }, ], - description: 'One or more substitution tokens for attribute names in an expression. View details.', + description: + 'One or more substitution tokens for attribute names in an expression. View details.', }, { displayName: 'Read Type', @@ -670,7 +625,8 @@ export const itemFields: INodeProperties[] = [ }, ], default: 'eventuallyConsistentRead', - description: 'Type of read to perform on the table. View details.', + description: + 'Type of read to perform on the table. View details.', }, ], }, @@ -684,16 +640,13 @@ export const itemFields: INodeProperties[] = [ type: 'boolean', displayOptions: { show: { - resource: [ - 'item', - ], - operation: [ - 'getAll', - ], + resource: ['item'], + operation: ['getAll'], }, }, default: false, - description: 'Whether to do an scan or query. Check differences.', + description: + 'Whether to do an scan or query. Check differences.', }, { displayName: 'Filter Expression', @@ -701,18 +654,18 @@ export const itemFields: INodeProperties[] = [ type: 'string', displayOptions: { show: { - scan: [ - true, - ], + scan: [true], }, }, default: '', - description: 'A filter expression determines which items within the Scan results should be returned to you. All of the other results are discarded. Empty value will return all Scan results.', + description: + 'A filter expression determines which items within the Scan results should be returned to you. All of the other results are discarded. Empty value will return all Scan results.', }, { displayName: 'Key Condition Expression', name: 'keyConditionExpression', - description: 'Condition to determine the items to be retrieved. The condition must perform an equality test on a single partition key value, in this format: partitionKeyName = :partitionkeyval', + description: + 'Condition to determine the items to be retrieved. The condition must perform an equality test on a single partition key value, in this format: partitionKeyName = :partitionkeyval', // eslint-disable-next-line n8n-nodes-base/node-param-placeholder-miscased-id placeholder: 'id = :id', default: '', @@ -720,15 +673,9 @@ export const itemFields: INodeProperties[] = [ required: true, displayOptions: { show: { - resource: [ - 'item', - ], - operation: [ - 'getAll', - ], - scan: [ - false, - ], + resource: ['item'], + operation: ['getAll'], + scan: [false], }, }, }, @@ -746,12 +693,8 @@ export const itemFields: INodeProperties[] = [ }, displayOptions: { show: { - resource: [ - 'item', - ], - operation: [ - 'getAll', - ], + resource: ['item'], + operation: ['getAll'], }, }, options: [ @@ -797,12 +740,8 @@ export const itemFields: INodeProperties[] = [ type: 'boolean', displayOptions: { show: { - resource: [ - 'item', - ], - operation: [ - 'getAll', - ], + resource: ['item'], + operation: ['getAll'], }, }, default: false, @@ -814,12 +753,8 @@ export const itemFields: INodeProperties[] = [ type: 'number', displayOptions: { show: { - operation: [ - 'getAll', - ], - returnAll: [ - false, - ], + operation: ['getAll'], + returnAll: [false], }, }, typeOptions: { @@ -835,12 +770,8 @@ export const itemFields: INodeProperties[] = [ type: 'options', displayOptions: { show: { - resource: [ - 'item', - ], - operation: [ - 'getAll', - ], + resource: ['item'], + operation: ['getAll'], }, }, options: [ @@ -870,17 +801,9 @@ export const itemFields: INodeProperties[] = [ type: 'boolean', displayOptions: { show: { - resource: [ - 'item', - ], - operation: [ - 'getAll', - ], - select: [ - 'ALL_PROJECTED_ATTRIBUTES', - 'ALL_ATTRIBUTES', - 'SPECIFIC_ATTRIBUTES', - ], + resource: ['item'], + operation: ['getAll'], + select: ['ALL_PROJECTED_ATTRIBUTES', 'ALL_ATTRIBUTES', 'SPECIFIC_ATTRIBUTES'], }, }, default: true, @@ -894,19 +817,16 @@ export const itemFields: INodeProperties[] = [ default: {}, displayOptions: { show: { - resource: [ - 'item', - ], - operation: [ - 'getAll', - ], + resource: ['item'], + operation: ['getAll'], }, }, options: [ { displayName: 'Index Name', name: 'indexName', - description: 'Name of the index to query. It can be any secondary local or global index on the table.', + description: + 'Name of the index to query. It can be any secondary local or global index on the table.', type: 'string', default: '', }, @@ -915,7 +835,8 @@ export const itemFields: INodeProperties[] = [ name: 'projectionExpression', type: 'string', default: '', - description: 'Text that identifies one or more attributes to retrieve from the table. These attributes can include scalars, sets, or elements of a JSON document. The attributes in the expression must be separated by commas.', + description: + 'Text that identifies one or more attributes to retrieve from the table. These attributes can include scalars, sets, or elements of a JSON document. The attributes in the expression must be separated by commas.', }, { displayName: 'Filter Expression', @@ -923,13 +844,12 @@ export const itemFields: INodeProperties[] = [ type: 'string', displayOptions: { show: { - '/scan': [ - false, - ], + '/scan': [false], }, }, default: '', - description: 'Text that contains conditions that DynamoDB applies after the Query operation, but before the data is returned. Items that do not satisfy the FilterExpression criteria are not returned.', + description: + 'Text that contains conditions that DynamoDB applies after the Query operation, but before the data is returned. Items that do not satisfy the FilterExpression criteria are not returned.', }, { displayName: 'Expression Attribute Names', @@ -960,7 +880,8 @@ export const itemFields: INodeProperties[] = [ ], }, ], - description: 'One or more substitution tokens for attribute names in an expression. Check Info.', + description: + 'One or more substitution tokens for attribute names in an expression. Check Info.', }, ], }, diff --git a/packages/nodes-base/nodes/Aws/DynamoDB/types.d.ts b/packages/nodes-base/nodes/Aws/DynamoDB/types.d.ts index 99eada32c73f6..c03eb89ab59a1 100644 --- a/packages/nodes-base/nodes/Aws/DynamoDB/types.d.ts +++ b/packages/nodes-base/nodes/Aws/DynamoDB/types.d.ts @@ -32,27 +32,36 @@ export interface IAttributeNameUi { } type AttributeValueType = - | 'B' // binary - | 'BOOL' // boolean - | 'BS' // binary set - | 'L' // list - | 'M' // map - | 'N' // number + | 'B' // binary + | 'BOOL' // boolean + | 'BS' // binary set + | 'L' // list + | 'M' // map + | 'N' // number | 'NULL' - | 'NS' // number set - | 'S' // string - | 'SS'; // string set + | 'NS' // number set + | 'S' // string + | 'SS'; // string set export type PartitionKey = { details: { name: string; type: string; value: string; - }, + }; }; export enum EAttributeValueType { - S = 'S', SS = 'SS', M = 'M', L = 'L', NS = 'NS', N = 'N', BOOL = 'BOOL', B = 'B', BS = 'BS', NULL = 'NULL', + S = 'S', + SS = 'SS', + M = 'M', + L = 'L', + NS = 'NS', + N = 'N', + BOOL = 'BOOL', + B = 'B', + BS = 'BS', + NULL = 'NULL', } export interface IExpressionAttributeValue { @@ -74,6 +83,6 @@ export type PutItemUi = { export type AdjustedPutItem = { [attribute: string]: { - [type: string]: string - } + [type: string]: string; + }; }; diff --git a/packages/nodes-base/nodes/Aws/DynamoDB/utils.ts b/packages/nodes-base/nodes/Aws/DynamoDB/utils.ts index a3651b48329bd..35399172b1efb 100644 --- a/packages/nodes-base/nodes/Aws/DynamoDB/utils.ts +++ b/packages/nodes-base/nodes/Aws/DynamoDB/utils.ts @@ -1,7 +1,4 @@ -import { - IDataObject, - INodeExecutionData, -} from 'n8n-workflow'; +import { IDataObject, INodeExecutionData } from 'n8n-workflow'; import { AdjustedPutItem, @@ -14,9 +11,10 @@ import { PutItemUi, } from './types'; -const addColon = (attribute: string) => attribute = attribute.charAt(0) === ':' ? attribute : `:${attribute}`; +const addColon = (attribute: string) => + (attribute = attribute.charAt(0) === ':' ? attribute : `:${attribute}`); -const addPound = (key: string) => key = key.charAt(0) === '#' ? key : `#${key}`; +const addPound = (key: string) => (key = key.charAt(0) === '#' ? key : `#${key}`); export function adjustExpressionAttributeValues(eavUi: IAttributeValueUi[]) { const eav: IAttributeValue = {}; @@ -100,7 +98,7 @@ export function validateJSON(input: any): object { export function copyInputItem(item: INodeExecutionData, properties: string[]): IDataObject { // Prepare the data to insert and copy it to be returned let newItem: IDataObject; - newItem = {}; + newItem = {}; for (const property of properties) { if (item.json[property] === undefined) { newItem[property] = null; diff --git a/packages/nodes-base/nodes/Aws/Rekognition/AwsRekognition.node.ts b/packages/nodes-base/nodes/Aws/Rekognition/AwsRekognition.node.ts index 96f9b05e3e189..b29b48c76306a 100644 --- a/packages/nodes-base/nodes/Aws/Rekognition/AwsRekognition.node.ts +++ b/packages/nodes-base/nodes/Aws/Rekognition/AwsRekognition.node.ts @@ -1,6 +1,4 @@ -import { - IExecuteFunctions, -} from 'n8n-core'; +import { IExecuteFunctions } from 'n8n-core'; import { IBinaryKeyData, @@ -12,10 +10,7 @@ import { NodeOperationError, } from 'n8n-workflow'; -import { - awsApiRequestREST, - keysTPascalCase, -} from './GenericFunctions'; +import { awsApiRequestREST, keysTPascalCase } from './GenericFunctions'; export class AwsRekognition implements INodeType { description: INodeTypeDescription = { @@ -70,12 +65,8 @@ export class AwsRekognition implements INodeType { type: 'options', displayOptions: { show: { - operation: [ - 'analyze', - ], - resource: [ - 'image', - ], + operation: ['analyze'], + resource: ['image'], }, }, options: [ @@ -110,12 +101,8 @@ export class AwsRekognition implements INodeType { required: true, displayOptions: { show: { - operation: [ - 'analyze', - ], - resource: [ - 'image', - ], + operation: ['analyze'], + resource: ['image'], }, }, description: 'Whether the image to analize should be taken from binary field', @@ -124,15 +111,9 @@ export class AwsRekognition implements INodeType { displayName: 'Binary Property', displayOptions: { show: { - operation: [ - 'analyze', - ], - resource: [ - 'image', - ], - binaryData: [ - true, - ], + operation: ['analyze'], + resource: ['image'], + binaryData: [true], }, }, name: 'binaryPropertyName', @@ -146,15 +127,9 @@ export class AwsRekognition implements INodeType { name: 'bucket', displayOptions: { show: { - operation: [ - 'analyze', - ], - resource: [ - 'image', - ], - binaryData: [ - false, - ], + operation: ['analyze'], + resource: ['image'], + binaryData: [false], }, }, type: 'string', @@ -167,15 +142,9 @@ export class AwsRekognition implements INodeType { name: 'name', displayOptions: { show: { - operation: [ - 'analyze', - ], - resource: [ - 'image', - ], - binaryData: [ - false, - ], + operation: ['analyze'], + resource: ['image'], + binaryData: [false], }, }, type: 'string', @@ -190,12 +159,8 @@ export class AwsRekognition implements INodeType { placeholder: 'Add Field', displayOptions: { show: { - operation: [ - 'analyze', - ], - resource: [ - 'image', - ], + operation: ['analyze'], + resource: ['image'], }, }, default: {}, @@ -208,9 +173,7 @@ export class AwsRekognition implements INodeType { placeholder: 'Add Region of Interest', displayOptions: { show: { - '/type': [ - 'detectText', - ], + '/type': ['detectText'], }, }, typeOptions: { @@ -225,21 +188,24 @@ export class AwsRekognition implements INodeType { displayName: 'Height', name: 'height', type: 'number', - description: 'Height of the bounding box as a ratio of the overall image height', + description: + 'Height of the bounding box as a ratio of the overall image height', default: 0, }, { displayName: 'Left', name: 'left', type: 'number', - description: 'Left coordinate of the bounding box as a ratio of overall image width', + description: + 'Left coordinate of the bounding box as a ratio of overall image width', default: 0, }, { displayName: 'Top', name: 'top', type: 'number', - description: 'Top coordinate of the bounding box as a ratio of overall image height', + description: + 'Top coordinate of the bounding box as a ratio of overall image height', default: 0, }, { @@ -258,9 +224,7 @@ export class AwsRekognition implements INodeType { name: 'version', displayOptions: { show: { - '/binaryData': [ - false, - ], + '/binaryData': [false], }, }, type: 'string', @@ -275,9 +239,7 @@ export class AwsRekognition implements INodeType { placeholder: 'Add Word Filter', displayOptions: { show: { - '/type': [ - 'detectText', - ], + '/type': ['detectText'], }, }, typeOptions: { @@ -288,21 +250,24 @@ export class AwsRekognition implements INodeType { displayName: 'Min Bounding Box Height', name: 'MinBoundingBoxHeight', type: 'number', - description: 'Sets the minimum height of the word bounding box. Words with bounding box heights lesser than this value will be excluded from the result. Value is relative to the video frame height.', + description: + 'Sets the minimum height of the word bounding box. Words with bounding box heights lesser than this value will be excluded from the result. Value is relative to the video frame height.', default: 0, }, { displayName: 'Min Bounding Box Width', name: 'MinBoundingBoxWidth', type: 'number', - description: 'Sets the minimum width of the word bounding box. Words with bounding boxes widths lesser than this value will be excluded from the result. Value is relative to the video frame width.', + description: + 'Sets the minimum width of the word bounding box. Words with bounding boxes widths lesser than this value will be excluded from the result. Value is relative to the video frame width.', default: 0, }, { displayName: 'Min Confidence', name: 'MinConfidence', type: 'number', - description: 'Sets the confidence of word detection. Words with detection confidence below this will be excluded from the result. Values should be between 50 and 100 as Text in Video will not return any result below 50.', + description: + 'Sets the confidence of word detection. Words with detection confidence below this will be excluded from the result. Values should be between 50 and 100 as Text in Video will not return any result below 50.', default: 0, }, ], @@ -313,17 +278,15 @@ export class AwsRekognition implements INodeType { type: 'number', displayOptions: { show: { - '/type': [ - 'detectModerationLabels', - 'detectLabels', - ], + '/type': ['detectModerationLabels', 'detectLabels'], }, }, default: 0, typeOptions: { minValue: 0, }, - description: 'Maximum number of labels you want the service to return in the response. The service returns the specified number of highest confidence labels.', + description: + 'Maximum number of labels you want the service to return in the response. The service returns the specified number of highest confidence labels.', }, { displayName: 'Min Confidence', @@ -331,10 +294,7 @@ export class AwsRekognition implements INodeType { type: 'number', displayOptions: { show: { - '/type': [ - 'detectModerationLabels', - 'detectLabels', - ], + '/type': ['detectModerationLabels', 'detectLabels'], }, }, default: 0, @@ -342,7 +302,8 @@ export class AwsRekognition implements INodeType { minValue: 0, maxValue: 100, }, - description: 'Specifies the minimum confidence level for the labels to return. Amazon Rekognition doesn\'t return any labels with a confidence level lower than this specified value.', + description: + "Specifies the minimum confidence level for the labels to return. Amazon Rekognition doesn't return any labels with a confidence level lower than this specified value.", }, { displayName: 'Attributes', @@ -350,9 +311,7 @@ export class AwsRekognition implements INodeType { type: 'multiOptions', displayOptions: { show: { - '/type': [ - 'detectFaces', - ], + '/type': ['detectFaces'], }, }, options: [ @@ -438,7 +397,9 @@ export class AwsRekognition implements INodeType { body.Filters = {}; - const box = (additionalFields.regionsOfInterestUi as IDataObject || {}).regionsOfInterestValues as IDataObject[] || []; + const box = + (((additionalFields.regionsOfInterestUi as IDataObject) || {}) + .regionsOfInterestValues as IDataObject[]) || []; if (box.length !== 0) { //@ts-ignore @@ -447,7 +408,7 @@ export class AwsRekognition implements INodeType { }); } - const wordFilter = additionalFields.wordFilterUi as IDataObject || {}; + const wordFilter = (additionalFields.wordFilterUi as IDataObject) || {}; if (Object.keys(wordFilter).length !== 0) { //@ts-ignore body.Filters.WordFilter = keysTPascalCase(wordFilter); @@ -456,15 +417,20 @@ export class AwsRekognition implements INodeType { const binaryData = this.getNodeParameter('binaryData', 0) as boolean; if (binaryData) { - const binaryPropertyName = this.getNodeParameter('binaryPropertyName', 0) as string; if (items[i].binary === undefined) { - throw new NodeOperationError(this.getNode(), 'No binary data exists on item!', { itemIndex: i }); + throw new NodeOperationError(this.getNode(), 'No binary data exists on item!', { + itemIndex: i, + }); } if ((items[i].binary as IBinaryKeyData)[binaryPropertyName] === undefined) { - throw new NodeOperationError(this.getNode(), `No binary data property "${binaryPropertyName}" does not exists on item!`, { itemIndex: i }); + throw new NodeOperationError( + this.getNode(), + `No binary data property "${binaryPropertyName}" does not exists on item!`, + { itemIndex: i }, + ); } const binaryPropertyData = (items[i].binary as IBinaryKeyData)[binaryPropertyName]; @@ -474,9 +440,7 @@ export class AwsRekognition implements INodeType { Bytes: binaryPropertyData.data, }, }); - } else { - const bucket = this.getNodeParameter('bucket', i) as string; const name = this.getNodeParameter('name', i) as string; @@ -496,8 +460,15 @@ export class AwsRekognition implements INodeType { } } - responseData = await awsApiRequestREST.call(this, 'rekognition', 'POST', '', JSON.stringify(body), {}, { 'X-Amz-Target': action, 'Content-Type': 'application/x-amz-json-1.1' }); - + responseData = await awsApiRequestREST.call( + this, + 'rekognition', + 'POST', + '', + JSON.stringify(body), + {}, + { 'X-Amz-Target': action, 'Content-Type': 'application/x-amz-json-1.1' }, + ); } } } diff --git a/packages/nodes-base/nodes/Aws/Rekognition/GenericFunctions.ts b/packages/nodes-base/nodes/Aws/Rekognition/GenericFunctions.ts index 3a8b98c3607e9..112c8c6234d5f 100644 --- a/packages/nodes-base/nodes/Aws/Rekognition/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Aws/Rekognition/GenericFunctions.ts @@ -1,23 +1,12 @@ -import { - URL, -} from 'url'; +import { URL } from 'url'; -import { - Request, - sign, -} from 'aws4'; +import { Request, sign } from 'aws4'; -import { - get, -} from 'lodash'; +import { get } from 'lodash'; -import { - OptionsWithUri, -} from 'request'; +import { OptionsWithUri } from 'request'; -import { - parseString, -} from 'xml2js'; +import { parseString } from 'xml2js'; import { IExecuteFunctions, @@ -26,27 +15,39 @@ import { IWebhookFunctions, } from 'n8n-core'; -import { - IDataObject, - NodeApiError, - NodeOperationError, - } from 'n8n-workflow'; - -import { - pascalCase, -} from 'change-case'; - -export async function awsApiRequest(this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions | IWebhookFunctions, service: string, method: string, path: string, body?: string | Buffer | IDataObject, query: IDataObject = {}, headers?: object, option: IDataObject = {}, region?: string): Promise { // tslint:disable-line:no-any +import { IDataObject, NodeApiError, NodeOperationError } from 'n8n-workflow'; + +import { pascalCase } from 'change-case'; + +export async function awsApiRequest( + this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions | IWebhookFunctions, + service: string, + method: string, + path: string, + body?: string | Buffer | IDataObject, + query: IDataObject = {}, + headers?: object, + option: IDataObject = {}, + region?: string, + // tslint:disable-next-line:no-any +): Promise { const credentials = await this.getCredentials('aws'); - const endpoint = new URL(((credentials.rekognitionEndpoint as string || '').replace('{region}', credentials.region as string) || `https://${service}.${credentials.region}.amazonaws.com`) + path); + const endpoint = new URL( + (((credentials.rekognitionEndpoint as string) || '').replace( + '{region}', + credentials.region as string, + ) || `https://${service}.${credentials.region}.amazonaws.com`) + path, + ); // Sign AWS API request with the user credentials - const signOpts = {headers: headers || {}, host: endpoint.host, method, path, body} as Request; + const signOpts = { headers: headers || {}, host: endpoint.host, method, path, body } as Request; const securityHeaders = { accessKeyId: `${credentials.accessKeyId}`.trim(), secretAccessKey: `${credentials.secretAccessKey}`.trim(), - sessionToken: credentials.temporaryCredentials ? `${credentials.sessionToken}`.trim() : undefined, + sessionToken: credentials.temporaryCredentials + ? `${credentials.sessionToken}`.trim() + : undefined, }; sign(signOpts, securityHeaders); @@ -68,8 +69,29 @@ export async function awsApiRequest(this: IHookFunctions | IExecuteFunctions | I } } -export async function awsApiRequestREST(this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions, service: string, method: string, path: string, body?: string, query: IDataObject = {}, headers?: object, options: IDataObject = {}, region?: string): Promise { // tslint:disable-line:no-any - const response = await awsApiRequest.call(this, service, method, path, body, query, headers, options, region); +export async function awsApiRequestREST( + this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions, + service: string, + method: string, + path: string, + body?: string, + query: IDataObject = {}, + headers?: object, + options: IDataObject = {}, + region?: string, + // tslint:disable-next-line:no-any +): Promise { + const response = await awsApiRequest.call( + this, + service, + method, + path, + body, + query, + headers, + options, + region, + ); try { return JSON.parse(response); } catch (error) { @@ -77,8 +99,29 @@ export async function awsApiRequestREST(this: IHookFunctions | IExecuteFunctions } } -export async function awsApiRequestSOAP(this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions | IWebhookFunctions, service: string, method: string, path: string, body?: string | Buffer | IDataObject, query: IDataObject = {}, headers?: object, option: IDataObject = {}, region?: string): Promise { // tslint:disable-line:no-any - const response = await awsApiRequest.call(this, service, method, path, body, query, headers, option, region); +export async function awsApiRequestSOAP( + this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions | IWebhookFunctions, + service: string, + method: string, + path: string, + body?: string | Buffer | IDataObject, + query: IDataObject = {}, + headers?: object, + option: IDataObject = {}, + region?: string, + // tslint:disable-next-line:no-any +): Promise { + const response = await awsApiRequest.call( + this, + service, + method, + path, + body, + query, + headers, + option, + region, + ); try { return await new Promise((resolve, reject) => { parseString(response, { explicitArray: false }, (err, data) => { @@ -93,18 +136,42 @@ export async function awsApiRequestSOAP(this: IHookFunctions | IExecuteFunctions } } -export async function awsApiRequestSOAPAllItems(this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions | IWebhookFunctions, propertyName: string, service: string, method: string, path: string, body?: string, query: IDataObject = {}, headers: IDataObject = {}, option: IDataObject = {}, region?: string): Promise { // tslint:disable-line:no-any - +export async function awsApiRequestSOAPAllItems( + this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions | IWebhookFunctions, + propertyName: string, + service: string, + method: string, + path: string, + body?: string, + query: IDataObject = {}, + headers: IDataObject = {}, + option: IDataObject = {}, + region?: string, + // tslint:disable-next-line:no-any +): Promise { const returnData: IDataObject[] = []; let responseData; do { - responseData = await awsApiRequestSOAP.call(this, service, method, path, body, query, headers, option, region); + responseData = await awsApiRequestSOAP.call( + this, + service, + method, + path, + body, + query, + headers, + option, + region, + ); //https://forums.aws.amazon.com/thread.jspa?threadID=55746 if (get(responseData, `${propertyName.split('.')[0]}.NextContinuationToken`)) { - query['continuation-token'] = get(responseData, `${propertyName.split('.')[0]}.NextContinuationToken`); + query['continuation-token'] = get( + responseData, + `${propertyName.split('.')[0]}.NextContinuationToken`, + ); } if (get(responseData, propertyName)) { if (Array.isArray(get(responseData, propertyName))) { @@ -125,7 +192,9 @@ export async function awsApiRequestSOAPAllItems(this: IHookFunctions | IExecuteF } function queryToString(params: IDataObject) { - return Object.keys(params).map(key => key + '=' + params[key]).join('&'); + return Object.keys(params) + .map((key) => key + '=' + params[key]) + .join('&'); } export function keysTPascalCase(object: IDataObject) { diff --git a/packages/nodes-base/nodes/Aws/S3/AwsS3.node.ts b/packages/nodes-base/nodes/Aws/S3/AwsS3.node.ts index 8a35569a016d2..ae7f3fc3adb23 100644 --- a/packages/nodes-base/nodes/Aws/S3/AwsS3.node.ts +++ b/packages/nodes-base/nodes/Aws/S3/AwsS3.node.ts @@ -1,20 +1,10 @@ +import { paramCase, snakeCase } from 'change-case'; -import { - paramCase, - snakeCase, -} from 'change-case'; +import { createHash } from 'crypto'; -import { - createHash, -} from 'crypto'; +import { Builder } from 'xml2js'; -import { - Builder, -} from 'xml2js'; - -import { - IExecuteFunctions, -} from 'n8n-core'; +import { IExecuteFunctions } from 'n8n-core'; import { IBinaryKeyData, @@ -26,20 +16,11 @@ import { NodeOperationError, } from 'n8n-workflow'; -import { - bucketFields, - bucketOperations, -} from './BucketDescription'; +import { bucketFields, bucketOperations } from './BucketDescription'; -import { - folderFields, - folderOperations, -} from './FolderDescription'; +import { folderFields, folderOperations } from './FolderDescription'; -import { - fileFields, - fileOperations, -} from './FileDescription'; +import { fileFields, fileOperations } from './FileDescription'; import { awsApiRequestREST, @@ -121,7 +102,8 @@ export class AwsS3 implements INodeType { headers['x-amz-acl'] = paramCase(additionalFields.acl as string); } if (additionalFields.bucketObjectLockEnabled) { - headers['x-amz-bucket-object-lock-enabled'] = additionalFields.bucketObjectLockEnabled as boolean; + headers['x-amz-bucket-object-lock-enabled'] = + additionalFields.bucketObjectLockEnabled as boolean; } if (additionalFields.grantFullControl) { headers['x-amz-grant-full-control'] = ''; @@ -146,7 +128,7 @@ export class AwsS3 implements INodeType { const body: IDataObject = { CreateBucketConfiguration: { - '$': { + $: { xmlns: 'http://s3.amazonaws.com/doc/2006-03-01/', }, }, @@ -159,7 +141,15 @@ export class AwsS3 implements INodeType { const builder = new Builder(); data = builder.buildObject(body); } - responseData = await awsApiRequestSOAP.call(this, `${name}.s3`, 'PUT', '', data, qs, headers); + responseData = await awsApiRequestSOAP.call( + this, + `${name}.s3`, + 'PUT', + '', + data, + qs, + headers, + ); returnData.push({ success: true }); } @@ -168,7 +158,15 @@ export class AwsS3 implements INodeType { if (operation === 'delete') { const name = this.getNodeParameter('name', i) as string; - responseData = await awsApiRequestSOAP.call(this, `${name}.s3`, 'DELETE', '', '', {}, headers); + responseData = await awsApiRequestSOAP.call( + this, + `${name}.s3`, + 'DELETE', + '', + '', + {}, + headers, + ); returnData.push({ success: true }); } @@ -176,10 +174,24 @@ export class AwsS3 implements INodeType { if (operation === 'getAll') { const returnAll = this.getNodeParameter('returnAll', 0) as boolean; if (returnAll) { - responseData = await awsApiRequestSOAPAllItems.call(this, 'ListAllMyBucketsResult.Buckets.Bucket', 's3', 'GET', ''); + responseData = await awsApiRequestSOAPAllItems.call( + this, + 'ListAllMyBucketsResult.Buckets.Bucket', + 's3', + 'GET', + '', + ); } else { qs.limit = this.getNodeParameter('limit', 0) as number; - responseData = await awsApiRequestSOAPAllItems.call(this, 'ListAllMyBucketsResult.Buckets.Bucket', 's3', 'GET', '', '', qs); + responseData = await awsApiRequestSOAPAllItems.call( + this, + 'ListAllMyBucketsResult.Buckets.Bucket', + 's3', + 'GET', + '', + '', + qs, + ); responseData = responseData.slice(0, qs.limit); } returnData.push.apply(returnData, responseData); @@ -217,16 +229,38 @@ export class AwsS3 implements INodeType { qs['list-type'] = 2; - - responseData = await awsApiRequestSOAP.call(this, `${bucketName}.s3`, 'GET', '', '', { location: '' }); + responseData = await awsApiRequestSOAP.call(this, `${bucketName}.s3`, 'GET', '', '', { + location: '', + }); const region = responseData.LocationConstraint._ as string; if (returnAll) { - responseData = await awsApiRequestSOAPAllItems.call(this, 'ListBucketResult.Contents', `${bucketName}.s3`, 'GET', '', '', qs, {}, {}, region); + responseData = await awsApiRequestSOAPAllItems.call( + this, + 'ListBucketResult.Contents', + `${bucketName}.s3`, + 'GET', + '', + '', + qs, + {}, + {}, + region, + ); } else { qs['max-keys'] = this.getNodeParameter('limit', 0) as number; - responseData = await awsApiRequestSOAP.call(this, `${bucketName}.s3`, 'GET', '', '', qs, {}, {}, region); + responseData = await awsApiRequestSOAP.call( + this, + `${bucketName}.s3`, + 'GET', + '', + '', + qs, + {}, + {}, + region, + ); responseData = responseData.ListBucketResult.Contents; } if (Array.isArray(responseData)) { @@ -251,13 +285,27 @@ export class AwsS3 implements INodeType { path = `/${additionalFields.parentFolderKey}${folderName}/`; } if (additionalFields.storageClass) { - headers['x-amz-storage-class'] = (snakeCase(additionalFields.storageClass as string)).toUpperCase(); + headers['x-amz-storage-class'] = snakeCase( + additionalFields.storageClass as string, + ).toUpperCase(); } - responseData = await awsApiRequestSOAP.call(this, `${bucketName}.s3`, 'GET', '', '', { location: '' }); + responseData = await awsApiRequestSOAP.call(this, `${bucketName}.s3`, 'GET', '', '', { + location: '', + }); const region = responseData.LocationConstraint._; - responseData = await awsApiRequestSOAP.call(this, `${bucketName}.s3`, 'PUT', path, '', qs, headers, {}, region); + responseData = await awsApiRequestSOAP.call( + this, + `${bucketName}.s3`, + 'PUT', + path, + '', + qs, + headers, + {}, + region, + ); returnData.push({ success: true }); } //https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteObjects.html @@ -265,24 +313,45 @@ export class AwsS3 implements INodeType { const bucketName = this.getNodeParameter('bucketName', i) as string; const folderKey = this.getNodeParameter('folderKey', i) as string; - responseData = await awsApiRequestSOAP.call(this, `${bucketName}.s3`, 'GET', '', '', { location: '' }); + responseData = await awsApiRequestSOAP.call(this, `${bucketName}.s3`, 'GET', '', '', { + location: '', + }); const region = responseData.LocationConstraint._; - responseData = await awsApiRequestSOAPAllItems.call(this, 'ListBucketResult.Contents', `${bucketName}.s3`, 'GET', '/', '', { 'list-type': 2, prefix: folderKey }, {}, {}, region); + responseData = await awsApiRequestSOAPAllItems.call( + this, + 'ListBucketResult.Contents', + `${bucketName}.s3`, + 'GET', + '/', + '', + { 'list-type': 2, prefix: folderKey }, + {}, + {}, + region, + ); // folder empty then just delete it if (responseData.length === 0) { - - responseData = await awsApiRequestSOAP.call(this, `${bucketName}.s3`, 'DELETE', `/${folderKey}`, '', qs, {}, {}, region); - - responseData = { deleted: [ { 'Key': folderKey } ] }; - + responseData = await awsApiRequestSOAP.call( + this, + `${bucketName}.s3`, + 'DELETE', + `/${folderKey}`, + '', + qs, + {}, + {}, + region, + ); + + responseData = { deleted: [{ Key: folderKey }] }; } else { - // delete everything inside the folder + // delete everything inside the folder const body: IDataObject = { Delete: { - '$': { + $: { xmlns: 'http://s3.amazonaws.com/doc/2006-03-01/', }, Object: [], @@ -303,7 +372,17 @@ export class AwsS3 implements INodeType { headers['Content-Type'] = 'application/xml'; - responseData = await awsApiRequestSOAP.call(this, `${bucketName}.s3`, 'POST', '/', data, { delete: '' } , headers, {}, region); + responseData = await awsApiRequestSOAP.call( + this, + `${bucketName}.s3`, + 'POST', + '/', + data, + { delete: '' }, + headers, + {}, + region, + ); responseData = { deleted: responseData.DeleteResult.Deleted }; } @@ -325,18 +404,45 @@ export class AwsS3 implements INodeType { qs['list-type'] = 2; - responseData = await awsApiRequestSOAP.call(this, `${bucketName}.s3`, 'GET', '', '', { location: '' }); + responseData = await awsApiRequestSOAP.call(this, `${bucketName}.s3`, 'GET', '', '', { + location: '', + }); const region = responseData.LocationConstraint._; if (returnAll) { - responseData = await awsApiRequestSOAPAllItems.call(this, 'ListBucketResult.Contents', `${bucketName}.s3`, 'GET', '', '', qs, {}, {}, region); + responseData = await awsApiRequestSOAPAllItems.call( + this, + 'ListBucketResult.Contents', + `${bucketName}.s3`, + 'GET', + '', + '', + qs, + {}, + {}, + region, + ); } else { qs.limit = this.getNodeParameter('limit', 0) as number; - responseData = await awsApiRequestSOAPAllItems.call(this, 'ListBucketResult.Contents', `${bucketName}.s3`, 'GET', '', '', qs, {}, {}, region); + responseData = await awsApiRequestSOAPAllItems.call( + this, + 'ListBucketResult.Contents', + `${bucketName}.s3`, + 'GET', + '', + '', + qs, + {}, + {}, + region, + ); } if (Array.isArray(responseData)) { - responseData = responseData.filter((e: IDataObject) => (e.Key as string).endsWith('/') && e.Size === '0' && e.Key !== options.folderKey); + responseData = responseData.filter( + (e: IDataObject) => + (e.Key as string).endsWith('/') && e.Size === '0' && e.Key !== options.folderKey, + ); if (qs.limit) { responseData = responseData.splice(0, qs.limit as number); } @@ -357,7 +463,9 @@ export class AwsS3 implements INodeType { headers['x-amz-request-payer'] = 'requester'; } if (additionalFields.storageClass) { - headers['x-amz-storage-class'] = (snakeCase(additionalFields.storageClass as string)).toUpperCase(); + headers['x-amz-storage-class'] = snakeCase( + additionalFields.storageClass as string, + ).toUpperCase(); } if (additionalFields.acl) { headers['x-amz-acl'] = paramCase(additionalFields.acl as string); @@ -375,37 +483,52 @@ export class AwsS3 implements INodeType { headers['x-amz-grant-write-acp'] = ''; } if (additionalFields.lockLegalHold) { - headers['x-amz-object-lock-legal-hold'] = (additionalFields.lockLegalHold as boolean) ? 'ON' : 'OFF'; + headers['x-amz-object-lock-legal-hold'] = (additionalFields.lockLegalHold as boolean) + ? 'ON' + : 'OFF'; } if (additionalFields.lockMode) { - headers['x-amz-object-lock-mode'] = (additionalFields.lockMode as string).toUpperCase(); + headers['x-amz-object-lock-mode'] = ( + additionalFields.lockMode as string + ).toUpperCase(); } if (additionalFields.lockRetainUntilDate) { - headers['x-amz-object-lock-retain-until-date'] = additionalFields.lockRetainUntilDate as string; + headers['x-amz-object-lock-retain-until-date'] = + additionalFields.lockRetainUntilDate as string; } if (additionalFields.serverSideEncryption) { - headers['x-amz-server-side-encryption'] = additionalFields.serverSideEncryption as string; + headers['x-amz-server-side-encryption'] = + additionalFields.serverSideEncryption as string; } if (additionalFields.encryptionAwsKmsKeyId) { - headers['x-amz-server-side-encryption-aws-kms-key-id'] = additionalFields.encryptionAwsKmsKeyId as string; + headers['x-amz-server-side-encryption-aws-kms-key-id'] = + additionalFields.encryptionAwsKmsKeyId as string; } if (additionalFields.serverSideEncryptionContext) { - headers['x-amz-server-side-encryption-context'] = additionalFields.serverSideEncryptionContext as string; + headers['x-amz-server-side-encryption-context'] = + additionalFields.serverSideEncryptionContext as string; } if (additionalFields.serversideEncryptionCustomerAlgorithm) { - headers['x-amz-server-side-encryption-customer-algorithm'] = additionalFields.serversideEncryptionCustomerAlgorithm as string; + headers['x-amz-server-side-encryption-customer-algorithm'] = + additionalFields.serversideEncryptionCustomerAlgorithm as string; } if (additionalFields.serversideEncryptionCustomerKey) { - headers['x-amz-server-side-encryption-customer-key'] = additionalFields.serversideEncryptionCustomerKey as string; + headers['x-amz-server-side-encryption-customer-key'] = + additionalFields.serversideEncryptionCustomerKey as string; } if (additionalFields.serversideEncryptionCustomerKeyMD5) { - headers['x-amz-server-side-encryption-customer-key-MD5'] = additionalFields.serversideEncryptionCustomerKeyMD5 as string; + headers['x-amz-server-side-encryption-customer-key-MD5'] = + additionalFields.serversideEncryptionCustomerKeyMD5 as string; } if (additionalFields.taggingDirective) { - headers['x-amz-tagging-directive'] = (additionalFields.taggingDirective as string).toUpperCase(); + headers['x-amz-tagging-directive'] = ( + additionalFields.taggingDirective as string + ).toUpperCase(); } if (additionalFields.metadataDirective) { - headers['x-amz-metadata-directive'] = (additionalFields.metadataDirective as string).toUpperCase(); + headers['x-amz-metadata-directive'] = ( + additionalFields.metadataDirective as string + ).toUpperCase(); } const destinationParts = destinationPath.split('/'); @@ -414,17 +537,27 @@ export class AwsS3 implements INodeType { const destination = `/${destinationParts.slice(2, destinationParts.length).join('/')}`; - responseData = await awsApiRequestSOAP.call(this, `${bucketName}.s3`, 'GET', '', '', { location: '' }); + responseData = await awsApiRequestSOAP.call(this, `${bucketName}.s3`, 'GET', '', '', { + location: '', + }); const region = responseData.LocationConstraint._; - responseData = await awsApiRequestSOAP.call(this, `${bucketName}.s3`, 'PUT', destination, '', qs, headers, {}, region); + responseData = await awsApiRequestSOAP.call( + this, + `${bucketName}.s3`, + 'PUT', + destination, + '', + qs, + headers, + {}, + region, + ); returnData.push(responseData.CopyObjectResult); - } //https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html if (operation === 'download') { - const bucketName = this.getNodeParameter('bucketName', i) as string; const fileKey = this.getNodeParameter('fileKey', i) as string; @@ -432,14 +565,29 @@ export class AwsS3 implements INodeType { const fileName = fileKey.split('/')[fileKey.split('/').length - 1]; if (fileKey.substring(fileKey.length - 1) === '/') { - throw new NodeOperationError(this.getNode(), 'Downloding a whole directory is not yet supported, please provide a file key'); + throw new NodeOperationError( + this.getNode(), + 'Downloding a whole directory is not yet supported, please provide a file key', + ); } - let region = await awsApiRequestSOAP.call(this, `${bucketName}.s3`, 'GET', '', '', { location: '' }); + let region = await awsApiRequestSOAP.call(this, `${bucketName}.s3`, 'GET', '', '', { + location: '', + }); region = region.LocationConstraint._; - const response = await awsApiRequestREST.call(this, `${bucketName}.s3`, 'GET', `/${fileKey}`, '', qs, {}, { encoding: null, resolveWithFullResponse: true }, region); + const response = await awsApiRequestREST.call( + this, + `${bucketName}.s3`, + 'GET', + `/${fileKey}`, + '', + qs, + {}, + { encoding: null, resolveWithFullResponse: true }, + region, + ); let mimeType: string | undefined; if (response.headers['content-type']) { @@ -460,11 +608,18 @@ export class AwsS3 implements INodeType { items[i] = newItem; - const dataPropertyNameDownload = this.getNodeParameter('binaryPropertyName', i) as string; + const dataPropertyNameDownload = this.getNodeParameter( + 'binaryPropertyName', + i, + ) as string; const data = Buffer.from(response.body as string, 'utf8'); - items[i].binary![dataPropertyNameDownload] = await this.helpers.prepareBinaryData(data as unknown as Buffer, fileName, mimeType); + items[i].binary![dataPropertyNameDownload] = await this.helpers.prepareBinaryData( + data as unknown as Buffer, + fileName, + mimeType, + ); } //https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteObject.html if (operation === 'delete') { @@ -478,11 +633,23 @@ export class AwsS3 implements INodeType { qs.versionId = options.versionId as string; } - responseData = await awsApiRequestSOAP.call(this, `${bucketName}.s3`, 'GET', '', '', { location: '' }); + responseData = await awsApiRequestSOAP.call(this, `${bucketName}.s3`, 'GET', '', '', { + location: '', + }); const region = responseData.LocationConstraint._; - responseData = await awsApiRequestSOAP.call(this, `${bucketName}.s3`, 'DELETE', `/${fileKey}`, '', qs, {}, {}, region); + responseData = await awsApiRequestSOAP.call( + this, + `${bucketName}.s3`, + 'DELETE', + `/${fileKey}`, + '', + qs, + {}, + {}, + region, + ); returnData.push({ success: true }); } @@ -504,19 +671,45 @@ export class AwsS3 implements INodeType { qs['list-type'] = 2; - responseData = await awsApiRequestSOAP.call(this, `${bucketName}.s3`, 'GET', '', '', { location: '' }); + responseData = await awsApiRequestSOAP.call(this, `${bucketName}.s3`, 'GET', '', '', { + location: '', + }); const region = responseData.LocationConstraint._; if (returnAll) { - responseData = await awsApiRequestSOAPAllItems.call(this, 'ListBucketResult.Contents', `${bucketName}.s3`, 'GET', '', '', qs, {}, {}, region); + responseData = await awsApiRequestSOAPAllItems.call( + this, + 'ListBucketResult.Contents', + `${bucketName}.s3`, + 'GET', + '', + '', + qs, + {}, + {}, + region, + ); } else { qs.limit = this.getNodeParameter('limit', 0) as number; - responseData = await awsApiRequestSOAPAllItems.call(this, 'ListBucketResult.Contents', `${bucketName}.s3`, 'GET', '', '', qs, {}, {}, region); + responseData = await awsApiRequestSOAPAllItems.call( + this, + 'ListBucketResult.Contents', + `${bucketName}.s3`, + 'GET', + '', + '', + qs, + {}, + {}, + region, + ); responseData = responseData.splice(0, qs.limit); } if (Array.isArray(responseData)) { - responseData = responseData.filter((e: IDataObject) => !(e.Key as string).endsWith('/') && e.Size !== '0'); + responseData = responseData.filter( + (e: IDataObject) => !(e.Key as string).endsWith('/') && e.Size !== '0', + ); if (qs.limit) { responseData = responseData.splice(0, qs.limit as number); } @@ -529,7 +722,8 @@ export class AwsS3 implements INodeType { const fileName = this.getNodeParameter('fileName', i) as string; const isBinaryData = this.getNodeParameter('binaryData', i) as boolean; const additionalFields = this.getNodeParameter('additionalFields', i) as IDataObject; - const tagsValues = (this.getNodeParameter('tagsUi', i) as IDataObject).tagsValues as IDataObject[]; + const tagsValues = (this.getNodeParameter('tagsUi', i) as IDataObject) + .tagsValues as IDataObject[]; let path = '/'; let body; @@ -540,7 +734,9 @@ export class AwsS3 implements INodeType { path = `/${additionalFields.parentFolderKey}/`; } if (additionalFields.storageClass) { - headers['x-amz-storage-class'] = (snakeCase(additionalFields.storageClass as string)).toUpperCase(); + headers['x-amz-storage-class'] = snakeCase( + additionalFields.storageClass as string, + ).toUpperCase(); } if (additionalFields.acl) { headers['x-amz-acl'] = paramCase(additionalFields.acl as string); @@ -558,39 +754,54 @@ export class AwsS3 implements INodeType { headers['x-amz-grant-write-acp'] = ''; } if (additionalFields.lockLegalHold) { - headers['x-amz-object-lock-legal-hold'] = (additionalFields.lockLegalHold as boolean) ? 'ON' : 'OFF'; + headers['x-amz-object-lock-legal-hold'] = (additionalFields.lockLegalHold as boolean) + ? 'ON' + : 'OFF'; } if (additionalFields.lockMode) { - headers['x-amz-object-lock-mode'] = (additionalFields.lockMode as string).toUpperCase(); + headers['x-amz-object-lock-mode'] = ( + additionalFields.lockMode as string + ).toUpperCase(); } if (additionalFields.lockRetainUntilDate) { - headers['x-amz-object-lock-retain-until-date'] = additionalFields.lockRetainUntilDate as string; + headers['x-amz-object-lock-retain-until-date'] = + additionalFields.lockRetainUntilDate as string; } if (additionalFields.serverSideEncryption) { - headers['x-amz-server-side-encryption'] = additionalFields.serverSideEncryption as string; + headers['x-amz-server-side-encryption'] = + additionalFields.serverSideEncryption as string; } if (additionalFields.encryptionAwsKmsKeyId) { - headers['x-amz-server-side-encryption-aws-kms-key-id'] = additionalFields.encryptionAwsKmsKeyId as string; + headers['x-amz-server-side-encryption-aws-kms-key-id'] = + additionalFields.encryptionAwsKmsKeyId as string; } if (additionalFields.serverSideEncryptionContext) { - headers['x-amz-server-side-encryption-context'] = additionalFields.serverSideEncryptionContext as string; + headers['x-amz-server-side-encryption-context'] = + additionalFields.serverSideEncryptionContext as string; } if (additionalFields.serversideEncryptionCustomerAlgorithm) { - headers['x-amz-server-side-encryption-customer-algorithm'] = additionalFields.serversideEncryptionCustomerAlgorithm as string; + headers['x-amz-server-side-encryption-customer-algorithm'] = + additionalFields.serversideEncryptionCustomerAlgorithm as string; } if (additionalFields.serversideEncryptionCustomerKey) { - headers['x-amz-server-side-encryption-customer-key'] = additionalFields.serversideEncryptionCustomerKey as string; + headers['x-amz-server-side-encryption-customer-key'] = + additionalFields.serversideEncryptionCustomerKey as string; } if (additionalFields.serversideEncryptionCustomerKeyMD5) { - headers['x-amz-server-side-encryption-customer-key-MD5'] = additionalFields.serversideEncryptionCustomerKeyMD5 as string; + headers['x-amz-server-side-encryption-customer-key-MD5'] = + additionalFields.serversideEncryptionCustomerKeyMD5 as string; } if (tagsValues) { const tags: string[] = []; - tagsValues.forEach((o: IDataObject) => { tags.push(`${o.key}=${o.value}`); }); + tagsValues.forEach((o: IDataObject) => { + tags.push(`${o.key}=${o.value}`); + }); headers['x-amz-tagging'] = tags.join('&'); } - responseData = await awsApiRequestSOAP.call(this, `${bucketName}.s3`, 'GET', '', '', { location: '' }); + responseData = await awsApiRequestSOAP.call(this, `${bucketName}.s3`, 'GET', '', '', { + location: '', + }); const region = responseData.LocationConstraint._; @@ -598,15 +809,24 @@ export class AwsS3 implements INodeType { const binaryPropertyName = this.getNodeParameter('binaryPropertyName', 0) as string; if (items[i].binary === undefined) { - throw new NodeOperationError(this.getNode(), 'No binary data exists on item!', { itemIndex: i }); + throw new NodeOperationError(this.getNode(), 'No binary data exists on item!', { + itemIndex: i, + }); } if ((items[i].binary as IBinaryKeyData)[binaryPropertyName] === undefined) { - throw new NodeOperationError(this.getNode(), `No binary data property "${binaryPropertyName}" does not exists on item!`, { itemIndex: i }); + throw new NodeOperationError( + this.getNode(), + `No binary data property "${binaryPropertyName}" does not exists on item!`, + { itemIndex: i }, + ); } const binaryData = (items[i].binary as IBinaryKeyData)[binaryPropertyName]; - const binaryDataBuffer = await this.helpers.getBinaryDataBuffer(i, binaryPropertyName); + const binaryDataBuffer = await this.helpers.getBinaryDataBuffer( + i, + binaryPropertyName, + ); body = binaryDataBuffer; @@ -614,10 +834,18 @@ export class AwsS3 implements INodeType { headers['Content-MD5'] = createHash('md5').update(body).digest('base64'); - responseData = await awsApiRequestSOAP.call(this, `${bucketName}.s3`, 'PUT', `${path}${fileName || binaryData.fileName}`, body, qs, headers, {}, region); - + responseData = await awsApiRequestSOAP.call( + this, + `${bucketName}.s3`, + 'PUT', + `${path}${fileName || binaryData.fileName}`, + body, + qs, + headers, + {}, + region, + ); } else { - const fileContent = this.getNodeParameter('fileContent', i) as string; body = Buffer.from(fileContent, 'utf8'); @@ -626,7 +854,17 @@ export class AwsS3 implements INodeType { headers['Content-MD5'] = createHash('md5').update(fileContent).digest('base64'); - responseData = await awsApiRequestSOAP.call(this, `${bucketName}.s3`, 'PUT', `${path}${fileName}`, body, qs, headers, {}, region); + responseData = await awsApiRequestSOAP.call( + this, + `${bucketName}.s3`, + 'PUT', + `${path}${fileName}`, + body, + qs, + headers, + {}, + region, + ); } returnData.push({ success: true }); } diff --git a/packages/nodes-base/nodes/Aws/S3/BucketDescription.ts b/packages/nodes-base/nodes/Aws/S3/BucketDescription.ts index 0cf93752ebd8a..a5bfd0aae1c29 100644 --- a/packages/nodes-base/nodes/Aws/S3/BucketDescription.ts +++ b/packages/nodes-base/nodes/Aws/S3/BucketDescription.ts @@ -1,6 +1,4 @@ -import { - INodeProperties, -} from 'n8n-workflow'; +import { INodeProperties } from 'n8n-workflow'; export const bucketOperations: INodeProperties[] = [ { @@ -10,9 +8,7 @@ export const bucketOperations: INodeProperties[] = [ noDataExpression: true, displayOptions: { show: { - resource: [ - 'bucket', - ], + resource: ['bucket'], }, }, options: [ @@ -46,10 +42,9 @@ export const bucketOperations: INodeProperties[] = [ ]; export const bucketFields: INodeProperties[] = [ - -/* -------------------------------------------------------------------------- */ -/* bucket:create */ -/* -------------------------------------------------------------------------- */ + /* -------------------------------------------------------------------------- */ + /* bucket:create */ + /* -------------------------------------------------------------------------- */ { displayName: 'Name', name: 'name', @@ -58,12 +53,8 @@ export const bucketFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'bucket', - ], - operation: [ - 'create', - ], + resource: ['bucket'], + operation: ['create'], }, }, description: 'A succinct description of the nature, symptoms, cause, or effect of the bucket', @@ -75,12 +66,8 @@ export const bucketFields: INodeProperties[] = [ placeholder: 'Add Field', displayOptions: { show: { - resource: [ - 'bucket', - ], - operation: [ - 'create', - ], + resource: ['bucket'], + operation: ['create'], }, }, default: {}, @@ -122,7 +109,8 @@ export const bucketFields: INodeProperties[] = [ name: 'grantFullControl', type: 'boolean', default: false, - description: 'Whether to allow grantee the read, write, read ACP, and write ACP permissions on the bucket', + description: + 'Whether to allow grantee the read, write, read ACP, and write ACP permissions on the bucket', }, { displayName: 'Grant Read', @@ -143,7 +131,8 @@ export const bucketFields: INodeProperties[] = [ name: 'grantWrite', type: 'boolean', default: false, - description: 'Whether to allow grantee to create, overwrite, and delete any object in the bucket', + description: + 'Whether to allow grantee to create, overwrite, and delete any object in the bucket', }, { displayName: 'Grant Write ACP', @@ -157,14 +146,15 @@ export const bucketFields: INodeProperties[] = [ name: 'region', type: 'string', default: '', - description: 'Region you want to create the bucket in, by default the buckets are created on the region defined on the credentials', + description: + 'Region you want to create the bucket in, by default the buckets are created on the region defined on the credentials', }, ], }, -/* -------------------------------------------------------------------------- */ -/* bucket:delete */ -/* -------------------------------------------------------------------------- */ + /* -------------------------------------------------------------------------- */ + /* bucket:delete */ + /* -------------------------------------------------------------------------- */ { displayName: 'Name', name: 'name', @@ -173,32 +163,24 @@ export const bucketFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'bucket', - ], - operation: [ - 'delete', - ], + resource: ['bucket'], + operation: ['delete'], }, }, description: 'Name of the AWS S3 bucket to delete', }, -/* -------------------------------------------------------------------------- */ -/* bucket:getAll */ -/* -------------------------------------------------------------------------- */ + /* -------------------------------------------------------------------------- */ + /* bucket:getAll */ + /* -------------------------------------------------------------------------- */ { displayName: 'Return All', name: 'returnAll', type: 'boolean', displayOptions: { show: { - operation: [ - 'getAll', - ], - resource: [ - 'bucket', - ], + operation: ['getAll'], + resource: ['bucket'], }, }, default: false, @@ -210,15 +192,9 @@ export const bucketFields: INodeProperties[] = [ type: 'number', displayOptions: { show: { - operation: [ - 'getAll', - ], - resource: [ - 'bucket', - ], - returnAll: [ - false, - ], + operation: ['getAll'], + resource: ['bucket'], + returnAll: [false], }, }, typeOptions: { @@ -228,9 +204,9 @@ export const bucketFields: INodeProperties[] = [ default: 100, description: 'Max number of results to return', }, -/* -------------------------------------------------------------------------- */ -/* bucket:search */ -/* -------------------------------------------------------------------------- */ + /* -------------------------------------------------------------------------- */ + /* bucket:search */ + /* -------------------------------------------------------------------------- */ { displayName: 'Bucket Name', name: 'bucketName', @@ -239,12 +215,8 @@ export const bucketFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'bucket', - ], - operation: [ - 'search', - ], + resource: ['bucket'], + operation: ['search'], }, }, }, @@ -254,12 +226,8 @@ export const bucketFields: INodeProperties[] = [ type: 'boolean', displayOptions: { show: { - operation: [ - 'search', - ], - resource: [ - 'bucket', - ], + operation: ['search'], + resource: ['bucket'], }, }, default: false, @@ -271,15 +239,9 @@ export const bucketFields: INodeProperties[] = [ type: 'number', displayOptions: { show: { - operation: [ - 'search', - ], - resource: [ - 'bucket', - ], - returnAll: [ - false, - ], + operation: ['search'], + resource: ['bucket'], + returnAll: [false], }, }, typeOptions: { @@ -296,12 +258,8 @@ export const bucketFields: INodeProperties[] = [ placeholder: 'Add Field', displayOptions: { show: { - resource: [ - 'bucket', - ], - operation: [ - 'search', - ], + resource: ['bucket'], + operation: ['search'], }, }, default: {}, @@ -332,7 +290,8 @@ export const bucketFields: INodeProperties[] = [ type: 'boolean', default: false, // eslint-disable-next-line n8n-nodes-base/node-param-description-boolean-without-whether - description: 'The owner field is not present in listV2 by default, if you want to return owner field with each key in the result then set the fetch owner field to true', + description: + 'The owner field is not present in listV2 by default, if you want to return owner field with each key in the result then set the fetch owner field to true', }, { displayName: 'Prefix', @@ -346,14 +305,16 @@ export const bucketFields: INodeProperties[] = [ name: 'requesterPays', type: 'boolean', default: false, - description: 'Whether the requester will pay for requests and data transfer. While Requester Pays is enabled, anonymous access to this bucket is disabled.', + description: + 'Whether the requester will pay for requests and data transfer. While Requester Pays is enabled, anonymous access to this bucket is disabled.', }, { displayName: 'Start After', name: 'startAfter', type: 'string', default: '', - description: 'StartAfter is where you want Amazon S3 to start listing from. Amazon S3 starts listing after this specified key.', + description: + 'StartAfter is where you want Amazon S3 to start listing from. Amazon S3 starts listing after this specified key.', }, ], }, diff --git a/packages/nodes-base/nodes/Aws/S3/FileDescription.ts b/packages/nodes-base/nodes/Aws/S3/FileDescription.ts index 386575dda73cf..f6bd10dabfed0 100644 --- a/packages/nodes-base/nodes/Aws/S3/FileDescription.ts +++ b/packages/nodes-base/nodes/Aws/S3/FileDescription.ts @@ -1,6 +1,4 @@ -import { - INodeProperties, -} from 'n8n-workflow'; +import { INodeProperties } from 'n8n-workflow'; export const fileOperations: INodeProperties[] = [ { @@ -10,9 +8,7 @@ export const fileOperations: INodeProperties[] = [ noDataExpression: true, displayOptions: { show: { - resource: [ - 'file', - ], + resource: ['file'], }, }, options: [ @@ -52,10 +48,9 @@ export const fileOperations: INodeProperties[] = [ ]; export const fileFields: INodeProperties[] = [ - -/* -------------------------------------------------------------------------- */ -/* file:copy */ -/* -------------------------------------------------------------------------- */ + /* -------------------------------------------------------------------------- */ + /* file:copy */ + /* -------------------------------------------------------------------------- */ { displayName: 'Source Path', name: 'sourcePath', @@ -65,15 +60,12 @@ export const fileFields: INodeProperties[] = [ placeholder: '/bucket/my-image.jpg', displayOptions: { show: { - resource: [ - 'file', - ], - operation: [ - 'copy', - ], + resource: ['file'], + operation: ['copy'], }, }, - description: 'The name of the source bucket and key name of the source object, separated by a slash (/)', + description: + 'The name of the source bucket and key name of the source object, separated by a slash (/)', }, { displayName: 'Destination Path', @@ -84,15 +76,12 @@ export const fileFields: INodeProperties[] = [ placeholder: '/bucket/my-second-image.jpg', displayOptions: { show: { - resource: [ - 'file', - ], - operation: [ - 'copy', - ], + resource: ['file'], + operation: ['copy'], }, }, - description: 'The name of the destination bucket and key name of the destination object, separated by a slash (/)', + description: + 'The name of the destination bucket and key name of the destination object, separated by a slash (/)', }, { displayName: 'Additional Fields', @@ -101,12 +90,8 @@ export const fileFields: INodeProperties[] = [ placeholder: 'Add Field', displayOptions: { show: { - resource: [ - 'file', - ], - operation: [ - 'copy', - ], + resource: ['file'], + operation: ['copy'], }, }, default: {}, @@ -153,7 +138,8 @@ export const fileFields: INodeProperties[] = [ name: 'grantFullControl', type: 'boolean', default: false, - description: 'Whether to give the grantee READ, READ_ACP, and WRITE_ACP permissions on the object', + description: + 'Whether to give the grantee READ, READ_ACP, and WRITE_ACP permissions on the object', }, { displayName: 'Grant Read', @@ -205,7 +191,7 @@ export const fileFields: INodeProperties[] = [ name: 'lockRetainUntilDate', type: 'dateTime', default: '', - description: 'The date and time when you want this object\'s Object Lock to expire', + description: "The date and time when you want this object's Object Lock to expire", }, { displayName: 'Metadata Directive', @@ -222,14 +208,16 @@ export const fileFields: INodeProperties[] = [ }, ], default: '', - description: 'Specifies whether the metadata is copied from the source object or replaced with metadata provided in the request', + description: + 'Specifies whether the metadata is copied from the source object or replaced with metadata provided in the request', }, { displayName: 'Requester Pays', name: 'requesterPays', type: 'boolean', default: false, - description: 'Whether the requester will pay for requests and data transfer. While Requester Pays is enabled, anonymous access to this bucket is disabled.', + description: + 'Whether the requester will pay for requests and data transfer. While Requester Pays is enabled, anonymous access to this bucket is disabled.', }, { displayName: 'Server Side Encryption', @@ -246,7 +234,8 @@ export const fileFields: INodeProperties[] = [ }, ], default: '', - description: 'The server-side encryption algorithm used when storing this object in Amazon S3', + description: + 'The server-side encryption algorithm used when storing this object in Amazon S3', }, { displayName: 'Server Side Encryption Context', @@ -267,14 +256,16 @@ export const fileFields: INodeProperties[] = [ name: 'serversideEncryptionCustomerAlgorithm', type: 'string', default: '', - description: 'Specifies the algorithm to use to when encrypting the object (for example, AES256)', + description: + 'Specifies the algorithm to use to when encrypting the object (for example, AES256)', }, { displayName: 'Server Side Encryption Customer Key', name: 'serversideEncryptionCustomerKey', type: 'string', default: '', - description: 'Specifies the customer-provided encryption key for Amazon S3 to use in encrypting data', + description: + 'Specifies the customer-provided encryption key for Amazon S3 to use in encrypting data', }, { displayName: 'Server Side Encryption Customer Key MD5', @@ -331,13 +322,14 @@ export const fileFields: INodeProperties[] = [ }, ], default: '', - description: 'Specifies whether the metadata is copied from the source object or replaced with metadata provided in the request', + description: + 'Specifies whether the metadata is copied from the source object or replaced with metadata provided in the request', }, ], }, -/* -------------------------------------------------------------------------- */ -/* file:upload */ -/* -------------------------------------------------------------------------- */ + /* -------------------------------------------------------------------------- */ + /* file:upload */ + /* -------------------------------------------------------------------------- */ { displayName: 'Bucket Name', name: 'bucketName', @@ -346,12 +338,8 @@ export const fileFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'file', - ], - operation: [ - 'upload', - ], + resource: ['file'], + operation: ['upload'], }, }, }, @@ -364,15 +352,9 @@ export const fileFields: INodeProperties[] = [ required: true, displayOptions: { show: { - resource: [ - 'file', - ], - operation: [ - 'upload', - ], - binaryData: [ - false, - ], + resource: ['file'], + operation: ['upload'], + binaryData: [false], }, }, }, @@ -383,15 +365,9 @@ export const fileFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'file', - ], - operation: [ - 'upload', - ], - binaryData: [ - true, - ], + resource: ['file'], + operation: ['upload'], + binaryData: [true], }, }, description: 'If not set the binary data filename will be used', @@ -403,12 +379,8 @@ export const fileFields: INodeProperties[] = [ default: true, displayOptions: { show: { - operation: [ - 'upload', - ], - resource: [ - 'file', - ], + operation: ['upload'], + resource: ['file'], }, }, description: 'Whether the data to upload should be taken from binary field', @@ -420,15 +392,9 @@ export const fileFields: INodeProperties[] = [ default: '', displayOptions: { show: { - operation: [ - 'upload', - ], - resource: [ - 'file', - ], - binaryData: [ - false, - ], + operation: ['upload'], + resource: ['file'], + binaryData: [false], }, }, placeholder: '', @@ -442,17 +408,10 @@ export const fileFields: INodeProperties[] = [ required: true, displayOptions: { show: { - operation: [ - 'upload', - ], - resource: [ - 'file', - ], - binaryData: [ - true, - ], + operation: ['upload'], + resource: ['file'], + binaryData: [true], }, - }, placeholder: '', description: 'Name of the binary property which contains the data for the file to be uploaded', @@ -464,12 +423,8 @@ export const fileFields: INodeProperties[] = [ placeholder: 'Add Field', displayOptions: { show: { - resource: [ - 'file', - ], - operation: [ - 'upload', - ], + resource: ['file'], + operation: ['upload'], }, }, default: {}, @@ -516,7 +471,8 @@ export const fileFields: INodeProperties[] = [ name: 'grantFullControl', type: 'boolean', default: false, - description: 'Whether to give the grantee READ, READ_ACP, and WRITE_ACP permissions on the object', + description: + 'Whether to give the grantee READ, READ_ACP, and WRITE_ACP permissions on the object', }, { displayName: 'Grant Read', @@ -568,7 +524,7 @@ export const fileFields: INodeProperties[] = [ name: 'lockRetainUntilDate', type: 'dateTime', default: '', - description: 'The date and time when you want this object\'s Object Lock to expire', + description: "The date and time when you want this object's Object Lock to expire", }, { displayName: 'Parent Folder Key', @@ -582,7 +538,8 @@ export const fileFields: INodeProperties[] = [ name: 'requesterPays', type: 'boolean', default: false, - description: 'Whether the requester will pay for requests and data transfer. While Requester Pays is enabled, anonymous access to this bucket is disabled.', + description: + 'Whether the requester will pay for requests and data transfer. While Requester Pays is enabled, anonymous access to this bucket is disabled.', }, { displayName: 'Server Side Encryption', @@ -599,7 +556,8 @@ export const fileFields: INodeProperties[] = [ }, ], default: '', - description: 'The server-side encryption algorithm used when storing this object in Amazon S3', + description: + 'The server-side encryption algorithm used when storing this object in Amazon S3', }, { displayName: 'Server Side Encryption Context', @@ -620,14 +578,16 @@ export const fileFields: INodeProperties[] = [ name: 'serversideEncryptionCustomerAlgorithm', type: 'string', default: '', - description: 'Specifies the algorithm to use to when encrypting the object (for example, AES256)', + description: + 'Specifies the algorithm to use to when encrypting the object (for example, AES256)', }, { displayName: 'Server Side Encryption Customer Key', name: 'serversideEncryptionCustomerKey', type: 'string', default: '', - description: 'Specifies the customer-provided encryption key for Amazon S3 to use in encrypting data', + description: + 'Specifies the customer-provided encryption key for Amazon S3 to use in encrypting data', }, { displayName: 'Server Side Encryption Customer Key MD5', @@ -682,12 +642,8 @@ export const fileFields: INodeProperties[] = [ }, displayOptions: { show: { - resource: [ - 'file', - ], - operation: [ - 'upload', - ], + resource: ['file'], + operation: ['upload'], }, }, options: [ @@ -712,9 +668,9 @@ export const fileFields: INodeProperties[] = [ ], description: 'Optional extra headers to add to the message (most headers are allowed)', }, -/* -------------------------------------------------------------------------- */ -/* file:download */ -/* -------------------------------------------------------------------------- */ + /* -------------------------------------------------------------------------- */ + /* file:download */ + /* -------------------------------------------------------------------------- */ { displayName: 'Bucket Name', name: 'bucketName', @@ -723,12 +679,8 @@ export const fileFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'file', - ], - operation: [ - 'download', - ], + resource: ['file'], + operation: ['download'], }, }, }, @@ -740,12 +692,8 @@ export const fileFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'file', - ], - operation: [ - 'download', - ], + resource: ['file'], + operation: ['download'], }, }, }, @@ -757,19 +705,15 @@ export const fileFields: INodeProperties[] = [ default: 'data', displayOptions: { show: { - operation: [ - 'download', - ], - resource: [ - 'file', - ], + operation: ['download'], + resource: ['file'], }, }, description: 'Name of the binary property to which to write the data of the read file', }, -/* -------------------------------------------------------------------------- */ -/* file:delete */ -/* -------------------------------------------------------------------------- */ + /* -------------------------------------------------------------------------- */ + /* file:delete */ + /* -------------------------------------------------------------------------- */ { displayName: 'Bucket Name', name: 'bucketName', @@ -778,12 +722,8 @@ export const fileFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'file', - ], - operation: [ - 'delete', - ], + resource: ['file'], + operation: ['delete'], }, }, }, @@ -795,12 +735,8 @@ export const fileFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'file', - ], - operation: [ - 'delete', - ], + resource: ['file'], + operation: ['delete'], }, }, }, @@ -812,12 +748,8 @@ export const fileFields: INodeProperties[] = [ default: {}, displayOptions: { show: { - resource: [ - 'file', - ], - operation: [ - 'delete', - ], + resource: ['file'], + operation: ['delete'], }, }, options: [ @@ -829,9 +761,9 @@ export const fileFields: INodeProperties[] = [ }, ], }, -/* -------------------------------------------------------------------------- */ -/* file:getAll */ -/* -------------------------------------------------------------------------- */ + /* -------------------------------------------------------------------------- */ + /* file:getAll */ + /* -------------------------------------------------------------------------- */ { displayName: 'Bucket Name', name: 'bucketName', @@ -840,12 +772,8 @@ export const fileFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'file', - ], - operation: [ - 'getAll', - ], + resource: ['file'], + operation: ['getAll'], }, }, }, @@ -855,12 +783,8 @@ export const fileFields: INodeProperties[] = [ type: 'boolean', displayOptions: { show: { - operation: [ - 'getAll', - ], - resource: [ - 'file', - ], + operation: ['getAll'], + resource: ['file'], }, }, default: false, @@ -872,15 +796,9 @@ export const fileFields: INodeProperties[] = [ type: 'number', displayOptions: { show: { - operation: [ - 'getAll', - ], - resource: [ - 'file', - ], - returnAll: [ - false, - ], + operation: ['getAll'], + resource: ['file'], + returnAll: [false], }, }, typeOptions: { @@ -898,12 +816,8 @@ export const fileFields: INodeProperties[] = [ default: {}, displayOptions: { show: { - resource: [ - 'file', - ], - operation: [ - 'getAll', - ], + resource: ['file'], + operation: ['getAll'], }, }, options: [ @@ -913,7 +827,8 @@ export const fileFields: INodeProperties[] = [ type: 'boolean', default: false, // eslint-disable-next-line n8n-nodes-base/node-param-description-boolean-without-whether - description: 'The owner field is not present in listV2 by default, if you want to return owner field with each key in the result then set the fetch owner field to true', + description: + 'The owner field is not present in listV2 by default, if you want to return owner field with each key in the result then set the fetch owner field to true', }, { displayName: 'Folder Key', diff --git a/packages/nodes-base/nodes/Aws/S3/FolderDescription.ts b/packages/nodes-base/nodes/Aws/S3/FolderDescription.ts index 2a0c003e1dc66..c089d646a2980 100644 --- a/packages/nodes-base/nodes/Aws/S3/FolderDescription.ts +++ b/packages/nodes-base/nodes/Aws/S3/FolderDescription.ts @@ -1,6 +1,4 @@ -import { - INodeProperties, -} from 'n8n-workflow'; +import { INodeProperties } from 'n8n-workflow'; export const folderOperations: INodeProperties[] = [ { @@ -10,9 +8,7 @@ export const folderOperations: INodeProperties[] = [ noDataExpression: true, displayOptions: { show: { - resource: [ - 'folder', - ], + resource: ['folder'], }, }, options: [ @@ -40,10 +36,9 @@ export const folderOperations: INodeProperties[] = [ ]; export const folderFields: INodeProperties[] = [ - -/* -------------------------------------------------------------------------- */ -/* folder:create */ -/* -------------------------------------------------------------------------- */ + /* -------------------------------------------------------------------------- */ + /* folder:create */ + /* -------------------------------------------------------------------------- */ { displayName: 'Bucket Name', name: 'bucketName', @@ -52,12 +47,8 @@ export const folderFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'folder', - ], - operation: [ - 'create', - ], + resource: ['folder'], + operation: ['create'], }, }, }, @@ -69,12 +60,8 @@ export const folderFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'folder', - ], - operation: [ - 'create', - ], + resource: ['folder'], + operation: ['create'], }, }, }, @@ -85,12 +72,8 @@ export const folderFields: INodeProperties[] = [ placeholder: 'Add Field', displayOptions: { show: { - resource: [ - 'folder', - ], - operation: [ - 'create', - ], + resource: ['folder'], + operation: ['create'], }, }, default: {}, @@ -107,7 +90,8 @@ export const folderFields: INodeProperties[] = [ name: 'requesterPays', type: 'boolean', default: false, - description: 'Whether the requester will pay for requests and data transfer. While Requester Pays is enabled, anonymous access to this bucket is disabled.', + description: + 'Whether the requester will pay for requests and data transfer. While Requester Pays is enabled, anonymous access to this bucket is disabled.', }, { displayName: 'Storage Class', @@ -148,9 +132,9 @@ export const folderFields: INodeProperties[] = [ }, ], }, -/* -------------------------------------------------------------------------- */ -/* folder:delete */ -/* -------------------------------------------------------------------------- */ + /* -------------------------------------------------------------------------- */ + /* folder:delete */ + /* -------------------------------------------------------------------------- */ { displayName: 'Bucket Name', name: 'bucketName', @@ -159,12 +143,8 @@ export const folderFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'folder', - ], - operation: [ - 'delete', - ], + resource: ['folder'], + operation: ['delete'], }, }, }, @@ -176,18 +156,14 @@ export const folderFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'folder', - ], - operation: [ - 'delete', - ], + resource: ['folder'], + operation: ['delete'], }, }, }, -/* -------------------------------------------------------------------------- */ -/* folder:getAll */ -/* -------------------------------------------------------------------------- */ + /* -------------------------------------------------------------------------- */ + /* folder:getAll */ + /* -------------------------------------------------------------------------- */ { displayName: 'Bucket Name', name: 'bucketName', @@ -196,12 +172,8 @@ export const folderFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'folder', - ], - operation: [ - 'getAll', - ], + resource: ['folder'], + operation: ['getAll'], }, }, }, @@ -211,12 +183,8 @@ export const folderFields: INodeProperties[] = [ type: 'boolean', displayOptions: { show: { - operation: [ - 'getAll', - ], - resource: [ - 'folder', - ], + operation: ['getAll'], + resource: ['folder'], }, }, default: false, @@ -228,15 +196,9 @@ export const folderFields: INodeProperties[] = [ type: 'number', displayOptions: { show: { - operation: [ - 'getAll', - ], - resource: [ - 'folder', - ], - returnAll: [ - false, - ], + operation: ['getAll'], + resource: ['folder'], + returnAll: [false], }, }, typeOptions: { @@ -254,12 +216,8 @@ export const folderFields: INodeProperties[] = [ default: {}, displayOptions: { show: { - resource: [ - 'folder', - ], - operation: [ - 'getAll', - ], + resource: ['folder'], + operation: ['getAll'], }, }, options: [ @@ -269,7 +227,8 @@ export const folderFields: INodeProperties[] = [ type: 'boolean', default: false, // eslint-disable-next-line n8n-nodes-base/node-param-description-boolean-without-whether - description: 'The owner field is not present in listV2 by default, if you want to return owner field with each key in the result then set the fetch owner field to true', + description: + 'The owner field is not present in listV2 by default, if you want to return owner field with each key in the result then set the fetch owner field to true', }, { displayName: 'Folder Key', diff --git a/packages/nodes-base/nodes/Aws/S3/GenericFunctions.ts b/packages/nodes-base/nodes/Aws/S3/GenericFunctions.ts index d2d7d4d19cca6..42c6537596ec6 100644 --- a/packages/nodes-base/nodes/Aws/S3/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Aws/S3/GenericFunctions.ts @@ -1,23 +1,12 @@ -import { - URL, -} from 'url'; +import { URL } from 'url'; -import { - Request, - sign, -} from 'aws4'; +import { Request, sign } from 'aws4'; -import { - get, -} from 'lodash'; +import { get } from 'lodash'; -import { - OptionsWithUri, -} from 'request'; +import { OptionsWithUri } from 'request'; -import { - parseString, -} from 'xml2js'; +import { parseString } from 'xml2js'; import { IExecuteFunctions, @@ -26,21 +15,41 @@ import { IWebhookFunctions, } from 'n8n-core'; -import { - IDataObject, JsonObject, NodeApiError, NodeOperationError, - } from 'n8n-workflow'; - -export async function awsApiRequest(this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions | IWebhookFunctions, service: string, method: string, path: string, body?: string | Buffer, query: IDataObject = {}, headers?: object, option: IDataObject = {}, region?: string): Promise { // tslint:disable-line:no-any +import { IDataObject, JsonObject, NodeApiError, NodeOperationError } from 'n8n-workflow'; + +export async function awsApiRequest( + this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions | IWebhookFunctions, + service: string, + method: string, + path: string, + body?: string | Buffer, + query: IDataObject = {}, + headers?: object, + option: IDataObject = {}, + region?: string, + // tslint:disable-next-line:no-any +): Promise { const credentials = await this.getCredentials('aws'); - const endpoint = new URL(((credentials.s3Endpoint as string || '').replace('{region}', credentials.region as string) || `https://${service}.${credentials.region}.amazonaws.com`) + path); + const endpoint = new URL( + (((credentials.s3Endpoint as string) || '').replace('{region}', credentials.region as string) || + `https://${service}.${credentials.region}.amazonaws.com`) + path, + ); // Sign AWS API request with the user credentials - const signOpts = {headers: headers || {}, host: endpoint.host, method, path: `${endpoint.pathname}?${queryToString(query).replace(/\+/g, '%2B')}`, body} as Request; + const signOpts = { + headers: headers || {}, + host: endpoint.host, + method, + path: `${endpoint.pathname}?${queryToString(query).replace(/\+/g, '%2B')}`, + body, + } as Request; const securityHeaders = { accessKeyId: `${credentials.accessKeyId}`.trim(), secretAccessKey: `${credentials.secretAccessKey}`.trim(), - sessionToken: credentials.temporaryCredentials ? `${credentials.sessionToken}`.trim() : undefined, + sessionToken: credentials.temporaryCredentials + ? `${credentials.sessionToken}`.trim() + : undefined, }; sign(signOpts, securityHeaders); @@ -59,12 +68,33 @@ export async function awsApiRequest(this: IHookFunctions | IExecuteFunctions | I try { return await this.helpers.request!(options); } catch (error) { - throw new NodeApiError(this.getNode(), (error as JsonObject)); + throw new NodeApiError(this.getNode(), error as JsonObject); } } -export async function awsApiRequestREST(this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions, service: string, method: string, path: string, body?: string, query: IDataObject = {}, headers?: object, options: IDataObject = {}, region?: string): Promise { // tslint:disable-line:no-any - const response = await awsApiRequest.call(this, service, method, path, body, query, headers, options, region); +export async function awsApiRequestREST( + this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions, + service: string, + method: string, + path: string, + body?: string, + query: IDataObject = {}, + headers?: object, + options: IDataObject = {}, + region?: string, + // tslint:disable-next-line:no-any +): Promise { + const response = await awsApiRequest.call( + this, + service, + method, + path, + body, + query, + headers, + options, + region, + ); try { return JSON.parse(response); } catch (error) { @@ -72,8 +102,29 @@ export async function awsApiRequestREST(this: IHookFunctions | IExecuteFunctions } } -export async function awsApiRequestSOAP(this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions | IWebhookFunctions, service: string, method: string, path: string, body?: string | Buffer, query: IDataObject = {}, headers?: object, option: IDataObject = {}, region?: string): Promise { // tslint:disable-line:no-any - const response = await awsApiRequest.call(this, service, method, path, body, query, headers, option, region); +export async function awsApiRequestSOAP( + this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions | IWebhookFunctions, + service: string, + method: string, + path: string, + body?: string | Buffer, + query: IDataObject = {}, + headers?: object, + option: IDataObject = {}, + region?: string, + // tslint:disable-next-line:no-any +): Promise { + const response = await awsApiRequest.call( + this, + service, + method, + path, + body, + query, + headers, + option, + region, + ); try { return await new Promise((resolve, reject) => { parseString(response, { explicitArray: false }, (err, data) => { @@ -88,18 +139,42 @@ export async function awsApiRequestSOAP(this: IHookFunctions | IExecuteFunctions } } -export async function awsApiRequestSOAPAllItems(this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions | IWebhookFunctions, propertyName: string, service: string, method: string, path: string, body?: string, query: IDataObject = {}, headers: IDataObject = {}, option: IDataObject = {}, region?: string): Promise { // tslint:disable-line:no-any - +export async function awsApiRequestSOAPAllItems( + this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions | IWebhookFunctions, + propertyName: string, + service: string, + method: string, + path: string, + body?: string, + query: IDataObject = {}, + headers: IDataObject = {}, + option: IDataObject = {}, + region?: string, + // tslint:disable-next-line:no-any +): Promise { const returnData: IDataObject[] = []; let responseData; do { - responseData = await awsApiRequestSOAP.call(this, service, method, path, body, query, headers, option, region); + responseData = await awsApiRequestSOAP.call( + this, + service, + method, + path, + body, + query, + headers, + option, + region, + ); //https://forums.aws.amazon.com/thread.jspa?threadID=55746 if (get(responseData, `${propertyName.split('.')[0]}.NextContinuationToken`)) { - query['continuation-token'] = get(responseData, `${propertyName.split('.')[0]}.NextContinuationToken`); + query['continuation-token'] = get( + responseData, + `${propertyName.split('.')[0]}.NextContinuationToken`, + ); } if (get(responseData, propertyName)) { if (Array.isArray(get(responseData, propertyName))) { @@ -120,5 +195,7 @@ export async function awsApiRequestSOAPAllItems(this: IHookFunctions | IExecuteF } function queryToString(params: IDataObject) { - return Object.keys(params).map(key => key + '=' + params[key]).join('&'); + return Object.keys(params) + .map((key) => key + '=' + params[key]) + .join('&'); } diff --git a/packages/nodes-base/nodes/Aws/SES/AwsSes.node.ts b/packages/nodes-base/nodes/Aws/SES/AwsSes.node.ts index 72e13db4f6fa4..0b2ede1b3b24a 100644 --- a/packages/nodes-base/nodes/Aws/SES/AwsSes.node.ts +++ b/packages/nodes-base/nodes/Aws/SES/AwsSes.node.ts @@ -1,6 +1,4 @@ -import { - IExecuteFunctions, -} from 'n8n-core'; +import { IExecuteFunctions } from 'n8n-core'; import { IDataObject, @@ -12,10 +10,7 @@ import { NodeOperationError, } from 'n8n-workflow'; -import { - awsApiRequestSOAP, - awsApiRequestSOAPAllItems, -} from './GenericFunctions'; +import { awsApiRequestSOAP, awsApiRequestSOAPAllItems } from './GenericFunctions'; function setParameter(params: string[], base: string, values: string[]) { for (let i = 0; i < values.length; i++) { @@ -72,9 +67,7 @@ export class AwsSes implements INodeType { noDataExpression: true, displayOptions: { show: { - resource: [ - 'customVerificationEmail', - ], + resource: ['customVerificationEmail'], }, }, options: [ @@ -99,7 +92,8 @@ export class AwsSes implements INodeType { { name: 'Get All', value: 'getAll', - description: 'Get all the existing custom verification email templates for your account', + description: + 'Get all the existing custom verification email templates for your account', action: 'Get all custom verifications', }, { @@ -124,12 +118,8 @@ export class AwsSes implements INodeType { type: 'string', displayOptions: { show: { - resource: [ - 'customVerificationEmail', - ], - operation: [ - 'create', - ], + resource: ['customVerificationEmail'], + operation: ['create'], }, }, required: true, @@ -142,12 +132,8 @@ export class AwsSes implements INodeType { type: 'string', displayOptions: { show: { - resource: [ - 'customVerificationEmail', - ], - operation: [ - 'create', - ], + resource: ['customVerificationEmail'], + operation: ['create'], }, }, default: '', @@ -162,15 +148,12 @@ export class AwsSes implements INodeType { }, displayOptions: { show: { - resource: [ - 'customVerificationEmail', - ], - operation: [ - 'create', - ], + resource: ['customVerificationEmail'], + operation: ['create'], }, }, - description: 'The content of the custom verification email. The total size of the email must be less than 10 MB. The message body may contain HTML', + description: + 'The content of the custom verification email. The total size of the email must be less than 10 MB. The message body may contain HTML', default: '', }, { @@ -179,12 +162,8 @@ export class AwsSes implements INodeType { type: 'string', displayOptions: { show: { - resource: [ - 'customVerificationEmail', - ], - operation: [ - 'create', - ], + resource: ['customVerificationEmail'], + operation: ['create'], }, }, default: '', @@ -197,16 +176,13 @@ export class AwsSes implements INodeType { type: 'string', displayOptions: { show: { - resource: [ - 'customVerificationEmail', - ], - operation: [ - 'create', - ], + resource: ['customVerificationEmail'], + operation: ['create'], }, }, required: true, - description: 'The URL that the recipient of the verification email is sent to if his or her address is successfully verified', + description: + 'The URL that the recipient of the verification email is sent to if his or her address is successfully verified', default: '', }, { @@ -215,16 +191,13 @@ export class AwsSes implements INodeType { type: 'string', displayOptions: { show: { - resource: [ - 'customVerificationEmail', - ], - operation: [ - 'create', - ], + resource: ['customVerificationEmail'], + operation: ['create'], }, }, required: true, - description: 'The URL that the recipient of the verification email is sent to if his or her address is not successfully verified', + description: + 'The URL that the recipient of the verification email is sent to if his or her address is not successfully verified', default: '', }, @@ -235,12 +208,8 @@ export class AwsSes implements INodeType { placeholder: 'name@email.com', displayOptions: { show: { - resource: [ - 'customVerificationEmail', - ], - operation: [ - 'send', - ], + resource: ['customVerificationEmail'], + operation: ['send'], }, }, default: '', @@ -253,17 +222,14 @@ export class AwsSes implements INodeType { type: 'string', displayOptions: { show: { - resource: [ - 'customVerificationEmail', - ], - operation: [ - 'send', - ], + resource: ['customVerificationEmail'], + operation: ['send'], }, }, default: '', required: true, - description: 'The name of the custom verification email template to use when sending the verification email', + description: + 'The name of the custom verification email template to use when sending the verification email', }, { displayName: 'Additional Fields', @@ -273,12 +239,8 @@ export class AwsSes implements INodeType { default: {}, displayOptions: { show: { - resource: [ - 'customVerificationEmail', - ], - operation: [ - 'send', - ], + resource: ['customVerificationEmail'], + operation: ['send'], }, }, options: [ @@ -298,14 +260,8 @@ export class AwsSes implements INodeType { type: 'string', displayOptions: { show: { - resource: [ - 'customVerificationEmail', - ], - operation: [ - 'update', - 'delete', - 'get', - ], + resource: ['customVerificationEmail'], + operation: ['update', 'delete', 'get'], }, }, default: '', @@ -319,12 +275,8 @@ export class AwsSes implements INodeType { default: {}, displayOptions: { show: { - resource: [ - 'customVerificationEmail', - ], - operation: [ - 'update', - ], + resource: ['customVerificationEmail'], + operation: ['update'], }, }, options: [ @@ -332,7 +284,8 @@ export class AwsSes implements INodeType { displayName: 'Failure Redirection URL', name: 'failureRedirectionURL', type: 'string', - description: 'The URL that the recipient of the verification email is sent to if his or her address is not successfully verified', + description: + 'The URL that the recipient of the verification email is sent to if his or her address is not successfully verified', default: '', }, { @@ -346,7 +299,8 @@ export class AwsSes implements INodeType { displayName: 'Success Redirection URL', name: 'successRedirectionURL', type: 'string', - description: 'The URL that the recipient of the verification email is sent to if his or her address is successfully verified', + description: + 'The URL that the recipient of the verification email is sent to if his or her address is successfully verified', default: '', }, { @@ -356,7 +310,8 @@ export class AwsSes implements INodeType { typeOptions: { alwaysOpenEditWindow: true, }, - description: 'The content of the custom verification email. The total size of the email must be less than 10 MB. The message body may contain HTML', + description: + 'The content of the custom verification email. The total size of the email must be less than 10 MB. The message body may contain HTML', default: '', }, { @@ -374,12 +329,8 @@ export class AwsSes implements INodeType { type: 'boolean', displayOptions: { show: { - resource: [ - 'customVerificationEmail', - ], - operation: [ - 'getAll', - ], + resource: ['customVerificationEmail'], + operation: ['getAll'], }, }, default: false, @@ -396,15 +347,9 @@ export class AwsSes implements INodeType { default: 20, displayOptions: { show: { - resource: [ - 'customVerificationEmail', - ], - operation: [ - 'getAll', - ], - returnAll: [ - false, - ], + resource: ['customVerificationEmail'], + operation: ['getAll'], + returnAll: [false], }, }, }, @@ -415,9 +360,7 @@ export class AwsSes implements INodeType { noDataExpression: true, displayOptions: { show: { - resource: [ - 'email', - ], + resource: ['email'], }, }, options: [ @@ -440,12 +383,8 @@ export class AwsSes implements INodeType { type: 'boolean', displayOptions: { show: { - resource: [ - 'email', - ], - operation: [ - 'send', - ], + resource: ['email'], + operation: ['send'], }, }, default: false, @@ -457,12 +396,8 @@ export class AwsSes implements INodeType { type: 'string', displayOptions: { show: { - resource: [ - 'email', - ], - operation: [ - 'send', - ], + resource: ['email'], + operation: ['send'], }, }, default: '', @@ -477,12 +412,8 @@ export class AwsSes implements INodeType { }, displayOptions: { show: { - resource: [ - 'email', - ], - operation: [ - 'send', - ], + resource: ['email'], + operation: ['send'], }, }, default: '', @@ -495,12 +426,8 @@ export class AwsSes implements INodeType { type: 'string', displayOptions: { show: { - resource: [ - 'email', - ], - operation: [ - 'send', - ], + resource: ['email'], + operation: ['send'], }, }, required: true, @@ -519,12 +446,8 @@ export class AwsSes implements INodeType { }, displayOptions: { show: { - resource: [ - 'email', - ], - operation: [ - 'send', - ], + resource: ['email'], + operation: ['send'], }, }, placeholder: 'info@example.com', @@ -539,16 +462,13 @@ export class AwsSes implements INodeType { }, displayOptions: { show: { - resource: [ - 'email', - ], - operation: [ - 'sendTemplate', - ], + resource: ['email'], + operation: ['sendTemplate'], }, }, default: '', - description: 'The ARN of the template to use when sending this email. Choose from the list, or specify an ID using an expression.', + description: + 'The ARN of the template to use when sending this email. Choose from the list, or specify an ID using an expression.', }, { displayName: 'From Email', @@ -556,12 +476,8 @@ export class AwsSes implements INodeType { type: 'string', displayOptions: { show: { - resource: [ - 'email', - ], - operation: [ - 'sendTemplate', - ], + resource: ['email'], + operation: ['sendTemplate'], }, }, required: true, @@ -580,12 +496,8 @@ export class AwsSes implements INodeType { }, displayOptions: { show: { - resource: [ - 'email', - ], - operation: [ - 'sendTemplate', - ], + resource: ['email'], + operation: ['sendTemplate'], }, }, placeholder: 'info@example.com', @@ -601,12 +513,8 @@ export class AwsSes implements INodeType { }, displayOptions: { show: { - resource: [ - 'email', - ], - operation: [ - 'sendTemplate', - ], + resource: ['email'], + operation: ['sendTemplate'], }, }, default: {}, @@ -639,13 +547,8 @@ export class AwsSes implements INodeType { default: {}, displayOptions: { show: { - resource: [ - 'email', - ], - operation: [ - 'send', - 'sendTemplate', - ], + resource: ['email'], + operation: ['send', 'sendTemplate'], }, }, options: [ @@ -694,7 +597,8 @@ export class AwsSes implements INodeType { displayName: 'Return Path', name: 'returnPath', type: 'string', - description: 'Email address that bounces and complaints will be forwarded to when feedback forwarding is enabled', + description: + 'Email address that bounces and complaints will be forwarded to when feedback forwarding is enabled', default: '', }, { @@ -720,9 +624,7 @@ export class AwsSes implements INodeType { noDataExpression: true, displayOptions: { show: { - resource: [ - 'template', - ], + resource: ['template'], }, }, options: [ @@ -765,15 +667,8 @@ export class AwsSes implements INodeType { type: 'string', displayOptions: { show: { - resource: [ - 'template', - ], - operation: [ - 'update', - 'create', - 'get', - 'delete', - ], + resource: ['template'], + operation: ['update', 'create', 'get', 'delete'], }, }, required: true, @@ -786,12 +681,8 @@ export class AwsSes implements INodeType { type: 'string', displayOptions: { show: { - resource: [ - 'template', - ], - operation: [ - 'create', - ], + resource: ['template'], + operation: ['create'], }, }, description: 'The subject line of the email', @@ -803,12 +694,8 @@ export class AwsSes implements INodeType { type: 'string', displayOptions: { show: { - resource: [ - 'template', - ], - operation: [ - 'create', - ], + resource: ['template'], + operation: ['create'], }, }, description: 'The HTML body of the email', @@ -822,12 +709,8 @@ export class AwsSes implements INodeType { default: {}, displayOptions: { show: { - resource: [ - 'template', - ], - operation: [ - 'create', - ], + resource: ['template'], + operation: ['create'], }, }, options: [ @@ -835,7 +718,8 @@ export class AwsSes implements INodeType { displayName: 'Text Part', name: 'textPart', type: 'string', - description: 'The email body that will be visible to recipients whose email clients do not display HTML', + description: + 'The email body that will be visible to recipients whose email clients do not display HTML', default: '', }, ], @@ -848,12 +732,8 @@ export class AwsSes implements INodeType { default: {}, displayOptions: { show: { - resource: [ - 'template', - ], - operation: [ - 'update', - ], + resource: ['template'], + operation: ['update'], }, }, options: [ @@ -861,7 +741,8 @@ export class AwsSes implements INodeType { displayName: 'Text Part', name: 'textPart', type: 'string', - description: 'The email body that will be visible to recipients whose email clients do not display HTML', + description: + 'The email body that will be visible to recipients whose email clients do not display HTML', default: '', }, { @@ -886,12 +767,8 @@ export class AwsSes implements INodeType { type: 'boolean', displayOptions: { show: { - resource: [ - 'template', - ], - operation: [ - 'getAll', - ], + resource: ['template'], + operation: ['getAll'], }, }, default: false, @@ -908,15 +785,9 @@ export class AwsSes implements INodeType { default: 20, displayOptions: { show: { - resource: [ - 'template', - ], - operation: [ - 'getAll', - ], - returnAll: [ - false, - ], + resource: ['template'], + operation: ['getAll'], + returnAll: [false], }, }, }, @@ -930,7 +801,13 @@ export class AwsSes implements INodeType { async getTemplates(this: ILoadOptionsFunctions): Promise { const returnData: INodePropertyOptions[] = []; - const templates = await awsApiRequestSOAPAllItems.call(this, 'ListTemplatesResponse.ListTemplatesResult.TemplatesMetadata.member', 'email', 'POST', '/?Action=ListTemplates'); + const templates = await awsApiRequestSOAPAllItems.call( + this, + 'ListTemplatesResponse.ListTemplatesResult.TemplatesMetadata.member', + 'email', + 'POST', + '/?Action=ListTemplates', + ); for (const template of templates) { const templateName = template.Name; @@ -957,14 +834,18 @@ export class AwsSes implements INodeType { for (let i = 0; i < items.length; i++) { try { if (resource === 'customVerificationEmail') { - if (operation === 'create') { - - const failureRedirectionURL = this.getNodeParameter('failureRedirectionURL', i) as string; + const failureRedirectionURL = this.getNodeParameter( + 'failureRedirectionURL', + i, + ) as string; const email = this.getNodeParameter('fromEmailAddress', i) as string; - const successRedirectionURL = this.getNodeParameter('successRedirectionURL', i) as string; + const successRedirectionURL = this.getNodeParameter( + 'successRedirectionURL', + i, + ) as string; const templateContent = this.getNodeParameter('templateContent', i) as string; @@ -982,13 +863,18 @@ export class AwsSes implements INodeType { `TemplateSubject=${templateSubject}`, ]; - responseData = await awsApiRequestSOAP.call(this, 'email', 'POST', '', params.join('&')); + responseData = await awsApiRequestSOAP.call( + this, + 'email', + 'POST', + '', + params.join('&'), + ); responseData = responseData.CreateCustomVerificationEmailTemplateResponse; } if (operation === 'delete') { - const templateName = this.getNodeParameter('templateName', i) as string; const params = [ @@ -996,42 +882,61 @@ export class AwsSes implements INodeType { `TemplateName=${templateName}`, ]; - responseData = await awsApiRequestSOAP.call(this, 'email', 'POST', '', params.join('&')); + responseData = await awsApiRequestSOAP.call( + this, + 'email', + 'POST', + '', + params.join('&'), + ); responseData = responseData.DeleteCustomVerificationEmailTemplateResponse; } if (operation === 'get') { - const templateName = this.getNodeParameter('templateName', i) as string; - const params = [ - `TemplateName=${templateName}`, - ]; + const params = [`TemplateName=${templateName}`]; - responseData = await awsApiRequestSOAP.call(this, 'email', 'POST', '/?Action=GetCustomVerificationEmailTemplate&' + params.join('&')); + responseData = await awsApiRequestSOAP.call( + this, + 'email', + 'POST', + '/?Action=GetCustomVerificationEmailTemplate&' + params.join('&'), + ); responseData = responseData.GetCustomVerificationEmailTemplateResponse; } if (operation === 'getAll') { - const returnAll = this.getNodeParameter('returnAll', i) as boolean; if (returnAll === true) { - responseData = await awsApiRequestSOAPAllItems.call(this, 'ListCustomVerificationEmailTemplatesResponse.ListCustomVerificationEmailTemplatesResult.CustomVerificationEmailTemplates.member', 'email', 'POST', '/?Action=ListCustomVerificationEmailTemplates'); - + responseData = await awsApiRequestSOAPAllItems.call( + this, + 'ListCustomVerificationEmailTemplatesResponse.ListCustomVerificationEmailTemplatesResult.CustomVerificationEmailTemplates.member', + 'email', + 'POST', + '/?Action=ListCustomVerificationEmailTemplates', + ); } else { const limit = this.getNodeParameter('limit', i) as number; - responseData = await awsApiRequestSOAP.call(this, 'email', 'GET', `/?Action=ListCustomVerificationEmailTemplates&MaxResults=${limit}`); - - responseData = responseData.ListCustomVerificationEmailTemplatesResponse.ListCustomVerificationEmailTemplatesResult.CustomVerificationEmailTemplates.member; + responseData = await awsApiRequestSOAP.call( + this, + 'email', + 'GET', + `/?Action=ListCustomVerificationEmailTemplates&MaxResults=${limit}`, + ); + + responseData = + responseData.ListCustomVerificationEmailTemplatesResponse + .ListCustomVerificationEmailTemplatesResult.CustomVerificationEmailTemplates + .member; } } if (operation === 'send') { - const email = this.getNodeParameter('email', i) as string[]; const templateName = this.getNodeParameter('templateName', i) as string; @@ -1048,13 +953,18 @@ export class AwsSes implements INodeType { params.push(`ConfigurationSetName=${additionalFields.configurationSetName}`); } - responseData = await awsApiRequestSOAP.call(this, 'email', 'POST', '', params.join('&')); + responseData = await awsApiRequestSOAP.call( + this, + 'email', + 'POST', + '', + params.join('&'), + ); responseData = responseData.SendCustomVerificationEmailResponse; } if (operation === 'update') { - const templateName = this.getNodeParameter('templateName', i) as string; const updateFields = this.getNodeParameter('updateFields', i) as IDataObject; @@ -1084,16 +994,20 @@ export class AwsSes implements INodeType { params.push(`TemplateSubject=${updateFields.templateSubject}`); } - responseData = await awsApiRequestSOAP.call(this, 'email', 'POST', '', params.join('&')); + responseData = await awsApiRequestSOAP.call( + this, + 'email', + 'POST', + '', + params.join('&'), + ); responseData = responseData.UpdateCustomVerificationEmailTemplateResponse; } } if (resource === 'email') { - if (operation === 'send') { - const toAddresses = this.getNodeParameter('toAddresses', i) as string[]; const message = this.getNodeParameter('body', i) as string; @@ -1106,10 +1020,7 @@ export class AwsSes implements INodeType { const additionalFields = this.getNodeParameter('additionalFields', i) as IDataObject; - const params = [ - `Message.Subject.Data=${subject}`, - `Source=${fromEmail}`, - ]; + const params = [`Message.Subject.Data=${subject}`, `Source=${fromEmail}`]; if (isBodyHtml) { params.push(`Message.Body.Html.Data=${encodeURIComponent(message)}`); @@ -1121,7 +1032,11 @@ export class AwsSes implements INodeType { if (toAddresses.length) { setParameter(params, 'Destination.ToAddresses.member', toAddresses); } else { - throw new NodeOperationError(this.getNode(), 'At least one "To Address" has to be added!', { itemIndex: i }); + throw new NodeOperationError( + this.getNode(), + 'At least one "To Address" has to be added!', + { itemIndex: i }, + ); } if (additionalFields.configurationSetName) { @@ -1141,21 +1056,37 @@ export class AwsSes implements INodeType { } if (additionalFields.replyToAddresses) { - setParameter(params, 'ReplyToAddresses.member', additionalFields.replyToAddresses as string[]); + setParameter( + params, + 'ReplyToAddresses.member', + additionalFields.replyToAddresses as string[], + ); } if (additionalFields.bccAddresses) { - setParameter(params, 'Destination.BccAddresses.member', additionalFields.bccAddresses as string[]); + setParameter( + params, + 'Destination.BccAddresses.member', + additionalFields.bccAddresses as string[], + ); } if (additionalFields.ccAddresses) { - setParameter(params, 'Destination.CcAddresses.member', additionalFields.ccAddresses as string[]); + setParameter( + params, + 'Destination.CcAddresses.member', + additionalFields.ccAddresses as string[], + ); } - responseData = await awsApiRequestSOAP.call(this, 'email', 'POST', '/?Action=SendEmail&' + params.join('&')); + responseData = await awsApiRequestSOAP.call( + this, + 'email', + 'POST', + '/?Action=SendEmail&' + params.join('&'), + ); } if (operation === 'sendTemplate') { - const toAddresses = this.getNodeParameter('toAddresses', i) as string[]; const template = this.getNodeParameter('templateName', i) as string; @@ -1166,15 +1097,16 @@ export class AwsSes implements INodeType { const templateDataUi = this.getNodeParameter('templateDataUi', i) as IDataObject; - const params = [ - `Template=${template}`, - `Source=${fromEmail}`, - ]; + const params = [`Template=${template}`, `Source=${fromEmail}`]; if (toAddresses.length) { setParameter(params, 'Destination.ToAddresses.member', toAddresses); } else { - throw new NodeOperationError(this.getNode(), 'At least one "To Address" has to be added!', { itemIndex: i }); + throw new NodeOperationError( + this.getNode(), + 'At least one "To Address" has to be added!', + { itemIndex: i }, + ); } if (additionalFields.configurationSetName) { @@ -1194,19 +1126,32 @@ export class AwsSes implements INodeType { } if (additionalFields.replyToAddresses) { - setParameter(params, 'ReplyToAddresses.member', additionalFields.replyToAddresses as string[]); + setParameter( + params, + 'ReplyToAddresses.member', + additionalFields.replyToAddresses as string[], + ); } if (additionalFields.bccAddresses) { - setParameter(params, 'Destination.BccAddresses.member', additionalFields.bccAddresses as string[]); + setParameter( + params, + 'Destination.BccAddresses.member', + additionalFields.bccAddresses as string[], + ); } if (additionalFields.ccAddresses) { - setParameter(params, 'Destination.CcAddresses.member', additionalFields.ccAddresses as string[]); + setParameter( + params, + 'Destination.CcAddresses.member', + additionalFields.ccAddresses as string[], + ); } if (templateDataUi) { - const templateDataValues = (templateDataUi as IDataObject).templateDataValues as IDataObject[]; + const templateDataValues = (templateDataUi as IDataObject) + .templateDataValues as IDataObject[]; const templateData: IDataObject = {}; if (templateDataValues !== undefined) { for (const templateDataValue of templateDataValues) { @@ -1217,16 +1162,19 @@ export class AwsSes implements INodeType { } } - responseData = await awsApiRequestSOAP.call(this, 'email', 'POST', '/?Action=SendTemplatedEmail&' + params.join('&')); + responseData = await awsApiRequestSOAP.call( + this, + 'email', + 'POST', + '/?Action=SendTemplatedEmail&' + params.join('&'), + ); responseData = responseData.SendTemplatedEmailResponse; } } if (resource === 'template') { - if (operation === 'create') { - const templateName = this.getNodeParameter('templateName', i) as string; const subjectPart = this.getNodeParameter('subjectPart', i) as string; @@ -1245,62 +1193,78 @@ export class AwsSes implements INodeType { params.push(`Template.TextPart=${additionalFields.textPart}`); } - responseData = await awsApiRequestSOAP.call(this, 'email', 'POST', '/?Action=CreateTemplate&' + params.join('&')); + responseData = await awsApiRequestSOAP.call( + this, + 'email', + 'POST', + '/?Action=CreateTemplate&' + params.join('&'), + ); responseData = responseData.CreateTemplateResponse; } if (operation === 'delete') { - const templateName = this.getNodeParameter('templateName', i) as string; - const params = [ - `TemplateName=${templateName}`, - ]; + const params = [`TemplateName=${templateName}`]; - responseData = await awsApiRequestSOAP.call(this, 'email', 'POST', '/?Action=DeleteTemplate&' + params.join('&')); + responseData = await awsApiRequestSOAP.call( + this, + 'email', + 'POST', + '/?Action=DeleteTemplate&' + params.join('&'), + ); responseData = responseData.DeleteTemplateResponse; } if (operation === 'get') { - const templateName = this.getNodeParameter('templateName', i) as string; - const params = [ - `TemplateName=${templateName}`, - ]; + const params = [`TemplateName=${templateName}`]; - responseData = await awsApiRequestSOAP.call(this, 'email', 'POST', '/?Action=GetTemplate&' + params.join('&')); + responseData = await awsApiRequestSOAP.call( + this, + 'email', + 'POST', + '/?Action=GetTemplate&' + params.join('&'), + ); responseData = responseData.GetTemplateResponse; } if (operation === 'getAll') { - const returnAll = this.getNodeParameter('returnAll', i) as boolean; if (returnAll === true) { - responseData = await awsApiRequestSOAPAllItems.call(this, 'ListTemplatesResponse.ListTemplatesResult.TemplatesMetadata.member', 'email', 'POST', '/?Action=ListTemplates'); - + responseData = await awsApiRequestSOAPAllItems.call( + this, + 'ListTemplatesResponse.ListTemplatesResult.TemplatesMetadata.member', + 'email', + 'POST', + '/?Action=ListTemplates', + ); } else { const limit = this.getNodeParameter('limit', i) as number; - responseData = await awsApiRequestSOAP.call(this, 'email', 'GET', `/?Action=ListTemplates&MaxItems=${limit}`); + responseData = await awsApiRequestSOAP.call( + this, + 'email', + 'GET', + `/?Action=ListTemplates&MaxItems=${limit}`, + ); - responseData = responseData.ListTemplatesResponse.ListTemplatesResult.TemplatesMetadata.member; + responseData = + responseData.ListTemplatesResponse.ListTemplatesResult.TemplatesMetadata.member; } } if (operation === 'update') { - const templateName = this.getNodeParameter('templateName', i) as string; const updateFields = this.getNodeParameter('updateFields', i) as IDataObject; - const params = [ - `Template.TemplateName=${templateName}`, - ]; + const params = [`Template.TemplateName=${templateName}`]; if (updateFields.textPart) { params.push(`Template.TextPart=${updateFields.textPart}`); @@ -1314,7 +1278,12 @@ export class AwsSes implements INodeType { params.push(`Template.HtmlPart=${updateFields.htmlPart}`); } - responseData = await awsApiRequestSOAP.call(this, 'email', 'POST', '/?Action=UpdateTemplate&' + params.join('&')); + responseData = await awsApiRequestSOAP.call( + this, + 'email', + 'POST', + '/?Action=UpdateTemplate&' + params.join('&'), + ); responseData = responseData.UpdateTemplateResponse; } diff --git a/packages/nodes-base/nodes/Aws/SES/GenericFunctions.ts b/packages/nodes-base/nodes/Aws/SES/GenericFunctions.ts index 09adde5ead19e..1e4ae868d81da 100644 --- a/packages/nodes-base/nodes/Aws/SES/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Aws/SES/GenericFunctions.ts @@ -1,19 +1,10 @@ -import { - URL, -} from 'url'; +import { URL } from 'url'; -import { - Request, - sign, -} from 'aws4'; +import { Request, sign } from 'aws4'; -import { - OptionsWithUri, -} from 'request'; +import { OptionsWithUri } from 'request'; -import { - parseString, -} from 'xml2js'; +import { parseString } from 'xml2js'; import { IExecuteFunctions, @@ -22,18 +13,27 @@ import { IWebhookFunctions, } from 'n8n-core'; -import { - IDataObject, NodeApiError, NodeOperationError, -} from 'n8n-workflow'; +import { IDataObject, NodeApiError, NodeOperationError } from 'n8n-workflow'; -import { - get, -} from 'lodash'; +import { get } from 'lodash'; -export async function awsApiRequest(this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions | IWebhookFunctions, service: string, method: string, path: string, body?: string, headers?: object): Promise { // tslint:disable-line:no-any +export async function awsApiRequest( + this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions | IWebhookFunctions, + service: string, + method: string, + path: string, + body?: string, + headers?: object, + // tslint:disable-next-line:no-any +): Promise { const credentials = await this.getCredentials('aws'); - const endpoint = new URL(((credentials.sesEndpoint as string || '').replace('{region}', credentials.region as string) || `https://${service}.${credentials.region}.amazonaws.com`) + path); + const endpoint = new URL( + (((credentials.sesEndpoint as string) || '').replace( + '{region}', + credentials.region as string, + ) || `https://${service}.${credentials.region}.amazonaws.com`) + path, + ); // Sign AWS API request with the user credentials @@ -41,7 +41,9 @@ export async function awsApiRequest(this: IHookFunctions | IExecuteFunctions | I const securityHeaders = { accessKeyId: `${credentials.accessKeyId}`.trim(), secretAccessKey: `${credentials.secretAccessKey}`.trim(), - sessionToken: credentials.temporaryCredentials ? `${credentials.sessionToken}`.trim() : undefined, + sessionToken: credentials.temporaryCredentials + ? `${credentials.sessionToken}`.trim() + : undefined, }; sign(signOpts, securityHeaders); @@ -60,7 +62,15 @@ export async function awsApiRequest(this: IHookFunctions | IExecuteFunctions | I } } -export async function awsApiRequestREST(this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions, service: string, method: string, path: string, body?: string, headers?: object): Promise { // tslint:disable-line:no-any +export async function awsApiRequestREST( + this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions, + service: string, + method: string, + path: string, + body?: string, + headers?: object, + // tslint:disable-next-line:no-any +): Promise { const response = await awsApiRequest.call(this, service, method, path, body, headers); try { return JSON.parse(response); @@ -69,7 +79,15 @@ export async function awsApiRequestREST(this: IHookFunctions | IExecuteFunctions } } -export async function awsApiRequestSOAP(this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions | IWebhookFunctions, service: string, method: string, path: string, body?: string, headers?: object): Promise { // tslint:disable-line:no-any +export async function awsApiRequestSOAP( + this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions | IWebhookFunctions, + service: string, + method: string, + path: string, + body?: string, + headers?: object, + // tslint:disable-next-line:no-any +): Promise { const response = await awsApiRequest.call(this, service, method, path, body, headers); try { return await new Promise((resolve, reject) => { @@ -85,9 +103,19 @@ export async function awsApiRequestSOAP(this: IHookFunctions | IExecuteFunctions } } - -export async function awsApiRequestSOAPAllItems(this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions | IWebhookFunctions, propertyName: string, service: string, method: string, path: string, body?: string, query: IDataObject = {}, headers: IDataObject = {}, option: IDataObject = {}, region?: string): Promise { // tslint:disable-line:no-any - +export async function awsApiRequestSOAPAllItems( + this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions | IWebhookFunctions, + propertyName: string, + service: string, + method: string, + path: string, + body?: string, + query: IDataObject = {}, + headers: IDataObject = {}, + option: IDataObject = {}, + region?: string, + // tslint:disable-next-line:no-any +): Promise { const returnData: IDataObject[] = []; let responseData; @@ -98,7 +126,10 @@ export async function awsApiRequestSOAPAllItems(this: IHookFunctions | IExecuteF responseData = await awsApiRequestSOAP.call(this, service, method, path, body, query); if (get(responseData, `${propertyNameArray[0]}.${propertyNameArray[1]}.NextToken`)) { - query['NextToken'] = get(responseData, `${propertyNameArray[0]}.${propertyNameArray[1]}.NextToken`); + query['NextToken'] = get( + responseData, + `${propertyNameArray[0]}.${propertyNameArray[1]}.NextToken`, + ); } if (get(responseData, propertyName)) { if (Array.isArray(get(responseData, propertyName))) { diff --git a/packages/nodes-base/nodes/Aws/SQS/AwsSqs.node.ts b/packages/nodes-base/nodes/Aws/SQS/AwsSqs.node.ts index e071af2404308..546d36d298e7b 100644 --- a/packages/nodes-base/nodes/Aws/SQS/AwsSqs.node.ts +++ b/packages/nodes-base/nodes/Aws/SQS/AwsSqs.node.ts @@ -1,6 +1,4 @@ -import { - IExecuteFunctions, -} from 'n8n-core'; +import { IExecuteFunctions } from 'n8n-core'; import { IDataObject, @@ -14,17 +12,11 @@ import { NodeOperationError, } from 'n8n-workflow'; -import { - URL, -} from 'url'; +import { URL } from 'url'; -import { - awsApiRequestSOAP, -} from '../GenericFunctions'; +import { awsApiRequestSOAP } from '../GenericFunctions'; -import { - pascalCase, -} from 'change-case'; +import { pascalCase } from 'change-case'; export class AwsSqs implements INodeType { description: INodeTypeDescription = { @@ -71,15 +63,14 @@ export class AwsSqs implements INodeType { }, displayOptions: { show: { - operation: [ - 'sendMessage', - ], + operation: ['sendMessage'], }, }, options: [], default: '', required: true, - description: 'Queue to send a message to. Choose from the list, or specify an ID using an expression.', + description: + 'Queue to send a message to. Choose from the list, or specify an ID using an expression.', }, { displayName: 'Queue Type', @@ -112,12 +103,8 @@ export class AwsSqs implements INodeType { type: 'string', displayOptions: { show: { - operation: [ - 'sendMessage', - ], - sendInputData: [ - false, - ], + operation: ['sendMessage'], + sendInputData: [false], }, }, required: true, @@ -132,12 +119,11 @@ export class AwsSqs implements INodeType { name: 'messageGroupId', type: 'string', default: '', - description: 'Tag that specifies that a message belongs to a specific message group. Applies only to FIFO (first-in-first-out) queues.', + description: + 'Tag that specifies that a message belongs to a specific message group. Applies only to FIFO (first-in-first-out) queues.', displayOptions: { show: { - queueType: [ - 'fifo', - ], + queueType: ['fifo'], }, }, required: true, @@ -148,9 +134,7 @@ export class AwsSqs implements INodeType { type: 'collection', displayOptions: { show: { - operation: [ - 'sendMessage', - ], + operation: ['sendMessage'], }, }, default: {}, @@ -162,9 +146,7 @@ export class AwsSqs implements INodeType { type: 'number', displayOptions: { show: { - '/queueType': [ - 'standard', - ], + '/queueType': ['standard'], }, }, description: 'How long, in seconds, to delay a message for', @@ -201,7 +183,8 @@ export class AwsSqs implements INodeType { name: 'dataPropertyName', type: 'string', default: 'data', - description: 'Name of the binary property which contains the data for the message attribute', + description: + 'Name of the binary property which contains the data for the message attribute', }, ], }, @@ -252,12 +235,11 @@ export class AwsSqs implements INodeType { name: 'messageDeduplicationId', type: 'string', default: '', - description: 'Token used for deduplication of sent messages. Applies only to FIFO (first-in-first-out) queues.', + description: + 'Token used for deduplication of sent messages. Applies only to FIFO (first-in-first-out) queues.', displayOptions: { show: { - '/queueType': [ - 'fifo', - ], + '/queueType': ['fifo'], }, }, }, @@ -270,10 +252,7 @@ export class AwsSqs implements INodeType { loadOptions: { // Get all the available queues to display them to user so that it can be selected easily async getQueues(this: ILoadOptionsFunctions): Promise { - const params = [ - 'Version=2012-11-05', - `Action=ListQueues`, - ]; + const params = ['Version=2012-11-05', `Action=ListQueues`]; let data; try { @@ -307,7 +286,6 @@ export class AwsSqs implements INodeType { }, }; - async execute(this: IExecuteFunctions): Promise { const items = this.getInputData(); const returnData: IDataObject[] = []; @@ -319,15 +297,14 @@ export class AwsSqs implements INodeType { const queueUrl = this.getNodeParameter('queue', i) as string; const queuePath = new URL(queueUrl).pathname; - const params = [ - 'Version=2012-11-05', - `Action=${pascalCase(operation)}`, - ]; + const params = ['Version=2012-11-05', `Action=${pascalCase(operation)}`]; const options = this.getNodeParameter('options', i, {}) as IDataObject; const sendInputData = this.getNodeParameter('sendInputData', i) as boolean; - const message = sendInputData ? JSON.stringify(items[i].json) : this.getNodeParameter('message', i) as string; + const message = sendInputData + ? JSON.stringify(items[i].json) + : (this.getNodeParameter('message', i) as string); params.push(`MessageBody=${message}`); if (options.delaySeconds) { @@ -336,7 +313,11 @@ export class AwsSqs implements INodeType { const queueType = this.getNodeParameter('queueType', i, {}) as string; if (queueType === 'fifo') { - const messageDeduplicationId = this.getNodeParameter('options.messageDeduplicationId', i, '') as string; + const messageDeduplicationId = this.getNodeParameter( + 'options.messageDeduplicationId', + i, + '', + ) as string; if (messageDeduplicationId) { params.push(`MessageDeduplicationId=${messageDeduplicationId}`); } @@ -349,7 +330,9 @@ export class AwsSqs implements INodeType { let attributeCount = 0; // Add string values - (this.getNodeParameter('options.messageAttributes.string', i, []) as INodeParameters[]).forEach((attribute) => { + ( + this.getNodeParameter('options.messageAttributes.string', i, []) as INodeParameters[] + ).forEach((attribute) => { attributeCount++; params.push(`MessageAttribute.${attributeCount}.Name=${attribute.name}`); params.push(`MessageAttribute.${attributeCount}.Value.StringValue=${attribute.value}`); @@ -357,17 +340,27 @@ export class AwsSqs implements INodeType { }); // Add binary values - (this.getNodeParameter('options.messageAttributes.binary', i, []) as INodeParameters[]).forEach((attribute) => { + ( + this.getNodeParameter('options.messageAttributes.binary', i, []) as INodeParameters[] + ).forEach((attribute) => { attributeCount++; const dataPropertyName = attribute.dataPropertyName as string; const item = items[i]; if (item.binary === undefined) { - throw new NodeOperationError(this.getNode(), 'No binary data set. So message attribute cannot be added!', { itemIndex: i }); + throw new NodeOperationError( + this.getNode(), + 'No binary data set. So message attribute cannot be added!', + { itemIndex: i }, + ); } if (item.binary[dataPropertyName] === undefined) { - throw new NodeOperationError(this.getNode(), `The binary property "${dataPropertyName}" does not exist. So message attribute cannot be added!`, { itemIndex: i }); + throw new NodeOperationError( + this.getNode(), + `The binary property "${dataPropertyName}" does not exist. So message attribute cannot be added!`, + { itemIndex: i }, + ); } const binaryData = item.binary[dataPropertyName].data; @@ -378,7 +371,9 @@ export class AwsSqs implements INodeType { }); // Add number values - (this.getNodeParameter('options.messageAttributes.number', i, []) as INodeParameters[]).forEach((attribute) => { + ( + this.getNodeParameter('options.messageAttributes.number', i, []) as INodeParameters[] + ).forEach((attribute) => { attributeCount++; params.push(`MessageAttribute.${attributeCount}.Name=${attribute.name}`); params.push(`MessageAttribute.${attributeCount}.Value.StringValue=${attribute.value}`); @@ -387,7 +382,12 @@ export class AwsSqs implements INodeType { let responseData; try { - responseData = await awsApiRequestSOAP.call(this, 'sqs', 'GET', `${queuePath}?${params.join('&')}`); + responseData = await awsApiRequestSOAP.call( + this, + 'sqs', + 'GET', + `${queuePath}?${params.join('&')}`, + ); } catch (error) { throw new NodeApiError(this.getNode(), error); } diff --git a/packages/nodes-base/nodes/Aws/Textract/AwsTextract.node.ts b/packages/nodes-base/nodes/Aws/Textract/AwsTextract.node.ts index cd094e881df3f..7ae96adc35502 100644 --- a/packages/nodes-base/nodes/Aws/Textract/AwsTextract.node.ts +++ b/packages/nodes-base/nodes/Aws/Textract/AwsTextract.node.ts @@ -1,6 +1,4 @@ -import { - IExecuteFunctions, -} from 'n8n-core'; +import { IExecuteFunctions } from 'n8n-core'; import { IBinaryKeyData, @@ -64,13 +62,12 @@ export class AwsTextract implements INodeType { default: 'data', displayOptions: { show: { - operation: [ - 'analyzeExpense', - ], + operation: ['analyzeExpense'], }, }, required: true, - description: 'The name of the input field containing the binary file data to be uploaded. Supported file types: PNG, JPEG.', + description: + 'The name of the input field containing the binary file data to be uploaded. Supported file types: PNG, JPEG.', }, { displayName: 'Simplify', @@ -78,22 +75,28 @@ export class AwsTextract implements INodeType { type: 'boolean', displayOptions: { show: { - operation: [ - 'analyzeExpense', - ], + operation: ['analyzeExpense'], }, }, default: true, - description: 'Whether to return a simplified version of the response instead of the raw data', + description: + 'Whether to return a simplified version of the response instead of the raw data', }, ], }; methods = { credentialTest: { - async awsTextractApiCredentialTest(this: ICredentialTestFunctions, credential: ICredentialsDecrypted): Promise { + async awsTextractApiCredentialTest( + this: ICredentialTestFunctions, + credential: ICredentialsDecrypted, + ): Promise { try { - await validateCredentials.call(this, credential.data as ICredentialDataDecryptedObject, 'sts'); + await validateCredentials.call( + this, + credential.data as ICredentialDataDecryptedObject, + 'sts', + ); } catch (error) { return { status: 'Error', @@ -122,11 +125,17 @@ export class AwsTextract implements INodeType { const simple = this.getNodeParameter('simple', i) as boolean; if (items[i].binary === undefined) { - throw new NodeOperationError(this.getNode(), 'No binary data exists on item!', { itemIndex: i }); + throw new NodeOperationError(this.getNode(), 'No binary data exists on item!', { + itemIndex: i, + }); } if ((items[i].binary as IBinaryKeyData)[binaryProperty] === undefined) { - throw new NodeOperationError(this.getNode(), `No binary data property "${binaryProperty}" does not exists on item!`, { itemIndex: i }); + throw new NodeOperationError( + this.getNode(), + `No binary data property "${binaryProperty}" does not exists on item!`, + { itemIndex: i }, + ); } const binaryPropertyData = (items[i].binary as IBinaryKeyData)[binaryProperty]; @@ -138,7 +147,14 @@ export class AwsTextract implements INodeType { }; const action = 'Textract.AnalyzeExpense'; - responseData = await awsApiRequestREST.call(this, 'textract', 'POST', '', JSON.stringify(body), { 'x-amz-target': action, 'Content-Type': 'application/x-amz-json-1.1' }) as IExpenseDocument; + responseData = (await awsApiRequestREST.call( + this, + 'textract', + 'POST', + '', + JSON.stringify(body), + { 'x-amz-target': action, 'Content-Type': 'application/x-amz-json-1.1' }, + )) as IExpenseDocument; if (simple) { responseData = simplify(responseData); } diff --git a/packages/nodes-base/nodes/Aws/Textract/GenericFunctions.ts b/packages/nodes-base/nodes/Aws/Textract/GenericFunctions.ts index a78f1436de095..4175593e0e43f 100644 --- a/packages/nodes-base/nodes/Aws/Textract/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Aws/Textract/GenericFunctions.ts @@ -1,19 +1,10 @@ -import { - URL, -} from 'url'; +import { URL } from 'url'; -import { - Request, - sign, -} from 'aws4'; +import { Request, sign } from 'aws4'; -import { - OptionsWithUri, -} from 'request'; +import { OptionsWithUri } from 'request'; -import { - parseString, -} from 'xml2js'; +import { parseString } from 'xml2js'; import { IExecuteFunctions, @@ -29,7 +20,10 @@ import { NodeOperationError, } from 'n8n-workflow'; -function getEndpointForService(service: string, credentials: ICredentialDataDecryptedObject): string { +function getEndpointForService( + service: string, + credentials: ICredentialDataDecryptedObject, +): string { let endpoint; if (service === 'lambda' && credentials.lambdaEndpoint) { endpoint = credentials.lambdaEndpoint; @@ -41,7 +35,15 @@ function getEndpointForService(service: string, credentials: ICredentialDataDecr return (endpoint as string).replace('{region}', credentials.region as string); } -export async function awsApiRequest(this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions | IWebhookFunctions, service: string, method: string, path: string, body?: string, headers?: object): Promise { // tslint:disable-line:no-any +export async function awsApiRequest( + this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions | IWebhookFunctions, + service: string, + method: string, + path: string, + body?: string, + headers?: object, + // tslint:disable-next-line:no-any +): Promise { const credentials = await this.getCredentials('aws'); // Concatenate path and instantiate URL object so it parses correctly query strings @@ -52,7 +54,9 @@ export async function awsApiRequest(this: IHookFunctions | IExecuteFunctions | I const securityHeaders = { accessKeyId: `${credentials.accessKeyId}`.trim(), secretAccessKey: `${credentials.secretAccessKey}`.trim(), - sessionToken: credentials.temporaryCredentials ? `${credentials.sessionToken}`.trim() : undefined, + sessionToken: credentials.temporaryCredentials + ? `${credentials.sessionToken}`.trim() + : undefined, }; sign(signOpts, securityHeaders); @@ -73,7 +77,8 @@ export async function awsApiRequest(this: IHookFunctions | IExecuteFunctions | I const user = JSON.parse(errorMessage).Message.split(' ')[1]; throw new NodeApiError(this.getNode(), error, { message: 'Unauthorized — please check your AWS policy configuration', - description: `Make sure an identity-based policy allows user ${user} to perform textract:AnalyzeExpense` }); + description: `Make sure an identity-based policy allows user ${user} to perform textract:AnalyzeExpense`, + }); } } @@ -81,7 +86,15 @@ export async function awsApiRequest(this: IHookFunctions | IExecuteFunctions | I } } -export async function awsApiRequestREST(this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions, service: string, method: string, path: string, body?: string, headers?: object): Promise { // tslint:disable-line:no-any +export async function awsApiRequestREST( + this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions, + service: string, + method: string, + path: string, + body?: string, + headers?: object, + // tslint:disable-next-line:no-any +): Promise { const response = await awsApiRequest.call(this, service, method, path, body, headers); try { return JSON.parse(response); @@ -90,7 +103,15 @@ export async function awsApiRequestREST(this: IHookFunctions | IExecuteFunctions } } -export async function awsApiRequestSOAP(this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions | IWebhookFunctions, service: string, method: string, path: string, body?: string, headers?: object): Promise { // tslint:disable-line:no-any +export async function awsApiRequestSOAP( + this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions | IWebhookFunctions, + service: string, + method: string, + path: string, + body?: string, + headers?: object, + // tslint:disable-next-line:no-any +): Promise { const response = await awsApiRequest.call(this, service, method, path, body, headers); try { return await new Promise((resolve, reject) => { @@ -121,25 +142,40 @@ export interface IExpenseDocument { { SummaryFields: [ { - LabelDetection: { Text: string }, - ValueDetection: { Text: string }, - Type: { Text: string } - }] - }]; + LabelDetection: { Text: string }; + ValueDetection: { Text: string }; + Type: { Text: string }; + }, + ]; + }, + ]; } -export async function validateCredentials(this: ICredentialTestFunctions, decryptedCredentials: ICredentialDataDecryptedObject, service: string): Promise { // tslint:disable-line:no-any +export async function validateCredentials( + this: ICredentialTestFunctions, + decryptedCredentials: ICredentialDataDecryptedObject, + service: string, + // tslint:disable-next-line:no-any +): Promise { const credentials = decryptedCredentials; // Concatenate path and instantiate URL object so it parses correctly query strings - const endpoint = new URL(getEndpointForService(service, credentials) + `?Action=GetCallerIdentity&Version=2011-06-15`); + const endpoint = new URL( + getEndpointForService(service, credentials) + `?Action=GetCallerIdentity&Version=2011-06-15`, + ); // Sign AWS API request with the user credentials - const signOpts = { host: endpoint.host, method: 'POST', path: '?Action=GetCallerIdentity&Version=2011-06-15' } as Request; + const signOpts = { + host: endpoint.host, + method: 'POST', + path: '?Action=GetCallerIdentity&Version=2011-06-15', + } as Request; const securityHeaders = { accessKeyId: `${credentials.accessKeyId}`.trim(), secretAccessKey: `${credentials.secretAccessKey}`.trim(), - sessionToken: credentials.temporaryCredentials ? `${credentials.sessionToken}`.trim() : undefined, + sessionToken: credentials.temporaryCredentials + ? `${credentials.sessionToken}`.trim() + : undefined, }; sign(signOpts, securityHeaders); diff --git a/packages/nodes-base/nodes/Aws/Transcribe/AwsTranscribe.node.ts b/packages/nodes-base/nodes/Aws/Transcribe/AwsTranscribe.node.ts index 984b258c19c79..90cf571a2f60a 100644 --- a/packages/nodes-base/nodes/Aws/Transcribe/AwsTranscribe.node.ts +++ b/packages/nodes-base/nodes/Aws/Transcribe/AwsTranscribe.node.ts @@ -1,18 +1,8 @@ -import { - IExecuteFunctions, -} from 'n8n-core'; +import { IExecuteFunctions } from 'n8n-core'; -import { - IDataObject, - INodeExecutionData, - INodeType, - INodeTypeDescription, -} from 'n8n-workflow'; +import { IDataObject, INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow'; -import { - awsApiRequestREST, - awsApiRequestRESTAllItems, -} from './GenericFunctions'; +import { awsApiRequestREST, awsApiRequestRESTAllItems } from './GenericFunctions'; export class AwsTranscribe implements INodeType { description: INodeTypeDescription = { @@ -88,14 +78,8 @@ export class AwsTranscribe implements INodeType { default: '', displayOptions: { show: { - resource: [ - 'transcriptionJob', - ], - operation: [ - 'create', - 'get', - 'delete', - ], + resource: ['transcriptionJob'], + operation: ['create', 'get', 'delete'], }, }, description: 'The name of the job', @@ -107,12 +91,8 @@ export class AwsTranscribe implements INodeType { default: '', displayOptions: { show: { - resource: [ - 'transcriptionJob', - ], - operation: [ - 'create', - ], + resource: ['transcriptionJob'], + operation: ['create'], }, }, description: 'The S3 object location of the input media file', @@ -123,16 +103,13 @@ export class AwsTranscribe implements INodeType { type: 'boolean', displayOptions: { show: { - resource: [ - 'transcriptionJob', - ], - operation: [ - 'create', - ], + resource: ['transcriptionJob'], + operation: ['create'], }, }, default: false, - description: 'Whether to set this field to true to enable automatic language identification', + description: + 'Whether to set this field to true to enable automatic language identification', }, { displayName: 'Language', @@ -170,15 +147,9 @@ export class AwsTranscribe implements INodeType { ], displayOptions: { show: { - resource: [ - 'transcriptionJob', - ], - operation: [ - 'create', - ], - detectLanguage: [ - false, - ], + resource: ['transcriptionJob'], + operation: ['create'], + detectLanguage: [false], }, }, default: 'en-US', @@ -194,9 +165,7 @@ export class AwsTranscribe implements INodeType { placeholder: 'Add Option', displayOptions: { show: { - operation: [ - 'create', - ], + operation: ['create'], }, }, default: {}, @@ -207,7 +176,8 @@ export class AwsTranscribe implements INodeType { type: 'boolean', default: false, // eslint-disable-next-line n8n-nodes-base/node-param-description-boolean-without-whether - description: 'Instructs Amazon Transcribe to process each audiochannel separately and then merge the transcription output of each channel into a single transcription. You can\'t set both Max Speaker Labels and Channel Identification in the same request. If you set both, your request returns a BadRequestException.', + description: + "Instructs Amazon Transcribe to process each audiochannel separately and then merge the transcription output of each channel into a single transcription. You can't set both Max Speaker Labels and Channel Identification in the same request. If you set both, your request returns a BadRequestException.", }, { displayName: 'Max Alternatives', @@ -229,7 +199,8 @@ export class AwsTranscribe implements INodeType { minValue: 2, maxValue: 10, }, - description: 'The maximum number of speakers to identify in the input audio. If there are more speakers in the audio than this number, multiple speakers are identified as a single speaker.', + description: + 'The maximum number of speakers to identify in the input audio. If there are more speakers in the audio than this number, multiple speakers are identified as a single speaker.', }, { displayName: 'Vocabulary Name', @@ -243,7 +214,8 @@ export class AwsTranscribe implements INodeType { name: 'vocabularyFilterName', type: 'string', default: '', - description: 'The name of the vocabulary filter to use when transcribing the audio. The filter that you specify must have the same language code as the transcription job.', + description: + 'The name of the vocabulary filter to use when transcribing the audio. The filter that you specify must have the same language code as the transcription job.', }, { displayName: 'Vocabulary Filter Method', @@ -262,10 +234,10 @@ export class AwsTranscribe implements INodeType { name: 'Tag', value: 'tag', }, - ], default: 'remove', - description: '

Set to mask to remove filtered text from the transcript and replace it with three asterisks ("***") as placeholder text.

Set to remove to remove filtered text from the transcript without using placeholder text. Set to tag to mark the word in the transcription output that matches the vocabulary filter. When you set the filter method to tag, the words matching your vocabulary filter are not masked or removed.

', + description: + '

Set to mask to remove filtered text from the transcript and replace it with three asterisks ("***") as placeholder text.

Set to remove to remove filtered text from the transcript without using placeholder text. Set to tag to mark the word in the transcription output that matches the vocabulary filter. When you set the filter method to tag, the words matching your vocabulary filter are not masked or removed.

', }, ], }, @@ -276,16 +248,13 @@ export class AwsTranscribe implements INodeType { default: true, displayOptions: { show: { - resource: [ - 'transcriptionJob', - ], - operation: [ - 'get', - ], + resource: ['transcriptionJob'], + operation: ['get'], }, }, // eslint-disable-next-line n8n-nodes-base/node-param-description-boolean-without-whether - description: 'By default, the response only contains metadata about the transcript. Enable this option to retrieve the transcript instead.', + description: + 'By default, the response only contains metadata about the transcript. Enable this option to retrieve the transcript instead.', }, { displayName: 'Simplify', @@ -293,19 +262,14 @@ export class AwsTranscribe implements INodeType { type: 'boolean', displayOptions: { show: { - resource: [ - 'transcriptionJob', - ], - operation: [ - 'get', - ], - returnTranscript: [ - true, - ], + resource: ['transcriptionJob'], + operation: ['get'], + returnTranscript: [true], }, }, default: true, - description: 'Whether to return a simplified version of the response instead of the raw data', + description: + 'Whether to return a simplified version of the response instead of the raw data', }, { displayName: 'Return All', @@ -313,12 +277,8 @@ export class AwsTranscribe implements INodeType { type: 'boolean', displayOptions: { show: { - resource: [ - 'transcriptionJob', - ], - operation: [ - 'getAll', - ], + resource: ['transcriptionJob'], + operation: ['getAll'], }, }, default: false, @@ -334,15 +294,9 @@ export class AwsTranscribe implements INodeType { }, displayOptions: { show: { - resource: [ - 'transcriptionJob', - ], - operation: [ - 'getAll', - ], - returnAll: [ - false, - ], + resource: ['transcriptionJob'], + operation: ['getAll'], + returnAll: [false], }, }, description: 'Max number of results to return', @@ -355,12 +309,8 @@ export class AwsTranscribe implements INodeType { default: {}, displayOptions: { show: { - resource: [ - 'transcriptionJob', - ], - operation: [ - 'getAll', - ], + resource: ['transcriptionJob'], + operation: ['getAll'], }, }, options: [ @@ -433,7 +383,9 @@ export class AwsTranscribe implements INodeType { } if (options.channelIdentification) { - Object.assign(body.Settings, { ChannelIdentification: options.channelIdentification }); + Object.assign(body.Settings, { + ChannelIdentification: options.channelIdentification, + }); } if (options.maxAlternatives) { @@ -469,7 +421,14 @@ export class AwsTranscribe implements INodeType { } const action = 'Transcribe.StartTranscriptionJob'; - responseData = await awsApiRequestREST.call(this, 'transcribe', 'POST', '', JSON.stringify(body), { 'x-amz-target': action, 'Content-Type': 'application/x-amz-json-1.1' }); + responseData = await awsApiRequestREST.call( + this, + 'transcribe', + 'POST', + '', + JSON.stringify(body), + { 'x-amz-target': action, 'Content-Type': 'application/x-amz-json-1.1' }, + ); responseData = responseData.TranscriptionJob; } //https://docs.aws.amazon.com/transcribe/latest/dg/API_DeleteTranscriptionJob.html @@ -481,7 +440,14 @@ export class AwsTranscribe implements INodeType { }; const action = 'Transcribe.DeleteTranscriptionJob'; - responseData = await awsApiRequestREST.call(this, 'transcribe', 'POST', '', JSON.stringify(body), { 'x-amz-target': action, 'Content-Type': 'application/x-amz-json-1.1' }); + responseData = await awsApiRequestREST.call( + this, + 'transcribe', + 'POST', + '', + JSON.stringify(body), + { 'x-amz-target': action, 'Content-Type': 'application/x-amz-json-1.1' }, + ); responseData = { success: true }; } //https://docs.aws.amazon.com/transcribe/latest/dg/API_GetTranscriptionJob.html @@ -494,14 +460,29 @@ export class AwsTranscribe implements INodeType { }; const action = 'Transcribe.GetTranscriptionJob'; - responseData = await awsApiRequestREST.call(this, 'transcribe', 'POST', '', JSON.stringify(body), { 'x-amz-target': action, 'Content-Type': 'application/x-amz-json-1.1' }); + responseData = await awsApiRequestREST.call( + this, + 'transcribe', + 'POST', + '', + JSON.stringify(body), + { 'x-amz-target': action, 'Content-Type': 'application/x-amz-json-1.1' }, + ); responseData = responseData.TranscriptionJob; if (resolve === true && responseData.TranscriptionJobStatus === 'COMPLETED') { - responseData = await this.helpers.request({ method: 'GET', uri: responseData.Transcript.TranscriptFileUri, json: true }); + responseData = await this.helpers.request({ + method: 'GET', + uri: responseData.Transcript.TranscriptFileUri, + json: true, + }); const simple = this.getNodeParameter('simple', 0) as boolean; if (simple === true) { - responseData = { transcript: responseData.results.transcripts.map((data: IDataObject) => data.transcript).join(' ') }; + responseData = { + transcript: responseData.results.transcripts + .map((data: IDataObject) => data.transcript) + .join(' '), + }; } } } @@ -521,12 +502,26 @@ export class AwsTranscribe implements INodeType { } if (returnAll === true) { - responseData = await awsApiRequestRESTAllItems.call(this, 'TranscriptionJobSummaries', 'transcribe', 'POST', '', JSON.stringify(body), { 'x-amz-target': action, 'Content-Type': 'application/x-amz-json-1.1' }); - + responseData = await awsApiRequestRESTAllItems.call( + this, + 'TranscriptionJobSummaries', + 'transcribe', + 'POST', + '', + JSON.stringify(body), + { 'x-amz-target': action, 'Content-Type': 'application/x-amz-json-1.1' }, + ); } else { const limit = this.getNodeParameter('limit', i) as number; body['MaxResults'] = limit; - responseData = await awsApiRequestREST.call(this, 'transcribe', 'POST', '', JSON.stringify(body), { 'x-amz-target': action, 'Content-Type': 'application/x-amz-json-1.1' }); + responseData = await awsApiRequestREST.call( + this, + 'transcribe', + 'POST', + '', + JSON.stringify(body), + { 'x-amz-target': action, 'Content-Type': 'application/x-amz-json-1.1' }, + ); responseData = responseData.TranscriptionJobSummaries; } } @@ -537,7 +532,6 @@ export class AwsTranscribe implements INodeType { } else { returnData.push(responseData as IDataObject); } - } catch (error) { if (this.continueOnFail()) { returnData.push({ error: error.message }); diff --git a/packages/nodes-base/nodes/Aws/Transcribe/GenericFunctions.ts b/packages/nodes-base/nodes/Aws/Transcribe/GenericFunctions.ts index 7de8078242efd..2d756b90bbd74 100644 --- a/packages/nodes-base/nodes/Aws/Transcribe/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Aws/Transcribe/GenericFunctions.ts @@ -1,15 +1,8 @@ -import { - URL, -} from 'url'; +import { URL } from 'url'; -import { - Request, - sign, -} from 'aws4'; +import { Request, sign } from 'aws4'; -import { - OptionsWithUri, -} from 'request'; +import { OptionsWithUri } from 'request'; import { IExecuteFunctions, @@ -25,11 +18,12 @@ import { NodeOperationError, } from 'n8n-workflow'; -import { - get, -} from 'lodash'; +import { get } from 'lodash'; -function getEndpointForService(service: string, credentials: ICredentialDataDecryptedObject): string { +function getEndpointForService( + service: string, + credentials: ICredentialDataDecryptedObject, +): string { let endpoint; if (service === 'lambda' && credentials.lambdaEndpoint) { endpoint = credentials.lambdaEndpoint; @@ -41,7 +35,15 @@ function getEndpointForService(service: string, credentials: ICredentialDataDecr return (endpoint as string).replace('{region}', credentials.region as string); } -export async function awsApiRequest(this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions | IWebhookFunctions, service: string, method: string, path: string, body?: string, headers?: object): Promise { // tslint:disable-line:no-any +export async function awsApiRequest( + this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions | IWebhookFunctions, + service: string, + method: string, + path: string, + body?: string, + headers?: object, + // tslint:disable-next-line:no-any +): Promise { const credentials = await this.getCredentials('aws'); // Concatenate path and instantiate URL object so it parses correctly query strings @@ -52,7 +54,9 @@ export async function awsApiRequest(this: IHookFunctions | IExecuteFunctions | I const securityHeaders = { accessKeyId: `${credentials.accessKeyId}`.trim(), secretAccessKey: `${credentials.secretAccessKey}`.trim(), - sessionToken: credentials.temporaryCredentials ? `${credentials.sessionToken}`.trim() : undefined, + sessionToken: credentials.temporaryCredentials + ? `${credentials.sessionToken}`.trim() + : undefined, }; sign(signOpts, securityHeaders); @@ -71,7 +75,15 @@ export async function awsApiRequest(this: IHookFunctions | IExecuteFunctions | I } } -export async function awsApiRequestREST(this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions, service: string, method: string, path: string, body?: string, headers?: object): Promise { // tslint:disable-line:no-any +export async function awsApiRequestREST( + this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions, + service: string, + method: string, + path: string, + body?: string, + headers?: object, + // tslint:disable-next-line:no-any +): Promise { const response = await awsApiRequest.call(this, service, method, path, body, headers); try { return JSON.parse(response); @@ -80,8 +92,19 @@ export async function awsApiRequestREST(this: IHookFunctions | IExecuteFunctions } } -export async function awsApiRequestRESTAllItems(this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions, propertyName: string, service: string, method: string, path: string, body?: string, query: IDataObject = {}, headers: IDataObject = {}, option: IDataObject = {}, region?: string): Promise { // tslint:disable-line:no-any - +export async function awsApiRequestRESTAllItems( + this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions, + propertyName: string, + service: string, + method: string, + path: string, + body?: string, + query: IDataObject = {}, + headers: IDataObject = {}, + option: IDataObject = {}, + region?: string, + // tslint:disable-next-line:no-any +): Promise { const returnData: IDataObject[] = []; let responseData; @@ -92,7 +115,10 @@ export async function awsApiRequestRESTAllItems(this: IHookFunctions | IExecuteF responseData = await awsApiRequestREST.call(this, service, method, path, body, query); if (get(responseData, `${propertyNameArray[0]}.${propertyNameArray[1]}.NextToken`)) { - query['NextToken'] = get(responseData, `${propertyNameArray[0]}.${propertyNameArray[1]}.NextToken`); + query['NextToken'] = get( + responseData, + `${propertyNameArray[0]}.${propertyNameArray[1]}.NextToken`, + ); } if (get(responseData, propertyName)) { if (Array.isArray(get(responseData, propertyName))) { diff --git a/packages/nodes-base/nodes/BambooHr/v1/actions/Interfaces.ts b/packages/nodes-base/nodes/BambooHr/v1/actions/Interfaces.ts index 1e18e6596612f..eaa4e27d4f583 100644 --- a/packages/nodes-base/nodes/BambooHr/v1/actions/Interfaces.ts +++ b/packages/nodes-base/nodes/BambooHr/v1/actions/Interfaces.ts @@ -1,8 +1,4 @@ -import { - AllEntities, - Entity, - PropertiesOf, -} from 'n8n-workflow'; +import { AllEntities, Entity, PropertiesOf } from 'n8n-workflow'; type BambooHrMap = { employee: 'create' | 'get' | 'getAll' | 'update'; diff --git a/packages/nodes-base/nodes/BambooHr/v1/actions/companyReport/get/description.ts b/packages/nodes-base/nodes/BambooHr/v1/actions/companyReport/get/description.ts index e49949b79c056..1201871e52d72 100644 --- a/packages/nodes-base/nodes/BambooHr/v1/actions/companyReport/get/description.ts +++ b/packages/nodes-base/nodes/BambooHr/v1/actions/companyReport/get/description.ts @@ -8,16 +8,13 @@ export const companyReportGetDescription: INodeProperties[] = [ required: true, displayOptions: { show: { - operation: [ - 'get', - ], - resource: [ - 'companyReport', - ], + operation: ['get'], + resource: ['companyReport'], }, }, default: '', - description: 'ID of the report. You can get the report number by hovering over the report name on the reports page and grabbing the ID.', + description: + 'ID of the report. You can get the report number by hovering over the report name on the reports page and grabbing the ID.', }, { displayName: 'Format', @@ -48,12 +45,8 @@ export const companyReportGetDescription: INodeProperties[] = [ required: true, displayOptions: { show: { - operation: [ - 'get', - ], - resource: [ - 'companyReport', - ], + operation: ['get'], + resource: ['companyReport'], }, }, default: 'JSON', @@ -68,17 +61,11 @@ export const companyReportGetDescription: INodeProperties[] = [ description: 'The name of the output field to put the binary file data in', displayOptions: { show: { - operation: [ - 'get', - ], - resource: [ - 'companyReport', - ], + operation: ['get'], + resource: ['companyReport'], }, hide: { - format: [ - 'JSON', - ], + format: ['JSON'], }, }, }, @@ -90,12 +77,8 @@ export const companyReportGetDescription: INodeProperties[] = [ default: {}, displayOptions: { show: { - operation: [ - 'get', - ], - resource: [ - 'companyReport', - ], + operation: ['get'], + resource: ['companyReport'], }, }, options: [ diff --git a/packages/nodes-base/nodes/BambooHr/v1/actions/companyReport/get/execute.ts b/packages/nodes-base/nodes/BambooHr/v1/actions/companyReport/get/execute.ts index 0a75b812f281e..49bc4e0f4bfc9 100644 --- a/packages/nodes-base/nodes/BambooHr/v1/actions/companyReport/get/execute.ts +++ b/packages/nodes-base/nodes/BambooHr/v1/actions/companyReport/get/execute.ts @@ -1,15 +1,8 @@ -import { - IExecuteFunctions, -} from 'n8n-core'; +import { IExecuteFunctions } from 'n8n-core'; -import { - IDataObject, - INodeExecutionData, -} from 'n8n-workflow'; +import { IDataObject, INodeExecutionData } from 'n8n-workflow'; -import { - apiRequest, -} from '../../../transport'; +import { apiRequest } from '../../../transport'; export async function get(this: IExecuteFunctions, index: number) { const body: IDataObject = {}; @@ -25,16 +18,26 @@ export async function get(this: IExecuteFunctions, index: number) { const endpoint = `reports/${reportId}/?format=${format}&fd=${fd}`; if (format === 'JSON') { - const responseData = await apiRequest.call(this, requestMethod, endpoint, body, {}, { resolveWithFullResponse: true }); + const responseData = await apiRequest.call( + this, + requestMethod, + endpoint, + body, + {}, + { resolveWithFullResponse: true }, + ); return this.helpers.returnJsonArray(responseData.body); } const output: string = this.getNodeParameter('output', index) as string; - const response = await apiRequest.call(this, requestMethod, endpoint, body, {} as IDataObject, - { encoding: null, json: false, resolveWithFullResponse: true }); + const response = await apiRequest.call(this, requestMethod, endpoint, body, {} as IDataObject, { + encoding: null, + json: false, + resolveWithFullResponse: true, + }); let mimeType = response.headers['content-type'] as string | undefined; - mimeType = mimeType ? mimeType.split(';').find(value => value.includes('/')) : undefined; + mimeType = mimeType ? mimeType.split(';').find((value) => value.includes('/')) : undefined; const contentDisposition = response.headers['content-disposition']; const fileNameRegex = /(?<=filename=").*\b/; const match = fileNameRegex.exec(contentDisposition); @@ -58,7 +61,11 @@ export async function get(this: IExecuteFunctions, index: number) { } newItem.binary = { - [output]: await this.helpers.prepareBinaryData(response.body as unknown as Buffer, fileName, mimeType), + [output]: await this.helpers.prepareBinaryData( + response.body as unknown as Buffer, + fileName, + mimeType, + ), }; return this.prepareOutputData(newItem as unknown as INodeExecutionData[]); diff --git a/packages/nodes-base/nodes/BambooHr/v1/actions/companyReport/get/index.ts b/packages/nodes-base/nodes/BambooHr/v1/actions/companyReport/get/index.ts index c15f450dd1e96..bd99a16bdd72a 100644 --- a/packages/nodes-base/nodes/BambooHr/v1/actions/companyReport/get/index.ts +++ b/packages/nodes-base/nodes/BambooHr/v1/actions/companyReport/get/index.ts @@ -1,7 +1,4 @@ import { get as execute } from './execute'; import { companyReportGetDescription as description } from './description'; -export { - description, - execute, -}; +export { description, execute }; diff --git a/packages/nodes-base/nodes/BambooHr/v1/actions/companyReport/index.ts b/packages/nodes-base/nodes/BambooHr/v1/actions/companyReport/index.ts index 8b9e7d8dad36e..7e5a991a512aa 100644 --- a/packages/nodes-base/nodes/BambooHr/v1/actions/companyReport/index.ts +++ b/packages/nodes-base/nodes/BambooHr/v1/actions/companyReport/index.ts @@ -1,12 +1,8 @@ import * as get from './get'; -import { - INodeProperties, -} from 'n8n-workflow'; +import { INodeProperties } from 'n8n-workflow'; -export { - get, -}; +export { get }; export const descriptions: INodeProperties[] = [ { @@ -16,9 +12,7 @@ export const descriptions: INodeProperties[] = [ noDataExpression: true, displayOptions: { show: { - resource: [ - 'companyReport', - ], + resource: ['companyReport'], }, }, options: [ diff --git a/packages/nodes-base/nodes/BambooHr/v1/actions/employee/create/description.ts b/packages/nodes-base/nodes/BambooHr/v1/actions/employee/create/description.ts index 36eafa765ec12..fa2490e20f7ec 100644 --- a/packages/nodes-base/nodes/BambooHr/v1/actions/employee/create/description.ts +++ b/packages/nodes-base/nodes/BambooHr/v1/actions/employee/create/description.ts @@ -1,10 +1,6 @@ -import { - EmployeeProperties, -} from '../../Interfaces'; +import { EmployeeProperties } from '../../Interfaces'; -import { - createEmployeeSharedDescription, -} from './shareDescription'; +import { createEmployeeSharedDescription } from './shareDescription'; export const employeeCreateDescription: EmployeeProperties = [ { @@ -14,16 +10,13 @@ export const employeeCreateDescription: EmployeeProperties = [ required: true, displayOptions: { show: { - operation: [ - 'create', - ], - resource: [ - 'employee', - ], + operation: ['create'], + resource: ['employee'], }, }, default: false, - description: 'Whether the employee to create was added to a pay schedule synced with Trax Payroll', + description: + 'Whether the employee to create was added to a pay schedule synced with Trax Payroll', }, { displayName: 'First Name', @@ -32,12 +25,8 @@ export const employeeCreateDescription: EmployeeProperties = [ required: true, displayOptions: { show: { - operation: [ - 'create', - ], - resource: [ - 'employee', - ], + operation: ['create'], + resource: ['employee'], }, }, default: '', @@ -49,12 +38,8 @@ export const employeeCreateDescription: EmployeeProperties = [ required: true, displayOptions: { show: { - operation: [ - 'create', - ], - resource: [ - 'employee', - ], + operation: ['create'], + resource: ['employee'], }, }, default: '', @@ -68,12 +53,8 @@ export const employeeCreateDescription: EmployeeProperties = [ default: {}, displayOptions: { show: { - operation: [ - 'create', - ], - resource: [ - 'employee', - ], + operation: ['create'], + resource: ['employee'], }, }, options: [ @@ -92,4 +73,4 @@ export const employeeCreateDescription: EmployeeProperties = [ }, ], }, -]; \ No newline at end of file +]; diff --git a/packages/nodes-base/nodes/BambooHr/v1/actions/employee/create/execute.ts b/packages/nodes-base/nodes/BambooHr/v1/actions/employee/create/execute.ts index fb990bcd32f7a..3656f3d9b872f 100644 --- a/packages/nodes-base/nodes/BambooHr/v1/actions/employee/create/execute.ts +++ b/packages/nodes-base/nodes/BambooHr/v1/actions/employee/create/execute.ts @@ -1,23 +1,17 @@ -import { - IExecuteFunctions, -} from 'n8n-core'; +import { IExecuteFunctions } from 'n8n-core'; -import { - IDataObject, - INodeExecutionData, -} from 'n8n-workflow'; +import { IDataObject, INodeExecutionData } from 'n8n-workflow'; -import { - apiRequest, -} from '../../../transport'; +import { apiRequest } from '../../../transport'; import moment from 'moment'; -import { - capitalCase -} from 'change-case'; +import { capitalCase } from 'change-case'; -export async function create(this: IExecuteFunctions, index: number): Promise { +export async function create( + this: IExecuteFunctions, + index: number, +): Promise { const body: IDataObject = {}; const requestMethod = 'POST'; const endpoint = 'employees'; @@ -30,8 +24,12 @@ export async function create(this: IExecuteFunctions, index: number): Promise { let elements: INodeProperties[] = [ @@ -66,7 +64,8 @@ export const createEmployeeSharedDescription = (sync = false): INodeProperties[] displayName: 'Department Name or ID', name: 'department', type: 'options', - description: 'Choose from the list, or specify an ID using an expression', + description: + 'Choose from the list, or specify an ID using an expression', typeOptions: { loadOptionsMethod: 'getDepartments', }, @@ -76,7 +75,8 @@ export const createEmployeeSharedDescription = (sync = false): INodeProperties[] displayName: 'Division Name or ID', name: 'division', type: 'options', - description: 'Choose from the list, or specify an ID using an expression', + description: + 'Choose from the list, or specify an ID using an expression', typeOptions: { loadOptionsMethod: 'getDivisions', }, @@ -130,7 +130,8 @@ export const createEmployeeSharedDescription = (sync = false): INodeProperties[] displayName: 'Location Name or ID', name: 'location', type: 'options', - description: 'Choose from the list, or specify an ID using an expression', + description: + 'Choose from the list, or specify an ID using an expression', typeOptions: { loadOptionsMethod: 'getEmployeeLocations', }, @@ -293,19 +294,13 @@ export const createEmployeeSharedDescription = (sync = false): INodeProperties[] ]; if (sync === true) { - elements = elements.map(element => { + elements = elements.map((element) => { return Object.assign(element, { displayOptions: { show: { - resource: [ - 'employee', - ], - operation: [ - 'create', - ], - synced: [ - true, - ], + resource: ['employee'], + operation: ['create'], + synced: [true], }, }, required: true, @@ -313,13 +308,11 @@ export const createEmployeeSharedDescription = (sync = false): INodeProperties[] }); return elements; } else { - elements = elements.map(element => { + elements = elements.map((element) => { return Object.assign(element, { displayOptions: { show: { - '/synced': [ - false, - ], + '/synced': [false], }, }, }); diff --git a/packages/nodes-base/nodes/BambooHr/v1/actions/employee/get/description.ts b/packages/nodes-base/nodes/BambooHr/v1/actions/employee/get/description.ts index d3d3ceb37e549..505b39e3930c6 100644 --- a/packages/nodes-base/nodes/BambooHr/v1/actions/employee/get/description.ts +++ b/packages/nodes-base/nodes/BambooHr/v1/actions/employee/get/description.ts @@ -1,6 +1,4 @@ -import { - EmployeeProperties, -} from '../../Interfaces'; +import { EmployeeProperties } from '../../Interfaces'; export const employeeGetDescription: EmployeeProperties = [ { @@ -10,12 +8,8 @@ export const employeeGetDescription: EmployeeProperties = [ required: true, displayOptions: { show: { - operation: [ - 'get', - ], - resource: [ - 'employee', - ], + operation: ['get'], + resource: ['employee'], }, }, default: '', @@ -28,12 +22,8 @@ export const employeeGetDescription: EmployeeProperties = [ default: {}, displayOptions: { show: { - operation: [ - 'get', - ], - resource: [ - 'employee', - ], + operation: ['get'], + resource: ['employee'], }, }, options: [ @@ -44,10 +34,9 @@ export const employeeGetDescription: EmployeeProperties = [ typeOptions: { loadOptionsMethod: 'getEmployeeFields', }, - default: [ - 'all', - ], - description: 'Set of fields to get from employee data. Choose from the list, or specify IDs using an expression.', + default: ['all'], + description: + 'Set of fields to get from employee data. Choose from the list, or specify IDs using an expression.', }, ], }, diff --git a/packages/nodes-base/nodes/BambooHr/v1/actions/employee/get/execute.ts b/packages/nodes-base/nodes/BambooHr/v1/actions/employee/get/execute.ts index 7ce3cff6f3402..8170020508eb5 100644 --- a/packages/nodes-base/nodes/BambooHr/v1/actions/employee/get/execute.ts +++ b/packages/nodes-base/nodes/BambooHr/v1/actions/employee/get/execute.ts @@ -1,15 +1,8 @@ -import { - IExecuteFunctions, -} from 'n8n-core'; +import { IExecuteFunctions } from 'n8n-core'; -import { - IDataObject, - INodeExecutionData, -} from 'n8n-workflow'; +import { IDataObject, INodeExecutionData } from 'n8n-workflow'; -import { - apiRequest, -} from '../../../transport'; +import { apiRequest } from '../../../transport'; export async function get(this: IExecuteFunctions, index: number): Promise { const body: IDataObject = {}; @@ -22,7 +15,12 @@ export async function get(this: IExecuteFunctions, index: number): Promise field.id); } diff --git a/packages/nodes-base/nodes/BambooHr/v1/actions/employee/get/index.ts b/packages/nodes-base/nodes/BambooHr/v1/actions/employee/get/index.ts index f5b38ee652c03..981c65126e799 100644 --- a/packages/nodes-base/nodes/BambooHr/v1/actions/employee/get/index.ts +++ b/packages/nodes-base/nodes/BambooHr/v1/actions/employee/get/index.ts @@ -1,7 +1,4 @@ import { get as execute } from './execute'; import { employeeGetDescription as description } from './description'; -export { - description, - execute, -}; +export { description, execute }; diff --git a/packages/nodes-base/nodes/BambooHr/v1/actions/employee/getAll/description.ts b/packages/nodes-base/nodes/BambooHr/v1/actions/employee/getAll/description.ts index 51369d85e2227..075ad5ce8f149 100644 --- a/packages/nodes-base/nodes/BambooHr/v1/actions/employee/getAll/description.ts +++ b/packages/nodes-base/nodes/BambooHr/v1/actions/employee/getAll/description.ts @@ -8,12 +8,8 @@ export const employeeGetAllDescription: INodeProperties[] = [ default: false, displayOptions: { show: { - resource: [ - 'employee', - ], - operation: [ - 'getAll', - ], + resource: ['employee'], + operation: ['getAll'], }, }, description: 'Whether to return all results or only up to a given limit', @@ -29,15 +25,9 @@ export const employeeGetAllDescription: INodeProperties[] = [ }, displayOptions: { show: { - resource: [ - 'employee', - ], - operation: [ - 'getAll', - ], - returnAll: [ - false, - ], + resource: ['employee'], + operation: ['getAll'], + returnAll: [false], }, }, description: 'Max number of results to return', diff --git a/packages/nodes-base/nodes/BambooHr/v1/actions/employee/getAll/execute.ts b/packages/nodes-base/nodes/BambooHr/v1/actions/employee/getAll/execute.ts index 0158273f538b7..b3537fd36e8da 100644 --- a/packages/nodes-base/nodes/BambooHr/v1/actions/employee/getAll/execute.ts +++ b/packages/nodes-base/nodes/BambooHr/v1/actions/employee/getAll/execute.ts @@ -1,17 +1,13 @@ -import { - IExecuteFunctions, -} from 'n8n-core'; +import { IExecuteFunctions } from 'n8n-core'; -import { - IDataObject, - INodeExecutionData, -} from 'n8n-workflow'; +import { IDataObject, INodeExecutionData } from 'n8n-workflow'; -import { - apiRequest, -} from '../../../transport'; +import { apiRequest } from '../../../transport'; -export async function getAll(this: IExecuteFunctions, index: number): Promise { +export async function getAll( + this: IExecuteFunctions, + index: number, +): Promise { const body: IDataObject = {}; const requestMethod = 'GET'; const endpoint = 'employees/directory'; diff --git a/packages/nodes-base/nodes/BambooHr/v1/actions/employee/getAll/index.ts b/packages/nodes-base/nodes/BambooHr/v1/actions/employee/getAll/index.ts index c500a19ccba67..9ae4d1d2b1a9b 100644 --- a/packages/nodes-base/nodes/BambooHr/v1/actions/employee/getAll/index.ts +++ b/packages/nodes-base/nodes/BambooHr/v1/actions/employee/getAll/index.ts @@ -1,7 +1,4 @@ import { getAll as execute } from './execute'; import { employeeGetAllDescription as description } from './description'; -export { - description, - execute, -}; +export { description, execute }; diff --git a/packages/nodes-base/nodes/BambooHr/v1/actions/employee/index.ts b/packages/nodes-base/nodes/BambooHr/v1/actions/employee/index.ts index 8010cc75cf39e..acae299826519 100644 --- a/packages/nodes-base/nodes/BambooHr/v1/actions/employee/index.ts +++ b/packages/nodes-base/nodes/BambooHr/v1/actions/employee/index.ts @@ -3,16 +3,9 @@ import * as get from './get'; import * as getAll from './getAll'; import * as update from './update'; -import { - INodeProperties, -} from 'n8n-workflow'; +import { INodeProperties } from 'n8n-workflow'; -export { - create, - get, - getAll, - update -}; +export { create, get, getAll, update }; export const descriptions: INodeProperties[] = [ { @@ -22,9 +15,7 @@ export const descriptions: INodeProperties[] = [ noDataExpression: true, displayOptions: { show: { - resource: [ - 'employee', - ], + resource: ['employee'], }, }, options: [ diff --git a/packages/nodes-base/nodes/BambooHr/v1/actions/employee/update/description.ts b/packages/nodes-base/nodes/BambooHr/v1/actions/employee/update/description.ts index a87e62941e6c6..176ffdf7d6583 100644 --- a/packages/nodes-base/nodes/BambooHr/v1/actions/employee/update/description.ts +++ b/packages/nodes-base/nodes/BambooHr/v1/actions/employee/update/description.ts @@ -1,6 +1,4 @@ -import { - EmployeeProperties, -} from '../../Interfaces'; +import { EmployeeProperties } from '../../Interfaces'; import { updateEmployeeSharedDescription } from './sharedDescription'; export const employeeUpdateDescription: EmployeeProperties = [ @@ -11,12 +9,8 @@ export const employeeUpdateDescription: EmployeeProperties = [ required: true, displayOptions: { show: { - operation: [ - 'update', - ], - resource: [ - 'employee', - ], + operation: ['update'], + resource: ['employee'], }, }, default: '', @@ -28,16 +22,13 @@ export const employeeUpdateDescription: EmployeeProperties = [ required: true, displayOptions: { show: { - operation: [ - 'update', - ], - resource: [ - 'employee', - ], + operation: ['update'], + resource: ['employee'], }, }, default: false, - description: 'Whether the employee to create was added to a pay schedule synced with Trax Payroll', + description: + 'Whether the employee to create was added to a pay schedule synced with Trax Payroll', }, ...updateEmployeeSharedDescription(true), { @@ -48,12 +39,8 @@ export const employeeUpdateDescription: EmployeeProperties = [ default: {}, displayOptions: { show: { - operation: [ - 'update', - ], - resource: [ - 'employee', - ], + operation: ['update'], + resource: ['employee'], }, }, options: [ diff --git a/packages/nodes-base/nodes/BambooHr/v1/actions/employee/update/execute.ts b/packages/nodes-base/nodes/BambooHr/v1/actions/employee/update/execute.ts index 0676c147e8b0b..ab1ca39cb547d 100644 --- a/packages/nodes-base/nodes/BambooHr/v1/actions/employee/update/execute.ts +++ b/packages/nodes-base/nodes/BambooHr/v1/actions/employee/update/execute.ts @@ -1,24 +1,17 @@ -import { - IExecuteFunctions, -} from 'n8n-core'; +import { IExecuteFunctions } from 'n8n-core'; -import { - IDataObject, - INodeExecutionData, - NodeOperationError, -} from 'n8n-workflow'; +import { IDataObject, INodeExecutionData, NodeOperationError } from 'n8n-workflow'; -import { - apiRequest, -} from '../../../transport'; +import { apiRequest } from '../../../transport'; import moment from 'moment'; -import { - capitalCase, -} from 'change-case'; +import { capitalCase } from 'change-case'; -export async function update(this: IExecuteFunctions, index: number): Promise { +export async function update( + this: IExecuteFunctions, + index: number, +): Promise { let body: IDataObject = {}; const requestMethod = 'POST'; @@ -35,8 +28,12 @@ export async function update(this: IExecuteFunctions, index: number): Promise { let elements: INodeProperties[] = [ @@ -66,7 +64,8 @@ export const updateEmployeeSharedDescription = (sync = false): INodeProperties[] displayName: 'Department Name or ID', name: 'department', type: 'options', - description: 'Choose from the list, or specify an ID using an expression', + description: + 'Choose from the list, or specify an ID using an expression', typeOptions: { loadOptionsMethod: 'getDepartments', }, @@ -76,7 +75,8 @@ export const updateEmployeeSharedDescription = (sync = false): INodeProperties[] displayName: 'Division Name or ID', name: 'division', type: 'options', - description: 'Choose from the list, or specify an ID using an expression', + description: + 'Choose from the list, or specify an ID using an expression', typeOptions: { loadOptionsMethod: 'getDivisions', }, @@ -94,9 +94,7 @@ export const updateEmployeeSharedDescription = (sync = false): INodeProperties[] type: 'string', displayOptions: { show: { - 'synced': [ - false, - ], + synced: [false], }, }, default: '', @@ -107,9 +105,7 @@ export const updateEmployeeSharedDescription = (sync = false): INodeProperties[] type: 'string', displayOptions: { show: { - 'synced': [ - false, - ], + synced: [false], }, }, default: '', @@ -156,7 +152,8 @@ export const updateEmployeeSharedDescription = (sync = false): INodeProperties[] displayName: 'Location Name or ID', name: 'location', type: 'options', - description: 'Choose from the list, or specify an ID using an expression', + description: + 'Choose from the list, or specify an ID using an expression', typeOptions: { loadOptionsMethod: 'getEmployeeLocations', }, @@ -319,19 +316,13 @@ export const updateEmployeeSharedDescription = (sync = false): INodeProperties[] ]; if (sync === true) { - elements = elements.map(element => { + elements = elements.map((element) => { return Object.assign(element, { displayOptions: { show: { - resource: [ - 'employee', - ], - operation: [ - 'update', - ], - synced: [ - true, - ], + resource: ['employee'], + operation: ['update'], + synced: [true], }, }, required: true, @@ -339,13 +330,11 @@ export const updateEmployeeSharedDescription = (sync = false): INodeProperties[] }); return elements; } else { - elements = elements.map(element => { + elements = elements.map((element) => { return Object.assign(element, { displayOptions: { show: { - '/synced': [ - false, - ], + '/synced': [false], }, }, }); diff --git a/packages/nodes-base/nodes/BambooHr/v1/actions/employeeDocument/del/description.ts b/packages/nodes-base/nodes/BambooHr/v1/actions/employeeDocument/del/description.ts index d898a312442bc..c12094c46c111 100644 --- a/packages/nodes-base/nodes/BambooHr/v1/actions/employeeDocument/del/description.ts +++ b/packages/nodes-base/nodes/BambooHr/v1/actions/employeeDocument/del/description.ts @@ -1,6 +1,4 @@ -import { - EmployeeDocumentProperties, -} from '../../Interfaces'; +import { EmployeeDocumentProperties } from '../../Interfaces'; export const employeeDocumentDelDescription: EmployeeDocumentProperties = [ { @@ -10,12 +8,8 @@ export const employeeDocumentDelDescription: EmployeeDocumentProperties = [ required: true, displayOptions: { show: { - operation: [ - 'delete', - ], - resource: [ - 'employeeDocument', - ], + operation: ['delete'], + resource: ['employeeDocument'], }, }, default: '', @@ -28,12 +22,8 @@ export const employeeDocumentDelDescription: EmployeeDocumentProperties = [ required: true, displayOptions: { show: { - operation: [ - 'delete', - ], - resource: [ - 'employeeDocument', - ], + operation: ['delete'], + resource: ['employeeDocument'], }, }, default: '', diff --git a/packages/nodes-base/nodes/BambooHr/v1/actions/employeeDocument/del/execute.ts b/packages/nodes-base/nodes/BambooHr/v1/actions/employeeDocument/del/execute.ts index 1d2ebe01b3f25..4f5615fc7b015 100644 --- a/packages/nodes-base/nodes/BambooHr/v1/actions/employeeDocument/del/execute.ts +++ b/packages/nodes-base/nodes/BambooHr/v1/actions/employeeDocument/del/execute.ts @@ -1,15 +1,8 @@ -import { - IExecuteFunctions, -} from 'n8n-core'; +import { IExecuteFunctions } from 'n8n-core'; -import { - IDataObject, - INodeExecutionData, -} from 'n8n-workflow'; +import { IDataObject, INodeExecutionData } from 'n8n-workflow'; -import { - apiRequest, -} from '../../../transport'; +import { apiRequest } from '../../../transport'; export async function del(this: IExecuteFunctions, index: number): Promise { const body: IDataObject = {}; diff --git a/packages/nodes-base/nodes/BambooHr/v1/actions/employeeDocument/del/index.ts b/packages/nodes-base/nodes/BambooHr/v1/actions/employeeDocument/del/index.ts index 4b40bf333a062..05d70b3f50845 100644 --- a/packages/nodes-base/nodes/BambooHr/v1/actions/employeeDocument/del/index.ts +++ b/packages/nodes-base/nodes/BambooHr/v1/actions/employeeDocument/del/index.ts @@ -1,7 +1,4 @@ import { del as execute } from './execute'; import { employeeDocumentDelDescription as description } from './description'; -export { - description, - execute, -}; +export { description, execute }; diff --git a/packages/nodes-base/nodes/BambooHr/v1/actions/employeeDocument/download/description.ts b/packages/nodes-base/nodes/BambooHr/v1/actions/employeeDocument/download/description.ts index 6560de5c2af71..e48fdc3f8d4fb 100644 --- a/packages/nodes-base/nodes/BambooHr/v1/actions/employeeDocument/download/description.ts +++ b/packages/nodes-base/nodes/BambooHr/v1/actions/employeeDocument/download/description.ts @@ -1,6 +1,4 @@ -import { - EmployeeDocumentProperties, -} from '../../Interfaces'; +import { EmployeeDocumentProperties } from '../../Interfaces'; export const employeeDocumentDownloadDescription: EmployeeDocumentProperties = [ { @@ -10,12 +8,8 @@ export const employeeDocumentDownloadDescription: EmployeeDocumentProperties = [ required: true, displayOptions: { show: { - operation: [ - 'download', - ], - resource: [ - 'employeeDocument', - ], + operation: ['download'], + resource: ['employeeDocument'], }, }, default: '', @@ -28,12 +22,8 @@ export const employeeDocumentDownloadDescription: EmployeeDocumentProperties = [ required: true, displayOptions: { show: { - operation: [ - 'download', - ], - resource: [ - 'employeeDocument', - ], + operation: ['download'], + resource: ['employeeDocument'], }, }, default: '', @@ -48,12 +38,8 @@ export const employeeDocumentDownloadDescription: EmployeeDocumentProperties = [ description: 'The name of the output field to put the binary file data in', displayOptions: { show: { - operation: [ - 'download', - ], - resource: [ - 'employeeDocument', - ], + operation: ['download'], + resource: ['employeeDocument'], }, }, }, diff --git a/packages/nodes-base/nodes/BambooHr/v1/actions/employeeDocument/download/execute.ts b/packages/nodes-base/nodes/BambooHr/v1/actions/employeeDocument/download/execute.ts index 4c9870ea4ef43..816a1f1dd94da 100644 --- a/packages/nodes-base/nodes/BambooHr/v1/actions/employeeDocument/download/execute.ts +++ b/packages/nodes-base/nodes/BambooHr/v1/actions/employeeDocument/download/execute.ts @@ -1,15 +1,8 @@ -import { - IExecuteFunctions, -} from 'n8n-core'; +import { IExecuteFunctions } from 'n8n-core'; -import { - IDataObject, - INodeExecutionData, -} from 'n8n-workflow'; +import { IDataObject, INodeExecutionData } from 'n8n-workflow'; -import { - apiRequest, -} from '../../../transport'; +import { apiRequest } from '../../../transport'; export async function download(this: IExecuteFunctions, index: number) { const body: IDataObject = {}; @@ -25,10 +18,13 @@ export async function download(this: IExecuteFunctions, index: number) { const endpoint = `employees/${id}/files/${fileId}/`; //response - const response = await apiRequest.call(this, requestMethod, endpoint, body, {} as IDataObject, - { encoding: null, json: false, resolveWithFullResponse: true }); + const response = await apiRequest.call(this, requestMethod, endpoint, body, {} as IDataObject, { + encoding: null, + json: false, + resolveWithFullResponse: true, + }); let mimeType = response.headers['content-type'] as string | undefined; - mimeType = mimeType ? mimeType.split(';').find(value => value.includes('/')) : undefined; + mimeType = mimeType ? mimeType.split(';').find((value) => value.includes('/')) : undefined; const contentDisposition = response.headers['content-disposition']; const fileNameRegex = /(?<=filename=").*\b/; const match = fileNameRegex.exec(contentDisposition); @@ -52,7 +48,11 @@ export async function download(this: IExecuteFunctions, index: number) { } newItem.binary = { - [output]: await this.helpers.prepareBinaryData(response.body as unknown as Buffer, fileName, mimeType), + [output]: await this.helpers.prepareBinaryData( + response.body as unknown as Buffer, + fileName, + mimeType, + ), }; return this.prepareOutputData(newItem as unknown as INodeExecutionData[]); diff --git a/packages/nodes-base/nodes/BambooHr/v1/actions/employeeDocument/download/index.ts b/packages/nodes-base/nodes/BambooHr/v1/actions/employeeDocument/download/index.ts index 956798721cd3e..67f73a986dfc7 100644 --- a/packages/nodes-base/nodes/BambooHr/v1/actions/employeeDocument/download/index.ts +++ b/packages/nodes-base/nodes/BambooHr/v1/actions/employeeDocument/download/index.ts @@ -1,7 +1,4 @@ import { download as execute } from './execute'; import { employeeDocumentDownloadDescription as description } from './description'; -export { - description, - execute, -}; +export { description, execute }; diff --git a/packages/nodes-base/nodes/BambooHr/v1/actions/employeeDocument/getAll/description.ts b/packages/nodes-base/nodes/BambooHr/v1/actions/employeeDocument/getAll/description.ts index aabd0d527f737..e2258048484c1 100644 --- a/packages/nodes-base/nodes/BambooHr/v1/actions/employeeDocument/getAll/description.ts +++ b/packages/nodes-base/nodes/BambooHr/v1/actions/employeeDocument/getAll/description.ts @@ -1,6 +1,4 @@ -import { - EmployeeDocumentProperties, -} from '../../Interfaces'; +import { EmployeeDocumentProperties } from '../../Interfaces'; export const employeeDocumentGetAllDescription: EmployeeDocumentProperties = [ { @@ -10,12 +8,8 @@ export const employeeDocumentGetAllDescription: EmployeeDocumentProperties = [ required: true, displayOptions: { show: { - operation: [ - 'getAll', - ], - resource: [ - 'employeeDocument', - ], + operation: ['getAll'], + resource: ['employeeDocument'], }, }, default: '', @@ -27,12 +21,8 @@ export const employeeDocumentGetAllDescription: EmployeeDocumentProperties = [ default: false, displayOptions: { show: { - operation: [ - 'getAll', - ], - resource: [ - 'employeeDocument', - ], + operation: ['getAll'], + resource: ['employeeDocument'], }, }, description: 'Whether to return all results or only up to a given limit', @@ -49,15 +39,9 @@ export const employeeDocumentGetAllDescription: EmployeeDocumentProperties = [ }, displayOptions: { show: { - operation: [ - 'getAll', - ], - resource: [ - 'employeeDocument', - ], - returnAll: [ - false, - ], + operation: ['getAll'], + resource: ['employeeDocument'], + returnAll: [false], }, }, }, @@ -68,12 +52,8 @@ export const employeeDocumentGetAllDescription: EmployeeDocumentProperties = [ default: true, displayOptions: { show: { - operation: [ - 'getAll', - ], - resource: [ - 'employeeDocument', - ], + operation: ['getAll'], + resource: ['employeeDocument'], }, }, description: 'Whether to return a simplified version of the response instead of the raw data', diff --git a/packages/nodes-base/nodes/BambooHr/v1/actions/employeeDocument/getAll/execute.ts b/packages/nodes-base/nodes/BambooHr/v1/actions/employeeDocument/getAll/execute.ts index 2a11cad42c5c7..dbede13557545 100644 --- a/packages/nodes-base/nodes/BambooHr/v1/actions/employeeDocument/getAll/execute.ts +++ b/packages/nodes-base/nodes/BambooHr/v1/actions/employeeDocument/getAll/execute.ts @@ -1,17 +1,13 @@ -import { - IExecuteFunctions, -} from 'n8n-core'; +import { IExecuteFunctions } from 'n8n-core'; -import { - IDataObject, - INodeExecutionData, -} from 'n8n-workflow'; +import { IDataObject, INodeExecutionData } from 'n8n-workflow'; -import { - apiRequest, -} from '../../../transport'; +import { apiRequest } from '../../../transport'; -export async function getAll(this: IExecuteFunctions, index: number): Promise { +export async function getAll( + this: IExecuteFunctions, + index: number, +): Promise { const body: IDataObject = {}; const requestMethod = 'GET'; diff --git a/packages/nodes-base/nodes/BambooHr/v1/actions/employeeDocument/getAll/index.ts b/packages/nodes-base/nodes/BambooHr/v1/actions/employeeDocument/getAll/index.ts index 60a7d085c521e..eb6a95a73ec97 100644 --- a/packages/nodes-base/nodes/BambooHr/v1/actions/employeeDocument/getAll/index.ts +++ b/packages/nodes-base/nodes/BambooHr/v1/actions/employeeDocument/getAll/index.ts @@ -1,7 +1,4 @@ import { getAll as execute } from './execute'; import { employeeDocumentGetAllDescription as description } from './description'; -export { - description, - execute, -}; +export { description, execute }; diff --git a/packages/nodes-base/nodes/BambooHr/v1/actions/employeeDocument/index.ts b/packages/nodes-base/nodes/BambooHr/v1/actions/employeeDocument/index.ts index 95d3d79ad94c8..29e79989d65a1 100644 --- a/packages/nodes-base/nodes/BambooHr/v1/actions/employeeDocument/index.ts +++ b/packages/nodes-base/nodes/BambooHr/v1/actions/employeeDocument/index.ts @@ -4,17 +4,9 @@ import * as getAll from './getAll'; import * as update from './update'; import * as upload from './upload'; -import { - INodeProperties, -} from 'n8n-workflow'; +import { INodeProperties } from 'n8n-workflow'; -export { - del, - download, - getAll, - update, - upload, -}; +export { del, download, getAll, update, upload }; export const descriptions: INodeProperties[] = [ { @@ -24,9 +16,7 @@ export const descriptions: INodeProperties[] = [ noDataExpression: true, displayOptions: { show: { - resource: [ - 'employeeDocument', - ], + resource: ['employeeDocument'], }, }, options: [ diff --git a/packages/nodes-base/nodes/BambooHr/v1/actions/employeeDocument/update/description.ts b/packages/nodes-base/nodes/BambooHr/v1/actions/employeeDocument/update/description.ts index ba16465e8d983..a4380e9e7d286 100644 --- a/packages/nodes-base/nodes/BambooHr/v1/actions/employeeDocument/update/description.ts +++ b/packages/nodes-base/nodes/BambooHr/v1/actions/employeeDocument/update/description.ts @@ -1,6 +1,4 @@ -import { - EmployeeDocumentProperties, -} from '../../Interfaces'; +import { EmployeeDocumentProperties } from '../../Interfaces'; export const employeeDocumentUpdateDescription: EmployeeDocumentProperties = [ { @@ -10,12 +8,8 @@ export const employeeDocumentUpdateDescription: EmployeeDocumentProperties = [ required: true, displayOptions: { show: { - operation: [ - 'update', - ], - resource: [ - 'employeeDocument', - ], + operation: ['update'], + resource: ['employeeDocument'], }, }, default: '', @@ -27,12 +21,8 @@ export const employeeDocumentUpdateDescription: EmployeeDocumentProperties = [ required: true, displayOptions: { show: { - operation: [ - 'update', - ], - resource: [ - 'employeeDocument', - ], + operation: ['update'], + resource: ['employeeDocument'], }, }, default: '', @@ -45,12 +35,8 @@ export const employeeDocumentUpdateDescription: EmployeeDocumentProperties = [ default: {}, displayOptions: { show: { - operation: [ - 'update', - ], - resource: [ - 'employeeDocument', - ], + operation: ['update'], + resource: ['employeeDocument'], }, }, options: [ @@ -60,12 +46,11 @@ export const employeeDocumentUpdateDescription: EmployeeDocumentProperties = [ type: 'options', typeOptions: { loadOptionsMethod: 'getEmployeeDocumentCategories', - loadOptionsDependsOn: [ - 'employeeId', - ], + loadOptionsDependsOn: ['employeeId'], }, default: '', - description: 'ID of the new category of the file. Choose from the list, or specify an ID using an expression.', + description: + 'ID of the new category of the file. Choose from the list, or specify an ID using an expression.', }, { displayName: 'Name', diff --git a/packages/nodes-base/nodes/BambooHr/v1/actions/employeeDocument/update/execute.ts b/packages/nodes-base/nodes/BambooHr/v1/actions/employeeDocument/update/execute.ts index 04acce14853f6..8ea89c1fd0a03 100644 --- a/packages/nodes-base/nodes/BambooHr/v1/actions/employeeDocument/update/execute.ts +++ b/packages/nodes-base/nodes/BambooHr/v1/actions/employeeDocument/update/execute.ts @@ -1,17 +1,13 @@ -import { - IExecuteFunctions, -} from 'n8n-core'; +import { IExecuteFunctions } from 'n8n-core'; -import { - IDataObject, - INodeExecutionData, -} from 'n8n-workflow'; +import { IDataObject, INodeExecutionData } from 'n8n-workflow'; -import { - apiRequest, -} from '../../../transport'; +import { apiRequest } from '../../../transport'; -export async function update(this: IExecuteFunctions, index: number): Promise { +export async function update( + this: IExecuteFunctions, + index: number, +): Promise { let body: IDataObject = {}; const requestMethod = 'POST'; @@ -24,7 +20,7 @@ export async function update(this: IExecuteFunctions, index: number): Promise { const body: IDataObject = {}; diff --git a/packages/nodes-base/nodes/BambooHr/v1/actions/file/del/index.ts b/packages/nodes-base/nodes/BambooHr/v1/actions/file/del/index.ts index 90105b3d1c8f9..0bef7541b8931 100644 --- a/packages/nodes-base/nodes/BambooHr/v1/actions/file/del/index.ts +++ b/packages/nodes-base/nodes/BambooHr/v1/actions/file/del/index.ts @@ -1,7 +1,4 @@ import { del as execute } from './execute'; import { fileDelDescription as description } from './description'; -export { - description, - execute, -}; +export { description, execute }; diff --git a/packages/nodes-base/nodes/BambooHr/v1/actions/file/download/description.ts b/packages/nodes-base/nodes/BambooHr/v1/actions/file/download/description.ts index 55b45d6d79222..d600fb61b0846 100644 --- a/packages/nodes-base/nodes/BambooHr/v1/actions/file/download/description.ts +++ b/packages/nodes-base/nodes/BambooHr/v1/actions/file/download/description.ts @@ -1,6 +1,4 @@ -import { - FileProperties, -} from '../../Interfaces'; +import { FileProperties } from '../../Interfaces'; export const fileDownloadDescription: FileProperties = [ { @@ -10,12 +8,8 @@ export const fileDownloadDescription: FileProperties = [ required: true, displayOptions: { show: { - operation: [ - 'download', - ], - resource: [ - 'file', - ], + operation: ['download'], + resource: ['file'], }, }, default: '', @@ -30,12 +24,8 @@ export const fileDownloadDescription: FileProperties = [ description: 'The name of the output field to put the binary file data in', displayOptions: { show: { - operation: [ - 'download', - ], - resource: [ - 'file', - ], + operation: ['download'], + resource: ['file'], }, }, }, diff --git a/packages/nodes-base/nodes/BambooHr/v1/actions/file/download/execute.ts b/packages/nodes-base/nodes/BambooHr/v1/actions/file/download/execute.ts index 358be14eca94d..b3b5bf4cf8a2b 100644 --- a/packages/nodes-base/nodes/BambooHr/v1/actions/file/download/execute.ts +++ b/packages/nodes-base/nodes/BambooHr/v1/actions/file/download/execute.ts @@ -1,15 +1,8 @@ -import { - IExecuteFunctions, -} from 'n8n-core'; +import { IExecuteFunctions } from 'n8n-core'; -import { - IDataObject, - INodeExecutionData, -} from 'n8n-workflow'; +import { IDataObject, INodeExecutionData } from 'n8n-workflow'; -import { - apiRequest, -} from '../../../transport'; +import { apiRequest } from '../../../transport'; export async function download(this: IExecuteFunctions, index: number) { const body: IDataObject = {}; @@ -24,11 +17,14 @@ export async function download(this: IExecuteFunctions, index: number) { const endpoint = `files/${fileId}/`; //response - const response = await apiRequest.call(this, requestMethod, endpoint, body, {} as IDataObject, - { encoding: null, json: false, resolveWithFullResponse: true }); + const response = await apiRequest.call(this, requestMethod, endpoint, body, {} as IDataObject, { + encoding: null, + json: false, + resolveWithFullResponse: true, + }); let mimeType = response.headers['content-type'] as string | undefined; - mimeType = mimeType ? mimeType.split(';').find(value => value.includes('/')) : undefined; + mimeType = mimeType ? mimeType.split(';').find((value) => value.includes('/')) : undefined; const contentDisposition = response.headers['content-disposition']; const fileNameRegex = /(?<=filename=").*\b/; const match = fileNameRegex.exec(contentDisposition); @@ -52,7 +48,11 @@ export async function download(this: IExecuteFunctions, index: number) { } newItem.binary = { - [output]: await this.helpers.prepareBinaryData(response.body as unknown as Buffer, fileName, mimeType), + [output]: await this.helpers.prepareBinaryData( + response.body as unknown as Buffer, + fileName, + mimeType, + ), }; return this.prepareOutputData(newItem as unknown as INodeExecutionData[]); diff --git a/packages/nodes-base/nodes/BambooHr/v1/actions/file/download/index.ts b/packages/nodes-base/nodes/BambooHr/v1/actions/file/download/index.ts index 0f3b6da933937..8d736b9e28da4 100644 --- a/packages/nodes-base/nodes/BambooHr/v1/actions/file/download/index.ts +++ b/packages/nodes-base/nodes/BambooHr/v1/actions/file/download/index.ts @@ -1,7 +1,4 @@ import { download as execute } from './execute'; import { fileDownloadDescription as description } from './description'; -export { - description, - execute, -}; +export { description, execute }; diff --git a/packages/nodes-base/nodes/BambooHr/v1/actions/file/getAll/description.ts b/packages/nodes-base/nodes/BambooHr/v1/actions/file/getAll/description.ts index 646ed3c03570c..f965f854d0318 100644 --- a/packages/nodes-base/nodes/BambooHr/v1/actions/file/getAll/description.ts +++ b/packages/nodes-base/nodes/BambooHr/v1/actions/file/getAll/description.ts @@ -1,6 +1,4 @@ -import { - FileProperties, -} from '../../Interfaces'; +import { FileProperties } from '../../Interfaces'; export const fileGetAllDescription: FileProperties = [ { @@ -11,12 +9,8 @@ export const fileGetAllDescription: FileProperties = [ description: 'Whether to return all results or only up to a given limit', displayOptions: { show: { - operation: [ - 'getAll', - ], - resource: [ - 'file', - ], + operation: ['getAll'], + resource: ['file'], }, }, }, @@ -32,15 +26,9 @@ export const fileGetAllDescription: FileProperties = [ }, displayOptions: { show: { - operation: [ - 'getAll', - ], - resource: [ - 'file', - ], - returnAll: [ - false, - ], + operation: ['getAll'], + resource: ['file'], + returnAll: [false], }, }, }, @@ -51,12 +39,8 @@ export const fileGetAllDescription: FileProperties = [ default: true, displayOptions: { show: { - operation: [ - 'getAll', - ], - resource: [ - 'file', - ], + operation: ['getAll'], + resource: ['file'], }, }, description: 'Whether to return a simplified version of the response instead of the raw data', diff --git a/packages/nodes-base/nodes/BambooHr/v1/actions/file/getAll/execute.ts b/packages/nodes-base/nodes/BambooHr/v1/actions/file/getAll/execute.ts index b78dc8ee837ff..6fd312a50dd7d 100644 --- a/packages/nodes-base/nodes/BambooHr/v1/actions/file/getAll/execute.ts +++ b/packages/nodes-base/nodes/BambooHr/v1/actions/file/getAll/execute.ts @@ -1,17 +1,13 @@ -import { - IExecuteFunctions, -} from 'n8n-core'; +import { IExecuteFunctions } from 'n8n-core'; -import { - IDataObject, - INodeExecutionData, -} from 'n8n-workflow'; +import { IDataObject, INodeExecutionData } from 'n8n-workflow'; -import { - apiRequest, -} from '../../../transport'; +import { apiRequest } from '../../../transport'; -export async function getAll(this: IExecuteFunctions, index: number): Promise { +export async function getAll( + this: IExecuteFunctions, + index: number, +): Promise { const body: IDataObject = {}; const requestMethod = 'GET'; const endpoint = 'files/view'; diff --git a/packages/nodes-base/nodes/BambooHr/v1/actions/file/getAll/index.ts b/packages/nodes-base/nodes/BambooHr/v1/actions/file/getAll/index.ts index 3b1b2ee79527c..ddb484a98c4b1 100644 --- a/packages/nodes-base/nodes/BambooHr/v1/actions/file/getAll/index.ts +++ b/packages/nodes-base/nodes/BambooHr/v1/actions/file/getAll/index.ts @@ -1,7 +1,4 @@ import { getAll as execute } from './execute'; import { fileGetAllDescription as description } from './description'; -export { - description, - execute, -}; +export { description, execute }; diff --git a/packages/nodes-base/nodes/BambooHr/v1/actions/file/index.ts b/packages/nodes-base/nodes/BambooHr/v1/actions/file/index.ts index 464e5ae05bb2b..02d05ec6c224a 100644 --- a/packages/nodes-base/nodes/BambooHr/v1/actions/file/index.ts +++ b/packages/nodes-base/nodes/BambooHr/v1/actions/file/index.ts @@ -4,17 +4,9 @@ import * as getAll from './getAll'; import * as update from './update'; import * as upload from './upload'; -import { - INodeProperties, -} from 'n8n-workflow'; +import { INodeProperties } from 'n8n-workflow'; -export { - del, - download, - getAll, - update, - upload, -}; +export { del, download, getAll, update, upload }; export const descriptions: INodeProperties[] = [ { @@ -24,9 +16,7 @@ export const descriptions: INodeProperties[] = [ noDataExpression: true, displayOptions: { show: { - resource: [ - 'file', - ], + resource: ['file'], }, }, options: [ diff --git a/packages/nodes-base/nodes/BambooHr/v1/actions/file/update/description.ts b/packages/nodes-base/nodes/BambooHr/v1/actions/file/update/description.ts index 7c0b110c1a633..f1e722eb4e1e9 100644 --- a/packages/nodes-base/nodes/BambooHr/v1/actions/file/update/description.ts +++ b/packages/nodes-base/nodes/BambooHr/v1/actions/file/update/description.ts @@ -1,6 +1,4 @@ -import { - FileProperties, -} from '../../Interfaces'; +import { FileProperties } from '../../Interfaces'; export const fileUpdateDescription: FileProperties = [ { @@ -10,12 +8,8 @@ export const fileUpdateDescription: FileProperties = [ required: true, displayOptions: { show: { - operation: [ - 'update', - ], - resource: [ - 'file', - ], + operation: ['update'], + resource: ['file'], }, }, default: '', @@ -29,12 +23,8 @@ export const fileUpdateDescription: FileProperties = [ default: {}, displayOptions: { show: { - operation: [ - 'update', - ], - resource: [ - 'file', - ], + operation: ['update'], + resource: ['file'], }, }, options: [ @@ -46,7 +36,8 @@ export const fileUpdateDescription: FileProperties = [ loadOptionsMethod: 'getCompanyFileCategories', }, default: '', - description: 'Move the file to a different category. Choose from the list, or specify an ID using an expression.', + description: + 'Move the file to a different category. Choose from the list, or specify an ID using an expression.', }, { displayName: 'Name', diff --git a/packages/nodes-base/nodes/BambooHr/v1/actions/file/update/execute.ts b/packages/nodes-base/nodes/BambooHr/v1/actions/file/update/execute.ts index aed7b0f3f05f9..1618aac3328b0 100644 --- a/packages/nodes-base/nodes/BambooHr/v1/actions/file/update/execute.ts +++ b/packages/nodes-base/nodes/BambooHr/v1/actions/file/update/execute.ts @@ -1,17 +1,13 @@ -import { - IExecuteFunctions, -} from 'n8n-core'; +import { IExecuteFunctions } from 'n8n-core'; -import { - IDataObject, - INodeExecutionData, -} from 'n8n-workflow'; +import { IDataObject, INodeExecutionData } from 'n8n-workflow'; -import { - apiRequest, -} from '../../../transport'; +import { apiRequest } from '../../../transport'; -export async function update(this: IExecuteFunctions, index: number): Promise { +export async function update( + this: IExecuteFunctions, + index: number, +): Promise { const body: IDataObject = {}; const requestMethod = 'POST'; @@ -22,7 +18,11 @@ export async function update(this: IExecuteFunctions, index: number): Promiseexpression', + description: + 'Choose from the list, or specify an ID using an expression', typeOptions: { loadOptionsMethod: 'getCompanyFileCategories', }, required: true, displayOptions: { show: { - operation: [ - 'upload', - ], - resource: [ - 'file', - ], + operation: ['upload'], + resource: ['file'], }, }, default: '', @@ -47,12 +41,8 @@ export const fileUploadDescription: INodeProperties[] = [ placeholder: 'Add Field', displayOptions: { show: { - operation: [ - 'upload', - ], - resource: [ - 'file', - ], + operation: ['upload'], + resource: ['file'], }, }, default: {}, diff --git a/packages/nodes-base/nodes/BambooHr/v1/actions/file/upload/execute.ts b/packages/nodes-base/nodes/BambooHr/v1/actions/file/upload/execute.ts index c9c711d671c46..fda421d1bc07f 100644 --- a/packages/nodes-base/nodes/BambooHr/v1/actions/file/upload/execute.ts +++ b/packages/nodes-base/nodes/BambooHr/v1/actions/file/upload/execute.ts @@ -1,17 +1,8 @@ -import { - IExecuteFunctions, -} from 'n8n-core'; +import { IExecuteFunctions } from 'n8n-core'; -import { - IBinaryData, - IBinaryKeyData, - IDataObject, - NodeOperationError, -} from 'n8n-workflow'; +import { IBinaryData, IBinaryKeyData, IDataObject, NodeOperationError } from 'n8n-workflow'; -import { - apiRequest, -} from '../../../transport'; +import { apiRequest } from '../../../transport'; export async function upload(this: IExecuteFunctions, index: number) { let body: IDataObject = {}; @@ -23,13 +14,19 @@ export async function upload(this: IExecuteFunctions, index: number) { const share = this.getNodeParameter('options.share', index, true) as boolean; if (items[index].binary === undefined) { - throw new NodeOperationError(this.getNode(), 'No binary data exists on item!', { itemIndex: index }); + throw new NodeOperationError(this.getNode(), 'No binary data exists on item!', { + itemIndex: index, + }); } const propertyNameUpload = this.getNodeParameter('binaryPropertyName', index) as string; if (items[index]!.binary![propertyNameUpload] === undefined) { - throw new NodeOperationError(this.getNode(), `No binary data property "${propertyNameUpload}" does not exists on item!`, { itemIndex: index }); + throw new NodeOperationError( + this.getNode(), + `No binary data property "${propertyNameUpload}" does not exists on item!`, + { itemIndex: index }, + ); } const item = items[index].binary as IBinaryKeyData; @@ -54,7 +51,7 @@ export async function upload(this: IExecuteFunctions, index: number) { resolveWithFullResponse: true, }; - Object.assign(body.formData, (share) ? { share: 'yes' } : { share: 'no' }); + Object.assign(body.formData, share ? { share: 'yes' } : { share: 'no' }); //endpoint const endpoint = `files`; diff --git a/packages/nodes-base/nodes/BambooHr/v1/actions/file/upload/index.ts b/packages/nodes-base/nodes/BambooHr/v1/actions/file/upload/index.ts index 23cd4577f3186..20787c370b06b 100644 --- a/packages/nodes-base/nodes/BambooHr/v1/actions/file/upload/index.ts +++ b/packages/nodes-base/nodes/BambooHr/v1/actions/file/upload/index.ts @@ -1,7 +1,4 @@ import { upload as execute } from './execute'; import { fileUploadDescription as description } from './description'; -export { - description, - execute, -}; +export { description, execute }; diff --git a/packages/nodes-base/nodes/BambooHr/v1/actions/router.ts b/packages/nodes-base/nodes/BambooHr/v1/actions/router.ts index b053254582147..e8e97623a18c6 100644 --- a/packages/nodes-base/nodes/BambooHr/v1/actions/router.ts +++ b/packages/nodes-base/nodes/BambooHr/v1/actions/router.ts @@ -1,10 +1,6 @@ -import { - IExecuteFunctions, -} from 'n8n-core'; +import { IExecuteFunctions } from 'n8n-core'; -import { - INodeExecutionData, -} from 'n8n-workflow'; +import { INodeExecutionData } from 'n8n-workflow'; import * as employee from './employee'; import * as employeeDocument from './employeeDocument'; @@ -33,16 +29,16 @@ export async function router(this: IExecuteFunctions): Promise { +export async function bambooHrApiCredentialTest( + this: ICredentialTestFunctions, + credential: ICredentialsDecrypted, +): Promise { try { await validateCredentials.call(this, credential.data as ICredentialDataDecryptedObject); } catch (error) { @@ -22,15 +25,16 @@ export async function bambooHrApiCredentialTest(this: ICredentialTestFunctions, } as INodeCredentialTestResult; } -async function validateCredentials(this: ICredentialTestFunctions, decryptedCredentials: ICredentialDataDecryptedObject): Promise { // tslint:disable-line:no-any +async function validateCredentials( + this: ICredentialTestFunctions, + decryptedCredentials: ICredentialDataDecryptedObject, + // tslint:disable-next-line:no-any +): Promise { const credentials = decryptedCredentials; - const { - subdomain, - apiKey, - } = credentials as { - subdomain: string, - apiKey: string, + const { subdomain, apiKey } = credentials as { + subdomain: string; + apiKey: string; }; const options: IHttpRequestOptions = { diff --git a/packages/nodes-base/nodes/BambooHr/v1/methods/loadOptions.ts b/packages/nodes-base/nodes/BambooHr/v1/methods/loadOptions.ts index 37f57ad54c580..8d29d8ea8d14e 100644 --- a/packages/nodes-base/nodes/BambooHr/v1/methods/loadOptions.ts +++ b/packages/nodes-base/nodes/BambooHr/v1/methods/loadOptions.ts @@ -1,15 +1,11 @@ -import { - IDataObject, - ILoadOptionsFunctions, - INodePropertyOptions, -} from 'n8n-workflow'; +import { IDataObject, ILoadOptionsFunctions, INodePropertyOptions } from 'n8n-workflow'; -import { - apiRequest, -} from '../transport'; +import { apiRequest } from '../transport'; // Get all the available channels -export async function getTimeOffTypeID(this: ILoadOptionsFunctions): Promise { +export async function getTimeOffTypeID( + this: ILoadOptionsFunctions, +): Promise { const returnData: INodePropertyOptions[] = []; const body: IDataObject = {}; const requestMethod = 'GET'; @@ -27,7 +23,9 @@ export async function getTimeOffTypeID(this: ILoadOptionsFunctions): Promise { +export async function getCompanyFileCategories( + this: ILoadOptionsFunctions, +): Promise { const returnData: INodePropertyOptions[] = []; const body: IDataObject = {}; const requestMethod = 'GET'; @@ -42,18 +40,20 @@ export async function getCompanyFileCategories(this: ILoadOptionsFunctions): Pro value: category.id, }); } - + returnData.sort(sort); return returnData; } -export async function getEmployeeDocumentCategories(this: ILoadOptionsFunctions): Promise { +export async function getEmployeeDocumentCategories( + this: ILoadOptionsFunctions, +): Promise { const returnData: INodePropertyOptions[] = []; const body: IDataObject = {}; const requestMethod = 'GET'; const id = this.getCurrentNodeParameter('employeeId') as string; - + const endPoint = `employees/${id}/files/view/`; const response = await apiRequest.call(this, requestMethod, endPoint, body); @@ -71,16 +71,20 @@ export async function getEmployeeDocumentCategories(this: ILoadOptionsFunctions) return returnData; } -export async function getEmployeeLocations(this: ILoadOptionsFunctions): Promise { +export async function getEmployeeLocations( + this: ILoadOptionsFunctions, +): Promise { const returnData: INodePropertyOptions[] = []; const body: IDataObject = {}; const requestMethod = 'GET'; const endPoint = 'meta/lists/'; - //do not request all data? - const fields = await apiRequest.call(this, requestMethod, endPoint, body, {}) as [{ fieldId: number, options: [{ id: number, name: string }] }]; + //do not request all data? + const fields = (await apiRequest.call(this, requestMethod, endPoint, body, {})) as [ + { fieldId: number; options: [{ id: number; name: string }] }, + ]; - const options = fields.filter(field => field.fieldId === 18)[0].options; + const options = fields.filter((field) => field.fieldId === 18)[0].options; for (const option of options) { returnData.push({ @@ -100,10 +104,12 @@ export async function getDepartments(this: ILoadOptionsFunctions): Promise field.fieldId === 4)[0].options; + const options = fields.filter((field) => field.fieldId === 4)[0].options; for (const option of options) { returnData.push({ @@ -123,10 +129,12 @@ export async function getDivisions(this: ILoadOptionsFunctions): Promise field.fieldId === 1355)[0].options; + const options = fields.filter((field) => field.fieldId === 1355)[0].options; for (const option of options) { returnData.push({ @@ -140,7 +148,9 @@ export async function getDivisions(this: ILoadOptionsFunctions): Promise { +export async function getEmployeeFields( + this: ILoadOptionsFunctions, +): Promise { const returnData: INodePropertyOptions[] = []; const body: IDataObject = {}; const requestMethod = 'GET'; @@ -167,10 +177,11 @@ export async function getEmployeeFields(this: ILoadOptionsFunctions): Promise { - if (a.name.toLocaleLowerCase() < b.name.toLocaleLowerCase()) { return -1; } - if (a.name.toLocaleLowerCase() > b.name.toLocaleLowerCase()) { return 1; } + if (a.name.toLocaleLowerCase() < b.name.toLocaleLowerCase()) { + return -1; + } + if (a.name.toLocaleLowerCase() > b.name.toLocaleLowerCase()) { + return 1; + } return 0; }; - - - diff --git a/packages/nodes-base/nodes/BambooHr/v1/transport/index.ts b/packages/nodes-base/nodes/BambooHr/v1/transport/index.ts index 66a0a7859bb61..6421abf74dad6 100644 --- a/packages/nodes-base/nodes/BambooHr/v1/transport/index.ts +++ b/packages/nodes-base/nodes/BambooHr/v1/transport/index.ts @@ -1,18 +1,8 @@ -import { - IExecuteFunctions, - IHookFunctions, - ILoadOptionsFunctions, -} from 'n8n-core'; +import { IExecuteFunctions, IHookFunctions, ILoadOptionsFunctions } from 'n8n-core'; -import { - IDataObject, - NodeApiError, - NodeOperationError, -} from 'n8n-workflow'; +import { IDataObject, NodeApiError, NodeOperationError } from 'n8n-workflow'; -import { - OptionsWithUrl, -} from 'request'; +import { OptionsWithUrl } from 'request'; /** * Make an API request to Mattermost diff --git a/packages/nodes-base/nodes/Bitwarden/descriptions/CollectionDescription.ts b/packages/nodes-base/nodes/Bitwarden/descriptions/CollectionDescription.ts index d887b6c1243f6..45907d487f7fd 100644 --- a/packages/nodes-base/nodes/Bitwarden/descriptions/CollectionDescription.ts +++ b/packages/nodes-base/nodes/Bitwarden/descriptions/CollectionDescription.ts @@ -1,6 +1,4 @@ -import { - INodeProperties, -} from 'n8n-workflow'; +import { INodeProperties } from 'n8n-workflow'; export const collectionOperations: INodeProperties[] = [ { @@ -33,9 +31,7 @@ export const collectionOperations: INodeProperties[] = [ ], displayOptions: { show: { - resource: [ - 'collection', - ], + resource: ['collection'], }, }, }, @@ -55,14 +51,8 @@ export const collectionFields: INodeProperties[] = [ placeholder: '5e59c8c7-e05a-4d17-8e85-acc301343926', displayOptions: { show: { - resource: [ - 'collection', - ], - operation: [ - 'delete', - 'get', - 'update', - ], + resource: ['collection'], + operation: ['delete', 'get', 'update'], }, }, }, @@ -78,12 +68,8 @@ export const collectionFields: INodeProperties[] = [ description: 'Whether to return all results or only up to a given limit', displayOptions: { show: { - resource: [ - 'collection', - ], - operation: [ - 'getAll', - ], + resource: ['collection'], + operation: ['getAll'], }, }, }, @@ -98,15 +84,9 @@ export const collectionFields: INodeProperties[] = [ description: 'Max number of results to return', displayOptions: { show: { - resource: [ - 'collection', - ], - operation: [ - 'getAll', - ], - returnAll: [ - false, - ], + resource: ['collection'], + operation: ['getAll'], + returnAll: [false], }, }, }, @@ -126,7 +106,8 @@ export const collectionFields: INodeProperties[] = [ displayName: 'Group Names or IDs', name: 'groups', type: 'multiOptions', - description: 'The group to assign this collection to. Choose from the list, or specify IDs using an expression.', + description: + 'The group to assign this collection to. Choose from the list, or specify IDs using an expression.', default: [], typeOptions: { loadOptionsMethod: 'getGroups', @@ -142,12 +123,8 @@ export const collectionFields: INodeProperties[] = [ ], displayOptions: { show: { - resource: [ - 'collection', - ], - operation: [ - 'update', - ], + resource: ['collection'], + operation: ['update'], }, }, }, diff --git a/packages/nodes-base/nodes/Bitwarden/descriptions/EventDescription.ts b/packages/nodes-base/nodes/Bitwarden/descriptions/EventDescription.ts index 6d9ea6c57e3eb..32155722303dc 100644 --- a/packages/nodes-base/nodes/Bitwarden/descriptions/EventDescription.ts +++ b/packages/nodes-base/nodes/Bitwarden/descriptions/EventDescription.ts @@ -1,6 +1,4 @@ -import { - INodeProperties, -} from 'n8n-workflow'; +import { INodeProperties } from 'n8n-workflow'; export const eventOperations: INodeProperties[] = [ { @@ -18,15 +16,12 @@ export const eventOperations: INodeProperties[] = [ ], displayOptions: { show: { - resource: [ - 'event', - ], + resource: ['event'], }, }, }, ]; - export const eventFields: INodeProperties[] = [ // ---------------------------------- // event: getAll @@ -39,12 +34,8 @@ export const eventFields: INodeProperties[] = [ description: 'Whether to return all results or only up to a given limit', displayOptions: { show: { - resource: [ - 'event', - ], - operation: [ - 'getAll', - ], + resource: ['event'], + operation: ['getAll'], }, }, }, @@ -59,15 +50,9 @@ export const eventFields: INodeProperties[] = [ description: 'Max number of results to return', displayOptions: { show: { - resource: [ - 'event', - ], - operation: [ - 'getAll', - ], - returnAll: [ - false, - ], + resource: ['event'], + operation: ['getAll'], + returnAll: [false], }, }, }, @@ -111,12 +96,8 @@ export const eventFields: INodeProperties[] = [ ], displayOptions: { show: { - resource: [ - 'event', - ], - operation: [ - 'getAll', - ], + resource: ['event'], + operation: ['getAll'], }, }, }, diff --git a/packages/nodes-base/nodes/Bitwarden/descriptions/GroupDescription.ts b/packages/nodes-base/nodes/Bitwarden/descriptions/GroupDescription.ts index bfa9eaab7fb1d..fef3e30228059 100644 --- a/packages/nodes-base/nodes/Bitwarden/descriptions/GroupDescription.ts +++ b/packages/nodes-base/nodes/Bitwarden/descriptions/GroupDescription.ts @@ -1,6 +1,4 @@ -import { - INodeProperties, -} from 'n8n-workflow'; +import { INodeProperties } from 'n8n-workflow'; export const groupOperations: INodeProperties[] = [ { @@ -48,9 +46,7 @@ export const groupOperations: INodeProperties[] = [ ], displayOptions: { show: { - resource: [ - 'group', - ], + resource: ['group'], }, }, }, @@ -70,16 +66,8 @@ export const groupFields: INodeProperties[] = [ placeholder: '5e59c8c7-e05a-4d17-8e85-acc301343926', displayOptions: { show: { - resource: [ - 'group', - ], - operation: [ - 'delete', - 'get', - 'getMembers', - 'update', - 'updateMembers', - ], + resource: ['group'], + operation: ['delete', 'get', 'getMembers', 'update', 'updateMembers'], }, }, }, @@ -95,12 +83,8 @@ export const groupFields: INodeProperties[] = [ description: 'Whether to return all results or only up to a given limit', displayOptions: { show: { - resource: [ - 'group', - ], - operation: [ - 'getAll', - ], + resource: ['group'], + operation: ['getAll'], }, }, }, @@ -115,15 +99,9 @@ export const groupFields: INodeProperties[] = [ description: 'Max number of results to return', displayOptions: { show: { - resource: [ - 'group', - ], - operation: [ - 'getAll', - ], - returnAll: [ - false, - ], + resource: ['group'], + operation: ['getAll'], + returnAll: [false], }, }, }, @@ -140,12 +118,8 @@ export const groupFields: INodeProperties[] = [ description: 'The name of the group to create', displayOptions: { show: { - resource: [ - 'group', - ], - operation: [ - 'create', - ], + resource: ['group'], + operation: ['create'], }, }, }, @@ -154,15 +128,12 @@ export const groupFields: INodeProperties[] = [ name: 'accessAll', type: 'boolean', default: false, - description: 'Whether to allow this group to access all collections within the organization, instead of only its associated collections. If set to true, this option overrides any collection assignments.', + description: + 'Whether to allow this group to access all collections within the organization, instead of only its associated collections. If set to true, this option overrides any collection assignments.', displayOptions: { show: { - resource: [ - 'group', - ], - operation: [ - 'create', - ], + resource: ['group'], + operation: ['create'], }, }, }, @@ -177,7 +148,8 @@ export const groupFields: INodeProperties[] = [ displayName: 'Collection Names or IDs', name: 'collections', type: 'multiOptions', - description: 'The collections to assign to this group. Choose from the list, or specify IDs using an expression.', + description: + 'The collections to assign to this group. Choose from the list, or specify IDs using an expression.', default: [], typeOptions: { loadOptionsMethod: 'getCollections', @@ -193,12 +165,8 @@ export const groupFields: INodeProperties[] = [ ], displayOptions: { show: { - resource: [ - 'group', - ], - operation: [ - 'create', - ], + resource: ['group'], + operation: ['create'], }, }, }, @@ -218,13 +186,15 @@ export const groupFields: INodeProperties[] = [ name: 'accessAll', type: 'boolean', default: false, - description: 'Whether to allow this group to access all collections within the organization, instead of only its associated collections. If set to true, this option overrides any collection assignments.', + description: + 'Whether to allow this group to access all collections within the organization, instead of only its associated collections. If set to true, this option overrides any collection assignments.', }, { displayName: 'Collection Names or IDs', name: 'collections', type: 'multiOptions', - description: 'The collections to assign to this group. Choose from the list, or specify IDs using an expression.', + description: + 'The collections to assign to this group. Choose from the list, or specify IDs using an expression.', default: [], typeOptions: { loadOptionsMethod: 'getCollections', @@ -247,12 +217,8 @@ export const groupFields: INodeProperties[] = [ ], displayOptions: { show: { - resource: [ - 'group', - ], - operation: [ - 'update', - ], + resource: ['group'], + operation: ['update'], }, }, }, @@ -268,12 +234,8 @@ export const groupFields: INodeProperties[] = [ description: 'Comma-separated list of IDs of members to set in a group', displayOptions: { show: { - resource: [ - 'group', - ], - operation: [ - 'updateMembers', - ], + resource: ['group'], + operation: ['updateMembers'], }, }, }, diff --git a/packages/nodes-base/nodes/Bitwarden/descriptions/MemberDescription.ts b/packages/nodes-base/nodes/Bitwarden/descriptions/MemberDescription.ts index 5d67637cef21e..6787199ac2287 100644 --- a/packages/nodes-base/nodes/Bitwarden/descriptions/MemberDescription.ts +++ b/packages/nodes-base/nodes/Bitwarden/descriptions/MemberDescription.ts @@ -1,6 +1,4 @@ -import { - INodeProperties, -} from 'n8n-workflow'; +import { INodeProperties } from 'n8n-workflow'; export const memberOperations: INodeProperties[] = [ { @@ -48,9 +46,7 @@ export const memberOperations: INodeProperties[] = [ ], displayOptions: { show: { - resource: [ - 'member', - ], + resource: ['member'], }, }, }, @@ -70,16 +66,8 @@ export const memberFields: INodeProperties[] = [ placeholder: '5e59c8c7-e05a-4d17-8e85-acc301343926', displayOptions: { show: { - resource: [ - 'member', - ], - operation: [ - 'delete', - 'get', - 'getGroups', - 'update', - 'updateGroups', - ], + resource: ['member'], + operation: ['delete', 'get', 'getGroups', 'update', 'updateGroups'], }, }, }, @@ -109,12 +97,8 @@ export const memberFields: INodeProperties[] = [ ], displayOptions: { show: { - resource: [ - 'member', - ], - operation: [ - 'create', - ], + resource: ['member'], + operation: ['create'], }, }, }, @@ -129,12 +113,8 @@ export const memberFields: INodeProperties[] = [ description: 'Whether to return all results or only up to a given limit', displayOptions: { show: { - resource: [ - 'member', - ], - operation: [ - 'getAll', - ], + resource: ['member'], + operation: ['getAll'], }, }, }, @@ -149,15 +129,9 @@ export const memberFields: INodeProperties[] = [ description: 'Max number of results to return', displayOptions: { show: { - resource: [ - 'member', - ], - operation: [ - 'getAll', - ], - returnAll: [ - false, - ], + resource: ['member'], + operation: ['getAll'], + returnAll: [false], }, }, }, @@ -173,12 +147,8 @@ export const memberFields: INodeProperties[] = [ description: 'The email of the member to update', displayOptions: { show: { - resource: [ - 'member', - ], - operation: [ - 'create', - ], + resource: ['member'], + operation: ['create'], }, }, }, @@ -189,12 +159,8 @@ export const memberFields: INodeProperties[] = [ default: false, displayOptions: { show: { - resource: [ - 'member', - ], - operation: [ - 'create', - ], + resource: ['member'], + operation: ['create'], }, }, }, @@ -209,7 +175,8 @@ export const memberFields: INodeProperties[] = [ displayName: 'Collection Names or IDs', name: 'collections', type: 'multiOptions', - description: 'The collections to assign to this member. Choose from the list, or specify IDs using an expression.', + description: + 'The collections to assign to this member. Choose from the list, or specify IDs using an expression.', default: [], typeOptions: { loadOptionsMethod: 'getCollections', @@ -225,12 +192,8 @@ export const memberFields: INodeProperties[] = [ ], displayOptions: { show: { - resource: [ - 'member', - ], - operation: [ - 'create', - ], + resource: ['member'], + operation: ['create'], }, }, }, @@ -272,7 +235,8 @@ export const memberFields: INodeProperties[] = [ displayName: 'Collection Names or IDs', name: 'collections', type: 'multiOptions', - description: 'The collections to assign to this member. Choose from the list, or specify IDs using an expression.', + description: + 'The collections to assign to this member. Choose from the list, or specify IDs using an expression.', default: [], typeOptions: { loadOptionsMethod: 'getCollections', @@ -294,12 +258,8 @@ export const memberFields: INodeProperties[] = [ ], displayOptions: { show: { - resource: [ - 'member', - ], - operation: [ - 'update', - ], + resource: ['member'], + operation: ['update'], }, }, }, @@ -314,12 +274,8 @@ export const memberFields: INodeProperties[] = [ description: 'Comma-separated list of IDs of groups to set for a member', displayOptions: { show: { - resource: [ - 'member', - ], - operation: [ - 'updateGroups', - ], + resource: ['member'], + operation: ['updateGroups'], }, }, }, diff --git a/packages/nodes-base/nodes/Cisco/Webex/CiscoWebex.node.ts b/packages/nodes-base/nodes/Cisco/Webex/CiscoWebex.node.ts index 13a68af67e19a..7b85bec62d93f 100644 --- a/packages/nodes-base/nodes/Cisco/Webex/CiscoWebex.node.ts +++ b/packages/nodes-base/nodes/Cisco/Webex/CiscoWebex.node.ts @@ -1,6 +1,4 @@ -import { - IExecuteFunctions, -} from 'n8n-core'; +import { IExecuteFunctions } from 'n8n-core'; import { IBinaryData, @@ -13,11 +11,7 @@ import { NodeOperationError, } from 'n8n-workflow'; -import { - getAttachemnts, - webexApiRequest, - webexApiRequestAllItems, -} from './GenericFunctions'; +import { getAttachemnts, webexApiRequest, webexApiRequestAllItems } from './GenericFunctions'; import { meetingFields, @@ -97,7 +91,12 @@ export class CiscoWebex implements INodeType { }, async getSites(this: ILoadOptionsFunctions): Promise { const returnData: INodePropertyOptions[] = []; - const sites = await webexApiRequestAllItems.call(this, 'sites', 'GET', '/meetingPreferences/sites'); + const sites = await webexApiRequestAllItems.call( + this, + 'sites', + 'GET', + '/meetingPreferences/sites', + ); for (const site of sites) { returnData.push({ name: site.siteUrl, @@ -118,25 +117,25 @@ export class CiscoWebex implements INodeType { let responseData; - for (let i = 0; i < items.length; i++) { - try { if (resource === 'message') { - // ********************************************************************** // message // ********************************************************************** if (operation === 'create') { - // ---------------------------------------- // message: create // ---------------------------------------- // https://developer.webex.com/docs/api/v1/messages/create-a-message const destination = this.getNodeParameter('destination', i); - const file = this.getNodeParameter('additionalFields.fileUi.fileValue', i, {}) as IDataObject; + const file = this.getNodeParameter( + 'additionalFields.fileUi.fileValue', + i, + {}, + ) as IDataObject; const markdown = this.getNodeParameter('additionalFields.markdown', i, '') as boolean; const body = {} as IDataObject; if (destination === 'room') { @@ -158,22 +157,31 @@ export class CiscoWebex implements INodeType { body['text'] = this.getNodeParameter('text', i); - body.attachments = getAttachemnts(this.getNodeParameter('additionalFields.attachmentsUi.attachmentValues', i, []) as IDataObject[]); + body.attachments = getAttachemnts( + this.getNodeParameter( + 'additionalFields.attachmentsUi.attachmentValues', + i, + [], + ) as IDataObject[], + ); if (Object.keys(file).length) { - const isBinaryData = file.fileLocation === 'binaryData' ? true : false; if (isBinaryData) { - if (!items[i].binary) { - throw new NodeOperationError(this.getNode(), 'No binary data exists on item!', { itemIndex: i }); + throw new NodeOperationError(this.getNode(), 'No binary data exists on item!', { + itemIndex: i, + }); } const binaryPropertyName = file.binaryPropertyName as string; const binaryData = items[i].binary![binaryPropertyName] as IBinaryData; - const binaryDataBuffer = await this.helpers.getBinaryDataBuffer(i, binaryPropertyName); + const binaryDataBuffer = await this.helpers.getBinaryDataBuffer( + i, + binaryPropertyName, + ); const formData = { files: { @@ -192,14 +200,19 @@ export class CiscoWebex implements INodeType { } if (file.fileLocation === 'binaryData') { - responseData = await webexApiRequest.call(this, 'POST', '/messages', {}, {}, undefined, { formData: body }); + responseData = await webexApiRequest.call( + this, + 'POST', + '/messages', + {}, + {}, + undefined, + { formData: body }, + ); } else { responseData = await webexApiRequest.call(this, 'POST', '/messages', body); } - - } else if (operation === 'delete') { - // ---------------------------------------- // message: delete // ---------------------------------------- @@ -210,9 +223,7 @@ export class CiscoWebex implements INodeType { const endpoint = `/messages/${messageId}`; responseData = await webexApiRequest.call(this, 'DELETE', endpoint); responseData = { success: true }; - } else if (operation === 'get') { - // ---------------------------------------- // message: get // ---------------------------------------- @@ -222,10 +233,7 @@ export class CiscoWebex implements INodeType { const endpoint = `/messages/${messageId}`; responseData = await webexApiRequest.call(this, 'GET', endpoint); - - } else if (operation === 'getAll') { - // ---------------------------------------- // message: getAll // ---------------------------------------- @@ -237,22 +245,25 @@ export class CiscoWebex implements INodeType { const filters = this.getNodeParameter('filters', i) as IDataObject; const returnAll = this.getNodeParameter('returnAll', i) as boolean; - if (Object.keys(filters).length) { Object.assign(qs, filters); } if (returnAll === true) { - responseData = await webexApiRequestAllItems.call(this, 'items', 'GET', '/messages', {}, qs); + responseData = await webexApiRequestAllItems.call( + this, + 'items', + 'GET', + '/messages', + {}, + qs, + ); } else { qs.max = this.getNodeParameter('limit', i) as number; responseData = await webexApiRequest.call(this, 'GET', '/messages', {}, qs); responseData = responseData.items; } - - } else if (operation === 'update') { - // ---------------------------------------- // message: update // ---------------------------------------- @@ -284,7 +295,11 @@ export class CiscoWebex implements INodeType { const title = this.getNodeParameter('title', i) as string; const start = this.getNodeParameter('start', i) as string; const end = this.getNodeParameter('end', i) as string; - const invitees = this.getNodeParameter('additionalFields.inviteesUi.inviteeValues', i, []) as IDataObject[]; + const invitees = this.getNodeParameter( + 'additionalFields.inviteesUi.inviteeValues', + i, + [], + ) as IDataObject[]; const additionalFields = this.getNodeParameter('additionalFields', i) as IDataObject; const body: IDataObject = { @@ -295,8 +310,10 @@ export class CiscoWebex implements INodeType { }; if (body.requireRegistrationInfo) { - body['registration'] = (body.requireRegistrationInfo as string[]) - .reduce((obj, value) => Object.assign(obj, { [`${value}`]: true }), {}); + body['registration'] = (body.requireRegistrationInfo as string[]).reduce( + (obj, value) => Object.assign(obj, { [`${value}`]: true }), + {}, + ); delete body.requireRegistrationInfo; } @@ -306,7 +323,6 @@ export class CiscoWebex implements INodeType { } responseData = await webexApiRequest.call(this, 'POST', '/meetings', body); - } if (operation === 'delete') { @@ -317,7 +333,13 @@ export class CiscoWebex implements INodeType { ...options, }; - responseData = await webexApiRequest.call(this, 'DELETE', `/meetings/${meetingId}`, {}, qs); + responseData = await webexApiRequest.call( + this, + 'DELETE', + `/meetings/${meetingId}`, + {}, + qs, + ); responseData = { success: true }; } @@ -336,7 +358,15 @@ export class CiscoWebex implements INodeType { }; } - responseData = await webexApiRequest.call(this, 'GET', `/meetings/${meetingId}`, {}, qs, undefined, { headers }); + responseData = await webexApiRequest.call( + this, + 'GET', + `/meetings/${meetingId}`, + {}, + qs, + undefined, + { headers }, + ); } if (operation === 'getAll') { @@ -348,15 +378,26 @@ export class CiscoWebex implements INodeType { }; if (qs.from) { - qs.from = moment(qs.from as string).utc(true).format(); + qs.from = moment(qs.from as string) + .utc(true) + .format(); } if (qs.to) { - qs.to = moment(qs.to as string).utc(true).format(); + qs.to = moment(qs.to as string) + .utc(true) + .format(); } if (returnAll === true) { - responseData = await webexApiRequestAllItems.call(this, 'items', 'GET', '/meetings', {}, qs); + responseData = await webexApiRequestAllItems.call( + this, + 'items', + 'GET', + '/meetings', + {}, + qs, + ); returnData.push(...responseData); } else { qs.max = this.getNodeParameter('limit', i) as number; @@ -367,23 +408,28 @@ export class CiscoWebex implements INodeType { if (operation === 'update') { const meetingId = this.getNodeParameter('meetingId', i) as string; - const invitees = this.getNodeParameter('updateFields.inviteesUi.inviteeValues', i, []) as IDataObject[]; + const invitees = this.getNodeParameter( + 'updateFields.inviteesUi.inviteeValues', + i, + [], + ) as IDataObject[]; const updateFields = this.getNodeParameter('updateFields', i) as IDataObject; - const { - title, - password, - start, - end, - } = await webexApiRequest.call(this, 'GET', `/meetings/${meetingId}`); + const { title, password, start, end } = await webexApiRequest.call( + this, + 'GET', + `/meetings/${meetingId}`, + ); const body: IDataObject = { ...updateFields, }; if (body.requireRegistrationInfo) { - body['registration'] = (body.requireRegistrationInfo as string[]) - .reduce((obj, value) => Object.assign(obj, { [`${value}`]: true }), {}); + body['registration'] = (body.requireRegistrationInfo as string[]).reduce( + (obj, value) => Object.assign(obj, { [`${value}`]: true }), + {}, + ); delete body.requireRegistrationInfo; } @@ -412,7 +458,6 @@ export class CiscoWebex implements INodeType { } responseData = await webexApiRequest.call(this, 'PUT', `/meetings/${meetingId}`, body); - } } @@ -421,9 +466,7 @@ export class CiscoWebex implements INodeType { } else if (responseData !== undefined) { returnData.push(responseData as IDataObject); } - } catch (error) { - if (this.continueOnFail()) { returnData.push({ error: error.toString() }); continue; @@ -431,7 +474,6 @@ export class CiscoWebex implements INodeType { throw error; } - } // if (resource === 'meetingTranscript') { diff --git a/packages/nodes-base/nodes/Cisco/Webex/CiscoWebexTrigger.node.ts b/packages/nodes-base/nodes/Cisco/Webex/CiscoWebexTrigger.node.ts index 2f2422c431f75..f1e6a015c93b5 100644 --- a/packages/nodes-base/nodes/Cisco/Webex/CiscoWebexTrigger.node.ts +++ b/packages/nodes-base/nodes/Cisco/Webex/CiscoWebexTrigger.node.ts @@ -1,7 +1,4 @@ -import { - IHookFunctions, - IWebhookFunctions, -} from 'n8n-core'; +import { IHookFunctions, IWebhookFunctions } from 'n8n-core'; import { IDataObject, @@ -19,9 +16,7 @@ import { webexApiRequestAllItems, } from './GenericFunctions'; -import { - createHmac, -} from 'crypto'; +import { createHmac } from 'crypto'; export class CiscoWebexTrigger implements INodeType { description: INodeTypeDescription = { @@ -102,14 +97,13 @@ export class CiscoWebexTrigger implements INodeType { type: 'boolean', displayOptions: { show: { - resource: [ - 'attachmentAction', - ], + resource: ['attachmentAction'], }, }, default: true, // eslint-disable-next-line n8n-nodes-base/node-param-description-boolean-without-whether - description: 'By default the response only contain a reference to the data the user inputed. If this option gets activated, it will resolve the data automatically.', + description: + 'By default the response only contain a reference to the data the user inputed. If this option gets activated, it will resolve the data automatically.', }, { displayName: 'Filters', @@ -124,13 +118,8 @@ export class CiscoWebexTrigger implements INodeType { type: 'boolean', displayOptions: { show: { - '/resource': [ - 'message', - ], - '/event': [ - 'created', - 'deleted', - ], + '/resource': ['message'], + '/event': ['created', 'deleted'], }, }, default: false, @@ -142,13 +131,8 @@ export class CiscoWebexTrigger implements INodeType { type: 'boolean', displayOptions: { show: { - '/resource': [ - 'room', - ], - '/event': [ - 'created', - 'updated', - ], + '/resource': ['room'], + '/event': ['created', 'updated'], }, }, default: false, @@ -160,14 +144,8 @@ export class CiscoWebexTrigger implements INodeType { type: 'boolean', displayOptions: { show: { - '/resource': [ - 'membership', - ], - '/event': [ - 'created', - 'updated', - 'deleted', - ], + '/resource': ['membership'], + '/event': ['created', 'updated', 'deleted'], }, }, default: false, @@ -179,17 +157,13 @@ export class CiscoWebexTrigger implements INodeType { type: 'string', displayOptions: { show: { - '/resource': [ - 'message', - ], - '/event': [ - 'created', - 'deleted', - ], + '/resource': ['message'], + '/event': ['created', 'deleted'], }, }, default: '', - description: 'Limit to messages which contain these mentioned people, by person ID; accepts me as a shorthand for your own person ID; separate multiple values with commas', + description: + 'Limit to messages which contain these mentioned people, by person ID; accepts me as a shorthand for your own person ID; separate multiple values with commas', }, { displayName: 'Message ID', @@ -197,12 +171,8 @@ export class CiscoWebexTrigger implements INodeType { type: 'string', displayOptions: { show: { - '/resource': [ - 'attachmentAction', - ], - '/event': [ - 'created', - ], + '/resource': ['attachmentAction'], + '/event': ['created'], }, }, default: '', @@ -213,9 +183,7 @@ export class CiscoWebexTrigger implements INodeType { name: 'ownedBy', displayOptions: { show: { - '/resource': [ - 'meeting', - ], + '/resource': ['meeting'], }, }, type: 'string', @@ -227,14 +195,8 @@ export class CiscoWebexTrigger implements INodeType { type: 'string', displayOptions: { show: { - '/resource': [ - 'membership', - ], - '/event': [ - 'created', - 'updated', - 'deleted', - ], + '/resource': ['membership'], + '/event': ['created', 'updated', 'deleted'], }, }, default: '', @@ -246,13 +208,8 @@ export class CiscoWebexTrigger implements INodeType { type: 'string', displayOptions: { show: { - '/resource': [ - 'message', - ], - '/event': [ - 'created', - 'deleted', - ], + '/resource': ['message'], + '/event': ['created', 'deleted'], }, }, default: '', @@ -264,12 +221,8 @@ export class CiscoWebexTrigger implements INodeType { type: 'string', displayOptions: { show: { - '/resource': [ - 'attachmentAction', - ], - '/event': [ - 'created', - ], + '/resource': ['attachmentAction'], + '/event': ['created'], }, }, default: '', @@ -281,14 +234,8 @@ export class CiscoWebexTrigger implements INodeType { type: 'string', displayOptions: { show: { - '/resource': [ - 'membership', - ], - '/event': [ - 'created', - 'updated', - 'deleted', - ], + '/resource': ['membership'], + '/event': ['created', 'updated', 'deleted'], }, }, default: '', @@ -300,13 +247,8 @@ export class CiscoWebexTrigger implements INodeType { type: 'string', displayOptions: { show: { - '/resource': [ - 'message', - ], - '/event': [ - 'created', - 'deleted', - ], + '/resource': ['message'], + '/event': ['created', 'deleted'], }, }, default: '', @@ -319,12 +261,8 @@ export class CiscoWebexTrigger implements INodeType { type: 'string', displayOptions: { show: { - '/resource': [ - 'attachmentAction', - ], - '/event': [ - 'created', - ], + '/resource': ['attachmentAction'], + '/event': ['created'], }, }, default: '', @@ -336,14 +274,8 @@ export class CiscoWebexTrigger implements INodeType { type: 'string', displayOptions: { show: { - '/resource': [ - 'membership', - ], - '/event': [ - 'created', - 'updated', - 'deleted', - ], + '/resource': ['membership'], + '/event': ['created', 'updated', 'deleted'], }, }, default: '', @@ -355,13 +287,8 @@ export class CiscoWebexTrigger implements INodeType { type: 'string', displayOptions: { show: { - '/resource': [ - 'message', - ], - '/event': [ - 'created', - 'updated', - ], + '/resource': ['message'], + '/event': ['created', 'updated'], }, }, default: '', @@ -383,13 +310,8 @@ export class CiscoWebexTrigger implements INodeType { ], displayOptions: { show: { - '/resource': [ - 'message', - ], - '/event': [ - 'created', - 'deleted', - ], + '/resource': ['message'], + '/event': ['created', 'deleted'], }, }, default: '', @@ -411,13 +333,8 @@ export class CiscoWebexTrigger implements INodeType { ], displayOptions: { show: { - '/resource': [ - 'room', - ], - '/event': [ - 'created', - 'updated', - ], + '/resource': ['room'], + '/event': ['created', 'updated'], }, }, default: '', @@ -587,10 +504,12 @@ export class CiscoWebexTrigger implements INodeType { // one that is supposed to get created. const data = await webexApiRequestAllItems.call(this, 'items', 'GET', '/webhooks'); for (const webhook of data) { - if (webhook.url === webhookUrl - && webhook.resource === mapResource(resource) - && webhook.event === event - && webhook.status === 'active') { + if ( + webhook.url === webhookUrl && + webhook.resource === mapResource(resource) && + webhook.event === event && + webhook.status === 'active' + ) { webhookData.webhookId = webhook.id as string; return true; } @@ -643,7 +562,6 @@ export class CiscoWebexTrigger implements INodeType { async delete(this: IHookFunctions): Promise { const webhookData = this.getWorkflowStaticData('node'); if (webhookData.webhookId !== undefined) { - const endpoint = `/webhooks/${webhookData.webhookId}`; try { await webexApiRequest.call(this, 'DELETE', endpoint); @@ -668,20 +586,23 @@ export class CiscoWebexTrigger implements INodeType { const resolveData = this.getNodeParameter('resolveData', false) as boolean; //@ts-ignore - const computedSignature = createHmac('sha1', webhookData.secret).update(req.rawBody).digest('hex'); + const computedSignature = createHmac('sha1', webhookData.secret) + //@ts-ignore + .update(req.rawBody) + .digest('hex'); if (headers['x-spark-signature'] !== computedSignature) { return {}; } if (resolveData) { - const { data: { id } } = bodyData as { data: { id: string } }; + const { + data: { id }, + } = bodyData as { data: { id: string } }; bodyData = await webexApiRequest.call(this, 'GET', `/attachment/actions/${id}`); } return { - workflowData: [ - this.helpers.returnJsonArray(bodyData), - ], + workflowData: [this.helpers.returnJsonArray(bodyData)], }; } } diff --git a/packages/nodes-base/nodes/Cisco/Webex/GenericFunctions.ts b/packages/nodes-base/nodes/Cisco/Webex/GenericFunctions.ts index 3ccef56ba18c8..561dac937f92c 100644 --- a/packages/nodes-base/nodes/Cisco/Webex/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Cisco/Webex/GenericFunctions.ts @@ -1,12 +1,6 @@ -import { - OptionsWithUri, -} from 'request'; +import { OptionsWithUri } from 'request'; -import { - IExecuteFunctions, - IHookFunctions, - ILoadOptionsFunctions, -} from 'n8n-core'; +import { IExecuteFunctions, IHookFunctions, ILoadOptionsFunctions } from 'n8n-core'; import { ICredentialDataDecryptedObject, @@ -16,15 +10,21 @@ import { NodeApiError, } from 'n8n-workflow'; -import { - upperFirst, -} from 'lodash'; +import { upperFirst } from 'lodash'; -import { - createHash, -} from 'crypto'; +import { createHash } from 'crypto'; -export async function webexApiRequest(this: IExecuteFunctions | ILoadOptionsFunctions | IHookFunctions | IWebhookFunctions, method: string, resource: string, body: any = {}, qs: IDataObject = {}, uri?: string, option: IDataObject = {}): Promise { // tslint:disable-line:no-any +export async function webexApiRequest( + this: IExecuteFunctions | ILoadOptionsFunctions | IHookFunctions | IWebhookFunctions, + method: string, + resource: string, + // tslint:disable-next-line:no-any + body: any = {}, + qs: IDataObject = {}, + uri?: string, + option: IDataObject = {}, + // tslint:disable-next-line:no-any +): Promise { let options: OptionsWithUri = { method, body, @@ -43,21 +43,35 @@ export async function webexApiRequest(this: IExecuteFunctions | ILoadOptionsFunc delete options.qs; } //@ts-ignore - return await this.helpers.requestOAuth2.call(this, 'ciscoWebexOAuth2Api', options, { tokenType: 'Bearer' }); + return await this.helpers.requestOAuth2.call(this, 'ciscoWebexOAuth2Api', options, { + tokenType: 'Bearer', + }); } catch (error) { throw new NodeApiError(this.getNode(), error); } } -export async function webexApiRequestAllItems(this: IExecuteFunctions | ILoadOptionsFunctions | IHookFunctions, propertyName: string, method: string, endpoint: string, body: any = {}, query: IDataObject = {}, options: IDataObject = {}): Promise { // tslint:disable-line:no-any - +export async function webexApiRequestAllItems( + this: IExecuteFunctions | ILoadOptionsFunctions | IHookFunctions, + propertyName: string, + method: string, + endpoint: string, + // tslint:disable-next-line:no-any + body: any = {}, + query: IDataObject = {}, + options: IDataObject = {}, + // tslint:disable-next-line:no-any +): Promise { const returnData: IDataObject[] = []; let responseData; let uri: string | undefined; query.max = 100; do { - responseData = await webexApiRequest.call(this, method, endpoint, body, query, uri, { resolveWithFullResponse: true, ...options }); + responseData = await webexApiRequest.call(this, method, endpoint, body, query, uri, { + resolveWithFullResponse: true, + ...options, + }); if (responseData.headers.link) { uri = responseData.headers['link'].split(';')[0].replace('<', '').replace('>', ''); } @@ -71,13 +85,13 @@ export async function webexApiRequestAllItems(this: IExecuteFunctions | ILoadOpt export function getEvents() { const resourceEvents: { [key: string]: string[] } = { - 'attachmentAction': ['created', 'deleted', 'updated', '*'], - 'membership': ['created', 'deleted', 'updated', '*'], - 'message': ['created', 'deleted', 'updated', '*'], - 'room': ['created', 'deleted', 'updated', '*'], - 'meeting': ['created', 'deleted', 'updated', 'started', 'ended', '*'], - 'recording': ['created', 'deleted', 'updated', '*'], - 'telephonyCall': ['created', 'deleted', 'updated'], + attachmentAction: ['created', 'deleted', 'updated', '*'], + membership: ['created', 'deleted', 'updated', '*'], + message: ['created', 'deleted', 'updated', '*'], + room: ['created', 'deleted', 'updated', '*'], + meeting: ['created', 'deleted', 'updated', 'started', 'ended', '*'], + recording: ['created', 'deleted', 'updated', '*'], + telephonyCall: ['created', 'deleted', 'updated'], '*': ['created', 'updated', 'deleted', '*'], }; @@ -90,12 +104,13 @@ export function getEvents() { type: 'options', displayOptions: { show: { - resource: [ - (resource === '*') ? 'all' : resource, - ], + resource: [resource === '*' ? 'all' : resource], }, }, - options: resourceEvents[resource].map((event) => ({ value: (event === '*' ? 'all' : event), name: upperFirst(event) })), + options: resourceEvents[resource].map((event) => ({ + value: event === '*' ? 'all' : event, + name: upperFirst(event), + })), default: '', required: true, }); @@ -104,16 +119,18 @@ export function getEvents() { } export function mapResource(event: string) { - return ({ - 'attachmentAction': 'attachmentActions', - 'membership': 'memberships', - 'message': 'messages', - 'room': 'rooms', - 'meeting': 'meetings', - 'recording': 'recordings', - 'telephonyCall': 'telephony_calls', - 'all': 'all', - } as { [key: string]: string })[event]; + return ( + { + attachmentAction: 'attachmentActions', + membership: 'memberships', + message: 'messages', + room: 'rooms', + meeting: 'meetings', + recording: 'recordings', + telephonyCall: 'telephony_calls', + all: 'all', + } as { [key: string]: string } + )[event]; } export function getAttachemnts(attachements: IDataObject[]) { @@ -121,18 +138,23 @@ export function getAttachemnts(attachements: IDataObject[]) { for (const attachment of attachements) { const body: IDataObject[] = []; const actions: IDataObject[] = []; - for (const element of (attachment?.elementsUi as IDataObject).elementValues as IDataObject[] || []) { + for (const element of ((attachment?.elementsUi as IDataObject) + .elementValues as IDataObject[]) || []) { // tslint:disable-next-line: no-any - const { type, ...rest } = element as { type: string, [key: string]: any }; + const { type, ...rest } = element as { type: string; [key: string]: any }; if (type.startsWith('input')) { - body.push({ type: `Input.${upperFirst(type.replace('input', ''))}`, ...removeEmptyProperties(rest) }); + body.push({ + type: `Input.${upperFirst(type.replace('input', ''))}`, + ...removeEmptyProperties(rest), + }); } else { body.push({ type: upperFirst(type), ...removeEmptyProperties(rest) }); } } - for (const action of (attachment?.actionsUi as IDataObject).actionValues as IDataObject[] || []) { + for (const action of ((attachment?.actionsUi as IDataObject).actionValues as IDataObject[]) || + []) { // tslint:disable-next-line: no-any - const { type, ...rest } = action as { type: string, [key: string]: any }; + const { type, ...rest } = action as { type: string; [key: string]: any }; actions.push({ type: `Action.${upperFirst(type)}`, ...removeEmptyProperties(rest) }); } _attachments.push({ @@ -164,7 +186,8 @@ export function getActionInheritedProperties(): INodeProperties[] { name: 'iconUrl', type: 'string', default: '', - description: 'Optional icon to be shown on the action in conjunction with the title. Supports data URI in version 1.2+.', + description: + 'Optional icon to be shown on the action in conjunction with the title. Supports data URI in version 1.2+.', }, { displayName: 'Style', @@ -185,7 +208,8 @@ export function getActionInheritedProperties(): INodeProperties[] { }, ], default: 'default', - description: 'Controls the style of an Action, which influences how the action is displayed, spoken, etc', + description: + 'Controls the style of an Action, which influences how the action is displayed, spoken, etc', }, ]; } @@ -199,13 +223,12 @@ export function getTextBlockProperties(): INodeProperties[] { default: '', displayOptions: { show: { - type: [ - 'textBlock', - ], + type: ['textBlock'], }, }, required: true, - description: 'Text to display. A subset of markdown is supported (https://aka.ms/ACTextFeatures).', + description: + 'Text to display. A subset of markdown is supported (https://aka.ms/ACTextFeatures).', }, { displayName: 'Color', @@ -213,9 +236,7 @@ export function getTextBlockProperties(): INodeProperties[] { type: 'options', displayOptions: { show: { - type: [ - 'textBlock', - ], + type: ['textBlock'], }, }, options: [ @@ -257,9 +278,7 @@ export function getTextBlockProperties(): INodeProperties[] { type: 'options', displayOptions: { show: { - type: [ - 'textBlock', - ], + type: ['textBlock'], }, }, options: [ @@ -281,9 +300,7 @@ export function getTextBlockProperties(): INodeProperties[] { type: 'options', displayOptions: { show: { - type: [ - 'textBlock', - ], + type: ['textBlock'], }, }, options: [ @@ -309,9 +326,7 @@ export function getTextBlockProperties(): INodeProperties[] { type: 'boolean', displayOptions: { show: { - type: [ - 'textBlock', - ], + type: ['textBlock'], }, }, default: false, @@ -323,9 +338,7 @@ export function getTextBlockProperties(): INodeProperties[] { type: 'number', displayOptions: { show: { - type: [ - 'textBlock', - ], + type: ['textBlock'], }, }, default: 1, @@ -337,9 +350,7 @@ export function getTextBlockProperties(): INodeProperties[] { type: 'options', displayOptions: { show: { - type: [ - 'textBlock', - ], + type: ['textBlock'], }, }, options: [ @@ -373,9 +384,7 @@ export function getTextBlockProperties(): INodeProperties[] { type: 'options', displayOptions: { show: { - type: [ - 'textBlock', - ], + type: ['textBlock'], }, }, options: [ @@ -401,9 +410,7 @@ export function getTextBlockProperties(): INodeProperties[] { type: 'boolean', displayOptions: { show: { - type: [ - 'textBlock', - ], + type: ['textBlock'], }, }, default: true, @@ -415,9 +422,7 @@ export function getTextBlockProperties(): INodeProperties[] { type: 'options', displayOptions: { show: { - type: [ - 'textBlock', - ], + type: ['textBlock'], }, }, options: [ @@ -440,9 +445,7 @@ export function getTextBlockProperties(): INodeProperties[] { default: false, displayOptions: { show: { - type: [ - 'textBlock', - ], + type: ['textBlock'], }, }, description: 'Whether to draw a separating line at the top of the element', @@ -453,9 +456,7 @@ export function getTextBlockProperties(): INodeProperties[] { type: 'options', displayOptions: { show: { - type: [ - 'textBlock', - ], + type: ['textBlock'], }, }, options: [ @@ -497,9 +498,7 @@ export function getTextBlockProperties(): INodeProperties[] { type: 'string', displayOptions: { show: { - type: [ - 'textBlock', - ], + type: ['textBlock'], }, }, default: '', @@ -511,9 +510,7 @@ export function getTextBlockProperties(): INodeProperties[] { type: 'boolean', displayOptions: { show: { - type: [ - 'textBlock', - ], + type: ['textBlock'], }, }, default: true, @@ -531,13 +528,12 @@ export function getInputTextProperties(): INodeProperties[] { required: true, displayOptions: { show: { - type: [ - 'inputText', - ], + type: ['inputText'], }, }, default: '', - description: 'Unique identifier for the value. Used to identify collected input when the Submit action is performed.', + description: + 'Unique identifier for the value. Used to identify collected input when the Submit action is performed.', }, { displayName: 'Is Multiline', @@ -545,9 +541,7 @@ export function getInputTextProperties(): INodeProperties[] { type: 'boolean', displayOptions: { show: { - type: [ - 'inputText', - ], + type: ['inputText'], }, }, default: false, @@ -559,9 +553,7 @@ export function getInputTextProperties(): INodeProperties[] { type: 'number', displayOptions: { show: { - type: [ - 'inputText', - ], + type: ['inputText'], }, }, default: 1, @@ -573,9 +565,7 @@ export function getInputTextProperties(): INodeProperties[] { type: 'string', displayOptions: { show: { - type: [ - 'inputText', - ], + type: ['inputText'], }, }, default: '', @@ -587,9 +577,7 @@ export function getInputTextProperties(): INodeProperties[] { type: 'string', displayOptions: { show: { - type: [ - 'inputText', - ], + type: ['inputText'], }, }, default: '', @@ -601,9 +589,7 @@ export function getInputTextProperties(): INodeProperties[] { type: 'options', displayOptions: { show: { - type: [ - 'inputText', - ], + type: ['inputText'], }, }, options: [ @@ -633,9 +619,7 @@ export function getInputTextProperties(): INodeProperties[] { type: 'string', displayOptions: { show: { - type: [ - 'inputText', - ], + type: ['inputText'], }, }, default: '', diff --git a/packages/nodes-base/nodes/Cisco/Webex/descriptions/MeetingDescription.ts b/packages/nodes-base/nodes/Cisco/Webex/descriptions/MeetingDescription.ts index ad1b44741868b..61cdef4928831 100644 --- a/packages/nodes-base/nodes/Cisco/Webex/descriptions/MeetingDescription.ts +++ b/packages/nodes-base/nodes/Cisco/Webex/descriptions/MeetingDescription.ts @@ -1,6 +1,4 @@ -import { - INodeProperties, -} from 'n8n-workflow'; +import { INodeProperties } from 'n8n-workflow'; export const meetingOperations: INodeProperties[] = [ { @@ -10,9 +8,7 @@ export const meetingOperations: INodeProperties[] = [ noDataExpression: true, displayOptions: { show: { - resource: [ - 'meeting', - ], + resource: ['meeting'], }, }, options: [ @@ -58,12 +54,8 @@ export const meetingFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'meeting', - ], - operation: [ - 'create', - ], + resource: ['meeting'], + operation: ['create'], }, }, description: 'Meeting title. The title can be a maximum of 128 characters long.', @@ -76,15 +68,12 @@ export const meetingFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'meeting', - ], - operation: [ - 'create', - ], + resource: ['meeting'], + operation: ['create'], }, }, - description: 'Date and time for the start of the meeting. Acceptable format.', + description: + 'Date and time for the start of the meeting. Acceptable format.', }, { displayName: 'End', @@ -94,15 +83,12 @@ export const meetingFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'meeting', - ], - operation: [ - 'create', - ], + resource: ['meeting'], + operation: ['create'], }, }, - description: 'Date and time for the end of the meeting. Acceptable format.', + description: + 'Date and time for the end of the meeting. Acceptable format.', }, { displayName: 'Additional Fields', @@ -110,12 +96,8 @@ export const meetingFields: INodeProperties[] = [ type: 'collection', displayOptions: { show: { - resource: [ - 'meeting', - ], - operation: [ - 'create', - ], + resource: ['meeting'], + operation: ['create'], }, }, default: {}, @@ -133,21 +115,24 @@ export const meetingFields: INodeProperties[] = [ name: 'allowAnyUserToBeCoHost', type: 'boolean', default: false, - description: 'Whether or not to allow any attendee with a host account on the target site to become a co-host when joining the meeting', + description: + 'Whether or not to allow any attendee with a host account on the target site to become a co-host when joining the meeting', }, { displayName: 'Allow Authenticated Devices', name: 'allowAuthenticatedDevices', type: 'boolean', default: false, - description: 'Whether or not to allow authenticated video devices in the meeting\'s organization to start or join the meeting without a prompt', + description: + "Whether or not to allow authenticated video devices in the meeting's organization to start or join the meeting without a prompt", }, { displayName: 'Allow First User To Be Co-Host', name: 'allowFirstUserToBeCoHost', type: 'boolean', default: false, - description: 'Whether or not to allow the first attendee of the meeting with a host account on the target site to become a co-host', + description: + 'Whether or not to allow the first attendee of the meeting with a host account on the target site to become a co-host', }, { displayName: 'Auto Accept Request', @@ -161,7 +146,8 @@ export const meetingFields: INodeProperties[] = [ name: 'enableConnectAudioBeforeHost', type: 'boolean', default: false, - description: 'Whether or not to allow any attendee to connect audio in the meeting before the host joins the meeting', + description: + 'Whether or not to allow any attendee to connect audio in the meeting before the host joins the meeting', }, { displayName: 'Enabled Auto Record Meeting', @@ -175,7 +161,8 @@ export const meetingFields: INodeProperties[] = [ name: 'enabledJoinBeforeHost', type: 'boolean', default: false, - description: 'Whether or not to allow any attendee to join the meeting before the host joins the meeting', + description: + 'Whether or not to allow any attendee to join the meeting before the host joins the meeting', }, { displayName: 'Exclude Password', @@ -189,14 +176,15 @@ export const meetingFields: INodeProperties[] = [ name: 'hostEmail', type: 'string', default: '', - description: 'Email address for the meeting host. Can only be set if you\'re an admin.', + description: "Email address for the meeting host. Can only be set if you're an admin.", }, { displayName: 'Integration Tags', name: 'integrationTags', type: 'string', default: '', - description: 'External keys created by an integration application in its own domain. They could be Zendesk ticket IDs, Jira IDs, Salesforce Opportunity IDs, etc.', + description: + 'External keys created by an integration application in its own domain. They could be Zendesk ticket IDs, Jira IDs, Salesforce Opportunity IDs, etc.', }, { displayName: 'Invitees', @@ -262,7 +250,8 @@ export const meetingFields: INodeProperties[] = [ }, ], default: 0, - description: 'The number of minutes an attendee can join the meeting before the meeting start time and the host joins', + description: + 'The number of minutes an attendee can join the meeting before the meeting start time and the host joins', }, { displayName: 'Public Meeting', @@ -276,7 +265,8 @@ export const meetingFields: INodeProperties[] = [ name: 'recurrence', type: 'string', default: '', - description: 'Rule for how the meeting should recur. Acceptable format.', + description: + 'Rule for how the meeting should recur. Acceptable format.', }, { displayName: 'Required Registration Info', @@ -345,7 +335,8 @@ export const meetingFields: INodeProperties[] = [ name: 'reminderTime', type: 'number', default: 1, - description: 'The number of minutes before the meeting begins, for sending an email reminder to the host', + description: + 'The number of minutes before the meeting begins, for sending an email reminder to the host', }, { displayName: 'Send Email', @@ -363,7 +354,8 @@ export const meetingFields: INodeProperties[] = [ loadOptionsMethod: 'getSites', }, default: '', - description: 'URL of the Webex site which the meeting is created on. If not specified, the meeting is created on user\'s preferred site. Choose from the list, or specify an ID using an expression.', + description: + 'URL of the Webex site which the meeting is created on. If not specified, the meeting is created on user\'s preferred site. Choose from the list, or specify an ID using an expression.', }, ], }, @@ -379,12 +371,8 @@ export const meetingFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'meeting', - ], - operation: [ - 'delete', - ], + resource: ['meeting'], + operation: ['delete'], }, }, description: 'ID of the meeting', @@ -397,12 +385,8 @@ export const meetingFields: INodeProperties[] = [ default: {}, displayOptions: { show: { - resource: [ - 'meeting', - ], - operation: [ - 'delete', - ], + resource: ['meeting'], + operation: ['delete'], }, }, options: [ @@ -411,7 +395,8 @@ export const meetingFields: INodeProperties[] = [ name: 'hostEmail', type: 'string', default: '', - description: 'Email address for the meeting host. This parameter is only used if the user or application calling the API has the admin-level scopes.', + description: + 'Email address for the meeting host. This parameter is only used if the user or application calling the API has the admin-level scopes.', }, { displayName: 'Send Email', @@ -434,12 +419,8 @@ export const meetingFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'meeting', - ], - operation: [ - 'get', - ], + resource: ['meeting'], + operation: ['get'], }, }, description: 'ID of the meeting', @@ -452,12 +433,8 @@ export const meetingFields: INodeProperties[] = [ default: {}, displayOptions: { show: { - resource: [ - 'meeting', - ], - operation: [ - 'get', - ], + resource: ['meeting'], + operation: ['get'], }, }, options: [ @@ -466,21 +443,24 @@ export const meetingFields: INodeProperties[] = [ name: 'hostEmail', type: 'string', default: '', - description: 'Email address for the meeting host. This parameter is only used if the user or application calling the API has the admin-level scopes.', + description: + 'Email address for the meeting host. This parameter is only used if the user or application calling the API has the admin-level scopes.', }, { displayName: 'Password', name: 'password', type: 'string', default: '', - description: 'Meeting password. It\'s required when the meeting is protected by a password and the current user is not privileged to view it if they are not a host, co-host or invitee of the meeting.', + description: + "Meeting password. It's required when the meeting is protected by a password and the current user is not privileged to view it if they are not a host, co-host or invitee of the meeting.", }, { displayName: 'Send Email', name: 'sendEmail', type: 'boolean', default: true, - description: 'Whether or not to send emails to host and invitees. It is an optional field and default value is true.', + description: + 'Whether or not to send emails to host and invitees. It is an optional field and default value is true.', }, ], }, @@ -496,12 +476,8 @@ export const meetingFields: INodeProperties[] = [ description: 'Whether to return all results or only up to a given limit', displayOptions: { show: { - resource: [ - 'meeting', - ], - operation: [ - 'getAll', - ], + resource: ['meeting'], + operation: ['getAll'], }, }, }, @@ -516,15 +492,9 @@ export const meetingFields: INodeProperties[] = [ }, displayOptions: { show: { - resource: [ - 'meeting', - ], - operation: [ - 'getAll', - ], - returnAll: [ - false, - ], + resource: ['meeting'], + operation: ['getAll'], + returnAll: [false], }, }, }, @@ -536,12 +506,8 @@ export const meetingFields: INodeProperties[] = [ default: {}, displayOptions: { show: { - resource: [ - 'meeting', - ], - operation: [ - 'getAll', - ], + resource: ['meeting'], + operation: ['getAll'], }, }, options: [ @@ -550,7 +516,8 @@ export const meetingFields: INodeProperties[] = [ name: 'from', type: 'dateTime', default: '', - description: 'Start date and time (inclusive) for the meeting. Acceptable format.', + description: + 'Start date and time (inclusive) for the meeting. Acceptable format.', }, { displayName: 'Host Email', @@ -564,7 +531,8 @@ export const meetingFields: INodeProperties[] = [ name: 'integrationTag', type: 'string', default: '', - description: 'External tag created by another application, e.g. Zendesk ticket ID or Jira ID', + description: + 'External tag created by another application, e.g. Zendesk ticket ID or Jira ID', }, { displayName: 'Limit to Current Meetings', @@ -588,7 +556,8 @@ export const meetingFields: INodeProperties[] = [ { name: 'Meeting Series', value: 'meetingSeries', - description: 'Master of a scheduled series of meetings which consists of one or more scheduled meeting based on a recurrence rule', + description: + 'Master of a scheduled series of meetings which consists of one or more scheduled meeting based on a recurrence rule', }, { name: 'Scheduled Meeting', @@ -619,7 +588,8 @@ export const meetingFields: INodeProperties[] = [ loadOptionsMethod: 'getSites', }, default: '', - description: 'URL of the Webex site which the API lists meetings from. Choose from the list, or specify an ID using an expression.', + description: + 'URL of the Webex site which the API lists meetings from. Choose from the list, or specify an ID using an expression.', }, { displayName: 'State', @@ -667,7 +637,8 @@ export const meetingFields: INodeProperties[] = [ name: 'to', type: 'dateTime', default: '', - description: 'End date and time (inclusive) for the meeting. Acceptable format.', + description: + 'End date and time (inclusive) for the meeting. Acceptable format.', }, { displayName: 'Weblink', @@ -690,12 +661,8 @@ export const meetingFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'meeting', - ], - operation: [ - 'update', - ], + resource: ['meeting'], + operation: ['update'], }, }, description: 'ID of the meeting', @@ -706,12 +673,8 @@ export const meetingFields: INodeProperties[] = [ type: 'collection', displayOptions: { show: { - resource: [ - 'meeting', - ], - operation: [ - 'update', - ], + resource: ['meeting'], + operation: ['update'], }, }, default: {}, @@ -722,35 +685,39 @@ export const meetingFields: INodeProperties[] = [ name: 'agenda', type: 'string', default: '', - description: 'The meeting\'s agenda. Cannot be longer that 1300 characters.', + description: "The meeting's agenda. Cannot be longer that 1300 characters.", }, { displayName: 'Allow Any User To Be Co-Host', name: 'allowAnyUserToBeCoHost', type: 'boolean', default: false, - description: 'Whether or not to allow any attendee with a host account on the target site to become a co-host when joining the meeting', + description: + 'Whether or not to allow any attendee with a host account on the target site to become a co-host when joining the meeting', }, { displayName: 'Allow Authenticated Devices', name: 'allowAuthenticatedDevices', type: 'boolean', default: false, - description: 'Whether or not to allow authenticated video devices in the meeting\'s organization to start or join the meeting without a prompt', + description: + "Whether or not to allow authenticated video devices in the meeting's organization to start or join the meeting without a prompt", }, { displayName: 'Allow First User To Be Co-Host', name: 'allowFirstUserToBeCoHost', type: 'boolean', default: false, - description: 'Whether or not to allow the first attendee of the meeting with a host account on the target site to become a co-host', + description: + 'Whether or not to allow the first attendee of the meeting with a host account on the target site to become a co-host', }, { displayName: 'Enable Connect Audio Before Host', name: 'enableConnectAudioBeforeHost', type: 'boolean', default: false, - description: 'Whether or not to allow any attendee to connect audio in the meeting before the host joins the meeting', + description: + 'Whether or not to allow any attendee to connect audio in the meeting before the host joins the meeting', }, { displayName: 'Enabled Auto Record Meeting', @@ -764,14 +731,16 @@ export const meetingFields: INodeProperties[] = [ name: 'enabledJoinBeforeHost', type: 'boolean', default: false, - description: 'Whether or not to allow any attendee to join the meeting before the host joins the meeting', + description: + 'Whether or not to allow any attendee to join the meeting before the host joins the meeting', }, { displayName: 'End', name: 'end', type: 'dateTime', default: '', - description: 'Date and time for the end of the meeting. Acceptable format.', + description: + 'Date and time for the end of the meeting. Acceptable format.', }, { displayName: 'Exclude Password', @@ -785,7 +754,8 @@ export const meetingFields: INodeProperties[] = [ name: 'hostEmail', type: 'string', default: '', - description: 'Email address for the meeting host. This attribute should only be set if the user or application calling the API has the admin-level scopes.', + description: + 'Email address for the meeting host. This attribute should only be set if the user or application calling the API has the admin-level scopes.', }, { displayName: 'Invitees', @@ -851,14 +821,16 @@ export const meetingFields: INodeProperties[] = [ }, ], default: 0, - description: 'The number of minutes an attendee can join the meeting before the meeting start time and the host joins', + description: + 'The number of minutes an attendee can join the meeting before the meeting start time and the host joins', }, { displayName: 'Password', name: 'password', type: 'string', default: '', - description: 'Meeting password. Must conform to the site\'s password complexity settings. If not specified, a random password conforming to the site\'s password rules will be generated automatically', + description: + "Meeting password. Must conform to the site's password complexity settings. If not specified, a random password conforming to the site's password rules will be generated automatically", }, { displayName: 'Public Meeting', @@ -872,7 +844,8 @@ export const meetingFields: INodeProperties[] = [ name: 'recurrence', type: 'string', default: '', - description: 'Meeting series recurrence rule (conforming with RFC 2445), applying only to meeting series', + description: + 'Meeting series recurrence rule (conforming with RFC 2445), applying only to meeting series', }, { displayName: 'Required Registration Info', @@ -941,14 +914,16 @@ export const meetingFields: INodeProperties[] = [ name: 'reminderTime', type: 'number', default: 1, - description: 'The number of minutes before the meeting begins, for sending an email reminder to the host', + description: + 'The number of minutes before the meeting begins, for sending an email reminder to the host', }, { displayName: 'Send Email', name: 'sendEmail', type: 'boolean', default: false, - description: 'Whether or not to send emails to host and invitees. It is an optional field and default value is true.', + description: + 'Whether or not to send emails to host and invitees. It is an optional field and default value is true.', }, { // eslint-disable-next-line n8n-nodes-base/node-param-display-name-wrong-for-dynamic-options @@ -959,14 +934,16 @@ export const meetingFields: INodeProperties[] = [ loadOptionsMethod: 'getSites', }, default: '', - description: 'URL of the Webex site which the meeting is created on. If not specified, the meeting is created on user\'s preferred site. Choose from the list, or specify an ID using an expression.', + description: + 'URL of the Webex site which the meeting is created on. If not specified, the meeting is created on user\'s preferred site. Choose from the list, or specify an ID using an expression.', }, { displayName: 'Start', name: 'start', type: 'dateTime', default: '', - description: 'Date and time for the start of the meeting. Acceptable format.', + description: + 'Date and time for the start of the meeting. Acceptable format.', }, { displayName: 'Title', diff --git a/packages/nodes-base/nodes/Cisco/Webex/descriptions/MeetingTranscript.ts b/packages/nodes-base/nodes/Cisco/Webex/descriptions/MeetingTranscript.ts index 068b8d8571df6..a85436a74bf20 100644 --- a/packages/nodes-base/nodes/Cisco/Webex/descriptions/MeetingTranscript.ts +++ b/packages/nodes-base/nodes/Cisco/Webex/descriptions/MeetingTranscript.ts @@ -1,6 +1,4 @@ -import { - INodeProperties, -} from 'n8n-workflow'; +import { INodeProperties } from 'n8n-workflow'; export const meetingTranscriptOperations: INodeProperties[] = [ { @@ -10,9 +8,7 @@ export const meetingTranscriptOperations: INodeProperties[] = [ noDataExpression: true, displayOptions: { show: { - resource: [ - 'meetingTranscript', - ], + resource: ['meetingTranscript'], }, }, options: [ @@ -43,12 +39,8 @@ export const meetingTranscriptFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'meetingTranscript', - ], - operation: [ - 'download', - ], + resource: ['meetingTranscript'], + operation: ['download'], }, }, description: 'Unique identifier for the meeting transcript', @@ -61,12 +53,8 @@ export const meetingTranscriptFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'meetingTranscript', - ], - operation: [ - 'download', - ], + resource: ['meetingTranscript'], + operation: ['download'], }, }, description: 'Unique identifier for the meeting instance which the transcripts belong to', @@ -77,12 +65,8 @@ export const meetingTranscriptFields: INodeProperties[] = [ type: 'collection', displayOptions: { show: { - resource: [ - 'meetingTranscript', - ], - operation: [ - 'download', - ], + resource: ['meetingTranscript'], + operation: ['download'], }, }, default: {}, @@ -121,12 +105,8 @@ export const meetingTranscriptFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'meetingTranscript', - ], - operation: [ - 'getAll', - ], + resource: ['meetingTranscript'], + operation: ['getAll'], }, }, description: 'Unique identifier for the meeting instance which the transcripts belong to', @@ -139,12 +119,8 @@ export const meetingTranscriptFields: INodeProperties[] = [ description: 'Whether to return all results or only up to a given limit', displayOptions: { show: { - resource: [ - 'meetingTranscript', - ], - operation: [ - 'getAll', - ], + resource: ['meetingTranscript'], + operation: ['getAll'], }, }, }, @@ -159,15 +135,9 @@ export const meetingTranscriptFields: INodeProperties[] = [ }, displayOptions: { show: { - resource: [ - 'meetingTranscript', - ], - operation: [ - 'getAll', - ], - returnAll: [ - false, - ], + resource: ['meetingTranscript'], + operation: ['getAll'], + returnAll: [false], }, }, }, @@ -179,12 +149,8 @@ export const meetingTranscriptFields: INodeProperties[] = [ default: {}, displayOptions: { show: { - resource: [ - 'meetingTranscript', - ], - operation: [ - 'getAll', - ], + resource: ['meetingTranscript'], + operation: ['getAll'], }, }, options: [ diff --git a/packages/nodes-base/nodes/Cisco/Webex/descriptions/MessageDescription.ts b/packages/nodes-base/nodes/Cisco/Webex/descriptions/MessageDescription.ts index 8a430c12bf93e..fbad869585f9b 100644 --- a/packages/nodes-base/nodes/Cisco/Webex/descriptions/MessageDescription.ts +++ b/packages/nodes-base/nodes/Cisco/Webex/descriptions/MessageDescription.ts @@ -1,9 +1,9 @@ -import { - INodeProperties, -} from 'n8n-workflow'; +import { INodeProperties } from 'n8n-workflow'; import { - getActionInheritedProperties, getInputTextProperties, getTextBlockProperties, + getActionInheritedProperties, + getInputTextProperties, + getTextBlockProperties, } from '../GenericFunctions'; export const messageOperations: INodeProperties[] = [ @@ -14,9 +14,7 @@ export const messageOperations: INodeProperties[] = [ noDataExpression: true, displayOptions: { show: { - resource: [ - 'message', - ], + resource: ['message'], }, }, options: [ @@ -72,12 +70,8 @@ export const messageFields: INodeProperties[] = [ default: 'room', displayOptions: { show: { - resource: [ - 'message', - ], - operation: [ - 'create', - ], + resource: ['message'], + operation: ['create'], }, }, }, @@ -85,7 +79,8 @@ export const messageFields: INodeProperties[] = [ displayName: 'Room Name or ID', name: 'roomId', type: 'options', - description: 'Choose from the list, or specify an ID using an expression', + description: + 'Choose from the list, or specify an ID using an expression', typeOptions: { loadOptionsMethod: 'getRooms', }, @@ -93,15 +88,9 @@ export const messageFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'message', - ], - operation: [ - 'create', - ], - destination: [ - 'room', - ], + resource: ['message'], + operation: ['create'], + destination: ['room'], }, }, }, @@ -123,15 +112,9 @@ export const messageFields: INodeProperties[] = [ default: 'email', displayOptions: { show: { - resource: [ - 'message', - ], - operation: [ - 'create', - ], - destination: [ - 'person', - ], + resource: ['message'], + operation: ['create'], + destination: ['person'], }, }, }, @@ -143,15 +126,9 @@ export const messageFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'message', - ], - operation: [ - 'create', - ], - specifyPersonBy: [ - 'id', - ], + resource: ['message'], + operation: ['create'], + specifyPersonBy: ['id'], }, }, }, @@ -163,15 +140,9 @@ export const messageFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'message', - ], - operation: [ - 'create', - ], - specifyPersonBy: [ - 'email', - ], + resource: ['message'], + operation: ['create'], + specifyPersonBy: ['email'], }, }, }, @@ -183,12 +154,8 @@ export const messageFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'message', - ], - operation: [ - 'create', - ], + resource: ['message'], + operation: ['create'], }, }, description: 'The message, in plain text', @@ -199,12 +166,8 @@ export const messageFields: INodeProperties[] = [ type: 'collection', displayOptions: { show: { - resource: [ - 'message', - ], - operation: [ - 'create', - ], + resource: ['message'], + operation: ['create'], }, }, default: {}, @@ -301,9 +264,7 @@ export const messageFields: INodeProperties[] = [ default: '', displayOptions: { show: { - type: [ - 'openUrl', - ], + type: ['openUrl'], }, }, description: 'The URL to open', @@ -314,14 +275,12 @@ export const messageFields: INodeProperties[] = [ type: 'string', displayOptions: { show: { - type: [ - 'submit', - 'execute', - ], + type: ['submit', 'execute'], }, }, default: '', - description: 'Any extra data to pass along. These are essentially ‘hidden’ properties.', + description: + 'Any extra data to pass along. These are essentially ‘hidden’ properties.', }, { displayName: 'Verb', @@ -329,9 +288,7 @@ export const messageFields: INodeProperties[] = [ type: 'string', displayOptions: { show: { - type: [ - 'execute', - ], + type: ['execute'], }, }, default: '', @@ -384,9 +341,7 @@ export const messageFields: INodeProperties[] = [ required: true, displayOptions: { show: { - fileLocation: [ - 'binaryData', - ], + fileLocation: ['binaryData'], }, }, description: 'The field in the node input containing the binary file data', @@ -398,9 +353,7 @@ export const messageFields: INodeProperties[] = [ default: '', displayOptions: { show: { - fileLocation: [ - 'url', - ], + fileLocation: ['url'], }, }, description: 'The public URL of the file', @@ -414,7 +367,8 @@ export const messageFields: INodeProperties[] = [ name: 'markdown', type: 'string', default: '', - description: 'The message in markdown format. When used the text parameter is used to provide alternate text for UI clients that do not support rich text.', + description: + 'The message in markdown format. When used the text parameter is used to provide alternate text for UI clients that do not support rich text.', }, ], }, @@ -431,12 +385,8 @@ export const messageFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'message', - ], - operation: [ - 'delete', - ], + resource: ['message'], + operation: ['delete'], }, }, }, @@ -453,12 +403,8 @@ export const messageFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'message', - ], - operation: [ - 'get', - ], + resource: ['message'], + operation: ['get'], }, }, }, @@ -469,7 +415,8 @@ export const messageFields: INodeProperties[] = [ { displayName: 'Room Name or ID', name: 'roomId', - description: 'List messages in a room, by ID. Choose from the list, or specify an ID using an expression.', + description: + 'List messages in a room, by ID. Choose from the list, or specify an ID using an expression.', type: 'options', typeOptions: { loadOptionsMethod: 'getRooms', @@ -478,12 +425,8 @@ export const messageFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'message', - ], - operation: [ - 'getAll', - ], + resource: ['message'], + operation: ['getAll'], }, }, }, @@ -495,12 +438,8 @@ export const messageFields: INodeProperties[] = [ description: 'Whether to return all results or only up to a given limit', displayOptions: { show: { - resource: [ - 'message', - ], - operation: [ - 'getAll', - ], + resource: ['message'], + operation: ['getAll'], }, }, }, @@ -515,15 +454,9 @@ export const messageFields: INodeProperties[] = [ }, displayOptions: { show: { - resource: [ - 'message', - ], - operation: [ - 'getAll', - ], - returnAll: [ - false, - ], + resource: ['message'], + operation: ['getAll'], + returnAll: [false], }, }, }, @@ -535,12 +468,8 @@ export const messageFields: INodeProperties[] = [ default: {}, displayOptions: { show: { - resource: [ - 'message', - ], - operation: [ - 'getAll', - ], + resource: ['message'], + operation: ['getAll'], }, }, options: [ @@ -570,7 +499,8 @@ export const messageFields: INodeProperties[] = [ name: 'mentionedPeople', type: 'string', default: '', - description: 'List only messages with certain person mentioned. Enter their ID. You can use \'me\' as a shorthand for yourself', + description: + "List only messages with certain person mentioned. Enter their ID. You can use 'me' as a shorthand for yourself", }, ], }, @@ -587,12 +517,8 @@ export const messageFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'message', - ], - operation: [ - 'update', - ], + resource: ['message'], + operation: ['update'], }, }, }, @@ -605,12 +531,8 @@ export const messageFields: INodeProperties[] = [ default: false, displayOptions: { show: { - resource: [ - 'message', - ], - operation: [ - 'update', - ], + resource: ['message'], + operation: ['update'], }, }, }, @@ -622,15 +544,9 @@ export const messageFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'message', - ], - operation: [ - 'update', - ], - markdown: [ - false, - ], + resource: ['message'], + operation: ['update'], + markdown: [false], }, }, description: 'The message, in plain text', @@ -644,15 +560,9 @@ export const messageFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'message', - ], - operation: [ - 'update', - ], - markdown: [ - true, - ], + resource: ['message'], + operation: ['update'], + markdown: [true], }, }, }, diff --git a/packages/nodes-base/nodes/Copper/descriptions/CompanyDescription.ts b/packages/nodes-base/nodes/Copper/descriptions/CompanyDescription.ts index 1b9c9a58e16b4..11aad32ef386f 100644 --- a/packages/nodes-base/nodes/Copper/descriptions/CompanyDescription.ts +++ b/packages/nodes-base/nodes/Copper/descriptions/CompanyDescription.ts @@ -1,15 +1,8 @@ -import { - INodeProperties, -} from 'n8n-workflow'; +import { INodeProperties } from 'n8n-workflow'; -import { - isoCountryCodes, -} from '../utils/isoCountryCodes'; +import { isoCountryCodes } from '../utils/isoCountryCodes'; -import { - addressFixedCollection, - phoneNumbersFixedCollection, -} from '../utils/sharedFields'; +import { addressFixedCollection, phoneNumbersFixedCollection } from '../utils/sharedFields'; export const companyOperations: INodeProperties[] = [ { @@ -19,9 +12,7 @@ export const companyOperations: INodeProperties[] = [ noDataExpression: true, displayOptions: { show: { - resource: [ - 'company', - ], + resource: ['company'], }, }, options: [ @@ -68,12 +59,8 @@ export const companyFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'company', - ], - operation: [ - 'create', - ], + resource: ['company'], + operation: ['create'], }, }, }, @@ -85,12 +72,8 @@ export const companyFields: INodeProperties[] = [ default: {}, displayOptions: { show: { - resource: [ - 'company', - ], - operation: [ - 'create', - ], + resource: ['company'], + operation: ['create'], }, }, options: [ @@ -124,12 +107,8 @@ export const companyFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'company', - ], - operation: [ - 'delete', - ], + resource: ['company'], + operation: ['delete'], }, }, }, @@ -146,12 +125,8 @@ export const companyFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'company', - ], - operation: [ - 'get', - ], + resource: ['company'], + operation: ['get'], }, }, }, @@ -167,12 +142,8 @@ export const companyFields: INodeProperties[] = [ description: 'Whether to return all results or only up to a given limit', displayOptions: { show: { - resource: [ - 'company', - ], - operation: [ - 'getAll', - ], + resource: ['company'], + operation: ['getAll'], }, }, }, @@ -188,15 +159,9 @@ export const companyFields: INodeProperties[] = [ }, displayOptions: { show: { - resource: [ - 'company', - ], - operation: [ - 'getAll', - ], - returnAll: [ - false, - ], + resource: ['company'], + operation: ['getAll'], + returnAll: [false], }, }, }, @@ -208,12 +173,8 @@ export const companyFields: INodeProperties[] = [ default: {}, displayOptions: { show: { - resource: [ - 'company', - ], - operation: [ - 'getAll', - ], + resource: ['company'], + operation: ['getAll'], }, }, options: [ @@ -247,12 +208,8 @@ export const companyFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'company', - ], - operation: [ - 'update', - ], + resource: ['company'], + operation: ['update'], }, }, }, @@ -264,12 +221,8 @@ export const companyFields: INodeProperties[] = [ default: {}, displayOptions: { show: { - resource: [ - 'company', - ], - operation: [ - 'update', - ], + resource: ['company'], + operation: ['update'], }, }, options: [ diff --git a/packages/nodes-base/nodes/Copper/descriptions/CustomerSourceDescription.ts b/packages/nodes-base/nodes/Copper/descriptions/CustomerSourceDescription.ts index 90ebb14bd6d9e..b3b2f7d41e457 100644 --- a/packages/nodes-base/nodes/Copper/descriptions/CustomerSourceDescription.ts +++ b/packages/nodes-base/nodes/Copper/descriptions/CustomerSourceDescription.ts @@ -1,6 +1,4 @@ -import { - INodeProperties, -} from 'n8n-workflow'; +import { INodeProperties } from 'n8n-workflow'; export const customerSourceOperations: INodeProperties[] = [ { @@ -10,9 +8,7 @@ export const customerSourceOperations: INodeProperties[] = [ noDataExpression: true, displayOptions: { show: { - resource: [ - 'customerSource', - ], + resource: ['customerSource'], }, }, options: [ @@ -38,12 +34,8 @@ export const customerSourceFields: INodeProperties[] = [ description: 'Whether to return all results or only up to a given limit', displayOptions: { show: { - resource: [ - 'customerSource', - ], - operation: [ - 'getAll', - ], + resource: ['customerSource'], + operation: ['getAll'], }, }, }, @@ -59,15 +51,9 @@ export const customerSourceFields: INodeProperties[] = [ }, displayOptions: { show: { - resource: [ - 'customerSource', - ], - operation: [ - 'getAll', - ], - returnAll: [ - false, - ], + resource: ['customerSource'], + operation: ['getAll'], + returnAll: [false], }, }, }, diff --git a/packages/nodes-base/nodes/Copper/descriptions/LeadDescription.ts b/packages/nodes-base/nodes/Copper/descriptions/LeadDescription.ts index 311e41f0f8ea3..6ade2139c66b2 100644 --- a/packages/nodes-base/nodes/Copper/descriptions/LeadDescription.ts +++ b/packages/nodes-base/nodes/Copper/descriptions/LeadDescription.ts @@ -1,6 +1,4 @@ -import { - INodeProperties, -} from 'n8n-workflow'; +import { INodeProperties } from 'n8n-workflow'; import { addressFixedCollection, @@ -16,9 +14,7 @@ export const leadOperations: INodeProperties[] = [ noDataExpression: true, displayOptions: { show: { - resource: [ - 'lead', - ], + resource: ['lead'], }, }, options: [ @@ -65,12 +61,8 @@ export const leadFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'lead', - ], - operation: [ - 'create', - ], + resource: ['lead'], + operation: ['create'], }, }, }, @@ -82,19 +74,11 @@ export const leadFields: INodeProperties[] = [ placeholder: 'Add Field', displayOptions: { show: { - resource: [ - 'lead', - ], - operation: [ - 'create', - ], + resource: ['lead'], + operation: ['create'], }, }, - options: [ - addressFixedCollection, - emailFixedCollection, - phoneNumbersFixedCollection, - ], + options: [addressFixedCollection, emailFixedCollection, phoneNumbersFixedCollection], }, // ---------------------------------------- @@ -109,12 +93,8 @@ export const leadFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'lead', - ], - operation: [ - 'delete', - ], + resource: ['lead'], + operation: ['delete'], }, }, }, @@ -131,12 +111,8 @@ export const leadFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'lead', - ], - operation: [ - 'get', - ], + resource: ['lead'], + operation: ['get'], }, }, }, @@ -152,12 +128,8 @@ export const leadFields: INodeProperties[] = [ description: 'Whether to return all results or only up to a given limit', displayOptions: { show: { - resource: [ - 'lead', - ], - operation: [ - 'getAll', - ], + resource: ['lead'], + operation: ['getAll'], }, }, }, @@ -173,15 +145,9 @@ export const leadFields: INodeProperties[] = [ }, displayOptions: { show: { - resource: [ - 'lead', - ], - operation: [ - 'getAll', - ], - returnAll: [ - false, - ], + resource: ['lead'], + operation: ['getAll'], + returnAll: [false], }, }, }, @@ -193,12 +159,8 @@ export const leadFields: INodeProperties[] = [ default: {}, displayOptions: { show: { - resource: [ - 'lead', - ], - operation: [ - 'getAll', - ], + resource: ['lead'], + operation: ['getAll'], }, }, options: [ @@ -231,12 +193,8 @@ export const leadFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'lead', - ], - operation: [ - 'update', - ], + resource: ['lead'], + operation: ['update'], }, }, }, @@ -248,12 +206,8 @@ export const leadFields: INodeProperties[] = [ default: {}, displayOptions: { show: { - resource: [ - 'lead', - ], - operation: [ - 'update', - ], + resource: ['lead'], + operation: ['update'], }, }, options: [ diff --git a/packages/nodes-base/nodes/Copper/descriptions/OpportunityDescription.ts b/packages/nodes-base/nodes/Copper/descriptions/OpportunityDescription.ts index 91f116de2e10a..e0a896b8639f4 100644 --- a/packages/nodes-base/nodes/Copper/descriptions/OpportunityDescription.ts +++ b/packages/nodes-base/nodes/Copper/descriptions/OpportunityDescription.ts @@ -1,6 +1,4 @@ -import { - INodeProperties, -} from 'n8n-workflow'; +import { INodeProperties } from 'n8n-workflow'; export const opportunityOperations: INodeProperties[] = [ { @@ -10,9 +8,7 @@ export const opportunityOperations: INodeProperties[] = [ noDataExpression: true, displayOptions: { show: { - resource: [ - 'opportunity', - ], + resource: ['opportunity'], }, }, options: [ @@ -59,12 +55,8 @@ export const opportunityFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'opportunity', - ], - operation: [ - 'create', - ], + resource: ['opportunity'], + operation: ['create'], }, }, }, @@ -76,12 +68,8 @@ export const opportunityFields: INodeProperties[] = [ description: 'ID of the customer source that generated this opportunity', displayOptions: { show: { - resource: [ - 'opportunity', - ], - operation: [ - 'create', - ], + resource: ['opportunity'], + operation: ['create'], }, }, }, @@ -93,12 +81,8 @@ export const opportunityFields: INodeProperties[] = [ description: 'ID of the primary company associated with this opportunity', displayOptions: { show: { - resource: [ - 'opportunity', - ], - operation: [ - 'create', - ], + resource: ['opportunity'], + operation: ['create'], }, }, }, @@ -115,12 +99,8 @@ export const opportunityFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'opportunity', - ], - operation: [ - 'delete', - ], + resource: ['opportunity'], + operation: ['delete'], }, }, }, @@ -137,12 +117,8 @@ export const opportunityFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'opportunity', - ], - operation: [ - 'get', - ], + resource: ['opportunity'], + operation: ['get'], }, }, }, @@ -158,12 +134,8 @@ export const opportunityFields: INodeProperties[] = [ description: 'Whether to return all results or only up to a given limit', displayOptions: { show: { - resource: [ - 'opportunity', - ], - operation: [ - 'getAll', - ], + resource: ['opportunity'], + operation: ['getAll'], }, }, }, @@ -179,15 +151,9 @@ export const opportunityFields: INodeProperties[] = [ }, displayOptions: { show: { - resource: [ - 'opportunity', - ], - operation: [ - 'getAll', - ], - returnAll: [ - false, - ], + resource: ['opportunity'], + operation: ['getAll'], + returnAll: [false], }, }, }, @@ -199,12 +165,8 @@ export const opportunityFields: INodeProperties[] = [ default: {}, displayOptions: { show: { - resource: [ - 'opportunity', - ], - operation: [ - 'getAll', - ], + resource: ['opportunity'], + operation: ['getAll'], }, }, options: [ @@ -237,12 +199,8 @@ export const opportunityFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'opportunity', - ], - operation: [ - 'update', - ], + resource: ['opportunity'], + operation: ['update'], }, }, }, @@ -254,12 +212,8 @@ export const opportunityFields: INodeProperties[] = [ default: {}, displayOptions: { show: { - resource: [ - 'opportunity', - ], - operation: [ - 'update', - ], + resource: ['opportunity'], + operation: ['update'], }, }, options: [ diff --git a/packages/nodes-base/nodes/Copper/descriptions/PersonDescription.ts b/packages/nodes-base/nodes/Copper/descriptions/PersonDescription.ts index 21f00dbb122fc..c74193f196753 100644 --- a/packages/nodes-base/nodes/Copper/descriptions/PersonDescription.ts +++ b/packages/nodes-base/nodes/Copper/descriptions/PersonDescription.ts @@ -1,6 +1,4 @@ -import { - INodeProperties, -} from 'n8n-workflow'; +import { INodeProperties } from 'n8n-workflow'; import { addressFixedCollection, @@ -16,9 +14,7 @@ export const personOperations: INodeProperties[] = [ noDataExpression: true, displayOptions: { show: { - resource: [ - 'person', - ], + resource: ['person'], }, }, options: [ @@ -65,12 +61,8 @@ export const personFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'person', - ], - operation: [ - 'create', - ], + resource: ['person'], + operation: ['create'], }, }, }, @@ -82,12 +74,8 @@ export const personFields: INodeProperties[] = [ default: {}, displayOptions: { show: { - resource: [ - 'person', - ], - operation: [ - 'create', - ], + resource: ['person'], + operation: ['create'], }, }, options: [ @@ -122,12 +110,8 @@ export const personFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'person', - ], - operation: [ - 'delete', - ], + resource: ['person'], + operation: ['delete'], }, }, }, @@ -144,12 +128,8 @@ export const personFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'person', - ], - operation: [ - 'get', - ], + resource: ['person'], + operation: ['get'], }, }, }, @@ -165,12 +145,8 @@ export const personFields: INodeProperties[] = [ description: 'Whether to return all results or only up to a given limit', displayOptions: { show: { - resource: [ - 'person', - ], - operation: [ - 'getAll', - ], + resource: ['person'], + operation: ['getAll'], }, }, }, @@ -186,15 +162,9 @@ export const personFields: INodeProperties[] = [ }, displayOptions: { show: { - resource: [ - 'person', - ], - operation: [ - 'getAll', - ], - returnAll: [ - false, - ], + resource: ['person'], + operation: ['getAll'], + returnAll: [false], }, }, }, @@ -206,12 +176,8 @@ export const personFields: INodeProperties[] = [ default: {}, displayOptions: { show: { - resource: [ - 'person', - ], - operation: [ - 'getAll', - ], + resource: ['person'], + operation: ['getAll'], }, }, options: [ @@ -237,12 +203,8 @@ export const personFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'person', - ], - operation: [ - 'update', - ], + resource: ['person'], + operation: ['update'], }, }, }, @@ -254,12 +216,8 @@ export const personFields: INodeProperties[] = [ default: {}, displayOptions: { show: { - resource: [ - 'person', - ], - operation: [ - 'update', - ], + resource: ['person'], + operation: ['update'], }, }, options: [ diff --git a/packages/nodes-base/nodes/Copper/descriptions/ProjectDescription.ts b/packages/nodes-base/nodes/Copper/descriptions/ProjectDescription.ts index a62b4856a342c..5de802d215c76 100644 --- a/packages/nodes-base/nodes/Copper/descriptions/ProjectDescription.ts +++ b/packages/nodes-base/nodes/Copper/descriptions/ProjectDescription.ts @@ -1,6 +1,4 @@ -import { - INodeProperties, -} from 'n8n-workflow'; +import { INodeProperties } from 'n8n-workflow'; export const projectOperations: INodeProperties[] = [ { @@ -10,9 +8,7 @@ export const projectOperations: INodeProperties[] = [ noDataExpression: true, displayOptions: { show: { - resource: [ - 'project', - ], + resource: ['project'], }, }, options: [ @@ -59,12 +55,8 @@ export const projectFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'project', - ], - operation: [ - 'create', - ], + resource: ['project'], + operation: ['create'], }, }, }, @@ -76,12 +68,8 @@ export const projectFields: INodeProperties[] = [ default: {}, displayOptions: { show: { - resource: [ - 'project', - ], - operation: [ - 'create', - ], + resource: ['project'], + operation: ['create'], }, }, options: [ @@ -130,12 +118,8 @@ export const projectFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'project', - ], - operation: [ - 'delete', - ], + resource: ['project'], + operation: ['delete'], }, }, }, @@ -152,12 +136,8 @@ export const projectFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'project', - ], - operation: [ - 'get', - ], + resource: ['project'], + operation: ['get'], }, }, }, @@ -173,12 +153,8 @@ export const projectFields: INodeProperties[] = [ description: 'Whether to return all results or only up to a given limit', displayOptions: { show: { - resource: [ - 'project', - ], - operation: [ - 'getAll', - ], + resource: ['project'], + operation: ['getAll'], }, }, }, @@ -194,15 +170,9 @@ export const projectFields: INodeProperties[] = [ }, displayOptions: { show: { - resource: [ - 'project', - ], - operation: [ - 'getAll', - ], - returnAll: [ - false, - ], + resource: ['project'], + operation: ['getAll'], + returnAll: [false], }, }, }, @@ -214,12 +184,8 @@ export const projectFields: INodeProperties[] = [ placeholder: 'Add Filter', displayOptions: { show: { - resource: [ - 'project', - ], - operation: [ - 'getAll', - ], + resource: ['project'], + operation: ['getAll'], }, }, options: [ @@ -245,12 +211,8 @@ export const projectFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'project', - ], - operation: [ - 'update', - ], + resource: ['project'], + operation: ['update'], }, }, }, @@ -262,12 +224,8 @@ export const projectFields: INodeProperties[] = [ default: {}, displayOptions: { show: { - resource: [ - 'project', - ], - operation: [ - 'update', - ], + resource: ['project'], + operation: ['update'], }, }, options: [ diff --git a/packages/nodes-base/nodes/Copper/descriptions/TaskDescription.ts b/packages/nodes-base/nodes/Copper/descriptions/TaskDescription.ts index efb40ee608da8..ac9fb30d923d7 100644 --- a/packages/nodes-base/nodes/Copper/descriptions/TaskDescription.ts +++ b/packages/nodes-base/nodes/Copper/descriptions/TaskDescription.ts @@ -1,6 +1,4 @@ -import { - INodeProperties, -} from 'n8n-workflow'; +import { INodeProperties } from 'n8n-workflow'; export const taskOperations: INodeProperties[] = [ { @@ -10,9 +8,7 @@ export const taskOperations: INodeProperties[] = [ noDataExpression: true, displayOptions: { show: { - resource: [ - 'task', - ], + resource: ['task'], }, }, options: [ @@ -58,12 +54,8 @@ export const taskFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'task', - ], - operation: [ - 'create', - ], + resource: ['task'], + operation: ['create'], }, }, }, @@ -75,12 +67,8 @@ export const taskFields: INodeProperties[] = [ default: {}, displayOptions: { show: { - resource: [ - 'task', - ], - operation: [ - 'create', - ], + resource: ['task'], + operation: ['create'], }, }, options: [ @@ -145,12 +133,8 @@ export const taskFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'task', - ], - operation: [ - 'delete', - ], + resource: ['task'], + operation: ['delete'], }, }, }, @@ -167,12 +151,8 @@ export const taskFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'task', - ], - operation: [ - 'get', - ], + resource: ['task'], + operation: ['get'], }, }, }, @@ -188,12 +168,8 @@ export const taskFields: INodeProperties[] = [ description: 'Whether to return all results or only up to a given limit', displayOptions: { show: { - resource: [ - 'task', - ], - operation: [ - 'getAll', - ], + resource: ['task'], + operation: ['getAll'], }, }, }, @@ -209,15 +185,9 @@ export const taskFields: INodeProperties[] = [ }, displayOptions: { show: { - resource: [ - 'task', - ], - operation: [ - 'getAll', - ], - returnAll: [ - false, - ], + resource: ['task'], + operation: ['getAll'], + returnAll: [false], }, }, }, @@ -229,12 +199,8 @@ export const taskFields: INodeProperties[] = [ default: {}, displayOptions: { show: { - resource: [ - 'task', - ], - operation: [ - 'getAll', - ], + resource: ['task'], + operation: ['getAll'], }, }, options: [ @@ -267,12 +233,8 @@ export const taskFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'task', - ], - operation: [ - 'update', - ], + resource: ['task'], + operation: ['update'], }, }, }, @@ -284,12 +246,8 @@ export const taskFields: INodeProperties[] = [ default: {}, displayOptions: { show: { - resource: [ - 'task', - ], - operation: [ - 'update', - ], + resource: ['task'], + operation: ['update'], }, }, options: [ diff --git a/packages/nodes-base/nodes/Copper/descriptions/UserDescription.ts b/packages/nodes-base/nodes/Copper/descriptions/UserDescription.ts index 0c31575539b98..d09d7072588a1 100644 --- a/packages/nodes-base/nodes/Copper/descriptions/UserDescription.ts +++ b/packages/nodes-base/nodes/Copper/descriptions/UserDescription.ts @@ -1,6 +1,4 @@ -import { - INodeProperties, -} from 'n8n-workflow'; +import { INodeProperties } from 'n8n-workflow'; export const userOperations: INodeProperties[] = [ { @@ -10,9 +8,7 @@ export const userOperations: INodeProperties[] = [ noDataExpression: true, displayOptions: { show: { - resource: [ - 'user', - ], + resource: ['user'], }, }, options: [ @@ -38,12 +34,8 @@ export const userFields: INodeProperties[] = [ description: 'Whether to return all results or only up to a given limit', displayOptions: { show: { - resource: [ - 'user', - ], - operation: [ - 'getAll', - ], + resource: ['user'], + operation: ['getAll'], }, }, }, @@ -59,15 +51,9 @@ export const userFields: INodeProperties[] = [ }, displayOptions: { show: { - resource: [ - 'user', - ], - operation: [ - 'getAll', - ], - returnAll: [ - false, - ], + resource: ['user'], + operation: ['getAll'], + returnAll: [false], }, }, }, diff --git a/packages/nodes-base/nodes/Copper/utils/isoCountryCodes.ts b/packages/nodes-base/nodes/Copper/utils/isoCountryCodes.ts index dd5bce6f4c74f..9ee28fbf569e2 100644 --- a/packages/nodes-base/nodes/Copper/utils/isoCountryCodes.ts +++ b/packages/nodes-base/nodes/Copper/utils/isoCountryCodes.ts @@ -218,7 +218,7 @@ export const isoCountryCodes = [ alpha2: 'CR', }, { - name: 'Côte d\'Ivoire', + name: "Côte d'Ivoire", alpha2: 'CI', }, { @@ -470,7 +470,7 @@ export const isoCountryCodes = [ alpha2: 'KI', }, { - name: 'Korea (the Democratic People\'s Republic of)', + name: "Korea (the Democratic People's Republic of)", alpha2: 'KP', }, { @@ -486,7 +486,7 @@ export const isoCountryCodes = [ alpha2: 'KG', }, { - name: 'Lao People\'s Democratic Republic (the)', + name: "Lao People's Democratic Republic (the)", alpha2: 'LA', }, { diff --git a/packages/nodes-base/nodes/Copper/utils/sharedFields.ts b/packages/nodes-base/nodes/Copper/utils/sharedFields.ts index 8221d1b61404f..43e8570125b4c 100644 --- a/packages/nodes-base/nodes/Copper/utils/sharedFields.ts +++ b/packages/nodes-base/nodes/Copper/utils/sharedFields.ts @@ -1,6 +1,4 @@ -import { - INodeProperties -} from 'n8n-workflow'; +import { INodeProperties } from 'n8n-workflow'; // for companies, leads, persons export const addressFixedCollection: INodeProperties = { diff --git a/packages/nodes-base/nodes/Copper/utils/types.d.ts b/packages/nodes-base/nodes/Copper/utils/types.d.ts index 0c71e916cd3c2..62d935298e49e 100644 --- a/packages/nodes-base/nodes/Copper/utils/types.d.ts +++ b/packages/nodes-base/nodes/Copper/utils/types.d.ts @@ -1,23 +1,23 @@ export type EmailFixedCollection = { email?: { - emailFields: Array<{ email: string, category: string }> - } + emailFields: Array<{ email: string; category: string }>; + }; }; export type EmailsFixedCollection = { emails?: { - emailFields: Array<{ email: string, category: string }> - } + emailFields: Array<{ email: string; category: string }>; + }; }; export type PhoneNumbersFixedCollection = { phone_numbers?: { - phoneFields: object, - } + phoneFields: object; + }; }; export type AddressFixedCollection = { address?: { - addressFields: object - } -} + addressFields: object; + }; +}; diff --git a/packages/nodes-base/nodes/Elastic/ElasticSecurity/ElasticSecurity.node.ts b/packages/nodes-base/nodes/Elastic/ElasticSecurity/ElasticSecurity.node.ts index a74c5e9507f15..328918f330552 100644 --- a/packages/nodes-base/nodes/Elastic/ElasticSecurity/ElasticSecurity.node.ts +++ b/packages/nodes-base/nodes/Elastic/ElasticSecurity/ElasticSecurity.node.ts @@ -1,6 +1,4 @@ -import { - IExecuteFunctions, -} from 'n8n-core'; +import { IExecuteFunctions } from 'n8n-core'; import { ICredentialsDecrypted, @@ -42,9 +40,7 @@ import { ElasticSecurityApiCredentials, } from './types'; -import { - OptionsWithUri, -} from 'request'; +import { OptionsWithUri } from 'request'; export class ElasticSecurity implements INodeType { description: INodeTypeDescription = { @@ -107,13 +103,17 @@ export class ElasticSecurity implements INodeType { methods = { loadOptions: { async getTags(this: ILoadOptionsFunctions): Promise { - const tags = await elasticSecurityApiRequest.call(this, 'GET', '/cases/tags') as string[]; - return tags.map(tag => ({ name: tag, value: tag })); + const tags = (await elasticSecurityApiRequest.call(this, 'GET', '/cases/tags')) as string[]; + return tags.map((tag) => ({ name: tag, value: tag })); }, async getConnectors(this: ILoadOptionsFunctions): Promise { const endpoint = '/cases/configure/connectors/_find'; - const connectors = await elasticSecurityApiRequest.call(this, 'GET', endpoint) as Connector[]; + const connectors = (await elasticSecurityApiRequest.call( + this, + 'GET', + endpoint, + )) as Connector[]; return connectors.map(({ name, id }) => ({ name, value: id })); }, }, @@ -172,17 +172,13 @@ export class ElasticSecurity implements INodeType { let responseData; for (let i = 0; i < items.length; i++) { - try { - if (resource === 'case') { - // ********************************************************************** // case // ********************************************************************** if (operation === 'create') { - // ---------------------------------------- // case: create // ---------------------------------------- @@ -208,7 +204,10 @@ export class ElasticSecurity implements INodeType { type: fetchedType, } = await getConnector.call(this, connectorId); - const selectedConnectorType = this.getNodeParameter('connectorType', i) as ConnectorType; + const selectedConnectorType = this.getNodeParameter( + 'connectorType', + i, + ) as ConnectorType; if (fetchedType !== selectedConnectorType) { throw new NodeOperationError( @@ -260,9 +259,7 @@ export class ElasticSecurity implements INodeType { } responseData = await elasticSecurityApiRequest.call(this, 'POST', '/cases', body); - } else if (operation === 'delete') { - // ---------------------------------------- // case: delete // ---------------------------------------- @@ -272,9 +269,7 @@ export class ElasticSecurity implements INodeType { const caseId = this.getNodeParameter('caseId', i); await elasticSecurityApiRequest.call(this, 'DELETE', `/cases?ids=["${caseId}"]`); responseData = { success: true }; - } else if (operation === 'get') { - // ---------------------------------------- // case: get // ---------------------------------------- @@ -283,9 +278,7 @@ export class ElasticSecurity implements INodeType { const caseId = this.getNodeParameter('caseId', i); responseData = await elasticSecurityApiRequest.call(this, 'GET', `/cases/${caseId}`); - } else if (operation === 'getAll') { - // ---------------------------------------- // case: getAll // ---------------------------------------- @@ -293,10 +286,10 @@ export class ElasticSecurity implements INodeType { // https://www.elastic.co/guide/en/security/current/cases-api-find-cases.html const qs = {} as IDataObject; - const { - tags, - status, - } = this.getNodeParameter('filters', i) as IDataObject & { tags: string[], status: string }; + const { tags, status } = this.getNodeParameter('filters', i) as IDataObject & { + tags: string[]; + status: string; + }; const sortOptions = this.getNodeParameter('sortOptions', i) as IDataObject; qs.sortField = sortOptions.sortField ?? 'createdAt'; @@ -311,9 +304,7 @@ export class ElasticSecurity implements INodeType { } responseData = await handleListing.call(this, 'GET', '/cases/_find', {}, qs); - } else if (operation === 'getStatus') { - // ---------------------------------------- // case: getStatus // ---------------------------------------- @@ -321,9 +312,7 @@ export class ElasticSecurity implements INodeType { // https://www.elastic.co/guide/en/security/current/cases-api-get-status.html responseData = await elasticSecurityApiRequest.call(this, 'GET', '/cases/status'); - } else if (operation === 'update') { - // ---------------------------------------- // case: update // ---------------------------------------- @@ -353,17 +342,13 @@ export class ElasticSecurity implements INodeType { }); responseData = await elasticSecurityApiRequest.call(this, 'PATCH', '/cases', body); - } - } else if (resource === 'caseTag') { - // ********************************************************************** // caseTag // ********************************************************************** if (operation === 'add') { - // ---------------------------------------- // caseTag: add // ---------------------------------------- @@ -372,14 +357,8 @@ export class ElasticSecurity implements INodeType { const caseId = this.getNodeParameter('caseId', i); - const { - title, - connector, - owner, - description, - settings, - tags, - } = await elasticSecurityApiRequest.call(this, 'GET', `/cases/${caseId}`); + const { title, connector, owner, description, settings, tags } = + await elasticSecurityApiRequest.call(this, 'GET', `/cases/${caseId}`); const tagToAdd = this.getNodeParameter('tag', i); @@ -409,25 +388,25 @@ export class ElasticSecurity implements INodeType { }); responseData = await elasticSecurityApiRequest.call(this, 'PATCH', '/cases', body); - } else if (operation === 'remove') { - // https://www.elastic.co/guide/en/security/current/cases-api-update.html const caseId = this.getNodeParameter('caseId', i); const tagToRemove = this.getNodeParameter('tag', i) as string; - const { - title, - connector, - owner, - description, - settings, - tags, - } = await elasticSecurityApiRequest.call(this, 'GET', `/cases/${caseId}`) as IDataObject & { tags: string[] }; + const { title, connector, owner, description, settings, tags } = + (await elasticSecurityApiRequest.call( + this, + 'GET', + `/cases/${caseId}`, + )) as IDataObject & { tags: string[] }; if (!tags.includes(tagToRemove)) { - throw new NodeOperationError(this.getNode(), `Cannot remove tag "${tagToRemove}" from case ID ${caseId} because this case does not have this tag.`, { itemIndex: i }); + throw new NodeOperationError( + this.getNode(), + `Cannot remove tag "${tagToRemove}" from case ID ${caseId} because this case does not have this tag.`, + { itemIndex: i }, + ); } const body = {}; @@ -448,17 +427,13 @@ export class ElasticSecurity implements INodeType { }); responseData = await elasticSecurityApiRequest.call(this, 'PATCH', '/cases', body); - } - } else if (resource === 'caseComment') { - // ********************************************************************** // caseComment // ********************************************************************** if (operation === 'add') { - // ---------------------------------------- // caseComment: add // ---------------------------------------- @@ -483,9 +458,7 @@ export class ElasticSecurity implements INodeType { const { comments } = responseData; responseData = comments[comments.length - 1]; } - } else if (operation === 'get') { - // ---------------------------------------- // caseComment: get // ---------------------------------------- @@ -497,9 +470,7 @@ export class ElasticSecurity implements INodeType { const endpoint = `/cases/${caseId}/comments/${commentId}`; responseData = await elasticSecurityApiRequest.call(this, 'GET', endpoint); - } else if (operation === 'getAll') { - // ---------------------------------------- // caseComment: getAll // ---------------------------------------- @@ -510,9 +481,7 @@ export class ElasticSecurity implements INodeType { const endpoint = `/cases/${caseId}/comments`; responseData = await handleListing.call(this, 'GET', endpoint); - } else if (operation === 'remove') { - // ---------------------------------------- // caseComment: remove // ---------------------------------------- @@ -525,9 +494,7 @@ export class ElasticSecurity implements INodeType { const endpoint = `/cases/${caseId}/comments/${commentId}`; await elasticSecurityApiRequest.call(this, 'DELETE', endpoint); responseData = { success: true }; - } else if (operation === 'update') { - // ---------------------------------------- // caseComment: update // ---------------------------------------- @@ -553,13 +520,9 @@ export class ElasticSecurity implements INodeType { const { comments } = responseData; responseData = comments[comments.length - 1]; } - } - } else if (resource === 'connector') { - if (operation === 'create') { - // ---------------------------------------- // connector: create // ---------------------------------------- @@ -601,16 +564,18 @@ export class ElasticSecurity implements INodeType { }; } - responseData = await elasticSecurityApiRequest.call(this, 'POST', '/actions/connector', body); - + responseData = await elasticSecurityApiRequest.call( + this, + 'POST', + '/actions/connector', + body, + ); } - } Array.isArray(responseData) ? returnData.push(...responseData) : returnData.push(responseData); - } catch (error) { if (this.continueOnFail()) { returnData.push({ error: error.message }); @@ -618,7 +583,6 @@ export class ElasticSecurity implements INodeType { } throw error; } - } return [this.helpers.returnJsonArray(returnData)]; diff --git a/packages/nodes-base/nodes/Elastic/ElasticSecurity/GenericFunctions.ts b/packages/nodes-base/nodes/Elastic/ElasticSecurity/GenericFunctions.ts index cf6aa17406dd9..0d2628ce47b5c 100644 --- a/packages/nodes-base/nodes/Elastic/ElasticSecurity/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Elastic/ElasticSecurity/GenericFunctions.ts @@ -1,22 +1,10 @@ -import { - IExecuteFunctions, -} from 'n8n-core'; - -import { - IDataObject, - ILoadOptionsFunctions, - NodeApiError, - NodeOperationError, -} from 'n8n-workflow'; - -import { - OptionsWithUri, -} from 'request'; - -import { - Connector, - ElasticSecurityApiCredentials, -} from './types'; +import { IExecuteFunctions } from 'n8n-core'; + +import { IDataObject, ILoadOptionsFunctions, NodeApiError, NodeOperationError } from 'n8n-workflow'; + +import { OptionsWithUri } from 'request'; + +import { Connector, ElasticSecurityApiCredentials } from './types'; export async function elasticSecurityApiRequest( this: IExecuteFunctions | ILoadOptionsFunctions, @@ -29,7 +17,7 @@ export async function elasticSecurityApiRequest( username, password, baseUrl: rawBaseUrl, - } = await this.getCredentials('elasticSecurityApi') as ElasticSecurityApiCredentials; + } = (await this.getCredentials('elasticSecurityApi')) as ElasticSecurityApiCredentials; const baseUrl = tolerateTrailingSlash(rawBaseUrl); @@ -83,9 +71,7 @@ export async function elasticSecurityApiRequestAllItems( responseData = await elasticSecurityApiRequest.call(this, method, endpoint, body, qs); page++; - const items = resource === 'case' - ? responseData.cases - : responseData; + const items = resource === 'case' ? responseData.cases : responseData; returnData.push(...items); } while (returnData.length < responseData.total); @@ -106,7 +92,13 @@ export async function handleListing( return await elasticSecurityApiRequestAllItems.call(this, method, endpoint, body, qs); } - const responseData = await elasticSecurityApiRequestAllItems.call(this, method, endpoint, body, qs); + const responseData = await elasticSecurityApiRequestAllItems.call( + this, + method, + endpoint, + body, + qs, + ); const limit = this.getNodeParameter('limit', 0) as number; return responseData.slice(0, limit); @@ -117,35 +109,26 @@ export async function handleListing( * * https://www.elastic.co/guide/en/kibana/master/get-connector-api.html */ -export async function getConnector( - this: IExecuteFunctions, - connectorId: string, -) { +export async function getConnector(this: IExecuteFunctions, connectorId: string) { const endpoint = `/actions/connector/${connectorId}`; const { id, name, connector_type_id: type, - } = await elasticSecurityApiRequest.call(this, 'GET', endpoint) as Connector; + } = (await elasticSecurityApiRequest.call(this, 'GET', endpoint)) as Connector; return { id, name, type }; } -export function throwOnEmptyUpdate( - this: IExecuteFunctions, - resource: string, -) { +export function throwOnEmptyUpdate(this: IExecuteFunctions, resource: string) { throw new NodeOperationError( this.getNode(), `Please enter at least one field to update for the ${resource}`, ); } -export async function getVersion( - this: IExecuteFunctions, - endpoint: string, -) { - const { version } = await elasticSecurityApiRequest.call(this, 'GET', endpoint) as { +export async function getVersion(this: IExecuteFunctions, endpoint: string) { + const { version } = (await elasticSecurityApiRequest.call(this, 'GET', endpoint)) as { version?: string; }; @@ -157,7 +140,5 @@ export async function getVersion( } export function tolerateTrailingSlash(baseUrl: string) { - return baseUrl.endsWith('/') - ? baseUrl.substr(0, baseUrl.length - 1) - : baseUrl; + return baseUrl.endsWith('/') ? baseUrl.substr(0, baseUrl.length - 1) : baseUrl; } diff --git a/packages/nodes-base/nodes/Elastic/ElasticSecurity/descriptions/CaseCommentDescription.ts b/packages/nodes-base/nodes/Elastic/ElasticSecurity/descriptions/CaseCommentDescription.ts index f5eb454972685..3f2bfcda926ab 100644 --- a/packages/nodes-base/nodes/Elastic/ElasticSecurity/descriptions/CaseCommentDescription.ts +++ b/packages/nodes-base/nodes/Elastic/ElasticSecurity/descriptions/CaseCommentDescription.ts @@ -1,6 +1,4 @@ -import { - INodeProperties, -} from 'n8n-workflow'; +import { INodeProperties } from 'n8n-workflow'; export const caseCommentOperations: INodeProperties[] = [ { @@ -10,9 +8,7 @@ export const caseCommentOperations: INodeProperties[] = [ type: 'options', displayOptions: { show: { - resource: [ - 'caseComment', - ], + resource: ['caseComment'], }, }, options: [ @@ -64,12 +60,8 @@ export const caseCommentFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'caseComment', - ], - operation: [ - 'add', - ], + resource: ['caseComment'], + operation: ['add'], }, }, }, @@ -81,12 +73,8 @@ export const caseCommentFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'caseComment', - ], - operation: [ - 'add', - ], + resource: ['caseComment'], + operation: ['add'], }, }, }, @@ -96,12 +84,8 @@ export const caseCommentFields: INodeProperties[] = [ type: 'boolean', displayOptions: { show: { - resource: [ - 'caseComment', - ], - operation: [ - 'add', - ], + resource: ['caseComment'], + operation: ['add'], }, }, default: true, @@ -115,12 +99,8 @@ export const caseCommentFields: INodeProperties[] = [ default: {}, displayOptions: { show: { - resource: [ - 'caseComment', - ], - operation: [ - 'add', - ], + resource: ['caseComment'], + operation: ['add'], }, }, options: [ @@ -128,7 +108,8 @@ export const caseCommentFields: INodeProperties[] = [ displayName: 'Owner', name: 'owner', type: 'string', - description: 'Valid application owner registered within the Cases Role Based Access Control system', + description: + 'Valid application owner registered within the Cases Role Based Access Control system', default: '', }, ], @@ -146,12 +127,8 @@ export const caseCommentFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'caseComment', - ], - operation: [ - 'get', - ], + resource: ['caseComment'], + operation: ['get'], }, }, }, @@ -164,12 +141,8 @@ export const caseCommentFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'caseComment', - ], - operation: [ - 'get', - ], + resource: ['caseComment'], + operation: ['get'], }, }, }, @@ -185,12 +158,8 @@ export const caseCommentFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'caseComment', - ], - operation: [ - 'getAll', - ], + resource: ['caseComment'], + operation: ['getAll'], }, }, }, @@ -202,12 +171,8 @@ export const caseCommentFields: INodeProperties[] = [ description: 'Whether to return all results or only up to a given limit', displayOptions: { show: { - resource: [ - 'caseComment', - ], - operation: [ - 'getAll', - ], + resource: ['caseComment'], + operation: ['getAll'], }, }, }, @@ -222,15 +187,9 @@ export const caseCommentFields: INodeProperties[] = [ }, displayOptions: { show: { - resource: [ - 'caseComment', - ], - operation: [ - 'getAll', - ], - returnAll: [ - false, - ], + resource: ['caseComment'], + operation: ['getAll'], + returnAll: [false], }, }, }, @@ -247,12 +206,8 @@ export const caseCommentFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'caseComment', - ], - operation: [ - 'remove', - ], + resource: ['caseComment'], + operation: ['remove'], }, }, }, @@ -264,12 +219,8 @@ export const caseCommentFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'caseComment', - ], - operation: [ - 'remove', - ], + resource: ['caseComment'], + operation: ['remove'], }, }, }, @@ -286,12 +237,8 @@ export const caseCommentFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'caseComment', - ], - operation: [ - 'update', - ], + resource: ['caseComment'], + operation: ['update'], }, }, }, @@ -303,12 +250,8 @@ export const caseCommentFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'caseComment', - ], - operation: [ - 'update', - ], + resource: ['caseComment'], + operation: ['update'], }, }, }, @@ -321,12 +264,8 @@ export const caseCommentFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'caseComment', - ], - operation: [ - 'update', - ], + resource: ['caseComment'], + operation: ['update'], }, }, }, @@ -336,12 +275,8 @@ export const caseCommentFields: INodeProperties[] = [ type: 'boolean', displayOptions: { show: { - resource: [ - 'caseComment', - ], - operation: [ - 'update', - ], + resource: ['caseComment'], + operation: ['update'], }, }, default: true, diff --git a/packages/nodes-base/nodes/Elastic/ElasticSecurity/descriptions/CaseDescription.ts b/packages/nodes-base/nodes/Elastic/ElasticSecurity/descriptions/CaseDescription.ts index 4ed412fe6c04c..f29cc20769ace 100644 --- a/packages/nodes-base/nodes/Elastic/ElasticSecurity/descriptions/CaseDescription.ts +++ b/packages/nodes-base/nodes/Elastic/ElasticSecurity/descriptions/CaseDescription.ts @@ -1,6 +1,4 @@ -import { - INodeProperties, -} from 'n8n-workflow'; +import { INodeProperties } from 'n8n-workflow'; export const caseOperations: INodeProperties[] = [ { @@ -10,9 +8,7 @@ export const caseOperations: INodeProperties[] = [ type: 'options', displayOptions: { show: { - resource: [ - 'case', - ], + resource: ['case'], }, }, options: [ @@ -69,19 +65,16 @@ export const caseFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'case', - ], - operation: [ - 'create', - ], + resource: ['case'], + operation: ['create'], }, }, }, { displayName: 'Connector Name or ID', name: 'connectorId', - description: 'Connectors allow you to send Elastic Security cases into other systems (only ServiceNow, Jira, or IBM Resilient). Choose from the list, or specify an ID using an expression.', + description: + 'Connectors allow you to send Elastic Security cases into other systems (only ServiceNow, Jira, or IBM Resilient). Choose from the list, or specify an ID using an expression.', type: 'options', required: true, default: '', @@ -90,12 +83,8 @@ export const caseFields: INodeProperties[] = [ }, displayOptions: { show: { - resource: [ - 'case', - ], - operation: [ - 'create', - ], + resource: ['case'], + operation: ['create'], }, }, }, @@ -121,12 +110,8 @@ export const caseFields: INodeProperties[] = [ ], displayOptions: { show: { - resource: [ - 'case', - ], - operation: [ - 'create', - ], + resource: ['case'], + operation: ['create'], }, }, }, @@ -140,15 +125,9 @@ export const caseFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'case', - ], - operation: [ - 'create', - ], - connectorType: [ - '.jira', - ], + resource: ['case'], + operation: ['create'], + connectorType: ['.jira'], }, }, }, @@ -162,15 +141,9 @@ export const caseFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'case', - ], - operation: [ - 'create', - ], - connectorType: [ - '.jira', - ], + resource: ['case'], + operation: ['create'], + connectorType: ['.jira'], }, }, }, @@ -197,15 +170,9 @@ export const caseFields: INodeProperties[] = [ ], displayOptions: { show: { - resource: [ - 'case', - ], - operation: [ - 'create', - ], - connectorType: [ - '.servicenow', - ], + resource: ['case'], + operation: ['create'], + connectorType: ['.servicenow'], }, }, }, @@ -232,15 +199,9 @@ export const caseFields: INodeProperties[] = [ ], displayOptions: { show: { - resource: [ - 'case', - ], - operation: [ - 'create', - ], - connectorType: [ - '.servicenow', - ], + resource: ['case'], + operation: ['create'], + connectorType: ['.servicenow'], }, }, }, @@ -267,15 +228,9 @@ export const caseFields: INodeProperties[] = [ ], displayOptions: { show: { - resource: [ - 'case', - ], - operation: [ - 'create', - ], - connectorType: [ - '.servicenow', - ], + resource: ['case'], + operation: ['create'], + connectorType: ['.servicenow'], }, }, }, @@ -289,37 +244,26 @@ export const caseFields: INodeProperties[] = [ placeholder: 'Helpdesk', displayOptions: { show: { - resource: [ - 'case', - ], - operation: [ - 'create', - ], - connectorType: [ - '.servicenow', - ], + resource: ['case'], + operation: ['create'], + connectorType: ['.servicenow'], }, }, }, { displayName: 'Issue Types', name: 'issueTypes', - description: 'Comma-separated list of numerical types of the IBM Resilient issue to create for this case', + description: + 'Comma-separated list of numerical types of the IBM Resilient issue to create for this case', type: 'string', placeholder: '123,456', required: true, default: '', displayOptions: { show: { - resource: [ - 'case', - ], - operation: [ - 'create', - ], - connectorType: [ - '.resilient', - ], + resource: ['case'], + operation: ['create'], + connectorType: ['.resilient'], }, }, }, @@ -335,15 +279,9 @@ export const caseFields: INodeProperties[] = [ default: 1, displayOptions: { show: { - resource: [ - 'case', - ], - operation: [ - 'create', - ], - connectorType: [ - '.resilient', - ], + resource: ['case'], + operation: ['create'], + connectorType: ['.resilient'], }, }, }, @@ -355,12 +293,8 @@ export const caseFields: INodeProperties[] = [ default: {}, displayOptions: { show: { - resource: [ - 'case', - ], - operation: [ - 'create', - ], + resource: ['case'], + operation: ['create'], }, }, options: [ @@ -374,7 +308,8 @@ export const caseFields: INodeProperties[] = [ displayName: 'Owner', name: 'owner', type: 'string', - description: 'Valid application owner registered within the Cases Role Based Access Control system', + description: + 'Valid application owner registered within the Cases Role Based Access Control system', default: '', }, { @@ -398,12 +333,8 @@ export const caseFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'case', - ], - operation: [ - 'delete', - ], + resource: ['case'], + operation: ['delete'], }, }, }, @@ -419,12 +350,8 @@ export const caseFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'case', - ], - operation: [ - 'get', - ], + resource: ['case'], + operation: ['get'], }, }, }, @@ -440,12 +367,8 @@ export const caseFields: INodeProperties[] = [ description: 'Whether to return all results or only up to a given limit', displayOptions: { show: { - resource: [ - 'case', - ], - operation: [ - 'getAll', - ], + resource: ['case'], + operation: ['getAll'], }, }, }, @@ -460,19 +383,13 @@ export const caseFields: INodeProperties[] = [ }, displayOptions: { show: { - resource: [ - 'case', - ], - operation: [ - 'getAll', - ], - returnAll: [ - false, - ], + resource: ['case'], + operation: ['getAll'], + returnAll: [false], }, }, }, -{ + { displayName: 'Filters', name: 'filters', type: 'collection', @@ -480,12 +397,8 @@ export const caseFields: INodeProperties[] = [ placeholder: 'Add Filter', displayOptions: { show: { - resource: [ - 'case', - ], - operation: [ - 'getAll', - ], + resource: ['case'], + operation: ['getAll'], }, }, options: [ @@ -513,7 +426,8 @@ export const caseFields: INodeProperties[] = [ displayName: 'Tag Names or IDs', name: 'tags', type: 'multiOptions', - description: 'Choose from the list, or specify IDs using an expression', + description: + 'Choose from the list, or specify IDs using an expression', default: [], typeOptions: { loadOptionsMethod: 'getTags', @@ -529,12 +443,8 @@ export const caseFields: INodeProperties[] = [ default: {}, displayOptions: { show: { - resource: [ - 'case', - ], - operation: [ - 'getAll', - ], + resource: ['case'], + operation: ['getAll'], }, }, options: [ @@ -590,12 +500,8 @@ export const caseFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'case', - ], - operation: [ - 'update', - ], + resource: ['case'], + operation: ['update'], }, }, }, @@ -607,12 +513,8 @@ export const caseFields: INodeProperties[] = [ default: {}, displayOptions: { show: { - resource: [ - 'case', - ], - operation: [ - 'update', - ], + resource: ['case'], + operation: ['update'], }, }, options: [ diff --git a/packages/nodes-base/nodes/Elastic/ElasticSecurity/descriptions/CaseTagDescription.ts b/packages/nodes-base/nodes/Elastic/ElasticSecurity/descriptions/CaseTagDescription.ts index 130a58eee4069..73fe8e2331028 100644 --- a/packages/nodes-base/nodes/Elastic/ElasticSecurity/descriptions/CaseTagDescription.ts +++ b/packages/nodes-base/nodes/Elastic/ElasticSecurity/descriptions/CaseTagDescription.ts @@ -1,6 +1,4 @@ -import { - INodeProperties, -} from 'n8n-workflow'; +import { INodeProperties } from 'n8n-workflow'; export const caseTagOperations: INodeProperties[] = [ { @@ -10,9 +8,7 @@ export const caseTagOperations: INodeProperties[] = [ noDataExpression: true, displayOptions: { show: { - resource: [ - 'caseTag', - ], + resource: ['caseTag'], }, }, options: [ @@ -45,12 +41,8 @@ export const caseTagFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'caseTag', - ], - operation: [ - 'add', - ], + resource: ['caseTag'], + operation: ['add'], }, }, }, @@ -58,7 +50,8 @@ export const caseTagFields: INodeProperties[] = [ displayName: 'Tag Name or ID', name: 'tag', type: 'options', - description: 'Tag to attach to the case. Choose from the list, or specify an ID using an expression.', + description: + 'Tag to attach to the case. Choose from the list, or specify an ID using an expression.', required: true, default: '', typeOptions: { @@ -66,12 +59,8 @@ export const caseTagFields: INodeProperties[] = [ }, displayOptions: { show: { - resource: [ - 'caseTag', - ], - operation: [ - 'add', - ], + resource: ['caseTag'], + operation: ['add'], }, }, }, @@ -87,12 +76,8 @@ export const caseTagFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'caseTag', - ], - operation: [ - 'remove', - ], + resource: ['caseTag'], + operation: ['remove'], }, }, }, @@ -100,7 +85,8 @@ export const caseTagFields: INodeProperties[] = [ displayName: 'Tag Name or ID', name: 'tag', type: 'options', - description: 'Choose from the list, or specify an ID using an expression', + description: + 'Choose from the list, or specify an ID using an expression', required: true, default: '', typeOptions: { @@ -108,12 +94,8 @@ export const caseTagFields: INodeProperties[] = [ }, displayOptions: { show: { - resource: [ - 'caseTag', - ], - operation: [ - 'remove', - ], + resource: ['caseTag'], + operation: ['remove'], }, }, }, diff --git a/packages/nodes-base/nodes/Elastic/ElasticSecurity/descriptions/ConnectorDescription.ts b/packages/nodes-base/nodes/Elastic/ElasticSecurity/descriptions/ConnectorDescription.ts index 72e2889bc18b4..aee33d5e2f2a9 100644 --- a/packages/nodes-base/nodes/Elastic/ElasticSecurity/descriptions/ConnectorDescription.ts +++ b/packages/nodes-base/nodes/Elastic/ElasticSecurity/descriptions/ConnectorDescription.ts @@ -1,6 +1,4 @@ -import { - INodeProperties, -} from 'n8n-workflow'; +import { INodeProperties } from 'n8n-workflow'; export const connectorOperations: INodeProperties[] = [ { @@ -10,9 +8,7 @@ export const connectorOperations: INodeProperties[] = [ type: 'options', displayOptions: { show: { - resource: [ - 'connector', - ], + resource: ['connector'], }, }, options: [ @@ -34,18 +30,15 @@ export const connectorFields: INodeProperties[] = [ { displayName: 'Connector Name', name: 'name', - description: 'Connectors allow you to send Elastic Security cases into other systems (only ServiceNow, Jira, or IBM Resilient)', + description: + 'Connectors allow you to send Elastic Security cases into other systems (only ServiceNow, Jira, or IBM Resilient)', type: 'string', required: true, default: '', displayOptions: { show: { - resource: [ - 'connector', - ], - operation: [ - 'create', - ], + resource: ['connector'], + operation: ['create'], }, }, }, @@ -71,12 +64,8 @@ export const connectorFields: INodeProperties[] = [ ], displayOptions: { show: { - resource: [ - 'connector', - ], - operation: [ - 'create', - ], + resource: ['connector'], + operation: ['create'], }, }, }, @@ -89,12 +78,8 @@ export const connectorFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'connector', - ], - operation: [ - 'create', - ], + resource: ['connector'], + operation: ['create'], }, }, }, @@ -108,15 +93,9 @@ export const connectorFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'connector', - ], - operation: [ - 'create', - ], - connectorType: [ - '.jira', - ], + resource: ['connector'], + operation: ['create'], + connectorType: ['.jira'], }, }, }, @@ -129,15 +108,9 @@ export const connectorFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'connector', - ], - operation: [ - 'create', - ], - connectorType: [ - '.jira', - ], + resource: ['connector'], + operation: ['create'], + connectorType: ['.jira'], }, }, }, @@ -150,15 +123,9 @@ export const connectorFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'connector', - ], - operation: [ - 'create', - ], - connectorType: [ - '.jira', - ], + resource: ['connector'], + operation: ['create'], + connectorType: ['.jira'], }, }, }, @@ -171,15 +138,9 @@ export const connectorFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'connector', - ], - operation: [ - 'create', - ], - connectorType: [ - '.servicenow', - ], + resource: ['connector'], + operation: ['create'], + connectorType: ['.servicenow'], }, }, }, @@ -192,15 +153,9 @@ export const connectorFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'connector', - ], - operation: [ - 'create', - ], - connectorType: [ - '.servicenow', - ], + resource: ['connector'], + operation: ['create'], + connectorType: ['.servicenow'], }, }, }, @@ -213,15 +168,9 @@ export const connectorFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'connector', - ], - operation: [ - 'create', - ], - connectorType: [ - '.resilient', - ], + resource: ['connector'], + operation: ['create'], + connectorType: ['.resilient'], }, }, }, @@ -234,15 +183,9 @@ export const connectorFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'connector', - ], - operation: [ - 'create', - ], - connectorType: [ - '.resilient', - ], + resource: ['connector'], + operation: ['create'], + connectorType: ['.resilient'], }, }, }, @@ -255,15 +198,9 @@ export const connectorFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'connector', - ], - operation: [ - 'create', - ], - connectorType: [ - '.resilient', - ], + resource: ['connector'], + operation: ['create'], + connectorType: ['.resilient'], }, }, }, diff --git a/packages/nodes-base/nodes/Elastic/ElasticSecurity/types.d.ts b/packages/nodes-base/nodes/Elastic/ElasticSecurity/types.d.ts index 7788a04255f92..268762ec621c7 100644 --- a/packages/nodes-base/nodes/Elastic/ElasticSecurity/types.d.ts +++ b/packages/nodes-base/nodes/Elastic/ElasticSecurity/types.d.ts @@ -9,7 +9,7 @@ export type ConnectorType = '.jira' | '.servicenow' | '.resilient'; export type Connector = { id: string; name: string; - connector_type_id: ConnectorType + connector_type_id: ConnectorType; }; export type ConnectorCreatePayload = @@ -18,39 +18,39 @@ export type ConnectorCreatePayload = | IbmResilientConnectorCreatePayload; type ServiceNowConnectorCreatePayload = { - connector_type_id: '.servicenow', - name: string, + connector_type_id: '.servicenow'; + name: string; secrets?: { username: string; password: string; - }, + }; config?: { apiUrl: string; - }, + }; }; type JiraConnectorCreatePayload = { - connector_type_id: '.jira', - name: string, + connector_type_id: '.jira'; + name: string; secrets?: { email: string; apiToken: string; - }, + }; config?: { apiUrl: string; projectKey: string; - }, + }; }; type IbmResilientConnectorCreatePayload = { - connector_type_id: '.resilient', - name: string, + connector_type_id: '.resilient'; + name: string; secrets?: { apiKeyId: string; apiKeySecret: string; - }, + }; config?: { apiUrl: string; orgId: string; - }, + }; }; diff --git a/packages/nodes-base/nodes/Elastic/Elasticsearch/Elasticsearch.node.ts b/packages/nodes-base/nodes/Elastic/Elasticsearch/Elasticsearch.node.ts index e7aab680de91c..4019683c62c3b 100644 --- a/packages/nodes-base/nodes/Elastic/Elasticsearch/Elasticsearch.node.ts +++ b/packages/nodes-base/nodes/Elastic/Elasticsearch/Elasticsearch.node.ts @@ -1,6 +1,4 @@ -import { - IExecuteFunctions, -} from 'n8n-core'; +import { IExecuteFunctions } from 'n8n-core'; import { ICredentialsDecrypted, @@ -13,26 +11,13 @@ import { JsonObject, } from 'n8n-workflow'; -import { - elasticsearchApiRequest, -} from './GenericFunctions'; +import { elasticsearchApiRequest } from './GenericFunctions'; -import { - documentFields, - documentOperations, - indexFields, - indexOperations, -} from './descriptions'; +import { documentFields, documentOperations, indexFields, indexOperations } from './descriptions'; -import { - DocumentGetAllOptions, - ElasticsearchApiCredentials, - FieldsUiValues, -} from './types'; +import { DocumentGetAllOptions, ElasticsearchApiCredentials, FieldsUiValues } from './types'; -import { - omit, -} from 'lodash'; +import { omit } from 'lodash'; export class Elasticsearch implements INodeType { description: INodeTypeDescription = { @@ -89,9 +74,7 @@ export class Elasticsearch implements INodeType { let responseData; for (let i = 0; i < items.length; i++) { - if (resource === 'document') { - // ********************************************************************** // document // ********************************************************************** @@ -99,7 +82,6 @@ export class Elasticsearch implements INodeType { // https://www.elastic.co/guide/en/elasticsearch/reference/current/docs.html if (operation === 'delete') { - // ---------------------------------------- // document: delete // ---------------------------------------- @@ -111,9 +93,7 @@ export class Elasticsearch implements INodeType { const endpoint = `/${indexId}/_doc/${documentId}`; responseData = await elasticsearchApiRequest.call(this, 'DELETE', endpoint); - } else if (operation === 'get') { - // ---------------------------------------- // document: get // ---------------------------------------- @@ -142,9 +122,7 @@ export class Elasticsearch implements INodeType { ...responseData._source, }; } - } else if (operation === 'getAll') { - // ---------------------------------------- // document: getAll // ---------------------------------------- @@ -170,7 +148,13 @@ export class Elasticsearch implements INodeType { qs.size = this.getNodeParameter('limit', 0); } - responseData = await elasticsearchApiRequest.call(this, 'GET', `/${indexId}/_search`, body, qs); + responseData = await elasticsearchApiRequest.call( + this, + 'GET', + `/${indexId}/_search`, + body, + qs, + ); responseData = responseData.hits.hits; const simple = this.getNodeParameter('simple', 0) as IDataObject; @@ -183,9 +167,7 @@ export class Elasticsearch implements INodeType { }; }); } - } else if (operation === 'create') { - // ---------------------------------------- // document: create // ---------------------------------------- @@ -194,24 +176,22 @@ export class Elasticsearch implements INodeType { const body: IDataObject = {}; - const dataToSend = this.getNodeParameter('dataToSend', 0) as 'defineBelow' | 'autoMapInputData'; + const dataToSend = this.getNodeParameter('dataToSend', 0) as + | 'defineBelow' + | 'autoMapInputData'; if (dataToSend === 'defineBelow') { - const fields = this.getNodeParameter('fieldsUi.fieldValues', i, []) as FieldsUiValues; - fields.forEach(({ fieldId, fieldValue }) => body[fieldId] = fieldValue); - + fields.forEach(({ fieldId, fieldValue }) => (body[fieldId] = fieldValue)); } else { - const inputData = items[i].json; const rawInputsToIgnore = this.getNodeParameter('inputsToIgnore', i) as string; - const inputsToIgnore = rawInputsToIgnore.split(',').map(c => c.trim()); + const inputsToIgnore = rawInputsToIgnore.split(',').map((c) => c.trim()); for (const key of Object.keys(inputData)) { if (inputsToIgnore.includes(key)) continue; body[key] = inputData[key]; } - } const qs = {} as IDataObject; @@ -234,9 +214,7 @@ export class Elasticsearch implements INodeType { const endpoint = `/${indexId}/_doc`; responseData = await elasticsearchApiRequest.call(this, 'POST', endpoint, body, qs); } - } else if (operation === 'update') { - // ---------------------------------------- // document: update // ---------------------------------------- @@ -245,24 +223,22 @@ export class Elasticsearch implements INodeType { const body = { doc: {} } as { doc: { [key: string]: string } }; - const dataToSend = this.getNodeParameter('dataToSend', 0) as 'defineBelow' | 'autoMapInputData'; + const dataToSend = this.getNodeParameter('dataToSend', 0) as + | 'defineBelow' + | 'autoMapInputData'; if (dataToSend === 'defineBelow') { - const fields = this.getNodeParameter('fieldsUi.fieldValues', i, []) as FieldsUiValues; - fields.forEach(({ fieldId, fieldValue }) => body.doc[fieldId] = fieldValue); - + fields.forEach(({ fieldId, fieldValue }) => (body.doc[fieldId] = fieldValue)); } else { - const inputData = items[i].json; const rawInputsToIgnore = this.getNodeParameter('inputsToIgnore', i) as string; - const inputsToIgnore = rawInputsToIgnore.split(',').map(c => c.trim()); + const inputsToIgnore = rawInputsToIgnore.split(',').map((c) => c.trim()); for (const key of Object.keys(inputData)) { if (inputsToIgnore.includes(key)) continue; body.doc[key] = inputData[key] as string; } - } const indexId = this.getNodeParameter('indexId', i); @@ -275,11 +251,8 @@ export class Elasticsearch implements INodeType { const endpoint = `/${indexId}/_update/${documentId}`; responseData = await elasticsearchApiRequest.call(this, 'POST', endpoint, body, qs); - } - } else if (resource === 'index') { - // ********************************************************************** // index // ********************************************************************** @@ -287,7 +260,6 @@ export class Elasticsearch implements INodeType { // https://www.elastic.co/guide/en/elasticsearch/reference/current/indices.html if (operation === 'create') { - // ---------------------------------------- // index: create // ---------------------------------------- @@ -309,9 +281,7 @@ export class Elasticsearch implements INodeType { responseData = await elasticsearchApiRequest.call(this, 'PUT', `/${indexId}`); responseData = { id: indexId, ...responseData }; delete responseData.index; - } else if (operation === 'delete') { - // ---------------------------------------- // index: delete // ---------------------------------------- @@ -322,9 +292,7 @@ export class Elasticsearch implements INodeType { responseData = await elasticsearchApiRequest.call(this, 'DELETE', `/${indexId}`); responseData = { success: true }; - } else if (operation === 'get') { - // ---------------------------------------- // index: get // ---------------------------------------- @@ -342,9 +310,7 @@ export class Elasticsearch implements INodeType { responseData = await elasticsearchApiRequest.call(this, 'GET', `/${indexId}`, {}, qs); responseData = { id: indexId, ...responseData[indexId] }; - } else if (operation === 'getAll') { - // ---------------------------------------- // index: getAll // ---------------------------------------- @@ -352,7 +318,7 @@ export class Elasticsearch implements INodeType { // https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-aliases.html responseData = await elasticsearchApiRequest.call(this, 'GET', '/_aliases'); - responseData = Object.keys(responseData).map(i => ({ indexId: i })); + responseData = Object.keys(responseData).map((i) => ({ indexId: i })); const returnAll = this.getNodeParameter('returnAll', i); @@ -360,15 +326,12 @@ export class Elasticsearch implements INodeType { const limit = this.getNodeParameter('limit', i) as number; responseData = responseData.slice(0, limit); } - } - } Array.isArray(responseData) ? returnData.push(...responseData) : returnData.push(responseData); - } return [this.helpers.returnJsonArray(returnData)]; diff --git a/packages/nodes-base/nodes/Elastic/Elasticsearch/GenericFunctions.ts b/packages/nodes-base/nodes/Elastic/Elasticsearch/GenericFunctions.ts index f6f9dee35e4fc..eef6ba236268b 100644 --- a/packages/nodes-base/nodes/Elastic/Elasticsearch/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Elastic/Elasticsearch/GenericFunctions.ts @@ -1,20 +1,10 @@ -import { - OptionsWithUri, -} from 'request'; +import { OptionsWithUri } from 'request'; -import { - IExecuteFunctions, -} from 'n8n-core'; +import { IExecuteFunctions } from 'n8n-core'; -import { - IDataObject, - JsonObject, - NodeApiError, -} from 'n8n-workflow'; +import { IDataObject, JsonObject, NodeApiError } from 'n8n-workflow'; -import { - ElasticsearchApiCredentials, -} from './types'; +import { ElasticsearchApiCredentials } from './types'; export async function elasticsearchApiRequest( this: IExecuteFunctions, @@ -23,10 +13,9 @@ export async function elasticsearchApiRequest( body: IDataObject = {}, qs: IDataObject = {}, ) { - const { - baseUrl, - ignoreSSLIssues, - } = await this.getCredentials('elasticsearchApi') as ElasticsearchApiCredentials; + const { baseUrl, ignoreSSLIssues } = (await this.getCredentials( + 'elasticsearchApi', + )) as ElasticsearchApiCredentials; const options: OptionsWithUri = { method, diff --git a/packages/nodes-base/nodes/Elastic/Elasticsearch/descriptions/DocumentDescription.ts b/packages/nodes-base/nodes/Elastic/Elasticsearch/descriptions/DocumentDescription.ts index a7bc5df013fdf..57a17d7e201c0 100644 --- a/packages/nodes-base/nodes/Elastic/Elasticsearch/descriptions/DocumentDescription.ts +++ b/packages/nodes-base/nodes/Elastic/Elasticsearch/descriptions/DocumentDescription.ts @@ -1,6 +1,4 @@ -import { - INodeProperties, -} from 'n8n-workflow'; +import { INodeProperties } from 'n8n-workflow'; import * as placeholders from './placeholders'; @@ -12,9 +10,7 @@ export const documentOperations: INodeProperties[] = [ noDataExpression: true, displayOptions: { show: { - resource: [ - 'document', - ], + resource: ['document'], }, }, options: [ @@ -66,12 +62,8 @@ export const documentFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'document', - ], - operation: [ - 'delete', - ], + resource: ['document'], + operation: ['delete'], }, }, }, @@ -84,12 +76,8 @@ export const documentFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'document', - ], - operation: [ - 'delete', - ], + resource: ['document'], + operation: ['delete'], }, }, }, @@ -106,12 +94,8 @@ export const documentFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'document', - ], - operation: [ - 'get', - ], + resource: ['document'], + operation: ['get'], }, }, }, @@ -124,12 +108,8 @@ export const documentFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'document', - ], - operation: [ - 'get', - ], + resource: ['document'], + operation: ['get'], }, }, }, @@ -141,12 +121,8 @@ export const documentFields: INodeProperties[] = [ description: 'Whether to return a simplified version of the response instead of the raw data', displayOptions: { show: { - resource: [ - 'document', - ], - operation: [ - 'get', - ], + resource: ['document'], + operation: ['get'], }, }, }, @@ -158,12 +134,8 @@ export const documentFields: INodeProperties[] = [ default: {}, displayOptions: { show: { - resource: [ - 'document', - ], - operation: [ - 'get', - ], + resource: ['document'], + operation: ['get'], }, }, options: [ @@ -184,7 +156,8 @@ export const documentFields: INodeProperties[] = [ { displayName: 'Stored Fields', name: 'stored_fields', - description: 'Whether to retrieve the document fields stored in the index rather than the document _source. Defaults to false.', + description: + 'Whether to retrieve the document fields stored in the index rather than the document _source. Defaults to false.', type: 'boolean', default: false, }, @@ -203,12 +176,8 @@ export const documentFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'document', - ], - operation: [ - 'getAll', - ], + resource: ['document'], + operation: ['getAll'], }, }, }, @@ -220,12 +189,8 @@ export const documentFields: INodeProperties[] = [ description: 'Whether to return all results or only up to a given limit', displayOptions: { show: { - resource: [ - 'document', - ], - operation: [ - 'getAll', - ], + resource: ['document'], + operation: ['getAll'], }, }, }, @@ -240,15 +205,9 @@ export const documentFields: INodeProperties[] = [ }, displayOptions: { show: { - resource: [ - 'document', - ], - operation: [ - 'getAll', - ], - returnAll: [ - false, - ], + resource: ['document'], + operation: ['getAll'], + returnAll: [false], }, }, }, @@ -260,12 +219,8 @@ export const documentFields: INodeProperties[] = [ description: 'Whether to return a simplified version of the response instead of the raw data', displayOptions: { show: { - resource: [ - 'document', - ], - operation: [ - 'getAll', - ], + resource: ['document'], + operation: ['getAll'], }, }, }, @@ -277,12 +232,8 @@ export const documentFields: INodeProperties[] = [ default: {}, displayOptions: { show: { - resource: [ - 'document', - ], - operation: [ - 'getAll', - ], + resource: ['document'], + operation: ['getAll'], }, }, options: [ @@ -290,7 +241,8 @@ export const documentFields: INodeProperties[] = [ displayName: 'Allow No Indices', name: 'allow_no_indices', // eslint-disable-next-line n8n-nodes-base/node-param-description-boolean-without-whether - description: 'If false, return an error if any of the following targets only missing/closed indices: wildcard expression, index alias, or _all value. Defaults to true.', + description: + 'If false, return an error if any of the following targets only missing/closed indices: wildcard expression, index alias, or _all value. Defaults to true.', type: 'boolean', default: true, }, @@ -298,14 +250,16 @@ export const documentFields: INodeProperties[] = [ displayName: 'Allow Partial Search Results', name: 'allow_partial_search_results', // eslint-disable-next-line n8n-nodes-base/node-param-description-boolean-without-whether - description: '

If true, return partial results if there are shard request timeouts or shard failures.

If false, returns an error with no partial results. Defaults to true.

.', + description: + '

If true, return partial results if there are shard request timeouts or shard failures.

If false, returns an error with no partial results. Defaults to true.

.', type: 'boolean', default: true, }, { displayName: 'Batched Reduce Size', name: 'batched_reduce_size', - description: 'Number of shard results that should be reduced at once on the coordinating node. Defaults to 512.', + description: + 'Number of shard results that should be reduced at once on the coordinating node. Defaults to 512.', type: 'number', typeOptions: { minValue: 2, @@ -315,21 +269,24 @@ export const documentFields: INodeProperties[] = [ { displayName: 'CCS Minimize Roundtrips', name: 'ccs_minimize_roundtrips', - description: 'Whether network round-trips between the coordinating node and the remote clusters are minimized when executing cross-cluster search (CCS) requests. Defaults to true.', + description: + 'Whether network round-trips between the coordinating node and the remote clusters are minimized when executing cross-cluster search (CCS) requests. Defaults to true.', type: 'boolean', default: true, }, { displayName: 'Doc Value Fields', name: 'docvalue_fields', - description: 'Comma-separated list of fields to return as the docvalue representation of a field for each hit', + description: + 'Comma-separated list of fields to return as the docvalue representation of a field for each hit', type: 'string', default: '', }, { displayName: 'Expand Wildcards', name: 'expand_wildcards', - description: 'Type of index that wildcard expressions can match. Defaults to open', + description: + 'Type of index that wildcard expressions can match. Defaults to open', type: 'options', options: [ { @@ -358,35 +315,40 @@ export const documentFields: INodeProperties[] = [ { displayName: 'Explain', name: 'explain', - description: 'Whether to return detailed information about score computation as part of a hit. Defaults to false.', + description: + 'Whether to return detailed information about score computation as part of a hit. Defaults to false.', type: 'boolean', default: false, }, { displayName: 'Ignore Throttled', name: 'ignore_throttled', - description: 'Whether concrete, expanded or aliased indices are ignored when frozen. Defaults to true.', + description: + 'Whether concrete, expanded or aliased indices are ignored when frozen. Defaults to true.', type: 'boolean', default: true, }, { displayName: 'Ignore Unavailable', name: 'ignore_unavailable', - description: 'Whether missing or closed indices are not included in the response. Defaults to false.', + description: + 'Whether missing or closed indices are not included in the response. Defaults to false.', type: 'boolean', default: false, }, { displayName: 'Max Concurrent Shard Requests', name: 'max_concurrent_shard_requests', - description: 'Define the number of shard requests per node this search executes concurrently. Defaults to 5.', + description: + 'Define the number of shard requests per node this search executes concurrently. Defaults to 5.', type: 'number', default: 5, }, { displayName: 'Pre-Filter Shard Size', name: 'pre_filter_shard_size', - description: 'Define a threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting. Only used if the number of shards the search request expands to exceeds the threshold.', + description: + 'Define a threshold that enforces a pre-filter roundtrip to prefilter search shards based on query rewriting. Only used if the number of shards the search request expands to exceeds the threshold.', type: 'number', typeOptions: { minValue: 1, @@ -396,7 +358,8 @@ export const documentFields: INodeProperties[] = [ { displayName: 'Query', name: 'query', - description: 'Query in the Elasticsearch Query DSL', + description: + 'Query in the Elasticsearch Query DSL', type: 'json', typeOptions: { alwaysOpenEditWindow: true, @@ -407,7 +370,8 @@ export const documentFields: INodeProperties[] = [ { displayName: 'Request Cache', name: 'request_cache', - description: 'Whether the caching of search results is enabled for requests where size is 0. See Elasticsearch shard request cache settings.', + description: + 'Whether the caching of search results is enabled for requests where size is 0. See Elasticsearch shard request cache settings.', type: 'boolean', default: false, }, @@ -421,7 +385,8 @@ export const documentFields: INodeProperties[] = [ { displayName: 'Search Type', name: 'search_type', - description: 'How distributed term frequencies are calculated for relevance scoring. Defaults to Query then Fetch.', + description: + 'How distributed term frequencies are calculated for relevance scoring. Defaults to Query then Fetch.', type: 'options', options: [ { @@ -438,7 +403,8 @@ export const documentFields: INodeProperties[] = [ { displayName: 'Sequence Number and Primary Term', name: 'seq_no_primary_term', - description: 'Whether to return the sequence number and primary term of the last modification of each hit. See Optimistic concurrency control.', + description: + 'Whether to return the sequence number and primary term of the last modification of each hit. See Optimistic concurrency control.', type: 'boolean', default: false, }, @@ -473,7 +439,8 @@ export const documentFields: INodeProperties[] = [ { displayName: 'Stored Fields', name: 'stored_fields', - description: 'Whether to retrieve the document fields stored in the index rather than the document _source. Defaults to false.', + description: + 'Whether to retrieve the document fields stored in the index rather than the document _source. Defaults to false.', type: 'boolean', default: false, }, @@ -487,14 +454,16 @@ export const documentFields: INodeProperties[] = [ { displayName: 'Timeout', name: 'timeout', - description: 'Period to wait for active shards. Defaults to 1m (one minute). See the Elasticsearch time units reference', + description: + 'Period to wait for active shards. Defaults to 1m (one minute). See the Elasticsearch time units reference', type: 'string', default: '1m', }, { displayName: 'Track Scores', name: 'track_scores', - description: 'Whether to calculate and return document scores, even if the scores are not used for sorting. Defaults to false.', + description: + 'Whether to calculate and return document scores, even if the scores are not used for sorting. Defaults to false.', type: 'boolean', default: false, }, @@ -527,12 +496,8 @@ export const documentFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'document', - ], - operation: [ - 'create', - ], + resource: ['document'], + operation: ['create'], }, }, }, @@ -554,12 +519,8 @@ export const documentFields: INodeProperties[] = [ ], displayOptions: { show: { - resource: [ - 'document', - ], - operation: [ - 'create', - ], + resource: ['document'], + operation: ['create'], }, }, default: 'defineBelow', @@ -571,19 +532,14 @@ export const documentFields: INodeProperties[] = [ type: 'string', displayOptions: { show: { - resource: [ - 'document', - ], - operation: [ - 'create', - ], - dataToSend: [ - 'autoMapInputData', - ], + resource: ['document'], + operation: ['create'], + dataToSend: ['autoMapInputData'], }, }, default: '', - description: 'List of input properties to avoid sending, separated by commas. Leave empty to send all properties.', + description: + 'List of input properties to avoid sending, separated by commas. Leave empty to send all properties.', placeholder: 'Enter properties...', }, { @@ -597,15 +553,9 @@ export const documentFields: INodeProperties[] = [ }, displayOptions: { show: { - resource: [ - 'document', - ], - operation: [ - 'create', - ], - dataToSend: [ - 'defineBelow', - ], + resource: ['document'], + operation: ['create'], + dataToSend: ['defineBelow'], }, }, default: {}, @@ -638,12 +588,8 @@ export const documentFields: INodeProperties[] = [ default: {}, displayOptions: { show: { - resource: [ - 'document', - ], - operation: [ - 'create', - ], + resource: ['document'], + operation: ['create'], }, }, options: [ @@ -664,7 +610,8 @@ export const documentFields: INodeProperties[] = [ { displayName: 'Timeout', name: 'timeout', - description: 'Period to wait for active shards. Defaults to 1m (one minute). See the Elasticsearch time units reference', + description: + 'Period to wait for active shards. Defaults to 1m (one minute). See the Elasticsearch time units reference', type: 'string', default: '1m', }, @@ -678,12 +625,8 @@ export const documentFields: INodeProperties[] = [ default: {}, displayOptions: { show: { - resource: [ - 'document', - ], - operation: [ - 'create', - ], + resource: ['document'], + operation: ['create'], }, }, options: [ @@ -697,7 +640,8 @@ export const documentFields: INodeProperties[] = [ { displayName: 'Refresh', name: 'refresh', - description: 'If true, Elasticsearch refreshes the affected shards to make this operation visible to search,if wait_for then wait for a refresh to make this operation visible to search,if false do nothing with refreshes', + description: + 'If true, Elasticsearch refreshes the affected shards to make this operation visible to search,if wait_for then wait for a refresh to make this operation visible to search,if false do nothing with refreshes', type: 'options', default: 'false', options: [ @@ -733,12 +677,8 @@ export const documentFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'document', - ], - operation: [ - 'update', - ], + resource: ['document'], + operation: ['update'], }, }, }, @@ -751,12 +691,8 @@ export const documentFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'document', - ], - operation: [ - 'update', - ], + resource: ['document'], + operation: ['update'], }, }, }, @@ -778,12 +714,8 @@ export const documentFields: INodeProperties[] = [ ], displayOptions: { show: { - resource: [ - 'document', - ], - operation: [ - 'update', - ], + resource: ['document'], + operation: ['update'], }, }, default: 'defineBelow', @@ -795,19 +727,14 @@ export const documentFields: INodeProperties[] = [ type: 'string', displayOptions: { show: { - resource: [ - 'document', - ], - operation: [ - 'update', - ], - dataToSend: [ - 'autoMapInputData', - ], + resource: ['document'], + operation: ['update'], + dataToSend: ['autoMapInputData'], }, }, default: '', - description: 'List of input properties to avoid sending, separated by commas. Leave empty to send all properties.', + description: + 'List of input properties to avoid sending, separated by commas. Leave empty to send all properties.', placeholder: 'Enter properties...', }, { @@ -821,15 +748,9 @@ export const documentFields: INodeProperties[] = [ }, displayOptions: { show: { - resource: [ - 'document', - ], - operation: [ - 'update', - ], - dataToSend: [ - 'defineBelow', - ], + resource: ['document'], + operation: ['update'], + dataToSend: ['defineBelow'], }, }, default: {}, @@ -862,19 +783,16 @@ export const documentFields: INodeProperties[] = [ default: {}, displayOptions: { show: { - resource: [ - 'document', - ], - operation: [ - 'update', - ], + resource: ['document'], + operation: ['update'], }, }, options: [ { displayName: 'Refresh', name: 'refresh', - description: 'If true, Elasticsearch refreshes the affected shards to make this operation visible to search,if wait_for then wait for a refresh to make this operation visible to search,if false do nothing with refreshes', + description: + 'If true, Elasticsearch refreshes the affected shards to make this operation visible to search,if wait_for then wait for a refresh to make this operation visible to search,if false do nothing with refreshes', type: 'options', default: 'false', options: [ diff --git a/packages/nodes-base/nodes/Elastic/Elasticsearch/descriptions/IndexDescription.ts b/packages/nodes-base/nodes/Elastic/Elasticsearch/descriptions/IndexDescription.ts index a24eef3fe446a..09a923575e576 100644 --- a/packages/nodes-base/nodes/Elastic/Elasticsearch/descriptions/IndexDescription.ts +++ b/packages/nodes-base/nodes/Elastic/Elasticsearch/descriptions/IndexDescription.ts @@ -1,6 +1,4 @@ -import { - INodeProperties, -} from 'n8n-workflow'; +import { INodeProperties } from 'n8n-workflow'; import * as placeholders from './placeholders'; @@ -12,9 +10,7 @@ export const indexOperations: INodeProperties[] = [ noDataExpression: true, displayOptions: { show: { - resource: [ - 'index', - ], + resource: ['index'], }, }, options: [ @@ -56,12 +52,8 @@ export const indexFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'index', - ], - operation: [ - 'create', - ], + resource: ['index'], + operation: ['create'], }, }, }, @@ -73,19 +65,16 @@ export const indexFields: INodeProperties[] = [ default: {}, displayOptions: { show: { - resource: [ - 'index', - ], - operation: [ - 'create', - ], + resource: ['index'], + operation: ['create'], }, }, options: [ { displayName: 'Aliases', name: 'aliases', - description: 'Index aliases which include the index, as an alias object', + description: + 'Index aliases which include the index, as an alias object', type: 'json', typeOptions: { alwaysOpenEditWindow: true, @@ -96,14 +85,16 @@ export const indexFields: INodeProperties[] = [ { displayName: 'Include Type Name', name: 'include_type_name', - description: 'Whether a mapping type is expected in the body of mappings. Defaults to false.', + description: + 'Whether a mapping type is expected in the body of mappings. Defaults to false.', type: 'boolean', default: false, }, { displayName: 'Mappings', name: 'mappings', - description: 'Mapping for fields in the index, as mapping object', + description: + 'Mapping for fields in the index, as mapping object', type: 'json', typeOptions: { alwaysOpenEditWindow: true, @@ -114,14 +105,16 @@ export const indexFields: INodeProperties[] = [ { displayName: 'Master Timeout', name: 'master_timeout', - description: 'Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error. Defaults to 1m. See the Elasticsearch time units reference', + description: + 'Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error. Defaults to 1m. See the Elasticsearch time units reference', type: 'string', default: '1m', }, { displayName: 'Settings', name: 'settings', - description: 'Configuration options for the index, as an index settings object', + description: + 'Configuration options for the index, as an index settings object', type: 'json', typeOptions: { alwaysOpenEditWindow: true, @@ -132,14 +125,16 @@ export const indexFields: INodeProperties[] = [ { displayName: 'Timeout', name: 'timeout', - description: 'Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. Defaults to 30s. See the Elasticsearch time units reference', + description: + 'Period to wait for a response. If no response is received before the timeout expires, the request fails and returns an error. Defaults to 30s. See the Elasticsearch time units reference', type: 'string', default: '30s', }, { displayName: 'Wait for Active Shards', name: 'wait_for_active_shards', - description: 'The number of shard copies that must be active before proceeding with the operation. Set to all or any positive integer up to the total number of shards in the index. Default: 1, the primary shard', + description: + 'The number of shard copies that must be active before proceeding with the operation. Set to all or any positive integer up to the total number of shards in the index. Default: 1, the primary shard', type: 'string', default: '1', }, @@ -158,12 +153,8 @@ export const indexFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'index', - ], - operation: [ - 'delete', - ], + resource: ['index'], + operation: ['delete'], }, }, }, @@ -180,12 +171,8 @@ export const indexFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'index', - ], - operation: [ - 'get', - ], + resource: ['index'], + operation: ['get'], }, }, }, @@ -197,12 +184,8 @@ export const indexFields: INodeProperties[] = [ default: {}, displayOptions: { show: { - resource: [ - 'index', - ], - operation: [ - 'get', - ], + resource: ['index'], + operation: ['get'], }, }, options: [ @@ -210,14 +193,16 @@ export const indexFields: INodeProperties[] = [ displayName: 'Allow No Indices', name: 'allow_no_indices', // eslint-disable-next-line n8n-nodes-base/node-param-description-boolean-without-whether - description: 'If false, return an error if any of the following targets only missing/closed indices: wildcard expression, index alias, or _all value. Defaults to true.', + description: + 'If false, return an error if any of the following targets only missing/closed indices: wildcard expression, index alias, or _all value. Defaults to true.', type: 'boolean', default: true, }, { displayName: 'Expand Wildcards', name: 'expand_wildcards', - description: 'Type of index that wildcard expressions can match. Defaults to open', + description: + 'Type of index that wildcard expressions can match. Defaults to open', type: 'options', options: [ { @@ -253,7 +238,8 @@ export const indexFields: INodeProperties[] = [ { displayName: 'Ignore Unavailable', name: 'ignore_unavailable', - description: 'Whether to request that target a missing index return an error. Defaults to false.', + description: + 'Whether to request that target a missing index return an error. Defaults to false.', type: 'boolean', default: false, }, @@ -274,7 +260,8 @@ export const indexFields: INodeProperties[] = [ { displayName: 'Master Timeout', name: 'master_timeout', - description: 'Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error. Defaults to 1m. See the Elasticsearch time units reference', + description: + 'Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error. Defaults to 1m. See the Elasticsearch time units reference', type: 'string', default: '1m', }, @@ -292,12 +279,8 @@ export const indexFields: INodeProperties[] = [ description: 'Whether to return all results or only up to a given limit', displayOptions: { show: { - resource: [ - 'index', - ], - operation: [ - 'getAll', - ], + resource: ['index'], + operation: ['getAll'], }, }, }, @@ -312,15 +295,9 @@ export const indexFields: INodeProperties[] = [ }, displayOptions: { show: { - resource: [ - 'index', - ], - operation: [ - 'getAll', - ], - returnAll: [ - false, - ], + resource: ['index'], + operation: ['getAll'], + returnAll: [false], }, }, }, diff --git a/packages/nodes-base/nodes/Freshservice/descriptions/AgentDescription.ts b/packages/nodes-base/nodes/Freshservice/descriptions/AgentDescription.ts index 53c5fe8b3a6ef..7ece71a69096b 100644 --- a/packages/nodes-base/nodes/Freshservice/descriptions/AgentDescription.ts +++ b/packages/nodes-base/nodes/Freshservice/descriptions/AgentDescription.ts @@ -1,10 +1,6 @@ -import { - INodeProperties, -} from 'n8n-workflow'; +import { INodeProperties } from 'n8n-workflow'; -import { - LANGUAGES, -} from '../constants'; +import { LANGUAGES } from '../constants'; export const agentOperations: INodeProperties[] = [ { @@ -14,9 +10,7 @@ export const agentOperations: INodeProperties[] = [ noDataExpression: true, displayOptions: { show: { - resource: [ - 'agent', - ], + resource: ['agent'], }, }, options: [ @@ -68,12 +62,8 @@ export const agentFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'agent', - ], - operation: [ - 'create', - ], + resource: ['agent'], + operation: ['create'], }, }, }, @@ -85,12 +75,8 @@ export const agentFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'agent', - ], - operation: [ - 'create', - ], + resource: ['agent'], + operation: ['create'], }, }, }, @@ -107,12 +93,8 @@ export const agentFields: INodeProperties[] = [ default: {}, displayOptions: { show: { - resource: [ - 'agent', - ], - operation: [ - 'create', - ], + resource: ['agent'], + operation: ['create'], }, }, options: [ @@ -123,7 +105,8 @@ export const agentFields: INodeProperties[] = [ { displayName: 'Role Name or ID', name: 'role', - description: 'Name of the role to assign to the agent. Choose from the list, or specify an ID using an expression.', + description: + 'Name of the role to assign to the agent. Choose from the list, or specify an ID using an expression.', type: 'options', typeOptions: { loadOptionsMethod: 'getAgentRoles', @@ -160,7 +143,8 @@ export const agentFields: INodeProperties[] = [ { displayName: 'Group Names or IDs', name: 'groups', - description: 'Groups in which the permissions granted by the role apply. Required only when Scope is Specified Groups - ignored otherwise. Choose from the list or specify an ID using an expression. Choose from the list, or specify IDs using an expression.', + description: + 'Groups in which the permissions granted by the role apply. Required only when Scope is Specified Groups - ignored otherwise. Choose from the list or specify an ID using an expression. Choose from the list, or specify IDs using an expression.', type: 'multiOptions', typeOptions: { loadOptionsMethod: 'getAgentGroups', @@ -179,12 +163,8 @@ export const agentFields: INodeProperties[] = [ default: {}, displayOptions: { show: { - resource: [ - 'agent', - ], - operation: [ - 'create', - ], + resource: ['agent'], + operation: ['create'], }, }, options: [ @@ -205,7 +185,8 @@ export const agentFields: INodeProperties[] = [ name: 'department_ids', type: 'multiOptions', default: [], - description: 'IDs of the departments to which the agent belongs. Choose from the list or specify an ID using an expression. Choose from the list, or specify IDs using an expression.', + description: + 'IDs of the departments to which the agent belongs. Choose from the list or specify an ID using an expression. Choose from the list, or specify IDs using an expression.', typeOptions: { loadOptionsMethod: 'getDepartments', }, @@ -234,7 +215,8 @@ export const agentFields: INodeProperties[] = [ name: 'location_id', type: 'options', default: '', - description: 'Choose from the list, or specify an ID using an expression', + description: + 'Choose from the list, or specify an ID using an expression', typeOptions: { loadOptionsMethod: 'getLocations', }, @@ -245,7 +227,8 @@ export const agentFields: INodeProperties[] = [ name: 'member_of', type: 'multiOptions', default: [], - description: 'Comma-separated IDs of the groups that the agent is a member of. Choose from the list or specify an ID using an expression. Choose from the list, or specify IDs using an expression.', + description: + 'Comma-separated IDs of the groups that the agent is a member of. Choose from the list or specify an ID using an expression. Choose from the list, or specify IDs using an expression.', typeOptions: { loadOptionsMethod: 'getAgentGroups', }, @@ -262,7 +245,8 @@ export const agentFields: INodeProperties[] = [ name: 'observer_of', type: 'multiOptions', default: [], - description: 'Comma-separated IDs of the groups that the agent is an observer of. Choose from the list or specify an ID using an expression. Choose from the list, or specify IDs using an expression.', + description: + 'Comma-separated IDs of the groups that the agent is an observer of. Choose from the list or specify an ID using an expression. Choose from the list, or specify IDs using an expression.', typeOptions: { loadOptionsMethod: 'getAgentGroups', }, @@ -338,12 +322,8 @@ export const agentFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'agent', - ], - operation: [ - 'delete', - ], + resource: ['agent'], + operation: ['delete'], }, }, }, @@ -360,12 +340,8 @@ export const agentFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'agent', - ], - operation: [ - 'get', - ], + resource: ['agent'], + operation: ['get'], }, }, }, @@ -381,12 +357,8 @@ export const agentFields: INodeProperties[] = [ description: 'Whether to return all results or only up to a given limit', displayOptions: { show: { - resource: [ - 'agent', - ], - operation: [ - 'getAll', - ], + resource: ['agent'], + operation: ['getAll'], }, }, }, @@ -401,15 +373,9 @@ export const agentFields: INodeProperties[] = [ }, displayOptions: { show: { - resource: [ - 'agent', - ], - operation: [ - 'getAll', - ], - returnAll: [ - false, - ], + resource: ['agent'], + operation: ['getAll'], + returnAll: [false], }, }, }, @@ -421,12 +387,8 @@ export const agentFields: INodeProperties[] = [ default: {}, displayOptions: { show: { - resource: [ - 'agent', - ], - operation: [ - 'getAll', - ], + resource: ['agent'], + operation: ['getAll'], }, }, options: [ @@ -435,7 +397,8 @@ export const agentFields: INodeProperties[] = [ name: 'department_id', type: 'options', default: '', - description: 'ID of the department to which the agent belongs. Choose from the list, or specify an ID using an expression.', + description: + 'ID of the department to which the agent belongs. Choose from the list, or specify an ID using an expression.', typeOptions: { loadOptionsMethod: 'getDepartments', }, @@ -477,7 +440,8 @@ export const agentFields: INodeProperties[] = [ name: 'location_id', type: 'options', default: '', - description: 'Choose from the list or specify an ID. Choose from the list, or specify an ID using an expression.', + description: + 'Choose from the list or specify an ID. Choose from the list, or specify an ID using an expression.', typeOptions: { loadOptionsMethod: 'getLocations', }, @@ -509,12 +473,8 @@ export const agentFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'agent', - ], - operation: [ - 'update', - ], + resource: ['agent'], + operation: ['update'], }, }, }, @@ -526,12 +486,8 @@ export const agentFields: INodeProperties[] = [ default: {}, displayOptions: { show: { - resource: [ - 'agent', - ], - operation: [ - 'update', - ], + resource: ['agent'], + operation: ['update'], }, }, options: [ @@ -552,7 +508,8 @@ export const agentFields: INodeProperties[] = [ name: 'department_ids', type: 'multiOptions', default: [], - description: 'IDs of the departments to which the agent belongs. Choose from the list or specify an ID using an expression. Choose from the list, or specify IDs using an expression.', + description: + 'IDs of the departments to which the agent belongs. Choose from the list or specify an ID using an expression. Choose from the list, or specify IDs using an expression.', typeOptions: { loadOptionsMethod: 'getDepartments', }, @@ -594,7 +551,8 @@ export const agentFields: INodeProperties[] = [ name: 'location_id', type: 'options', default: '', - description: 'Choose from the list or specify an ID. Choose from the list, or specify an ID using an expression.', + description: + 'Choose from the list or specify an ID. Choose from the list, or specify an ID using an expression.', typeOptions: { loadOptionsMethod: 'getLocations', }, @@ -605,7 +563,8 @@ export const agentFields: INodeProperties[] = [ name: 'member_of', type: 'multiOptions', default: [], - description: 'Comma-separated IDs of the groups that the agent is a member of. Choose from the list or specify an ID using an expression. Choose from the list, or specify IDs using an expression.', + description: + 'Comma-separated IDs of the groups that the agent is a member of. Choose from the list or specify an ID using an expression. Choose from the list, or specify IDs using an expression.', typeOptions: { loadOptionsMethod: 'getAgentGroups', }, @@ -622,7 +581,8 @@ export const agentFields: INodeProperties[] = [ name: 'observer_of', type: 'multiOptions', default: [], - description: 'Comma-separated IDs of the groups that the agent is an observer of. Choose from the list or specify an ID using an expression. Choose from the list, or specify IDs using an expression.', + description: + 'Comma-separated IDs of the groups that the agent is an observer of. Choose from the list or specify an ID using an expression. Choose from the list, or specify IDs using an expression.', typeOptions: { loadOptionsMethod: 'getAgentGroups', }, diff --git a/packages/nodes-base/nodes/Freshservice/descriptions/AgentGroupDescription.ts b/packages/nodes-base/nodes/Freshservice/descriptions/AgentGroupDescription.ts index 0b522b61471e9..f1c70913e100c 100644 --- a/packages/nodes-base/nodes/Freshservice/descriptions/AgentGroupDescription.ts +++ b/packages/nodes-base/nodes/Freshservice/descriptions/AgentGroupDescription.ts @@ -1,6 +1,4 @@ -import { - INodeProperties, -} from 'n8n-workflow'; +import { INodeProperties } from 'n8n-workflow'; export const agentGroupOperations: INodeProperties[] = [ { @@ -10,9 +8,7 @@ export const agentGroupOperations: INodeProperties[] = [ noDataExpression: true, displayOptions: { show: { - resource: [ - 'agentGroup', - ], + resource: ['agentGroup'], }, }, options: [ @@ -63,12 +59,8 @@ export const agentGroupFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'agentGroup', - ], - operation: [ - 'create', - ], + resource: ['agentGroup'], + operation: ['create'], }, }, }, @@ -80,12 +72,8 @@ export const agentGroupFields: INodeProperties[] = [ default: {}, displayOptions: { show: { - resource: [ - 'agentGroup', - ], - operation: [ - 'create', - ], + resource: ['agentGroup'], + operation: ['create'], }, }, options: [ @@ -103,14 +91,16 @@ export const agentGroupFields: INodeProperties[] = [ typeOptions: { loadOptionsMethod: 'getAgents', }, - description: 'ID of the user to whom an escalation email is sent if a ticket in this group is unassigned. Choose from the list, or specify an ID using an expression.', + description: + 'ID of the user to whom an escalation email is sent if a ticket in this group is unassigned. Choose from the list, or specify an ID using an expression.', }, { displayName: 'Member Names or IDs', name: 'members', type: 'multiOptions', default: [], - description: 'Comma-separated IDs of agents who are members of this group. Choose from the list or specify an ID using an expression. Choose from the list, or specify IDs using an expression.', + description: + 'Comma-separated IDs of agents who are members of this group. Choose from the list or specify an ID using an expression. Choose from the list, or specify IDs using an expression.', typeOptions: { loadOptionsMethod: 'getAgents', }, @@ -120,7 +110,8 @@ export const agentGroupFields: INodeProperties[] = [ name: 'observers', type: 'multiOptions', default: [], - description: 'Comma-separated agent IDs who are observers of this group. Choose from the list or specify an ID using an expression. Choose from the list, or specify IDs using an expression.', + description: + 'Comma-separated agent IDs who are observers of this group. Choose from the list or specify an ID using an expression. Choose from the list, or specify IDs using an expression.', typeOptions: { loadOptionsMethod: 'getAgents', }, @@ -128,7 +119,8 @@ export const agentGroupFields: INodeProperties[] = [ { displayName: 'Unassigned For', name: 'unassigned_for', - description: 'Time after which an escalation email is sent if a ticket in the group remains unassigned', + description: + 'Time after which an escalation email is sent if a ticket in the group remains unassigned', type: 'options', default: '30m', options: [ @@ -181,12 +173,8 @@ export const agentGroupFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'agentGroup', - ], - operation: [ - 'delete', - ], + resource: ['agentGroup'], + operation: ['delete'], }, }, }, @@ -203,12 +191,8 @@ export const agentGroupFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'agentGroup', - ], - operation: [ - 'get', - ], + resource: ['agentGroup'], + operation: ['get'], }, }, }, @@ -224,12 +208,8 @@ export const agentGroupFields: INodeProperties[] = [ description: 'Whether to return all results or only up to a given limit', displayOptions: { show: { - resource: [ - 'agentGroup', - ], - operation: [ - 'getAll', - ], + resource: ['agentGroup'], + operation: ['getAll'], }, }, }, @@ -244,15 +224,9 @@ export const agentGroupFields: INodeProperties[] = [ }, displayOptions: { show: { - resource: [ - 'agentGroup', - ], - operation: [ - 'getAll', - ], - returnAll: [ - false, - ], + resource: ['agentGroup'], + operation: ['getAll'], + returnAll: [false], }, }, }, @@ -269,12 +243,8 @@ export const agentGroupFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'agentGroup', - ], - operation: [ - 'update', - ], + resource: ['agentGroup'], + operation: ['update'], }, }, }, @@ -286,12 +256,8 @@ export const agentGroupFields: INodeProperties[] = [ default: {}, displayOptions: { show: { - resource: [ - 'agentGroup', - ], - operation: [ - 'update', - ], + resource: ['agentGroup'], + operation: ['update'], }, }, options: [ @@ -306,7 +272,8 @@ export const agentGroupFields: INodeProperties[] = [ name: 'escalate_to', type: 'options', default: '', - description: 'ID of the agent to whom an escalation email is sent if a ticket in this group is unassigned. Choose from the list, or specify an ID using an expression.', + description: + 'ID of the agent to whom an escalation email is sent if a ticket in this group is unassigned. Choose from the list, or specify an ID using an expression.', typeOptions: { loadOptionsMethod: 'getAgents', }, @@ -316,7 +283,8 @@ export const agentGroupFields: INodeProperties[] = [ name: 'members', type: 'multiOptions', default: [], - description: 'Comma-separated IDs of agents who are members of this group. Choose from the list or specify an ID using an expression. Choose from the list, or specify IDs using an expression.', + description: + 'Comma-separated IDs of agents who are members of this group. Choose from the list or specify an ID using an expression. Choose from the list, or specify IDs using an expression.', typeOptions: { loadOptionsMethod: 'getAgents', }, @@ -332,7 +300,8 @@ export const agentGroupFields: INodeProperties[] = [ name: 'observers', type: 'multiOptions', default: [], - description: 'Comma-separated agent user IDs who are observers of this group. Choose from the list or specify an ID using an expression. Choose from the list, or specify IDs using an expression.', + description: + 'Comma-separated agent user IDs who are observers of this group. Choose from the list or specify an ID using an expression. Choose from the list, or specify IDs using an expression.', typeOptions: { loadOptionsMethod: 'getAgents', }, @@ -340,7 +309,8 @@ export const agentGroupFields: INodeProperties[] = [ { displayName: 'Unassigned For', name: 'unassigned_for', - description: 'Time after which an escalation email is sent if a ticket in the group remains unassigned', + description: + 'Time after which an escalation email is sent if a ticket in the group remains unassigned', type: 'options', default: '30m', options: [ diff --git a/packages/nodes-base/nodes/Freshservice/descriptions/AgentRoleDescription.ts b/packages/nodes-base/nodes/Freshservice/descriptions/AgentRoleDescription.ts index f18c8a420cbce..27c6879d10d4d 100644 --- a/packages/nodes-base/nodes/Freshservice/descriptions/AgentRoleDescription.ts +++ b/packages/nodes-base/nodes/Freshservice/descriptions/AgentRoleDescription.ts @@ -1,6 +1,4 @@ -import { - INodeProperties, -} from 'n8n-workflow'; +import { INodeProperties } from 'n8n-workflow'; export const agentRoleOperations: INodeProperties[] = [ { @@ -10,9 +8,7 @@ export const agentRoleOperations: INodeProperties[] = [ noDataExpression: true, displayOptions: { show: { - resource: [ - 'agentRole', - ], + resource: ['agentRole'], }, }, options: [ @@ -46,12 +42,8 @@ export const agentRoleFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'agentRole', - ], - operation: [ - 'get', - ], + resource: ['agentRole'], + operation: ['get'], }, }, }, @@ -67,12 +59,8 @@ export const agentRoleFields: INodeProperties[] = [ description: 'Whether to return all results or only up to a given limit', displayOptions: { show: { - resource: [ - 'agentRole', - ], - operation: [ - 'getAll', - ], + resource: ['agentRole'], + operation: ['getAll'], }, }, }, @@ -87,15 +75,9 @@ export const agentRoleFields: INodeProperties[] = [ }, displayOptions: { show: { - resource: [ - 'agentRole', - ], - operation: [ - 'getAll', - ], - returnAll: [ - false, - ], + resource: ['agentRole'], + operation: ['getAll'], + returnAll: [false], }, }, }, diff --git a/packages/nodes-base/nodes/Freshservice/descriptions/AnnouncementDescription.ts b/packages/nodes-base/nodes/Freshservice/descriptions/AnnouncementDescription.ts index ccb5d4b7cbe3e..27178c1f22069 100644 --- a/packages/nodes-base/nodes/Freshservice/descriptions/AnnouncementDescription.ts +++ b/packages/nodes-base/nodes/Freshservice/descriptions/AnnouncementDescription.ts @@ -1,6 +1,4 @@ -import { - INodeProperties, -} from 'n8n-workflow'; +import { INodeProperties } from 'n8n-workflow'; export const announcementOperations: INodeProperties[] = [ { @@ -10,9 +8,7 @@ export const announcementOperations: INodeProperties[] = [ noDataExpression: true, displayOptions: { show: { - resource: [ - 'announcement', - ], + resource: ['announcement'], }, }, options: [ @@ -63,12 +59,8 @@ export const announcementFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'announcement', - ], - operation: [ - 'create', - ], + resource: ['announcement'], + operation: ['create'], }, }, }, @@ -81,12 +73,8 @@ export const announcementFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'announcement', - ], - operation: [ - 'create', - ], + resource: ['announcement'], + operation: ['create'], }, }, }, @@ -112,12 +100,8 @@ export const announcementFields: INodeProperties[] = [ ], displayOptions: { show: { - resource: [ - 'announcement', - ], - operation: [ - 'create', - ], + resource: ['announcement'], + operation: ['create'], }, }, }, @@ -130,12 +114,8 @@ export const announcementFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'announcement', - ], - operation: [ - 'create', - ], + resource: ['announcement'], + operation: ['create'], }, }, }, @@ -147,12 +127,8 @@ export const announcementFields: INodeProperties[] = [ default: {}, displayOptions: { show: { - resource: [ - 'announcement', - ], - operation: [ - 'create', - ], + resource: ['announcement'], + operation: ['create'], }, }, options: [ @@ -161,14 +137,16 @@ export const announcementFields: INodeProperties[] = [ name: 'additional_emails', type: 'string', default: '', - description: 'Comma-separated additional email addresses to which the announcement needs to be sent', + description: + 'Comma-separated additional email addresses to which the announcement needs to be sent', }, { displayName: 'Department Names or IDs', name: 'departments', type: 'multiOptions', default: [], - description: 'Comma-separated IDs of departments that may view this announcement. Choose from the list or specify an ID using an expression. Choose from the list, or specify IDs using an expression.', + description: + 'Comma-separated IDs of departments that may view this announcement. Choose from the list or specify an ID using an expression. Choose from the list, or specify IDs using an expression.', typeOptions: { loadOptionsMethod: 'getDepartments', }, @@ -202,12 +180,8 @@ export const announcementFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'announcement', - ], - operation: [ - 'delete', - ], + resource: ['announcement'], + operation: ['delete'], }, }, }, @@ -224,12 +198,8 @@ export const announcementFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'announcement', - ], - operation: [ - 'get', - ], + resource: ['announcement'], + operation: ['get'], }, }, }, @@ -245,12 +215,8 @@ export const announcementFields: INodeProperties[] = [ description: 'Whether to return all results or only up to a given limit', displayOptions: { show: { - resource: [ - 'announcement', - ], - operation: [ - 'getAll', - ], + resource: ['announcement'], + operation: ['getAll'], }, }, }, @@ -265,15 +231,9 @@ export const announcementFields: INodeProperties[] = [ }, displayOptions: { show: { - resource: [ - 'announcement', - ], - operation: [ - 'getAll', - ], - returnAll: [ - false, - ], + resource: ['announcement'], + operation: ['getAll'], + returnAll: [false], }, }, }, @@ -290,12 +250,8 @@ export const announcementFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'announcement', - ], - operation: [ - 'update', - ], + resource: ['announcement'], + operation: ['update'], }, }, }, @@ -307,12 +263,8 @@ export const announcementFields: INodeProperties[] = [ default: {}, displayOptions: { show: { - resource: [ - 'announcement', - ], - operation: [ - 'update', - ], + resource: ['announcement'], + operation: ['update'], }, }, options: [ @@ -321,7 +273,8 @@ export const announcementFields: INodeProperties[] = [ name: 'additional_emails', type: 'string', default: '', - description: 'Comma-separated additional email addresses to which the announcement needs to be sent', + description: + 'Comma-separated additional email addresses to which the announcement needs to be sent', }, { displayName: 'Body', @@ -335,7 +288,8 @@ export const announcementFields: INodeProperties[] = [ name: 'departments', type: 'multiOptions', default: [], - description: 'Comma-separated IDs of departments that may view this announcement. Choose from the list or specify an ID using an expression. Choose from the list, or specify IDs using an expression.', + description: + 'Comma-separated IDs of departments that may view this announcement. Choose from the list or specify an ID using an expression. Choose from the list, or specify IDs using an expression.', typeOptions: { loadOptionsMethod: 'getDepartments', }, diff --git a/packages/nodes-base/nodes/Freshservice/descriptions/AssetDescription.ts b/packages/nodes-base/nodes/Freshservice/descriptions/AssetDescription.ts index 25246bdfa6820..e79d8cc2b6ded 100644 --- a/packages/nodes-base/nodes/Freshservice/descriptions/AssetDescription.ts +++ b/packages/nodes-base/nodes/Freshservice/descriptions/AssetDescription.ts @@ -1,6 +1,4 @@ -import { - INodeProperties, -} from 'n8n-workflow'; +import { INodeProperties } from 'n8n-workflow'; export const assetOperations: INodeProperties[] = [ { @@ -10,9 +8,7 @@ export const assetOperations: INodeProperties[] = [ noDataExpression: true, displayOptions: { show: { - resource: [ - 'asset', - ], + resource: ['asset'], }, }, options: [ @@ -63,12 +59,8 @@ export const assetFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'asset', - ], - operation: [ - 'create', - ], + resource: ['asset'], + operation: ['create'], }, }, }, @@ -76,7 +68,8 @@ export const assetFields: INodeProperties[] = [ displayName: 'Asset Type Name or ID', name: 'assetTypeId', type: 'options', - description: 'Choose from the list, or specify an ID using an expression', + description: + 'Choose from the list, or specify an ID using an expression', required: true, default: '', typeOptions: { @@ -84,12 +77,8 @@ export const assetFields: INodeProperties[] = [ }, displayOptions: { show: { - resource: [ - 'asset', - ], - operation: [ - 'create', - ], + resource: ['asset'], + operation: ['create'], }, }, }, @@ -103,12 +92,8 @@ export const assetFields: INodeProperties[] = [ }, displayOptions: { show: { - resource: [ - 'asset', - ], - operation: [ - 'create', - ], + resource: ['asset'], + operation: ['create'], }, }, default: {}, @@ -122,13 +107,12 @@ export const assetFields: INodeProperties[] = [ name: 'name', type: 'options', typeOptions: { - loadOptionsDependsOn: [ - 'assetTypeId', - ], + loadOptionsDependsOn: ['assetTypeId'], loadOptionsMethod: 'getAssetTypeFields', }, default: '', - description: 'The ID of the field to add custom field to. Choose from the list, or specify an ID using an expression.', + description: + 'The ID of the field to add custom field to. Choose from the list, or specify an ID using an expression.', }, { displayName: 'Value', @@ -153,12 +137,8 @@ export const assetFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'asset', - ], - operation: [ - 'delete', - ], + resource: ['asset'], + operation: ['delete'], }, }, }, @@ -175,12 +155,8 @@ export const assetFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'asset', - ], - operation: [ - 'get', - ], + resource: ['asset'], + operation: ['get'], }, }, }, @@ -196,12 +172,8 @@ export const assetFields: INodeProperties[] = [ description: 'Whether to return all results or only up to a given limit', displayOptions: { show: { - resource: [ - 'asset', - ], - operation: [ - 'getAll', - ], + resource: ['asset'], + operation: ['getAll'], }, }, }, @@ -216,15 +188,9 @@ export const assetFields: INodeProperties[] = [ }, displayOptions: { show: { - resource: [ - 'asset', - ], - operation: [ - 'getAll', - ], - returnAll: [ - false, - ], + resource: ['asset'], + operation: ['getAll'], + returnAll: [false], }, }, }, @@ -236,12 +202,8 @@ export const assetFields: INodeProperties[] = [ default: {}, displayOptions: { show: { - resource: [ - 'asset', - ], - operation: [ - 'getAll', - ], + resource: ['asset'], + operation: ['getAll'], }, }, options: [ @@ -250,7 +212,8 @@ export const assetFields: INodeProperties[] = [ name: 'agent_id', type: 'options', default: '', - description: 'ID of the agent by whom the asset is managed. Choose from the list, or specify an ID using an expression.', + description: + 'ID of the agent by whom the asset is managed. Choose from the list, or specify an ID using an expression.', typeOptions: { loadOptionsMethod: 'getAgents', }, @@ -267,7 +230,8 @@ export const assetFields: INodeProperties[] = [ name: 'asset_type_id', type: 'options', default: '', - description: 'ID of the asset type to filter by. Choose from the list, or specify an ID using an expression.', + description: + 'ID of the asset type to filter by. Choose from the list, or specify an ID using an expression.', typeOptions: { loadOptionsMethod: 'getAssetTypes', }, @@ -277,7 +241,8 @@ export const assetFields: INodeProperties[] = [ name: 'department_id', type: 'options', default: '', - description: 'ID of the department to which the asset belongs. Choose from the list, or specify an ID using an expression.', + description: + 'ID of the department to which the asset belongs. Choose from the list, or specify an ID using an expression.', typeOptions: { loadOptionsMethod: 'getDepartments', }, @@ -287,7 +252,8 @@ export const assetFields: INodeProperties[] = [ name: 'location_id', type: 'options', default: '', - description: 'ID of the location to filter by. Choose from the list, or specify an ID using an expression.', + description: + 'ID of the location to filter by. Choose from the list, or specify an ID using an expression.', typeOptions: { loadOptionsMethod: 'getLocations', }, @@ -314,12 +280,8 @@ export const assetFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'asset', - ], - operation: [ - 'update', - ], + resource: ['asset'], + operation: ['update'], }, }, }, @@ -333,12 +295,8 @@ export const assetFields: INodeProperties[] = [ }, displayOptions: { show: { - resource: [ - 'asset', - ], - operation: [ - 'update', - ], + resource: ['asset'], + operation: ['update'], }, }, default: {}, @@ -352,13 +310,12 @@ export const assetFields: INodeProperties[] = [ name: 'name', type: 'options', typeOptions: { - loadOptionsDependsOn: [ - 'assetTypeId', - ], + loadOptionsDependsOn: ['assetTypeId'], loadOptionsMethod: 'getAssetTypeFields', }, default: '', - description: 'The ID of the field to add custom field to. Choose from the list, or specify an ID using an expression.', + description: + 'The ID of the field to add custom field to. Choose from the list, or specify an ID using an expression.', }, { displayName: 'Value', diff --git a/packages/nodes-base/nodes/Freshservice/descriptions/AssetTypeDescription.ts b/packages/nodes-base/nodes/Freshservice/descriptions/AssetTypeDescription.ts index 1be79ef1d5686..a683b651d1634 100644 --- a/packages/nodes-base/nodes/Freshservice/descriptions/AssetTypeDescription.ts +++ b/packages/nodes-base/nodes/Freshservice/descriptions/AssetTypeDescription.ts @@ -1,6 +1,4 @@ -import { - INodeProperties, -} from 'n8n-workflow'; +import { INodeProperties } from 'n8n-workflow'; export const assetTypeOperations: INodeProperties[] = [ { @@ -10,9 +8,7 @@ export const assetTypeOperations: INodeProperties[] = [ noDataExpression: true, displayOptions: { show: { - resource: [ - 'assetType', - ], + resource: ['assetType'], }, }, options: [ @@ -63,12 +59,8 @@ export const assetTypeFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'assetType', - ], - operation: [ - 'create', - ], + resource: ['assetType'], + operation: ['create'], }, }, }, @@ -80,12 +72,8 @@ export const assetTypeFields: INodeProperties[] = [ default: {}, displayOptions: { show: { - resource: [ - 'assetType', - ], - operation: [ - 'create', - ], + resource: ['assetType'], + operation: ['create'], }, }, options: [ @@ -98,7 +86,8 @@ export const assetTypeFields: INodeProperties[] = [ { displayName: 'Parent Asset Type Name or ID', name: 'parent_asset_type_id', - description: 'Choose from the list, or specify an ID using an expression', + description: + 'Choose from the list, or specify an ID using an expression', type: 'options', default: '', typeOptions: { @@ -120,12 +109,8 @@ export const assetTypeFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'assetType', - ], - operation: [ - 'delete', - ], + resource: ['assetType'], + operation: ['delete'], }, }, }, @@ -142,12 +127,8 @@ export const assetTypeFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'assetType', - ], - operation: [ - 'get', - ], + resource: ['assetType'], + operation: ['get'], }, }, }, @@ -163,12 +144,8 @@ export const assetTypeFields: INodeProperties[] = [ description: 'Whether to return all results or only up to a given limit', displayOptions: { show: { - resource: [ - 'assetType', - ], - operation: [ - 'getAll', - ], + resource: ['assetType'], + operation: ['getAll'], }, }, }, @@ -183,15 +160,9 @@ export const assetTypeFields: INodeProperties[] = [ }, displayOptions: { show: { - resource: [ - 'assetType', - ], - operation: [ - 'getAll', - ], - returnAll: [ - false, - ], + resource: ['assetType'], + operation: ['getAll'], + returnAll: [false], }, }, }, @@ -208,12 +179,8 @@ export const assetTypeFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'assetType', - ], - operation: [ - 'update', - ], + resource: ['assetType'], + operation: ['update'], }, }, }, @@ -225,12 +192,8 @@ export const assetTypeFields: INodeProperties[] = [ default: {}, displayOptions: { show: { - resource: [ - 'assetType', - ], - operation: [ - 'update', - ], + resource: ['assetType'], + operation: ['update'], }, }, options: [ diff --git a/packages/nodes-base/nodes/Freshservice/descriptions/ChangeDescription.ts b/packages/nodes-base/nodes/Freshservice/descriptions/ChangeDescription.ts index 73aaf4bda20bf..1800b21213bca 100644 --- a/packages/nodes-base/nodes/Freshservice/descriptions/ChangeDescription.ts +++ b/packages/nodes-base/nodes/Freshservice/descriptions/ChangeDescription.ts @@ -1,6 +1,4 @@ -import { - INodeProperties, -} from 'n8n-workflow'; +import { INodeProperties } from 'n8n-workflow'; export const changeOperations: INodeProperties[] = [ { @@ -10,9 +8,7 @@ export const changeOperations: INodeProperties[] = [ noDataExpression: true, displayOptions: { show: { - resource: [ - 'change', - ], + resource: ['change'], }, }, options: [ @@ -59,7 +55,8 @@ export const changeFields: INodeProperties[] = [ displayName: 'Requester Name or ID', name: 'requesterId', // eslint-disable-next-line n8n-nodes-base/node-param-description-wrong-for-dynamic-options - description: 'ID of the requester of the change. Choose from the list or specify an ID. You can also specify the ID using an expression.', + description: + 'ID of the requester of the change. Choose from the list or specify an ID. You can also specify the ID using an expression.', type: 'options', required: true, default: '', @@ -68,12 +65,8 @@ export const changeFields: INodeProperties[] = [ }, displayOptions: { show: { - resource: [ - 'change', - ], - operation: [ - 'create', - ], + resource: ['change'], + operation: ['create'], }, }, }, @@ -85,12 +78,8 @@ export const changeFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'change', - ], - operation: [ - 'create', - ], + resource: ['change'], + operation: ['create'], }, }, }, @@ -102,12 +91,8 @@ export const changeFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'change', - ], - operation: [ - 'create', - ], + resource: ['change'], + operation: ['create'], }, }, }, @@ -119,12 +104,8 @@ export const changeFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'change', - ], - operation: [ - 'create', - ], + resource: ['change'], + operation: ['create'], }, }, }, @@ -136,12 +117,8 @@ export const changeFields: INodeProperties[] = [ default: {}, displayOptions: { show: { - resource: [ - 'change', - ], - operation: [ - 'create', - ], + resource: ['change'], + operation: ['create'], }, }, options: [ @@ -150,7 +127,8 @@ export const changeFields: INodeProperties[] = [ name: 'agent_id', type: 'options', default: '', - description: 'ID of the agent to whom the change is assigned. Choose from the list, or specify an ID using an expression.', + description: + 'ID of the agent to whom the change is assigned. Choose from the list, or specify an ID using an expression.', typeOptions: { loadOptionsMethod: 'getAgents', }, @@ -184,7 +162,8 @@ export const changeFields: INodeProperties[] = [ name: 'department_id', type: 'options', default: '', - description: 'ID of the department requesting the change. Choose from the list, or specify an ID using an expression.', + description: + 'ID of the department requesting the change. Choose from the list, or specify an ID using an expression.', typeOptions: { loadOptionsMethod: 'getDepartments', }, @@ -201,7 +180,8 @@ export const changeFields: INodeProperties[] = [ name: 'group_id', type: 'options', default: '', - description: 'ID of the agent group to which the change is assigned. Choose from the list, or specify an ID using an expression.', + description: + 'ID of the agent group to which the change is assigned. Choose from the list, or specify an ID using an expression.', typeOptions: { loadOptionsMethod: 'getAgentGroups', }, @@ -328,12 +308,8 @@ export const changeFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'change', - ], - operation: [ - 'delete', - ], + resource: ['change'], + operation: ['delete'], }, }, }, @@ -350,12 +326,8 @@ export const changeFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'change', - ], - operation: [ - 'get', - ], + resource: ['change'], + operation: ['get'], }, }, }, @@ -371,12 +343,8 @@ export const changeFields: INodeProperties[] = [ description: 'Whether to return all results or only up to a given limit', displayOptions: { show: { - resource: [ - 'change', - ], - operation: [ - 'getAll', - ], + resource: ['change'], + operation: ['getAll'], }, }, }, @@ -391,15 +359,9 @@ export const changeFields: INodeProperties[] = [ }, displayOptions: { show: { - resource: [ - 'change', - ], - operation: [ - 'getAll', - ], - returnAll: [ - false, - ], + resource: ['change'], + operation: ['getAll'], + returnAll: [false], }, }, }, @@ -411,12 +373,8 @@ export const changeFields: INodeProperties[] = [ default: {}, displayOptions: { show: { - resource: [ - 'change', - ], - operation: [ - 'getAll', - ], + resource: ['change'], + operation: ['getAll'], }, }, options: [ @@ -485,12 +443,8 @@ export const changeFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'change', - ], - operation: [ - 'update', - ], + resource: ['change'], + operation: ['update'], }, }, }, @@ -502,12 +456,8 @@ export const changeFields: INodeProperties[] = [ default: {}, displayOptions: { show: { - resource: [ - 'change', - ], - operation: [ - 'update', - ], + resource: ['change'], + operation: ['update'], }, }, options: [ @@ -516,7 +466,8 @@ export const changeFields: INodeProperties[] = [ name: 'agent_id', type: 'options', default: '', - description: 'ID of the agent to whom the change is assigned. Choose from the list, or specify an ID using an expression.', + description: + 'ID of the agent to whom the change is assigned. Choose from the list, or specify an ID using an expression.', typeOptions: { loadOptionsMethod: 'getAgents', }, @@ -550,7 +501,8 @@ export const changeFields: INodeProperties[] = [ name: 'department_id', type: 'options', default: '', - description: 'ID of the department requesting the change. Choose from the list, or specify an ID using an expression.', + description: + 'ID of the department requesting the change. Choose from the list, or specify an ID using an expression.', typeOptions: { loadOptionsMethod: 'getDepartments', }, @@ -567,7 +519,8 @@ export const changeFields: INodeProperties[] = [ name: 'group_id', type: 'options', default: '', - description: 'ID of the agent group to which the change is assigned. Choose from the list, or specify an ID using an expression.', + description: + 'ID of the agent group to which the change is assigned. Choose from the list, or specify an ID using an expression.', typeOptions: { loadOptionsMethod: 'getAgentGroups', }, @@ -622,7 +575,8 @@ export const changeFields: INodeProperties[] = [ name: 'requester_id', type: 'options', default: '', - description: 'ID of the requester of the change. Choose from the list, or specify an ID using an expression.', + description: + 'ID of the requester of the change. Choose from the list, or specify an ID using an expression.', typeOptions: { loadOptionsMethod: 'getRequesters', }, diff --git a/packages/nodes-base/nodes/Freshservice/descriptions/DepartmentDescription.ts b/packages/nodes-base/nodes/Freshservice/descriptions/DepartmentDescription.ts index e77b3b739e1d2..ce762b617cbce 100644 --- a/packages/nodes-base/nodes/Freshservice/descriptions/DepartmentDescription.ts +++ b/packages/nodes-base/nodes/Freshservice/descriptions/DepartmentDescription.ts @@ -1,6 +1,4 @@ -import { - INodeProperties, -} from 'n8n-workflow'; +import { INodeProperties } from 'n8n-workflow'; export const departmentOperations: INodeProperties[] = [ { @@ -10,9 +8,7 @@ export const departmentOperations: INodeProperties[] = [ noDataExpression: true, displayOptions: { show: { - resource: [ - 'department', - ], + resource: ['department'], }, }, options: [ @@ -63,12 +59,8 @@ export const departmentFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'department', - ], - operation: [ - 'create', - ], + resource: ['department'], + operation: ['create'], }, }, }, @@ -80,12 +72,8 @@ export const departmentFields: INodeProperties[] = [ default: {}, displayOptions: { show: { - resource: [ - 'department', - ], - operation: [ - 'create', - ], + resource: ['department'], + operation: ['create'], }, }, options: [ @@ -117,12 +105,8 @@ export const departmentFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'department', - ], - operation: [ - 'delete', - ], + resource: ['department'], + operation: ['delete'], }, }, }, @@ -139,12 +123,8 @@ export const departmentFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'department', - ], - operation: [ - 'get', - ], + resource: ['department'], + operation: ['get'], }, }, }, @@ -160,12 +140,8 @@ export const departmentFields: INodeProperties[] = [ description: 'Whether to return all results or only up to a given limit', displayOptions: { show: { - resource: [ - 'department', - ], - operation: [ - 'getAll', - ], + resource: ['department'], + operation: ['getAll'], }, }, }, @@ -180,15 +156,9 @@ export const departmentFields: INodeProperties[] = [ }, displayOptions: { show: { - resource: [ - 'department', - ], - operation: [ - 'getAll', - ], - returnAll: [ - false, - ], + resource: ['department'], + operation: ['getAll'], + returnAll: [false], }, }, }, @@ -200,12 +170,8 @@ export const departmentFields: INodeProperties[] = [ default: {}, displayOptions: { show: { - resource: [ - 'department', - ], - operation: [ - 'getAll', - ], + resource: ['department'], + operation: ['getAll'], }, }, options: [ @@ -231,12 +197,8 @@ export const departmentFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'department', - ], - operation: [ - 'update', - ], + resource: ['department'], + operation: ['update'], }, }, }, @@ -248,12 +210,8 @@ export const departmentFields: INodeProperties[] = [ default: {}, displayOptions: { show: { - resource: [ - 'department', - ], - operation: [ - 'update', - ], + resource: ['department'], + operation: ['update'], }, }, options: [ diff --git a/packages/nodes-base/nodes/Freshservice/descriptions/LocationDescription.ts b/packages/nodes-base/nodes/Freshservice/descriptions/LocationDescription.ts index 30e2f207575cc..3bafe487ed35e 100644 --- a/packages/nodes-base/nodes/Freshservice/descriptions/LocationDescription.ts +++ b/packages/nodes-base/nodes/Freshservice/descriptions/LocationDescription.ts @@ -1,6 +1,4 @@ -import { - INodeProperties, -} from 'n8n-workflow'; +import { INodeProperties } from 'n8n-workflow'; export const locationOperations: INodeProperties[] = [ { @@ -10,9 +8,7 @@ export const locationOperations: INodeProperties[] = [ noDataExpression: true, displayOptions: { show: { - resource: [ - 'location', - ], + resource: ['location'], }, }, options: [ @@ -64,12 +60,8 @@ export const locationFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'location', - ], - operation: [ - 'create', - ], + resource: ['location'], + operation: ['create'], }, }, }, @@ -81,12 +73,8 @@ export const locationFields: INodeProperties[] = [ default: {}, displayOptions: { show: { - resource: [ - 'location', - ], - operation: [ - 'create', - ], + resource: ['location'], + operation: ['create'], }, }, options: [ @@ -156,12 +144,8 @@ export const locationFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'location', - ], - operation: [ - 'delete', - ], + resource: ['location'], + operation: ['delete'], }, }, }, @@ -178,12 +162,8 @@ export const locationFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'location', - ], - operation: [ - 'get', - ], + resource: ['location'], + operation: ['get'], }, }, }, @@ -199,12 +179,8 @@ export const locationFields: INodeProperties[] = [ description: 'Whether to return all results or only up to a given limit', displayOptions: { show: { - resource: [ - 'location', - ], - operation: [ - 'getAll', - ], + resource: ['location'], + operation: ['getAll'], }, }, }, @@ -219,15 +195,9 @@ export const locationFields: INodeProperties[] = [ }, displayOptions: { show: { - resource: [ - 'location', - ], - operation: [ - 'getAll', - ], - returnAll: [ - false, - ], + resource: ['location'], + operation: ['getAll'], + returnAll: [false], }, }, }, @@ -244,12 +214,8 @@ export const locationFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'location', - ], - operation: [ - 'update', - ], + resource: ['location'], + operation: ['update'], }, }, }, @@ -261,12 +227,8 @@ export const locationFields: INodeProperties[] = [ default: {}, displayOptions: { show: { - resource: [ - 'location', - ], - operation: [ - 'update', - ], + resource: ['location'], + operation: ['update'], }, }, options: [ diff --git a/packages/nodes-base/nodes/Freshservice/descriptions/ProblemDescription.ts b/packages/nodes-base/nodes/Freshservice/descriptions/ProblemDescription.ts index 426c02af15704..9438974a9c76d 100644 --- a/packages/nodes-base/nodes/Freshservice/descriptions/ProblemDescription.ts +++ b/packages/nodes-base/nodes/Freshservice/descriptions/ProblemDescription.ts @@ -1,6 +1,4 @@ -import { - INodeProperties, -} from 'n8n-workflow'; +import { INodeProperties } from 'n8n-workflow'; export const problemOperations: INodeProperties[] = [ { @@ -10,9 +8,7 @@ export const problemOperations: INodeProperties[] = [ noDataExpression: true, displayOptions: { show: { - resource: [ - 'problem', - ], + resource: ['problem'], }, }, options: [ @@ -63,19 +59,16 @@ export const problemFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'problem', - ], - operation: [ - 'create', - ], + resource: ['problem'], + operation: ['create'], }, }, }, { displayName: 'Requester Name or ID', name: 'requesterId', - description: 'ID of the initiator of the problem. Choose from the list, or specify an ID using an expression.', + description: + 'ID of the initiator of the problem. Choose from the list, or specify an ID using an expression.', type: 'options', required: true, default: '', @@ -84,12 +77,8 @@ export const problemFields: INodeProperties[] = [ }, displayOptions: { show: { - resource: [ - 'problem', - ], - operation: [ - 'create', - ], + resource: ['problem'], + operation: ['create'], }, }, }, @@ -101,12 +90,8 @@ export const problemFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'problem', - ], - operation: [ - 'create', - ], + resource: ['problem'], + operation: ['create'], }, }, }, @@ -118,12 +103,8 @@ export const problemFields: INodeProperties[] = [ default: {}, displayOptions: { show: { - resource: [ - 'problem', - ], - operation: [ - 'create', - ], + resource: ['problem'], + operation: ['create'], }, }, options: [ @@ -132,7 +113,8 @@ export const problemFields: INodeProperties[] = [ name: 'agent_id', type: 'options', default: '', - description: 'ID of the agent to whom the problem is assigned. Choose from the list, or specify an ID using an expression.', + description: + 'ID of the agent to whom the problem is assigned. Choose from the list, or specify an ID using an expression.', typeOptions: { loadOptionsMethod: 'getAgents', }, @@ -142,7 +124,8 @@ export const problemFields: INodeProperties[] = [ name: 'department_id', type: 'options', default: '', - description: 'ID of the department initiating the problem. Choose from the list, or specify an ID using an expression.', + description: + 'ID of the department initiating the problem. Choose from the list, or specify an ID using an expression.', typeOptions: { loadOptionsMethod: 'getDepartments', }, @@ -159,7 +142,8 @@ export const problemFields: INodeProperties[] = [ name: 'group_id', type: 'options', default: '', - description: 'ID of the agent group to which the problem is assigned. Choose from the list, or specify an ID using an expression.', + description: + 'ID of the agent group to which the problem is assigned. Choose from the list, or specify an ID using an expression.', typeOptions: { loadOptionsMethod: 'getAgentGroups', }, @@ -243,12 +227,8 @@ export const problemFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'problem', - ], - operation: [ - 'delete', - ], + resource: ['problem'], + operation: ['delete'], }, }, }, @@ -265,12 +245,8 @@ export const problemFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'problem', - ], - operation: [ - 'get', - ], + resource: ['problem'], + operation: ['get'], }, }, }, @@ -286,12 +262,8 @@ export const problemFields: INodeProperties[] = [ description: 'Whether to return all results or only up to a given limit', displayOptions: { show: { - resource: [ - 'problem', - ], - operation: [ - 'getAll', - ], + resource: ['problem'], + operation: ['getAll'], }, }, }, @@ -306,15 +278,9 @@ export const problemFields: INodeProperties[] = [ }, displayOptions: { show: { - resource: [ - 'problem', - ], - operation: [ - 'getAll', - ], - returnAll: [ - false, - ], + resource: ['problem'], + operation: ['getAll'], + returnAll: [false], }, }, }, @@ -331,12 +297,8 @@ export const problemFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'problem', - ], - operation: [ - 'update', - ], + resource: ['problem'], + operation: ['update'], }, }, }, @@ -348,12 +310,8 @@ export const problemFields: INodeProperties[] = [ default: {}, displayOptions: { show: { - resource: [ - 'problem', - ], - operation: [ - 'update', - ], + resource: ['problem'], + operation: ['update'], }, }, options: [ @@ -362,7 +320,8 @@ export const problemFields: INodeProperties[] = [ name: 'agent_id', type: 'options', default: '', - description: 'ID of the agent to whom the problem is assigned. Choose from the list, or specify an ID using an expression.', + description: + 'ID of the agent to whom the problem is assigned. Choose from the list, or specify an ID using an expression.', typeOptions: { loadOptionsMethod: 'getAgents', }, @@ -372,7 +331,8 @@ export const problemFields: INodeProperties[] = [ name: 'department_id', type: 'options', default: '', - description: 'ID of the department initiating the problem. Choose from the list, or specify an ID using an expression.', + description: + 'ID of the department initiating the problem. Choose from the list, or specify an ID using an expression.', typeOptions: { loadOptionsMethod: 'getDepartments', }, @@ -396,7 +356,8 @@ export const problemFields: INodeProperties[] = [ name: 'group_id', type: 'options', default: '', - description: 'ID of the agent group to which the problem is assigned. Choose from the list, or specify an ID using an expression.', + description: + 'ID of the agent group to which the problem is assigned. Choose from the list, or specify an ID using an expression.', typeOptions: { loadOptionsMethod: 'getAgentGroups', }, @@ -450,7 +411,8 @@ export const problemFields: INodeProperties[] = [ name: 'requester_id', type: 'options', default: '', - description: 'ID of the initiator of the problem. Choose from the list, or specify an ID using an expression.', + description: + 'ID of the initiator of the problem. Choose from the list, or specify an ID using an expression.', typeOptions: { loadOptionsMethod: 'getRequesters', }, diff --git a/packages/nodes-base/nodes/Freshservice/descriptions/ProductDescription.ts b/packages/nodes-base/nodes/Freshservice/descriptions/ProductDescription.ts index 5db77323c54b6..3b4e498285263 100644 --- a/packages/nodes-base/nodes/Freshservice/descriptions/ProductDescription.ts +++ b/packages/nodes-base/nodes/Freshservice/descriptions/ProductDescription.ts @@ -1,6 +1,4 @@ -import { - INodeProperties, -} from 'n8n-workflow'; +import { INodeProperties } from 'n8n-workflow'; export const productOperations: INodeProperties[] = [ { @@ -10,9 +8,7 @@ export const productOperations: INodeProperties[] = [ noDataExpression: true, displayOptions: { show: { - resource: [ - 'product', - ], + resource: ['product'], }, }, options: [ @@ -59,7 +55,8 @@ export const productFields: INodeProperties[] = [ displayName: 'Asset Type Name or ID', name: 'assetTypeId', type: 'options', - description: 'Choose from the list, or specify an ID using an expression', + description: + 'Choose from the list, or specify an ID using an expression', required: true, default: '', typeOptions: { @@ -67,12 +64,8 @@ export const productFields: INodeProperties[] = [ }, displayOptions: { show: { - resource: [ - 'product', - ], - operation: [ - 'create', - ], + resource: ['product'], + operation: ['create'], }, }, }, @@ -84,12 +77,8 @@ export const productFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'product', - ], - operation: [ - 'create', - ], + resource: ['product'], + operation: ['create'], }, }, }, @@ -101,12 +90,8 @@ export const productFields: INodeProperties[] = [ default: {}, displayOptions: { show: { - resource: [ - 'product', - ], - operation: [ - 'create', - ], + resource: ['product'], + operation: ['create'], }, }, options: [ @@ -178,12 +163,8 @@ export const productFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'product', - ], - operation: [ - 'delete', - ], + resource: ['product'], + operation: ['delete'], }, }, }, @@ -200,12 +181,8 @@ export const productFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'product', - ], - operation: [ - 'get', - ], + resource: ['product'], + operation: ['get'], }, }, }, @@ -221,12 +198,8 @@ export const productFields: INodeProperties[] = [ description: 'Whether to return all results or only up to a given limit', displayOptions: { show: { - resource: [ - 'product', - ], - operation: [ - 'getAll', - ], + resource: ['product'], + operation: ['getAll'], }, }, }, @@ -241,15 +214,9 @@ export const productFields: INodeProperties[] = [ }, displayOptions: { show: { - resource: [ - 'product', - ], - operation: [ - 'getAll', - ], - returnAll: [ - false, - ], + resource: ['product'], + operation: ['getAll'], + returnAll: [false], }, }, }, @@ -266,12 +233,8 @@ export const productFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'product', - ], - operation: [ - 'update', - ], + resource: ['product'], + operation: ['update'], }, }, }, @@ -283,12 +246,8 @@ export const productFields: INodeProperties[] = [ default: {}, displayOptions: { show: { - resource: [ - 'product', - ], - operation: [ - 'update', - ], + resource: ['product'], + operation: ['update'], }, }, options: [ @@ -296,7 +255,8 @@ export const productFields: INodeProperties[] = [ displayName: 'Asset Type Name or ID', name: 'asset_type_id', type: 'options', - description: 'Choose from the list, or specify an ID using an expression', + description: + 'Choose from the list, or specify an ID using an expression', default: '', typeOptions: { loadOptionsMethod: 'getAssetTypes', diff --git a/packages/nodes-base/nodes/Freshservice/descriptions/ReleaseDescription.ts b/packages/nodes-base/nodes/Freshservice/descriptions/ReleaseDescription.ts index bd81416607a24..6b40609bd227a 100644 --- a/packages/nodes-base/nodes/Freshservice/descriptions/ReleaseDescription.ts +++ b/packages/nodes-base/nodes/Freshservice/descriptions/ReleaseDescription.ts @@ -1,6 +1,4 @@ -import { - INodeProperties, -} from 'n8n-workflow'; +import { INodeProperties } from 'n8n-workflow'; export const releaseOperations: INodeProperties[] = [ { @@ -10,9 +8,7 @@ export const releaseOperations: INodeProperties[] = [ noDataExpression: true, displayOptions: { show: { - resource: [ - 'release', - ], + resource: ['release'], }, }, options: [ @@ -63,12 +59,8 @@ export const releaseFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'release', - ], - operation: [ - 'create', - ], + resource: ['release'], + operation: ['create'], }, }, }, @@ -79,12 +71,8 @@ export const releaseFields: INodeProperties[] = [ default: 1, displayOptions: { show: { - resource: [ - 'release', - ], - operation: [ - 'create', - ], + resource: ['release'], + operation: ['create'], }, }, options: [ @@ -113,12 +101,8 @@ export const releaseFields: INodeProperties[] = [ default: 1, displayOptions: { show: { - resource: [ - 'release', - ], - operation: [ - 'create', - ], + resource: ['release'], + operation: ['create'], }, }, options: [ @@ -147,12 +131,8 @@ export const releaseFields: INodeProperties[] = [ default: 1, displayOptions: { show: { - resource: [ - 'release', - ], - operation: [ - 'create', - ], + resource: ['release'], + operation: ['create'], }, }, // eslint-disable-next-line n8n-nodes-base/node-param-options-type-unsorted-items @@ -187,12 +167,8 @@ export const releaseFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'release', - ], - operation: [ - 'create', - ], + resource: ['release'], + operation: ['create'], }, }, }, @@ -204,12 +180,8 @@ export const releaseFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'release', - ], - operation: [ - 'create', - ], + resource: ['release'], + operation: ['create'], }, }, }, @@ -221,12 +193,8 @@ export const releaseFields: INodeProperties[] = [ default: {}, displayOptions: { show: { - resource: [ - 'release', - ], - operation: [ - 'create', - ], + resource: ['release'], + operation: ['create'], }, }, options: [ @@ -235,7 +203,8 @@ export const releaseFields: INodeProperties[] = [ name: 'department_id', type: 'options', default: '', - description: 'ID of the department initiating the release. Choose from the list, or specify an ID using an expression.', + description: + 'ID of the department initiating the release. Choose from the list, or specify an ID using an expression.', typeOptions: { loadOptionsMethod: 'getDepartments', }, @@ -252,7 +221,8 @@ export const releaseFields: INodeProperties[] = [ name: 'group_id', type: 'options', default: '', - description: 'ID of the agent group to which the release is assigned. Choose from the list, or specify an ID using an expression.', + description: + 'ID of the agent group to which the release is assigned. Choose from the list, or specify an ID using an expression.', typeOptions: { loadOptionsMethod: 'getAgentGroups', }, @@ -272,12 +242,8 @@ export const releaseFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'release', - ], - operation: [ - 'delete', - ], + resource: ['release'], + operation: ['delete'], }, }, }, @@ -294,12 +260,8 @@ export const releaseFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'release', - ], - operation: [ - 'get', - ], + resource: ['release'], + operation: ['get'], }, }, }, @@ -315,12 +277,8 @@ export const releaseFields: INodeProperties[] = [ description: 'Whether to return all results or only up to a given limit', displayOptions: { show: { - resource: [ - 'release', - ], - operation: [ - 'getAll', - ], + resource: ['release'], + operation: ['getAll'], }, }, }, @@ -335,15 +293,9 @@ export const releaseFields: INodeProperties[] = [ }, displayOptions: { show: { - resource: [ - 'release', - ], - operation: [ - 'getAll', - ], - returnAll: [ - false, - ], + resource: ['release'], + operation: ['getAll'], + returnAll: [false], }, }, }, @@ -360,12 +312,8 @@ export const releaseFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'release', - ], - operation: [ - 'update', - ], + resource: ['release'], + operation: ['update'], }, }, }, @@ -377,12 +325,8 @@ export const releaseFields: INodeProperties[] = [ default: {}, displayOptions: { show: { - resource: [ - 'release', - ], - operation: [ - 'update', - ], + resource: ['release'], + operation: ['update'], }, }, options: [ @@ -391,7 +335,8 @@ export const releaseFields: INodeProperties[] = [ name: 'department_id', type: 'options', default: '', - description: 'ID of the department initiating the release. Choose from the list, or specify an ID using an expression.', + description: + 'ID of the department initiating the release. Choose from the list, or specify an ID using an expression.', typeOptions: { loadOptionsMethod: 'getDepartments', }, @@ -408,7 +353,8 @@ export const releaseFields: INodeProperties[] = [ name: 'group_id', type: 'options', default: '', - description: 'ID of the agent group to which the release is assigned. Choose from the list, or specify an ID using an expression.', + description: + 'ID of the agent group to which the release is assigned. Choose from the list, or specify an ID using an expression.', typeOptions: { loadOptionsMethod: 'getAgentGroups', }, diff --git a/packages/nodes-base/nodes/Freshservice/descriptions/RequesterDescription.ts b/packages/nodes-base/nodes/Freshservice/descriptions/RequesterDescription.ts index 214ec0e812452..10802499bacfe 100644 --- a/packages/nodes-base/nodes/Freshservice/descriptions/RequesterDescription.ts +++ b/packages/nodes-base/nodes/Freshservice/descriptions/RequesterDescription.ts @@ -1,6 +1,4 @@ -import { - INodeProperties, -} from 'n8n-workflow'; +import { INodeProperties } from 'n8n-workflow'; import { LANGUAGES } from '../constants'; export const requesterOperations: INodeProperties[] = [ @@ -11,9 +9,7 @@ export const requesterOperations: INodeProperties[] = [ noDataExpression: true, displayOptions: { show: { - resource: [ - 'requester', - ], + resource: ['requester'], }, }, options: [ @@ -64,12 +60,8 @@ export const requesterFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'requester', - ], - operation: [ - 'create', - ], + resource: ['requester'], + operation: ['create'], }, }, }, @@ -80,12 +72,8 @@ export const requesterFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'requester', - ], - operation: [ - 'create', - ], + resource: ['requester'], + operation: ['create'], }, }, }, @@ -97,12 +85,8 @@ export const requesterFields: INodeProperties[] = [ default: {}, displayOptions: { show: { - resource: [ - 'requester', - ], - operation: [ - 'create', - ], + resource: ['requester'], + operation: ['create'], }, }, options: [ @@ -123,7 +107,8 @@ export const requesterFields: INodeProperties[] = [ name: 'department_ids', type: 'multiOptions', default: [], - description: 'Comma-separated IDs of the departments associated with the requester. Choose from the list or specify an ID using an expression. Choose from the list, or specify IDs using an expression.', + description: + 'Comma-separated IDs of the departments associated with the requester. Choose from the list or specify an ID using an expression. Choose from the list, or specify IDs using an expression.', typeOptions: { loadOptionsMethod: 'getDepartments', }, @@ -150,7 +135,8 @@ export const requesterFields: INodeProperties[] = [ { displayName: 'Location Name or ID', name: 'location_id', - description: 'Choose from the list, or specify an ID using an expression', + description: + 'Choose from the list, or specify an ID using an expression', type: 'options', default: '', typeOptions: { @@ -207,12 +193,8 @@ export const requesterFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'requester', - ], - operation: [ - 'delete', - ], + resource: ['requester'], + operation: ['delete'], }, }, }, @@ -229,12 +211,8 @@ export const requesterFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'requester', - ], - operation: [ - 'get', - ], + resource: ['requester'], + operation: ['get'], }, }, }, @@ -250,12 +228,8 @@ export const requesterFields: INodeProperties[] = [ description: 'Whether to return all results or only up to a given limit', displayOptions: { show: { - resource: [ - 'requester', - ], - operation: [ - 'getAll', - ], + resource: ['requester'], + operation: ['getAll'], }, }, }, @@ -270,15 +244,9 @@ export const requesterFields: INodeProperties[] = [ }, displayOptions: { show: { - resource: [ - 'requester', - ], - operation: [ - 'getAll', - ], - returnAll: [ - false, - ], + resource: ['requester'], + operation: ['getAll'], + returnAll: [false], }, }, }, @@ -290,19 +258,16 @@ export const requesterFields: INodeProperties[] = [ default: {}, displayOptions: { show: { - resource: [ - 'requester', - ], - operation: [ - 'getAll', - ], + resource: ['requester'], + operation: ['getAll'], }, }, options: [ { displayName: 'Department Name or ID', name: 'department_id', - description: 'Choose from the list, or specify an ID using an expression', + description: + 'Choose from the list, or specify an ID using an expression', type: 'options', default: '', typeOptions: { @@ -338,7 +303,8 @@ export const requesterFields: INodeProperties[] = [ displayName: 'Location Name or ID', name: 'location_id', type: 'options', - description: 'Choose from the list, or specify an ID using an expression', + description: + 'Choose from the list, or specify an ID using an expression', default: '', typeOptions: { loadOptionsMethod: 'getLocations', @@ -377,12 +343,8 @@ export const requesterFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'requester', - ], - operation: [ - 'update', - ], + resource: ['requester'], + operation: ['update'], }, }, }, @@ -394,12 +356,8 @@ export const requesterFields: INodeProperties[] = [ default: {}, displayOptions: { show: { - resource: [ - 'requester', - ], - operation: [ - 'update', - ], + resource: ['requester'], + operation: ['update'], }, }, options: [ @@ -420,7 +378,8 @@ export const requesterFields: INodeProperties[] = [ name: 'department_ids', type: 'multiOptions', default: [], - description: 'Comma-separated IDs of the departments associated with the requester. Choose from the list or specify an ID using an expression. Choose from the list, or specify IDs using an expression.', + description: + 'Comma-separated IDs of the departments associated with the requester. Choose from the list or specify an ID using an expression. Choose from the list, or specify IDs using an expression.', typeOptions: { loadOptionsMethod: 'getDepartments', }, @@ -455,7 +414,8 @@ export const requesterFields: INodeProperties[] = [ name: 'location_id', type: 'options', default: '', - description: 'Choose from the list, or specify an ID using an expression', + description: + 'Choose from the list, or specify an ID using an expression', typeOptions: { loadOptionsMethod: 'getLocations', }, diff --git a/packages/nodes-base/nodes/Freshservice/descriptions/RequesterGroupDescription.ts b/packages/nodes-base/nodes/Freshservice/descriptions/RequesterGroupDescription.ts index 06ef8f122683c..64ac2bc36868e 100644 --- a/packages/nodes-base/nodes/Freshservice/descriptions/RequesterGroupDescription.ts +++ b/packages/nodes-base/nodes/Freshservice/descriptions/RequesterGroupDescription.ts @@ -1,6 +1,4 @@ -import { - INodeProperties, -} from 'n8n-workflow'; +import { INodeProperties } from 'n8n-workflow'; export const requesterGroupOperations: INodeProperties[] = [ { @@ -10,9 +8,7 @@ export const requesterGroupOperations: INodeProperties[] = [ noDataExpression: true, displayOptions: { show: { - resource: [ - 'requesterGroup', - ], + resource: ['requesterGroup'], }, }, options: [ @@ -63,12 +59,8 @@ export const requesterGroupFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'requesterGroup', - ], - operation: [ - 'create', - ], + resource: ['requesterGroup'], + operation: ['create'], }, }, }, @@ -80,12 +72,8 @@ export const requesterGroupFields: INodeProperties[] = [ default: {}, displayOptions: { show: { - resource: [ - 'requesterGroup', - ], - operation: [ - 'create', - ], + resource: ['requesterGroup'], + operation: ['create'], }, }, options: [ @@ -110,12 +98,8 @@ export const requesterGroupFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'requesterGroup', - ], - operation: [ - 'delete', - ], + resource: ['requesterGroup'], + operation: ['delete'], }, }, }, @@ -132,12 +116,8 @@ export const requesterGroupFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'requesterGroup', - ], - operation: [ - 'get', - ], + resource: ['requesterGroup'], + operation: ['get'], }, }, }, @@ -153,12 +133,8 @@ export const requesterGroupFields: INodeProperties[] = [ description: 'Whether to return all results or only up to a given limit', displayOptions: { show: { - resource: [ - 'requesterGroup', - ], - operation: [ - 'getAll', - ], + resource: ['requesterGroup'], + operation: ['getAll'], }, }, }, @@ -173,15 +149,9 @@ export const requesterGroupFields: INodeProperties[] = [ }, displayOptions: { show: { - resource: [ - 'requesterGroup', - ], - operation: [ - 'getAll', - ], - returnAll: [ - false, - ], + resource: ['requesterGroup'], + operation: ['getAll'], + returnAll: [false], }, }, }, @@ -198,12 +168,8 @@ export const requesterGroupFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'requesterGroup', - ], - operation: [ - 'update', - ], + resource: ['requesterGroup'], + operation: ['update'], }, }, }, @@ -215,12 +181,8 @@ export const requesterGroupFields: INodeProperties[] = [ default: {}, displayOptions: { show: { - resource: [ - 'requesterGroup', - ], - operation: [ - 'update', - ], + resource: ['requesterGroup'], + operation: ['update'], }, }, options: [ diff --git a/packages/nodes-base/nodes/Freshservice/descriptions/SoftwareDescription.ts b/packages/nodes-base/nodes/Freshservice/descriptions/SoftwareDescription.ts index 8b73c8b3e775d..176c4f8e22b74 100644 --- a/packages/nodes-base/nodes/Freshservice/descriptions/SoftwareDescription.ts +++ b/packages/nodes-base/nodes/Freshservice/descriptions/SoftwareDescription.ts @@ -1,6 +1,4 @@ -import { - INodeProperties, -} from 'n8n-workflow'; +import { INodeProperties } from 'n8n-workflow'; export const softwareOperations: INodeProperties[] = [ { @@ -10,9 +8,7 @@ export const softwareOperations: INodeProperties[] = [ noDataExpression: true, displayOptions: { show: { - resource: [ - 'software', - ], + resource: ['software'], }, }, options: [ @@ -77,12 +73,8 @@ export const softwareFields: INodeProperties[] = [ default: 'desktop', displayOptions: { show: { - resource: [ - 'software', - ], - operation: [ - 'create', - ], + resource: ['software'], + operation: ['create'], }, }, }, @@ -94,12 +86,8 @@ export const softwareFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'software', - ], - operation: [ - 'create', - ], + resource: ['software'], + operation: ['create'], }, }, }, @@ -111,12 +99,8 @@ export const softwareFields: INodeProperties[] = [ default: {}, displayOptions: { show: { - resource: [ - 'software', - ], - operation: [ - 'create', - ], + resource: ['software'], + operation: ['create'], }, }, options: [ @@ -171,12 +155,8 @@ export const softwareFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'software', - ], - operation: [ - 'delete', - ], + resource: ['software'], + operation: ['delete'], }, }, }, @@ -193,12 +173,8 @@ export const softwareFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'software', - ], - operation: [ - 'get', - ], + resource: ['software'], + operation: ['get'], }, }, }, @@ -214,12 +190,8 @@ export const softwareFields: INodeProperties[] = [ description: 'Whether to return all results or only up to a given limit', displayOptions: { show: { - resource: [ - 'software', - ], - operation: [ - 'getAll', - ], + resource: ['software'], + operation: ['getAll'], }, }, }, @@ -234,15 +206,9 @@ export const softwareFields: INodeProperties[] = [ }, displayOptions: { show: { - resource: [ - 'software', - ], - operation: [ - 'getAll', - ], - returnAll: [ - false, - ], + resource: ['software'], + operation: ['getAll'], + returnAll: [false], }, }, }, @@ -259,12 +225,8 @@ export const softwareFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'software', - ], - operation: [ - 'update', - ], + resource: ['software'], + operation: ['update'], }, }, }, @@ -276,12 +238,8 @@ export const softwareFields: INodeProperties[] = [ default: {}, displayOptions: { show: { - resource: [ - 'software', - ], - operation: [ - 'update', - ], + resource: ['software'], + operation: ['update'], }, }, options: [ diff --git a/packages/nodes-base/nodes/Freshservice/descriptions/TicketDescription.ts b/packages/nodes-base/nodes/Freshservice/descriptions/TicketDescription.ts index b4eb5e9caf92a..621b3cc6c3b27 100644 --- a/packages/nodes-base/nodes/Freshservice/descriptions/TicketDescription.ts +++ b/packages/nodes-base/nodes/Freshservice/descriptions/TicketDescription.ts @@ -1,6 +1,4 @@ -import { - INodeProperties, -} from 'n8n-workflow'; +import { INodeProperties } from 'n8n-workflow'; export const ticketOperations: INodeProperties[] = [ { @@ -10,9 +8,7 @@ export const ticketOperations: INodeProperties[] = [ noDataExpression: true, displayOptions: { show: { - resource: [ - 'ticket', - ], + resource: ['ticket'], }, }, options: [ @@ -65,12 +61,8 @@ export const ticketFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'ticket', - ], - operation: [ - 'create', - ], + resource: ['ticket'], + operation: ['create'], }, }, }, @@ -81,12 +73,8 @@ export const ticketFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'ticket', - ], - operation: [ - 'create', - ], + resource: ['ticket'], + operation: ['create'], }, }, }, @@ -98,12 +86,8 @@ export const ticketFields: INodeProperties[] = [ description: 'HTML supported', displayOptions: { show: { - resource: [ - 'ticket', - ], - operation: [ - 'create', - ], + resource: ['ticket'], + operation: ['create'], }, }, }, @@ -114,12 +98,8 @@ export const ticketFields: INodeProperties[] = [ default: 1, displayOptions: { show: { - resource: [ - 'ticket', - ], - operation: [ - 'create', - ], + resource: ['ticket'], + operation: ['create'], }, }, options: [ @@ -148,12 +128,8 @@ export const ticketFields: INodeProperties[] = [ default: 2, displayOptions: { show: { - resource: [ - 'ticket', - ], - operation: [ - 'create', - ], + resource: ['ticket'], + operation: ['create'], }, }, options: [ @@ -183,12 +159,8 @@ export const ticketFields: INodeProperties[] = [ default: {}, displayOptions: { show: { - resource: [ - 'ticket', - ], - operation: [ - 'create', - ], + resource: ['ticket'], + operation: ['create'], }, }, options: [ @@ -204,7 +176,8 @@ export const ticketFields: INodeProperties[] = [ name: 'department_id', type: 'options', default: '', - description: 'ID of the department to which this ticket belongs. Choose from the list, or specify an ID using an expression.', + description: + 'ID of the department to which this ticket belongs. Choose from the list, or specify an ID using an expression.', typeOptions: { loadOptionsMethod: 'getDepartments', }, @@ -214,7 +187,8 @@ export const ticketFields: INodeProperties[] = [ name: 'group_id', type: 'options', default: '', - description: 'ID of the group to which the ticket has been assigned. Choose from the list, or specify an ID using an expression.', + description: + 'ID of the group to which the ticket has been assigned. Choose from the list, or specify an ID using an expression.', typeOptions: { loadOptionsMethod: 'getAgentGroups', }, @@ -250,7 +224,8 @@ export const ticketFields: INodeProperties[] = [ displayName: 'Requester Name or ID', name: 'requester_id', type: 'options', - description: 'Choose from the list, or specify an ID using an expression', + description: + 'Choose from the list, or specify an ID using an expression', default: '', typeOptions: { loadOptionsMethod: 'getRequesters', @@ -271,12 +246,8 @@ export const ticketFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'ticket', - ], - operation: [ - 'delete', - ], + resource: ['ticket'], + operation: ['delete'], }, }, }, @@ -293,12 +264,8 @@ export const ticketFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'ticket', - ], - operation: [ - 'get', - ], + resource: ['ticket'], + operation: ['get'], }, }, }, @@ -314,12 +281,8 @@ export const ticketFields: INodeProperties[] = [ description: 'Whether to return all results or only up to a given limit', displayOptions: { show: { - resource: [ - 'ticket', - ], - operation: [ - 'getAll', - ], + resource: ['ticket'], + operation: ['getAll'], }, }, }, @@ -334,15 +297,9 @@ export const ticketFields: INodeProperties[] = [ }, displayOptions: { show: { - resource: [ - 'ticket', - ], - operation: [ - 'getAll', - ], - returnAll: [ - false, - ], + resource: ['ticket'], + operation: ['getAll'], + returnAll: [false], }, }, }, @@ -354,12 +311,8 @@ export const ticketFields: INodeProperties[] = [ default: {}, displayOptions: { show: { - resource: [ - 'ticket', - ], - operation: [ - 'getAll', - ], + resource: ['ticket'], + operation: ['getAll'], }, }, options: [ @@ -368,7 +321,8 @@ export const ticketFields: INodeProperties[] = [ name: 'agent_id', type: 'options', default: '', - description: 'ID of the agent to whom the tickets have been assigned. Choose from the list, or specify an ID using an expression.', + description: + 'ID of the agent to whom the tickets have been assigned. Choose from the list, or specify an ID using an expression.', typeOptions: { loadOptionsMethod: 'getAgents', }, @@ -378,7 +332,8 @@ export const ticketFields: INodeProperties[] = [ name: 'group_id', type: 'options', default: '', - description: 'ID of the group to which the tickets have been assigned. Choose from the list, or specify an ID using an expression.', + description: + 'ID of the group to which the tickets have been assigned. Choose from the list, or specify an ID using an expression.', typeOptions: { loadOptionsMethod: 'getAgentGroups', }, @@ -480,12 +435,8 @@ export const ticketFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'ticket', - ], - operation: [ - 'update', - ], + resource: ['ticket'], + operation: ['update'], }, }, }, @@ -497,12 +448,8 @@ export const ticketFields: INodeProperties[] = [ default: {}, displayOptions: { show: { - resource: [ - 'ticket', - ], - operation: [ - 'update', - ], + resource: ['ticket'], + operation: ['update'], }, }, options: [ @@ -511,7 +458,8 @@ export const ticketFields: INodeProperties[] = [ name: 'department_id', type: 'options', default: '', - description: 'ID of the department to which this ticket has been assigned. Choose from the list, or specify an ID using an expression.', + description: + 'ID of the department to which this ticket has been assigned. Choose from the list, or specify an ID using an expression.', typeOptions: { loadOptionsMethod: 'getDepartments', }, @@ -536,7 +484,8 @@ export const ticketFields: INodeProperties[] = [ name: 'group_id', type: 'options', default: '', - description: 'ID of the group to which the ticket has been assigned. Choose from the list, or specify an ID using an expression.', + description: + 'ID of the group to which the ticket has been assigned. Choose from the list, or specify an ID using an expression.', typeOptions: { loadOptionsMethod: 'getAgentGroups', }, diff --git a/packages/nodes-base/nodes/FreshworksCrm/descriptions/AccountDescription.ts b/packages/nodes-base/nodes/FreshworksCrm/descriptions/AccountDescription.ts index 849fb32e60460..7f6b9d3d6bf21 100644 --- a/packages/nodes-base/nodes/FreshworksCrm/descriptions/AccountDescription.ts +++ b/packages/nodes-base/nodes/FreshworksCrm/descriptions/AccountDescription.ts @@ -1,6 +1,4 @@ -import { - INodeProperties, -} from 'n8n-workflow'; +import { INodeProperties } from 'n8n-workflow'; export const accountOperations: INodeProperties[] = [ { @@ -10,9 +8,7 @@ export const accountOperations: INodeProperties[] = [ noDataExpression: true, displayOptions: { show: { - resource: [ - 'account', - ], + resource: ['account'], }, }, options: [ @@ -64,12 +60,8 @@ export const accountFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'account', - ], - operation: [ - 'create', - ], + resource: ['account'], + operation: ['create'], }, }, }, @@ -81,12 +73,8 @@ export const accountFields: INodeProperties[] = [ default: {}, displayOptions: { show: { - resource: [ - 'account', - ], - operation: [ - 'create', - ], + resource: ['account'], + operation: ['create'], }, }, options: [ @@ -112,7 +100,8 @@ export const accountFields: INodeProperties[] = [ typeOptions: { loadOptionsMethod: 'getBusinessTypes', }, - description: 'ID of the business that the account belongs to. Choose from the list, or specify an ID using an expression.', + description: + 'ID of the business that the account belongs to. Choose from the list, or specify an ID using an expression.', }, { displayName: 'City', @@ -143,7 +132,8 @@ export const accountFields: INodeProperties[] = [ typeOptions: { loadOptionsMethod: 'getIndustryTypes', }, - description: 'ID of the industry that the account belongs to. Choose from the list, or specify an ID using an expression.', + description: + 'ID of the industry that the account belongs to. Choose from the list, or specify an ID using an expression.', }, { displayName: 'LinkedIn', @@ -167,7 +157,8 @@ export const accountFields: INodeProperties[] = [ typeOptions: { loadOptionsMethod: 'getUsers', }, - description: 'ID of the user to whom the account is assigned. Choose from the list, or specify an ID using an expression.', + description: + 'ID of the user to whom the account is assigned. Choose from the list, or specify an ID using an expression.', }, { displayName: 'Parent Sales Account ID', @@ -198,7 +189,8 @@ export const accountFields: INodeProperties[] = [ typeOptions: { loadOptionsMethod: 'getTerritories', }, - description: 'ID of the territory that the account belongs to. Choose from the list, or specify an ID using an expression.', + description: + 'ID of the territory that the account belongs to. Choose from the list, or specify an ID using an expression.', }, { displayName: 'Twitter', @@ -236,12 +228,8 @@ export const accountFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'account', - ], - operation: [ - 'delete', - ], + resource: ['account'], + operation: ['delete'], }, }, }, @@ -258,12 +246,8 @@ export const accountFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'account', - ], - operation: [ - 'get', - ], + resource: ['account'], + operation: ['get'], }, }, }, @@ -275,19 +259,16 @@ export const accountFields: INodeProperties[] = [ displayName: 'View Name or ID', name: 'view', type: 'options', - description: 'Choose from the list, or specify an ID using an expression', + description: + 'Choose from the list, or specify an ID using an expression', required: true, typeOptions: { loadOptionsMethod: 'getAccountViews', }, displayOptions: { show: { - resource: [ - 'account', - ], - operation: [ - 'getAll', - ], + resource: ['account'], + operation: ['getAll'], }, }, default: '', @@ -300,12 +281,8 @@ export const accountFields: INodeProperties[] = [ description: 'Whether to return all results or only up to a given limit', displayOptions: { show: { - resource: [ - 'account', - ], - operation: [ - 'getAll', - ], + resource: ['account'], + operation: ['getAll'], }, }, }, @@ -320,15 +297,9 @@ export const accountFields: INodeProperties[] = [ }, displayOptions: { show: { - resource: [ - 'account', - ], - operation: [ - 'getAll', - ], - returnAll: [ - false, - ], + resource: ['account'], + operation: ['getAll'], + returnAll: [false], }, }, }, @@ -345,12 +316,8 @@ export const accountFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'account', - ], - operation: [ - 'update', - ], + resource: ['account'], + operation: ['update'], }, }, }, @@ -362,12 +329,8 @@ export const accountFields: INodeProperties[] = [ default: {}, displayOptions: { show: { - resource: [ - 'account', - ], - operation: [ - 'update', - ], + resource: ['account'], + operation: ['update'], }, }, options: [ @@ -393,7 +356,8 @@ export const accountFields: INodeProperties[] = [ typeOptions: { loadOptionsMethod: 'getBusinessTypes', }, - description: 'ID of the business that the account belongs to. Choose from the list, or specify an ID using an expression.', + description: + 'ID of the business that the account belongs to. Choose from the list, or specify an ID using an expression.', }, { displayName: 'City', @@ -424,7 +388,8 @@ export const accountFields: INodeProperties[] = [ typeOptions: { loadOptionsMethod: 'getIndustryTypes', }, - description: 'ID of the industry that the account belongs to. Choose from the list, or specify an ID using an expression.', + description: + 'ID of the industry that the account belongs to. Choose from the list, or specify an ID using an expression.', }, { displayName: 'LinkedIn', @@ -455,7 +420,8 @@ export const accountFields: INodeProperties[] = [ typeOptions: { loadOptionsMethod: 'getUsers', }, - description: 'ID of the user to whom the account is assigned. Choose from the list, or specify an ID using an expression.', + description: + 'ID of the user to whom the account is assigned. Choose from the list, or specify an ID using an expression.', }, { displayName: 'Parent Sales Account ID', @@ -486,7 +452,8 @@ export const accountFields: INodeProperties[] = [ typeOptions: { loadOptionsMethod: 'getTerritories', }, - description: 'ID of the territory that the account belongs to. Choose from the list, or specify an ID using an expression.', + description: + 'ID of the territory that the account belongs to. Choose from the list, or specify an ID using an expression.', }, { displayName: 'Twitter', diff --git a/packages/nodes-base/nodes/FreshworksCrm/descriptions/AppointmentDescription.ts b/packages/nodes-base/nodes/FreshworksCrm/descriptions/AppointmentDescription.ts index 98a86a894e498..4d2123fc1c0a7 100644 --- a/packages/nodes-base/nodes/FreshworksCrm/descriptions/AppointmentDescription.ts +++ b/packages/nodes-base/nodes/FreshworksCrm/descriptions/AppointmentDescription.ts @@ -1,10 +1,6 @@ -import { - tz, -} from 'moment-timezone'; +import { tz } from 'moment-timezone'; -import { - INodeProperties, -} from 'n8n-workflow'; +import { INodeProperties } from 'n8n-workflow'; export const appointmentOperations: INodeProperties[] = [ { @@ -14,9 +10,7 @@ export const appointmentOperations: INodeProperties[] = [ noDataExpression: true, displayOptions: { show: { - resource: [ - 'appointment', - ], + resource: ['appointment'], }, }, options: [ @@ -68,48 +62,38 @@ export const appointmentFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'appointment', - ], - operation: [ - 'create', - ], + resource: ['appointment'], + operation: ['create'], }, }, }, { displayName: 'Start Date', name: 'fromDate', - description: 'Timestamp that denotes the start of appointment. Start date if this is an all-day appointment.', + description: + 'Timestamp that denotes the start of appointment. Start date if this is an all-day appointment.', type: 'dateTime', required: true, default: '', displayOptions: { show: { - resource: [ - 'appointment', - ], - operation: [ - 'create', - ], + resource: ['appointment'], + operation: ['create'], }, }, }, { displayName: 'End Date', name: 'endDate', - description: 'Timestamp that denotes the end of appointment. End date if this is an all-day appointment.', + description: + 'Timestamp that denotes the end of appointment. End date if this is an all-day appointment.', type: 'dateTime', required: true, default: '', displayOptions: { show: { - resource: [ - 'appointment', - ], - operation: [ - 'create', - ], + resource: ['appointment'], + operation: ['create'], }, }, }, @@ -122,12 +106,8 @@ export const appointmentFields: INodeProperties[] = [ }, displayOptions: { show: { - resource: [ - 'appointment', - ], - operation: [ - 'create', - ], + resource: ['appointment'], + operation: ['create'], }, }, placeholder: 'Add Attendee', @@ -157,12 +137,11 @@ export const appointmentFields: INodeProperties[] = [ displayName: 'User Name or ID', name: 'userId', type: 'options', - description: 'Choose from the list, or specify an ID using an expression', + description: + 'Choose from the list, or specify an ID using an expression', displayOptions: { show: { - type: [ - 'user', - ], + type: ['user'], }, }, typeOptions: { @@ -175,9 +154,7 @@ export const appointmentFields: INodeProperties[] = [ name: 'contactId', displayOptions: { show: { - type: [ - 'contact', - ], + type: ['contact'], }, }, type: 'string', @@ -195,12 +172,8 @@ export const appointmentFields: INodeProperties[] = [ default: {}, displayOptions: { show: { - resource: [ - 'appointment', - ], - operation: [ - 'create', - ], + resource: ['appointment'], + operation: ['create'], }, }, options: [ @@ -212,7 +185,8 @@ export const appointmentFields: INodeProperties[] = [ typeOptions: { loadOptionsMethod: 'getUsers', }, - description: 'ID of the user who created the appointment. Choose from the list, or specify an ID using an expression.', + description: + 'ID of the user who created the appointment. Choose from the list, or specify an ID using an expression.', }, { displayName: 'Is All-Day', @@ -250,7 +224,8 @@ export const appointmentFields: INodeProperties[] = [ typeOptions: { loadOptionsMethod: 'getOutcomes', }, - description: 'ID of outcome of Appointment sales activity type. Choose from the list, or specify an ID using an expression.', + description: + 'ID of outcome of Appointment sales activity type. Choose from the list, or specify an ID using an expression.', }, { displayName: 'Target ID', @@ -285,7 +260,7 @@ export const appointmentFields: INodeProperties[] = [ type: 'options', default: '', description: 'Timezone that the appointment is scheduled in', - options: tz.names().map(tz => ({ name: tz, value: tz })), + options: tz.names().map((tz) => ({ name: tz, value: tz })), }, ], }, @@ -302,12 +277,8 @@ export const appointmentFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'appointment', - ], - operation: [ - 'delete', - ], + resource: ['appointment'], + operation: ['delete'], }, }, }, @@ -324,12 +295,8 @@ export const appointmentFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'appointment', - ], - operation: [ - 'get', - ], + resource: ['appointment'], + operation: ['get'], }, }, }, @@ -345,12 +312,8 @@ export const appointmentFields: INodeProperties[] = [ description: 'Whether to return all results or only up to a given limit', displayOptions: { show: { - resource: [ - 'appointment', - ], - operation: [ - 'getAll', - ], + resource: ['appointment'], + operation: ['getAll'], }, }, }, @@ -365,15 +328,9 @@ export const appointmentFields: INodeProperties[] = [ }, displayOptions: { show: { - resource: [ - 'appointment', - ], - operation: [ - 'getAll', - ], - returnAll: [ - false, - ], + resource: ['appointment'], + operation: ['getAll'], + returnAll: [false], }, }, }, @@ -385,12 +342,8 @@ export const appointmentFields: INodeProperties[] = [ placeholder: 'Add Filter', displayOptions: { show: { - resource: [ - 'appointment', - ], - operation: [ - 'getAll', - ], + resource: ['appointment'], + operation: ['getAll'], }, }, options: [ @@ -445,12 +398,8 @@ export const appointmentFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'appointment', - ], - operation: [ - 'update', - ], + resource: ['appointment'], + operation: ['update'], }, }, }, @@ -462,12 +411,8 @@ export const appointmentFields: INodeProperties[] = [ default: {}, displayOptions: { show: { - resource: [ - 'appointment', - ], - operation: [ - 'update', - ], + resource: ['appointment'], + operation: ['update'], }, }, options: [ @@ -505,12 +450,11 @@ export const appointmentFields: INodeProperties[] = [ displayName: 'User Name or ID', name: 'userId', type: 'options', - description: 'Choose from the list, or specify an ID using an expression', + description: + 'Choose from the list, or specify an ID using an expression', displayOptions: { show: { - type: [ - 'user', - ], + type: ['user'], }, }, typeOptions: { @@ -523,9 +467,7 @@ export const appointmentFields: INodeProperties[] = [ name: 'contactId', displayOptions: { show: { - type: [ - 'contact', - ], + type: ['contact'], }, }, type: 'string', @@ -543,12 +485,14 @@ export const appointmentFields: INodeProperties[] = [ typeOptions: { loadOptionsMethod: 'getUsers', }, - description: 'ID of the user who created the appointment. Choose from the list, or specify an ID using an expression.', + description: + 'ID of the user who created the appointment. Choose from the list, or specify an ID using an expression.', }, { displayName: 'End Date', name: 'endDate', - description: 'Timestamp that denotes the end of appointment. End date if this is an all-day appointment.', + description: + 'Timestamp that denotes the end of appointment. End date if this is an all-day appointment.', type: 'dateTime', default: '', }, @@ -588,12 +532,14 @@ export const appointmentFields: INodeProperties[] = [ typeOptions: { loadOptionsMethod: 'getOutcomes', }, - description: 'ID of outcome of Appointment sales activity type. Choose from the list, or specify an ID using an expression.', + description: + 'ID of outcome of Appointment sales activity type. Choose from the list, or specify an ID using an expression.', }, { displayName: 'Start Date', name: 'fromDate', - description: 'Timestamp that denotes the start of appointment. Start date if this is an all-day appointment.', + description: + 'Timestamp that denotes the start of appointment. Start date if this is an all-day appointment.', type: 'dateTime', default: '', }, @@ -630,7 +576,7 @@ export const appointmentFields: INodeProperties[] = [ type: 'options', default: '', description: 'Timezone that the appointment is scheduled in', - options: tz.names().map(tz => ({ name: tz, value: tz })), + options: tz.names().map((tz) => ({ name: tz, value: tz })), }, { displayName: 'Title', diff --git a/packages/nodes-base/nodes/FreshworksCrm/descriptions/ContactDescription.ts b/packages/nodes-base/nodes/FreshworksCrm/descriptions/ContactDescription.ts index d0805bde75c48..1e2e1fd44afa0 100644 --- a/packages/nodes-base/nodes/FreshworksCrm/descriptions/ContactDescription.ts +++ b/packages/nodes-base/nodes/FreshworksCrm/descriptions/ContactDescription.ts @@ -1,6 +1,4 @@ -import { - INodeProperties, -} from 'n8n-workflow'; +import { INodeProperties } from 'n8n-workflow'; export const contactOperations: INodeProperties[] = [ { @@ -10,9 +8,7 @@ export const contactOperations: INodeProperties[] = [ noDataExpression: true, displayOptions: { show: { - resource: [ - 'contact', - ], + resource: ['contact'], }, }, options: [ @@ -64,12 +60,8 @@ export const contactFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'contact', - ], - operation: [ - 'create', - ], + resource: ['contact'], + operation: ['create'], }, }, }, @@ -82,12 +74,8 @@ export const contactFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'contact', - ], - operation: [ - 'create', - ], + resource: ['contact'], + operation: ['create'], }, }, }, @@ -100,12 +88,8 @@ export const contactFields: INodeProperties[] = [ required: true, displayOptions: { show: { - resource: [ - 'contact', - ], - operation: [ - 'create', - ], + resource: ['contact'], + operation: ['create'], }, }, }, @@ -117,12 +101,8 @@ export const contactFields: INodeProperties[] = [ default: {}, displayOptions: { show: { - resource: [ - 'contact', - ], - operation: [ - 'create', - ], + resource: ['contact'], + operation: ['create'], }, }, options: [ @@ -141,7 +121,8 @@ export const contactFields: INodeProperties[] = [ typeOptions: { loadOptionsMethod: 'getCampaigns', }, - description: 'ID of the campaign that led your contact to your webapp. Choose from the list, or specify an ID using an expression.', + description: + 'ID of the campaign that led your contact to your webapp. Choose from the list, or specify an ID using an expression.', }, { displayName: 'City', @@ -158,7 +139,8 @@ export const contactFields: INodeProperties[] = [ typeOptions: { loadOptionsMethod: 'getContactStatuses', }, - description: 'ID of the contact status that the contact belongs to. Choose from the list, or specify an ID using an expression.', + description: + 'ID of the contact status that the contact belongs to. Choose from the list, or specify an ID using an expression.', }, { displayName: 'Country', @@ -210,7 +192,8 @@ export const contactFields: INodeProperties[] = [ typeOptions: { loadOptionsMethod: 'getLifecycleStages', }, - description: 'ID of the lifecycle stage that the contact belongs to. Choose from the list, or specify an ID using an expression.', + description: + 'ID of the lifecycle stage that the contact belongs to. Choose from the list, or specify an ID using an expression.', }, { displayName: 'LinkedIn', @@ -241,7 +224,8 @@ export const contactFields: INodeProperties[] = [ typeOptions: { loadOptionsMethod: 'getUsers', }, - description: 'ID of the user to whom the contact is assigned. Choose from the list, or specify an ID using an expression.', + description: + 'ID of the user to whom the contact is assigned. Choose from the list, or specify an ID using an expression.', }, { displayName: 'Sales Account Names or IDs', @@ -251,7 +235,8 @@ export const contactFields: INodeProperties[] = [ typeOptions: { loadOptionsMethod: 'getAccounts', }, - description: 'Accounts which contact belongs to. Choose from the list, or specify IDs using an expression.', + description: + 'Accounts which contact belongs to. Choose from the list, or specify IDs using an expression.', }, { displayName: 'State', @@ -282,7 +267,8 @@ export const contactFields: INodeProperties[] = [ typeOptions: { loadOptionsMethod: 'getTerritories', }, - description: 'ID of the territory that the contact belongs to. Choose from the list, or specify an ID using an expression.', + description: + 'ID of the territory that the contact belongs to. Choose from the list, or specify an ID using an expression.', }, { displayName: 'Time Zone', @@ -327,12 +313,8 @@ export const contactFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'contact', - ], - operation: [ - 'delete', - ], + resource: ['contact'], + operation: ['delete'], }, }, }, @@ -349,12 +331,8 @@ export const contactFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'contact', - ], - operation: [ - 'get', - ], + resource: ['contact'], + operation: ['get'], }, }, }, @@ -366,15 +344,12 @@ export const contactFields: INodeProperties[] = [ displayName: 'View Name or ID', name: 'view', type: 'options', - description: 'Choose from the list, or specify an ID using an expression', + description: + 'Choose from the list, or specify an ID using an expression', displayOptions: { show: { - resource: [ - 'contact', - ], - operation: [ - 'getAll', - ], + resource: ['contact'], + operation: ['getAll'], }, }, typeOptions: { @@ -390,12 +365,8 @@ export const contactFields: INodeProperties[] = [ description: 'Whether to return all results or only up to a given limit', displayOptions: { show: { - resource: [ - 'contact', - ], - operation: [ - 'getAll', - ], + resource: ['contact'], + operation: ['getAll'], }, }, }, @@ -410,15 +381,9 @@ export const contactFields: INodeProperties[] = [ }, displayOptions: { show: { - resource: [ - 'contact', - ], - operation: [ - 'getAll', - ], - returnAll: [ - false, - ], + resource: ['contact'], + operation: ['getAll'], + returnAll: [false], }, }, }, @@ -435,12 +400,8 @@ export const contactFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'contact', - ], - operation: [ - 'update', - ], + resource: ['contact'], + operation: ['update'], }, }, }, @@ -452,12 +413,8 @@ export const contactFields: INodeProperties[] = [ default: {}, displayOptions: { show: { - resource: [ - 'contact', - ], - operation: [ - 'update', - ], + resource: ['contact'], + operation: ['update'], }, }, options: [ @@ -476,7 +433,8 @@ export const contactFields: INodeProperties[] = [ typeOptions: { loadOptionsMethod: 'getCampaigns', }, - description: 'ID of the campaign that led your contact to your webapp. Choose from the list, or specify an ID using an expression.', + description: + 'ID of the campaign that led your contact to your webapp. Choose from the list, or specify an ID using an expression.', }, { displayName: 'City', @@ -493,7 +451,8 @@ export const contactFields: INodeProperties[] = [ typeOptions: { loadOptionsMethod: 'getContactStatuses', }, - description: 'ID of the contact status that the contact belongs to. Choose from the list, or specify an ID using an expression.', + description: + 'ID of the contact status that the contact belongs to. Choose from the list, or specify an ID using an expression.', }, { displayName: 'Country', @@ -552,7 +511,8 @@ export const contactFields: INodeProperties[] = [ typeOptions: { loadOptionsMethod: 'getLeadSources', }, - description: 'ID of the source where contact came from. Choose from the list, or specify an ID using an expression.', + description: + 'ID of the source where contact came from. Choose from the list, or specify an ID using an expression.', }, { displayName: 'Lifecycle Stage Name or ID', @@ -562,7 +522,8 @@ export const contactFields: INodeProperties[] = [ typeOptions: { loadOptionsMethod: 'getLifecycleStages', }, - description: 'ID of the lifecycle stage that the contact belongs to. Choose from the list, or specify an ID using an expression.', + description: + 'ID of the lifecycle stage that the contact belongs to. Choose from the list, or specify an ID using an expression.', }, { displayName: 'LinkedIn', @@ -593,7 +554,8 @@ export const contactFields: INodeProperties[] = [ typeOptions: { loadOptionsMethod: 'getUsers', }, - description: 'ID of the user to whom the contact is assigned. Choose from the list, or specify an ID using an expression.', + description: + 'ID of the user to whom the contact is assigned. Choose from the list, or specify an ID using an expression.', }, { displayName: 'Sales Account Names or IDs', @@ -603,7 +565,8 @@ export const contactFields: INodeProperties[] = [ typeOptions: { loadOptionsMethod: 'getAccounts', }, - description: 'Accounts which contact belongs to. Choose from the list, or specify IDs using an expression.', + description: + 'Accounts which contact belongs to. Choose from the list, or specify IDs using an expression.', }, { displayName: 'State', @@ -620,7 +583,8 @@ export const contactFields: INodeProperties[] = [ typeOptions: { loadOptionsMethod: 'getSubscriptionStatuses', }, - description: 'Status of subscription that the contact is in. Choose from the list, or specify an ID using an expression.', + description: + 'Status of subscription that the contact is in. Choose from the list, or specify an ID using an expression.', }, { displayName: 'Subscription Types Name or ID', @@ -630,7 +594,8 @@ export const contactFields: INodeProperties[] = [ typeOptions: { loadOptionsMethod: 'getSubscriptionTypes', }, - description: 'Type of subscription that the contact is in. Choose from the list, or specify an ID using an expression.', + description: + 'Type of subscription that the contact is in. Choose from the list, or specify an ID using an expression.', }, { displayName: 'Territory Name or ID', @@ -640,7 +605,8 @@ export const contactFields: INodeProperties[] = [ typeOptions: { loadOptionsMethod: 'getTerritories', }, - description: 'ID of the territory that the contact belongs to. Choose from the list, or specify an ID using an expression.', + description: + 'ID of the territory that the contact belongs to. Choose from the list, or specify an ID using an expression.', }, { displayName: 'Time Zone', diff --git a/packages/nodes-base/nodes/FreshworksCrm/descriptions/DealDescription.ts b/packages/nodes-base/nodes/FreshworksCrm/descriptions/DealDescription.ts index e0f76a5efc2de..fab74fa27fb0c 100644 --- a/packages/nodes-base/nodes/FreshworksCrm/descriptions/DealDescription.ts +++ b/packages/nodes-base/nodes/FreshworksCrm/descriptions/DealDescription.ts @@ -1,6 +1,4 @@ -import { - INodeProperties, -} from 'n8n-workflow'; +import { INodeProperties } from 'n8n-workflow'; export const dealOperations: INodeProperties[] = [ { @@ -10,9 +8,7 @@ export const dealOperations: INodeProperties[] = [ noDataExpression: true, displayOptions: { show: { - resource: [ - 'deal', - ], + resource: ['deal'], }, }, options: [ @@ -64,12 +60,8 @@ export const dealFields: INodeProperties[] = [ default: 0, displayOptions: { show: { - resource: [ - 'deal', - ], - operation: [ - 'create', - ], + resource: ['deal'], + operation: ['create'], }, }, }, @@ -82,12 +74,8 @@ export const dealFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'deal', - ], - operation: [ - 'create', - ], + resource: ['deal'], + operation: ['create'], }, }, }, @@ -99,12 +87,8 @@ export const dealFields: INodeProperties[] = [ default: {}, displayOptions: { show: { - resource: [ - 'deal', - ], - operation: [ - 'create', - ], + resource: ['deal'], + operation: ['create'], }, }, options: [ @@ -123,7 +107,8 @@ export const dealFields: INodeProperties[] = [ typeOptions: { loadOptionsMethod: 'getCampaigns', }, - description: 'ID of the campaign that landed this deal. Choose from the list, or specify an ID using an expression.', + description: + 'ID of the campaign that landed this deal. Choose from the list, or specify an ID using an expression.', }, { displayName: 'Currency Name or ID', @@ -133,7 +118,8 @@ export const dealFields: INodeProperties[] = [ typeOptions: { loadOptionsMethod: 'getCurrencies', }, - description: 'ID of the currency that the deal belongs to. Choose from the list, or specify an ID using an expression.', + description: + 'ID of the currency that the deal belongs to. Choose from the list, or specify an ID using an expression.', }, { displayName: 'Deal Payment Status Name or ID', @@ -143,7 +129,8 @@ export const dealFields: INodeProperties[] = [ typeOptions: { loadOptionsMethod: 'getDealPaymentStatuses', }, - description: 'ID of the mode of payment for the deal. Choose from the list, or specify an ID using an expression.', + description: + 'ID of the mode of payment for the deal. Choose from the list, or specify an ID using an expression.', }, { displayName: 'Deal Pipeline Name or ID', @@ -153,7 +140,8 @@ export const dealFields: INodeProperties[] = [ typeOptions: { loadOptionsMethod: 'getDealPipelines', }, - description: 'ID of the deal pipeline that it belongs to. Choose from the list, or specify an ID using an expression.', + description: + 'ID of the deal pipeline that it belongs to. Choose from the list, or specify an ID using an expression.', }, { displayName: 'Deal Product Name or ID', @@ -163,7 +151,8 @@ export const dealFields: INodeProperties[] = [ typeOptions: { loadOptionsMethod: 'getDealProducts', }, - description: 'ID of the product that the deal belongs to (in a multi-product company). Choose from the list, or specify an ID using an expression.', + description: + 'ID of the product that the deal belongs to (in a multi-product company). Choose from the list, or specify an ID using an expression.', }, { displayName: 'Deal Reason Name or ID', @@ -173,7 +162,8 @@ export const dealFields: INodeProperties[] = [ typeOptions: { loadOptionsMethod: 'getDealReasons', }, - description: 'ID of the reason for losing the deal. Can only be set if the deal is in \'Lost\' stage. Choose from the list, or specify an ID using an expression.', + description: + 'ID of the reason for losing the deal. Can only be set if the deal is in \'Lost\' stage. Choose from the list, or specify an ID using an expression.', }, { displayName: 'Deal Stage Name or ID', @@ -183,7 +173,8 @@ export const dealFields: INodeProperties[] = [ typeOptions: { loadOptionsMethod: 'getDealStages', }, - description: 'ID of the deal stage that the deal belongs to. Choose from the list, or specify an ID using an expression.', + description: + 'ID of the deal stage that the deal belongs to. Choose from the list, or specify an ID using an expression.', }, { displayName: 'Deal Type Name or ID', @@ -193,7 +184,8 @@ export const dealFields: INodeProperties[] = [ typeOptions: { loadOptionsMethod: 'getDealTypes', }, - description: 'ID of the deal type that the deal belongs to. Choose from the list, or specify an ID using an expression.', + description: + 'ID of the deal type that the deal belongs to. Choose from the list, or specify an ID using an expression.', }, { displayName: 'Lead Source ID', @@ -210,7 +202,8 @@ export const dealFields: INodeProperties[] = [ typeOptions: { loadOptionsMethod: 'getUsers', }, - description: 'ID of the user to whom the deal is assigned. Choose from the list, or specify an ID using an expression.', + description: + 'ID of the user to whom the deal is assigned. Choose from the list, or specify an ID using an expression.', }, { displayName: 'Probability', @@ -231,7 +224,8 @@ export const dealFields: INodeProperties[] = [ typeOptions: { loadOptionsMethod: 'getAccounts', }, - description: 'ID of the account that the deal belongs to. Choose from the list, or specify an ID using an expression.', + description: + 'ID of the account that the deal belongs to. Choose from the list, or specify an ID using an expression.', }, { displayName: 'Territory Name or ID', @@ -241,7 +235,8 @@ export const dealFields: INodeProperties[] = [ typeOptions: { loadOptionsMethod: 'getTerritories', }, - description: 'ID of the territory that the deal belongs to. Choose from the list, or specify an ID using an expression.', + description: + 'ID of the territory that the deal belongs to. Choose from the list, or specify an ID using an expression.', }, ], }, @@ -258,12 +253,8 @@ export const dealFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'deal', - ], - operation: [ - 'delete', - ], + resource: ['deal'], + operation: ['delete'], }, }, }, @@ -280,12 +271,8 @@ export const dealFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'deal', - ], - operation: [ - 'get', - ], + resource: ['deal'], + operation: ['get'], }, }, }, @@ -297,15 +284,12 @@ export const dealFields: INodeProperties[] = [ displayName: 'View Name or ID', name: 'view', type: 'options', - description: 'Choose from the list, or specify an ID using an expression', + description: + 'Choose from the list, or specify an ID using an expression', displayOptions: { show: { - resource: [ - 'deal', - ], - operation: [ - 'getAll', - ], + resource: ['deal'], + operation: ['getAll'], }, }, typeOptions: { @@ -321,12 +305,8 @@ export const dealFields: INodeProperties[] = [ description: 'Whether to return all results or only up to a given limit', displayOptions: { show: { - resource: [ - 'deal', - ], - operation: [ - 'getAll', - ], + resource: ['deal'], + operation: ['getAll'], }, }, }, @@ -341,15 +321,9 @@ export const dealFields: INodeProperties[] = [ }, displayOptions: { show: { - resource: [ - 'deal', - ], - operation: [ - 'getAll', - ], - returnAll: [ - false, - ], + resource: ['deal'], + operation: ['getAll'], + returnAll: [false], }, }, }, @@ -366,12 +340,8 @@ export const dealFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'deal', - ], - operation: [ - 'update', - ], + resource: ['deal'], + operation: ['update'], }, }, }, @@ -383,12 +353,8 @@ export const dealFields: INodeProperties[] = [ default: {}, displayOptions: { show: { - resource: [ - 'deal', - ], - operation: [ - 'update', - ], + resource: ['deal'], + operation: ['update'], }, }, options: [ @@ -420,7 +386,8 @@ export const dealFields: INodeProperties[] = [ typeOptions: { loadOptionsMethod: 'getCampaigns', }, - description: 'ID of the campaign that landed this deal. Choose from the list, or specify an ID using an expression.', + description: + 'ID of the campaign that landed this deal. Choose from the list, or specify an ID using an expression.', }, { displayName: 'Currency Name or ID', @@ -430,7 +397,8 @@ export const dealFields: INodeProperties[] = [ typeOptions: { loadOptionsMethod: 'getCurrencies', }, - description: 'ID of the currency that the deal belongs to. Choose from the list, or specify an ID using an expression.', + description: + 'ID of the currency that the deal belongs to. Choose from the list, or specify an ID using an expression.', }, { displayName: 'Deal Payment Status Name or ID', @@ -440,7 +408,8 @@ export const dealFields: INodeProperties[] = [ typeOptions: { loadOptionsMethod: 'getDealPaymentStatuses', }, - description: 'ID of the mode of payment for the deal. Choose from the list, or specify an ID using an expression.', + description: + 'ID of the mode of payment for the deal. Choose from the list, or specify an ID using an expression.', }, { displayName: 'Deal Pipeline Name or ID', @@ -450,7 +419,8 @@ export const dealFields: INodeProperties[] = [ typeOptions: { loadOptionsMethod: 'getDealPipelines', }, - description: 'ID of the deal pipeline that it belongs to. Choose from the list, or specify an ID using an expression.', + description: + 'ID of the deal pipeline that it belongs to. Choose from the list, or specify an ID using an expression.', }, { displayName: 'Deal Product Name or ID', @@ -460,7 +430,8 @@ export const dealFields: INodeProperties[] = [ typeOptions: { loadOptionsMethod: 'getDealProducts', }, - description: 'ID of the product that the deal belongs to (in a multi-product company). Choose from the list, or specify an ID using an expression.', + description: + 'ID of the product that the deal belongs to (in a multi-product company). Choose from the list, or specify an ID using an expression.', }, { displayName: 'Deal Reason Name or ID', @@ -470,7 +441,8 @@ export const dealFields: INodeProperties[] = [ typeOptions: { loadOptionsMethod: 'getDealReasons', }, - description: 'ID of the reason for losing the deal. Can only be set if the deal is in \'Lost\' stage. Choose from the list, or specify an ID using an expression.', + description: + 'ID of the reason for losing the deal. Can only be set if the deal is in \'Lost\' stage. Choose from the list, or specify an ID using an expression.', }, { displayName: 'Deal Stage Name or ID', @@ -480,7 +452,8 @@ export const dealFields: INodeProperties[] = [ typeOptions: { loadOptionsMethod: 'getDealStages', }, - description: 'ID of the deal stage that the deal belongs to. Choose from the list, or specify an ID using an expression.', + description: + 'ID of the deal stage that the deal belongs to. Choose from the list, or specify an ID using an expression.', }, { displayName: 'Deal Type Name or ID', @@ -490,7 +463,8 @@ export const dealFields: INodeProperties[] = [ typeOptions: { loadOptionsMethod: 'getDealTypes', }, - description: 'ID of the deal type that the deal belongs to. Choose from the list, or specify an ID using an expression.', + description: + 'ID of the deal type that the deal belongs to. Choose from the list, or specify an ID using an expression.', }, { displayName: 'Lead Source ID', @@ -514,7 +488,8 @@ export const dealFields: INodeProperties[] = [ typeOptions: { loadOptionsMethod: 'getUsers', }, - description: 'ID of the user to whom the deal is assigned. Choose from the list, or specify an ID using an expression.', + description: + 'ID of the user to whom the deal is assigned. Choose from the list, or specify an ID using an expression.', }, { displayName: 'Probability', @@ -535,7 +510,8 @@ export const dealFields: INodeProperties[] = [ typeOptions: { loadOptionsMethod: 'getAccounts', }, - description: 'ID of the account that the deal belongs to. Choose from the list, or specify an ID using an expression.', + description: + 'ID of the account that the deal belongs to. Choose from the list, or specify an ID using an expression.', }, { displayName: 'Territory Name or ID', @@ -545,7 +521,8 @@ export const dealFields: INodeProperties[] = [ typeOptions: { loadOptionsMethod: 'getTerritories', }, - description: 'ID of the territory that the deal belongs to. Choose from the list, or specify an ID using an expression.', + description: + 'ID of the territory that the deal belongs to. Choose from the list, or specify an ID using an expression.', }, ], }, diff --git a/packages/nodes-base/nodes/FreshworksCrm/descriptions/NoteDescription.ts b/packages/nodes-base/nodes/FreshworksCrm/descriptions/NoteDescription.ts index ba964868f2ee6..a20d0f31d4ac3 100644 --- a/packages/nodes-base/nodes/FreshworksCrm/descriptions/NoteDescription.ts +++ b/packages/nodes-base/nodes/FreshworksCrm/descriptions/NoteDescription.ts @@ -1,6 +1,4 @@ -import { - INodeProperties, -} from 'n8n-workflow'; +import { INodeProperties } from 'n8n-workflow'; export const noteOperations: INodeProperties[] = [ { @@ -10,9 +8,7 @@ export const noteOperations: INodeProperties[] = [ noDataExpression: true, displayOptions: { show: { - resource: [ - 'note', - ], + resource: ['note'], }, }, options: [ @@ -55,12 +51,8 @@ export const noteFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'note', - ], - operation: [ - 'create', - ], + resource: ['note'], + operation: ['create'], }, }, }, @@ -87,30 +79,23 @@ export const noteFields: INodeProperties[] = [ ], displayOptions: { show: { - resource: [ - 'note', - ], - operation: [ - 'create', - ], + resource: ['note'], + operation: ['create'], }, }, }, { displayName: 'Target ID', name: 'targetable_id', - description: 'ID of the entity for which note is created. The type of entity is selected in "Target Type".', + description: + 'ID of the entity for which note is created. The type of entity is selected in "Target Type".', type: 'string', required: true, default: '', displayOptions: { show: { - resource: [ - 'note', - ], - operation: [ - 'create', - ], + resource: ['note'], + operation: ['create'], }, }, }, @@ -127,12 +112,8 @@ export const noteFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'note', - ], - operation: [ - 'delete', - ], + resource: ['note'], + operation: ['delete'], }, }, }, @@ -149,12 +130,8 @@ export const noteFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'note', - ], - operation: [ - 'update', - ], + resource: ['note'], + operation: ['update'], }, }, }, @@ -166,12 +143,8 @@ export const noteFields: INodeProperties[] = [ default: {}, displayOptions: { show: { - resource: [ - 'note', - ], - operation: [ - 'update', - ], + resource: ['note'], + operation: ['update'], }, }, options: [ diff --git a/packages/nodes-base/nodes/FreshworksCrm/descriptions/SalesActivityDescription.ts b/packages/nodes-base/nodes/FreshworksCrm/descriptions/SalesActivityDescription.ts index f7c30416ee8b6..45cdbbccbce4c 100644 --- a/packages/nodes-base/nodes/FreshworksCrm/descriptions/SalesActivityDescription.ts +++ b/packages/nodes-base/nodes/FreshworksCrm/descriptions/SalesActivityDescription.ts @@ -1,6 +1,4 @@ -import { - INodeProperties, -} from 'n8n-workflow'; +import { INodeProperties } from 'n8n-workflow'; export const salesActivityOperations: INodeProperties[] = [ { @@ -10,9 +8,7 @@ export const salesActivityOperations: INodeProperties[] = [ noDataExpression: true, displayOptions: { show: { - resource: [ - 'salesActivity', - ], + resource: ['salesActivity'], }, }, options: [ @@ -60,15 +56,12 @@ export const salesActivityFields: INodeProperties[] = [ typeOptions: { loadOptionsMethod: 'getSalesActivityTypes', }, - description: 'ID of a sales activity type for which the sales activity is created. Choose from the list, or specify an ID using an expression.', + description: + 'ID of a sales activity type for which the sales activity is created. Choose from the list, or specify an ID using an expression.', displayOptions: { show: { - resource: [ - 'salesActivity', - ], - operation: [ - 'create', - ], + resource: ['salesActivity'], + operation: ['create'], }, }, }, @@ -81,19 +74,16 @@ export const salesActivityFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'salesActivity', - ], - operation: [ - 'create', - ], + resource: ['salesActivity'], + operation: ['create'], }, }, }, { displayName: 'Owner Name or ID', name: 'ownerId', - description: 'ID of the user who owns the sales activity. Choose from the list, or specify an ID using an expression.', + description: + 'ID of the user who owns the sales activity. Choose from the list, or specify an ID using an expression.', type: 'options', default: '', typeOptions: { @@ -102,12 +92,8 @@ export const salesActivityFields: INodeProperties[] = [ required: true, displayOptions: { show: { - resource: [ - 'salesActivity', - ], - operation: [ - 'create', - ], + resource: ['salesActivity'], + operation: ['create'], }, }, }, @@ -120,12 +106,8 @@ export const salesActivityFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'salesActivity', - ], - operation: [ - 'create', - ], + resource: ['salesActivity'], + operation: ['create'], }, }, }, @@ -138,12 +120,8 @@ export const salesActivityFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'salesActivity', - ], - operation: [ - 'create', - ], + resource: ['salesActivity'], + operation: ['create'], }, }, }, @@ -170,30 +148,23 @@ export const salesActivityFields: INodeProperties[] = [ ], displayOptions: { show: { - resource: [ - 'salesActivity', - ], - operation: [ - 'create', - ], + resource: ['salesActivity'], + operation: ['create'], }, }, }, { displayName: 'Target ID', name: 'targetable_id', - description: 'ID of the entity for which the sales activity is created. The type of entity is selected in "Target Type".', + description: + 'ID of the entity for which the sales activity is created. The type of entity is selected in "Target Type".', type: 'string', required: true, default: '', displayOptions: { show: { - resource: [ - 'salesActivity', - ], - operation: [ - 'create', - ], + resource: ['salesActivity'], + operation: ['create'], }, }, }, @@ -205,12 +176,8 @@ export const salesActivityFields: INodeProperties[] = [ default: {}, displayOptions: { show: { - resource: [ - 'salesActivity', - ], - operation: [ - 'create', - ], + resource: ['salesActivity'], + operation: ['create'], }, }, options: [ @@ -222,7 +189,8 @@ export const salesActivityFields: INodeProperties[] = [ typeOptions: { loadOptionsMethod: 'getUsers', }, - description: 'ID of the user who created the sales activity. Choose from the list, or specify an ID using an expression.', + description: + 'ID of the user who created the sales activity. Choose from the list, or specify an ID using an expression.', }, { displayName: 'Latitude', @@ -260,7 +228,8 @@ export const salesActivityFields: INodeProperties[] = [ typeOptions: { loadOptionsMethod: 'getOutcomes', }, - description: 'ID of a sales activity\'s outcome. Choose from the list, or specify an ID using an expression.', + description: + 'ID of a sales activity\'s outcome. Choose from the list, or specify an ID using an expression.', }, ], }, @@ -277,12 +246,8 @@ export const salesActivityFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'salesActivity', - ], - operation: [ - 'delete', - ], + resource: ['salesActivity'], + operation: ['delete'], }, }, }, @@ -299,12 +264,8 @@ export const salesActivityFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'salesActivity', - ], - operation: [ - 'get', - ], + resource: ['salesActivity'], + operation: ['get'], }, }, }, @@ -320,12 +281,8 @@ export const salesActivityFields: INodeProperties[] = [ description: 'Whether to return all results or only up to a given limit', displayOptions: { show: { - resource: [ - 'salesActivity', - ], - operation: [ - 'getAll', - ], + resource: ['salesActivity'], + operation: ['getAll'], }, }, }, @@ -340,15 +297,9 @@ export const salesActivityFields: INodeProperties[] = [ }, displayOptions: { show: { - resource: [ - 'salesActivity', - ], - operation: [ - 'getAll', - ], - returnAll: [ - false, - ], + resource: ['salesActivity'], + operation: ['getAll'], + returnAll: [false], }, }, }, @@ -365,12 +316,8 @@ export const salesActivityFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'salesActivity', - ], - operation: [ - 'update', - ], + resource: ['salesActivity'], + operation: ['update'], }, }, }, @@ -382,12 +329,8 @@ export const salesActivityFields: INodeProperties[] = [ default: {}, displayOptions: { show: { - resource: [ - 'salesActivity', - ], - operation: [ - 'update', - ], + resource: ['salesActivity'], + operation: ['update'], }, }, options: [ @@ -399,7 +342,8 @@ export const salesActivityFields: INodeProperties[] = [ typeOptions: { loadOptionsMethod: 'getUsers', }, - description: 'ID of the user who created the sales activity. Choose from the list, or specify an ID using an expression.', + description: + 'ID of the user who created the sales activity. Choose from the list, or specify an ID using an expression.', }, { displayName: 'Start Date', @@ -444,7 +388,8 @@ export const salesActivityFields: INodeProperties[] = [ typeOptions: { loadOptionsMethod: 'getUsers', }, - description: 'ID of the user who owns the sales activity. Choose from the list, or specify an ID using an expression.', + description: + 'ID of the user who owns the sales activity. Choose from the list, or specify an ID using an expression.', }, { displayName: 'Sales Activity Outcome Name or ID', @@ -454,7 +399,8 @@ export const salesActivityFields: INodeProperties[] = [ typeOptions: { loadOptionsMethod: 'getOutcomes', }, - description: 'ID of a sales activity\'s outcome. Choose from the list, or specify an ID using an expression.', + description: + 'ID of a sales activity\'s outcome. Choose from the list, or specify an ID using an expression.', }, { displayName: 'Sales Activity Type Name or ID', @@ -464,7 +410,8 @@ export const salesActivityFields: INodeProperties[] = [ typeOptions: { loadOptionsMethod: 'getSalesActivityTypes', }, - description: 'ID of a sales activity type for which the sales activity is updated. Choose from the list, or specify an ID using an expression.', + description: + 'ID of a sales activity type for which the sales activity is updated. Choose from the list, or specify an ID using an expression.', }, { displayName: 'Start Date', @@ -478,7 +425,8 @@ export const salesActivityFields: INodeProperties[] = [ name: 'targetable_id', type: 'string', default: '', - description: 'ID of the entity for which the sales activity is updated. The type of entity is selected in "Target Type".', + description: + 'ID of the entity for which the sales activity is updated. The type of entity is selected in "Target Type".', }, { displayName: 'Target Type', diff --git a/packages/nodes-base/nodes/FreshworksCrm/descriptions/SearchDescription.ts b/packages/nodes-base/nodes/FreshworksCrm/descriptions/SearchDescription.ts index ed2a6bb20d14b..fd3ac017f9d95 100644 --- a/packages/nodes-base/nodes/FreshworksCrm/descriptions/SearchDescription.ts +++ b/packages/nodes-base/nodes/FreshworksCrm/descriptions/SearchDescription.ts @@ -1,6 +1,4 @@ -import { - INodeProperties, -} from 'n8n-workflow'; +import { INodeProperties } from 'n8n-workflow'; export const searchOperations: INodeProperties[] = [ { @@ -10,9 +8,7 @@ export const searchOperations: INodeProperties[] = [ noDataExpression: true, displayOptions: { show: { - resource: [ - 'search', - ], + resource: ['search'], }, }, options: [ @@ -45,12 +41,8 @@ export const searchFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'search', - ], - operation: [ - 'query', - ], + resource: ['search'], + operation: ['query'], }, }, description: 'Enter a term that will be used for searching entities', @@ -81,12 +73,8 @@ export const searchFields: INodeProperties[] = [ default: [], displayOptions: { show: { - resource: [ - 'search', - ], - operation: [ - 'query', - ], + resource: ['search'], + operation: ['query'], }, }, description: 'Enter a term that will be used for searching entities', @@ -98,12 +86,8 @@ export const searchFields: INodeProperties[] = [ default: false, displayOptions: { show: { - resource: [ - 'search', - ], - operation: [ - 'query', - ], + resource: ['search'], + operation: ['query'], }, }, description: 'Whether to return all results or only up to a given limit', @@ -118,15 +102,9 @@ export const searchFields: INodeProperties[] = [ default: 25, displayOptions: { show: { - resource: [ - 'search', - ], - operation: [ - 'query', - ], - returnAll: [ - false, - ], + resource: ['search'], + operation: ['query'], + returnAll: [false], }, }, description: 'Max number of results to return', @@ -150,19 +128,16 @@ export const searchFields: INodeProperties[] = [ { name: 'Custom Field', value: 'customField', - description: 'Only allowed custom fields of type "Text field", "Number", "Dropdown" or "Radio button"', + description: + 'Only allowed custom fields of type "Text field", "Number", "Dropdown" or "Radio button"', }, ], required: true, default: '', displayOptions: { show: { - resource: [ - 'search', - ], - operation: [ - 'lookup', - ], + resource: ['search'], + operation: ['lookup'], }, }, description: 'Field against which the entities have to be searched', @@ -175,15 +150,9 @@ export const searchFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'search', - ], - operation: [ - 'lookup', - ], - searchField: [ - 'customField', - ], + resource: ['search'], + operation: ['lookup'], + searchField: ['customField'], }, }, }, @@ -195,15 +164,9 @@ export const searchFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'search', - ], - operation: [ - 'lookup', - ], - searchField: [ - 'customField', - ], + resource: ['search'], + operation: ['lookup'], + searchField: ['customField'], }, }, }, @@ -215,16 +178,9 @@ export const searchFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'search', - ], - operation: [ - 'lookup', - ], - searchField: [ - 'email', - 'name', - ], + resource: ['search'], + operation: ['lookup'], + searchField: ['email', 'name'], }, }, }, @@ -236,12 +192,8 @@ export const searchFields: INodeProperties[] = [ default: {}, displayOptions: { show: { - resource: [ - 'search', - ], - operation: [ - 'lookup', - ], + resource: ['search'], + operation: ['lookup'], }, }, options: [ @@ -264,8 +216,8 @@ export const searchFields: INodeProperties[] = [ value: 'sales_account', }, ], - // eslint-disable-next-line n8n-nodes-base/node-param-description-unneeded-backticks - description: `Use 'entities' to query against related entities. You can include multiple entities at once, provided the field is available in both entities or else you'd receive an error response.`, + // eslint-disable-next-line n8n-nodes-base/node-param-description-unneeded-backticks + description: `Use 'entities' to query against related entities. You can include multiple entities at once, provided the field is available in both entities or else you'd receive an error response.`, }, ], }, diff --git a/packages/nodes-base/nodes/FreshworksCrm/descriptions/TaskDescription.ts b/packages/nodes-base/nodes/FreshworksCrm/descriptions/TaskDescription.ts index 5a43c4c2252f5..b23d49eb43570 100644 --- a/packages/nodes-base/nodes/FreshworksCrm/descriptions/TaskDescription.ts +++ b/packages/nodes-base/nodes/FreshworksCrm/descriptions/TaskDescription.ts @@ -1,6 +1,4 @@ -import { - INodeProperties, -} from 'n8n-workflow'; +import { INodeProperties } from 'n8n-workflow'; export const taskOperations: INodeProperties[] = [ { @@ -10,9 +8,7 @@ export const taskOperations: INodeProperties[] = [ noDataExpression: true, displayOptions: { show: { - resource: [ - 'task', - ], + resource: ['task'], }, }, options: [ @@ -64,12 +60,8 @@ export const taskFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'task', - ], - operation: [ - 'create', - ], + resource: ['task'], + operation: ['create'], }, }, }, @@ -82,19 +74,16 @@ export const taskFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'task', - ], - operation: [ - 'create', - ], + resource: ['task'], + operation: ['create'], }, }, }, { displayName: 'Owner Name or ID', name: 'ownerId', - description: 'ID of the user to whom the task is assigned. Choose from the list, or specify an ID using an expression.', + description: + 'ID of the user to whom the task is assigned. Choose from the list, or specify an ID using an expression.', type: 'options', default: '', typeOptions: { @@ -103,12 +92,8 @@ export const taskFields: INodeProperties[] = [ required: true, displayOptions: { show: { - resource: [ - 'task', - ], - operation: [ - 'create', - ], + resource: ['task'], + operation: ['create'], }, }, }, @@ -135,30 +120,23 @@ export const taskFields: INodeProperties[] = [ ], displayOptions: { show: { - resource: [ - 'task', - ], - operation: [ - 'create', - ], + resource: ['task'], + operation: ['create'], }, }, }, { displayName: 'Target ID', name: 'targetable_id', - description: 'ID of the entity for which the task is created. The type of entity is selected in "Target Type".', + description: + 'ID of the entity for which the task is created. The type of entity is selected in "Target Type".', type: 'string', default: '', required: true, displayOptions: { show: { - resource: [ - 'task', - ], - operation: [ - 'create', - ], + resource: ['task'], + operation: ['create'], }, }, }, @@ -170,12 +148,8 @@ export const taskFields: INodeProperties[] = [ default: {}, displayOptions: { show: { - resource: [ - 'task', - ], - operation: [ - 'create', - ], + resource: ['task'], + operation: ['create'], }, }, options: [ @@ -187,7 +161,8 @@ export const taskFields: INodeProperties[] = [ typeOptions: { loadOptionsMethod: 'getUsers', }, - description: 'ID of the user who created the task. Choose from the list, or specify an ID using an expression.', + description: + 'ID of the user who created the task. Choose from the list, or specify an ID using an expression.', }, { displayName: 'Outcome Name or ID', @@ -197,7 +172,8 @@ export const taskFields: INodeProperties[] = [ typeOptions: { loadOptionsMethod: 'getOutcomes', }, - description: 'ID of the outcome of the task. Choose from the list, or specify an ID using an expression.', + description: + 'ID of the outcome of the task. Choose from the list, or specify an ID using an expression.', }, { displayName: 'Task Type ID', @@ -221,12 +197,8 @@ export const taskFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'task', - ], - operation: [ - 'delete', - ], + resource: ['task'], + operation: ['delete'], }, }, }, @@ -243,12 +215,8 @@ export const taskFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'task', - ], - operation: [ - 'get', - ], + resource: ['task'], + operation: ['get'], }, }, }, @@ -264,12 +232,8 @@ export const taskFields: INodeProperties[] = [ description: 'Whether to return all results or only up to a given limit', displayOptions: { show: { - resource: [ - 'task', - ], - operation: [ - 'getAll', - ], + resource: ['task'], + operation: ['getAll'], }, }, }, @@ -284,15 +248,9 @@ export const taskFields: INodeProperties[] = [ }, displayOptions: { show: { - resource: [ - 'task', - ], - operation: [ - 'getAll', - ], - returnAll: [ - false, - ], + resource: ['task'], + operation: ['getAll'], + returnAll: [false], }, }, }, @@ -304,12 +262,8 @@ export const taskFields: INodeProperties[] = [ placeholder: 'Add Filter', displayOptions: { show: { - resource: [ - 'task', - ], - operation: [ - 'getAll', - ], + resource: ['task'], + operation: ['getAll'], }, }, options: [ @@ -376,12 +330,8 @@ export const taskFields: INodeProperties[] = [ default: '', displayOptions: { show: { - resource: [ - 'task', - ], - operation: [ - 'update', - ], + resource: ['task'], + operation: ['update'], }, }, }, @@ -393,12 +343,8 @@ export const taskFields: INodeProperties[] = [ default: {}, displayOptions: { show: { - resource: [ - 'task', - ], - operation: [ - 'update', - ], + resource: ['task'], + operation: ['update'], }, }, options: [ @@ -410,7 +356,8 @@ export const taskFields: INodeProperties[] = [ typeOptions: { loadOptionsMethod: 'getUsers', }, - description: 'ID of the user who created the sales activity. Choose from the list, or specify an ID using an expression.', + description: + 'ID of the user who created the sales activity. Choose from the list, or specify an ID using an expression.', }, { displayName: 'Due Date', @@ -427,7 +374,8 @@ export const taskFields: INodeProperties[] = [ typeOptions: { loadOptionsMethod: 'getOutcomes', }, - description: 'ID of the outcome of the task. Choose from the list, or specify an ID using an expression.', + description: + 'ID of the outcome of the task. Choose from the list, or specify an ID using an expression.', }, { displayName: 'Owner Name or ID', @@ -437,14 +385,16 @@ export const taskFields: INodeProperties[] = [ typeOptions: { loadOptionsMethod: 'getUsers', }, - description: 'ID of the user to whom the task is assigned. Choose from the list, or specify an ID using an expression.', + description: + 'ID of the user to whom the task is assigned. Choose from the list, or specify an ID using an expression.', }, { displayName: 'Target ID', name: 'targetable_id', type: 'string', default: '', - description: 'ID of the entity for which the task is updated. The type of entity is selected in "Target Type".', + description: + 'ID of the entity for which the task is updated. The type of entity is selected in "Target Type".', }, { displayName: 'Target Type',