From a380a9a3941e9059668aaf478555fee045827b1a Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Mon, 4 May 2020 08:56:01 +0200 Subject: [PATCH 001/241] :zap: Add first basic code for external hooks --- packages/cli/commands/start.ts | 7 ++ packages/cli/config/index.ts | 7 ++ packages/cli/src/ExternalHooks.ts | 89 +++++++++++++++++++ packages/cli/src/Interfaces.ts | 5 ++ packages/cli/src/Server.ts | 7 ++ .../cli/src/externalHooksTemp/test-hooks.ts | 10 +++ packages/cli/src/index.ts | 1 + 7 files changed, 126 insertions(+) create mode 100644 packages/cli/src/ExternalHooks.ts create mode 100644 packages/cli/src/externalHooksTemp/test-hooks.ts diff --git a/packages/cli/commands/start.ts b/packages/cli/commands/start.ts index 4e2efaacfd..65edec601d 100644 --- a/packages/cli/commands/start.ts +++ b/packages/cli/commands/start.ts @@ -12,6 +12,7 @@ import { ActiveWorkflowRunner, CredentialTypes, Db, + ExternalHooks, GenericHelpers, LoadNodesAndCredentials, NodeTypes, @@ -108,6 +109,12 @@ export class Start extends Command { const loadNodesAndCredentials = LoadNodesAndCredentials(); await loadNodesAndCredentials.init(); + // Load all external hooks + const externalHooks = ExternalHooks(); + await externalHooks.init(); + + // await externalHooks.run('credentials.new'); + // Add the found types to an instance other parts of the application can use const nodeTypes = NodeTypes(); await nodeTypes.init(loadNodesAndCredentials.nodeTypes); diff --git a/packages/cli/config/index.ts b/packages/cli/config/index.ts index 69b3154064..5705a5fc7d 100644 --- a/packages/cli/config/index.ts +++ b/packages/cli/config/index.ts @@ -252,6 +252,13 @@ const config = convict({ }, }, + externalHookFiles: { + doc: 'Files containing external hooks', + format: String, + default: '', + env: 'EXTERNAL_HOOK_FILES' + }, + nodes: { exclude: { doc: 'Nodes not to load', diff --git a/packages/cli/src/ExternalHooks.ts b/packages/cli/src/ExternalHooks.ts new file mode 100644 index 0000000000..2c00a525c6 --- /dev/null +++ b/packages/cli/src/ExternalHooks.ts @@ -0,0 +1,89 @@ +import { + Db, + IDatabaseCollections, + IExternalHooks, +} from "./"; + +import * as config from '../config'; +// import { +// access as fsAccess, +// readdir as fsReaddir, +// readFile as fsReadFile, +// stat as fsStat, +// } from 'fs'; + +// TODO: Give different name +interface IHookData { + DbCollections: IDatabaseCollections; +} + +// export EXTERNAL_HOOK_FILES=/data/packages/cli/dist/src/externalHooksTemp/test-hooks.js + +class ExternalHooksClass implements IExternalHooks { + + externalHooks: { + [key: string]: Array<() => {}> + } = {}; + + + async init(): Promise { + console.log('ExternalHooks.init'); + + const externalHookFiles = config.get('externalHookFiles').split(','); + + console.log('externalHookFiles'); + console.log(externalHookFiles); + + for (let hookFilePath of externalHookFiles) { + hookFilePath = hookFilePath.trim(); + if (hookFilePath !== '') { + console.log(' --- load: ' + hookFilePath); + const hookFile = require(hookFilePath); + + for (const resource of Object.keys(hookFile)) { + // if (this.externalHooks[resource] === undefined) { + // this.externalHooks[resource] = {}; + // } + + for (const operation of Object.keys(hookFile[resource])) { + const hookString = `${resource}.${operation}`; + if (this.externalHooks[hookString] === undefined) { + this.externalHooks[hookString] = []; + } + + this.externalHooks[hookString].push.apply(this.externalHooks[hookString], hookFile[resource][operation]); + } + } + } + } + } + + async run(hookName: string): Promise { + console.log('RUN NOW: ' + hookName); + + const hookData: IHookData = { + DbCollections: Db.collections, + }; + + if (this.externalHooks[hookName] === undefined) { + return; + } + + for(const externalHookFunction of this.externalHooks[hookName]) { + externalHookFunction.call(hookData); + } + } + +} + + + +let externalHooksInstance: ExternalHooksClass | undefined; + +export function ExternalHooks(): ExternalHooksClass { + if (externalHooksInstance === undefined) { + externalHooksInstance = new ExternalHooksClass(); + } + + return externalHooksInstance; +} diff --git a/packages/cli/src/Interfaces.ts b/packages/cli/src/Interfaces.ts index 225e02885f..b54e1eb299 100644 --- a/packages/cli/src/Interfaces.ts +++ b/packages/cli/src/Interfaces.ts @@ -188,6 +188,11 @@ export interface IExecutingWorkflowData { workflowExecution?: PCancelable; } +export interface IExternalHooks { + init(): Promise; + run(hookName: string): Promise; +} + export interface IN8nConfig { database: IN8nConfigDatabase; endpoints: IN8nConfigEndpoints; diff --git a/packages/cli/src/Server.ts b/packages/cli/src/Server.ts index ad2a3c1de5..baf4f1aa58 100644 --- a/packages/cli/src/Server.ts +++ b/packages/cli/src/Server.ts @@ -19,6 +19,7 @@ import { ActiveWorkflowRunner, CredentialTypes, Db, + ExternalHooks, IActivationError, ICustomRequest, ICredentialsDb, @@ -33,6 +34,7 @@ import { IExecutionsListResponse, IExecutionsStopData, IExecutionsSummary, + IExternalHooks, IN8nUISettings, IPackageVersions, IWorkflowBase, @@ -93,6 +95,7 @@ class App { testWebhooks: TestWebhooks.TestWebhooks; endpointWebhook: string; endpointWebhookTest: string; + externalHooks: IExternalHooks; saveDataErrorExecution: string; saveDataSuccessExecution: string; saveManualExecutions: boolean; @@ -124,6 +127,8 @@ class App { this.protocol = config.get('protocol'); this.sslKey = config.get('ssl_key'); this.sslCert = config.get('ssl_cert'); + + this.externalHooks = ExternalHooks(); } @@ -689,6 +694,8 @@ class App { throw new ResponseHelper.ResponseError(`Credentials with the same type and name exist already.`, undefined, 400); } + await this.externalHooks.run('credentials.new'); + // Encrypt the data const credentials = new Credentials(incomingData.name, incomingData.type, incomingData.nodesAccess); credentials.setData(incomingData.data, encryptionKey); diff --git a/packages/cli/src/externalHooksTemp/test-hooks.ts b/packages/cli/src/externalHooksTemp/test-hooks.ts new file mode 100644 index 0000000000..2cb60decfc --- /dev/null +++ b/packages/cli/src/externalHooksTemp/test-hooks.ts @@ -0,0 +1,10 @@ +export = { + credentials: { + new: [ + () => { + // Here any additional code can run or the creation blocked + throw new Error('No additional credentials can be created.'); + }, + ], + }, +}; diff --git a/packages/cli/src/index.ts b/packages/cli/src/index.ts index 0b7ae6ad0a..fba554c04e 100644 --- a/packages/cli/src/index.ts +++ b/packages/cli/src/index.ts @@ -1,4 +1,5 @@ export * from './CredentialTypes'; +export * from './ExternalHooks'; export * from './Interfaces'; export * from './LoadNodesAndCredentials'; export * from './NodeTypes'; From 0387671cae3084235619a20b76395f144df36f88 Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Tue, 5 May 2020 01:23:54 +0200 Subject: [PATCH 002/241] :zap: Add additional external hooks and provide additional data --- packages/cli/config/index.ts | 2 +- packages/cli/src/ExternalHooks.ts | 48 ++++++++----------- packages/cli/src/Interfaces.ts | 6 ++- packages/cli/src/Server.ts | 18 +++++-- .../cli/src/externalHooksTemp/test-hooks.ts | 42 ++++++++++++++-- 5 files changed, 79 insertions(+), 37 deletions(-) diff --git a/packages/cli/config/index.ts b/packages/cli/config/index.ts index 5705a5fc7d..7ef5155a67 100644 --- a/packages/cli/config/index.ts +++ b/packages/cli/config/index.ts @@ -253,7 +253,7 @@ const config = convict({ }, externalHookFiles: { - doc: 'Files containing external hooks', + doc: 'Files containing external hooks. Multiple files can be separated by colon (":")', format: String, default: '', env: 'EXTERNAL_HOOK_FILES' diff --git a/packages/cli/src/ExternalHooks.ts b/packages/cli/src/ExternalHooks.ts index 2c00a525c6..c4f12301b4 100644 --- a/packages/cli/src/ExternalHooks.ts +++ b/packages/cli/src/ExternalHooks.ts @@ -1,21 +1,10 @@ import { Db, - IDatabaseCollections, + IExternalHookFunctions, IExternalHooks, -} from "./"; +} from './'; import * as config from '../config'; -// import { -// access as fsAccess, -// readdir as fsReaddir, -// readFile as fsReadFile, -// stat as fsStat, -// } from 'fs'; - -// TODO: Give different name -interface IHookData { - DbCollections: IDatabaseCollections; -} // export EXTERNAL_HOOK_FILES=/data/packages/cli/dist/src/externalHooksTemp/test-hooks.js @@ -29,39 +18,42 @@ class ExternalHooksClass implements IExternalHooks { async init(): Promise { console.log('ExternalHooks.init'); - const externalHookFiles = config.get('externalHookFiles').split(','); + const externalHookFiles = config.get('externalHookFiles').split(':'); console.log('externalHookFiles'); console.log(externalHookFiles); + // Load all the provided hook-files for (let hookFilePath of externalHookFiles) { hookFilePath = hookFilePath.trim(); if (hookFilePath !== '') { console.log(' --- load: ' + hookFilePath); - const hookFile = require(hookFilePath); + try { + const hookFile = require(hookFilePath); - for (const resource of Object.keys(hookFile)) { - // if (this.externalHooks[resource] === undefined) { - // this.externalHooks[resource] = {}; - // } + for (const resource of Object.keys(hookFile)) { + for (const operation of Object.keys(hookFile[resource])) { + // Save all the hook functions directly under their string + // format in an array + const hookString = `${resource}.${operation}`; + if (this.externalHooks[hookString] === undefined) { + this.externalHooks[hookString] = []; + } - for (const operation of Object.keys(hookFile[resource])) { - const hookString = `${resource}.${operation}`; - if (this.externalHooks[hookString] === undefined) { - this.externalHooks[hookString] = []; + this.externalHooks[hookString].push.apply(this.externalHooks[hookString], hookFile[resource][operation]); } - - this.externalHooks[hookString].push.apply(this.externalHooks[hookString], hookFile[resource][operation]); } + } catch (error) { + throw new Error(`Problem loading external hook file "${hookFilePath}": ${error.message}`); } } } } - async run(hookName: string): Promise { + async run(hookName: string, hookParameters?: any[]): Promise { // tslint:disable-line:no-any console.log('RUN NOW: ' + hookName); - const hookData: IHookData = { + const externalHookFunctions: IExternalHookFunctions = { DbCollections: Db.collections, }; @@ -70,7 +62,7 @@ class ExternalHooksClass implements IExternalHooks { } for(const externalHookFunction of this.externalHooks[hookName]) { - externalHookFunction.call(hookData); + await externalHookFunction.apply(externalHookFunctions, hookParameters); } } diff --git a/packages/cli/src/Interfaces.ts b/packages/cli/src/Interfaces.ts index b54e1eb299..0b9b9eca69 100644 --- a/packages/cli/src/Interfaces.ts +++ b/packages/cli/src/Interfaces.ts @@ -188,9 +188,13 @@ export interface IExecutingWorkflowData { workflowExecution?: PCancelable; } +export interface IExternalHookFunctions { + DbCollections: IDatabaseCollections; +} + export interface IExternalHooks { init(): Promise; - run(hookName: string): Promise; + run(hookName: string, hookParameters?: any[]): Promise; // tslint:disable-line:no-any } export interface IN8nConfig { diff --git a/packages/cli/src/Server.ts b/packages/cli/src/Server.ts index baf4f1aa58..a592c642c2 100644 --- a/packages/cli/src/Server.ts +++ b/packages/cli/src/Server.ts @@ -346,7 +346,7 @@ class App { // Creates a new workflow this.app.post('/rest/workflows', ResponseHelper.send(async (req: express.Request, res: express.Response): Promise => { - const newWorkflowData = req.body; + const newWorkflowData = req.body as IWorkflowBase; newWorkflowData.name = newWorkflowData.name.trim(); newWorkflowData.createdAt = this.getCurrentDate(); @@ -354,6 +354,8 @@ class App { newWorkflowData.id = undefined; + await this.externalHooks.run('workflow.create', [newWorkflowData]); + // Save the workflow in DB const result = await Db.collections.Workflow!.save(newWorkflowData); @@ -429,9 +431,11 @@ class App { // Updates an existing workflow this.app.patch('/rest/workflows/:id', ResponseHelper.send(async (req: express.Request, res: express.Response): Promise => { - const newWorkflowData = req.body; + const newWorkflowData = req.body as IWorkflowBase; const id = req.params.id; + await this.externalHooks.run('workflow.update', [newWorkflowData]); + if (this.activeWorkflowRunner.isActive(id)) { // When workflow gets saved always remove it as the triggers could have been // changed and so the changes would not take effect @@ -497,6 +501,8 @@ class App { this.app.delete('/rest/workflows/:id', ResponseHelper.send(async (req: express.Request, res: express.Response): Promise => { const id = req.params.id; + await this.externalHooks.run('workflow.delete', [id]); + if (this.activeWorkflowRunner.isActive(id)) { // Before deleting a workflow deactivate it await this.activeWorkflowRunner.remove(id); @@ -658,6 +664,8 @@ class App { this.app.delete('/rest/credentials/:id', ResponseHelper.send(async (req: express.Request, res: express.Response): Promise => { const id = req.params.id; + await this.externalHooks.run('credentials.delete', [id]); + await Db.collections.Credentials!.delete({ id }); return true; @@ -672,6 +680,8 @@ class App { nodeAccess.date = this.getCurrentDate(); } + await this.externalHooks.run('credentials.create'); + const encryptionKey = await UserSettings.getEncryptionKey(); if (encryptionKey === undefined) { throw new Error('No encryption key got found to encrypt the credentials!'); @@ -694,8 +704,6 @@ class App { throw new ResponseHelper.ResponseError(`Credentials with the same type and name exist already.`, undefined, 400); } - await this.externalHooks.run('credentials.new'); - // Encrypt the data const credentials = new Credentials(incomingData.name, incomingData.type, incomingData.nodesAccess); credentials.setData(incomingData.data, encryptionKey); @@ -722,6 +730,8 @@ class App { const id = req.params.id; + await this.externalHooks.run('credentials.update', [id]); + if (incomingData.name === '') { throw new Error('Credentials have to have a name set!'); } diff --git a/packages/cli/src/externalHooksTemp/test-hooks.ts b/packages/cli/src/externalHooksTemp/test-hooks.ts index 2cb60decfc..f10000f1f0 100644 --- a/packages/cli/src/externalHooksTemp/test-hooks.ts +++ b/packages/cli/src/externalHooksTemp/test-hooks.ts @@ -1,10 +1,46 @@ +import { + IExternalHookFunctions, + IWorkflowBase, +} from '../'; + +// TODO: Move that to interfaces +interface IExternalHooks { + credentials?: { + create?: Array<{ (this: IExternalHookFunctions): Promise; }> + delete?: Array<{ (this: IExternalHookFunctions, credentialId: string): Promise; }> + update?: Array<{ (this: IExternalHookFunctions, credentialId: string): Promise; }> + }; + workflow?: { + create?: Array<{ (this: IExternalHookFunctions, workflowData: IWorkflowBase): Promise; }> + delete?: Array<{ (this: IExternalHookFunctions, workflowId: string): Promise; }> + update?: Array<{ (this: IExternalHookFunctions, workflowData: IWorkflowBase): Promise; }> + }; +} + export = { credentials: { - new: [ - () => { + create: [ + async function (this: IExternalHookFunctions) { + // console.log(this.DbCollections.Workflow); + // Here any additional code can run or the creation blocked throw new Error('No additional credentials can be created.'); }, ], }, -}; + workflow: { + update: [ + async function (this: IExternalHookFunctions, workflowData: IWorkflowBase) { + console.log('update workflow hook'); + + // const responseData = await this.DbCollections.Workflow!.findOne(workflowData.id); + // console.log('workflowData'); + // console.log(responseData); + // console.log(workflowData); + + // Here any additional code can run or the creation blocked + throw new Error('Workflow can not be updated.'); + }, + ], + }, +} as IExternalHooks; From 6e1254fd54a43e6a2126b1192336ad0ccb97db69 Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Wed, 6 May 2020 00:59:58 +0200 Subject: [PATCH 003/241] :zap: Add additional external workflow hooks --- packages/cli/src/ExternalHooks.ts | 17 +++++--- packages/cli/src/Interfaces.ts | 21 ++++++++-- packages/cli/src/Server.ts | 11 ++--- .../cli/src/WorkflowExecuteAdditionalData.ts | 5 +++ packages/cli/src/WorkflowRunner.ts | 4 ++ .../cli/src/externalHooksTemp/test-hooks.ts | 41 +++++++++---------- 6 files changed, 65 insertions(+), 34 deletions(-) diff --git a/packages/cli/src/ExternalHooks.ts b/packages/cli/src/ExternalHooks.ts index c4f12301b4..9d195ccbad 100644 --- a/packages/cli/src/ExternalHooks.ts +++ b/packages/cli/src/ExternalHooks.ts @@ -1,23 +1,28 @@ import { Db, - IExternalHookFunctions, - IExternalHooks, + IExternalHooksFunctions, + IExternalHooksClass, } from './'; import * as config from '../config'; // export EXTERNAL_HOOK_FILES=/data/packages/cli/dist/src/externalHooksTemp/test-hooks.js -class ExternalHooksClass implements IExternalHooks { +class ExternalHooksClass implements IExternalHooksClass { externalHooks: { [key: string]: Array<() => {}> } = {}; + initDidRun = false; async init(): Promise { console.log('ExternalHooks.init'); + if (this.initDidRun === true) { + return; + } + const externalHookFiles = config.get('externalHookFiles').split(':'); console.log('externalHookFiles'); @@ -48,13 +53,15 @@ class ExternalHooksClass implements IExternalHooks { } } } + + this.initDidRun = true; } async run(hookName: string, hookParameters?: any[]): Promise { // tslint:disable-line:no-any console.log('RUN NOW: ' + hookName); - const externalHookFunctions: IExternalHookFunctions = { - DbCollections: Db.collections, + const externalHookFunctions: IExternalHooksFunctions = { + dbCollections: Db.collections, }; if (this.externalHooks[hookName] === undefined) { diff --git a/packages/cli/src/Interfaces.ts b/packages/cli/src/Interfaces.ts index 0b9b9eca69..5e76f2c4e2 100644 --- a/packages/cli/src/Interfaces.ts +++ b/packages/cli/src/Interfaces.ts @@ -188,11 +188,26 @@ export interface IExecutingWorkflowData { workflowExecution?: PCancelable; } -export interface IExternalHookFunctions { - DbCollections: IDatabaseCollections; +export interface IExternalHooks { + credentials?: { + create?: Array<{ (this: IExternalHooksFunctions, credentialsData: ICredentialsEncrypted): Promise; }> + delete?: Array<{ (this: IExternalHooksFunctions, credentialId: string): Promise; }> + update?: Array<{ (this: IExternalHooksFunctions, credentialsData: ICredentialsDb): Promise; }> + }; + workflow?: { + activate?: Array<{ (this: IExternalHooksFunctions, workflowData: IWorkflowDb): Promise; }> + create?: Array<{ (this: IExternalHooksFunctions, workflowData: IWorkflowBase): Promise; }> + delete?: Array<{ (this: IExternalHooksFunctions, workflowId: string): Promise; }> + execute?: Array<{ (this: IExternalHooksFunctions, workflowData: IWorkflowDb, mode: WorkflowExecuteMode): Promise; }> + update?: Array<{ (this: IExternalHooksFunctions, workflowData: IWorkflowDb): Promise; }> + }; } -export interface IExternalHooks { +export interface IExternalHooksFunctions { + dbCollections: IDatabaseCollections; +} + +export interface IExternalHooksClass { init(): Promise; run(hookName: string, hookParameters?: any[]): Promise; // tslint:disable-line:no-any } diff --git a/packages/cli/src/Server.ts b/packages/cli/src/Server.ts index a592c642c2..a36a2fd81e 100644 --- a/packages/cli/src/Server.ts +++ b/packages/cli/src/Server.ts @@ -48,7 +48,6 @@ import { WorkflowCredentials, WebhookHelpers, WorkflowExecuteAdditionalData, - WorkflowHelpers, WorkflowRunner, GenericHelpers, } from './'; @@ -477,6 +476,8 @@ class App { if (responseData.active === true) { // When the workflow is supposed to be active add it again try { + await this.externalHooks.run('workflow.activate', [responseData]); + await this.activeWorkflowRunner.add(id); } catch (error) { // If workflow could not be activated set it again to inactive @@ -680,8 +681,6 @@ class App { nodeAccess.date = this.getCurrentDate(); } - await this.externalHooks.run('credentials.create'); - const encryptionKey = await UserSettings.getEncryptionKey(); if (encryptionKey === undefined) { throw new Error('No encryption key got found to encrypt the credentials!'); @@ -709,6 +708,8 @@ class App { credentials.setData(incomingData.data, encryptionKey); const newCredentialsData = credentials.getDataToSave() as ICredentialsDb; + await this.externalHooks.run('credentials.create', [newCredentialsData]); + // Add special database related data newCredentialsData.createdAt = this.getCurrentDate(); newCredentialsData.updatedAt = this.getCurrentDate(); @@ -730,8 +731,6 @@ class App { const id = req.params.id; - await this.externalHooks.run('credentials.update', [id]); - if (incomingData.name === '') { throw new Error('Credentials have to have a name set!'); } @@ -770,6 +769,8 @@ class App { // Add special database related data newCredentialsData.updatedAt = this.getCurrentDate(); + await this.externalHooks.run('credentials.update', [newCredentialsData]); + // Update the credentials in DB await Db.collections.Credentials!.update(id, newCredentialsData); diff --git a/packages/cli/src/WorkflowExecuteAdditionalData.ts b/packages/cli/src/WorkflowExecuteAdditionalData.ts index 9665080ebd..4b86357852 100644 --- a/packages/cli/src/WorkflowExecuteAdditionalData.ts +++ b/packages/cli/src/WorkflowExecuteAdditionalData.ts @@ -1,5 +1,6 @@ import { Db, + ExternalHooks, IExecutionDb, IExecutionFlattedDb, IPushDataExecutionFinished, @@ -302,6 +303,10 @@ export async function executeWorkflow(workflowInfo: IExecuteWorkflowInfo, additi workflowData = workflowInfo.code; } + const externalHooks = ExternalHooks(); + await externalHooks.init(); + await externalHooks.run('workflow.execute', [workflowData, mode]); + const nodeTypes = NodeTypes(); const workflowName = workflowData ? workflowData.name : undefined; diff --git a/packages/cli/src/WorkflowRunner.ts b/packages/cli/src/WorkflowRunner.ts index 3a09606550..c3ce61cedc 100644 --- a/packages/cli/src/WorkflowRunner.ts +++ b/packages/cli/src/WorkflowRunner.ts @@ -1,5 +1,6 @@ import { ActiveExecutions, + ExternalHooks, IProcessMessageDataHook, ITransferNodeTypes, IWorkflowExecutionDataProcess, @@ -94,6 +95,9 @@ export class WorkflowRunner { * @memberof WorkflowRunner */ async run(data: IWorkflowExecutionDataProcess, loadStaticData?: boolean): Promise { + const externalHooks = ExternalHooks(); + await externalHooks.run('workflow.execute', [data.workflowData, data.executionMode]); + const executionsProcess = config.get('executions.process') as string; if (executionsProcess === 'main') { return this.runMainProcess(data, loadStaticData); diff --git a/packages/cli/src/externalHooksTemp/test-hooks.ts b/packages/cli/src/externalHooksTemp/test-hooks.ts index f10000f1f0..b49c0600b2 100644 --- a/packages/cli/src/externalHooksTemp/test-hooks.ts +++ b/packages/cli/src/externalHooksTemp/test-hooks.ts @@ -1,45 +1,44 @@ import { - IExternalHookFunctions, + WorkflowExecuteMode, +} from 'n8n-workflow'; + +import { + IExternalHooks, + IExternalHooksFunctions, IWorkflowBase, + IWorkflowDb, } from '../'; -// TODO: Move that to interfaces -interface IExternalHooks { - credentials?: { - create?: Array<{ (this: IExternalHookFunctions): Promise; }> - delete?: Array<{ (this: IExternalHookFunctions, credentialId: string): Promise; }> - update?: Array<{ (this: IExternalHookFunctions, credentialId: string): Promise; }> - }; - workflow?: { - create?: Array<{ (this: IExternalHookFunctions, workflowData: IWorkflowBase): Promise; }> - delete?: Array<{ (this: IExternalHookFunctions, workflowId: string): Promise; }> - update?: Array<{ (this: IExternalHookFunctions, workflowData: IWorkflowBase): Promise; }> - }; -} export = { credentials: { create: [ - async function (this: IExternalHookFunctions) { - // console.log(this.DbCollections.Workflow); - + async function (this: IExternalHooksFunctions) { // Here any additional code can run or the creation blocked - throw new Error('No additional credentials can be created.'); + // throw new Error('No additional credentials can be created.'); }, ], }, workflow: { + execute: [ + async function (this: IExternalHooksFunctions, workflowData: IWorkflowDb, mode: WorkflowExecuteMode) { + console.log('execute: ' + mode); + // if (mode === 'integrated') { + // throw new Error('Workflow can not be executed.'); + // } + } + ], update: [ - async function (this: IExternalHookFunctions, workflowData: IWorkflowBase) { + async function (this: IExternalHooksFunctions, workflowData: IWorkflowBase) { console.log('update workflow hook'); - // const responseData = await this.DbCollections.Workflow!.findOne(workflowData.id); + // const responseData = await this.dbCollections.Workflow!.findOne(workflowData.id); // console.log('workflowData'); // console.log(responseData); // console.log(workflowData); // Here any additional code can run or the creation blocked - throw new Error('Workflow can not be updated.'); + // throw new Error('Workflow can not be updated.'); }, ], }, From 91c40367e11b93967b093b50d012efa2b8396d13 Mon Sep 17 00:00:00 2001 From: ricardo Date: Wed, 27 May 2020 19:32:49 -0400 Subject: [PATCH 004/241] Done --- packages/cli/src/ActiveWorkflowRunner.ts | 156 ++++++++++++------ packages/cli/src/Db.ts | 7 +- packages/cli/src/Interfaces.ts | 8 + packages/cli/src/Server.ts | 12 +- packages/cli/src/WebhookHelpers.ts | 27 +++ .../src/databases/mongodb/WebhookEntity.ts | 31 ++++ packages/cli/src/databases/mongodb/index.ts | 2 + .../src/databases/mysqldb/WebhookEntity.ts | 30 ++++ packages/cli/src/databases/mysqldb/index.ts | 1 + .../src/databases/postgresdb/WebhookEntity.ts | 30 ++++ .../cli/src/databases/postgresdb/index.ts | 2 + .../migrations/1589476000887-WebhookModel.ts | 62 +++++++ .../databases/postgresdb/migrations/index.ts | 2 + .../cli/src/databases/sqlite/WebhookEntity.ts | 30 ++++ packages/cli/src/databases/sqlite/index.ts | 2 +- packages/editor-ui/package.json | 4 +- packages/editor-ui/src/views/NodeView.vue | 6 + packages/workflow/src/Interfaces.ts | 1 + packages/workflow/src/NodeHelpers.ts | 64 ++++++- 19 files changed, 423 insertions(+), 54 deletions(-) create mode 100644 packages/cli/src/databases/mongodb/WebhookEntity.ts create mode 100644 packages/cli/src/databases/mysqldb/WebhookEntity.ts create mode 100644 packages/cli/src/databases/postgresdb/WebhookEntity.ts create mode 100644 packages/cli/src/databases/postgresdb/migrations/1589476000887-WebhookModel.ts create mode 100644 packages/cli/src/databases/sqlite/WebhookEntity.ts diff --git a/packages/cli/src/ActiveWorkflowRunner.ts b/packages/cli/src/ActiveWorkflowRunner.ts index 9fef6ed243..4be2326323 100644 --- a/packages/cli/src/ActiveWorkflowRunner.ts +++ b/packages/cli/src/ActiveWorkflowRunner.ts @@ -11,11 +11,11 @@ import { WorkflowHelpers, WorkflowRunner, WorkflowExecuteAdditionalData, + IWebhookDb, } from './'; import { ActiveWorkflows, - ActiveWebhooks, NodeExecuteFunctions, } from 'n8n-core'; @@ -26,7 +26,7 @@ import { INode, INodeExecutionData, IRunExecutionData, - IWebhookData, + NodeHelpers, IWorkflowExecuteAdditionalData as IWorkflowExecuteAdditionalDataWorkflow, WebhookHttpMethod, Workflow, @@ -38,19 +38,21 @@ import * as express from 'express'; export class ActiveWorkflowRunner { private activeWorkflows: ActiveWorkflows | null = null; - private activeWebhooks: ActiveWebhooks | null = null; + private activationErrors: { [key: string]: IActivationError; } = {}; async init() { + // Get the active workflows from database + + // NOTE + // Here I guess we can have a flag on the workflow table like hasTrigger + // so intead of pulling all the active wehhooks just pull the actives that have a trigger const workflowsData: IWorkflowDb[] = await Db.collections.Workflow!.find({ active: true }) as IWorkflowDb[]; - this.activeWebhooks = new ActiveWebhooks(); - - // Add them as active workflows this.activeWorkflows = new ActiveWorkflows(); if (workflowsData.length !== 0) { @@ -58,20 +60,27 @@ export class ActiveWorkflowRunner { console.log(' Start Active Workflows:'); console.log(' ================================'); + const nodeTypes = NodeTypes(); + for (const workflowData of workflowsData) { - console.log(` - ${workflowData.name}`); - try { - await this.add(workflowData.id.toString(), workflowData); - console.log(` => Started`); - } catch (error) { - console.log(` => ERROR: Workflow could not be activated:`); - console.log(` ${error.message}`); + + const workflow = new Workflow({ id: workflowData.id.toString(), name: workflowData.name, nodes: workflowData.nodes, connections: workflowData.connections, active: workflowData.active, nodeTypes, staticData: workflowData.staticData, settings: workflowData.settings}); + + if (workflow.getTriggerNodes().length !== 0 + || workflow.getPollNodes().length !== 0) { + console.log(` - ${workflowData.name}`); + try { + await this.add(workflowData.id.toString(), workflowData); + console.log(` => Started`); + } catch (error) { + console.log(` => ERROR: Workflow could not be activated:`); + console.log(` ${error.message}`); + } } } } } - /** * Removes all the currently active workflows * @@ -94,7 +103,6 @@ export class ActiveWorkflowRunner { return; } - /** * Checks if a webhook for the given method and path exists and executes the workflow. * @@ -110,30 +118,41 @@ export class ActiveWorkflowRunner { throw new ResponseHelper.ResponseError('The "activeWorkflows" instance did not get initialized yet.', 404, 404); } - const webhookData: IWebhookData | undefined = this.activeWebhooks!.get(httpMethod, path); + const webhook = await Db.collections.Webhook?.findOne({ webhookPath: path, method: httpMethod }) as IWebhookDb; - if (webhookData === undefined) { + // check if something exist + if (webhook === undefined) { // The requested webhook is not registered throw new ResponseHelper.ResponseError(`The requested webhook "${httpMethod} ${path}" is not registered.`, 404, 404); } - const workflowData = await Db.collections.Workflow!.findOne(webhookData.workflowId); + const workflowData = await Db.collections.Workflow!.findOne(webhook.workflowId); if (workflowData === undefined) { - throw new ResponseHelper.ResponseError(`Could not find workflow with id "${webhookData.workflowId}"`, 404, 404); + throw new ResponseHelper.ResponseError(`Could not find workflow with id "${webhook.workflowId}"`, 404, 404); } const nodeTypes = NodeTypes(); - const workflow = new Workflow({ id: webhookData.workflowId, name: workflowData.name, nodes: workflowData.nodes, connections: workflowData.connections, active: workflowData.active, nodeTypes, staticData: workflowData.staticData, settings: workflowData.settings}); + const workflow = new Workflow({ id: webhook.workflowId.toString(), name: workflowData.name, nodes: workflowData.nodes, connections: workflowData.connections, active: workflowData.active, nodeTypes, staticData: workflowData.staticData, settings: workflowData.settings}); + + const credentials = await WorkflowCredentials([workflow.getNode(webhook.node as string) as INode]); + + const additionalData = await WorkflowExecuteAdditionalData.getBase(credentials); + + const webhookData = NodeHelpers.getNodeWebhooks(workflow, workflow.getNode(webhook.node as string) as INode, additionalData).filter((webhook) => { + return (webhook.httpMethod === httpMethod && webhook.path === path); + })[0]; // Get the node which has the webhook defined to know where to start from and to // get additional data const workflowStartNode = workflow.getNode(webhookData.node); + if (workflowStartNode === null) { throw new ResponseHelper.ResponseError('Could not find node to process webhook.', 404, 404); } return new Promise((resolve, reject) => { const executionMode = 'webhook'; + //@ts-ignore WebhookHelpers.executeWebhook(workflow, webhookData, workflowData, workflowStartNode, executionMode, undefined, req, res, (error: Error | null, data: object) => { if (error !== null) { return reject(error); @@ -143,19 +162,14 @@ export class ActiveWorkflowRunner { }); } - /** * Returns the ids of the currently active workflows * * @returns {string[]} * @memberof ActiveWorkflowRunner */ - getActiveWorkflows(): string[] { - if (this.activeWorkflows === null) { - return []; - } - - return this.activeWorkflows.allActiveWorkflows(); + getActiveWorkflows(): Promise { + return Db.collections.Workflow?.find({ select: ['id'] }) as Promise; } @@ -166,15 +180,11 @@ export class ActiveWorkflowRunner { * @returns {boolean} * @memberof ActiveWorkflowRunner */ - isActive(id: string): boolean { - if (this.activeWorkflows !== null) { - return this.activeWorkflows.isActive(id); - } - - return false; + async isActive(id: string): Promise { + const workflow = await Db.collections.Workflow?.findOne({ id }) as IWorkflowDb; + return workflow?.active as boolean; } - /** * Return error if there was a problem activating the workflow * @@ -190,7 +200,6 @@ export class ActiveWorkflowRunner { return this.activationErrors[id]; } - /** * Adds all the webhooks of the workflow * @@ -202,12 +211,47 @@ export class ActiveWorkflowRunner { */ async addWorkflowWebhooks(workflow: Workflow, additionalData: IWorkflowExecuteAdditionalDataWorkflow, mode: WorkflowExecuteMode): Promise { const webhooks = WebhookHelpers.getWorkflowWebhooks(workflow, additionalData); + let path = ''; for (const webhookData of webhooks) { - await this.activeWebhooks!.add(workflow, webhookData, mode); - // Save static data! - await WorkflowHelpers.saveStaticData(workflow); + + const node = workflow.getNode(webhookData.node) as INode; + node.name = webhookData.node; + + path = node.parameters.path as string; + + if (node.parameters.path === undefined) { + path = workflow.getSimpleParameterValue(node, webhookData.webhookDescription['path'], 'GET') as string; + } + + const webhook = { + workflowId: webhookData.workflowId, + webhookPath: NodeHelpers.getNodeWebhookPath(workflow.id as string, node, path), + node: node.name, + method: webhookData.httpMethod, + } as IWebhookDb; + + try { + await Db.collections.Webhook?.insert(webhook); + + const webhookExists = await workflow.runWebhookMethod('checkExists', webhookData, NodeExecuteFunctions, mode, false); + if (webhookExists === false) { + // If webhook does not exist yet create it + await workflow.runWebhookMethod('create', webhookData, NodeExecuteFunctions, mode, false); + } + + } catch (error) { + // The workflow was saved with two webhooks with the + // same path/method so delete all webhooks saved + + await Db.collections.Webhook?.delete({ workflowId: workflow.id }); + + // then show error to the user + throw new Error(error.message || error.detail); + } } + // Save static data! + await WorkflowHelpers.saveStaticData(workflow); } @@ -227,10 +271,22 @@ export class ActiveWorkflowRunner { const nodeTypes = NodeTypes(); const workflow = new Workflow({ id: workflowId, name: workflowData.name, nodes: workflowData.nodes, connections: workflowData.connections, active: workflowData.active, nodeTypes, staticData: workflowData.staticData, settings: workflowData.settings }); - await this.activeWebhooks!.removeWorkflow(workflow); + const mode = 'internal'; - // Save the static workflow data if needed - await WorkflowHelpers.saveStaticData(workflow); + const credentials = await WorkflowCredentials(workflowData.nodes); + const additionalData = await WorkflowExecuteAdditionalData.getBase(credentials); + + const webhooks = WebhookHelpers.getWorkflowWebhooks(workflow, additionalData); + + for (const webhookData of webhooks) { + await workflow.runWebhookMethod('delete', webhookData, NodeExecuteFunctions, mode, false); + } + + const webhook = { + workflowId: workflowData.id, + } as IWebhookDb; + + await Db.collections.Webhook?.delete(webhook); } @@ -322,7 +378,6 @@ export class ActiveWorkflowRunner { }); } - /** * Makes a workflow active * @@ -361,7 +416,11 @@ export class ActiveWorkflowRunner { // Add the workflows which have webhooks defined await this.addWorkflowWebhooks(workflowInstance, additionalData, mode); - await this.activeWorkflows.add(workflowId, workflowInstance, additionalData, getTriggerFunctions, getPollFunctions); + + if (workflowInstance.getTriggerNodes().length !== 0 + || workflowInstance.getPollNodes().length !== 0) { + await this.activeWorkflows.add(workflowId, workflowInstance, additionalData, getTriggerFunctions, getPollFunctions); + } if (this.activationErrors[workflowId] !== undefined) { // If there were activation errors delete them @@ -386,7 +445,6 @@ export class ActiveWorkflowRunner { await WorkflowHelpers.saveStaticData(workflowInstance!); } - /** * Makes a workflow inactive * @@ -395,6 +453,7 @@ export class ActiveWorkflowRunner { * @memberof ActiveWorkflowRunner */ async remove(workflowId: string): Promise { + if (this.activeWorkflows !== null) { // Remove all the webhooks of the workflow await this.removeWorkflowWebhooks(workflowId); @@ -404,8 +463,13 @@ export class ActiveWorkflowRunner { delete this.activationErrors[workflowId]; } - // Remove the workflow from the "list" of active workflows - return this.activeWorkflows.remove(workflowId); + // if it's active in memory then it's a trigger + // so remove from list of actives workflows + if (this.activeWorkflows.isActive(workflowId)) { + this.activeWorkflows.remove(workflowId); + } + + return; } throw new Error(`The "activeWorkflows" instance did not get initialized yet.`); diff --git a/packages/cli/src/Db.ts b/packages/cli/src/Db.ts index 54633adb13..9077922a5c 100644 --- a/packages/cli/src/Db.ts +++ b/packages/cli/src/Db.ts @@ -27,10 +27,12 @@ export let collections: IDatabaseCollections = { Credentials: null, Execution: null, Workflow: null, + Webhook: null, }; import { - InitialMigration1587669153312 + InitialMigration1587669153312, + WebhookModel1589476000887, } from './databases/postgresdb/migrations'; import { @@ -81,7 +83,7 @@ export async function init(): Promise { port: await GenericHelpers.getConfigValue('database.postgresdb.port') as number, username: await GenericHelpers.getConfigValue('database.postgresdb.user') as string, schema: config.get('database.postgresdb.schema'), - migrations: [InitialMigration1587669153312], + migrations: [InitialMigration1587669153312, WebhookModel1589476000887], migrationsRun: true, migrationsTableName: `${entityPrefix}migrations`, }; @@ -135,6 +137,7 @@ export async function init(): Promise { collections.Credentials = getRepository(entities.CredentialsEntity); collections.Execution = getRepository(entities.ExecutionEntity); collections.Workflow = getRepository(entities.WorkflowEntity); + collections.Webhook = getRepository(entities.WebhookEntity); return collections; } diff --git a/packages/cli/src/Interfaces.ts b/packages/cli/src/Interfaces.ts index 225e02885f..65b211b2a9 100644 --- a/packages/cli/src/Interfaces.ts +++ b/packages/cli/src/Interfaces.ts @@ -40,8 +40,16 @@ export interface IDatabaseCollections { Credentials: Repository | null; Execution: Repository | null; Workflow: Repository | null; + Webhook: Repository | null; } +export interface IWebhookDb { + id?: number | ObjectID; + workflowId: number | string | ObjectID; + webhookPath: string; + method: string; + node: string; +} export interface IWorkflowBase extends IWorkflowBaseWorkflow { id?: number | string | ObjectID; diff --git a/packages/cli/src/Server.ts b/packages/cli/src/Server.ts index d078c8594e..4e27568983 100644 --- a/packages/cli/src/Server.ts +++ b/packages/cli/src/Server.ts @@ -427,7 +427,9 @@ class App { const newWorkflowData = req.body; const id = req.params.id; - if (this.activeWorkflowRunner.isActive(id)) { + const isActive = await this.activeWorkflowRunner.isActive(id); + + if (isActive) { // When workflow gets saved always remove it as the triggers could have been // changed and so the changes would not take effect await this.activeWorkflowRunner.remove(id); @@ -492,7 +494,9 @@ class App { this.app.delete('/rest/workflows/:id', ResponseHelper.send(async (req: express.Request, res: express.Response): Promise => { const id = req.params.id; - if (this.activeWorkflowRunner.isActive(id)) { + const isActive = await this.activeWorkflowRunner.isActive(id); + + if (isActive) { // Before deleting a workflow deactivate it await this.activeWorkflowRunner.remove(id); } @@ -503,6 +507,7 @@ class App { })); + this.app.post('/rest/workflows/run', ResponseHelper.send(async (req: express.Request, res: express.Response): Promise => { const workflowData = req.body.workflowData; const runData: IRunData | undefined = req.body.runData; @@ -632,7 +637,8 @@ class App { // Returns the active workflow ids this.app.get('/rest/active', ResponseHelper.send(async (req: express.Request, res: express.Response): Promise => { - return this.activeWorkflowRunner.getActiveWorkflows(); + const activeWorkflows = await this.activeWorkflowRunner.getActiveWorkflows(); + return activeWorkflows.map(workflow => workflow.id.toString()) as string[]; })); diff --git a/packages/cli/src/WebhookHelpers.ts b/packages/cli/src/WebhookHelpers.ts index d39e3f5dee..0badd1c9d1 100644 --- a/packages/cli/src/WebhookHelpers.ts +++ b/packages/cli/src/WebhookHelpers.ts @@ -69,6 +69,33 @@ export function getWorkflowWebhooks(workflow: Workflow, additionalData: IWorkflo return returnData; } +/** + * Returns all the webhooks which should be created for the give workflow + * + * @export + * @param {string} workflowId + * @param {Workflow} workflow + * @returns {IWebhookData[]} + */ +export function getWorkflowWebhooksBasic(workflow: Workflow): IWebhookData[] { + // Check all the nodes in the workflow if they have webhooks + + const returnData: IWebhookData[] = []; + + let parentNodes: string[] | undefined; + + for (const node of Object.values(workflow.nodes)) { + if (parentNodes !== undefined && !parentNodes.includes(node.name)) { + // If parentNodes are given check only them if they have webhooks + // and no other ones + continue; + } + returnData.push.apply(returnData, NodeHelpers.getNodeWebhooksBasic(workflow, node)); + } + + return returnData; +} + /** * Executes a webhook diff --git a/packages/cli/src/databases/mongodb/WebhookEntity.ts b/packages/cli/src/databases/mongodb/WebhookEntity.ts new file mode 100644 index 0000000000..c9952c2c6d --- /dev/null +++ b/packages/cli/src/databases/mongodb/WebhookEntity.ts @@ -0,0 +1,31 @@ +import { + Column, + Entity, + Unique, + ObjectIdColumn, + ObjectID, +} from 'typeorm'; + +import { + IWebhookDb, + } from '../../Interfaces'; + +@Entity() +@Unique(['webhookPath', 'method']) +export class WebhookEntity implements IWebhookDb { + + @ObjectIdColumn() + id: ObjectID; + + @Column() + workflowId: number; + + @Column() + webhookPath: string; + + @Column() + method: string; + + @Column() + node: string; +} diff --git a/packages/cli/src/databases/mongodb/index.ts b/packages/cli/src/databases/mongodb/index.ts index 164d67fd0c..bd6b9abd60 100644 --- a/packages/cli/src/databases/mongodb/index.ts +++ b/packages/cli/src/databases/mongodb/index.ts @@ -1,3 +1,5 @@ export * from './CredentialsEntity'; export * from './ExecutionEntity'; export * from './WorkflowEntity'; +export * from './WebhookEntity'; + diff --git a/packages/cli/src/databases/mysqldb/WebhookEntity.ts b/packages/cli/src/databases/mysqldb/WebhookEntity.ts new file mode 100644 index 0000000000..df89da4319 --- /dev/null +++ b/packages/cli/src/databases/mysqldb/WebhookEntity.ts @@ -0,0 +1,30 @@ +import { + Column, + Entity, + Unique, + PrimaryGeneratedColumn, +} from 'typeorm'; + +import { + IWebhookDb, + } from '../../Interfaces'; + +@Entity() +@Unique(['webhookPath', 'method']) +export class WebhookEntity implements IWebhookDb { + + @PrimaryGeneratedColumn() + id: number; + + @Column() + workflowId: number; + + @Column() + webhookPath: string; + + @Column() + method: string; + + @Column() + node: string; +} diff --git a/packages/cli/src/databases/mysqldb/index.ts b/packages/cli/src/databases/mysqldb/index.ts index 164d67fd0c..a3494531db 100644 --- a/packages/cli/src/databases/mysqldb/index.ts +++ b/packages/cli/src/databases/mysqldb/index.ts @@ -1,3 +1,4 @@ export * from './CredentialsEntity'; export * from './ExecutionEntity'; export * from './WorkflowEntity'; +export * from './WebhookEntity'; diff --git a/packages/cli/src/databases/postgresdb/WebhookEntity.ts b/packages/cli/src/databases/postgresdb/WebhookEntity.ts new file mode 100644 index 0000000000..07c1c88ae8 --- /dev/null +++ b/packages/cli/src/databases/postgresdb/WebhookEntity.ts @@ -0,0 +1,30 @@ +import { + Column, + Entity, + Unique, + PrimaryGeneratedColumn, +} from 'typeorm'; + +import { + IWebhookDb, + } from '../../'; + +@Entity() +@Unique(['webhookPath', 'method']) +export class WebhookEntity implements IWebhookDb { + + @PrimaryGeneratedColumn() + id: number; + + @Column() + workflowId: number; + + @Column() + webhookPath: string; + + @Column() + method: string; + + @Column() + node: string; +} diff --git a/packages/cli/src/databases/postgresdb/index.ts b/packages/cli/src/databases/postgresdb/index.ts index 164d67fd0c..bd6b9abd60 100644 --- a/packages/cli/src/databases/postgresdb/index.ts +++ b/packages/cli/src/databases/postgresdb/index.ts @@ -1,3 +1,5 @@ export * from './CredentialsEntity'; export * from './ExecutionEntity'; export * from './WorkflowEntity'; +export * from './WebhookEntity'; + diff --git a/packages/cli/src/databases/postgresdb/migrations/1589476000887-WebhookModel.ts b/packages/cli/src/databases/postgresdb/migrations/1589476000887-WebhookModel.ts new file mode 100644 index 0000000000..0e8ed1e76a --- /dev/null +++ b/packages/cli/src/databases/postgresdb/migrations/1589476000887-WebhookModel.ts @@ -0,0 +1,62 @@ +import {MigrationInterface, QueryRunner} from 'typeorm'; + +import { IWorkflowDb, NodeTypes, WebhookHelpers } from '../../..'; +import { Workflow } from 'n8n-workflow/dist/src/Workflow'; +import { + IWebhookDb, + } from '../../../Interfaces'; + + import * as config from '../../../../config'; + +export class WebhookModel1589476000887 implements MigrationInterface { + name = 'WebhookModel1589476000887'; + + async up(queryRunner: QueryRunner): Promise { + let tablePrefix = config.get('database.tablePrefix'); + const schema = config.get('database.postgresdb.schema'); + if (schema) { + tablePrefix = schema + '.' + tablePrefix; + } + + await queryRunner.query(`CREATE TABLE ${tablePrefix}webhook_entity ("id" SERIAL NOT NULL, "workflowId" integer NOT NULL, "webhookPath" character varying NOT NULL, "method" character varying NOT NULL, "node" character varying NOT NULL, CONSTRAINT "UQ_b21ace2e13596ccd87dc9bf4ea6" UNIQUE ("webhookPath", "method"), CONSTRAINT "PK_202217c8b912cf70b93b1e87256" PRIMARY KEY ("id"))`, undefined); + + const workflows = await queryRunner.query(`SELECT * FROM ${tablePrefix}workflow_entity WHERE active=true`) as IWorkflowDb[]; + const data: IWebhookDb[] = []; + const nodeTypes = NodeTypes(); + for (const workflow of workflows) { + const workflowInstance = new Workflow({ id: workflow.id as string, name: workflow.name, nodes: workflow.nodes, connections: workflow.connections, active: workflow.active, nodeTypes, staticData: workflow.staticData, settings: workflow.settings }); + // I'm writing something more simple than this. I tried to use the built in method + // getWorkflowWebhooks but it needs additionaldata and to get it I need the credentials + // and for some reason when I use + // const credentials = await WorkflowCredentials(node); + // to get the credentials I got an error I think is cuz the database is yet not ready. + const webhooks = WebhookHelpers.getWorkflowWebhooksBasic(workflowInstance); + for (const webhook of webhooks) { + data.push({ + workflowId: workflowInstance.id as string, + webhookPath: webhook.path, + method: webhook.httpMethod, + node: webhook.node, + }); + } + } + + if (data.length !== 0) { + await queryRunner.manager.createQueryBuilder() + .insert() + .into(`${tablePrefix}webhook_entity`) + .values(data) + .execute(); + } + } + + async down(queryRunner: QueryRunner): Promise { + let tablePrefix = config.get('database.tablePrefix'); + const schema = config.get('database.postgresdb.schema'); + if (schema) { + tablePrefix = schema + '.' + tablePrefix; + } + await queryRunner.query(`DROP TABLE ${tablePrefix}webhook_entity`, undefined); + } + +} diff --git a/packages/cli/src/databases/postgresdb/migrations/index.ts b/packages/cli/src/databases/postgresdb/migrations/index.ts index 5bb6551492..827f01796c 100644 --- a/packages/cli/src/databases/postgresdb/migrations/index.ts +++ b/packages/cli/src/databases/postgresdb/migrations/index.ts @@ -1 +1,3 @@ export * from './1587669153312-InitialMigration'; +export * from './1589476000887-WebhookModel'; + diff --git a/packages/cli/src/databases/sqlite/WebhookEntity.ts b/packages/cli/src/databases/sqlite/WebhookEntity.ts new file mode 100644 index 0000000000..df89da4319 --- /dev/null +++ b/packages/cli/src/databases/sqlite/WebhookEntity.ts @@ -0,0 +1,30 @@ +import { + Column, + Entity, + Unique, + PrimaryGeneratedColumn, +} from 'typeorm'; + +import { + IWebhookDb, + } from '../../Interfaces'; + +@Entity() +@Unique(['webhookPath', 'method']) +export class WebhookEntity implements IWebhookDb { + + @PrimaryGeneratedColumn() + id: number; + + @Column() + workflowId: number; + + @Column() + webhookPath: string; + + @Column() + method: string; + + @Column() + node: string; +} diff --git a/packages/cli/src/databases/sqlite/index.ts b/packages/cli/src/databases/sqlite/index.ts index 2c7d6e25e9..a3494531db 100644 --- a/packages/cli/src/databases/sqlite/index.ts +++ b/packages/cli/src/databases/sqlite/index.ts @@ -1,4 +1,4 @@ export * from './CredentialsEntity'; export * from './ExecutionEntity'; export * from './WorkflowEntity'; - +export * from './WebhookEntity'; diff --git a/packages/editor-ui/package.json b/packages/editor-ui/package.json index ec505a172c..783a6ef1dc 100644 --- a/packages/editor-ui/package.json +++ b/packages/editor-ui/package.json @@ -23,7 +23,9 @@ "test:e2e": "vue-cli-service test:e2e", "test:unit": "vue-cli-service test:unit" }, - "dependencies": {}, + "dependencies": { + "uuid": "^8.1.0" + }, "devDependencies": { "@beyonk/google-fonts-webpack-plugin": "^1.2.3", "@fortawesome/fontawesome-svg-core": "^1.2.19", diff --git a/packages/editor-ui/src/views/NodeView.vue b/packages/editor-ui/src/views/NodeView.vue index de89534e09..2a86c1be12 100644 --- a/packages/editor-ui/src/views/NodeView.vue +++ b/packages/editor-ui/src/views/NodeView.vue @@ -126,6 +126,8 @@ import RunData from '@/components/RunData.vue'; import mixins from 'vue-typed-mixins'; +import { v4 as uuidv4 } from 'uuid'; + import { debounce } from 'lodash'; import axios from 'axios'; import { @@ -946,6 +948,10 @@ export default mixins( // Check if node-name is unique else find one that is newNodeData.name = this.getUniqueNodeName(newNodeData.name); + if (nodeTypeData.webhooks && nodeTypeData.webhooks.length) { + newNodeData.webhookPath = uuidv4(); + } + await this.addNodes([newNodeData]); // Automatically deselect all nodes and select the current one and also active diff --git a/packages/workflow/src/Interfaces.ts b/packages/workflow/src/Interfaces.ts index ce75635fc0..b5f143e3f6 100644 --- a/packages/workflow/src/Interfaces.ts +++ b/packages/workflow/src/Interfaces.ts @@ -297,6 +297,7 @@ export interface INode { continueOnFail?: boolean; parameters: INodeParameters; credentials?: INodeCredentials; + webhookPath?: string; } diff --git a/packages/workflow/src/NodeHelpers.ts b/packages/workflow/src/NodeHelpers.ts index a72ee565de..87e219699d 100644 --- a/packages/workflow/src/NodeHelpers.ts +++ b/packages/workflow/src/NodeHelpers.ts @@ -791,6 +791,59 @@ export function getNodeWebhooks(workflow: Workflow, node: INode, additionalData: return returnData; } +export function getNodeWebhooksBasic(workflow: Workflow, node: INode): IWebhookData[] { + if (node.disabled === true) { + // Node is disabled so webhooks will also not be enabled + return []; + } + + const nodeType = workflow.nodeTypes.getByName(node.type) as INodeType; + + if (nodeType.description.webhooks === undefined) { + // Node does not have any webhooks so return + return []; + } + + const workflowId = workflow.id || '__UNSAVED__'; + + const returnData: IWebhookData[] = []; + for (const webhookDescription of nodeType.description.webhooks) { + let nodeWebhookPath = workflow.getSimpleParameterValue(node, webhookDescription['path'], 'GET'); + if (nodeWebhookPath === undefined) { + // TODO: Use a proper logger + console.error(`No webhook path could be found for node "${node.name}" in workflow "${workflowId}".`); + continue; + } + + nodeWebhookPath = nodeWebhookPath.toString(); + + if (nodeWebhookPath.charAt(0) === '/') { + nodeWebhookPath = nodeWebhookPath.slice(1); + } + + const path = getNodeWebhookPath(workflowId, node, nodeWebhookPath); + + const httpMethod = workflow.getSimpleParameterValue(node, webhookDescription['httpMethod'], 'GET'); + + if (httpMethod === undefined) { + // TODO: Use a proper logger + console.error(`The webhook "${path}" for node "${node.name}" in workflow "${workflowId}" could not be added because the httpMethod is not defined.`); + continue; + } + + //@ts-ignore + returnData.push({ + httpMethod: httpMethod.toString() as WebhookHttpMethod, + node: node.name, + path, + webhookDescription, + workflowId, + }); + } + + return returnData; +} + /** * Returns the webhook path @@ -802,7 +855,16 @@ export function getNodeWebhooks(workflow: Workflow, node: INode, additionalData: * @returns {string} */ export function getNodeWebhookPath(workflowId: string, node: INode, path: string): string { - return `${workflowId}/${encodeURIComponent(node.name.toLowerCase())}/${path}`; + let webhookPath = ''; + if (node.webhookPath === undefined) { + webhookPath = `${workflowId}/${encodeURIComponent(node.name.toLowerCase())}/${path}`; + } else { + if (node.type === 'n8n-nodes-base.webhook') { + return path; + } + webhookPath = `${node.webhookPath}/${path}`; + } + return webhookPath; } From 4e9490a88d4c6a97414c438ea6ae45604c99c3b0 Mon Sep 17 00:00:00 2001 From: ricardo Date: Sat, 30 May 2020 19:03:58 -0400 Subject: [PATCH 005/241] :zap: Improvements --- packages/cli/src/ActiveWorkflowRunner.ts | 21 +++++++++++++++---- packages/cli/src/Interfaces.ts | 1 - packages/cli/src/TestWebhooks.ts | 4 +++- .../src/databases/mongodb/WebhookEntity.ts | 12 +++-------- .../src/databases/mysqldb/WebhookEntity.ts | 11 +++------- .../src/databases/postgresdb/WebhookEntity.ts | 11 +++------- .../1587669153312-InitialMigration.ts | 3 ++- .../migrations/1589476000887-WebhookModel.ts | 19 +++++++++++++---- .../cli/src/databases/sqlite/WebhookEntity.ts | 11 +++------- packages/core/src/ActiveWebhooks.ts | 9 +++++++- packages/editor-ui/src/views/NodeView.vue | 5 +++++ 11 files changed, 62 insertions(+), 45 deletions(-) diff --git a/packages/cli/src/ActiveWorkflowRunner.ts b/packages/cli/src/ActiveWorkflowRunner.ts index 4be2326323..a72cb065c7 100644 --- a/packages/cli/src/ActiveWorkflowRunner.ts +++ b/packages/cli/src/ActiveWorkflowRunner.ts @@ -241,13 +241,26 @@ export class ActiveWorkflowRunner { } } catch (error) { - // The workflow was saved with two webhooks with the - // same path/method so delete all webhooks saved + + let errorMessage = ''; await Db.collections.Webhook?.delete({ workflowId: workflow.id }); - // then show error to the user - throw new Error(error.message || error.detail); + // if it's a workflow from the the insert + // TODO check if there is standard error code for deplicate key violation that works + // with all databases + if (error.name === 'QueryFailedError') { + + errorMessage = `The webhook path [${webhook.webhookPath}] and method [${webhook.method}] already exist.`; + + } else if (error.detail) { + // it's a error runnig the webhook methods (checkExists, create) + errorMessage = error.detail; + } else { + errorMessage = error; + } + + throw new Error(errorMessage); } } // Save static data! diff --git a/packages/cli/src/Interfaces.ts b/packages/cli/src/Interfaces.ts index 65b211b2a9..fd56ad3ada 100644 --- a/packages/cli/src/Interfaces.ts +++ b/packages/cli/src/Interfaces.ts @@ -44,7 +44,6 @@ export interface IDatabaseCollections { } export interface IWebhookDb { - id?: number | ObjectID; workflowId: number | string | ObjectID; webhookPath: string; method: string; diff --git a/packages/cli/src/TestWebhooks.ts b/packages/cli/src/TestWebhooks.ts index 45ae624e2b..a20fa76c88 100644 --- a/packages/cli/src/TestWebhooks.ts +++ b/packages/cli/src/TestWebhooks.ts @@ -141,12 +141,14 @@ export class TestWebhooks { let key: string; for (const webhookData of webhooks) { key = this.activeWebhooks!.getWebhookKey(webhookData.httpMethod, webhookData.path); + + await this.activeWebhooks!.add(workflow, webhookData, mode); + this.testWebhookData[key] = { sessionId, timeout, workflowData, }; - await this.activeWebhooks!.add(workflow, webhookData, mode); // Save static data! this.testWebhookData[key].workflowData.staticData = workflow.staticData; diff --git a/packages/cli/src/databases/mongodb/WebhookEntity.ts b/packages/cli/src/databases/mongodb/WebhookEntity.ts index c9952c2c6d..a78fd34ae9 100644 --- a/packages/cli/src/databases/mongodb/WebhookEntity.ts +++ b/packages/cli/src/databases/mongodb/WebhookEntity.ts @@ -1,9 +1,7 @@ import { Column, Entity, - Unique, - ObjectIdColumn, - ObjectID, + PrimaryColumn, } from 'typeorm'; import { @@ -11,19 +9,15 @@ import { } from '../../Interfaces'; @Entity() -@Unique(['webhookPath', 'method']) export class WebhookEntity implements IWebhookDb { - @ObjectIdColumn() - id: ObjectID; - @Column() workflowId: number; - @Column() + @PrimaryColumn() webhookPath: string; - @Column() + @PrimaryColumn() method: string; @Column() diff --git a/packages/cli/src/databases/mysqldb/WebhookEntity.ts b/packages/cli/src/databases/mysqldb/WebhookEntity.ts index df89da4319..a78fd34ae9 100644 --- a/packages/cli/src/databases/mysqldb/WebhookEntity.ts +++ b/packages/cli/src/databases/mysqldb/WebhookEntity.ts @@ -1,8 +1,7 @@ import { Column, Entity, - Unique, - PrimaryGeneratedColumn, + PrimaryColumn, } from 'typeorm'; import { @@ -10,19 +9,15 @@ import { } from '../../Interfaces'; @Entity() -@Unique(['webhookPath', 'method']) export class WebhookEntity implements IWebhookDb { - @PrimaryGeneratedColumn() - id: number; - @Column() workflowId: number; - @Column() + @PrimaryColumn() webhookPath: string; - @Column() + @PrimaryColumn() method: string; @Column() diff --git a/packages/cli/src/databases/postgresdb/WebhookEntity.ts b/packages/cli/src/databases/postgresdb/WebhookEntity.ts index 07c1c88ae8..6e511cde74 100644 --- a/packages/cli/src/databases/postgresdb/WebhookEntity.ts +++ b/packages/cli/src/databases/postgresdb/WebhookEntity.ts @@ -1,8 +1,7 @@ import { Column, Entity, - Unique, - PrimaryGeneratedColumn, + PrimaryColumn, } from 'typeorm'; import { @@ -10,19 +9,15 @@ import { } from '../../'; @Entity() -@Unique(['webhookPath', 'method']) export class WebhookEntity implements IWebhookDb { - @PrimaryGeneratedColumn() - id: number; - @Column() workflowId: number; - @Column() + @PrimaryColumn() webhookPath: string; - @Column() + @PrimaryColumn() method: string; @Column() diff --git a/packages/cli/src/databases/postgresdb/migrations/1587669153312-InitialMigration.ts b/packages/cli/src/databases/postgresdb/migrations/1587669153312-InitialMigration.ts index 555015c10d..5f3798ca66 100644 --- a/packages/cli/src/databases/postgresdb/migrations/1587669153312-InitialMigration.ts +++ b/packages/cli/src/databases/postgresdb/migrations/1587669153312-InitialMigration.ts @@ -1,4 +1,5 @@ -import { MigrationInterface, QueryRunner } from 'typeorm'; +import { + MigrationInterface, QueryRunner } from 'typeorm'; import * as config from '../../../../config'; diff --git a/packages/cli/src/databases/postgresdb/migrations/1589476000887-WebhookModel.ts b/packages/cli/src/databases/postgresdb/migrations/1589476000887-WebhookModel.ts index 0e8ed1e76a..a521d227d0 100644 --- a/packages/cli/src/databases/postgresdb/migrations/1589476000887-WebhookModel.ts +++ b/packages/cli/src/databases/postgresdb/migrations/1589476000887-WebhookModel.ts @@ -1,7 +1,18 @@ -import {MigrationInterface, QueryRunner} from 'typeorm'; +import { + MigrationInterface, + QueryRunner, +} from 'typeorm'; + +import { + IWorkflowDb, + NodeTypes, + WebhookHelpers, + } from '../../..'; + +import { + Workflow, +} from 'n8n-workflow/dist/src/Workflow'; -import { IWorkflowDb, NodeTypes, WebhookHelpers } from '../../..'; -import { Workflow } from 'n8n-workflow/dist/src/Workflow'; import { IWebhookDb, } from '../../../Interfaces'; @@ -18,7 +29,7 @@ export class WebhookModel1589476000887 implements MigrationInterface { tablePrefix = schema + '.' + tablePrefix; } - await queryRunner.query(`CREATE TABLE ${tablePrefix}webhook_entity ("id" SERIAL NOT NULL, "workflowId" integer NOT NULL, "webhookPath" character varying NOT NULL, "method" character varying NOT NULL, "node" character varying NOT NULL, CONSTRAINT "UQ_b21ace2e13596ccd87dc9bf4ea6" UNIQUE ("webhookPath", "method"), CONSTRAINT "PK_202217c8b912cf70b93b1e87256" PRIMARY KEY ("id"))`, undefined); + await queryRunner.query(`CREATE TABLE ${tablePrefix}webhook_entity ("workflowId" integer NOT NULL, "webhookPath" character varying NOT NULL, "method" character varying NOT NULL, "node" character varying NOT NULL, CONSTRAINT "PK_b21ace2e13596ccd87dc9bf4ea6" PRIMARY KEY ("webhookPath", "method"))`, undefined); const workflows = await queryRunner.query(`SELECT * FROM ${tablePrefix}workflow_entity WHERE active=true`) as IWorkflowDb[]; const data: IWebhookDb[] = []; diff --git a/packages/cli/src/databases/sqlite/WebhookEntity.ts b/packages/cli/src/databases/sqlite/WebhookEntity.ts index df89da4319..a78fd34ae9 100644 --- a/packages/cli/src/databases/sqlite/WebhookEntity.ts +++ b/packages/cli/src/databases/sqlite/WebhookEntity.ts @@ -1,8 +1,7 @@ import { Column, Entity, - Unique, - PrimaryGeneratedColumn, + PrimaryColumn, } from 'typeorm'; import { @@ -10,19 +9,15 @@ import { } from '../../Interfaces'; @Entity() -@Unique(['webhookPath', 'method']) export class WebhookEntity implements IWebhookDb { - @PrimaryGeneratedColumn() - id: number; - @Column() workflowId: number; - @Column() + @PrimaryColumn() webhookPath: string; - @Column() + @PrimaryColumn() method: string; @Column() diff --git a/packages/core/src/ActiveWebhooks.ts b/packages/core/src/ActiveWebhooks.ts index 17cf753830..7f6d705ccd 100644 --- a/packages/core/src/ActiveWebhooks.ts +++ b/packages/core/src/ActiveWebhooks.ts @@ -35,13 +35,20 @@ export class ActiveWebhooks { throw new Error('Webhooks can only be added for saved workflows as an id is needed!'); } + const webhookKey = this.getWebhookKey(webhookData.httpMethod, webhookData.path); + + //check that there is not a webhook already registed with that path/method + if (this.webhookUrls[webhookKey] !== undefined) { + throw new Error('There is test wenhook registered on that path'); + } + if (this.workflowWebhooks[webhookData.workflowId] === undefined) { this.workflowWebhooks[webhookData.workflowId] = []; } // Make the webhook available directly because sometimes to create it successfully // it gets called - this.webhookUrls[this.getWebhookKey(webhookData.httpMethod, webhookData.path)] = webhookData; + this.webhookUrls[webhookKey] = webhookData; const webhookExists = await workflow.runWebhookMethod('checkExists', webhookData, NodeExecuteFunctions, mode, this.testWebhooks); if (webhookExists === false) { diff --git a/packages/editor-ui/src/views/NodeView.vue b/packages/editor-ui/src/views/NodeView.vue index 2a86c1be12..65ff1b5267 100644 --- a/packages/editor-ui/src/views/NodeView.vue +++ b/packages/editor-ui/src/views/NodeView.vue @@ -1585,6 +1585,11 @@ export default mixins( console.error(e); // eslint-disable-line no-console } node.parameters = nodeParameters !== null ? nodeParameters : {}; + + // if it's a webhook and the path is empty set the UUID as the default path + if (node.type === 'n8n-nodes-base.webhook' && node.parameters.path === '') { + node.parameters.path = node.webhookPath as string; + } } foundNodeIssues = this.getNodeIssues(nodeType, node); From 1f4b8f8999046a62c3e85b5b4dfd16bc723abf29 Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Sun, 31 May 2020 21:13:45 +0200 Subject: [PATCH 006/241] :zap: Small improvements --- packages/core/src/ActiveWebhooks.ts | 2 +- packages/nodes-base/nodes/Webhook.node.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/core/src/ActiveWebhooks.ts b/packages/core/src/ActiveWebhooks.ts index 7f6d705ccd..529fe01af3 100644 --- a/packages/core/src/ActiveWebhooks.ts +++ b/packages/core/src/ActiveWebhooks.ts @@ -39,7 +39,7 @@ export class ActiveWebhooks { //check that there is not a webhook already registed with that path/method if (this.webhookUrls[webhookKey] !== undefined) { - throw new Error('There is test wenhook registered on that path'); + throw new Error(`Test-Webhook can not be activated because another one with the same method "${webhookData.httpMethod}" and path "${webhookData.path}" is already active!`); } if (this.workflowWebhooks[webhookData.workflowId] === undefined) { diff --git a/packages/nodes-base/nodes/Webhook.node.ts b/packages/nodes-base/nodes/Webhook.node.ts index 135960ea4e..26562abc4c 100644 --- a/packages/nodes-base/nodes/Webhook.node.ts +++ b/packages/nodes-base/nodes/Webhook.node.ts @@ -133,7 +133,7 @@ export class Webhook implements INodeType { default: '', placeholder: 'webhook', required: true, - description: 'The path to listen to. Slashes("/") in the path are not allowed.', + description: 'The path to listen to.', }, { displayName: 'Response Code', From 0ab6a70fa10746ff3f84285ff490e170c08d6d9b Mon Sep 17 00:00:00 2001 From: Rupenieks Date: Thu, 4 Jun 2020 15:54:39 +0200 Subject: [PATCH 007/241] Mailchimp OAuth2 support --- .../MailchimpOAuth2Api.credentials.ts | 68 +++++++++++++++++++ .../nodes/Mailchimp/GenericFunctions.ts | 56 +++++++++------ .../nodes/Mailchimp/Mailchimp.node.ts | 38 ++++++++++- .../nodes/Mailchimp/MailchimpTrigger.node.ts | 37 +++++++++- packages/nodes-base/package.json | 1 + 5 files changed, 178 insertions(+), 22 deletions(-) create mode 100644 packages/nodes-base/credentials/MailchimpOAuth2Api.credentials.ts diff --git a/packages/nodes-base/credentials/MailchimpOAuth2Api.credentials.ts b/packages/nodes-base/credentials/MailchimpOAuth2Api.credentials.ts new file mode 100644 index 0000000000..0a0efc7091 --- /dev/null +++ b/packages/nodes-base/credentials/MailchimpOAuth2Api.credentials.ts @@ -0,0 +1,68 @@ +import { + ICredentialType, + NodePropertyTypes, +} from 'n8n-workflow'; + + +export class MailchimpOAuth2Api implements ICredentialType { + name = 'mailchimpOAuth2Api'; + extends = [ + 'oAuth2Api', + ]; + displayName = 'Mailchimp OAuth2 API'; + properties = [ + { + displayName: 'Mailchimp Server', + name: 'server', + type: 'string' as NodePropertyTypes, + default: 'https://login.mailchimp.com/', + description: 'The server to connect to.', + }, + { + displayName: 'Datacenter', + name: 'dataCenter', + type: 'string' as NodePropertyTypes, + default: 'us10', + description: 'Datacenter that your Mailchimp application is hosted on. Found in the URL of your Mailchimp dashboard.', + }, + { + displayName: 'Authorization URL', + name: 'authUrl', + type: 'hidden' as NodePropertyTypes, + default: 'https://login.mailchimp.com/oauth2/authorize', + required: true, + }, + { + displayName: 'Access Token URL', + name: 'accessTokenUrl', + type: 'hidden' as NodePropertyTypes, + default: 'https://login.mailchimp.com/oauth2/token', + required: true, + }, + { + displayName: 'Metadata', + name: 'metadataUrl', + type: 'hidden' as NodePropertyTypes, + default: 'https://login.mailchimp.com/oauth2/metadata', + required: true, + }, + { + displayName: 'Scope', + name: 'scope', + type: 'hidden' as NodePropertyTypes, + default: '', + }, + { + displayName: 'Auth URI Query Parameters', + name: 'authQueryParameters', + type: 'hidden' as NodePropertyTypes, + default: '', + }, + { + displayName: 'Authentication', + name: 'authentication', + type: 'hidden' as NodePropertyTypes, + default: 'header', + }, + ]; +} diff --git a/packages/nodes-base/nodes/Mailchimp/GenericFunctions.ts b/packages/nodes-base/nodes/Mailchimp/GenericFunctions.ts index 91dfcdde85..3d66c2d8ab 100644 --- a/packages/nodes-base/nodes/Mailchimp/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Mailchimp/GenericFunctions.ts @@ -1,5 +1,5 @@ import { - OptionsWithUri, + OptionsWithUrl, } from 'request'; import { @@ -14,35 +14,51 @@ import { } from 'n8n-workflow'; export async function mailchimpApiRequest(this: IHookFunctions | IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions, endpoint: string, method: string, body: any = {}, qs: IDataObject = {} ,headers?: object): Promise { // tslint:disable-line:no-any - const credentials = this.getCredentials('mailchimpApi'); - - if (credentials === undefined) { - throw new Error('No credentials got returned!'); - } - - const headerWithAuthentication = Object.assign({}, headers, { Authorization: `apikey ${credentials.apiKey}` }); - - if (!(credentials.apiKey as string).includes('-')) { - throw new Error('The API key is not valid!'); - } - - const datacenter = (credentials.apiKey as string).split('-').pop(); + const authenticationMethod = this.getNodeParameter('authentication', 0) as string; const host = 'api.mailchimp.com/3.0'; - const options: OptionsWithUri = { - headers: headerWithAuthentication, + const options: OptionsWithUrl = { + headers: { + 'Accept': 'application/json' + }, method, qs, - uri: `https://${datacenter}.${host}${endpoint}`, + body, + url: ``, json: true, }; - if (Object.keys(body).length !== 0) { - options.body = body; + if (Object.keys(body).length === 0) { + delete options.body; } + try { - return await this.helpers.request!(options); + if (authenticationMethod === 'accessToken') { + const credentials = this.getCredentials('mailchimpApi'); + + if (credentials === undefined) { + throw new Error('No credentials got returned!'); + } + + options.headers = Object.assign({}, headers, { Authorization: `apikey ${credentials.apiKey}` }); + + if (!(credentials.apiKey as string).includes('-')) { + throw new Error('The API key is not valid!'); + } + + const datacenter = (credentials.apiKey as string).split('-').pop(); + options.url = `https://${datacenter}.${host}${endpoint}`; + + return await this.helpers.request!(options); + } else { + const credentials = this.getCredentials('mailchimpOAuth2Api'); + const datacenter = credentials!.dataCenter; + + options.url = `https://${datacenter}.${host}${endpoint}`; + //@ts-ignore + return await this.helpers.requestOAuth2!.call(this, 'mailchimpOAuth2Api', options, 'bearer'); + } } catch (error) { if (error.response.body && error.response.body.detail) { throw new Error(`Mailchimp Error response [${error.statusCode}]: ${error.response.body.detail}`); diff --git a/packages/nodes-base/nodes/Mailchimp/Mailchimp.node.ts b/packages/nodes-base/nodes/Mailchimp/Mailchimp.node.ts index cb54ac24e9..3b8d17c302 100644 --- a/packages/nodes-base/nodes/Mailchimp/Mailchimp.node.ts +++ b/packages/nodes-base/nodes/Mailchimp/Mailchimp.node.ts @@ -69,9 +69,44 @@ export class Mailchimp implements INodeType { { name: 'mailchimpApi', required: true, - } + displayOptions: { + show: { + authentication: [ + 'accessToken', + ], + }, + }, + }, + { + name: 'mailchimpOAuth2Api', + required: true, + displayOptions: { + show: { + authentication: [ + 'oAuth2', + ], + }, + }, + }, ], properties: [ + { + displayName: 'Authentication', + name: 'authentication', + type: 'options', + options: [ + { + name: 'Access Token', + value: 'accessToken', + }, + { + name: 'OAuth2', + value: 'oAuth2', + }, + ], + default: 'accessToken', + description: 'Method of authentication.', + }, { displayName: 'Resource', name: 'resource', @@ -1536,6 +1571,7 @@ export class Mailchimp implements INodeType { responseData = { success: true }; } } + if (Array.isArray(responseData)) { returnData.push.apply(returnData, responseData as IDataObject[]); } else { diff --git a/packages/nodes-base/nodes/Mailchimp/MailchimpTrigger.node.ts b/packages/nodes-base/nodes/Mailchimp/MailchimpTrigger.node.ts index 25eac04c20..67e07ad6bd 100644 --- a/packages/nodes-base/nodes/Mailchimp/MailchimpTrigger.node.ts +++ b/packages/nodes-base/nodes/Mailchimp/MailchimpTrigger.node.ts @@ -33,7 +33,25 @@ export class MailchimpTrigger implements INodeType { { name: 'mailchimpApi', required: true, - } + displayOptions: { + show: { + authentication: [ + 'accessToken', + ], + }, + }, + }, + { + name: 'mailchimpOAuth2Api', + required: true, + displayOptions: { + show: { + authentication: [ + 'oAuth2', + ], + }, + }, + }, ], webhooks: [ { @@ -50,6 +68,23 @@ export class MailchimpTrigger implements INodeType { } ], properties: [ + { + displayName: 'Authentication', + name: 'authentication', + type: 'options', + options: [ + { + name: 'Access Token', + value: 'accessToken', + }, + { + name: 'OAuth2', + value: 'oAuth2', + }, + ], + default: 'accessToken', + description: 'Method of authentication.', + }, { displayName: 'List', name: 'list', diff --git a/packages/nodes-base/package.json b/packages/nodes-base/package.json index 31cb4a8da5..f1ce8536a6 100644 --- a/packages/nodes-base/package.json +++ b/packages/nodes-base/package.json @@ -78,6 +78,7 @@ "dist/credentials/KeapOAuth2Api.credentials.js", "dist/credentials/LinkFishApi.credentials.js", "dist/credentials/MailchimpApi.credentials.js", + "dist/credentials/MailchimpOAuth2Api.credentials.js", "dist/credentials/MailgunApi.credentials.js", "dist/credentials/MailjetEmailApi.credentials.js", "dist/credentials/MailjetSmsApi.credentials.js", From d3829c90c238d7f5ae64c9dd135d235a69481b3d Mon Sep 17 00:00:00 2001 From: ricardo Date: Sat, 6 Jun 2020 14:57:42 -0400 Subject: [PATCH 008/241] :zap: Google Drive OAuth2 support --- .../GoogleDriveOAuth2Api.credentials.ts | 26 +++ .../nodes/Google/Drive/GenericFunctions.ts | 142 +++++++++++++++ .../nodes/Google/Drive/GoogleDrive.node.ts | 168 ++++++++++-------- packages/nodes-base/nodes/Google/GoogleApi.ts | 23 --- packages/nodes-base/package.json | 2 +- 5 files changed, 259 insertions(+), 102 deletions(-) create mode 100644 packages/nodes-base/credentials/GoogleDriveOAuth2Api.credentials.ts create mode 100644 packages/nodes-base/nodes/Google/Drive/GenericFunctions.ts delete mode 100644 packages/nodes-base/nodes/Google/GoogleApi.ts diff --git a/packages/nodes-base/credentials/GoogleDriveOAuth2Api.credentials.ts b/packages/nodes-base/credentials/GoogleDriveOAuth2Api.credentials.ts new file mode 100644 index 0000000000..77b0a9504c --- /dev/null +++ b/packages/nodes-base/credentials/GoogleDriveOAuth2Api.credentials.ts @@ -0,0 +1,26 @@ +import { + ICredentialType, + NodePropertyTypes, +} from 'n8n-workflow'; + +const scopes = [ + 'https://www.googleapis.com/auth/drive', + 'https://www.googleapis.com/auth/drive.appdata', + 'https://www.googleapis.com/auth/drive.photos.readonly', +]; + +export class GoogleDriveOAuth2Api implements ICredentialType { + name = 'googleDriveOAuth2Api'; + extends = [ + 'googleOAuth2Api', + ]; + displayName = 'Google Drive OAuth2 API'; + properties = [ + { + displayName: 'Scope', + name: 'scope', + type: 'hidden' as NodePropertyTypes, + default: scopes.join(' '), + }, + ]; +} diff --git a/packages/nodes-base/nodes/Google/Drive/GenericFunctions.ts b/packages/nodes-base/nodes/Google/Drive/GenericFunctions.ts new file mode 100644 index 0000000000..9946cd802a --- /dev/null +++ b/packages/nodes-base/nodes/Google/Drive/GenericFunctions.ts @@ -0,0 +1,142 @@ +import { + OptionsWithUri, + } from 'request'; + +import { + IExecuteFunctions, + IExecuteSingleFunctions, + ILoadOptionsFunctions, +} from 'n8n-core'; + +import { + IDataObject, +} from 'n8n-workflow'; + +import * as moment from 'moment-timezone'; + +import * as jwt from 'jsonwebtoken'; + +export async function googleApiRequest(this: IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions, method: string, resource: string, body: any = {}, qs: IDataObject = {}, uri?: string, option: IDataObject = {}): Promise { // tslint:disable-line:no-any + const authenticationMethod = this.getNodeParameter('authentication', 0, 'serviceAccount') as string; + + let options: OptionsWithUri = { + headers: { + 'Content-Type': 'application/json', + }, + method, + body, + qs, + uri: uri || `https://www.googleapis.com${resource}`, + json: true, + }; + options = Object.assign({}, options, option); + try { + if (Object.keys(body).length === 0) { + delete options.body; + } + + if (authenticationMethod === 'serviceAccount') { + const credentials = this.getCredentials('googleApi'); + + if (credentials === undefined) { + throw new Error('No credentials got returned!'); + } + + const { access_token } = await getAccessToken.call(this, credentials as IDataObject); + + options.headers!.Authorization = `Bearer ${access_token}`; + //@ts-ignore + return await this.helpers.request(options); + } else { + //@ts-ignore + return await this.helpers.requestOAuth2.call(this, 'googleDriveOAuth2Api', options); + } + } catch (error) { + if (error.response && error.response.body && error.response.body.error) { + + let errorMessages; + + if (error.response.body.error.errors) { + // Try to return the error prettier + errorMessages = error.response.body.error.errors; + + errorMessages = errorMessages.map((errorItem: IDataObject) => errorItem.message); + + errorMessages = errorMessages.join('|'); + + } else if (error.response.body.error.message){ + errorMessages = error.response.body.error.message; + } + + throw new Error(`Google Drive error response [${error.statusCode}]: ${errorMessages}`); + } + throw error; + } +} + +export async function googleApiRequestAllItems(this: IExecuteFunctions | ILoadOptionsFunctions, propertyName: string ,method: string, endpoint: string, body: any = {}, query: IDataObject = {}): Promise { // tslint:disable-line:no-any + + const returnData: IDataObject[] = []; + + let responseData; + query.maxResults = 100; + + do { + responseData = await googleApiRequest.call(this, method, endpoint, body, query); + query.pageToken = responseData['nextPageToken']; + returnData.push.apply(returnData, responseData[propertyName]); + } while ( + responseData['nextPageToken'] !== undefined && + responseData['nextPageToken'] !== '' + ); + + return returnData; +} + +function getAccessToken(this: IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions, credentials: IDataObject) : Promise { + //https://developers.google.com/identity/protocols/oauth2/service-account#httprest + + const scopes = [ + 'https://www.googleapis.com/auth/drive', + 'https://www.googleapis.com/auth/drive.appdata', + 'https://www.googleapis.com/auth/drive.photos.readonly', + ]; + + const now = moment().unix(); + + const signature = jwt.sign( + { + 'iss': credentials.email as string, + 'sub': credentials.email as string, + 'scope': scopes.join(' '), + 'aud': `https://oauth2.googleapis.com/token`, + 'iat': now, + 'exp': now + 3600, + }, + credentials.privateKey as string, + { + algorithm: 'RS256', + header: { + 'kid': credentials.privateKey as string, + 'typ': 'JWT', + 'alg': 'RS256', + }, + } + ); + + const options: OptionsWithUri = { + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + }, + method: 'POST', + form: { + grant_type: 'urn:ietf:params:oauth:grant-type:jwt-bearer', + assertion: signature, + }, + uri: 'https://oauth2.googleapis.com/token', + json: true + }; + + //@ts-ignore + return this.helpers.request(options); +} diff --git a/packages/nodes-base/nodes/Google/Drive/GoogleDrive.node.ts b/packages/nodes-base/nodes/Google/Drive/GoogleDrive.node.ts index 387a3d7bc0..8ddfd7c1fa 100644 --- a/packages/nodes-base/nodes/Google/Drive/GoogleDrive.node.ts +++ b/packages/nodes-base/nodes/Google/Drive/GoogleDrive.node.ts @@ -1,10 +1,8 @@ -import { google } from 'googleapis'; -const { Readable } = require('stream'); - import { BINARY_ENCODING, IExecuteFunctions, } from 'n8n-core'; + import { IDataObject, INodeTypeDescription, @@ -12,8 +10,9 @@ import { INodeType, } from 'n8n-workflow'; -import { getAuthenticationClient } from '../GoogleApi'; - +import { + googleApiRequest, +} from './GenericFunctions'; export class GoogleDrive implements INodeType { description: INodeTypeDescription = { @@ -34,9 +33,43 @@ export class GoogleDrive implements INodeType { { name: 'googleApi', required: true, - } + displayOptions: { + show: { + authentication: [ + 'serviceAccount', + ], + }, + }, + }, + { + name: 'googleDriveOAuth2Api', + required: true, + displayOptions: { + show: { + authentication: [ + 'oAuth2', + ], + }, + }, + }, ], properties: [ + { + displayName: 'Authentication', + name: 'authentication', + type: 'options', + options: [ + { + name: 'Service Account', + value: 'serviceAccount', + }, + { + name: 'OAuth2', + value: 'oAuth2', + }, + ], + default: 'serviceAccount', + }, { displayName: 'Resource', name: 'resource', @@ -813,26 +846,6 @@ export class GoogleDrive implements INodeType { const items = this.getInputData(); const returnData: IDataObject[] = []; - const credentials = this.getCredentials('googleApi'); - - if (credentials === undefined) { - throw new Error('No credentials got returned!'); - } - - const scopes = [ - 'https://www.googleapis.com/auth/drive', - 'https://www.googleapis.com/auth/drive.appdata', - 'https://www.googleapis.com/auth/drive.photos.readonly', - ]; - - const client = await getAuthenticationClient(credentials.email as string, credentials.privateKey as string, scopes); - - const drive = google.drive({ - version: 'v3', - // @ts-ignore - auth: client, - }); - const resource = this.getNodeParameter('resource', 0) as string; const operation = this.getNodeParameter('operation', 0) as string; @@ -857,22 +870,20 @@ export class GoogleDrive implements INodeType { const fileId = this.getNodeParameter('fileId', i) as string; - const copyOptions = { - fileId, + const body: IDataObject = { fields: queryFields, - requestBody: {} as IDataObject, }; const optionProperties = ['name', 'parents']; for (const propertyName of optionProperties) { if (options[propertyName] !== undefined) { - copyOptions.requestBody[propertyName] = options[propertyName]; + body[propertyName] = options[propertyName]; } } - const response = await drive.files.copy(copyOptions); + const response = await googleApiRequest.call(this, 'POST', `/drive/v3/files/${fileId}/copy`, body); - returnData.push(response.data as IDataObject); + returnData.push(response as IDataObject); } else if (operation === 'download') { // ---------------------------------- @@ -881,15 +892,13 @@ export class GoogleDrive implements INodeType { const fileId = this.getNodeParameter('fileId', i) as string; - const response = await drive.files.get( - { - fileId, - alt: 'media', - }, - { - responseType: 'arraybuffer', - }, - ); + const requestOptions = { + resolveWithFullResponse: true, + encoding: null, + json: false, + }; + + const response = await googleApiRequest.call(this, 'GET', `/drive/v3/files/${fileId}`, {}, { alt: 'media' }, undefined, requestOptions); let mimeType: string | undefined; if (response.headers['content-type']) { @@ -912,7 +921,7 @@ export class GoogleDrive implements INodeType { const dataPropertyNameDownload = this.getNodeParameter('binaryPropertyName', i) as string; - const data = Buffer.from(response.data as string); + const data = Buffer.from(response.body as string); items[i].binary![dataPropertyNameDownload] = await this.helpers.prepareBinaryData(data as unknown as Buffer, undefined, mimeType); @@ -988,20 +997,19 @@ export class GoogleDrive implements INodeType { const pageSize = this.getNodeParameter('limit', i) as number; - const res = await drive.files.list({ + const qs = { pageSize, orderBy: 'modifiedTime', fields: `nextPageToken, files(${queryFields})`, spaces: querySpaces, - corpora: queryCorpora, - driveId, q: queryString, - includeItemsFromAllDrives: (queryCorpora !== '' || driveId !== ''), // Actually depracated, - supportsAllDrives: (queryCorpora !== '' || driveId !== ''), // see https://developers.google.com/drive/api/v3/reference/files/list - // However until June 2020 still needs to be set, to avoid API errors. - }); + includeItemsFromAllDrives: (queryCorpora !== '' || driveId !== ''), + supportsAllDrives: (queryCorpora !== '' || driveId !== ''), + }; - const files = res!.data.files; + const response = await googleApiRequest.call(this, 'GET', `/drive/v3/files`, {}, qs); + + const files = response!.files; return [this.helpers.returnJsonArray(files as IDataObject[])]; @@ -1044,29 +1052,35 @@ export class GoogleDrive implements INodeType { const name = this.getNodeParameter('name', i) as string; const parents = this.getNodeParameter('parents', i) as string[]; - const response = await drive.files.create({ - requestBody: { - name, - originalFilename, - parents, - }, + let qs: IDataObject = { fields: queryFields, - media: { - mimeType, - body: ((buffer: Buffer) => { - const readableInstanceStream = new Readable({ - read() { - this.push(buffer); - this.push(null); - } - }); + uploadType: 'media', + }; - return readableInstanceStream; - })(body), + const requestOptions = { + headers: { + 'Content-Type': mimeType, + 'Content-Length': body.byteLength, }, - }); + encoding: null, + json: false, + }; - returnData.push(response.data as IDataObject); + let response = await googleApiRequest.call(this, 'POST', `/upload/drive/v3/files`, body, qs, undefined, requestOptions); + + body = { + mimeType, + name, + originalFilename, + }; + + qs = { + addParents: parents.join(','), + }; + + response = await googleApiRequest.call(this, 'PATCH', `/drive/v3/files/${JSON.parse(response).id}`, body, qs); + + returnData.push(response as IDataObject); } } else if (resource === 'folder') { @@ -1077,19 +1091,19 @@ export class GoogleDrive implements INodeType { const name = this.getNodeParameter('name', i) as string; - const fileMetadata = { + const body = { name, mimeType: 'application/vnd.google-apps.folder', parents: options.parents || [], }; - const response = await drive.files.create({ - // @ts-ignore - resource: fileMetadata, + const qs = { fields: queryFields, - }); + }; - returnData.push(response.data as IDataObject); + const response = await googleApiRequest.call(this, 'POST', '/drive/v3/files', body, qs); + + returnData.push(response as IDataObject); } } if (['file', 'folder'].includes(resource)) { @@ -1100,9 +1114,7 @@ export class GoogleDrive implements INodeType { const fileId = this.getNodeParameter('fileId', i) as string; - await drive.files.delete({ - fileId, - }); + const response = await googleApiRequest.call(this, 'DELETE', `/drive/v3/files/${fileId}`); // If we are still here it did succeed returnData.push({ diff --git a/packages/nodes-base/nodes/Google/GoogleApi.ts b/packages/nodes-base/nodes/Google/GoogleApi.ts deleted file mode 100644 index 64ba9f9bec..0000000000 --- a/packages/nodes-base/nodes/Google/GoogleApi.ts +++ /dev/null @@ -1,23 +0,0 @@ - -import { JWT } from 'google-auth-library'; -import { google } from 'googleapis'; - - -/** - * Returns the authentication client needed to access spreadsheet - */ -export async function getAuthenticationClient(email: string, privateKey: string, scopes: string[]): Promise { - const client = new google.auth.JWT( - email, - undefined, - privateKey, - scopes, - undefined - ); - - // TODO: Check later if this or the above should be cached - await client.authorize(); - - // @ts-ignore - return client; -} diff --git a/packages/nodes-base/package.json b/packages/nodes-base/package.json index a898058634..0f85456439 100644 --- a/packages/nodes-base/package.json +++ b/packages/nodes-base/package.json @@ -58,6 +58,7 @@ "dist/credentials/GitlabApi.credentials.js", "dist/credentials/GoogleApi.credentials.js", "dist/credentials/GoogleCalendarOAuth2Api.credentials.js", + "dist/credentials/GoogleDriveOAuth2Api.credentials.js", "dist/credentials/GoogleOAuth2Api.credentials.js", "dist/credentials/GoogleSheetsOAuth2Api.credentials.js", "dist/credentials/GumroadApi.credentials.js", @@ -319,7 +320,6 @@ "formidable": "^1.2.1", "glob-promise": "^3.4.0", "gm": "^1.23.1", - "googleapis": "~50.0.0", "imap-simple": "^4.3.0", "jsonwebtoken": "^8.5.1", "lodash.get": "^4.4.2", From d2e738b5c7a9c7e8d09fda24047da236a071be38 Mon Sep 17 00:00:00 2001 From: Robarelli Date: Sun, 7 Jun 2020 23:34:10 -0600 Subject: [PATCH 009/241] Add MondayCom options for changing column values --- .../nodes/MondayCom/BoardItemDescription.ts | 157 ++++++++++++++++++ .../nodes/MondayCom/MondayCom.node.ts | 58 +++++++ 2 files changed, 215 insertions(+) diff --git a/packages/nodes-base/nodes/MondayCom/BoardItemDescription.ts b/packages/nodes-base/nodes/MondayCom/BoardItemDescription.ts index c6725279ed..c3f81484f9 100644 --- a/packages/nodes-base/nodes/MondayCom/BoardItemDescription.ts +++ b/packages/nodes-base/nodes/MondayCom/BoardItemDescription.ts @@ -15,6 +15,16 @@ export const boardItemOperations = [ }, }, options: [ + { + name: 'Change Column Value', + value: 'changeColumnValue', + description: 'Change a column value for a board item', + }, + { + name: 'Change Multiple Column Values', + value: 'changeMultipleColumnValues', + description: 'Change multiple column values for a board item', + }, { name: 'Create', value: 'create', @@ -377,4 +387,151 @@ export const boardItemFields = [ default: 50, description: 'How many results to return.', }, +/* -------------------------------------------------------------------------- */ +/* boardItem:changeColumnValue */ +/* -------------------------------------------------------------------------- */ + { + displayName: 'Board ID', + name: 'boardId', + type: 'options', + typeOptions: { + loadOptionsMethod: 'getBoards', + }, + default: '', + required: true, + displayOptions: { + show: { + resource: [ + 'boardItem', + ], + operation: [ + 'changeColumnValue', + ], + }, + }, + description: 'The unique identifier of the board.', + }, + { + displayName: 'Item ID', + name: 'itemId', + type: 'string', + default: '', + required: true, + displayOptions: { + show: { + resource: [ + 'boardItem', + ], + operation: [ + 'changeColumnValue', + ], + }, + }, + description: `Item's ID` + }, + { + displayName: 'Column ID', + name: 'columnId', + type: 'options', + typeOptions: { + loadOptionsMethod: 'getColumns', + loadOptionsDependsOn: [ + 'boardId' + ], + }, + default: '', + required: true, + displayOptions: { + show: { + resource: [ + 'boardItem', + ], + operation: [ + 'changeColumnValue', + ], + }, + }, + description: `The column's unique identifier.`, + }, + { + displayName: 'Value', + name: 'value', + type: 'json', + required: true, + default: '', + displayOptions: { + show: { + resource: [ + 'boardItem', + ], + operation: [ + 'changeColumnValue', + ], + }, + }, + description: 'The column value in JSON format.', + }, +/* -------------------------------------------------------------------------- */ +/* boardItem:changeMultipleColumnValues */ +/* -------------------------------------------------------------------------- */ + { + displayName: 'Board ID', + name: 'boardId', + type: 'options', + typeOptions: { + loadOptionsMethod: 'getBoards', + }, + default: '', + required: true, + displayOptions: { + show: { + resource: [ + 'boardItem', + ], + operation: [ + 'changeMultipleColumnValues', + ], + }, + }, + description: 'The unique identifier of the board.', + }, + { + displayName: 'Item ID', + name: 'itemId', + type: 'string', + default: '', + required: true, + displayOptions: { + show: { + resource: [ + 'boardItem', + ], + operation: [ + 'changeMultipleColumnValues', + ], + }, + }, + description: `Item's ID` + }, + { + displayName: 'Column Values', + name: 'columnValues', + type: 'json', + required: true, + default: '', + displayOptions: { + show: { + resource: [ + 'boardItem', + ], + operation: [ + 'changeMultipleColumnValues', + ], + }, + }, + description: 'The column fields and values in JSON format.', + typeOptions: { + alwaysOpenEditWindow: true, + }, + }, ] as INodeProperties[]; diff --git a/packages/nodes-base/nodes/MondayCom/MondayCom.node.ts b/packages/nodes-base/nodes/MondayCom/MondayCom.node.ts index f8e538e5cb..26ccdfa06e 100644 --- a/packages/nodes-base/nodes/MondayCom/MondayCom.node.ts +++ b/packages/nodes-base/nodes/MondayCom/MondayCom.node.ts @@ -487,6 +487,64 @@ export class MondayCom implements INodeType { responseData = await mondayComApiRequest.call(this, body); responseData = responseData.data.create_item; } + if (operation === 'changeColumnValue') { + const boardId = parseInt(this.getNodeParameter('boardId', i) as string, 10); + const itemId = parseInt((this.getNodeParameter('itemId', i) as string), 10); + const columnId = this.getNodeParameter('columnId', i) as string; + const value = this.getNodeParameter('value', i) as string; + + const body: IGraphqlBody = { + query: + `mutation ($boardId: Int!, $itemId: Int!, $columnId: String!, $value: JSON!) { + change_column_value (board_id: $boardId, item_id: $itemId, column_id: $columnId, value: $value) { + id + } + }`, + variables: { + boardId, + itemId, + columnId, + }, + }; + + try { + JSON.parse(value); + } catch (e) { + throw new Error('Custom Values must be a valid JSON'); + } + body.variables.value = JSON.stringify(JSON.parse(value)); + + responseData = await mondayComApiRequest.call(this, body); + responseData = responseData.data.change_column_value; + } + if (operation === 'changeMultipleColumnValues') { + const boardId = parseInt(this.getNodeParameter('boardId', i) as string, 10); + const itemId = parseInt((this.getNodeParameter('itemId', i) as string), 10); + const columnValues = this.getNodeParameter('columnValues', i) as string; + + const body: IGraphqlBody = { + query: + `mutation ($boardId: Int!, $itemId: Int!, $columnValues: JSON!) { + change_multiple_column_values (board_id: $boardId, item_id: $itemId, column_values: $columnValues) { + id + } + }`, + variables: { + boardId, + itemId, + }, + }; + + try { + JSON.parse(columnValues); + } catch (e) { + throw new Error('Custom Values must be a valid JSON'); + } + body.variables.columnValues = JSON.stringify(JSON.parse(columnValues)); + + responseData = await mondayComApiRequest.call(this, body); + responseData = responseData.data.change_multiple_column_values; + } if (operation === 'delete') { const itemId = parseInt((this.getNodeParameter('itemId', i) as string), 10); From 8e86443bdb88f0a77bb59f422844c25c2f425232 Mon Sep 17 00:00:00 2001 From: Robarelli Date: Sun, 7 Jun 2020 23:57:39 -0600 Subject: [PATCH 010/241] Add MondayCom option to add updates to an item. Make options alphabetical. --- .../nodes/MondayCom/BoardItemDescription.ts | 338 ++++++++++-------- .../nodes/MondayCom/MondayCom.node.ts | 60 ++-- 2 files changed, 231 insertions(+), 167 deletions(-) diff --git a/packages/nodes-base/nodes/MondayCom/BoardItemDescription.ts b/packages/nodes-base/nodes/MondayCom/BoardItemDescription.ts index c3f81484f9..4f8cfccecc 100644 --- a/packages/nodes-base/nodes/MondayCom/BoardItemDescription.ts +++ b/packages/nodes-base/nodes/MondayCom/BoardItemDescription.ts @@ -15,6 +15,11 @@ export const boardItemOperations = [ }, }, options: [ + { + name: 'Add Update', + value: 'addUpdate', + description: `Add an update to an item.`, + }, { name: 'Change Column Value', value: 'changeColumnValue', @@ -58,6 +63,192 @@ export const boardItemOperations = [ export const boardItemFields = [ +/* -------------------------------------------------------------------------- */ +/* boardItem:addUpdate */ +/* -------------------------------------------------------------------------- */ + { + displayName: 'Item ID', + name: 'itemId', + type: 'string', + default: '', + required: true, + displayOptions: { + show: { + resource: [ + 'boardItem', + ], + operation: [ + 'addUpdate', + ], + }, + }, + description: `Item's ID` + }, + { + displayName: 'Body', + name: 'value', + type: 'string', + required: true, + default: '', + displayOptions: { + show: { + resource: [ + 'boardItem', + ], + operation: [ + 'addUpdate', + ], + }, + }, + description: 'The update text', + }, +/* -------------------------------------------------------------------------- */ +/* boardItem:changeColumnValue */ +/* -------------------------------------------------------------------------- */ + { + displayName: 'Board ID', + name: 'boardId', + type: 'options', + typeOptions: { + loadOptionsMethod: 'getBoards', + }, + default: '', + required: true, + displayOptions: { + show: { + resource: [ + 'boardItem', + ], + operation: [ + 'changeColumnValue', + ], + }, + }, + description: 'The unique identifier of the board.', + }, + { + displayName: 'Item ID', + name: 'itemId', + type: 'string', + default: '', + required: true, + displayOptions: { + show: { + resource: [ + 'boardItem', + ], + operation: [ + 'changeColumnValue', + ], + }, + }, + description: `Item's ID` + }, + { + displayName: 'Column ID', + name: 'columnId', + type: 'options', + typeOptions: { + loadOptionsMethod: 'getColumns', + loadOptionsDependsOn: [ + 'boardId' + ], + }, + default: '', + required: true, + displayOptions: { + show: { + resource: [ + 'boardItem', + ], + operation: [ + 'changeColumnValue', + ], + }, + }, + description: `The column's unique identifier.`, + }, + { + displayName: 'Value', + name: 'value', + type: 'json', + required: true, + default: '', + displayOptions: { + show: { + resource: [ + 'boardItem', + ], + operation: [ + 'changeColumnValue', + ], + }, + }, + description: 'The column value in JSON format.', + }, +/* -------------------------------------------------------------------------- */ +/* boardItem:changeMultipleColumnValues */ +/* -------------------------------------------------------------------------- */ + { + displayName: 'Board ID', + name: 'boardId', + type: 'options', + typeOptions: { + loadOptionsMethod: 'getBoards', + }, + default: '', + required: true, + displayOptions: { + show: { + resource: [ + 'boardItem', + ], + operation: [ + 'changeMultipleColumnValues', + ], + }, + }, + description: 'The unique identifier of the board.', + }, + { + displayName: 'Item ID', + name: 'itemId', + type: 'string', + default: '', + required: true, + displayOptions: { + show: { + resource: [ + 'boardItem', + ], + operation: [ + 'changeMultipleColumnValues', + ], + }, + }, + description: `Item's ID` + }, + { + displayName: 'Column Values', + name: 'columnValues', + type: 'json', + required: true, + default: '', + displayOptions: { + show: { + resource: [ + 'boardItem', + ], + operation: [ + 'changeMultipleColumnValues', + ], + }, + }, + description: 'The column fields and values in JSON format.', + typeOptions: { + alwaysOpenEditWindow: true, + }, + }, /* -------------------------------------------------------------------------- */ /* boardItem:create */ /* -------------------------------------------------------------------------- */ @@ -387,151 +578,4 @@ export const boardItemFields = [ default: 50, description: 'How many results to return.', }, -/* -------------------------------------------------------------------------- */ -/* boardItem:changeColumnValue */ -/* -------------------------------------------------------------------------- */ - { - displayName: 'Board ID', - name: 'boardId', - type: 'options', - typeOptions: { - loadOptionsMethod: 'getBoards', - }, - default: '', - required: true, - displayOptions: { - show: { - resource: [ - 'boardItem', - ], - operation: [ - 'changeColumnValue', - ], - }, - }, - description: 'The unique identifier of the board.', - }, - { - displayName: 'Item ID', - name: 'itemId', - type: 'string', - default: '', - required: true, - displayOptions: { - show: { - resource: [ - 'boardItem', - ], - operation: [ - 'changeColumnValue', - ], - }, - }, - description: `Item's ID` - }, - { - displayName: 'Column ID', - name: 'columnId', - type: 'options', - typeOptions: { - loadOptionsMethod: 'getColumns', - loadOptionsDependsOn: [ - 'boardId' - ], - }, - default: '', - required: true, - displayOptions: { - show: { - resource: [ - 'boardItem', - ], - operation: [ - 'changeColumnValue', - ], - }, - }, - description: `The column's unique identifier.`, - }, - { - displayName: 'Value', - name: 'value', - type: 'json', - required: true, - default: '', - displayOptions: { - show: { - resource: [ - 'boardItem', - ], - operation: [ - 'changeColumnValue', - ], - }, - }, - description: 'The column value in JSON format.', - }, -/* -------------------------------------------------------------------------- */ -/* boardItem:changeMultipleColumnValues */ -/* -------------------------------------------------------------------------- */ - { - displayName: 'Board ID', - name: 'boardId', - type: 'options', - typeOptions: { - loadOptionsMethod: 'getBoards', - }, - default: '', - required: true, - displayOptions: { - show: { - resource: [ - 'boardItem', - ], - operation: [ - 'changeMultipleColumnValues', - ], - }, - }, - description: 'The unique identifier of the board.', - }, - { - displayName: 'Item ID', - name: 'itemId', - type: 'string', - default: '', - required: true, - displayOptions: { - show: { - resource: [ - 'boardItem', - ], - operation: [ - 'changeMultipleColumnValues', - ], - }, - }, - description: `Item's ID` - }, - { - displayName: 'Column Values', - name: 'columnValues', - type: 'json', - required: true, - default: '', - displayOptions: { - show: { - resource: [ - 'boardItem', - ], - operation: [ - 'changeMultipleColumnValues', - ], - }, - }, - description: 'The column fields and values in JSON format.', - typeOptions: { - alwaysOpenEditWindow: true, - }, - }, ] as INodeProperties[]; diff --git a/packages/nodes-base/nodes/MondayCom/MondayCom.node.ts b/packages/nodes-base/nodes/MondayCom/MondayCom.node.ts index 26ccdfa06e..5dc7457081 100644 --- a/packages/nodes-base/nodes/MondayCom/MondayCom.node.ts +++ b/packages/nodes-base/nodes/MondayCom/MondayCom.node.ts @@ -455,37 +455,25 @@ export class MondayCom implements INodeType { } } if (resource === 'boardItem') { - if (operation === 'create') { - const boardId = parseInt(this.getNodeParameter('boardId', i) as string, 10); - const groupId = this.getNodeParameter('groupId', i) as string; - const itemName = this.getNodeParameter('name', i) as string; - const additionalFields = this.getNodeParameter('additionalFields', i) as IDataObject; + if (operation === 'addUpdate') { + const itemId = parseInt((this.getNodeParameter('itemId', i) as string), 10); + const value = this.getNodeParameter('value', i) as string; const body: IGraphqlBody = { query: - `mutation ($boardId: Int!, $groupId: String!, $itemName: String!, $columnValues: JSON) { - create_item (board_id: $boardId, group_id: $groupId, item_name: $itemName, column_values: $columnValues) { + `mutation ($itemId: Int!, $value: String!) { + create_update (item_id: $itemId, body: $value) { id } }`, variables: { - boardId, - groupId, - itemName, + itemId, + value, }, }; - if (additionalFields.columnValues) { - try { - JSON.parse(additionalFields.columnValues as string); - } catch (e) { - throw new Error('Custom Values must be a valid JSON'); - } - body.variables.columnValues = JSON.stringify(JSON.parse(additionalFields.columnValues as string)); - } - responseData = await mondayComApiRequest.call(this, body); - responseData = responseData.data.create_item; + responseData = responseData.data.create_update; } if (operation === 'changeColumnValue') { const boardId = parseInt(this.getNodeParameter('boardId', i) as string, 10); @@ -545,6 +533,38 @@ export class MondayCom implements INodeType { responseData = await mondayComApiRequest.call(this, body); responseData = responseData.data.change_multiple_column_values; } + if (operation === 'create') { + const boardId = parseInt(this.getNodeParameter('boardId', i) as string, 10); + const groupId = this.getNodeParameter('groupId', i) as string; + const itemName = this.getNodeParameter('name', i) as string; + const additionalFields = this.getNodeParameter('additionalFields', i) as IDataObject; + + const body: IGraphqlBody = { + query: + `mutation ($boardId: Int!, $groupId: String!, $itemName: String!, $columnValues: JSON) { + create_item (board_id: $boardId, group_id: $groupId, item_name: $itemName, column_values: $columnValues) { + id + } + }`, + variables: { + boardId, + groupId, + itemName, + }, + }; + + if (additionalFields.columnValues) { + try { + JSON.parse(additionalFields.columnValues as string); + } catch (e) { + throw new Error('Custom Values must be a valid JSON'); + } + body.variables.columnValues = JSON.stringify(JSON.parse(additionalFields.columnValues as string)); + } + + responseData = await mondayComApiRequest.call(this, body); + responseData = responseData.data.create_item; + } if (operation === 'delete') { const itemId = parseInt((this.getNodeParameter('itemId', i) as string), 10); From 6375934cb83fea7b2d91d78f036dd3249e2157e1 Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Mon, 8 Jun 2020 10:51:18 +0200 Subject: [PATCH 011/241] :bookmark: Release n8n-core@0.36.0 --- packages/core/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/package.json b/packages/core/package.json index 259ce7d4cb..598ae14b23 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "n8n-core", - "version": "0.35.0", + "version": "0.36.0", "description": "Core functionality of n8n", "license": "SEE LICENSE IN LICENSE.md", "homepage": "https://n8n.io", From c3d2f1f5ea8d5737101e0b7d7f47438a833d1aa6 Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Mon, 8 Jun 2020 10:52:24 +0200 Subject: [PATCH 012/241] :arrow_up: Set n8n-core@0.36.0 on n8n-nodes-base --- packages/nodes-base/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/nodes-base/package.json b/packages/nodes-base/package.json index 3f28db9dec..784affead3 100644 --- a/packages/nodes-base/package.json +++ b/packages/nodes-base/package.json @@ -330,7 +330,7 @@ "moment-timezone": "^0.5.28", "mongodb": "^3.5.5", "mysql2": "^2.0.1", - "n8n-core": "~0.35.0", + "n8n-core": "~0.36.0", "nodemailer": "^6.4.6", "pdf-parse": "^1.1.1", "pg-promise": "^9.0.3", From 768163a0b6d4e05432d74bcea130106db417f252 Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Mon, 8 Jun 2020 10:53:04 +0200 Subject: [PATCH 013/241] :bookmark: Release n8n-nodes-base@0.64.0 --- packages/nodes-base/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/nodes-base/package.json b/packages/nodes-base/package.json index 784affead3..5cf4bb3eb9 100644 --- a/packages/nodes-base/package.json +++ b/packages/nodes-base/package.json @@ -1,6 +1,6 @@ { "name": "n8n-nodes-base", - "version": "0.63.1", + "version": "0.64.0", "description": "Base nodes of n8n", "license": "SEE LICENSE IN LICENSE.md", "homepage": "https://n8n.io", From 1159064d590c12c7db48023ca190ae111991a8fd Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Mon, 8 Jun 2020 10:54:59 +0200 Subject: [PATCH 014/241] :arrow_up: Set n8n-workflow@0.33.0 on n8n-editor-ui --- packages/editor-ui/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/editor-ui/package.json b/packages/editor-ui/package.json index 8543d2fdd0..a89b070111 100644 --- a/packages/editor-ui/package.json +++ b/packages/editor-ui/package.json @@ -64,7 +64,7 @@ "lodash.debounce": "^4.0.8", "lodash.get": "^4.4.2", "lodash.set": "^4.3.2", - "n8n-workflow": "~0.32.0", + "n8n-workflow": "~0.33.0", "node-sass": "^4.12.0", "prismjs": "^1.17.1", "quill": "^2.0.0-dev.3", From 734e6a8e870d3c25660bf42261f051b32ecac485 Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Mon, 8 Jun 2020 10:55:22 +0200 Subject: [PATCH 015/241] :bookmark: Release n8n-editor-ui@0.47.0 --- packages/editor-ui/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/editor-ui/package.json b/packages/editor-ui/package.json index a89b070111..48caca7524 100644 --- a/packages/editor-ui/package.json +++ b/packages/editor-ui/package.json @@ -1,6 +1,6 @@ { "name": "n8n-editor-ui", - "version": "0.46.0", + "version": "0.47.0", "description": "Workflow Editor UI for n8n", "license": "SEE LICENSE IN LICENSE.md", "homepage": "https://n8n.io", From 7697a5703e7131afc694312349d544c20a2e8153 Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Mon, 8 Jun 2020 10:56:50 +0200 Subject: [PATCH 016/241] :arrow_up: Set n8n-core@0.36.0, n8n-editor-ui@0.47.0, n8n-nodes-base@0.64.0 and n8n-workflow@0.33.0 on n8n --- packages/cli/package.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/cli/package.json b/packages/cli/package.json index 325a73d874..f447b5828d 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -100,10 +100,10 @@ "lodash.get": "^4.4.2", "mongodb": "^3.5.5", "mysql2": "^2.0.1", - "n8n-core": "~0.35.0", - "n8n-editor-ui": "~0.46.0", - "n8n-nodes-base": "~0.63.1", - "n8n-workflow": "~0.32.0", + "n8n-core": "~0.36.0", + "n8n-editor-ui": "~0.47.0", + "n8n-nodes-base": "~0.64.0", + "n8n-workflow": "~0.33.0", "oauth-1.0a": "^2.2.6", "open": "^7.0.0", "pg": "^7.11.0", From e6d70d6cc3ed11c8ced0b82f68e31610bbc58d56 Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Mon, 8 Jun 2020 10:57:23 +0200 Subject: [PATCH 017/241] :bookmark: Release n8n@0.69.0 --- packages/cli/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/cli/package.json b/packages/cli/package.json index f447b5828d..1b043c5494 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "n8n", - "version": "0.68.2", + "version": "0.69.0", "description": "n8n Workflow Automation Tool", "license": "SEE LICENSE IN LICENSE.md", "homepage": "https://n8n.io", From 679660440ecccb396d675bfcbce12b39c044239e Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Mon, 8 Jun 2020 11:11:04 +0200 Subject: [PATCH 018/241] :bookmark: Release n8n-workflow@0.33.0 --- packages/workflow/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/workflow/package.json b/packages/workflow/package.json index 969270199b..068dc6d108 100644 --- a/packages/workflow/package.json +++ b/packages/workflow/package.json @@ -1,6 +1,6 @@ { "name": "n8n-workflow", - "version": "0.32.0", + "version": "0.33.0", "description": "Workflow base code of n8n", "license": "SEE LICENSE IN LICENSE.md", "homepage": "https://n8n.io", From 3f9bdd2e4150184774d1de28883bc5d6d1837077 Mon Sep 17 00:00:00 2001 From: Rupenieks Date: Mon, 8 Jun 2020 14:40:23 +0200 Subject: [PATCH 019/241] OAuth2 support --- .../HubspotOAuth2Api.credentials.ts | 59 +++++++++++++++++++ .../nodes/Hubspot/GenericFunctions.ts | 18 ++++-- .../nodes-base/nodes/Hubspot/Hubspot.node.ts | 37 +++++++++++- .../nodes/Hubspot/HubspotTrigger.node.ts | 35 +++++++++++ packages/nodes-base/package.json | 1 + 5 files changed, 143 insertions(+), 7 deletions(-) create mode 100644 packages/nodes-base/credentials/HubspotOAuth2Api.credentials.ts diff --git a/packages/nodes-base/credentials/HubspotOAuth2Api.credentials.ts b/packages/nodes-base/credentials/HubspotOAuth2Api.credentials.ts new file mode 100644 index 0000000000..775211cbc9 --- /dev/null +++ b/packages/nodes-base/credentials/HubspotOAuth2Api.credentials.ts @@ -0,0 +1,59 @@ +import { + ICredentialType, + NodePropertyTypes, +} from 'n8n-workflow'; + +export class HubspotOAuth2Api implements ICredentialType { + name = 'hubspotOAuth2Api'; + extends = [ + 'oAuth2Api', + ]; + displayName = 'Hubspot OAuth2 API'; + properties = [ + { + displayName: 'Authorization URL', + name: 'authUrl', + type: 'hidden' as NodePropertyTypes, + default: 'https://app.hubspot.com/oauth/authorize', + required: true, + }, + { + displayName: 'Access Token URL', + name: 'accessTokenUrl', + type: 'hidden' as NodePropertyTypes, + default: 'https://api.hubapi.com/oauth/v1/token', + required: true, + }, + { + displayName: 'Scope', + name: 'scope', + type: 'string' as NodePropertyTypes, + default: '', + }, + { + displayName: 'Auth URI Query Parameters', + name: 'authQueryParameters', + type: 'hidden' as NodePropertyTypes, + default: 'grant_type=authorization_code', + }, + { + displayName: 'Authentication', + name: 'authentication', + type: 'options' as NodePropertyTypes, + options: [ + { + name: 'Body', + value: 'body', + description: 'Send credentials in body', + }, + { + name: 'Header', + value: 'header', + description: 'Send credentials as Basic Auth header', + }, + ], + default: 'header', + description: 'Resource to consume.', + }, + ]; +} diff --git a/packages/nodes-base/nodes/Hubspot/GenericFunctions.ts b/packages/nodes-base/nodes/Hubspot/GenericFunctions.ts index 969c392cdd..eb414b82aa 100644 --- a/packages/nodes-base/nodes/Hubspot/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Hubspot/GenericFunctions.ts @@ -14,12 +14,8 @@ import { } from 'n8n-workflow'; export async function hubspotApiRequest(this: IHookFunctions | IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions, method: string, endpoint: string, body: any = {}, query: IDataObject = {}, uri?: string): Promise { // tslint:disable-line:no-any + const authenticationMethod = this.getNodeParameter('authentication', 0); - const node = this.getNode(); - const credentialName = Object.keys(node.credentials!)[0]; - const credentials = this.getCredentials(credentialName); - - query!.hapikey = credentials!.apiKey as string; const options: OptionsWithUri = { method, qs: query, @@ -28,8 +24,18 @@ export async function hubspotApiRequest(this: IHookFunctions | IExecuteFunctions json: true, useQuerystring: true, }; + try { - return await this.helpers.request!(options); + if (authenticationMethod === 'accessToken') { + const credentials = this.getCredentials('hubspotApi'); + + options.qs.hapikey = credentials!.apiKey as string; + + return await this.helpers.request!(options); + } else { + // @ts-ignore + return await this.helpers.requestOAuth2!.call(this, 'hubspotOAuth2Api', options, 'Bearer'); + } } catch (error) { if (error.response && error.response.body && error.response.body.errors) { // Try to return the error prettier diff --git a/packages/nodes-base/nodes/Hubspot/Hubspot.node.ts b/packages/nodes-base/nodes/Hubspot/Hubspot.node.ts index 6c1d7be400..bed4606042 100644 --- a/packages/nodes-base/nodes/Hubspot/Hubspot.node.ts +++ b/packages/nodes-base/nodes/Hubspot/Hubspot.node.ts @@ -73,9 +73,44 @@ export class Hubspot implements INodeType { { name: 'hubspotApi', required: true, - } + displayOptions: { + show: { + authentication: [ + 'accessToken', + ], + }, + }, + }, + { + name: 'hubspotOAuth2Api', + required: true, + displayOptions: { + show: { + authentication: [ + 'oAuth2', + ], + }, + }, + }, ], properties: [ + { + displayName: 'Authentication', + name: 'authentication', + type: 'options', + options: [ + { + name: 'Access Token', + value: 'accessToken', + }, + { + name: 'OAuth2', + value: 'oAuth2', + }, + ], + default: 'accessToken', + description: 'The method of authentication.', + }, { displayName: 'Resource', name: 'resource', diff --git a/packages/nodes-base/nodes/Hubspot/HubspotTrigger.node.ts b/packages/nodes-base/nodes/Hubspot/HubspotTrigger.node.ts index 25028f88e8..c2ed3f3e0a 100644 --- a/packages/nodes-base/nodes/Hubspot/HubspotTrigger.node.ts +++ b/packages/nodes-base/nodes/Hubspot/HubspotTrigger.node.ts @@ -37,6 +37,24 @@ export class HubspotTrigger implements INodeType { { name: 'hubspotDeveloperApi', required: true, + displayOptions: { + show: { + authentication: [ + 'developerApi', + ], + }, + }, + }, + { + name: 'hubspotOAuth2Api', + required: true, + displayOptions: { + show: { + authentication: [ + 'oAuth2', + ], + }, + }, }, ], webhooks: [ @@ -54,6 +72,23 @@ export class HubspotTrigger implements INodeType { }, ], properties: [ + { + displayName: 'Authentication', + name: 'authentication', + type: 'options', + options: [ + { + name: 'Developer API', + value: 'developerApi', + }, + { + name: 'OAuth2', + value: 'oAuth2', + }, + ], + default: 'developerApi', + description: 'The method of authentication.', + }, { displayName: 'App ID', name: 'appId', diff --git a/packages/nodes-base/package.json b/packages/nodes-base/package.json index 31cb4a8da5..d41b5bb4ba 100644 --- a/packages/nodes-base/package.json +++ b/packages/nodes-base/package.json @@ -68,6 +68,7 @@ "dist/credentials/HttpHeaderAuth.credentials.js", "dist/credentials/HubspotApi.credentials.js", "dist/credentials/HubspotDeveloperApi.credentials.js", + "dist/credentials/HubspotOAuth2Api.credentials.js", "dist/credentials/HunterApi.credentials.js", "dist/credentials/Imap.credentials.js", "dist/credentials/IntercomApi.credentials.js", From 46147e0d97795f5cf9b2e16b8cf1f9353475df06 Mon Sep 17 00:00:00 2001 From: Rupenieks Date: Mon, 8 Jun 2020 16:58:32 +0200 Subject: [PATCH 020/241] OAuth2 credentials, genericFunctions modded, oauth2 ui changes --- .../PagerDutyOAuth2Api.credentials.ts | 39 +++++++++++++++++++ .../nodes/PagerDuty/GenericFunctions.ts | 26 +++++++++---- .../nodes/PagerDuty/PagerDuty.node.ts | 34 ++++++++++++++++ packages/nodes-base/package.json | 1 + 4 files changed, 92 insertions(+), 8 deletions(-) create mode 100644 packages/nodes-base/credentials/PagerDutyOAuth2Api.credentials.ts diff --git a/packages/nodes-base/credentials/PagerDutyOAuth2Api.credentials.ts b/packages/nodes-base/credentials/PagerDutyOAuth2Api.credentials.ts new file mode 100644 index 0000000000..0bdd68b9c9 --- /dev/null +++ b/packages/nodes-base/credentials/PagerDutyOAuth2Api.credentials.ts @@ -0,0 +1,39 @@ +import { + ICredentialType, + NodePropertyTypes, +} from 'n8n-workflow'; + +export class PagerDutyOAuth2Api implements ICredentialType { + name = 'pagerDutyOAuth2Api'; + extends = [ + 'oAuth2Api', + ]; + displayName = 'PagerDuty OAuth2 API'; + properties = [ + { + displayName: 'Authorization URL', + name: 'authUrl', + type: 'hidden' as NodePropertyTypes, + default: 'https://app.pagerduty.com/oauth/authorize', + }, + { + displayName: 'Access Token URL', + name: 'accessTokenUrl', + type: 'hidden' as NodePropertyTypes, + default: 'https://app.pagerduty.com/oauth/token', + }, + { + displayName: 'Auth URI Query Parameters', + name: 'authQueryParameters', + type: 'hidden' as NodePropertyTypes, + default: 'grant_type=authorization_code', + }, + { + displayName: 'Authentication', + name: 'authentication', + type: 'hidden' as NodePropertyTypes, + default: 'header', + description: 'Method of authentication.', + }, + ]; +} diff --git a/packages/nodes-base/nodes/PagerDuty/GenericFunctions.ts b/packages/nodes-base/nodes/PagerDuty/GenericFunctions.ts index c360114144..716b4e0d5e 100644 --- a/packages/nodes-base/nodes/PagerDuty/GenericFunctions.ts +++ b/packages/nodes-base/nodes/PagerDuty/GenericFunctions.ts @@ -19,16 +19,11 @@ import { export async function pagerDutyApiRequest(this: IExecuteFunctions | IWebhookFunctions | IHookFunctions | ILoadOptionsFunctions, method: string, resource: string, body: any = {}, query: IDataObject = {}, uri?: string, headers: IDataObject = {}): Promise { // tslint:disable-line:no-any - const credentials = this.getCredentials('pagerDutyApi'); - - if (credentials === undefined) { - throw new Error('No credentials got returned!'); - } + const authenticationMethod = this.getNodeParameter('authentication', 0); const options: OptionsWithUri = { headers: { - Accept: 'application/vnd.pagerduty+json;version=2', - Authorization: `Token token=${credentials.apiToken}`, + Accept: 'application/vnd.pagerduty+json;version=2' }, method, body, @@ -39,15 +34,30 @@ export async function pagerDutyApiRequest(this: IExecuteFunctions | IWebhookFunc arrayFormat: 'brackets', }, }; + if (!Object.keys(body).length) { delete options.form; } if (!Object.keys(query).length) { delete options.qs; } + options.headers = Object.assign({}, options.headers, headers); + try { - return await this.helpers.request!(options); + if (authenticationMethod === 'accessToken') { + const credentials = this.getCredentials('pagerDutyApi'); + + if (credentials === undefined) { + throw new Error('No credentials got returned!'); + } + + options.headers!['Authorization'] = `Token token=${credentials.apiToken}`; + + return await this.helpers.request!(options); + } else { + return await this.helpers.requestOAuth2!.call(this, 'pagerDutyOAuth2Api', options); + } } catch (error) { if (error.response && error.response.body && error.response.body.error && error.response.body.error.errors) { // Try to return the error prettier diff --git a/packages/nodes-base/nodes/PagerDuty/PagerDuty.node.ts b/packages/nodes-base/nodes/PagerDuty/PagerDuty.node.ts index d53e5921b8..f9b8b1e3c7 100644 --- a/packages/nodes-base/nodes/PagerDuty/PagerDuty.node.ts +++ b/packages/nodes-base/nodes/PagerDuty/PagerDuty.node.ts @@ -66,9 +66,43 @@ export class PagerDuty implements INodeType { { name: 'pagerDutyApi', required: true, + displayOptions: { + show: { + authentication: [ + 'accessToken', + ], + }, + }, + }, + { + name: 'pagerDutyOAuth2Api', + required: true, + displayOptions: { + show: { + authentication: [ + 'oAuth2', + ], + }, + }, }, ], properties: [ + { + displayName: 'Authentication', + name: 'authentication', + type: 'options', + options: [ + { + name: 'Access Token', + value: 'accessToken', + }, + { + name: 'OAuth2', + value: 'oAuth2', + }, + ], + default: 'accessToken', + }, { displayName: 'Resource', name: 'resource', diff --git a/packages/nodes-base/package.json b/packages/nodes-base/package.json index 3f28db9dec..18314a9488 100644 --- a/packages/nodes-base/package.json +++ b/packages/nodes-base/package.json @@ -97,6 +97,7 @@ "dist/credentials/OAuth2Api.credentials.js", "dist/credentials/OpenWeatherMapApi.credentials.js", "dist/credentials/PagerDutyApi.credentials.js", + "dist/credentials/PagerDutyOAuth2Api.credentials.js", "dist/credentials/PayPalApi.credentials.js", "dist/credentials/PipedriveApi.credentials.js", "dist/credentials/Postgres.credentials.js", From ddb48dc9db81fdd49e7ce3a82bed152998a38eee Mon Sep 17 00:00:00 2001 From: Rupenieks Date: Mon, 8 Jun 2020 17:50:18 +0200 Subject: [PATCH 021/241] Credentials, oauth2 supported genericfunctions, oauth2 UI mod --- .../WebflowOAuth2Api.credentials.ts | 50 +++++++++++++++++++ .../nodes/Webflow/GenericFunctions.ts | 25 +++++----- .../nodes/Webflow/WebflowTrigger.node.ts | 37 +++++++++++++- packages/nodes-base/package.json | 1 + 4 files changed, 100 insertions(+), 13 deletions(-) create mode 100644 packages/nodes-base/credentials/WebflowOAuth2Api.credentials.ts diff --git a/packages/nodes-base/credentials/WebflowOAuth2Api.credentials.ts b/packages/nodes-base/credentials/WebflowOAuth2Api.credentials.ts new file mode 100644 index 0000000000..c19e451741 --- /dev/null +++ b/packages/nodes-base/credentials/WebflowOAuth2Api.credentials.ts @@ -0,0 +1,50 @@ +import { + ICredentialType, + NodePropertyTypes, +} from 'n8n-workflow'; + + +export class WebflowOAuth2Api implements ICredentialType { + name = 'webflowOAuth2Api'; + extends = [ + 'oAuth2Api', + ]; + displayName = 'Webflow OAuth2 API'; + properties = [ + { + displayName: 'Authorization URL', + name: 'authUrl', + type: 'hidden' as NodePropertyTypes, + default: 'https://webflow.com/oauth/authorize', + required: true, + }, + { + displayName: 'Access Token URL', + name: 'accessTokenUrl', + type: 'hidden' as NodePropertyTypes, + default: 'https://api.webflow.com/oauth/access_token', + required: true, + }, + { + displayName: 'Scope', + name: 'scope', + type: 'string' as NodePropertyTypes, + default: '', + }, + { + displayName: 'Auth URI Query Parameters', + name: 'authQueryParameters', + type: 'hidden' as NodePropertyTypes, + default: '', + description: 'For some services additional query parameters have to be set which can be defined here.', + placeholder: '', + }, + { + displayName: 'Authentication', + name: 'authentication', + type: 'hidden' as NodePropertyTypes, + default: 'body', + description: '', + }, + ]; +} diff --git a/packages/nodes-base/nodes/Webflow/GenericFunctions.ts b/packages/nodes-base/nodes/Webflow/GenericFunctions.ts index 030e47f903..cc10d218a9 100644 --- a/packages/nodes-base/nodes/Webflow/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Webflow/GenericFunctions.ts @@ -9,14 +9,10 @@ import { import { IDataObject } from 'n8n-workflow'; export async function webflowApiRequest(this: IHookFunctions | IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions | IWebhookFunctions, method: string, resource: string, body: any = {}, qs: IDataObject = {}, uri?: string, option: IDataObject = {}): Promise { // tslint:disable-line:no-any - const credentials = this.getCredentials('webflowApi'); - if (credentials === undefined) { - throw new Error('No credentials got returned!'); - } + const authenticationMethod = this.getNodeParameter('authentication', 0); let options: OptionsWithUri = { headers: { - authorization: `Bearer ${credentials.accessToken}`, 'accept-version': '1.0.0', }, method, @@ -31,14 +27,19 @@ export async function webflowApiRequest(this: IHookFunctions | IExecuteFunctions } try { - return await this.helpers.request!(options); - } catch (error) { + if (authenticationMethod === 'accessToken') { + const credentials = this.getCredentials('webflowApi'); + if (credentials === undefined) { + throw new Error('No credentials got returned!'); + } - let errorMessage = error.message; - if (error.response.body && error.response.body.err) { - errorMessage = error.response.body.err; + options.headers!['authorization'] = `Bearer ${credentials.accessToken}`; + + return await this.helpers.request!(options); + } else { + return await this.helpers.requestOAuth2!.call(this, 'webflowOAuth2Api', options); } - - throw new Error('Webflow Error: ' + errorMessage); + } catch (error) { + throw new Error('Webflow Error: ' + error.code + error.msg); } } diff --git a/packages/nodes-base/nodes/Webflow/WebflowTrigger.node.ts b/packages/nodes-base/nodes/Webflow/WebflowTrigger.node.ts index 709b9858cd..73b2efef61 100644 --- a/packages/nodes-base/nodes/Webflow/WebflowTrigger.node.ts +++ b/packages/nodes-base/nodes/Webflow/WebflowTrigger.node.ts @@ -34,7 +34,25 @@ export class WebflowTrigger implements INodeType { { name: 'webflowApi', required: true, - } + displayOptions: { + show: { + authentication: [ + 'accessToken', + ], + }, + }, + }, + { + name: 'webflowOAuth2Api', + required: true, + displayOptions: { + show: { + authentication: [ + 'oAuth2', + ], + }, + }, + }, ], webhooks: [ { @@ -45,6 +63,23 @@ export class WebflowTrigger implements INodeType { }, ], properties: [ + { + displayName: 'Authentication', + name: 'authentication', + type: 'options', + options: [ + { + name: 'Access Token', + value: 'accessToken', + }, + { + name: 'OAuth2', + value: 'oAuth2', + }, + ], + default: 'accessToken', + description: 'Method of authentication.', + }, { displayName: 'Site', name: 'site', diff --git a/packages/nodes-base/package.json b/packages/nodes-base/package.json index 3f28db9dec..95cca9994b 100644 --- a/packages/nodes-base/package.json +++ b/packages/nodes-base/package.json @@ -123,6 +123,7 @@ "dist/credentials/UpleadApi.credentials.js", "dist/credentials/VeroApi.credentials.js", "dist/credentials/WebflowApi.credentials.js", + "dist/credentials/WebflowOAuth2Api.credentials.js", "dist/credentials/WooCommerceApi.credentials.js", "dist/credentials/WordpressApi.credentials.js", "dist/credentials/ZendeskApi.credentials.js", From 918fba81cc300e58b6f6e43974e650e77a2f26c4 Mon Sep 17 00:00:00 2001 From: ricardo Date: Mon, 8 Jun 2020 16:13:17 -0400 Subject: [PATCH 022/241] :zap: Improve error message --- packages/nodes-base/nodes/Twitter/Twitter.node.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/packages/nodes-base/nodes/Twitter/Twitter.node.ts b/packages/nodes-base/nodes/Twitter/Twitter.node.ts index 60f95e3798..94718973c5 100644 --- a/packages/nodes-base/nodes/Twitter/Twitter.node.ts +++ b/packages/nodes-base/nodes/Twitter/Twitter.node.ts @@ -133,7 +133,15 @@ export class Twitter implements INodeType { let attachmentBody = {}; let response: IDataObject = {}; - if (binaryData[binaryPropertyName].mimeType.includes('image')) { + const isAnimatedWebp = (Buffer.from(binaryData[binaryPropertyName].data, 'base64').toString().indexOf('ANMF') !== -1); + + const isImage = binaryData[binaryPropertyName].mimeType.includes('image'); + + if (isImage && isAnimatedWebp) { + throw new Error('Animated .webp images are not supported use .git instead'); + } + + if (isImage) { const attachmentBody = { media_data: binaryData[binaryPropertyName].data, From bdad41f4e88aa73c6736b62a764622e4c1ea3980 Mon Sep 17 00:00:00 2001 From: Rupenieks Date: Tue, 9 Jun 2020 14:00:41 +0200 Subject: [PATCH 023/241] OAuth2 support, changed url to subdomain in credentials --- .../credentials/ZendeskApi.credentials.ts | 7 +- .../ZendeskOAuth2Api.credentials.ts | 74 +++++++++++++++++++ .../nodes/Zendesk/GenericFunctions.ts | 40 +++++++--- .../nodes-base/nodes/Zendesk/Zendesk.node.ts | 37 +++++++++- packages/nodes-base/package.json | 1 + 5 files changed, 146 insertions(+), 13 deletions(-) create mode 100644 packages/nodes-base/credentials/ZendeskOAuth2Api.credentials.ts diff --git a/packages/nodes-base/credentials/ZendeskApi.credentials.ts b/packages/nodes-base/credentials/ZendeskApi.credentials.ts index 29048c1172..4f285912b6 100644 --- a/packages/nodes-base/credentials/ZendeskApi.credentials.ts +++ b/packages/nodes-base/credentials/ZendeskApi.credentials.ts @@ -8,10 +8,11 @@ export class ZendeskApi implements ICredentialType { displayName = 'Zendesk API'; properties = [ { - displayName: 'URL', - name: 'url', + displayName: 'Subdomain', + name: 'subdomain', type: 'string' as NodePropertyTypes, - default: '', + description: 'The subdomain of your Zendesk work environment.', + default: 'n8n', }, { displayName: 'Email', diff --git a/packages/nodes-base/credentials/ZendeskOAuth2Api.credentials.ts b/packages/nodes-base/credentials/ZendeskOAuth2Api.credentials.ts new file mode 100644 index 0000000000..b530404a0d --- /dev/null +++ b/packages/nodes-base/credentials/ZendeskOAuth2Api.credentials.ts @@ -0,0 +1,74 @@ +import { + ICredentialType, + NodePropertyTypes, +} from 'n8n-workflow'; + + +export class ZendeskOAuth2Api implements ICredentialType { + name = 'zendeskOAuth2Api'; + extends = [ + 'oAuth2Api', + ]; + displayName = 'Zendesk OAuth2 API'; + properties = [ + { + displayName: 'Subdomain', + name: 'subdomain', + type: 'string' as NodePropertyTypes, + default: 'n8n', + description: 'The subdomain of your Zendesk work environment.', + required: true, + }, + { + displayName: 'Authorization URL', + name: 'authUrl', + type: 'string' as NodePropertyTypes, + default: 'https://{SUBDOMAIN_HERE}.zendesk.com/oauth/authorizations/new', + description: 'URL to get authorization code. Replace {SUBDOMAIN_HERE} with your subdomain.', + required: true, + }, + { + displayName: 'Access Token URL', + name: 'accessTokenUrl', + type: 'string' as NodePropertyTypes, + default: 'https://{SUBDOMAIN_HERE}.zendesk.com/oauth/tokens', + description: 'URL to get access token. Replace {SUBDOMAIN_HERE} with your subdomain.', + required: true, + }, + { + displayName: 'Client ID', + name: 'clientId', + type: 'string' as NodePropertyTypes, + default: '', + required: true, + }, + { + displayName: 'Client Secret', + name: 'clientSecret', + type: 'string' as NodePropertyTypes, + default: '', + required: true, + }, + { + displayName: 'Scope', + name: 'scope', + type: 'string' as NodePropertyTypes, + default: 'write read', + }, + { + displayName: 'Auth URI Query Parameters', + name: 'authQueryParameters', + type: 'hidden' as NodePropertyTypes, + default: '', + description: 'For some services additional query parameters have to be set which can be defined here.', + placeholder: '', + }, + { + displayName: 'Authentication', + name: 'authentication', + type: 'hidden' as NodePropertyTypes, + default: 'body', + description: 'Resource to consume.', + }, + ]; +} diff --git a/packages/nodes-base/nodes/Zendesk/GenericFunctions.ts b/packages/nodes-base/nodes/Zendesk/GenericFunctions.ts index ffe371e160..007741813f 100644 --- a/packages/nodes-base/nodes/Zendesk/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Zendesk/GenericFunctions.ts @@ -14,26 +14,48 @@ import { } from 'n8n-workflow'; export async function zendeskApiRequest(this: IHookFunctions | IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions, method: string, resource: string, body: any = {}, qs: IDataObject = {}, uri?: string, option: IDataObject = {}): Promise { // tslint:disable-line:no-any - const credentials = this.getCredentials('zendeskApi'); - if (credentials === undefined) { - throw new Error('No credentials got returned!'); - } - const base64Key = Buffer.from(`${credentials.email}/token:${credentials.apiToken}`).toString('base64'); + const authenticationMethod = this.getNodeParameter('authentication', 0); + let options: OptionsWithUri = { - headers: { 'Authorization': `Basic ${base64Key}`}, + headers: {}, method, qs, body, - uri: uri ||`${credentials.url}/api/v2${resource}.json`, + //@ts-ignore + uri, json: true }; + options = Object.assign({}, options, option); if (Object.keys(options.body).length === 0) { delete options.body; } + try { - return await this.helpers.request!(options); - } catch (err) { + if (authenticationMethod === 'accessToken') { + const credentials = this.getCredentials('zendeskApi'); + + if (credentials === undefined) { + throw new Error('No credentials got returned!'); + } + + const base64Key = Buffer.from(`${credentials.email}/token:${credentials.apiToken}`).toString('base64'); + options.uri = `https://${credentials.subdomain}.zendesk.com/api/v2${resource}.json`; + options.headers!['Authorization'] = `Basic ${base64Key}`; + + return await this.helpers.request!(options); + } else { + const credentials = this.getCredentials('zendeskOAuth2Api'); + + if (credentials === undefined) { + throw new Error('No credentials got returned!'); + } + + options.uri = `https://${credentials.subdomain}.zendesk.com/api/v2${resource}.json`; + + return await this.helpers.requestOAuth2!.call(this, 'zendeskOAuth2Api', options); + } + } catch(err) { let errorMessage = err.message; if (err.response && err.response.body && err.response.body.error) { errorMessage = err.response.body.error; diff --git a/packages/nodes-base/nodes/Zendesk/Zendesk.node.ts b/packages/nodes-base/nodes/Zendesk/Zendesk.node.ts index 8a2586d8d8..d0ea357b5a 100644 --- a/packages/nodes-base/nodes/Zendesk/Zendesk.node.ts +++ b/packages/nodes-base/nodes/Zendesk/Zendesk.node.ts @@ -52,9 +52,44 @@ export class Zendesk implements INodeType { { name: 'zendeskApi', required: true, - } + displayOptions: { + show: { + authentication: [ + 'accessToken', + ], + }, + }, + }, + { + name: 'zendeskOAuth2Api', + required: true, + displayOptions: { + show: { + authentication: [ + 'oAuth2', + ], + }, + }, + }, ], properties: [ + { + displayName: 'Authentication', + name: 'authentication', + type: 'options', + options: [ + { + name: 'Access Token', + value: 'accessToken', + }, + { + name: 'OAuth2', + value: 'oAuth2', + }, + ], + default: 'accessToken', + description: 'The resource to operate on.', + }, { displayName: 'Resource', name: 'resource', diff --git a/packages/nodes-base/package.json b/packages/nodes-base/package.json index 3f28db9dec..03f9d8c1b1 100644 --- a/packages/nodes-base/package.json +++ b/packages/nodes-base/package.json @@ -126,6 +126,7 @@ "dist/credentials/WooCommerceApi.credentials.js", "dist/credentials/WordpressApi.credentials.js", "dist/credentials/ZendeskApi.credentials.js", + "dist/credentials/ZendeskOAuth2Api.credentials.js", "dist/credentials/ZohoOAuth2Api.credentials.js", "dist/credentials/ZulipApi.credentials.js" ], From 5bce911b0f03ef1f8a42a7a378df8f0788d8f891 Mon Sep 17 00:00:00 2001 From: Rupenieks Date: Tue, 9 Jun 2020 15:53:17 +0200 Subject: [PATCH 024/241] Added OAuth2 UI for trigger --- .../nodes/Zendesk/ZendeskTrigger.node.ts | 37 ++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/packages/nodes-base/nodes/Zendesk/ZendeskTrigger.node.ts b/packages/nodes-base/nodes/Zendesk/ZendeskTrigger.node.ts index cc4e26dbd4..a5e1350fed 100644 --- a/packages/nodes-base/nodes/Zendesk/ZendeskTrigger.node.ts +++ b/packages/nodes-base/nodes/Zendesk/ZendeskTrigger.node.ts @@ -42,7 +42,25 @@ export class ZendeskTrigger implements INodeType { { name: 'zendeskApi', required: true, - } + displayOptions: { + show: { + authentication: [ + 'accessToken', + ], + }, + }, + }, + { + name: 'zendeskOAuth2Api', + required: true, + displayOptions: { + show: { + authentication: [ + 'oAuth2', + ], + }, + }, + }, ], webhooks: [ { @@ -53,6 +71,23 @@ export class ZendeskTrigger implements INodeType { }, ], properties: [ + { + displayName: 'Authentication', + name: 'authentication', + type: 'options', + options: [ + { + name: 'Access Token', + value: 'accessToken', + }, + { + name: 'OAuth2', + value: 'oAuth2', + }, + ], + default: 'accessToken', + description: 'The resource to operate on.', + }, { displayName: 'Service', name: 'service', From 62c835656671fab65187f2d861ffb5a98c7440db Mon Sep 17 00:00:00 2001 From: Erin McNulty Date: Tue, 9 Jun 2020 16:50:09 -0400 Subject: [PATCH 025/241] :twisted_rightwards_arrows: Fix Github Trigger node and add OAuth support (#643) * Fixed bug with small name change in credentials * Deleted Excess Commented Code * Changed the code to give user options --- .../nodes/Github/GithubTrigger.node.ts | 37 ++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/packages/nodes-base/nodes/Github/GithubTrigger.node.ts b/packages/nodes-base/nodes/Github/GithubTrigger.node.ts index 2a14b5d3db..1360d7536a 100644 --- a/packages/nodes-base/nodes/Github/GithubTrigger.node.ts +++ b/packages/nodes-base/nodes/Github/GithubTrigger.node.ts @@ -34,7 +34,25 @@ export class GithubTrigger implements INodeType { { name: 'githubApi', required: true, - } + displayOptions: { + show: { + authentication: [ + 'accessToken', + ], + }, + }, + }, + { + name: 'githubOAuth2Api', + required: true, + displayOptions: { + show: { + authentication: [ + 'oAuth2', + ], + }, + }, + }, ], webhooks: [ { @@ -45,6 +63,23 @@ export class GithubTrigger implements INodeType { }, ], properties: [ + { + displayName: 'Authentication', + name: 'authentication', + type: 'options', + options: [ + { + name: 'Access Token', + value: 'accessToken', + }, + { + name: 'OAuth2', + value: 'oAuth2', + }, + ], + default: 'accessToken', + description: 'The resource to operate on.', + }, { displayName: 'Repository Owner', name: 'owner', From 751d6934d7a04e6a56cc2da08217a64b603be2c7 Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Tue, 9 Jun 2020 23:05:51 +0200 Subject: [PATCH 026/241] :bookmark: Release n8n-nodes-base@0.64.1 --- packages/nodes-base/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/nodes-base/package.json b/packages/nodes-base/package.json index 5cf4bb3eb9..822978eaf4 100644 --- a/packages/nodes-base/package.json +++ b/packages/nodes-base/package.json @@ -1,6 +1,6 @@ { "name": "n8n-nodes-base", - "version": "0.64.0", + "version": "0.64.1", "description": "Base nodes of n8n", "license": "SEE LICENSE IN LICENSE.md", "homepage": "https://n8n.io", From e8737b5c4e3e79104a298d6b582784b67965f178 Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Tue, 9 Jun 2020 23:07:04 +0200 Subject: [PATCH 027/241] :arrow_up: Set n8n-nodes-base@0.64.1 on n8n --- packages/cli/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/cli/package.json b/packages/cli/package.json index 1b043c5494..3873eb6bdb 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -102,7 +102,7 @@ "mysql2": "^2.0.1", "n8n-core": "~0.36.0", "n8n-editor-ui": "~0.47.0", - "n8n-nodes-base": "~0.64.0", + "n8n-nodes-base": "~0.64.1", "n8n-workflow": "~0.33.0", "oauth-1.0a": "^2.2.6", "open": "^7.0.0", From 4eff72504d0491443998db82b497f47a7ccb61b3 Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Tue, 9 Jun 2020 23:07:51 +0200 Subject: [PATCH 028/241] :bookmark: Release n8n@0.69.1 --- packages/cli/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/cli/package.json b/packages/cli/package.json index 3873eb6bdb..f3a747bfe2 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "n8n", - "version": "0.69.0", + "version": "0.69.1", "description": "n8n Workflow Automation Tool", "license": "SEE LICENSE IN LICENSE.md", "homepage": "https://n8n.io", From 68f9dd15609f07e91e18f71ef82f299356db5c4d Mon Sep 17 00:00:00 2001 From: Rupenieks Date: Wed, 10 Jun 2020 09:50:50 +0200 Subject: [PATCH 029/241] OAuth2 support --- .../TypeformOAuth2Api.credentials.ts | 46 +++++++++++++++++++ .../nodes/Typeform/GenericFunctions.ts | 29 +++++++----- .../nodes/Typeform/TypeformTrigger.node.ts | 37 ++++++++++++++- packages/nodes-base/package.json | 1 + 4 files changed, 101 insertions(+), 12 deletions(-) create mode 100644 packages/nodes-base/credentials/TypeformOAuth2Api.credentials.ts diff --git a/packages/nodes-base/credentials/TypeformOAuth2Api.credentials.ts b/packages/nodes-base/credentials/TypeformOAuth2Api.credentials.ts new file mode 100644 index 0000000000..5465eee72c --- /dev/null +++ b/packages/nodes-base/credentials/TypeformOAuth2Api.credentials.ts @@ -0,0 +1,46 @@ +import { + ICredentialType, + NodePropertyTypes, +} from 'n8n-workflow'; + + +export class TypeformOAuth2Api implements ICredentialType { + name = 'typeformOAuth2Api'; + extends = [ + 'oAuth2Api', + ]; + properties = [ + { + displayName: 'Authorization URL', + name: 'authUrl', + type: 'hidden' as NodePropertyTypes, + default: 'https://api.typeform.com/oauth/authorize', + required: true, + }, + { + displayName: 'Access Token URL', + name: 'accessTokenUrl', + type: 'hidden' as NodePropertyTypes, + default: 'https://api.typeform.com/oauth/token', + required: true, + }, + { + displayName: 'Scope', + name: 'scope', + type: 'string' as NodePropertyTypes, + default: 'webhooks:write,webhooks:read,forms:read,', + }, + { + displayName: 'Auth URI Query Parameters', + name: 'authQueryParameters', + type: 'hidden' as NodePropertyTypes, + default: '', + }, + { + displayName: 'Authentication', + name: 'authentication', + type: 'hidden' as NodePropertyTypes, + default: 'header', + }, + ]; +} diff --git a/packages/nodes-base/nodes/Typeform/GenericFunctions.ts b/packages/nodes-base/nodes/Typeform/GenericFunctions.ts index c5e9242465..83ca713afe 100644 --- a/packages/nodes-base/nodes/Typeform/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Typeform/GenericFunctions.ts @@ -45,18 +45,10 @@ export interface ITypeformAnswerField { * @returns {Promise} */ export async function apiRequest(this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions, method: string, endpoint: string, body: object, query?: IDataObject): Promise { // tslint:disable-line:no-any - const credentials = this.getCredentials('typeformApi'); - - if (credentials === undefined) { - throw new Error('No credentials got returned!'); - } - - query = query || {}; + const authenticationMethod = this.getNodeParameter('authentication', 0); const options: OptionsWithUri = { - headers: { - 'Authorization': `bearer ${credentials.accessToken}`, - }, + headers: {}, method, body, qs: query, @@ -64,8 +56,23 @@ export async function apiRequest(this: IHookFunctions | IExecuteFunctions | ILoa json: true, }; + query = query || {}; + try { - return await this.helpers.request!(options); + if (authenticationMethod === 'accessToken') { + + const credentials = this.getCredentials('typeformApi'); + + if (credentials === undefined) { + throw new Error('No credentials got returned!'); + } + + options.headers!['Authorization'] = `bearer ${credentials.accessToken}`; + + return await this.helpers.request!(options); + } else { + return await this.helpers.requestOAuth2!.call(this, 'typeformOAuth2Api', options); + } } catch (error) { if (error.statusCode === 401) { // Return a clear error diff --git a/packages/nodes-base/nodes/Typeform/TypeformTrigger.node.ts b/packages/nodes-base/nodes/Typeform/TypeformTrigger.node.ts index b127a1f594..9c8f6e16ff 100644 --- a/packages/nodes-base/nodes/Typeform/TypeformTrigger.node.ts +++ b/packages/nodes-base/nodes/Typeform/TypeformTrigger.node.ts @@ -37,7 +37,25 @@ export class TypeformTrigger implements INodeType { { name: 'typeformApi', required: true, - } + displayOptions: { + show: { + authentication: [ + 'accessToken', + ], + }, + }, + }, + { + name: 'typeformOAuth2Api', + required: true, + displayOptions: { + show: { + authentication: [ + 'oAuth2', + ], + }, + }, + }, ], webhooks: [ { @@ -48,6 +66,23 @@ export class TypeformTrigger implements INodeType { }, ], properties: [ + { + displayName: 'Authentication', + name: 'authentication', + type: 'options', + options: [ + { + name: 'Access Token', + value: 'accessToken', + }, + { + name: 'OAuth2', + value: 'oAuth2', + }, + ], + default: 'accessToken', + description: 'The resource to operate on.', + }, { displayName: 'Form', name: 'formId', diff --git a/packages/nodes-base/package.json b/packages/nodes-base/package.json index 3f28db9dec..13b3f0c128 100644 --- a/packages/nodes-base/package.json +++ b/packages/nodes-base/package.json @@ -119,6 +119,7 @@ "dist/credentials/TwilioApi.credentials.js", "dist/credentials/TwitterOAuth1Api.credentials.js", "dist/credentials/TypeformApi.credentials.js", + "dist/credentials/TypeformOAuth2Api.credentials.js", "dist/credentials/TogglApi.credentials.js", "dist/credentials/UpleadApi.credentials.js", "dist/credentials/VeroApi.credentials.js", From 934a4f16d16fff1d5c87db9d7df004838ea37980 Mon Sep 17 00:00:00 2001 From: Rupenieks Date: Wed, 10 Jun 2020 09:51:12 +0200 Subject: [PATCH 030/241] Update TypeformOAuth2Api.credentials.ts --- packages/nodes-base/credentials/TypeformOAuth2Api.credentials.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/nodes-base/credentials/TypeformOAuth2Api.credentials.ts b/packages/nodes-base/credentials/TypeformOAuth2Api.credentials.ts index 5465eee72c..6e95391577 100644 --- a/packages/nodes-base/credentials/TypeformOAuth2Api.credentials.ts +++ b/packages/nodes-base/credentials/TypeformOAuth2Api.credentials.ts @@ -9,6 +9,7 @@ export class TypeformOAuth2Api implements ICredentialType { extends = [ 'oAuth2Api', ]; + displayName = 'Typeform OAuth2 API'; properties = [ { displayName: 'Authorization URL', From 60fa44722d96e6944e34899db3d3464f0475747e Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Wed, 10 Jun 2020 11:46:12 +0200 Subject: [PATCH 031/241] :zap: Remove not working and not possible option from Github-Node --- packages/nodes-base/nodes/Github/Github.node.ts | 5 ----- 1 file changed, 5 deletions(-) diff --git a/packages/nodes-base/nodes/Github/Github.node.ts b/packages/nodes-base/nodes/Github/Github.node.ts index 00133ec302..035b381091 100644 --- a/packages/nodes-base/nodes/Github/Github.node.ts +++ b/packages/nodes-base/nodes/Github/Github.node.ts @@ -244,11 +244,6 @@ export class Github implements INodeType { }, }, options: [ - { - name: 'Get Emails', - value: 'getEmails', - description: 'Returns the email addresses of a user', - }, { name: 'Get Repositories', value: 'getRepositories', From 9983ed6f8f8a358afd83600cd239e9a59f36de6e Mon Sep 17 00:00:00 2001 From: Rupenieks Date: Wed, 10 Jun 2020 12:48:21 +0200 Subject: [PATCH 032/241] OAuth2: credentials, genericFunctions, UI --- .../SurveyMonkeyOAuth2Api.credentials.ts | 47 +++++++++++++++++++ .../nodes/SurveyMonkey/GenericFunctions.ts | 25 ++++++---- .../SurveyMonkey/SurveyMonkeyTrigger.node.ts | 44 ++++++++++++++++- packages/nodes-base/package.json | 1 + 4 files changed, 108 insertions(+), 9 deletions(-) create mode 100644 packages/nodes-base/credentials/SurveyMonkeyOAuth2Api.credentials.ts diff --git a/packages/nodes-base/credentials/SurveyMonkeyOAuth2Api.credentials.ts b/packages/nodes-base/credentials/SurveyMonkeyOAuth2Api.credentials.ts new file mode 100644 index 0000000000..cbeafdf753 --- /dev/null +++ b/packages/nodes-base/credentials/SurveyMonkeyOAuth2Api.credentials.ts @@ -0,0 +1,47 @@ +import { + ICredentialType, + NodePropertyTypes, +} from 'n8n-workflow'; + + +export class SurveyMonkeyOAuth2Api implements ICredentialType { + name = 'surveyMonkeyOAuth2Api'; + extends = [ + 'oAuth2Api', + ]; + displayName = 'SurveyMonkey OAuth2 API'; + properties = [ + { + displayName: 'Authorization URL', + name: 'authUrl', + type: 'hidden' as NodePropertyTypes, + default: 'https://api.surveymonkey.com/oauth/authorize', + required: true, + }, + { + displayName: 'Access Token URL', + name: 'accessTokenUrl', + type: 'hidden' as NodePropertyTypes, + default: 'https://api.surveymonkey.com/oauth/token', + required: true, + }, + { + displayName: 'Scope', + name: 'scope', + type: 'string' as NodePropertyTypes, + default: 'surveys_read,surveys_write,responses_read,responses_write,webhooks_read,webhooks_write', + }, + { + displayName: 'Auth URI Query Parameters', + name: 'authQueryParameters', + type: 'hidden' as NodePropertyTypes, + default: '', + }, + { + displayName: 'Authentication', + name: 'authentication', + type: 'hidden' as NodePropertyTypes, + default: 'body' + }, + ]; +} diff --git a/packages/nodes-base/nodes/SurveyMonkey/GenericFunctions.ts b/packages/nodes-base/nodes/SurveyMonkey/GenericFunctions.ts index 86f999b578..bfca4dde1b 100644 --- a/packages/nodes-base/nodes/SurveyMonkey/GenericFunctions.ts +++ b/packages/nodes-base/nodes/SurveyMonkey/GenericFunctions.ts @@ -14,19 +14,13 @@ import { } from 'n8n-workflow'; export async function surveyMonkeyApiRequest(this: IExecuteFunctions | IWebhookFunctions | IHookFunctions | ILoadOptionsFunctions, method: string, resource: string, body: any = {}, query: IDataObject = {}, uri?: string, option: IDataObject = {}): Promise { // tslint:disable-line:no-any - - const credentials = this.getCredentials('surveyMonkeyApi'); - - if (credentials === undefined) { - throw new Error('No credentials got returned!'); - } + const authenticationMethod = this.getNodeParameter('authentication', 0); const endpoint = 'https://api.surveymonkey.com/v3'; let options: OptionsWithUri = { headers: { 'Content-Type': 'application/json', - 'Authorization': `bearer ${credentials.accessToken}`, }, method, body, @@ -34,6 +28,7 @@ export async function surveyMonkeyApiRequest(this: IExecuteFunctions | IWebhookF uri: uri || `${endpoint}${resource}`, json: true }; + if (!Object.keys(body).length) { delete options.body; } @@ -41,8 +36,22 @@ export async function surveyMonkeyApiRequest(this: IExecuteFunctions | IWebhookF delete options.qs; } options = Object.assign({}, options, option); + try { - return await this.helpers.request!(options); + if ( authenticationMethod === 'accessToken') { + const credentials = this.getCredentials('surveyMonkeyApi'); + + if (credentials === undefined) { + throw new Error('No credentials got returned!'); + } + // @ts-ignore + options.headers['Authorization'] = `bearer ${credentials.accessToken}`; + + return await this.helpers.request!(options); + + } else { + return await this.helpers.requestOAuth2?.call(this, 'surveyMonkeyOAuth2Api', options); + } } catch (error) { const errorMessage = error.response.body.error.message; if (errorMessage !== undefined) { diff --git a/packages/nodes-base/nodes/SurveyMonkey/SurveyMonkeyTrigger.node.ts b/packages/nodes-base/nodes/SurveyMonkey/SurveyMonkeyTrigger.node.ts index efdc8dba5a..c0f722dd8c 100644 --- a/packages/nodes-base/nodes/SurveyMonkey/SurveyMonkeyTrigger.node.ts +++ b/packages/nodes-base/nodes/SurveyMonkey/SurveyMonkeyTrigger.node.ts @@ -49,6 +49,24 @@ export class SurveyMonkeyTrigger implements INodeType { { name: 'surveyMonkeyApi', required: true, + displayOptions: { + show: { + authentication: [ + 'accessToken', + ], + }, + }, + }, + { + name: 'surveyMonkeyOAuth2Api', + required: true, + displayOptions: { + show: { + authentication: [ + 'oAuth2', + ], + }, + }, }, ], webhooks: [ @@ -66,6 +84,23 @@ export class SurveyMonkeyTrigger implements INodeType { }, ], properties: [ + { + displayName: 'Authentication', + name: 'authentication', + type: 'options', + options: [ + { + name: 'Access Token', + value: 'accessToken', + }, + { + name: 'OAuth2', + value: 'oAuth2', + }, + ], + default: 'accessToken', + description: 'Method of authentication.', + }, { displayName: 'Type', name: 'objectType', @@ -453,11 +488,18 @@ export class SurveyMonkeyTrigger implements INodeType { async webhook(this: IWebhookFunctions): Promise { const event = this.getNodeParameter('event') as string; const objectType = this.getNodeParameter('objectType') as string; - const credentials = this.getCredentials('surveyMonkeyApi') as IDataObject; + const authenticationMethod = this.getNodeParameter('authentication') as string; + let credentials : IDataObject; const headerData = this.getHeaderData() as IDataObject; const req = this.getRequestObject(); const webhookName = this.getWebhookName(); + if (authenticationMethod === 'accessToken') { + credentials = this.getCredentials('surveyMonkeyApi') as IDataObject; + } else { + credentials = this.getCredentials('surveyMonkeyOAuth2Api') as IDataObject; + } + if (webhookName === 'setup') { // It is a create webhook confirmation request return {}; diff --git a/packages/nodes-base/package.json b/packages/nodes-base/package.json index 822978eaf4..fe6c3ccb95 100644 --- a/packages/nodes-base/package.json +++ b/packages/nodes-base/package.json @@ -113,6 +113,7 @@ "dist/credentials/SalesmateApi.credentials.js", "dist/credentials/SegmentApi.credentials.js", "dist/credentials/SurveyMonkeyApi.credentials.js", + "dist/credentials/SurveyMonkeyOAuth2Api.credentials.js", "dist/credentials/TelegramApi.credentials.js", "dist/credentials/TodoistApi.credentials.js", "dist/credentials/TrelloApi.credentials.js", From d6144838281c3a9004d2eb440b74b27126628c44 Mon Sep 17 00:00:00 2001 From: Rupenieks Date: Wed, 10 Jun 2020 12:57:13 +0200 Subject: [PATCH 033/241] trigger node fix --- .../nodes/Hubspot/HubspotTrigger.node.ts | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/packages/nodes-base/nodes/Hubspot/HubspotTrigger.node.ts b/packages/nodes-base/nodes/Hubspot/HubspotTrigger.node.ts index c2ed3f3e0a..38fd678d58 100644 --- a/packages/nodes-base/nodes/Hubspot/HubspotTrigger.node.ts +++ b/packages/nodes-base/nodes/Hubspot/HubspotTrigger.node.ts @@ -281,7 +281,21 @@ export class HubspotTrigger implements INodeType { }; async webhook(this: IWebhookFunctions): Promise { - const credentials = this.getCredentials('hubspotDeveloperApi'); + + const authenticationMethod = this.getNodeParameter('authentication') as string; + + let credentials : IDataObject; + + if (authenticationMethod === 'hubspotDeveloperApi') { + credentials = this.getCredentials('hubspotDeveloperApi') as IDataObject; + } else { + credentials = this.getCredentials('hubspotOAuth2Api') as IDataObject; + } + + if (credentials === undefined) { + throw new Error('No credentials found!'); + } + const req = this.getRequestObject(); const bodyData = req.body; const headerData = this.getHeaderData(); From 57b3a2e05eb59bbfdbd53c39c64d49fb9d0ed150 Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Wed, 10 Jun 2020 13:00:28 +0200 Subject: [PATCH 034/241] :zap: Cleanup of external hooks --- packages/cli/commands/execute.ts | 5 +++ packages/cli/commands/start.ts | 3 -- packages/cli/src/ExternalHooks.ts | 1 - packages/cli/src/Server.ts | 4 +- .../cli/src/externalHooksTemp/test-hooks.ts | 45 ------------------- 5 files changed, 7 insertions(+), 51 deletions(-) delete mode 100644 packages/cli/src/externalHooksTemp/test-hooks.ts diff --git a/packages/cli/commands/execute.ts b/packages/cli/commands/execute.ts index 7501b4aa9b..54016c5d55 100644 --- a/packages/cli/commands/execute.ts +++ b/packages/cli/commands/execute.ts @@ -10,6 +10,7 @@ import { import { ActiveExecutions, Db, + ExternalHooks, GenericHelpers, IWorkflowBase, IWorkflowExecutionDataProcess, @@ -103,6 +104,10 @@ export class Execute extends Command { // Wait till the n8n-packages have been read await loadNodesAndCredentialsPromise; + // Load all external hooks + const externalHooks = ExternalHooks(); + await externalHooks.init(); + // Add the found types to an instance other parts of the application can use const nodeTypes = NodeTypes(); await nodeTypes.init(loadNodesAndCredentials.nodeTypes); diff --git a/packages/cli/commands/start.ts b/packages/cli/commands/start.ts index 65edec601d..bce82bf890 100644 --- a/packages/cli/commands/start.ts +++ b/packages/cli/commands/start.ts @@ -5,7 +5,6 @@ import { } from 'n8n-core'; import { Command, flags } from '@oclif/command'; const open = require('open'); -// import { dirname } from 'path'; import * as config from '../config'; import { @@ -113,8 +112,6 @@ export class Start extends Command { const externalHooks = ExternalHooks(); await externalHooks.init(); - // await externalHooks.run('credentials.new'); - // Add the found types to an instance other parts of the application can use const nodeTypes = NodeTypes(); await nodeTypes.init(loadNodesAndCredentials.nodeTypes); diff --git a/packages/cli/src/ExternalHooks.ts b/packages/cli/src/ExternalHooks.ts index 9d195ccbad..b2b84cd7c7 100644 --- a/packages/cli/src/ExternalHooks.ts +++ b/packages/cli/src/ExternalHooks.ts @@ -6,7 +6,6 @@ import { import * as config from '../config'; -// export EXTERNAL_HOOK_FILES=/data/packages/cli/dist/src/externalHooksTemp/test-hooks.js class ExternalHooksClass implements IExternalHooksClass { diff --git a/packages/cli/src/Server.ts b/packages/cli/src/Server.ts index a36a2fd81e..d302e3970a 100644 --- a/packages/cli/src/Server.ts +++ b/packages/cli/src/Server.ts @@ -34,7 +34,7 @@ import { IExecutionsListResponse, IExecutionsStopData, IExecutionsSummary, - IExternalHooks, + IExternalHooksClass, IN8nUISettings, IPackageVersions, IWorkflowBase, @@ -94,7 +94,7 @@ class App { testWebhooks: TestWebhooks.TestWebhooks; endpointWebhook: string; endpointWebhookTest: string; - externalHooks: IExternalHooks; + externalHooks: IExternalHooksClass; saveDataErrorExecution: string; saveDataSuccessExecution: string; saveManualExecutions: boolean; diff --git a/packages/cli/src/externalHooksTemp/test-hooks.ts b/packages/cli/src/externalHooksTemp/test-hooks.ts deleted file mode 100644 index b49c0600b2..0000000000 --- a/packages/cli/src/externalHooksTemp/test-hooks.ts +++ /dev/null @@ -1,45 +0,0 @@ -import { - WorkflowExecuteMode, -} from 'n8n-workflow'; - -import { - IExternalHooks, - IExternalHooksFunctions, - IWorkflowBase, - IWorkflowDb, -} from '../'; - - -export = { - credentials: { - create: [ - async function (this: IExternalHooksFunctions) { - // Here any additional code can run or the creation blocked - // throw new Error('No additional credentials can be created.'); - }, - ], - }, - workflow: { - execute: [ - async function (this: IExternalHooksFunctions, workflowData: IWorkflowDb, mode: WorkflowExecuteMode) { - console.log('execute: ' + mode); - // if (mode === 'integrated') { - // throw new Error('Workflow can not be executed.'); - // } - } - ], - update: [ - async function (this: IExternalHooksFunctions, workflowData: IWorkflowBase) { - console.log('update workflow hook'); - - // const responseData = await this.dbCollections.Workflow!.findOne(workflowData.id); - // console.log('workflowData'); - // console.log(responseData); - // console.log(workflowData); - - // Here any additional code can run or the creation blocked - // throw new Error('Workflow can not be updated.'); - }, - ], - }, -} as IExternalHooks; From 5ed86670a8a029c841407a901d7829492b81f311 Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Wed, 10 Jun 2020 15:39:15 +0200 Subject: [PATCH 035/241] :zap: Make it use of full webhook path more generic --- packages/cli/src/ActiveWorkflowRunner.ts | 16 +++++++++---- packages/cli/src/Server.ts | 1 - packages/core/src/NodeExecuteFunctions.ts | 3 ++- .../editor-ui/src/components/NodeWebhooks.vue | 3 ++- packages/nodes-base/nodes/Webhook.node.ts | 1 + packages/workflow/src/Interfaces.ts | 3 ++- packages/workflow/src/NodeHelpers.ts | 23 +++++++++++-------- packages/workflow/src/Workflow.ts | 2 +- 8 files changed, 33 insertions(+), 19 deletions(-) diff --git a/packages/cli/src/ActiveWorkflowRunner.ts b/packages/cli/src/ActiveWorkflowRunner.ts index a72cb065c7..13fc5697ec 100644 --- a/packages/cli/src/ActiveWorkflowRunner.ts +++ b/packages/cli/src/ActiveWorkflowRunner.ts @@ -211,7 +211,7 @@ export class ActiveWorkflowRunner { */ async addWorkflowWebhooks(workflow: Workflow, additionalData: IWorkflowExecuteAdditionalDataWorkflow, mode: WorkflowExecuteMode): Promise { const webhooks = WebhookHelpers.getWorkflowWebhooks(workflow, additionalData); - let path = ''; + let path = '' as string | undefined; for (const webhookData of webhooks) { @@ -221,12 +221,20 @@ export class ActiveWorkflowRunner { path = node.parameters.path as string; if (node.parameters.path === undefined) { - path = workflow.getSimpleParameterValue(node, webhookData.webhookDescription['path'], 'GET') as string; + path = workflow.getSimpleParameterValue(node, webhookData.webhookDescription['path']) as string | undefined; + + if (path === undefined) { + // TODO: Use a proper logger + console.error(`No webhook path could be found for node "${node.name}" in workflow "${workflow.id}".`); + continue; + } } + const isFullPath: boolean = workflow.getSimpleParameterValue(node, webhookData.webhookDescription['isFullPath'], false) as boolean; + const webhook = { workflowId: webhookData.workflowId, - webhookPath: NodeHelpers.getNodeWebhookPath(workflow.id as string, node, path), + webhookPath: NodeHelpers.getNodeWebhookPath(workflow.id as string, node, path, isFullPath), node: node.name, method: webhookData.httpMethod, } as IWebhookDb; @@ -257,7 +265,7 @@ export class ActiveWorkflowRunner { // it's a error runnig the webhook methods (checkExists, create) errorMessage = error.detail; } else { - errorMessage = error; + errorMessage = error.message; } throw new Error(errorMessage); diff --git a/packages/cli/src/Server.ts b/packages/cli/src/Server.ts index 4e27568983..cf53b85665 100644 --- a/packages/cli/src/Server.ts +++ b/packages/cli/src/Server.ts @@ -46,7 +46,6 @@ import { WorkflowCredentials, WebhookHelpers, WorkflowExecuteAdditionalData, - WorkflowHelpers, WorkflowRunner, GenericHelpers, } from './'; diff --git a/packages/core/src/NodeExecuteFunctions.ts b/packages/core/src/NodeExecuteFunctions.ts index 640a75ca9a..9cc9c776de 100644 --- a/packages/core/src/NodeExecuteFunctions.ts +++ b/packages/core/src/NodeExecuteFunctions.ts @@ -289,7 +289,8 @@ export function getNodeWebhookUrl(name: string, workflow: Workflow, node: INode, return undefined; } - return NodeHelpers.getNodeWebhookUrl(baseUrl, workflow.id!, node, path.toString()); + const isFullPath: boolean = workflow.getSimpleParameterValue(node, webhookDescription['isFullPath'], false) as boolean; + return NodeHelpers.getNodeWebhookUrl(baseUrl, workflow.id!, node, path.toString(), isFullPath); } diff --git a/packages/editor-ui/src/components/NodeWebhooks.vue b/packages/editor-ui/src/components/NodeWebhooks.vue index b649575a0b..e2875a49fd 100644 --- a/packages/editor-ui/src/components/NodeWebhooks.vue +++ b/packages/editor-ui/src/components/NodeWebhooks.vue @@ -110,8 +110,9 @@ export default mixins( const workflowId = this.$store.getters.workflowId; const path = this.getValue(webhookData, 'path'); + const isFullPath = this.getValue(webhookData, 'isFullPath') as unknown as boolean || false; - return NodeHelpers.getNodeWebhookUrl(baseUrl, workflowId, this.node, path); + return NodeHelpers.getNodeWebhookUrl(baseUrl, workflowId, this.node, path, isFullPath); }, }, watch: { diff --git a/packages/nodes-base/nodes/Webhook.node.ts b/packages/nodes-base/nodes/Webhook.node.ts index 26562abc4c..1778d44290 100644 --- a/packages/nodes-base/nodes/Webhook.node.ts +++ b/packages/nodes-base/nodes/Webhook.node.ts @@ -77,6 +77,7 @@ export class Webhook implements INodeType { { name: 'default', httpMethod: '={{$parameter["httpMethod"]}}', + isFullPath: true, responseCode: '={{$parameter["responseCode"]}}', responseMode: '={{$parameter["responseMode"]}}', responseData: '={{$parameter["responseData"]}}', diff --git a/packages/workflow/src/Interfaces.ts b/packages/workflow/src/Interfaces.ts index b5f143e3f6..32f272f25c 100644 --- a/packages/workflow/src/Interfaces.ts +++ b/packages/workflow/src/Interfaces.ts @@ -520,8 +520,9 @@ export interface IWebhookData { } export interface IWebhookDescription { - [key: string]: WebhookHttpMethod | WebhookResponseMode | string | undefined; + [key: string]: WebhookHttpMethod | WebhookResponseMode | boolean | string | undefined; httpMethod: WebhookHttpMethod | string; + isFullPath?: boolean; name: string; path: string; responseBinaryPropertyName?: string; diff --git a/packages/workflow/src/NodeHelpers.ts b/packages/workflow/src/NodeHelpers.ts index 87e219699d..610aefda56 100644 --- a/packages/workflow/src/NodeHelpers.ts +++ b/packages/workflow/src/NodeHelpers.ts @@ -755,7 +755,7 @@ export function getNodeWebhooks(workflow: Workflow, node: INode, additionalData: const returnData: IWebhookData[] = []; for (const webhookDescription of nodeType.description.webhooks) { - let nodeWebhookPath = workflow.getSimpleParameterValue(node, webhookDescription['path'], 'GET'); + let nodeWebhookPath = workflow.getSimpleParameterValue(node, webhookDescription['path']); if (nodeWebhookPath === undefined) { // TODO: Use a proper logger console.error(`No webhook path could be found for node "${node.name}" in workflow "${workflowId}".`); @@ -768,7 +768,8 @@ export function getNodeWebhooks(workflow: Workflow, node: INode, additionalData: nodeWebhookPath = nodeWebhookPath.slice(1); } - const path = getNodeWebhookPath(workflowId, node, nodeWebhookPath); + const isFullPath: boolean = workflow.getSimpleParameterValue(node, webhookDescription['isFullPath'], false) as boolean; + const path = getNodeWebhookPath(workflowId, node, nodeWebhookPath, isFullPath); const httpMethod = workflow.getSimpleParameterValue(node, webhookDescription['httpMethod'], 'GET'); @@ -808,7 +809,7 @@ export function getNodeWebhooksBasic(workflow: Workflow, node: INode): IWebhookD const returnData: IWebhookData[] = []; for (const webhookDescription of nodeType.description.webhooks) { - let nodeWebhookPath = workflow.getSimpleParameterValue(node, webhookDescription['path'], 'GET'); + let nodeWebhookPath = workflow.getSimpleParameterValue(node, webhookDescription['path']); if (nodeWebhookPath === undefined) { // TODO: Use a proper logger console.error(`No webhook path could be found for node "${node.name}" in workflow "${workflowId}".`); @@ -821,9 +822,11 @@ export function getNodeWebhooksBasic(workflow: Workflow, node: INode): IWebhookD nodeWebhookPath = nodeWebhookPath.slice(1); } - const path = getNodeWebhookPath(workflowId, node, nodeWebhookPath); + const isFullPath: boolean = workflow.getSimpleParameterValue(node, webhookDescription['isFullPath'], false) as boolean; - const httpMethod = workflow.getSimpleParameterValue(node, webhookDescription['httpMethod'], 'GET'); + const path = getNodeWebhookPath(workflowId, node, nodeWebhookPath, isFullPath); + + const httpMethod = workflow.getSimpleParameterValue(node, webhookDescription['httpMethod']); if (httpMethod === undefined) { // TODO: Use a proper logger @@ -854,12 +857,12 @@ export function getNodeWebhooksBasic(workflow: Workflow, node: INode): IWebhookD * @param {string} path * @returns {string} */ -export function getNodeWebhookPath(workflowId: string, node: INode, path: string): string { +export function getNodeWebhookPath(workflowId: string, node: INode, path: string, isFullPath?: boolean): string { let webhookPath = ''; if (node.webhookPath === undefined) { webhookPath = `${workflowId}/${encodeURIComponent(node.name.toLowerCase())}/${path}`; } else { - if (node.type === 'n8n-nodes-base.webhook') { + if (isFullPath === true) { return path; } webhookPath = `${node.webhookPath}/${path}`; @@ -876,11 +879,11 @@ export function getNodeWebhookPath(workflowId: string, node: INode, path: string * @param {string} workflowId * @param {string} nodeTypeName * @param {string} path + * @param {boolean} isFullPath * @returns {string} */ -export function getNodeWebhookUrl(baseUrl: string, workflowId: string, node: INode, path: string): string { - // return `${baseUrl}/${workflowId}/${nodeTypeName}/${path}`; - return `${baseUrl}/${getNodeWebhookPath(workflowId, node, path)}`; +export function getNodeWebhookUrl(baseUrl: string, workflowId: string, node: INode, path: string, isFullPath?: boolean): string { + return `${baseUrl}/${getNodeWebhookPath(workflowId, node, path, isFullPath)}`; } diff --git a/packages/workflow/src/Workflow.ts b/packages/workflow/src/Workflow.ts index 9a7d3ef1eb..8d09738598 100644 --- a/packages/workflow/src/Workflow.ts +++ b/packages/workflow/src/Workflow.ts @@ -715,7 +715,7 @@ export class Workflow { * @returns {(string | undefined)} * @memberof Workflow */ - getSimpleParameterValue(node: INode, parameterValue: string | undefined, defaultValue?: boolean | number | string): boolean | number | string | undefined { + getSimpleParameterValue(node: INode, parameterValue: string | boolean | undefined, defaultValue?: boolean | number | string): boolean | number | string | undefined { if (parameterValue === undefined) { // Value is not set so return the default return defaultValue; From 17ee152eaf0647d333e6f27e4243b287e15f6296 Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Wed, 10 Jun 2020 15:58:57 +0200 Subject: [PATCH 036/241] :zap: Fix indentation --- .../migrations/1589476000887-WebhookModel.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/cli/src/databases/postgresdb/migrations/1589476000887-WebhookModel.ts b/packages/cli/src/databases/postgresdb/migrations/1589476000887-WebhookModel.ts index a521d227d0..8ff5d583ca 100644 --- a/packages/cli/src/databases/postgresdb/migrations/1589476000887-WebhookModel.ts +++ b/packages/cli/src/databases/postgresdb/migrations/1589476000887-WebhookModel.ts @@ -7,7 +7,7 @@ import { IWorkflowDb, NodeTypes, WebhookHelpers, - } from '../../..'; +} from '../../..'; import { Workflow, @@ -15,21 +15,21 @@ import { import { IWebhookDb, - } from '../../../Interfaces'; +} from '../../../Interfaces'; - import * as config from '../../../../config'; +import * as config from '../../../../config'; export class WebhookModel1589476000887 implements MigrationInterface { name = 'WebhookModel1589476000887'; - async up(queryRunner: QueryRunner): Promise { + async up(queryRunner: QueryRunner): Promise { let tablePrefix = config.get('database.tablePrefix'); const schema = config.get('database.postgresdb.schema'); if (schema) { tablePrefix = schema + '.' + tablePrefix; } - await queryRunner.query(`CREATE TABLE ${tablePrefix}webhook_entity ("workflowId" integer NOT NULL, "webhookPath" character varying NOT NULL, "method" character varying NOT NULL, "node" character varying NOT NULL, CONSTRAINT "PK_b21ace2e13596ccd87dc9bf4ea6" PRIMARY KEY ("webhookPath", "method"))`, undefined); + await queryRunner.query(`CREATE TABLE ${tablePrefix}webhook_entity ("workflowId" integer NOT NULL, "webhookPath" character varying NOT NULL, "method" character varying NOT NULL, "node" character varying NOT NULL, CONSTRAINT "PK_b21ace2e13596ccd87dc9bf4ea6" PRIMARY KEY ("webhookPath", "method"))`, undefined); const workflows = await queryRunner.query(`SELECT * FROM ${tablePrefix}workflow_entity WHERE active=true`) as IWorkflowDb[]; const data: IWebhookDb[] = []; @@ -61,13 +61,13 @@ export class WebhookModel1589476000887 implements MigrationInterface { } } - async down(queryRunner: QueryRunner): Promise { + async down(queryRunner: QueryRunner): Promise { let tablePrefix = config.get('database.tablePrefix'); const schema = config.get('database.postgresdb.schema'); if (schema) { tablePrefix = schema + '.' + tablePrefix; } - await queryRunner.query(`DROP TABLE ${tablePrefix}webhook_entity`, undefined); - } + await queryRunner.query(`DROP TABLE ${tablePrefix}webhook_entity`, undefined); + } } From cee5c522de495d1977a548a9dd1d88c60fcc944c Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Wed, 10 Jun 2020 16:17:16 +0200 Subject: [PATCH 037/241] :zap: Rename webhookPath parameter on node to webhookId --- packages/editor-ui/src/views/NodeView.vue | 4 ++-- packages/workflow/src/Interfaces.ts | 2 +- packages/workflow/src/NodeHelpers.ts | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/editor-ui/src/views/NodeView.vue b/packages/editor-ui/src/views/NodeView.vue index 65ff1b5267..e22b98f595 100644 --- a/packages/editor-ui/src/views/NodeView.vue +++ b/packages/editor-ui/src/views/NodeView.vue @@ -949,7 +949,7 @@ export default mixins( newNodeData.name = this.getUniqueNodeName(newNodeData.name); if (nodeTypeData.webhooks && nodeTypeData.webhooks.length) { - newNodeData.webhookPath = uuidv4(); + newNodeData.webhookId = uuidv4(); } await this.addNodes([newNodeData]); @@ -1588,7 +1588,7 @@ export default mixins( // if it's a webhook and the path is empty set the UUID as the default path if (node.type === 'n8n-nodes-base.webhook' && node.parameters.path === '') { - node.parameters.path = node.webhookPath as string; + node.parameters.path = node.webhookId as string; } } diff --git a/packages/workflow/src/Interfaces.ts b/packages/workflow/src/Interfaces.ts index 32f272f25c..393f9e28af 100644 --- a/packages/workflow/src/Interfaces.ts +++ b/packages/workflow/src/Interfaces.ts @@ -297,7 +297,7 @@ export interface INode { continueOnFail?: boolean; parameters: INodeParameters; credentials?: INodeCredentials; - webhookPath?: string; + webhookId?: string; } diff --git a/packages/workflow/src/NodeHelpers.ts b/packages/workflow/src/NodeHelpers.ts index 610aefda56..cede36f5b5 100644 --- a/packages/workflow/src/NodeHelpers.ts +++ b/packages/workflow/src/NodeHelpers.ts @@ -859,13 +859,13 @@ export function getNodeWebhooksBasic(workflow: Workflow, node: INode): IWebhookD */ export function getNodeWebhookPath(workflowId: string, node: INode, path: string, isFullPath?: boolean): string { let webhookPath = ''; - if (node.webhookPath === undefined) { + if (node.webhookId === undefined) { webhookPath = `${workflowId}/${encodeURIComponent(node.name.toLowerCase())}/${path}`; } else { if (isFullPath === true) { return path; } - webhookPath = `${node.webhookPath}/${path}`; + webhookPath = `${node.webhookId}/${path}`; } return webhookPath; } From ca32d21f869379ffa784960c185f7dd3e47143c8 Mon Sep 17 00:00:00 2001 From: ricardo Date: Wed, 10 Jun 2020 17:37:01 -0400 Subject: [PATCH 038/241] :zap: Mautic extended --- .../MauticOAuth2Api.credentials.ts | 55 ++ .../nodes/Mautic/ContactDescription.ts | 562 +++++++++++++++++- .../nodes/Mautic/GenericFunctions.ts | 40 +- .../nodes-base/nodes/Mautic/Mautic.node.ts | 184 +++++- packages/nodes-base/package.json | 1 + 5 files changed, 809 insertions(+), 33 deletions(-) create mode 100644 packages/nodes-base/credentials/MauticOAuth2Api.credentials.ts diff --git a/packages/nodes-base/credentials/MauticOAuth2Api.credentials.ts b/packages/nodes-base/credentials/MauticOAuth2Api.credentials.ts new file mode 100644 index 0000000000..8c52f9372c --- /dev/null +++ b/packages/nodes-base/credentials/MauticOAuth2Api.credentials.ts @@ -0,0 +1,55 @@ +import { + ICredentialType, + NodePropertyTypes, +} from 'n8n-workflow'; + +export class MauticOAuth2Api implements ICredentialType { + name = 'mauticOAuth2Api'; + extends = [ + 'oAuth2Api', + ]; + displayName = 'Mautic OAuth2 API'; + properties = [ + { + displayName: 'URL', + name: 'url', + type: 'string' as NodePropertyTypes, + default: '', + placeholder: 'https://name.mautic.net', + }, + { + displayName: 'Authorization URL', + name: 'authUrl', + type: 'string' as NodePropertyTypes, + default: '', + placeholder: 'https://name.mautic.net/oauth/v2/authorize', + required: true, + }, + { + displayName: 'Access Token URL', + name: 'accessTokenUrl', + type: 'string' as NodePropertyTypes, + default: '', + placeholder: 'https://name.mautic.net/oauth/v2/token', + required: true, + }, + { + displayName: 'Scope', + name: 'scope', + type: 'hidden' as NodePropertyTypes, + default: '', + }, + { + displayName: 'Auth URI Query Parameters', + name: 'authQueryParameters', + type: 'hidden' as NodePropertyTypes, + default: '', + }, + { + displayName: 'Authentication', + name: 'authentication', + type: 'hidden' as NodePropertyTypes, + default: 'header', + }, + ]; +} diff --git a/packages/nodes-base/nodes/Mautic/ContactDescription.ts b/packages/nodes-base/nodes/Mautic/ContactDescription.ts index b9eb9b0f42..1ea81acbc8 100644 --- a/packages/nodes-base/nodes/Mautic/ContactDescription.ts +++ b/packages/nodes-base/nodes/Mautic/ContactDescription.ts @@ -226,6 +226,94 @@ export const contactFields = [ }, }, options: [ + { + displayName: 'Address', + name: 'addressUi', + placeholder: 'Address', + type: 'fixedCollection', + typeOptions: { + multipleValues: false, + }, + default: {}, + options: [ + { + name: 'addressValues', + displayName: 'Address', + values: [ + { + displayName: 'Address Line 1', + name: 'address1', + type: 'string', + default: '', + }, + { + displayName: 'Address Line 2', + name: 'address2', + type: 'string', + default: '', + }, + { + displayName: 'City', + name: 'city', + type: 'string', + default: '', + }, + { + displayName: 'State', + name: 'state', + type: 'string', + default: '', + }, + { + displayName: 'Country', + name: 'country', + type: 'string', + default: '', + }, + { + displayName: 'Zip Code', + name: 'zipCode', + type: 'string', + default: '', + }, + ], + }, + ], + }, + { + displayName: 'B2B or B2C', + name: 'b2bOrb2c', + type: 'options', + options: [ + { + name: 'B2B', + value: 'B2B', + }, + { + name: 'B2C', + value: 'B2C', + }, + ], + default: '', + }, + { + displayName: 'CRM ID', + name: 'crmId', + type: 'string', + default: '', + }, + { + displayName: 'Fax', + name: 'fax', + type: 'string', + default: '', + }, + { + displayName: 'Has Purchased', + name: 'hasPurchased', + type: 'boolean', + default: false, + }, { displayName: 'IP Address', name: 'ipAddress', @@ -240,6 +328,12 @@ export const contactFields = [ default: '', description: 'Date/time in UTC;', }, + { + displayName: 'Mobile', + name: 'mobile', + type: 'string', + default: '', + }, { displayName: 'Owner ID', name: 'ownerId', @@ -247,6 +341,112 @@ export const contactFields = [ default: '', description: 'ID of a Mautic user to assign this contact to', }, + { + displayName: 'Phone', + name: 'phone', + type: 'string', + default: '', + }, + { + displayName: 'Prospect or Customer', + name: 'prospectOrCustomer', + type: 'options', + options: [ + { + name: 'Prospect', + value: 'Prospect', + }, + { + name: 'Customer', + value: 'Customer', + }, + ], + default: '', + }, + { + displayName: 'Sandbox', + name: 'sandbox', + type: 'boolean', + default: false, + }, + { + displayName: 'Stage', + name: 'stage', + type: 'options', + typeOptions: { + loadOptionsMethod: 'getStages', + }, + default: '', + }, + { + displayName: 'Tags', + name: 'tags', + type: 'multiOptions', + typeOptions: { + loadOptionsMethod: 'getTags', + }, + default: '', + }, + { + displayName: 'Social Media', + name: 'socialMediaUi', + placeholder: 'Social Media', + type: 'fixedCollection', + typeOptions: { + multipleValues: false, + }, + default: {}, + options: [ + { + name: 'socialMediaValues', + displayName: 'Social Media', + values: [ + { + displayName: 'Facebook', + name: 'facebook', + type: 'string', + default: '', + }, + { + displayName: 'Foursquare', + name: 'foursquare', + type: 'string', + default: '', + }, + { + displayName: 'Instagram', + name: 'instagram', + type: 'string', + default: '', + }, + { + displayName: 'LinkedIn', + name: 'linkedIn', + type: 'string', + default: '', + }, + { + displayName: 'Skype', + name: 'skype', + type: 'string', + default: '', + }, + { + displayName: 'Twitter', + name: 'twitter', + type: 'string', + default: '', + }, + ], + }, + ], + }, + { + displayName: 'Website', + name: 'website', + type: 'string', + default: '', + }, ], }, @@ -318,6 +518,103 @@ export const contactFields = [ default: '', description: 'Contact parameters', }, + { + displayName: 'Address', + name: 'addressUi', + placeholder: 'Address', + type: 'fixedCollection', + typeOptions: { + multipleValues: false, + }, + displayOptions: { + show: { + '/jsonParameters': [ + false, + ], + }, + }, + default: {}, + options: [ + { + name: 'addressValues', + displayName: 'Address', + values: [ + { + displayName: 'Address Line 1', + name: 'address1', + type: 'string', + default: '', + }, + { + displayName: 'Address Line 2', + name: 'address2', + type: 'string', + default: '', + }, + { + displayName: 'City', + name: 'city', + type: 'string', + default: '', + }, + { + displayName: 'State', + name: 'state', + type: 'string', + default: '', + }, + { + displayName: 'Country', + name: 'country', + type: 'string', + default: '', + }, + { + displayName: 'Zip Code', + name: 'zipCode', + type: 'string', + default: '', + }, + ], + }, + ], + }, + { + displayName: 'B2B or B2C', + name: 'b2bOrb2c', + type: 'options', + displayOptions: { + show: { + '/jsonParameters': [ + false, + ], + }, + }, + options: [ + { + name: 'B2B', + value: 'B2B', + }, + { + name: 'B2C', + value: 'B2C', + }, + ], + default: '', + }, + { + displayName: 'CRM ID', + name: 'crmId', + type: 'string', + displayOptions: { + show: { + '/jsonParameters': [ + false, + ], + }, + }, + default: '', + }, { displayName: 'Email', name: 'email', @@ -332,6 +629,19 @@ export const contactFields = [ default: '', description: 'Email address of the contact.', }, + { + displayName: 'Fax', + name: 'fax', + type: 'string', + displayOptions: { + show: { + '/jsonParameters': [ + false, + ], + }, + }, + default: '', + }, { displayName: 'First Name', name: 'firstName', @@ -346,6 +656,47 @@ export const contactFields = [ default: '', description: 'First Name', }, + { + displayName: 'Has Purchased', + name: 'hasPurchased', + type: 'boolean', + displayOptions: { + show: { + '/jsonParameters': [ + false, + ], + }, + }, + default: false, + }, + { + displayName: 'IP Address', + name: 'ipAddress', + type: 'string', + displayOptions: { + show: { + '/jsonParameters': [ + false, + ], + }, + }, + default: '', + description: 'IP address to associate with the contact', + }, + { + displayName: 'Last Active', + name: 'lastActive', + type: 'dateTime', + displayOptions: { + show: { + '/jsonParameters': [ + false, + ], + }, + }, + default: '', + description: 'Date/time in UTC;', + }, { displayName: 'Last Name', name: 'lastName', @@ -360,6 +711,60 @@ export const contactFields = [ default: '', description: 'LastName', }, + { + displayName: 'Mobile', + name: 'mobile', + type: 'string', + displayOptions: { + show: { + '/jsonParameters': [ + false, + ], + }, + }, + default: '', + }, + { + displayName: 'Owner ID', + name: 'ownerId', + type: 'string', + displayOptions: { + show: { + '/jsonParameters': [ + false, + ], + }, + }, + default: '', + description: 'ID of a Mautic user to assign this contact to', + }, + { + displayName: 'Phone', + name: 'phone', + type: 'string', + displayOptions: { + show: { + '/jsonParameters': [ + false, + ], + }, + }, + default: '', + }, + { + displayName: 'Position', + name: 'position', + type: 'string', + displayOptions: { + show: { + '/jsonParameters': [ + false, + ], + }, + }, + default: '', + description: 'Position', + }, { displayName: 'Primary Company', name: 'company', @@ -378,9 +783,9 @@ export const contactFields = [ description: 'Primary company', }, { - displayName: 'Position', - name: 'position', - type: 'string', + displayName: 'Prospect or Customer', + name: 'prospectOrCustomer', + type: 'options', displayOptions: { show: { '/jsonParameters': [ @@ -388,8 +793,62 @@ export const contactFields = [ ], }, }, + options: [ + { + name: 'Prospect', + value: 'Prospect', + }, + { + name: 'Customer', + value: 'Customer', + }, + ], + default: '', + }, + { + displayName: 'Sandbox', + name: 'sandbox', + type: 'boolean', + displayOptions: { + show: { + '/jsonParameters': [ + false, + ], + }, + }, + default: false, + }, + { + displayName: 'Stage', + name: 'stage', + type: 'options', + displayOptions: { + show: { + '/jsonParameters': [ + false, + ], + }, + }, + typeOptions: { + loadOptionsMethod: 'getStages', + }, + default: '', + }, + { + displayName: 'Tags', + name: 'tags', + type: 'multiOptions', + displayOptions: { + show: { + '/jsonParameters': [ + false, + ], + }, + }, + typeOptions: { + loadOptionsMethod: 'getTags', + }, default: '', - description: 'Position', }, { displayName: 'Title', @@ -405,27 +864,94 @@ export const contactFields = [ default: '', description: 'Title', }, + { + displayName: 'Social Media', + name: 'socialMediaUi', + placeholder: 'Social Media', + type: 'fixedCollection', + displayOptions: { + show: { + '/jsonParameters': [ + false, + ], + }, + }, + typeOptions: { + multipleValues: false, + }, + default: {}, + options: [ + { + name: 'socialMediaValues', + displayName: 'Social Media', + values: [ + { + displayName: 'Facebook', + name: 'facebook', + type: 'string', + default: '', + }, + { + displayName: 'Foursquare', + name: 'foursquare', + type: 'string', + default: '', + }, + { + displayName: 'Instagram', + name: 'instagram', + type: 'string', + default: '', + }, + { + displayName: 'LinkedIn', + name: 'linkedIn', + type: 'string', + default: '', + }, + { + displayName: 'Skype', + name: 'skype', + type: 'string', + default: '', + }, + { + displayName: 'Twitter', + name: 'twitter', + type: 'string', + default: '', + }, + ], + }, + ], + }, + { + displayName: 'Website', + name: 'website', + type: 'string', + displayOptions: { + show: { + '/jsonParameters': [ + false, + ], + }, + }, + default: '', + }, { displayName: 'IP Address', name: 'ipAddress', type: 'string', + displayOptions: { + show: { + '/jsonParameters': [ + false, + ], + }, + }, default: '', description: 'IP address to associate with the contact', }, - { - displayName: 'Last Active', - name: 'lastActive', - type: 'dateTime', - default: '', - description: 'Date/time in UTC;', - }, - { - displayName: 'Owner ID', - name: 'ownerId', - type: 'string', - default: '', - description: 'ID of a Mautic user to assign this contact to', - }, ], }, diff --git a/packages/nodes-base/nodes/Mautic/GenericFunctions.ts b/packages/nodes-base/nodes/Mautic/GenericFunctions.ts index 6b179db7fd..9861690254 100644 --- a/packages/nodes-base/nodes/Mautic/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Mautic/GenericFunctions.ts @@ -10,7 +10,6 @@ import { import { IDataObject, } from 'n8n-workflow'; -import { errors } from 'imap-simple'; interface OMauticErrorResponse { errors: Array<{ @@ -19,7 +18,7 @@ interface OMauticErrorResponse { }>; } -function getErrors(error: OMauticErrorResponse): string { +export function getErrors(error: OMauticErrorResponse): string { const returnErrors: string[] = []; for (const errorItem of error.errors) { @@ -31,23 +30,40 @@ function getErrors(error: OMauticErrorResponse): string { export async function mauticApiRequest(this: IHookFunctions | IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions, method: string, endpoint: string, body: any = {}, query?: IDataObject, uri?: string): Promise { // tslint:disable-line:no-any - const credentials = this.getCredentials('mauticApi'); - if (credentials === undefined) { - throw new Error('No credentials got returned!'); - } - const base64Key = Buffer.from(`${credentials.username}:${credentials.password}`).toString('base64'); + const authenticationMethod = this.getNodeParameter('authentication', 0, 'credentials') as string; + const options: OptionsWithUri = { - headers: { Authorization: `Basic ${base64Key}` }, + headers: {}, method, qs: query, - uri: uri || `${credentials.url}/api${endpoint}`, + uri: uri || `/api${endpoint}`, body, json: true }; - try { - const returnData = await this.helpers.request!(options); - if (returnData.error) { + try { + + let returnData; + + if (authenticationMethod === 'credentials') { + const credentials = this.getCredentials('mauticApi') as IDataObject; + + const base64Key = Buffer.from(`${credentials.username}:${credentials.password}`).toString('base64'); + + options.headers!.Authorization = `Basic ${base64Key}`; + + options.uri = `${credentials.url}${options.uri}`; + //@ts-ignore + returnData = await this.helpers.request(options); + } else { + const credentials = this.getCredentials('mauticOAuth2Api') as IDataObject; + + options.uri = `${credentials.url}${options.uri}`; + //@ts-ignore + returnData = await this.helpers.requestOAuth2.call(this, 'mauticOAuth2Api', options); + } + + if (returnData.errors) { // They seem to to sometimes return 200 status but still error. throw new Error(getErrors(returnData)); } diff --git a/packages/nodes-base/nodes/Mautic/Mautic.node.ts b/packages/nodes-base/nodes/Mautic/Mautic.node.ts index 50abcda83e..7bdafe7605 100644 --- a/packages/nodes-base/nodes/Mautic/Mautic.node.ts +++ b/packages/nodes-base/nodes/Mautic/Mautic.node.ts @@ -1,5 +1,3 @@ -import { snakeCase } from 'change-case'; - import { IExecuteFunctions, } from 'n8n-core'; @@ -15,12 +13,18 @@ import { mauticApiRequest, mauticApiRequestAllItems, validateJSON, + getErrors, } from './GenericFunctions'; + import { contactFields, contactOperations, } from './ContactDescription'; +import { + snakeCase, + } from 'change-case'; + export class Mautic implements INodeType { description: INodeTypeDescription = { displayName: 'Mautic', @@ -40,9 +44,43 @@ export class Mautic implements INodeType { { name: 'mauticApi', required: true, - } + displayOptions: { + show: { + authentication: [ + 'credentials', + ], + }, + }, + }, + { + name: 'mauticOAuth2Api', + required: true, + displayOptions: { + show: { + authentication: [ + 'oAuth2', + ], + }, + }, + }, ], properties: [ + { + displayName: 'Authentication', + name: 'authentication', + type: 'options', + options: [ + { + name: 'Credentials', + value: 'credentials', + }, + { + name: 'OAuth2', + value: 'oAuth2', + }, + ], + default: 'credentials', + }, { displayName: 'Resource', name: 'resource', @@ -77,6 +115,32 @@ export class Mautic implements INodeType { } return returnData; }, + // Get all the available tags to display them to user so that he can + // select them easily + async getTags(this: ILoadOptionsFunctions): Promise { + const returnData: INodePropertyOptions[] = []; + const tags = await mauticApiRequestAllItems.call(this, 'tags', 'GET', '/tags'); + for (const tag of tags) { + returnData.push({ + name: tag.tag, + value: tag.tag, + }); + } + return returnData; + }, + // Get all the available stages to display them to user so that he can + // select them easily + async getStages(this: ILoadOptionsFunctions): Promise { + const returnData: INodePropertyOptions[] = []; + const stages = await mauticApiRequestAllItems.call(this, 'stages', 'GET', '/stages'); + for (const stage of stages) { + returnData.push({ + name: stage.name, + value: stage.id, + }); + } + return returnData; + }, }, }; @@ -124,6 +188,62 @@ export class Mautic implements INodeType { if (additionalFields.ownerId) { body.ownerId = additionalFields.ownerId as string; } + if (additionalFields.addressUi) { + const addressValues = (additionalFields.addressUi as IDataObject).addressValues as IDataObject; + if (addressValues) { + body.address1 = addressValues.address1 as string; + body.address2 = addressValues.address2 as string; + body.city = addressValues.city as string; + body.state = addressValues.state as string; + body.country = addressValues.country as string; + body.zipcode = addressValues.zipCode as string; + } + } + if (additionalFields.socialMediaUi) { + const socialMediaValues = (additionalFields.socialMediaUi as IDataObject).socialMediaValues as IDataObject; + if (socialMediaValues) { + body.facebook = socialMediaValues.facebook as string; + body.foursquare = socialMediaValues.foursquare as string; + body.instagram = socialMediaValues.instagram as string; + body.linkedin = socialMediaValues.linkedIn as string; + body.skype = socialMediaValues.skype as string; + body.twitter = socialMediaValues.twitter as string; + } + } + if (additionalFields.b2bOrb2c) { + body.b2b_or_b2c = additionalFields.b2bOrb2c as string; + } + if (additionalFields.crmId) { + body.crm_id = additionalFields.crmId as string; + } + if (additionalFields.fax) { + body.fax = additionalFields.fax as string; + } + if (additionalFields.hasPurchased) { + body.haspurchased = additionalFields.hasPurchased as boolean; + } + if (additionalFields.mobile) { + body.mobile = additionalFields.mobile as string; + } + if (additionalFields.phone) { + body.phone = additionalFields.phone as string; + } + if (additionalFields.prospectOrCustomer) { + body.prospect_or_customer = additionalFields.prospectOrCustomer as string; + } + if (additionalFields.sandbox) { + body.sandbox = additionalFields.sandbox as boolean; + } + if (additionalFields.stage) { + body.stage = additionalFields.stage as string; + } + if (additionalFields.tags) { + body.tags = additionalFields.tags as string; + } + if (additionalFields.website) { + body.website = additionalFields.website as string; + } + responseData = await mauticApiRequest.call(this, 'POST', '/contacts/new', body); responseData = responseData.contact; } @@ -167,6 +287,61 @@ export class Mautic implements INodeType { if (updateFields.ownerId) { body.ownerId = updateFields.ownerId as string; } + if (updateFields.addressUi) { + const addressValues = (updateFields.addressUi as IDataObject).addressValues as IDataObject; + if (addressValues) { + body.address1 = addressValues.address1 as string; + body.address2 = addressValues.address2 as string; + body.city = addressValues.city as string; + body.state = addressValues.state as string; + body.country = addressValues.country as string; + body.zipcode = addressValues.zipCode as string; + } + } + if (updateFields.socialMediaUi) { + const socialMediaValues = (updateFields.socialMediaUi as IDataObject).socialMediaValues as IDataObject; + if (socialMediaValues) { + body.facebook = socialMediaValues.facebook as string; + body.foursquare = socialMediaValues.foursquare as string; + body.instagram = socialMediaValues.instagram as string; + body.linkedin = socialMediaValues.linkedIn as string; + body.skype = socialMediaValues.skype as string; + body.twitter = socialMediaValues.twitter as string; + } + } + if (updateFields.b2bOrb2c) { + body.b2b_or_b2c = updateFields.b2bOrb2c as string; + } + if (updateFields.crmId) { + body.crm_id = updateFields.crmId as string; + } + if (updateFields.fax) { + body.fax = updateFields.fax as string; + } + if (updateFields.hasPurchased) { + body.haspurchased = updateFields.hasPurchased as boolean; + } + if (updateFields.mobile) { + body.mobile = updateFields.mobile as string; + } + if (updateFields.phone) { + body.phone = updateFields.phone as string; + } + if (updateFields.prospectOrCustomer) { + body.prospect_or_customer = updateFields.prospectOrCustomer as string; + } + if (updateFields.sandbox) { + body.sandbox = updateFields.sandbox as boolean; + } + if (updateFields.stage) { + body.stage = updateFields.stage as string; + } + if (updateFields.tags) { + body.tags = updateFields.tags as string; + } + if (updateFields.website) { + body.website = updateFields.website as string; + } responseData = await mauticApiRequest.call(this, 'PATCH', `/contacts/${contactId}/edit`, body); responseData = responseData.contact; } @@ -193,6 +368,9 @@ export class Mautic implements INodeType { qs.limit = this.getNodeParameter('limit', i) as number; qs.start = 0; responseData = await mauticApiRequest.call(this, 'GET', '/contacts', {}, qs); + if (responseData.errors) { + throw new Error(getErrors(responseData)); + } responseData = responseData.contacts; responseData = Object.values(responseData); } diff --git a/packages/nodes-base/package.json b/packages/nodes-base/package.json index 2a6df1e4e3..63e51f078a 100644 --- a/packages/nodes-base/package.json +++ b/packages/nodes-base/package.json @@ -85,6 +85,7 @@ "dist/credentials/MandrillApi.credentials.js", "dist/credentials/MattermostApi.credentials.js", "dist/credentials/MauticApi.credentials.js", + "dist/credentials/MauticOAuth2Api.credentials.js", "dist/credentials/MicrosoftExcelOAuth2Api.credentials.js", "dist/credentials/MicrosoftOAuth2Api.credentials.js", "dist/credentials/MicrosoftOneDriveOAuth2Api.credentials.js", From 677ffec6f9b817097ce7ed875b5dddf4da14a3ac Mon Sep 17 00:00:00 2001 From: shraddha shaligram Date: Thu, 11 Jun 2020 15:57:32 -0700 Subject: [PATCH 039/241] add messagebird API improve code readability fixed a minor error --- .../credentials/MessageBirdApi.credentials.ts | 14 + .../nodes/MessageBird/GenericFunctions.ts | 68 ++ .../nodes/MessageBird/MessageBird.node.ts | 354 +++++++++ .../nodes/MessageBird/messagebird.png | Bin 0 -> 1305 bytes packages/nodes-base/package.json | 720 +++++++++--------- 5 files changed, 797 insertions(+), 359 deletions(-) create mode 100644 packages/nodes-base/credentials/MessageBirdApi.credentials.ts create mode 100644 packages/nodes-base/nodes/MessageBird/GenericFunctions.ts create mode 100644 packages/nodes-base/nodes/MessageBird/MessageBird.node.ts create mode 100644 packages/nodes-base/nodes/MessageBird/messagebird.png diff --git a/packages/nodes-base/credentials/MessageBirdApi.credentials.ts b/packages/nodes-base/credentials/MessageBirdApi.credentials.ts new file mode 100644 index 0000000000..e67c6a0c9e --- /dev/null +++ b/packages/nodes-base/credentials/MessageBirdApi.credentials.ts @@ -0,0 +1,14 @@ +import { ICredentialType, NodePropertyTypes } from 'n8n-workflow'; + +export class MessageBirdApi implements ICredentialType { + name = 'messageBirdApi'; + displayName = 'MessageBird API'; + properties = [ + { + displayName: 'API Key', + name: 'accessKey', + type: 'string' as NodePropertyTypes, + default: '' + } + ]; +} diff --git a/packages/nodes-base/nodes/MessageBird/GenericFunctions.ts b/packages/nodes-base/nodes/MessageBird/GenericFunctions.ts new file mode 100644 index 0000000000..ff1df3b265 --- /dev/null +++ b/packages/nodes-base/nodes/MessageBird/GenericFunctions.ts @@ -0,0 +1,68 @@ +import { IExecuteFunctions, IHookFunctions } from 'n8n-core'; +import { OptionsWithUri } from 'request'; + +import { IDataObject } from 'n8n-workflow'; + +/** + * Make an API request to Message Bird + * + * @param {IHookFunctions} this + * @param {string} method + * @param {string} url + * @param {object} body + * @returns {Promise} + */ +export async function messageBirdApiRequest( + this: IHookFunctions | IExecuteFunctions, + method: string, + resource: string, + body: IDataObject, + query?: IDataObject +): Promise { + const credentials = this.getCredentials('messageBirdApi'); + if (credentials === undefined) { + throw new Error('No credentials returned!'); + } + + if (query === undefined) { + query = {}; + } + let token; + token = token = `AccessKey ${credentials.accessKey}`; + + const options: OptionsWithUri = { + headers: { + Accept: 'application/json', + Authorization: token + }, + method, + qs: query, + body, + uri: `https://rest.messagebird.com${resource}`, + json: true + }; + + try { + return await this.helpers.request(options); + } catch (error) { + if (error.statusCode === 401) { + throw new Error('The Message Bird credentials are not valid!'); + } + + if (error.response && error.response.body && error.response.body.errors) { + // Try to return the error prettier + let errorMessage; + for (let i = 0; i < error.response.body.errors.length; i++) { + errorMessage = + errorMessage + + `Message Bird Error response [${error.statusCode}]: ${error.response.body.errors[i].description}`; + } + throw new Error(errorMessage); + } + + // If that data does not exist for some reason return the actual error + throw new Error( + `Message Bird error ${error.response.body.errors[0].description}` + ); + } +} diff --git a/packages/nodes-base/nodes/MessageBird/MessageBird.node.ts b/packages/nodes-base/nodes/MessageBird/MessageBird.node.ts new file mode 100644 index 0000000000..cb0960f1e0 --- /dev/null +++ b/packages/nodes-base/nodes/MessageBird/MessageBird.node.ts @@ -0,0 +1,354 @@ +import { IExecuteFunctions } from 'n8n-core'; +import { + IDataObject, + INodeTypeDescription, + INodeExecutionData, + INodeType +} from 'n8n-workflow'; + +import { messageBirdApiRequest } from './GenericFunctions'; + +export class MessageBird implements INodeType { + description: INodeTypeDescription = { + displayName: 'MessageBird', + name: 'messageBird', + icon: 'file:messagebird.png', + group: ['transform'], + version: 1, + subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}', + description: 'Sending SMS', + defaults: { + name: 'MessageBird', + color: '#2481d7' + }, + inputs: ['main'], + outputs: ['main'], + credentials: [ + { + name: 'messageBirdApi', + required: true + } + ], + properties: [ + { + displayName: 'Resource', + name: 'resource', + type: 'options', + options: [ + { + name: 'SMS', + value: 'sms' + } + ], + default: 'sms', + description: 'The resource to operate on.' + }, + + { + displayName: 'Operation', + name: 'operation', + type: 'options', + displayOptions: { + show: { + resource: ['sms'] + } + }, + options: [ + { + name: 'Send', + value: 'send', + description: 'Send text messages (SMS)' + } + ], + default: 'send', + description: 'The operation to perform.' + }, + + // ---------------------------------- + // sms:send + // ---------------------------------- + { + displayName: 'From', + name: 'originator', + type: 'string', + default: '', + placeholder: '14155238886', + required: true, + displayOptions: { + show: { + operation: ['send'], + resource: ['sms'] + } + }, + description: 'The number from which to send the message' + }, + { + displayName: 'To', + name: 'recipients', + type: 'string', + default: '', + placeholder: '14155238886/+14155238886', + required: true, + displayOptions: { + show: { + operation: ['send'], + resource: ['sms'] + } + }, + description: 'all recipients separated by commas' + }, + + { + displayName: 'Message', + name: 'message', + type: 'string', + default: '', + required: true, + displayOptions: { + show: { + operation: ['send'], + resource: ['sms'] + } + }, + description: 'The message to be send' + }, + { + displayName: 'Additional Fields', + name: 'additionalFields', + type: 'collection', + placeholder: 'Add Fields', + default: {}, + options: [ + //date-time format + { + displayName: 'Created Date-time', + name: 'createdDatetime', + type: 'dateTime', + placeholder: '2011-08-30T09:30:16.768-04:00', + default: '', + description: + 'The date and time of the creation of the message in RFC3339 format (Y-m-dTH:i:sP).' + }, + { + displayName: 'Datacoding', + name: 'datacoding', + type: 'string', + default: '', + description: + 'Using unicode will limit the maximum number of characters to 70 instead of 160' + }, + { + displayName: 'Gateway', + name: 'gateway', + type: 'number', + default: '', + description: 'The SMS route that is used to send the message.' + }, + { + displayName: 'Group Ids', + name: 'groupIds', + placeholder: '1,2', + type: 'string', + default: '', + description: + 'group ids separated by commas, If provided recipients can be omitted' + }, + { + displayName: 'Mclass', + name: 'mclass', + type: 'options', + placeholder: 'permissible values from 0-3', + options: [ + { + name: '0', + value: '0' + }, + { + name: '1', + value: '1' + }, + { + name: '2', + value: '2' + }, + { + name: '3', + value: '3' + } + ], + default: '', + description: + 'Indicated the message type. 1 is a normal message, 0 is a flash message.' + }, + { + displayName: 'Reference', + name: 'reference', + type: 'string', + default: '', + description: 'A client reference.' + }, + { + displayName: 'Report Url', + name: 'reportUrl', + type: 'string', + default: '', + description: + 'The status report URL to be used on a per-message basis.
Reference is required for a status report webhook to be sent.' + }, + //date-time format + { + displayName: 'Scheduled Date-time', + name: 'scheduledDatetime', + type: 'dateTime', + default: '', + placeholder: '2011-08-30T09:30:16.768-04:00', + description: + 'The scheduled date and time of the message in RFC3339 format (Y-m-dTH:i:sP).' + }, + { + displayName: 'Type', + name: 'type', + type: 'options', + options: [ + { + name: 'sms', + value: 'sms' + }, + { + name: 'binary', + value: 'binary' + }, + { + name: 'flash', + value: 'flash' + } + ], + default: '', + description: + 'The type of message.
Values can be: sms, binary, or flash.' + }, + //hash + { + displayName: 'Type Details', + name: 'typeDetails', + type: 'string', + default: '', + description: + 'A hash with extra information.
Is only used when a binary message is sent.' + }, + { + displayName: 'Validity', + name: 'validity', + type: 'number', + default: '', + typeOptions: { + minValue: 1 + }, + description: 'The amount of seconds that the message is valid.' + } + ] + } + ] + }; + + async execute(this: IExecuteFunctions): Promise { + const items = this.getInputData(); + const returnData: IDataObject[] = []; + + let operation: string; + let resource: string; + + // For POST + let bodyRequest: IDataObject; + // For Query string + let qs: IDataObject; + + let requestMethod; + + for (let i = 0; i < items.length; i++) { + qs = {}; + + resource = this.getNodeParameter('resource', i) as string; + operation = this.getNodeParameter('operation', i) as string; + + if (resource === 'sms') { + //https://developers.messagebird.com/api/sms-messaging/#sms-api + if (operation === 'send') { + // ---------------------------------- + // sms:send + // ---------------------------------- + + requestMethod = 'POST'; + const originator = this.getNodeParameter('originator', i) as string; + const body = this.getNodeParameter('message', i) as string; + + bodyRequest = { + recipients: [], + originator, + body + }; + const additionalFields = this.getNodeParameter( + 'additionalFields', + i + ) as IDataObject; + + if (additionalFields.groupIds) { + bodyRequest.groupIds = additionalFields.groupIds as string; + } + if (additionalFields.type) { + bodyRequest.type = additionalFields.type as string; + } + if (additionalFields.reference) { + bodyRequest.reference = additionalFields.reference as string; + } + if (additionalFields.reportUrl) { + bodyRequest.reportUrl = additionalFields.reportUrl as string; + } + if (additionalFields.validity) { + bodyRequest.validity = additionalFields.reportUrl as number; + } + if (additionalFields.gateway) { + bodyRequest.gateway = additionalFields.gateway as string; + } + if (additionalFields.typeDetails) { + bodyRequest.typeDetails = additionalFields.typeDetails as string; + } + if (additionalFields.datacoding) { + bodyRequest.datacoding = additionalFields.datacoding as string; + } + if (additionalFields.mclass) { + bodyRequest.mclass = additionalFields.mclass as number; + } + if (additionalFields.scheduledDatetime) { + bodyRequest.scheduledDatetime = additionalFields.scheduledDatetime as string; + } + if (additionalFields.createdDatetime) { + bodyRequest.createdDatetime = additionalFields.createdDatetime as string; + } + + const receivers = this.getNodeParameter('recipients', i) as string; + + bodyRequest.recipients = receivers.split(',').map(item => { + return parseInt(item, 10); + }); + } else { + throw new Error(`The operation "${operation}" is not known!`); + } + } else { + throw new Error(`The resource "${resource}" is not known!`); + } + + const responseData = await messageBirdApiRequest.call( + this, + requestMethod, + '/messages', + bodyRequest, + qs + ); + + returnData.push(responseData as IDataObject); + } + + return [this.helpers.returnJsonArray(returnData)]; + } +} diff --git a/packages/nodes-base/nodes/MessageBird/messagebird.png b/packages/nodes-base/nodes/MessageBird/messagebird.png new file mode 100644 index 0000000000000000000000000000000000000000..006b762950d6604ab0e58a3ebf90e984f04907f6 GIT binary patch literal 1305 zcmeAS@N?(olHy`uVBq!ia0vp^HXzKw1|+Ti+$;i8Ea{HEjtmSN`?>!lvI6-E$sR$z z3=CCj3=9n|3=F@3LJcn%7)lKo7+xg+bI6B3hk`{3u+q^6EQYb$Fqb0`Z}TW&b_ z-}^zkqPOjSoVabPclqS!dv2C(uD$;xw(Q>QzqM&~pR4cBRJYJmeeF@1E!)8ShQay( z-v%)C+MTap-D$>irE9Gdwtt&E^F~OQ4%<4-R^B*+t+V@d4m{vFV|PYphuMeSz6BZV zI!Dg3d@^9G{r=#y+z-Pktq1y_Hm^UBV~`uYa2pR_*`cd~Mn;z-!?$b;KXCBv%-8YN zZM*-o^>ZglY3epIiN9If%Im6qd;Thh?b;h-R8F#9dM1*|JbxG0@^vr%7oJwj;9Zg@ zJ=2?KNy{stibCNK(Zg#!e`vA<3vRg_D_!w_@`WeuGu)4ockQ1YS7^3>3%e1zH0^7I z`J9~Q>DwI^+cU0F+$*a1@Y#~e8}|}3{)^sWvdd_Tz543=^FJT1#;wq465jjaEyLxzEI2Nx`2e|Nhi>6UA@9h-Qwmce%K z$TJ~@9u6EC>zZ_zuKfM#C;PrVJa+st)sCVo-LHOB|I&Z6c`NIl71yLJZt=9fyRt88 zQP9q1B3fMG+s?Z_tk7>sd+_*qV*K4x)yEDMq$L!7xh52G;Cu6h2jMTH7A2Y{2T9Ig z_CI`^H>*G{^uFy5vpo50b_Q8(cE4TMzWhGxiuU2hoBq{!Hm*A0wB-A<=kE?MJMY%G zeSqPj#hiT$eGa~3*dr1!@5Xb_zQ9FYceZ_ck`?>P^Zxe;2|b=!9YLNFf9>Xc*sJ8f z_9avJr(J!EeEc!EdYbA>n4Lk*jUt-nsCK2}_KiCcQ_ zwcR%5$KNb$hpVD{F0v+cN64?YdVdmE zSm~eo!`Kkg_J1y0^#<<37d!Yie@;7W%&oI3OqSP5I||Jl(eT z+b+pn{PRl=S4cd59`&qYY1LJkJfHo_n-)#9toW}~(t74_)5=9#ZKisE*}c<{(S7#< zW9F4PA`u)F+3I_OR)7CfAz_v8_&fDS?UXk*9r2S|WThW|t$Nz_NUSDWXWctqztxw| zZ{EJ}{kmI4X}^lQ1+ybxwlZPW)%M51ZrULboFyt I=akR{0A)r^>i_@% literal 0 HcmV?d00001 diff --git a/packages/nodes-base/package.json b/packages/nodes-base/package.json index 822978eaf4..37b9adecf2 100644 --- a/packages/nodes-base/package.json +++ b/packages/nodes-base/package.json @@ -1,363 +1,365 @@ { - "name": "n8n-nodes-base", - "version": "0.64.1", - "description": "Base nodes of n8n", - "license": "SEE LICENSE IN LICENSE.md", - "homepage": "https://n8n.io", - "author": { - "name": "Jan Oberhauser", - "email": "jan@n8n.io" - }, - "repository": { - "type": "git", - "url": "git+https://github.com/n8n-io/n8n.git" - }, - "main": "dist/src/index", - "types": "dist/src/index.d.ts", - "scripts": { - "dev": "npm run watch", - "build": "tsc && gulp", - "tslint": "tslint -p tsconfig.json -c tslint.json", - "watch": "tsc --watch", - "test": "jest" - }, - "files": [ - "dist" + "name": "n8n-nodes-base", + "version": "0.64.1", + "description": "Base nodes of n8n", + "license": "SEE LICENSE IN LICENSE.md", + "homepage": "https://n8n.io", + "author": { + "name": "Jan Oberhauser", + "email": "jan@n8n.io" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/n8n-io/n8n.git" + }, + "main": "dist/src/index", + "types": "dist/src/index.d.ts", + "scripts": { + "dev": "npm run watch", + "build": "tsc && gulp", + "tslint": "tslint -p tsconfig.json -c tslint.json", + "watch": "tsc --watch", + "test": "jest" + }, + "files": [ + "dist" + ], + "n8n": { + "credentials": [ + "dist/credentials/ActiveCampaignApi.credentials.js", + "dist/credentials/AgileCrmApi.credentials.js", + "dist/credentials/AcuitySchedulingApi.credentials.js", + "dist/credentials/AirtableApi.credentials.js", + "dist/credentials/Amqp.credentials.js", + "dist/credentials/AsanaApi.credentials.js", + "dist/credentials/Aws.credentials.js", + "dist/credentials/AffinityApi.credentials.js", + "dist/credentials/BannerbearApi.credentials.js", + "dist/credentials/BitbucketApi.credentials.js", + "dist/credentials/BitlyApi.credentials.js", + "dist/credentials/ChargebeeApi.credentials.js", + "dist/credentials/ClearbitApi.credentials.js", + "dist/credentials/ClickUpApi.credentials.js", + "dist/credentials/ClockifyApi.credentials.js", + "dist/credentials/CockpitApi.credentials.js", + "dist/credentials/CodaApi.credentials.js", + "dist/credentials/CopperApi.credentials.js", + "dist/credentials/CalendlyApi.credentials.js", + "dist/credentials/DisqusApi.credentials.js", + "dist/credentials/DriftApi.credentials.js", + "dist/credentials/DropboxApi.credentials.js", + "dist/credentials/EventbriteApi.credentials.js", + "dist/credentials/FacebookGraphApi.credentials.js", + "dist/credentials/FreshdeskApi.credentials.js", + "dist/credentials/FileMaker.credentials.js", + "dist/credentials/FlowApi.credentials.js", + "dist/credentials/GithubApi.credentials.js", + "dist/credentials/GithubOAuth2Api.credentials.js", + "dist/credentials/GitlabApi.credentials.js", + "dist/credentials/GoogleApi.credentials.js", + "dist/credentials/GoogleCalendarOAuth2Api.credentials.js", + "dist/credentials/GoogleOAuth2Api.credentials.js", + "dist/credentials/GoogleSheetsOAuth2Api.credentials.js", + "dist/credentials/GumroadApi.credentials.js", + "dist/credentials/HarvestApi.credentials.js", + "dist/credentials/HelpScoutOAuth2Api.credentials.js", + "dist/credentials/HttpBasicAuth.credentials.js", + "dist/credentials/HttpDigestAuth.credentials.js", + "dist/credentials/HttpHeaderAuth.credentials.js", + "dist/credentials/HubspotApi.credentials.js", + "dist/credentials/HubspotDeveloperApi.credentials.js", + "dist/credentials/HunterApi.credentials.js", + "dist/credentials/Imap.credentials.js", + "dist/credentials/IntercomApi.credentials.js", + "dist/credentials/InvoiceNinjaApi.credentials.js", + "dist/credentials/JiraSoftwareCloudApi.credentials.js", + "dist/credentials/JiraSoftwareServerApi.credentials.js", + "dist/credentials/JotFormApi.credentials.js", + "dist/credentials/KeapOAuth2Api.credentials.js", + "dist/credentials/LinkFishApi.credentials.js", + "dist/credentials/MailchimpApi.credentials.js", + "dist/credentials/MailgunApi.credentials.js", + "dist/credentials/MailjetEmailApi.credentials.js", + "dist/credentials/MailjetSmsApi.credentials.js", + "dist/credentials/MandrillApi.credentials.js", + "dist/credentials/MattermostApi.credentials.js", + "dist/credentials/MauticApi.credentials.js", + "dist/credentials/MessageBirdApi.credentials.js", + "dist/credentials/MicrosoftExcelOAuth2Api.credentials.js", + "dist/credentials/MicrosoftOAuth2Api.credentials.js", + "dist/credentials/MicrosoftOneDriveOAuth2Api.credentials.js", + "dist/credentials/MoceanApi.credentials.js", + "dist/credentials/MondayComApi.credentials.js", + "dist/credentials/MongoDb.credentials.js", + "dist/credentials/Msg91Api.credentials.js", + "dist/credentials/MySql.credentials.js", + "dist/credentials/NextCloudApi.credentials.js", + "dist/credentials/OAuth1Api.credentials.js", + "dist/credentials/OAuth2Api.credentials.js", + "dist/credentials/OpenWeatherMapApi.credentials.js", + "dist/credentials/PagerDutyApi.credentials.js", + "dist/credentials/PayPalApi.credentials.js", + "dist/credentials/PipedriveApi.credentials.js", + "dist/credentials/Postgres.credentials.js", + "dist/credentials/Redis.credentials.js", + "dist/credentials/RocketchatApi.credentials.js", + "dist/credentials/RundeckApi.credentials.js", + "dist/credentials/ShopifyApi.credentials.js", + "dist/credentials/SalesforceOAuth2Api.credentials.js", + "dist/credentials/SlackApi.credentials.js", + "dist/credentials/SlackOAuth2Api.credentials.js", + "dist/credentials/Sms77Api.credentials.js", + "dist/credentials/Smtp.credentials.js", + "dist/credentials/StripeApi.credentials.js", + "dist/credentials/SalesmateApi.credentials.js", + "dist/credentials/SegmentApi.credentials.js", + "dist/credentials/SurveyMonkeyApi.credentials.js", + "dist/credentials/TelegramApi.credentials.js", + "dist/credentials/TodoistApi.credentials.js", + "dist/credentials/TrelloApi.credentials.js", + "dist/credentials/TwilioApi.credentials.js", + "dist/credentials/TwitterOAuth1Api.credentials.js", + "dist/credentials/TypeformApi.credentials.js", + "dist/credentials/TogglApi.credentials.js", + "dist/credentials/UpleadApi.credentials.js", + "dist/credentials/VeroApi.credentials.js", + "dist/credentials/WebflowApi.credentials.js", + "dist/credentials/WooCommerceApi.credentials.js", + "dist/credentials/WordpressApi.credentials.js", + "dist/credentials/ZendeskApi.credentials.js", + "dist/credentials/ZohoOAuth2Api.credentials.js", + "dist/credentials/ZulipApi.credentials.js" ], - "n8n": { - "credentials": [ - "dist/credentials/ActiveCampaignApi.credentials.js", - "dist/credentials/AgileCrmApi.credentials.js", - "dist/credentials/AcuitySchedulingApi.credentials.js", - "dist/credentials/AirtableApi.credentials.js", - "dist/credentials/Amqp.credentials.js", - "dist/credentials/AsanaApi.credentials.js", - "dist/credentials/Aws.credentials.js", - "dist/credentials/AffinityApi.credentials.js", - "dist/credentials/BannerbearApi.credentials.js", - "dist/credentials/BitbucketApi.credentials.js", - "dist/credentials/BitlyApi.credentials.js", - "dist/credentials/ChargebeeApi.credentials.js", - "dist/credentials/ClearbitApi.credentials.js", - "dist/credentials/ClickUpApi.credentials.js", - "dist/credentials/ClockifyApi.credentials.js", - "dist/credentials/CockpitApi.credentials.js", - "dist/credentials/CodaApi.credentials.js", - "dist/credentials/CopperApi.credentials.js", - "dist/credentials/CalendlyApi.credentials.js", - "dist/credentials/DisqusApi.credentials.js", - "dist/credentials/DriftApi.credentials.js", - "dist/credentials/DropboxApi.credentials.js", - "dist/credentials/EventbriteApi.credentials.js", - "dist/credentials/FacebookGraphApi.credentials.js", - "dist/credentials/FreshdeskApi.credentials.js", - "dist/credentials/FileMaker.credentials.js", - "dist/credentials/FlowApi.credentials.js", - "dist/credentials/GithubApi.credentials.js", - "dist/credentials/GithubOAuth2Api.credentials.js", - "dist/credentials/GitlabApi.credentials.js", - "dist/credentials/GoogleApi.credentials.js", - "dist/credentials/GoogleCalendarOAuth2Api.credentials.js", - "dist/credentials/GoogleOAuth2Api.credentials.js", - "dist/credentials/GoogleSheetsOAuth2Api.credentials.js", - "dist/credentials/GumroadApi.credentials.js", - "dist/credentials/HarvestApi.credentials.js", - "dist/credentials/HelpScoutOAuth2Api.credentials.js", - "dist/credentials/HttpBasicAuth.credentials.js", - "dist/credentials/HttpDigestAuth.credentials.js", - "dist/credentials/HttpHeaderAuth.credentials.js", - "dist/credentials/HubspotApi.credentials.js", - "dist/credentials/HubspotDeveloperApi.credentials.js", - "dist/credentials/HunterApi.credentials.js", - "dist/credentials/Imap.credentials.js", - "dist/credentials/IntercomApi.credentials.js", - "dist/credentials/InvoiceNinjaApi.credentials.js", - "dist/credentials/JiraSoftwareCloudApi.credentials.js", - "dist/credentials/JiraSoftwareServerApi.credentials.js", - "dist/credentials/JotFormApi.credentials.js", - "dist/credentials/KeapOAuth2Api.credentials.js", - "dist/credentials/LinkFishApi.credentials.js", - "dist/credentials/MailchimpApi.credentials.js", - "dist/credentials/MailgunApi.credentials.js", - "dist/credentials/MailjetEmailApi.credentials.js", - "dist/credentials/MailjetSmsApi.credentials.js", - "dist/credentials/MandrillApi.credentials.js", - "dist/credentials/MattermostApi.credentials.js", - "dist/credentials/MauticApi.credentials.js", - "dist/credentials/MicrosoftExcelOAuth2Api.credentials.js", - "dist/credentials/MicrosoftOAuth2Api.credentials.js", - "dist/credentials/MicrosoftOneDriveOAuth2Api.credentials.js", - "dist/credentials/MoceanApi.credentials.js", - "dist/credentials/MondayComApi.credentials.js", - "dist/credentials/MongoDb.credentials.js", - "dist/credentials/Msg91Api.credentials.js", - "dist/credentials/MySql.credentials.js", - "dist/credentials/NextCloudApi.credentials.js", - "dist/credentials/OAuth1Api.credentials.js", - "dist/credentials/OAuth2Api.credentials.js", - "dist/credentials/OpenWeatherMapApi.credentials.js", - "dist/credentials/PagerDutyApi.credentials.js", - "dist/credentials/PayPalApi.credentials.js", - "dist/credentials/PipedriveApi.credentials.js", - "dist/credentials/Postgres.credentials.js", - "dist/credentials/Redis.credentials.js", - "dist/credentials/RocketchatApi.credentials.js", - "dist/credentials/RundeckApi.credentials.js", - "dist/credentials/ShopifyApi.credentials.js", - "dist/credentials/SalesforceOAuth2Api.credentials.js", - "dist/credentials/SlackApi.credentials.js", - "dist/credentials/SlackOAuth2Api.credentials.js", - "dist/credentials/Sms77Api.credentials.js", - "dist/credentials/Smtp.credentials.js", - "dist/credentials/StripeApi.credentials.js", - "dist/credentials/SalesmateApi.credentials.js", - "dist/credentials/SegmentApi.credentials.js", - "dist/credentials/SurveyMonkeyApi.credentials.js", - "dist/credentials/TelegramApi.credentials.js", - "dist/credentials/TodoistApi.credentials.js", - "dist/credentials/TrelloApi.credentials.js", - "dist/credentials/TwilioApi.credentials.js", - "dist/credentials/TwitterOAuth1Api.credentials.js", - "dist/credentials/TypeformApi.credentials.js", - "dist/credentials/TogglApi.credentials.js", - "dist/credentials/UpleadApi.credentials.js", - "dist/credentials/VeroApi.credentials.js", - "dist/credentials/WebflowApi.credentials.js", - "dist/credentials/WooCommerceApi.credentials.js", - "dist/credentials/WordpressApi.credentials.js", - "dist/credentials/ZendeskApi.credentials.js", - "dist/credentials/ZohoOAuth2Api.credentials.js", - "dist/credentials/ZulipApi.credentials.js" - ], - "nodes": [ - "dist/nodes/ActiveCampaign/ActiveCampaign.node.js", - "dist/nodes/ActiveCampaign/ActiveCampaignTrigger.node.js", - "dist/nodes/AgileCrm/AgileCrm.node.js", - "dist/nodes/Airtable/Airtable.node.js", - "dist/nodes/AcuityScheduling/AcuitySchedulingTrigger.node.js", - "dist/nodes/Amqp/Amqp.node.js", - "dist/nodes/Amqp/AmqpTrigger.node.js", - "dist/nodes/Asana/Asana.node.js", - "dist/nodes/Asana/AsanaTrigger.node.js", - "dist/nodes/Affinity/Affinity.node.js", - "dist/nodes/Affinity/AffinityTrigger.node.js", - "dist/nodes/Aws/AwsLambda.node.js", - "dist/nodes/Aws/S3/AwsS3.node.js", - "dist/nodes/Aws/AwsSes.node.js", - "dist/nodes/Aws/AwsSns.node.js", - "dist/nodes/Aws/AwsSnsTrigger.node.js", - "dist/nodes/Bannerbear/Bannerbear.node.js", - "dist/nodes/Bitbucket/BitbucketTrigger.node.js", - "dist/nodes/Bitly/Bitly.node.js", - "dist/nodes/Calendly/CalendlyTrigger.node.js", - "dist/nodes/Chargebee/Chargebee.node.js", - "dist/nodes/Chargebee/ChargebeeTrigger.node.js", - "dist/nodes/Clearbit/Clearbit.node.js", - "dist/nodes/ClickUp/ClickUp.node.js", - "dist/nodes/ClickUp/ClickUpTrigger.node.js", - "dist/nodes/Clockify/ClockifyTrigger.node.js", - "dist/nodes/Cockpit/Cockpit.node.js", - "dist/nodes/Coda/Coda.node.js", - "dist/nodes/Copper/CopperTrigger.node.js", - "dist/nodes/Cron.node.js", - "dist/nodes/Crypto.node.js", - "dist/nodes/DateTime.node.js", - "dist/nodes/Discord/Discord.node.js", - "dist/nodes/Disqus/Disqus.node.js", - "dist/nodes/Drift/Drift.node.js", - "dist/nodes/Dropbox/Dropbox.node.js", - "dist/nodes/EditImage.node.js", - "dist/nodes/EmailReadImap.node.js", - "dist/nodes/EmailSend.node.js", - "dist/nodes/ErrorTrigger.node.js", - "dist/nodes/Eventbrite/EventbriteTrigger.node.js", - "dist/nodes/ExecuteCommand.node.js", - "dist/nodes/ExecuteWorkflow.node.js", - "dist/nodes/Facebook/FacebookGraphApi.node.js", - "dist/nodes/FileMaker/FileMaker.node.js", - "dist/nodes/Freshdesk/Freshdesk.node.js", - "dist/nodes/Flow/Flow.node.js", - "dist/nodes/Flow/FlowTrigger.node.js", - "dist/nodes/Function.node.js", - "dist/nodes/FunctionItem.node.js", - "dist/nodes/Github/Github.node.js", - "dist/nodes/Github/GithubTrigger.node.js", - "dist/nodes/Gitlab/Gitlab.node.js", - "dist/nodes/Gitlab/GitlabTrigger.node.js", - "dist/nodes/Google/Calendar/GoogleCalendar.node.js", - "dist/nodes/Google/Drive/GoogleDrive.node.js", - "dist/nodes/Google/Sheet/GoogleSheets.node.js", - "dist/nodes/GraphQL/GraphQL.node.js", - "dist/nodes/Gumroad/GumroadTrigger.node.js", - "dist/nodes/Harvest/Harvest.node.js", - "dist/nodes/HelpScout/HelpScout.node.js", - "dist/nodes/HelpScout/HelpScoutTrigger.node.js", - "dist/nodes/HtmlExtract/HtmlExtract.node.js", - "dist/nodes/HttpRequest.node.js", - "dist/nodes/Hubspot/Hubspot.node.js", - "dist/nodes/Hubspot/HubspotTrigger.node.js", - "dist/nodes/Hunter/Hunter.node.js", - "dist/nodes/If.node.js", - "dist/nodes/Intercom/Intercom.node.js", - "dist/nodes/Interval.node.js", - "dist/nodes/InvoiceNinja/InvoiceNinja.node.js", - "dist/nodes/InvoiceNinja/InvoiceNinjaTrigger.node.js", - "dist/nodes/Jira/Jira.node.js", - "dist/nodes/JotForm/JotFormTrigger.node.js", - "dist/nodes/Keap/Keap.node.js", - "dist/nodes/Keap/KeapTrigger.node.js", - "dist/nodes/LinkFish/LinkFish.node.js", - "dist/nodes/Mailchimp/Mailchimp.node.js", - "dist/nodes/Mailchimp/MailchimpTrigger.node.js", - "dist/nodes/Mailgun/Mailgun.node.js", - "dist/nodes/Mailjet/Mailjet.node.js", - "dist/nodes/Mailjet/MailjetTrigger.node.js", - "dist/nodes/Mandrill/Mandrill.node.js", - "dist/nodes/Mattermost/Mattermost.node.js", - "dist/nodes/Mautic/Mautic.node.js", - "dist/nodes/Mautic/MauticTrigger.node.js", - "dist/nodes/Merge.node.js", - "dist/nodes/Microsoft/Excel/MicrosoftExcel.node.js", - "dist/nodes/Microsoft/OneDrive/MicrosoftOneDrive.node.js", - "dist/nodes/MoveBinaryData.node.js", - "dist/nodes/Mocean/Mocean.node.js", - "dist/nodes/MondayCom/MondayCom.node.js", - "dist/nodes/MongoDb/MongoDb.node.js", - "dist/nodes/MoveBinaryData.node.js", - "dist/nodes/Msg91/Msg91.node.js", - "dist/nodes/MySql/MySql.node.js", - "dist/nodes/NextCloud/NextCloud.node.js", - "dist/nodes/NoOp.node.js", - "dist/nodes/OpenWeatherMap.node.js", - "dist/nodes/PagerDuty/PagerDuty.node.js", - "dist/nodes/PayPal/PayPal.node.js", - "dist/nodes/PayPal/PayPalTrigger.node.js", - "dist/nodes/Pipedrive/Pipedrive.node.js", - "dist/nodes/Pipedrive/PipedriveTrigger.node.js", - "dist/nodes/Postgres/Postgres.node.js", - "dist/nodes/ReadBinaryFile.node.js", - "dist/nodes/ReadBinaryFiles.node.js", - "dist/nodes/ReadPdf.node.js", - "dist/nodes/Redis/Redis.node.js", - "dist/nodes/RenameKeys.node.js", - "dist/nodes/Rocketchat/Rocketchat.node.js", - "dist/nodes/RssFeedRead.node.js", - "dist/nodes/Rundeck/Rundeck.node.js", - "dist/nodes/Salesforce/Salesforce.node.js", - "dist/nodes/Set.node.js", - "dist/nodes/Shopify/Shopify.node.js", - "dist/nodes/Shopify/ShopifyTrigger.node.js", - "dist/nodes/Slack/Slack.node.js", - "dist/nodes/Sms77/Sms77.node.js", - "dist/nodes/SplitInBatches.node.js", - "dist/nodes/SpreadsheetFile.node.js", - "dist/nodes/SseTrigger.node.js", - "dist/nodes/Start.node.js", - "dist/nodes/Stripe/StripeTrigger.node.js", - "dist/nodes/Switch.node.js", - "dist/nodes/Salesmate/Salesmate.node.js", - "dist/nodes/Segment/Segment.node.js", - "dist/nodes/SurveyMonkey/SurveyMonkeyTrigger.node.js", - "dist/nodes/Telegram/Telegram.node.js", - "dist/nodes/Telegram/TelegramTrigger.node.js", - "dist/nodes/Todoist/Todoist.node.js", - "dist/nodes/Toggl/TogglTrigger.node.js", - "dist/nodes/Trello/Trello.node.js", - "dist/nodes/Trello/TrelloTrigger.node.js", - "dist/nodes/Twilio/Twilio.node.js", - "dist/nodes/Twitter/Twitter.node.js", - "dist/nodes/Typeform/TypeformTrigger.node.js", - "dist/nodes/Uplead/Uplead.node.js", - "dist/nodes/Vero/Vero.node.js", - "dist/nodes/Webflow/WebflowTrigger.node.js", - "dist/nodes/Webhook.node.js", - "dist/nodes/Wordpress/Wordpress.node.js", - "dist/nodes/WooCommerce/WooCommerce.node.js", - "dist/nodes/WooCommerce/WooCommerceTrigger.node.js", - "dist/nodes/WriteBinaryFile.node.js", - "dist/nodes/Xml.node.js", - "dist/nodes/Zendesk/Zendesk.node.js", - "dist/nodes/Zendesk/ZendeskTrigger.node.js", - "dist/nodes/Zoho/ZohoCrm.node.js", - "dist/nodes/Zulip/Zulip.node.js" - ] + "nodes": [ + "dist/nodes/ActiveCampaign/ActiveCampaign.node.js", + "dist/nodes/ActiveCampaign/ActiveCampaignTrigger.node.js", + "dist/nodes/AgileCrm/AgileCrm.node.js", + "dist/nodes/Airtable/Airtable.node.js", + "dist/nodes/AcuityScheduling/AcuitySchedulingTrigger.node.js", + "dist/nodes/Amqp/Amqp.node.js", + "dist/nodes/Amqp/AmqpTrigger.node.js", + "dist/nodes/Asana/Asana.node.js", + "dist/nodes/Asana/AsanaTrigger.node.js", + "dist/nodes/Affinity/Affinity.node.js", + "dist/nodes/Affinity/AffinityTrigger.node.js", + "dist/nodes/Aws/AwsLambda.node.js", + "dist/nodes/Aws/S3/AwsS3.node.js", + "dist/nodes/Aws/AwsSes.node.js", + "dist/nodes/Aws/AwsSns.node.js", + "dist/nodes/Aws/AwsSnsTrigger.node.js", + "dist/nodes/Bannerbear/Bannerbear.node.js", + "dist/nodes/Bitbucket/BitbucketTrigger.node.js", + "dist/nodes/Bitly/Bitly.node.js", + "dist/nodes/Calendly/CalendlyTrigger.node.js", + "dist/nodes/Chargebee/Chargebee.node.js", + "dist/nodes/Chargebee/ChargebeeTrigger.node.js", + "dist/nodes/Clearbit/Clearbit.node.js", + "dist/nodes/ClickUp/ClickUp.node.js", + "dist/nodes/ClickUp/ClickUpTrigger.node.js", + "dist/nodes/Clockify/ClockifyTrigger.node.js", + "dist/nodes/Cockpit/Cockpit.node.js", + "dist/nodes/Coda/Coda.node.js", + "dist/nodes/Copper/CopperTrigger.node.js", + "dist/nodes/Cron.node.js", + "dist/nodes/Crypto.node.js", + "dist/nodes/DateTime.node.js", + "dist/nodes/Discord/Discord.node.js", + "dist/nodes/Disqus/Disqus.node.js", + "dist/nodes/Drift/Drift.node.js", + "dist/nodes/Dropbox/Dropbox.node.js", + "dist/nodes/EditImage.node.js", + "dist/nodes/EmailReadImap.node.js", + "dist/nodes/EmailSend.node.js", + "dist/nodes/ErrorTrigger.node.js", + "dist/nodes/Eventbrite/EventbriteTrigger.node.js", + "dist/nodes/ExecuteCommand.node.js", + "dist/nodes/ExecuteWorkflow.node.js", + "dist/nodes/Facebook/FacebookGraphApi.node.js", + "dist/nodes/FileMaker/FileMaker.node.js", + "dist/nodes/Freshdesk/Freshdesk.node.js", + "dist/nodes/Flow/Flow.node.js", + "dist/nodes/Flow/FlowTrigger.node.js", + "dist/nodes/Function.node.js", + "dist/nodes/FunctionItem.node.js", + "dist/nodes/Github/Github.node.js", + "dist/nodes/Github/GithubTrigger.node.js", + "dist/nodes/Gitlab/Gitlab.node.js", + "dist/nodes/Gitlab/GitlabTrigger.node.js", + "dist/nodes/Google/Calendar/GoogleCalendar.node.js", + "dist/nodes/Google/Drive/GoogleDrive.node.js", + "dist/nodes/Google/Sheet/GoogleSheets.node.js", + "dist/nodes/GraphQL/GraphQL.node.js", + "dist/nodes/Gumroad/GumroadTrigger.node.js", + "dist/nodes/Harvest/Harvest.node.js", + "dist/nodes/HelpScout/HelpScout.node.js", + "dist/nodes/HelpScout/HelpScoutTrigger.node.js", + "dist/nodes/HtmlExtract/HtmlExtract.node.js", + "dist/nodes/HttpRequest.node.js", + "dist/nodes/Hubspot/Hubspot.node.js", + "dist/nodes/Hubspot/HubspotTrigger.node.js", + "dist/nodes/Hunter/Hunter.node.js", + "dist/nodes/If.node.js", + "dist/nodes/Intercom/Intercom.node.js", + "dist/nodes/Interval.node.js", + "dist/nodes/InvoiceNinja/InvoiceNinja.node.js", + "dist/nodes/InvoiceNinja/InvoiceNinjaTrigger.node.js", + "dist/nodes/Jira/Jira.node.js", + "dist/nodes/JotForm/JotFormTrigger.node.js", + "dist/nodes/Keap/Keap.node.js", + "dist/nodes/Keap/KeapTrigger.node.js", + "dist/nodes/LinkFish/LinkFish.node.js", + "dist/nodes/Mailchimp/Mailchimp.node.js", + "dist/nodes/Mailchimp/MailchimpTrigger.node.js", + "dist/nodes/Mailgun/Mailgun.node.js", + "dist/nodes/Mailjet/Mailjet.node.js", + "dist/nodes/Mailjet/MailjetTrigger.node.js", + "dist/nodes/Mandrill/Mandrill.node.js", + "dist/nodes/Mattermost/Mattermost.node.js", + "dist/nodes/Mautic/Mautic.node.js", + "dist/nodes/Mautic/MauticTrigger.node.js", + "dist/nodes/Merge.node.js", + "dist/nodes/MessageBird/MessageBird.node.js", + "dist/nodes/Microsoft/Excel/MicrosoftExcel.node.js", + "dist/nodes/Microsoft/OneDrive/MicrosoftOneDrive.node.js", + "dist/nodes/MoveBinaryData.node.js", + "dist/nodes/Mocean/Mocean.node.js", + "dist/nodes/MondayCom/MondayCom.node.js", + "dist/nodes/MongoDb/MongoDb.node.js", + "dist/nodes/MoveBinaryData.node.js", + "dist/nodes/Msg91/Msg91.node.js", + "dist/nodes/MySql/MySql.node.js", + "dist/nodes/NextCloud/NextCloud.node.js", + "dist/nodes/NoOp.node.js", + "dist/nodes/OpenWeatherMap.node.js", + "dist/nodes/PagerDuty/PagerDuty.node.js", + "dist/nodes/PayPal/PayPal.node.js", + "dist/nodes/PayPal/PayPalTrigger.node.js", + "dist/nodes/Pipedrive/Pipedrive.node.js", + "dist/nodes/Pipedrive/PipedriveTrigger.node.js", + "dist/nodes/Postgres/Postgres.node.js", + "dist/nodes/ReadBinaryFile.node.js", + "dist/nodes/ReadBinaryFiles.node.js", + "dist/nodes/ReadPdf.node.js", + "dist/nodes/Redis/Redis.node.js", + "dist/nodes/RenameKeys.node.js", + "dist/nodes/Rocketchat/Rocketchat.node.js", + "dist/nodes/RssFeedRead.node.js", + "dist/nodes/Rundeck/Rundeck.node.js", + "dist/nodes/Salesforce/Salesforce.node.js", + "dist/nodes/Set.node.js", + "dist/nodes/Shopify/Shopify.node.js", + "dist/nodes/Shopify/ShopifyTrigger.node.js", + "dist/nodes/Slack/Slack.node.js", + "dist/nodes/Sms77/Sms77.node.js", + "dist/nodes/SplitInBatches.node.js", + "dist/nodes/SpreadsheetFile.node.js", + "dist/nodes/SseTrigger.node.js", + "dist/nodes/Start.node.js", + "dist/nodes/Stripe/StripeTrigger.node.js", + "dist/nodes/Switch.node.js", + "dist/nodes/Salesmate/Salesmate.node.js", + "dist/nodes/Segment/Segment.node.js", + "dist/nodes/SurveyMonkey/SurveyMonkeyTrigger.node.js", + "dist/nodes/Telegram/Telegram.node.js", + "dist/nodes/Telegram/TelegramTrigger.node.js", + "dist/nodes/Todoist/Todoist.node.js", + "dist/nodes/Toggl/TogglTrigger.node.js", + "dist/nodes/Trello/Trello.node.js", + "dist/nodes/Trello/TrelloTrigger.node.js", + "dist/nodes/Twilio/Twilio.node.js", + "dist/nodes/Twitter/Twitter.node.js", + "dist/nodes/Typeform/TypeformTrigger.node.js", + "dist/nodes/Uplead/Uplead.node.js", + "dist/nodes/Vero/Vero.node.js", + "dist/nodes/Webflow/WebflowTrigger.node.js", + "dist/nodes/Webhook.node.js", + "dist/nodes/Wordpress/Wordpress.node.js", + "dist/nodes/WooCommerce/WooCommerce.node.js", + "dist/nodes/WooCommerce/WooCommerceTrigger.node.js", + "dist/nodes/WriteBinaryFile.node.js", + "dist/nodes/Xml.node.js", + "dist/nodes/Zendesk/Zendesk.node.js", + "dist/nodes/Zendesk/ZendeskTrigger.node.js", + "dist/nodes/Zoho/ZohoCrm.node.js", + "dist/nodes/Zulip/Zulip.node.js" + ] + }, + "devDependencies": { + "@types/aws4": "^1.5.1", + "@types/basic-auth": "^1.1.2", + "@types/cheerio": "^0.22.15", + "@types/cron": "^1.6.1", + "@types/eventsource": "^1.1.2", + "@types/express": "^4.16.1", + "@types/formidable": "^1.0.31", + "@types/gm": "^1.18.2", + "@types/imap-simple": "^4.2.0", + "@types/jest": "^24.0.18", + "@types/lodash.set": "^4.3.6", + "@types/moment-timezone": "^0.5.12", + "@types/mongodb": "^3.5.4", + "@types/node": "^10.10.1", + "@types/nodemailer": "^6.4.0", + "@types/redis": "^2.8.11", + "@types/request-promise-native": "~1.0.15", + "@types/uuid": "^3.4.6", + "@types/xml2js": "^0.4.3", + "gulp": "^4.0.0", + "jest": "^24.9.0", + "n8n-workflow": "~0.32.0", + "ts-jest": "^24.0.2", + "tslint": "^5.17.0", + "typescript": "~3.7.4" + }, + "dependencies": { + "aws4": "^1.8.0", + "basic-auth": "^2.0.1", + "change-case": "^4.1.1", + "cheerio": "^1.0.0-rc.3", + "cron": "^1.7.2", + "eventsource": "^1.0.7", + "formidable": "^1.2.1", + "glob-promise": "^3.4.0", + "gm": "^1.23.1", + "googleapis": "~50.0.0", + "imap-simple": "^4.3.0", + "iso-639-1": "^2.1.3", + "jsonwebtoken": "^8.5.1", + "lodash.get": "^4.4.2", + "lodash.set": "^4.3.2", + "lodash.unset": "^4.5.2", + "moment": "2.24.0", + "moment-timezone": "^0.5.28", + "mongodb": "^3.5.5", + "mysql2": "^2.0.1", + "n8n-core": "~0.36.0", + "nodemailer": "^6.4.6", + "pdf-parse": "^1.1.1", + "pg-promise": "^9.0.3", + "redis": "^2.8.0", + "request": "^2.88.2", + "rhea": "^1.0.11", + "rss-parser": "^3.7.0", + "uuid": "^3.4.0", + "vm2": "^3.6.10", + "xlsx": "^0.14.3", + "xml2js": "^0.4.22" + }, + "jest": { + "transform": { + "^.+\\.tsx?$": "ts-jest" }, - "devDependencies": { - "@types/aws4": "^1.5.1", - "@types/basic-auth": "^1.1.2", - "@types/cheerio": "^0.22.15", - "@types/cron": "^1.6.1", - "@types/eventsource": "^1.1.2", - "@types/express": "^4.16.1", - "@types/formidable": "^1.0.31", - "@types/gm": "^1.18.2", - "@types/imap-simple": "^4.2.0", - "@types/jest": "^24.0.18", - "@types/lodash.set": "^4.3.6", - "@types/moment-timezone": "^0.5.12", - "@types/mongodb": "^3.5.4", - "@types/node": "^10.10.1", - "@types/nodemailer": "^6.4.0", - "@types/redis": "^2.8.11", - "@types/request-promise-native": "~1.0.15", - "@types/uuid": "^3.4.6", - "@types/xml2js": "^0.4.3", - "gulp": "^4.0.0", - "jest": "^24.9.0", - "n8n-workflow": "~0.32.0", - "ts-jest": "^24.0.2", - "tslint": "^5.17.0", - "typescript": "~3.7.4" - }, - "dependencies": { - "aws4": "^1.8.0", - "basic-auth": "^2.0.1", - "change-case": "^4.1.1", - "cheerio": "^1.0.0-rc.3", - "cron": "^1.7.2", - "eventsource": "^1.0.7", - "formidable": "^1.2.1", - "glob-promise": "^3.4.0", - "gm": "^1.23.1", - "googleapis": "~50.0.0", - "imap-simple": "^4.3.0", - "iso-639-1": "^2.1.3", - "jsonwebtoken": "^8.5.1", - "lodash.get": "^4.4.2", - "lodash.set": "^4.3.2", - "lodash.unset": "^4.5.2", - "moment": "2.24.0", - "moment-timezone": "^0.5.28", - "mongodb": "^3.5.5", - "mysql2": "^2.0.1", - "n8n-core": "~0.36.0", - "nodemailer": "^6.4.6", - "pdf-parse": "^1.1.1", - "pg-promise": "^9.0.3", - "redis": "^2.8.0", - "request": "^2.88.2", - "rhea": "^1.0.11", - "rss-parser": "^3.7.0", - "uuid": "^3.4.0", - "vm2": "^3.6.10", - "xlsx": "^0.14.3", - "xml2js": "^0.4.22" - }, - "jest": { - "transform": { - "^.+\\.tsx?$": "ts-jest" - }, - "testURL": "http://localhost/", - "testRegex": "(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$", - "testPathIgnorePatterns": [ - "/dist/", - "/node_modules/" - ], - "moduleFileExtensions": [ - "ts", - "tsx", - "js", - "json" - ] - } + "testURL": "http://localhost/", + "testRegex": "(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$", + "testPathIgnorePatterns": [ + "/dist/", + "/node_modules/" + ], + "moduleFileExtensions": [ + "ts", + "tsx", + "js", + "json" + ] + } } From edd4c7a82f568decbcf2891dd62c0b17015feefe Mon Sep 17 00:00:00 2001 From: ricardo Date: Thu, 11 Jun 2020 20:40:58 -0400 Subject: [PATCH 040/241] :zap: Small improvements to MessageBird node --- .../nodes/MessageBird/GenericFunctions.ts | 38 +++-- .../nodes/MessageBird/MessageBird.node.ts | 134 ++++++++++-------- 2 files changed, 88 insertions(+), 84 deletions(-) diff --git a/packages/nodes-base/nodes/MessageBird/GenericFunctions.ts b/packages/nodes-base/nodes/MessageBird/GenericFunctions.ts index ff1df3b265..ee790863d7 100644 --- a/packages/nodes-base/nodes/MessageBird/GenericFunctions.ts +++ b/packages/nodes-base/nodes/MessageBird/GenericFunctions.ts @@ -1,7 +1,15 @@ -import { IExecuteFunctions, IHookFunctions } from 'n8n-core'; -import { OptionsWithUri } from 'request'; +import { + IExecuteFunctions, + IHookFunctions, + } from 'n8n-core'; -import { IDataObject } from 'n8n-workflow'; +import { + OptionsWithUri, + } from 'request'; + +import { + IDataObject, + } from 'n8n-workflow'; /** * Make an API request to Message Bird @@ -17,23 +25,17 @@ export async function messageBirdApiRequest( method: string, resource: string, body: IDataObject, - query?: IDataObject + query: IDataObject = {}, ): Promise { const credentials = this.getCredentials('messageBirdApi'); if (credentials === undefined) { throw new Error('No credentials returned!'); } - if (query === undefined) { - query = {}; - } - let token; - token = token = `AccessKey ${credentials.accessKey}`; - const options: OptionsWithUri = { headers: { Accept: 'application/json', - Authorization: token + Authorization: `AccessKey ${credentials.accessKey}`, }, method, qs: query, @@ -51,18 +53,12 @@ export async function messageBirdApiRequest( if (error.response && error.response.body && error.response.body.errors) { // Try to return the error prettier - let errorMessage; - for (let i = 0; i < error.response.body.errors.length; i++) { - errorMessage = - errorMessage + - `Message Bird Error response [${error.statusCode}]: ${error.response.body.errors[i].description}`; - } - throw new Error(errorMessage); + const errorMessage = error.response.body.errors.map((e: IDataObject) => e.description); + + throw new Error(`MessageBird Error response [${error.statusCode}]: ${errorMessage.join('|')}`); } // If that data does not exist for some reason return the actual error - throw new Error( - `Message Bird error ${error.response.body.errors[0].description}` - ); + throw error; } } diff --git a/packages/nodes-base/nodes/MessageBird/MessageBird.node.ts b/packages/nodes-base/nodes/MessageBird/MessageBird.node.ts index cb0960f1e0..8d1190c8d6 100644 --- a/packages/nodes-base/nodes/MessageBird/MessageBird.node.ts +++ b/packages/nodes-base/nodes/MessageBird/MessageBird.node.ts @@ -1,19 +1,24 @@ -import { IExecuteFunctions } from 'n8n-core'; +import { + IExecuteFunctions, + } from 'n8n-core'; + import { IDataObject, INodeTypeDescription, INodeExecutionData, - INodeType + INodeType, } from 'n8n-workflow'; -import { messageBirdApiRequest } from './GenericFunctions'; +import { + messageBirdApiRequest, + } from './GenericFunctions'; export class MessageBird implements INodeType { description: INodeTypeDescription = { displayName: 'MessageBird', name: 'messageBird', icon: 'file:messagebird.png', - group: ['transform'], + group: ['output'], version: 1, subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}', description: 'Sending SMS', @@ -50,15 +55,17 @@ export class MessageBird implements INodeType { type: 'options', displayOptions: { show: { - resource: ['sms'] - } + resource: [ + 'sms', + ], + }, }, options: [ { name: 'Send', value: 'send', description: 'Send text messages (SMS)' - } + }, ], default: 'send', description: 'The operation to perform.' @@ -76,9 +83,13 @@ export class MessageBird implements INodeType { required: true, displayOptions: { show: { - operation: ['send'], - resource: ['sms'] - } + operation: [ + 'send', + ], + resource: [ + 'sms', + ], + }, }, description: 'The number from which to send the message' }, @@ -106,9 +117,13 @@ export class MessageBird implements INodeType { required: true, displayOptions: { show: { - operation: ['send'], - resource: ['sms'] - } + operation: [ + 'send', + ], + resource: [ + 'sms', + ], + }, }, description: 'The message to be send' }, @@ -119,91 +134,87 @@ export class MessageBird implements INodeType { placeholder: 'Add Fields', default: {}, options: [ - //date-time format { displayName: 'Created Date-time', name: 'createdDatetime', type: 'dateTime', - placeholder: '2011-08-30T09:30:16.768-04:00', default: '', - description: - 'The date and time of the creation of the message in RFC3339 format (Y-m-dTH:i:sP).' + description: 'The date and time of the creation of the message in RFC3339 format (Y-m-dTH:i:sP).', }, { displayName: 'Datacoding', name: 'datacoding', - type: 'string', + type: 'options', + options: [ + { + name: 'Auto', + value: 'auto', + }, + { + name: 'Plain', + value: 'plain', + }, + { + name: 'Unicode', + value: 'unicode', + }, + ], default: '', - description: - 'Using unicode will limit the maximum number of characters to 70 instead of 160' + description: 'Using unicode will limit the maximum number of characters to 70 instead of 160', }, { displayName: 'Gateway', name: 'gateway', type: 'number', default: '', - description: 'The SMS route that is used to send the message.' + description: 'The SMS route that is used to send the message.', }, { - displayName: 'Group Ids', + displayName: 'Group IDs', name: 'groupIds', placeholder: '1,2', type: 'string', default: '', - description: - 'group ids separated by commas, If provided recipients can be omitted' + description: 'Group IDs separated by commas, If provided recipients can be omitted', }, { - displayName: 'Mclass', + displayName: 'Message Type', name: 'mclass', type: 'options', - placeholder: 'permissible values from 0-3', + placeholder: 'Permissible values from 0-3', options: [ { - name: '0', - value: '0' + name: 'Normal', + value: 0 }, { - name: '1', - value: '1' + name: 'Flash', + value: 1, }, - { - name: '2', - value: '2' - }, - { - name: '3', - value: '3' - } ], - default: '', - description: - 'Indicated the message type. 1 is a normal message, 0 is a flash message.' + default: 1, + description: 'Indicated the message type. 1 is a normal message, 0 is a flash message.', }, { displayName: 'Reference', name: 'reference', type: 'string', default: '', - description: 'A client reference.' + description: 'A client reference.', }, { displayName: 'Report Url', name: 'reportUrl', type: 'string', default: '', - description: - 'The status report URL to be used on a per-message basis.
Reference is required for a status report webhook to be sent.' + description: 'The status report URL to be used on a per-message basis.
Reference is required for a status report webhook to be sent.', }, - //date-time format { displayName: 'Scheduled Date-time', name: 'scheduledDatetime', type: 'dateTime', default: '', - placeholder: '2011-08-30T09:30:16.768-04:00', - description: - 'The scheduled date and time of the message in RFC3339 format (Y-m-dTH:i:sP).' + description: 'The scheduled date and time of the message in RFC3339 format (Y-m-dTH:i:sP).', }, { displayName: 'Type', @@ -211,44 +222,41 @@ export class MessageBird implements INodeType { type: 'options', options: [ { - name: 'sms', + name: 'SMS', value: 'sms' }, { - name: 'binary', + name: 'Binary', value: 'binary' }, { - name: 'flash', + name: 'Flash', value: 'flash' } ], default: '', - description: - 'The type of message.
Values can be: sms, binary, or flash.' + description: 'The type of message.
Values can be: sms, binary, or flash.' }, - //hash { displayName: 'Type Details', name: 'typeDetails', type: 'string', default: '', - description: - 'A hash with extra information.
Is only used when a binary message is sent.' + description: 'A hash with extra information.
Is only used when a binary message is sent.', }, { displayName: 'Validity', name: 'validity', type: 'number', - default: '', + default: 1, typeOptions: { - minValue: 1 + minValue: 1, }, - description: 'The amount of seconds that the message is valid.' - } - ] - } - ] + description: 'The amount of seconds that the message is valid.', + }, + ], + }, + ], }; async execute(this: IExecuteFunctions): Promise { From 09862d602ee74aa0c3e047a565292a05c926bd5f Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Fri, 12 Jun 2020 09:39:56 +0200 Subject: [PATCH 041/241] :zap: Minor improvements to MessageBird-Node --- .../nodes/MessageBird/GenericFunctions.ts | 16 ++++---- .../nodes/MessageBird/MessageBird.node.ts | 38 +++++++++---------- 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/packages/nodes-base/nodes/MessageBird/GenericFunctions.ts b/packages/nodes-base/nodes/MessageBird/GenericFunctions.ts index ee790863d7..5a7eda2210 100644 --- a/packages/nodes-base/nodes/MessageBird/GenericFunctions.ts +++ b/packages/nodes-base/nodes/MessageBird/GenericFunctions.ts @@ -1,15 +1,15 @@ +import { + OptionsWithUri, +} from 'request'; + import { IExecuteFunctions, IHookFunctions, - } from 'n8n-core'; - -import { - OptionsWithUri, - } from 'request'; +} from 'n8n-core'; import { IDataObject, - } from 'n8n-workflow'; +} from 'n8n-workflow'; /** * Make an API request to Message Bird @@ -26,7 +26,7 @@ export async function messageBirdApiRequest( resource: string, body: IDataObject, query: IDataObject = {}, -): Promise { +): Promise { // tslint:disable-line:no-any const credentials = this.getCredentials('messageBirdApi'); if (credentials === undefined) { throw new Error('No credentials returned!'); @@ -41,7 +41,7 @@ export async function messageBirdApiRequest( qs: query, body, uri: `https://rest.messagebird.com${resource}`, - json: true + json: true, }; try { diff --git a/packages/nodes-base/nodes/MessageBird/MessageBird.node.ts b/packages/nodes-base/nodes/MessageBird/MessageBird.node.ts index 8d1190c8d6..9c74b6a3d9 100644 --- a/packages/nodes-base/nodes/MessageBird/MessageBird.node.ts +++ b/packages/nodes-base/nodes/MessageBird/MessageBird.node.ts @@ -64,11 +64,11 @@ export class MessageBird implements INodeType { { name: 'Send', value: 'send', - description: 'Send text messages (SMS)' + description: 'Send text messages (SMS)', }, ], default: 'send', - description: 'The operation to perform.' + description: 'The operation to perform.', }, // ---------------------------------- @@ -91,7 +91,7 @@ export class MessageBird implements INodeType { ], }, }, - description: 'The number from which to send the message' + description: 'The number from which to send the message.', }, { displayName: 'To', @@ -103,10 +103,10 @@ export class MessageBird implements INodeType { displayOptions: { show: { operation: ['send'], - resource: ['sms'] - } + resource: ['sms'], + }, }, - description: 'all recipients separated by commas' + description: 'All recipients separated by commas.', }, { @@ -125,7 +125,7 @@ export class MessageBird implements INodeType { ], }, }, - description: 'The message to be send' + description: 'The message to be send.', }, { displayName: 'Additional Fields', @@ -160,7 +160,7 @@ export class MessageBird implements INodeType { }, ], default: '', - description: 'Using unicode will limit the maximum number of characters to 70 instead of 160', + description: 'Using unicode will limit the maximum number of characters to 70 instead of 160.', }, { displayName: 'Gateway', @@ -175,7 +175,7 @@ export class MessageBird implements INodeType { placeholder: '1,2', type: 'string', default: '', - description: 'Group IDs separated by commas, If provided recipients can be omitted', + description: 'Group IDs separated by commas, If provided recipients can be omitted.', }, { displayName: 'Message Type', @@ -183,14 +183,14 @@ export class MessageBird implements INodeType { type: 'options', placeholder: 'Permissible values from 0-3', options: [ - { - name: 'Normal', - value: 0 - }, { name: 'Flash', value: 1, }, + { + name: 'Normal', + value: 0, + }, ], default: 1, description: 'Indicated the message type. 1 is a normal message, 0 is a flash message.', @@ -221,10 +221,6 @@ export class MessageBird implements INodeType { name: 'type', type: 'options', options: [ - { - name: 'SMS', - value: 'sms' - }, { name: 'Binary', value: 'binary' @@ -232,10 +228,14 @@ export class MessageBird implements INodeType { { name: 'Flash', value: 'flash' - } + }, + { + name: 'SMS', + value: 'sms' + }, ], default: '', - description: 'The type of message.
Values can be: sms, binary, or flash.' + description: 'The type of message.
Values can be: sms, binary, or flash.', }, { displayName: 'Type Details', From 6a3f075612b9beee9b8321910c62bd0f6b93f365 Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Fri, 12 Jun 2020 10:30:22 +0200 Subject: [PATCH 042/241] :bug: Fix bug with parameter being a string --- packages/nodes-base/nodes/Google/Sheet/GoogleSheets.node.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/nodes-base/nodes/Google/Sheet/GoogleSheets.node.ts b/packages/nodes-base/nodes/Google/Sheet/GoogleSheets.node.ts index 90e4e8b1fd..52fe2fcc84 100644 --- a/packages/nodes-base/nodes/Google/Sheet/GoogleSheets.node.ts +++ b/packages/nodes-base/nodes/Google/Sheet/GoogleSheets.node.ts @@ -670,7 +670,7 @@ export class GoogleSheets implements INodeType { sheetId: range.sheetId, dimension: deletePropertyToDimensions[propertyName] as string, startIndex: range.startIndex, - endIndex: range.startIndex + range.amount, + endIndex: parseInt(range.startIndex.toString(), 10) + parseInt(range.amount.toString(), 10), } } }); From 002437862d560c412aeaa382fd223caf6a1958d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Ovejero?= Date: Fri, 12 Jun 2020 10:28:40 -0300 Subject: [PATCH 043/241] :zap: Fix PNG file copy for CLI build --watch command (#661) --- packages/node-dev/src/Build.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/node-dev/src/Build.ts b/packages/node-dev/src/Build.ts index ddb74add0a..fd695efb4b 100644 --- a/packages/node-dev/src/Build.ts +++ b/packages/node-dev/src/Build.ts @@ -105,10 +105,10 @@ export async function buildFiles (options?: IBuildOptions): Promise { } return new Promise((resolve, reject) => { + copyfiles([join(process.cwd(), './*.png'), outputDirectory], { up: true }, () => resolve(outputDirectory)); buildProcess.on('exit', code => { // Remove the tmp tsconfig file tsconfigData.cleanup(); - copyfiles([join(process.cwd(), './*.png'), outputDirectory], { up: true }, () => resolve(outputDirectory)); }); }); } From 3705e2bfbf9fd7acaf1689b75d01815d40eea9b4 Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Fri, 12 Jun 2020 15:29:55 +0200 Subject: [PATCH 044/241] :bookmark: Release n8n-node-dev@0.8.0 --- packages/node-dev/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/node-dev/package.json b/packages/node-dev/package.json index 9d859de394..1c252141b3 100644 --- a/packages/node-dev/package.json +++ b/packages/node-dev/package.json @@ -1,6 +1,6 @@ { "name": "n8n-node-dev", - "version": "0.7.0", + "version": "0.8.0", "description": "CLI to simplify n8n credentials/node development", "license": "SEE LICENSE IN LICENSE.md", "homepage": "https://n8n.io", From d1c5eb26fb550e682a289e2924291d3acb42a29b Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Fri, 12 Jun 2020 15:32:39 +0200 Subject: [PATCH 045/241] :bookmark: Release n8n-node-dev@0.9.0 --- packages/node-dev/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/node-dev/package.json b/packages/node-dev/package.json index 1c252141b3..66394fec29 100644 --- a/packages/node-dev/package.json +++ b/packages/node-dev/package.json @@ -1,6 +1,6 @@ { "name": "n8n-node-dev", - "version": "0.8.0", + "version": "0.9.0", "description": "CLI to simplify n8n credentials/node development", "license": "SEE LICENSE IN LICENSE.md", "homepage": "https://n8n.io", From ed160764c9a8e9424609b2bdb0df5c138228f17b Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Fri, 12 Jun 2020 15:51:38 +0200 Subject: [PATCH 046/241] :zap: Remove debug messages --- packages/cli/src/ExternalHooks.ts | 8 -------- 1 file changed, 8 deletions(-) diff --git a/packages/cli/src/ExternalHooks.ts b/packages/cli/src/ExternalHooks.ts index b2b84cd7c7..355415158a 100644 --- a/packages/cli/src/ExternalHooks.ts +++ b/packages/cli/src/ExternalHooks.ts @@ -16,22 +16,16 @@ class ExternalHooksClass implements IExternalHooksClass { async init(): Promise { - console.log('ExternalHooks.init'); - if (this.initDidRun === true) { return; } const externalHookFiles = config.get('externalHookFiles').split(':'); - console.log('externalHookFiles'); - console.log(externalHookFiles); - // Load all the provided hook-files for (let hookFilePath of externalHookFiles) { hookFilePath = hookFilePath.trim(); if (hookFilePath !== '') { - console.log(' --- load: ' + hookFilePath); try { const hookFile = require(hookFilePath); @@ -57,8 +51,6 @@ class ExternalHooksClass implements IExternalHooksClass { } async run(hookName: string, hookParameters?: any[]): Promise { // tslint:disable-line:no-any - console.log('RUN NOW: ' + hookName); - const externalHookFunctions: IExternalHooksFunctions = { dbCollections: Db.collections, }; From 2bddf55d4ffaafeb6cb5b0ba92d014a374cf2a32 Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Fri, 12 Jun 2020 21:12:21 +0200 Subject: [PATCH 047/241] :bug: Fix issue that it always used data of first item --- packages/nodes-base/nodes/OpenWeatherMap.node.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/nodes-base/nodes/OpenWeatherMap.node.ts b/packages/nodes-base/nodes/OpenWeatherMap.node.ts index e12e384094..38e883e53f 100644 --- a/packages/nodes-base/nodes/OpenWeatherMap.node.ts +++ b/packages/nodes-base/nodes/OpenWeatherMap.node.ts @@ -213,20 +213,20 @@ export class OpenWeatherMap implements INodeType { // Set base data qs = { APPID: credentials.accessToken, - units: this.getNodeParameter('format', 0) as string + units: this.getNodeParameter('format', i) as string }; // Get the location - locationSelection = this.getNodeParameter('locationSelection', 0) as string; + locationSelection = this.getNodeParameter('locationSelection', i) as string; if (locationSelection === 'cityName') { - qs.q = this.getNodeParameter('cityName', 0) as string; + qs.q = this.getNodeParameter('cityName', i) as string; } else if (locationSelection === 'cityId') { - qs.id = this.getNodeParameter('cityId', 0) as number; + qs.id = this.getNodeParameter('cityId', i) as number; } else if (locationSelection === 'coordinates') { - qs.lat = this.getNodeParameter('latitude', 0) as string; - qs.lon = this.getNodeParameter('longitude', 0) as string; + qs.lat = this.getNodeParameter('latitude', i) as string; + qs.lon = this.getNodeParameter('longitude', i) as string; } else if (locationSelection === 'zipCode') { - qs.zip = this.getNodeParameter('zipCode', 0) as string; + qs.zip = this.getNodeParameter('zipCode', i) as string; } else { throw new Error(`The locationSelection "${locationSelection}" is not known!`); } From a5055940b3c2360abf23fd008a1333282e84c865 Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Sat, 13 Jun 2020 12:34:20 +0200 Subject: [PATCH 048/241] :bug: Fix issue with multiuser-setup --- .../migrations/1588157391238-InitialMigration.ts | 8 ++++---- .../migrations/1587669153312-InitialMigration.ts | 16 +++++++++------- .../migrations/1588102412422-InitialMigration.ts | 8 ++++---- 3 files changed, 17 insertions(+), 15 deletions(-) diff --git a/packages/cli/src/databases/mysqldb/migrations/1588157391238-InitialMigration.ts b/packages/cli/src/databases/mysqldb/migrations/1588157391238-InitialMigration.ts index fc11ef32fb..1d1d4d8cc5 100644 --- a/packages/cli/src/databases/mysqldb/migrations/1588157391238-InitialMigration.ts +++ b/packages/cli/src/databases/mysqldb/migrations/1588157391238-InitialMigration.ts @@ -8,8 +8,8 @@ export class InitialMigration1588157391238 implements MigrationInterface { async up(queryRunner: QueryRunner): Promise { const tablePrefix = config.get('database.tablePrefix'); - await queryRunner.query('CREATE TABLE IF NOT EXISTS `' + tablePrefix + 'credentials_entity` (`id` int NOT NULL AUTO_INCREMENT, `name` varchar(128) NOT NULL, `data` text NOT NULL, `type` varchar(32) NOT NULL, `nodesAccess` json NOT NULL, `createdAt` datetime NOT NULL, `updatedAt` datetime NOT NULL, INDEX `IDX_07fde106c0b471d8cc80a64fc8` (`type`), PRIMARY KEY (`id`)) ENGINE=InnoDB', undefined); - await queryRunner.query('CREATE TABLE IF NOT EXISTS `' + tablePrefix + 'execution_entity` (`id` int NOT NULL AUTO_INCREMENT, `data` text NOT NULL, `finished` tinyint NOT NULL, `mode` varchar(255) NOT NULL, `retryOf` varchar(255) NULL, `retrySuccessId` varchar(255) NULL, `startedAt` datetime NOT NULL, `stoppedAt` datetime NOT NULL, `workflowData` json NOT NULL, `workflowId` varchar(255) NULL, INDEX `IDX_c4d999a5e90784e8caccf5589d` (`workflowId`), PRIMARY KEY (`id`)) ENGINE=InnoDB', undefined); + await queryRunner.query('CREATE TABLE IF NOT EXISTS `' + tablePrefix + 'credentials_entity` (`id` int NOT NULL AUTO_INCREMENT, `name` varchar(128) NOT NULL, `data` text NOT NULL, `type` varchar(32) NOT NULL, `nodesAccess` json NOT NULL, `createdAt` datetime NOT NULL, `updatedAt` datetime NOT NULL, INDEX `IDX_' + tablePrefix + '07fde106c0b471d8cc80a64fc8` (`type`), PRIMARY KEY (`id`)) ENGINE=InnoDB', undefined); + await queryRunner.query('CREATE TABLE IF NOT EXISTS `' + tablePrefix + 'execution_entity` (`id` int NOT NULL AUTO_INCREMENT, `data` text NOT NULL, `finished` tinyint NOT NULL, `mode` varchar(255) NOT NULL, `retryOf` varchar(255) NULL, `retrySuccessId` varchar(255) NULL, `startedAt` datetime NOT NULL, `stoppedAt` datetime NOT NULL, `workflowData` json NOT NULL, `workflowId` varchar(255) NULL, INDEX `IDX_' + tablePrefix + 'c4d999a5e90784e8caccf5589d` (`workflowId`), PRIMARY KEY (`id`)) ENGINE=InnoDB', undefined); await queryRunner.query('CREATE TABLE IF NOT EXISTS`' + tablePrefix + 'workflow_entity` (`id` int NOT NULL AUTO_INCREMENT, `name` varchar(128) NOT NULL, `active` tinyint NOT NULL, `nodes` json NOT NULL, `connections` json NOT NULL, `createdAt` datetime NOT NULL, `updatedAt` datetime NOT NULL, `settings` json NULL, `staticData` json NULL, PRIMARY KEY (`id`)) ENGINE=InnoDB', undefined); } @@ -17,9 +17,9 @@ export class InitialMigration1588157391238 implements MigrationInterface { const tablePrefix = config.get('database.tablePrefix'); await queryRunner.query('DROP TABLE `' + tablePrefix + 'workflow_entity`', undefined); - await queryRunner.query('DROP INDEX `IDX_c4d999a5e90784e8caccf5589d` ON `' + tablePrefix + 'execution_entity`', undefined); + await queryRunner.query('DROP INDEX `IDX_' + tablePrefix + 'c4d999a5e90784e8caccf5589d` ON `' + tablePrefix + 'execution_entity`', undefined); await queryRunner.query('DROP TABLE `' + tablePrefix + 'execution_entity`', undefined); - await queryRunner.query('DROP INDEX `IDX_07fde106c0b471d8cc80a64fc8` ON `' + tablePrefix + 'credentials_entity`', undefined); + await queryRunner.query('DROP INDEX `IDX_' + tablePrefix + '07fde106c0b471d8cc80a64fc8` ON `' + tablePrefix + 'credentials_entity`', undefined); await queryRunner.query('DROP TABLE `' + tablePrefix + 'credentials_entity`', undefined); } diff --git a/packages/cli/src/databases/postgresdb/migrations/1587669153312-InitialMigration.ts b/packages/cli/src/databases/postgresdb/migrations/1587669153312-InitialMigration.ts index 555015c10d..29a80e434f 100644 --- a/packages/cli/src/databases/postgresdb/migrations/1587669153312-InitialMigration.ts +++ b/packages/cli/src/databases/postgresdb/migrations/1587669153312-InitialMigration.ts @@ -7,29 +7,31 @@ export class InitialMigration1587669153312 implements MigrationInterface { async up(queryRunner: QueryRunner): Promise { let tablePrefix = config.get('database.tablePrefix'); + const tablePrefixIndex = tablePrefix; const schema = config.get('database.postgresdb.schema'); if (schema) { tablePrefix = schema + '.' + tablePrefix; } - await queryRunner.query(`CREATE TABLE IF NOT EXISTS ${tablePrefix}credentials_entity ("id" SERIAL NOT NULL, "name" character varying(128) NOT NULL, "data" text NOT NULL, "type" character varying(32) NOT NULL, "nodesAccess" json NOT NULL, "createdAt" TIMESTAMP NOT NULL, "updatedAt" TIMESTAMP NOT NULL, CONSTRAINT PK_814c3d3c36e8a27fa8edb761b0e PRIMARY KEY ("id"))`, undefined); - await queryRunner.query(`CREATE INDEX IF NOT EXISTS IDX_07fde106c0b471d8cc80a64fc8 ON ${tablePrefix}credentials_entity (type) `, undefined); - await queryRunner.query(`CREATE TABLE IF NOT EXISTS ${tablePrefix}execution_entity ("id" SERIAL NOT NULL, "data" text NOT NULL, "finished" boolean NOT NULL, "mode" character varying NOT NULL, "retryOf" character varying, "retrySuccessId" character varying, "startedAt" TIMESTAMP NOT NULL, "stoppedAt" TIMESTAMP NOT NULL, "workflowData" json NOT NULL, "workflowId" character varying, CONSTRAINT PK_e3e63bbf986767844bbe1166d4e PRIMARY KEY ("id"))`, undefined); - await queryRunner.query(`CREATE INDEX IF NOT EXISTS IDX_c4d999a5e90784e8caccf5589d ON ${tablePrefix}execution_entity ("workflowId") `, undefined); - await queryRunner.query(`CREATE TABLE IF NOT EXISTS ${tablePrefix}workflow_entity ("id" SERIAL NOT NULL, "name" character varying(128) NOT NULL, "active" boolean NOT NULL, "nodes" json NOT NULL, "connections" json NOT NULL, "createdAt" TIMESTAMP NOT NULL, "updatedAt" TIMESTAMP NOT NULL, "settings" json, "staticData" json, CONSTRAINT PK_eded7d72664448da7745d551207 PRIMARY KEY ("id"))`, undefined); + await queryRunner.query(`CREATE TABLE IF NOT EXISTS ${tablePrefix}credentials_entity ("id" SERIAL NOT NULL, "name" character varying(128) NOT NULL, "data" text NOT NULL, "type" character varying(32) NOT NULL, "nodesAccess" json NOT NULL, "createdAt" TIMESTAMP NOT NULL, "updatedAt" TIMESTAMP NOT NULL, CONSTRAINT PK_${tablePrefixIndex}814c3d3c36e8a27fa8edb761b0e PRIMARY KEY ("id"))`, undefined); + await queryRunner.query(`CREATE INDEX IF NOT EXISTS IDX_${tablePrefixIndex}07fde106c0b471d8cc80a64fc8 ON ${tablePrefix}credentials_entity (type) `, undefined); + await queryRunner.query(`CREATE TABLE IF NOT EXISTS ${tablePrefix}execution_entity ("id" SERIAL NOT NULL, "data" text NOT NULL, "finished" boolean NOT NULL, "mode" character varying NOT NULL, "retryOf" character varying, "retrySuccessId" character varying, "startedAt" TIMESTAMP NOT NULL, "stoppedAt" TIMESTAMP NOT NULL, "workflowData" json NOT NULL, "workflowId" character varying, CONSTRAINT PK_${tablePrefixIndex}e3e63bbf986767844bbe1166d4e PRIMARY KEY ("id"))`, undefined); + await queryRunner.query(`CREATE INDEX IF NOT EXISTS IDX_${tablePrefixIndex}c4d999a5e90784e8caccf5589d ON ${tablePrefix}execution_entity ("workflowId") `, undefined); + await queryRunner.query(`CREATE TABLE IF NOT EXISTS ${tablePrefix}workflow_entity ("id" SERIAL NOT NULL, "name" character varying(128) NOT NULL, "active" boolean NOT NULL, "nodes" json NOT NULL, "connections" json NOT NULL, "createdAt" TIMESTAMP NOT NULL, "updatedAt" TIMESTAMP NOT NULL, "settings" json, "staticData" json, CONSTRAINT PK_${tablePrefixIndex}eded7d72664448da7745d551207 PRIMARY KEY ("id"))`, undefined); } async down(queryRunner: QueryRunner): Promise { let tablePrefix = config.get('database.tablePrefix'); + const tablePrefixIndex = tablePrefix; const schema = config.get('database.postgresdb.schema'); if (schema) { tablePrefix = schema + '.' + tablePrefix; } await queryRunner.query(`DROP TABLE ${tablePrefix}workflow_entity`, undefined); - await queryRunner.query(`DROP INDEX IDX_c4d999a5e90784e8caccf5589d`, undefined); + await queryRunner.query(`DROP INDEX IDX_${tablePrefixIndex}c4d999a5e90784e8caccf5589d`, undefined); await queryRunner.query(`DROP TABLE ${tablePrefix}execution_entity`, undefined); - await queryRunner.query(`DROP INDEX IDX_07fde106c0b471d8cc80a64fc8`, undefined); + await queryRunner.query(`DROP INDEX IDX_${tablePrefixIndex}07fde106c0b471d8cc80a64fc8`, undefined); await queryRunner.query(`DROP TABLE ${tablePrefix}credentials_entity`, undefined); } diff --git a/packages/cli/src/databases/sqlite/migrations/1588102412422-InitialMigration.ts b/packages/cli/src/databases/sqlite/migrations/1588102412422-InitialMigration.ts index 31b271d633..c2bb55040e 100644 --- a/packages/cli/src/databases/sqlite/migrations/1588102412422-InitialMigration.ts +++ b/packages/cli/src/databases/sqlite/migrations/1588102412422-InitialMigration.ts @@ -9,9 +9,9 @@ export class InitialMigration1588102412422 implements MigrationInterface { const tablePrefix = config.get('database.tablePrefix'); await queryRunner.query(`CREATE TABLE IF NOT EXISTS "${tablePrefix}credentials_entity" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(128) NOT NULL, "data" text NOT NULL, "type" varchar(32) NOT NULL, "nodesAccess" text NOT NULL, "createdAt" datetime NOT NULL, "updatedAt" datetime NOT NULL)`, undefined); - await queryRunner.query(`CREATE INDEX IF NOT EXISTS "IDX_07fde106c0b471d8cc80a64fc8" ON "${tablePrefix}credentials_entity" ("type") `, undefined); + await queryRunner.query(`CREATE INDEX IF NOT EXISTS "IDX_${tablePrefix}07fde106c0b471d8cc80a64fc8" ON "${tablePrefix}credentials_entity" ("type") `, undefined); await queryRunner.query(`CREATE TABLE IF NOT EXISTS "${tablePrefix}execution_entity" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "data" text NOT NULL, "finished" boolean NOT NULL, "mode" varchar NOT NULL, "retryOf" varchar, "retrySuccessId" varchar, "startedAt" datetime NOT NULL, "stoppedAt" datetime NOT NULL, "workflowData" text NOT NULL, "workflowId" varchar)`, undefined); - await queryRunner.query(`CREATE INDEX IF NOT EXISTS "IDX_c4d999a5e90784e8caccf5589d" ON "${tablePrefix}execution_entity" ("workflowId") `, undefined); + await queryRunner.query(`CREATE INDEX IF NOT EXISTS "IDX_${tablePrefix}c4d999a5e90784e8caccf5589d" ON "${tablePrefix}execution_entity" ("workflowId") `, undefined); await queryRunner.query(`CREATE TABLE IF NOT EXISTS "${tablePrefix}workflow_entity" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(128) NOT NULL, "active" boolean NOT NULL, "nodes" text NOT NULL, "connections" text NOT NULL, "createdAt" datetime NOT NULL, "updatedAt" datetime NOT NULL, "settings" text, "staticData" text)`, undefined); } @@ -19,9 +19,9 @@ export class InitialMigration1588102412422 implements MigrationInterface { const tablePrefix = config.get('database.tablePrefix'); await queryRunner.query(`DROP TABLE "${tablePrefix}workflow_entity"`, undefined); - await queryRunner.query(`DROP INDEX "IDX_c4d999a5e90784e8caccf5589d"`, undefined); + await queryRunner.query(`DROP INDEX "IDX_${tablePrefix}c4d999a5e90784e8caccf5589d"`, undefined); await queryRunner.query(`DROP TABLE "${tablePrefix}execution_entity"`, undefined); - await queryRunner.query(`DROP INDEX "IDX_07fde106c0b471d8cc80a64fc8"`, undefined); + await queryRunner.query(`DROP INDEX "IDX_${tablePrefix}07fde106c0b471d8cc80a64fc8"`, undefined); await queryRunner.query(`DROP TABLE "${tablePrefix}credentials_entity"`, undefined); } From 094614508d691bfa8e2e7008376a00578ade3838 Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Sat, 13 Jun 2020 13:47:49 +0200 Subject: [PATCH 049/241] :zap: Some minor improvements --- .../nodes/Google/Drive/GenericFunctions.ts | 36 +++++++++---------- .../nodes/Google/Drive/GoogleDrive.node.ts | 4 +-- .../nodes-base/nodes/Twitter/Twitter.node.ts | 2 +- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/packages/nodes-base/nodes/Google/Drive/GenericFunctions.ts b/packages/nodes-base/nodes/Google/Drive/GenericFunctions.ts index 9946cd802a..7d15e492ad 100644 --- a/packages/nodes-base/nodes/Google/Drive/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Google/Drive/GenericFunctions.ts @@ -1,6 +1,6 @@ import { OptionsWithUri, - } from 'request'; +} from 'request'; import { IExecuteFunctions, @@ -64,7 +64,7 @@ export async function googleApiRequest(this: IExecuteFunctions | IExecuteSingleF errorMessages = errorMessages.join('|'); - } else if (error.response.body.error.message){ + } else if (error.response.body.error.message) { errorMessages = error.response.body.error.message; } @@ -74,7 +74,7 @@ export async function googleApiRequest(this: IExecuteFunctions | IExecuteSingleF } } -export async function googleApiRequestAllItems(this: IExecuteFunctions | ILoadOptionsFunctions, propertyName: string ,method: string, endpoint: string, body: any = {}, query: IDataObject = {}): Promise { // tslint:disable-line:no-any +export async function googleApiRequestAllItems(this: IExecuteFunctions | ILoadOptionsFunctions, propertyName: string, method: string, endpoint: string, body: any = {}, query: IDataObject = {}): Promise { // tslint:disable-line:no-any const returnData: IDataObject[] = []; @@ -93,7 +93,7 @@ export async function googleApiRequestAllItems(this: IExecuteFunctions | ILoadOp return returnData; } -function getAccessToken(this: IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions, credentials: IDataObject) : Promise { +function getAccessToken(this: IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions, credentials: IDataObject): Promise { //https://developers.google.com/identity/protocols/oauth2/service-account#httprest const scopes = [ @@ -106,25 +106,25 @@ function getAccessToken(this: IExecuteFunctions | IExecuteSingleFunctions | ILoa const signature = jwt.sign( { - 'iss': credentials.email as string, - 'sub': credentials.email as string, - 'scope': scopes.join(' '), - 'aud': `https://oauth2.googleapis.com/token`, - 'iat': now, - 'exp': now + 3600, + 'iss': credentials.email as string, + 'sub': credentials.email as string, + 'scope': scopes.join(' '), + 'aud': `https://oauth2.googleapis.com/token`, + 'iat': now, + 'exp': now + 3600, }, credentials.privateKey as string, { - algorithm: 'RS256', - header: { - 'kid': credentials.privateKey as string, - 'typ': 'JWT', - 'alg': 'RS256', - }, + algorithm: 'RS256', + header: { + 'kid': credentials.privateKey as string, + 'typ': 'JWT', + 'alg': 'RS256', + }, } - ); + ); - const options: OptionsWithUri = { + const options: OptionsWithUri = { headers: { 'Content-Type': 'application/x-www-form-urlencoded', }, diff --git a/packages/nodes-base/nodes/Google/Drive/GoogleDrive.node.ts b/packages/nodes-base/nodes/Google/Drive/GoogleDrive.node.ts index 8ddfd7c1fa..f6291b1045 100644 --- a/packages/nodes-base/nodes/Google/Drive/GoogleDrive.node.ts +++ b/packages/nodes-base/nodes/Google/Drive/GoogleDrive.node.ts @@ -797,7 +797,7 @@ export class GoogleDrive implements INodeType { { name: 'domain', value: 'domain', - description:"All files shared to the user's domain that are searchable", + description: 'All files shared to the user\'s domain that are searchable', }, { name: 'drive', @@ -945,7 +945,7 @@ export class GoogleDrive implements INodeType { queryCorpora = options.corpora as string; } - let driveId : string | undefined; + let driveId: string | undefined; driveId = options.driveId as string; if (driveId === '') { driveId = undefined; diff --git a/packages/nodes-base/nodes/Twitter/Twitter.node.ts b/packages/nodes-base/nodes/Twitter/Twitter.node.ts index 94718973c5..a62f9fd95b 100644 --- a/packages/nodes-base/nodes/Twitter/Twitter.node.ts +++ b/packages/nodes-base/nodes/Twitter/Twitter.node.ts @@ -138,7 +138,7 @@ export class Twitter implements INodeType { const isImage = binaryData[binaryPropertyName].mimeType.includes('image'); if (isImage && isAnimatedWebp) { - throw new Error('Animated .webp images are not supported use .git instead'); + throw new Error('Animated .webp images are not supported use .gif instead'); } if (isImage) { From 8d8d9f256f006575cf90395c75ed9f2e50aa3a62 Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Sat, 13 Jun 2020 16:43:37 +0200 Subject: [PATCH 050/241] :zap: Add OAuth2 support to Mautic-Trigger Node --- .../nodes/Mautic/MauticTrigger.node.ts | 36 ++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/packages/nodes-base/nodes/Mautic/MauticTrigger.node.ts b/packages/nodes-base/nodes/Mautic/MauticTrigger.node.ts index a3ba20f28a..4f844e1188 100644 --- a/packages/nodes-base/nodes/Mautic/MauticTrigger.node.ts +++ b/packages/nodes-base/nodes/Mautic/MauticTrigger.node.ts @@ -38,7 +38,25 @@ export class MauticTrigger implements INodeType { { name: 'mauticApi', required: true, - } + displayOptions: { + show: { + authentication: [ + 'credentials', + ], + }, + }, + }, + { + name: 'mauticOAuth2Api', + required: true, + displayOptions: { + show: { + authentication: [ + 'oAuth2', + ], + }, + }, + }, ], webhooks: [ { @@ -49,6 +67,22 @@ export class MauticTrigger implements INodeType { }, ], properties: [ + { + displayName: 'Authentication', + name: 'authentication', + type: 'options', + options: [ + { + name: 'Credentials', + value: 'credentials', + }, + { + name: 'OAuth2', + value: 'oAuth2', + }, + ], + default: 'credentials', + }, { displayName: 'Events', name: 'events', From 81a29ff16d40368f577940aa1edd2e9e2f530aa0 Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Sat, 13 Jun 2020 16:44:49 +0200 Subject: [PATCH 051/241] :zap: Fix issue with some parameters returning strings --- .../nodes/Google/Sheet/GoogleSheets.node.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/nodes-base/nodes/Google/Sheet/GoogleSheets.node.ts b/packages/nodes-base/nodes/Google/Sheet/GoogleSheets.node.ts index 52fe2fcc84..042eb39105 100644 --- a/packages/nodes-base/nodes/Google/Sheet/GoogleSheets.node.ts +++ b/packages/nodes-base/nodes/Google/Sheet/GoogleSheets.node.ts @@ -622,7 +622,7 @@ export class GoogleSheets implements INodeType { // ---------------------------------- // append // ---------------------------------- - const keyRow = this.getNodeParameter('keyRow', 0) as number; + const keyRow = parseInt(this.getNodeParameter('keyRow', 0) as string, 10); const items = this.getInputData(); @@ -693,8 +693,8 @@ export class GoogleSheets implements INodeType { return []; } - const dataStartRow = this.getNodeParameter('dataStartRow', 0) as number; - const keyRow = this.getNodeParameter('keyRow', 0) as number; + const dataStartRow = parseInt(this.getNodeParameter('dataStartRow', 0) as string, 10); + const keyRow = parseInt(this.getNodeParameter('keyRow', 0) as string, 10); const items = this.getInputData(); @@ -735,8 +735,8 @@ export class GoogleSheets implements INodeType { } ]; } else { - const dataStartRow = this.getNodeParameter('dataStartRow', 0) as number; - const keyRow = this.getNodeParameter('keyRow', 0) as number; + const dataStartRow = parseInt(this.getNodeParameter('dataStartRow', 0) as string, 10); + const keyRow = parseInt(this.getNodeParameter('keyRow', 0) as string, 10); returnData = sheet.structureArrayDataByColumn(sheetData, keyRow, dataStartRow); } @@ -769,8 +769,8 @@ export class GoogleSheets implements INodeType { const data = await sheet.batchUpdate(updateData, valueInputMode); } else { const keyName = this.getNodeParameter('key', 0) as string; - const keyRow = this.getNodeParameter('keyRow', 0) as number; - const dataStartRow = this.getNodeParameter('dataStartRow', 0) as number; + const keyRow = parseInt(this.getNodeParameter('keyRow', 0) as string, 10); + const dataStartRow = parseInt(this.getNodeParameter('dataStartRow', 0) as string, 10); const setData: IDataObject[] = []; items.forEach((item) => { From 0af237e5b18e2b1ca81ecef3f3e64d47ba6bb220 Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Sat, 13 Jun 2020 17:46:13 +0200 Subject: [PATCH 052/241] :zap: Some minor improvements to Monday.com-Node --- .../nodes/MondayCom/BoardItemDescription.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/nodes-base/nodes/MondayCom/BoardItemDescription.ts b/packages/nodes-base/nodes/MondayCom/BoardItemDescription.ts index 4f8cfccecc..9537c32521 100644 --- a/packages/nodes-base/nodes/MondayCom/BoardItemDescription.ts +++ b/packages/nodes-base/nodes/MondayCom/BoardItemDescription.ts @@ -82,10 +82,10 @@ export const boardItemFields = [ ], }, }, - description: `Item's ID` + description: 'The unique identifier of the item to add update to.', }, { - displayName: 'Body', + displayName: 'Update Text', name: 'value', type: 'string', required: true, @@ -100,7 +100,7 @@ export const boardItemFields = [ ], }, }, - description: 'The update text', + description: 'The update text to add.', }, /* -------------------------------------------------------------------------- */ /* boardItem:changeColumnValue */ @@ -142,7 +142,7 @@ export const boardItemFields = [ ], }, }, - description: `Item's ID` + description: 'The unique identifier of the item to to change column of.', }, { displayName: 'Column ID', @@ -184,7 +184,7 @@ export const boardItemFields = [ ], }, }, - description: 'The column value in JSON format.', + description: 'The column value in JSON format. Documentation can be found here.', }, /* -------------------------------------------------------------------------- */ /* boardItem:changeMultipleColumnValues */ @@ -244,7 +244,7 @@ export const boardItemFields = [ ], }, }, - description: 'The column fields and values in JSON format.', + description: 'The column fields and values in JSON format. Documentation can be found here.', typeOptions: { alwaysOpenEditWindow: true, }, From 2af04e775dfdb62086946007bc025e564f0eeef2 Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Sat, 13 Jun 2020 19:22:49 +0200 Subject: [PATCH 053/241] :zap: Add delete option to MongoDb-Node --- .../nodes-base/nodes/MongoDb/MongoDb.node.ts | 13 +++++++- .../nodes/MongoDb/mongo.node.options.ts | 30 ++++++++++++++++++- 2 files changed, 41 insertions(+), 2 deletions(-) diff --git a/packages/nodes-base/nodes/MongoDb/MongoDb.node.ts b/packages/nodes-base/nodes/MongoDb/MongoDb.node.ts index dbd7ab2929..d91a287b88 100644 --- a/packages/nodes-base/nodes/MongoDb/MongoDb.node.ts +++ b/packages/nodes-base/nodes/MongoDb/MongoDb.node.ts @@ -32,7 +32,18 @@ export class MongoDb implements INodeType { const items = this.getInputData(); const operation = this.getNodeParameter('operation', 0) as string; - if (operation === 'find') { + if (operation === 'delete') { + // ---------------------------------- + // delete + // ---------------------------------- + + const { deletedCount } = await mdb + .collection(this.getNodeParameter('collection', 0) as string) + .deleteMany(JSON.parse(this.getNodeParameter('query', 0) as string)); + + returnItems = this.helpers.returnJsonArray([{ deletedCount }]); + + } else if (operation === 'find') { // ---------------------------------- // find // ---------------------------------- diff --git a/packages/nodes-base/nodes/MongoDb/mongo.node.options.ts b/packages/nodes-base/nodes/MongoDb/mongo.node.options.ts index 190ff3de88..953a45a620 100644 --- a/packages/nodes-base/nodes/MongoDb/mongo.node.options.ts +++ b/packages/nodes-base/nodes/MongoDb/mongo.node.options.ts @@ -28,6 +28,11 @@ export const nodeDescription: INodeTypeDescription = { name: 'operation', type: 'options', options: [ + { + name: 'Delete', + value: 'delete', + description: 'Delete documents.' + }, { name: 'Find', value: 'find', @@ -57,13 +62,36 @@ export const nodeDescription: INodeTypeDescription = { description: 'MongoDB Collection' }, + // ---------------------------------- + // delete + // ---------------------------------- + { + displayName: 'Delete Query (JSON format)', + name: 'query', + type: 'json', + typeOptions: { + rows: 5 + }, + displayOptions: { + show: { + operation: [ + 'delete' + ], + }, + }, + default: '{}', + placeholder: `{ "birth": { "$gt": "1950-01-01" } }`, + required: true, + description: 'MongoDB Delete query.' + }, + // ---------------------------------- // find // ---------------------------------- { displayName: 'Query (JSON format)', name: 'query', - type: 'string', + type: 'json', typeOptions: { rows: 5 }, From 1cfdccc311066aa2efecb650ae5ec4687c7ed62b Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Sat, 13 Jun 2020 20:31:57 +0200 Subject: [PATCH 054/241] :bookmark: Release n8n-nodes-base@0.65.0 --- packages/nodes-base/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/nodes-base/package.json b/packages/nodes-base/package.json index 182922492c..8a3c76c261 100644 --- a/packages/nodes-base/package.json +++ b/packages/nodes-base/package.json @@ -1,6 +1,6 @@ { "name": "n8n-nodes-base", - "version": "0.64.1", + "version": "0.65.0", "description": "Base nodes of n8n", "license": "SEE LICENSE IN LICENSE.md", "homepage": "https://n8n.io", From 716716bd1c11111c4952f61c57c5f58c40e5d74f Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Sat, 13 Jun 2020 20:34:22 +0200 Subject: [PATCH 055/241] :arrow_up: Set n8n-nodes-base@0.65.0 on n8n --- packages/cli/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/cli/package.json b/packages/cli/package.json index f3a747bfe2..f221cd59c7 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -102,7 +102,7 @@ "mysql2": "^2.0.1", "n8n-core": "~0.36.0", "n8n-editor-ui": "~0.47.0", - "n8n-nodes-base": "~0.64.1", + "n8n-nodes-base": "~0.65.0", "n8n-workflow": "~0.33.0", "oauth-1.0a": "^2.2.6", "open": "^7.0.0", From 7f74408487664cc9f2aaf11494bb9b4f8f8aaa6b Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Sat, 13 Jun 2020 20:35:00 +0200 Subject: [PATCH 056/241] :bookmark: Release n8n@0.70.0 --- packages/cli/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/cli/package.json b/packages/cli/package.json index f221cd59c7..1628a80b82 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "n8n", - "version": "0.69.1", + "version": "0.70.0", "description": "n8n Workflow Automation Tool", "license": "SEE LICENSE IN LICENSE.md", "homepage": "https://n8n.io", From bc4d407c4427e41259e2b180ec2053424fb97431 Mon Sep 17 00:00:00 2001 From: ricardo Date: Sat, 13 Jun 2020 19:48:24 -0400 Subject: [PATCH 057/241] :sparkles: Improvements to Hubspot-Node --- .../HubspotOAuth2Api.credentials.ts | 26 +- .../nodes/Hubspot/GenericFunctions.ts | 37 +- .../nodes-base/nodes/Hubspot/Hubspot.node.ts | 8 +- .../nodes/Hubspot/HubspotTrigger.node.ts | 61 +--- packages/nodes-base/package.json | 344 +----------------- 5 files changed, 62 insertions(+), 414 deletions(-) diff --git a/packages/nodes-base/credentials/HubspotOAuth2Api.credentials.ts b/packages/nodes-base/credentials/HubspotOAuth2Api.credentials.ts index 775211cbc9..ce18b899df 100644 --- a/packages/nodes-base/credentials/HubspotOAuth2Api.credentials.ts +++ b/packages/nodes-base/credentials/HubspotOAuth2Api.credentials.ts @@ -3,6 +3,12 @@ import { NodePropertyTypes, } from 'n8n-workflow'; +const scopes = [ + 'contacts', + 'forms', + 'tickets', +]; + export class HubspotOAuth2Api implements ICredentialType { name = 'hubspotOAuth2Api'; extends = [ @@ -27,8 +33,8 @@ export class HubspotOAuth2Api implements ICredentialType { { displayName: 'Scope', name: 'scope', - type: 'string' as NodePropertyTypes, - default: '', + type: 'hidden' as NodePropertyTypes, + default: scopes.join(' '), }, { displayName: 'Auth URI Query Parameters', @@ -39,20 +45,8 @@ export class HubspotOAuth2Api implements ICredentialType { { displayName: 'Authentication', name: 'authentication', - type: 'options' as NodePropertyTypes, - options: [ - { - name: 'Body', - value: 'body', - description: 'Send credentials in body', - }, - { - name: 'Header', - value: 'header', - description: 'Send credentials as Basic Auth header', - }, - ], - default: 'header', + type: 'hidden' as NodePropertyTypes, + default: 'body', description: 'Resource to consume.', }, ]; diff --git a/packages/nodes-base/nodes/Hubspot/GenericFunctions.ts b/packages/nodes-base/nodes/Hubspot/GenericFunctions.ts index eb414b82aa..d8d68abfb6 100644 --- a/packages/nodes-base/nodes/Hubspot/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Hubspot/GenericFunctions.ts @@ -14,7 +14,12 @@ import { } from 'n8n-workflow'; export async function hubspotApiRequest(this: IHookFunctions | IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions, method: string, endpoint: string, body: any = {}, query: IDataObject = {}, uri?: string): Promise { // tslint:disable-line:no-any - const authenticationMethod = this.getNodeParameter('authentication', 0); + + let authenticationMethod = this.getNodeParameter('authentication', 0); + + if (this.getNode().type.includes('Trigger')) { + authenticationMethod = 'developerApi'; + } const options: OptionsWithUri = { method, @@ -26,26 +31,40 @@ export async function hubspotApiRequest(this: IHookFunctions | IExecuteFunctions }; try { - if (authenticationMethod === 'accessToken') { + if (authenticationMethod === 'apiKey') { const credentials = this.getCredentials('hubspotApi'); options.qs.hapikey = credentials!.apiKey as string; + return await this.helpers.request!(options); + } else if (authenticationMethod === 'developerApi') { + const credentials = this.getCredentials('hubspotDeveloperApi'); + + options.qs.hapikey = credentials!.apiKey as string; + return await this.helpers.request!(options); } else { // @ts-ignore return await this.helpers.requestOAuth2!.call(this, 'hubspotOAuth2Api', options, 'Bearer'); } } catch (error) { - if (error.response && error.response.body && error.response.body.errors) { - // Try to return the error prettier - let errorMessages = error.response.body.errors; + let errorMessages; - if (errorMessages[0].message) { - // @ts-ignore - errorMessages = errorMessages.map(errorItem => errorItem.message); + if (error.response && error.response.body) { + + if (error.response.body.message) { + + errorMessages = [error.response.body.message]; + + } else if (error.response.body.errors) { + // Try to return the error prettier + errorMessages = error.response.body.errors; + + if (errorMessages[0].message) { + // @ts-ignore + errorMessages = errorMessages.map(errorItem => errorItem.message); + } } - throw new Error(`Hubspot error response [${error.statusCode}]: ${errorMessages.join('|')}`); } diff --git a/packages/nodes-base/nodes/Hubspot/Hubspot.node.ts b/packages/nodes-base/nodes/Hubspot/Hubspot.node.ts index bed4606042..adf01d1ec3 100644 --- a/packages/nodes-base/nodes/Hubspot/Hubspot.node.ts +++ b/packages/nodes-base/nodes/Hubspot/Hubspot.node.ts @@ -76,7 +76,7 @@ export class Hubspot implements INodeType { displayOptions: { show: { authentication: [ - 'accessToken', + 'apiKey', ], }, }, @@ -100,15 +100,15 @@ export class Hubspot implements INodeType { type: 'options', options: [ { - name: 'Access Token', - value: 'accessToken', + name: 'API Key', + value: 'apiKey', }, { name: 'OAuth2', value: 'oAuth2', }, ], - default: 'accessToken', + default: 'apiKey', description: 'The method of authentication.', }, { diff --git a/packages/nodes-base/nodes/Hubspot/HubspotTrigger.node.ts b/packages/nodes-base/nodes/Hubspot/HubspotTrigger.node.ts index 38fd678d58..47b2318b36 100644 --- a/packages/nodes-base/nodes/Hubspot/HubspotTrigger.node.ts +++ b/packages/nodes-base/nodes/Hubspot/HubspotTrigger.node.ts @@ -37,24 +37,6 @@ export class HubspotTrigger implements INodeType { { name: 'hubspotDeveloperApi', required: true, - displayOptions: { - show: { - authentication: [ - 'developerApi', - ], - }, - }, - }, - { - name: 'hubspotOAuth2Api', - required: true, - displayOptions: { - show: { - authentication: [ - 'oAuth2', - ], - }, - }, }, ], webhooks: [ @@ -72,23 +54,6 @@ export class HubspotTrigger implements INodeType { }, ], properties: [ - { - displayName: 'Authentication', - name: 'authentication', - type: 'options', - options: [ - { - name: 'Developer API', - value: 'developerApi', - }, - { - name: 'OAuth2', - value: 'oAuth2', - }, - ], - default: 'developerApi', - description: 'The method of authentication.', - }, { displayName: 'App ID', name: 'appId', @@ -282,15 +247,7 @@ export class HubspotTrigger implements INodeType { async webhook(this: IWebhookFunctions): Promise { - const authenticationMethod = this.getNodeParameter('authentication') as string; - - let credentials : IDataObject; - - if (authenticationMethod === 'hubspotDeveloperApi') { - credentials = this.getCredentials('hubspotDeveloperApi') as IDataObject; - } else { - credentials = this.getCredentials('hubspotOAuth2Api') as IDataObject; - } + const credentials = this.getCredentials('hubspotDeveloperApi') as IDataObject; if (credentials === undefined) { throw new Error('No credentials found!'); @@ -303,12 +260,18 @@ export class HubspotTrigger implements INodeType { if (headerData['x-hubspot-signature'] === undefined) { return {}; } - const hash = `${credentials!.clientSecret}${JSON.stringify(bodyData)}`; - const signature = createHash('sha256').update(hash).digest('hex'); - //@ts-ignore - if (signature !== headerData['x-hubspot-signature']) { - return {}; + + // check signare if client secret is defined + + if (credentials.clientSecret !== '') { + const hash = `${credentials!.clientSecret}${JSON.stringify(bodyData)}`; + const signature = createHash('sha256').update(hash).digest('hex'); + //@ts-ignore + if (signature !== headerData['x-hubspot-signature']) { + return {}; + } } + for (let i = 0; i < bodyData.length; i++) { const subscriptionType = bodyData[i].subscriptionType as string; if (subscriptionType.includes('contact')) { diff --git a/packages/nodes-base/package.json b/packages/nodes-base/package.json index 7b90d3e2a9..5b33ebcc98 100644 --- a/packages/nodes-base/package.json +++ b/packages/nodes-base/package.json @@ -69,6 +69,7 @@ "dist/credentials/HttpHeaderAuth.credentials.js", "dist/credentials/HubspotApi.credentials.js", "dist/credentials/HubspotDeveloperApi.credentials.js", + "dist/credentials/HubspotOAuth2Api.credentials.js", "dist/credentials/HunterApi.credentials.js", "dist/credentials/Imap.credentials.js", "dist/credentials/IntercomApi.credentials.js", @@ -356,340 +357,11 @@ "/dist/", "/node_modules/" ], - "n8n": { - "credentials": [ - "dist/credentials/ActiveCampaignApi.credentials.js", - "dist/credentials/AgileCrmApi.credentials.js", - "dist/credentials/AcuitySchedulingApi.credentials.js", - "dist/credentials/AirtableApi.credentials.js", - "dist/credentials/Amqp.credentials.js", - "dist/credentials/AsanaApi.credentials.js", - "dist/credentials/Aws.credentials.js", - "dist/credentials/AffinityApi.credentials.js", - "dist/credentials/BannerbearApi.credentials.js", - "dist/credentials/BitbucketApi.credentials.js", - "dist/credentials/BitlyApi.credentials.js", - "dist/credentials/ChargebeeApi.credentials.js", - "dist/credentials/ClearbitApi.credentials.js", - "dist/credentials/ClickUpApi.credentials.js", - "dist/credentials/ClockifyApi.credentials.js", - "dist/credentials/CockpitApi.credentials.js", - "dist/credentials/CodaApi.credentials.js", - "dist/credentials/CopperApi.credentials.js", - "dist/credentials/CalendlyApi.credentials.js", - "dist/credentials/DisqusApi.credentials.js", - "dist/credentials/DriftApi.credentials.js", - "dist/credentials/DropboxApi.credentials.js", - "dist/credentials/EventbriteApi.credentials.js", - "dist/credentials/FacebookGraphApi.credentials.js", - "dist/credentials/FreshdeskApi.credentials.js", - "dist/credentials/FileMaker.credentials.js", - "dist/credentials/FlowApi.credentials.js", - "dist/credentials/GithubApi.credentials.js", - "dist/credentials/GithubOAuth2Api.credentials.js", - "dist/credentials/GitlabApi.credentials.js", - "dist/credentials/GoogleApi.credentials.js", - "dist/credentials/GoogleCalendarOAuth2Api.credentials.js", - "dist/credentials/GoogleOAuth2Api.credentials.js", - "dist/credentials/GoogleSheetsOAuth2Api.credentials.js", - "dist/credentials/GumroadApi.credentials.js", - "dist/credentials/HarvestApi.credentials.js", - "dist/credentials/HelpScoutOAuth2Api.credentials.js", - "dist/credentials/HttpBasicAuth.credentials.js", - "dist/credentials/HttpDigestAuth.credentials.js", - "dist/credentials/HttpHeaderAuth.credentials.js", - "dist/credentials/HubspotApi.credentials.js", - "dist/credentials/HubspotDeveloperApi.credentials.js", - "dist/credentials/HubspotOAuth2Api.credentials.js", - "dist/credentials/HunterApi.credentials.js", - "dist/credentials/Imap.credentials.js", - "dist/credentials/IntercomApi.credentials.js", - "dist/credentials/InvoiceNinjaApi.credentials.js", - "dist/credentials/JiraSoftwareCloudApi.credentials.js", - "dist/credentials/JiraSoftwareServerApi.credentials.js", - "dist/credentials/JotFormApi.credentials.js", - "dist/credentials/KeapOAuth2Api.credentials.js", - "dist/credentials/LinkFishApi.credentials.js", - "dist/credentials/MailchimpApi.credentials.js", - "dist/credentials/MailgunApi.credentials.js", - "dist/credentials/MailjetEmailApi.credentials.js", - "dist/credentials/MailjetSmsApi.credentials.js", - "dist/credentials/MandrillApi.credentials.js", - "dist/credentials/MattermostApi.credentials.js", - "dist/credentials/MauticApi.credentials.js", - "dist/credentials/MicrosoftExcelOAuth2Api.credentials.js", - "dist/credentials/MicrosoftOAuth2Api.credentials.js", - "dist/credentials/MicrosoftOneDriveOAuth2Api.credentials.js", - "dist/credentials/MoceanApi.credentials.js", - "dist/credentials/MondayComApi.credentials.js", - "dist/credentials/MongoDb.credentials.js", - "dist/credentials/Msg91Api.credentials.js", - "dist/credentials/MySql.credentials.js", - "dist/credentials/NextCloudApi.credentials.js", - "dist/credentials/OAuth1Api.credentials.js", - "dist/credentials/OAuth2Api.credentials.js", - "dist/credentials/OpenWeatherMapApi.credentials.js", - "dist/credentials/PagerDutyApi.credentials.js", - "dist/credentials/PayPalApi.credentials.js", - "dist/credentials/PipedriveApi.credentials.js", - "dist/credentials/Postgres.credentials.js", - "dist/credentials/Redis.credentials.js", - "dist/credentials/RocketchatApi.credentials.js", - "dist/credentials/RundeckApi.credentials.js", - "dist/credentials/ShopifyApi.credentials.js", - "dist/credentials/SalesforceOAuth2Api.credentials.js", - "dist/credentials/SlackApi.credentials.js", - "dist/credentials/SlackOAuth2Api.credentials.js", - "dist/credentials/Sms77Api.credentials.js", - "dist/credentials/Smtp.credentials.js", - "dist/credentials/StripeApi.credentials.js", - "dist/credentials/SalesmateApi.credentials.js", - "dist/credentials/SegmentApi.credentials.js", - "dist/credentials/SurveyMonkeyApi.credentials.js", - "dist/credentials/TelegramApi.credentials.js", - "dist/credentials/TodoistApi.credentials.js", - "dist/credentials/TrelloApi.credentials.js", - "dist/credentials/TwilioApi.credentials.js", - "dist/credentials/TwitterOAuth1Api.credentials.js", - "dist/credentials/TypeformApi.credentials.js", - "dist/credentials/TogglApi.credentials.js", - "dist/credentials/UpleadApi.credentials.js", - "dist/credentials/VeroApi.credentials.js", - "dist/credentials/WebflowApi.credentials.js", - "dist/credentials/WooCommerceApi.credentials.js", - "dist/credentials/WordpressApi.credentials.js", - "dist/credentials/ZendeskApi.credentials.js", - "dist/credentials/ZohoOAuth2Api.credentials.js", - "dist/credentials/ZulipApi.credentials.js" - ], - "nodes": [ - "dist/nodes/ActiveCampaign/ActiveCampaign.node.js", - "dist/nodes/ActiveCampaign/ActiveCampaignTrigger.node.js", - "dist/nodes/AgileCrm/AgileCrm.node.js", - "dist/nodes/Airtable/Airtable.node.js", - "dist/nodes/AcuityScheduling/AcuitySchedulingTrigger.node.js", - "dist/nodes/Amqp/Amqp.node.js", - "dist/nodes/Amqp/AmqpTrigger.node.js", - "dist/nodes/Asana/Asana.node.js", - "dist/nodes/Asana/AsanaTrigger.node.js", - "dist/nodes/Affinity/Affinity.node.js", - "dist/nodes/Affinity/AffinityTrigger.node.js", - "dist/nodes/Aws/AwsLambda.node.js", - "dist/nodes/Aws/S3/AwsS3.node.js", - "dist/nodes/Aws/AwsSes.node.js", - "dist/nodes/Aws/AwsSns.node.js", - "dist/nodes/Aws/AwsSnsTrigger.node.js", - "dist/nodes/Bannerbear/Bannerbear.node.js", - "dist/nodes/Bitbucket/BitbucketTrigger.node.js", - "dist/nodes/Bitly/Bitly.node.js", - "dist/nodes/Calendly/CalendlyTrigger.node.js", - "dist/nodes/Chargebee/Chargebee.node.js", - "dist/nodes/Chargebee/ChargebeeTrigger.node.js", - "dist/nodes/Clearbit/Clearbit.node.js", - "dist/nodes/ClickUp/ClickUp.node.js", - "dist/nodes/ClickUp/ClickUpTrigger.node.js", - "dist/nodes/Clockify/ClockifyTrigger.node.js", - "dist/nodes/Cockpit/Cockpit.node.js", - "dist/nodes/Coda/Coda.node.js", - "dist/nodes/Copper/CopperTrigger.node.js", - "dist/nodes/Cron.node.js", - "dist/nodes/Crypto.node.js", - "dist/nodes/DateTime.node.js", - "dist/nodes/Discord/Discord.node.js", - "dist/nodes/Disqus/Disqus.node.js", - "dist/nodes/Drift/Drift.node.js", - "dist/nodes/Dropbox/Dropbox.node.js", - "dist/nodes/EditImage.node.js", - "dist/nodes/EmailReadImap.node.js", - "dist/nodes/EmailSend.node.js", - "dist/nodes/ErrorTrigger.node.js", - "dist/nodes/Eventbrite/EventbriteTrigger.node.js", - "dist/nodes/ExecuteCommand.node.js", - "dist/nodes/ExecuteWorkflow.node.js", - "dist/nodes/Facebook/FacebookGraphApi.node.js", - "dist/nodes/FileMaker/FileMaker.node.js", - "dist/nodes/Freshdesk/Freshdesk.node.js", - "dist/nodes/Flow/Flow.node.js", - "dist/nodes/Flow/FlowTrigger.node.js", - "dist/nodes/Function.node.js", - "dist/nodes/FunctionItem.node.js", - "dist/nodes/Github/Github.node.js", - "dist/nodes/Github/GithubTrigger.node.js", - "dist/nodes/Gitlab/Gitlab.node.js", - "dist/nodes/Gitlab/GitlabTrigger.node.js", - "dist/nodes/Google/Calendar/GoogleCalendar.node.js", - "dist/nodes/Google/Drive/GoogleDrive.node.js", - "dist/nodes/Google/Sheet/GoogleSheets.node.js", - "dist/nodes/GraphQL/GraphQL.node.js", - "dist/nodes/Gumroad/GumroadTrigger.node.js", - "dist/nodes/Harvest/Harvest.node.js", - "dist/nodes/HelpScout/HelpScout.node.js", - "dist/nodes/HelpScout/HelpScoutTrigger.node.js", - "dist/nodes/HtmlExtract/HtmlExtract.node.js", - "dist/nodes/HttpRequest.node.js", - "dist/nodes/Hubspot/Hubspot.node.js", - "dist/nodes/Hubspot/HubspotTrigger.node.js", - "dist/nodes/Hunter/Hunter.node.js", - "dist/nodes/If.node.js", - "dist/nodes/Intercom/Intercom.node.js", - "dist/nodes/Interval.node.js", - "dist/nodes/InvoiceNinja/InvoiceNinja.node.js", - "dist/nodes/InvoiceNinja/InvoiceNinjaTrigger.node.js", - "dist/nodes/Jira/Jira.node.js", - "dist/nodes/JotForm/JotFormTrigger.node.js", - "dist/nodes/Keap/Keap.node.js", - "dist/nodes/Keap/KeapTrigger.node.js", - "dist/nodes/LinkFish/LinkFish.node.js", - "dist/nodes/Mailchimp/Mailchimp.node.js", - "dist/nodes/Mailchimp/MailchimpTrigger.node.js", - "dist/nodes/Mailgun/Mailgun.node.js", - "dist/nodes/Mailjet/Mailjet.node.js", - "dist/nodes/Mailjet/MailjetTrigger.node.js", - "dist/nodes/Mandrill/Mandrill.node.js", - "dist/nodes/Mattermost/Mattermost.node.js", - "dist/nodes/Mautic/Mautic.node.js", - "dist/nodes/Mautic/MauticTrigger.node.js", - "dist/nodes/Merge.node.js", - "dist/nodes/Microsoft/Excel/MicrosoftExcel.node.js", - "dist/nodes/Microsoft/OneDrive/MicrosoftOneDrive.node.js", - "dist/nodes/MoveBinaryData.node.js", - "dist/nodes/Mocean/Mocean.node.js", - "dist/nodes/MondayCom/MondayCom.node.js", - "dist/nodes/MongoDb/MongoDb.node.js", - "dist/nodes/MoveBinaryData.node.js", - "dist/nodes/Msg91/Msg91.node.js", - "dist/nodes/MySql/MySql.node.js", - "dist/nodes/NextCloud/NextCloud.node.js", - "dist/nodes/NoOp.node.js", - "dist/nodes/OpenWeatherMap.node.js", - "dist/nodes/PagerDuty/PagerDuty.node.js", - "dist/nodes/PayPal/PayPal.node.js", - "dist/nodes/PayPal/PayPalTrigger.node.js", - "dist/nodes/Pipedrive/Pipedrive.node.js", - "dist/nodes/Pipedrive/PipedriveTrigger.node.js", - "dist/nodes/Postgres/Postgres.node.js", - "dist/nodes/ReadBinaryFile.node.js", - "dist/nodes/ReadBinaryFiles.node.js", - "dist/nodes/ReadPdf.node.js", - "dist/nodes/Redis/Redis.node.js", - "dist/nodes/RenameKeys.node.js", - "dist/nodes/Rocketchat/Rocketchat.node.js", - "dist/nodes/RssFeedRead.node.js", - "dist/nodes/Rundeck/Rundeck.node.js", - "dist/nodes/Salesforce/Salesforce.node.js", - "dist/nodes/Set.node.js", - "dist/nodes/Shopify/Shopify.node.js", - "dist/nodes/Shopify/ShopifyTrigger.node.js", - "dist/nodes/Slack/Slack.node.js", - "dist/nodes/Sms77/Sms77.node.js", - "dist/nodes/SplitInBatches.node.js", - "dist/nodes/SpreadsheetFile.node.js", - "dist/nodes/SseTrigger.node.js", - "dist/nodes/Start.node.js", - "dist/nodes/Stripe/StripeTrigger.node.js", - "dist/nodes/Switch.node.js", - "dist/nodes/Salesmate/Salesmate.node.js", - "dist/nodes/Segment/Segment.node.js", - "dist/nodes/SurveyMonkey/SurveyMonkeyTrigger.node.js", - "dist/nodes/Telegram/Telegram.node.js", - "dist/nodes/Telegram/TelegramTrigger.node.js", - "dist/nodes/Todoist/Todoist.node.js", - "dist/nodes/Toggl/TogglTrigger.node.js", - "dist/nodes/Trello/Trello.node.js", - "dist/nodes/Trello/TrelloTrigger.node.js", - "dist/nodes/Twilio/Twilio.node.js", - "dist/nodes/Twitter/Twitter.node.js", - "dist/nodes/Typeform/TypeformTrigger.node.js", - "dist/nodes/Uplead/Uplead.node.js", - "dist/nodes/Vero/Vero.node.js", - "dist/nodes/Webflow/WebflowTrigger.node.js", - "dist/nodes/Webhook.node.js", - "dist/nodes/Wordpress/Wordpress.node.js", - "dist/nodes/WooCommerce/WooCommerce.node.js", - "dist/nodes/WooCommerce/WooCommerceTrigger.node.js", - "dist/nodes/WriteBinaryFile.node.js", - "dist/nodes/Xml.node.js", - "dist/nodes/Zendesk/Zendesk.node.js", - "dist/nodes/Zendesk/ZendeskTrigger.node.js", - "dist/nodes/Zoho/ZohoCrm.node.js", - "dist/nodes/Zulip/Zulip.node.js" - ] - }, - "devDependencies": { - "@types/aws4": "^1.5.1", - "@types/basic-auth": "^1.1.2", - "@types/cheerio": "^0.22.15", - "@types/cron": "^1.6.1", - "@types/eventsource": "^1.1.2", - "@types/express": "^4.16.1", - "@types/formidable": "^1.0.31", - "@types/gm": "^1.18.2", - "@types/imap-simple": "^4.2.0", - "@types/jest": "^24.0.18", - "@types/lodash.set": "^4.3.6", - "@types/moment-timezone": "^0.5.12", - "@types/mongodb": "^3.5.4", - "@types/node": "^10.10.1", - "@types/nodemailer": "^6.4.0", - "@types/redis": "^2.8.11", - "@types/request-promise-native": "~1.0.15", - "@types/uuid": "^3.4.6", - "@types/xml2js": "^0.4.3", - "gulp": "^4.0.0", - "jest": "^24.9.0", - "n8n-workflow": "~0.31.0", - "ts-jest": "^24.0.2", - "tslint": "^5.17.0", - "typescript": "~3.7.4" - }, - "dependencies": { - "aws4": "^1.8.0", - "basic-auth": "^2.0.1", - "change-case": "^4.1.1", - "cheerio": "^1.0.0-rc.3", - "cron": "^1.7.2", - "eventsource": "^1.0.7", - "formidable": "^1.2.1", - "glob-promise": "^3.4.0", - "gm": "^1.23.1", - "googleapis": "~50.0.0", - "imap-simple": "^4.3.0", - "jsonwebtoken": "^8.5.1", - "lodash.get": "^4.4.2", - "lodash.set": "^4.3.2", - "lodash.unset": "^4.5.2", - "moment": "2.24.0", - "moment-timezone": "^0.5.28", - "mongodb": "^3.5.5", - "mysql2": "^2.0.1", - "n8n-core": "~0.34.0", - "nodemailer": "^6.4.6", - "pdf-parse": "^1.1.1", - "pg-promise": "^9.0.3", - "redis": "^2.8.0", - "request": "^2.88.2", - "rhea": "^1.0.11", - "rss-parser": "^3.7.0", - "uuid": "^3.4.0", - "vm2": "^3.6.10", - "xlsx": "^0.14.3", - "xml2js": "^0.4.22" - }, - "jest": { - "transform": { - "^.+\\.tsx?$": "ts-jest" - }, - "testURL": "http://localhost/", - "testRegex": "(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$", - "testPathIgnorePatterns": [ - "/dist/", - "/node_modules/" - ], - "moduleFileExtensions": [ - "ts", - "tsx", - "js", - "json" - ] - } + "moduleFileExtensions": [ + "ts", + "tsx", + "js", + "json" + ] + } } From a23b0e6f9ca6509f7e4022426fb631b107cabeda Mon Sep 17 00:00:00 2001 From: ricardo Date: Sat, 13 Jun 2020 22:29:21 -0400 Subject: [PATCH 058/241] :zap: Small fix --- packages/nodes-base/package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/nodes-base/package.json b/packages/nodes-base/package.json index 5b33ebcc98..f762717e76 100644 --- a/packages/nodes-base/package.json +++ b/packages/nodes-base/package.json @@ -80,6 +80,7 @@ "dist/credentials/KeapOAuth2Api.credentials.js", "dist/credentials/LinkFishApi.credentials.js", "dist/credentials/MailchimpApi.credentials.js", + "dist/credentials/MailchimpOAuth2Api.credentials.js", "dist/credentials/MailgunApi.credentials.js", "dist/credentials/MailjetEmailApi.credentials.js", "dist/credentials/MailjetSmsApi.credentials.js", From e859b27a891d2040cba73f65d7384c06daebe699 Mon Sep 17 00:00:00 2001 From: ricardo Date: Sat, 13 Jun 2020 22:37:03 -0400 Subject: [PATCH 059/241] :zap: Improvements to Mailchimp-Node --- .../MailchimpOAuth2Api.credentials.ts | 14 ------- .../nodes/Mailchimp/GenericFunctions.ts | 39 +++++++++++++------ .../nodes/Mailchimp/Mailchimp.node.ts | 10 ++--- .../nodes/Mailchimp/MailchimpTrigger.node.ts | 8 ++-- 4 files changed, 36 insertions(+), 35 deletions(-) diff --git a/packages/nodes-base/credentials/MailchimpOAuth2Api.credentials.ts b/packages/nodes-base/credentials/MailchimpOAuth2Api.credentials.ts index 0a0efc7091..886424b6a6 100644 --- a/packages/nodes-base/credentials/MailchimpOAuth2Api.credentials.ts +++ b/packages/nodes-base/credentials/MailchimpOAuth2Api.credentials.ts @@ -11,20 +11,6 @@ export class MailchimpOAuth2Api implements ICredentialType { ]; displayName = 'Mailchimp OAuth2 API'; properties = [ - { - displayName: 'Mailchimp Server', - name: 'server', - type: 'string' as NodePropertyTypes, - default: 'https://login.mailchimp.com/', - description: 'The server to connect to.', - }, - { - displayName: 'Datacenter', - name: 'dataCenter', - type: 'string' as NodePropertyTypes, - default: 'us10', - description: 'Datacenter that your Mailchimp application is hosted on. Found in the URL of your Mailchimp dashboard.', - }, { displayName: 'Authorization URL', name: 'authUrl', diff --git a/packages/nodes-base/nodes/Mailchimp/GenericFunctions.ts b/packages/nodes-base/nodes/Mailchimp/GenericFunctions.ts index 3d66c2d8ab..59362b50d6 100644 --- a/packages/nodes-base/nodes/Mailchimp/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Mailchimp/GenericFunctions.ts @@ -34,33 +34,34 @@ export async function mailchimpApiRequest(this: IHookFunctions | IExecuteFunctio } try { - if (authenticationMethod === 'accessToken') { + if (authenticationMethod === 'apiKey') { const credentials = this.getCredentials('mailchimpApi'); - + if (credentials === undefined) { throw new Error('No credentials got returned!'); } - + options.headers = Object.assign({}, headers, { Authorization: `apikey ${credentials.apiKey}` }); - + if (!(credentials.apiKey as string).includes('-')) { throw new Error('The API key is not valid!'); } - + const datacenter = (credentials.apiKey as string).split('-').pop(); options.url = `https://${datacenter}.${host}${endpoint}`; - + return await this.helpers.request!(options); } else { - const credentials = this.getCredentials('mailchimpOAuth2Api'); - const datacenter = credentials!.dataCenter; - - options.url = `https://${datacenter}.${host}${endpoint}`; + const credentials = this.getCredentials('mailchimpOAuth2Api') as IDataObject; + + const { api_endpoint } = await getMetadata.call(this, credentials.oauthTokenData as IDataObject); + + options.url = `${api_endpoint}/3.0${endpoint}`; //@ts-ignore - return await this.helpers.requestOAuth2!.call(this, 'mailchimpOAuth2Api', options, 'bearer'); + return await this.helpers.requestOAuth2!.call(this, 'mailchimpOAuth2Api', options, 'Bearer'); } } catch (error) { - if (error.response.body && error.response.body.detail) { + if (error.respose && error.response.body && error.response.body.detail) { throw new Error(`Mailchimp Error response [${error.statusCode}]: ${error.response.body.detail}`); } throw error; @@ -96,3 +97,17 @@ export function validateJSON(json: string | undefined): any { // tslint:disable- } return result; } + +function getMetadata(this: IHookFunctions | IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions, oauthTokenData: IDataObject) { + const credentials = this.getCredentials('mailchimpOAuth2Api') as IDataObject; + const options: OptionsWithUrl = { + headers: { + 'Accept': 'application/json', + 'Authorization': `OAuth ${oauthTokenData.access_token}`, + }, + method: 'GET', + url: credentials.metadataUrl as string, + json: true, + }; + return this.helpers.request!(options); +} diff --git a/packages/nodes-base/nodes/Mailchimp/Mailchimp.node.ts b/packages/nodes-base/nodes/Mailchimp/Mailchimp.node.ts index 3b8d17c302..25dbeb9984 100644 --- a/packages/nodes-base/nodes/Mailchimp/Mailchimp.node.ts +++ b/packages/nodes-base/nodes/Mailchimp/Mailchimp.node.ts @@ -72,7 +72,7 @@ export class Mailchimp implements INodeType { displayOptions: { show: { authentication: [ - 'accessToken', + 'apiKey', ], }, }, @@ -96,15 +96,15 @@ export class Mailchimp implements INodeType { type: 'options', options: [ { - name: 'Access Token', - value: 'accessToken', + name: 'API Key', + value: 'apiKey', }, { name: 'OAuth2', value: 'oAuth2', }, ], - default: 'accessToken', + default: 'apiKey', description: 'Method of authentication.', }, { @@ -1571,7 +1571,7 @@ export class Mailchimp implements INodeType { responseData = { success: true }; } } - + if (Array.isArray(responseData)) { returnData.push.apply(returnData, responseData as IDataObject[]); } else { diff --git a/packages/nodes-base/nodes/Mailchimp/MailchimpTrigger.node.ts b/packages/nodes-base/nodes/Mailchimp/MailchimpTrigger.node.ts index 67e07ad6bd..9fbd80a0f5 100644 --- a/packages/nodes-base/nodes/Mailchimp/MailchimpTrigger.node.ts +++ b/packages/nodes-base/nodes/Mailchimp/MailchimpTrigger.node.ts @@ -36,7 +36,7 @@ export class MailchimpTrigger implements INodeType { displayOptions: { show: { authentication: [ - 'accessToken', + 'apiKey', ], }, }, @@ -74,15 +74,15 @@ export class MailchimpTrigger implements INodeType { type: 'options', options: [ { - name: 'Access Token', - value: 'accessToken', + name: 'API Key', + value: 'apiKey', }, { name: 'OAuth2', value: 'oAuth2', }, ], - default: 'accessToken', + default: 'apiKey', description: 'Method of authentication.', }, { From 8f15c93e43847580b07f99686c3544fa5d9fe0d3 Mon Sep 17 00:00:00 2001 From: ricardo Date: Sun, 14 Jun 2020 16:27:28 -0400 Subject: [PATCH 060/241] :zap: Small fix --- packages/nodes-base/package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/nodes-base/package.json b/packages/nodes-base/package.json index f762717e76..8aa05c1f5f 100644 --- a/packages/nodes-base/package.json +++ b/packages/nodes-base/package.json @@ -118,6 +118,7 @@ "dist/credentials/SalesmateApi.credentials.js", "dist/credentials/SegmentApi.credentials.js", "dist/credentials/SurveyMonkeyApi.credentials.js", + "dist/credentials/SurveyMonkeyOAuth2Api.credentials.js", "dist/credentials/TelegramApi.credentials.js", "dist/credentials/TodoistApi.credentials.js", "dist/credentials/TrelloApi.credentials.js", From 0f6b82249b49647d2a3bf55973b7a643a2f4584a Mon Sep 17 00:00:00 2001 From: ricardo Date: Sun, 14 Jun 2020 16:30:24 -0400 Subject: [PATCH 061/241] :zap: Improvements to SurveyMonkey-Node --- .../credentials/SurveyMonkeyOAuth2Api.credentials.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/packages/nodes-base/credentials/SurveyMonkeyOAuth2Api.credentials.ts b/packages/nodes-base/credentials/SurveyMonkeyOAuth2Api.credentials.ts index cbeafdf753..26949d879f 100644 --- a/packages/nodes-base/credentials/SurveyMonkeyOAuth2Api.credentials.ts +++ b/packages/nodes-base/credentials/SurveyMonkeyOAuth2Api.credentials.ts @@ -3,6 +3,14 @@ import { NodePropertyTypes, } from 'n8n-workflow'; +const scopes = [ + 'surveys_read', + 'collectors_read', + 'responses_read', + 'responses_read_detail', + 'webhooks_write', + 'webhooks_read', +]; export class SurveyMonkeyOAuth2Api implements ICredentialType { name = 'surveyMonkeyOAuth2Api'; @@ -28,8 +36,8 @@ export class SurveyMonkeyOAuth2Api implements ICredentialType { { displayName: 'Scope', name: 'scope', - type: 'string' as NodePropertyTypes, - default: 'surveys_read,surveys_write,responses_read,responses_write,webhooks_read,webhooks_write', + type: 'hidden' as NodePropertyTypes, + default: scopes.join(','), }, { displayName: 'Auth URI Query Parameters', From 15a9ff25c4abc64e87ae1a6cfbb48accdcaaaa4b Mon Sep 17 00:00:00 2001 From: ricardo Date: Sun, 14 Jun 2020 17:47:28 -0400 Subject: [PATCH 062/241] :zap: Small improvement --- packages/nodes-base/package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/nodes-base/package.json b/packages/nodes-base/package.json index 8aa05c1f5f..7566f70f06 100644 --- a/packages/nodes-base/package.json +++ b/packages/nodes-base/package.json @@ -132,6 +132,7 @@ "dist/credentials/WooCommerceApi.credentials.js", "dist/credentials/WordpressApi.credentials.js", "dist/credentials/ZendeskApi.credentials.js", + "dist/credentials/ZendeskOAuth2Api.credentials.js", "dist/credentials/ZohoOAuth2Api.credentials.js", "dist/credentials/ZulipApi.credentials.js" ], From 8d778bf06ec860aec89610b05c173ebf2eb0457d Mon Sep 17 00:00:00 2001 From: ricardo Date: Sun, 14 Jun 2020 18:04:22 -0400 Subject: [PATCH 063/241] :zap: Improvements to Zendesk-Node --- .../credentials/ZendeskOAuth2Api.credentials.ts | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/packages/nodes-base/credentials/ZendeskOAuth2Api.credentials.ts b/packages/nodes-base/credentials/ZendeskOAuth2Api.credentials.ts index b530404a0d..06428456e6 100644 --- a/packages/nodes-base/credentials/ZendeskOAuth2Api.credentials.ts +++ b/packages/nodes-base/credentials/ZendeskOAuth2Api.credentials.ts @@ -3,6 +3,10 @@ import { NodePropertyTypes, } from 'n8n-workflow'; +const scopes = [ + 'read', + 'write', +]; export class ZendeskOAuth2Api implements ICredentialType { name = 'zendeskOAuth2Api'; @@ -15,7 +19,8 @@ export class ZendeskOAuth2Api implements ICredentialType { displayName: 'Subdomain', name: 'subdomain', type: 'string' as NodePropertyTypes, - default: 'n8n', + default: '', + placeholder: 'n8n', description: 'The subdomain of your Zendesk work environment.', required: true, }, @@ -52,8 +57,8 @@ export class ZendeskOAuth2Api implements ICredentialType { { displayName: 'Scope', name: 'scope', - type: 'string' as NodePropertyTypes, - default: 'write read', + type: 'hidden' as NodePropertyTypes, + default: scopes.join(' '), }, { displayName: 'Auth URI Query Parameters', From 2ef5c8c83645933fabd74bc708ec352416fc05db Mon Sep 17 00:00:00 2001 From: ricardo Date: Sun, 14 Jun 2020 18:19:35 -0400 Subject: [PATCH 064/241] :zap: Small improvement --- packages/nodes-base/nodes/Zendesk/GenericFunctions.ts | 2 +- packages/nodes-base/nodes/Zendesk/Zendesk.node.ts | 8 ++++---- packages/nodes-base/nodes/Zendesk/ZendeskTrigger.node.ts | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/packages/nodes-base/nodes/Zendesk/GenericFunctions.ts b/packages/nodes-base/nodes/Zendesk/GenericFunctions.ts index 007741813f..271c10259f 100644 --- a/packages/nodes-base/nodes/Zendesk/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Zendesk/GenericFunctions.ts @@ -32,7 +32,7 @@ export async function zendeskApiRequest(this: IHookFunctions | IExecuteFunctions } try { - if (authenticationMethod === 'accessToken') { + if (authenticationMethod === 'apiToken') { const credentials = this.getCredentials('zendeskApi'); if (credentials === undefined) { diff --git a/packages/nodes-base/nodes/Zendesk/Zendesk.node.ts b/packages/nodes-base/nodes/Zendesk/Zendesk.node.ts index d0ea357b5a..d0c72c335f 100644 --- a/packages/nodes-base/nodes/Zendesk/Zendesk.node.ts +++ b/packages/nodes-base/nodes/Zendesk/Zendesk.node.ts @@ -55,7 +55,7 @@ export class Zendesk implements INodeType { displayOptions: { show: { authentication: [ - 'accessToken', + 'apiToken', ], }, }, @@ -79,15 +79,15 @@ export class Zendesk implements INodeType { type: 'options', options: [ { - name: 'Access Token', - value: 'accessToken', + name: 'API Token', + value: 'apiToken', }, { name: 'OAuth2', value: 'oAuth2', }, ], - default: 'accessToken', + default: 'apiToken', description: 'The resource to operate on.', }, { diff --git a/packages/nodes-base/nodes/Zendesk/ZendeskTrigger.node.ts b/packages/nodes-base/nodes/Zendesk/ZendeskTrigger.node.ts index a5e1350fed..421d9e4b32 100644 --- a/packages/nodes-base/nodes/Zendesk/ZendeskTrigger.node.ts +++ b/packages/nodes-base/nodes/Zendesk/ZendeskTrigger.node.ts @@ -45,7 +45,7 @@ export class ZendeskTrigger implements INodeType { displayOptions: { show: { authentication: [ - 'accessToken', + 'apiToken', ], }, }, @@ -77,15 +77,15 @@ export class ZendeskTrigger implements INodeType { type: 'options', options: [ { - name: 'Access Token', - value: 'accessToken', + name: 'API Token', + value: 'apiToken', }, { name: 'OAuth2', value: 'oAuth2', }, ], - default: 'accessToken', + default: 'apiToken', description: 'The resource to operate on.', }, { From a8a2260c586e68d0cf5393b1d51bda404f24dfa0 Mon Sep 17 00:00:00 2001 From: ricardo Date: Sun, 14 Jun 2020 19:30:05 -0400 Subject: [PATCH 065/241] :zap: Small fix --- packages/nodes-base/package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/nodes-base/package.json b/packages/nodes-base/package.json index 7566f70f06..9cb463d8fd 100644 --- a/packages/nodes-base/package.json +++ b/packages/nodes-base/package.json @@ -125,6 +125,7 @@ "dist/credentials/TwilioApi.credentials.js", "dist/credentials/TwitterOAuth1Api.credentials.js", "dist/credentials/TypeformApi.credentials.js", + "dist/credentials/TypeformOAuth2Api.credentials.js", "dist/credentials/TogglApi.credentials.js", "dist/credentials/UpleadApi.credentials.js", "dist/credentials/VeroApi.credentials.js", From c4bbb961a2b41709d525acff7b54e29e1a034596 Mon Sep 17 00:00:00 2001 From: ricardo Date: Sun, 14 Jun 2020 19:31:45 -0400 Subject: [PATCH 066/241] :zap: Improvements to Typeform-Node --- .../credentials/TypeformOAuth2Api.credentials.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/nodes-base/credentials/TypeformOAuth2Api.credentials.ts b/packages/nodes-base/credentials/TypeformOAuth2Api.credentials.ts index 6e95391577..a876e87ed0 100644 --- a/packages/nodes-base/credentials/TypeformOAuth2Api.credentials.ts +++ b/packages/nodes-base/credentials/TypeformOAuth2Api.credentials.ts @@ -3,6 +3,12 @@ import { NodePropertyTypes, } from 'n8n-workflow'; +const scopes = [ + 'webhooks:write', + 'webhooks:read', + 'forms:read', +]; + export class TypeformOAuth2Api implements ICredentialType { name = 'typeformOAuth2Api'; @@ -28,8 +34,8 @@ export class TypeformOAuth2Api implements ICredentialType { { displayName: 'Scope', name: 'scope', - type: 'string' as NodePropertyTypes, - default: 'webhooks:write,webhooks:read,forms:read,', + type: 'hidden' as NodePropertyTypes, + default: scopes.join(','), }, { displayName: 'Auth URI Query Parameters', From 7682fd79e61a46b525f8f68f547f28eba4954b99 Mon Sep 17 00:00:00 2001 From: ricardo Date: Sun, 14 Jun 2020 21:36:56 -0400 Subject: [PATCH 067/241] :zap: Small fix --- packages/nodes-base/package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/nodes-base/package.json b/packages/nodes-base/package.json index 9cb463d8fd..649bde4837 100644 --- a/packages/nodes-base/package.json +++ b/packages/nodes-base/package.json @@ -102,6 +102,7 @@ "dist/credentials/OAuth2Api.credentials.js", "dist/credentials/OpenWeatherMapApi.credentials.js", "dist/credentials/PagerDutyApi.credentials.js", + "dist/credentials/PagerDutyOAuth2Api.credentials.js", "dist/credentials/PayPalApi.credentials.js", "dist/credentials/PipedriveApi.credentials.js", "dist/credentials/Postgres.credentials.js", From acfc4fc39dac367c82facb9d61e0efabe56d257d Mon Sep 17 00:00:00 2001 From: ricardo Date: Sun, 14 Jun 2020 21:39:30 -0400 Subject: [PATCH 068/241] :zap: Improvements to PagerDuty-Node --- .../credentials/PagerDutyOAuth2Api.credentials.ts | 8 +++++++- packages/nodes-base/nodes/PagerDuty/GenericFunctions.ts | 2 +- packages/nodes-base/nodes/PagerDuty/PagerDuty.node.ts | 8 ++++---- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/packages/nodes-base/credentials/PagerDutyOAuth2Api.credentials.ts b/packages/nodes-base/credentials/PagerDutyOAuth2Api.credentials.ts index 0bdd68b9c9..28b44011db 100644 --- a/packages/nodes-base/credentials/PagerDutyOAuth2Api.credentials.ts +++ b/packages/nodes-base/credentials/PagerDutyOAuth2Api.credentials.ts @@ -26,7 +26,13 @@ export class PagerDutyOAuth2Api implements ICredentialType { displayName: 'Auth URI Query Parameters', name: 'authQueryParameters', type: 'hidden' as NodePropertyTypes, - default: 'grant_type=authorization_code', + default: '', + }, + { + displayName: 'Scope', + name: 'scope', + type: 'hidden' as NodePropertyTypes, + default: '', }, { displayName: 'Authentication', diff --git a/packages/nodes-base/nodes/PagerDuty/GenericFunctions.ts b/packages/nodes-base/nodes/PagerDuty/GenericFunctions.ts index 716b4e0d5e..f4832b923c 100644 --- a/packages/nodes-base/nodes/PagerDuty/GenericFunctions.ts +++ b/packages/nodes-base/nodes/PagerDuty/GenericFunctions.ts @@ -45,7 +45,7 @@ export async function pagerDutyApiRequest(this: IExecuteFunctions | IWebhookFunc options.headers = Object.assign({}, options.headers, headers); try { - if (authenticationMethod === 'accessToken') { + if (authenticationMethod === 'apiToken') { const credentials = this.getCredentials('pagerDutyApi'); if (credentials === undefined) { diff --git a/packages/nodes-base/nodes/PagerDuty/PagerDuty.node.ts b/packages/nodes-base/nodes/PagerDuty/PagerDuty.node.ts index f9b8b1e3c7..8d62b8fc6f 100644 --- a/packages/nodes-base/nodes/PagerDuty/PagerDuty.node.ts +++ b/packages/nodes-base/nodes/PagerDuty/PagerDuty.node.ts @@ -69,7 +69,7 @@ export class PagerDuty implements INodeType { displayOptions: { show: { authentication: [ - 'accessToken', + 'apiToken', ], }, }, @@ -93,15 +93,15 @@ export class PagerDuty implements INodeType { type: 'options', options: [ { - name: 'Access Token', - value: 'accessToken', + name: 'API Token', + value: 'apiToken', }, { name: 'OAuth2', value: 'oAuth2', }, ], - default: 'accessToken', + default: 'apiToken', }, { displayName: 'Resource', From 136596f46596afbaf17c0373ff1085cea17845e7 Mon Sep 17 00:00:00 2001 From: shraddha shaligram Date: Mon, 15 Jun 2020 15:47:44 -0700 Subject: [PATCH 069/241] add Google tasks API --- .../GoogleTasksOAuth2Api.credentials.ts | 17 + .../nodes/Google/Calendar/EventDescription.ts | 627 ++++++++---------- .../Google/Calendar/GoogleCalendar.node.ts | 244 ++++--- .../nodes/Google/Task/GenericFunctions.ts | 83 +++ .../nodes/Google/Task/GoogleTasks.node.ts | 290 ++++++++ .../nodes/Google/Task/TaskDescription.ts | 539 +++++++++++++++ .../nodes/Google/Task/googleTasks.png | Bin 0 -> 2540 bytes .../nodes/MessageBird/MessageBird.node.ts | 108 ++- packages/nodes-base/package.json | 2 + 9 files changed, 1429 insertions(+), 481 deletions(-) create mode 100644 packages/nodes-base/credentials/GoogleTasksOAuth2Api.credentials.ts create mode 100644 packages/nodes-base/nodes/Google/Task/GenericFunctions.ts create mode 100644 packages/nodes-base/nodes/Google/Task/GoogleTasks.node.ts create mode 100644 packages/nodes-base/nodes/Google/Task/TaskDescription.ts create mode 100644 packages/nodes-base/nodes/Google/Task/googleTasks.png diff --git a/packages/nodes-base/credentials/GoogleTasksOAuth2Api.credentials.ts b/packages/nodes-base/credentials/GoogleTasksOAuth2Api.credentials.ts new file mode 100644 index 0000000000..db30799920 --- /dev/null +++ b/packages/nodes-base/credentials/GoogleTasksOAuth2Api.credentials.ts @@ -0,0 +1,17 @@ +import { ICredentialType, NodePropertyTypes } from 'n8n-workflow'; + +const scopes = ['https://www.googleapis.com/auth/tasks']; + +export class GoogleTasksOAuth2Api implements ICredentialType { + name = 'googleTasksOAuth2Api'; + extends = ['googleOAuth2Api']; + displayName = 'Google Tasks OAuth2 API'; + properties = [ + { + displayName: 'Scope', + name: 'scope', + type: 'hidden' as NodePropertyTypes, + default: scopes.join(' ') + } + ]; +} diff --git a/packages/nodes-base/nodes/Google/Calendar/EventDescription.ts b/packages/nodes-base/nodes/Google/Calendar/EventDescription.ts index e92582a847..a7800334e5 100644 --- a/packages/nodes-base/nodes/Google/Calendar/EventDescription.ts +++ b/packages/nodes-base/nodes/Google/Calendar/EventDescription.ts @@ -1,4 +1,4 @@ -import { INodeProperties } from "n8n-workflow"; +import { INodeProperties } from 'n8n-workflow'; export const eventOperations = [ { @@ -7,67 +7,60 @@ export const eventOperations = [ type: 'options', displayOptions: { show: { - resource: [ - 'event', - ], - }, + resource: ['event'] + } }, options: [ { name: 'Create', value: 'create', - description: 'Add a event to calendar', + description: 'Add a event to calendar' }, { name: 'Delete', value: 'delete', - description: 'Delete an event', + description: 'Delete an event' }, { name: 'Get', value: 'get', - description: 'Retrieve an event', + description: 'Retrieve an event' }, { name: 'Get All', value: 'getAll', - description: 'Retrieve all events from a calendar', + description: 'Retrieve all events from a calendar' }, { name: 'Update', value: 'update', - description: 'Update an event', - }, + description: 'Update an event' + } ], default: 'create', - description: 'The operation to perform.', - }, + description: 'The operation to perform.' + } ] as INodeProperties[]; export const eventFields = [ - -/* -------------------------------------------------------------------------- */ -/* event:create */ -/* -------------------------------------------------------------------------- */ + /* -------------------------------------------------------------------------- */ + /* event:create */ + /* -------------------------------------------------------------------------- */ { displayName: 'Calendar', name: 'calendar', type: 'options', typeOptions: { - loadOptionsMethod: 'getCalendars', + loadOptionsMethod: 'getCalendars' }, required: true, displayOptions: { show: { - operation: [ - 'create', - ], - resource: [ - 'event', - ], - }, + operation: ['create'], + resource: ['event'] + } }, - default: '', + default: '' }, { displayName: 'Start', @@ -76,16 +69,12 @@ export const eventFields = [ required: true, displayOptions: { show: { - operation: [ - 'create', - ], - resource: [ - 'event', - ], - }, + operation: ['create'], + resource: ['event'] + } }, default: '', - description: 'Start time of the event.', + description: 'Start time of the event.' }, { displayName: 'End', @@ -94,16 +83,12 @@ export const eventFields = [ required: true, displayOptions: { show: { - operation: [ - 'create', - ], - resource: [ - 'event', - ], - }, + operation: ['create'], + resource: ['event'] + } }, default: '', - description: 'End time of the event.', + description: 'End time of the event.' }, { displayName: 'Use Default Reminders', @@ -111,15 +96,11 @@ export const eventFields = [ type: 'boolean', displayOptions: { show: { - operation: [ - 'create', - ], - resource: [ - 'event', - ], - }, + operation: ['create'], + resource: ['event'] + } }, - default: true, + default: true }, { displayName: 'Additional Fields', @@ -129,13 +110,9 @@ export const eventFields = [ default: {}, displayOptions: { show: { - operation: [ - 'create', - ], - resource: [ - 'event', - ], - }, + operation: ['create'], + resource: ['event'] + } }, options: [ { @@ -145,15 +122,15 @@ export const eventFields = [ options: [ { name: 'Yes', - value: 'yes', + value: 'yes' }, { name: 'No', - value: 'no', - }, + value: 'no' + } ], default: 'no', - description: 'Wheater the event is all day or not', + description: 'Wheater the event is all day or not' }, { displayName: 'Attendees', @@ -161,55 +138,57 @@ export const eventFields = [ type: 'string', typeOptions: { multipleValues: true, - multipleValueButtonText: 'Add Attendee', + multipleValueButtonText: 'Add Attendee' }, default: '', - description: 'The attendees of the event', + description: 'The attendees of the event' }, { displayName: 'Color', name: 'color', type: 'options', typeOptions: { - loadOptionsMethod: 'getColors', + loadOptionsMethod: 'getColors' }, default: '', - description: 'The color of the event.', + description: 'The color of the event.' }, { displayName: 'Guests Can Invite Others', name: 'guestsCanInviteOthers', type: 'boolean', default: true, - description: 'Whether attendees other than the organizer can invite others to the event', + description: + 'Whether attendees other than the organizer can invite others to the event' }, { displayName: 'Guests Can Modify', name: 'guestsCanModify', type: 'boolean', default: false, - description: 'Whether attendees other than the organizer can modify the event', + description: + 'Whether attendees other than the organizer can modify the event' }, { displayName: 'Guests Can See Other Guests', name: 'guestsCanSeeOtherGuests', type: 'boolean', default: true, - description: `Whether attendees other than the organizer can see who the event's attendees are.`, + description: `Whether attendees other than the organizer can see who the event's attendees are.` }, { displayName: 'ID', name: 'id', type: 'string', default: '', - description: 'Opaque identifier of the event', + description: 'Opaque identifier of the event' }, { displayName: 'Location', name: 'location', type: 'string', default: '', - description: 'Geographic location of the event as free-form text.', + description: 'Geographic location of the event as free-form text.' }, { displayName: 'Max Attendees', @@ -217,7 +196,7 @@ export const eventFields = [ type: 'number', default: 0, description: `The maximum number of attendees to include in the response.
- If there are more than the specified number of attendees, only the participant is returned`, + If there are more than the specified number of attendees, only the participant is returned` }, { displayName: 'Repeat Frecuency', @@ -226,37 +205,37 @@ export const eventFields = [ options: [ { name: 'Daily', - value: 'Daily', + value: 'Daily' }, { name: 'Weekly', - value: 'weekly', + value: 'weekly' }, { name: 'Monthly', - value: 'monthly', + value: 'monthly' }, { name: 'Yearly', - value: 'yearly', - }, + value: 'yearly' + } ], - default: '', + default: '' }, { displayName: 'Repeat Until', name: 'repeatUntil', type: 'dateTime', - default: '', + default: '' }, { displayName: 'Repeat How Many Times?', name: 'repeatHowManyTimes', type: 'number', typeOptions: { - minValue: 1, + minValue: 1 }, - default: 1, + default: 1 }, { displayName: 'Send Updates', @@ -266,28 +245,31 @@ export const eventFields = [ { name: 'All', value: 'all', - description: ' Notifications are sent to all guests', + description: ' Notifications are sent to all guests' }, { name: 'External Only', value: 'externalOnly', - description: 'Notifications are sent to non-Google Calendar guests only', + description: + 'Notifications are sent to non-Google Calendar guests only' }, { name: 'None', value: 'none', - description: ' No notifications are sent. This value should only be used for migration use case', - }, + description: + ' No notifications are sent. This value should only be used for migration use case' + } ], - description: 'Whether to send notifications about the creation of the new event', - default: '', + description: + 'Whether to send notifications about the creation of the new event', + default: '' }, { displayName: 'Summary', name: 'summary', type: 'string', default: '', - description: 'Title of the event.', + description: 'Title of the event.' }, { displayName: 'Show Me As', @@ -297,26 +279,27 @@ export const eventFields = [ { name: 'Available', value: 'transparent', - description: 'The event does not block time on the calendar', + description: 'The event does not block time on the calendar' }, { name: 'Busy', value: 'opaque', - description: ' The event does block time on the calendar.', - }, + description: ' The event does block time on the calendar.' + } ], default: 'opaque', - description: 'Whether the event blocks time on the calendar', + description: 'Whether the event blocks time on the calendar' }, { displayName: 'Timezone', name: 'timezone', type: 'options', typeOptions: { - loadOptionsMethod: 'getTimezones', + loadOptionsMethod: 'getTimezones' }, default: '', - description: 'The timezone the event will have set. By default events are schedule on timezone set in n8n.' + description: + 'The timezone the event will have set. By default events are schedule on timezone set in n8n.' }, { displayName: 'Visibility', @@ -326,28 +309,32 @@ export const eventFields = [ { name: 'Confidential', value: 'confidential', - description: 'The event is private. This value is provided for compatibility reasons.', + description: + 'The event is private. This value is provided for compatibility reasons.' }, { name: 'Default', value: 'default', - description: ' Uses the default visibility for events on the calendar.', + description: + ' Uses the default visibility for events on the calendar.' }, { name: 'Private', value: 'private', - description: 'The event is private and only event attendees may view event details.', + description: + 'The event is private and only event attendees may view event details.' }, { name: 'Public', value: 'public', - description: 'The event is public and event details are visible to all readers of the calendar.', - }, + description: + 'The event is public and event details are visible to all readers of the calendar.' + } ], default: 'default', - description: 'Visibility of the event.', - }, - ], + description: 'Visibility of the event.' + } + ] }, { displayName: 'Reminders', @@ -356,21 +343,15 @@ export const eventFields = [ default: '', placeholder: 'Add Reminder', typeOptions: { - multipleValues: true, + multipleValues: true }, required: false, displayOptions: { show: { - resource: [ - 'event', - ], - operation: [ - 'create', - ], - useDefaultReminders: [ - false, - ], - }, + resource: ['event'], + operation: ['create'], + useDefaultReminders: [false] + } }, options: [ { @@ -384,14 +365,14 @@ export const eventFields = [ options: [ { name: 'Email', - value: 'email', + value: 'email' }, { name: 'Popup', - value: 'popup', - }, + value: 'popup' + } ], - default: '', + default: '' }, { displayName: 'Minutes Before', @@ -399,37 +380,33 @@ export const eventFields = [ type: 'number', typeOptions: { minValue: 0, - maxValue: 40320, + maxValue: 40320 }, - default: 0, - }, - ], + default: 0 + } + ] } ], - description: `If the event doesn't use the default reminders, this lists the reminders specific to the event`, + description: `If the event doesn't use the default reminders, this lists the reminders specific to the event` }, -/* -------------------------------------------------------------------------- */ -/* event:delete */ -/* -------------------------------------------------------------------------- */ + /* -------------------------------------------------------------------------- */ + /* event:delete */ + /* -------------------------------------------------------------------------- */ { displayName: 'Calendar', name: 'calendar', type: 'options', typeOptions: { - loadOptionsMethod: 'getCalendars', + loadOptionsMethod: 'getCalendars' }, required: true, displayOptions: { show: { - operation: [ - 'delete', - ], - resource: [ - 'event', - ], - }, + operation: ['delete'], + resource: ['event'] + } }, - default: '', + default: '' }, { displayName: 'Event ID', @@ -438,15 +415,11 @@ export const eventFields = [ required: true, displayOptions: { show: { - operation: [ - 'delete', - ], - resource: [ - 'event', - ], - }, + operation: ['delete'], + resource: ['event'] + } }, - default: '', + default: '' }, { displayName: 'Options', @@ -456,13 +429,9 @@ export const eventFields = [ default: {}, displayOptions: { show: { - operation: [ - 'delete', - ], - resource: [ - 'event', - ], - }, + operation: ['delete'], + resource: ['event'] + } }, options: [ { @@ -473,46 +442,45 @@ export const eventFields = [ { name: 'All', value: 'all', - description: ' Notifications are sent to all guests', + description: ' Notifications are sent to all guests' }, { name: 'External Only', value: 'externalOnly', - description: 'Notifications are sent to non-Google Calendar guests only', + description: + 'Notifications are sent to non-Google Calendar guests only' }, { name: 'None', value: 'none', - description: ' No notifications are sent. This value should only be used for migration use case', - }, + description: + ' No notifications are sent. This value should only be used for migration use case' + } ], - description: 'Whether to send notifications about the creation of the new event', - default: '', - }, - ], + description: + 'Whether to send notifications about the creation of the new event', + default: '' + } + ] }, -/* -------------------------------------------------------------------------- */ -/* event:get */ -/* -------------------------------------------------------------------------- */ + /* -------------------------------------------------------------------------- */ + /* event:get */ + /* -------------------------------------------------------------------------- */ { displayName: 'Calendar', name: 'calendar', type: 'options', typeOptions: { - loadOptionsMethod: 'getCalendars', + loadOptionsMethod: 'getCalendars' }, required: true, displayOptions: { show: { - operation: [ - 'get', - ], - resource: [ - 'event', - ], - }, + operation: ['get'], + resource: ['event'] + } }, - default: '', + default: '' }, { displayName: 'Event ID', @@ -521,15 +489,11 @@ export const eventFields = [ required: true, displayOptions: { show: { - operation: [ - 'get', - ], - resource: [ - 'event', - ], - }, + operation: ['get'], + resource: ['event'] + } }, - default: '', + default: '' }, { displayName: 'Options', @@ -539,13 +503,9 @@ export const eventFields = [ default: {}, displayOptions: { show: { - operation: [ - 'get', - ], - resource: [ - 'event', - ], - }, + operation: ['get'], + resource: ['event'] + } }, options: [ { @@ -554,42 +514,38 @@ export const eventFields = [ type: 'number', default: 0, description: `The maximum number of attendees to include in the response.
- If there are more than the specified number of attendees, only the participant is returned`, + If there are more than the specified number of attendees, only the participant is returned` }, { displayName: 'Timezone', name: 'timeZone', type: 'options', typeOptions: { - loadOptionsMethod: 'getTimezones', + loadOptionsMethod: 'getTimezones' }, default: '', - description: `Time zone used in the response. The default is the time zone of the calendar.`, - }, - ], + description: `Time zone used in the response. The default is the time zone of the calendar.` + } + ] }, -/* -------------------------------------------------------------------------- */ -/* event:getAll */ -/* -------------------------------------------------------------------------- */ + /* -------------------------------------------------------------------------- */ + /* event:getAll */ + /* -------------------------------------------------------------------------- */ { displayName: 'Calendar', name: 'calendar', type: 'options', typeOptions: { - loadOptionsMethod: 'getCalendars', + loadOptionsMethod: 'getCalendars' }, required: true, displayOptions: { show: { - operation: [ - 'getAll', - ], - resource: [ - 'event', - ], - }, + operation: ['getAll'], + resource: ['event'] + } }, - default: '', + default: '' }, { displayName: 'Return All', @@ -597,16 +553,13 @@ export const eventFields = [ type: 'boolean', displayOptions: { show: { - operation: [ - 'getAll', - ], - resource: [ - 'event', - ], - }, + operation: ['getAll'], + resource: ['event'] + } }, default: false, - description: 'If all results should be returned or only up to a given limit.', + description: + 'If all results should be returned or only up to a given limit.' }, { displayName: 'Limit', @@ -614,23 +567,17 @@ export const eventFields = [ type: 'number', displayOptions: { show: { - operation: [ - 'getAll', - ], - resource: [ - 'event', - ], - returnAll: [ - false, - ], - }, + operation: ['getAll'], + resource: ['event'], + returnAll: [false] + } }, typeOptions: { minValue: 1, - maxValue: 500, + maxValue: 500 }, default: 100, - description: 'How many results to return.', + description: 'How many results to return.' }, { displayName: 'Options', @@ -640,13 +587,9 @@ export const eventFields = [ default: {}, displayOptions: { show: { - operation: [ - 'getAll', - ], - resource: [ - 'event', - ], - }, + operation: ['getAll'], + resource: ['event'] + } }, options: [ { @@ -654,7 +597,8 @@ export const eventFields = [ name: 'iCalUID', type: 'string', default: '', - description: 'Specifies event ID in the iCalendar format to be included in the response', + description: + 'Specifies event ID in the iCalendar format to be included in the response' }, { displayName: 'Max Attendees', @@ -662,7 +606,7 @@ export const eventFields = [ type: 'number', default: 0, description: `The maximum number of attendees to include in the response.
- If there are more than the specified number of attendees, only the participant is returned`, + If there are more than the specified number of attendees, only the participant is returned` }, { displayName: 'Order By', @@ -672,37 +616,40 @@ export const eventFields = [ { name: 'Start Time', value: 'startTime', - description: 'Order by the start date/time (ascending). This is only available when querying single events (i.e. the parameter singleEvents is True)', + description: + 'Order by the start date/time (ascending). This is only available when querying single events (i.e. the parameter singleEvents is True)' }, { name: 'Updated', value: 'updated', - description: 'Order by last modification time (ascending).', - }, + description: 'Order by last modification time (ascending).' + } ], default: '', - description: 'The order of the events returned in the result.', + description: 'The order of the events returned in the result.' }, { displayName: 'Query', name: 'query', type: 'string', default: '', - description: 'Free text search terms to find events that match these terms in any field, except for extended properties.', + description: + 'Free text search terms to find events that match these terms in any field, except for extended properties.' }, { displayName: 'Show Deleted', name: 'showDeleted', type: 'boolean', default: false, - description: 'Whether to include deleted events (with status equals "cancelled") in the result.', + description: + 'Whether to include deleted events (with status equals "cancelled") in the result.' }, { displayName: 'Show Hidden Invitations', name: 'showHiddenInvitations', type: 'boolean', default: false, - description: 'Whether to include hidden invitations in the result.', + description: 'Whether to include hidden invitations in the result.' }, { displayName: 'Single Events', @@ -710,31 +657,31 @@ export const eventFields = [ type: 'boolean', default: false, description: `Whether to expand recurring events into instances and only return single one-off
- events and instances of recurring events, but not the underlying recurring events themselves.`, + events and instances of recurring events, but not the underlying recurring events themselves.` }, { displayName: 'Time Max', name: 'timeMax', type: 'dateTime', default: '', - description: `Upper bound (exclusive) for an event's start time to filter by`, + description: `Upper bound (exclusive) for an event's start time to filter by` }, { displayName: 'Time Min', name: 'timeMin', type: 'dateTime', default: '', - description: `Lower bound (exclusive) for an event's end time to filter by`, + description: `Lower bound (exclusive) for an event's end time to filter by` }, { displayName: 'Timezone', name: 'timeZone', type: 'options', typeOptions: { - loadOptionsMethod: 'getTimezones', + loadOptionsMethod: 'getTimezones' }, default: '', - description: `Time zone used in the response. The default is the time zone of the calendar.`, + description: `Time zone used in the response. The default is the time zone of the calendar.` }, { displayName: 'Updated Min', @@ -742,32 +689,28 @@ export const eventFields = [ type: 'dateTime', default: '', description: `Lower bound for an event's last modification time (as a RFC3339 timestamp) to filter by. - When specified, entries deleted since this time will always be included regardless of showDeleted`, - }, - ], + When specified, entries deleted since this time will always be included regardless of showDeleted` + } + ] }, -/* -------------------------------------------------------------------------- */ -/* event:update */ -/* -------------------------------------------------------------------------- */ + /* -------------------------------------------------------------------------- */ + /* event:update */ + /* -------------------------------------------------------------------------- */ { displayName: 'Calendar', name: 'calendar', type: 'options', typeOptions: { - loadOptionsMethod: 'getCalendars', + loadOptionsMethod: 'getCalendars' }, required: true, displayOptions: { show: { - operation: [ - 'update', - ], - resource: [ - 'event', - ], - }, + operation: ['update'], + resource: ['event'] + } }, - default: '', + default: '' }, { displayName: 'Event ID', @@ -776,15 +719,11 @@ export const eventFields = [ required: true, displayOptions: { show: { - operation: [ - 'update', - ], - resource: [ - 'event', - ], - }, + operation: ['update'], + resource: ['event'] + } }, - default: '', + default: '' }, { displayName: 'Use Default Reminders', @@ -792,15 +731,11 @@ export const eventFields = [ type: 'boolean', displayOptions: { show: { - operation: [ - 'update', - ], - resource: [ - 'event', - ], - }, + operation: ['update'], + resource: ['event'] + } }, - default: true, + default: true }, { displayName: 'Update Fields', @@ -810,13 +745,9 @@ export const eventFields = [ default: {}, displayOptions: { show: { - operation: [ - 'update', - ], - resource: [ - 'event', - ], - }, + operation: ['update'], + resource: ['event'] + } }, options: [ { @@ -826,15 +757,15 @@ export const eventFields = [ options: [ { name: 'Yes', - value: 'yes', + value: 'yes' }, { name: 'No', - value: 'no', - }, + value: 'no' + } ], default: 'no', - description: 'Wheater the event is all day or not', + description: 'Wheater the event is all day or not' }, { displayName: 'Attendees', @@ -842,62 +773,64 @@ export const eventFields = [ type: 'string', typeOptions: { multipleValues: true, - multipleValueButtonText: 'Add Attendee', + multipleValueButtonText: 'Add Attendee' }, default: '', - description: 'The attendees of the event', + description: 'The attendees of the event' }, { displayName: 'Color', name: 'color', type: 'options', typeOptions: { - loadOptionsMethod: 'getColors', + loadOptionsMethod: 'getColors' }, default: '', - description: 'The color of the event.', + description: 'The color of the event.' }, { displayName: 'End', name: 'end', type: 'dateTime', default: '', - description: 'End time of the event.', + description: 'End time of the event.' }, { displayName: 'Guests Can Invite Others', name: 'guestsCanInviteOthers', type: 'boolean', default: true, - description: 'Whether attendees other than the organizer can invite others to the event', + description: + 'Whether attendees other than the organizer can invite others to the event' }, { displayName: 'Guests Can Modify', name: 'guestsCanModify', type: 'boolean', default: false, - description: 'Whether attendees other than the organizer can modify the event', + description: + 'Whether attendees other than the organizer can modify the event' }, { displayName: 'Guests Can See Other Guests', name: 'guestsCanSeeOtherGuests', type: 'boolean', default: true, - description: `Whether attendees other than the organizer can see who the event's attendees are.`, + description: `Whether attendees other than the organizer can see who the event's attendees are.` }, { displayName: 'ID', name: 'id', type: 'string', default: '', - description: 'Opaque identifier of the event', + description: 'Opaque identifier of the event' }, { displayName: 'Location', name: 'location', type: 'string', default: '', - description: 'Geographic location of the event as free-form text.', + description: 'Geographic location of the event as free-form text.' }, { displayName: 'Max Attendees', @@ -905,7 +838,7 @@ export const eventFields = [ type: 'number', default: 0, description: `The maximum number of attendees to include in the response.
- If there are more than the specified number of attendees, only the participant is returned`, + If there are more than the specified number of attendees, only the participant is returned` }, { displayName: 'Repeat Frecuency', @@ -914,44 +847,44 @@ export const eventFields = [ options: [ { name: 'Daily', - value: 'Daily', + value: 'Daily' }, { name: 'Weekly', - value: 'weekly', + value: 'weekly' }, { name: 'Monthly', - value: 'monthly', + value: 'monthly' }, { name: 'Yearly', - value: 'yearly', - }, + value: 'yearly' + } ], - default: '', + default: '' }, { displayName: 'Repeat Until', name: 'repeatUntil', type: 'dateTime', - default: '', + default: '' }, { displayName: 'Repeat How Many Times?', name: 'repeatHowManyTimes', type: 'number', typeOptions: { - minValue: 1, + minValue: 1 }, - default: 1, + default: 1 }, { displayName: 'Start', name: 'start', type: 'dateTime', default: '', - description: 'Start time of the event.', + description: 'Start time of the event.' }, { displayName: 'Send Updates', @@ -961,28 +894,31 @@ export const eventFields = [ { name: 'All', value: 'all', - description: ' Notifications are sent to all guests', + description: ' Notifications are sent to all guests' }, { name: 'External Only', value: 'externalOnly', - description: 'Notifications are sent to non-Google Calendar guests only', + description: + 'Notifications are sent to non-Google Calendar guests only' }, { name: 'None', value: 'none', - description: ' No notifications are sent. This value should only be used for migration use case', - }, + description: + ' No notifications are sent. This value should only be used for migration use case' + } ], - description: 'Whether to send notifications about the creation of the new event', - default: '', + description: + 'Whether to send notifications about the creation of the new event', + default: '' }, { displayName: 'Summary', name: 'summary', type: 'string', default: '', - description: 'Title of the event.', + description: 'Title of the event.' }, { displayName: 'Show Me As', @@ -992,26 +928,27 @@ export const eventFields = [ { name: 'Available', value: 'transparent', - description: 'The event does not block time on the calendar', + description: 'The event does not block time on the calendar' }, { name: 'Busy', value: 'opaque', - description: ' The event does block time on the calendar.', - }, + description: ' The event does block time on the calendar.' + } ], default: 'opaque', - description: 'Whether the event blocks time on the calendar', + description: 'Whether the event blocks time on the calendar' }, { displayName: 'Timezone', name: 'timezone', type: 'options', typeOptions: { - loadOptionsMethod: 'getTimezones', + loadOptionsMethod: 'getTimezones' }, default: '', - description: 'The timezone the event will have set. By default events are schedule on n8n timezone ' + description: + 'The timezone the event will have set. By default events are schedule on n8n timezone ' }, { displayName: 'Visibility', @@ -1021,28 +958,32 @@ export const eventFields = [ { name: 'Confidential', value: 'confidential', - description: 'The event is private. This value is provided for compatibility reasons.', + description: + 'The event is private. This value is provided for compatibility reasons.' }, { name: 'Default', value: 'default', - description: ' Uses the default visibility for events on the calendar.', + description: + ' Uses the default visibility for events on the calendar.' }, { name: 'Public', value: 'public', - description: 'The event is public and event details are visible to all readers of the calendar.', + description: + 'The event is public and event details are visible to all readers of the calendar.' }, { name: 'Private', value: 'private', - description: 'The event is private and only event attendees may view event details.', - }, + description: + 'The event is private and only event attendees may view event details.' + } ], default: 'default', - description: 'Visibility of the event.', - }, - ], + description: 'Visibility of the event.' + } + ] }, { displayName: 'Reminders', @@ -1051,21 +992,15 @@ export const eventFields = [ default: '', placeholder: 'Add Reminder', typeOptions: { - multipleValues: true, + multipleValues: true }, required: false, displayOptions: { show: { - resource: [ - 'event', - ], - operation: [ - 'update', - ], - useDefaultReminders: [ - false, - ], - }, + resource: ['event'], + operation: ['update'], + useDefaultReminders: [false] + } }, options: [ { @@ -1079,14 +1014,14 @@ export const eventFields = [ options: [ { name: 'Email', - value: 'email', + value: 'email' }, { name: 'Popup', - value: 'popup', - }, + value: 'popup' + } ], - default: '', + default: '' }, { displayName: 'Minutes Before', @@ -1094,13 +1029,13 @@ export const eventFields = [ type: 'number', typeOptions: { minValue: 0, - maxValue: 40320, + maxValue: 40320 }, - default: 0, - }, - ], + default: 0 + } + ] } ], - description: `If the event doesn't use the default reminders, this lists the reminders specific to the event`, - }, + description: `If the event doesn't use the default reminders, this lists the reminders specific to the event` + } ] as INodeProperties[]; diff --git a/packages/nodes-base/nodes/Google/Calendar/GoogleCalendar.node.ts b/packages/nodes-base/nodes/Google/Calendar/GoogleCalendar.node.ts index 1f185935d7..53d3d9de83 100644 --- a/packages/nodes-base/nodes/Google/Calendar/GoogleCalendar.node.ts +++ b/packages/nodes-base/nodes/Google/Calendar/GoogleCalendar.node.ts @@ -1,6 +1,4 @@ -import { - IExecuteFunctions, -} from 'n8n-core'; +import { IExecuteFunctions } from 'n8n-core'; import { IDataObject, @@ -8,22 +6,14 @@ import { INodeTypeDescription, INodeType, ILoadOptionsFunctions, - INodePropertyOptions, + INodePropertyOptions } from 'n8n-workflow'; -import { - googleApiRequest, - googleApiRequestAllItems, -} from './GenericFunctions'; +import { googleApiRequest, googleApiRequestAllItems } from './GenericFunctions'; -import { - eventOperations, - eventFields, -} from './EventDescription'; +import { eventOperations, eventFields } from './EventDescription'; -import { - IEvent, -} from './EventInterface'; +import { IEvent } from './EventInterface'; import * as moment from 'moment-timezone'; @@ -38,15 +28,15 @@ export class GoogleCalendar implements INodeType { description: 'Consume Google Calendar API.', defaults: { name: 'Google Calendar', - color: '#3E87E4', + color: '#3E87E4' }, inputs: ['main'], outputs: ['main'], credentials: [ { name: 'googleCalendarOAuth2Api', - required: true, - }, + required: true + } ], properties: [ { @@ -56,70 +46,85 @@ export class GoogleCalendar implements INodeType { options: [ { name: 'Event', - value: 'event', - }, + value: 'event' + } ], default: 'event', - description: 'The resource to operate on.', + description: 'The resource to operate on.' }, ...eventOperations, - ...eventFields, - ], + ...eventFields + ] }; methods = { loadOptions: { // Get all the calendars to display them to user so that he can // select them easily - async getCalendars(this: ILoadOptionsFunctions): Promise { + async getCalendars( + this: ILoadOptionsFunctions + ): Promise { const returnData: INodePropertyOptions[] = []; - const calendars = await googleApiRequestAllItems.call(this, 'items', 'GET', '/calendar/v3/users/me/calendarList'); + const calendars = await googleApiRequestAllItems.call( + this, + 'items', + 'GET', + '/calendar/v3/users/me/calendarList' + ); for (const calendar of calendars) { const calendarName = calendar.summary; const calendarId = calendar.id; returnData.push({ name: calendarName, - value: calendarId, + value: calendarId }); } return returnData; }, // Get all the colors to display them to user so that he can // select them easily - async getColors(this: ILoadOptionsFunctions): Promise { + async getColors( + this: ILoadOptionsFunctions + ): Promise { const returnData: INodePropertyOptions[] = []; - const { calendar } = await googleApiRequest.call(this, 'GET', '/calendar/v3/colors'); - for (const key of Object.keys(calendar)) { + const { calendar } = await googleApiRequest.call( + this, + 'GET', + '/calendar/v3/colors' + ); + for (const key of Object.keys(calendar)) { const colorName = calendar[key].background; const colorId = key; returnData.push({ name: `${colorName} - ${colorId}`, - value: colorId, + value: colorId }); } return returnData; }, // Get all the timezones to display them to user so that he can // select them easily - async getTimezones(this: ILoadOptionsFunctions): Promise { + async getTimezones( + this: ILoadOptionsFunctions + ): Promise { const returnData: INodePropertyOptions[] = []; for (const timezone of moment.tz.names()) { const timezoneName = timezone; const timezoneId = timezone; returnData.push({ name: timezoneName, - value: timezoneId, + value: timezoneId }); } return returnData; - }, - }, + } + } }; async execute(this: IExecuteFunctions): Promise { const items = this.getInputData(); const returnData: IDataObject[] = []; - const length = items.length as unknown as number; + const length = (items.length as unknown) as number; const qs: IDataObject = {}; let responseData; const resource = this.getNodeParameter('resource', 0) as string; @@ -131,8 +136,14 @@ export class GoogleCalendar implements INodeType { const calendarId = this.getNodeParameter('calendar', i) as string; const start = this.getNodeParameter('start', i) as string; const end = this.getNodeParameter('end', i) as string; - const useDefaultReminders = this.getNodeParameter('useDefaultReminders', i) as boolean; - const additionalFields = this.getNodeParameter('additionalFields', i) as IDataObject; + const useDefaultReminders = this.getNodeParameter( + 'useDefaultReminders', + i + ) as boolean; + const additionalFields = this.getNodeParameter( + 'additionalFields', + i + ) as IDataObject; if (additionalFields.maxAttendees) { qs.maxAttendees = additionalFields.maxAttendees as number; } @@ -145,17 +156,19 @@ export class GoogleCalendar implements INodeType { const body: IEvent = { start: { dateTime: start, - timeZone: additionalFields.timeZone || this.getTimezone(), + timeZone: additionalFields.timeZone || this.getTimezone() }, end: { dateTime: end, - timeZone: additionalFields.timeZone || this.getTimezone(), + timeZone: additionalFields.timeZone || this.getTimezone() } }; if (additionalFields.attendees) { - body.attendees = (additionalFields.attendees as string[]).map(attendee => { - return { email: attendee }; - }); + body.attendees = (additionalFields.attendees as string[]).map( + attendee => { + return { email: attendee }; + } + ); } if (additionalFields.color) { body.colorId = additionalFields.color as string; @@ -188,9 +201,12 @@ export class GoogleCalendar implements INodeType { body.visibility = additionalFields.visibility as string; } if (!useDefaultReminders) { - const reminders = (this.getNodeParameter('remindersUi', i) as IDataObject).remindersValues as IDataObject[]; + const reminders = (this.getNodeParameter( + 'remindersUi', + i + ) as IDataObject).remindersValues as IDataObject[]; body.reminders = { - useDefault: false, + useDefault: false }; if (reminders) { body.reminders.overrides = reminders; @@ -198,32 +214,54 @@ export class GoogleCalendar implements INodeType { } if (additionalFields.allday) { body.start = { - date: moment(start).utc().format('YYYY-MM-DD'), + date: moment(start) + .utc() + .format('YYYY-MM-DD') }; body.end = { - date: moment(end).utc().format('YYYY-MM-DD'), + date: moment(end) + .utc() + .format('YYYY-MM-DD') }; } //exampel: RRULE:FREQ=WEEKLY;INTERVAL=2;COUNT=10;UNTIL=20110701T170000Z //https://icalendar.org/iCalendar-RFC-5545/3-8-5-3-recurrence-rule.html body.recurrence = []; - if (additionalFields.repeatHowManyTimes - && additionalFields.repeatUntil) { - throw new Error(`You can set either 'Repeat How Many Times' or 'Repeat Until' but not both`); + if ( + additionalFields.repeatHowManyTimes && + additionalFields.repeatUntil + ) { + throw new Error( + `You can set either 'Repeat How Many Times' or 'Repeat Until' but not both` + ); } if (additionalFields.repeatFrecuency) { - body.recurrence?.push(`FREQ=${(additionalFields.repeatFrecuency as string).toUpperCase()};`); + body.recurrence?.push( + `FREQ=${(additionalFields.repeatFrecuency as string).toUpperCase()};` + ); } if (additionalFields.repeatHowManyTimes) { - body.recurrence?.push(`COUNT=${additionalFields.repeatHowManyTimes};`); + body.recurrence?.push( + `COUNT=${additionalFields.repeatHowManyTimes};` + ); } if (additionalFields.repeatUntil) { - body.recurrence?.push(`UNTIL=${moment(additionalFields.repeatUntil as string).utc().format('YYYYMMDDTHHmmss')}Z`); + body.recurrence?.push( + `UNTIL=${moment(additionalFields.repeatUntil as string) + .utc() + .format('YYYYMMDDTHHmmss')}Z` + ); } if (body.recurrence.length !== 0) { body.recurrence = [`RRULE:${body.recurrence.join('')}`]; } - responseData = await googleApiRequest.call(this, 'POST', `/calendar/v3/calendars/${calendarId}/events`, body, qs); + responseData = await googleApiRequest.call( + this, + 'POST', + `/calendar/v3/calendars/${calendarId}/events`, + body, + qs + ); } //https://developers.google.com/calendar/v3/reference/events/delete if (operation === 'delete') { @@ -233,8 +271,13 @@ export class GoogleCalendar implements INodeType { if (options.sendUpdates) { qs.sendUpdates = options.sendUpdates as number; } - responseData = await googleApiRequest.call(this, 'DELETE', `/calendar/v3/calendars/${calendarId}/events/${eventId}`, {}); - responseData = { success: true }; + responseData = await googleApiRequest.call( + this, + 'DELETE', + `/calendar/v3/calendars/${calendarId}/events/${eventId}`, + {} + ); + responseData = { success: true }; } //https://developers.google.com/calendar/v3/reference/events/get if (operation === 'get') { @@ -247,7 +290,13 @@ export class GoogleCalendar implements INodeType { if (options.timeZone) { qs.timeZone = options.timeZone as string; } - responseData = await googleApiRequest.call(this, 'GET', `/calendar/v3/calendars/${calendarId}/events/${eventId}`, {}, qs); + responseData = await googleApiRequest.call( + this, + 'GET', + `/calendar/v3/calendars/${calendarId}/events/${eventId}`, + {}, + qs + ); } //https://developers.google.com/calendar/v3/reference/events/list if (operation === 'getAll') { @@ -288,10 +337,23 @@ export class GoogleCalendar implements INodeType { qs.updatedMin = options.updatedMin as string; } if (returnAll) { - responseData = await googleApiRequestAllItems.call(this, 'items', 'GET', `/calendar/v3/calendars/${calendarId}/events`, {}, qs); + responseData = await googleApiRequestAllItems.call( + this, + 'items', + 'GET', + `/calendar/v3/calendars/${calendarId}/events`, + {}, + qs + ); } else { qs.maxResults = this.getNodeParameter('limit', i) as number; - responseData = await googleApiRequest.call(this, 'GET', `/calendar/v3/calendars/${calendarId}/events`, {}, qs); + responseData = await googleApiRequest.call( + this, + 'GET', + `/calendar/v3/calendars/${calendarId}/events`, + {}, + qs + ); responseData = responseData.items; } } @@ -299,8 +361,14 @@ export class GoogleCalendar implements INodeType { if (operation === 'update') { const calendarId = this.getNodeParameter('calendar', i) as string; const eventId = this.getNodeParameter('eventId', i) as string; - const useDefaultReminders = this.getNodeParameter('useDefaultReminders', i) as boolean; - const updateFields = this.getNodeParameter('updateFields', i) as IDataObject; + const useDefaultReminders = this.getNodeParameter( + 'useDefaultReminders', + i + ) as boolean; + const updateFields = this.getNodeParameter( + 'updateFields', + i + ) as IDataObject; if (updateFields.maxAttendees) { qs.maxAttendees = updateFields.maxAttendees as number; } @@ -314,19 +382,21 @@ export class GoogleCalendar implements INodeType { if (updateFields.start) { body.start = { dateTime: updateFields.start, - timeZone: updateFields.timeZone || this.getTimezone(), + timeZone: updateFields.timeZone || this.getTimezone() }; } if (updateFields.end) { body.end = { dateTime: updateFields.end, - timeZone: updateFields.timeZone || this.getTimezone(), + timeZone: updateFields.timeZone || this.getTimezone() }; } if (updateFields.attendees) { - body.attendees = (updateFields.attendees as string[]).map(attendee => { - return { email: attendee }; - }); + body.attendees = (updateFields.attendees as string[]).map( + attendee => { + return { email: attendee }; + } + ); } if (updateFields.color) { body.colorId = updateFields.color as string; @@ -359,46 +429,64 @@ export class GoogleCalendar implements INodeType { body.visibility = updateFields.visibility as string; } if (!useDefaultReminders) { - const reminders = (this.getNodeParameter('remindersUi', i) as IDataObject).remindersValues as IDataObject[]; + const reminders = (this.getNodeParameter( + 'remindersUi', + i + ) as IDataObject).remindersValues as IDataObject[]; body.reminders = { - useDefault: false, + useDefault: false }; if (reminders) { body.reminders.overrides = reminders; } } - if (updateFields.allday - && updateFields.start - && updateFields.end) { + if (updateFields.allday && updateFields.start && updateFields.end) { body.start = { - date: moment(updateFields.start as string).utc().format('YYYY-MM-DD'), + date: moment(updateFields.start as string) + .utc() + .format('YYYY-MM-DD') }; body.end = { - date: moment(updateFields.end as string).utc().format('YYYY-MM-DD'), + date: moment(updateFields.end as string) + .utc() + .format('YYYY-MM-DD') }; } //exampel: RRULE:FREQ=WEEKLY;INTERVAL=2;COUNT=10;UNTIL=20110701T170000Z //https://icalendar.org/iCalendar-RFC-5545/3-8-5-3-recurrence-rule.html body.recurrence = []; - if (updateFields.repeatHowManyTimes - && updateFields.repeatUntil) { - throw new Error(`You can set either 'Repeat How Many Times' or 'Repeat Until' but not both`); + if (updateFields.repeatHowManyTimes && updateFields.repeatUntil) { + throw new Error( + `You can set either 'Repeat How Many Times' or 'Repeat Until' but not both` + ); } if (updateFields.repeatFrecuency) { - body.recurrence?.push(`FREQ=${(updateFields.repeatFrecuency as string).toUpperCase()};`); + body.recurrence?.push( + `FREQ=${(updateFields.repeatFrecuency as string).toUpperCase()};` + ); } if (updateFields.repeatHowManyTimes) { body.recurrence?.push(`COUNT=${updateFields.repeatHowManyTimes};`); } if (updateFields.repeatUntil) { - body.recurrence?.push(`UNTIL=${moment(updateFields.repeatUntil as string).utc().format('YYYYMMDDTHHmmss')}Z`); + body.recurrence?.push( + `UNTIL=${moment(updateFields.repeatUntil as string) + .utc() + .format('YYYYMMDDTHHmmss')}Z` + ); } if (body.recurrence.length !== 0) { body.recurrence = [`RRULE:${body.recurrence.join('')}`]; } else { delete body.recurrence; } - responseData = await googleApiRequest.call(this, 'PATCH', `/calendar/v3/calendars/${calendarId}/events/${eventId}`, body, qs); + responseData = await googleApiRequest.call( + this, + 'PATCH', + `/calendar/v3/calendars/${calendarId}/events/${eventId}`, + body, + qs + ); } } } diff --git a/packages/nodes-base/nodes/Google/Task/GenericFunctions.ts b/packages/nodes-base/nodes/Google/Task/GenericFunctions.ts new file mode 100644 index 0000000000..19652d1d4a --- /dev/null +++ b/packages/nodes-base/nodes/Google/Task/GenericFunctions.ts @@ -0,0 +1,83 @@ +import { OptionsWithUri } from 'request'; + +import { + IExecuteFunctions, + IExecuteSingleFunctions, + ILoadOptionsFunctions +} from 'n8n-core'; + +import { IDataObject } from 'n8n-workflow'; + +export async function googleApiRequest( + this: IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions, + method: string, + resource: string, + body: any = {}, + qs: IDataObject = {}, + uri?: string, + headers: IDataObject = {} +): Promise { + const options: OptionsWithUri = { + headers: { + 'Content-Type': 'application/json' + }, + method, + body, + qs, + uri: uri || `https://www.googleapis.com${resource}`, + json: true + }; + try { + if (Object.keys(headers).length !== 0) { + options.headers = Object.assign({}, options.headers, headers); + } + if (Object.keys(body).length === 0) { + delete options.body; + } + //@ts-ignore + return await this.helpers.requestOAuth2.call( + this, + 'googleTasksOAuth2Api', + options + ); + } catch (error) { + if (error.response && error.response.body && error.response.body.message) { + // Try to return the error prettier + throw new Error( + `Google Tasks error response [${error.statusCode}]: ${error.response.body.message}` + ); + } + throw error; + } +} + +export async function googleApiRequestAllItems( + this: IExecuteFunctions | ILoadOptionsFunctions, + propertyName: string, + method: string, + endpoint: string, + body: any = {}, + query: IDataObject = {} +): Promise { + const returnData: IDataObject[] = []; + + let responseData; + query.maxResults = 100; + + do { + responseData = await googleApiRequest.call( + this, + method, + endpoint, + body, + query + ); + query.pageToken = responseData['nextPageToken']; + returnData.push.apply(returnData, responseData[propertyName]); + } while ( + responseData['nextPageToken'] !== undefined && + responseData['nextPageToken'] !== '' + ); + + return returnData; +} diff --git a/packages/nodes-base/nodes/Google/Task/GoogleTasks.node.ts b/packages/nodes-base/nodes/Google/Task/GoogleTasks.node.ts new file mode 100644 index 0000000000..450b389376 --- /dev/null +++ b/packages/nodes-base/nodes/Google/Task/GoogleTasks.node.ts @@ -0,0 +1,290 @@ +import { IExecuteFunctions } from 'n8n-core'; + +import { + IDataObject, + INodeExecutionData, + INodeTypeDescription, + INodeType, + ILoadOptionsFunctions, + INodePropertyOptions +} from 'n8n-workflow'; +import { taskOperations, taskFields } from './TaskDescription'; + +import { googleApiRequest, googleApiRequestAllItems } from './GenericFunctions'; + +export class GoogleTasks implements INodeType { + description: INodeTypeDescription = { + displayName: 'Google Tasks', + name: 'googleTasks', + icon: 'file:googleTasks.png', + group: ['input'], + version: 1, + subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}', + description: 'Consume Google Tasks API.', + defaults: { + name: 'Google Tasks', + color: '#3E87E4' + }, + inputs: ['main'], + outputs: ['main'], + credentials: [ + { + name: 'googleTasksOAuth2Api', + required: true + } + ], + properties: [ + { + displayName: 'Resource', + name: 'resource', + type: 'options', + options: [ + { + name: 'Task', + value: 'task' + } + ], + default: 'task', + description: 'The resource to operate on.' + }, + ...taskOperations, + ...taskFields + ] + }; + methods = { + loadOptions: { + // Get all the tasklists to display them to user so that he can select them easily + + async getTasks( + this: ILoadOptionsFunctions + ): Promise { + const returnData: INodePropertyOptions[] = []; + const tasks = await googleApiRequestAllItems.call( + this, + 'items', + 'GET', + '/tasks/v1/users/@me/lists' + ); + for (const task of tasks) { + const taskName = task.title; + const taskId = task.id; + returnData.push({ + name: taskName, + value: taskId + }); + } + return returnData; + } + } + }; + + async execute(this: IExecuteFunctions): Promise { + const items = this.getInputData(); + const returnData: IDataObject[] = []; + const length = (items.length as unknown) as number; + const qs: IDataObject = {}; + let responseData; + const resource = this.getNodeParameter('resource', 0) as string; + const operation = this.getNodeParameter('operation', 0) as string; + let body: IDataObject = {}; + for (let i = 0; i < length; i++) { + if (resource === 'task') { + if (operation === 'create') { + body = {}; + //https://developers.google.com/tasks/v1/reference/tasks/insert + const taskId = this.getNodeParameter('task', i) as string; + const additionalFields = this.getNodeParameter( + 'additionalFields', + i + ) as IDataObject; + + if (additionalFields.parent) + qs.parent = additionalFields.parent as string; + + if (additionalFields.previous) + qs.previous = additionalFields.previous as string; + + if (additionalFields.links) { + body.links = (additionalFields.links as string[]).map(link => { + return { link: link }; + }); + } + if (additionalFields.status) + body.status = additionalFields.status as string; + + if (additionalFields.notes) + body.notes = additionalFields.notes as string; + + if (additionalFields.title) + body.title = additionalFields.title as string; + + if (additionalFields.dueDate) + body.dueDate = additionalFields.dueDate as string; + + if (additionalFields.completed) + body.completed = additionalFields.completed as string; + + if (additionalFields.deleted) + body.deleted = additionalFields.deleted as boolean; + + if (additionalFields.hidden) + body.hidden = additionalFields.hidden as boolean; + + if (additionalFields.position) + body.position = additionalFields.position as string; + + if (additionalFields.selfLink) + body.selfLink = additionalFields.selfLink as string; + + responseData = await googleApiRequest.call( + this, + 'POST', + `/tasks/v1/lists/${taskId}/tasks`, + body, + qs + ); + } + if (operation == 'delete') { + //https://developers.google.com/tasks/v1/reference/tasks/delete + const taskListId = this.getNodeParameter('task', i) as string; + const taskId = this.getNodeParameter('taskId', i) as string; + + responseData = await googleApiRequest.call( + this, + 'DELETE', + `/tasks/v1/lists/${taskListId}/tasks/${taskId}`, + {} + ); + responseData = { success: true }; + } + if (operation === 'get') { + //https://developers.google.com/tasks/v1/reference/tasks/get + const taskListId = this.getNodeParameter('task', i) as string; + const taskId = this.getNodeParameter('taskId', i) as string; + responseData = await googleApiRequest.call( + this, + 'GET', + `/tasks/v1/lists/${taskListId}/tasks/${taskId}`, + {}, + qs + ); + } + if (operation === 'getAll') { + //https://developers.google.com/tasks/v1/reference/tasks/list + const returnAll = this.getNodeParameter('returnAll', i) as boolean; + const taskListId = this.getNodeParameter('task', i) as string; + const options = this.getNodeParameter( + 'additionalFields', + i + ) as IDataObject; + if (options.completedMax) { + qs.completedMax = options.completedMax as string; + } + if (options.completedMin) { + qs.completedMin = options.completedMin as string; + } + if (options.dueMin) { + qs.dueMin = options.dueMin as string; + } + if (options.dueMax) { + qs.dueMax = options.dueMax as string; + } + if (options.pageToken) { + qs.pageToken = options.pageToken as string; + } + if (options.showCompleted) { + qs.showCompleted = options.showCompleted as boolean; + } + if (options.showDeleted) { + qs.showDeleted = options.showDeleted as boolean; + } + if (options.showHidden) { + qs.showHidden = options.showHidden as boolean; + } + + if (options.updatedMin) { + qs.updatedMin = options.updatedMin as string; + } + if (returnAll) { + responseData = await googleApiRequestAllItems.call( + this, + 'items', + 'GET', + `/tasks/v1/lists/${taskListId}/tasks`, + {}, + qs + ); + } else { + qs.maxResults = this.getNodeParameter('limit', i) as number; + responseData = await googleApiRequest.call( + this, + 'GET', + `/tasks/v1/lists/${taskListId}/tasks`, + {}, + qs + ); + responseData = responseData.items; + } + } + if (operation == 'update') { + body = {}; + //https://developers.google.com/tasks/v1/reference/tasks/patch + const taskListId = this.getNodeParameter('task', i) as string; + const taskId = this.getNodeParameter('taskId', i) as string; + const updateFields = this.getNodeParameter( + 'updateFields', + i + ) as IDataObject; + + if (updateFields.parent) qs.parent = updateFields.parent as string; + + if (updateFields.previous) + qs.previous = updateFields.previous as string; + + if (updateFields.links) { + body.links = (updateFields.links as string[]).map(link => { + return { link: link }; + }); + } + if (updateFields.status) body.status = updateFields.status as string; + + if (updateFields.notes) body.notes = updateFields.notes as string; + + if (updateFields.title) body.title = updateFields.title as string; + + if (updateFields.dueDate) + body.dueDate = updateFields.dueDate as string; + + if (updateFields.completed) + body.completed = updateFields.completed as string; + + if (updateFields.deleted) + body.deleted = updateFields.deleted as boolean; + + if (updateFields.hidden) body.hidden = updateFields.hidden as boolean; + + if (updateFields.position) + body.position = updateFields.position as string; + + if (updateFields.selfLink) + body.selfLink = updateFields.selfLink as string; + + responseData = await googleApiRequest.call( + this, + 'PATCH', + `/tasks/v1/lists/${taskListId}/tasks/${taskId}`, + body, + qs + ); + } + } + } + + if (Array.isArray(responseData)) { + returnData.push.apply(returnData, responseData as IDataObject[]); + } else if (responseData !== undefined) { + returnData.push(responseData as IDataObject); + } + return [this.helpers.returnJsonArray(returnData)]; + } +} diff --git a/packages/nodes-base/nodes/Google/Task/TaskDescription.ts b/packages/nodes-base/nodes/Google/Task/TaskDescription.ts new file mode 100644 index 0000000000..24c5b9018b --- /dev/null +++ b/packages/nodes-base/nodes/Google/Task/TaskDescription.ts @@ -0,0 +1,539 @@ +import { INodeProperties } from 'n8n-workflow'; + +export const taskOperations = [ + { + displayName: 'Operation', + name: 'operation', + type: 'options', + displayOptions: { + show: { + resource: ['task'] + } + }, + options: [ + { + name: 'Create', + value: 'create', + description: 'Add a task to tasklist' + }, + { + name: 'Delete', + value: 'delete', + description: 'Delete a task' + }, + { + name: 'Get', + value: 'get', + description: 'Retrieve a task' + }, + { + name: 'Get All', + value: 'getAll', + description: 'Retrieve all tasks from a tasklist' + }, + { + name: 'Update', + value: 'update', + description: 'Update a task' + } + ], + default: 'create', + description: 'The operation to perform.' + } +] as INodeProperties[]; + +export const taskFields = [ + /* -------------------------------------------------------------------------- */ + /* task:create */ + /* -------------------------------------------------------------------------- */ + { + displayName: 'TaskList', + name: 'task', + type: 'options', + typeOptions: { + loadOptionsMethod: 'getTasks' + }, + required: true, + displayOptions: { + show: { + operation: ['create'], + resource: ['task'] + } + }, + default: '' + }, + { + displayName: 'Additional Fields', + name: 'additionalFields', + type: 'collection', + placeholder: 'Add Field', + default: {}, + displayOptions: { + show: { + operation: ['create'], + resource: ['task'] + } + }, + options: [ + { + displayName: 'Status', + name: 'status', + type: 'options', + options: [ + { + name: 'needs Action', + value: 'needsAction' + }, + { + name: 'completed', + value: 'completed' + } + ], + default: '', + description: 'Current status of the task.' + }, + { + displayName: 'Links', + name: 'links', + type: 'string', + typeOptions: { + multipleValues: true, + multipleValueButtonText: 'Add Link' + }, + default: '', + description: 'The links to insert in the task.' + }, + + { + displayName: 'Notes', + name: 'notes', + type: 'string', + default: '', + description: 'Additional Notes.' + }, + { + displayName: 'Title', + name: 'title', + type: 'string', + default: '', + description: 'Title of the task.' + }, + { + displayName: 'Due Date', + name: 'dueDate', + type: 'dateTime', + default: '', + description: 'Due date of the task.' + }, + { + displayName: 'Completion date', + name: 'completed', + type: 'dateTime', + default: '', + description: `Completion date of the task (as a RFC 3339 timestamp). This field is omitted if the task has not been completed.` + }, + + { + displayName: 'Deleted status', + name: 'deleted', + type: 'boolean', + default: false, + description: 'Flag indicating whether the task has been deleted.' + }, + { + displayName: 'Hidden', + name: 'hidden', + type: 'boolean', + default: false, + description: 'Flag indicating whether the task is hidden.' + }, + { + displayName: 'Parent', + name: 'parent', + type: 'string', + default: '', + description: + 'Parent task identifier.This field is omitted if it is a top-level task.' + }, + { + displayName: 'Position', + name: 'position', + type: 'string', + default: '', + description: + 'Parent task identifier.This field is omitted if it is a top-level task.' + }, + { + displayName: 'Self Link', + name: 'selfLink', + type: 'string', + default: '', + description: + 'URL pointing to this task. Used to retrieve, update, or delete this task.' + }, + { + displayName: 'Previous', + name: 'previous', + type: 'string', + default: '', + description: + 'Previous sibling task identifier. If the task is created at the first position among its siblings, this parameter is omitted.' + } + ] + }, + /* -------------------------------------------------------------------------- */ + /* task:delete */ + /* -------------------------------------------------------------------------- */ + { + displayName: 'TaskList', + name: 'task', + type: 'options', + typeOptions: { + loadOptionsMethod: 'getTasks' + }, + required: true, + displayOptions: { + show: { + operation: ['delete'], + resource: ['task'] + } + }, + default: '' + }, + { + displayName: 'Task ID', + name: 'taskId', + type: 'string', + required: true, + displayOptions: { + show: { + operation: ['delete'], + resource: ['task'] + } + }, + default: '' + }, + /* -------------------------------------------------------------------------- */ + /* task:get */ + /* -------------------------------------------------------------------------- */ + { + displayName: 'TaskList', + name: 'task', + type: 'options', + typeOptions: { + loadOptionsMethod: 'getTasks' + }, + required: true, + displayOptions: { + show: { + operation: ['get'], + resource: ['task'] + } + }, + default: '' + }, + { + displayName: 'Task ID', + name: 'taskId', + type: 'string', + required: true, + displayOptions: { + show: { + operation: ['get'], + resource: ['task'] + } + }, + default: '' + }, + /* -------------------------------------------------------------------------- */ + /* task:getAll */ + /* -------------------------------------------------------------------------- */ + { + displayName: 'TaskList', + name: 'task', + type: 'options', + typeOptions: { + loadOptionsMethod: 'getTasks' + }, + required: true, + displayOptions: { + show: { + operation: ['getAll'], + resource: ['task'] + } + }, + default: '' + }, + { + displayName: 'Return All', + name: 'returnAll', + type: 'boolean', + displayOptions: { + show: { + operation: ['getAll'], + resource: ['task'] + } + }, + default: false, + description: + 'If all results should be returned or only up to a given limit.' + }, + { + displayName: 'Limit', + name: 'limit', + type: 'number', + displayOptions: { + show: { + operation: ['getAll'], + resource: ['task'], + returnAll: [false] + } + }, + typeOptions: { + minValue: 1, + maxValue: 100 + }, + default: 20, + description: 'How many results to return.' + }, + { + displayName: 'Additional Fields', + name: 'additionalFields', + type: 'collection', + placeholder: 'Add Field', + default: {}, + displayOptions: { + show: { + operation: ['getAll'], + resource: ['task'] + } + }, + + options: [ + { + displayName: 'Completed Max', + name: 'completedMax', + type: 'dateTime', + default: '', + description: + 'Upper bound for a task completion date (as a RFC 3339 timestamp) to filter by.' + }, + { + displayName: 'Completed Min', + name: 'completedMin', + type: 'dateTime', + default: '', + description: + 'Lower bound for a task completion date (as a RFC 3339 timestamp) to filter by.' + }, + { + displayName: 'Due Min', + name: 'dueMin', + type: 'dateTime', + default: '', + description: + 'Lower bound for a task due date (as a RFC 3339 timestamp) to filter by.' + }, + { + displayName: 'Due Max', + name: 'dueMax', + type: 'dateTime', + default: '', + description: + 'Upper bound for a task due date (as a RFC 3339 timestamp) to filter by.' + }, + + { + displayName: 'Page Token', + name: 'pageToken', + type: 'string', + default: '', + description: 'Token specifying the result page to return.' + }, + + { + displayName: 'Show Completed', + name: 'showCompleted', + type: 'boolean', + default: true, + description: + 'Flag indicating whether completed tasks are returned in the result' + }, + { + displayName: 'Show Deleted', + name: 'showDeleted', + type: 'boolean', + default: false, + description: + 'Flag indicating whether deleted tasks are returned in the result' + }, + { + displayName: 'Show Hidden', + name: 'showHidden', + type: 'boolean', + default: false, + description: + 'Flag indicating whether hidden tasks are returned in the result' + }, + { + displayName: 'updated Min', + name: 'updatedMin', + type: 'string', + + description: + 'Lower bound for a task last modification time (as a RFC 3339 timestamp) to filter by.' + } + ] + }, + /* -------------------------------------------------------------------------- */ + /* task:update */ + /* -------------------------------------------------------------------------- */ + { + displayName: 'TaskList', + name: 'task', + type: 'options', + typeOptions: { + loadOptionsMethod: 'getTasks' + }, + required: true, + displayOptions: { + show: { + operation: ['update'], + resource: ['task'] + } + }, + default: '' + }, + { + displayName: 'Task ID', + name: 'taskId', + type: 'string', + required: true, + displayOptions: { + show: { + operation: ['update'], + resource: ['task'] + } + }, + default: '' + }, + { + displayName: 'Update Fields', + name: 'updateFields', + type: 'collection', + placeholder: 'Update Field', + default: {}, + displayOptions: { + show: { + operation: ['update'], + resource: ['task'] + } + }, + options: [ + { + displayName: 'Status', + name: 'status', + type: 'options', + options: [ + { + name: 'needs Action', + value: 'needsAction' + }, + { + name: 'completed', + value: 'completed' + } + ], + default: '', + description: 'Current status of the task.' + }, + { + displayName: 'Links', + name: 'links', + type: 'string', + typeOptions: { + multipleValues: true, + multipleValueButtonText: 'Add Link' + }, + default: '', + description: 'The links to insert in the task.' + }, + + { + displayName: 'Notes', + name: 'notes', + type: 'string', + default: '', + description: 'Additional Notes.' + }, + { + displayName: 'Title', + name: 'title', + type: 'string', + default: '', + description: 'Title of the task.' + }, + { + displayName: 'Due Date', + name: 'dueDate', + type: 'dateTime', + default: '', + description: 'Due date of the task.' + }, + { + displayName: 'Completion date', + name: 'completed', + type: 'dateTime', + default: '', + description: `Completion date of the task (as a RFC 3339 timestamp). This field is omitted if the task has not been completed.` + }, + + { + displayName: 'Deleted status', + name: 'deleted', + type: 'boolean', + default: false, + description: 'Flag indicating whether the task has been deleted.' + }, + { + displayName: 'Hidden', + name: 'hidden', + type: 'boolean', + default: false, + description: 'Flag indicating whether the task is hidden.' + }, + { + displayName: 'Parent', + name: 'parent', + type: 'string', + default: '', + description: + 'Parent task identifier.This field is omitted if it is a top-level task.' + }, + { + displayName: 'Position', + name: 'position', + type: 'string', + default: '', + description: + 'Parent task identifier.This field is omitted if it is a top-level task.' + }, + { + displayName: 'Self Link', + name: 'selfLink', + type: 'string', + default: '', + description: + 'URL pointing to this task. Used to retrieve, update, or delete this task.' + }, + { + displayName: 'Previous', + name: 'previous', + type: 'string', + default: '', + description: + 'Previous sibling task identifier. If the task is created at the first position among its siblings, this parameter is omitted.' + } + ] + } +] as INodeProperties[]; diff --git a/packages/nodes-base/nodes/Google/Task/googleTasks.png b/packages/nodes-base/nodes/Google/Task/googleTasks.png new file mode 100644 index 0000000000000000000000000000000000000000..f0339e5bfeef3f8b4f46a91af01ee4b437e1d341 GIT binary patch literal 2540 zcmZ{mXE@x862|{ny&XZc=q)zEvic%8s|UMc^}f*}h`NXtqDG4oH5{^{Eu!~MlxQ0q zD@2bHZIuu;$Cdl-ez?!PGw(Aq&u>0YJi<_$o`#bK004Sj9k}t0EB{U^ikqr*HS2R@ zAQyE5bpWVIp}le-zv=nVI>rV75G(=!5ibGY;${@_9RU0x0I+R;LuCN~+q2wOycGokd;HPED7qhMg;r|+Mwqyqq|16{bfiR1y~d)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)%-|${5hjWqnKyAq9zFlEz&ohr0URd4akE z_5r4QHi9Ch*dKJC1!at$D*9SnX0`efHQHJ!>=7u2$H;1FvJ9aC&6R2#(T!dOMUF42 z8Z5lG6tvXPxs=i7vCRoA2qI-FbSaYjOuKc>h2^UxP1D)93Jjj1s|oIHIfTZ2!y?bZ zXJV2Yn1t-L=!b_He}}^1nP#r~nbj0X?PCwwamqwr|tP(boNa8e?JSd$QyU=pe7S3}BV+E2edTqJsBrwgx-9oQ`Jtp9P*SyX zS}S-p?RoFYJJD}P?BQLQ(2efFy@7gKFO`Udx0`IO#M-cDvIAMglQ^M<>adA2WH!?K zQ=?Et$dtL4-(cQI$}79YW5$Wur_GUz)9!z=X~Q4^FQfwK2Le+!KJ*j_Y-POXEPu6+ zaX4usoW?8#ZaWMxs(L$;q+Gec(*OKnadzm>EP+!^lA?@QPuMcJo+%KJ_5SogsO;BW zYEhyLfh%Yyp7P7}(P?s~74P_7-=^)U^!hI^>F_ZN{fd0pp!sv9h>wShLO3GlLffVN z%%_nchmjIhI*hXi;lCP~3nv*lVN!lgZl`tg4hj2dn)^L=@N-f^`#9YgAPtd*h(qMW yrDRN`p-NDwk`(kF1fm3iFs(&v{}15d_1Mih=>G%uEh?8c0HCXB2>+mAANe0Tk+m5B literal 0 HcmV?d00001 diff --git a/packages/nodes-base/nodes/MessageBird/MessageBird.node.ts b/packages/nodes-base/nodes/MessageBird/MessageBird.node.ts index 9c74b6a3d9..5a7418a708 100644 --- a/packages/nodes-base/nodes/MessageBird/MessageBird.node.ts +++ b/packages/nodes-base/nodes/MessageBird/MessageBird.node.ts @@ -1,17 +1,13 @@ -import { - IExecuteFunctions, - } from 'n8n-core'; +import { IExecuteFunctions } from 'n8n-core'; import { IDataObject, INodeTypeDescription, INodeExecutionData, - INodeType, + INodeType } from 'n8n-workflow'; -import { - messageBirdApiRequest, - } from './GenericFunctions'; +import { messageBirdApiRequest } from './GenericFunctions'; export class MessageBird implements INodeType { description: INodeTypeDescription = { @@ -55,20 +51,18 @@ export class MessageBird implements INodeType { type: 'options', displayOptions: { show: { - resource: [ - 'sms', - ], - }, + resource: ['sms'] + } }, options: [ { name: 'Send', value: 'send', - description: 'Send text messages (SMS)', - }, + description: 'Send text messages (SMS)' + } ], default: 'send', - description: 'The operation to perform.', + description: 'The operation to perform.' }, // ---------------------------------- @@ -83,15 +77,11 @@ export class MessageBird implements INodeType { required: true, displayOptions: { show: { - operation: [ - 'send', - ], - resource: [ - 'sms', - ], - }, + operation: ['send'], + resource: ['sms'] + } }, - description: 'The number from which to send the message.', + description: 'The number from which to send the message.' }, { displayName: 'To', @@ -103,10 +93,10 @@ export class MessageBird implements INodeType { displayOptions: { show: { operation: ['send'], - resource: ['sms'], - }, + resource: ['sms'] + } }, - description: 'All recipients separated by commas.', + description: 'All recipients separated by commas.' }, { @@ -117,15 +107,11 @@ export class MessageBird implements INodeType { required: true, displayOptions: { show: { - operation: [ - 'send', - ], - resource: [ - 'sms', - ], - }, + operation: ['send'], + resource: ['sms'] + } }, - description: 'The message to be send.', + description: 'The message to be send.' }, { displayName: 'Additional Fields', @@ -139,7 +125,8 @@ export class MessageBird implements INodeType { name: 'createdDatetime', type: 'dateTime', default: '', - description: 'The date and time of the creation of the message in RFC3339 format (Y-m-dTH:i:sP).', + description: + 'The date and time of the creation of the message in RFC3339 format (Y-m-dTH:i:sP).' }, { displayName: 'Datacoding', @@ -148,26 +135,27 @@ export class MessageBird implements INodeType { options: [ { name: 'Auto', - value: 'auto', + value: 'auto' }, { name: 'Plain', - value: 'plain', + value: 'plain' }, { name: 'Unicode', - value: 'unicode', - }, + value: 'unicode' + } ], default: '', - description: 'Using unicode will limit the maximum number of characters to 70 instead of 160.', + description: + 'Using unicode will limit the maximum number of characters to 70 instead of 160.' }, { displayName: 'Gateway', name: 'gateway', type: 'number', default: '', - description: 'The SMS route that is used to send the message.', + description: 'The SMS route that is used to send the message.' }, { displayName: 'Group IDs', @@ -175,7 +163,8 @@ export class MessageBird implements INodeType { placeholder: '1,2', type: 'string', default: '', - description: 'Group IDs separated by commas, If provided recipients can be omitted.', + description: + 'Group IDs separated by commas, If provided recipients can be omitted.' }, { displayName: 'Message Type', @@ -185,36 +174,39 @@ export class MessageBird implements INodeType { options: [ { name: 'Flash', - value: 1, + value: 1 }, { name: 'Normal', - value: 0, - }, + value: 0 + } ], default: 1, - description: 'Indicated the message type. 1 is a normal message, 0 is a flash message.', + description: + 'Indicated the message type. 1 is a normal message, 0 is a flash message.' }, { displayName: 'Reference', name: 'reference', type: 'string', default: '', - description: 'A client reference.', + description: 'A client reference.' }, { displayName: 'Report Url', name: 'reportUrl', type: 'string', default: '', - description: 'The status report URL to be used on a per-message basis.
Reference is required for a status report webhook to be sent.', + description: + 'The status report URL to be used on a per-message basis.
Reference is required for a status report webhook to be sent.' }, { displayName: 'Scheduled Date-time', name: 'scheduledDatetime', type: 'dateTime', default: '', - description: 'The scheduled date and time of the message in RFC3339 format (Y-m-dTH:i:sP).', + description: + 'The scheduled date and time of the message in RFC3339 format (Y-m-dTH:i:sP).' }, { displayName: 'Type', @@ -232,17 +224,19 @@ export class MessageBird implements INodeType { { name: 'SMS', value: 'sms' - }, + } ], default: '', - description: 'The type of message.
Values can be: sms, binary, or flash.', + description: + 'The type of message.
Values can be: sms, binary, or flash.' }, { displayName: 'Type Details', name: 'typeDetails', type: 'string', default: '', - description: 'A hash with extra information.
Is only used when a binary message is sent.', + description: + 'A hash with extra information.
Is only used when a binary message is sent.' }, { displayName: 'Validity', @@ -250,13 +244,13 @@ export class MessageBird implements INodeType { type: 'number', default: 1, typeOptions: { - minValue: 1, + minValue: 1 }, - description: 'The amount of seconds that the message is valid.', - }, - ], - }, - ], + description: 'The amount of seconds that the message is valid.' + } + ] + } + ] }; async execute(this: IExecuteFunctions): Promise { diff --git a/packages/nodes-base/package.json b/packages/nodes-base/package.json index 7566f70f06..dc4b084109 100644 --- a/packages/nodes-base/package.json +++ b/packages/nodes-base/package.json @@ -61,6 +61,7 @@ "dist/credentials/GoogleDriveOAuth2Api.credentials.js", "dist/credentials/GoogleOAuth2Api.credentials.js", "dist/credentials/GoogleSheetsOAuth2Api.credentials.js", + "dist/credentials/GoogleTasksOAuth2Api.credentials.js", "dist/credentials/GumroadApi.credentials.js", "dist/credentials/HarvestApi.credentials.js", "dist/credentials/HelpScoutOAuth2Api.credentials.js", @@ -194,6 +195,7 @@ "dist/nodes/Google/Calendar/GoogleCalendar.node.js", "dist/nodes/Google/Drive/GoogleDrive.node.js", "dist/nodes/Google/Sheet/GoogleSheets.node.js", + "dist/nodes/Google/Task/GoogleTasks.node.js", "dist/nodes/GraphQL/GraphQL.node.js", "dist/nodes/Gumroad/GumroadTrigger.node.js", "dist/nodes/Harvest/Harvest.node.js", From cd2dac76753e66481c366990f97f0282174a4122 Mon Sep 17 00:00:00 2001 From: ricardo Date: Mon, 15 Jun 2020 20:27:16 -0400 Subject: [PATCH 070/241] :zap: Small fix --- packages/nodes-base/package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/nodes-base/package.json b/packages/nodes-base/package.json index 649bde4837..dcfaeb2269 100644 --- a/packages/nodes-base/package.json +++ b/packages/nodes-base/package.json @@ -131,6 +131,7 @@ "dist/credentials/UpleadApi.credentials.js", "dist/credentials/VeroApi.credentials.js", "dist/credentials/WebflowApi.credentials.js", + "dist/credentials/WebflowOAuth2Api.credentials.js", "dist/credentials/WooCommerceApi.credentials.js", "dist/credentials/WordpressApi.credentials.js", "dist/credentials/ZendeskApi.credentials.js", From 346ae8efc96e7f6f86522ba01b31a56170c6c405 Mon Sep 17 00:00:00 2001 From: ricardo Date: Mon, 15 Jun 2020 20:31:18 -0400 Subject: [PATCH 071/241] :zap: Improvements to Webflow-Node --- .../credentials/WebflowOAuth2Api.credentials.ts | 2 +- .../nodes-base/nodes/Webflow/GenericFunctions.ts | 15 ++++++++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/packages/nodes-base/credentials/WebflowOAuth2Api.credentials.ts b/packages/nodes-base/credentials/WebflowOAuth2Api.credentials.ts index c19e451741..ba5501910c 100644 --- a/packages/nodes-base/credentials/WebflowOAuth2Api.credentials.ts +++ b/packages/nodes-base/credentials/WebflowOAuth2Api.credentials.ts @@ -28,7 +28,7 @@ export class WebflowOAuth2Api implements ICredentialType { { displayName: 'Scope', name: 'scope', - type: 'string' as NodePropertyTypes, + type: 'hidden' as NodePropertyTypes, default: '', }, { diff --git a/packages/nodes-base/nodes/Webflow/GenericFunctions.ts b/packages/nodes-base/nodes/Webflow/GenericFunctions.ts index cc10d218a9..783b674808 100644 --- a/packages/nodes-base/nodes/Webflow/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Webflow/GenericFunctions.ts @@ -1,4 +1,7 @@ -import { OptionsWithUri } from 'request'; +import { + OptionsWithUri, +} from 'request'; + import { IExecuteFunctions, IExecuteSingleFunctions, @@ -6,7 +9,10 @@ import { ILoadOptionsFunctions, IWebhookFunctions, } from 'n8n-core'; -import { IDataObject } from 'n8n-workflow'; + +import { + IDataObject, + } from 'n8n-workflow'; export async function webflowApiRequest(this: IHookFunctions | IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions | IWebhookFunctions, method: string, resource: string, body: any = {}, qs: IDataObject = {}, uri?: string, option: IDataObject = {}): Promise { // tslint:disable-line:no-any const authenticationMethod = this.getNodeParameter('authentication', 0); @@ -40,6 +46,9 @@ export async function webflowApiRequest(this: IHookFunctions | IExecuteFunctions return await this.helpers.requestOAuth2!.call(this, 'webflowOAuth2Api', options); } } catch (error) { - throw new Error('Webflow Error: ' + error.code + error.msg); + if (error.response.body.err) { + throw new Error(`Webflow Error: [${error.statusCode}]: ${error.response.body.err}`); + } + return error; } } From 9a449284aedb956bbe9aad94eb64f66f2392e510 Mon Sep 17 00:00:00 2001 From: Rupenieks Date: Tue, 16 Jun 2020 11:45:47 +0200 Subject: [PATCH 072/241] Drift OAuth2 support --- .../credentials/DriftOAuth2Api.credentials.ts | 41 +++++++++++++++++++ packages/nodes-base/nodes/Drift/Drift.node.ts | 35 ++++++++++++++++ .../nodes/Drift/GenericFunctions.ts | 33 ++++++++------- packages/nodes-base/package.json | 1 + 4 files changed, 96 insertions(+), 14 deletions(-) create mode 100644 packages/nodes-base/credentials/DriftOAuth2Api.credentials.ts diff --git a/packages/nodes-base/credentials/DriftOAuth2Api.credentials.ts b/packages/nodes-base/credentials/DriftOAuth2Api.credentials.ts new file mode 100644 index 0000000000..5b509c5981 --- /dev/null +++ b/packages/nodes-base/credentials/DriftOAuth2Api.credentials.ts @@ -0,0 +1,41 @@ +import { + ICredentialType, + NodePropertyTypes, +} from 'n8n-workflow'; + + +export class DriftOAuth2Api implements ICredentialType { + name = 'driftOAuth2Api'; + extends = [ + 'oAuth2Api', + ]; + displayName = 'Drift OAuth2 API'; + properties = [ + { + displayName: 'Authorization URL', + name: 'authUrl', + type: 'hidden' as NodePropertyTypes, + default: 'ttps://dev.drift.com/authorize', + required: true, + }, + { + displayName: 'Access Token URL', + name: 'accessTokenUrl', + type: 'hidden' as NodePropertyTypes, + default: 'https://driftapi.com/oauth2/token', + required: true, + }, + { + displayName: 'Auth URI Query Parameters', + name: 'authQueryParameters', + type: 'hidden' as NodePropertyTypes, + default: '', + }, + { + displayName: 'Authentication', + name: 'authentication', + type: 'hidden' as NodePropertyTypes, + default: 'body', + }, + ]; +} diff --git a/packages/nodes-base/nodes/Drift/Drift.node.ts b/packages/nodes-base/nodes/Drift/Drift.node.ts index 53a9a2695e..46afa3d519 100644 --- a/packages/nodes-base/nodes/Drift/Drift.node.ts +++ b/packages/nodes-base/nodes/Drift/Drift.node.ts @@ -37,9 +37,44 @@ export class Drift implements INodeType { { name: 'driftApi', required: true, + displayOptions: { + show: { + authentication: [ + 'accessToken', + ], + }, + }, + }, + { + name: 'driftOAuth2Api', + required: true, + displayOptions: { + show: { + authentication: [ + 'oAuth2', + ], + }, + }, }, ], properties: [ + { + displayName: 'Authentication', + name: 'authentication', + type: 'options', + options: [ + { + name: 'Access Token', + value: 'accessToken', + }, + { + name: 'OAuth2', + value: 'oAuth2', + }, + ], + default: 'accessToken', + description: 'The resource to operate on.', + }, { displayName: 'Resource', name: 'resource', diff --git a/packages/nodes-base/nodes/Drift/GenericFunctions.ts b/packages/nodes-base/nodes/Drift/GenericFunctions.ts index 47b38a86e3..c28d6bd5a2 100644 --- a/packages/nodes-base/nodes/Drift/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Drift/GenericFunctions.ts @@ -12,25 +12,15 @@ import { } from 'n8n-workflow'; export async function driftApiRequest(this: IExecuteFunctions | IWebhookFunctions | IHookFunctions | ILoadOptionsFunctions, method: string, resource: string, body: any = {}, query: IDataObject = {}, uri?: string, option: IDataObject = {}): Promise { // tslint:disable-line:no-any - - const credentials = this.getCredentials('driftApi'); - - if (credentials === undefined) { - throw new Error('No credentials got returned!'); - } - - const endpoint = 'https://driftapi.com'; - let options: OptionsWithUri = { - headers: { - Authorization: `Bearer ${credentials.accessToken}`, - }, + headers: {}, method, body, qs: query, - uri: uri || `${endpoint}${resource}`, + uri: uri || `https://driftapi.com${resource}`, json: true }; + if (!Object.keys(body).length) { delete options.form; } @@ -38,8 +28,23 @@ export async function driftApiRequest(this: IExecuteFunctions | IWebhookFunction delete options.qs; } options = Object.assign({}, options, option); + + const authenticationMethod = this.getNodeParameter('authentication', 0); + try { - return await this.helpers.request!(options); + if (authenticationMethod === 'accessToken') { + const credentials = this.getCredentials('driftApi'); + + if (credentials === undefined) { + throw new Error('No credentials got returned!'); + } + + options.headers!['Authorization'] = `Bearer ${credentials.accessToken}`; + + return await this.helpers.request!(options); + } else { + return await this.helpers.requestOAuth2!.call(this, 'driftOAuth2Api', options); + } } catch (error) { if (error.response) { const errorMessage = error.message || (error.response.body && error.response.body.message ); diff --git a/packages/nodes-base/package.json b/packages/nodes-base/package.json index dcfaeb2269..6c8c541998 100644 --- a/packages/nodes-base/package.json +++ b/packages/nodes-base/package.json @@ -47,6 +47,7 @@ "dist/credentials/CalendlyApi.credentials.js", "dist/credentials/DisqusApi.credentials.js", "dist/credentials/DriftApi.credentials.js", + "dist/credentials/DriftOAuth2Api.credentials.js", "dist/credentials/DropboxApi.credentials.js", "dist/credentials/EventbriteApi.credentials.js", "dist/credentials/FacebookGraphApi.credentials.js", From 04f1f262486125399997f404e597c3047c877ac2 Mon Sep 17 00:00:00 2001 From: Rupenieks Date: Tue, 16 Jun 2020 14:16:03 +0200 Subject: [PATCH 073/241] Fixed deprecated API calls & Added OAuth2 support --- .../EventbriteOAuth2Api.credentials.ts | 60 +++++++++++++++++++ .../Eventbrite/EventbriteTrigger.node.ts | 44 +++++++++++++- .../nodes/Eventbrite/GenericFunctions.ts | 23 ++++--- packages/nodes-base/package.json | 1 + 4 files changed, 117 insertions(+), 11 deletions(-) create mode 100644 packages/nodes-base/credentials/EventbriteOAuth2Api.credentials.ts diff --git a/packages/nodes-base/credentials/EventbriteOAuth2Api.credentials.ts b/packages/nodes-base/credentials/EventbriteOAuth2Api.credentials.ts new file mode 100644 index 0000000000..ff50a115d5 --- /dev/null +++ b/packages/nodes-base/credentials/EventbriteOAuth2Api.credentials.ts @@ -0,0 +1,60 @@ +import { + ICredentialType, + NodePropertyTypes, +} from 'n8n-workflow'; + + +export class EventbriteOAuth2Api implements ICredentialType { + name = 'eventbriteOAuth2Api'; + extends = [ + 'oAuth2Api', + ]; + displayName = 'Eventbrite OAuth2 API'; + properties = [ + { + displayName: 'Authorization URL', + name: 'authUrl', + type: 'hidden' as NodePropertyTypes, + default: 'https://www.eventbrite.com/oauth/authorize', + required: true, + }, + { + displayName: 'Access Token URL', + name: 'accessTokenUrl', + type: 'hidden' as NodePropertyTypes, + default: 'https://www.eventbrite.com/oauth/token', + required: true, + }, + { + displayName: 'Scope', + name: 'scope', + type: 'hidden' as NodePropertyTypes, + default: '', + }, + { + displayName: 'Auth URI Query Parameters', + name: 'authQueryParameters', + type: 'hidden' as NodePropertyTypes, + default: '', + }, + { + displayName: 'Authentication', + name: 'authentication', + type: 'options' as NodePropertyTypes, + options: [ + { + name: 'Body', + value: 'body', + description: 'Send credentials in body', + }, + { + name: 'Header', + value: 'header', + description: 'Send credentials as Basic Auth header', + }, + ], + default: 'header', + description: 'Resource to consume.', + }, + ]; +} diff --git a/packages/nodes-base/nodes/Eventbrite/EventbriteTrigger.node.ts b/packages/nodes-base/nodes/Eventbrite/EventbriteTrigger.node.ts index fdeae599c2..8299ae866d 100644 --- a/packages/nodes-base/nodes/Eventbrite/EventbriteTrigger.node.ts +++ b/packages/nodes-base/nodes/Eventbrite/EventbriteTrigger.node.ts @@ -35,7 +35,25 @@ export class EventbriteTrigger implements INodeType { { name: 'eventbriteApi', required: true, - } + displayOptions: { + show: { + authentication: [ + 'accessToken', + ], + }, + }, + }, + { + name: 'eventbriteOAuth2Api', + required: true, + displayOptions: { + show: { + authentication: [ + 'oAuth2', + ], + }, + }, + }, ], webhooks: [ { @@ -46,6 +64,23 @@ export class EventbriteTrigger implements INodeType { }, ], properties: [ + { + displayName: 'Authentication', + name: 'authentication', + type: 'options', + options: [ + { + name: 'Access Token', + value: 'accessToken', + }, + { + name: 'OAuth2', + value: 'oAuth2', + }, + ], + default: 'accessToken', + description: 'The resource to operate on.', + }, { displayName: 'Organization', name: 'organization', @@ -192,10 +227,12 @@ export class EventbriteTrigger implements INodeType { default: { async checkExists(this: IHookFunctions): Promise { const webhookData = this.getWorkflowStaticData('node'); + const organisation = this.getNodeParameter('organization') as string; + if (webhookData.webhookId === undefined) { return false; } - const endpoint = `/webhooks/${webhookData.webhookId}/`; + const endpoint = `/organizations/${organisation}/webhooks/`; try { await eventbriteApiRequest.call(this, 'GET', endpoint); } catch (e) { @@ -206,9 +243,10 @@ export class EventbriteTrigger implements INodeType { async create(this: IHookFunctions): Promise { const webhookUrl = this.getNodeWebhookUrl('default'); const webhookData = this.getWorkflowStaticData('node'); + const organisation = this.getNodeParameter('organization') as string; const event = this.getNodeParameter('event') as string; const actions = this.getNodeParameter('actions') as string[]; - const endpoint = `/webhooks/`; + const endpoint = `/organizations/${organisation}/webhooks/`; const body: IDataObject = { endpoint_url: webhookUrl, actions: actions.join(','), diff --git a/packages/nodes-base/nodes/Eventbrite/GenericFunctions.ts b/packages/nodes-base/nodes/Eventbrite/GenericFunctions.ts index 285c89b1f8..5bbb517c5d 100644 --- a/packages/nodes-base/nodes/Eventbrite/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Eventbrite/GenericFunctions.ts @@ -9,13 +9,8 @@ import { import { IDataObject } from 'n8n-workflow'; export async function eventbriteApiRequest(this: IHookFunctions | IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions | IWebhookFunctions, method: string, resource: string, body: any = {}, qs: IDataObject = {}, uri?: string, option: IDataObject = {}): Promise { // tslint:disable-line:no-any - const credentials = this.getCredentials('eventbriteApi'); - if (credentials === undefined) { - throw new Error('No credentials got returned!'); - } - let options: OptionsWithUri = { - headers: { 'Authorization': `Bearer ${credentials.apiKey}`}, + headers: {}, method, qs, body, @@ -27,14 +22,26 @@ export async function eventbriteApiRequest(this: IHookFunctions | IExecuteFuncti delete options.body; } + const authenticationMethod = this.getNodeParameter('authentication', 0); + try { - return await this.helpers.request!(options); + if (authenticationMethod === 'accessToken') { + const credentials = this.getCredentials('eventbriteApi'); + if (credentials === undefined) { + throw new Error('No credentials got returned!'); + } + + options.headers!['Authorization'] = `Bearer ${credentials.apiKey}`; + + return await this.helpers.request!(options); + } else { + return await this.helpers.requestOAuth2!.call(this, 'eventbriteOAuth2Api', options); + } } catch (error) { let errorMessage = error.message; if (error.response.body && error.response.body.error_description) { errorMessage = error.response.body.error_description; } - throw new Error('Eventbrite Error: ' + errorMessage); } } diff --git a/packages/nodes-base/package.json b/packages/nodes-base/package.json index dcfaeb2269..ba9899b2d1 100644 --- a/packages/nodes-base/package.json +++ b/packages/nodes-base/package.json @@ -49,6 +49,7 @@ "dist/credentials/DriftApi.credentials.js", "dist/credentials/DropboxApi.credentials.js", "dist/credentials/EventbriteApi.credentials.js", + "dist/credentials/EventbriteOAuth2Api.credentials.js", "dist/credentials/FacebookGraphApi.credentials.js", "dist/credentials/FreshdeskApi.credentials.js", "dist/credentials/FileMaker.credentials.js", From 755079c3607d06f2f4bbb780a003b12776f6754b Mon Sep 17 00:00:00 2001 From: Rupenieks Date: Tue, 16 Jun 2020 14:16:53 +0200 Subject: [PATCH 074/241] Update EventbriteOAuth2Api.credentials.ts --- .../EventbriteOAuth2Api.credentials.ts | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/packages/nodes-base/credentials/EventbriteOAuth2Api.credentials.ts b/packages/nodes-base/credentials/EventbriteOAuth2Api.credentials.ts index ff50a115d5..46a9df4266 100644 --- a/packages/nodes-base/credentials/EventbriteOAuth2Api.credentials.ts +++ b/packages/nodes-base/credentials/EventbriteOAuth2Api.credentials.ts @@ -40,21 +40,8 @@ export class EventbriteOAuth2Api implements ICredentialType { { displayName: 'Authentication', name: 'authentication', - type: 'options' as NodePropertyTypes, - options: [ - { - name: 'Body', - value: 'body', - description: 'Send credentials in body', - }, - { - name: 'Header', - value: 'header', - description: 'Send credentials as Basic Auth header', - }, - ], - default: 'header', - description: 'Resource to consume.', + type: 'hidden' as NodePropertyTypes, + default: 'body' }, ]; } From 39f5cf92d829469a31aefce63226229e439c2632 Mon Sep 17 00:00:00 2001 From: Rupenieks Date: Tue, 16 Jun 2020 15:50:17 +0200 Subject: [PATCH 075/241] Gitlab OAuth2 support --- .../GitlabOAuth2Api.credentials.ts | 53 +++++++++++++++++ .../nodes/Gitlab/GenericFunctions.ts | 42 +++++++++---- .../nodes-base/nodes/Gitlab/Gitlab.node.ts | 59 +++++++++++++++++-- .../nodes/Gitlab/GitlabTrigger.node.ts | 37 +++++++++++- packages/nodes-base/package.json | 1 + 5 files changed, 176 insertions(+), 16 deletions(-) create mode 100644 packages/nodes-base/credentials/GitlabOAuth2Api.credentials.ts diff --git a/packages/nodes-base/credentials/GitlabOAuth2Api.credentials.ts b/packages/nodes-base/credentials/GitlabOAuth2Api.credentials.ts new file mode 100644 index 0000000000..60cc091836 --- /dev/null +++ b/packages/nodes-base/credentials/GitlabOAuth2Api.credentials.ts @@ -0,0 +1,53 @@ +import { + ICredentialType, + NodePropertyTypes, +} from 'n8n-workflow'; + + +export class GitlabOAuth2Api implements ICredentialType { + name = 'gitlabOAuth2Api'; + extends = [ + 'oAuth2Api', + ]; + displayName = 'Gitlab OAuth2 API'; + properties = [ + { + displayName: 'Gitlab Server', + name: 'server', + type: 'string' as NodePropertyTypes, + default: 'https://gitlab.com' + }, + { + displayName: 'Authorization URL', + name: 'authUrl', + type: 'hidden' as NodePropertyTypes, + default: 'https://gitlab.com/oauth/authorize', + required: true, + }, + { + displayName: 'Access Token URL', + name: 'accessTokenUrl', + type: 'hidden' as NodePropertyTypes, + default: 'https://gitlab.com/oauth/token', + required: true, + }, + { + displayName: 'Scope', + name: 'scope', + type: 'string' as NodePropertyTypes, + default: 'api', + }, + { + displayName: 'Auth URI Query Parameters', + name: 'authQueryParameters', + type: 'hidden' as NodePropertyTypes, + default: '', + }, + { + displayName: 'Authentication', + name: 'authentication', + type: 'hidden' as NodePropertyTypes, + default: 'body', + }, + ]; +} diff --git a/packages/nodes-base/nodes/Gitlab/GenericFunctions.ts b/packages/nodes-base/nodes/Gitlab/GenericFunctions.ts index 8f1811b8c7..4b91358b28 100644 --- a/packages/nodes-base/nodes/Gitlab/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Gitlab/GenericFunctions.ts @@ -6,6 +6,7 @@ import { import { IDataObject, } from 'n8n-workflow'; +import { OptionsWithUri } from 'request'; /** * Make an API request to Gitlab @@ -17,24 +18,43 @@ import { * @returns {Promise} */ export async function gitlabApiRequest(this: IHookFunctions | IExecuteFunctions, method: string, endpoint: string, body: object, query?: object): Promise { // tslint:disable-line:no-any - const credentials = this.getCredentials('gitlabApi'); - if (credentials === undefined) { - throw new Error('No credentials got returned!'); - } - - const options = { + const options : OptionsWithUri = { method, - headers: { - 'Private-Token': `${credentials.accessToken}`, - }, + headers: {}, body, qs: query, - uri: `${(credentials.server as string).replace(/\/$/, '')}/api/v4${endpoint}`, + uri: '', json: true }; + if (query === undefined) { + delete options.qs; + } + + const authenticationMethod = this.getNodeParameter('authentication', 0); + try { - return await this.helpers.request(options); + if (authenticationMethod === 'accessToken') { + const credentials = this.getCredentials('gitlabApi'); + if (credentials === undefined) { + throw new Error('No credentials got returned!'); + } + + options.headers!['Private-Token'] = `${credentials.accessToken}`; + + options.uri = `${(credentials.server as string).replace(/\/$/, '')}/api/v4${endpoint}`; + + return await this.helpers.request(options); + } else { + const credentials = this.getCredentials('gitlabOAuth2Api'); + if (credentials === undefined) { + throw new Error('No credentials got returned!'); + } + + options.uri = `${(credentials.server as string).replace(/\/$/, '')}/api/v4${endpoint}`; + + return await this.helpers.requestOAuth2!.call(this, 'gitlabOAuth2Api', options); + } } catch (error) { if (error.statusCode === 401) { // Return a clear error diff --git a/packages/nodes-base/nodes/Gitlab/Gitlab.node.ts b/packages/nodes-base/nodes/Gitlab/Gitlab.node.ts index 39d71ae3da..920a2867ec 100644 --- a/packages/nodes-base/nodes/Gitlab/Gitlab.node.ts +++ b/packages/nodes-base/nodes/Gitlab/Gitlab.node.ts @@ -33,9 +33,44 @@ export class Gitlab implements INodeType { { name: 'gitlabApi', required: true, - } + displayOptions: { + show: { + authentication: [ + 'accessToken', + ], + }, + }, + }, + { + name: 'gitlabOAuth2Api', + required: true, + displayOptions: { + show: { + authentication: [ + 'oAuth2', + ], + }, + }, + }, ], properties: [ + { + displayName: 'Authentication', + name: 'authentication', + type: 'options', + options: [ + { + name: 'Access Token', + value: 'accessToken', + }, + { + name: 'OAuth2', + value: 'oAuth2', + }, + ], + default: 'accessToken', + description: 'The resource to operate on.', + }, { displayName: 'Resource', name: 'resource', @@ -793,10 +828,26 @@ export class Gitlab implements INodeType { const items = this.getInputData(); const returnData: IDataObject[] = []; - const credentials = this.getCredentials('gitlabApi'); + let credentials; - if (credentials === undefined) { - throw new Error('No credentials got returned!'); + const authenticationMethod = this.getNodeParameter('authentication', 0); + + try { + if (authenticationMethod === 'accessToken') { + credentials = this.getCredentials('gitlabApi'); + + if (credentials === undefined) { + throw new Error('No credentials got returned!'); + } + } else { + credentials = this.getCredentials('gitlabOAuth2Api'); + + if (credentials === undefined) { + throw new Error('No credentials got returned!'); + } + } + } catch (error) { + throw new Error(error); } // Operations which overwrite the returned data diff --git a/packages/nodes-base/nodes/Gitlab/GitlabTrigger.node.ts b/packages/nodes-base/nodes/Gitlab/GitlabTrigger.node.ts index 28987c2458..a3e9b9ee2a 100644 --- a/packages/nodes-base/nodes/Gitlab/GitlabTrigger.node.ts +++ b/packages/nodes-base/nodes/Gitlab/GitlabTrigger.node.ts @@ -34,7 +34,25 @@ export class GitlabTrigger implements INodeType { { name: 'gitlabApi', required: true, - } + displayOptions: { + show: { + authentication: [ + 'accessToken', + ], + }, + }, + }, + { + name: 'gitlabOAuth2Api', + required: true, + displayOptions: { + show: { + authentication: [ + 'oAuth2', + ], + }, + }, + }, ], webhooks: [ { @@ -45,6 +63,23 @@ export class GitlabTrigger implements INodeType { }, ], properties: [ + { + displayName: 'Authentication', + name: 'authentication', + type: 'options', + options: [ + { + name: 'Access Token', + value: 'accessToken', + }, + { + name: 'OAuth2', + value: 'oAuth2', + }, + ], + default: 'accessToken', + description: 'The resource to operate on.', + }, { displayName: 'Repository Owner', name: 'owner', diff --git a/packages/nodes-base/package.json b/packages/nodes-base/package.json index dcfaeb2269..989cb0f055 100644 --- a/packages/nodes-base/package.json +++ b/packages/nodes-base/package.json @@ -56,6 +56,7 @@ "dist/credentials/GithubApi.credentials.js", "dist/credentials/GithubOAuth2Api.credentials.js", "dist/credentials/GitlabApi.credentials.js", + "dist/credentials/GitlabOAuth2Api.credentials.js", "dist/credentials/GoogleApi.credentials.js", "dist/credentials/GoogleCalendarOAuth2Api.credentials.js", "dist/credentials/GoogleDriveOAuth2Api.credentials.js", From 717c43b21fc6378e94d544cccb87198b144564ea Mon Sep 17 00:00:00 2001 From: shraddha shaligram Date: Tue, 16 Jun 2020 12:13:34 -0700 Subject: [PATCH 076/241] minor improvements --- packages/nodes-base/nodes/Google/Task/GoogleTasks.node.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/nodes-base/nodes/Google/Task/GoogleTasks.node.ts b/packages/nodes-base/nodes/Google/Task/GoogleTasks.node.ts index 450b389376..db751cb258 100644 --- a/packages/nodes-base/nodes/Google/Task/GoogleTasks.node.ts +++ b/packages/nodes-base/nodes/Google/Task/GoogleTasks.node.ts @@ -106,7 +106,7 @@ export class GoogleTasks implements INodeType { if (additionalFields.links) { body.links = (additionalFields.links as string[]).map(link => { - return { link: link }; + return { link }; }); } if (additionalFields.status) @@ -144,7 +144,7 @@ export class GoogleTasks implements INodeType { qs ); } - if (operation == 'delete') { + if (operation === 'delete') { //https://developers.google.com/tasks/v1/reference/tasks/delete const taskListId = this.getNodeParameter('task', i) as string; const taskId = this.getNodeParameter('taskId', i) as string; @@ -226,7 +226,7 @@ export class GoogleTasks implements INodeType { responseData = responseData.items; } } - if (operation == 'update') { + if (operation === 'update') { body = {}; //https://developers.google.com/tasks/v1/reference/tasks/patch const taskListId = this.getNodeParameter('task', i) as string; From 355ccc3201f388b6c0160b8f53339e8fd571845b Mon Sep 17 00:00:00 2001 From: shraddha shaligram Date: Tue, 16 Jun 2020 17:46:38 -0700 Subject: [PATCH 077/241] add authentication --- .../credentials/ZoomApi.credentials.ts | 14 ++ .../credentials/ZoomOAuth2Api.credentials.ts | 50 +++++++ .../nodes-base/nodes/Zoom/GenericFunctions.ts | 128 ++++++++++++++++++ packages/nodes-base/nodes/Zoom/Zoom.node.ts | 103 ++++++++++++++ packages/nodes-base/nodes/Zoom/zoom.png | Bin 0 -> 1848 bytes packages/nodes-base/package.json | 3 + 6 files changed, 298 insertions(+) create mode 100644 packages/nodes-base/credentials/ZoomApi.credentials.ts create mode 100644 packages/nodes-base/credentials/ZoomOAuth2Api.credentials.ts create mode 100644 packages/nodes-base/nodes/Zoom/GenericFunctions.ts create mode 100644 packages/nodes-base/nodes/Zoom/Zoom.node.ts create mode 100644 packages/nodes-base/nodes/Zoom/zoom.png diff --git a/packages/nodes-base/credentials/ZoomApi.credentials.ts b/packages/nodes-base/credentials/ZoomApi.credentials.ts new file mode 100644 index 0000000000..3db4aadbe0 --- /dev/null +++ b/packages/nodes-base/credentials/ZoomApi.credentials.ts @@ -0,0 +1,14 @@ +import { ICredentialType, NodePropertyTypes } from 'n8n-workflow'; + +export class ZoomApi implements ICredentialType { + name = 'zoomApi'; + displayName = 'Zoom API'; + properties = [ + { + displayName: 'Access Token', + name: 'accessToken', + type: 'string' as NodePropertyTypes, + default: '' + } + ]; +} diff --git a/packages/nodes-base/credentials/ZoomOAuth2Api.credentials.ts b/packages/nodes-base/credentials/ZoomOAuth2Api.credentials.ts new file mode 100644 index 0000000000..2b05c819a7 --- /dev/null +++ b/packages/nodes-base/credentials/ZoomOAuth2Api.credentials.ts @@ -0,0 +1,50 @@ +import { ICredentialType, NodePropertyTypes } from 'n8n-workflow'; + +const userScopes = [ + 'meeting:read', + 'meeting:write', + 'user:read', + 'user:write', + 'user_profile', + 'webinar:read', + 'webinar:write' +]; + +export class ZoomOAuth2Api implements ICredentialType { + name = 'zoomOAuth2Api'; + extends = ['oAuth2Api']; + displayName = 'Zoom OAuth2 API'; + properties = [ + { + displayName: 'Authorization URL', + name: 'authUrl', + type: 'hidden' as NodePropertyTypes, + default: 'https://zoom.us/oauth/authorize' + }, + { + displayName: 'Access Token URL', + name: 'accessTokenUrl', + type: 'hidden' as NodePropertyTypes, + default: 'https://zoom.us/oauth/token' + }, + + { + displayName: 'Scope', + name: 'scope', + type: 'hidden' as NodePropertyTypes, + default: '' + }, + { + displayName: 'Auth URI Query Parameters', + name: 'authQueryParameters', + type: 'hidden' as NodePropertyTypes, + default: '' + }, + { + displayName: 'Authentication', + name: 'authentication', + type: 'hidden' as NodePropertyTypes, + default: 'body' + } + ]; +} diff --git a/packages/nodes-base/nodes/Zoom/GenericFunctions.ts b/packages/nodes-base/nodes/Zoom/GenericFunctions.ts new file mode 100644 index 0000000000..0e2feda8db --- /dev/null +++ b/packages/nodes-base/nodes/Zoom/GenericFunctions.ts @@ -0,0 +1,128 @@ +import { OptionsWithUri } from 'request'; + +import { + IExecuteFunctions, + IExecuteSingleFunctions, + ILoadOptionsFunctions +} from 'n8n-core'; + +import { IDataObject } from 'n8n-workflow'; +import * as _ from 'lodash'; + +export async function zoomApiRequest( + this: IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions, + method: string, + resource: string, + body: object = {}, + query: object = {}, + headers: {} | undefined = undefined, + option: {} = {} +): Promise { + // tslint:disable-line:no-any + const authenticationMethod = this.getNodeParameter( + 'authentication', + 0, + 'accessToken' + ) as string; + let options: OptionsWithUri = { + method, + headers: headers || { + 'Content-Type': 'application/json' + }, + body, + qs: query, + uri: `https://zoom.us/oauth${resource}`, + json: true + }; + options = Object.assign({}, options, option); + if (Object.keys(body).length === 0) { + delete options.body; + } + if (Object.keys(query).length === 0) { + delete options.qs; + } + try { + if (authenticationMethod === 'accessToken') { + const credentials = this.getCredentials('zoomApi'); + if (credentials === undefined) { + throw new Error('No credentials got returned!'); + } + options.headers!.Authorization = `Bearer ${credentials.accessToken}`; + //@ts-ignore + return await this.helpers.request(options); + } else { + //@ts-ignore + return await this.helpers.requestOAuth2.call( + this, + 'zoomOAuth2Api', + options + ); + } + } catch (error) { + if (error.statusCode === 401) { + // Return a clear error + throw new Error('The Zoom credentials are not valid!'); + } + + if (error.response && error.response.body && error.response.body.message) { + // Try to return the error prettier + throw new Error( + `Zoom error response [${error.statusCode}]: ${error.response.body.message}` + ); + } + + // If that data does not exist for some reason return the actual error + throw error; + } +} + +export async function zoomApiRequestAllItems( + this: IExecuteFunctions | ILoadOptionsFunctions, + propertyName: string, + method: string, + endpoint: string, + body: any = {}, + query: IDataObject = {} +): Promise { + // tslint:disable-line:no-any + const returnData: IDataObject[] = []; + let responseData; + query.page = 1; + query.count = 100; + do { + responseData = await zoomApiRequest.call( + this, + method, + endpoint, + body, + query + ); + query.cursor = encodeURIComponent( + _.get(responseData, 'response_metadata.next_cursor') + ); + query.page++; + returnData.push.apply(returnData, responseData[propertyName]); + } while ( + (responseData.response_metadata !== undefined && + responseData.response_metadata.mext_cursor !== undefined && + responseData.response_metadata.next_cursor !== '' && + responseData.response_metadata.next_cursor !== null) || + (responseData.paging !== undefined && + responseData.paging.pages !== undefined && + responseData.paging.page !== undefined && + responseData.paging.page < responseData.paging.pages) + ); + + return returnData; +} + +export function validateJSON(json: string | undefined): any { + // tslint:disable-line:no-any + let result; + try { + result = JSON.parse(json!); + } catch (exception) { + result = undefined; + } + return result; +} diff --git a/packages/nodes-base/nodes/Zoom/Zoom.node.ts b/packages/nodes-base/nodes/Zoom/Zoom.node.ts new file mode 100644 index 0000000000..ce32b4c51b --- /dev/null +++ b/packages/nodes-base/nodes/Zoom/Zoom.node.ts @@ -0,0 +1,103 @@ +import { IExecuteFunctions } from 'n8n-core'; +import { + IDataObject, + INodeExecutionData, + INodeType, + INodeTypeDescription +} from 'n8n-workflow'; +import { + zoomApiRequest, + zoomApiRequestAllItems, + validateJSON +} from './GenericFunctions'; +export class Zoom implements INodeType { + description: INodeTypeDescription = { + displayName: 'Zoom', + name: 'zoom', + group: ['input'], + version: 1, + description: 'Consume Zoom API', + defaults: { + name: 'Zoom', + color: '#772244' + }, + inputs: ['main'], + outputs: ['main'], + credentials: [ + { + name: 'zoomApi', + required: true, + displayOptions: { + show: { + authentication: ['accessToken'] + } + } + }, + { + name: 'zoomOAuth2Api', + required: true, + displayOptions: { + show: { + authentication: ['oAuth2'] + } + } + } + ], + properties: [ + { + displayName: 'Authentication', + name: 'authentication', + type: 'options', + options: [ + { + name: 'Access Token', + value: 'accessToken' + }, + { + name: 'OAuth2', + value: 'oAuth2' + } + ], + default: 'accessToken', + description: 'The resource to operate on.' + } + ] + }; + + async execute(this: IExecuteFunctions): Promise { + const items = this.getInputData(); + const returnData: IDataObject[] = []; + const length = (items.length as unknown) as number; + let qs: IDataObject; + let responseData; + const authentication = this.getNodeParameter('authentication', 0) as string; + const resource = this.getNodeParameter('resource', 0) as string; + const operation = this.getNodeParameter('operation', 0) as string; + for (let i = 0; i < length; i++) { + qs = {}; + if (resource === 'channel') { + //https://api.slack.com/methods/conversations.archive + if (operation === 'archive') { + const channel = this.getNodeParameter('channelId', i) as string; + const body: IDataObject = { + channel + }; + responseData = await zoomApiRequest.call( + this, + 'POST', + '/conversations.archive', + body, + qs + ); + } + } + } + if (Array.isArray(responseData)) { + returnData.push.apply(returnData, responseData as IDataObject[]); + } else { + returnData.push(responseData as IDataObject); + } + + return [this.helpers.returnJsonArray(returnData)]; + } +} diff --git a/packages/nodes-base/nodes/Zoom/zoom.png b/packages/nodes-base/nodes/Zoom/zoom.png new file mode 100644 index 0000000000000000000000000000000000000000..dfc72331ebddb8f4f2bfded903500be639581567 GIT binary patch literal 1848 zcmV-82gmq{P)Px%JbF}EbW&k=AaHVTW@&6?Aar?fWgvKMZ~y=}jg?hP zvfLmH+;fT?0ZT$M$MFnim#Qpt{B*;7-uQVkiCtx5B-E{z!0GqTU+D+0SS9IId#sUt zarKLrFv%`nJiPj@O=Rzv%cYB8zPfRygcfU>twlD4@9H(#8e3pt(b#M+=6EBZDi(=o z*Ilw+W7REI$3kxe^F=bh{px!tZHWkAW8TR_w`q8|4<^qrn7eR=Jyu9AtF@AokX(;3 zrA2mCY2cG}QJ^aF#oVH%g=5TJF)PC^((#^8Ptu0lHXJv&gyh35xAX)o;8VoR{E(WY zVPtx181Aea(&;fS*#lm(55@uHMJw+I6T!1h05A#-)Q5_oij4@gzp?-YlnR9quS2N{ zh2U|w`;s774+u+EQ`oPypupex4zT@MB8)X**pSK!KAGepZNAs)7}6TL=S|r38uvUb z0=ARj8dli4L*w+B^m%YLcR(-rbcRczLnFb0GUHR~iOujvfeV5dYgY)+{rasbGZ?{v zPC7=J4O$d!m<1g>cHpe(@R0fh8H#O2E0Ux}q+hJssN8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$!EI#xjmzwZTg8n97>lFb9`uh%paXm#Ico8{I^01|5Z3Y m^XEj^W09%Wm7f*)|MeG&CZon#`=kW`0000 Date: Wed, 17 Jun 2020 19:38:30 +0200 Subject: [PATCH 078/241] NextCloud OAuth2 support --- .../NextCloudOAuth2Api.credentials.ts | 54 +++++++++++++++ .../nodes/NextCloud/GenericFunctions.ts | 64 ++++++++++++++++++ .../nodes/NextCloud/NextCloud.node.ts | 65 ++++++++++++++----- packages/nodes-base/package.json | 1 + 4 files changed, 167 insertions(+), 17 deletions(-) create mode 100644 packages/nodes-base/credentials/NextCloudOAuth2Api.credentials.ts create mode 100644 packages/nodes-base/nodes/NextCloud/GenericFunctions.ts diff --git a/packages/nodes-base/credentials/NextCloudOAuth2Api.credentials.ts b/packages/nodes-base/credentials/NextCloudOAuth2Api.credentials.ts new file mode 100644 index 0000000000..dbb4efcda1 --- /dev/null +++ b/packages/nodes-base/credentials/NextCloudOAuth2Api.credentials.ts @@ -0,0 +1,54 @@ +import { + ICredentialType, + NodePropertyTypes, +} from 'n8n-workflow'; + + +export class NextCloudOAuth2Api implements ICredentialType { + name = 'nextCloudOAuth2Api'; + extends = [ + 'oAuth2Api', + ]; + displayName = 'NextCloud OAuth2 API'; + properties = [ + { + displayName: 'Web DAV URL', + name: 'webDavUrl', + type: 'string' as NodePropertyTypes, + placeholder: 'https://nextcloud.example.com/remote.php/webdav/', + default: '', + }, + { + displayName: 'Authorization URL', + name: 'authUrl', + type: 'string' as NodePropertyTypes, + default: 'https://nextcloud.example.com/apps/oauth2/authorize', + required: true, + }, + { + displayName: 'Access Token URL', + name: 'accessTokenUrl', + type: 'string' as NodePropertyTypes, + default: 'https://nextcloud.example.com/apps/oauth2/api/v1/token', + required: true, + }, + { + displayName: 'Scope', + name: 'scope', + type: 'hidden' as NodePropertyTypes, + default: '', + }, + { + displayName: 'Auth URI Query Parameters', + name: 'authQueryParameters', + type: 'hidden' as NodePropertyTypes, + default: '', + }, + { + displayName: 'Authentication', + name: 'authentication', + type: 'hidden' as NodePropertyTypes, + default: 'body', + }, + ]; +} diff --git a/packages/nodes-base/nodes/NextCloud/GenericFunctions.ts b/packages/nodes-base/nodes/NextCloud/GenericFunctions.ts new file mode 100644 index 0000000000..fc4e7646bf --- /dev/null +++ b/packages/nodes-base/nodes/NextCloud/GenericFunctions.ts @@ -0,0 +1,64 @@ +import { + IExecuteFunctions, + IHookFunctions, +} from 'n8n-core'; + +import { + IDataObject, +} from 'n8n-workflow'; +import { OptionsWithUri } from 'request'; + +/** + * Make an API request to NextCloud + * + * @param {IHookFunctions} this + * @param {string} method + * @param {string} url + * @param {object} body + * @returns {Promise} + */ +export async function nextCloudApiRequest(this: IHookFunctions | IExecuteFunctions, method: string, endpoint: string, body: object | string | Buffer, headers?: object, encoding?: null | undefined, query?: object): Promise { // tslint:disable-line:no-any + const options : OptionsWithUri = { + headers, + method, + body, + qs: {}, + uri: '', + json: false, + }; + + if (encoding === null) { + options.encoding = null; + } + + const authenticationMethod = this.getNodeParameter('authentication', 0); + + try { + if (authenticationMethod === 'accessToken') { + const credentials = this.getCredentials('nextCloudApi'); + if (credentials === undefined) { + throw new Error('No credentials got returned!'); + } + + options.auth = { + user: credentials.user as string, + pass: credentials.password as string, + }; + + options.uri = `${credentials.webDavUrl}/${encodeURI(endpoint)}`; + + return await this.helpers.request(options); + } else { + const credentials = this.getCredentials('nextCloudOAuth2Api'); + if (credentials === undefined) { + throw new Error('No credentials got returned!'); + } + + options.uri = `${credentials.webDavUrl}/${encodeURI(endpoint)}`; + + return await this.helpers.requestOAuth2!.call(this, 'nextCloudOAuth2Api', options); + } + } catch (error) { + throw new Error(`NextCloud Error. Status Code: ${error.statusCode}. Message: ${error.message}`); + } +} diff --git a/packages/nodes-base/nodes/NextCloud/NextCloud.node.ts b/packages/nodes-base/nodes/NextCloud/NextCloud.node.ts index 309f53ceae..8b3f0620fc 100644 --- a/packages/nodes-base/nodes/NextCloud/NextCloud.node.ts +++ b/packages/nodes-base/nodes/NextCloud/NextCloud.node.ts @@ -11,6 +11,7 @@ import { import { parseString } from 'xml2js'; import { OptionsWithUri } from 'request'; +import { nextCloudApiRequest } from './GenericFunctions'; export class NextCloud implements INodeType { @@ -32,9 +33,44 @@ export class NextCloud implements INodeType { { name: 'nextCloudApi', required: true, - } + displayOptions: { + show: { + authentication: [ + 'accessToken', + ], + }, + }, + }, + { + name: 'nextCloudOAuth2Api', + required: true, + displayOptions: { + show: { + authentication: [ + 'oAuth2', + ], + }, + }, + }, ], properties: [ + { + displayName: 'Authentication', + name: 'authentication', + type: 'options', + options: [ + { + name: 'Access Token', + value: 'accessToken', + }, + { + name: 'OAuth2', + value: 'oAuth2', + }, + ], + default: 'accessToken', + description: 'The resource to operate on.', + }, { displayName: 'Resource', name: 'resource', @@ -446,7 +482,14 @@ export class NextCloud implements INodeType { const items = this.getInputData().slice(); const returnData: IDataObject[] = []; - const credentials = this.getCredentials('nextCloudApi'); + const authenticationMethod = this.getNodeParameter('authentication', 0); + let credentials; + + if (authenticationMethod === 'accessToken') { + credentials = this.getCredentials('nextCloudApi'); + } else { + credentials = this.getCredentials('nextCloudOAuth2Api'); + } if (credentials === undefined) { throw new Error('No credentials got returned!'); @@ -562,26 +605,14 @@ export class NextCloud implements INodeType { webDavUrl = webDavUrl.slice(0, -1); } - const options: OptionsWithUri = { - auth: { - user: credentials.user as string, - pass: credentials.password as string, - }, - headers, - method: requestMethod, - body, - qs: {}, - uri: `${credentials.webDavUrl}/${encodeURI(endpoint)}`, - json: false, - }; - + let encoding = undefined; if (resource === 'file' && operation === 'download') { // Return the data as a buffer - options.encoding = null; + encoding = null; } try { - responseData = await this.helpers.request(options); + responseData = await nextCloudApiRequest.call(this, requestMethod, endpoint, body, headers, encoding); } catch (error) { if (this.continueOnFail() === true) { returnData.push({ error }); diff --git a/packages/nodes-base/package.json b/packages/nodes-base/package.json index dcfaeb2269..c3a3183db0 100644 --- a/packages/nodes-base/package.json +++ b/packages/nodes-base/package.json @@ -98,6 +98,7 @@ "dist/credentials/Msg91Api.credentials.js", "dist/credentials/MySql.credentials.js", "dist/credentials/NextCloudApi.credentials.js", + "dist/credentials/NextCloudOAuth2Api.credentials.js", "dist/credentials/OAuth1Api.credentials.js", "dist/credentials/OAuth2Api.credentials.js", "dist/credentials/OpenWeatherMapApi.credentials.js", From eb2ced7e3c702a103e142cf1772a2edc6b19f448 Mon Sep 17 00:00:00 2001 From: shraddha shaligram Date: Wed, 17 Jun 2020 11:16:31 -0700 Subject: [PATCH 079/241] add resource --- packages/nodes-base/nodes/Zoom/Zoom.node.ts | 56 +++++++++++++-------- 1 file changed, 36 insertions(+), 20 deletions(-) diff --git a/packages/nodes-base/nodes/Zoom/Zoom.node.ts b/packages/nodes-base/nodes/Zoom/Zoom.node.ts index ce32b4c51b..ff7487a2e2 100644 --- a/packages/nodes-base/nodes/Zoom/Zoom.node.ts +++ b/packages/nodes-base/nodes/Zoom/Zoom.node.ts @@ -17,10 +17,12 @@ export class Zoom implements INodeType { group: ['input'], version: 1, description: 'Consume Zoom API', + subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}', defaults: { name: 'Zoom', color: '#772244' }, + icon: 'file:zoom.png', inputs: ['main'], outputs: ['main'], credentials: [ @@ -60,6 +62,19 @@ export class Zoom implements INodeType { ], default: 'accessToken', description: 'The resource to operate on.' + }, + { + displayName: 'Resource', + name: 'resource', + type: 'options', + options: [ + { + name: 'meeting', + value: 'meeting' + } + ], + default: 'meeting', + description: 'The resource to operate on.' } ] }; @@ -72,26 +87,27 @@ export class Zoom implements INodeType { let responseData; const authentication = this.getNodeParameter('authentication', 0) as string; const resource = this.getNodeParameter('resource', 0) as string; - const operation = this.getNodeParameter('operation', 0) as string; - for (let i = 0; i < length; i++) { - qs = {}; - if (resource === 'channel') { - //https://api.slack.com/methods/conversations.archive - if (operation === 'archive') { - const channel = this.getNodeParameter('channelId', i) as string; - const body: IDataObject = { - channel - }; - responseData = await zoomApiRequest.call( - this, - 'POST', - '/conversations.archive', - body, - qs - ); - } - } - } + // const operation = this.getNodeParameter('operation', 0) as string; + console.log(this.getCredentials('zoomOAuth2Api')); + // for (let i = 0; i < length; i++) { + // qs = {}; + // if (resource === 'channel') { + // //https://api.slack.com/methods/conversations.archive + // if (operation === 'archive') { + // const channel = this.getNodeParameter('channelId', i) as string; + // const body: IDataObject = { + // channel + // }; + // responseData = await zoomApiRequest.call( + // this, + // 'POST', + // '/conversations.archive', + // body, + // qs + // ); + // } + // } + // } if (Array.isArray(responseData)) { returnData.push.apply(returnData, responseData as IDataObject[]); } else { From c25d62474a6743cc5cfffd6b77e0192fd67c6e0d Mon Sep 17 00:00:00 2001 From: shraddha shaligram Date: Wed, 17 Jun 2020 12:49:37 -0700 Subject: [PATCH 080/241] fix formatting and syntax --- .../nodes/Google/Task/GoogleTasks.node.ts | 84 ++-- .../nodes/Google/Task/TaskDescription.ts | 446 +++++++++--------- 2 files changed, 250 insertions(+), 280 deletions(-) diff --git a/packages/nodes-base/nodes/Google/Task/GoogleTasks.node.ts b/packages/nodes-base/nodes/Google/Task/GoogleTasks.node.ts index db751cb258..61bf3e6471 100644 --- a/packages/nodes-base/nodes/Google/Task/GoogleTasks.node.ts +++ b/packages/nodes-base/nodes/Google/Task/GoogleTasks.node.ts @@ -8,10 +8,10 @@ import { ILoadOptionsFunctions, INodePropertyOptions } from 'n8n-workflow'; -import { taskOperations, taskFields } from './TaskDescription'; - import { googleApiRequest, googleApiRequestAllItems } from './GenericFunctions'; +import { taskOperations, taskFields } from './TaskDescription'; + export class GoogleTasks implements INodeType { description: INodeTypeDescription = { displayName: 'Google Tasks', @@ -98,43 +98,40 @@ export class GoogleTasks implements INodeType { i ) as IDataObject; - if (additionalFields.parent) + if (additionalFields.parent) { qs.parent = additionalFields.parent as string; - - if (additionalFields.previous) - qs.previous = additionalFields.previous as string; - - if (additionalFields.links) { - body.links = (additionalFields.links as string[]).map(link => { - return { link }; - }); } - if (additionalFields.status) + if (additionalFields.previous) { + qs.previous = additionalFields.previous as string; + } + + if (additionalFields.status) { body.status = additionalFields.status as string; + } - if (additionalFields.notes) + if (additionalFields.notes) { body.notes = additionalFields.notes as string; + } - if (additionalFields.title) + if (additionalFields.title) { body.title = additionalFields.title as string; + } - if (additionalFields.dueDate) + if (additionalFields.dueDate) { body.dueDate = additionalFields.dueDate as string; + } - if (additionalFields.completed) + if (additionalFields.completed) { body.completed = additionalFields.completed as string; + } - if (additionalFields.deleted) + if (additionalFields.deleted) { body.deleted = additionalFields.deleted as boolean; + } - if (additionalFields.hidden) - body.hidden = additionalFields.hidden as boolean; - - if (additionalFields.position) - body.position = additionalFields.position as string; - - if (additionalFields.selfLink) + if (additionalFields.selfLink) { body.selfLink = additionalFields.selfLink as string; + } responseData = await googleApiRequest.call( this, @@ -236,38 +233,37 @@ export class GoogleTasks implements INodeType { i ) as IDataObject; - if (updateFields.parent) qs.parent = updateFields.parent as string; - - if (updateFields.previous) + if (updateFields.previous) { qs.previous = updateFields.previous as string; - - if (updateFields.links) { - body.links = (updateFields.links as string[]).map(link => { - return { link: link }; - }); } - if (updateFields.status) body.status = updateFields.status as string; - if (updateFields.notes) body.notes = updateFields.notes as string; + if (updateFields.status) { + body.status = updateFields.status as string; + } - if (updateFields.title) body.title = updateFields.title as string; + if (updateFields.notes) { + body.notes = updateFields.notes as string; + } - if (updateFields.dueDate) + if (updateFields.title) { + body.title = updateFields.title as string; + } + + if (updateFields.dueDate) { body.dueDate = updateFields.dueDate as string; + } - if (updateFields.completed) + if (updateFields.completed) { body.completed = updateFields.completed as string; + } - if (updateFields.deleted) + if (updateFields.deleted) { body.deleted = updateFields.deleted as boolean; + } - if (updateFields.hidden) body.hidden = updateFields.hidden as boolean; - - if (updateFields.position) - body.position = updateFields.position as string; - - if (updateFields.selfLink) + if (updateFields.selfLink) { body.selfLink = updateFields.selfLink as string; + } responseData = await googleApiRequest.call( this, diff --git a/packages/nodes-base/nodes/Google/Task/TaskDescription.ts b/packages/nodes-base/nodes/Google/Task/TaskDescription.ts index 5b8df27097..4bf04ae8e4 100644 --- a/packages/nodes-base/nodes/Google/Task/TaskDescription.ts +++ b/packages/nodes-base/nodes/Google/Task/TaskDescription.ts @@ -7,38 +7,40 @@ export const taskOperations = [ type: 'options', displayOptions: { show: { - resource: ['task'] - } + resource: [ + 'task', + ], + }, }, options: [ { name: 'Create', value: 'create', - description: 'Add a task to tasklist' + description: 'Add a task to tasklist', }, { name: 'Delete', value: 'delete', - description: 'Delete a task' + description: 'Delete a task', }, { name: 'Get', value: 'get', - description: 'Retrieve a task' + description: 'Retrieve a task', }, { name: 'Get All', value: 'getAll', - description: 'Retrieve all tasks from a tasklist' + description: 'Retrieve all tasks from a tasklist', }, { name: 'Update', value: 'update', - description: 'Update a task' + description: 'Update a task', } ], default: 'create', - description: 'The operation to perform.' + description: 'The operation to perform.', } ] as INodeProperties[]; @@ -51,16 +53,20 @@ export const taskFields = [ name: 'task', type: 'options', typeOptions: { - loadOptionsMethod: 'getTasks' + loadOptionsMethod: 'getTasks', }, required: true, displayOptions: { show: { - operation: ['create'], - resource: ['task'] + operation: [ + 'create', + ], + resource: [ + 'task', + ], } }, - default: '' + default: '', }, { displayName: 'Additional Fields', @@ -70,11 +76,64 @@ export const taskFields = [ default: {}, displayOptions: { show: { - operation: ['create'], - resource: ['task'] + operation: [ + 'create', + ], + resource: [ + 'task', + ], } }, options: [ + { + displayName: 'Completion date', + name: 'completed', + type: 'dateTime', + default: '', + description: `Completion date of the task (as a RFC 3339 timestamp). This field is omitted if the task has not been completed.`, + }, + { + displayName: 'Deleted status', + name: 'deleted', + type: 'boolean', + default: false, + description: 'Flag indicating whether the task has been deleted.', + }, + { + displayName: 'Due Date', + name: 'dueDate', + type: 'dateTime', + default: '', + description: 'Due date of the task.', + }, + { + displayName: 'Notes', + name: 'notes', + type: 'string', + default: '', + description: 'Additional Notes.', + }, + { + displayName: 'Parent', + name: 'parent', + type: 'string', + default: '', + description: 'Parent task identifier. If the task is created at the top level, this parameter is omitted.', + }, + { + displayName: 'Previous', + name: 'previous', + type: 'string', + default: '', + description: 'Previous sibling task identifier. If the task is created at the first position among its siblings, this parameter is omitted.', + }, + { + displayName: 'Self Link', + name: 'selfLink', + type: 'string', + default: '', + description: 'URL pointing to this task. Used to retrieve, update, or delete this task.', + }, { displayName: 'Status', name: 'status', @@ -82,103 +141,24 @@ export const taskFields = [ options: [ { name: 'needs Action', - value: 'needsAction' + value: 'needsAction', }, { name: 'completed', - value: 'completed' + value: 'completed', } ], default: '', - description: 'Current status of the task.' - }, - { - displayName: 'Links', - name: 'links', - type: 'string', - typeOptions: { - multipleValues: true, - multipleValueButtonText: 'Add Link' - }, - default: '', - description: 'The links to insert in the task.' - }, - - { - displayName: 'Notes', - name: 'notes', - type: 'string', - default: '', - description: 'Additional Notes.' + description: 'Current status of the task.', }, { displayName: 'Title', name: 'title', type: 'string', default: '', - description: 'Title of the task.' - }, - { - displayName: 'Due Date', - name: 'dueDate', - type: 'dateTime', - default: '', - description: 'Due date of the task.' - }, - { - displayName: 'Completion date', - name: 'completed', - type: 'dateTime', - default: '', - description: `Completion date of the task (as a RFC 3339 timestamp). This field is omitted if the task has not been completed.` + description: 'Title of the task.', }, - { - displayName: 'Deleted status', - name: 'deleted', - type: 'boolean', - default: false, - description: 'Flag indicating whether the task has been deleted.' - }, - { - displayName: 'Hidden', - name: 'hidden', - type: 'boolean', - default: false, - description: 'Flag indicating whether the task is hidden.' - }, - { - displayName: 'Parent', - name: 'parent', - type: 'string', - default: '', - description: - 'Parent task identifier.This field is omitted if it is a top-level task.' - }, - { - displayName: 'Position', - name: 'position', - type: 'string', - default: '', - description: - 'Parent task identifier.This field is omitted if it is a top-level task.' - }, - { - displayName: 'Self Link', - name: 'selfLink', - type: 'string', - default: '', - description: - 'URL pointing to this task. Used to retrieve, update, or delete this task.' - }, - { - displayName: 'Previous', - name: 'previous', - type: 'string', - default: '', - description: - 'Previous sibling task identifier. If the task is created at the first position among its siblings, this parameter is omitted.' - } ] }, /* -------------------------------------------------------------------------- */ @@ -189,16 +169,20 @@ export const taskFields = [ name: 'task', type: 'options', typeOptions: { - loadOptionsMethod: 'getTasks' + loadOptionsMethod: 'getTasks', }, required: true, displayOptions: { show: { - operation: ['delete'], - resource: ['task'] + operation: [ + 'delete', + ], + resource: [ + 'task', + ], } }, - default: '' + default: '', }, { displayName: 'Task ID', @@ -207,11 +191,15 @@ export const taskFields = [ required: true, displayOptions: { show: { - operation: ['delete'], - resource: ['task'] + operation: [ + 'delete', + ], + resource: [ + 'task', + ], } }, - default: '' + default: '', }, /* -------------------------------------------------------------------------- */ /* task:get */ @@ -221,16 +209,20 @@ export const taskFields = [ name: 'task', type: 'options', typeOptions: { - loadOptionsMethod: 'getTasks' + loadOptionsMethod: 'getTasks', }, required: true, displayOptions: { show: { - operation: ['get'], - resource: ['task'] + operation: [ + 'get', + ], + resource: [ + 'task', + ], } }, - default: '' + default: '', }, { displayName: 'Task ID', @@ -239,11 +231,15 @@ export const taskFields = [ required: true, displayOptions: { show: { - operation: ['get'], - resource: ['task'] + operation: [ + 'get', + ], + resource: [ + 'task', + ], } }, - default: '' + default: '', }, /* -------------------------------------------------------------------------- */ /* task:getAll */ @@ -253,16 +249,20 @@ export const taskFields = [ name: 'task', type: 'options', typeOptions: { - loadOptionsMethod: 'getTasks' + loadOptionsMethod: 'getTasks', }, required: true, displayOptions: { show: { - operation: ['getAll'], - resource: ['task'] + operation: [ + 'getAll', + ], + resource: [ + 'task', + ], } }, - default: '' + default: '', }, { displayName: 'Return All', @@ -270,13 +270,16 @@ export const taskFields = [ type: 'boolean', displayOptions: { show: { - operation: ['getAll'], - resource: ['task'] + operation: [ + 'getAll', + ], + resource: [ + 'task', + ], } }, default: false, - description: - 'If all results should be returned or only up to a given limit.' + description: 'If all results should be returned or only up to a given limit.', }, { displayName: 'Limit', @@ -284,9 +287,15 @@ export const taskFields = [ type: 'number', displayOptions: { show: { - operation: ['getAll'], - resource: ['task'], - returnAll: [false] + operation: [ + 'getAll', + ], + resource: [ + 'task', + ], + returnAll: [ + false, + ], } }, typeOptions: { @@ -294,7 +303,7 @@ export const taskFields = [ maxValue: 100 }, default: 20, - description: 'How many results to return.' + description: 'How many results to return.', }, { displayName: 'Additional Fields', @@ -304,8 +313,12 @@ export const taskFields = [ default: {}, displayOptions: { show: { - operation: ['getAll'], - resource: ['task'] + operation: [ + 'getAll', + ], + resource: [ + 'task', + ], } }, @@ -315,40 +328,35 @@ export const taskFields = [ name: 'completedMax', type: 'dateTime', default: '', - description: - 'Upper bound for a task completion date (as a RFC 3339 timestamp) to filter by.' + description: 'Upper bound for a task completion date (as a RFC 3339 timestamp) to filter by.', }, { displayName: 'Completed Min', name: 'completedMin', type: 'dateTime', default: '', - description: - 'Lower bound for a task completion date (as a RFC 3339 timestamp) to filter by.' + description: 'Lower bound for a task completion date (as a RFC 3339 timestamp) to filter by.', }, { displayName: 'Due Min', name: 'dueMin', type: 'dateTime', default: '', - description: - 'Lower bound for a task due date (as a RFC 3339 timestamp) to filter by.' + description: 'Lower bound for a task due date (as a RFC 3339 timestamp) to filter by.', }, { displayName: 'Due Max', name: 'dueMax', type: 'dateTime', default: '', - description: - 'Upper bound for a task due date (as a RFC 3339 timestamp) to filter by.' + description: 'Upper bound for a task due date (as a RFC 3339 timestamp) to filter by.', }, - { displayName: 'Page Token', name: 'pageToken', type: 'string', default: '', - description: 'Token specifying the result page to return.' + description: 'Token specifying the result page to return.', }, { @@ -356,33 +364,29 @@ export const taskFields = [ name: 'showCompleted', type: 'boolean', default: true, - description: - 'Flag indicating whether completed tasks are returned in the result' + description: 'Flag indicating whether completed tasks are returned in the result', }, { displayName: 'Show Deleted', name: 'showDeleted', type: 'boolean', default: false, - description: - 'Flag indicating whether deleted tasks are returned in the result' + description: 'Flag indicating whether deleted tasks are returned in the result', }, { displayName: 'Show Hidden', name: 'showHidden', type: 'boolean', default: false, - description: - 'Flag indicating whether hidden tasks are returned in the result' + description: 'Flag indicating whether hidden tasks are returned in the result', }, { displayName: 'Updated Min', name: 'updatedMin', type: 'string', - - description: - 'Lower bound for a task last modification time (as a RFC 3339 timestamp) to filter by.' - } + default: '', + description: 'Lower bound for a task last modification time (as a RFC 3339 timestamp) to filter by.', + }, ] }, /* -------------------------------------------------------------------------- */ @@ -393,16 +397,20 @@ export const taskFields = [ name: 'task', type: 'options', typeOptions: { - loadOptionsMethod: 'getTasks' + loadOptionsMethod: 'getTasks', }, required: true, displayOptions: { show: { - operation: ['update'], - resource: ['task'] + operation: [ + 'update', + ], + resource: [ + 'task', + ], } }, - default: '' + default: '', }, { displayName: 'Task ID', @@ -411,11 +419,15 @@ export const taskFields = [ required: true, displayOptions: { show: { - operation: ['update'], - resource: ['task'] + operation: [ + 'update', + ], + resource: [ + 'task', + ], } }, - default: '' + default: '', }, { displayName: 'Update Fields', @@ -425,67 +437,21 @@ export const taskFields = [ default: {}, displayOptions: { show: { - operation: ['update'], - resource: ['task'] + operation: [ + 'update', + ], + resource: [ + 'task', + ], } }, options: [ - { - displayName: 'Status', - name: 'status', - type: 'options', - options: [ - { - name: 'needs Action', - value: 'needsAction' - }, - { - name: 'completed', - value: 'completed' - } - ], - default: '', - description: 'Current status of the task.' - }, - { - displayName: 'Links', - name: 'links', - type: 'string', - typeOptions: { - multipleValues: true, - multipleValueButtonText: 'Add Link' - }, - default: '', - description: 'The links to insert in the task.' - }, - - { - displayName: 'Notes', - name: 'notes', - type: 'string', - default: '', - description: 'Additional Notes.' - }, - { - displayName: 'Title', - name: 'title', - type: 'string', - default: '', - description: 'Title of the task.' - }, - { - displayName: 'Due Date', - name: 'dueDate', - type: 'dateTime', - default: '', - description: 'Due date of the task.' - }, { displayName: 'Completion date', name: 'completed', type: 'dateTime', default: '', - description: `Completion date of the task (as a RFC 3339 timestamp). This field is omitted if the task has not been completed.` + description: `Completion date of the task (as a RFC 3339 timestamp). This field is omitted if the task has not been completed.`, }, { @@ -493,47 +459,55 @@ export const taskFields = [ name: 'deleted', type: 'boolean', default: false, - description: 'Flag indicating whether the task has been deleted.' + description: 'Flag indicating whether the task has been deleted.', }, { - displayName: 'Hidden', - name: 'hidden', - type: 'boolean', - default: false, - description: 'Flag indicating whether the task is hidden.' - }, - { - displayName: 'Parent', - name: 'parent', + displayName: 'Notes', + name: 'notes', type: 'string', default: '', - description: - 'Parent task identifier.This field is omitted if it is a top-level task.' - }, - { - displayName: 'Position', - name: 'position', - type: 'string', - default: '', - description: - 'Parent task identifier.This field is omitted if it is a top-level task.' - }, - { - displayName: 'Self Link', - name: 'selfLink', - type: 'string', - default: '', - description: - 'URL pointing to this task. Used to retrieve, update, or delete this task.' + description: 'Additional Notes.', }, { displayName: 'Previous', name: 'previous', type: 'string', default: '', - description: - 'Previous sibling task identifier. If the task is created at the first position among its siblings, this parameter is omitted.' - } + description: 'Previous sibling task identifier. If the task is created at the first position among its siblings, this parameter is omitted.', + }, + { + displayName: 'Self Link', + name: 'selfLink', + type: 'string', + default: '', + description: 'URL pointing to this task. Used to retrieve, update, or delete this task.', + }, + { + displayName: 'Status', + name: 'status', + type: 'options', + options: [ + { + name: 'needs Update', + value: 'needsAction', + }, + { + name: 'completed', + value: 'completed', + } + ], + default: '', + description: 'Current status of the task.', + }, + { + displayName: 'Title', + name: 'title', + type: 'string', + default: '', + description: 'Title of the task.', + }, + + ] } ] as INodeProperties[]; From d261eb5a12c2ab4b7027b6247628e2ca68781ec0 Mon Sep 17 00:00:00 2001 From: ricardo Date: Wed, 17 Jun 2020 17:15:54 -0400 Subject: [PATCH 081/241] :zap: Improvements to Google Tasks node --- .../GoogleTasksOAuth2Api.credentials.ts | 11 ++- .../nodes/Google/Task/GenericFunctions.ts | 19 ++-- .../nodes/Google/Task/GoogleTasks.node.ts | 47 +++++----- .../nodes/Google/Task/TaskDescription.ts | 87 +++++++------------ 4 files changed, 77 insertions(+), 87 deletions(-) diff --git a/packages/nodes-base/credentials/GoogleTasksOAuth2Api.credentials.ts b/packages/nodes-base/credentials/GoogleTasksOAuth2Api.credentials.ts index db30799920..ac1242be2b 100644 --- a/packages/nodes-base/credentials/GoogleTasksOAuth2Api.credentials.ts +++ b/packages/nodes-base/credentials/GoogleTasksOAuth2Api.credentials.ts @@ -1,6 +1,11 @@ -import { ICredentialType, NodePropertyTypes } from 'n8n-workflow'; +import { + ICredentialType, + NodePropertyTypes, +} from 'n8n-workflow'; -const scopes = ['https://www.googleapis.com/auth/tasks']; +const scopes = [ + 'https://www.googleapis.com/auth/tasks', +]; export class GoogleTasksOAuth2Api implements ICredentialType { name = 'googleTasksOAuth2Api'; @@ -12,6 +17,6 @@ export class GoogleTasksOAuth2Api implements ICredentialType { name: 'scope', type: 'hidden' as NodePropertyTypes, default: scopes.join(' ') - } + }, ]; } diff --git a/packages/nodes-base/nodes/Google/Task/GenericFunctions.ts b/packages/nodes-base/nodes/Google/Task/GenericFunctions.ts index 19652d1d4a..c3a5031511 100644 --- a/packages/nodes-base/nodes/Google/Task/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Google/Task/GenericFunctions.ts @@ -1,12 +1,16 @@ -import { OptionsWithUri } from 'request'; +import { + OptionsWithUri, +} from 'request'; import { IExecuteFunctions, IExecuteSingleFunctions, - ILoadOptionsFunctions + ILoadOptionsFunctions, } from 'n8n-core'; -import { IDataObject } from 'n8n-workflow'; +import { + IDataObject, +} from 'n8n-workflow'; export async function googleApiRequest( this: IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions, @@ -27,6 +31,7 @@ export async function googleApiRequest( uri: uri || `https://www.googleapis.com${resource}`, json: true }; + try { if (Object.keys(headers).length !== 0) { options.headers = Object.assign({}, options.headers, headers); @@ -41,10 +46,14 @@ export async function googleApiRequest( options ); } catch (error) { - if (error.response && error.response.body && error.response.body.message) { + if (error.response && error.response.body && error.response.body.error) { + + let errors = error.response.body.error.errors; + + errors = errors.map((e: IDataObject) => e.message); // Try to return the error prettier throw new Error( - `Google Tasks error response [${error.statusCode}]: ${error.response.body.message}` + `Google Tasks error response [${error.statusCode}]: ${errors.join('|')}` ); } throw error; diff --git a/packages/nodes-base/nodes/Google/Task/GoogleTasks.node.ts b/packages/nodes-base/nodes/Google/Task/GoogleTasks.node.ts index 61bf3e6471..8e2f06dcf5 100644 --- a/packages/nodes-base/nodes/Google/Task/GoogleTasks.node.ts +++ b/packages/nodes-base/nodes/Google/Task/GoogleTasks.node.ts @@ -1,16 +1,25 @@ -import { IExecuteFunctions } from 'n8n-core'; +import { + IExecuteFunctions, + } from 'n8n-core'; import { IDataObject, - INodeExecutionData, - INodeTypeDescription, - INodeType, ILoadOptionsFunctions, - INodePropertyOptions + INodeExecutionData, + INodePropertyOptions, + INodeType, + INodeTypeDescription, } from 'n8n-workflow'; -import { googleApiRequest, googleApiRequestAllItems } from './GenericFunctions'; -import { taskOperations, taskFields } from './TaskDescription'; +import { + googleApiRequest, + googleApiRequestAllItems, +} from './GenericFunctions'; + +import { + taskOperations, + taskFields, +} from './TaskDescription'; export class GoogleTasks implements INodeType { description: INodeTypeDescription = { @@ -129,10 +138,6 @@ export class GoogleTasks implements INodeType { body.deleted = additionalFields.deleted as boolean; } - if (additionalFields.selfLink) { - body.selfLink = additionalFields.selfLink as string; - } - responseData = await googleApiRequest.call( this, 'POST', @@ -186,9 +191,6 @@ export class GoogleTasks implements INodeType { if (options.dueMax) { qs.dueMax = options.dueMax as string; } - if (options.pageToken) { - qs.pageToken = options.pageToken as string; - } if (options.showCompleted) { qs.showCompleted = options.showCompleted as boolean; } @@ -198,10 +200,10 @@ export class GoogleTasks implements INodeType { if (options.showHidden) { qs.showHidden = options.showHidden as boolean; } - if (options.updatedMin) { qs.updatedMin = options.updatedMin as string; } + if (returnAll) { responseData = await googleApiRequestAllItems.call( this, @@ -261,10 +263,6 @@ export class GoogleTasks implements INodeType { body.deleted = updateFields.deleted as boolean; } - if (updateFields.selfLink) { - body.selfLink = updateFields.selfLink as string; - } - responseData = await googleApiRequest.call( this, 'PATCH', @@ -274,12 +272,11 @@ export class GoogleTasks implements INodeType { ); } } - } - - if (Array.isArray(responseData)) { - returnData.push.apply(returnData, responseData as IDataObject[]); - } else if (responseData !== undefined) { - returnData.push(responseData as IDataObject); + if (Array.isArray(responseData)) { + returnData.push.apply(returnData, responseData as IDataObject[]); + } else if (responseData !== undefined) { + returnData.push(responseData as IDataObject); + } } return [this.helpers.returnJsonArray(returnData)]; } diff --git a/packages/nodes-base/nodes/Google/Task/TaskDescription.ts b/packages/nodes-base/nodes/Google/Task/TaskDescription.ts index 4bf04ae8e4..8030f0a7f3 100644 --- a/packages/nodes-base/nodes/Google/Task/TaskDescription.ts +++ b/packages/nodes-base/nodes/Google/Task/TaskDescription.ts @@ -1,4 +1,6 @@ -import { INodeProperties } from 'n8n-workflow'; +import { + INodeProperties, +} from 'n8n-workflow'; export const taskOperations = [ { @@ -46,7 +48,7 @@ export const taskOperations = [ export const taskFields = [ /* -------------------------------------------------------------------------- */ - /* task:create */ + /* task:create */ /* -------------------------------------------------------------------------- */ { displayName: 'TaskList', @@ -64,7 +66,7 @@ export const taskFields = [ resource: [ 'task', ], - } + }, }, default: '', }, @@ -86,14 +88,14 @@ export const taskFields = [ }, options: [ { - displayName: 'Completion date', + displayName: 'Completion Date', name: 'completed', type: 'dateTime', default: '', description: `Completion date of the task (as a RFC 3339 timestamp). This field is omitted if the task has not been completed.`, }, { - displayName: 'Deleted status', + displayName: 'Deleted', name: 'deleted', type: 'boolean', default: false, @@ -127,24 +129,17 @@ export const taskFields = [ default: '', description: 'Previous sibling task identifier. If the task is created at the first position among its siblings, this parameter is omitted.', }, - { - displayName: 'Self Link', - name: 'selfLink', - type: 'string', - default: '', - description: 'URL pointing to this task. Used to retrieve, update, or delete this task.', - }, { displayName: 'Status', name: 'status', type: 'options', options: [ { - name: 'needs Action', + name: 'Needs Action', value: 'needsAction', }, { - name: 'completed', + name: 'Completed', value: 'completed', } ], @@ -158,11 +153,10 @@ export const taskFields = [ default: '', description: 'Title of the task.', }, - - ] + ], }, /* -------------------------------------------------------------------------- */ - /* task:delete */ + /* task:delete */ /* -------------------------------------------------------------------------- */ { displayName: 'TaskList', @@ -180,7 +174,7 @@ export const taskFields = [ resource: [ 'task', ], - } + }, }, default: '', }, @@ -197,12 +191,12 @@ export const taskFields = [ resource: [ 'task', ], - } + }, }, default: '', }, /* -------------------------------------------------------------------------- */ - /* task:get */ + /* task:get */ /* -------------------------------------------------------------------------- */ { displayName: 'TaskList', @@ -237,12 +231,12 @@ export const taskFields = [ resource: [ 'task', ], - } + }, }, default: '', }, /* -------------------------------------------------------------------------- */ - /* task:getAll */ + /* task:getAll */ /* -------------------------------------------------------------------------- */ { displayName: 'TaskList', @@ -260,7 +254,7 @@ export const taskFields = [ resource: [ 'task', ], - } + }, }, default: '', }, @@ -276,7 +270,7 @@ export const taskFields = [ resource: [ 'task', ], - } + }, }, default: false, description: 'If all results should be returned or only up to a given limit.', @@ -296,7 +290,7 @@ export const taskFields = [ returnAll: [ false, ], - } + }, }, typeOptions: { minValue: 1, @@ -319,9 +313,8 @@ export const taskFields = [ resource: [ 'task', ], - } + }, }, - options: [ { displayName: 'Completed Max', @@ -351,14 +344,6 @@ export const taskFields = [ default: '', description: 'Upper bound for a task due date (as a RFC 3339 timestamp) to filter by.', }, - { - displayName: 'Page Token', - name: 'pageToken', - type: 'string', - default: '', - description: 'Token specifying the result page to return.', - }, - { displayName: 'Show Completed', name: 'showCompleted', @@ -383,14 +368,14 @@ export const taskFields = [ { displayName: 'Updated Min', name: 'updatedMin', - type: 'string', + type: 'dateTime', default: '', description: 'Lower bound for a task last modification time (as a RFC 3339 timestamp) to filter by.', }, ] }, /* -------------------------------------------------------------------------- */ - /* task:update */ + /* task:update */ /* -------------------------------------------------------------------------- */ { displayName: 'TaskList', @@ -408,7 +393,7 @@ export const taskFields = [ resource: [ 'task', ], - } + }, }, default: '', }, @@ -425,7 +410,7 @@ export const taskFields = [ resource: [ 'task', ], - } + }, }, default: '', }, @@ -447,7 +432,7 @@ export const taskFields = [ }, options: [ { - displayName: 'Completion date', + displayName: 'Completion Date', name: 'completed', type: 'dateTime', default: '', @@ -455,7 +440,7 @@ export const taskFields = [ }, { - displayName: 'Deleted status', + displayName: 'Deleted', name: 'deleted', type: 'boolean', default: false, @@ -465,6 +450,9 @@ export const taskFields = [ displayName: 'Notes', name: 'notes', type: 'string', + typeOptions: { + alwaysOpenEditWindow: true, + }, default: '', description: 'Additional Notes.', }, @@ -475,24 +463,17 @@ export const taskFields = [ default: '', description: 'Previous sibling task identifier. If the task is created at the first position among its siblings, this parameter is omitted.', }, - { - displayName: 'Self Link', - name: 'selfLink', - type: 'string', - default: '', - description: 'URL pointing to this task. Used to retrieve, update, or delete this task.', - }, { displayName: 'Status', name: 'status', type: 'options', options: [ { - name: 'needs Update', + name: 'Needs Update', value: 'needsAction', }, { - name: 'completed', + name: 'Completed', value: 'completed', } ], @@ -506,8 +487,6 @@ export const taskFields = [ default: '', description: 'Title of the task.', }, - - - ] - } + ], + }, ] as INodeProperties[]; From b4da818dbd055bc5ba4b2b1e8e762ef2873de3d1 Mon Sep 17 00:00:00 2001 From: ricardo Date: Wed, 17 Jun 2020 17:46:34 -0400 Subject: [PATCH 082/241] :zap: Fixed formatting issues on Google Calendar and MessageBird --- .../nodes/Google/Calendar/EventDescription.ts | 532 ++++++++++-------- .../nodes/Google/Calendar/EventInterface.ts | 4 +- .../Google/Calendar/GoogleCalendar.node.ts | 32 +- .../nodes/MessageBird/MessageBird.node.ts | 134 ++--- 4 files changed, 394 insertions(+), 308 deletions(-) diff --git a/packages/nodes-base/nodes/Google/Calendar/EventDescription.ts b/packages/nodes-base/nodes/Google/Calendar/EventDescription.ts index a7800334e5..44af95a151 100644 --- a/packages/nodes-base/nodes/Google/Calendar/EventDescription.ts +++ b/packages/nodes-base/nodes/Google/Calendar/EventDescription.ts @@ -1,4 +1,6 @@ -import { INodeProperties } from 'n8n-workflow'; +import { + INodeProperties, +} from 'n8n-workflow'; export const eventOperations = [ { @@ -7,34 +9,36 @@ export const eventOperations = [ type: 'options', displayOptions: { show: { - resource: ['event'] - } + resource: [ + 'event', + ], + }, }, options: [ { name: 'Create', value: 'create', - description: 'Add a event to calendar' + description: 'Add a event to calendar', }, { name: 'Delete', value: 'delete', - description: 'Delete an event' + description: 'Delete an event', }, { name: 'Get', value: 'get', - description: 'Retrieve an event' + description: 'Retrieve an event', }, { name: 'Get All', value: 'getAll', - description: 'Retrieve all events from a calendar' + description: 'Retrieve all events from a calendar', }, { name: 'Update', value: 'update', - description: 'Update an event' + description: 'Update an event', } ], default: 'create', @@ -56,9 +60,13 @@ export const eventFields = [ required: true, displayOptions: { show: { - operation: ['create'], - resource: ['event'] - } + operation: [ + 'create' + ], + resource: [ + 'event' + ], + }, }, default: '' }, @@ -69,9 +77,13 @@ export const eventFields = [ required: true, displayOptions: { show: { - operation: ['create'], - resource: ['event'] - } + operation: [ + 'create', + ], + resource: [ + 'event', + ], + }, }, default: '', description: 'Start time of the event.' @@ -83,9 +95,13 @@ export const eventFields = [ required: true, displayOptions: { show: { - operation: ['create'], - resource: ['event'] - } + operation: [ + 'create', + ], + resource: [ + 'event', + ], + }, }, default: '', description: 'End time of the event.' @@ -96,9 +112,13 @@ export const eventFields = [ type: 'boolean', displayOptions: { show: { - operation: ['create'], - resource: ['event'] - } + operation: [ + 'create', + ], + resource: [ + 'event', + ], + }, }, default: true }, @@ -110,9 +130,13 @@ export const eventFields = [ default: {}, displayOptions: { show: { - operation: ['create'], - resource: ['event'] - } + operation: [ + 'create', + ], + resource: [ + 'event', + ], + }, }, options: [ { @@ -122,12 +146,12 @@ export const eventFields = [ options: [ { name: 'Yes', - value: 'yes' + value: 'yes', }, { name: 'No', - value: 'no' - } + value: 'no', + }, ], default: 'no', description: 'Wheater the event is all day or not' @@ -138,57 +162,55 @@ export const eventFields = [ type: 'string', typeOptions: { multipleValues: true, - multipleValueButtonText: 'Add Attendee' + multipleValueButtonText: 'Add Attendee', }, default: '', - description: 'The attendees of the event' + description: 'The attendees of the event', }, { displayName: 'Color', name: 'color', type: 'options', typeOptions: { - loadOptionsMethod: 'getColors' + loadOptionsMethod: 'getColors', }, default: '', - description: 'The color of the event.' + description: 'The color of the event.', }, { displayName: 'Guests Can Invite Others', name: 'guestsCanInviteOthers', type: 'boolean', default: true, - description: - 'Whether attendees other than the organizer can invite others to the event' + description: 'Whether attendees other than the organizer can invite others to the event', }, { displayName: 'Guests Can Modify', name: 'guestsCanModify', type: 'boolean', default: false, - description: - 'Whether attendees other than the organizer can modify the event' + description: 'Whether attendees other than the organizer can modify the event', }, { displayName: 'Guests Can See Other Guests', name: 'guestsCanSeeOtherGuests', type: 'boolean', default: true, - description: `Whether attendees other than the organizer can see who the event's attendees are.` + description: `Whether attendees other than the organizer can see who the event's attendees are.`, }, { displayName: 'ID', name: 'id', type: 'string', default: '', - description: 'Opaque identifier of the event' + description: 'Opaque identifier of the event', }, { displayName: 'Location', name: 'location', type: 'string', default: '', - description: 'Geographic location of the event as free-form text.' + description: 'Geographic location of the event as free-form text.', }, { displayName: 'Max Attendees', @@ -196,7 +218,7 @@ export const eventFields = [ type: 'number', default: 0, description: `The maximum number of attendees to include in the response.
- If there are more than the specified number of attendees, only the participant is returned` + If there are more than the specified number of attendees, only the participant is returned`, }, { displayName: 'Repeat Frecuency', @@ -205,28 +227,28 @@ export const eventFields = [ options: [ { name: 'Daily', - value: 'Daily' + value: 'Daily', }, { name: 'Weekly', - value: 'weekly' + value: 'weekly', }, { name: 'Monthly', - value: 'monthly' + value: 'monthly', }, { name: 'Yearly', - value: 'yearly' + value: 'yearly', } ], - default: '' + default: '', }, { displayName: 'Repeat Until', name: 'repeatUntil', type: 'dateTime', - default: '' + default: '', }, { displayName: 'Repeat How Many Times?', @@ -245,31 +267,28 @@ export const eventFields = [ { name: 'All', value: 'all', - description: ' Notifications are sent to all guests' + description: 'Notifications are sent to all guests' }, { name: 'External Only', value: 'externalOnly', - description: - 'Notifications are sent to non-Google Calendar guests only' + description: 'Notifications are sent to non-Google Calendar guests only', }, { name: 'None', value: 'none', - description: - ' No notifications are sent. This value should only be used for migration use case' + description: 'No notifications are sent. This value should only be used for migration use case', } ], - description: - 'Whether to send notifications about the creation of the new event', - default: '' + description: 'Whether to send notifications about the creation of the new event', + default: '', }, { displayName: 'Summary', name: 'summary', type: 'string', default: '', - description: 'Title of the event.' + description: 'Title of the event.', }, { displayName: 'Show Me As', @@ -279,27 +298,26 @@ export const eventFields = [ { name: 'Available', value: 'transparent', - description: 'The event does not block time on the calendar' + description: 'The event does not block time on the calendar', }, { name: 'Busy', value: 'opaque', - description: ' The event does block time on the calendar.' + description: ' The event does block time on the calendar.', } ], default: 'opaque', - description: 'Whether the event blocks time on the calendar' + description: 'Whether the event blocks time on the calendar', }, { displayName: 'Timezone', name: 'timezone', type: 'options', typeOptions: { - loadOptionsMethod: 'getTimezones' + loadOptionsMethod: 'getTimezones', }, default: '', - description: - 'The timezone the event will have set. By default events are schedule on timezone set in n8n.' + description: 'The timezone the event will have set. By default events are schedule on timezone set in n8n.', }, { displayName: 'Visibility', @@ -309,32 +327,28 @@ export const eventFields = [ { name: 'Confidential', value: 'confidential', - description: - 'The event is private. This value is provided for compatibility reasons.' + description: 'The event is private. This value is provided for compatibility reasons.', }, { name: 'Default', value: 'default', - description: - ' Uses the default visibility for events on the calendar.' + description: 'Uses the default visibility for events on the calendar.', }, { name: 'Private', value: 'private', - description: - 'The event is private and only event attendees may view event details.' + description: 'The event is private and only event attendees may view event details.', }, { name: 'Public', value: 'public', - description: - 'The event is public and event details are visible to all readers of the calendar.' - } + description: 'The event is public and event details are visible to all readers of the calendar.', + }, ], default: 'default', description: 'Visibility of the event.' - } - ] + }, + ], }, { displayName: 'Reminders', @@ -348,10 +362,16 @@ export const eventFields = [ required: false, displayOptions: { show: { - resource: ['event'], - operation: ['create'], - useDefaultReminders: [false] - } + resource: [ + 'event', + ], + operation: [ + 'create', + ], + useDefaultReminders: [ + false, + ], + }, }, options: [ { @@ -365,14 +385,14 @@ export const eventFields = [ options: [ { name: 'Email', - value: 'email' + value: 'email', }, { name: 'Popup', - value: 'popup' - } + value: 'popup', + }, ], - default: '' + default: '', }, { displayName: 'Minutes Before', @@ -380,12 +400,12 @@ export const eventFields = [ type: 'number', typeOptions: { minValue: 0, - maxValue: 40320 + maxValue: 40320, }, - default: 0 - } - ] - } + default: 0, + }, + ], + }, ], description: `If the event doesn't use the default reminders, this lists the reminders specific to the event` }, @@ -397,14 +417,18 @@ export const eventFields = [ name: 'calendar', type: 'options', typeOptions: { - loadOptionsMethod: 'getCalendars' + loadOptionsMethod: 'getCalendars', }, required: true, displayOptions: { show: { - operation: ['delete'], - resource: ['event'] - } + operation: [ + 'delete', + ], + resource: [ + 'event', + ], + }, }, default: '' }, @@ -415,11 +439,15 @@ export const eventFields = [ required: true, displayOptions: { show: { - operation: ['delete'], - resource: ['event'] - } + operation: [ + 'delete', + ], + resource: [ + 'event', + ], + }, }, - default: '' + default: '', }, { displayName: 'Options', @@ -429,9 +457,13 @@ export const eventFields = [ default: {}, displayOptions: { show: { - operation: ['delete'], - resource: ['event'] - } + operation: [ + 'delete', + ], + resource: [ + 'event', + ], + }, }, options: [ { @@ -442,26 +474,23 @@ export const eventFields = [ { name: 'All', value: 'all', - description: ' Notifications are sent to all guests' + description: 'Notifications are sent to all guests', }, { name: 'External Only', value: 'externalOnly', - description: - 'Notifications are sent to non-Google Calendar guests only' + description: 'Notifications are sent to non-Google Calendar guests only', }, { name: 'None', value: 'none', - description: - ' No notifications are sent. This value should only be used for migration use case' + description: 'No notifications are sent. This value should only be used for migration use case', } ], - description: - 'Whether to send notifications about the creation of the new event', - default: '' - } - ] + description: 'Whether to send notifications about the creation of the new event', + default: '', + }, + ], }, /* -------------------------------------------------------------------------- */ /* event:get */ @@ -471,14 +500,18 @@ export const eventFields = [ name: 'calendar', type: 'options', typeOptions: { - loadOptionsMethod: 'getCalendars' + loadOptionsMethod: 'getCalendars', }, required: true, displayOptions: { show: { - operation: ['get'], - resource: ['event'] - } + operation: [ + 'get', + ], + resource: [ + 'event', + ], + }, }, default: '' }, @@ -489,11 +522,15 @@ export const eventFields = [ required: true, displayOptions: { show: { - operation: ['get'], - resource: ['event'] - } + operation: [ + 'get', + ], + resource: [ + 'event', + ], + }, }, - default: '' + default: '', }, { displayName: 'Options', @@ -503,9 +540,13 @@ export const eventFields = [ default: {}, displayOptions: { show: { - operation: ['get'], - resource: ['event'] - } + operation: [ + 'get', + ], + resource: [ + 'event', + ], + }, }, options: [ { @@ -514,17 +555,17 @@ export const eventFields = [ type: 'number', default: 0, description: `The maximum number of attendees to include in the response.
- If there are more than the specified number of attendees, only the participant is returned` + If there are more than the specified number of attendees, only the participant is returned`, }, { displayName: 'Timezone', name: 'timeZone', type: 'options', typeOptions: { - loadOptionsMethod: 'getTimezones' + loadOptionsMethod: 'getTimezones', }, default: '', - description: `Time zone used in the response. The default is the time zone of the calendar.` + description: `Time zone used in the response. The default is the time zone of the calendar.`, } ] }, @@ -536,14 +577,18 @@ export const eventFields = [ name: 'calendar', type: 'options', typeOptions: { - loadOptionsMethod: 'getCalendars' + loadOptionsMethod: 'getCalendars', }, required: true, displayOptions: { show: { - operation: ['getAll'], - resource: ['event'] - } + operation: [ + 'getAll', + ], + resource: [ + 'event', + ], + }, }, default: '' }, @@ -553,13 +598,16 @@ export const eventFields = [ type: 'boolean', displayOptions: { show: { - operation: ['getAll'], - resource: ['event'] - } + operation: [ + 'getAll', + ], + resource: [ + 'event', + ], + }, }, default: false, - description: - 'If all results should be returned or only up to a given limit.' + description: 'If all results should be returned or only up to a given limit.', }, { displayName: 'Limit', @@ -567,17 +615,23 @@ export const eventFields = [ type: 'number', displayOptions: { show: { - operation: ['getAll'], - resource: ['event'], - returnAll: [false] - } + operation: [ + 'getAll', + ], + resource: [ + 'event', + ], + returnAll: [ + false, + ], + }, }, typeOptions: { minValue: 1, - maxValue: 500 + maxValue: 500, }, default: 100, - description: 'How many results to return.' + description: 'How many results to return.', }, { displayName: 'Options', @@ -587,9 +641,13 @@ export const eventFields = [ default: {}, displayOptions: { show: { - operation: ['getAll'], - resource: ['event'] - } + operation: [ + 'getAll', + ], + resource: [ + 'event', + ], + }, }, options: [ { @@ -597,8 +655,7 @@ export const eventFields = [ name: 'iCalUID', type: 'string', default: '', - description: - 'Specifies event ID in the iCalendar format to be included in the response' + description: 'Specifies event ID in the iCalendar format to be included in the response', }, { displayName: 'Max Attendees', @@ -606,7 +663,7 @@ export const eventFields = [ type: 'number', default: 0, description: `The maximum number of attendees to include in the response.
- If there are more than the specified number of attendees, only the participant is returned` + If there are more than the specified number of attendees, only the participant is returned`, }, { displayName: 'Order By', @@ -616,40 +673,37 @@ export const eventFields = [ { name: 'Start Time', value: 'startTime', - description: - 'Order by the start date/time (ascending). This is only available when querying single events (i.e. the parameter singleEvents is True)' + description: 'Order by the start date/time (ascending). This is only available when querying single events (i.e. the parameter singleEvents is True)', }, { name: 'Updated', value: 'updated', - description: 'Order by last modification time (ascending).' + description: 'Order by last modification time (ascending).', } ], default: '', - description: 'The order of the events returned in the result.' + description: 'The order of the events returned in the result.', }, { displayName: 'Query', name: 'query', type: 'string', default: '', - description: - 'Free text search terms to find events that match these terms in any field, except for extended properties.' + description: 'Free text search terms to find events that match these terms in any field, except for extended properties.', }, { displayName: 'Show Deleted', name: 'showDeleted', type: 'boolean', default: false, - description: - 'Whether to include deleted events (with status equals "cancelled") in the result.' + description: 'Whether to include deleted events (with status equals "cancelled") in the result.', }, { displayName: 'Show Hidden Invitations', name: 'showHiddenInvitations', type: 'boolean', default: false, - description: 'Whether to include hidden invitations in the result.' + description: 'Whether to include hidden invitations in the result.', }, { displayName: 'Single Events', @@ -657,31 +711,31 @@ export const eventFields = [ type: 'boolean', default: false, description: `Whether to expand recurring events into instances and only return single one-off
- events and instances of recurring events, but not the underlying recurring events themselves.` + events and instances of recurring events, but not the underlying recurring events themselves.`, }, { displayName: 'Time Max', name: 'timeMax', type: 'dateTime', default: '', - description: `Upper bound (exclusive) for an event's start time to filter by` + description: `Upper bound (exclusive) for an event's start time to filter by`, }, { displayName: 'Time Min', name: 'timeMin', type: 'dateTime', default: '', - description: `Lower bound (exclusive) for an event's end time to filter by` + description: `Lower bound (exclusive) for an event's end time to filter by`, }, { displayName: 'Timezone', name: 'timeZone', type: 'options', typeOptions: { - loadOptionsMethod: 'getTimezones' + loadOptionsMethod: 'getTimezones', }, default: '', - description: `Time zone used in the response. The default is the time zone of the calendar.` + description: `Time zone used in the response. The default is the time zone of the calendar.`, }, { displayName: 'Updated Min', @@ -689,7 +743,7 @@ export const eventFields = [ type: 'dateTime', default: '', description: `Lower bound for an event's last modification time (as a RFC3339 timestamp) to filter by. - When specified, entries deleted since this time will always be included regardless of showDeleted` + When specified, entries deleted since this time will always be included regardless of showDeleted`, } ] }, @@ -706,11 +760,15 @@ export const eventFields = [ required: true, displayOptions: { show: { - operation: ['update'], - resource: ['event'] - } + operation: [ + 'update', + ], + resource: [ + 'event', + ], + }, }, - default: '' + default: '', }, { displayName: 'Event ID', @@ -719,11 +777,15 @@ export const eventFields = [ required: true, displayOptions: { show: { - operation: ['update'], - resource: ['event'] - } + operation: [ + 'update', + ], + resource: [ + 'event', + ], + }, }, - default: '' + default: '', }, { displayName: 'Use Default Reminders', @@ -731,9 +793,13 @@ export const eventFields = [ type: 'boolean', displayOptions: { show: { - operation: ['update'], - resource: ['event'] - } + operation: [ + 'update', + ], + resource: [ + 'event', + ], + }, }, default: true }, @@ -745,9 +811,13 @@ export const eventFields = [ default: {}, displayOptions: { show: { - operation: ['update'], - resource: ['event'] - } + operation: [ + 'update', + ], + resource: [ + 'event', + ], + }, }, options: [ { @@ -757,15 +827,15 @@ export const eventFields = [ options: [ { name: 'Yes', - value: 'yes' + value: 'yes', }, { name: 'No', - value: 'no' + value: 'no', } ], default: 'no', - description: 'Wheater the event is all day or not' + description: 'Wheater the event is all day or not', }, { displayName: 'Attendees', @@ -773,64 +843,62 @@ export const eventFields = [ type: 'string', typeOptions: { multipleValues: true, - multipleValueButtonText: 'Add Attendee' + multipleValueButtonText: 'Add Attendee', }, default: '', - description: 'The attendees of the event' + description: 'The attendees of the event', }, { displayName: 'Color', name: 'color', type: 'options', typeOptions: { - loadOptionsMethod: 'getColors' + loadOptionsMethod: 'getColors', }, default: '', - description: 'The color of the event.' + description: 'The color of the event.', }, { displayName: 'End', name: 'end', type: 'dateTime', default: '', - description: 'End time of the event.' + description: 'End time of the event.', }, { displayName: 'Guests Can Invite Others', name: 'guestsCanInviteOthers', type: 'boolean', default: true, - description: - 'Whether attendees other than the organizer can invite others to the event' + description: 'Whether attendees other than the organizer can invite others to the event', }, { displayName: 'Guests Can Modify', name: 'guestsCanModify', type: 'boolean', default: false, - description: - 'Whether attendees other than the organizer can modify the event' + description: 'Whether attendees other than the organizer can modify the event', }, { displayName: 'Guests Can See Other Guests', name: 'guestsCanSeeOtherGuests', type: 'boolean', default: true, - description: `Whether attendees other than the organizer can see who the event's attendees are.` + description: `Whether attendees other than the organizer can see who the event's attendees are.`, }, { displayName: 'ID', name: 'id', type: 'string', default: '', - description: 'Opaque identifier of the event' + description: 'Opaque identifier of the event', }, { displayName: 'Location', name: 'location', type: 'string', default: '', - description: 'Geographic location of the event as free-form text.' + description: 'Geographic location of the event as free-form text.', }, { displayName: 'Max Attendees', @@ -838,7 +906,7 @@ export const eventFields = [ type: 'number', default: 0, description: `The maximum number of attendees to include in the response.
- If there are more than the specified number of attendees, only the participant is returned` + If there are more than the specified number of attendees, only the participant is returned`, }, { displayName: 'Repeat Frecuency', @@ -847,44 +915,44 @@ export const eventFields = [ options: [ { name: 'Daily', - value: 'Daily' + value: 'Daily', }, { name: 'Weekly', - value: 'weekly' + value: 'weekly', }, { name: 'Monthly', - value: 'monthly' + value: 'monthly', }, { name: 'Yearly', - value: 'yearly' + value: 'yearly', } ], - default: '' + default: '', }, { displayName: 'Repeat Until', name: 'repeatUntil', type: 'dateTime', - default: '' + default: '', }, { displayName: 'Repeat How Many Times?', name: 'repeatHowManyTimes', type: 'number', typeOptions: { - minValue: 1 + minValue: 1, }, - default: 1 + default: 1, }, { displayName: 'Start', name: 'start', type: 'dateTime', default: '', - description: 'Start time of the event.' + description: 'Start time of the event.', }, { displayName: 'Send Updates', @@ -894,31 +962,28 @@ export const eventFields = [ { name: 'All', value: 'all', - description: ' Notifications are sent to all guests' + description: ' Notifications are sent to all guests', }, { name: 'External Only', value: 'externalOnly', - description: - 'Notifications are sent to non-Google Calendar guests only' + description: 'Notifications are sent to non-Google Calendar guests only', }, { name: 'None', value: 'none', - description: - ' No notifications are sent. This value should only be used for migration use case' + description: 'No notifications are sent. This value should only be used for migration use case', } ], - description: - 'Whether to send notifications about the creation of the new event', - default: '' + description: 'Whether to send notifications about the creation of the new event', + default: '', }, { displayName: 'Summary', name: 'summary', type: 'string', default: '', - description: 'Title of the event.' + description: 'Title of the event.', }, { displayName: 'Show Me As', @@ -928,27 +993,26 @@ export const eventFields = [ { name: 'Available', value: 'transparent', - description: 'The event does not block time on the calendar' + description: 'The event does not block time on the calendar', }, { name: 'Busy', value: 'opaque', - description: ' The event does block time on the calendar.' - } + description: ' The event does block time on the calendar.', + }, ], default: 'opaque', - description: 'Whether the event blocks time on the calendar' + description: 'Whether the event blocks time on the calendar', }, { displayName: 'Timezone', name: 'timezone', type: 'options', typeOptions: { - loadOptionsMethod: 'getTimezones' + loadOptionsMethod: 'getTimezones', }, default: '', - description: - 'The timezone the event will have set. By default events are schedule on n8n timezone ' + description: 'The timezone the event will have set. By default events are schedule on n8n timezone', }, { displayName: 'Visibility', @@ -958,32 +1022,28 @@ export const eventFields = [ { name: 'Confidential', value: 'confidential', - description: - 'The event is private. This value is provided for compatibility reasons.' + description: 'The event is private. This value is provided for compatibility reasons.', }, { name: 'Default', value: 'default', - description: - ' Uses the default visibility for events on the calendar.' + description: 'Uses the default visibility for events on the calendar.', }, { name: 'Public', value: 'public', - description: - 'The event is public and event details are visible to all readers of the calendar.' + description: 'The event is public and event details are visible to all readers of the calendar.', }, { name: 'Private', value: 'private', - description: - 'The event is private and only event attendees may view event details.' + description: 'The event is private and only event attendees may view event details.', } ], default: 'default', - description: 'Visibility of the event.' - } - ] + description: 'Visibility of the event.', + }, + ], }, { displayName: 'Reminders', @@ -997,10 +1057,16 @@ export const eventFields = [ required: false, displayOptions: { show: { - resource: ['event'], - operation: ['update'], - useDefaultReminders: [false] - } + resource: [ + 'event', + ], + operation: [ + 'update', + ], + useDefaultReminders: [ + false, + ], + }, }, options: [ { @@ -1014,14 +1080,14 @@ export const eventFields = [ options: [ { name: 'Email', - value: 'email' + value: 'email', }, { name: 'Popup', - value: 'popup' + value: 'popup', } ], - default: '' + default: '', }, { displayName: 'Minutes Before', @@ -1029,13 +1095,13 @@ export const eventFields = [ type: 'number', typeOptions: { minValue: 0, - maxValue: 40320 + maxValue: 40320, }, - default: 0 - } - ] - } + default: 0, + }, + ], + }, ], - description: `If the event doesn't use the default reminders, this lists the reminders specific to the event` + description: `If the event doesn't use the default reminders, this lists the reminders specific to the event`, } ] as INodeProperties[]; diff --git a/packages/nodes-base/nodes/Google/Calendar/EventInterface.ts b/packages/nodes-base/nodes/Google/Calendar/EventInterface.ts index 72bf96cc80..14cda0fe41 100644 --- a/packages/nodes-base/nodes/Google/Calendar/EventInterface.ts +++ b/packages/nodes-base/nodes/Google/Calendar/EventInterface.ts @@ -1,4 +1,6 @@ -import { IDataObject } from "n8n-workflow"; +import { + IDataObject, + } from 'n8n-workflow'; export interface IReminder { useDefault?: boolean; diff --git a/packages/nodes-base/nodes/Google/Calendar/GoogleCalendar.node.ts b/packages/nodes-base/nodes/Google/Calendar/GoogleCalendar.node.ts index 53d3d9de83..dc0ddad947 100644 --- a/packages/nodes-base/nodes/Google/Calendar/GoogleCalendar.node.ts +++ b/packages/nodes-base/nodes/Google/Calendar/GoogleCalendar.node.ts @@ -1,4 +1,6 @@ -import { IExecuteFunctions } from 'n8n-core'; +import { + IExecuteFunctions, +} from 'n8n-core'; import { IDataObject, @@ -6,14 +8,22 @@ import { INodeTypeDescription, INodeType, ILoadOptionsFunctions, - INodePropertyOptions + INodePropertyOptions, } from 'n8n-workflow'; -import { googleApiRequest, googleApiRequestAllItems } from './GenericFunctions'; +import { + googleApiRequest, + googleApiRequestAllItems, +} from './GenericFunctions'; -import { eventOperations, eventFields } from './EventDescription'; +import { + eventOperations, + eventFields, +} from './EventDescription'; -import { IEvent } from './EventInterface'; +import { + IEvent, +} from './EventInterface'; import * as moment from 'moment-timezone'; @@ -28,14 +38,14 @@ export class GoogleCalendar implements INodeType { description: 'Consume Google Calendar API.', defaults: { name: 'Google Calendar', - color: '#3E87E4' + color: '#3E87E4', }, inputs: ['main'], outputs: ['main'], credentials: [ { name: 'googleCalendarOAuth2Api', - required: true + required: true, } ], properties: [ @@ -46,15 +56,15 @@ export class GoogleCalendar implements INodeType { options: [ { name: 'Event', - value: 'event' - } + value: 'event', + }, ], default: 'event', description: 'The resource to operate on.' }, ...eventOperations, - ...eventFields - ] + ...eventFields, + ], }; methods = { diff --git a/packages/nodes-base/nodes/MessageBird/MessageBird.node.ts b/packages/nodes-base/nodes/MessageBird/MessageBird.node.ts index 5a7418a708..46f70c85d6 100644 --- a/packages/nodes-base/nodes/MessageBird/MessageBird.node.ts +++ b/packages/nodes-base/nodes/MessageBird/MessageBird.node.ts @@ -1,13 +1,17 @@ -import { IExecuteFunctions } from 'n8n-core'; +import { + IExecuteFunctions, + } from 'n8n-core'; import { IDataObject, INodeTypeDescription, INodeExecutionData, - INodeType + INodeType, } from 'n8n-workflow'; -import { messageBirdApiRequest } from './GenericFunctions'; +import { + messageBirdApiRequest, +} from './GenericFunctions'; export class MessageBird implements INodeType { description: INodeTypeDescription = { @@ -20,15 +24,15 @@ export class MessageBird implements INodeType { description: 'Sending SMS', defaults: { name: 'MessageBird', - color: '#2481d7' + color: '#2481d7', }, inputs: ['main'], outputs: ['main'], credentials: [ { name: 'messageBirdApi', - required: true - } + required: true, + }, ], properties: [ { @@ -38,31 +42,32 @@ export class MessageBird implements INodeType { options: [ { name: 'SMS', - value: 'sms' - } + value: 'sms', + }, ], default: 'sms', - description: 'The resource to operate on.' + description: 'The resource to operate on.', }, - { displayName: 'Operation', name: 'operation', type: 'options', displayOptions: { show: { - resource: ['sms'] - } + resource: [ + 'sms', + ], + }, }, options: [ { name: 'Send', value: 'send', - description: 'Send text messages (SMS)' - } + description: 'Send text messages (SMS)', + }, ], default: 'send', - description: 'The operation to perform.' + description: 'The operation to perform.', }, // ---------------------------------- @@ -77,11 +82,15 @@ export class MessageBird implements INodeType { required: true, displayOptions: { show: { - operation: ['send'], - resource: ['sms'] - } + operation: [ + 'send', + ], + resource: [ + 'sms', + ], + }, }, - description: 'The number from which to send the message.' + description: 'The number from which to send the message.', }, { displayName: 'To', @@ -92,13 +101,16 @@ export class MessageBird implements INodeType { required: true, displayOptions: { show: { - operation: ['send'], - resource: ['sms'] - } + operation: [ + 'send', + ], + resource: [ + 'sms', + ], + }, }, - description: 'All recipients separated by commas.' + description: 'All recipients separated by commas.', }, - { displayName: 'Message', name: 'message', @@ -107,11 +119,15 @@ export class MessageBird implements INodeType { required: true, displayOptions: { show: { - operation: ['send'], - resource: ['sms'] - } + operation: [ + 'send', + ], + resource: [ + 'sms', + ], + }, }, - description: 'The message to be send.' + description: 'The message to be send.', }, { displayName: 'Additional Fields', @@ -125,8 +141,7 @@ export class MessageBird implements INodeType { name: 'createdDatetime', type: 'dateTime', default: '', - description: - 'The date and time of the creation of the message in RFC3339 format (Y-m-dTH:i:sP).' + description: 'The date and time of the creation of the message in RFC3339 format (Y-m-dTH:i:sP).', }, { displayName: 'Datacoding', @@ -135,27 +150,26 @@ export class MessageBird implements INodeType { options: [ { name: 'Auto', - value: 'auto' + value: 'auto', }, { name: 'Plain', - value: 'plain' + value: 'plain', }, { name: 'Unicode', - value: 'unicode' - } + value: 'unicode', + }, ], default: '', - description: - 'Using unicode will limit the maximum number of characters to 70 instead of 160.' + description: 'Using unicode will limit the maximum number of characters to 70 instead of 160.', }, { displayName: 'Gateway', name: 'gateway', type: 'number', default: '', - description: 'The SMS route that is used to send the message.' + description: 'The SMS route that is used to send the message.', }, { displayName: 'Group IDs', @@ -163,8 +177,7 @@ export class MessageBird implements INodeType { placeholder: '1,2', type: 'string', default: '', - description: - 'Group IDs separated by commas, If provided recipients can be omitted.' + description: 'Group IDs separated by commas, If provided recipients can be omitted.', }, { displayName: 'Message Type', @@ -174,39 +187,36 @@ export class MessageBird implements INodeType { options: [ { name: 'Flash', - value: 1 + value: 1, }, { name: 'Normal', - value: 0 - } + value: 0, + }, ], default: 1, - description: - 'Indicated the message type. 1 is a normal message, 0 is a flash message.' + description: 'Indicated the message type. 1 is a normal message, 0 is a flash message.', }, { displayName: 'Reference', name: 'reference', type: 'string', default: '', - description: 'A client reference.' + description: 'A client reference.', }, { displayName: 'Report Url', name: 'reportUrl', type: 'string', default: '', - description: - 'The status report URL to be used on a per-message basis.
Reference is required for a status report webhook to be sent.' + description: 'The status report URL to be used on a per-message basis.
Reference is required for a status report webhook to be sent.', }, { displayName: 'Scheduled Date-time', name: 'scheduledDatetime', type: 'dateTime', default: '', - description: - 'The scheduled date and time of the message in RFC3339 format (Y-m-dTH:i:sP).' + description: 'The scheduled date and time of the message in RFC3339 format (Y-m-dTH:i:sP).', }, { displayName: 'Type', @@ -215,28 +225,26 @@ export class MessageBird implements INodeType { options: [ { name: 'Binary', - value: 'binary' + value: 'binary', }, { name: 'Flash', - value: 'flash' + value: 'flash', }, { name: 'SMS', - value: 'sms' - } + value: 'sms', + }, ], default: '', - description: - 'The type of message.
Values can be: sms, binary, or flash.' + description: 'The type of message.
Values can be: sms, binary, or flash.', }, { displayName: 'Type Details', name: 'typeDetails', type: 'string', default: '', - description: - 'A hash with extra information.
Is only used when a binary message is sent.' + description: 'A hash with extra information.
Is only used when a binary message is sent.', }, { displayName: 'Validity', @@ -244,13 +252,13 @@ export class MessageBird implements INodeType { type: 'number', default: 1, typeOptions: { - minValue: 1 + minValue: 1, }, - description: 'The amount of seconds that the message is valid.' - } - ] - } - ] + description: 'The amount of seconds that the message is valid.', + }, + ], + }, + ], }; async execute(this: IExecuteFunctions): Promise { From 84c4b32261fcb48e2777cf08b83e74636bf56cd9 Mon Sep 17 00:00:00 2001 From: ricardo Date: Wed, 17 Jun 2020 23:42:04 -0400 Subject: [PATCH 083/241] :zap: Added migrations to Sqlite and Mysql --- packages/cli/src/Db.ts | 10 ++-- .../src/databases/mongodb/WebhookEntity.ts | 7 ++- .../migrations/1592447867632-WebhookModel.ts | 59 +++++++++++++++++++ .../src/databases/mysqldb/migrations/index.ts | 3 +- .../migrations/1592445003908-WebhookModel.ts | 59 +++++++++++++++++++ .../src/databases/sqlite/migrations/index.ts | 3 +- 6 files changed, 132 insertions(+), 9 deletions(-) create mode 100644 packages/cli/src/databases/mysqldb/migrations/1592447867632-WebhookModel.ts create mode 100644 packages/cli/src/databases/sqlite/migrations/1592445003908-WebhookModel.ts diff --git a/packages/cli/src/Db.ts b/packages/cli/src/Db.ts index 9077922a5c..7a8c808363 100644 --- a/packages/cli/src/Db.ts +++ b/packages/cli/src/Db.ts @@ -40,11 +40,13 @@ import { } from './databases/mongodb/migrations'; import { - InitialMigration1588157391238 + InitialMigration1588157391238, + WebhookModel1592447867632, } from './databases/mysqldb/migrations'; import { - InitialMigration1588102412422 + InitialMigration1588102412422, + WebhookModel1592445003908, } from './databases/sqlite/migrations'; import * as path from 'path'; @@ -100,7 +102,7 @@ export async function init(): Promise { password: await GenericHelpers.getConfigValue('database.mysqldb.password') as string, port: await GenericHelpers.getConfigValue('database.mysqldb.port') as number, username: await GenericHelpers.getConfigValue('database.mysqldb.user') as string, - migrations: [InitialMigration1588157391238], + migrations: [InitialMigration1588157391238, WebhookModel1592447867632], migrationsRun: true, migrationsTableName: `${entityPrefix}migrations`, }; @@ -112,7 +114,7 @@ export async function init(): Promise { type: 'sqlite', database: path.join(n8nFolder, 'database.sqlite'), entityPrefix, - migrations: [InitialMigration1588102412422], + migrations: [InitialMigration1588102412422, WebhookModel1592445003908], migrationsRun: true, migrationsTableName: `${entityPrefix}migrations`, }; diff --git a/packages/cli/src/databases/mongodb/WebhookEntity.ts b/packages/cli/src/databases/mongodb/WebhookEntity.ts index a78fd34ae9..646a995ba9 100644 --- a/packages/cli/src/databases/mongodb/WebhookEntity.ts +++ b/packages/cli/src/databases/mongodb/WebhookEntity.ts @@ -1,7 +1,7 @@ import { Column, Entity, - PrimaryColumn, + Index, } from 'typeorm'; import { @@ -9,15 +9,16 @@ import { } from '../../Interfaces'; @Entity() +@Index(['webhookPath', 'method'], { unique: true }) export class WebhookEntity implements IWebhookDb { @Column() workflowId: number; - @PrimaryColumn() + @Column() webhookPath: string; - @PrimaryColumn() + @Column() method: string; @Column() diff --git a/packages/cli/src/databases/mysqldb/migrations/1592447867632-WebhookModel.ts b/packages/cli/src/databases/mysqldb/migrations/1592447867632-WebhookModel.ts new file mode 100644 index 0000000000..6c81f612ed --- /dev/null +++ b/packages/cli/src/databases/mysqldb/migrations/1592447867632-WebhookModel.ts @@ -0,0 +1,59 @@ +import { + MigrationInterface, + QueryRunner, +} from 'typeorm'; + +import * as config from '../../../../config'; + +import { + IWorkflowDb, + NodeTypes, + WebhookHelpers, +} from '../../..'; + +import { + Workflow, +} from 'n8n-workflow/dist/src/Workflow'; + +import { + IWebhookDb, +} from '../../../Interfaces'; + +export class WebhookModel1592447867632 implements MigrationInterface { + name = 'WebhookModel1592447867632'; + + async up(queryRunner: QueryRunner): Promise { + const tablePrefix = config.get('database.tablePrefix'); + + await queryRunner.query(`CREATE TABLE IF NOT EXISTS ${tablePrefix}webhook_entity (workflowId int NOT NULL, webhookPath varchar(255) NOT NULL, method varchar(255) NOT NULL, node varchar(255) NOT NULL, PRIMARY KEY (webhookPath, method)) ENGINE=InnoDB`); + + const workflows = await queryRunner.query(`SELECT * FROM ${tablePrefix}workflow_entity WHERE active=true`) as IWorkflowDb[]; + const data: IWebhookDb[] = []; + const nodeTypes = NodeTypes(); + for (const workflow of workflows) { + const workflowInstance = new Workflow({ id: workflow.id as string, name: workflow.name, nodes: workflow.nodes, connections: workflow.connections, active: workflow.active, nodeTypes, staticData: workflow.staticData, settings: workflow.settings }); + const webhooks = WebhookHelpers.getWorkflowWebhooksBasic(workflowInstance); + for (const webhook of webhooks) { + data.push({ + workflowId: workflowInstance.id as string, + webhookPath: webhook.path, + method: webhook.httpMethod, + node: webhook.node, + }); + } + } + + if (data.length !== 0) { + await queryRunner.manager.createQueryBuilder() + .insert() + .into(`${tablePrefix}webhook_entity`) + .values(data) + .execute(); + } + } + + async down(queryRunner: QueryRunner): Promise { + const tablePrefix = config.get('database.tablePrefix'); + await queryRunner.query(`DROP TABLE ${tablePrefix}webhook_entity`); + } +} diff --git a/packages/cli/src/databases/mysqldb/migrations/index.ts b/packages/cli/src/databases/mysqldb/migrations/index.ts index ac2dcab467..9e5abd3b8c 100644 --- a/packages/cli/src/databases/mysqldb/migrations/index.ts +++ b/packages/cli/src/databases/mysqldb/migrations/index.ts @@ -1 +1,2 @@ -export * from './1588157391238-InitialMigration'; \ No newline at end of file +export * from './1588157391238-InitialMigration'; +export * from './1592447867632-WebhookModel'; diff --git a/packages/cli/src/databases/sqlite/migrations/1592445003908-WebhookModel.ts b/packages/cli/src/databases/sqlite/migrations/1592445003908-WebhookModel.ts new file mode 100644 index 0000000000..83e59b2f6f --- /dev/null +++ b/packages/cli/src/databases/sqlite/migrations/1592445003908-WebhookModel.ts @@ -0,0 +1,59 @@ +import { + MigrationInterface, + QueryRunner, +} from "typeorm"; + +import * as config from '../../../../config'; + +import { + IWorkflowDb, + NodeTypes, + WebhookHelpers, +} from '../../..'; + +import { + Workflow, +} from 'n8n-workflow/dist/src/Workflow'; + +import { + IWebhookDb, +} from '../../../Interfaces'; + +export class WebhookModel1592445003908 implements MigrationInterface { + name = 'WebhookModel1592445003908'; + + async up(queryRunner: QueryRunner): Promise { + const tablePrefix = config.get('database.tablePrefix'); + + await queryRunner.query(`CREATE TABLE IF NOT EXISTS ${tablePrefix}webhook_entity ("workflowId" integer NOT NULL, "webhookPath" varchar NOT NULL, "method" varchar NOT NULL, "node" varchar NOT NULL, PRIMARY KEY ("webhookPath", "method"))`); + + const workflows = await queryRunner.query(`SELECT * FROM ${tablePrefix}workflow_entity WHERE active=true`) as IWorkflowDb[]; + const data: IWebhookDb[] = []; + const nodeTypes = NodeTypes(); + for (const workflow of workflows) { + const workflowInstance = new Workflow({ id: workflow.id as string, name: workflow.name, nodes: workflow.nodes, connections: workflow.connections, active: workflow.active, nodeTypes, staticData: workflow.staticData, settings: workflow.settings }); + const webhooks = WebhookHelpers.getWorkflowWebhooksBasic(workflowInstance); + for (const webhook of webhooks) { + data.push({ + workflowId: workflowInstance.id as string, + webhookPath: webhook.path, + method: webhook.httpMethod, + node: webhook.node, + }); + } + } + + if (data.length !== 0) { + await queryRunner.manager.createQueryBuilder() + .insert() + .into(`${tablePrefix}webhook_entity`) + .values(data) + .execute(); + } + } + + async down(queryRunner: QueryRunner): Promise { + const tablePrefix = config.get('database.tablePrefix'); + await queryRunner.query(`DROP TABLE ${tablePrefix}webhook_entity`); + } +} diff --git a/packages/cli/src/databases/sqlite/migrations/index.ts b/packages/cli/src/databases/sqlite/migrations/index.ts index 8d9a0a0b16..a830a007c7 100644 --- a/packages/cli/src/databases/sqlite/migrations/index.ts +++ b/packages/cli/src/databases/sqlite/migrations/index.ts @@ -1 +1,2 @@ -export * from './1588102412422-InitialMigration'; \ No newline at end of file +export * from './1588102412422-InitialMigration'; +export * from './1592445003908-WebhookModel'; From 0d1b4611c8a32214f6c9bfd5103ae885e39d08e7 Mon Sep 17 00:00:00 2001 From: Tanay Pant <7481165+tanay1337@users.noreply.github.com> Date: Thu, 18 Jun 2020 10:08:31 +0200 Subject: [PATCH 084/241] =?UTF-8?q?=E2=9C=8D=EF=B8=8F=20Make=20a=20few=20l?= =?UTF-8?q?anguage=20changes=20(#681)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CONTRIBUTING.md | 10 +++++----- LICENSE.md | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 568f8fc9a7..fcc046beef 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -38,7 +38,7 @@ The most important directories: execution, active webhooks and workflows - [/packages/editor-ui](/packages/editor-ui) - Vue frontend workflow editor - - [/packages/node-dev](/packages/node-dev) - Simple CLI to create new n8n-nodes + - [/packages/node-dev](/packages/node-dev) - CLI to create new n8n-nodes - [/packages/nodes-base](/packages/nodes-base) - Base n8n nodes - [/packages/workflow](/packages/workflow) - Workflow code with interfaces which get used by front- & backend @@ -159,7 +159,7 @@ tests of all packages. ## Create Custom Nodes -It is very easy to create own nodes for n8n. More information about that can +It is very straightforward to create your own nodes for n8n. More information about that can be found in the documentation of "n8n-node-dev" which is a small CLI which helps with n8n-node-development. @@ -177,9 +177,9 @@ If you want to create a node which should be added to n8n follow these steps: 1. Create a new folder for the new node. For a service named "Example" the folder would be called: `/packages/nodes-base/nodes/Example` - 1. If there is already a similar node simply copy the existing one in the new folder and rename it. If none exists yet, create a boilerplate node with [n8n-node-dev](https://github.com/n8n-io/n8n/tree/master/packages/node-dev) and copy that one in the folder. + 1. If there is already a similar node, copy the existing one in the new folder and rename it. If none exists yet, create a boilerplate node with [n8n-node-dev](https://github.com/n8n-io/n8n/tree/master/packages/node-dev) and copy that one in the folder. - 1. If the node needs credentials because it has to authenticate with an API or similar create new ones. Existing ones can be found in folder `/packages/nodes-base/credentials`. Also there it is the easiest to simply copy existing similar ones. + 1. If the node needs credentials because it has to authenticate with an API or similar create new ones. Existing ones can be found in folder `/packages/nodes-base/credentials`. Also there it is the easiest to copy existing similar ones. 1. Add the path to the new node (and optionally credentials) to package.json of `nodes-base`. It already contains a property `n8n` with its own keys `credentials` and `nodes`. @@ -236,6 +236,6 @@ docsify serve ./docs That we do not have any potential problems later it is sadly necessary to sign a [Contributor License Agreement](CONTRIBUTOR_LICENSE_AGREEMENT.md). That can be done literally with the push of a button. -We used the most simple one that exists. It is from [Indie Open Source](https://indieopensource.com/forms/cla) which uses plain English and is literally just a few lines long. +We used the most simple one that exists. It is from [Indie Open Source](https://indieopensource.com/forms/cla) which uses plain English and is literally only a few lines long. A bot will automatically comment on the pull request once it got opened asking for the agreement to be signed. Before it did not get signed it is sadly not possible to merge it in. diff --git a/LICENSE.md b/LICENSE.md index aac54547eb..c2aec2148e 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -215,7 +215,7 @@ Licensor: n8n GmbH same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright [yyyy] [name of copyright owner] + Copyright [2020] [n8n GmbH] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. From bae541e13b1ed44be998e829b55d56f82c90d815 Mon Sep 17 00:00:00 2001 From: Tanay Pant <7481165+tanay1337@users.noreply.github.com> Date: Thu, 18 Jun 2020 10:08:31 +0200 Subject: [PATCH 085/241] :books: Make a few language changes (#681) --- CONTRIBUTING.md | 10 +++++----- LICENSE.md | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 568f8fc9a7..fcc046beef 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -38,7 +38,7 @@ The most important directories: execution, active webhooks and workflows - [/packages/editor-ui](/packages/editor-ui) - Vue frontend workflow editor - - [/packages/node-dev](/packages/node-dev) - Simple CLI to create new n8n-nodes + - [/packages/node-dev](/packages/node-dev) - CLI to create new n8n-nodes - [/packages/nodes-base](/packages/nodes-base) - Base n8n nodes - [/packages/workflow](/packages/workflow) - Workflow code with interfaces which get used by front- & backend @@ -159,7 +159,7 @@ tests of all packages. ## Create Custom Nodes -It is very easy to create own nodes for n8n. More information about that can +It is very straightforward to create your own nodes for n8n. More information about that can be found in the documentation of "n8n-node-dev" which is a small CLI which helps with n8n-node-development. @@ -177,9 +177,9 @@ If you want to create a node which should be added to n8n follow these steps: 1. Create a new folder for the new node. For a service named "Example" the folder would be called: `/packages/nodes-base/nodes/Example` - 1. If there is already a similar node simply copy the existing one in the new folder and rename it. If none exists yet, create a boilerplate node with [n8n-node-dev](https://github.com/n8n-io/n8n/tree/master/packages/node-dev) and copy that one in the folder. + 1. If there is already a similar node, copy the existing one in the new folder and rename it. If none exists yet, create a boilerplate node with [n8n-node-dev](https://github.com/n8n-io/n8n/tree/master/packages/node-dev) and copy that one in the folder. - 1. If the node needs credentials because it has to authenticate with an API or similar create new ones. Existing ones can be found in folder `/packages/nodes-base/credentials`. Also there it is the easiest to simply copy existing similar ones. + 1. If the node needs credentials because it has to authenticate with an API or similar create new ones. Existing ones can be found in folder `/packages/nodes-base/credentials`. Also there it is the easiest to copy existing similar ones. 1. Add the path to the new node (and optionally credentials) to package.json of `nodes-base`. It already contains a property `n8n` with its own keys `credentials` and `nodes`. @@ -236,6 +236,6 @@ docsify serve ./docs That we do not have any potential problems later it is sadly necessary to sign a [Contributor License Agreement](CONTRIBUTOR_LICENSE_AGREEMENT.md). That can be done literally with the push of a button. -We used the most simple one that exists. It is from [Indie Open Source](https://indieopensource.com/forms/cla) which uses plain English and is literally just a few lines long. +We used the most simple one that exists. It is from [Indie Open Source](https://indieopensource.com/forms/cla) which uses plain English and is literally only a few lines long. A bot will automatically comment on the pull request once it got opened asking for the agreement to be signed. Before it did not get signed it is sadly not possible to merge it in. diff --git a/LICENSE.md b/LICENSE.md index aac54547eb..c2aec2148e 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -215,7 +215,7 @@ Licensor: n8n GmbH same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright [yyyy] [name of copyright owner] + Copyright [2020] [n8n GmbH] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. From d9906e1b24989db2c200f38542127cc98846ab0a Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Thu, 18 Jun 2020 10:12:13 +0200 Subject: [PATCH 086/241] :books: Text fix --- LICENSE.md | 2 +- packages/cli/LICENSE.md | 2 +- packages/core/LICENSE.md | 2 +- packages/editor-ui/LICENSE.md | 2 +- packages/node-dev/LICENSE.md | 2 +- packages/nodes-base/LICENSE.md | 2 +- packages/workflow/LICENSE.md | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/LICENSE.md b/LICENSE.md index c2aec2148e..24a7d38fc9 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -215,7 +215,7 @@ Licensor: n8n GmbH same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright [2020] [n8n GmbH] + Copyright 2020 n8n GmbH Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/packages/cli/LICENSE.md b/packages/cli/LICENSE.md index aac54547eb..24a7d38fc9 100644 --- a/packages/cli/LICENSE.md +++ b/packages/cli/LICENSE.md @@ -215,7 +215,7 @@ Licensor: n8n GmbH same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright [yyyy] [name of copyright owner] + Copyright 2020 n8n GmbH Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/packages/core/LICENSE.md b/packages/core/LICENSE.md index aac54547eb..24a7d38fc9 100644 --- a/packages/core/LICENSE.md +++ b/packages/core/LICENSE.md @@ -215,7 +215,7 @@ Licensor: n8n GmbH same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright [yyyy] [name of copyright owner] + Copyright 2020 n8n GmbH Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/packages/editor-ui/LICENSE.md b/packages/editor-ui/LICENSE.md index aac54547eb..24a7d38fc9 100644 --- a/packages/editor-ui/LICENSE.md +++ b/packages/editor-ui/LICENSE.md @@ -215,7 +215,7 @@ Licensor: n8n GmbH same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright [yyyy] [name of copyright owner] + Copyright 2020 n8n GmbH Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/packages/node-dev/LICENSE.md b/packages/node-dev/LICENSE.md index aac54547eb..24a7d38fc9 100644 --- a/packages/node-dev/LICENSE.md +++ b/packages/node-dev/LICENSE.md @@ -215,7 +215,7 @@ Licensor: n8n GmbH same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright [yyyy] [name of copyright owner] + Copyright 2020 n8n GmbH Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/packages/nodes-base/LICENSE.md b/packages/nodes-base/LICENSE.md index aac54547eb..24a7d38fc9 100644 --- a/packages/nodes-base/LICENSE.md +++ b/packages/nodes-base/LICENSE.md @@ -215,7 +215,7 @@ Licensor: n8n GmbH same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright [yyyy] [name of copyright owner] + Copyright 2020 n8n GmbH Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/packages/workflow/LICENSE.md b/packages/workflow/LICENSE.md index aac54547eb..24a7d38fc9 100644 --- a/packages/workflow/LICENSE.md +++ b/packages/workflow/LICENSE.md @@ -215,7 +215,7 @@ Licensor: n8n GmbH same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright [yyyy] [name of copyright owner] + Copyright 2020 n8n GmbH Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. From 5db2ce2924f08a462ad58616e0e9ab779fdf1422 Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Sat, 20 Jun 2020 12:28:56 +0200 Subject: [PATCH 087/241] :bug: Fix issue that changed static data in webhook function did not get saved --- packages/cli/src/WebhookHelpers.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/cli/src/WebhookHelpers.ts b/packages/cli/src/WebhookHelpers.ts index d39e3f5dee..64e4c101ff 100644 --- a/packages/cli/src/WebhookHelpers.ts +++ b/packages/cli/src/WebhookHelpers.ts @@ -149,6 +149,9 @@ export function getWorkflowWebhooks(workflow: Workflow, additionalData: IWorkflo }; } + // Save static data if it changed + await WorkflowHelpers.saveStaticData(workflow); + if (webhookData.webhookDescription['responseHeaders'] !== undefined) { const responseHeaders = workflow.getComplexParameterValue(workflowStartNode, webhookData.webhookDescription['responseHeaders'], undefined) as { entries?: Array<{ From 6d7368d7237d9fc5020da8ce872fc18823ee6fce Mon Sep 17 00:00:00 2001 From: Ricardo Espinoza Date: Sat, 20 Jun 2020 11:51:11 -0400 Subject: [PATCH 088/241] :zap: Added description and fixed issue with colors (#686) --- .../nodes/Google/Calendar/EventDescription.ts | 18 ++++++++++++++++++ .../nodes/Google/Calendar/GenericFunctions.ts | 10 ++++++++-- .../Google/Calendar/GoogleCalendar.node.ts | 8 ++++---- 3 files changed, 30 insertions(+), 6 deletions(-) diff --git a/packages/nodes-base/nodes/Google/Calendar/EventDescription.ts b/packages/nodes-base/nodes/Google/Calendar/EventDescription.ts index 44af95a151..545ed841f1 100644 --- a/packages/nodes-base/nodes/Google/Calendar/EventDescription.ts +++ b/packages/nodes-base/nodes/Google/Calendar/EventDescription.ts @@ -177,6 +177,15 @@ export const eventFields = [ default: '', description: 'The color of the event.', }, + { + displayName: 'Description', + name: 'description', + type: 'string', + typeOptions: { + alwaysOpenEditWindow: true, + }, + default: '', + }, { displayName: 'Guests Can Invite Others', name: 'guestsCanInviteOthers', @@ -858,6 +867,15 @@ export const eventFields = [ default: '', description: 'The color of the event.', }, + { + displayName: 'Description', + name: 'description', + type: 'string', + typeOptions: { + alwaysOpenEditWindow: true, + }, + default: '', + }, { displayName: 'End', name: 'end', diff --git a/packages/nodes-base/nodes/Google/Calendar/GenericFunctions.ts b/packages/nodes-base/nodes/Google/Calendar/GenericFunctions.ts index 18d808cef7..caf4c9868d 100644 --- a/packages/nodes-base/nodes/Google/Calendar/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Google/Calendar/GenericFunctions.ts @@ -33,9 +33,15 @@ export async function googleApiRequest(this: IExecuteFunctions | IExecuteSingleF //@ts-ignore return await this.helpers.requestOAuth2.call(this, 'googleCalendarOAuth2Api', options); } catch (error) { - if (error.response && error.response.body && error.response.body.message) { + if (error.response && error.response.body && error.response.body.error) { + + let errors = error.response.body.error.errors; + + errors = errors.map((e: IDataObject) => e.message); // Try to return the error prettier - throw new Error(`Google Calendar error response [${error.statusCode}]: ${error.response.body.message}`); + throw new Error( + `Google Calendar error response [${error.statusCode}]: ${errors.join('|')}` + ); } throw error; } diff --git a/packages/nodes-base/nodes/Google/Calendar/GoogleCalendar.node.ts b/packages/nodes-base/nodes/Google/Calendar/GoogleCalendar.node.ts index dc0ddad947..4c8208590e 100644 --- a/packages/nodes-base/nodes/Google/Calendar/GoogleCalendar.node.ts +++ b/packages/nodes-base/nodes/Google/Calendar/GoogleCalendar.node.ts @@ -97,16 +97,16 @@ export class GoogleCalendar implements INodeType { this: ILoadOptionsFunctions ): Promise { const returnData: INodePropertyOptions[] = []; - const { calendar } = await googleApiRequest.call( + const { event } = await googleApiRequest.call( this, 'GET', '/calendar/v3/colors' ); - for (const key of Object.keys(calendar)) { - const colorName = calendar[key].background; + for (const key of Object.keys(event)) { + const colorName = `Background: ${event[key].background} - Foreground: ${event[key].foreground}`; const colorId = key; returnData.push({ - name: `${colorName} - ${colorId}`, + name: `${colorName}`, value: colorId }); } From 3d45b67d50477dc02bdc2b73cdd90e33e71e45e7 Mon Sep 17 00:00:00 2001 From: Ricardo Espinoza Date: Sat, 20 Jun 2020 12:08:30 -0400 Subject: [PATCH 089/241] :bug: Fixes issue #663 and #664 --- .../nodes/Gitlab/GenericFunctions.ts | 7 ++++-- .../nodes/Gitlab/GitlabTrigger.node.ts | 23 +++++++++++++++---- 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/packages/nodes-base/nodes/Gitlab/GenericFunctions.ts b/packages/nodes-base/nodes/Gitlab/GenericFunctions.ts index 8f1811b8c7..6362896cff 100644 --- a/packages/nodes-base/nodes/Gitlab/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Gitlab/GenericFunctions.ts @@ -1,6 +1,7 @@ import { IExecuteFunctions, IHookFunctions, + ILoadOptionsFunctions, } from 'n8n-core'; import { @@ -16,7 +17,7 @@ import { * @param {object} body * @returns {Promise} */ -export async function gitlabApiRequest(this: IHookFunctions | IExecuteFunctions, method: string, endpoint: string, body: object, query?: object): Promise { // tslint:disable-line:no-any +export async function gitlabApiRequest(this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions, method: string, endpoint: string, body: object, query?: object): Promise { // tslint:disable-line:no-any const credentials = this.getCredentials('gitlabApi'); if (credentials === undefined) { throw new Error('No credentials got returned!'); @@ -34,7 +35,9 @@ export async function gitlabApiRequest(this: IHookFunctions | IExecuteFunctions, }; try { - return await this.helpers.request(options); + //@ts-ignore + return await this.helpers?.request(options); + } catch (error) { if (error.statusCode === 401) { // Return a clear error diff --git a/packages/nodes-base/nodes/Gitlab/GitlabTrigger.node.ts b/packages/nodes-base/nodes/Gitlab/GitlabTrigger.node.ts index 28987c2458..a97f2be536 100644 --- a/packages/nodes-base/nodes/Gitlab/GitlabTrigger.node.ts +++ b/packages/nodes-base/nodes/Gitlab/GitlabTrigger.node.ts @@ -135,7 +135,10 @@ export class GitlabTrigger implements INodeType { // Webhook got created before so check if it still exists const owner = this.getNodeParameter('owner') as string; const repository = this.getNodeParameter('repository') as string; - const endpoint = `/projects/${owner}%2F${repository}/hooks/${webhookData.webhookId}`; + + const path = (`${owner}/${repository}`).replace(/\//g,'%2F'); + + const endpoint = `/projects/${path}/hooks/${webhookData.webhookId}`; try { await gitlabApiRequest.call(this, 'GET', endpoint, {}); @@ -175,15 +178,22 @@ export class GitlabTrigger implements INodeType { events[`${e}_events`] = true; } - const endpoint = `/projects/${owner}%2F${repository}/hooks`; + // gitlab set the push_events to true when the field it's not sent. + // set it to false when it's not picked by the user. + if (events['push_events'] === undefined) { + events['push_events'] = false; + } + + const path = (`${owner}/${repository}`).replace(/\//g,'%2F'); + + const endpoint = `/projects/${path}/hooks`; const body = { url: webhookUrl, - events, + ...events, enable_ssl_verification: false, }; - let responseData; try { responseData = await gitlabApiRequest.call(this, 'POST', endpoint, body); @@ -208,7 +218,10 @@ export class GitlabTrigger implements INodeType { if (webhookData.webhookId !== undefined) { const owner = this.getNodeParameter('owner') as string; const repository = this.getNodeParameter('repository') as string; - const endpoint = `/projects/${owner}%2F${repository}/hooks/${webhookData.webhookId}`; + + const path = (`${owner}/${repository}`).replace(/\//g,'%2F'); + + const endpoint = `/projects/${path}/hooks/${webhookData.webhookId}`; const body = {}; try { From 54a670c0de778d6db8d64ecf39c21f50b9901f0f Mon Sep 17 00:00:00 2001 From: Ricardo Espinoza Date: Sat, 20 Jun 2020 12:11:11 -0400 Subject: [PATCH 090/241] :bug: Fixes issue #651 and #652 (#668) * :bug: Fixes issue #651 and #652 * :zap: Added description to username field --- .../credentials/SlackOAuth2Api.credentials.ts | 3 --- .../nodes/Slack/MessageDescription.ts | 22 +------------------ packages/nodes-base/nodes/Slack/Slack.node.ts | 8 +++---- 3 files changed, 5 insertions(+), 28 deletions(-) diff --git a/packages/nodes-base/credentials/SlackOAuth2Api.credentials.ts b/packages/nodes-base/credentials/SlackOAuth2Api.credentials.ts index b56699fe68..0426ceee02 100644 --- a/packages/nodes-base/credentials/SlackOAuth2Api.credentials.ts +++ b/packages/nodes-base/credentials/SlackOAuth2Api.credentials.ts @@ -6,15 +6,12 @@ import { //https://api.slack.com/authentication/oauth-v2 const userScopes = [ 'chat:write', - 'conversations:history', - 'conversations:read', 'files:read', 'files:write', 'stars:read', 'stars:write', ]; - export class SlackOAuth2Api implements ICredentialType { name = 'slackOAuth2Api'; extends = [ diff --git a/packages/nodes-base/nodes/Slack/MessageDescription.ts b/packages/nodes-base/nodes/Slack/MessageDescription.ts index d5170aba67..8d91663155 100644 --- a/packages/nodes-base/nodes/Slack/MessageDescription.ts +++ b/packages/nodes-base/nodes/Slack/MessageDescription.ts @@ -111,7 +111,7 @@ export const messageFields = [ ], }, }, - description: 'Set the bot\'s user name.', + description: 'Set the bot\'s user name. This field will be ignored if you are using a user token.', }, { displayName: 'JSON parameters', @@ -486,26 +486,6 @@ export const messageFields = [ }, description: `Timestamp of the message to be updated.`, }, - { - displayName: 'As User', - name: 'as_user', - type: 'boolean', - default: false, - displayOptions: { - show: { - authentication: [ - 'accessToken', - ], - operation: [ - 'update' - ], - resource: [ - 'message', - ], - }, - }, - description: 'Pass true to update the message as the authed user. Bot users in this context are considered authed users.', - }, { displayName: 'Update Fields', name: 'updateFields', diff --git a/packages/nodes-base/nodes/Slack/Slack.node.ts b/packages/nodes-base/nodes/Slack/Slack.node.ts index 57fe569d22..befe931fb5 100644 --- a/packages/nodes-base/nodes/Slack/Slack.node.ts +++ b/packages/nodes-base/nodes/Slack/Slack.node.ts @@ -454,6 +454,10 @@ export class Slack implements INodeType { body.username = this.getNodeParameter('username', i) as string; } + // ignore body.as_user as it's deprecated + + delete body.as_user; + if (!jsonParameters) { const attachments = this.getNodeParameter('attachments', i, []) as unknown as Attachment[]; const blocksUi = (this.getNodeParameter('blocksUi', i, []) as IDataObject).blocksValues as IDataObject[]; @@ -691,10 +695,6 @@ export class Slack implements INodeType { ts, }; - if (authentication === 'accessToken') { - body.as_user = this.getNodeParameter('as_user', i) as boolean; - } - // The node does save the fields data differently than the API // expects so fix the data befre we send the request for (const attachment of attachments) { From 3ca9647215c9e137f4b5e0fa2e0a524d48366927 Mon Sep 17 00:00:00 2001 From: ricardo Date: Sat, 20 Jun 2020 21:59:06 -0400 Subject: [PATCH 091/241] :zap: Add mongodb migration --- packages/cli/src/ActiveWorkflowRunner.ts | 10 +++- packages/cli/src/Db.ts | 5 +- .../src/databases/mongodb/WebhookEntity.ts | 6 +- .../migrations/1592679094242-WebhookModel.ts | 57 +++++++++++++++++++ .../src/databases/mongodb/migrations/index.ts | 1 + .../migrations/1589476000887-WebhookModel.ts | 5 -- 6 files changed, 73 insertions(+), 11 deletions(-) create mode 100644 packages/cli/src/databases/mongodb/migrations/1592679094242-WebhookModel.ts diff --git a/packages/cli/src/ActiveWorkflowRunner.ts b/packages/cli/src/ActiveWorkflowRunner.ts index 13fc5697ec..c7f7ea1d69 100644 --- a/packages/cli/src/ActiveWorkflowRunner.ts +++ b/packages/cli/src/ActiveWorkflowRunner.ts @@ -35,7 +35,6 @@ import { import * as express from 'express'; - export class ActiveWorkflowRunner { private activeWorkflows: ActiveWorkflows | null = null; @@ -240,6 +239,7 @@ export class ActiveWorkflowRunner { } as IWebhookDb; try { + await Db.collections.Webhook?.insert(webhook); const webhookExists = await workflow.runWebhookMethod('checkExists', webhookData, NodeExecuteFunctions, mode, false); @@ -257,7 +257,7 @@ export class ActiveWorkflowRunner { // if it's a workflow from the the insert // TODO check if there is standard error code for deplicate key violation that works // with all databases - if (error.name === 'QueryFailedError') { + if (error.name === 'MongoError' || error.name === 'QueryFailedError') { errorMessage = `The webhook path [${webhook.webhookPath}] and method [${webhook.method}] already exist.`; @@ -303,6 +303,11 @@ export class ActiveWorkflowRunner { await workflow.runWebhookMethod('delete', webhookData, NodeExecuteFunctions, mode, false); } + // if it's a mongo objectId convert it to string + if (typeof workflowData.id === 'object') { + workflowData.id = workflowData.id.toString(); + } + const webhook = { workflowId: workflowData.id, } as IWebhookDb; @@ -310,7 +315,6 @@ export class ActiveWorkflowRunner { await Db.collections.Webhook?.delete(webhook); } - /** * Runs the given workflow * diff --git a/packages/cli/src/Db.ts b/packages/cli/src/Db.ts index 7a8c808363..ace8b62f1f 100644 --- a/packages/cli/src/Db.ts +++ b/packages/cli/src/Db.ts @@ -36,7 +36,8 @@ import { } from './databases/postgresdb/migrations'; import { - InitialMigration1587563438936 + InitialMigration1587563438936, + WebhookModel1592679094242, } from './databases/mongodb/migrations'; import { @@ -68,7 +69,7 @@ export async function init(): Promise { entityPrefix, url: await GenericHelpers.getConfigValue('database.mongodb.connectionUrl') as string, useNewUrlParser: true, - migrations: [InitialMigration1587563438936], + migrations: [InitialMigration1587563438936, WebhookModel1592679094242], migrationsRun: true, migrationsTableName: `${entityPrefix}migrations`, }; diff --git a/packages/cli/src/databases/mongodb/WebhookEntity.ts b/packages/cli/src/databases/mongodb/WebhookEntity.ts index 646a995ba9..dbf90f3da1 100644 --- a/packages/cli/src/databases/mongodb/WebhookEntity.ts +++ b/packages/cli/src/databases/mongodb/WebhookEntity.ts @@ -2,6 +2,8 @@ import { Column, Entity, Index, + ObjectID, + ObjectIdColumn, } from 'typeorm'; import { @@ -9,9 +11,11 @@ import { } from '../../Interfaces'; @Entity() -@Index(['webhookPath', 'method'], { unique: true }) export class WebhookEntity implements IWebhookDb { + @ObjectIdColumn() + id: ObjectID; + @Column() workflowId: number; diff --git a/packages/cli/src/databases/mongodb/migrations/1592679094242-WebhookModel.ts b/packages/cli/src/databases/mongodb/migrations/1592679094242-WebhookModel.ts new file mode 100644 index 0000000000..c05a44f765 --- /dev/null +++ b/packages/cli/src/databases/mongodb/migrations/1592679094242-WebhookModel.ts @@ -0,0 +1,57 @@ +import { + MigrationInterface, +} from 'typeorm'; + +import { + IWorkflowDb, + NodeTypes, + WebhookHelpers, +} from '../../..'; + +import { + Workflow, +} from 'n8n-workflow/dist/src/Workflow'; + +import { + IWebhookDb, +} from '../../../Interfaces'; + +import * as config from '../../../../config'; + +import { + MongoQueryRunner, +} from 'typeorm/driver/mongodb/MongoQueryRunner'; + +export class WebhookModel1592679094242 implements MigrationInterface { + name = 'WebhookModel1592679094242'; + + async up(queryRunner: MongoQueryRunner): Promise { + const tablePrefix = config.get('database.tablePrefix'); + const workflows = await queryRunner.cursor( `${tablePrefix}workflow_entity`, { active: true }).toArray() as IWorkflowDb[]; + const data: IWebhookDb[] = []; + const nodeTypes = NodeTypes(); + for (const workflow of workflows) { + const workflowInstance = new Workflow({ id: workflow.id as string, name: workflow.name, nodes: workflow.nodes, connections: workflow.connections, active: workflow.active, nodeTypes, staticData: workflow.staticData, settings: workflow.settings }); + const webhooks = WebhookHelpers.getWorkflowWebhooksBasic(workflowInstance); + for (const webhook of webhooks) { + data.push({ + workflowId: workflowInstance.id as string, + webhookPath: webhook.path, + method: webhook.httpMethod, + node: webhook.node, + }); + } + } + + if (data.length !== 0) { + await queryRunner.manager.insertMany(`${tablePrefix}webhook_entity`, data); + } + + await queryRunner.manager.createCollectionIndex(`${tablePrefix}webhook_entity`, ['webhookPath', 'method'], { unique: true, background: false }); + } + + async down(queryRunner: MongoQueryRunner): Promise { + const tablePrefix = config.get('database.tablePrefix'); + await queryRunner.dropTable(`${tablePrefix}webhook_entity`); + } +} diff --git a/packages/cli/src/databases/mongodb/migrations/index.ts b/packages/cli/src/databases/mongodb/migrations/index.ts index a60bdc7cf8..4072ab582d 100644 --- a/packages/cli/src/databases/mongodb/migrations/index.ts +++ b/packages/cli/src/databases/mongodb/migrations/index.ts @@ -1 +1,2 @@ export * from './1587563438936-InitialMigration'; +export * from './1592679094242-WebhookModel'; diff --git a/packages/cli/src/databases/postgresdb/migrations/1589476000887-WebhookModel.ts b/packages/cli/src/databases/postgresdb/migrations/1589476000887-WebhookModel.ts index 8ff5d583ca..dfbf94a799 100644 --- a/packages/cli/src/databases/postgresdb/migrations/1589476000887-WebhookModel.ts +++ b/packages/cli/src/databases/postgresdb/migrations/1589476000887-WebhookModel.ts @@ -36,11 +36,6 @@ export class WebhookModel1589476000887 implements MigrationInterface { const nodeTypes = NodeTypes(); for (const workflow of workflows) { const workflowInstance = new Workflow({ id: workflow.id as string, name: workflow.name, nodes: workflow.nodes, connections: workflow.connections, active: workflow.active, nodeTypes, staticData: workflow.staticData, settings: workflow.settings }); - // I'm writing something more simple than this. I tried to use the built in method - // getWorkflowWebhooks but it needs additionaldata and to get it I need the credentials - // and for some reason when I use - // const credentials = await WorkflowCredentials(node); - // to get the credentials I got an error I think is cuz the database is yet not ready. const webhooks = WebhookHelpers.getWorkflowWebhooksBasic(workflowInstance); for (const webhook of webhooks) { data.push({ From e59dd00c107d656abb03d132113298d0c7bf9f1c Mon Sep 17 00:00:00 2001 From: ricardo Date: Mon, 22 Jun 2020 13:26:41 -0400 Subject: [PATCH 092/241] done --- .../databases/sqlite/migrations/1592445003908-WebhookModel.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/cli/src/databases/sqlite/migrations/1592445003908-WebhookModel.ts b/packages/cli/src/databases/sqlite/migrations/1592445003908-WebhookModel.ts index 83e59b2f6f..f1402fad88 100644 --- a/packages/cli/src/databases/sqlite/migrations/1592445003908-WebhookModel.ts +++ b/packages/cli/src/databases/sqlite/migrations/1592445003908-WebhookModel.ts @@ -31,6 +31,10 @@ export class WebhookModel1592445003908 implements MigrationInterface { const data: IWebhookDb[] = []; const nodeTypes = NodeTypes(); for (const workflow of workflows) { + workflow.nodes = JSON.parse(workflow.nodes as unknown as string); + workflow.connections = JSON.parse(workflow.connections as unknown as string); + workflow.staticData = JSON.parse(workflow.staticData as unknown as string); + workflow.settings = JSON.parse(workflow.settings as unknown as string); const workflowInstance = new Workflow({ id: workflow.id as string, name: workflow.name, nodes: workflow.nodes, connections: workflow.connections, active: workflow.active, nodeTypes, staticData: workflow.staticData, settings: workflow.settings }); const webhooks = WebhookHelpers.getWorkflowWebhooksBasic(workflowInstance); for (const webhook of webhooks) { From b95e3464a45112f7202cb36829226746d571084e Mon Sep 17 00:00:00 2001 From: shraddha shaligram Date: Mon, 22 Jun 2020 11:51:15 -0700 Subject: [PATCH 093/241] add meeting functionality --- CONTRIBUTING.md | 10 +- LICENSE.md | 2 +- packages/cli/LICENSE.md | 2 +- packages/core/LICENSE.md | 2 +- packages/editor-ui/LICENSE.md | 2 +- packages/node-dev/LICENSE.md | 2 +- packages/nodes-base/LICENSE.md | 2 +- .../nodes/Salesforce/GenericFunctions.ts | 2 +- packages/nodes-base/nodes/Slack/Slack.node.ts | 114 +-- .../nodes-base/nodes/Zoom/GenericFunctions.ts | 12 +- .../nodes/Zoom/MeetingDescription.ts | 751 ++++++++++++++++++ .../Zoom/MeetingRegistrantDescription.ts | 407 ++++++++++ packages/nodes-base/nodes/Zoom/Zoom.node.ts | 355 ++++++++- .../nodes-base/nodes/Zoom/ZoomOperations.ts | 71 -- packages/workflow/LICENSE.md | 2 +- 15 files changed, 1561 insertions(+), 175 deletions(-) create mode 100644 packages/nodes-base/nodes/Zoom/MeetingDescription.ts create mode 100644 packages/nodes-base/nodes/Zoom/MeetingRegistrantDescription.ts delete mode 100644 packages/nodes-base/nodes/Zoom/ZoomOperations.ts diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 568f8fc9a7..fcc046beef 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -38,7 +38,7 @@ The most important directories: execution, active webhooks and workflows - [/packages/editor-ui](/packages/editor-ui) - Vue frontend workflow editor - - [/packages/node-dev](/packages/node-dev) - Simple CLI to create new n8n-nodes + - [/packages/node-dev](/packages/node-dev) - CLI to create new n8n-nodes - [/packages/nodes-base](/packages/nodes-base) - Base n8n nodes - [/packages/workflow](/packages/workflow) - Workflow code with interfaces which get used by front- & backend @@ -159,7 +159,7 @@ tests of all packages. ## Create Custom Nodes -It is very easy to create own nodes for n8n. More information about that can +It is very straightforward to create your own nodes for n8n. More information about that can be found in the documentation of "n8n-node-dev" which is a small CLI which helps with n8n-node-development. @@ -177,9 +177,9 @@ If you want to create a node which should be added to n8n follow these steps: 1. Create a new folder for the new node. For a service named "Example" the folder would be called: `/packages/nodes-base/nodes/Example` - 1. If there is already a similar node simply copy the existing one in the new folder and rename it. If none exists yet, create a boilerplate node with [n8n-node-dev](https://github.com/n8n-io/n8n/tree/master/packages/node-dev) and copy that one in the folder. + 1. If there is already a similar node, copy the existing one in the new folder and rename it. If none exists yet, create a boilerplate node with [n8n-node-dev](https://github.com/n8n-io/n8n/tree/master/packages/node-dev) and copy that one in the folder. - 1. If the node needs credentials because it has to authenticate with an API or similar create new ones. Existing ones can be found in folder `/packages/nodes-base/credentials`. Also there it is the easiest to simply copy existing similar ones. + 1. If the node needs credentials because it has to authenticate with an API or similar create new ones. Existing ones can be found in folder `/packages/nodes-base/credentials`. Also there it is the easiest to copy existing similar ones. 1. Add the path to the new node (and optionally credentials) to package.json of `nodes-base`. It already contains a property `n8n` with its own keys `credentials` and `nodes`. @@ -236,6 +236,6 @@ docsify serve ./docs That we do not have any potential problems later it is sadly necessary to sign a [Contributor License Agreement](CONTRIBUTOR_LICENSE_AGREEMENT.md). That can be done literally with the push of a button. -We used the most simple one that exists. It is from [Indie Open Source](https://indieopensource.com/forms/cla) which uses plain English and is literally just a few lines long. +We used the most simple one that exists. It is from [Indie Open Source](https://indieopensource.com/forms/cla) which uses plain English and is literally only a few lines long. A bot will automatically comment on the pull request once it got opened asking for the agreement to be signed. Before it did not get signed it is sadly not possible to merge it in. diff --git a/LICENSE.md b/LICENSE.md index aac54547eb..24a7d38fc9 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -215,7 +215,7 @@ Licensor: n8n GmbH same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright [yyyy] [name of copyright owner] + Copyright 2020 n8n GmbH Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/packages/cli/LICENSE.md b/packages/cli/LICENSE.md index aac54547eb..24a7d38fc9 100644 --- a/packages/cli/LICENSE.md +++ b/packages/cli/LICENSE.md @@ -215,7 +215,7 @@ Licensor: n8n GmbH same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright [yyyy] [name of copyright owner] + Copyright 2020 n8n GmbH Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/packages/core/LICENSE.md b/packages/core/LICENSE.md index aac54547eb..24a7d38fc9 100644 --- a/packages/core/LICENSE.md +++ b/packages/core/LICENSE.md @@ -215,7 +215,7 @@ Licensor: n8n GmbH same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright [yyyy] [name of copyright owner] + Copyright 2020 n8n GmbH Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/packages/editor-ui/LICENSE.md b/packages/editor-ui/LICENSE.md index aac54547eb..24a7d38fc9 100644 --- a/packages/editor-ui/LICENSE.md +++ b/packages/editor-ui/LICENSE.md @@ -215,7 +215,7 @@ Licensor: n8n GmbH same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright [yyyy] [name of copyright owner] + Copyright 2020 n8n GmbH Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/packages/node-dev/LICENSE.md b/packages/node-dev/LICENSE.md index aac54547eb..24a7d38fc9 100644 --- a/packages/node-dev/LICENSE.md +++ b/packages/node-dev/LICENSE.md @@ -215,7 +215,7 @@ Licensor: n8n GmbH same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright [yyyy] [name of copyright owner] + Copyright 2020 n8n GmbH Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/packages/nodes-base/LICENSE.md b/packages/nodes-base/LICENSE.md index aac54547eb..24a7d38fc9 100644 --- a/packages/nodes-base/LICENSE.md +++ b/packages/nodes-base/LICENSE.md @@ -215,7 +215,7 @@ Licensor: n8n GmbH same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright [yyyy] [name of copyright owner] + Copyright 2020 n8n GmbH Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. diff --git a/packages/nodes-base/nodes/Salesforce/GenericFunctions.ts b/packages/nodes-base/nodes/Salesforce/GenericFunctions.ts index 648735feb2..4c81432238 100644 --- a/packages/nodes-base/nodes/Salesforce/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Salesforce/GenericFunctions.ts @@ -30,7 +30,7 @@ export async function salesforceApiRequest(this: IExecuteFunctions | IExecuteSin } } -export async function salesforceApiRequestAllItems(this: IExecuteFunctions | ILoadOptionsFunctions, propertyName: string ,method: string, endpoint: string, body: any = {}, query: IDataObject = {}): Promise { // tslint:disable-line:no-any +export async function salesforceApiRequestAllItems(this: IExecuteFunctions | ILoadOptionsFunctions, propertyName: string, method: string, endpoint: string, body: any = {}, query: IDataObject = {}): Promise { // tslint:disable-line:no-any const returnData: IDataObject[] = []; diff --git a/packages/nodes-base/nodes/Slack/Slack.node.ts b/packages/nodes-base/nodes/Slack/Slack.node.ts index 57fe569d22..bd3a7b3c21 100644 --- a/packages/nodes-base/nodes/Slack/Slack.node.ts +++ b/packages/nodes-base/nodes/Slack/Slack.node.ts @@ -289,7 +289,7 @@ export class Slack implements INodeType { if (operation === 'get') { const channel = this.getNodeParameter('channelId', i) as string; qs.channel = channel, - responseData = await slackApiRequest.call(this, 'POST', '/conversations.info', {}, qs); + responseData = await slackApiRequest.call(this, 'POST', '/conversations.info', {}, qs); responseData = responseData.channel; } //https://api.slack.com/methods/conversations.list @@ -456,7 +456,7 @@ export class Slack implements INodeType { if (!jsonParameters) { const attachments = this.getNodeParameter('attachments', i, []) as unknown as Attachment[]; - const blocksUi = (this.getNodeParameter('blocksUi', i, []) as IDataObject).blocksValues as IDataObject[]; + const blocksUi = (this.getNodeParameter('blocksUi', i, []) as IDataObject).blocksValues as IDataObject[]; // The node does save the fields data differently than the API // expects so fix the data befre we send the request @@ -482,7 +482,7 @@ export class Slack implements INodeType { block.block_id = blockUi.blockId as string; block.type = blockUi.type as string; if (block.type === 'actions') { - const elementsUi = (blockUi.elementsUi as IDataObject).elementsValues as IDataObject[]; + const elementsUi = (blockUi.elementsUi as IDataObject).elementsValues as IDataObject[]; if (elementsUi) { for (const elementUi of elementsUi) { const element: Element = {}; @@ -498,7 +498,7 @@ export class Slack implements INodeType { text: elementUi.text as string, type: 'plain_text', emoji: elementUi.emoji as boolean, - }; + }; if (elementUi.url) { element.url = elementUi.url as string; } @@ -508,13 +508,13 @@ export class Slack implements INodeType { if (elementUi.style !== 'default') { element.style = elementUi.style as string; } - const confirmUi = (elementUi.confirmUi as IDataObject).confirmValue as IDataObject; - if (confirmUi) { + const confirmUi = (elementUi.confirmUi as IDataObject).confirmValue as IDataObject; + if (confirmUi) { const confirm: Confirm = {}; - const titleUi = (confirmUi.titleUi as IDataObject).titleValue as IDataObject; - const textUi = (confirmUi.textUi as IDataObject).textValue as IDataObject; - const confirmTextUi = (confirmUi.confirmTextUi as IDataObject).confirmValue as IDataObject; - const denyUi = (confirmUi.denyUi as IDataObject).denyValue as IDataObject; + const titleUi = (confirmUi.titleUi as IDataObject).titleValue as IDataObject; + const textUi = (confirmUi.textUi as IDataObject).textValue as IDataObject; + const confirmTextUi = (confirmUi.confirmTextUi as IDataObject).confirmValue as IDataObject; + const denyUi = (confirmUi.denyUi as IDataObject).denyValue as IDataObject; const style = confirmUi.style as string; if (titleUi) { confirm.title = { @@ -548,13 +548,13 @@ export class Slack implements INodeType { confirm.style = style as string; } element.confirm = confirm; - } - elements.push(element); + } + elements.push(element); } block.elements = elements; } } else if (block.type === 'section') { - const textUi = (blockUi.textUi as IDataObject).textValue as IDataObject; + const textUi = (blockUi.textUi as IDataObject).textValue as IDataObject; if (textUi) { const text: Text = {}; if (textUi.type === 'plainText') { @@ -569,7 +569,7 @@ export class Slack implements INodeType { } else { throw new Error('Property text must be defined'); } - const fieldsUi = (blockUi.fieldsUi as IDataObject).fieldsValues as IDataObject[]; + const fieldsUi = (blockUi.fieldsUi as IDataObject).fieldsValues as IDataObject[]; if (fieldsUi) { const fields: Text[] = []; for (const fieldUi of fieldsUi) { @@ -589,7 +589,7 @@ export class Slack implements INodeType { block.fields = fields; } } - const accessoryUi = (blockUi.accessoryUi as IDataObject).accessoriesValues as IDataObject; + const accessoryUi = (blockUi.accessoryUi as IDataObject).accessoriesValues as IDataObject; if (accessoryUi) { const accessory: Element = {}; if (accessoryUi.type === 'button') { @@ -608,46 +608,46 @@ export class Slack implements INodeType { if (accessoryUi.style !== 'default') { accessory.style = accessoryUi.style as string; } - const confirmUi = (accessoryUi.confirmUi as IDataObject).confirmValue as IDataObject; + const confirmUi = (accessoryUi.confirmUi as IDataObject).confirmValue as IDataObject; if (confirmUi) { - const confirm: Confirm = {}; - const titleUi = (confirmUi.titleUi as IDataObject).titleValue as IDataObject; - const textUi = (confirmUi.textUi as IDataObject).textValue as IDataObject; - const confirmTextUi = (confirmUi.confirmTextUi as IDataObject).confirmValue as IDataObject; - const denyUi = (confirmUi.denyUi as IDataObject).denyValue as IDataObject; - const style = confirmUi.style as string; - if (titleUi) { - confirm.title = { - type: 'plain_text', - text: titleUi.text as string, - emoji: titleUi.emoji as boolean, - }; - } - if (textUi) { - confirm.text = { - type: 'plain_text', - text: textUi.text as string, - emoji: textUi.emoji as boolean, - }; - } - if (confirmTextUi) { - confirm.confirm = { - type: 'plain_text', - text: confirmTextUi.text as string, - emoji: confirmTextUi.emoji as boolean, - }; - } - if (denyUi) { - confirm.deny = { - type: 'plain_text', - text: denyUi.text as string, - emoji: denyUi.emoji as boolean, - }; - } - if (style !== 'default') { - confirm.style = style as string; - } - accessory.confirm = confirm; + const confirm: Confirm = {}; + const titleUi = (confirmUi.titleUi as IDataObject).titleValue as IDataObject; + const textUi = (confirmUi.textUi as IDataObject).textValue as IDataObject; + const confirmTextUi = (confirmUi.confirmTextUi as IDataObject).confirmValue as IDataObject; + const denyUi = (confirmUi.denyUi as IDataObject).denyValue as IDataObject; + const style = confirmUi.style as string; + if (titleUi) { + confirm.title = { + type: 'plain_text', + text: titleUi.text as string, + emoji: titleUi.emoji as boolean, + }; + } + if (textUi) { + confirm.text = { + type: 'plain_text', + text: textUi.text as string, + emoji: textUi.emoji as boolean, + }; + } + if (confirmTextUi) { + confirm.confirm = { + type: 'plain_text', + text: confirmTextUi.text as string, + emoji: confirmTextUi.emoji as boolean, + }; + } + if (denyUi) { + confirm.deny = { + type: 'plain_text', + text: denyUi.text as string, + emoji: denyUi.emoji as boolean, + }; + } + if (style !== 'default') { + confirm.style = style as string; + } + accessory.confirm = confirm; } } block.accessory = accessory; @@ -790,8 +790,8 @@ export class Slack implements INodeType { if (binaryData) { const binaryPropertyName = this.getNodeParameter('binaryPropertyName', i) as string; if (items[i].binary === undefined - //@ts-ignore - || items[i].binary[binaryPropertyName] === undefined) { + //@ts-ignore + || items[i].binary[binaryPropertyName] === undefined) { throw new Error(`No binary data property "${binaryPropertyName}" does not exists on item!`); } body.file = { @@ -804,7 +804,7 @@ export class Slack implements INodeType { contentType: items[i].binary[binaryPropertyName].mimeType, } }; - responseData = await slackApiRequest.call(this, 'POST', '/files.upload', {}, qs, { 'Content-Type': 'multipart/form-data' }, { formData: body }); + responseData = await slackApiRequest.call(this, 'POST', '/files.upload', {}, qs, { 'Content-Type': 'multipart/form-data' }, { formData: body }); responseData = responseData.file; } else { const fileContent = this.getNodeParameter('fileContent', i) as string; diff --git a/packages/nodes-base/nodes/Zoom/GenericFunctions.ts b/packages/nodes-base/nodes/Zoom/GenericFunctions.ts index e8e0247461..9cde3e67e2 100644 --- a/packages/nodes-base/nodes/Zoom/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Zoom/GenericFunctions.ts @@ -40,21 +40,11 @@ export async function zoomApiRequest(this: IExecuteFunctions | IExecuteSingleFun throw new Error('No credentials got returned!'); } options.headers!.Authorization = `Bearer ${credentials.accessToken}`; - console.log("options if"); - console.log(options); + //@ts-ignore return await this.helpers.request(options); } else { - console.log("options else"); - console.log(options); - let credentials = this.getCredentials('zoomOAuth2Api'); - // let oauthtoken1 = credentials!.oauthTokenData; - - - console.log(credentials); - console.log("credss"); - //@ts-ignore return await this.helpers.requestOAuth2.call(this, 'zoomOAuth2Api', options); diff --git a/packages/nodes-base/nodes/Zoom/MeetingDescription.ts b/packages/nodes-base/nodes/Zoom/MeetingDescription.ts new file mode 100644 index 0000000000..bd4b8ce271 --- /dev/null +++ b/packages/nodes-base/nodes/Zoom/MeetingDescription.ts @@ -0,0 +1,751 @@ +import { + INodeProperties, +} from 'n8n-workflow'; + +export const meetingOperations = [ + { + displayName: 'Operation', + name: 'operation', + type: 'options', + displayOptions: { + show: { + resource: [ + 'meeting', + ], + }, + }, + options: [ + { + name: 'Create', + value: 'create', + description: 'Create a meeting', + }, + { + name: 'Delete', + value: 'delete', + description: 'Delete a meeting', + }, + { + name: 'Get', + value: 'get', + description: 'Retrieve a meeting', + }, + { + name: 'Get All', + value: 'getAll', + description: 'Retrieve all meetings', + }, + { + name: 'Update', + value: 'update', + description: 'Update a meeting', + } + ], + default: 'create', + description: 'The operation to perform.', + } +] as INodeProperties[]; + +export const meetingFields = [ + /* -------------------------------------------------------------------------- */ + /* meeting:create */ + /* -------------------------------------------------------------------------- */ + { + displayName: 'Id', + name: 'userId', + type: 'string', + default: '', + required: true, + displayOptions: { + show: { + operation: [ + 'create', + + + ], + resource: [ + 'meeting', + ], + }, + }, + description: 'User ID.', + }, + { + displayName: 'Additional settings', + name: 'additionalFields', + type: 'collection', + placeholder: 'Add Field', + default: {}, + displayOptions: { + show: { + operation: [ + 'create', + + ], + resource: [ + 'meeting', + ], + } + }, + options: [ + { + displayName: 'Meeting topic', + name: 'topic', + type: 'string', + default: '', + description: `Meeting topic.`, + }, + { + displayName: 'Meeting type', + name: 'type', + type: 'options', + options: [ + { + name: 'Instant Meeting', + value: 1, + }, + { + name: 'Scheduled Meeting', + value: 2, + }, + { + name: 'Recurring meeting with no fixed time', + value: 3, + }, + { + name: 'Recurring meeting with no fixed time', + value: 8, + }, + + ], + default: 2, + description: 'Meeting type.' + }, + { + displayName: 'Start time', + name: 'startTime', + type: 'dateTime', + default: '', + description: 'Start time should be used only for scheduled or recurring meetings with fixed time', + }, + { + displayName: 'Duration', + name: 'duration', + type: 'number', + default: '', + description: 'Duration.', + }, + { + displayName: 'Timezone', + name: 'timeZone', + type: 'options', + typeOptions: { + loadOptionsMethod: 'getTimezones', + }, + default: '', + description: `Time zone used in the response. The default is the time zone of the calendar.`, + }, + { + displayName: 'Schedule for', + name: 'scheduleFor', + type: 'string', + default: '', + description: 'Schedule meeting for someone else from your account, provide their email id.', + }, + { + displayName: 'Password', + name: 'password', + type: 'string', + default: '', + description: 'Password to join the meeting with maximum 10 characters.', + }, + { + displayName: 'Agenda', + name: 'agenda', + type: 'string', + default: '', + description: 'Meeting agenda.', + }, + { + displayName: 'Host Meeting in China', + name: 'cn_meeting', + type: 'boolean', + default: false, + description: 'Host Meeting in China.', + }, + { + displayName: 'Host Meeting in India', + name: 'in_meeting', + type: 'boolean', + default: false, + description: 'Host Meeting in India.', + }, + { + displayName: 'Host Video', + name: 'host_video', + type: 'boolean', + default: false, + description: 'Start video when host joins the meeting.', + }, + { + displayName: 'Participant Video', + name: 'participant_video', + type: 'boolean', + default: false, + description: 'Start video when participant joins the meeting.', + }, + { + displayName: 'Join before Host', + name: 'join_before_host', + type: 'boolean', + default: false, + description: 'Allow participants to join the meeting before host starts it.', + }, + { + displayName: 'Muting before entry', + name: 'mute_upon_entry', + type: 'boolean', + default: false, + description: 'Mute participants upon entry.', + }, + { + displayName: 'Watermark', + name: 'watermark', + type: 'boolean', + default: false, + description: 'Adds watermark when viewing a shared screen.', + }, + { + displayName: 'Alternative Hosts', + name: 'alternative_hosts', + type: 'string', + default: '', + description: 'Alternative hosts email ids.', + }, + { + displayName: 'Auto recording', + name: 'auto_recording', + type: 'options', + options: [ + { + name: 'Record on local', + value: 'local', + }, + { + name: 'Record on cloud', + value: 'cloud', + }, + { + name: 'Disabled', + value: 'none', + }, + + + ], + default: 'none', + description: 'Auto recording.', + }, + { + displayName: 'Audio', + name: 'auto_recording', + type: 'options', + options: [ + { + name: 'Both Telephony and VoiP', + value: 'both', + }, + { + name: 'Telephony', + value: 'telephony', + }, + { + name: 'VOIP', + value: 'voip', + }, + + + ], + default: 'both', + description: 'Determine how participants can join audio portion of the meeting.', + }, + { + displayName: 'Registration type', + name: 'registration_type', + type: 'options', + options: [ + { + name: 'Attendees register once and can attend any of the occurences', + value: 1, + }, + { + name: 'Attendees need to register for every occurence', + value: 2, + }, + { + name: 'Attendees register once and can choose one or more occurences to attend', + value: 3, + }, + + + ], + default: 1, + description: 'Registration type. Used for recurring meetings with fixed time only', + }, + + + ], + }, + /* -------------------------------------------------------------------------- */ + /* meeting:get */ + /* -------------------------------------------------------------------------- */ + { + displayName: 'Id', + name: 'userId', + type: 'string', + default: '', + required: true, + displayOptions: { + show: { + operation: [ + 'get', + ], + resource: [ + 'meeting', + ], + }, + }, + description: 'User ID.', + }, + /* -------------------------------------------------------------------------- */ + /* meeting:getAll */ + /* -------------------------------------------------------------------------- */ + { + displayName: 'Id', + name: 'userId', + type: 'string', + default: '', + required: true, + displayOptions: { + show: { + operation: [ + 'getAll', + ], + resource: [ + 'meeting', + ], + }, + }, + description: 'User ID.', + }, + { + displayName: 'Return All', + name: 'returnAll', + type: 'boolean', + displayOptions: { + show: { + operation: [ + 'getAll', + ], + resource: [ + 'meeting', + ], + }, + }, + default: false, + description: 'If all results should be returned or only up to a given limit.', + }, + { + displayName: 'Limit', + name: 'limit', + type: 'number', + displayOptions: { + show: { + operation: [ + 'getAll', + ], + resource: [ + 'meeting', + ], + returnAll: [ + false, + ], + }, + }, + typeOptions: { + minValue: 1, + maxValue: 300 + }, + default: 30, + description: 'How many results to return.', + }, + { + displayName: 'Additional settings', + name: 'additionalFields', + type: 'collection', + placeholder: 'Add Field', + default: {}, + displayOptions: { + show: { + operation: [ + 'getAll', + + ], + resource: [ + 'meeting', + ], + } + }, + options: [ + { + displayName: 'Type', + name: 'type', + type: 'options', + options: [ + { + name: 'Scheduled', + value: 'scheduled', + }, + { + name: 'Live', + value: 'live', + }, + { + name: 'Upcoming', + value: 'upcoming', + }, + + + ], + default: 'live', + description: `Meeting type.`, + }, + ] + }, + /* -------------------------------------------------------------------------- */ + /* meeting:delete */ + /* -------------------------------------------------------------------------- */ + { + displayName: 'Meeting Id', + name: 'meetingId', + type: 'string', + default: '', + required: true, + displayOptions: { + show: { + operation: [ + 'delete' + ], + resource: [ + 'meeting', + ], + }, + }, + description: 'Meeting ID.', + }, + { + displayName: 'Additional Fields', + name: 'additionalFields', + type: 'collection', + placeholder: 'Add Field', + default: {}, + displayOptions: { + show: { + operation: [ + 'delete', + ], + resource: [ + 'meeting', + ], + }, + }, + options: [ + { + displayName: 'Occurence Id', + name: 'occurenceId', + type: 'string', + default: '', + description: 'Meeting occurence Id.', + }, + { + displayName: 'Schedule a reminder', + name: 'scheduleForReminder', + type: 'boolean', + default: false, + description: 'Schedule a reminder via email', + }, + + + + ], + + }, + /* -------------------------------------------------------------------------- */ + /* meeting:update */ + /* -------------------------------------------------------------------------- */ + { + displayName: 'Meeting Id', + name: 'meetingId', + type: 'string', + default: '', + required: true, + displayOptions: { + show: { + operation: [ + 'update', + + + ], + resource: [ + 'meeting', + ], + }, + }, + description: 'Meeting ID.', + }, + { + displayName: 'Occurence Id', + name: 'occurenceId', + type: 'string', + default: '', + required: true, + displayOptions: { + show: { + operation: [ + 'update', + + + ], + resource: [ + 'meeting', + ], + }, + }, + description: 'Occurence ID.', + }, + { + displayName: 'Additional settings', + name: 'additionalFields', + type: 'collection', + placeholder: 'Add Field', + default: {}, + displayOptions: { + show: { + operation: [ + + 'update', + ], + resource: [ + 'meeting', + ], + } + }, + options: [ + { + displayName: 'Meeting topic', + name: 'topic', + type: 'string', + default: '', + description: `Meeting topic.`, + }, + { + displayName: 'Meeting type', + name: 'type', + type: 'options', + options: [ + { + name: 'Instant Meeting', + value: 1, + }, + { + name: 'Scheduled Meeting', + value: 2, + }, + { + name: 'Recurring meeting with no fixed time', + value: 3, + }, + { + name: 'Recurring meeting with no fixed time', + value: 8, + }, + + ], + default: 2, + description: 'Meeting type.' + }, + { + displayName: 'Start time', + name: 'startTime', + type: 'dateTime', + default: '', + description: 'Start time should be used only for scheduled or recurring meetings with fixed time', + }, + { + displayName: 'Duration', + name: 'duration', + type: 'number', + default: '', + description: 'Duration.', + }, + { + displayName: 'Timezone', + name: 'timeZone', + type: 'options', + typeOptions: { + loadOptionsMethod: 'getTimezones', + }, + default: '', + description: `Time zone used in the response. The default is the time zone of the calendar.`, + }, + { + displayName: 'Schedule for', + name: 'scheduleFor', + type: 'string', + default: '', + description: 'Schedule meeting for someone else from your account, provide their email id.', + }, + { + displayName: 'Password', + name: 'password', + type: 'string', + default: '', + description: 'Password to join the meeting with maximum 10 characters.', + }, + { + displayName: 'Agenda', + name: 'agenda', + type: 'string', + default: '', + description: 'Meeting agenda.', + }, + { + displayName: 'Host Meeting in China', + name: 'cn_meeting', + type: 'boolean', + default: false, + description: 'Host Meeting in China.', + }, + { + displayName: 'Host Meeting in India', + name: 'in_meeting', + type: 'boolean', + default: false, + description: 'Host Meeting in India.', + }, + { + displayName: 'Host Video', + name: 'host_video', + type: 'boolean', + default: false, + description: 'Start video when host joins the meeting.', + }, + { + displayName: 'Participant Video', + name: 'participant_video', + type: 'boolean', + default: false, + description: 'Start video when participant joins the meeting.', + }, + { + displayName: 'Join before Host', + name: 'join_before_host', + type: 'boolean', + default: false, + description: 'Allow participants to join the meeting before host starts it.', + }, + { + displayName: 'Muting before entry', + name: 'mute_upon_entry', + type: 'boolean', + default: false, + description: 'Mute participants upon entry.', + }, + { + displayName: 'Watermark', + name: 'watermark', + type: 'boolean', + default: false, + description: 'Adds watermark when viewing a shared screen.', + }, + { + displayName: 'Alternative Hosts', + name: 'alternative_hosts', + type: 'string', + default: '', + description: 'Alternative hosts email ids.', + }, + { + displayName: 'Auto recording', + name: 'auto_recording', + type: 'options', + options: [ + { + name: 'Record on local', + value: 'local', + }, + { + name: 'Record on cloud', + value: 'cloud', + }, + { + name: 'Disabled', + value: 'none', + }, + + + ], + default: 'none', + description: 'Auto recording.', + }, + { + displayName: 'Audio', + name: 'auto_recording', + type: 'options', + options: [ + { + name: 'Both Telephony and VoiP', + value: 'both', + }, + { + name: 'Telephony', + value: 'telephony', + }, + { + name: 'VOIP', + value: 'voip', + }, + + + ], + default: 'both', + description: 'Determine how participants can join audio portion of the meeting.', + }, + { + displayName: 'Registration type', + name: 'registration_type', + type: 'options', + options: [ + { + name: 'Attendees register once and can attend any of the occurences', + value: 1, + }, + { + name: 'Attendees need to register for every occurence', + value: 2, + }, + { + name: 'Attendees register once and can choose one or more occurences to attend', + value: 3, + }, + + + ], + default: 1, + description: 'Registration type. Used for recurring meetings with fixed time only', + }, + + + ], + }, + +] as INodeProperties[]; diff --git a/packages/nodes-base/nodes/Zoom/MeetingRegistrantDescription.ts b/packages/nodes-base/nodes/Zoom/MeetingRegistrantDescription.ts new file mode 100644 index 0000000000..b062786892 --- /dev/null +++ b/packages/nodes-base/nodes/Zoom/MeetingRegistrantDescription.ts @@ -0,0 +1,407 @@ +import { + INodeProperties, +} from 'n8n-workflow'; +export const meetingRegistrantOperations = [ + { + displayName: 'Operation', + name: 'operation', + type: 'options', + displayOptions: { + show: { + resource: [ + 'meetingRegistrants', + ], + }, + }, + options: [ + { + name: 'Create', + value: 'create', + description: 'Create Meeting Registrants', + }, + { + name: 'Update', + value: 'update', + description: 'Update Meeting Registrant status', + }, + { + name: 'Get All', + value: 'getAll', + description: 'Retrieve all meeting registrants', + }, + + ], + default: 'create', + description: 'The operation to perform.', + } +] as INodeProperties[]; + + + +export const meetingRegistrantFields = [ + /* -------------------------------------------------------------------------- */ + /* meetingRegistrants:create */ + /* -------------------------------------------------------------------------- */ + { + displayName: 'Meeting Id', + name: 'meetingId', + type: 'string', + default: '', + required: true, + displayOptions: { + show: { + operation: [ + 'create', + + + ], + resource: [ + 'meetingRegistrants', + ], + }, + }, + description: 'Meeting ID.', + }, + { + displayName: 'Occurence Id', + name: 'occurenceId', + type: 'string', + default: '', + required: true, + displayOptions: { + show: { + operation: [ + 'create', + + + ], + resource: [ + 'meetingRegistrants', + ], + }, + }, + description: 'Occurence ID.', + }, + { + displayName: 'Email', + name: 'email', + type: 'string', + required: true, + default: '', + description: 'Valid email-id of registrant.', + }, + { + displayName: 'First name', + name: 'firstName', + required: true, + type: 'string', + default: '', + description: 'First Name.', + }, + { + displayName: 'Additional settings', + name: 'additionalFields', + type: 'collection', + placeholder: 'Add Field', + default: {}, + displayOptions: { + show: { + operation: [ + 'get', + + ], + resource: [ + 'meetingRegistrants', + ], + } + }, + options: [ + { + displayName: 'Last Name', + name: 'lastName', + type: 'string', + default: '', + description: 'Last Name.', + }, + { + displayName: 'Address', + name: 'address', + type: 'string', + default: '', + description: 'Valid address of registrant.', + }, + { + displayName: 'City', + name: 'city', + type: 'string', + default: '', + description: 'Valid city of registrant.', + }, + { + displayName: 'State', + name: 'state', + type: 'string', + default: '', + description: 'Valid state of registrant.', + }, + { + displayName: 'Country', + name: 'country', + type: 'string', + default: '', + description: 'Valid country of registrant.', + }, + { + displayName: 'Zip code', + name: 'zip', + type: 'string', + default: '', + description: 'Valid zip-code of registrant.', + }, + { + displayName: 'Phone Number', + name: 'phone', + type: 'string', + default: '', + description: 'Valid phone number of registrant.', + }, + { + displayName: 'Comments', + name: 'comments', + type: 'string', + default: '', + description: 'Allows registrants to provide any questions they have.', + }, + { + displayName: 'Organization', + name: 'org', + type: 'string', + default: '', + description: 'Organization of registrant.', + }, + { + displayName: 'Job title', + name: 'job_title', + type: 'string', + default: '', + description: 'Job title of registrant.', + }, + { + displayName: 'Purchasing time frame', + name: 'purchasing_time_frame', + type: 'options', + options: [ + { + name: 'Within a month', + value: 'Within a month', + }, + { + name: '1-3 months', + value: '1-3 months', + }, + { + name: '4-6 months', + value: '4-6 months', + }, + { + name: 'More than 6 months', + value: 'More than 6 months', + }, + { + name: 'No timeframe', + value: 'No timeframe', + }, + + + ], + default: '', + description: 'Meeting type.' + }, + { + displayName: 'Role in purchase process', + name: 'role_in_purchase_process', + type: 'options', + options: [ + { + name: 'Decision Maker', + value: 'Decision Maker', + }, + { + name: 'Evaluator/Recommender', + value: 'Evaluator/Recommender', + }, + { + name: 'Influener', + value: 'Influener', + }, + { + name: 'Not Involved', + value: 'Not Involved', + }, + + ], + default: '', + description: 'Role in purchase process.' + }, + ], + }, + /* -------------------------------------------------------------------------- */ + /* meetingRegistrants:getAll */ + /* -------------------------------------------------------------------------- */ + { + displayName: 'Meeting Id', + name: 'meetingId', + type: 'string', + default: '', + required: true, + displayOptions: { + show: { + operation: [ + 'getAll', + + + ], + resource: [ + 'meetingRegistrants', + ], + }, + }, + description: 'Meeting ID.', + }, + { + displayName: 'Return All', + name: 'returnAll', + type: 'boolean', + displayOptions: { + show: { + operation: [ + 'getAll', + ], + resource: [ + 'meetingRegistrants', + ], + }, + }, + default: false, + description: 'If all results should be returned or only up to a given limit.', + }, + { + displayName: 'Limit', + name: 'limit', + type: 'number', + displayOptions: { + show: { + operation: [ + 'getAll', + ], + resource: [ + 'meetingRegistrants', + ], + returnAll: [ + false, + ], + }, + }, + typeOptions: { + minValue: 1, + maxValue: 300 + }, + default: 30, + description: 'How many results to return.', + }, + { + displayName: 'Additional settings', + name: 'additionalFields', + type: 'collection', + placeholder: 'Add Field', + default: {}, + displayOptions: { + show: { + operation: [ + 'get', + + ], + resource: [ + 'meetingRegistrants', + ], + } + }, + options: [ + { + displayName: 'Occurence Id', + name: 'occurence_id', + type: 'string', + default: '', + description: `Occurence Id.`, + }, + { + displayName: 'Status', + name: 'status', + type: 'options', + options: [ + { + name: 'Pending', + value: 'pending', + }, + { + name: 'Approved', + value: 'approved', + }, + { + name: 'Denied', + value: 'denied', + }, + + + ], + default: '', + description: `Registrant Status.`, + }, + + ] + }, + /* -------------------------------------------------------------------------- */ + /* meetingRegistrants:update */ + /* -------------------------------------------------------------------------- */ + { + displayName: 'Meeting Id', + name: 'meetingId', + type: 'number', + default: '', + required: true, + displayOptions: { + show: { + operation: [ + 'update', + + + ], + resource: [ + 'meetingRegistrants', + ], + }, + }, + description: 'Meeting ID.', + }, + { + displayName: 'Occurence Id', + name: 'occurenceId', + type: 'string', + default: '', + required: true, + displayOptions: { + show: { + operation: [ + 'update', + + + ], + resource: [ + 'meetingRegistrants', + ], + }, + }, + description: 'Occurence ID.', + }, + +] as INodeProperties[]; diff --git a/packages/nodes-base/nodes/Zoom/Zoom.node.ts b/packages/nodes-base/nodes/Zoom/Zoom.node.ts index 524fc08440..c1915d4ab4 100644 --- a/packages/nodes-base/nodes/Zoom/Zoom.node.ts +++ b/packages/nodes-base/nodes/Zoom/Zoom.node.ts @@ -3,7 +3,9 @@ import { IDataObject, INodeExecutionData, INodeType, + ILoadOptionsFunctions, INodeTypeDescription, + INodePropertyOptions, } from 'n8n-workflow'; import { zoomApiRequest, @@ -14,7 +16,30 @@ import { import { meetingOperations, meetingFields, -} from './ZoomOperations'; +} from './MeetingDescription'; + +import { + meetingRegistrantOperations, + meetingRegistrantFields, + +} from './MeetingRegistrantDescription'; + +import * as moment from 'moment-timezone'; + +interface Settings { + host_video?: boolean; + participant_video?: boolean; + cn_meeting?: boolean; + in_meeting?: boolean; + join_before_host?: boolean; + mute_upon_entry?: boolean; + watermark?: boolean; + audio?: string; + alternative_hosts?: string; + auto_recording?: string; + registration_type?: number; + +} export class Zoom implements INodeType { description: INodeTypeDescription = { displayName: 'Zoom', @@ -25,31 +50,11 @@ export class Zoom implements INodeType { subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}', defaults: { name: 'Zoom', - color: '#772244' + color: '#0B6CF9' }, icon: 'file:zoom.png', inputs: ['main'], outputs: ['main'], - // credentials: [ - // { - // name: 'zoomApi', - // required: true, - // displayOptions: { - // show: { - // authentication: ['accessToken'] - // } - // } - // }, - // { - // name: 'zoomOAuth2Api', - // required: true, - // displayOptions: { - // show: { - // authentication: ['oAuth2'] - // } - // } - // } - // ], credentials: [ { name: 'zoomApi', @@ -100,16 +105,41 @@ export class Zoom implements INodeType { { name: 'Meeting', value: 'meeting' + }, + { + name: 'Meeting Registrants', + value: 'meetingRegistrants' } ], default: 'meeting', description: 'The resource to operate on.' }, ...meetingOperations, - ...meetingFields + ...meetingFields, + ...meetingRegistrantOperations, + ...meetingRegistrantFields, ] }; + methods = { + loadOptions: { + // Get all the timezones to display them to user so that he can select them easily + async getTimezones( + this: ILoadOptionsFunctions + ): Promise { + const returnData: INodePropertyOptions[] = []; + for (const timezone of moment.tz.names()) { + const timezoneName = timezone; + const timezoneId = timezone; + returnData.push({ + name: timezoneName, + value: timezoneId + }); + } + return returnData; + } + } + }; async execute(this: IExecuteFunctions): Promise { const items = this.getInputData(); @@ -120,11 +150,13 @@ export class Zoom implements INodeType { const resource = this.getNodeParameter('resource', 0) as string; const operation = this.getNodeParameter('operation', 0) as string; console.log(this.getCredentials('zoomOAuth2Api')); + let body: IDataObject = {}; for (let i = 0; i < length; i++) { qs = {}; if (resource === 'meeting') { if (operation === 'get') { + //https://marketplace.zoom.us/docs/api-reference/zoom-api/meetings/meeting const userId = this.getNodeParameter('userId', i) as string; responseData = await zoomApiRequest.call( @@ -135,6 +167,283 @@ export class Zoom implements INodeType { qs ); } + if (operation === 'getAll') { + //https://marketplace.zoom.us/docs/api-reference/zoom-api/meetings/meetings + const userId = this.getNodeParameter('userId', i) as string; + + responseData = await zoomApiRequest.call( + this, + 'GET', + `/users/${userId}/meetings`, + {}, + qs + ); + } + if (operation === 'delete') { + //https://marketplace.zoom.us/docs/api-reference/zoom-api/meetings/meetingdelete + const meetingId = this.getNodeParameter('meetingId', i) as string; + responseData = await zoomApiRequest.call( + this, + 'DELETE', + `/meetings/${meetingId}`, + {}, + qs + ); + responseData = { success: true }; + } + if (operation === 'create') { + //https://marketplace.zoom.us/docs/api-reference/zoom-api/meetings/meetingcreate + const userId = this.getNodeParameter('userId', i) as string; + const additionalFields = this.getNodeParameter( + 'additionalFields', + i + ) as IDataObject; + const settings: Settings = {}; + if (additionalFields.cn_meeting) { + settings.cn_meeting = additionalFields.cn_meeting as boolean; + + } + + if (additionalFields.in_meeting) { + settings.in_meeting = additionalFields.in_meeting as boolean; + + } + + if (additionalFields.join_before_host) { + settings.join_before_host = additionalFields.join_before_host as boolean; + + } + + if (additionalFields.mute_upon_entry) { + settings.mute_upon_entry = additionalFields.mute_upon_entry as boolean; + + } + + if (additionalFields.watermark) { + settings.watermark = additionalFields.watermark as boolean; + + } + + if (additionalFields.audio) { + settings.audio = additionalFields.audio as string; + + } + + if (additionalFields.alternative_hosts) { + settings.alternative_hosts = additionalFields.alternative_hosts as string; + + } + + if (additionalFields.participant_video) { + settings.participant_video = additionalFields.participant_video as boolean; + + } + + if (additionalFields.host_video) { + settings.host_video = additionalFields.host_video as boolean; + + } + + if (additionalFields.auto_recording) { + settings.auto_recording = additionalFields.auto_recording as string; + + } + + if (additionalFields.registration_type) { + settings.registration_type = additionalFields.registration_type as number; + + } + + body = { + settings, + }; + + if (additionalFields.topic) { + body.topic = additionalFields.topic as string; + + } + + if (additionalFields.type) { + body.type = additionalFields.type as string; + + } + + if (additionalFields.startTime) { + body.start_time = additionalFields.startTime as string; + + } + + if (additionalFields.duration) { + body.duration = additionalFields.duration as number; + + } + + if (additionalFields.scheduleFor) { + body.schedule_for = additionalFields.scheduleFor as string; + + } + + if (additionalFields.timeZone) { + body.timezone = additionalFields.timeZone as string; + + } + + if (additionalFields.password) { + body.password = additionalFields.password as string; + + } + + if (additionalFields.agenda) { + body.agenda = additionalFields.agenda as string; + + } + + + + + responseData = await zoomApiRequest.call( + this, + 'POST', + `/users/${userId}/meetings`, + body, + qs + ); + } + if (operation === 'update') { + //https://marketplace.zoom.us/docs/api-reference/zoom-api/meetings/meetingupdate + const meetingId = this.getNodeParameter('meetingId', i) as string; + qs.occurence_id = this.getNodeParameter('occurenceId', i) as string; + const additionalFields = this.getNodeParameter( + 'additionalFields', + i + ) as IDataObject; + const settings: Settings = {}; + if (additionalFields.cn_meeting) { + settings.cn_meeting = additionalFields.cn_meeting as boolean; + + } + + if (additionalFields.in_meeting) { + settings.in_meeting = additionalFields.in_meeting as boolean; + + } + + if (additionalFields.join_before_host) { + settings.join_before_host = additionalFields.join_before_host as boolean; + + } + + if (additionalFields.mute_upon_entry) { + settings.mute_upon_entry = additionalFields.mute_upon_entry as boolean; + + } + + if (additionalFields.watermark) { + settings.watermark = additionalFields.watermark as boolean; + + } + + if (additionalFields.audio) { + settings.audio = additionalFields.audio as string; + + } + + if (additionalFields.alternative_hosts) { + settings.alternative_hosts = additionalFields.alternative_hosts as string; + + } + + if (additionalFields.participant_video) { + settings.participant_video = additionalFields.participant_video as boolean; + + } + + if (additionalFields.host_video) { + settings.host_video = additionalFields.host_video as boolean; + + } + + if (additionalFields.auto_recording) { + settings.auto_recording = additionalFields.auto_recording as string; + + } + + if (additionalFields.registration_type) { + settings.registration_type = additionalFields.registration_type as number; + + } + + body = { + settings, + }; + if (additionalFields.topic) { + body.topic = additionalFields.topic as string; + + } + + if (additionalFields.type) { + body.type = additionalFields.type as string; + + } + + if (additionalFields.startTime) { + body.start_time = additionalFields.startTime as string; + + } + + if (additionalFields.duration) { + body.duration = additionalFields.duration as number; + + } + + if (additionalFields.scheduleFor) { + body.schedule_for = additionalFields.scheduleFor as string; + + } + + if (additionalFields.timeZone) { + body.timezone = additionalFields.timeZone as string; + + } + + if (additionalFields.password) { + body.password = additionalFields.password as string; + + } + + if (additionalFields.agenda) { + body.agenda = additionalFields.agenda as string; + + } + + responseData = await zoomApiRequest.call( + this, + 'PATCH', + `/meetings/${meetingId}`, + body, + qs + ); + } + } + if (resource === 'meetingRegistrant') { + if (operation === 'create') { + //https://marketplace.zoom.us/docs/api-reference/zoom-api/meetings/meetingregistrantcreate + const meetingId = this.getNodeParameter('meetingId', i) as string; + qs.occurence_id = this.getNodeParameter('occurenceId', i) as string; + responseData = await zoomApiRequest.call( + this, + 'PATCH', + `/meetings/${meetingId}/registrants`, + body, + qs + ); + } + if (operation === 'getAll') { + //https://marketplace.zoom.us/docs/api-reference/zoom-api/meetings/meetingregistrants + } + if (operation === 'update') { + //https://marketplace.zoom.us/docs/api-reference/zoom-api/meetings/meetingregistrantstatus + } } } if (Array.isArray(responseData)) { diff --git a/packages/nodes-base/nodes/Zoom/ZoomOperations.ts b/packages/nodes-base/nodes/Zoom/ZoomOperations.ts deleted file mode 100644 index 58f1825435..0000000000 --- a/packages/nodes-base/nodes/Zoom/ZoomOperations.ts +++ /dev/null @@ -1,71 +0,0 @@ -import { - INodeProperties, -} from 'n8n-workflow'; - -export const meetingOperations = [ - { - displayName: 'Operation', - name: 'operation', - type: 'options', - displayOptions: { - show: { - resource: [ - 'meeting', - ], - }, - }, - options: [ - { - name: 'Create', - value: 'create', - description: 'Create a meeting', - }, - { - name: 'Delete', - value: 'delete', - description: 'Delete a meeting', - }, - { - name: 'Get', - value: 'get', - description: 'Retrieve a meeting', - }, - { - name: 'Get All', - value: 'getAll', - description: 'Retrieve all meetings', - }, - { - name: 'Update', - value: 'update', - description: 'Update a meeting', - } - ], - default: 'create', - description: 'The operation to perform.', - } -] as INodeProperties[]; - -export const meetingFields = [ - /* -------------------------------------------------------------------------- */ - /* meeting:get */ - /* -------------------------------------------------------------------------- */ - { - displayName: 'User Id', - name: 'userId', - type: 'string', - default: '', - required: true, - displayOptions: { - show: { - operation: [ - 'get', - ], - resource: [ - 'meeting', - ], - }, - }, - description: 'User ID.', - }, -] as INodeProperties[]; diff --git a/packages/workflow/LICENSE.md b/packages/workflow/LICENSE.md index aac54547eb..24a7d38fc9 100644 --- a/packages/workflow/LICENSE.md +++ b/packages/workflow/LICENSE.md @@ -215,7 +215,7 @@ Licensor: n8n GmbH same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright [yyyy] [name of copyright owner] + Copyright 2020 n8n GmbH Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. From 4c9b0162efb205a551640e67a479c58dcf57bc09 Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Mon, 22 Jun 2020 21:23:50 +0200 Subject: [PATCH 094/241] :zap: Improve parameter name --- packages/nodes-base/nodes/Twitter/TweetDescription.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/nodes-base/nodes/Twitter/TweetDescription.ts b/packages/nodes-base/nodes/Twitter/TweetDescription.ts index edd12bbf5e..12cb87ebfe 100644 --- a/packages/nodes-base/nodes/Twitter/TweetDescription.ts +++ b/packages/nodes-base/nodes/Twitter/TweetDescription.ts @@ -219,7 +219,7 @@ export const tweetFields = [ description: 'The entities node will not be included when set to false', }, { - displayName: 'Lang', + displayName: 'Language', name: 'lang', type: 'options', typeOptions: { From 94cd2c76c2abcbbcc880f88dda7ebfa280089f68 Mon Sep 17 00:00:00 2001 From: ricardo Date: Mon, 22 Jun 2020 19:37:58 -0400 Subject: [PATCH 095/241] :zap: updated n8n packages to it's latest version. --- packages/core/package.json | 2 +- packages/node-dev/package.json | 4 ++-- packages/nodes-base/package.json | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/core/package.json b/packages/core/package.json index 598ae14b23..9a6352671b 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -45,7 +45,7 @@ "crypto-js": "3.1.9-1", "lodash.get": "^4.4.2", "mmmagic": "^0.5.2", - "n8n-workflow": "~0.32.0", + "n8n-workflow": "~0.33.0", "p-cancelable": "^2.0.0", "request": "^2.88.2", "request-promise-native": "^1.0.7" diff --git a/packages/node-dev/package.json b/packages/node-dev/package.json index 66394fec29..8df65a2792 100644 --- a/packages/node-dev/package.json +++ b/packages/node-dev/package.json @@ -58,8 +58,8 @@ "change-case": "^4.1.1", "copyfiles": "^2.1.1", "inquirer": "^7.0.0", - "n8n-core": "^0.31.0", - "n8n-workflow": "^0.28.0", + "n8n-core": "^0.36.0", + "n8n-workflow": "^0.33.0", "replace-in-file": "^6.0.0", "request": "^2.88.2", "tmp-promise": "^2.0.2", diff --git a/packages/nodes-base/package.json b/packages/nodes-base/package.json index a09d97d032..e38403add3 100644 --- a/packages/nodes-base/package.json +++ b/packages/nodes-base/package.json @@ -317,7 +317,7 @@ "@types/xml2js": "^0.4.3", "gulp": "^4.0.0", "jest": "^24.9.0", - "n8n-workflow": "~0.32.0", + "n8n-workflow": "~0.33.0", "ts-jest": "^24.0.2", "tslint": "^5.17.0", "typescript": "~3.7.4" From 815f823f5ac6371d2796d30da68792d473f20baf Mon Sep 17 00:00:00 2001 From: shraddha shaligram Date: Mon, 22 Jun 2020 18:39:21 -0700 Subject: [PATCH 096/241] add webinars and registrants resource --- .../nodes-base/nodes/Zoom/GenericFunctions.ts | 34 +- .../nodes/Zoom/MeetingDescription.ts | 107 ++- .../Zoom/MeetingRegistrantDescription.ts | 104 ++- .../nodes/Zoom/WebinarDescription.ts | 685 ++++++++++++++++++ packages/nodes-base/nodes/Zoom/Zoom.node.ts | 405 ++++++++++- 5 files changed, 1198 insertions(+), 137 deletions(-) create mode 100644 packages/nodes-base/nodes/Zoom/WebinarDescription.ts diff --git a/packages/nodes-base/nodes/Zoom/GenericFunctions.ts b/packages/nodes-base/nodes/Zoom/GenericFunctions.ts index 9cde3e67e2..d361a9761a 100644 --- a/packages/nodes-base/nodes/Zoom/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Zoom/GenericFunctions.ts @@ -31,8 +31,6 @@ export async function zoomApiRequest(this: IExecuteFunctions | IExecuteSingleFun if (Object.keys(query).length === 0) { delete options.qs; } - console.log("options"); - console.log(options); try { if (authenticationMethod === 'accessToken') { const credentials = this.getCredentials('zoomApi'); @@ -42,7 +40,6 @@ export async function zoomApiRequest(this: IExecuteFunctions | IExecuteSingleFun options.headers!.Authorization = `Bearer ${credentials.accessToken}`; //@ts-ignore - return await this.helpers.request(options); } else { //@ts-ignore @@ -78,9 +75,10 @@ export async function zoomApiRequestAllItems( ): Promise { // tslint:disable-line:no-any const returnData: IDataObject[] = []; + let responseData; - query.page = 1; - query.count = 100; + //query.maxResults = 300; + do { responseData = await zoomApiRequest.call( this, @@ -89,32 +87,14 @@ export async function zoomApiRequestAllItems( body, query ); - query.cursor = encodeURIComponent( - _.get(responseData, 'response_metadata.next_cursor') - ); - query.page++; + query.page_number = responseData['page_number']; returnData.push.apply(returnData, responseData[propertyName]); } while ( - (responseData.response_metadata !== undefined && - responseData.response_metadata.mext_cursor !== undefined && - responseData.response_metadata.next_cursor !== '' && - responseData.response_metadata.next_cursor !== null) || - (responseData.paging !== undefined && - responseData.paging.pages !== undefined && - responseData.paging.page !== undefined && - responseData.paging.page < responseData.paging.pages) + responseData['page_number'] !== undefined && + responseData['page_number'] !== '' ); return returnData; } -export function validateJSON(json: string | undefined): any { - // tslint:disable-line:no-any - let result; - try { - result = JSON.parse(json!); - } catch (exception) { - result = undefined; - } - return result; -} + diff --git a/packages/nodes-base/nodes/Zoom/MeetingDescription.ts b/packages/nodes-base/nodes/Zoom/MeetingDescription.ts index bd4b8ce271..274b48ff97 100644 --- a/packages/nodes-base/nodes/Zoom/MeetingDescription.ts +++ b/packages/nodes-base/nodes/Zoom/MeetingDescription.ts @@ -51,7 +51,7 @@ export const meetingFields = [ /* meeting:create */ /* -------------------------------------------------------------------------- */ { - displayName: 'Id', + displayName: 'User Id', name: 'userId', type: 'string', default: '', @@ -60,15 +60,13 @@ export const meetingFields = [ show: { operation: [ 'create', - - ], resource: [ 'meeting', ], }, }, - description: 'User ID.', + description: 'User ID or email address of user.', }, { displayName: 'Additional settings', @@ -239,15 +237,13 @@ export const meetingFields = [ name: 'Disabled', value: 'none', }, - - ], default: 'none', description: 'Auto recording.', }, { displayName: 'Audio', - name: 'auto_recording', + name: 'audio', type: 'options', options: [ { @@ -263,7 +259,6 @@ export const meetingFields = [ value: 'voip', }, - ], default: 'both', description: 'Determine how participants can join audio portion of the meeting.', @@ -285,22 +280,19 @@ export const meetingFields = [ name: 'Attendees register once and can choose one or more occurences to attend', value: 3, }, - - ], default: 1, description: 'Registration type. Used for recurring meetings with fixed time only', }, - ], }, /* -------------------------------------------------------------------------- */ /* meeting:get */ /* -------------------------------------------------------------------------- */ { - displayName: 'Id', - name: 'userId', + displayName: 'Meeting Id', + name: 'meetingId', type: 'string', default: '', required: true, @@ -314,13 +306,47 @@ export const meetingFields = [ ], }, }, - description: 'User ID.', + description: 'Meeting ID.', + }, + { + displayName: 'Additional settings', + name: 'additionalFields', + type: 'collection', + placeholder: 'Add Field', + default: {}, + displayOptions: { + show: { + operation: [ + 'get', + + ], + resource: [ + 'meeting', + ], + }, + }, + options: [ + { + displayName: 'Occurence Id', + name: 'occurenceId', + type: 'string', + default: '', + description: 'To view meeting details of a particular occurence of the recurring meeting.', + }, + { + displayName: 'Show Previous Occurences', + name: 'showPreviousOccurences', + type: 'boolean', + default: '', + description: 'To view meeting details of all previous occurences of the recurring meeting.', + }, + ], }, /* -------------------------------------------------------------------------- */ /* meeting:getAll */ /* -------------------------------------------------------------------------- */ { - displayName: 'Id', + displayName: 'User Id', name: 'userId', type: 'string', default: '', @@ -335,7 +361,7 @@ export const meetingFields = [ ], }, }, - description: 'User ID.', + description: 'User ID or email-id.', }, { displayName: 'Return All', @@ -393,7 +419,7 @@ export const meetingFields = [ resource: [ 'meeting', ], - } + }, }, options: [ { @@ -413,8 +439,6 @@ export const meetingFields = [ name: 'Upcoming', value: 'upcoming', }, - - ], default: 'live', description: `Meeting type.`, @@ -471,11 +495,8 @@ export const meetingFields = [ name: 'scheduleForReminder', type: 'boolean', default: false, - description: 'Schedule a reminder via email', + description: 'Notify hosts and alternative hosts about meeting cancellation via email', }, - - - ], }, @@ -492,8 +513,6 @@ export const meetingFields = [ show: { operation: [ 'update', - - ], resource: [ 'meeting', @@ -502,26 +521,6 @@ export const meetingFields = [ }, description: 'Meeting ID.', }, - { - displayName: 'Occurence Id', - name: 'occurenceId', - type: 'string', - default: '', - required: true, - displayOptions: { - show: { - operation: [ - 'update', - - - ], - resource: [ - 'meeting', - ], - }, - }, - description: 'Occurence ID.', - }, { displayName: 'Additional settings', name: 'additionalFields', @@ -531,15 +530,21 @@ export const meetingFields = [ displayOptions: { show: { operation: [ - 'update', ], resource: [ 'meeting', ], - } + }, }, options: [ + { + displayName: 'Occurence Id', + name: 'occurenceId', + type: 'string', + default: '', + description: 'Occurence ID.', + }, { displayName: 'Meeting topic', name: 'topic', @@ -691,8 +696,6 @@ export const meetingFields = [ name: 'Disabled', value: 'none', }, - - ], default: 'none', description: 'Auto recording.', @@ -714,8 +717,6 @@ export const meetingFields = [ name: 'VOIP', value: 'voip', }, - - ], default: 'both', description: 'Determine how participants can join audio portion of the meeting.', @@ -737,14 +738,10 @@ export const meetingFields = [ name: 'Attendees register once and can choose one or more occurences to attend', value: 3, }, - - ], default: 1, description: 'Registration type. Used for recurring meetings with fixed time only', }, - - ], }, diff --git a/packages/nodes-base/nodes/Zoom/MeetingRegistrantDescription.ts b/packages/nodes-base/nodes/Zoom/MeetingRegistrantDescription.ts index b062786892..592c7a285a 100644 --- a/packages/nodes-base/nodes/Zoom/MeetingRegistrantDescription.ts +++ b/packages/nodes-base/nodes/Zoom/MeetingRegistrantDescription.ts @@ -52,8 +52,6 @@ export const meetingRegistrantFields = [ show: { operation: [ 'create', - - ], resource: [ 'meetingRegistrants', @@ -63,31 +61,21 @@ export const meetingRegistrantFields = [ description: 'Meeting ID.', }, { - displayName: 'Occurence Id', - name: 'occurenceId', + displayName: 'Email', + name: 'email', type: 'string', - default: '', required: true, + default: '', displayOptions: { show: { operation: [ 'create', - - ], resource: [ 'meetingRegistrants', ], }, }, - description: 'Occurence ID.', - }, - { - displayName: 'Email', - name: 'email', - type: 'string', - required: true, - default: '', description: 'Valid email-id of registrant.', }, { @@ -96,6 +84,16 @@ export const meetingRegistrantFields = [ required: true, type: 'string', default: '', + displayOptions: { + show: { + operation: [ + 'create', + ], + resource: [ + 'meetingRegistrants', + ], + }, + }, description: 'First Name.', }, { @@ -107,7 +105,7 @@ export const meetingRegistrantFields = [ displayOptions: { show: { operation: [ - 'get', + 'create', ], resource: [ @@ -116,6 +114,13 @@ export const meetingRegistrantFields = [ } }, options: [ + { + displayName: 'Occurence Ids', + name: 'occurenceId', + type: 'string', + default: '', + description: 'Occurence IDs separated by comma.', + }, { displayName: 'Last Name', name: 'lastName', @@ -211,8 +216,6 @@ export const meetingRegistrantFields = [ name: 'No timeframe', value: 'No timeframe', }, - - ], default: '', description: 'Meeting type.' @@ -258,8 +261,6 @@ export const meetingRegistrantFields = [ show: { operation: [ 'getAll', - - ], resource: [ 'meetingRegistrants', @@ -318,7 +319,7 @@ export const meetingRegistrantFields = [ displayOptions: { show: { operation: [ - 'get', + 'getAll', ], resource: [ @@ -351,10 +352,8 @@ export const meetingRegistrantFields = [ name: 'Denied', value: 'denied', }, - - ], - default: '', + default: 'approved', description: `Registrant Status.`, }, @@ -366,15 +365,13 @@ export const meetingRegistrantFields = [ { displayName: 'Meeting Id', name: 'meetingId', - type: 'number', + type: 'string', default: '', required: true, displayOptions: { show: { operation: [ 'update', - - ], resource: [ 'meetingRegistrants', @@ -384,24 +381,63 @@ export const meetingRegistrantFields = [ description: 'Meeting ID.', }, { - displayName: 'Occurence Id', - name: 'occurenceId', - type: 'string', - default: '', + displayName: 'Action', + name: 'action', + type: 'options', required: true, displayOptions: { show: { operation: [ 'update', - - ], resource: [ 'meetingRegistrants', ], }, }, - description: 'Occurence ID.', + options: [ + { + name: 'Cancel', + value: 'cancel', + }, + { + name: 'Approved', + value: 'approve', + }, + { + name: 'Deny', + value: 'deny', + }, + ], + default: '', + description: `Registrant Status.`, }, + { + displayName: 'Additional settings', + name: 'additionalFields', + type: 'collection', + placeholder: 'Add Field', + default: {}, + displayOptions: { + show: { + operation: [ + 'update', + ], + resource: [ + 'meetingRegistrants', + ], + }, + }, + options: [ + { + displayName: 'Occurence Id', + name: 'occurenceId', + type: 'string', + default: '', + description: 'Occurence ID.', + }, + + ], + } ] as INodeProperties[]; diff --git a/packages/nodes-base/nodes/Zoom/WebinarDescription.ts b/packages/nodes-base/nodes/Zoom/WebinarDescription.ts new file mode 100644 index 0000000000..5cefbdace8 --- /dev/null +++ b/packages/nodes-base/nodes/Zoom/WebinarDescription.ts @@ -0,0 +1,685 @@ +import { + INodeProperties, +} from 'n8n-workflow'; + +export const webinarOperations = [ + { + displayName: 'Operation', + name: 'operation', + type: 'options', + displayOptions: { + show: { + resource: [ + 'webinar', + ], + }, + }, + options: [ + { + name: 'Create', + value: 'create', + description: 'Create a webinar', + }, + { + name: 'Delete', + value: 'delete', + description: 'Delete a webinar', + }, + { + name: 'Get', + value: 'get', + description: 'Retrieve a webinar', + }, + { + name: 'Get All', + value: 'getAll', + description: 'Retrieve all webinars', + }, + { + name: 'Update', + value: 'update', + description: 'Update a webinar', + } + ], + default: 'create', + description: 'The operation to perform.', + } +] as INodeProperties[]; + +export const webinarFields = [ + /* -------------------------------------------------------------------------- */ + /* webinar:create */ + /* -------------------------------------------------------------------------- */ + { + displayName: 'User Id', + name: 'userId', + type: 'string', + default: '', + required: true, + displayOptions: { + show: { + operation: [ + 'create', + ], + resource: [ + 'webinar', + ], + }, + }, + description: 'User ID or email address of user.', + }, + { + displayName: 'Additional settings', + name: 'additionalFields', + type: 'collection', + placeholder: 'Add Field', + default: {}, + displayOptions: { + show: { + operation: [ + 'create', + + ], + resource: [ + 'webinar', + ], + } + }, + options: [ + { + displayName: 'Webinar topic', + name: 'topic', + type: 'string', + default: '', + description: `Webinar topic.`, + }, + { + displayName: 'Webinar type', + name: 'type', + type: 'options', + options: [ + { + name: 'Webinar', + value: 5, + }, + { + name: 'Recurring webinar with no fixed time', + value: 6, + }, + { + name: 'Recurring webinar with fixed time', + value: 9, + }, + ], + default: 5, + description: 'Webinar type.' + }, + { + displayName: 'Start time', + name: 'startTime', + type: 'dateTime', + default: '', + description: 'Start time should be used only for scheduled or recurring webinar with fixed time', + }, + { + displayName: 'Duration', + name: 'duration', + type: 'string', + default: '', + description: 'Duration.', + }, + { + displayName: 'Timezone', + name: 'timeZone', + type: 'options', + typeOptions: { + loadOptionsMethod: 'getTimezones', + }, + default: '', + description: `Time zone used in the response. The default is the time zone of the calendar.`, + }, + { + displayName: 'Password', + name: 'password', + type: 'string', + default: '', + description: 'Password to join the webinar with maximum 10 characters.', + }, + { + displayName: 'Agenda', + name: 'agenda', + type: 'string', + default: '', + description: 'Webinar agenda.', + }, + { + displayName: 'Host Video', + name: 'host_video', + type: 'boolean', + default: false, + description: 'Start video when host joins the webinar.', + }, + { + displayName: 'Panelists Video', + name: 'panelists_video', + type: 'boolean', + default: false, + description: 'Start video when panelists joins the webinar.', + }, + { + displayName: 'Practice Session', + name: 'practice_session', + type: 'boolean', + default: false, + description: 'Enable Practice session.', + }, + { + displayName: 'Alternative Hosts', + name: 'alternative_hosts', + type: 'string', + default: '', + description: 'Alternative hosts email ids.', + }, + { + displayName: 'Approval type', + name: 'approval_type', + type: 'options', + options: [ + { + name: 'Automatically approve', + value: 0, + }, + { + name: 'Manually approve', + value: 1, + }, + { + name: 'No registration required', + value: 2, + }, + ], + default: 2, + description: 'Approval type.', + }, + { + displayName: 'Auto recording', + name: 'auto_recording', + type: 'options', + options: [ + { + name: 'Record on local', + value: 'local', + }, + { + name: 'Record on cloud', + value: 'cloud', + }, + { + name: 'Disabled', + value: 'none', + }, + ], + default: 'none', + description: 'Auto recording.', + }, + { + displayName: 'Audio', + name: 'audio', + type: 'options', + options: [ + { + name: 'Both Telephony and VoiP', + value: 'both', + }, + { + name: 'Telephony', + value: 'telephony', + }, + { + name: 'VOIP', + value: 'voip', + }, + + ], + default: 'both', + description: 'Determine how participants can join audio portion of the webinar.', + }, + { + displayName: 'Registration type', + name: 'registration_type', + type: 'options', + options: [ + { + name: 'Attendees register once and can attend any of the occurences', + value: 1, + }, + { + name: 'Attendees need to register for every occurence', + value: 2, + }, + { + name: 'Attendees register once and can choose one or more occurences to attend', + value: 3, + }, + ], + default: 1, + description: 'Registration type. Used for recurring webinar with fixed time only', + }, + + ], + }, + /* -------------------------------------------------------------------------- */ + /* webinar:get */ + /* -------------------------------------------------------------------------- */ + { + displayName: 'Webinar Id', + name: 'webinarId', + type: 'string', + default: '', + required: true, + displayOptions: { + show: { + operation: [ + 'get', + ], + resource: [ + 'webinar', + ], + }, + }, + description: 'Webinar ID.', + }, + { + displayName: 'Additional settings', + name: 'additionalFields', + type: 'collection', + placeholder: 'Add Field', + default: {}, + displayOptions: { + show: { + operation: [ + 'get', + + ], + resource: [ + 'webinar', + ], + }, + }, + options: [ + { + displayName: 'Occurence Id', + name: 'occurenceId', + type: 'string', + default: '', + description: 'To view webinar details of a particular occurence of the recurring webinar.', + }, + { + displayName: 'Show Previous Occurences', + name: 'showPreviousOccurences', + type: 'boolean', + default: '', + description: 'To view webinar details of all previous occurences of the recurring webinar.', + }, + ], + }, + /* -------------------------------------------------------------------------- */ + /* webinar:getAll */ + /* -------------------------------------------------------------------------- */ + { + displayName: 'User Id', + name: 'userId', + type: 'string', + default: '', + required: true, + displayOptions: { + show: { + operation: [ + 'getAll', + ], + resource: [ + 'webinar', + ], + }, + }, + description: 'User ID or email-id.', + }, + { + displayName: 'Return All', + name: 'returnAll', + type: 'boolean', + displayOptions: { + show: { + operation: [ + 'getAll', + ], + resource: [ + 'webinar', + ], + }, + }, + default: false, + description: 'If all results should be returned or only up to a given limit.', + }, + { + displayName: 'Limit', + name: 'limit', + type: 'number', + displayOptions: { + show: { + operation: [ + 'getAll', + ], + resource: [ + 'webinar', + ], + returnAll: [ + false, + ], + }, + }, + typeOptions: { + minValue: 1, + maxValue: 300 + }, + default: 30, + description: 'How many results to return.', + }, + { + displayName: 'Additional settings', + name: 'additionalFields', + type: 'collection', + placeholder: 'Add Field', + default: {}, + displayOptions: { + show: { + operation: [ + 'getAll', + + ], + resource: [ + 'webinar', + ], + }, + }, + + }, + /* -------------------------------------------------------------------------- */ + /* webina:delete */ + /* -------------------------------------------------------------------------- */ + { + displayName: 'Webinar Id', + name: 'webinarId', + type: 'string', + default: '', + required: true, + displayOptions: { + show: { + operation: [ + 'delete' + ], + resource: [ + 'webinarId', + ], + }, + }, + description: 'WebinarId ID.', + }, + { + displayName: 'Additional Fields', + name: 'additionalFields', + type: 'collection', + placeholder: 'Add Field', + default: {}, + displayOptions: { + show: { + operation: [ + 'delete', + ], + resource: [ + 'webinar', + ], + }, + }, + options: [ + { + displayName: 'Occurence Id', + name: 'occurenceId', + type: 'string', + default: '', + description: 'Webinar occurence Id.', + }, + + ], + + }, + /* -------------------------------------------------------------------------- */ + /* webinar:update */ + /* -------------------------------------------------------------------------- */ + { + displayName: 'User Id', + name: 'userId', + type: 'string', + default: '', + required: true, + displayOptions: { + show: { + operation: [ + 'update', + ], + resource: [ + 'webinar', + ], + }, + }, + description: 'User ID or email address of user.', + }, + { + displayName: 'Additional settings', + name: 'additionalFields', + type: 'collection', + placeholder: 'Add Field', + default: {}, + displayOptions: { + show: { + operation: [ + 'update', + + ], + resource: [ + 'webinar', + ], + } + }, + options: [ + { + displayName: 'Occurence Id', + name: 'occurence_id', + type: 'string', + default: '', + description: `Webinar occurence Id.`, + }, + { + displayName: 'Webinar topic', + name: 'topic', + type: 'string', + default: '', + description: `Webinar topic.`, + }, + { + displayName: 'Webinar type', + name: 'type', + type: 'options', + options: [ + { + name: 'Webinar', + value: 5, + }, + { + name: 'Recurring webinar with no fixed time', + value: 6, + }, + { + name: 'Recurring webinar with fixed time', + value: 9, + }, + ], + default: 5, + description: 'Webinar type.' + }, + { + displayName: 'Start time', + name: 'startTime', + type: 'dateTime', + default: '', + description: 'Start time should be used only for scheduled or recurring webinar with fixed time', + }, + { + displayName: 'Duration', + name: 'duration', + type: 'string', + default: '', + description: 'Duration.', + }, + { + displayName: 'Timezone', + name: 'timeZone', + type: 'options', + typeOptions: { + loadOptionsMethod: 'getTimezones', + }, + default: '', + description: `Time zone used in the response. The default is the time zone of the calendar.`, + }, + { + displayName: 'Password', + name: 'password', + type: 'string', + default: '', + description: 'Password to join the webinar with maximum 10 characters.', + }, + { + displayName: 'Agenda', + name: 'agenda', + type: 'string', + default: '', + description: 'Webinar agenda.', + }, + { + displayName: 'Host Video', + name: 'host_video', + type: 'boolean', + default: false, + description: 'Start video when host joins the webinar.', + }, + { + displayName: 'Panelists Video', + name: 'panelists_video', + type: 'boolean', + default: false, + description: 'Start video when panelists joins the webinar.', + }, + { + displayName: 'Practice Session', + name: 'practice_session', + type: 'boolean', + default: false, + description: 'Enable Practice session.', + }, + { + displayName: 'Alternative Hosts', + name: 'alternative_hosts', + type: 'string', + default: '', + description: 'Alternative hosts email ids.', + }, + { + displayName: 'Approval type', + name: 'approval_type', + type: 'options', + options: [ + { + name: 'Automatically approve', + value: 0, + }, + { + name: 'Manually approve', + value: 1, + }, + { + name: 'No registration required', + value: 2, + }, + ], + default: 2, + description: 'Approval type.', + }, + { + displayName: 'Auto recording', + name: 'auto_recording', + type: 'options', + options: [ + { + name: 'Record on local', + value: 'local', + }, + { + name: 'Record on cloud', + value: 'cloud', + }, + { + name: 'Disabled', + value: 'none', + }, + ], + default: 'none', + description: 'Auto recording.', + }, + { + displayName: 'Audio', + name: 'audio', + type: 'options', + options: [ + { + name: 'Both Telephony and VoiP', + value: 'both', + }, + { + name: 'Telephony', + value: 'telephony', + }, + { + name: 'VOIP', + value: 'voip', + }, + + ], + default: 'both', + description: 'Determine how participants can join audio portion of the webinar.', + }, + { + displayName: 'Registration type', + name: 'registration_type', + type: 'options', + options: [ + { + name: 'Attendees register once and can attend any of the occurences', + value: 1, + }, + { + name: 'Attendees need to register for every occurence', + value: 2, + }, + { + name: 'Attendees register once and can choose one or more occurences to attend', + value: 3, + }, + ], + default: 1, + description: 'Registration type. Used for recurring webinars with fixed time only', + }, + + ], + }, + +] as INodeProperties[]; diff --git a/packages/nodes-base/nodes/Zoom/Zoom.node.ts b/packages/nodes-base/nodes/Zoom/Zoom.node.ts index c1915d4ab4..fb3b7565f7 100644 --- a/packages/nodes-base/nodes/Zoom/Zoom.node.ts +++ b/packages/nodes-base/nodes/Zoom/Zoom.node.ts @@ -1,4 +1,6 @@ -import { IExecuteFunctions } from 'n8n-core'; +import { + IExecuteFunctions, +} from 'n8n-core'; import { IDataObject, INodeExecutionData, @@ -10,7 +12,6 @@ import { import { zoomApiRequest, zoomApiRequestAllItems, - validateJSON, } from './GenericFunctions'; import { @@ -24,11 +25,16 @@ import { } from './MeetingRegistrantDescription'; +import { + webinarOperations, + webinarFields, +} from './WebinarDescription'; import * as moment from 'moment-timezone'; interface Settings { host_video?: boolean; participant_video?: boolean; + panelists_video?: boolean; cn_meeting?: boolean; in_meeting?: boolean; join_before_host?: boolean; @@ -38,6 +44,9 @@ interface Settings { alternative_hosts?: string; auto_recording?: string; registration_type?: number; + approval_type?: number; + practice_session?: boolean; + } export class Zoom implements INodeType { @@ -107,17 +116,28 @@ export class Zoom implements INodeType { value: 'meeting' }, { - name: 'Meeting Registrants', + name: 'Meeting Registrant', value: 'meetingRegistrants' + }, + { + name: 'Webinar', + value: 'webinar' } ], default: 'meeting', description: 'The resource to operate on.' }, + //MEETINGS ...meetingOperations, ...meetingFields, + + //MEETING REGISTRANTS ...meetingRegistrantOperations, ...meetingRegistrantFields, + + //WEBINARS + ...webinarOperations, + ...webinarFields, ] }; @@ -149,20 +169,30 @@ export class Zoom implements INodeType { let responseData; const resource = this.getNodeParameter('resource', 0) as string; const operation = this.getNodeParameter('operation', 0) as string; - console.log(this.getCredentials('zoomOAuth2Api')); let body: IDataObject = {}; for (let i = 0; i < length; i++) { qs = {}; + //https://marketplace.zoom.us/docs/api-reference/zoom-api/ if (resource === 'meeting') { if (operation === 'get') { //https://marketplace.zoom.us/docs/api-reference/zoom-api/meetings/meeting - const userId = this.getNodeParameter('userId', i) as string; + const meetingId = this.getNodeParameter('meetingId', i) as string; + + const additionalFields = this.getNodeParameter( + 'additionalFields', + i + ) as IDataObject; + if (additionalFields.showPreviousOccurences) + qs.show_previous_occurences = additionalFields.showPreviousOccurences as boolean; + + if (additionalFields.occurenceId) + qs.occurence_id = additionalFields.occurenceId as string; responseData = await zoomApiRequest.call( this, 'GET', - `/meetings/${userId}`, + `/meetings/${meetingId}`, {}, qs ); @@ -170,18 +200,30 @@ export class Zoom implements INodeType { if (operation === 'getAll') { //https://marketplace.zoom.us/docs/api-reference/zoom-api/meetings/meetings const userId = this.getNodeParameter('userId', i) as string; + const returnAll = this.getNodeParameter('returnAll', i) as boolean; + if (returnAll) { + responseData = await zoomApiRequestAllItems.call(this, 'results', 'GET', `/users/${userId}/meetings`, {}, qs); + } else { + const limit = this.getNodeParameter('limit', i) as number; + qs.page_size = limit; + responseData = await zoomApiRequest.call(this, 'GET', `/users/${userId}/meetings`, {}, qs); + responseData = responseData.results; + } - responseData = await zoomApiRequest.call( - this, - 'GET', - `/users/${userId}/meetings`, - {}, - qs - ); } if (operation === 'delete') { //https://marketplace.zoom.us/docs/api-reference/zoom-api/meetings/meetingdelete const meetingId = this.getNodeParameter('meetingId', i) as string; + const additionalFields = this.getNodeParameter( + 'additionalFields', + i + ) as IDataObject; + if (additionalFields.scheduleForReminder) + qs.schedule_for_reminder = additionalFields.scheduleForReminder as boolean; + + if (additionalFields.occurenceId) + qs.occurence_id = additionalFields.occurenceId; + responseData = await zoomApiRequest.call( this, 'DELETE', @@ -297,10 +339,6 @@ export class Zoom implements INodeType { body.agenda = additionalFields.agenda as string; } - - - - responseData = await zoomApiRequest.call( this, 'POST', @@ -312,12 +350,16 @@ export class Zoom implements INodeType { if (operation === 'update') { //https://marketplace.zoom.us/docs/api-reference/zoom-api/meetings/meetingupdate const meetingId = this.getNodeParameter('meetingId', i) as string; - qs.occurence_id = this.getNodeParameter('occurenceId', i) as string; + const settings: Settings = {}; const additionalFields = this.getNodeParameter( 'additionalFields', i ) as IDataObject; - const settings: Settings = {}; + + if (additionalFields.occurenceId) { + qs.occurence_id = additionalFields.occurenceId as string; + } + if (additionalFields.cn_meeting) { settings.cn_meeting = additionalFields.cn_meeting as boolean; @@ -423,16 +465,64 @@ export class Zoom implements INodeType { body, qs ); + responseData = { updated: true }; + } } if (resource === 'meetingRegistrant') { if (operation === 'create') { //https://marketplace.zoom.us/docs/api-reference/zoom-api/meetings/meetingregistrantcreate const meetingId = this.getNodeParameter('meetingId', i) as string; - qs.occurence_id = this.getNodeParameter('occurenceId', i) as string; + const emailId = this.getNodeParameter('email', i) as string; + body.email = emailId; + const firstName = this.getNodeParameter('firstName', i) as string; + body.first_name = firstName; + const additionalFields = this.getNodeParameter( + 'additionalFields', + i + ) as IDataObject; + if (additionalFields.occurenceId) { + qs.occurence_ids = additionalFields.occurenceId as string; + } + if (additionalFields.lastName) { + body.last_name = additionalFields.lastName as string; + } + if (additionalFields.address) { + body.address = additionalFields.address as string; + } + if (additionalFields.city) { + body.city = additionalFields.city as string; + } + if (additionalFields.state) { + body.state = additionalFields.state as string; + } + if (additionalFields.country) { + body.country = additionalFields.country as string; + } + if (additionalFields.zip) { + body.zip = additionalFields.zip as string; + } + if (additionalFields.phone) { + body.phone = additionalFields.phone as string; + } + if (additionalFields.comments) { + body.comments = additionalFields.comments as string; + } + if (additionalFields.org) { + body.org = additionalFields.org as string; + } + if (additionalFields.job_title) { + body.job_title = additionalFields.job_title as string; + } + if (additionalFields.purchasing_time_frame) { + body.purchasing_time_frame = additionalFields.purchasing_time_frame as string; + } + if (additionalFields.role_in_purchase_process) { + body.role_in_purchase_process = additionalFields.role_in_purchase_process as string; + } responseData = await zoomApiRequest.call( this, - 'PATCH', + 'POST', `/meetings/${meetingId}/registrants`, body, qs @@ -440,9 +530,282 @@ export class Zoom implements INodeType { } if (operation === 'getAll') { //https://marketplace.zoom.us/docs/api-reference/zoom-api/meetings/meetingregistrants + const meetingId = this.getNodeParameter('meetingId', i) as string; + const additionalFields = this.getNodeParameter( + 'additionalFields', + i + ) as IDataObject; + if (additionalFields.occurenceId) { + qs.occurence_id = additionalFields.occurenceId as string; + } + if (additionalFields.status) { + qs.status = additionalFields.status as string; + } + const returnAll = this.getNodeParameter('returnAll', i) as boolean; + if (returnAll) { + responseData = await zoomApiRequestAllItems.call(this, 'results', 'GET', `/meetings/${meetingId}/registrants`, {}, qs); + } else { + const limit = this.getNodeParameter('limit', i) as number; + qs.page_size = limit; + responseData = await zoomApiRequest.call(this, 'GET', `/meetings/${meetingId}/registrants`, {}, qs); + responseData = responseData.results; + } + } if (operation === 'update') { //https://marketplace.zoom.us/docs/api-reference/zoom-api/meetings/meetingregistrantstatus + const meetingId = this.getNodeParameter('meetingId', i) as string; + const additionalFields = this.getNodeParameter( + 'additionalFields', + i + ) as IDataObject; + if (additionalFields.occurenceId) { + qs.occurence_id = additionalFields.occurenceId as string; + } + responseData = await zoomApiRequest.call( + this, + 'PUT', + `/meetings/${meetingId}/registrants/status`, + body, + qs + ); + } + } + if (resource === 'webinar') { + if (operation === 'create') { + //https://marketplace.zoom.us/docs/api-reference/zoom-api/webinars/webinarcreate + const userId = this.getNodeParameter('userId', i) as string; + const additionalFields = this.getNodeParameter( + 'additionalFields', + i + ) as IDataObject; + const settings: Settings = {}; + + + if (additionalFields.audio) { + settings.audio = additionalFields.audio as string; + + } + + if (additionalFields.alternative_hosts) { + settings.alternative_hosts = additionalFields.alternative_hosts as string; + + } + + if (additionalFields.panelists_video) { + settings.panelists_video = additionalFields.panelists_video as boolean; + + } + if (additionalFields.practice_session) { + settings.practice_session = additionalFields.practice_session as boolean; + + } + if (additionalFields.auto_recording) { + settings.auto_recording = additionalFields.auto_recording as string; + + } + + if (additionalFields.registration_type) { + settings.registration_type = additionalFields.registration_type as number; + + } + if (additionalFields.approval_type) { + settings.approval_type = additionalFields.approval_type as number; + + } + + body = { + settings, + }; + + if (additionalFields.topic) { + body.topic = additionalFields.topic as string; + + } + + if (additionalFields.type) { + body.type = additionalFields.type as string; + + } + + if (additionalFields.startTime) { + body.start_time = additionalFields.startTime as string; + + } + + if (additionalFields.duration) { + body.duration = additionalFields.duration as number; + + } + + + if (additionalFields.timeZone) { + body.timezone = additionalFields.timeZone as string; + + } + + if (additionalFields.password) { + body.password = additionalFields.password as string; + + } + + if (additionalFields.agenda) { + body.agenda = additionalFields.agenda as string; + + } + responseData = await zoomApiRequest.call( + this, + 'POST', + `/users/${userId}/webinars`, + body, + qs + ); + } + if (operation === 'get') { + //https://marketplace.zoom.us/docs/api-reference/zoom-api/webinars/webinar + const webinarId = this.getNodeParameter('webinarId', i) as string; + + const additionalFields = this.getNodeParameter( + 'additionalFields', + i + ) as IDataObject; + if (additionalFields.showPreviousOccurences) + qs.show_previous_occurences = additionalFields.showPreviousOccurences as boolean; + + if (additionalFields.occurenceId) + qs.occurence_id = additionalFields.occurenceId as string; + + responseData = await zoomApiRequest.call( + this, + 'GET', + `/webinars/${webinarId}`, + {}, + qs + ); + } + if (operation === 'getAll') { + //https://marketplace.zoom.us/docs/api-reference/zoom-api/webinars/webinars + const userId = this.getNodeParameter('userId', i) as string; + const returnAll = this.getNodeParameter('returnAll', i) as boolean; + if (returnAll) { + responseData = await zoomApiRequestAllItems.call(this, 'results', 'GET', `/users/${userId}/webinars`, {}, qs); + } else { + const limit = this.getNodeParameter('limit', i) as number; + qs.page_size = limit; + responseData = await zoomApiRequest.call(this, 'GET', `/users/${userId}/webinars`, {}, qs); + responseData = responseData.results; + } + } + if (operation === 'delete') { + //https://marketplace.zoom.us/docs/api-reference/zoom-api/webinars/webinardelete + const webinarId = this.getNodeParameter('webinarId', i) as string; + const additionalFields = this.getNodeParameter( + 'additionalFields', + i + ) as IDataObject; + + + if (additionalFields.occurenceId) + qs.occurence_id = additionalFields.occurenceId; + + responseData = await zoomApiRequest.call( + this, + 'DELETE', + `/webinars/${webinarId}`, + {}, + qs + ); + responseData = { success: true }; + } + if (operation === 'update') { + //https://marketplace.zoom.us/docs/api-reference/zoom-api/webinars/webinarupdate + const webinarId = this.getNodeParameter('webinarId', i) as string; + const additionalFields = this.getNodeParameter( + 'additionalFields', + i + ) as IDataObject; + if (additionalFields.occurence_id) { + qs.occurence_id = additionalFields.occurence_id as string; + + } + const settings: Settings = {}; + if (additionalFields.audio) { + settings.audio = additionalFields.audio as string; + + } + if (additionalFields.alternative_hosts) { + settings.alternative_hosts = additionalFields.alternative_hosts as string; + + } + + if (additionalFields.panelists_video) { + settings.panelists_video = additionalFields.panelists_video as boolean; + + } + if (additionalFields.practice_session) { + settings.practice_session = additionalFields.practice_session as boolean; + + } + if (additionalFields.auto_recording) { + settings.auto_recording = additionalFields.auto_recording as string; + + } + + if (additionalFields.registration_type) { + settings.registration_type = additionalFields.registration_type as number; + + } + if (additionalFields.approval_type) { + settings.approval_type = additionalFields.approval_type as number; + + } + + body = { + settings, + }; + + if (additionalFields.topic) { + body.topic = additionalFields.topic as string; + + } + + if (additionalFields.type) { + body.type = additionalFields.type as string; + + } + + if (additionalFields.startTime) { + body.start_time = additionalFields.startTime as string; + + } + + if (additionalFields.duration) { + body.duration = additionalFields.duration as number; + + } + + + if (additionalFields.timeZone) { + body.timezone = additionalFields.timeZone as string; + + } + + if (additionalFields.password) { + body.password = additionalFields.password as string; + + } + + if (additionalFields.agenda) { + body.agenda = additionalFields.agenda as string; + + } + responseData = await zoomApiRequest.call( + this, + 'PATCH', + `/users/${webinarId}/webinars`, + body, + qs + ); } } } From e60edc3bff68a6e7fb72af7454bf8f77d2e3baad Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Tue, 23 Jun 2020 12:43:40 +0200 Subject: [PATCH 097/241] :zap: Minor improvements --- .../mysqldb/migrations/1592447867632-WebhookModel.ts | 2 +- .../postgresdb/migrations/1589476000887-WebhookModel.ts | 5 +++-- .../sqlite/migrations/1588102412422-InitialMigration.ts | 5 ++++- .../sqlite/migrations/1592445003908-WebhookModel.ts | 4 ++-- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/packages/cli/src/databases/mysqldb/migrations/1592447867632-WebhookModel.ts b/packages/cli/src/databases/mysqldb/migrations/1592447867632-WebhookModel.ts index 6c81f612ed..8a49080462 100644 --- a/packages/cli/src/databases/mysqldb/migrations/1592447867632-WebhookModel.ts +++ b/packages/cli/src/databases/mysqldb/migrations/1592447867632-WebhookModel.ts @@ -13,7 +13,7 @@ import { import { Workflow, -} from 'n8n-workflow/dist/src/Workflow'; +} from 'n8n-workflow'; import { IWebhookDb, diff --git a/packages/cli/src/databases/postgresdb/migrations/1589476000887-WebhookModel.ts b/packages/cli/src/databases/postgresdb/migrations/1589476000887-WebhookModel.ts index dfbf94a799..e53fc28915 100644 --- a/packages/cli/src/databases/postgresdb/migrations/1589476000887-WebhookModel.ts +++ b/packages/cli/src/databases/postgresdb/migrations/1589476000887-WebhookModel.ts @@ -11,7 +11,7 @@ import { import { Workflow, -} from 'n8n-workflow/dist/src/Workflow'; +} from 'n8n-workflow'; import { IWebhookDb, @@ -24,12 +24,13 @@ export class WebhookModel1589476000887 implements MigrationInterface { async up(queryRunner: QueryRunner): Promise { let tablePrefix = config.get('database.tablePrefix'); + const tablePrefixIndex = tablePrefix; const schema = config.get('database.postgresdb.schema'); if (schema) { tablePrefix = schema + '.' + tablePrefix; } - await queryRunner.query(`CREATE TABLE ${tablePrefix}webhook_entity ("workflowId" integer NOT NULL, "webhookPath" character varying NOT NULL, "method" character varying NOT NULL, "node" character varying NOT NULL, CONSTRAINT "PK_b21ace2e13596ccd87dc9bf4ea6" PRIMARY KEY ("webhookPath", "method"))`, undefined); + await queryRunner.query(`CREATE TABLE ${tablePrefix}webhook_entity ("workflowId" integer NOT NULL, "webhookPath" character varying NOT NULL, "method" character varying NOT NULL, "node" character varying NOT NULL, CONSTRAINT "PK_${tablePrefixIndex}b21ace2e13596ccd87dc9bf4ea6" PRIMARY KEY ("webhookPath", "method"))`, undefined); const workflows = await queryRunner.query(`SELECT * FROM ${tablePrefix}workflow_entity WHERE active=true`) as IWorkflowDb[]; const data: IWebhookDb[] = []; diff --git a/packages/cli/src/databases/sqlite/migrations/1588102412422-InitialMigration.ts b/packages/cli/src/databases/sqlite/migrations/1588102412422-InitialMigration.ts index c2bb55040e..09a0da911a 100644 --- a/packages/cli/src/databases/sqlite/migrations/1588102412422-InitialMigration.ts +++ b/packages/cli/src/databases/sqlite/migrations/1588102412422-InitialMigration.ts @@ -1,4 +1,7 @@ -import { MigrationInterface, QueryRunner } from "typeorm"; +import { + MigrationInterface, + QueryRunner, +} from 'typeorm'; import * as config from '../../../../config'; diff --git a/packages/cli/src/databases/sqlite/migrations/1592445003908-WebhookModel.ts b/packages/cli/src/databases/sqlite/migrations/1592445003908-WebhookModel.ts index f1402fad88..92704482b2 100644 --- a/packages/cli/src/databases/sqlite/migrations/1592445003908-WebhookModel.ts +++ b/packages/cli/src/databases/sqlite/migrations/1592445003908-WebhookModel.ts @@ -1,7 +1,7 @@ import { MigrationInterface, QueryRunner, -} from "typeorm"; +} from 'typeorm'; import * as config from '../../../../config'; @@ -13,7 +13,7 @@ import { import { Workflow, -} from 'n8n-workflow/dist/src/Workflow'; +} from 'n8n-workflow'; import { IWebhookDb, From 93afb0940b34b82186f5ec1f6a945f501cf9c307 Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Tue, 23 Jun 2020 16:12:53 +0200 Subject: [PATCH 098/241] :zap: Use rest endpoint configuration --- packages/cli/src/Server.ts | 74 +++++++++++++++++++------------------- 1 file changed, 38 insertions(+), 36 deletions(-) diff --git a/packages/cli/src/Server.ts b/packages/cli/src/Server.ts index 5a9099bd63..1b3750a20c 100644 --- a/packages/cli/src/Server.ts +++ b/packages/cli/src/Server.ts @@ -113,6 +113,7 @@ class App { activeExecutionsInstance: ActiveExecutions.ActiveExecutions; push: Push.Push; versions: IPackageVersions | undefined; + restEndpoint: string; protocol: string; sslKey: string; @@ -127,6 +128,7 @@ class App { this.saveDataSuccessExecution = config.get('executions.saveDataOnSuccess') as string; this.saveManualExecutions = config.get('executions.saveDataManualExecutions') as boolean; this.timezone = config.get('generic.timezone') as string; + this.restEndpoint = config.get('endpoints.rest') as string; this.activeWorkflowRunner = ActiveWorkflowRunner.getInstance(); this.testWebhooks = TestWebhooks.getInstance(); @@ -235,7 +237,7 @@ class App { // Get push connections this.app.use((req: express.Request, res: express.Response, next: express.NextFunction) => { - if (req.url.indexOf('/rest/push') === 0) { + if (req.url.indexOf(`/${this.restEndpoint}/push`) === 0) { // TODO: Later also has to add some kind of authentication token if (req.query.sessionId === undefined) { next(new Error('The query parameter "sessionId" is missing!')); @@ -284,7 +286,7 @@ class App { this.app.use(history({ rewrites: [ { - from: new RegExp(`^\/(rest|healthz|css|js|${this.endpointWebhook}|${this.endpointWebhookTest})\/?.*$`), + from: new RegExp(`^\/(${this.restEndpoint}|healthz|css|js|${this.endpointWebhook}|${this.endpointWebhookTest})\/?.*$`), to: (context) => { return context.parsedUrl!.pathname!.toString(); } @@ -354,7 +356,7 @@ class App { // Creates a new workflow - this.app.post('/rest/workflows', ResponseHelper.send(async (req: express.Request, res: express.Response): Promise => { + this.app.post(`/${this.restEndpoint}/workflows`, ResponseHelper.send(async (req: express.Request, res: express.Response): Promise => { const newWorkflowData = req.body as IWorkflowBase; @@ -377,7 +379,7 @@ class App { // Reads and returns workflow data from an URL - this.app.get('/rest/workflows/from-url', ResponseHelper.send(async (req: express.Request, res: express.Response): Promise => { + this.app.get(`/${this.restEndpoint}/workflows/from-url`, ResponseHelper.send(async (req: express.Request, res: express.Response): Promise => { if (req.query.url === undefined) { throw new ResponseHelper.ResponseError(`The parameter "url" is missing!`, undefined, 400); } @@ -405,7 +407,7 @@ class App { // Returns workflows - this.app.get('/rest/workflows', ResponseHelper.send(async (req: express.Request, res: express.Response): Promise => { + this.app.get(`/${this.restEndpoint}/workflows`, ResponseHelper.send(async (req: express.Request, res: express.Response): Promise => { const findQuery = {} as FindManyOptions; if (req.query.filter) { findQuery.where = JSON.parse(req.query.filter as string); @@ -425,7 +427,7 @@ class App { // Returns a specific workflow - this.app.get('/rest/workflows/:id', ResponseHelper.send(async (req: express.Request, res: express.Response): Promise => { + this.app.get(`/${this.restEndpoint}/workflows/:id`, ResponseHelper.send(async (req: express.Request, res: express.Response): Promise => { const result = await Db.collections.Workflow!.findOne(req.params.id); if (result === undefined) { @@ -439,7 +441,7 @@ class App { // Updates an existing workflow - this.app.patch('/rest/workflows/:id', ResponseHelper.send(async (req: express.Request, res: express.Response): Promise => { + this.app.patch(`/${this.restEndpoint}/workflows/:id`, ResponseHelper.send(async (req: express.Request, res: express.Response): Promise => { const newWorkflowData = req.body as IWorkflowBase; const id = req.params.id; @@ -510,7 +512,7 @@ class App { // Deletes a specific workflow - this.app.delete('/rest/workflows/:id', ResponseHelper.send(async (req: express.Request, res: express.Response): Promise => { + this.app.delete(`/${this.restEndpoint}/workflows/:id`, ResponseHelper.send(async (req: express.Request, res: express.Response): Promise => { const id = req.params.id; await this.externalHooks.run('workflow.delete', [id]); @@ -526,7 +528,7 @@ class App { })); - this.app.post('/rest/workflows/run', ResponseHelper.send(async (req: express.Request, res: express.Response): Promise => { + this.app.post(`/${this.restEndpoint}/workflows/run`, ResponseHelper.send(async (req: express.Request, res: express.Response): Promise => { const workflowData = req.body.workflowData; const runData: IRunData | undefined = req.body.runData; const startNodes: string[] | undefined = req.body.startNodes; @@ -575,7 +577,7 @@ class App { // Returns parameter values which normally get loaded from an external API or // get generated dynamically - this.app.get('/rest/node-parameter-options', ResponseHelper.send(async (req: express.Request, res: express.Response): Promise => { + this.app.get(`/${this.restEndpoint}/node-parameter-options`, ResponseHelper.send(async (req: express.Request, res: express.Response): Promise => { const nodeType = req.query.nodeType as string; let credentials: INodeCredentials | undefined = undefined; const currentNodeParameters = JSON.parse('' + req.query.currentNodeParameters) as INodeParameters; @@ -597,7 +599,7 @@ class App { // Returns all the node-types - this.app.get('/rest/node-types', ResponseHelper.send(async (req: express.Request, res: express.Response): Promise => { + this.app.get(`/${this.restEndpoint}/node-types`, ResponseHelper.send(async (req: express.Request, res: express.Response): Promise => { const returnData: INodeTypeDescription[] = []; @@ -620,7 +622,7 @@ class App { // Returns the node icon - this.app.get(['/rest/node-icon/:nodeType', '/rest/node-icon/:scope/:nodeType'], async (req: express.Request, res: express.Response): Promise => { + this.app.get([`/${this.restEndpoint}/node-icon/:nodeType`, `/${this.restEndpoint}/node-icon/:scope/:nodeType`], async (req: express.Request, res: express.Response): Promise => { const nodeTypeName = `${req.params.scope ? `${req.params.scope}/` : ''}${req.params.nodeType}`; const nodeTypes = NodeTypes(); @@ -654,13 +656,13 @@ class App { // Returns the active workflow ids - this.app.get('/rest/active', ResponseHelper.send(async (req: express.Request, res: express.Response): Promise => { + this.app.get(`/${this.restEndpoint}/active`, ResponseHelper.send(async (req: express.Request, res: express.Response): Promise => { return this.activeWorkflowRunner.getActiveWorkflows(); })); // Returns if the workflow with the given id had any activation errors - this.app.get('/rest/active/error/:id', ResponseHelper.send(async (req: express.Request, res: express.Response): Promise => { + this.app.get(`/${this.restEndpoint}/active/error/:id`, ResponseHelper.send(async (req: express.Request, res: express.Response): Promise => { const id = req.params.id; return this.activeWorkflowRunner.getActivationError(id); })); @@ -673,7 +675,7 @@ class App { // Deletes a specific credential - this.app.delete('/rest/credentials/:id', ResponseHelper.send(async (req: express.Request, res: express.Response): Promise => { + this.app.delete(`/${this.restEndpoint}/credentials/:id`, ResponseHelper.send(async (req: express.Request, res: express.Response): Promise => { const id = req.params.id; await this.externalHooks.run('credentials.delete', [id]); @@ -684,7 +686,7 @@ class App { })); // Creates new credentials - this.app.post('/rest/credentials', ResponseHelper.send(async (req: express.Request, res: express.Response): Promise => { + this.app.post(`/${this.restEndpoint}/credentials`, ResponseHelper.send(async (req: express.Request, res: express.Response): Promise => { const incomingData = req.body; if (!incomingData.name || incomingData.name.length < 3) { @@ -742,7 +744,7 @@ class App { // Updates existing credentials - this.app.patch('/rest/credentials/:id', ResponseHelper.send(async (req: express.Request, res: express.Response): Promise => { + this.app.patch(`/${this.restEndpoint}/credentials/:id`, ResponseHelper.send(async (req: express.Request, res: express.Response): Promise => { const incomingData = req.body; const id = req.params.id; @@ -823,7 +825,7 @@ class App { // Returns specific credentials - this.app.get('/rest/credentials/:id', ResponseHelper.send(async (req: express.Request, res: express.Response): Promise => { + this.app.get(`/${this.restEndpoint}/credentials/:id`, ResponseHelper.send(async (req: express.Request, res: express.Response): Promise => { const findQuery = {} as FindManyOptions; // Make sure the variable has an expected value @@ -858,7 +860,7 @@ class App { // Returns all the saved credentials - this.app.get('/rest/credentials', ResponseHelper.send(async (req: express.Request, res: express.Response): Promise => { + this.app.get(`/${this.restEndpoint}/credentials`, ResponseHelper.send(async (req: express.Request, res: express.Response): Promise => { const findQuery = {} as FindManyOptions; if (req.query.filter) { findQuery.where = JSON.parse(req.query.filter as string); @@ -900,7 +902,7 @@ class App { // Returns all the credential types which are defined in the loaded n8n-modules - this.app.get('/rest/credential-types', ResponseHelper.send(async (req: express.Request, res: express.Response): Promise => { + this.app.get(`/${this.restEndpoint}/credential-types`, ResponseHelper.send(async (req: express.Request, res: express.Response): Promise => { const returnData: ICredentialType[] = []; @@ -918,7 +920,7 @@ class App { // ---------------------------------------- // Authorize OAuth Data - this.app.get('/rest/oauth1-credential/auth', ResponseHelper.send(async (req: express.Request, res: express.Response): Promise => { + this.app.get(`/${this.restEndpoint}/oauth1-credential/auth`, ResponseHelper.send(async (req: express.Request, res: express.Response): Promise => { if (req.query.id === undefined) { throw new Error('Required credential id is missing!'); } @@ -961,7 +963,7 @@ class App { }, }); - const callback = `${WebhookHelpers.getWebhookBaseUrl()}rest/oauth1-credential/callback?cid=${req.query.id}`; + const callback = `${WebhookHelpers.getWebhookBaseUrl()}${this.restEndpoint}/oauth1-credential/callback?cid=${req.query.id}`; const options: RequestOptions = { method: 'POST', @@ -1000,7 +1002,7 @@ class App { })); // Verify and store app code. Generate access tokens and store for respective credential. - this.app.get('/rest/oauth1-credential/callback', async (req: express.Request, res: express.Response) => { + this.app.get(`/${this.restEndpoint}/oauth1-credential/callback`, async (req: express.Request, res: express.Response) => { const { oauth_verifier, oauth_token, cid } = req.query; if (oauth_verifier === undefined || oauth_token === undefined) { @@ -1072,7 +1074,7 @@ class App { // Authorize OAuth Data - this.app.get('/rest/oauth2-credential/auth', ResponseHelper.send(async (req: express.Request, res: express.Response): Promise => { + this.app.get(`/${this.restEndpoint}/oauth2-credential/auth`, ResponseHelper.send(async (req: express.Request, res: express.Response): Promise => { if (req.query.id === undefined) { throw new Error('Required credential id is missing!'); } @@ -1113,7 +1115,7 @@ class App { clientSecret: _.get(oauthCredentials, 'clientSecret', '') as string, accessTokenUri: _.get(oauthCredentials, 'accessTokenUrl', '') as string, authorizationUri: _.get(oauthCredentials, 'authUrl', '') as string, - redirectUri: `${WebhookHelpers.getWebhookBaseUrl()}rest/oauth2-credential/callback`, + redirectUri: `${WebhookHelpers.getWebhookBaseUrl()}${this.restEndpoint}/oauth2-credential/callback`, scopes: _.split(_.get(oauthCredentials, 'scope', 'openid,') as string, ','), state: stateEncodedStr, }); @@ -1146,7 +1148,7 @@ class App { // ---------------------------------------- // Verify and store app code. Generate access tokens and store for respective credential. - this.app.get('/rest/oauth2-credential/callback', async (req: express.Request, res: express.Response) => { + this.app.get(`/${this.restEndpoint}/oauth2-credential/callback`, async (req: express.Request, res: express.Response) => { const {code, state: stateEncoded } = req.query; if (code === undefined || stateEncoded === undefined) { @@ -1206,7 +1208,7 @@ class App { clientSecret: _.get(oauthCredentials, 'clientSecret', '') as string, accessTokenUri: _.get(oauthCredentials, 'accessTokenUrl', '') as string, authorizationUri: _.get(oauthCredentials, 'authUrl', '') as string, - redirectUri: `${WebhookHelpers.getWebhookBaseUrl()}rest/oauth2-credential/callback`, + redirectUri: `${WebhookHelpers.getWebhookBaseUrl()}${this.restEndpoint}/oauth2-credential/callback`, scopes: _.split(_.get(oauthCredentials, 'scope', 'openid,') as string, ',') }); @@ -1246,7 +1248,7 @@ class App { // Returns all finished executions - this.app.get('/rest/executions', ResponseHelper.send(async (req: express.Request, res: express.Response): Promise => { + this.app.get(`/${this.restEndpoint}/executions`, ResponseHelper.send(async (req: express.Request, res: express.Response): Promise => { let filter: any = {}; // tslint:disable-line:no-any if (req.query.filter) { @@ -1311,7 +1313,7 @@ class App { // Returns a specific execution - this.app.get('/rest/executions/:id', ResponseHelper.send(async (req: express.Request, res: express.Response): Promise => { + this.app.get(`/${this.restEndpoint}/executions/:id`, ResponseHelper.send(async (req: express.Request, res: express.Response): Promise => { const result = await Db.collections.Execution!.findOne(req.params.id); if (result === undefined) { @@ -1325,7 +1327,7 @@ class App { // Retries a failed execution - this.app.post('/rest/executions/:id/retry', ResponseHelper.send(async (req: express.Request, res: express.Response): Promise => { + this.app.post(`/${this.restEndpoint}/executions/:id/retry`, ResponseHelper.send(async (req: express.Request, res: express.Response): Promise => { // Get the data to execute const fullExecutionDataFlatted = await Db.collections.Execution!.findOne(req.params.id); @@ -1399,7 +1401,7 @@ class App { // Delete Executions // INFORMATION: We use POST instead of DELETE to not run into any issues // with the query data getting to long - this.app.post('/rest/executions/delete', ResponseHelper.send(async (req: express.Request, res: express.Response): Promise => { + this.app.post(`/${this.restEndpoint}/executions/delete`, ResponseHelper.send(async (req: express.Request, res: express.Response): Promise => { const deleteData = req.body as IExecutionDeleteFilter; if (deleteData.deleteBefore !== undefined) { @@ -1426,7 +1428,7 @@ class App { // Returns all the currently working executions - this.app.get('/rest/executions-current', ResponseHelper.send(async (req: express.Request, res: express.Response): Promise => { + this.app.get(`/${this.restEndpoint}/executions-current`, ResponseHelper.send(async (req: express.Request, res: express.Response): Promise => { const executingWorkflows = this.activeExecutionsInstance.getActiveExecutions(); const returnData: IExecutionsSummary[] = []; @@ -1455,7 +1457,7 @@ class App { })); // Forces the execution to stop - this.app.post('/rest/executions-current/:id/stop', ResponseHelper.send(async (req: express.Request, res: express.Response): Promise => { + this.app.post(`/${this.restEndpoint}/executions-current/:id/stop`, ResponseHelper.send(async (req: express.Request, res: express.Response): Promise => { const executionId = req.params.id; // Stopt he execution and wait till it is done and we got the data @@ -1477,7 +1479,7 @@ class App { // Removes a test webhook - this.app.delete('/rest/test-webhook/:id', ResponseHelper.send(async (req: express.Request, res: express.Response): Promise => { + this.app.delete(`/${this.restEndpoint}/test-webhook/:id`, ResponseHelper.send(async (req: express.Request, res: express.Response): Promise => { const workflowId = req.params.id; return this.testWebhooks.cancelTestWebhook(workflowId); })); @@ -1489,7 +1491,7 @@ class App { // ---------------------------------------- // Returns all the available timezones - this.app.get('/rest/options/timezones', ResponseHelper.send(async (req: express.Request, res: express.Response): Promise => { + this.app.get(`/${this.restEndpoint}/options/timezones`, ResponseHelper.send(async (req: express.Request, res: express.Response): Promise => { return timezones; })); @@ -1502,7 +1504,7 @@ class App { // Returns the settings which are needed in the UI - this.app.get('/rest/settings', ResponseHelper.send(async (req: express.Request, res: express.Response): Promise => { + this.app.get(`/${this.restEndpoint}/settings`, ResponseHelper.send(async (req: express.Request, res: express.Response): Promise => { return { endpointWebhook: this.endpointWebhook, endpointWebhookTest: this.endpointWebhookTest, From 6a96587c5041ed9a6c51e84fc87c92179e79f460 Mon Sep 17 00:00:00 2001 From: Ron <43244104+rons4@users.noreply.github.com> Date: Tue, 23 Jun 2020 17:18:01 +0200 Subject: [PATCH 099/241] Initial version. --- .../nodes/SIGNL4/GenericFunctions.ts | 64 +++++ .../nodes-base/nodes/SIGNL4/signl4.node.ts | 233 ++++++++++++++++++ packages/nodes-base/nodes/SIGNL4/signl4.png | Bin 0 -> 3045 bytes 3 files changed, 297 insertions(+) create mode 100644 packages/nodes-base/nodes/SIGNL4/GenericFunctions.ts create mode 100644 packages/nodes-base/nodes/SIGNL4/signl4.node.ts create mode 100644 packages/nodes-base/nodes/SIGNL4/signl4.png diff --git a/packages/nodes-base/nodes/SIGNL4/GenericFunctions.ts b/packages/nodes-base/nodes/SIGNL4/GenericFunctions.ts new file mode 100644 index 0000000000..525a0b1ef9 --- /dev/null +++ b/packages/nodes-base/nodes/SIGNL4/GenericFunctions.ts @@ -0,0 +1,64 @@ +import { + IExecuteFunctions, + IHookFunctions, +} from 'n8n-core'; + +import { + ICredentialDataDecryptedObject, + IDataObject, +} from 'n8n-workflow'; + +/** + * Make an API request to MSG91 + * + * @param {IHookFunctions | IExecuteFunctions} this + * @param {object} message + * @returns {Promise} + */ +export async function SIGNL4ApiRequest(this: IHookFunctions | IExecuteFunctions, message: IDataObject): Promise { // tslint:disable-line:no-any + const credentials = this.getCredentials('SIGNL4Api'); + if (credentials === undefined) { + throw new Error('No credentials got returned!'); + } + + const teamsecret = credentials!.teamSecret as string; + + var response = null; + try { + response = await this.helpers.request({ + headers: {'Content-Type': 'application/json'}, + method: 'POST', + body: message, + qs: {}, + uri: `https://connect.signl4.com/webhook/${teamsecret}`, + json: true + }); + } + catch (error) { + + throw new Error(`I am behind. Status: ${JSON.stringify(teamsecret)}`); + + if (error && error.message) { + throw new Error(`Error sending the SIGNL4 request. Error: ${JSON.stringify(error.message)}`); + } + + throw new Error('Error sending the SIGNL4 request.'); + + throw error; + } + + return response; +} + + +function setPayload(credentials: ICredentialDataDecryptedObject, o?: IDataObject) { + if (!o) { + o = {}; + } + + o.p = credentials!.teamSecret as string; + o.json = 1; + o.sendwith = 'n8n'; + + return o; +} diff --git a/packages/nodes-base/nodes/SIGNL4/signl4.node.ts b/packages/nodes-base/nodes/SIGNL4/signl4.node.ts new file mode 100644 index 0000000000..cc665eadd4 --- /dev/null +++ b/packages/nodes-base/nodes/SIGNL4/signl4.node.ts @@ -0,0 +1,233 @@ +import {IExecuteFunctions,} from 'n8n-core'; +import {IDataObject, INodeExecutionData, INodeType, INodeTypeDescription,} from 'n8n-workflow'; +import {SIGNL4ApiRequest} from './GenericFunctions'; + +export class SIGNL4 implements INodeType { + description: INodeTypeDescription = { + displayName: 'SIGNL4', + name: 'SIGNL4', + icon: 'file:signl4.png', + group: ['transform'], + version: 1, + subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}', + description: 'Send SIGNL4 alert.', + defaults: { + name: 'SIGNL4', + color: '#0000FF', + }, + inputs: ['main'], + outputs: ['main'], + credentials: [ + { + name: 'SIGNL4Api', + required: true, + } + ], + properties: [ + { + displayName: 'Resource', + name: 'resource', + type: 'options', + options: [ + { + name: 'Alert', + value: 'alert', + }, + ], + default: 'alert', + description: 'The resource to operate on.', + }, + { + displayName: 'Operation', + name: 'operation', + type: 'options', + displayOptions: { + show: { + resource: [ + 'alert', + ], + }, + }, + options: [ + { + name: 'Send Alert', + value: 'send', + description: 'Send SIGNL4 alert.', + }, + ], + default: 'send', + description: 'The operation to perform.', + }, + { + displayName: 'Subject', + name: 'subject', + type: 'string', + default: 'SIGNL4 Alert', + placeholder: 'SIGNL4 Alert', + required: true, + displayOptions: { + show: { + operation: [ + 'send', + ], + resource: [ + 'alert', + ], + }, + }, + description: 'The subject of the SIGNL4 alert.', + }, + { + displayName: 'Body', + name: 'body', + type: 'string', + default: '', + placeholder: 'Alert description.', + required: false, + displayOptions: { + show: { + operation: [ + 'send', + ], + resource: [ + 'alert', + ], + }, + }, + description: 'A more detailed description for the alert.', + }, + { + displayName: 'S4-Service', + name: 'xS4Service', + type: 'string', + default: '', + required: false, + displayOptions: { + show: { + operation: [ + 'send', + ], + resource: [ + 'alert', + ], + }, + }, + description: 'Assigns the alert to the service/system category with the specified name.', + }, + { + displayName: 'S4-Location', + name: 'xS4Location', + type: 'string', + default: '', + required: false, + displayOptions: { + show: { + operation: [ + 'send', + ], + resource: [ + 'alert', + ], + }, + }, + description: 'Transmit location information (\'latitude, longitude\') with your event and display a map in the mobile app.', + }, + { + displayName: 'S4-AlertingScenario', + name: 'xS4AlertingScenario', + type: 'options', + options: [ + { + name: 'single_ack', + value: 'single_ack', + }, + { + name: 'multi_ack', + value: 'multi_ack', + }, + ], + default: 'single_ack', + required: false, + displayOptions: { + show: { + operation: [ + 'send', + ], + resource: [ + 'alert', + ], + }, + }, + description: 'Pass \'single_ack\' if only one person needs to confirm this Signl. Pass \'multi_ack\' in case this alert must be confirmed by the number of people who are on duty at the time this Singl is raised.', + }, + { + displayName: 'S4-ExternalID', + name: 'xS4ExternalId', + type: 'string', + default: '', + required: false, + displayOptions: { + show: { + operation: [ + 'send', + ], + resource: [ + 'alert', + ], + }, + }, + description: 'If the event originates from a record in a 3rd party system, use this parameter to pass the unique ID of that record. That ID will be communicated in outbound webhook notifications from SIGNL4, which is great for correlation/synchronization of that record with the alert.', + }, + { + displayName: 'S4-Filtering', + name: 'xS4Filtering', + type: 'boolean', + default: 'false', + required: false, + displayOptions: { + show: { + operation: [ + 'send', + ], + resource: [ + 'alert', + ], + }, + }, + description: 'Specify a boolean value of true or false to apply event filtering for this event, or not. If set to true, the event will only trigger a notification to the team, if it contains at least one keyword from one of your services and system categories (i.e. it is whitelisted)', + } + ], + }; + + async execute(this: IExecuteFunctions): Promise { + const returnData: IDataObject[] = []; + + for (let i = 0; i < this.getInputData().length; i++) { + const resource = this.getNodeParameter('resource', i); + if ('alert' !== resource) { + throw new Error(`The resource "${resource}" is not known!`); + } + + const operation = this.getNodeParameter('operation', i); + if ('send' !== operation) { + throw new Error(`The operation "${operation}" is not known!`); + } + + // Assemble JSON data + var message = { + Subject: this.getNodeParameter('subject', i), + Body: this.getNodeParameter('body', i) + } as IDataObject; + message['X-S4-Service'] = this.getNodeParameter('xS4Service', i); + message['X-S4-Location'] = this.getNodeParameter('xS4Location', i); + message['X-S4-AlertingScenario'] = this.getNodeParameter('xS4AlertingScenario', i); + message['X-S4-ExternalID'] = this.getNodeParameter('xS4ExternalId', i); + message['X-S4-Filtering'] = this.getNodeParameter('xS4Filtering', i); + + const responseData = await SIGNL4ApiRequest.call(this, message); + + returnData.push(responseData); + } + return [this.helpers.returnJsonArray(returnData)]; + } +} diff --git a/packages/nodes-base/nodes/SIGNL4/signl4.png b/packages/nodes-base/nodes/SIGNL4/signl4.png new file mode 100644 index 0000000000000000000000000000000000000000..205c94a5d2ba0e8d25d7b792050e341a8c8ab29b GIT binary patch literal 3045 zcmVPx#1ZP1_K>z@;j|==^1poj532;bRa{vGi!~g&e!~vBn4jTXf00v@9M??Vs0RI60 zpuMM)00007bV*G`2jK|@3RSOzj|T*UUHjarW6~ukZWz-rwG>1;C@6 zG_Zs8q`^r?*s`pX%cV)!S{7kV{zl9%H+K5}q|r!(MT#Ebr;U02QR*kN1U+VypG_O` z?-kl2+(^#mABhvBS_G7u=K*t%tU_XS{&53QUiGeN^WG3|Nmzu$BP1z_u`uM`#~+(=er;sMzdNv2{z2hEyhs&bN|=T6|#E^Sv8K{6@TD9jgV z=3mMkT~j7X&^nK;lHw%18JJ)?!Bl0D7wHlk%H6}c&E&Yla-4;PHEt&$E6Zg_CQEW6yDACvr7W!J@bjyf zmjcv=kBzoOV1^c)q(#Td9!845NXf%+(I-F7I+2z_W=V_if|301(Uh>UE=6vvxhk@< zPLlZO!X&K8NVYcA;<6In3lxFHU3h?blJ7p5l{Z)5-$EGLi^uB~CMwrMt?4 zp;b@MSXkc)Y|Jw4%3#wMzKQG=pNEz1;G679y>apKDisv=JdVNp@5JDdVGQPh19_63 z@rjSp;&O4{z5Uf(R!)=Xwi|B+K5;$9<2ly*J3yv7h4NDm;_dtHL?u6=p)L#LYwZ-t zMzI5T*4*tdge~;Sm1)tnB)z`V!lv#tHs5>~vR8f?R)S9 zd+AT8R?B9gl9-j+wft?0B*Qt}*}EFsfADJ@+V(l*y#(s2&%YL{&pyj2PFq=;ik#iM zDf-qLkvQ+u#tNgqz zRQA2Z71?Tts{FoT#6|JIn++Omjmm-7=+YWxw4bIfZS=;JV*?jdvvp{n^bY}ypa%EB z8~T@8wTFp=n0)DJ^R8BDe|7eWOKsv@eDe3yp}y7{o)q-#Bb*9+F&J~ZvcRQ7D9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y#cb#%o7j5E=)G` zFz<(L%Fpcbt=0zInF*Bl{1LV-2aWc#ESJ``OW~m(qx{-#7F4-7%6s=<`hg$9Q5@RP z$9(a|hcNl8+qoVsJykrnhSB@J1AF?Y|LKV0B$M%-%tnUgR#AN6am3E}5Muow2x=Q3 ztG%%Yqd&SCvEsO~#!`@#>+k#;B&W>$JozqMRoTs#A1%&5EWJ~ zn~uJ=hv1tvImuZUAbrU-h;R5Hd$dtK_y&rMgsLw;iG<}wx`)zMQ}14j4Cs=qJksLoshdtS$CfcL_2Ig% zf1G5W7W4YQHxAFC$9##G>*_dW!tW<6Yg>9h!|FcCENpe>PPz06jgxN<_vA9CT>3 Date: Tue, 23 Jun 2020 17:19:17 +0200 Subject: [PATCH 100/241] Add files via upload --- packages/nodes-base/nodes/SIGNL4/signl4.node.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/nodes-base/nodes/SIGNL4/signl4.node.ts b/packages/nodes-base/nodes/SIGNL4/signl4.node.ts index cc665eadd4..5b91df3814 100644 --- a/packages/nodes-base/nodes/SIGNL4/signl4.node.ts +++ b/packages/nodes-base/nodes/SIGNL4/signl4.node.ts @@ -10,7 +10,7 @@ export class SIGNL4 implements INodeType { group: ['transform'], version: 1, subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}', - description: 'Send SIGNL4 alert.', + description: 'Send SIGNL4 alert. Find our more at https://www.signl4.com.', defaults: { name: 'SIGNL4', color: '#0000FF', From 474eac5005d36f973820cd89487c6a862feac03b Mon Sep 17 00:00:00 2001 From: Ron <43244104+rons4@users.noreply.github.com> Date: Tue, 23 Jun 2020 17:20:21 +0200 Subject: [PATCH 101/241] Initial version. --- .../credentials/SIGNL4Api.credentials.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 packages/nodes-base/credentials/SIGNL4Api.credentials.ts diff --git a/packages/nodes-base/credentials/SIGNL4Api.credentials.ts b/packages/nodes-base/credentials/SIGNL4Api.credentials.ts new file mode 100644 index 0000000000..4fa31c1422 --- /dev/null +++ b/packages/nodes-base/credentials/SIGNL4Api.credentials.ts @@ -0,0 +1,18 @@ +import { + ICredentialType, + NodePropertyTypes, +} from 'n8n-workflow'; + +export class SIGNL4Api implements ICredentialType { + name = 'SIGNL4Api'; + displayName = 'SIGNL4 Webhook'; + properties = [ + { + displayName: 'Team Secret', + name: 'teamSecret', + type: 'string' as NodePropertyTypes, + default: '', + description: 'The team secret is the last part of your SIGNL4 webhook URL.' + }, + ]; +} From d59658ade0531c20eb6a71eedb36fc7dbe217b41 Mon Sep 17 00:00:00 2001 From: Ron <43244104+rons4@users.noreply.github.com> Date: Tue, 23 Jun 2020 17:23:39 +0200 Subject: [PATCH 102/241] Updated for the SIGNL4 node. --- packages/nodes-base/package.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/nodes-base/package.json b/packages/nodes-base/package.json index a09d97d032..1b4a18a5cc 100644 --- a/packages/nodes-base/package.json +++ b/packages/nodes-base/package.json @@ -1,6 +1,6 @@ { "name": "n8n-nodes-base", - "version": "0.65.0", + "version": "0.66.0", "description": "Base nodes of n8n", "license": "SEE LICENSE IN LICENSE.md", "homepage": "https://n8n.io", @@ -119,6 +119,7 @@ "dist/credentials/StripeApi.credentials.js", "dist/credentials/SalesmateApi.credentials.js", "dist/credentials/SegmentApi.credentials.js", + "dist/credentials/SIGNL4Api.credentials.js", "dist/credentials/SurveyMonkeyApi.credentials.js", "dist/credentials/SurveyMonkeyOAuth2Api.credentials.js", "dist/credentials/TelegramApi.credentials.js", @@ -260,6 +261,7 @@ "dist/nodes/Set.node.js", "dist/nodes/Shopify/Shopify.node.js", "dist/nodes/Shopify/ShopifyTrigger.node.js", + "dist/nodes/SIGNL4/SIGNL4.node.js", "dist/nodes/Slack/Slack.node.js", "dist/nodes/Sms77/Sms77.node.js", "dist/nodes/SplitInBatches.node.js", From 807db166fd6ec8b46ed987d15cc254606307eb2b Mon Sep 17 00:00:00 2001 From: shraddha shaligram Date: Tue, 23 Jun 2020 12:14:04 -0700 Subject: [PATCH 103/241] refactor code --- .../nodes/Zoom/MeetingDescription.ts | 498 +++++++++--------- .../Zoom/MeetingRegistrantDescription.ts | 59 ++- .../nodes/Zoom/WebinarDescription.ts | 396 +++++++------- packages/nodes-base/nodes/Zoom/Zoom.node.ts | 28 +- 4 files changed, 489 insertions(+), 492 deletions(-) diff --git a/packages/nodes-base/nodes/Zoom/MeetingDescription.ts b/packages/nodes-base/nodes/Zoom/MeetingDescription.ts index 274b48ff97..b9a1c74cb5 100644 --- a/packages/nodes-base/nodes/Zoom/MeetingDescription.ts +++ b/packages/nodes-base/nodes/Zoom/MeetingDescription.ts @@ -86,77 +86,6 @@ export const meetingFields = [ } }, options: [ - { - displayName: 'Meeting topic', - name: 'topic', - type: 'string', - default: '', - description: `Meeting topic.`, - }, - { - displayName: 'Meeting type', - name: 'type', - type: 'options', - options: [ - { - name: 'Instant Meeting', - value: 1, - }, - { - name: 'Scheduled Meeting', - value: 2, - }, - { - name: 'Recurring meeting with no fixed time', - value: 3, - }, - { - name: 'Recurring meeting with no fixed time', - value: 8, - }, - - ], - default: 2, - description: 'Meeting type.' - }, - { - displayName: 'Start time', - name: 'startTime', - type: 'dateTime', - default: '', - description: 'Start time should be used only for scheduled or recurring meetings with fixed time', - }, - { - displayName: 'Duration', - name: 'duration', - type: 'number', - default: '', - description: 'Duration.', - }, - { - displayName: 'Timezone', - name: 'timeZone', - type: 'options', - typeOptions: { - loadOptionsMethod: 'getTimezones', - }, - default: '', - description: `Time zone used in the response. The default is the time zone of the calendar.`, - }, - { - displayName: 'Schedule for', - name: 'scheduleFor', - type: 'string', - default: '', - description: 'Schedule meeting for someone else from your account, provide their email id.', - }, - { - displayName: 'Password', - name: 'password', - type: 'string', - default: '', - description: 'Password to join the meeting with maximum 10 characters.', - }, { displayName: 'Agenda', name: 'agenda', @@ -164,55 +93,6 @@ export const meetingFields = [ default: '', description: 'Meeting agenda.', }, - { - displayName: 'Host Meeting in China', - name: 'cn_meeting', - type: 'boolean', - default: false, - description: 'Host Meeting in China.', - }, - { - displayName: 'Host Meeting in India', - name: 'in_meeting', - type: 'boolean', - default: false, - description: 'Host Meeting in India.', - }, - { - displayName: 'Host Video', - name: 'host_video', - type: 'boolean', - default: false, - description: 'Start video when host joins the meeting.', - }, - { - displayName: 'Participant Video', - name: 'participant_video', - type: 'boolean', - default: false, - description: 'Start video when participant joins the meeting.', - }, - { - displayName: 'Join before Host', - name: 'join_before_host', - type: 'boolean', - default: false, - description: 'Allow participants to join the meeting before host starts it.', - }, - { - displayName: 'Muting before entry', - name: 'mute_upon_entry', - type: 'boolean', - default: false, - description: 'Mute participants upon entry.', - }, - { - displayName: 'Watermark', - name: 'watermark', - type: 'boolean', - default: false, - description: 'Adds watermark when viewing a shared screen.', - }, { displayName: 'Alternative Hosts', name: 'alternative_hosts', @@ -263,6 +143,95 @@ export const meetingFields = [ default: 'both', description: 'Determine how participants can join audio portion of the meeting.', }, + { + displayName: 'Duration', + name: 'duration', + type: 'number', + default: '', + description: 'Duration.', + }, + { + displayName: 'Host Meeting in China', + name: 'cn_meeting', + type: 'boolean', + default: false, + description: 'Host Meeting in China.', + }, + { + displayName: 'Host Meeting in India', + name: 'in_meeting', + type: 'boolean', + default: false, + description: 'Host Meeting in India.', + }, + { + displayName: 'Host Video', + name: 'host_video', + type: 'boolean', + default: false, + description: 'Start video when host joins the meeting.', + }, + { + displayName: 'Join before Host', + name: 'join_before_host', + type: 'boolean', + default: false, + description: 'Allow participants to join the meeting before host starts it.', + }, + { + displayName: 'Meeting topic', + name: 'topic', + type: 'string', + default: '', + description: `Meeting topic.`, + }, + { + displayName: 'Meeting type', + name: 'type', + type: 'options', + options: [ + { + name: 'Instant Meeting', + value: 1, + }, + { + name: 'Scheduled Meeting', + value: 2, + }, + { + name: 'Recurring meeting with no fixed time', + value: 3, + }, + { + name: 'Recurring meeting with no fixed time', + value: 8, + }, + + ], + default: 2, + description: 'Meeting type.' + }, + { + displayName: 'Muting before entry', + name: 'mute_upon_entry', + type: 'boolean', + default: false, + description: 'Mute participants upon entry.', + }, + { + displayName: 'Participant Video', + name: 'participant_video', + type: 'boolean', + default: false, + description: 'Start video when participant joins the meeting.', + }, + { + displayName: 'Password', + name: 'password', + type: 'string', + default: '', + description: 'Password to join the meeting with maximum 10 characters.', + }, { displayName: 'Registration type', name: 'registration_type', @@ -284,7 +253,37 @@ export const meetingFields = [ default: 1, description: 'Registration type. Used for recurring meetings with fixed time only', }, - + { + displayName: 'Schedule for', + name: 'scheduleFor', + type: 'string', + default: '', + description: 'Schedule meeting for someone else from your account, provide their email id.', + }, + { + displayName: 'Start time', + name: 'startTime', + type: 'dateTime', + default: '', + description: 'Start time should be used only for scheduled or recurring meetings with fixed time', + }, + { + displayName: 'Timezone', + name: 'timeZone', + type: 'options', + typeOptions: { + loadOptionsMethod: 'getTimezones', + }, + default: '', + description: `Time zone used in the response. The default is the time zone of the calendar.`, + }, + { + displayName: 'Watermark', + name: 'watermark', + type: 'boolean', + default: false, + description: 'Adds watermark when viewing a shared screen.', + }, ], }, /* -------------------------------------------------------------------------- */ @@ -538,6 +537,98 @@ export const meetingFields = [ }, }, options: [ + { + displayName: 'Agenda', + name: 'agenda', + type: 'string', + default: '', + description: 'Meeting agenda.', + }, + { + displayName: 'Alternative Hosts', + name: 'alternative_hosts', + type: 'string', + default: '', + description: 'Alternative hosts email ids.', + }, + { + displayName: 'Audio', + name: 'auto_recording', + type: 'options', + options: [ + { + name: 'Both Telephony and VoiP', + value: 'both', + }, + { + name: 'Telephony', + value: 'telephony', + }, + { + name: 'VOIP', + value: 'voip', + }, + ], + default: 'both', + description: 'Determine how participants can join audio portion of the meeting.', + }, + { + displayName: 'Auto recording', + name: 'auto_recording', + type: 'options', + options: [ + { + name: 'Record on local', + value: 'local', + }, + { + name: 'Record on cloud', + value: 'cloud', + }, + { + name: 'Disabled', + value: 'none', + }, + ], + default: 'none', + description: 'Auto recording.', + }, + + { + displayName: 'Duration', + name: 'duration', + type: 'number', + default: '', + description: 'Duration.', + }, + { + displayName: 'Join before Host', + name: 'join_before_host', + type: 'boolean', + default: false, + description: 'Allow participants to join the meeting before host starts it.', + }, + { + displayName: 'Host Meeting in China', + name: 'cn_meeting', + type: 'boolean', + default: false, + description: 'Host Meeting in China.', + }, + { + displayName: 'Host Meeting in India', + name: 'in_meeting', + type: 'boolean', + default: false, + description: 'Host Meeting in India.', + }, + { + displayName: 'Host Video', + name: 'host_video', + type: 'boolean', + default: false, + description: 'Start video when host joins the meeting.', + }, { displayName: 'Occurence Id', name: 'occurenceId', @@ -579,35 +670,11 @@ export const meetingFields = [ description: 'Meeting type.' }, { - displayName: 'Start time', - name: 'startTime', - type: 'dateTime', - default: '', - description: 'Start time should be used only for scheduled or recurring meetings with fixed time', - }, - { - displayName: 'Duration', - name: 'duration', - type: 'number', - default: '', - description: 'Duration.', - }, - { - displayName: 'Timezone', - name: 'timeZone', - type: 'options', - typeOptions: { - loadOptionsMethod: 'getTimezones', - }, - default: '', - description: `Time zone used in the response. The default is the time zone of the calendar.`, - }, - { - displayName: 'Schedule for', - name: 'scheduleFor', - type: 'string', - default: '', - description: 'Schedule meeting for someone else from your account, provide their email id.', + displayName: 'Muting before entry', + name: 'mute_upon_entry', + type: 'boolean', + default: false, + description: 'Mute participants upon entry.', }, { displayName: 'Password', @@ -616,34 +683,6 @@ export const meetingFields = [ default: '', description: 'Password to join the meeting with maximum 10 characters.', }, - { - displayName: 'Agenda', - name: 'agenda', - type: 'string', - default: '', - description: 'Meeting agenda.', - }, - { - displayName: 'Host Meeting in China', - name: 'cn_meeting', - type: 'boolean', - default: false, - description: 'Host Meeting in China.', - }, - { - displayName: 'Host Meeting in India', - name: 'in_meeting', - type: 'boolean', - default: false, - description: 'Host Meeting in India.', - }, - { - displayName: 'Host Video', - name: 'host_video', - type: 'boolean', - default: false, - description: 'Start video when host joins the meeting.', - }, { displayName: 'Participant Video', name: 'participant_video', @@ -651,76 +690,6 @@ export const meetingFields = [ default: false, description: 'Start video when participant joins the meeting.', }, - { - displayName: 'Join before Host', - name: 'join_before_host', - type: 'boolean', - default: false, - description: 'Allow participants to join the meeting before host starts it.', - }, - { - displayName: 'Muting before entry', - name: 'mute_upon_entry', - type: 'boolean', - default: false, - description: 'Mute participants upon entry.', - }, - { - displayName: 'Watermark', - name: 'watermark', - type: 'boolean', - default: false, - description: 'Adds watermark when viewing a shared screen.', - }, - { - displayName: 'Alternative Hosts', - name: 'alternative_hosts', - type: 'string', - default: '', - description: 'Alternative hosts email ids.', - }, - { - displayName: 'Auto recording', - name: 'auto_recording', - type: 'options', - options: [ - { - name: 'Record on local', - value: 'local', - }, - { - name: 'Record on cloud', - value: 'cloud', - }, - { - name: 'Disabled', - value: 'none', - }, - ], - default: 'none', - description: 'Auto recording.', - }, - { - displayName: 'Audio', - name: 'auto_recording', - type: 'options', - options: [ - { - name: 'Both Telephony and VoiP', - value: 'both', - }, - { - name: 'Telephony', - value: 'telephony', - }, - { - name: 'VOIP', - value: 'voip', - }, - ], - default: 'both', - description: 'Determine how participants can join audio portion of the meeting.', - }, { displayName: 'Registration type', name: 'registration_type', @@ -742,6 +711,39 @@ export const meetingFields = [ default: 1, description: 'Registration type. Used for recurring meetings with fixed time only', }, + { + displayName: 'Schedule for', + name: 'scheduleFor', + type: 'string', + default: '', + description: 'Schedule meeting for someone else from your account, provide their email id.', + }, + { + displayName: 'Start time', + name: 'startTime', + type: 'dateTime', + default: '', + description: 'Start time should be used only for scheduled or recurring meetings with fixed time', + }, + { + displayName: 'Timezone', + name: 'timeZone', + type: 'options', + typeOptions: { + loadOptionsMethod: 'getTimezones', + }, + default: '', + description: `Time zone used in the response. The default is the time zone of the calendar.`, + }, + { + displayName: 'Watermark', + name: 'watermark', + type: 'boolean', + default: false, + description: 'Adds watermark when viewing a shared screen.', + }, + + ], }, diff --git a/packages/nodes-base/nodes/Zoom/MeetingRegistrantDescription.ts b/packages/nodes-base/nodes/Zoom/MeetingRegistrantDescription.ts index 592c7a285a..232f8cf42c 100644 --- a/packages/nodes-base/nodes/Zoom/MeetingRegistrantDescription.ts +++ b/packages/nodes-base/nodes/Zoom/MeetingRegistrantDescription.ts @@ -114,20 +114,6 @@ export const meetingRegistrantFields = [ } }, options: [ - { - displayName: 'Occurence Ids', - name: 'occurenceId', - type: 'string', - default: '', - description: 'Occurence IDs separated by comma.', - }, - { - displayName: 'Last Name', - name: 'lastName', - type: 'string', - default: '', - description: 'Last Name.', - }, { displayName: 'Address', name: 'address', @@ -143,11 +129,11 @@ export const meetingRegistrantFields = [ description: 'Valid city of registrant.', }, { - displayName: 'State', - name: 'state', + displayName: 'Comments', + name: 'comments', type: 'string', default: '', - description: 'Valid state of registrant.', + description: 'Allows registrants to provide any questions they have.', }, { displayName: 'Country', @@ -157,25 +143,25 @@ export const meetingRegistrantFields = [ description: 'Valid country of registrant.', }, { - displayName: 'Zip code', - name: 'zip', + displayName: 'Job title', + name: 'job_title', type: 'string', default: '', - description: 'Valid zip-code of registrant.', + description: 'Job title of registrant.', }, { - displayName: 'Phone Number', - name: 'phone', + displayName: 'Last Name', + name: 'lastName', type: 'string', default: '', - description: 'Valid phone number of registrant.', + description: 'Last Name.', }, { - displayName: 'Comments', - name: 'comments', + displayName: 'Occurence Ids', + name: 'occurenceId', type: 'string', default: '', - description: 'Allows registrants to provide any questions they have.', + description: 'Occurence IDs separated by comma.', }, { displayName: 'Organization', @@ -185,11 +171,11 @@ export const meetingRegistrantFields = [ description: 'Organization of registrant.', }, { - displayName: 'Job title', - name: 'job_title', + displayName: 'Phone Number', + name: 'phone', type: 'string', default: '', - description: 'Job title of registrant.', + description: 'Valid phone number of registrant.', }, { displayName: 'Purchasing time frame', @@ -246,6 +232,21 @@ export const meetingRegistrantFields = [ default: '', description: 'Role in purchase process.' }, + { + displayName: 'State', + name: 'state', + type: 'string', + default: '', + description: 'Valid state of registrant.', + }, + { + displayName: 'Zip code', + name: 'zip', + type: 'string', + default: '', + description: 'Valid zip-code of registrant.', + }, + ], }, /* -------------------------------------------------------------------------- */ diff --git a/packages/nodes-base/nodes/Zoom/WebinarDescription.ts b/packages/nodes-base/nodes/Zoom/WebinarDescription.ts index 5cefbdace8..4bbec11fd4 100644 --- a/packages/nodes-base/nodes/Zoom/WebinarDescription.ts +++ b/packages/nodes-base/nodes/Zoom/WebinarDescription.ts @@ -86,65 +86,6 @@ export const webinarFields = [ } }, options: [ - { - displayName: 'Webinar topic', - name: 'topic', - type: 'string', - default: '', - description: `Webinar topic.`, - }, - { - displayName: 'Webinar type', - name: 'type', - type: 'options', - options: [ - { - name: 'Webinar', - value: 5, - }, - { - name: 'Recurring webinar with no fixed time', - value: 6, - }, - { - name: 'Recurring webinar with fixed time', - value: 9, - }, - ], - default: 5, - description: 'Webinar type.' - }, - { - displayName: 'Start time', - name: 'startTime', - type: 'dateTime', - default: '', - description: 'Start time should be used only for scheduled or recurring webinar with fixed time', - }, - { - displayName: 'Duration', - name: 'duration', - type: 'string', - default: '', - description: 'Duration.', - }, - { - displayName: 'Timezone', - name: 'timeZone', - type: 'options', - typeOptions: { - loadOptionsMethod: 'getTimezones', - }, - default: '', - description: `Time zone used in the response. The default is the time zone of the calendar.`, - }, - { - displayName: 'Password', - name: 'password', - type: 'string', - default: '', - description: 'Password to join the webinar with maximum 10 characters.', - }, { displayName: 'Agenda', name: 'agenda', @@ -152,27 +93,6 @@ export const webinarFields = [ default: '', description: 'Webinar agenda.', }, - { - displayName: 'Host Video', - name: 'host_video', - type: 'boolean', - default: false, - description: 'Start video when host joins the webinar.', - }, - { - displayName: 'Panelists Video', - name: 'panelists_video', - type: 'boolean', - default: false, - description: 'Start video when panelists joins the webinar.', - }, - { - displayName: 'Practice Session', - name: 'practice_session', - type: 'boolean', - default: false, - description: 'Enable Practice session.', - }, { displayName: 'Alternative Hosts', name: 'alternative_hosts', @@ -201,27 +121,6 @@ export const webinarFields = [ default: 2, description: 'Approval type.', }, - { - displayName: 'Auto recording', - name: 'auto_recording', - type: 'options', - options: [ - { - name: 'Record on local', - value: 'local', - }, - { - name: 'Record on cloud', - value: 'cloud', - }, - { - name: 'Disabled', - value: 'none', - }, - ], - default: 'none', - description: 'Auto recording.', - }, { displayName: 'Audio', name: 'audio', @@ -244,6 +143,62 @@ export const webinarFields = [ default: 'both', description: 'Determine how participants can join audio portion of the webinar.', }, + { + displayName: 'Auto recording', + name: 'auto_recording', + type: 'options', + options: [ + { + name: 'Record on local', + value: 'local', + }, + { + name: 'Record on cloud', + value: 'cloud', + }, + { + name: 'Disabled', + value: 'none', + }, + ], + default: 'none', + description: 'Auto recording.', + }, + { + displayName: 'Duration', + name: 'duration', + type: 'string', + default: '', + description: 'Duration.', + }, + { + displayName: 'Host Video', + name: 'host_video', + type: 'boolean', + default: false, + description: 'Start video when host joins the webinar.', + }, + { + displayName: 'Panelists Video', + name: 'panelists_video', + type: 'boolean', + default: false, + description: 'Start video when panelists joins the webinar.', + }, + { + displayName: 'Password', + name: 'password', + type: 'string', + default: '', + description: 'Password to join the webinar with maximum 10 characters.', + }, + { + displayName: 'Practice Session', + name: 'practice_session', + type: 'boolean', + default: false, + description: 'Enable Practice session.', + }, { displayName: 'Registration type', name: 'registration_type', @@ -265,6 +220,51 @@ export const webinarFields = [ default: 1, description: 'Registration type. Used for recurring webinar with fixed time only', }, + { + displayName: 'Start time', + name: 'startTime', + type: 'dateTime', + default: '', + description: 'Start time should be used only for scheduled or recurring webinar with fixed time', + }, + { + displayName: 'Timezone', + name: 'timeZone', + type: 'options', + typeOptions: { + loadOptionsMethod: 'getTimezones', + }, + default: '', + description: `Time zone used in the response. The default is the time zone of the calendar.`, + }, + { + displayName: 'Webinar topic', + name: 'topic', + type: 'string', + default: '', + description: `Webinar topic.`, + }, + { + displayName: 'Webinar type', + name: 'type', + type: 'options', + options: [ + { + name: 'Webinar', + value: 5, + }, + { + name: 'Recurring webinar with no fixed time', + value: 6, + }, + { + name: 'Recurring webinar with fixed time', + value: 9, + }, + ], + default: 5, + description: 'Webinar type.' + }, ], }, @@ -385,25 +385,6 @@ export const webinarFields = [ default: 30, description: 'How many results to return.', }, - { - displayName: 'Additional settings', - name: 'additionalFields', - type: 'collection', - placeholder: 'Add Field', - default: {}, - displayOptions: { - show: { - operation: [ - 'getAll', - - ], - resource: [ - 'webinar', - ], - }, - }, - - }, /* -------------------------------------------------------------------------- */ /* webina:delete */ /* -------------------------------------------------------------------------- */ @@ -492,72 +473,6 @@ export const webinarFields = [ } }, options: [ - { - displayName: 'Occurence Id', - name: 'occurence_id', - type: 'string', - default: '', - description: `Webinar occurence Id.`, - }, - { - displayName: 'Webinar topic', - name: 'topic', - type: 'string', - default: '', - description: `Webinar topic.`, - }, - { - displayName: 'Webinar type', - name: 'type', - type: 'options', - options: [ - { - name: 'Webinar', - value: 5, - }, - { - name: 'Recurring webinar with no fixed time', - value: 6, - }, - { - name: 'Recurring webinar with fixed time', - value: 9, - }, - ], - default: 5, - description: 'Webinar type.' - }, - { - displayName: 'Start time', - name: 'startTime', - type: 'dateTime', - default: '', - description: 'Start time should be used only for scheduled or recurring webinar with fixed time', - }, - { - displayName: 'Duration', - name: 'duration', - type: 'string', - default: '', - description: 'Duration.', - }, - { - displayName: 'Timezone', - name: 'timeZone', - type: 'options', - typeOptions: { - loadOptionsMethod: 'getTimezones', - }, - default: '', - description: `Time zone used in the response. The default is the time zone of the calendar.`, - }, - { - displayName: 'Password', - name: 'password', - type: 'string', - default: '', - description: 'Password to join the webinar with maximum 10 characters.', - }, { displayName: 'Agenda', name: 'agenda', @@ -565,27 +480,6 @@ export const webinarFields = [ default: '', description: 'Webinar agenda.', }, - { - displayName: 'Host Video', - name: 'host_video', - type: 'boolean', - default: false, - description: 'Start video when host joins the webinar.', - }, - { - displayName: 'Panelists Video', - name: 'panelists_video', - type: 'boolean', - default: false, - description: 'Start video when panelists joins the webinar.', - }, - { - displayName: 'Practice Session', - name: 'practice_session', - type: 'boolean', - default: false, - description: 'Enable Practice session.', - }, { displayName: 'Alternative Hosts', name: 'alternative_hosts', @@ -657,6 +551,48 @@ export const webinarFields = [ default: 'both', description: 'Determine how participants can join audio portion of the webinar.', }, + { + displayName: 'Duration', + name: 'duration', + type: 'string', + default: '', + description: 'Duration.', + }, + { + displayName: 'Host Video', + name: 'host_video', + type: 'boolean', + default: false, + description: 'Start video when host joins the webinar.', + }, + { + displayName: 'Occurence Id', + name: 'occurence_id', + type: 'string', + default: '', + description: `Webinar occurence Id.`, + }, + { + displayName: 'Password', + name: 'password', + type: 'string', + default: '', + description: 'Password to join the webinar with maximum 10 characters.', + }, + { + displayName: 'Panelists Video', + name: 'panelists_video', + type: 'boolean', + default: false, + description: 'Start video when panelists joins the webinar.', + }, + { + displayName: 'Practice Session', + name: 'practice_session', + type: 'boolean', + default: false, + description: 'Enable Practice session.', + }, { displayName: 'Registration type', name: 'registration_type', @@ -678,7 +614,51 @@ export const webinarFields = [ default: 1, description: 'Registration type. Used for recurring webinars with fixed time only', }, - + { + displayName: 'Start time', + name: 'startTime', + type: 'dateTime', + default: '', + description: 'Start time should be used only for scheduled or recurring webinar with fixed time', + }, + { + displayName: 'Timezone', + name: 'timeZone', + type: 'options', + typeOptions: { + loadOptionsMethod: 'getTimezones', + }, + default: '', + description: `Time zone used in the response. The default is the time zone of the calendar.`, + }, + { + displayName: 'Webinar topic', + name: 'topic', + type: 'string', + default: '', + description: `Webinar topic.`, + }, + { + displayName: 'Webinar type', + name: 'type', + type: 'options', + options: [ + { + name: 'Webinar', + value: 5, + }, + { + name: 'Recurring webinar with no fixed time', + value: 6, + }, + { + name: 'Recurring webinar with fixed time', + value: 9, + }, + ], + default: 5, + description: 'Webinar type.' + }, ], }, diff --git a/packages/nodes-base/nodes/Zoom/Zoom.node.ts b/packages/nodes-base/nodes/Zoom/Zoom.node.ts index fb3b7565f7..8e6eb10d2b 100644 --- a/packages/nodes-base/nodes/Zoom/Zoom.node.ts +++ b/packages/nodes-base/nodes/Zoom/Zoom.node.ts @@ -183,12 +183,16 @@ export class Zoom implements INodeType { 'additionalFields', i ) as IDataObject; - if (additionalFields.showPreviousOccurences) + if (additionalFields.showPreviousOccurences) { qs.show_previous_occurences = additionalFields.showPreviousOccurences as boolean; - if (additionalFields.occurenceId) + } + + if (additionalFields.occurenceId) { qs.occurence_id = additionalFields.occurenceId as string; + } + responseData = await zoomApiRequest.call( this, 'GET', @@ -218,12 +222,16 @@ export class Zoom implements INodeType { 'additionalFields', i ) as IDataObject; - if (additionalFields.scheduleForReminder) + if (additionalFields.scheduleForReminder) { qs.schedule_for_reminder = additionalFields.scheduleForReminder as boolean; - if (additionalFields.occurenceId) + } + + if (additionalFields.occurenceId) { qs.occurence_id = additionalFields.occurenceId; + } + responseData = await zoomApiRequest.call( this, 'DELETE', @@ -669,12 +677,16 @@ export class Zoom implements INodeType { 'additionalFields', i ) as IDataObject; - if (additionalFields.showPreviousOccurences) + if (additionalFields.showPreviousOccurences) { qs.show_previous_occurences = additionalFields.showPreviousOccurences as boolean; - if (additionalFields.occurenceId) + } + + if (additionalFields.occurenceId) { qs.occurence_id = additionalFields.occurenceId as string; + } + responseData = await zoomApiRequest.call( this, 'GET', @@ -705,9 +717,11 @@ export class Zoom implements INodeType { ) as IDataObject; - if (additionalFields.occurenceId) + if (additionalFields.occurenceId) { qs.occurence_id = additionalFields.occurenceId; + } + responseData = await zoomApiRequest.call( this, 'DELETE', From a6e40aaebe3cbd1b099f65ad4797cace9104ac92 Mon Sep 17 00:00:00 2001 From: shraddha shaligram Date: Tue, 23 Jun 2020 12:27:47 -0700 Subject: [PATCH 104/241] minor fix --- .../nodes-base/nodes/Zoom/GenericFunctions.ts | 16 +++++++--------- .../nodes/Zoom/MeetingRegistrantDescription.ts | 2 -- packages/nodes-base/nodes/Zoom/Zoom.node.ts | 3 +-- 3 files changed, 8 insertions(+), 13 deletions(-) diff --git a/packages/nodes-base/nodes/Zoom/GenericFunctions.ts b/packages/nodes-base/nodes/Zoom/GenericFunctions.ts index d361a9761a..d5cad39297 100644 --- a/packages/nodes-base/nodes/Zoom/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Zoom/GenericFunctions.ts @@ -1,13 +1,16 @@ -import { OptionsWithUri } from 'request'; +import { + OptionsWithUri, +} from 'request'; import { IExecuteFunctions, IExecuteSingleFunctions, - ILoadOptionsFunctions + ILoadOptionsFunctions, } from 'n8n-core'; -import { IDataObject } from 'n8n-workflow'; -import * as _ from 'lodash'; +import { + IDataObject, +} from 'n8n-workflow'; export async function zoomApiRequest(this: IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions, method: string, resource: string, body: object = {}, query: object = {}, headers: {} | undefined = undefined, option: {} = {}): Promise { // tslint:disable-line:no-any @@ -60,8 +63,6 @@ export async function zoomApiRequest(this: IExecuteFunctions | IExecuteSingleFun // If that data does not exist for some reason return the actual error throw error; } - - } @@ -75,10 +76,7 @@ export async function zoomApiRequestAllItems( ): Promise { // tslint:disable-line:no-any const returnData: IDataObject[] = []; - let responseData; - //query.maxResults = 300; - do { responseData = await zoomApiRequest.call( this, diff --git a/packages/nodes-base/nodes/Zoom/MeetingRegistrantDescription.ts b/packages/nodes-base/nodes/Zoom/MeetingRegistrantDescription.ts index 232f8cf42c..2d32c55b42 100644 --- a/packages/nodes-base/nodes/Zoom/MeetingRegistrantDescription.ts +++ b/packages/nodes-base/nodes/Zoom/MeetingRegistrantDescription.ts @@ -36,8 +36,6 @@ export const meetingRegistrantOperations = [ } ] as INodeProperties[]; - - export const meetingRegistrantFields = [ /* -------------------------------------------------------------------------- */ /* meetingRegistrants:create */ diff --git a/packages/nodes-base/nodes/Zoom/Zoom.node.ts b/packages/nodes-base/nodes/Zoom/Zoom.node.ts index 8e6eb10d2b..078da4879c 100644 --- a/packages/nodes-base/nodes/Zoom/Zoom.node.ts +++ b/packages/nodes-base/nodes/Zoom/Zoom.node.ts @@ -29,6 +29,7 @@ import { webinarOperations, webinarFields, } from './WebinarDescription'; + import * as moment from 'moment-timezone'; interface Settings { @@ -46,8 +47,6 @@ interface Settings { registration_type?: number; approval_type?: number; practice_session?: boolean; - - } export class Zoom implements INodeType { description: INodeTypeDescription = { From d41b976b3bc99daff7168db113590d47c4247f46 Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Tue, 23 Jun 2020 21:37:15 +0200 Subject: [PATCH 105/241] :zap: Remove unnecessary import --- packages/editor-ui/src/store.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages/editor-ui/src/store.ts b/packages/editor-ui/src/store.ts index b9762bb616..80454fc9e4 100644 --- a/packages/editor-ui/src/store.ts +++ b/packages/editor-ui/src/store.ts @@ -29,8 +29,6 @@ import { XYPositon, } from './Interface'; -import { get } from 'lodash'; - Vue.use(Vuex); export const store = new Vuex.Store({ From 0bdb9cecac846db285b0df768f0a8e7e4d9d43c6 Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Tue, 23 Jun 2020 22:15:07 +0200 Subject: [PATCH 106/241] :zap: Make it possible that n8n is deployed under subfolder --- packages/editor-ui/vue.config.js | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/editor-ui/vue.config.js b/packages/editor-ui/vue.config.js index f70f41c5b2..cdcd8259f9 100644 --- a/packages/editor-ui/vue.config.js +++ b/packages/editor-ui/vue.config.js @@ -29,4 +29,5 @@ module.exports = { }, }, }, + publicPath: process.env.VUE_APP_PUBLIC_PATH ? process.env.VUE_APP_PUBLIC_PATH : '/', }; From 37ff6a8f1333b74dea2548e9ca56746fddced9c1 Mon Sep 17 00:00:00 2001 From: shraddha shaligram Date: Tue, 23 Jun 2020 13:40:43 -0700 Subject: [PATCH 107/241] fix spellings --- .../nodes-base/nodes/Zoom/GenericFunctions.ts | 1 - .../nodes/Zoom/MeetingDescription.ts | 40 ++++++++--------- .../Zoom/MeetingRegistrantDescription.ts | 18 ++++---- .../nodes/Zoom/WebinarDescription.ts | 36 ++++++++-------- packages/nodes-base/nodes/Zoom/Zoom.node.ts | 43 +++++++++---------- 5 files changed, 68 insertions(+), 70 deletions(-) diff --git a/packages/nodes-base/nodes/Zoom/GenericFunctions.ts b/packages/nodes-base/nodes/Zoom/GenericFunctions.ts index d5cad39297..74b5a18d06 100644 --- a/packages/nodes-base/nodes/Zoom/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Zoom/GenericFunctions.ts @@ -46,7 +46,6 @@ export async function zoomApiRequest(this: IExecuteFunctions | IExecuteSingleFun return await this.helpers.request(options); } else { //@ts-ignore - return await this.helpers.requestOAuth2.call(this, 'zoomOAuth2Api', options); } } catch (error) { diff --git a/packages/nodes-base/nodes/Zoom/MeetingDescription.ts b/packages/nodes-base/nodes/Zoom/MeetingDescription.ts index b9a1c74cb5..4d8281660d 100644 --- a/packages/nodes-base/nodes/Zoom/MeetingDescription.ts +++ b/packages/nodes-base/nodes/Zoom/MeetingDescription.ts @@ -98,7 +98,7 @@ export const meetingFields = [ name: 'alternative_hosts', type: 'string', default: '', - description: 'Alternative hosts email ids.', + description: 'Alternative hosts email IDs.', }, { displayName: 'Auto recording', @@ -242,11 +242,11 @@ export const meetingFields = [ value: 1, }, { - name: 'Attendees need to register for every occurence', + name: 'Attendees need to register for every occurrence', value: 2, }, { - name: 'Attendees register once and can choose one or more occurences to attend', + name: 'Attendees register once and can choose one or more occurrences to attend', value: 3, }, ], @@ -326,18 +326,18 @@ export const meetingFields = [ }, options: [ { - displayName: 'Occurence Id', - name: 'occurenceId', + displayName: 'Occurrence ID', + name: 'occurrenceId', type: 'string', default: '', - description: 'To view meeting details of a particular occurence of the recurring meeting.', + description: 'To view meeting details of a particular occurrence of the recurring meeting.', }, { - displayName: 'Show Previous Occurences', - name: 'showPreviousOccurences', + displayName: 'Show Previous Occurrences', + name: 'showPreviousOccurrences', type: 'boolean', default: '', - description: 'To view meeting details of all previous occurences of the recurring meeting.', + description: 'To view meeting details of all previous occurrences of the recurring meeting.', }, ], }, @@ -360,7 +360,7 @@ export const meetingFields = [ ], }, }, - description: 'User ID or email-id.', + description: 'User ID or email-ID.', }, { displayName: 'Return All', @@ -483,11 +483,11 @@ export const meetingFields = [ }, options: [ { - displayName: 'Occurence Id', - name: 'occurenceId', + displayName: 'Occurence ID', + name: 'occurrenceId', type: 'string', default: '', - description: 'Meeting occurence Id.', + description: 'Meeting occurrence ID.', }, { displayName: 'Schedule a reminder', @@ -503,7 +503,7 @@ export const meetingFields = [ /* meeting:update */ /* -------------------------------------------------------------------------- */ { - displayName: 'Meeting Id', + displayName: 'Meeting ID', name: 'meetingId', type: 'string', default: '', @@ -630,11 +630,11 @@ export const meetingFields = [ description: 'Start video when host joins the meeting.', }, { - displayName: 'Occurence Id', - name: 'occurenceId', + displayName: 'Occurrence Id', + name: 'occurrenceId', type: 'string', default: '', - description: 'Occurence ID.', + description: 'Occurrence ID.', }, { displayName: 'Meeting topic', @@ -696,15 +696,15 @@ export const meetingFields = [ type: 'options', options: [ { - name: 'Attendees register once and can attend any of the occurences', + name: 'Attendees register once and can attend any of the occurrences', value: 1, }, { - name: 'Attendees need to register for every occurence', + name: 'Attendees need to register for every occurrence', value: 2, }, { - name: 'Attendees register once and can choose one or more occurences to attend', + name: 'Attendees register once and can choose one or more occurrences to attend', value: 3, }, ], diff --git a/packages/nodes-base/nodes/Zoom/MeetingRegistrantDescription.ts b/packages/nodes-base/nodes/Zoom/MeetingRegistrantDescription.ts index 2d32c55b42..8cef3383aa 100644 --- a/packages/nodes-base/nodes/Zoom/MeetingRegistrantDescription.ts +++ b/packages/nodes-base/nodes/Zoom/MeetingRegistrantDescription.ts @@ -155,11 +155,11 @@ export const meetingRegistrantFields = [ description: 'Last Name.', }, { - displayName: 'Occurence Ids', - name: 'occurenceId', + displayName: 'Occurrence Ids', + name: 'occurrenceId', type: 'string', default: '', - description: 'Occurence IDs separated by comma.', + description: 'Occurrence IDs separated by comma.', }, { displayName: 'Organization', @@ -328,11 +328,11 @@ export const meetingRegistrantFields = [ }, options: [ { - displayName: 'Occurence Id', - name: 'occurence_id', + displayName: 'Occurrence Id', + name: 'occurrence_id', type: 'string', default: '', - description: `Occurence Id.`, + description: `Occurrence Id.`, }, { displayName: 'Status', @@ -429,11 +429,11 @@ export const meetingRegistrantFields = [ }, options: [ { - displayName: 'Occurence Id', - name: 'occurenceId', + displayName: 'Occurrence Id', + name: 'occurrenceId', type: 'string', default: '', - description: 'Occurence ID.', + description: 'Occurrence ID.', }, ], diff --git a/packages/nodes-base/nodes/Zoom/WebinarDescription.ts b/packages/nodes-base/nodes/Zoom/WebinarDescription.ts index 4bbec11fd4..b673b77fa9 100644 --- a/packages/nodes-base/nodes/Zoom/WebinarDescription.ts +++ b/packages/nodes-base/nodes/Zoom/WebinarDescription.ts @@ -209,11 +209,11 @@ export const webinarFields = [ value: 1, }, { - name: 'Attendees need to register for every occurence', + name: 'Attendees need to register for every occurrence', value: 2, }, { - name: 'Attendees register once and can choose one or more occurences to attend', + name: 'Attendees register once and can choose one or more occurrences to attend', value: 3, }, ], @@ -312,14 +312,14 @@ export const webinarFields = [ name: 'occurenceId', type: 'string', default: '', - description: 'To view webinar details of a particular occurence of the recurring webinar.', + description: 'To view webinar details of a particular occurrence of the recurring webinar.', }, { - displayName: 'Show Previous Occurences', - name: 'showPreviousOccurences', + displayName: 'Show Previous Occurrences', + name: 'showPreviousOccurrences', type: 'boolean', default: '', - description: 'To view webinar details of all previous occurences of the recurring webinar.', + description: 'To view webinar details of all previous occurrences of the recurring webinar.', }, ], }, @@ -386,7 +386,7 @@ export const webinarFields = [ description: 'How many results to return.', }, /* -------------------------------------------------------------------------- */ - /* webina:delete */ + /* webinar:delete */ /* -------------------------------------------------------------------------- */ { displayName: 'Webinar Id', @@ -424,11 +424,11 @@ export const webinarFields = [ }, options: [ { - displayName: 'Occurence Id', - name: 'occurenceId', + displayName: 'Occurrence Id', + name: 'occurrenceId', type: 'string', default: '', - description: 'Webinar occurence Id.', + description: 'Webinar occurrence Id.', }, ], @@ -566,11 +566,11 @@ export const webinarFields = [ description: 'Start video when host joins the webinar.', }, { - displayName: 'Occurence Id', - name: 'occurence_id', + displayName: 'Occurrence Id', + name: 'occurrence_id', type: 'string', default: '', - description: `Webinar occurence Id.`, + description: `Webinar occurrence Id.`, }, { displayName: 'Password', @@ -599,27 +599,27 @@ export const webinarFields = [ type: 'options', options: [ { - name: 'Attendees register once and can attend any of the occurences', + name: 'Attendees register once and can attend any of the occurrences', value: 1, }, { - name: 'Attendees need to register for every occurence', + name: 'Attendees need to register for every occurrence', value: 2, }, { - name: 'Attendees register once and can choose one or more occurences to attend', + name: 'Attendees register once and can choose one or more occurrences to attend', value: 3, }, ], default: 1, - description: 'Registration type. Used for recurring webinars with fixed time only', + description: 'Registration type. Used for recurring webinars with fixed time only.', }, { displayName: 'Start time', name: 'startTime', type: 'dateTime', default: '', - description: 'Start time should be used only for scheduled or recurring webinar with fixed time', + description: 'Start time should be used only for scheduled or recurring webinar with fixed time.', }, { displayName: 'Timezone', diff --git a/packages/nodes-base/nodes/Zoom/Zoom.node.ts b/packages/nodes-base/nodes/Zoom/Zoom.node.ts index 078da4879c..9e0cf88889 100644 --- a/packages/nodes-base/nodes/Zoom/Zoom.node.ts +++ b/packages/nodes-base/nodes/Zoom/Zoom.node.ts @@ -177,18 +177,17 @@ export class Zoom implements INodeType { if (operation === 'get') { //https://marketplace.zoom.us/docs/api-reference/zoom-api/meetings/meeting const meetingId = this.getNodeParameter('meetingId', i) as string; - const additionalFields = this.getNodeParameter( 'additionalFields', i ) as IDataObject; - if (additionalFields.showPreviousOccurences) { - qs.show_previous_occurences = additionalFields.showPreviousOccurences as boolean; + if (additionalFields.showPreviousOccurrences) { + qs.show_previous_occurrences = additionalFields.showPreviousOccurrences as boolean; } - if (additionalFields.occurenceId) { - qs.occurence_id = additionalFields.occurenceId as string; + if (additionalFields.occurrenceId) { + qs.occurrence_id = additionalFields.occurrenceId as string; } @@ -226,8 +225,8 @@ export class Zoom implements INodeType { } - if (additionalFields.occurenceId) { - qs.occurence_id = additionalFields.occurenceId; + if (additionalFields.occurrenceId) { + qs.occurrence_id = additionalFields.occurrenceId; } @@ -363,8 +362,8 @@ export class Zoom implements INodeType { i ) as IDataObject; - if (additionalFields.occurenceId) { - qs.occurence_id = additionalFields.occurenceId as string; + if (additionalFields.occurrenceId) { + qs.occurrence_id = additionalFields.occurrenceId as string; } if (additionalFields.cn_meeting) { @@ -488,8 +487,8 @@ export class Zoom implements INodeType { 'additionalFields', i ) as IDataObject; - if (additionalFields.occurenceId) { - qs.occurence_ids = additionalFields.occurenceId as string; + if (additionalFields.occurrenceId) { + qs.occurrence_ids = additionalFields.occurrenceId as string; } if (additionalFields.lastName) { body.last_name = additionalFields.lastName as string; @@ -542,8 +541,8 @@ export class Zoom implements INodeType { 'additionalFields', i ) as IDataObject; - if (additionalFields.occurenceId) { - qs.occurence_id = additionalFields.occurenceId as string; + if (additionalFields.occurrenceId) { + qs.occurrence_id = additionalFields.occurrenceId as string; } if (additionalFields.status) { qs.status = additionalFields.status as string; @@ -567,7 +566,7 @@ export class Zoom implements INodeType { i ) as IDataObject; if (additionalFields.occurenceId) { - qs.occurence_id = additionalFields.occurenceId as string; + qs.occurrence_id = additionalFields.occurrenceId as string; } responseData = await zoomApiRequest.call( this, @@ -676,13 +675,13 @@ export class Zoom implements INodeType { 'additionalFields', i ) as IDataObject; - if (additionalFields.showPreviousOccurences) { - qs.show_previous_occurences = additionalFields.showPreviousOccurences as boolean; + if (additionalFields.showPreviousOccurrences) { + qs.show_previous_occurrences = additionalFields.showPreviousOccurrences as boolean; } - if (additionalFields.occurenceId) { - qs.occurence_id = additionalFields.occurenceId as string; + if (additionalFields.occurrenceId) { + qs.occurrence_id = additionalFields.occurrenceId as string; } @@ -716,8 +715,8 @@ export class Zoom implements INodeType { ) as IDataObject; - if (additionalFields.occurenceId) { - qs.occurence_id = additionalFields.occurenceId; + if (additionalFields.occurrenceId) { + qs.occurrence_id = additionalFields.occurrenceId; } @@ -737,8 +736,8 @@ export class Zoom implements INodeType { 'additionalFields', i ) as IDataObject; - if (additionalFields.occurence_id) { - qs.occurence_id = additionalFields.occurence_id as string; + if (additionalFields.occurrence_id) { + qs.occurrence_id = additionalFields.occurrence_id as string; } const settings: Settings = {}; From 83828a19abda3945196523fc698812d2bfa9bd02 Mon Sep 17 00:00:00 2001 From: shraddha shaligram Date: Tue, 23 Jun 2020 14:26:00 -0700 Subject: [PATCH 108/241] follow codebase conventions --- .../nodes-base/nodes/Zoom/GenericFunctions.ts | 1 - .../nodes/Zoom/MeetingDescription.ts | 16 +++++------ .../Zoom/MeetingRegistrantDescription.ts | 12 ++++---- .../nodes/Zoom/WebinarDescription.ts | 28 +++++++++---------- packages/nodes-base/nodes/Zoom/Zoom.node.ts | 8 +++--- 5 files changed, 32 insertions(+), 33 deletions(-) diff --git a/packages/nodes-base/nodes/Zoom/GenericFunctions.ts b/packages/nodes-base/nodes/Zoom/GenericFunctions.ts index 74b5a18d06..500b0a64d9 100644 --- a/packages/nodes-base/nodes/Zoom/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Zoom/GenericFunctions.ts @@ -14,7 +14,6 @@ import { export async function zoomApiRequest(this: IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions, method: string, resource: string, body: object = {}, query: object = {}, headers: {} | undefined = undefined, option: {} = {}): Promise { // tslint:disable-line:no-any - // tslint:disable-line:no-any const authenticationMethod = this.getNodeParameter('authentication', 0, 'accessToken') as string; let options: OptionsWithUri = { diff --git a/packages/nodes-base/nodes/Zoom/MeetingDescription.ts b/packages/nodes-base/nodes/Zoom/MeetingDescription.ts index 4d8281660d..829418d12b 100644 --- a/packages/nodes-base/nodes/Zoom/MeetingDescription.ts +++ b/packages/nodes-base/nodes/Zoom/MeetingDescription.ts @@ -51,7 +51,7 @@ export const meetingFields = [ /* meeting:create */ /* -------------------------------------------------------------------------- */ { - displayName: 'User Id', + displayName: 'User ID', name: 'userId', type: 'string', default: '', @@ -258,7 +258,7 @@ export const meetingFields = [ name: 'scheduleFor', type: 'string', default: '', - description: 'Schedule meeting for someone else from your account, provide their email id.', + description: 'Schedule meeting for someone else from your account, provide their email ID.', }, { displayName: 'Start time', @@ -290,7 +290,7 @@ export const meetingFields = [ /* meeting:get */ /* -------------------------------------------------------------------------- */ { - displayName: 'Meeting Id', + displayName: 'Meeting ID', name: 'meetingId', type: 'string', default: '', @@ -345,7 +345,7 @@ export const meetingFields = [ /* meeting:getAll */ /* -------------------------------------------------------------------------- */ { - displayName: 'User Id', + displayName: 'User ID', name: 'userId', type: 'string', default: '', @@ -448,7 +448,7 @@ export const meetingFields = [ /* meeting:delete */ /* -------------------------------------------------------------------------- */ { - displayName: 'Meeting Id', + displayName: 'Meeting ID', name: 'meetingId', type: 'string', default: '', @@ -549,7 +549,7 @@ export const meetingFields = [ name: 'alternative_hosts', type: 'string', default: '', - description: 'Alternative hosts email ids.', + description: 'Alternative hosts email IDs.', }, { displayName: 'Audio', @@ -630,7 +630,7 @@ export const meetingFields = [ description: 'Start video when host joins the meeting.', }, { - displayName: 'Occurrence Id', + displayName: 'Occurrence ID', name: 'occurrenceId', type: 'string', default: '', @@ -716,7 +716,7 @@ export const meetingFields = [ name: 'scheduleFor', type: 'string', default: '', - description: 'Schedule meeting for someone else from your account, provide their email id.', + description: 'Schedule meeting for someone else from your account, provide their email ID.', }, { displayName: 'Start time', diff --git a/packages/nodes-base/nodes/Zoom/MeetingRegistrantDescription.ts b/packages/nodes-base/nodes/Zoom/MeetingRegistrantDescription.ts index 8cef3383aa..b9a5147364 100644 --- a/packages/nodes-base/nodes/Zoom/MeetingRegistrantDescription.ts +++ b/packages/nodes-base/nodes/Zoom/MeetingRegistrantDescription.ts @@ -155,7 +155,7 @@ export const meetingRegistrantFields = [ description: 'Last Name.', }, { - displayName: 'Occurrence Ids', + displayName: 'Occurrence IDs', name: 'occurrenceId', type: 'string', default: '', @@ -251,7 +251,7 @@ export const meetingRegistrantFields = [ /* meetingRegistrants:getAll */ /* -------------------------------------------------------------------------- */ { - displayName: 'Meeting Id', + displayName: 'Meeting ID', name: 'meetingId', type: 'string', default: '', @@ -328,11 +328,11 @@ export const meetingRegistrantFields = [ }, options: [ { - displayName: 'Occurrence Id', + displayName: 'Occurrence ID', name: 'occurrence_id', type: 'string', default: '', - description: `Occurrence Id.`, + description: `Occurrence ID.`, }, { displayName: 'Status', @@ -362,7 +362,7 @@ export const meetingRegistrantFields = [ /* meetingRegistrants:update */ /* -------------------------------------------------------------------------- */ { - displayName: 'Meeting Id', + displayName: 'Meeting ID', name: 'meetingId', type: 'string', default: '', @@ -429,7 +429,7 @@ export const meetingRegistrantFields = [ }, options: [ { - displayName: 'Occurrence Id', + displayName: 'Occurrence ID', name: 'occurrenceId', type: 'string', default: '', diff --git a/packages/nodes-base/nodes/Zoom/WebinarDescription.ts b/packages/nodes-base/nodes/Zoom/WebinarDescription.ts index b673b77fa9..19796ea51a 100644 --- a/packages/nodes-base/nodes/Zoom/WebinarDescription.ts +++ b/packages/nodes-base/nodes/Zoom/WebinarDescription.ts @@ -51,7 +51,7 @@ export const webinarFields = [ /* webinar:create */ /* -------------------------------------------------------------------------- */ { - displayName: 'User Id', + displayName: 'User ID', name: 'userId', type: 'string', default: '', @@ -98,7 +98,7 @@ export const webinarFields = [ name: 'alternative_hosts', type: 'string', default: '', - description: 'Alternative hosts email ids.', + description: 'Alternative hosts email IDs.', }, { displayName: 'Approval type', @@ -272,7 +272,7 @@ export const webinarFields = [ /* webinar:get */ /* -------------------------------------------------------------------------- */ { - displayName: 'Webinar Id', + displayName: 'Webinar ID', name: 'webinarId', type: 'string', default: '', @@ -308,7 +308,7 @@ export const webinarFields = [ }, options: [ { - displayName: 'Occurence Id', + displayName: 'Occurence ID', name: 'occurenceId', type: 'string', default: '', @@ -327,7 +327,7 @@ export const webinarFields = [ /* webinar:getAll */ /* -------------------------------------------------------------------------- */ { - displayName: 'User Id', + displayName: 'User ID', name: 'userId', type: 'string', default: '', @@ -342,7 +342,7 @@ export const webinarFields = [ ], }, }, - description: 'User ID or email-id.', + description: 'User ID or email-ID.', }, { displayName: 'Return All', @@ -389,7 +389,7 @@ export const webinarFields = [ /* webinar:delete */ /* -------------------------------------------------------------------------- */ { - displayName: 'Webinar Id', + displayName: 'Webinar ID', name: 'webinarId', type: 'string', default: '', @@ -404,7 +404,7 @@ export const webinarFields = [ ], }, }, - description: 'WebinarId ID.', + description: 'Webinar ID.', }, { displayName: 'Additional Fields', @@ -424,11 +424,11 @@ export const webinarFields = [ }, options: [ { - displayName: 'Occurrence Id', + displayName: 'Occurrence ID', name: 'occurrenceId', type: 'string', default: '', - description: 'Webinar occurrence Id.', + description: 'Webinar occurrence ID.', }, ], @@ -438,7 +438,7 @@ export const webinarFields = [ /* webinar:update */ /* -------------------------------------------------------------------------- */ { - displayName: 'User Id', + displayName: 'User ID', name: 'userId', type: 'string', default: '', @@ -485,7 +485,7 @@ export const webinarFields = [ name: 'alternative_hosts', type: 'string', default: '', - description: 'Alternative hosts email ids.', + description: 'Alternative hosts email IDs.', }, { displayName: 'Approval type', @@ -566,11 +566,11 @@ export const webinarFields = [ description: 'Start video when host joins the webinar.', }, { - displayName: 'Occurrence Id', + displayName: 'Occurrence ID', name: 'occurrence_id', type: 'string', default: '', - description: `Webinar occurrence Id.`, + description: `Webinar occurrence ID.`, }, { displayName: 'Password', diff --git a/packages/nodes-base/nodes/Zoom/Zoom.node.ts b/packages/nodes-base/nodes/Zoom/Zoom.node.ts index 9e0cf88889..56901ac2ce 100644 --- a/packages/nodes-base/nodes/Zoom/Zoom.node.ts +++ b/packages/nodes-base/nodes/Zoom/Zoom.node.ts @@ -163,13 +163,13 @@ export class Zoom implements INodeType { async execute(this: IExecuteFunctions): Promise { const items = this.getInputData(); const returnData: IDataObject[] = []; - const length = (items.length as unknown) as number; - let qs: IDataObject; + let qs: IDataObject = {}; + let body: IDataObject = {}; let responseData; const resource = this.getNodeParameter('resource', 0) as string; const operation = this.getNodeParameter('operation', 0) as string; - let body: IDataObject = {}; - for (let i = 0; i < length; i++) { + + for (let i = 0; i < items.length; i++) { qs = {}; //https://marketplace.zoom.us/docs/api-reference/zoom-api/ if (resource === 'meeting') { From 69a1f8af00f6bd64795c709fd25e407cfc28c0e5 Mon Sep 17 00:00:00 2001 From: shraddha shaligram Date: Tue, 23 Jun 2020 20:29:47 -0700 Subject: [PATCH 109/241] fix pagination --- .../credentials/ZoomOAuth2Api.credentials.ts | 16 ++++---------- .../nodes-base/nodes/Zoom/GenericFunctions.ts | 18 ++++++++++----- .../nodes/Zoom/MeetingDescription.ts | 22 +++++++++---------- .../Zoom/MeetingRegistrantDescription.ts | 16 +++++++------- .../nodes/Zoom/WebinarDescription.ts | 14 ++++++------ packages/nodes-base/nodes/Zoom/Zoom.node.ts | 16 ++++++++++---- 6 files changed, 55 insertions(+), 47 deletions(-) diff --git a/packages/nodes-base/credentials/ZoomOAuth2Api.credentials.ts b/packages/nodes-base/credentials/ZoomOAuth2Api.credentials.ts index c00c694661..f85cc75254 100644 --- a/packages/nodes-base/credentials/ZoomOAuth2Api.credentials.ts +++ b/packages/nodes-base/credentials/ZoomOAuth2Api.credentials.ts @@ -1,14 +1,7 @@ -import { ICredentialType, NodePropertyTypes } from 'n8n-workflow'; - -const userScopes = [ - 'meeting:read', - 'meeting:write', - 'user:read', - 'user:write', - 'user_profile', - 'webinar:read', - 'webinar:write' -]; +import { + ICredentialType, + NodePropertyTypes, +} from 'n8n-workflow'; export class ZoomOAuth2Api implements ICredentialType { name = 'zoomOAuth2Api'; @@ -27,7 +20,6 @@ export class ZoomOAuth2Api implements ICredentialType { type: 'hidden' as NodePropertyTypes, default: 'https://zoom.us/oauth/token' }, - { displayName: 'Scope', name: 'scope', diff --git a/packages/nodes-base/nodes/Zoom/GenericFunctions.ts b/packages/nodes-base/nodes/Zoom/GenericFunctions.ts index 500b0a64d9..6a8593e3ab 100644 --- a/packages/nodes-base/nodes/Zoom/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Zoom/GenericFunctions.ts @@ -75,6 +75,7 @@ export async function zoomApiRequestAllItems( // tslint:disable-line:no-any const returnData: IDataObject[] = []; let responseData; + query.page_number = 0; do { responseData = await zoomApiRequest.call( this, @@ -83,14 +84,21 @@ export async function zoomApiRequestAllItems( body, query ); - query.page_number = responseData['page_number']; + query.page_number++; returnData.push.apply(returnData, responseData[propertyName]); + // zoom free plan rate limit is 1 request/second + // TODO just wait when the plan is free + await wait(); } while ( - responseData['page_number'] !== undefined && - responseData['page_number'] !== '' + responseData.page_count !== responseData.page_number ); return returnData; } - - +function wait() { + return new Promise((resolve, reject) => { + setTimeout(() => { + resolve(true); + }, 1000); + }); +} diff --git a/packages/nodes-base/nodes/Zoom/MeetingDescription.ts b/packages/nodes-base/nodes/Zoom/MeetingDescription.ts index 829418d12b..5a8a5966a9 100644 --- a/packages/nodes-base/nodes/Zoom/MeetingDescription.ts +++ b/packages/nodes-base/nodes/Zoom/MeetingDescription.ts @@ -39,7 +39,7 @@ export const meetingOperations = [ name: 'Update', value: 'update', description: 'Update a meeting', - } + }, ], default: 'create', description: 'The operation to perform.', @@ -69,7 +69,7 @@ export const meetingFields = [ description: 'User ID or email address of user.', }, { - displayName: 'Additional settings', + displayName: 'Additional fields', name: 'additionalFields', type: 'collection', placeholder: 'Add Field', @@ -83,7 +83,7 @@ export const meetingFields = [ resource: [ 'meeting', ], - } + }, }, options: [ { @@ -209,7 +209,7 @@ export const meetingFields = [ ], default: 2, - description: 'Meeting type.' + description: 'Meeting type.', }, { displayName: 'Muting before entry', @@ -219,7 +219,7 @@ export const meetingFields = [ description: 'Mute participants upon entry.', }, { - displayName: 'Participant Video', + displayName: 'Participant video', name: 'participant_video', type: 'boolean', default: false, @@ -308,7 +308,7 @@ export const meetingFields = [ description: 'Meeting ID.', }, { - displayName: 'Additional settings', + displayName: 'Additional fields', name: 'additionalFields', type: 'collection', placeholder: 'Add Field', @@ -398,13 +398,13 @@ export const meetingFields = [ }, typeOptions: { minValue: 1, - maxValue: 300 + maxValue: 300, }, default: 30, description: 'How many results to return.', }, { - displayName: 'Additional settings', + displayName: 'Additional fields', name: 'additionalFields', type: 'collection', placeholder: 'Add Field', @@ -456,7 +456,7 @@ export const meetingFields = [ displayOptions: { show: { operation: [ - 'delete' + 'delete', ], resource: [ 'meeting', @@ -521,7 +521,7 @@ export const meetingFields = [ description: 'Meeting ID.', }, { - displayName: 'Additional settings', + displayName: 'Additional fields', name: 'additionalFields', type: 'collection', placeholder: 'Add Field', @@ -667,7 +667,7 @@ export const meetingFields = [ ], default: 2, - description: 'Meeting type.' + description: 'Meeting type.', }, { displayName: 'Muting before entry', diff --git a/packages/nodes-base/nodes/Zoom/MeetingRegistrantDescription.ts b/packages/nodes-base/nodes/Zoom/MeetingRegistrantDescription.ts index b9a5147364..b7e5271f55 100644 --- a/packages/nodes-base/nodes/Zoom/MeetingRegistrantDescription.ts +++ b/packages/nodes-base/nodes/Zoom/MeetingRegistrantDescription.ts @@ -95,7 +95,7 @@ export const meetingRegistrantFields = [ description: 'First Name.', }, { - displayName: 'Additional settings', + displayName: 'Additional fields', name: 'additionalFields', type: 'collection', placeholder: 'Add Field', @@ -109,7 +109,7 @@ export const meetingRegistrantFields = [ resource: [ 'meetingRegistrants', ], - } + }, }, options: [ { @@ -202,7 +202,7 @@ export const meetingRegistrantFields = [ }, ], default: '', - description: 'Meeting type.' + description: 'Meeting type.', }, { displayName: 'Role in purchase process', @@ -228,7 +228,7 @@ export const meetingRegistrantFields = [ ], default: '', - description: 'Role in purchase process.' + description: 'Role in purchase process.', }, { displayName: 'State', @@ -304,13 +304,13 @@ export const meetingRegistrantFields = [ }, typeOptions: { minValue: 1, - maxValue: 300 + maxValue: 300, }, default: 30, description: 'How many results to return.', }, { - displayName: 'Additional settings', + displayName: 'Additional fields', name: 'additionalFields', type: 'collection', placeholder: 'Add Field', @@ -324,7 +324,7 @@ export const meetingRegistrantFields = [ resource: [ 'meetingRegistrants', ], - } + }, }, options: [ { @@ -412,7 +412,7 @@ export const meetingRegistrantFields = [ description: `Registrant Status.`, }, { - displayName: 'Additional settings', + displayName: 'Additional fields', name: 'additionalFields', type: 'collection', placeholder: 'Add Field', diff --git a/packages/nodes-base/nodes/Zoom/WebinarDescription.ts b/packages/nodes-base/nodes/Zoom/WebinarDescription.ts index 19796ea51a..228cf9f1ae 100644 --- a/packages/nodes-base/nodes/Zoom/WebinarDescription.ts +++ b/packages/nodes-base/nodes/Zoom/WebinarDescription.ts @@ -69,7 +69,7 @@ export const webinarFields = [ description: 'User ID or email address of user.', }, { - displayName: 'Additional settings', + displayName: 'Additional fields', name: 'additionalFields', type: 'collection', placeholder: 'Add Field', @@ -263,7 +263,7 @@ export const webinarFields = [ }, ], default: 5, - description: 'Webinar type.' + description: 'Webinar type.', }, ], @@ -290,7 +290,7 @@ export const webinarFields = [ description: 'Webinar ID.', }, { - displayName: 'Additional settings', + displayName: 'Additional fields', name: 'additionalFields', type: 'collection', placeholder: 'Add Field', @@ -380,7 +380,7 @@ export const webinarFields = [ }, typeOptions: { minValue: 1, - maxValue: 300 + maxValue: 300, }, default: 30, description: 'How many results to return.', @@ -397,7 +397,7 @@ export const webinarFields = [ displayOptions: { show: { operation: [ - 'delete' + 'delete', ], resource: [ 'webinarId', @@ -456,7 +456,7 @@ export const webinarFields = [ description: 'User ID or email address of user.', }, { - displayName: 'Additional settings', + displayName: 'Additional fields', name: 'additionalFields', type: 'collection', placeholder: 'Add Field', @@ -470,7 +470,7 @@ export const webinarFields = [ resource: [ 'webinar', ], - } + }, }, options: [ { diff --git a/packages/nodes-base/nodes/Zoom/Zoom.node.ts b/packages/nodes-base/nodes/Zoom/Zoom.node.ts index 56901ac2ce..18e3614cc4 100644 --- a/packages/nodes-base/nodes/Zoom/Zoom.node.ts +++ b/packages/nodes-base/nodes/Zoom/Zoom.node.ts @@ -203,13 +203,21 @@ export class Zoom implements INodeType { //https://marketplace.zoom.us/docs/api-reference/zoom-api/meetings/meetings const userId = this.getNodeParameter('userId', i) as string; const returnAll = this.getNodeParameter('returnAll', i) as boolean; + + const additionalFields = this.getNodeParameter( + 'additionalFields', + i + ) as IDataObject; + if (additionalFields.type) { + qs.type = additionalFields.type as string; + + } if (returnAll) { - responseData = await zoomApiRequestAllItems.call(this, 'results', 'GET', `/users/${userId}/meetings`, {}, qs); + responseData = await zoomApiRequestAllItems.call(this, 'meetings', 'GET', `/users/${userId}/meetings`, {}, qs); } else { - const limit = this.getNodeParameter('limit', i) as number; - qs.page_size = limit; + qs.page_size = this.getNodeParameter('limit', i) as number;; responseData = await zoomApiRequest.call(this, 'GET', `/users/${userId}/meetings`, {}, qs); - responseData = responseData.results; + } } From 5d98f5673f7d7637b3944dd63135853b6bd91ddc Mon Sep 17 00:00:00 2001 From: shraddha shaligram Date: Tue, 23 Jun 2020 20:53:49 -0700 Subject: [PATCH 110/241] fix specific results for registrants --- packages/nodes-base/nodes/Zoom/Zoom.node.ts | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/packages/nodes-base/nodes/Zoom/Zoom.node.ts b/packages/nodes-base/nodes/Zoom/Zoom.node.ts index 18e3614cc4..f33a2a338e 100644 --- a/packages/nodes-base/nodes/Zoom/Zoom.node.ts +++ b/packages/nodes-base/nodes/Zoom/Zoom.node.ts @@ -215,7 +215,7 @@ export class Zoom implements INodeType { if (returnAll) { responseData = await zoomApiRequestAllItems.call(this, 'meetings', 'GET', `/users/${userId}/meetings`, {}, qs); } else { - qs.page_size = this.getNodeParameter('limit', i) as number;; + qs.page_size = this.getNodeParameter('limit', i) as number; responseData = await zoomApiRequest.call(this, 'GET', `/users/${userId}/meetings`, {}, qs); } @@ -559,10 +559,9 @@ export class Zoom implements INodeType { if (returnAll) { responseData = await zoomApiRequestAllItems.call(this, 'results', 'GET', `/meetings/${meetingId}/registrants`, {}, qs); } else { - const limit = this.getNodeParameter('limit', i) as number; - qs.page_size = limit; + qs.page_size = this.getNodeParameter('limit', i) as number; responseData = await zoomApiRequest.call(this, 'GET', `/meetings/${meetingId}/registrants`, {}, qs); - responseData = responseData.results; + } } @@ -708,10 +707,9 @@ export class Zoom implements INodeType { if (returnAll) { responseData = await zoomApiRequestAllItems.call(this, 'results', 'GET', `/users/${userId}/webinars`, {}, qs); } else { - const limit = this.getNodeParameter('limit', i) as number; - qs.page_size = limit; + qs.page_size = this.getNodeParameter('limit', i) as number; responseData = await zoomApiRequest.call(this, 'GET', `/users/${userId}/webinars`, {}, qs); - responseData = responseData.results; + } } if (operation === 'delete') { From 8f75087f8c454cb07f906feeabec47ae69ccb9c0 Mon Sep 17 00:00:00 2001 From: Ron <43244104+rons4@users.noreply.github.com> Date: Wed, 24 Jun 2020 08:45:39 +0200 Subject: [PATCH 111/241] Fixed some old debug output. --- packages/nodes-base/nodes/SIGNL4/GenericFunctions.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages/nodes-base/nodes/SIGNL4/GenericFunctions.ts b/packages/nodes-base/nodes/SIGNL4/GenericFunctions.ts index 525a0b1ef9..e04e3b8393 100644 --- a/packages/nodes-base/nodes/SIGNL4/GenericFunctions.ts +++ b/packages/nodes-base/nodes/SIGNL4/GenericFunctions.ts @@ -36,8 +36,6 @@ export async function SIGNL4ApiRequest(this: IHookFunctions | IExecuteFunctions, } catch (error) { - throw new Error(`I am behind. Status: ${JSON.stringify(teamsecret)}`); - if (error && error.message) { throw new Error(`Error sending the SIGNL4 request. Error: ${JSON.stringify(error.message)}`); } From 81ef9c6801892ed7c0bed6fd463467c75d38cbef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Ovejero?= Date: Fri, 12 Jun 2020 17:23:36 -0300 Subject: [PATCH 112/241] :sparkles: Hacker News node --- .../nodes/HackerNews/GenericFunctions.ts | 69 ++++ .../nodes/HackerNews/HackerNews.node.ts | 357 ++++++++++++++++++ .../nodes/HackerNews/hackernews.png | Bin 0 -> 1952 bytes packages/nodes-base/package.json | 1 + 4 files changed, 427 insertions(+) create mode 100644 packages/nodes-base/nodes/HackerNews/GenericFunctions.ts create mode 100644 packages/nodes-base/nodes/HackerNews/HackerNews.node.ts create mode 100644 packages/nodes-base/nodes/HackerNews/hackernews.png diff --git a/packages/nodes-base/nodes/HackerNews/GenericFunctions.ts b/packages/nodes-base/nodes/HackerNews/GenericFunctions.ts new file mode 100644 index 0000000000..56f6d8aef6 --- /dev/null +++ b/packages/nodes-base/nodes/HackerNews/GenericFunctions.ts @@ -0,0 +1,69 @@ +import { + IExecuteFunctions, + IHookFunctions, +} from 'n8n-core'; + +import { + IDataObject, ILoadOptionsFunctions, +} from 'n8n-workflow'; + +import { + OptionsWithUri +} from 'request'; + + +/** + * Make an API request to HackerNews + * + * @param {IHookFunctions} this + * @param {string} method + * @param {string} endpoint + * @param {IDataObject} qs + * @returns {Promise} + */ +export async function hackerNewsApiRequest(this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions, method: string, endpoint: string, qs: IDataObject): Promise { // tslint:disable-line:no-any + const options: OptionsWithUri = { + method: method, + qs, + uri: `http://hn.algolia.com/api/v1/${endpoint}`, + json: true, + }; + + return await this.helpers.request!(options); +} + + +/** + * Make an API request to HackerNews + * and return all results + * + * @export + * @param {(IHookFunctions | IExecuteFunctions)} this + * @param {string} method + * @param {string} endpoint + * @param {IDataObject} qs + * @returns {Promise} + */ +export async function hackerNewsApiRequestAllItems(this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions, method: string, endpoint: string, qs: IDataObject): Promise { // tslint:disable-line:no-any + + qs.hitsPerPage = 100; + + const returnData: IDataObject[] = []; + + let responseData; + let itemsReceived = 0; + + do { + responseData = await hackerNewsApiRequest.call(this, method, endpoint, qs); + returnData.push.apply(returnData, responseData.hits); + + if (returnData !== undefined) { + itemsReceived += returnData.length; + } + + } while ( + responseData.nbHits > itemsReceived + ); + + return returnData; +} diff --git a/packages/nodes-base/nodes/HackerNews/HackerNews.node.ts b/packages/nodes-base/nodes/HackerNews/HackerNews.node.ts new file mode 100644 index 0000000000..91edf0679d --- /dev/null +++ b/packages/nodes-base/nodes/HackerNews/HackerNews.node.ts @@ -0,0 +1,357 @@ +import { + IExecuteFunctions +} from 'n8n-core'; + +import { + INodeExecutionData, + INodeType, + INodeTypeDescription, + IDataObject, +} from 'n8n-workflow'; + +import { + hackerNewsApiRequest, + hackerNewsApiRequestAllItems +} from './GenericFunctions'; + +export class HackerNews implements INodeType { + description: INodeTypeDescription = { + displayName: 'Hacker News', + name: 'hackerNews', + icon: 'file:hackernews.png', + group: ['transform'], + version: 1, + subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}', + description: 'Consume Hacker News API', + defaults: { + name: 'Hacker News', + color: '#ff6600', + }, + inputs: ['main'], + outputs: ['main'], + properties: [ + // ---------------------------------- + // Resources + // ---------------------------------- + { + displayName: 'Resource', + name: 'resource', + type: 'options', + options: [ + { + name: 'Article', + value: 'article' + }, + { + name: 'User', + value: 'user' + } + ], + default: 'article', + description: 'Resource to consume.', + }, + // ---------------------------------- + // Operations + // ---------------------------------- + { + displayName: 'Operation', + name: 'operation', + type: 'options', + displayOptions: { + show: { + resource: [ + 'article' + ], + }, + }, + options: [ + { + name: 'Get', + value: 'get', + description: 'Get a Hacker News article', + }, + { + name: 'Get All', + value: 'getAll', + description: 'Get all Hacker News articles', + } + ], + default: 'get', + description: 'Operation to perform.', + }, + { + displayName: 'Operation', + name: 'operation', + type: 'options', + displayOptions: { + show: { + resource: [ + 'user' + ], + }, + }, + options: [ + { + name: 'Get', + value: 'get', + description: 'Get a Hacker News user', + } + ], + default: 'get', + description: 'Operation to perform.', + }, + // ---------------------------------- + // Fields + // ---------------------------------- + { + displayName: 'Article ID', + name: 'articleId', + type: 'string', + required: true, + default: '', + description: 'The ID of the Hacker News article to be returned', + displayOptions: { + show: { + resource: [ + 'article' + ], + operation: [ + 'get' + ], + }, + }, + }, + { + displayName: 'Username', + name: 'username', + type: 'string', + required: true, + default: '', + description: 'The Hacker News user to be returned', + displayOptions: { + show: { + resource: [ + 'user' + ], + operation: [ + 'get' + ], + }, + }, + }, + { + displayName: 'Return All', + name: 'returnAll', + type: 'boolean', + default: false, + description: 'Whether to return all results for the query or only up to a limit.', + displayOptions: { + show: { + resource: [ + 'article' + ], + operation: [ + 'getAll' + ], + }, + }, + }, + { + displayName: 'Limit', + name: 'limit', + type: 'number', + default: 5, + description: 'Limit of Hacker News articles to be returned for the query.', + displayOptions: { + show: { + resource: [ + 'article' + ], + operation: [ + 'getAll' + ], + returnAll: [ + false + ], + }, + }, + }, + { + displayName: 'Additional Fields', + name: 'additionalFields', + type: 'collection', + placeholder: 'Add Field', + default: {}, + displayOptions: { + show: { + resource: [ + 'article' + ], + operation: [ + 'get' + ], + }, + }, + options: [ + { + displayName: 'Include comments', + name: 'includeComments', + type: 'boolean', + default: false, + description: 'Whether to include all the comments in a Hacker News article.' + }, + ] + }, + { + displayName: 'Additional Fields', + name: 'additionalFields', + type: 'collection', + placeholder: 'Add Field', + default: {}, + displayOptions: { + show: { + resource: [ + 'article' + ], + operation: [ + 'getAll' + ], + }, + }, + options: [ + { + displayName: 'Keyword', + name: 'keyword', + type: 'string', + default: '', + description: 'The keyword for filtering the results of the query.', + }, + { + displayName: 'Tags', + name: 'tags', + type: 'multiOptions', + options: [ + { + name: 'Story', + value: 'story', + description: 'Returns query results filtered by story tag', + }, + { + name: 'Comment', + value: 'comment', + description: 'Returns query results filtered by comment tag', + }, + { + name: 'Poll', + value: 'poll', + description: 'Returns query results filtered by poll tag', + }, + { + name: 'Show HN', + value: 'show_hn', // snake case per HN tags + description: 'Returns query results filtered by Show HN tag', + }, + { + name: 'Ask HN', + value: 'ask_hn', // snake case per HN tags + description: 'Returns query results filtered by Ask HN tag', + }, + { + name: 'Front Page', + value: 'front_page', // snake case per HN tags + description: 'Returns query results filtered by Front Page tag', + } + ], + default: '', + description: 'Tags for filtering the results of the query.', + } + ] + } + ] + }; + + + async execute(this: IExecuteFunctions): Promise { + const items = this.getInputData(); + const returnData: IDataObject[] = []; + + const resource = this.getNodeParameter('resource', 0) as string; + const operation = this.getNodeParameter('operation', 0) as string; + let returnAll = false; + + for (let i = 0; i < items.length; i++) { + + let qs: IDataObject = {}; + let endpoint = ''; + let includeComments = false; + + if (resource === 'article') { + + if (operation === 'get') { + + endpoint = `items/${this.getNodeParameter('articleId', i)}`; + const additionalFields = this.getNodeParameter('additionalFields', i) as IDataObject; + includeComments = additionalFields.includeComments as boolean; + + } else if (operation === 'getAll') { + + const additionalFields = this.getNodeParameter('additionalFields', i) as IDataObject; + const keyword = additionalFields.keyword as string; + const tags = additionalFields.tags as string[]; + + qs = { + query: keyword, + tags: tags ? tags.join() : '', + }; + + returnAll = this.getNodeParameter('returnAll', i) as boolean; + + if (!returnAll) { + qs.hitsPerPage = this.getNodeParameter('limit', i) as number; + } + + endpoint = 'search?'; + + } else { + throw new Error(`The operation '${operation}' is unknown!`); + } + + } else if (resource === 'user') { + + if (operation === 'get') { + endpoint = `users/${this.getNodeParameter('username', i)}`; + + } else { + throw new Error(`The operation '${operation}' is unknown!`); + } + + } else { + throw new Error(`The resource '${resource}' is unknown!`); + } + + + let responseData; + if (returnAll === true) { + responseData = await hackerNewsApiRequestAllItems.call(this, 'GET', endpoint, qs); + } else { + responseData = await hackerNewsApiRequest.call(this, 'GET', endpoint, qs); + if (resource === 'article' && operation === 'getAll') + responseData = responseData.hits; + } + + if (resource === 'article' && operation === 'get' && !includeComments) { + delete responseData.children; + } + + if (Array.isArray(responseData)) { + returnData.push.apply(returnData, responseData as IDataObject[]); + } else { + returnData.push(responseData as IDataObject); + } + + } + + return [this.helpers.returnJsonArray(returnData)]; + + } +} diff --git a/packages/nodes-base/nodes/HackerNews/hackernews.png b/packages/nodes-base/nodes/HackerNews/hackernews.png new file mode 100644 index 0000000000000000000000000000000000000000..67ba3047ff3d07ec99bd35a2124161d8779cbb0f GIT binary patch literal 1952 zcmcgrX;f3m622?~23dy1u;_@03>aYof-0>ydUrHtJ8JrRQ30LU0tVJ;N`hp zjbuQ=Fied>clIXYmPJ=lSgaVEI}$-L*ooEH787{3! zg&cVpV~#{a;AIicRe@2)aJ(DFt^?Jl(A+dU>j3VCAp~HI84wMEKd!(-%7||WM_$1= z3amZ_XM`wa1H8e4U_nZxvF4DFs?WqZ3V5g%=zR=DgD}<%apXbXUi3{&bctjLR3@TN z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E zN86W2+t)*jHceS@T>2?QXW+N>eG~5;NbVm^b`3YLBL1m9-{luR?HG^8KFY^vVe9}t zn`IOk!aroRox$|lo2X7EKx-F4EMm((=-&v;nrcn8pl-CVqWW0b*i-H7tv67pRC_9w h;ugB+zX-fztPoDr|0ej7TSNo_W4L%amu~Y<`UkDC^S=N9 literal 0 HcmV?d00001 diff --git a/packages/nodes-base/package.json b/packages/nodes-base/package.json index 37b9adecf2..c27f5fa98b 100644 --- a/packages/nodes-base/package.json +++ b/packages/nodes-base/package.json @@ -190,6 +190,7 @@ "dist/nodes/Google/Sheet/GoogleSheets.node.js", "dist/nodes/GraphQL/GraphQL.node.js", "dist/nodes/Gumroad/GumroadTrigger.node.js", + "dist/nodes/HackerNews/HackerNews.node.js", "dist/nodes/Harvest/Harvest.node.js", "dist/nodes/HelpScout/HelpScout.node.js", "dist/nodes/HelpScout/HelpScoutTrigger.node.js", From 55ed53579f9b7c22e818c49eead34c5cffceeb8f Mon Sep 17 00:00:00 2001 From: Rupenieks Date: Wed, 24 Jun 2020 15:46:56 +0200 Subject: [PATCH 113/241] Postmark trigger --- .../credentials/PostmarkApi.credentials.ts | 18 ++ .../nodes/Postmark/GenericFunctions.ts | 47 +++ .../nodes/Postmark/PostmarkTrigger.node.ts | 275 ++++++++++++++++++ .../nodes-base/nodes/Postmark/postmark.png | Bin 0 -> 3301 bytes packages/nodes-base/package.json | 2 + 5 files changed, 342 insertions(+) create mode 100644 packages/nodes-base/credentials/PostmarkApi.credentials.ts create mode 100644 packages/nodes-base/nodes/Postmark/GenericFunctions.ts create mode 100644 packages/nodes-base/nodes/Postmark/PostmarkTrigger.node.ts create mode 100644 packages/nodes-base/nodes/Postmark/postmark.png diff --git a/packages/nodes-base/credentials/PostmarkApi.credentials.ts b/packages/nodes-base/credentials/PostmarkApi.credentials.ts new file mode 100644 index 0000000000..88df53aa30 --- /dev/null +++ b/packages/nodes-base/credentials/PostmarkApi.credentials.ts @@ -0,0 +1,18 @@ +import { + ICredentialType, + NodePropertyTypes, +} from 'n8n-workflow'; + + +export class PostmarkApi implements ICredentialType { + name = 'postmarkApi'; + displayName = 'Postmark API'; + properties = [ + { + displayName: 'Server Token', + name: 'serverToken', + type: 'string' as NodePropertyTypes, + default: '', + }, + ]; +} diff --git a/packages/nodes-base/nodes/Postmark/GenericFunctions.ts b/packages/nodes-base/nodes/Postmark/GenericFunctions.ts new file mode 100644 index 0000000000..d65777d881 --- /dev/null +++ b/packages/nodes-base/nodes/Postmark/GenericFunctions.ts @@ -0,0 +1,47 @@ +import { + OptionsWithUri, + } from 'request'; + +import { + IExecuteFunctions, + ILoadOptionsFunctions, +} from 'n8n-core'; + +import { + IDataObject, + IHookFunctions, + IWebhookFunctions +} from 'n8n-workflow'; + + +export async function postmarkApiRequest(this: IExecuteFunctions | IWebhookFunctions | IHookFunctions | ILoadOptionsFunctions, method : string, endpoint : string, body: any = {}, option: IDataObject = {}): Promise { // tslint:disable-line:no-any + const credentials = this.getCredentials('postmarkApi'); + + if (credentials === undefined) { + throw new Error('No credentials got returned!'); + } + + let options: OptionsWithUri = { + headers: { + 'Content-Type': 'application/json', + 'Accept': 'application/json', + 'X-Postmark-Server-Token' : credentials.serverToken + }, + method, + body, + uri: 'https://api.postmarkapp.com' + endpoint, + json: true + }; + if (body === {}) { + delete options.body; + } + options = Object.assign({}, options, option); + + try { + return await this.helpers.request!(options); + } catch (error) { + throw new Error(`Postmark: ${error.statusCode} Message: ${error.message}`); + } +} + + diff --git a/packages/nodes-base/nodes/Postmark/PostmarkTrigger.node.ts b/packages/nodes-base/nodes/Postmark/PostmarkTrigger.node.ts new file mode 100644 index 0000000000..15af530cad --- /dev/null +++ b/packages/nodes-base/nodes/Postmark/PostmarkTrigger.node.ts @@ -0,0 +1,275 @@ +import { + IHookFunctions, + IWebhookFunctions, +} from 'n8n-core'; + +import { + INodeTypeDescription, + INodeType, + IWebhookResponseData, +} from 'n8n-workflow'; + +import { + postmarkApiRequest, +} from './GenericFunctions'; + +export class PostmarkTrigger implements INodeType { + description: INodeTypeDescription = { + displayName: 'Postmark Trigger', + name: 'postmarkTrigger', + icon: 'file:postmark.png', + group: ['trigger'], + version: 1, + description: 'Starts the workflow when Postmark events occur.', + defaults: { + name: 'Postmark Trigger', + color: '#fedd00', + }, + inputs: [], + outputs: ['main'], + credentials: [ + { + name: 'postmarkApi', + required: true, + }, + ], + webhooks: [ + { + name: 'default', + httpMethod: 'POST', + responseMode: 'onReceived', + path: 'webhook', + }, + ], + properties: [ + { + displayName: 'Open', + name: 'open', + type: 'boolean', + default: false, + description: 'Listing for if the Open webhook is enabled/disabled.', + }, + { + displayName: 'First Open Only', + name: 'postFirstOpenOnly', + type: 'boolean', + default: false, + displayOptions: { + show: { + open: [ + true + ], + }, + }, + description: 'Webhook will only post on first open if enabled.', + }, + { + displayName: 'Click', + name: 'click', + type: 'boolean', + default: false, + description: 'Listing for if the Click webhook is enabled/disabled.', + }, + { + displayName: 'Delivery', + name: 'delivery', + type: 'boolean', + default: false, + description: 'Listing for if the Delivery webhook is enabled/disabled.', + }, + { + displayName: 'Bounce', + name: 'bounce', + type: 'boolean', + default: false, + description: 'Listing for if the Bounce webhook is enabled/disabled.', + }, + { + displayName: 'Bounce Include Content', + name: 'bounceIncludeContent', + type: 'boolean', + default: false, + displayOptions: { + show: { + bounce: [ + true + ], + }, + }, + description: 'Webhook will send full bounce content if IncludeContent is enabled.', + }, + { + displayName: 'Spam Complaint', + name: 'spamComplaint', + type: 'boolean', + default: false, + description: 'Listing for if the Spam webhook is enabled/disabled.', + }, + { + displayName: 'Spam Complaint Include Content', + name: 'spamComplaintIncludeContent', + type: 'boolean', + default: false, + displayOptions: { + show: { + spamComplaint: [ + true + ], + }, + }, + description: 'Webhook will send full spam content if IncludeContent is enabled.', + }, + { + displayName: 'Subscription Change', + name: 'subscriptionChange', + type: 'boolean', + default: false, + description: 'Listing for if the Subscription Change webhook is enabled/disabled.', + }, + ], + + }; + + // @ts-ignore (because of request) + webhookMethods = { + default: { + async checkExists(this: IHookFunctions): Promise { + const webhookData = this.getWorkflowStaticData('node'); + + if (webhookData.webhookId === undefined) { + // No webhook id is set so no webhook can exist + return false; + } + + // Webhook got created before so check if it still exists + const endpoint = `/webhooks/${webhookData.webhookId}`; + + const responseData = await postmarkApiRequest.call(this, 'GET', endpoint, {}); + + if (responseData.ID === undefined) { + return false; + } + else if (responseData.ID === webhookData.id) { + return true; + } + return false; + }, + async create(this: IHookFunctions): Promise { + const webhookUrl = this.getNodeWebhookUrl('default'); + + const endpoint = `/webhooks`; + + // tslint:disable-next-line: no-any + const body : any = { + Url: webhookUrl, + Triggers: { + Open:{ + Enabled: false, + PostFirstOpenOnly: false + }, + Click:{ + Enabled: false + }, + Delivery:{ + Enabled: false + }, + Bounce:{ + Enabled: false, + IncludeContent: false + }, + SpamComplaint:{ + Enabled: false, + IncludeContent: false + }, + SubscriptionChange: { + Enabled: false + } + } + }; + + const open = this.getNodeParameter('open', 0); + const postFirstOpenOnly = this.getNodeParameter('postFirstOpenOnly', 0); + const click = this.getNodeParameter('click', 0); + const delivery = this.getNodeParameter('delivery', 0); + const bounce = this.getNodeParameter('bounce', 0); + const bounceIncludeContent = this.getNodeParameter('bounceIncludeContent', 0); + const spamComplaint = this.getNodeParameter('spamComplaint', 0); + const spamComplaintIncludeContent = this.getNodeParameter('spamComplaintIncludeContent', 0); + const subscriptionChange = this.getNodeParameter('subscriptionChange', 0); + + if (open) { + body.Triggers.Open.Enabled = true; + + if (postFirstOpenOnly) { + body.Triggers.Open.PostFirstOpenOnly = true; + } + } + if (click) { + body.Triggers.Click.Enabled = true; + } + if (delivery) { + body.Triggers.Delivery.Enabled = true; + } + if (bounce) { + body.Triggers.Bounce.Enabled = true; + + if (bounceIncludeContent) { + body.Triggers.Bounce.IncludeContent = true; + } + } + if (spamComplaint) { + body.Triggers.SpamComplaint.Enabled = true; + + if (spamComplaintIncludeContent) { + body.Triggers.SpamComplaint.IncludeContent = true; + } + } + if (subscriptionChange) { + body.Triggers.SubscriptionChange.Enabled = true; + } + + const responseData = await postmarkApiRequest.call(this, 'POST', endpoint, body); + + if (responseData.ID === undefined) { + // Required data is missing so was not successful + return false; + } + + const webhookData = this.getWorkflowStaticData('node'); + webhookData.webhookId = responseData.ID as string; + + return true; + }, + async delete(this: IHookFunctions): Promise { + const webhookData = this.getWorkflowStaticData('node'); + + if (webhookData.webhookId !== undefined) { + const endpoint = `/webhooks/${webhookData.webhookId}`; + const body = {}; + + try { + await postmarkApiRequest.call(this, 'DELETE', endpoint, body); + } catch (e) { + return false; + } + + // Remove from the static workflow data so that it is clear + // that no webhooks are registred anymore + delete webhookData.webhookId; + delete webhookData.webhookEvents; + } + + return true; + }, + }, + }; + + async webhook(this: IWebhookFunctions): Promise { + const req = this.getRequestObject(); + return { + workflowData: [ + this.helpers.returnJsonArray(req.body) + ], + }; + } +} diff --git a/packages/nodes-base/nodes/Postmark/postmark.png b/packages/nodes-base/nodes/Postmark/postmark.png new file mode 100644 index 0000000000000000000000000000000000000000..44f90b2a6c25f66c011e849512dbbbea5f128dfa GIT binary patch literal 3301 zcmcInc~lek7LKec0xB+`h%v4RlVq|%0s#vcpcQE>sZ`X+3z=bg6Cf8LxkGryVNcfb4HW$rn% z*Wb_EeCDE=7!1bT*T*XWy}Rnq=_crv@$Qx!z0HvMY*t_}W>)%h8s^w{)) zIUJba7sO47=F)jMcQ>r7nt>8XU?qfAOT zfG%geT(1e+-n(X81}KN=V9ueZ81CR1{t$;xVXP zkVcP$A^~SEOaWjrg$K|fQX~M8xFisUBFT{uZ%h|z?}cz<_36{wkGCxk;i4Q<8Dh{$ zFi0lDAOM0+bb!XC5CMo!rU4WZnH0;AVU;XpA#Phcp#rd1wjx3og;Br9+$yK>G&E(@1nFeWv=UY`UB?>)?j-neA_ zyvvvO?fW_>7q_1iCbpu8idHR>_&zZ`_UV4MX5EciWb3oEoE+;)k$9fxo`T}rrq{A^ z76n8H3g=igdj;ZZ=bG<5dHk^VfT6u?Fx;-f^=i!fq0qSY0DR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DOIC_Ad&8eZG~VCa#9h6cwtee+fqO=fqM#Yg;b z{@doB{Vy^*zk0!_*=wBn+CPm@U$|xDrbDEPHrqxwuXhx*TwGt6M5rw&b&u;pdNA!p zvj_WwHx%4)yP`YTfBpIl+XLl*=KaZozd^W^@G#(_G^gm)aGckd%C>pd`DXt@jt`f9 z+tVAD>ulL#qb+Qzi4%3vY7JH0%Ven>1C@A2YSHVbcQam^UawkXkz@Sy5rnl&H|ZOe wby@5&eYzTx^7f#2SJEY`lBH3`11HoU3?)ewA9`$Vj{S)EuJ`lG_lVf>Z!h~rQvd(} literal 0 HcmV?d00001 diff --git a/packages/nodes-base/package.json b/packages/nodes-base/package.json index a09d97d032..99d390ee09 100644 --- a/packages/nodes-base/package.json +++ b/packages/nodes-base/package.json @@ -107,6 +107,7 @@ "dist/credentials/PayPalApi.credentials.js", "dist/credentials/PipedriveApi.credentials.js", "dist/credentials/Postgres.credentials.js", + "dist/credentials/PostmarkApi.credentials.js", "dist/credentials/Redis.credentials.js", "dist/credentials/RocketchatApi.credentials.js", "dist/credentials/RundeckApi.credentials.js", @@ -248,6 +249,7 @@ "dist/nodes/Pipedrive/Pipedrive.node.js", "dist/nodes/Pipedrive/PipedriveTrigger.node.js", "dist/nodes/Postgres/Postgres.node.js", + "dist/nodes/Postmark/PostmarkTrigger.node.js", "dist/nodes/ReadBinaryFile.node.js", "dist/nodes/ReadBinaryFiles.node.js", "dist/nodes/ReadPdf.node.js", From e3cf858ebc64c78fdf7c3ce5ef4f0772a45f61ba Mon Sep 17 00:00:00 2001 From: shraddha shaligram Date: Wed, 24 Jun 2020 10:47:35 -0700 Subject: [PATCH 114/241] fix naming conventions --- .../nodes/Zoom/MeetingDescription.ts | 52 +++++++++--------- .../Zoom/MeetingRegistrantDescription.ts | 20 +++---- .../nodes/Zoom/WebinarDescription.ts | 54 +++++++++---------- packages/nodes-base/nodes/Zoom/Zoom.node.ts | 2 +- 4 files changed, 64 insertions(+), 64 deletions(-) diff --git a/packages/nodes-base/nodes/Zoom/MeetingDescription.ts b/packages/nodes-base/nodes/Zoom/MeetingDescription.ts index 5a8a5966a9..d335901bdf 100644 --- a/packages/nodes-base/nodes/Zoom/MeetingDescription.ts +++ b/packages/nodes-base/nodes/Zoom/MeetingDescription.ts @@ -69,7 +69,7 @@ export const meetingFields = [ description: 'User ID or email address of user.', }, { - displayName: 'Additional fields', + displayName: 'Additional Fields', name: 'additionalFields', type: 'collection', placeholder: 'Add Field', @@ -101,7 +101,7 @@ export const meetingFields = [ description: 'Alternative hosts email IDs.', }, { - displayName: 'Auto recording', + displayName: 'Auto Recording', name: 'auto_recording', type: 'options', options: [ @@ -179,14 +179,14 @@ export const meetingFields = [ description: 'Allow participants to join the meeting before host starts it.', }, { - displayName: 'Meeting topic', + displayName: 'Meeting Topic', name: 'topic', type: 'string', default: '', description: `Meeting topic.`, }, { - displayName: 'Meeting type', + displayName: 'Meeting Type', name: 'type', type: 'options', options: [ @@ -199,11 +199,11 @@ export const meetingFields = [ value: 2, }, { - name: 'Recurring meeting with no fixed time', + name: 'Recurring Meeting with no fixed time', value: 3, }, { - name: 'Recurring meeting with no fixed time', + name: 'Recurring Meeting with fixed time', value: 8, }, @@ -219,7 +219,7 @@ export const meetingFields = [ description: 'Mute participants upon entry.', }, { - displayName: 'Participant video', + displayName: 'Participant Video', name: 'participant_video', type: 'boolean', default: false, @@ -233,7 +233,7 @@ export const meetingFields = [ description: 'Password to join the meeting with maximum 10 characters.', }, { - displayName: 'Registration type', + displayName: 'Registration Type', name: 'registration_type', type: 'options', options: [ @@ -254,14 +254,14 @@ export const meetingFields = [ description: 'Registration type. Used for recurring meetings with fixed time only', }, { - displayName: 'Schedule for', + displayName: 'Schedule For', name: 'scheduleFor', type: 'string', default: '', description: 'Schedule meeting for someone else from your account, provide their email ID.', }, { - displayName: 'Start time', + displayName: 'Start Time', name: 'startTime', type: 'dateTime', default: '', @@ -308,7 +308,7 @@ export const meetingFields = [ description: 'Meeting ID.', }, { - displayName: 'Additional fields', + displayName: 'Additional Fields', name: 'additionalFields', type: 'collection', placeholder: 'Add Field', @@ -404,7 +404,7 @@ export const meetingFields = [ description: 'How many results to return.', }, { - displayName: 'Additional fields', + displayName: 'Additional Fields', name: 'additionalFields', type: 'collection', placeholder: 'Add Field', @@ -490,7 +490,7 @@ export const meetingFields = [ description: 'Meeting occurrence ID.', }, { - displayName: 'Schedule a reminder', + displayName: 'Schedule Reminder', name: 'scheduleForReminder', type: 'boolean', default: false, @@ -521,7 +521,7 @@ export const meetingFields = [ description: 'Meeting ID.', }, { - displayName: 'Additional fields', + displayName: 'Additional Fields', name: 'additionalFields', type: 'collection', placeholder: 'Add Field', @@ -573,16 +573,16 @@ export const meetingFields = [ description: 'Determine how participants can join audio portion of the meeting.', }, { - displayName: 'Auto recording', + displayName: 'Auto Recording', name: 'auto_recording', type: 'options', options: [ { - name: 'Record on local', + name: 'Record on Local', value: 'local', }, { - name: 'Record on cloud', + name: 'Record on Cloud', value: 'cloud', }, { @@ -602,7 +602,7 @@ export const meetingFields = [ description: 'Duration.', }, { - displayName: 'Join before Host', + displayName: 'Join Before Host', name: 'join_before_host', type: 'boolean', default: false, @@ -637,14 +637,14 @@ export const meetingFields = [ description: 'Occurrence ID.', }, { - displayName: 'Meeting topic', + displayName: 'Meeting Topic', name: 'topic', type: 'string', default: '', description: `Meeting topic.`, }, { - displayName: 'Meeting type', + displayName: 'Meeting Type', name: 'type', type: 'options', options: [ @@ -657,11 +657,11 @@ export const meetingFields = [ value: 2, }, { - name: 'Recurring meeting with no fixed time', + name: 'Recurring Meeting with no fixed time', value: 3, }, { - name: 'Recurring meeting with no fixed time', + name: 'Recurring Meeting with fixed time', value: 8, }, @@ -670,7 +670,7 @@ export const meetingFields = [ description: 'Meeting type.', }, { - displayName: 'Muting before entry', + displayName: 'Muting Before Entry', name: 'mute_upon_entry', type: 'boolean', default: false, @@ -691,7 +691,7 @@ export const meetingFields = [ description: 'Start video when participant joins the meeting.', }, { - displayName: 'Registration type', + displayName: 'Registration Type', name: 'registration_type', type: 'options', options: [ @@ -712,14 +712,14 @@ export const meetingFields = [ description: 'Registration type. Used for recurring meetings with fixed time only', }, { - displayName: 'Schedule for', + displayName: 'Schedule For', name: 'scheduleFor', type: 'string', default: '', description: 'Schedule meeting for someone else from your account, provide their email ID.', }, { - displayName: 'Start time', + displayName: 'Start Time', name: 'startTime', type: 'dateTime', default: '', diff --git a/packages/nodes-base/nodes/Zoom/MeetingRegistrantDescription.ts b/packages/nodes-base/nodes/Zoom/MeetingRegistrantDescription.ts index b7e5271f55..d1527f165a 100644 --- a/packages/nodes-base/nodes/Zoom/MeetingRegistrantDescription.ts +++ b/packages/nodes-base/nodes/Zoom/MeetingRegistrantDescription.ts @@ -22,12 +22,12 @@ export const meetingRegistrantOperations = [ { name: 'Update', value: 'update', - description: 'Update Meeting Registrant status', + description: 'Update Meeting Registrant Status', }, { name: 'Get All', value: 'getAll', - description: 'Retrieve all meeting registrants', + description: 'Retrieve all Meeting Registrants', }, ], @@ -77,7 +77,7 @@ export const meetingRegistrantFields = [ description: 'Valid email-id of registrant.', }, { - displayName: 'First name', + displayName: 'First Name', name: 'firstName', required: true, type: 'string', @@ -95,7 +95,7 @@ export const meetingRegistrantFields = [ description: 'First Name.', }, { - displayName: 'Additional fields', + displayName: 'Additional Fields', name: 'additionalFields', type: 'collection', placeholder: 'Add Field', @@ -141,7 +141,7 @@ export const meetingRegistrantFields = [ description: 'Valid country of registrant.', }, { - displayName: 'Job title', + displayName: 'Job Title', name: 'job_title', type: 'string', default: '', @@ -176,7 +176,7 @@ export const meetingRegistrantFields = [ description: 'Valid phone number of registrant.', }, { - displayName: 'Purchasing time frame', + displayName: 'Purchasing Time Frame', name: 'purchasing_time_frame', type: 'options', options: [ @@ -205,7 +205,7 @@ export const meetingRegistrantFields = [ description: 'Meeting type.', }, { - displayName: 'Role in purchase process', + displayName: 'Role in Purchase Process', name: 'role_in_purchase_process', type: 'options', options: [ @@ -238,7 +238,7 @@ export const meetingRegistrantFields = [ description: 'Valid state of registrant.', }, { - displayName: 'Zip code', + displayName: 'Zip Code', name: 'zip', type: 'string', default: '', @@ -310,7 +310,7 @@ export const meetingRegistrantFields = [ description: 'How many results to return.', }, { - displayName: 'Additional fields', + displayName: 'Additional Fields', name: 'additionalFields', type: 'collection', placeholder: 'Add Field', @@ -412,7 +412,7 @@ export const meetingRegistrantFields = [ description: `Registrant Status.`, }, { - displayName: 'Additional fields', + displayName: 'Additional Fields', name: 'additionalFields', type: 'collection', placeholder: 'Add Field', diff --git a/packages/nodes-base/nodes/Zoom/WebinarDescription.ts b/packages/nodes-base/nodes/Zoom/WebinarDescription.ts index 228cf9f1ae..1c0e03e096 100644 --- a/packages/nodes-base/nodes/Zoom/WebinarDescription.ts +++ b/packages/nodes-base/nodes/Zoom/WebinarDescription.ts @@ -69,7 +69,7 @@ export const webinarFields = [ description: 'User ID or email address of user.', }, { - displayName: 'Additional fields', + displayName: 'Additional Fields', name: 'additionalFields', type: 'collection', placeholder: 'Add Field', @@ -101,20 +101,20 @@ export const webinarFields = [ description: 'Alternative hosts email IDs.', }, { - displayName: 'Approval type', + displayName: 'Approval Type', name: 'approval_type', type: 'options', options: [ { - name: 'Automatically approve', + name: 'Automatically Approve', value: 0, }, { - name: 'Manually approve', + name: 'Manually Approve', value: 1, }, { - name: 'No registration required', + name: 'No Registration Required', value: 2, }, ], @@ -144,16 +144,16 @@ export const webinarFields = [ description: 'Determine how participants can join audio portion of the webinar.', }, { - displayName: 'Auto recording', + displayName: 'Auto Recording', name: 'auto_recording', type: 'options', options: [ { - name: 'Record on local', + name: 'Record on Local', value: 'local', }, { - name: 'Record on cloud', + name: 'Record on Cloud', value: 'cloud', }, { @@ -200,7 +200,7 @@ export const webinarFields = [ description: 'Enable Practice session.', }, { - displayName: 'Registration type', + displayName: 'Registration Type', name: 'registration_type', type: 'options', options: [ @@ -221,7 +221,7 @@ export const webinarFields = [ description: 'Registration type. Used for recurring webinar with fixed time only', }, { - displayName: 'Start time', + displayName: 'Start Time', name: 'startTime', type: 'dateTime', default: '', @@ -238,14 +238,14 @@ export const webinarFields = [ description: `Time zone used in the response. The default is the time zone of the calendar.`, }, { - displayName: 'Webinar topic', + displayName: 'Webinar Topic', name: 'topic', type: 'string', default: '', description: `Webinar topic.`, }, { - displayName: 'Webinar type', + displayName: 'Webinar Type', name: 'type', type: 'options', options: [ @@ -258,7 +258,7 @@ export const webinarFields = [ value: 6, }, { - name: 'Recurring webinar with fixed time', + name: 'Recurring webinar with fixed time', value: 9, }, ], @@ -290,7 +290,7 @@ export const webinarFields = [ description: 'Webinar ID.', }, { - displayName: 'Additional fields', + displayName: 'Additional Fields', name: 'additionalFields', type: 'collection', placeholder: 'Add Field', @@ -456,7 +456,7 @@ export const webinarFields = [ description: 'User ID or email address of user.', }, { - displayName: 'Additional fields', + displayName: 'Additional Fields', name: 'additionalFields', type: 'collection', placeholder: 'Add Field', @@ -488,20 +488,20 @@ export const webinarFields = [ description: 'Alternative hosts email IDs.', }, { - displayName: 'Approval type', + displayName: 'Approval Type', name: 'approval_type', type: 'options', options: [ { - name: 'Automatically approve', + name: 'Automatically Approve', value: 0, }, { - name: 'Manually approve', + name: 'Manually Approve', value: 1, }, { - name: 'No registration required', + name: 'No Registration Required', value: 2, }, ], @@ -509,16 +509,16 @@ export const webinarFields = [ description: 'Approval type.', }, { - displayName: 'Auto recording', + displayName: 'Auto Recording', name: 'auto_recording', type: 'options', options: [ { - name: 'Record on local', + name: 'Record on Local', value: 'local', }, { - name: 'Record on cloud', + name: 'Record on Cloud', value: 'cloud', }, { @@ -594,7 +594,7 @@ export const webinarFields = [ description: 'Enable Practice session.', }, { - displayName: 'Registration type', + displayName: 'Registration Type', name: 'registration_type', type: 'options', options: [ @@ -615,7 +615,7 @@ export const webinarFields = [ description: 'Registration type. Used for recurring webinars with fixed time only.', }, { - displayName: 'Start time', + displayName: 'Start Time', name: 'startTime', type: 'dateTime', default: '', @@ -632,14 +632,14 @@ export const webinarFields = [ description: `Time zone used in the response. The default is the time zone of the calendar.`, }, { - displayName: 'Webinar topic', + displayName: 'Webinar Topic', name: 'topic', type: 'string', default: '', description: `Webinar topic.`, }, { - displayName: 'Webinar type', + displayName: 'Webinar Type', name: 'type', type: 'options', options: [ @@ -652,7 +652,7 @@ export const webinarFields = [ value: 6, }, { - name: 'Recurring webinar with fixed time', + name: 'Recurring webinar with fixed time', value: 9, }, ], diff --git a/packages/nodes-base/nodes/Zoom/Zoom.node.ts b/packages/nodes-base/nodes/Zoom/Zoom.node.ts index f33a2a338e..c0d1a05a9e 100644 --- a/packages/nodes-base/nodes/Zoom/Zoom.node.ts +++ b/packages/nodes-base/nodes/Zoom/Zoom.node.ts @@ -483,7 +483,7 @@ export class Zoom implements INodeType { } } - if (resource === 'meetingRegistrant') { + if (resource === 'meetingRegistrants') { if (operation === 'create') { //https://marketplace.zoom.us/docs/api-reference/zoom-api/meetings/meetingregistrantcreate const meetingId = this.getNodeParameter('meetingId', i) as string; From 86a42f47474e9484326b32eaf5a77016267ee406 Mon Sep 17 00:00:00 2001 From: ricardo Date: Wed, 24 Jun 2020 14:02:17 -0400 Subject: [PATCH 115/241] :zap: Improvements to HackerNews-Node --- .../nodes/HackerNews/GenericFunctions.ts | 19 ++++-- .../nodes/HackerNews/HackerNews.node.ts | 63 ++++++++++--------- 2 files changed, 47 insertions(+), 35 deletions(-) diff --git a/packages/nodes-base/nodes/HackerNews/GenericFunctions.ts b/packages/nodes-base/nodes/HackerNews/GenericFunctions.ts index 56f6d8aef6..76fbdd3bb5 100644 --- a/packages/nodes-base/nodes/HackerNews/GenericFunctions.ts +++ b/packages/nodes-base/nodes/HackerNews/GenericFunctions.ts @@ -4,11 +4,12 @@ import { } from 'n8n-core'; import { - IDataObject, ILoadOptionsFunctions, + IDataObject, + ILoadOptionsFunctions, } from 'n8n-workflow'; import { - OptionsWithUri + OptionsWithUri, } from 'request'; @@ -23,13 +24,23 @@ import { */ export async function hackerNewsApiRequest(this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions, method: string, endpoint: string, qs: IDataObject): Promise { // tslint:disable-line:no-any const options: OptionsWithUri = { - method: method, + method, qs, uri: `http://hn.algolia.com/api/v1/${endpoint}`, json: true, }; - return await this.helpers.request!(options); + try { + return await this.helpers.request!(options); + } catch (error) { + + if (error.response && error.response.body && error.response.body.error) { + // Try to return the error prettier + throw new Error(`Hacker News error response [${error.statusCode}]: ${error.response.body.error}`); + } + + throw error; + } } diff --git a/packages/nodes-base/nodes/HackerNews/HackerNews.node.ts b/packages/nodes-base/nodes/HackerNews/HackerNews.node.ts index 91edf0679d..65afe2b83c 100644 --- a/packages/nodes-base/nodes/HackerNews/HackerNews.node.ts +++ b/packages/nodes-base/nodes/HackerNews/HackerNews.node.ts @@ -1,5 +1,5 @@ import { - IExecuteFunctions + IExecuteFunctions, } from 'n8n-core'; import { @@ -11,7 +11,7 @@ import { import { hackerNewsApiRequest, - hackerNewsApiRequestAllItems + hackerNewsApiRequestAllItems, } from './GenericFunctions'; export class HackerNews implements INodeType { @@ -40,12 +40,12 @@ export class HackerNews implements INodeType { options: [ { name: 'Article', - value: 'article' + value: 'article', }, { name: 'User', - value: 'user' - } + value: 'user', + }, ], default: 'article', description: 'Resource to consume.', @@ -60,7 +60,7 @@ export class HackerNews implements INodeType { displayOptions: { show: { resource: [ - 'article' + 'article', ], }, }, @@ -74,7 +74,7 @@ export class HackerNews implements INodeType { name: 'Get All', value: 'getAll', description: 'Get all Hacker News articles', - } + }, ], default: 'get', description: 'Operation to perform.', @@ -86,7 +86,7 @@ export class HackerNews implements INodeType { displayOptions: { show: { resource: [ - 'user' + 'user', ], }, }, @@ -95,7 +95,7 @@ export class HackerNews implements INodeType { name: 'Get', value: 'get', description: 'Get a Hacker News user', - } + }, ], default: 'get', description: 'Operation to perform.', @@ -113,10 +113,10 @@ export class HackerNews implements INodeType { displayOptions: { show: { resource: [ - 'article' + 'article', ], operation: [ - 'get' + 'get', ], }, }, @@ -131,10 +131,10 @@ export class HackerNews implements INodeType { displayOptions: { show: { resource: [ - 'user' + 'user', ], operation: [ - 'get' + 'get', ], }, }, @@ -148,10 +148,10 @@ export class HackerNews implements INodeType { displayOptions: { show: { resource: [ - 'article' + 'article', ], operation: [ - 'getAll' + 'getAll', ], }, }, @@ -165,13 +165,13 @@ export class HackerNews implements INodeType { displayOptions: { show: { resource: [ - 'article' + 'article', ], operation: [ - 'getAll' + 'getAll', ], returnAll: [ - false + false, ], }, }, @@ -185,10 +185,10 @@ export class HackerNews implements INodeType { displayOptions: { show: { resource: [ - 'article' + 'article', ], operation: [ - 'get' + 'get', ], }, }, @@ -198,9 +198,9 @@ export class HackerNews implements INodeType { name: 'includeComments', type: 'boolean', default: false, - description: 'Whether to include all the comments in a Hacker News article.' + description: 'Whether to include all the comments in a Hacker News article.', }, - ] + ], }, { displayName: 'Additional Fields', @@ -211,10 +211,10 @@ export class HackerNews implements INodeType { displayOptions: { show: { resource: [ - 'article' + 'article', ], operation: [ - 'getAll' + 'getAll', ], }, }, @@ -260,14 +260,14 @@ export class HackerNews implements INodeType { name: 'Front Page', value: 'front_page', // snake case per HN tags description: 'Returns query results filtered by Front Page tag', - } + }, ], default: '', description: 'Tags for filtering the results of the query.', - } - ] - } - ] + }, + ], + }, + ], }; @@ -335,8 +335,9 @@ export class HackerNews implements INodeType { responseData = await hackerNewsApiRequestAllItems.call(this, 'GET', endpoint, qs); } else { responseData = await hackerNewsApiRequest.call(this, 'GET', endpoint, qs); - if (resource === 'article' && operation === 'getAll') - responseData = responseData.hits; + if (resource === 'article' && operation === 'getAll') { + responseData = responseData.hits; + } } if (resource === 'article' && operation === 'get' && !includeComments) { From 582954008352add0c2b88b5a2094872ae846c34a Mon Sep 17 00:00:00 2001 From: shraddha shaligram Date: Wed, 24 Jun 2020 11:09:11 -0700 Subject: [PATCH 116/241] fix registrants bug --- .../nodes/Zoom/MeetingDescription.ts | 46 +++++----- .../Zoom/MeetingRegistrantDescription.ts | 10 +-- packages/nodes-base/nodes/Zoom/Zoom.node.ts | 87 ++++++++++--------- 3 files changed, 73 insertions(+), 70 deletions(-) diff --git a/packages/nodes-base/nodes/Zoom/MeetingDescription.ts b/packages/nodes-base/nodes/Zoom/MeetingDescription.ts index d335901bdf..3efcc2a2bc 100644 --- a/packages/nodes-base/nodes/Zoom/MeetingDescription.ts +++ b/packages/nodes-base/nodes/Zoom/MeetingDescription.ts @@ -66,7 +66,7 @@ export const meetingFields = [ ], }, }, - description: 'User ID or email address of user.', + description: 'User ID or Email Address.', }, { displayName: 'Additional Fields', @@ -95,22 +95,22 @@ export const meetingFields = [ }, { displayName: 'Alternative Hosts', - name: 'alternative_hosts', + name: 'alternativeHosts', type: 'string', default: '', description: 'Alternative hosts email IDs.', }, { displayName: 'Auto Recording', - name: 'auto_recording', + name: 'autoRecording', type: 'options', options: [ { - name: 'Record on local', + name: 'Record on Local', value: 'local', }, { - name: 'Record on cloud', + name: 'Record on Cloud', value: 'cloud', }, { @@ -152,28 +152,28 @@ export const meetingFields = [ }, { displayName: 'Host Meeting in China', - name: 'cn_meeting', + name: 'cnMeeting', type: 'boolean', default: false, description: 'Host Meeting in China.', }, { displayName: 'Host Meeting in India', - name: 'in_meeting', + name: 'inMeeting', type: 'boolean', default: false, description: 'Host Meeting in India.', }, { displayName: 'Host Video', - name: 'host_video', + name: 'hostVideo', type: 'boolean', default: false, description: 'Start video when host joins the meeting.', }, { - displayName: 'Join before Host', - name: 'join_before_host', + displayName: 'Join Before Host', + name: 'joinBeforeHost', type: 'boolean', default: false, description: 'Allow participants to join the meeting before host starts it.', @@ -213,14 +213,14 @@ export const meetingFields = [ }, { displayName: 'Muting before entry', - name: 'mute_upon_entry', + name: 'muteUponEntry', type: 'boolean', default: false, description: 'Mute participants upon entry.', }, { displayName: 'Participant Video', - name: 'participant_video', + name: 'participantVideo', type: 'boolean', default: false, description: 'Start video when participant joins the meeting.', @@ -234,7 +234,7 @@ export const meetingFields = [ }, { displayName: 'Registration Type', - name: 'registration_type', + name: 'registrationType', type: 'options', options: [ { @@ -546,14 +546,14 @@ export const meetingFields = [ }, { displayName: 'Alternative Hosts', - name: 'alternative_hosts', + name: 'alternativeHosts', type: 'string', default: '', description: 'Alternative hosts email IDs.', }, { displayName: 'Audio', - name: 'auto_recording', + name: 'audio', type: 'options', options: [ { @@ -574,7 +574,7 @@ export const meetingFields = [ }, { displayName: 'Auto Recording', - name: 'auto_recording', + name: 'autoRecording', type: 'options', options: [ { @@ -603,28 +603,28 @@ export const meetingFields = [ }, { displayName: 'Join Before Host', - name: 'join_before_host', + name: 'joinBeforeHost', type: 'boolean', default: false, description: 'Allow participants to join the meeting before host starts it.', }, { displayName: 'Host Meeting in China', - name: 'cn_meeting', + name: 'cnMeeting', type: 'boolean', default: false, description: 'Host Meeting in China.', }, { displayName: 'Host Meeting in India', - name: 'in_meeting', + name: 'inMeeting', type: 'boolean', default: false, description: 'Host Meeting in India.', }, { displayName: 'Host Video', - name: 'host_video', + name: 'hostVideo', type: 'boolean', default: false, description: 'Start video when host joins the meeting.', @@ -671,7 +671,7 @@ export const meetingFields = [ }, { displayName: 'Muting Before Entry', - name: 'mute_upon_entry', + name: 'muteUponEntry', type: 'boolean', default: false, description: 'Mute participants upon entry.', @@ -685,14 +685,14 @@ export const meetingFields = [ }, { displayName: 'Participant Video', - name: 'participant_video', + name: 'participantVideo', type: 'boolean', default: false, description: 'Start video when participant joins the meeting.', }, { displayName: 'Registration Type', - name: 'registration_type', + name: 'registrationType', type: 'options', options: [ { diff --git a/packages/nodes-base/nodes/Zoom/MeetingRegistrantDescription.ts b/packages/nodes-base/nodes/Zoom/MeetingRegistrantDescription.ts index d1527f165a..5d40aae014 100644 --- a/packages/nodes-base/nodes/Zoom/MeetingRegistrantDescription.ts +++ b/packages/nodes-base/nodes/Zoom/MeetingRegistrantDescription.ts @@ -74,7 +74,7 @@ export const meetingRegistrantFields = [ ], }, }, - description: 'Valid email-id of registrant.', + description: 'Valid Email-ID.', }, { displayName: 'First Name', @@ -142,7 +142,7 @@ export const meetingRegistrantFields = [ }, { displayName: 'Job Title', - name: 'job_title', + name: 'jobTitle', type: 'string', default: '', description: 'Job title of registrant.', @@ -177,7 +177,7 @@ export const meetingRegistrantFields = [ }, { displayName: 'Purchasing Time Frame', - name: 'purchasing_time_frame', + name: 'purchasingTimeFrame', type: 'options', options: [ { @@ -206,7 +206,7 @@ export const meetingRegistrantFields = [ }, { displayName: 'Role in Purchase Process', - name: 'role_in_purchase_process', + name: 'roleInPurchaseProcess', type: 'options', options: [ { @@ -329,7 +329,7 @@ export const meetingRegistrantFields = [ options: [ { displayName: 'Occurrence ID', - name: 'occurrence_id', + name: 'occurrenceId', type: 'string', default: '', description: `Occurrence ID.`, diff --git a/packages/nodes-base/nodes/Zoom/Zoom.node.ts b/packages/nodes-base/nodes/Zoom/Zoom.node.ts index c0d1a05a9e..43221e8288 100644 --- a/packages/nodes-base/nodes/Zoom/Zoom.node.ts +++ b/packages/nodes-base/nodes/Zoom/Zoom.node.ts @@ -255,23 +255,23 @@ export class Zoom implements INodeType { i ) as IDataObject; const settings: Settings = {}; - if (additionalFields.cn_meeting) { - settings.cn_meeting = additionalFields.cn_meeting as boolean; + if (additionalFields.cnMeeting) { + settings.cn_meeting = additionalFields.cnMeeting as boolean; } - if (additionalFields.in_meeting) { - settings.in_meeting = additionalFields.in_meeting as boolean; + if (additionalFields.inMeeting) { + settings.in_meeting = additionalFields.inMeeting as boolean; } - if (additionalFields.join_before_host) { - settings.join_before_host = additionalFields.join_before_host as boolean; + if (additionalFields.joinBeforeHost) { + settings.join_before_host = additionalFields.joinBeforeHost as boolean; } - if (additionalFields.mute_upon_entry) { - settings.mute_upon_entry = additionalFields.mute_upon_entry as boolean; + if (additionalFields.muteUponEntry) { + settings.mute_upon_entry = additionalFields.muteUponEntry as boolean; } @@ -285,28 +285,28 @@ export class Zoom implements INodeType { } - if (additionalFields.alternative_hosts) { - settings.alternative_hosts = additionalFields.alternative_hosts as string; + if (additionalFields.alternativeHosts) { + settings.alternative_hosts = additionalFields.alternativeHosts as string; } - if (additionalFields.participant_video) { - settings.participant_video = additionalFields.participant_video as boolean; + if (additionalFields.participantVideo) { + settings.participant_video = additionalFields.participantVideo as boolean; } - if (additionalFields.host_video) { - settings.host_video = additionalFields.host_video as boolean; + if (additionalFields.hostVideo) { + settings.host_video = additionalFields.hostVideo as boolean; } - if (additionalFields.auto_recording) { - settings.auto_recording = additionalFields.auto_recording as string; + if (additionalFields.autoRecording) { + settings.auto_recording = additionalFields.autoRecording as string; } - if (additionalFields.registration_type) { - settings.registration_type = additionalFields.registration_type as number; + if (additionalFields.registrationType) { + settings.registration_type = additionalFields.registrationType as number; } @@ -374,23 +374,23 @@ export class Zoom implements INodeType { qs.occurrence_id = additionalFields.occurrenceId as string; } - if (additionalFields.cn_meeting) { - settings.cn_meeting = additionalFields.cn_meeting as boolean; + if (additionalFields.cnMeeting) { + settings.cn_meeting = additionalFields.cnMeeting as boolean; } - if (additionalFields.in_meeting) { - settings.in_meeting = additionalFields.in_meeting as boolean; + if (additionalFields.inMeeting) { + settings.in_meeting = additionalFields.inMeeting as boolean; } - if (additionalFields.join_before_host) { - settings.join_before_host = additionalFields.join_before_host as boolean; + if (additionalFields.joinBeforeHost) { + settings.join_before_host = additionalFields.joinBeforeHost as boolean; } - if (additionalFields.mute_upon_entry) { - settings.mute_upon_entry = additionalFields.mute_upon_entry as boolean; + if (additionalFields.muteUponEntry) { + settings.mute_upon_entry = additionalFields.muteUponEntry as boolean; } @@ -404,28 +404,28 @@ export class Zoom implements INodeType { } - if (additionalFields.alternative_hosts) { - settings.alternative_hosts = additionalFields.alternative_hosts as string; + if (additionalFields.alternativeHosts) { + settings.alternative_hosts = additionalFields.alternativeHosts as string; } - if (additionalFields.participant_video) { - settings.participant_video = additionalFields.participant_video as boolean; + if (additionalFields.participantVideo) { + settings.participant_video = additionalFields.participantVideo as boolean; } - if (additionalFields.host_video) { - settings.host_video = additionalFields.host_video as boolean; + if (additionalFields.hostVideo) { + settings.host_video = additionalFields.hostVideo as boolean; } - if (additionalFields.auto_recording) { - settings.auto_recording = additionalFields.auto_recording as string; + if (additionalFields.autoRecording) { + settings.auto_recording = additionalFields.autoRecording as string; } - if (additionalFields.registration_type) { - settings.registration_type = additionalFields.registration_type as number; + if (additionalFields.registrationType) { + settings.registration_type = additionalFields.registrationType as number; } @@ -525,14 +525,14 @@ export class Zoom implements INodeType { if (additionalFields.org) { body.org = additionalFields.org as string; } - if (additionalFields.job_title) { - body.job_title = additionalFields.job_title as string; + if (additionalFields.jobTitle) { + body.job_title = additionalFields.jobTitle as string; } - if (additionalFields.purchasing_time_frame) { - body.purchasing_time_frame = additionalFields.purchasing_time_frame as string; + if (additionalFields.purchasingTimeFrame) { + body.purchasing_time_frame = additionalFields.purchasingTimeFrame as string; } - if (additionalFields.role_in_purchase_process) { - body.role_in_purchase_process = additionalFields.role_in_purchase_process as string; + if (additionalFields.roleInPurchaseProcess) { + body.role_in_purchase_process = additionalFields.roleInPurchaseProcess as string; } responseData = await zoomApiRequest.call( this, @@ -575,6 +575,9 @@ export class Zoom implements INodeType { if (additionalFields.occurenceId) { qs.occurrence_id = additionalFields.occurrenceId as string; } + if (additionalFields.action) { + body.action = additionalFields.action as string; + } responseData = await zoomApiRequest.call( this, 'PUT', From 7fea380af557151b0419032d04f3336e06d2429b Mon Sep 17 00:00:00 2001 From: shraddha shaligram Date: Wed, 24 Jun 2020 11:18:56 -0700 Subject: [PATCH 117/241] fix webinar resource --- .../nodes/Zoom/WebinarDescription.ts | 20 ++++++------- packages/nodes-base/nodes/Zoom/Zoom.node.ts | 30 +++++++++++-------- 2 files changed, 27 insertions(+), 23 deletions(-) diff --git a/packages/nodes-base/nodes/Zoom/WebinarDescription.ts b/packages/nodes-base/nodes/Zoom/WebinarDescription.ts index 1c0e03e096..eff6f4159c 100644 --- a/packages/nodes-base/nodes/Zoom/WebinarDescription.ts +++ b/packages/nodes-base/nodes/Zoom/WebinarDescription.ts @@ -66,7 +66,7 @@ export const webinarFields = [ ], }, }, - description: 'User ID or email address of user.', + description: 'User ID or email ID.', }, { displayName: 'Additional Fields', @@ -95,14 +95,14 @@ export const webinarFields = [ }, { displayName: 'Alternative Hosts', - name: 'alternative_hosts', + name: 'alternativeHosts', type: 'string', default: '', description: 'Alternative hosts email IDs.', }, { displayName: 'Approval Type', - name: 'approval_type', + name: 'approvalType', type: 'options', options: [ { @@ -145,7 +145,7 @@ export const webinarFields = [ }, { displayName: 'Auto Recording', - name: 'auto_recording', + name: 'autoRecording', type: 'options', options: [ { @@ -173,14 +173,14 @@ export const webinarFields = [ }, { displayName: 'Host Video', - name: 'host_video', + name: 'hostVideo', type: 'boolean', default: false, description: 'Start video when host joins the webinar.', }, { displayName: 'Panelists Video', - name: 'panelists_video', + name: 'panelistsVideo', type: 'boolean', default: false, description: 'Start video when panelists joins the webinar.', @@ -194,14 +194,14 @@ export const webinarFields = [ }, { displayName: 'Practice Session', - name: 'practice_session', + name: 'practiceSession', type: 'boolean', default: false, description: 'Enable Practice session.', }, { displayName: 'Registration Type', - name: 'registration_type', + name: 'registrationType', type: 'options', options: [ { @@ -438,8 +438,8 @@ export const webinarFields = [ /* webinar:update */ /* -------------------------------------------------------------------------- */ { - displayName: 'User ID', - name: 'userId', + displayName: 'Webinar ID', + name: 'webinarId', type: 'string', default: '', required: true, diff --git a/packages/nodes-base/nodes/Zoom/Zoom.node.ts b/packages/nodes-base/nodes/Zoom/Zoom.node.ts index 43221e8288..60f186b31a 100644 --- a/packages/nodes-base/nodes/Zoom/Zoom.node.ts +++ b/packages/nodes-base/nodes/Zoom/Zoom.node.ts @@ -603,30 +603,34 @@ export class Zoom implements INodeType { } - if (additionalFields.alternative_hosts) { - settings.alternative_hosts = additionalFields.alternative_hosts as string; + if (additionalFields.alternativeHosts) { + settings.alternative_hosts = additionalFields.alternativeHosts as string; } - if (additionalFields.panelists_video) { - settings.panelists_video = additionalFields.panelists_video as boolean; + if (additionalFields.panelistsVideo) { + settings.panelists_video = additionalFields.panelistsVideo as boolean; } - if (additionalFields.practice_session) { - settings.practice_session = additionalFields.practice_session as boolean; + if (additionalFields.hostVideo) { + settings.host_video = additionalFields.hostVideo as boolean; } - if (additionalFields.auto_recording) { - settings.auto_recording = additionalFields.auto_recording as string; + if (additionalFields.practiceSession) { + settings.practice_session = additionalFields.practiceSession as boolean; + + } + if (additionalFields.autoRecording) { + settings.auto_recording = additionalFields.autoRecording as string; } - if (additionalFields.registration_type) { - settings.registration_type = additionalFields.registration_type as number; + if (additionalFields.registrationType) { + settings.registration_type = additionalFields.registrationType as number; } - if (additionalFields.approval_type) { - settings.approval_type = additionalFields.approval_type as number; + if (additionalFields.approvalType) { + settings.approval_type = additionalFields.approvalType as number; } @@ -823,7 +827,7 @@ export class Zoom implements INodeType { responseData = await zoomApiRequest.call( this, 'PATCH', - `/users/${webinarId}/webinars`, + `webinars/${webinarId}`, body, qs ); From f9fe9de235184f13d2871356a830173f8787083b Mon Sep 17 00:00:00 2001 From: shraddha shaligram Date: Wed, 24 Jun 2020 11:25:07 -0700 Subject: [PATCH 118/241] fix webinar naming conventions --- .../nodes/Zoom/WebinarDescription.ts | 16 +++++----- packages/nodes-base/nodes/Zoom/Zoom.node.ts | 32 +++++++++++-------- 2 files changed, 26 insertions(+), 22 deletions(-) diff --git a/packages/nodes-base/nodes/Zoom/WebinarDescription.ts b/packages/nodes-base/nodes/Zoom/WebinarDescription.ts index eff6f4159c..421eb2cf50 100644 --- a/packages/nodes-base/nodes/Zoom/WebinarDescription.ts +++ b/packages/nodes-base/nodes/Zoom/WebinarDescription.ts @@ -482,14 +482,14 @@ export const webinarFields = [ }, { displayName: 'Alternative Hosts', - name: 'alternative_hosts', + name: 'alternativeHosts', type: 'string', default: '', description: 'Alternative hosts email IDs.', }, { displayName: 'Approval Type', - name: 'approval_type', + name: 'approvalType', type: 'options', options: [ { @@ -510,7 +510,7 @@ export const webinarFields = [ }, { displayName: 'Auto Recording', - name: 'auto_recording', + name: 'autoRecording', type: 'options', options: [ { @@ -560,14 +560,14 @@ export const webinarFields = [ }, { displayName: 'Host Video', - name: 'host_video', + name: 'hostVideo', type: 'boolean', default: false, description: 'Start video when host joins the webinar.', }, { displayName: 'Occurrence ID', - name: 'occurrence_id', + name: 'occurrenceId', type: 'string', default: '', description: `Webinar occurrence ID.`, @@ -581,21 +581,21 @@ export const webinarFields = [ }, { displayName: 'Panelists Video', - name: 'panelists_video', + name: 'panelistsVideo', type: 'boolean', default: false, description: 'Start video when panelists joins the webinar.', }, { displayName: 'Practice Session', - name: 'practice_session', + name: 'practiceSession', type: 'boolean', default: false, description: 'Enable Practice session.', }, { displayName: 'Registration Type', - name: 'registration_type', + name: 'registrationType', type: 'options', options: [ { diff --git a/packages/nodes-base/nodes/Zoom/Zoom.node.ts b/packages/nodes-base/nodes/Zoom/Zoom.node.ts index 60f186b31a..f7e00b0de7 100644 --- a/packages/nodes-base/nodes/Zoom/Zoom.node.ts +++ b/packages/nodes-base/nodes/Zoom/Zoom.node.ts @@ -749,8 +749,8 @@ export class Zoom implements INodeType { 'additionalFields', i ) as IDataObject; - if (additionalFields.occurrence_id) { - qs.occurrence_id = additionalFields.occurrence_id as string; + if (additionalFields.occurrenceId) { + qs.occurrence_id = additionalFields.occurrenceId as string; } const settings: Settings = {}; @@ -758,30 +758,34 @@ export class Zoom implements INodeType { settings.audio = additionalFields.audio as string; } - if (additionalFields.alternative_hosts) { - settings.alternative_hosts = additionalFields.alternative_hosts as string; + if (additionalFields.alternativeHosts) { + settings.alternative_hosts = additionalFields.alternativeHosts as string; } - if (additionalFields.panelists_video) { - settings.panelists_video = additionalFields.panelists_video as boolean; + if (additionalFields.panelistsVideo) { + settings.panelists_video = additionalFields.panelistsVideo as boolean; } - if (additionalFields.practice_session) { - settings.practice_session = additionalFields.practice_session as boolean; + if (additionalFields.hostVideo) { + settings.host_video = additionalFields.hostVideo as boolean; } - if (additionalFields.auto_recording) { - settings.auto_recording = additionalFields.auto_recording as string; + if (additionalFields.practiceSession) { + settings.practice_session = additionalFields.practiceSession as boolean; + + } + if (additionalFields.autoRecording) { + settings.auto_recording = additionalFields.autoRecording as string; } - if (additionalFields.registration_type) { - settings.registration_type = additionalFields.registration_type as number; + if (additionalFields.registrationType) { + settings.registration_type = additionalFields.registrationType as number; } - if (additionalFields.approval_type) { - settings.approval_type = additionalFields.approval_type as number; + if (additionalFields.approvalType) { + settings.approval_type = additionalFields.approvalType as number; } From 34e05f0f72d1f9726ffd9b1e9c18840470bdee42 Mon Sep 17 00:00:00 2001 From: shraddha shaligram Date: Wed, 24 Jun 2020 12:01:06 -0700 Subject: [PATCH 119/241] add credentials comments --- packages/nodes-base/nodes/Zoom/Zoom.node.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/nodes-base/nodes/Zoom/Zoom.node.ts b/packages/nodes-base/nodes/Zoom/Zoom.node.ts index f7e00b0de7..e6e6a78600 100644 --- a/packages/nodes-base/nodes/Zoom/Zoom.node.ts +++ b/packages/nodes-base/nodes/Zoom/Zoom.node.ts @@ -65,6 +65,9 @@ export class Zoom implements INodeType { outputs: ['main'], credentials: [ { + // create a JWT app on Zoom Marketplace + //https://marketplace.zoom.us/develop/create + //get the JWT token as access token name: 'zoomApi', required: true, displayOptions: { @@ -76,6 +79,8 @@ export class Zoom implements INodeType { }, }, { + //create a account level OAuth app + //https://marketplace.zoom.us/develop/create name: 'zoomOAuth2Api', required: true, displayOptions: { From 5e81e02599601dd1c45220473d3bd88f918598d7 Mon Sep 17 00:00:00 2001 From: Erin Date: Wed, 24 Jun 2020 14:16:48 -0400 Subject: [PATCH 120/241] :sparkles: Spotify Node Co-authored-by: Ricardo Espinoza --- .../SpotifyOAuth2Api.credentials.ts | 53 ++ .../nodes/Spotify/GenericFunctions.ts | 84 ++ .../nodes-base/nodes/Spotify/Spotify.node.ts | 816 ++++++++++++++++++ packages/nodes-base/nodes/Spotify/spotify.png | Bin 0 -> 6664 bytes packages/nodes-base/package.json | 2 + 5 files changed, 955 insertions(+) create mode 100644 packages/nodes-base/credentials/SpotifyOAuth2Api.credentials.ts create mode 100644 packages/nodes-base/nodes/Spotify/GenericFunctions.ts create mode 100644 packages/nodes-base/nodes/Spotify/Spotify.node.ts create mode 100644 packages/nodes-base/nodes/Spotify/spotify.png diff --git a/packages/nodes-base/credentials/SpotifyOAuth2Api.credentials.ts b/packages/nodes-base/credentials/SpotifyOAuth2Api.credentials.ts new file mode 100644 index 0000000000..1dc9f1057a --- /dev/null +++ b/packages/nodes-base/credentials/SpotifyOAuth2Api.credentials.ts @@ -0,0 +1,53 @@ +import { + ICredentialType, + NodePropertyTypes, +} from 'n8n-workflow'; + + +export class SpotifyOAuth2Api implements ICredentialType { + name = 'spotifyOAuth2Api'; + extends = [ + 'oAuth2Api', + ]; + displayName = 'Spotify OAuth2 API'; + properties = [ + { + displayName: 'Spotify Server', + name: 'server', + type: 'hidden' as NodePropertyTypes, + default: 'https://api.spotify.com/', + }, + { + displayName: 'Authorization URL', + name: 'authUrl', + type: 'hidden' as NodePropertyTypes, + default: 'https://accounts.spotify.com/authorize', + required: true, + }, + { + displayName: 'Access Token URL', + name: 'accessTokenUrl', + type: 'hidden' as NodePropertyTypes, + default: 'https://accounts.spotify.com/api/token', + required: true, + }, + { + displayName: 'Scope', + name: 'scope', + type: 'hidden' as NodePropertyTypes, + default: 'user-read-playback-state playlist-read-collaborative user-modify-playback-state playlist-modify-public user-read-currently-playing playlist-read-private user-read-recently-played playlist-modify-private', + }, + { + displayName: 'Auth URI Query Parameters', + name: 'authQueryParameters', + type: 'hidden' as NodePropertyTypes, + default: '', + }, + { + displayName: 'Authentication', + name: 'authentication', + type: 'hidden' as NodePropertyTypes, + default: 'header', + } + ]; +} diff --git a/packages/nodes-base/nodes/Spotify/GenericFunctions.ts b/packages/nodes-base/nodes/Spotify/GenericFunctions.ts new file mode 100644 index 0000000000..f4c86a9d2d --- /dev/null +++ b/packages/nodes-base/nodes/Spotify/GenericFunctions.ts @@ -0,0 +1,84 @@ +import { OptionsWithUri } from 'request'; + +import { + IExecuteFunctions, + IHookFunctions, +} from 'n8n-core'; + +import { + IDataObject, +} from 'n8n-workflow'; + +/** + * Make an API request to Spotify + * + * @param {IHookFunctions} this + * @param {string} method + * @param {string} url + * @param {object} body + * @returns {Promise} + */ +export async function spotifyApiRequest(this: IHookFunctions | IExecuteFunctions, + method: string, endpoint: string, body: object, query?: object, uri?: string): Promise { // tslint:disable-line:no-any + + const options: OptionsWithUri = { + method, + headers: { + 'User-Agent': 'n8n', + 'Content-Type': 'text/plain', + 'Accept': ' application/json', + }, + body, + qs: query, + uri: uri || `https://api.spotify.com/v1${endpoint}`, + json: true + }; + + try { + const credentials = this.getCredentials('spotifyOAuth2Api'); + + if (credentials === undefined) { + throw new Error('No credentials got returned!'); + } + + if (Object.keys(body).length === 0) { + delete options.body; + } + + return await this.helpers.requestOAuth2.call(this, 'spotifyOAuth2Api', options); + } catch (error) { + if (error.statusCode === 401) { + // Return a clear error + throw new Error('The Spotify credentials are not valid!'); + } + + if (error.error && error.error.error && error.error.error.message) { + // Try to return the error prettier + throw new Error(`Spotify error response [${error.error.error.status}]: ${error.error.error.message}`); + } + + // If that data does not exist for some reason return the actual error + throw error; + } +} + +export async function spotifyApiRequestAllItems(this: IHookFunctions | IExecuteFunctions, + propertyName: string, method: string, endpoint: string, body: object, query?: object): Promise { // tslint:disable-line:no-any + + const returnData: IDataObject[] = []; + + let responseData; + + let uri: string | undefined; + + do { + responseData = await spotifyApiRequest.call(this, method, endpoint, body, query, uri); + returnData.push.apply(returnData, responseData[propertyName]); + uri = responseData.next; + + } while ( + responseData['next'] !== null + ); + + return returnData; +} diff --git a/packages/nodes-base/nodes/Spotify/Spotify.node.ts b/packages/nodes-base/nodes/Spotify/Spotify.node.ts new file mode 100644 index 0000000000..b0c2df8119 --- /dev/null +++ b/packages/nodes-base/nodes/Spotify/Spotify.node.ts @@ -0,0 +1,816 @@ +import { + IExecuteFunctions, +} from 'n8n-core'; + +import { + IDataObject, + INodeExecutionData, + INodeType, + INodeTypeDescription, +} from 'n8n-workflow'; + +import { + spotifyApiRequest, + spotifyApiRequestAllItems, +} from './GenericFunctions'; + +export class Spotify implements INodeType { + description: INodeTypeDescription = { + displayName: 'Spotify', + name: 'spotify', + icon: 'file:spotify.png', + group: ['input'], + version: 1, + description: 'Access public song data via the Spotify API.', + subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}', + defaults: { + name: 'Spotify', + color: '#1DB954', + }, + inputs: ['main'], + outputs: ['main'], + credentials: [ + { + name: 'spotifyOAuth2Api', + required: true, + }, + ], + properties: [ + // ---------------------------------------------------------- + // Resource to Operate on + // Player, Album, Artisits, Playlists, Tracks + // ---------------------------------------------------------- + { + displayName: 'Resource', + name: 'resource', + type: 'options', + options: [ + { + name: 'Album', + value: 'album', + }, + { + name: 'Artist', + value: 'artist', + }, + { + name: 'Player', + value: 'player', + }, + { + name: 'Playlist', + value: 'playlist', + }, + { + name: 'Track', + value: 'track', + }, + ], + default: 'player', + description: 'The resource to operate on.', + }, + // -------------------------------------------------------------------------------------------------------- + // Player Operations + // Pause, Play, Get Recently Played, Get Currently Playing, Next Song, Previous Song, Add to Queue + // -------------------------------------------------------------------------------------------------------- + { + displayName: 'Operation', + name: 'operation', + type: 'options', + displayOptions: { + show: { + resource: [ + 'player', + ], + }, + }, + options: [ + { + name: 'Add Song to Queue', + value: 'addSongToQueue', + description: 'Add a song to your queue.' + }, + { + name: 'Currently Playing', + value: 'currentlyPlaying', + description: 'Get your currently playing track.' + }, + { + name: 'Next Song', + value: 'nextSong', + description: 'Skip to your next track.' + }, + { + name: 'Pause', + value: 'pause', + description: 'Pause your music.', + }, + { + name: 'Previous Song', + value: 'previousSong', + description: 'Skip to your previous song.' + }, + { + name: 'Recently Played', + value: 'recentlyPlayed', + description: 'Get your recently played tracks.' + }, + { + name: 'Start Music', + value: 'startMusic', + description: 'Start playing a playlist, artist, or album.' + }, + ], + default: 'addSongToQueue', + description: 'The operation to perform.', + }, + { + displayName: 'Resource ID', + name: 'id', + type: 'string', + default: '', + required: true, + displayOptions: { + show: { + resource: [ + 'player' + ], + operation: [ + 'startMusic', + ], + }, + }, + placeholder: 'spotify:album:1YZ3k65Mqw3G8FzYlW1mmp', + description: `Enter a playlist, artist, or album URI or ID.`, + }, + { + displayName: 'Track ID', + name: 'id', + type: 'string', + default: '', + required: true, + displayOptions: { + show: { + resource: [ + 'player' + ], + operation: [ + 'addSongToQueue', + ], + }, + }, + placeholder: 'spotify:track:0xE4LEFzSNGsz1F6kvXsHU', + description: `Enter a track URI or ID.`, + }, + // ----------------------------------------------- + // Album Operations + // Get an Album, Get an Album's Tracks + // ----------------------------------------------- + { + displayName: 'Operation', + name: 'operation', + type: 'options', + displayOptions: { + show: { + resource: [ + 'album', + ], + }, + }, + options: [ + { + name: 'Get', + value: 'get', + description: 'Get an album by URI or ID.', + }, + { + name: `Get Tracks`, + value: 'getTracks', + description: `Get an album's tracks by URI or ID.`, + }, + ], + default: 'get', + description: 'The operation to perform.', + }, + { + displayName: 'Album ID', + name: 'id', + type: 'string', + default: '', + required: true, + displayOptions: { + show: { + resource: [ + 'album', + ], + }, + }, + placeholder: 'spotify:album:1YZ3k65Mqw3G8FzYlW1mmp', + description: `The album's Spotify URI or ID.`, + }, + // ------------------------------------------------------------------------------------------------------------- + // Artist Operations + // Get an Artist, Get an Artist's Related Artists, Get an Artist's Top Tracks, Get an Artist's Albums + // ------------------------------------------------------------------------------------------------------------- + { + displayName: 'Operation', + name: 'operation', + type: 'options', + displayOptions: { + show: { + resource: [ + 'artist', + ], + }, + }, + options: [ + { + name: 'Get', + value: 'get', + description: 'Get an artist by URI or ID.', + }, + { + name: `Get Albums`, + value: 'getAlbums', + description: `Get an artist's albums by URI or ID.`, + }, + { + name: `Get Related Artists`, + value: 'getRelatedArtists', + description: `Get an artist's related artists by URI or ID.`, + }, + { + name: `Get Top Tracks`, + value: 'getTopTracks', + description: `Get an artist's top tracks by URI or ID.`, + }, + ], + default: 'get', + description: 'The operation to perform.', + }, + { + displayName: 'Artist ID', + name: 'id', + type: 'string', + default: '', + required: true, + displayOptions: { + show: { + resource: [ + 'artist', + ], + }, + }, + placeholder: 'spotify:artist:4LLpKhyESsyAXpc4laK94U', + description: `The artist's Spotify URI or ID.`, + }, + { + displayName: 'Country', + name: 'country', + type: 'string', + default: 'US', + required: true, + displayOptions: { + show: { + resource: [ + 'artist' + ], + operation: [ + 'getTopTracks', + ], + }, + }, + placeholder: 'US', + description: `Top tracks in which country? Enter the postal abbriviation.`, + }, + // ------------------------------------------------------------------------------------------------------------- + // Playlist Operations + // Get a Playlist, Get a Playlist's Tracks, Add/Remove a Song from a Playlist, Get a User's Playlists + // ------------------------------------------------------------------------------------------------------------- + { + displayName: 'Operation', + name: 'operation', + type: 'options', + displayOptions: { + show: { + resource: [ + 'playlist', + ], + }, + }, + options: [ + { + name: 'Add an Item', + value: 'add', + description: 'Add tracks from a playlist by track and playlist URI or ID.', + }, + { + name: 'Get', + value: 'get', + description: 'Get a playlist by URI or ID.', + }, + { + name: 'Get Tracks', + value: 'getTracks', + description: `Get a playlist's tracks by URI or ID.`, + }, + { + name: `Get the User's Playlists`, + value: 'getUserPlaylists', + description: `Get a user's playlists.`, + }, + { + name: 'Remove an Item', + value: 'delete', + description: 'Remove tracks from a playlist by track and playlist URI or ID.', + }, + ], + default: 'add', + description: 'The operation to perform.', + }, + { + displayName: 'Playlist ID', + name: 'id', + type: 'string', + default: '', + required: true, + displayOptions: { + show: { + resource: [ + 'playlist' + ], + operation: [ + 'add', + 'delete', + 'get', + 'getTracks' + ], + }, + }, + placeholder: 'spotify:playlist:37i9dQZF1DWUhI3iC1khPH', + description: `The playlist's Spotify URI or its ID.`, + }, + { + displayName: 'Track ID', + name: 'trackID', + type: 'string', + default: '', + required: true, + displayOptions: { + show: { + resource: [ + 'playlist' + ], + operation: [ + 'add', + 'delete' + ], + }, + }, + placeholder: 'spotify:track:0xE4LEFzSNGsz1F6kvXsHU', + description: `The track's Spotify URI or its ID. The track to add/delete from the playlist.`, + }, + // ----------------------------------------------------- + // Track Operations + // Get a Track, Get a Track's Audio Features + // ----------------------------------------------------- + { + displayName: 'Operation', + name: 'operation', + type: 'options', + displayOptions: { + show: { + resource: [ + 'track', + ], + }, + }, + options: [ + { + name: 'Get', + value: 'get', + description: 'Get a track by its URI or ID.', + }, + { + name: 'Get Audio Features', + value: 'getAudioFeatures', + description: 'Get audio features for a track by URI or ID.', + }, + ], + default: 'track', + description: 'The operation to perform.', + }, + { + displayName: 'Track ID', + name: 'id', + type: 'string', + default: '', + required: true, + displayOptions: { + show: { + resource: [ + 'track', + ], + }, + }, + placeholder: 'spotify:track:0xE4LEFzSNGsz1F6kvXsHU', + description: `The track's Spotify URI or ID.`, + }, + { + displayName: 'Return All', + name: 'returnAll', + type: 'boolean', + default: false, + required: true, + displayOptions: { + show: { + resource: [ + 'album', + 'artist', + 'playlist' + ], + operation: [ + 'getTracks', + 'getAlbums', + 'getUserPlaylists' + ] + }, + }, + description: `The number of items to return.`, + }, + { + displayName: 'Limit', + name: 'limit', + type: 'number', + default: 50, + required: true, + displayOptions: { + show: { + resource: [ + 'album', + 'artist', + 'playlist' + ], + operation: [ + 'getTracks', + 'getAlbums', + 'getUserPlaylists' + ], + returnAll: [ + false + ] + }, + }, + typeOptions: { + minValue: 1, + maxValue: 100, + }, + description: `The number of items to return.`, + }, + { + displayName: 'Limit', + name: 'limit', + type: 'number', + default: 50, + required: true, + displayOptions: { + show: { + resource: [ + 'player', + ], + operation: [ + 'recentlyPlayed', + ], + }, + }, + typeOptions: { + minValue: 1, + maxValue: 50, + }, + description: `The number of items to return.`, + }, + ] + }; + + + async execute(this: IExecuteFunctions): Promise { + // Get all of the incoming input data to loop through + const items = this.getInputData(); + const returnData: IDataObject[] = []; + + // For Post + let body: IDataObject; + // For Query string + let qs: IDataObject; + + let requestMethod: string; + let endpoint: string; + let returnAll: boolean; + let propertyName = ''; + let responseData; + + const operation = this.getNodeParameter('operation', 0) as string; + const resource = this.getNodeParameter('resource', 0) as string; + + // Set initial values + requestMethod = 'GET'; + endpoint = ''; + body = {}; + qs = {}; + returnAll = false; + + for(let i = 0; i < items.length; i++) { + // ----------------------------- + // Player Operations + // ----------------------------- + if( resource === 'player' ) { + if(operation === 'pause') { + requestMethod = 'PUT'; + + endpoint = `/me/player/pause`; + + responseData = await spotifyApiRequest.call(this, requestMethod, endpoint, body, qs); + + responseData = { success: true }; + + } else if(operation === 'recentlyPlayed') { + requestMethod = 'GET'; + + endpoint = `/me/player/recently-played`; + + const limit = this.getNodeParameter('limit', i) as number; + + qs = { + 'limit': limit + }; + + responseData = await spotifyApiRequest.call(this, requestMethod, endpoint, body, qs); + + responseData = responseData.items; + + } else if(operation === 'currentlyPlaying') { + requestMethod = 'GET'; + + endpoint = `/me/player/currently-playing`; + + responseData = await spotifyApiRequest.call(this, requestMethod, endpoint, body, qs); + + } else if(operation === 'nextSong') { + requestMethod = 'POST'; + + endpoint = `/me/player/next`; + + responseData = await spotifyApiRequest.call(this, requestMethod, endpoint, body, qs); + + responseData = { success: true }; + + } else if(operation === 'previousSong') { + requestMethod = 'POST'; + + endpoint = `/me/player/previous`; + + responseData = await spotifyApiRequest.call(this, requestMethod, endpoint, body, qs); + + responseData = { success: true }; + + } else if(operation === 'startMusic') { + requestMethod = 'PUT'; + + endpoint = `/me/player/play`; + + const id = this.getNodeParameter('id', i) as string; + + body.context_uri = id; + + responseData = await spotifyApiRequest.call(this, requestMethod, endpoint, body, qs); + + responseData = { success: true }; + + } else if(operation === 'addSongToQueue') { + requestMethod = 'POST'; + + endpoint = `/me/player/queue`; + + const id = this.getNodeParameter('id', i) as string; + + qs = { + 'uri': id + }; + + responseData = await spotifyApiRequest.call(this, requestMethod, endpoint, body, qs); + + responseData = { success: true }; + } + // ----------------------------- + // Album Operations + // ----------------------------- + } else if( resource === 'album') { + const uri = this.getNodeParameter('id', i) as string; + + const id = uri.replace('spotify:album:', ''); + + requestMethod = 'GET'; + + if(operation === 'get') { + endpoint = `/albums/${id}`; + + responseData = await spotifyApiRequest.call(this, requestMethod, endpoint, body, qs); + + } else if(operation === 'getTracks') { + endpoint = `/albums/${id}/tracks`; + + propertyName = 'tracks'; + + returnAll = this.getNodeParameter('returnAll', i) as boolean; + + propertyName = 'items'; + + if(!returnAll) { + const limit = this.getNodeParameter('limit', i) as number; + + qs = { + 'limit': limit + }; + + responseData = await spotifyApiRequest.call(this, requestMethod, endpoint, body, qs); + + responseData = responseData.items; + } + } + // ----------------------------- + // Artist Operations + // ----------------------------- + } else if( resource === 'artist') { + const uri = this.getNodeParameter('id', i) as string; + + const id = uri.replace('spotify:artist:', ''); + + if(operation === 'getAlbums') { + + endpoint = `/artists/${id}/albums`; + + returnAll = this.getNodeParameter('returnAll', i) as boolean; + + propertyName = 'items'; + + if(!returnAll) { + const limit = this.getNodeParameter('limit', i) as number; + + qs = { + 'limit': limit + }; + + responseData = await spotifyApiRequest.call(this, requestMethod, endpoint, body, qs); + + responseData = responseData.items; + } + } else if(operation === 'getRelatedArtists') { + + endpoint = `/artists/${id}/related-artists`; + + responseData = await spotifyApiRequest.call(this, requestMethod, endpoint, body, qs); + + responseData = responseData.artists; + + } else if(operation === 'getTopTracks'){ + const country = this.getNodeParameter('country', i) as string; + + qs = { + 'country': country + }; + + endpoint = `/artists/${id}/top-tracks`; + + responseData = await spotifyApiRequest.call(this, requestMethod, endpoint, body, qs); + + responseData = responseData.tracks; + + } else if (operation === 'get') { + + requestMethod = 'GET'; + + endpoint = `/artists/${id}`; + + responseData = await spotifyApiRequest.call(this, requestMethod, endpoint, body, qs); + } + // ----------------------------- + // Playlist Operations + // ----------------------------- + } else if( resource === 'playlist') { + if(['delete', 'get', 'getTracks', 'add'].includes(operation)) { + const uri = this.getNodeParameter('id', i) as string; + + const id = uri.replace('spotify:playlist:', ''); + + if(operation === 'delete') { + requestMethod = 'DELETE'; + const trackId = this.getNodeParameter('trackID', i) as string; + + body.tracks = [ + { + "uri": `${trackId}`, + "positions": [ 0 ] + } + ]; + + endpoint = `/playlists/${id}/tracks`; + + responseData = await spotifyApiRequest.call(this, requestMethod, endpoint, body, qs); + + responseData = { success: true }; + + } else if(operation === 'get') { + requestMethod = 'GET'; + + endpoint = `/playlists/${id}`; + + responseData = await spotifyApiRequest.call(this, requestMethod, endpoint, body, qs); + + } else if(operation === 'getTracks') { + requestMethod = 'GET'; + + endpoint = `/playlists/${id}/tracks`; + + returnAll = this.getNodeParameter('returnAll', i) as boolean; + + propertyName = 'items'; + + if(!returnAll) { + const limit = this.getNodeParameter('limit', i) as number; + + qs = { + 'limit': limit + }; + + responseData = await spotifyApiRequest.call(this, requestMethod, endpoint, body, qs); + + responseData = responseData.items; + } + } else if(operation === 'add') { + requestMethod = 'POST'; + + const trackId = this.getNodeParameter('trackID', i) as string; + + qs = { + 'uris': trackId + }; + + endpoint = `/playlists/${id}/tracks`; + + responseData = await spotifyApiRequest.call(this, requestMethod, endpoint, body, qs); + + } + } else if(operation === 'getUserPlaylists') { + requestMethod = 'GET'; + + endpoint = `/me/playlists`; + + returnAll = this.getNodeParameter('returnAll', i) as boolean; + + propertyName = 'items'; + + if(!returnAll) { + const limit = this.getNodeParameter('limit', i) as number; + + qs = { + 'limit': limit + }; + + responseData = await spotifyApiRequest.call(this, requestMethod, endpoint, body, qs); + + responseData = responseData.items; + } + } + // ----------------------------- + // Track Operations + // ----------------------------- + } else if( resource === 'track') { + const uri = this.getNodeParameter('id', i) as string; + + const id = uri.replace('spotify:track:', ''); + + requestMethod = 'GET'; + + if(operation === 'getAudioFeatures') { + endpoint = `/audio-features/${id}`; + } else if(operation === 'get') { + endpoint = `/tracks/${id}`; + } + + responseData = await spotifyApiRequest.call(this, requestMethod, endpoint, body, qs); + } + + if(returnAll) { + responseData = await spotifyApiRequestAllItems.call(this, propertyName, requestMethod, endpoint, body, qs); + } + + if (Array.isArray(responseData)) { + returnData.push.apply(returnData, responseData as IDataObject[]); + } else { + returnData.push(responseData as IDataObject); + } + } + + return [this.helpers.returnJsonArray(returnData)]; + } +} diff --git a/packages/nodes-base/nodes/Spotify/spotify.png b/packages/nodes-base/nodes/Spotify/spotify.png new file mode 100644 index 0000000000000000000000000000000000000000..2feeb78bbf25c43b2e1ceab5ee5f382eb790b207 GIT binary patch literal 6664 zcmZu$WmptI*CiyRL^`EQVp+PoySsa-1$OC%1*994E|HM#5D;mkTe`bbsSn@ydY)(M z&bjB_bLZboq?(E>CK?GE92^{`yquKA%PjP_qaweI0uKvrFB3dOLskN=a+GZUW%Jra zP9FjXhmQNV!^34{5xoG0L0WoHJ!K^UORy80xfR&Ln$63}aPByTcEda>R&ktbd0B~@yz93j3-p){SFIHy=%|A*0%_C(E zv2+8uKtW(<%D=qk7GQU%Fg5kxK>ykPm8X--e+F`f{7cn~K7g0G3joN*4*36^pdg$7 zO7DMo{XO}o+dowOGnmjzX#^zQtj(cdH!U#OQAGT2?I`7)%x$eTtj(>wg#iB>@n4w= z{iPI8bpu(yX#J~51SkafKem72g#dr${x|vmtnELnFU1u>dx`Y#ixNR&VjB^LgCm@k zmlD^qLmDxB{ZVTsRRmnB>#KW>#bsEdAbr9e!^mj5hB0*X(czp;Dj45vlFq^fMYr?QT}eS{?isA9gzel-;K=F;!xkydKkh zPg`t7cXMtN_AGf88$U19%ax{EgrlR4r9{NDRV}6qa<$AHkmc6ZZYnKSDkYhu)W^#G zn$(V`wMMA@qFlGFBUyWUC%;Un^B@>5zrFYbx#IOuOtNY@vvXJatdFjoMBBEz;B6we z%OC$ytu!D}qE7X#&vW8xfCqTzOqn63C(A>SyK>6bL4T$=1*A61KIni`N-6ohfJcW1 zKT=7bT3LI5X1HjN=l7%s8|}S^jMb{)4`Dih5dWVJcVWKD9Hj0;alUNc^!rWaVAF3o> zvSaT>2z-V_N0IVdMMKlC;S|pv*Z9L#$(6$wOApto-$|CVS2k>O*W|QAwB$=pJIU_i zkpv+qC!m`z%$?8eFojsBzdB6hHy3cY+G(Lj-uq&_oHldF$hxX#pgEGabRCMJ5)Mpej&&8WP#x6<0H>eKRddXDj(Bv z_8PhO^=08Hm<(eAk@^_tzApLM_||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DZu zM0S=Z^H+q1s{xJ`OD==CtvA?TB)MyIY1(4+_H4LA^#i+rF+`}_9Bm8cyG2;JUzN@Y zCVG8(iw_IamwhF#IKh`&e(lJw(&m76A>LU1`!7$p!3U@yn%j=cvB)>4i$y#$9ZAA4 zC)Esv0SCOiO1MZyHShC4*FPuiOV{46yse&!iIOxD9ZuG3M2obV+K42|T7_Knx~={e zc{};1>0^O1KO=O^Wy9aZjmCEFN>xYObwnZZA2-C^cGlB19OgFJX0okrg9~H%@$NVV zW|SA+Q}s%*VuWlIu=M+!zkzM^6LG3Nj8H0f4Rg>%^75JI%Fqalm&yJ9nP{*7*xWTh zx61tOSQ?vw>&QrJzIQ=5m+BEi8&hZpsKX=HhiQQZ_5%xZ*iSVpEBLG>5uo7;gj-${7^}Y;i7QprJkQAcgKPq0L&{$gOsEb^rtDK z&fO0oIW__>(659{IQ(Gi#{T&%{Jf(z-Ue2tCbRDhOtM6`ypS-k%PIfUO8I1O>p@BO yuDUBI#tL~Id;c)#1LY@6KIaUBA^!o!Zi|xu literal 0 HcmV?d00001 diff --git a/packages/nodes-base/package.json b/packages/nodes-base/package.json index a09d97d032..7782a493b1 100644 --- a/packages/nodes-base/package.json +++ b/packages/nodes-base/package.json @@ -119,6 +119,7 @@ "dist/credentials/StripeApi.credentials.js", "dist/credentials/SalesmateApi.credentials.js", "dist/credentials/SegmentApi.credentials.js", + "dist/credentials/SpotifyOAuth2Api.credentials.js", "dist/credentials/SurveyMonkeyApi.credentials.js", "dist/credentials/SurveyMonkeyOAuth2Api.credentials.js", "dist/credentials/TelegramApi.credentials.js", @@ -263,6 +264,7 @@ "dist/nodes/Slack/Slack.node.js", "dist/nodes/Sms77/Sms77.node.js", "dist/nodes/SplitInBatches.node.js", + "dist/nodes/Spotify/Spotify.node.js", "dist/nodes/SpreadsheetFile.node.js", "dist/nodes/SseTrigger.node.js", "dist/nodes/Start.node.js", From dee03a5e4c0de14911edcbeb899902774ce93ab1 Mon Sep 17 00:00:00 2001 From: shraddha shaligram Date: Wed, 24 Jun 2020 15:50:23 -0700 Subject: [PATCH 121/241] minor fix --- packages/nodes-base/nodes/Zoom/MeetingDescription.ts | 7 +++++++ packages/nodes-base/nodes/Zoom/Zoom.node.ts | 5 +++++ 2 files changed, 12 insertions(+) diff --git a/packages/nodes-base/nodes/Zoom/MeetingDescription.ts b/packages/nodes-base/nodes/Zoom/MeetingDescription.ts index 3efcc2a2bc..0df1f35b72 100644 --- a/packages/nodes-base/nodes/Zoom/MeetingDescription.ts +++ b/packages/nodes-base/nodes/Zoom/MeetingDescription.ts @@ -277,6 +277,13 @@ export const meetingFields = [ default: '', description: `Time zone used in the response. The default is the time zone of the calendar.`, }, + { + displayName: 'Waiting Room', + name: 'waitingRoom', + type: 'boolean', + default: false, + description: 'Enable waiting room.', + }, { displayName: 'Watermark', name: 'watermark', diff --git a/packages/nodes-base/nodes/Zoom/Zoom.node.ts b/packages/nodes-base/nodes/Zoom/Zoom.node.ts index e6e6a78600..52435e5ab9 100644 --- a/packages/nodes-base/nodes/Zoom/Zoom.node.ts +++ b/packages/nodes-base/nodes/Zoom/Zoom.node.ts @@ -41,6 +41,7 @@ interface Settings { join_before_host?: boolean; mute_upon_entry?: boolean; watermark?: boolean; + waiting_room?: boolean; audio?: string; alternative_hosts?: string; auto_recording?: string; @@ -278,6 +279,10 @@ export class Zoom implements INodeType { if (additionalFields.muteUponEntry) { settings.mute_upon_entry = additionalFields.muteUponEntry as boolean; + } + if (additionalFields.waitingRoom) { + settings.waiting_room = additionalFields.waitingRoom as boolean; + } if (additionalFields.watermark) { From 4555d6bfc9a18df485990968fb34c70de5b2242a Mon Sep 17 00:00:00 2001 From: ricardo Date: Wed, 24 Jun 2020 19:28:08 -0400 Subject: [PATCH 122/241] :zap: Improvements to Zoom-Node --- .../nodes-base/nodes/Zoom/GenericFunctions.ts | 1 + .../nodes/Zoom/MeetingDescription.ts | 592 +++++---- .../Zoom/MeetingRegistrantDescription.ts | 31 +- packages/nodes-base/nodes/Zoom/Zoom.node.ts | 1060 ++++++++--------- 4 files changed, 821 insertions(+), 863 deletions(-) diff --git a/packages/nodes-base/nodes/Zoom/GenericFunctions.ts b/packages/nodes-base/nodes/Zoom/GenericFunctions.ts index 6a8593e3ab..95e07f09b9 100644 --- a/packages/nodes-base/nodes/Zoom/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Zoom/GenericFunctions.ts @@ -33,6 +33,7 @@ export async function zoomApiRequest(this: IExecuteFunctions | IExecuteSingleFun if (Object.keys(query).length === 0) { delete options.qs; } + try { if (authenticationMethod === 'accessToken') { const credentials = this.getCredentials('zoomApi'); diff --git a/packages/nodes-base/nodes/Zoom/MeetingDescription.ts b/packages/nodes-base/nodes/Zoom/MeetingDescription.ts index 3efcc2a2bc..130830b9fe 100644 --- a/packages/nodes-base/nodes/Zoom/MeetingDescription.ts +++ b/packages/nodes-base/nodes/Zoom/MeetingDescription.ts @@ -43,31 +43,13 @@ export const meetingOperations = [ ], default: 'create', description: 'The operation to perform.', - } + }, ] as INodeProperties[]; export const meetingFields = [ /* -------------------------------------------------------------------------- */ - /* meeting:create */ + /* meeting:create */ /* -------------------------------------------------------------------------- */ - { - displayName: 'User ID', - name: 'userId', - type: 'string', - default: '', - required: true, - displayOptions: { - show: { - operation: [ - 'create', - ], - resource: [ - 'meeting', - ], - }, - }, - description: 'User ID or Email Address.', - }, { displayName: 'Additional Fields', name: 'additionalFields', @@ -90,98 +72,29 @@ export const meetingFields = [ displayName: 'Agenda', name: 'agenda', type: 'string', + typeOptions: { + alwaysOpenEditWindow: true, + }, default: '', description: 'Meeting agenda.', }, - { - displayName: 'Alternative Hosts', - name: 'alternativeHosts', - type: 'string', - default: '', - description: 'Alternative hosts email IDs.', - }, - { - displayName: 'Auto Recording', - name: 'autoRecording', - type: 'options', - options: [ - { - name: 'Record on Local', - value: 'local', - }, - { - name: 'Record on Cloud', - value: 'cloud', - }, - { - name: 'Disabled', - value: 'none', - }, - ], - default: 'none', - description: 'Auto recording.', - }, - { - displayName: 'Audio', - name: 'audio', - type: 'options', - options: [ - { - name: 'Both Telephony and VoiP', - value: 'both', - }, - { - name: 'Telephony', - value: 'telephony', - }, - { - name: 'VOIP', - value: 'voip', - }, - - ], - default: 'both', - description: 'Determine how participants can join audio portion of the meeting.', - }, { displayName: 'Duration', name: 'duration', type: 'number', - default: '', - description: 'Duration.', - }, - { - displayName: 'Host Meeting in China', - name: 'cnMeeting', - type: 'boolean', - default: false, - description: 'Host Meeting in China.', - }, - { - displayName: 'Host Meeting in India', - name: 'inMeeting', - type: 'boolean', - default: false, - description: 'Host Meeting in India.', - }, - { - displayName: 'Host Video', - name: 'hostVideo', - type: 'boolean', - default: false, - description: 'Start video when host joins the meeting.', - }, - { - displayName: 'Join Before Host', - name: 'joinBeforeHost', - type: 'boolean', - default: false, - description: 'Allow participants to join the meeting before host starts it.', + typeOptions: { + minValue: 0, + }, + default: 0, + description: 'Meeting duration (minutes).', }, { displayName: 'Meeting Topic', name: 'topic', type: 'string', + typeOptions: { + alwaysOpenEditWindow: true, + }, default: '', description: `Meeting topic.`, }, @@ -211,20 +124,6 @@ export const meetingFields = [ default: 2, description: 'Meeting type.', }, - { - displayName: 'Muting before entry', - name: 'muteUponEntry', - type: 'boolean', - default: false, - description: 'Mute participants upon entry.', - }, - { - displayName: 'Participant Video', - name: 'participantVideo', - type: 'boolean', - default: false, - description: 'Start video when participant joins the meeting.', - }, { displayName: 'Password', name: 'password', @@ -232,27 +131,6 @@ export const meetingFields = [ default: '', description: 'Password to join the meeting with maximum 10 characters.', }, - { - displayName: 'Registration Type', - name: 'registrationType', - type: 'options', - options: [ - { - name: 'Attendees register once and can attend any of the occurences', - value: 1, - }, - { - name: 'Attendees need to register for every occurrence', - value: 2, - }, - { - name: 'Attendees register once and can choose one or more occurrences to attend', - value: 3, - }, - ], - default: 1, - description: 'Registration type. Used for recurring meetings with fixed time only', - }, { displayName: 'Schedule For', name: 'scheduleFor', @@ -260,6 +138,135 @@ export const meetingFields = [ default: '', description: 'Schedule meeting for someone else from your account, provide their email ID.', }, + { + displayName: 'Settings', + name: 'settings', + type: 'collection', + placeholder: 'Add Setting', + default: {}, + options: [ + { + displayName: 'Audio', + name: 'audio', + type: 'options', + options: [ + { + name: 'Both Telephony and VoiP', + value: 'both', + }, + { + name: 'Telephony', + value: 'telephony', + }, + { + name: 'VOIP', + value: 'voip', + }, + + ], + default: 'both', + description: 'Determine how participants can join audio portion of the meeting.', + }, + { + displayName: 'Alternative Hosts', + name: 'alternativeHosts', + type: 'string', + default: '', + description: 'Alternative hosts email IDs.', + }, + { + displayName: 'Auto Recording', + name: 'autoRecording', + type: 'options', + options: [ + { + name: 'Record on Local', + value: 'local', + }, + { + name: 'Record on Cloud', + value: 'cloud', + }, + { + name: 'Disabled', + value: 'none', + }, + ], + default: 'none', + description: 'Auto recording.', + }, + { + displayName: 'Host Meeting in China', + name: 'cnMeeting', + type: 'boolean', + default: false, + description: 'Host Meeting in China.', + }, + { + displayName: 'Host Meeting in India', + name: 'inMeeting', + type: 'boolean', + default: false, + description: 'Host Meeting in India.', + }, + { + displayName: 'Host Video', + name: 'hostVideo', + type: 'boolean', + default: false, + description: 'Start video when host joins the meeting.', + }, + { + displayName: 'Join Before Host', + name: 'joinBeforeHost', + type: 'boolean', + default: false, + description: 'Allow participants to join the meeting before host starts it.', + }, + { + displayName: 'Muting Upon Entry', + name: 'muteUponEntry', + type: 'boolean', + default: false, + description: 'Mute participants upon entry.', + }, + { + displayName: 'Participant Video', + name: 'participantVideo', + type: 'boolean', + default: false, + description: 'Start video when participant joins the meeting.', + }, + { + displayName: 'Registration Type', + name: 'registrationType', + type: 'options', + options: [ + { + name: 'Attendees register once and can attend any of the occurences', + value: 1, + }, + { + name: 'Attendees need to register for every occurrence', + value: 2, + }, + { + name: 'Attendees register once and can choose one or more occurrences to attend', + value: 3, + }, + ], + default: 1, + description: 'Registration type. Used for recurring meetings with fixed time only', + }, + { + displayName: 'Watermark', + name: 'watermark', + type: 'boolean', + default: false, + description: 'Adds watermark when viewing a shared screen.', + }, + ], + }, { displayName: 'Start Time', name: 'startTime', @@ -277,13 +284,6 @@ export const meetingFields = [ default: '', description: `Time zone used in the response. The default is the time zone of the calendar.`, }, - { - displayName: 'Watermark', - name: 'watermark', - type: 'boolean', - default: false, - description: 'Adds watermark when viewing a shared screen.', - }, ], }, /* -------------------------------------------------------------------------- */ @@ -342,26 +342,8 @@ export const meetingFields = [ ], }, /* -------------------------------------------------------------------------- */ - /* meeting:getAll */ + /* meeting:getAll */ /* -------------------------------------------------------------------------- */ - { - displayName: 'User ID', - name: 'userId', - type: 'string', - default: '', - required: true, - displayOptions: { - show: { - operation: [ - 'getAll', - ], - resource: [ - 'meeting', - ], - }, - }, - description: 'User ID or email-ID.', - }, { displayName: 'Return All', name: 'returnAll', @@ -404,10 +386,10 @@ export const meetingFields = [ description: 'How many results to return.', }, { - displayName: 'Additional Fields', - name: 'additionalFields', + displayName: 'Filters', + name: 'filters', type: 'collection', - placeholder: 'Add Field', + placeholder: 'Add Filter', default: {}, displayOptions: { show: { @@ -429,23 +411,26 @@ export const meetingFields = [ { name: 'Scheduled', value: 'scheduled', + description: 'This includes all valid past meetings, live meetings and upcoming scheduled meetings' }, { name: 'Live', value: 'live', + description: 'All ongoing meetings', }, { name: 'Upcoming', value: 'upcoming', + description: 'All upcoming meetings including live meetings', }, ], default: 'live', description: `Meeting type.`, }, - ] + ], }, /* -------------------------------------------------------------------------- */ - /* meeting:delete */ + /* meeting:delete */ /* -------------------------------------------------------------------------- */ { displayName: 'Meeting ID', @@ -500,7 +485,7 @@ export const meetingFields = [ }, /* -------------------------------------------------------------------------- */ - /* meeting:update */ + /* meeting:update */ /* -------------------------------------------------------------------------- */ { displayName: 'Meeting ID', @@ -521,8 +506,8 @@ export const meetingFields = [ description: 'Meeting ID.', }, { - displayName: 'Additional Fields', - name: 'additionalFields', + displayName: 'Update Fields', + name: 'updateFields', type: 'collection', placeholder: 'Add Field', default: {}, @@ -541,100 +526,21 @@ export const meetingFields = [ displayName: 'Agenda', name: 'agenda', type: 'string', + typeOptions: { + alwaysOpenEditWindow: true, + }, default: '', description: 'Meeting agenda.', }, - { - displayName: 'Alternative Hosts', - name: 'alternativeHosts', - type: 'string', - default: '', - description: 'Alternative hosts email IDs.', - }, - { - displayName: 'Audio', - name: 'audio', - type: 'options', - options: [ - { - name: 'Both Telephony and VoiP', - value: 'both', - }, - { - name: 'Telephony', - value: 'telephony', - }, - { - name: 'VOIP', - value: 'voip', - }, - ], - default: 'both', - description: 'Determine how participants can join audio portion of the meeting.', - }, - { - displayName: 'Auto Recording', - name: 'autoRecording', - type: 'options', - options: [ - { - name: 'Record on Local', - value: 'local', - }, - { - name: 'Record on Cloud', - value: 'cloud', - }, - { - name: 'Disabled', - value: 'none', - }, - ], - default: 'none', - description: 'Auto recording.', - }, - { displayName: 'Duration', name: 'duration', type: 'number', - default: '', - description: 'Duration.', - }, - { - displayName: 'Join Before Host', - name: 'joinBeforeHost', - type: 'boolean', - default: false, - description: 'Allow participants to join the meeting before host starts it.', - }, - { - displayName: 'Host Meeting in China', - name: 'cnMeeting', - type: 'boolean', - default: false, - description: 'Host Meeting in China.', - }, - { - displayName: 'Host Meeting in India', - name: 'inMeeting', - type: 'boolean', - default: false, - description: 'Host Meeting in India.', - }, - { - displayName: 'Host Video', - name: 'hostVideo', - type: 'boolean', - default: false, - description: 'Start video when host joins the meeting.', - }, - { - displayName: 'Occurrence ID', - name: 'occurrenceId', - type: 'string', - default: '', - description: 'Occurrence ID.', + typeOptions: { + minValue: 0, + }, + default: 0, + description: 'Meeting duration (minutes).', }, { displayName: 'Meeting Topic', @@ -669,13 +575,6 @@ export const meetingFields = [ default: 2, description: 'Meeting type.', }, - { - displayName: 'Muting Before Entry', - name: 'muteUponEntry', - type: 'boolean', - default: false, - description: 'Mute participants upon entry.', - }, { displayName: 'Password', name: 'password', @@ -683,34 +582,6 @@ export const meetingFields = [ default: '', description: 'Password to join the meeting with maximum 10 characters.', }, - { - displayName: 'Participant Video', - name: 'participantVideo', - type: 'boolean', - default: false, - description: 'Start video when participant joins the meeting.', - }, - { - displayName: 'Registration Type', - name: 'registrationType', - type: 'options', - options: [ - { - name: 'Attendees register once and can attend any of the occurrences', - value: 1, - }, - { - name: 'Attendees need to register for every occurrence', - value: 2, - }, - { - name: 'Attendees register once and can choose one or more occurrences to attend', - value: 3, - }, - ], - default: 1, - description: 'Registration type. Used for recurring meetings with fixed time only', - }, { displayName: 'Schedule For', name: 'scheduleFor', @@ -718,6 +589,135 @@ export const meetingFields = [ default: '', description: 'Schedule meeting for someone else from your account, provide their email ID.', }, + { + displayName: 'Settings', + name: 'settings', + type: 'collection', + placeholder: 'Add Setting', + default: {}, + options: [ + { + displayName: 'Audio', + name: 'audio', + type: 'options', + options: [ + { + name: 'Both Telephony and VoiP', + value: 'both', + }, + { + name: 'Telephony', + value: 'telephony', + }, + { + name: 'VOIP', + value: 'voip', + }, + + ], + default: 'both', + description: 'Determine how participants can join audio portion of the meeting.', + }, + { + displayName: 'Alternative Hosts', + name: 'alternativeHosts', + type: 'string', + default: '', + description: 'Alternative hosts email IDs.', + }, + { + displayName: 'Auto Recording', + name: 'autoRecording', + type: 'options', + options: [ + { + name: 'Record on Local', + value: 'local', + }, + { + name: 'Record on Cloud', + value: 'cloud', + }, + { + name: 'Disabled', + value: 'none', + }, + ], + default: 'none', + description: 'Auto recording.', + }, + { + displayName: 'Host Meeting in China', + name: 'cnMeeting', + type: 'boolean', + default: false, + description: 'Host Meeting in China.', + }, + { + displayName: 'Host Meeting in India', + name: 'inMeeting', + type: 'boolean', + default: false, + description: 'Host Meeting in India.', + }, + { + displayName: 'Host Video', + name: 'hostVideo', + type: 'boolean', + default: false, + description: 'Start video when host joins the meeting.', + }, + { + displayName: 'Join Before Host', + name: 'joinBeforeHost', + type: 'boolean', + default: false, + description: 'Allow participants to join the meeting before host starts it.', + }, + { + displayName: 'Muting Upon Entry', + name: 'muteUponEntry', + type: 'boolean', + default: false, + description: 'Mute participants upon entry.', + }, + { + displayName: 'Participant Video', + name: 'participantVideo', + type: 'boolean', + default: false, + description: 'Start video when participant joins the meeting.', + }, + { + displayName: 'Registration Type', + name: 'registrationType', + type: 'options', + options: [ + { + name: 'Attendees register once and can attend any of the occurences', + value: 1, + }, + { + name: 'Attendees need to register for every occurrence', + value: 2, + }, + { + name: 'Attendees register once and can choose one or more occurrences to attend', + value: 3, + }, + ], + default: 1, + description: 'Registration type. Used for recurring meetings with fixed time only', + }, + { + displayName: 'Watermark', + name: 'watermark', + type: 'boolean', + default: false, + description: 'Adds watermark when viewing a shared screen.', + }, + ], + }, { displayName: 'Start Time', name: 'startTime', @@ -735,16 +735,6 @@ export const meetingFields = [ default: '', description: `Time zone used in the response. The default is the time zone of the calendar.`, }, - { - displayName: 'Watermark', - name: 'watermark', - type: 'boolean', - default: false, - description: 'Adds watermark when viewing a shared screen.', - }, - - ], }, - ] as INodeProperties[]; diff --git a/packages/nodes-base/nodes/Zoom/MeetingRegistrantDescription.ts b/packages/nodes-base/nodes/Zoom/MeetingRegistrantDescription.ts index 5d40aae014..5438f18fa3 100644 --- a/packages/nodes-base/nodes/Zoom/MeetingRegistrantDescription.ts +++ b/packages/nodes-base/nodes/Zoom/MeetingRegistrantDescription.ts @@ -1,6 +1,7 @@ import { INodeProperties, } from 'n8n-workflow'; + export const meetingRegistrantOperations = [ { displayName: 'Operation', @@ -9,7 +10,7 @@ export const meetingRegistrantOperations = [ displayOptions: { show: { resource: [ - 'meetingRegistrants', + 'meetingRegistrant', ], }, }, @@ -38,7 +39,7 @@ export const meetingRegistrantOperations = [ export const meetingRegistrantFields = [ /* -------------------------------------------------------------------------- */ - /* meetingRegistrants:create */ + /* meetingRegistrant:create */ /* -------------------------------------------------------------------------- */ { displayName: 'Meeting Id', @@ -52,7 +53,7 @@ export const meetingRegistrantFields = [ 'create', ], resource: [ - 'meetingRegistrants', + 'meetingRegistrant', ], }, }, @@ -70,7 +71,7 @@ export const meetingRegistrantFields = [ 'create', ], resource: [ - 'meetingRegistrants', + 'meetingRegistrant', ], }, }, @@ -88,7 +89,7 @@ export const meetingRegistrantFields = [ 'create', ], resource: [ - 'meetingRegistrants', + 'meetingRegistrant', ], }, }, @@ -107,7 +108,7 @@ export const meetingRegistrantFields = [ ], resource: [ - 'meetingRegistrants', + 'meetingRegistrant', ], }, }, @@ -248,7 +249,7 @@ export const meetingRegistrantFields = [ ], }, /* -------------------------------------------------------------------------- */ - /* meetingRegistrants:getAll */ + /* meetingRegistrant:getAll */ /* -------------------------------------------------------------------------- */ { displayName: 'Meeting ID', @@ -262,7 +263,7 @@ export const meetingRegistrantFields = [ 'getAll', ], resource: [ - 'meetingRegistrants', + 'meetingRegistrant', ], }, }, @@ -278,7 +279,7 @@ export const meetingRegistrantFields = [ 'getAll', ], resource: [ - 'meetingRegistrants', + 'meetingRegistrant', ], }, }, @@ -295,7 +296,7 @@ export const meetingRegistrantFields = [ 'getAll', ], resource: [ - 'meetingRegistrants', + 'meetingRegistrant', ], returnAll: [ false, @@ -322,7 +323,7 @@ export const meetingRegistrantFields = [ ], resource: [ - 'meetingRegistrants', + 'meetingRegistrant', ], }, }, @@ -359,7 +360,7 @@ export const meetingRegistrantFields = [ ] }, /* -------------------------------------------------------------------------- */ - /* meetingRegistrants:update */ + /* meetingRegistrant:update */ /* -------------------------------------------------------------------------- */ { displayName: 'Meeting ID', @@ -373,7 +374,7 @@ export const meetingRegistrantFields = [ 'update', ], resource: [ - 'meetingRegistrants', + 'meetingRegistrant', ], }, }, @@ -390,7 +391,7 @@ export const meetingRegistrantFields = [ 'update', ], resource: [ - 'meetingRegistrants', + 'meetingRegistrant', ], }, }, @@ -423,7 +424,7 @@ export const meetingRegistrantFields = [ 'update', ], resource: [ - 'meetingRegistrants', + 'meetingRegistrant', ], }, }, diff --git a/packages/nodes-base/nodes/Zoom/Zoom.node.ts b/packages/nodes-base/nodes/Zoom/Zoom.node.ts index e6e6a78600..e3c9a083a5 100644 --- a/packages/nodes-base/nodes/Zoom/Zoom.node.ts +++ b/packages/nodes-base/nodes/Zoom/Zoom.node.ts @@ -1,14 +1,16 @@ import { IExecuteFunctions, } from 'n8n-core'; + import { IDataObject, - INodeExecutionData, - INodeType, ILoadOptionsFunctions, - INodeTypeDescription, + INodeExecutionData, INodePropertyOptions, + INodeType, + INodeTypeDescription, } from 'n8n-workflow'; + import { zoomApiRequest, zoomApiRequestAllItems, @@ -19,16 +21,15 @@ import { meetingFields, } from './MeetingDescription'; -import { - meetingRegistrantOperations, - meetingRegistrantFields, +// import { +// meetingRegistrantOperations, +// meetingRegistrantFields, +// } from './MeetingRegistrantDescription'; -} from './MeetingRegistrantDescription'; - -import { - webinarOperations, - webinarFields, -} from './WebinarDescription'; +// import { +// webinarOperations, +// webinarFields, +// } from './WebinarDescription'; import * as moment from 'moment-timezone'; @@ -48,6 +49,7 @@ interface Settings { approval_type?: number; practice_session?: boolean; } + export class Zoom implements INodeType { description: INodeTypeDescription = { displayName: 'Zoom', @@ -119,14 +121,14 @@ export class Zoom implements INodeType { name: 'Meeting', value: 'meeting' }, - { - name: 'Meeting Registrant', - value: 'meetingRegistrants' - }, - { - name: 'Webinar', - value: 'webinar' - } + // { + // name: 'Meeting Registrant', + // value: 'meetingRegistrant' + // }, + // { + // name: 'Webinar', + // value: 'webinar' + // } ], default: 'meeting', description: 'The resource to operate on.' @@ -135,13 +137,13 @@ export class Zoom implements INodeType { ...meetingOperations, ...meetingFields, - //MEETING REGISTRANTS - ...meetingRegistrantOperations, - ...meetingRegistrantFields, + // //MEETING REGISTRANTS + // ...meetingRegistrantOperations, + // ...meetingRegistrantFields, - //WEBINARS - ...webinarOperations, - ...webinarFields, + // //WEBINARS + // ...webinarOperations, + // ...webinarFields, ] }; @@ -169,7 +171,6 @@ export class Zoom implements INodeType { const items = this.getInputData(); const returnData: IDataObject[] = []; let qs: IDataObject = {}; - let body: IDataObject = {}; let responseData; const resource = this.getNodeParameter('resource', 0) as string; const operation = this.getNodeParameter('operation', 0) as string; @@ -186,14 +187,13 @@ export class Zoom implements INodeType { 'additionalFields', i ) as IDataObject; + if (additionalFields.showPreviousOccurrences) { qs.show_previous_occurrences = additionalFields.showPreviousOccurrences as boolean; - } if (additionalFields.occurrenceId) { qs.occurrence_id = additionalFields.occurrenceId as string; - } responseData = await zoomApiRequest.call( @@ -206,23 +206,22 @@ export class Zoom implements INodeType { } if (operation === 'getAll') { //https://marketplace.zoom.us/docs/api-reference/zoom-api/meetings/meetings - const userId = this.getNodeParameter('userId', i) as string; const returnAll = this.getNodeParameter('returnAll', i) as boolean; - const additionalFields = this.getNodeParameter( - 'additionalFields', + const filters = this.getNodeParameter( + 'filters', i ) as IDataObject; - if (additionalFields.type) { - qs.type = additionalFields.type as string; - + if (filters.type) { + qs.type = filters.type as string; } + if (returnAll) { - responseData = await zoomApiRequestAllItems.call(this, 'meetings', 'GET', `/users/${userId}/meetings`, {}, qs); + responseData = await zoomApiRequestAllItems.call(this, 'meetings', 'GET', '/users/me/meetings', {}, qs); } else { qs.page_size = this.getNodeParameter('limit', i) as number; - responseData = await zoomApiRequest.call(this, 'GET', `/users/${userId}/meetings`, {}, qs); - + responseData = await zoomApiRequest.call(this, 'GET', '/users/me/meetings', {}, qs); + responseData = responseData.meetings; } } @@ -235,12 +234,10 @@ export class Zoom implements INodeType { ) as IDataObject; if (additionalFields.scheduleForReminder) { qs.schedule_for_reminder = additionalFields.scheduleForReminder as boolean; - } if (additionalFields.occurrenceId) { qs.occurrence_id = additionalFields.occurrenceId; - } responseData = await zoomApiRequest.call( @@ -254,114 +251,100 @@ export class Zoom implements INodeType { } if (operation === 'create') { //https://marketplace.zoom.us/docs/api-reference/zoom-api/meetings/meetingcreate - const userId = this.getNodeParameter('userId', i) as string; const additionalFields = this.getNodeParameter( 'additionalFields', i ) as IDataObject; - const settings: Settings = {}; - if (additionalFields.cnMeeting) { - settings.cn_meeting = additionalFields.cnMeeting as boolean; + const body: IDataObject = {}; + + if (additionalFields.settings) { + const settingValues: Settings = {}; + const settings = additionalFields.settings as IDataObject; + + if (settings.cnMeeting) { + settingValues.cn_meeting = settings.cnMeeting as boolean; + } + + if (settings.inMeeting) { + settingValues.in_meeting = settings.inMeeting as boolean; + } + + if (settings.joinBeforeHost) { + settingValues.join_before_host = settings.joinBeforeHost as boolean; + } + + if (settings.muteUponEntry) { + settingValues.mute_upon_entry = settings.muteUponEntry as boolean; + } + + if (settings.watermark) { + settingValues.watermark = settings.watermark as boolean; + } + + if (settings.audio) { + settingValues.audio = settings.audio as string; + } + + if (settings.alternativeHosts) { + settingValues.alternative_hosts = settings.alternativeHosts as string; + } + + if (settings.participantVideo) { + settingValues.participant_video = settings.participantVideo as boolean; + } + + if (settings.hostVideo) { + settingValues.host_video = settings.hostVideo as boolean; + } + + if (settings.autoRecording) { + settingValues.auto_recording = settings.autoRecording as string; + } + + if (settings.registrationType) { + settingValues.registration_type = settings.registrationType as number; + } + + body.settings = settingValues; } - if (additionalFields.inMeeting) { - settings.in_meeting = additionalFields.inMeeting as boolean; - - } - - if (additionalFields.joinBeforeHost) { - settings.join_before_host = additionalFields.joinBeforeHost as boolean; - - } - - if (additionalFields.muteUponEntry) { - settings.mute_upon_entry = additionalFields.muteUponEntry as boolean; - - } - - if (additionalFields.watermark) { - settings.watermark = additionalFields.watermark as boolean; - - } - - if (additionalFields.audio) { - settings.audio = additionalFields.audio as string; - - } - - if (additionalFields.alternativeHosts) { - settings.alternative_hosts = additionalFields.alternativeHosts as string; - - } - - if (additionalFields.participantVideo) { - settings.participant_video = additionalFields.participantVideo as boolean; - - } - - if (additionalFields.hostVideo) { - settings.host_video = additionalFields.hostVideo as boolean; - - } - - if (additionalFields.autoRecording) { - settings.auto_recording = additionalFields.autoRecording as string; - - } - - if (additionalFields.registrationType) { - settings.registration_type = additionalFields.registrationType as number; - - } - - body = { - settings, - }; - if (additionalFields.topic) { body.topic = additionalFields.topic as string; - } if (additionalFields.type) { body.type = additionalFields.type as string; - } if (additionalFields.startTime) { body.start_time = additionalFields.startTime as string; - } if (additionalFields.duration) { body.duration = additionalFields.duration as number; - } if (additionalFields.scheduleFor) { body.schedule_for = additionalFields.scheduleFor as string; - } if (additionalFields.timeZone) { body.timezone = additionalFields.timeZone as string; - } if (additionalFields.password) { body.password = additionalFields.password as string; - } if (additionalFields.agenda) { body.agenda = additionalFields.agenda as string; - } + responseData = await zoomApiRequest.call( this, 'POST', - `/users/${userId}/meetings`, + `/users/me/meetings`, body, qs ); @@ -369,112 +352,94 @@ export class Zoom implements INodeType { if (operation === 'update') { //https://marketplace.zoom.us/docs/api-reference/zoom-api/meetings/meetingupdate const meetingId = this.getNodeParameter('meetingId', i) as string; - const settings: Settings = {}; - const additionalFields = this.getNodeParameter( - 'additionalFields', + const updateFields = this.getNodeParameter( + 'updateFields', i ) as IDataObject; - if (additionalFields.occurrenceId) { - qs.occurrence_id = additionalFields.occurrenceId as string; + const body: IDataObject = {}; + + if (updateFields.settings) { + const settingValues: Settings = {}; + const settings = updateFields.settings as IDataObject; + + if (settings.cnMeeting) { + settingValues.cn_meeting = settings.cnMeeting as boolean; + } + + if (settings.inMeeting) { + settingValues.in_meeting = settings.inMeeting as boolean; + } + + if (settings.joinBeforeHost) { + settingValues.join_before_host = settings.joinBeforeHost as boolean; + } + + if (settings.muteUponEntry) { + settingValues.mute_upon_entry = settings.muteUponEntry as boolean; + } + + if (settings.watermark) { + settingValues.watermark = settings.watermark as boolean; + } + + if (settings.audio) { + settingValues.audio = settings.audio as string; + } + + if (settings.alternativeHosts) { + settingValues.alternative_hosts = settings.alternativeHosts as string; + } + + if (settings.participantVideo) { + settingValues.participant_video = settings.participantVideo as boolean; + } + + if (settings.hostVideo) { + settingValues.host_video = settings.hostVideo as boolean; + } + + if (settings.autoRecording) { + settingValues.auto_recording = settings.autoRecording as string; + } + + if (settings.registrationType) { + settingValues.registration_type = settings.registrationType as number; + } + + body.settings = settingValues; } - if (additionalFields.cnMeeting) { - settings.cn_meeting = additionalFields.cnMeeting as boolean; - + if (updateFields.topic) { + body.topic = updateFields.topic as string; } - if (additionalFields.inMeeting) { - settings.in_meeting = additionalFields.inMeeting as boolean; - + if (updateFields.type) { + body.type = updateFields.type as string; } - if (additionalFields.joinBeforeHost) { - settings.join_before_host = additionalFields.joinBeforeHost as boolean; - + if (updateFields.startTime) { + body.start_time = updateFields.startTime as string; } - if (additionalFields.muteUponEntry) { - settings.mute_upon_entry = additionalFields.muteUponEntry as boolean; - + if (updateFields.duration) { + body.duration = updateFields.duration as number; } - if (additionalFields.watermark) { - settings.watermark = additionalFields.watermark as boolean; - + if (updateFields.scheduleFor) { + body.schedule_for = updateFields.scheduleFor as string; } - if (additionalFields.audio) { - settings.audio = additionalFields.audio as string; - + if (updateFields.timeZone) { + body.timezone = updateFields.timeZone as string; } - if (additionalFields.alternativeHosts) { - settings.alternative_hosts = additionalFields.alternativeHosts as string; - + if (updateFields.password) { + body.password = updateFields.password as string; } - if (additionalFields.participantVideo) { - settings.participant_video = additionalFields.participantVideo as boolean; - - } - - if (additionalFields.hostVideo) { - settings.host_video = additionalFields.hostVideo as boolean; - - } - - if (additionalFields.autoRecording) { - settings.auto_recording = additionalFields.autoRecording as string; - - } - - if (additionalFields.registrationType) { - settings.registration_type = additionalFields.registrationType as number; - - } - - body = { - settings, - }; - if (additionalFields.topic) { - body.topic = additionalFields.topic as string; - - } - - if (additionalFields.type) { - body.type = additionalFields.type as string; - - } - - if (additionalFields.startTime) { - body.start_time = additionalFields.startTime as string; - - } - - if (additionalFields.duration) { - body.duration = additionalFields.duration as number; - - } - - if (additionalFields.scheduleFor) { - body.schedule_for = additionalFields.scheduleFor as string; - - } - - if (additionalFields.timeZone) { - body.timezone = additionalFields.timeZone as string; - - } - - if (additionalFields.password) { - body.password = additionalFields.password as string; - - } - - if (additionalFields.agenda) { - body.agenda = additionalFields.agenda as string; - + if (updateFields.agenda) { + body.agenda = updateFields.agenda as string; } responseData = await zoomApiRequest.call( @@ -484,364 +449,365 @@ export class Zoom implements INodeType { body, qs ); - responseData = { updated: true }; - } - } - if (resource === 'meetingRegistrants') { - if (operation === 'create') { - //https://marketplace.zoom.us/docs/api-reference/zoom-api/meetings/meetingregistrantcreate - const meetingId = this.getNodeParameter('meetingId', i) as string; - const emailId = this.getNodeParameter('email', i) as string; - body.email = emailId; - const firstName = this.getNodeParameter('firstName', i) as string; - body.first_name = firstName; - const additionalFields = this.getNodeParameter( - 'additionalFields', - i - ) as IDataObject; - if (additionalFields.occurrenceId) { - qs.occurrence_ids = additionalFields.occurrenceId as string; - } - if (additionalFields.lastName) { - body.last_name = additionalFields.lastName as string; - } - if (additionalFields.address) { - body.address = additionalFields.address as string; - } - if (additionalFields.city) { - body.city = additionalFields.city as string; - } - if (additionalFields.state) { - body.state = additionalFields.state as string; - } - if (additionalFields.country) { - body.country = additionalFields.country as string; - } - if (additionalFields.zip) { - body.zip = additionalFields.zip as string; - } - if (additionalFields.phone) { - body.phone = additionalFields.phone as string; - } - if (additionalFields.comments) { - body.comments = additionalFields.comments as string; - } - if (additionalFields.org) { - body.org = additionalFields.org as string; - } - if (additionalFields.jobTitle) { - body.job_title = additionalFields.jobTitle as string; - } - if (additionalFields.purchasingTimeFrame) { - body.purchasing_time_frame = additionalFields.purchasingTimeFrame as string; - } - if (additionalFields.roleInPurchaseProcess) { - body.role_in_purchase_process = additionalFields.roleInPurchaseProcess as string; - } - responseData = await zoomApiRequest.call( - this, - 'POST', - `/meetings/${meetingId}/registrants`, - body, - qs - ); - } - if (operation === 'getAll') { - //https://marketplace.zoom.us/docs/api-reference/zoom-api/meetings/meetingregistrants - const meetingId = this.getNodeParameter('meetingId', i) as string; - const additionalFields = this.getNodeParameter( - 'additionalFields', - i - ) as IDataObject; - if (additionalFields.occurrenceId) { - qs.occurrence_id = additionalFields.occurrenceId as string; - } - if (additionalFields.status) { - qs.status = additionalFields.status as string; - } - const returnAll = this.getNodeParameter('returnAll', i) as boolean; - if (returnAll) { - responseData = await zoomApiRequestAllItems.call(this, 'results', 'GET', `/meetings/${meetingId}/registrants`, {}, qs); - } else { - qs.page_size = this.getNodeParameter('limit', i) as number; - responseData = await zoomApiRequest.call(this, 'GET', `/meetings/${meetingId}/registrants`, {}, qs); - - } - - } - if (operation === 'update') { - //https://marketplace.zoom.us/docs/api-reference/zoom-api/meetings/meetingregistrantstatus - const meetingId = this.getNodeParameter('meetingId', i) as string; - const additionalFields = this.getNodeParameter( - 'additionalFields', - i - ) as IDataObject; - if (additionalFields.occurenceId) { - qs.occurrence_id = additionalFields.occurrenceId as string; - } - if (additionalFields.action) { - body.action = additionalFields.action as string; - } - responseData = await zoomApiRequest.call( - this, - 'PUT', - `/meetings/${meetingId}/registrants/status`, - body, - qs - ); - } - } - if (resource === 'webinar') { - if (operation === 'create') { - //https://marketplace.zoom.us/docs/api-reference/zoom-api/webinars/webinarcreate - const userId = this.getNodeParameter('userId', i) as string; - const additionalFields = this.getNodeParameter( - 'additionalFields', - i - ) as IDataObject; - const settings: Settings = {}; - - - if (additionalFields.audio) { - settings.audio = additionalFields.audio as string; - - } - - if (additionalFields.alternativeHosts) { - settings.alternative_hosts = additionalFields.alternativeHosts as string; - - } - - if (additionalFields.panelistsVideo) { - settings.panelists_video = additionalFields.panelistsVideo as boolean; - - } - if (additionalFields.hostVideo) { - settings.host_video = additionalFields.hostVideo as boolean; - - } - if (additionalFields.practiceSession) { - settings.practice_session = additionalFields.practiceSession as boolean; - - } - if (additionalFields.autoRecording) { - settings.auto_recording = additionalFields.autoRecording as string; - - } - - if (additionalFields.registrationType) { - settings.registration_type = additionalFields.registrationType as number; - - } - if (additionalFields.approvalType) { - settings.approval_type = additionalFields.approvalType as number; - - } - - body = { - settings, - }; - - if (additionalFields.topic) { - body.topic = additionalFields.topic as string; - - } - - if (additionalFields.type) { - body.type = additionalFields.type as string; - - } - - if (additionalFields.startTime) { - body.start_time = additionalFields.startTime as string; - - } - - if (additionalFields.duration) { - body.duration = additionalFields.duration as number; - - } - - - if (additionalFields.timeZone) { - body.timezone = additionalFields.timeZone as string; - - } - - if (additionalFields.password) { - body.password = additionalFields.password as string; - - } - - if (additionalFields.agenda) { - body.agenda = additionalFields.agenda as string; - - } - responseData = await zoomApiRequest.call( - this, - 'POST', - `/users/${userId}/webinars`, - body, - qs - ); - } - if (operation === 'get') { - //https://marketplace.zoom.us/docs/api-reference/zoom-api/webinars/webinar - const webinarId = this.getNodeParameter('webinarId', i) as string; - - const additionalFields = this.getNodeParameter( - 'additionalFields', - i - ) as IDataObject; - if (additionalFields.showPreviousOccurrences) { - qs.show_previous_occurrences = additionalFields.showPreviousOccurrences as boolean; - - } - - if (additionalFields.occurrenceId) { - qs.occurrence_id = additionalFields.occurrenceId as string; - - } - - responseData = await zoomApiRequest.call( - this, - 'GET', - `/webinars/${webinarId}`, - {}, - qs - ); - } - if (operation === 'getAll') { - //https://marketplace.zoom.us/docs/api-reference/zoom-api/webinars/webinars - const userId = this.getNodeParameter('userId', i) as string; - const returnAll = this.getNodeParameter('returnAll', i) as boolean; - if (returnAll) { - responseData = await zoomApiRequestAllItems.call(this, 'results', 'GET', `/users/${userId}/webinars`, {}, qs); - } else { - qs.page_size = this.getNodeParameter('limit', i) as number; - responseData = await zoomApiRequest.call(this, 'GET', `/users/${userId}/webinars`, {}, qs); - - } - } - if (operation === 'delete') { - //https://marketplace.zoom.us/docs/api-reference/zoom-api/webinars/webinardelete - const webinarId = this.getNodeParameter('webinarId', i) as string; - const additionalFields = this.getNodeParameter( - 'additionalFields', - i - ) as IDataObject; - - - if (additionalFields.occurrenceId) { - qs.occurrence_id = additionalFields.occurrenceId; - - } - - responseData = await zoomApiRequest.call( - this, - 'DELETE', - `/webinars/${webinarId}`, - {}, - qs - ); responseData = { success: true }; - } - if (operation === 'update') { - //https://marketplace.zoom.us/docs/api-reference/zoom-api/webinars/webinarupdate - const webinarId = this.getNodeParameter('webinarId', i) as string; - const additionalFields = this.getNodeParameter( - 'additionalFields', - i - ) as IDataObject; - if (additionalFields.occurrenceId) { - qs.occurrence_id = additionalFields.occurrenceId as string; - } - const settings: Settings = {}; - if (additionalFields.audio) { - settings.audio = additionalFields.audio as string; - - } - if (additionalFields.alternativeHosts) { - settings.alternative_hosts = additionalFields.alternativeHosts as string; - - } - - if (additionalFields.panelistsVideo) { - settings.panelists_video = additionalFields.panelistsVideo as boolean; - - } - if (additionalFields.hostVideo) { - settings.host_video = additionalFields.hostVideo as boolean; - - } - if (additionalFields.practiceSession) { - settings.practice_session = additionalFields.practiceSession as boolean; - - } - if (additionalFields.autoRecording) { - settings.auto_recording = additionalFields.autoRecording as string; - - } - - if (additionalFields.registrationType) { - settings.registration_type = additionalFields.registrationType as number; - - } - if (additionalFields.approvalType) { - settings.approval_type = additionalFields.approvalType as number; - - } - - body = { - settings, - }; - - if (additionalFields.topic) { - body.topic = additionalFields.topic as string; - - } - - if (additionalFields.type) { - body.type = additionalFields.type as string; - - } - - if (additionalFields.startTime) { - body.start_time = additionalFields.startTime as string; - - } - - if (additionalFields.duration) { - body.duration = additionalFields.duration as number; - - } - - - if (additionalFields.timeZone) { - body.timezone = additionalFields.timeZone as string; - - } - - if (additionalFields.password) { - body.password = additionalFields.password as string; - - } - - if (additionalFields.agenda) { - body.agenda = additionalFields.agenda as string; - - } - responseData = await zoomApiRequest.call( - this, - 'PATCH', - `webinars/${webinarId}`, - body, - qs - ); } } + // if (resource === 'meetingRegistrant') { + // if (operation === 'create') { + // //https://marketplace.zoom.us/docs/api-reference/zoom-api/meetings/meetingregistrantcreate + // const meetingId = this.getNodeParameter('meetingId', i) as string; + // const emailId = this.getNodeParameter('email', i) as string; + // body.email = emailId; + // const firstName = this.getNodeParameter('firstName', i) as string; + // body.first_name = firstName; + // const additionalFields = this.getNodeParameter( + // 'additionalFields', + // i + // ) as IDataObject; + // if (additionalFields.occurrenceId) { + // qs.occurrence_ids = additionalFields.occurrenceId as string; + // } + // if (additionalFields.lastName) { + // body.last_name = additionalFields.lastName as string; + // } + // if (additionalFields.address) { + // body.address = additionalFields.address as string; + // } + // if (additionalFields.city) { + // body.city = additionalFields.city as string; + // } + // if (additionalFields.state) { + // body.state = additionalFields.state as string; + // } + // if (additionalFields.country) { + // body.country = additionalFields.country as string; + // } + // if (additionalFields.zip) { + // body.zip = additionalFields.zip as string; + // } + // if (additionalFields.phone) { + // body.phone = additionalFields.phone as string; + // } + // if (additionalFields.comments) { + // body.comments = additionalFields.comments as string; + // } + // if (additionalFields.org) { + // body.org = additionalFields.org as string; + // } + // if (additionalFields.jobTitle) { + // body.job_title = additionalFields.jobTitle as string; + // } + // if (additionalFields.purchasingTimeFrame) { + // body.purchasing_time_frame = additionalFields.purchasingTimeFrame as string; + // } + // if (additionalFields.roleInPurchaseProcess) { + // body.role_in_purchase_process = additionalFields.roleInPurchaseProcess as string; + // } + // responseData = await zoomApiRequest.call( + // this, + // 'POST', + // `/meetings/${meetingId}/registrants`, + // body, + // qs + // ); + // } + // if (operation === 'getAll') { + // //https://marketplace.zoom.us/docs/api-reference/zoom-api/meetings/meetingregistrants + // const meetingId = this.getNodeParameter('meetingId', i) as string; + // const additionalFields = this.getNodeParameter( + // 'additionalFields', + // i + // ) as IDataObject; + // if (additionalFields.occurrenceId) { + // qs.occurrence_id = additionalFields.occurrenceId as string; + // } + // if (additionalFields.status) { + // qs.status = additionalFields.status as string; + // } + // const returnAll = this.getNodeParameter('returnAll', i) as boolean; + // if (returnAll) { + // responseData = await zoomApiRequestAllItems.call(this, 'results', 'GET', `/meetings/${meetingId}/registrants`, {}, qs); + // } else { + // qs.page_size = this.getNodeParameter('limit', i) as number; + // responseData = await zoomApiRequest.call(this, 'GET', `/meetings/${meetingId}/registrants`, {}, qs); + + // } + + // } + // if (operation === 'update') { + // //https://marketplace.zoom.us/docs/api-reference/zoom-api/meetings/meetingregistrantstatus + // const meetingId = this.getNodeParameter('meetingId', i) as string; + // const additionalFields = this.getNodeParameter( + // 'additionalFields', + // i + // ) as IDataObject; + // if (additionalFields.occurenceId) { + // qs.occurrence_id = additionalFields.occurrenceId as string; + // } + // if (additionalFields.action) { + // body.action = additionalFields.action as string; + // } + // responseData = await zoomApiRequest.call( + // this, + // 'PUT', + // `/meetings/${meetingId}/registrants/status`, + // body, + // qs + // ); + // } + // } + // if (resource === 'webinar') { + // if (operation === 'create') { + // //https://marketplace.zoom.us/docs/api-reference/zoom-api/webinars/webinarcreate + // const userId = this.getNodeParameter('userId', i) as string; + // const additionalFields = this.getNodeParameter( + // 'additionalFields', + // i + // ) as IDataObject; + // const settings: Settings = {}; + + + // if (additionalFields.audio) { + // settings.audio = additionalFields.audio as string; + + // } + + // if (additionalFields.alternativeHosts) { + // settings.alternative_hosts = additionalFields.alternativeHosts as string; + + // } + + // if (additionalFields.panelistsVideo) { + // settings.panelists_video = additionalFields.panelistsVideo as boolean; + + // } + // if (additionalFields.hostVideo) { + // settings.host_video = additionalFields.hostVideo as boolean; + + // } + // if (additionalFields.practiceSession) { + // settings.practice_session = additionalFields.practiceSession as boolean; + + // } + // if (additionalFields.autoRecording) { + // settings.auto_recording = additionalFields.autoRecording as string; + + // } + + // if (additionalFields.registrationType) { + // settings.registration_type = additionalFields.registrationType as number; + + // } + // if (additionalFields.approvalType) { + // settings.approval_type = additionalFields.approvalType as number; + + // } + + // body = { + // settings, + // }; + + // if (additionalFields.topic) { + // body.topic = additionalFields.topic as string; + + // } + + // if (additionalFields.type) { + // body.type = additionalFields.type as string; + + // } + + // if (additionalFields.startTime) { + // body.start_time = additionalFields.startTime as string; + + // } + + // if (additionalFields.duration) { + // body.duration = additionalFields.duration as number; + + // } + + + // if (additionalFields.timeZone) { + // body.timezone = additionalFields.timeZone as string; + + // } + + // if (additionalFields.password) { + // body.password = additionalFields.password as string; + + // } + + // if (additionalFields.agenda) { + // body.agenda = additionalFields.agenda as string; + + // } + // responseData = await zoomApiRequest.call( + // this, + // 'POST', + // `/users/${userId}/webinars`, + // body, + // qs + // ); + // } + // if (operation === 'get') { + // //https://marketplace.zoom.us/docs/api-reference/zoom-api/webinars/webinar + // const webinarId = this.getNodeParameter('webinarId', i) as string; + + // const additionalFields = this.getNodeParameter( + // 'additionalFields', + // i + // ) as IDataObject; + // if (additionalFields.showPreviousOccurrences) { + // qs.show_previous_occurrences = additionalFields.showPreviousOccurrences as boolean; + + // } + + // if (additionalFields.occurrenceId) { + // qs.occurrence_id = additionalFields.occurrenceId as string; + + // } + + // responseData = await zoomApiRequest.call( + // this, + // 'GET', + // `/webinars/${webinarId}`, + // {}, + // qs + // ); + // } + // if (operation === 'getAll') { + // //https://marketplace.zoom.us/docs/api-reference/zoom-api/webinars/webinars + // const userId = this.getNodeParameter('userId', i) as string; + // const returnAll = this.getNodeParameter('returnAll', i) as boolean; + // if (returnAll) { + // responseData = await zoomApiRequestAllItems.call(this, 'results', 'GET', `/users/${userId}/webinars`, {}, qs); + // } else { + // qs.page_size = this.getNodeParameter('limit', i) as number; + // responseData = await zoomApiRequest.call(this, 'GET', `/users/${userId}/webinars`, {}, qs); + + // } + // } + // if (operation === 'delete') { + // //https://marketplace.zoom.us/docs/api-reference/zoom-api/webinars/webinardelete + // const webinarId = this.getNodeParameter('webinarId', i) as string; + // const additionalFields = this.getNodeParameter( + // 'additionalFields', + // i + // ) as IDataObject; + + + // if (additionalFields.occurrenceId) { + // qs.occurrence_id = additionalFields.occurrenceId; + + // } + + // responseData = await zoomApiRequest.call( + // this, + // 'DELETE', + // `/webinars/${webinarId}`, + // {}, + // qs + // ); + // responseData = { success: true }; + // } + // if (operation === 'update') { + // //https://marketplace.zoom.us/docs/api-reference/zoom-api/webinars/webinarupdate + // const webinarId = this.getNodeParameter('webinarId', i) as string; + // const additionalFields = this.getNodeParameter( + // 'additionalFields', + // i + // ) as IDataObject; + // if (additionalFields.occurrenceId) { + // qs.occurrence_id = additionalFields.occurrenceId as string; + + // } + // const settings: Settings = {}; + // if (additionalFields.audio) { + // settings.audio = additionalFields.audio as string; + + // } + // if (additionalFields.alternativeHosts) { + // settings.alternative_hosts = additionalFields.alternativeHosts as string; + + // } + + // if (additionalFields.panelistsVideo) { + // settings.panelists_video = additionalFields.panelistsVideo as boolean; + + // } + // if (additionalFields.hostVideo) { + // settings.host_video = additionalFields.hostVideo as boolean; + + // } + // if (additionalFields.practiceSession) { + // settings.practice_session = additionalFields.practiceSession as boolean; + + // } + // if (additionalFields.autoRecording) { + // settings.auto_recording = additionalFields.autoRecording as string; + + // } + + // if (additionalFields.registrationType) { + // settings.registration_type = additionalFields.registrationType as number; + + // } + // if (additionalFields.approvalType) { + // settings.approval_type = additionalFields.approvalType as number; + + // } + + // body = { + // settings, + // }; + + // if (additionalFields.topic) { + // body.topic = additionalFields.topic as string; + + // } + + // if (additionalFields.type) { + // body.type = additionalFields.type as string; + + // } + + // if (additionalFields.startTime) { + // body.start_time = additionalFields.startTime as string; + + // } + + // if (additionalFields.duration) { + // body.duration = additionalFields.duration as number; + + // } + + + // if (additionalFields.timeZone) { + // body.timezone = additionalFields.timeZone as string; + + // } + + // if (additionalFields.password) { + // body.password = additionalFields.password as string; + + // } + + // if (additionalFields.agenda) { + // body.agenda = additionalFields.agenda as string; + + // } + // responseData = await zoomApiRequest.call( + // this, + // 'PATCH', + // `webinars/${webinarId}`, + // body, + // qs + // ); + // } + // } } if (Array.isArray(responseData)) { returnData.push.apply(returnData, responseData as IDataObject[]); From 5b269b45f1d247e4bbf8dfe453da5258d98dd717 Mon Sep 17 00:00:00 2001 From: ricardo Date: Thu, 25 Jun 2020 00:06:48 -0400 Subject: [PATCH 123/241] :sparkles: SIGNL4-Node --- .../credentials/SIGNL4Api.credentials.ts | 4 +- .../nodes/SIGNL4/GenericFunctions.ts | 72 ++-- .../nodes-base/nodes/SIGNL4/signl4.node.ts | 368 +++++++++++------- packages/nodes-base/package.json | 6 +- 4 files changed, 266 insertions(+), 184 deletions(-) diff --git a/packages/nodes-base/credentials/SIGNL4Api.credentials.ts b/packages/nodes-base/credentials/SIGNL4Api.credentials.ts index 4fa31c1422..842136de02 100644 --- a/packages/nodes-base/credentials/SIGNL4Api.credentials.ts +++ b/packages/nodes-base/credentials/SIGNL4Api.credentials.ts @@ -3,8 +3,8 @@ import { NodePropertyTypes, } from 'n8n-workflow'; -export class SIGNL4Api implements ICredentialType { - name = 'SIGNL4Api'; +export class Signl4Api implements ICredentialType { + name = 'signl4Api'; displayName = 'SIGNL4 Webhook'; properties = [ { diff --git a/packages/nodes-base/nodes/SIGNL4/GenericFunctions.ts b/packages/nodes-base/nodes/SIGNL4/GenericFunctions.ts index e04e3b8393..5281ae8c25 100644 --- a/packages/nodes-base/nodes/SIGNL4/GenericFunctions.ts +++ b/packages/nodes-base/nodes/SIGNL4/GenericFunctions.ts @@ -1,62 +1,52 @@ import { IExecuteFunctions, - IHookFunctions, } from 'n8n-core'; import { - ICredentialDataDecryptedObject, IDataObject, } from 'n8n-workflow'; +import { + OptionsWithUri, + } from 'request'; + /** - * Make an API request to MSG91 + * Make an API request to SIGNL4 * * @param {IHookFunctions | IExecuteFunctions} this * @param {object} message * @returns {Promise} */ -export async function SIGNL4ApiRequest(this: IHookFunctions | IExecuteFunctions, message: IDataObject): Promise { // tslint:disable-line:no-any - const credentials = this.getCredentials('SIGNL4Api'); - if (credentials === undefined) { - throw new Error('No credentials got returned!'); - } - - const teamsecret = credentials!.teamSecret as string; - var response = null; - try { - response = await this.helpers.request({ - headers: {'Content-Type': 'application/json'}, - method: 'POST', - body: message, - qs: {}, - uri: `https://connect.signl4.com/webhook/${teamsecret}`, - json: true - }); +export async function SIGNL4ApiRequest(this: IExecuteFunctions, method: string, resource: string, body: any = {}, query: IDataObject = {}, uri?: string, option: IDataObject = {}): Promise { // tslint:disable-line:no-any + + let options: OptionsWithUri = { + headers: { + 'Accept': '*/*', + }, + method, + body, + qs: query, + uri: uri || ``, + json: true, + }; + + if (!Object.keys(body).length) { + delete options.body; } - catch (error) { - - if (error && error.message) { - throw new Error(`Error sending the SIGNL4 request. Error: ${JSON.stringify(error.message)}`); + if (!Object.keys(query).length) { + delete options.qs; + } + options = Object.assign({}, options, option); + + try { + return await this.helpers.request!(options); + } catch (error) { + + if (error.response && error.response.body && error.response.body.details) { + throw new Error(`SIGNL4 error response [${error.statusCode}]: ${error.response.body.details}`); } - - throw new Error('Error sending the SIGNL4 request.'); throw error; } - - return response; -} - - -function setPayload(credentials: ICredentialDataDecryptedObject, o?: IDataObject) { - if (!o) { - o = {}; - } - - o.p = credentials!.teamSecret as string; - o.json = 1; - o.sendwith = 'n8n'; - - return o; } diff --git a/packages/nodes-base/nodes/SIGNL4/signl4.node.ts b/packages/nodes-base/nodes/SIGNL4/signl4.node.ts index 5b91df3814..5a2ec290e3 100644 --- a/packages/nodes-base/nodes/SIGNL4/signl4.node.ts +++ b/packages/nodes-base/nodes/SIGNL4/signl4.node.ts @@ -1,27 +1,40 @@ -import {IExecuteFunctions,} from 'n8n-core'; -import {IDataObject, INodeExecutionData, INodeType, INodeTypeDescription,} from 'n8n-workflow'; -import {SIGNL4ApiRequest} from './GenericFunctions'; +import { + IExecuteFunctions, + BINARY_ENCODING, +} from 'n8n-core'; -export class SIGNL4 implements INodeType { +import { + IDataObject, + INodeExecutionData, + INodeType, + INodeTypeDescription, + IBinaryKeyData, +} from 'n8n-workflow'; + +import { + SIGNL4ApiRequest, +} from './GenericFunctions'; + +export class Signl4 implements INodeType { description: INodeTypeDescription = { displayName: 'SIGNL4', - name: 'SIGNL4', + name: 'signl4', icon: 'file:signl4.png', group: ['transform'], version: 1, subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}', - description: 'Send SIGNL4 alert. Find our more at https://www.signl4.com.', + description: 'Consume SIGNL4 API.', defaults: { name: 'SIGNL4', - color: '#0000FF', + color: '#53afe8', }, inputs: ['main'], outputs: ['main'], credentials: [ { - name: 'SIGNL4Api', + name: 'signl4Api', required: true, - } + }, ], properties: [ { @@ -50,39 +63,22 @@ export class SIGNL4 implements INodeType { }, options: [ { - name: 'Send Alert', + name: 'Send', value: 'send', - description: 'Send SIGNL4 alert.', + description: 'Send an alert.', }, ], default: 'send', description: 'The operation to perform.', }, { - displayName: 'Subject', - name: 'subject', + displayName: 'Message', + name: 'message', type: 'string', - default: 'SIGNL4 Alert', - placeholder: 'SIGNL4 Alert', - required: true, - displayOptions: { - show: { - operation: [ - 'send', - ], - resource: [ - 'alert', - ], - }, + typeOptions: { + alwaysOpenEditWindow: true, }, - description: 'The subject of the SIGNL4 alert.', - }, - { - displayName: 'Body', - name: 'body', - type: 'string', default: '', - placeholder: 'Alert description.', required: false, displayOptions: { show: { @@ -97,11 +93,10 @@ export class SIGNL4 implements INodeType { description: 'A more detailed description for the alert.', }, { - displayName: 'S4-Service', - name: 'xS4Service', - type: 'string', - default: '', - required: false, + displayName: 'Additional Fields', + name: 'additionalFields', + type: 'collection', + placeholder: 'Add Field', displayOptions: { show: { operation: [ @@ -112,121 +107,218 @@ export class SIGNL4 implements INodeType { ], }, }, - description: 'Assigns the alert to the service/system category with the specified name.', - }, - { - displayName: 'S4-Location', - name: 'xS4Location', - type: 'string', - default: '', - required: false, - displayOptions: { - show: { - operation: [ - 'send', - ], - resource: [ - 'alert', - ], - }, - }, - description: 'Transmit location information (\'latitude, longitude\') with your event and display a map in the mobile app.', - }, - { - displayName: 'S4-AlertingScenario', - name: 'xS4AlertingScenario', - type: 'options', + default: {}, options: [ { - name: 'single_ack', - value: 'single_ack', + displayName: 'Alerting Scenario', + name: 'alertingScenario', + type: 'options', + options: [ + { + name: 'Single ACK', + value: 'single_ack', + description: 'In case only one person needs to confirm this Signl.' + }, + { + name: 'Multi ACK', + value: 'multi_ack', + description: 'in case this alert must be confirmed by the number of people who are on duty at the time this Singl is raised', + }, + ], + default: 'single_ack', + required: false, }, { - name: 'multi_ack', - value: 'multi_ack', + displayName: 'Attachments', + name: 'attachmentsUi', + placeholder: 'Add Attachments', + type: 'fixedCollection', + typeOptions: { + multipleValues: false, + }, + options: [ + { + name: 'attachmentsBinary', + displayName: 'Attachments Binary', + values: [ + { + displayName: 'Property Name', + name: 'property', + type: 'string', + placeholder: 'data', + default: '', + description: 'Name of the binary properties which contain data which should be added as attachment', + }, + ], + }, + ], + default: {}, + }, + { + displayName: 'External ID', + name: 'externalId', + type: 'string', + default: '', + description: `If the event originates from a record in a 3rd party system, use this parameter to pass
+ the unique ID of that record. That ID will be communicated in outbound webhook notifications from SIGNL4,
+ which is great for correlation/synchronization of that record with the alert.`, + }, + { + displayName: 'Filtering', + name: 'filtering', + type: 'boolean', + default: 'false', + description: `Specify a boolean value of true or false to apply event filtering for this event, or not.
+ If set to true, the event will only trigger a notification to the team, if it contains at least one keyword
+ from one of your services and system categories (i.e. it is whitelisted)`, + }, + { + displayName: 'Location', + name: 'locationFieldsUi', + type: 'fixedCollection', + placeholder: 'Add Location', + default: {}, + description: 'Transmit location information (\'latitude, longitude\') with your event and display a map in the mobile app.', + options: [ + { + name: 'locationFieldsValues', + displayName: 'Location', + values: [ + { + displayName: 'Latitude', + name: 'latitude', + type: 'string', + required: true, + description: 'The location latitude.', + default: '', + }, + { + displayName: 'Longitude', + name: 'longitude', + type: 'string', + required: true, + description: 'The location longitude.', + default: '', + }, + ], + } + ], + }, + { + displayName: 'Service', + name: 'service', + type: 'string', + default: '', + description: 'Assigns the alert to the service/system category with the specified name.', + }, + { + displayName: 'Title', + name: 'title', + type: 'string', + default: '', }, ], - default: 'single_ack', - required: false, - displayOptions: { - show: { - operation: [ - 'send', - ], - resource: [ - 'alert', - ], - }, - }, - description: 'Pass \'single_ack\' if only one person needs to confirm this Signl. Pass \'multi_ack\' in case this alert must be confirmed by the number of people who are on duty at the time this Singl is raised.', }, - { - displayName: 'S4-ExternalID', - name: 'xS4ExternalId', - type: 'string', - default: '', - required: false, - displayOptions: { - show: { - operation: [ - 'send', - ], - resource: [ - 'alert', - ], - }, - }, - description: 'If the event originates from a record in a 3rd party system, use this parameter to pass the unique ID of that record. That ID will be communicated in outbound webhook notifications from SIGNL4, which is great for correlation/synchronization of that record with the alert.', - }, - { - displayName: 'S4-Filtering', - name: 'xS4Filtering', - type: 'boolean', - default: 'false', - required: false, - displayOptions: { - show: { - operation: [ - 'send', - ], - resource: [ - 'alert', - ], - }, - }, - description: 'Specify a boolean value of true or false to apply event filtering for this event, or not. If set to true, the event will only trigger a notification to the team, if it contains at least one keyword from one of your services and system categories (i.e. it is whitelisted)', - } ], }; async execute(this: IExecuteFunctions): Promise { + const items = this.getInputData(); const returnData: IDataObject[] = []; + const length = (items.length as unknown) as number; + const qs: IDataObject = {}; + let responseData; + const resource = this.getNodeParameter('resource', 0) as string; + const operation = this.getNodeParameter('operation', 0) as string; + for (let i = 0; i < length; i++) { + if (resource === 'alert') { + //https://connect.signl4.com/webhook/docs/index.html + if (operation === 'send') { + const message = this.getNodeParameter('message', i) as string; + const additionalFields = this.getNodeParameter('additionalFields',i) as IDataObject; - for (let i = 0; i < this.getInputData().length; i++) { - const resource = this.getNodeParameter('resource', i); - if ('alert' !== resource) { - throw new Error(`The resource "${resource}" is not known!`); + const data: IDataObject = { + message, + }; + + if (additionalFields.alertingScenario) { + data['X-S4-AlertingScenario'] = additionalFields.alertingScenario as string; + } + if (additionalFields.externalId) { + data['X-S4-ExternalID'] = additionalFields.externalId as string; + } + if (additionalFields.filtering) { + data['X-S4-Filtering'] = (additionalFields.filtering as boolean).toString(); + } + if (additionalFields.locationFieldsUi) { + const locationUi = (additionalFields.locationFieldsUi as IDataObject).locationFieldsValues as IDataObject; + if (locationUi) { + data['X-S4-Location'] = `${locationUi.latitude},${locationUi.longitude}`; + } + } + if (additionalFields.service) { + data['X-S4-Service'] = additionalFields.service as string; + } + if (additionalFields.title) { + data['title'] = additionalFields.title as string; + } + + const attachments = additionalFields.attachmentsUi as IDataObject; + + if (attachments) { + if (attachments.attachmentsBinary && items[i].binary) { + + const propertyName = (attachments.attachmentsBinary as IDataObject).property as string + + const binaryProperty = (items[i].binary as IBinaryKeyData)[propertyName]; + + if (binaryProperty) { + + const supportedFileExtension = ['png', 'jpg', 'txt']; + + if (!supportedFileExtension.includes(binaryProperty.fileExtension as string)) { + + throw new Error(`Invalid extension, just ${supportedFileExtension.join(',')} are supported}`); + } + + data['file'] = { + value: Buffer.from(binaryProperty.data, BINARY_ENCODING), + options: { + filename: binaryProperty.fileName, + contentType: binaryProperty.mimeType, + }, + } + + } else { + throw new Error(`Binary property ${propertyName} does not exist on input`); + } + } + } + + const credentials = this.getCredentials('signl4Api'); + + const endpoint = `https://connect.signl4.com/webhook/${credentials?.teamSecret}`; + + responseData = await SIGNL4ApiRequest.call( + this, + 'POST', + '', + {}, + {}, + endpoint, + { + formData: { + ...data, + }, + }, + ); + } } - - const operation = this.getNodeParameter('operation', i); - if ('send' !== operation) { - throw new Error(`The operation "${operation}" is not known!`); - } - - // Assemble JSON data - var message = { - Subject: this.getNodeParameter('subject', i), - Body: this.getNodeParameter('body', i) - } as IDataObject; - message['X-S4-Service'] = this.getNodeParameter('xS4Service', i); - message['X-S4-Location'] = this.getNodeParameter('xS4Location', i); - message['X-S4-AlertingScenario'] = this.getNodeParameter('xS4AlertingScenario', i); - message['X-S4-ExternalID'] = this.getNodeParameter('xS4ExternalId', i); - message['X-S4-Filtering'] = this.getNodeParameter('xS4Filtering', i); - - const responseData = await SIGNL4ApiRequest.call(this, message); - - returnData.push(responseData); + } + if (Array.isArray(responseData)) { + returnData.push.apply(returnData, responseData as IDataObject[]); + } else if (responseData !== undefined) { + returnData.push(responseData as IDataObject); } return [this.helpers.returnJsonArray(returnData)]; } diff --git a/packages/nodes-base/package.json b/packages/nodes-base/package.json index 1b4a18a5cc..915b3c81da 100644 --- a/packages/nodes-base/package.json +++ b/packages/nodes-base/package.json @@ -1,6 +1,6 @@ { "name": "n8n-nodes-base", - "version": "0.66.0", + "version": "0.65.0", "description": "Base nodes of n8n", "license": "SEE LICENSE IN LICENSE.md", "homepage": "https://n8n.io", @@ -119,7 +119,7 @@ "dist/credentials/StripeApi.credentials.js", "dist/credentials/SalesmateApi.credentials.js", "dist/credentials/SegmentApi.credentials.js", - "dist/credentials/SIGNL4Api.credentials.js", + "dist/credentials/Signl4Api.credentials.js", "dist/credentials/SurveyMonkeyApi.credentials.js", "dist/credentials/SurveyMonkeyOAuth2Api.credentials.js", "dist/credentials/TelegramApi.credentials.js", @@ -261,7 +261,7 @@ "dist/nodes/Set.node.js", "dist/nodes/Shopify/Shopify.node.js", "dist/nodes/Shopify/ShopifyTrigger.node.js", - "dist/nodes/SIGNL4/SIGNL4.node.js", + "dist/nodes/signl4/Signl4.node.js", "dist/nodes/Slack/Slack.node.js", "dist/nodes/Sms77/Sms77.node.js", "dist/nodes/SplitInBatches.node.js", From 830e4f19b6edfadb0aea20b0ce8b1de553ae9ca2 Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Thu, 25 Jun 2020 09:54:25 +0200 Subject: [PATCH 124/241] :zap: Minor improvements to Signl4-Node --- ...4Api.credentials.ts => Signl4Api.credentials.ts} | 0 .../nodes/{SIGNL4 => Signl4}/GenericFunctions.ts | 0 .../signl4.node.ts => Signl4/Signl4.node.ts} | 4 ++-- .../nodes-base/nodes/{SIGNL4 => Signl4}/signl4.png | Bin packages/nodes-base/package.json | 2 +- 5 files changed, 3 insertions(+), 3 deletions(-) rename packages/nodes-base/credentials/{SIGNL4Api.credentials.ts => Signl4Api.credentials.ts} (100%) rename packages/nodes-base/nodes/{SIGNL4 => Signl4}/GenericFunctions.ts (100%) rename packages/nodes-base/nodes/{SIGNL4/signl4.node.ts => Signl4/Signl4.node.ts} (99%) rename packages/nodes-base/nodes/{SIGNL4 => Signl4}/signl4.png (100%) diff --git a/packages/nodes-base/credentials/SIGNL4Api.credentials.ts b/packages/nodes-base/credentials/Signl4Api.credentials.ts similarity index 100% rename from packages/nodes-base/credentials/SIGNL4Api.credentials.ts rename to packages/nodes-base/credentials/Signl4Api.credentials.ts diff --git a/packages/nodes-base/nodes/SIGNL4/GenericFunctions.ts b/packages/nodes-base/nodes/Signl4/GenericFunctions.ts similarity index 100% rename from packages/nodes-base/nodes/SIGNL4/GenericFunctions.ts rename to packages/nodes-base/nodes/Signl4/GenericFunctions.ts diff --git a/packages/nodes-base/nodes/SIGNL4/signl4.node.ts b/packages/nodes-base/nodes/Signl4/Signl4.node.ts similarity index 99% rename from packages/nodes-base/nodes/SIGNL4/signl4.node.ts rename to packages/nodes-base/nodes/Signl4/Signl4.node.ts index 5a2ec290e3..29d3917cf6 100644 --- a/packages/nodes-base/nodes/SIGNL4/signl4.node.ts +++ b/packages/nodes-base/nodes/Signl4/Signl4.node.ts @@ -268,7 +268,7 @@ export class Signl4 implements INodeType { if (attachments) { if (attachments.attachmentsBinary && items[i].binary) { - const propertyName = (attachments.attachmentsBinary as IDataObject).property as string + const propertyName = (attachments.attachmentsBinary as IDataObject).property as string; const binaryProperty = (items[i].binary as IBinaryKeyData)[propertyName]; @@ -287,7 +287,7 @@ export class Signl4 implements INodeType { filename: binaryProperty.fileName, contentType: binaryProperty.mimeType, }, - } + }; } else { throw new Error(`Binary property ${propertyName} does not exist on input`); diff --git a/packages/nodes-base/nodes/SIGNL4/signl4.png b/packages/nodes-base/nodes/Signl4/signl4.png similarity index 100% rename from packages/nodes-base/nodes/SIGNL4/signl4.png rename to packages/nodes-base/nodes/Signl4/signl4.png diff --git a/packages/nodes-base/package.json b/packages/nodes-base/package.json index 915b3c81da..0fa350583b 100644 --- a/packages/nodes-base/package.json +++ b/packages/nodes-base/package.json @@ -261,7 +261,7 @@ "dist/nodes/Set.node.js", "dist/nodes/Shopify/Shopify.node.js", "dist/nodes/Shopify/ShopifyTrigger.node.js", - "dist/nodes/signl4/Signl4.node.js", + "dist/nodes/Signl4/Signl4.node.js", "dist/nodes/Slack/Slack.node.js", "dist/nodes/Sms77/Sms77.node.js", "dist/nodes/SplitInBatches.node.js", From 6af3743e1ba5ccdbc354cad9701cf22eda2603a5 Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Thu, 25 Jun 2020 11:39:04 +0200 Subject: [PATCH 125/241] :sparkles: Add Postgres SSL support --- packages/cli/config/index.ts | 28 ++++++++++++++++++++++++++++ packages/cli/src/Db.ts | 20 ++++++++++++++++++++ 2 files changed, 48 insertions(+) diff --git a/packages/cli/config/index.ts b/packages/cli/config/index.ts index ce79ca5221..a3c2cfd03a 100644 --- a/packages/cli/config/index.ts +++ b/packages/cli/config/index.ts @@ -63,6 +63,34 @@ const config = convict({ default: 'public', env: 'DB_POSTGRESDB_SCHEMA' }, + + ssl: { + ca: { + doc: 'SSL certificate authority', + format: String, + default: '', + env: 'DB_POSTGRESDB_SSL_CA', + }, + cert: { + doc: 'SSL certificate', + format: String, + default: '', + env: 'DB_POSTGRESDB_SSL_CERT', + }, + key: { + doc: 'SSL key', + format: String, + default: '', + env: 'DB_POSTGRESDB_SSL_KEY', + }, + rejectUnauthorized: { + doc: 'If unauthorized SSL connections should be rejected', + format: 'Boolean', + default: true, + env: 'DB_POSTGRESDB_SSL_REJECT_UNAUTHORIZED', + }, + } + }, mysqldb: { database: { diff --git a/packages/cli/src/Db.ts b/packages/cli/src/Db.ts index 54633adb13..efda1f6366 100644 --- a/packages/cli/src/Db.ts +++ b/packages/cli/src/Db.ts @@ -14,6 +14,8 @@ import { getRepository, } from 'typeorm'; +import { TlsOptions } from 'tls'; + import * as config from '../config'; import { @@ -72,6 +74,22 @@ export async function init(): Promise { case 'postgresdb': entities = PostgresDb; + + const sslCa = await GenericHelpers.getConfigValue('database.postgresdb.ssl.ca') as string; + const sslCert = await GenericHelpers.getConfigValue('database.postgresdb.ssl.cert') as string; + const sslKey = await GenericHelpers.getConfigValue('database.postgresdb.ssl.key') as string; + const sslRejectUnauthorized = await GenericHelpers.getConfigValue('database.postgresdb.ssl.rejectUnauthorized') as boolean; + + let ssl: TlsOptions | undefined = undefined; + if (sslCa !== '' || sslCert !== '' || sslKey !== '' || sslRejectUnauthorized !== true) { + ssl = { + ca: sslCa || undefined, + cert: sslCert || undefined, + key: sslKey || undefined, + rejectUnauthorized: sslRejectUnauthorized, + }; + } + connectionOptions = { type: 'postgres', entityPrefix, @@ -84,7 +102,9 @@ export async function init(): Promise { migrations: [InitialMigration1587669153312], migrationsRun: true, migrationsTableName: `${entityPrefix}migrations`, + ssl, }; + break; case 'mariadb': From ef2b477a2848aa31e6c3af1bbc87a33f0668fd8f Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Thu, 25 Jun 2020 12:25:53 +0200 Subject: [PATCH 126/241] :bookmark: Release n8n-nodes-base@0.66.0 --- packages/nodes-base/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/nodes-base/package.json b/packages/nodes-base/package.json index fa2ca8f79a..9638243632 100644 --- a/packages/nodes-base/package.json +++ b/packages/nodes-base/package.json @@ -1,6 +1,6 @@ { "name": "n8n-nodes-base", - "version": "0.65.0", + "version": "0.66.0", "description": "Base nodes of n8n", "license": "SEE LICENSE IN LICENSE.md", "homepage": "https://n8n.io", From f99da78c1d51e9ee232d0e71d7dfb7fdca147fb3 Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Thu, 25 Jun 2020 12:27:26 +0200 Subject: [PATCH 127/241] :bookmark: Release n8n-editor-ui@0.48.0 --- packages/editor-ui/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/editor-ui/package.json b/packages/editor-ui/package.json index 48caca7524..9491626ddf 100644 --- a/packages/editor-ui/package.json +++ b/packages/editor-ui/package.json @@ -1,6 +1,6 @@ { "name": "n8n-editor-ui", - "version": "0.47.0", + "version": "0.48.0", "description": "Workflow Editor UI for n8n", "license": "SEE LICENSE IN LICENSE.md", "homepage": "https://n8n.io", From 24746f57d0f016a6c8804b68c9d745b8a2a39d73 Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Thu, 25 Jun 2020 12:28:40 +0200 Subject: [PATCH 128/241] :arrow_up: Set n8n-editor-ui@0.48.0 and n8n-nodes-base@0.66.0 on n8n --- packages/cli/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/cli/package.json b/packages/cli/package.json index 1628a80b82..ef0edfcc1d 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -101,8 +101,8 @@ "mongodb": "^3.5.5", "mysql2": "^2.0.1", "n8n-core": "~0.36.0", - "n8n-editor-ui": "~0.47.0", - "n8n-nodes-base": "~0.65.0", + "n8n-editor-ui": "~0.48.0", + "n8n-nodes-base": "~0.66.0", "n8n-workflow": "~0.33.0", "oauth-1.0a": "^2.2.6", "open": "^7.0.0", From 91b3c262fc9689edc5eab3f9e172349f614ff7c9 Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Thu, 25 Jun 2020 12:29:25 +0200 Subject: [PATCH 129/241] :bookmark: Release n8n@0.71.0 --- packages/cli/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/cli/package.json b/packages/cli/package.json index ef0edfcc1d..9e23c91021 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "n8n", - "version": "0.70.0", + "version": "0.71.0", "description": "n8n Workflow Automation Tool", "license": "SEE LICENSE IN LICENSE.md", "homepage": "https://n8n.io", From 28befc10346362b79e4ead8a7ec9d2efb3589b3e Mon Sep 17 00:00:00 2001 From: ricardo Date: Thu, 25 Jun 2020 19:43:49 -0400 Subject: [PATCH 130/241] :zap: Improvements to Eventbrite-Trigger --- .../credentials/EventbriteApi.credentials.ts | 2 +- .../Eventbrite/EventbriteTrigger.node.ts | 38 ++++++++++++------- .../nodes/Eventbrite/GenericFunctions.ts | 12 ++++-- 3 files changed, 35 insertions(+), 17 deletions(-) diff --git a/packages/nodes-base/credentials/EventbriteApi.credentials.ts b/packages/nodes-base/credentials/EventbriteApi.credentials.ts index 9fa48753fb..e54be8580c 100644 --- a/packages/nodes-base/credentials/EventbriteApi.credentials.ts +++ b/packages/nodes-base/credentials/EventbriteApi.credentials.ts @@ -8,7 +8,7 @@ export class EventbriteApi implements ICredentialType { displayName = 'Eventbrite API'; properties = [ { - displayName: 'API Key', + displayName: 'Private Key', name: 'apiKey', type: 'string' as NodePropertyTypes, default: '', diff --git a/packages/nodes-base/nodes/Eventbrite/EventbriteTrigger.node.ts b/packages/nodes-base/nodes/Eventbrite/EventbriteTrigger.node.ts index 8299ae866d..0c9158b6c3 100644 --- a/packages/nodes-base/nodes/Eventbrite/EventbriteTrigger.node.ts +++ b/packages/nodes-base/nodes/Eventbrite/EventbriteTrigger.node.ts @@ -38,7 +38,7 @@ export class EventbriteTrigger implements INodeType { displayOptions: { show: { authentication: [ - 'accessToken', + 'privateKey', ], }, }, @@ -70,15 +70,15 @@ export class EventbriteTrigger implements INodeType { type: 'options', options: [ { - name: 'Access Token', - value: 'accessToken', + name: 'Private Key', + value: 'privateKey', }, { name: 'OAuth2', value: 'oAuth2', }, ], - default: 'accessToken', + default: 'privateKey', description: 'The resource to operate on.', }, { @@ -184,7 +184,6 @@ export class EventbriteTrigger implements INodeType { description: 'By default does the webhook-data only contain the URL to receive
the object data manually. If this option gets activated it
will resolve the data automatically.', }, ], - }; methods = { @@ -227,18 +226,31 @@ export class EventbriteTrigger implements INodeType { default: { async checkExists(this: IHookFunctions): Promise { const webhookData = this.getWorkflowStaticData('node'); + const webhookUrl = this.getNodeWebhookUrl('default'); const organisation = this.getNodeParameter('organization') as string; + const actions = this.getNodeParameter('actions') as string[]; - if (webhookData.webhookId === undefined) { - return false; - } const endpoint = `/organizations/${organisation}/webhooks/`; - try { - await eventbriteApiRequest.call(this, 'GET', endpoint); - } catch (e) { - return false; + + const { webhooks } = await eventbriteApiRequest.call(this, 'GET', endpoint); + + const check = (currentActions: string[], webhookActions: string[]) => { + for (const currentAction of currentActions) { + if (!webhookActions.includes(currentAction)) { + return false; + } + } + return true; + }; + + for (const webhook of webhooks) { + if (webhook.endpoint_url === webhookUrl && check(actions, webhook.actions)) { + webhookData.webhookId = webhook.id; + return true; + } } - return true; + + return false; }, async create(this: IHookFunctions): Promise { const webhookUrl = this.getNodeWebhookUrl('default'); diff --git a/packages/nodes-base/nodes/Eventbrite/GenericFunctions.ts b/packages/nodes-base/nodes/Eventbrite/GenericFunctions.ts index 5bbb517c5d..2392a0ae20 100644 --- a/packages/nodes-base/nodes/Eventbrite/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Eventbrite/GenericFunctions.ts @@ -1,4 +1,7 @@ -import { OptionsWithUri } from 'request'; +import { + OptionsWithUri, +} from 'request'; + import { IExecuteFunctions, IExecuteSingleFunctions, @@ -6,7 +9,10 @@ import { ILoadOptionsFunctions, IWebhookFunctions, } from 'n8n-core'; -import { IDataObject } from 'n8n-workflow'; + +import { + IDataObject, +} from 'n8n-workflow'; export async function eventbriteApiRequest(this: IHookFunctions | IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions | IWebhookFunctions, method: string, resource: string, body: any = {}, qs: IDataObject = {}, uri?: string, option: IDataObject = {}): Promise { // tslint:disable-line:no-any let options: OptionsWithUri = { @@ -25,7 +31,7 @@ export async function eventbriteApiRequest(this: IHookFunctions | IExecuteFuncti const authenticationMethod = this.getNodeParameter('authentication', 0); try { - if (authenticationMethod === 'accessToken') { + if (authenticationMethod === 'privateKey') { const credentials = this.getCredentials('eventbriteApi'); if (credentials === undefined) { throw new Error('No credentials got returned!'); From e68f45c142ab559fafb89953dec8ff2c26c104a0 Mon Sep 17 00:00:00 2001 From: ricardo Date: Thu, 25 Jun 2020 22:29:04 -0400 Subject: [PATCH 131/241] :zap: Improvements to Drift-Node --- .../nodes-base/credentials/DriftOAuth2Api.credentials.ts | 8 +++++++- packages/nodes-base/nodes/Drift/GenericFunctions.ts | 5 +++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/packages/nodes-base/credentials/DriftOAuth2Api.credentials.ts b/packages/nodes-base/credentials/DriftOAuth2Api.credentials.ts index 5b509c5981..1d25c49dfe 100644 --- a/packages/nodes-base/credentials/DriftOAuth2Api.credentials.ts +++ b/packages/nodes-base/credentials/DriftOAuth2Api.credentials.ts @@ -15,7 +15,7 @@ export class DriftOAuth2Api implements ICredentialType { displayName: 'Authorization URL', name: 'authUrl', type: 'hidden' as NodePropertyTypes, - default: 'ttps://dev.drift.com/authorize', + default: 'https://dev.drift.com/authorize', required: true, }, { @@ -31,6 +31,12 @@ export class DriftOAuth2Api implements ICredentialType { type: 'hidden' as NodePropertyTypes, default: '', }, + { + displayName: 'Scope', + name: 'scope', + type: 'hidden' as NodePropertyTypes, + default: '', + }, { displayName: 'Authentication', name: 'authentication', diff --git a/packages/nodes-base/nodes/Drift/GenericFunctions.ts b/packages/nodes-base/nodes/Drift/GenericFunctions.ts index c28d6bd5a2..904fc4c6b3 100644 --- a/packages/nodes-base/nodes/Drift/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Drift/GenericFunctions.ts @@ -46,8 +46,9 @@ export async function driftApiRequest(this: IExecuteFunctions | IWebhookFunction return await this.helpers.requestOAuth2!.call(this, 'driftOAuth2Api', options); } } catch (error) { - if (error.response) { - const errorMessage = error.message || (error.response.body && error.response.body.message ); + + if (error.response && error.response.body && error.response.body.error) { + const errorMessage = error.response.body.error.message; throw new Error(`Drift error response [${error.statusCode}]: ${errorMessage}`); } throw error; From d199e1e638a62c909ec9a3034635c4f5409097db Mon Sep 17 00:00:00 2001 From: Rupenieks Date: Fri, 26 Jun 2020 13:32:48 +0200 Subject: [PATCH 132/241] checkExists modified --- .../nodes/Postmark/GenericFunctions.ts | 48 +++++ .../nodes/Postmark/PostmarkTrigger.node.ts | 197 +++++++----------- 2 files changed, 128 insertions(+), 117 deletions(-) diff --git a/packages/nodes-base/nodes/Postmark/GenericFunctions.ts b/packages/nodes-base/nodes/Postmark/GenericFunctions.ts index d65777d881..5844d28d7c 100644 --- a/packages/nodes-base/nodes/Postmark/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Postmark/GenericFunctions.ts @@ -37,6 +37,8 @@ export async function postmarkApiRequest(this: IExecuteFunctions | IWebhookFunct } options = Object.assign({}, options, option); + console.log(options); + try { return await this.helpers.request!(options); } catch (error) { @@ -44,4 +46,50 @@ export async function postmarkApiRequest(this: IExecuteFunctions | IWebhookFunct } } +// tslint:disable-next-line: no-any +export function convertTriggerObjectToStringArray (webhookObject : any) : string[] { + const triggers = webhookObject.Triggers; + const webhookEvents : string[] = []; + + // Translate Webhook trigger settings to string array + if (triggers.Open.Enabled) { + webhookEvents.push('open'); + } + if (triggers.Open.PostFirstOpenOnly) { + webhookEvents.push('firstOpen'); + } + if (triggers.Click.Enabled) { + webhookEvents.push('click'); + } + if (triggers.Delivery.Enabled) { + webhookEvents.push('delivery'); + } + if (triggers.Bounce.Enabled) { + webhookEvents.push('bounce'); + } + if (triggers.Bounce.IncludeContent) { + webhookEvents.push('bounceContent'); + } + if (triggers.SpamComplaint.Enabled) { + webhookEvents.push('spamComplaint'); + } + if (triggers.SpamComplaint.IncludeContent) { + webhookEvents.push('spamComplaintContent'); + } + if (triggers.SubscriptionChange.Enabled) { + webhookEvents.push('subscriptionChange'); + } + + return webhookEvents; +} + +export function eventExists (currentEvents : string[], webhookEvents: string[]) { + for (const currentEvent of currentEvents) { + if (!webhookEvents.includes(currentEvent)) { + return false; + } + } + return true; +} + diff --git a/packages/nodes-base/nodes/Postmark/PostmarkTrigger.node.ts b/packages/nodes-base/nodes/Postmark/PostmarkTrigger.node.ts index 15af530cad..f6f09afdd4 100644 --- a/packages/nodes-base/nodes/Postmark/PostmarkTrigger.node.ts +++ b/packages/nodes-base/nodes/Postmark/PostmarkTrigger.node.ts @@ -10,7 +10,9 @@ import { } from 'n8n-workflow'; import { - postmarkApiRequest, + convertTriggerObjectToStringArray, + eventExists, + postmarkApiRequest } from './GenericFunctions'; export class PostmarkTrigger implements INodeType { @@ -43,88 +45,54 @@ export class PostmarkTrigger implements INodeType { ], properties: [ { - displayName: 'Open', - name: 'open', - type: 'boolean', - default: false, - description: 'Listing for if the Open webhook is enabled/disabled.', - }, - { - displayName: 'First Open Only', - name: 'postFirstOpenOnly', - type: 'boolean', - default: false, - displayOptions: { - show: { - open: [ - true - ], + displayName: 'Events', + name: 'events', + type: 'multiOptions', + options: [ + { + name: 'Open', + value: 'open', + description: 'Trigger webhook on open.' }, - }, - description: 'Webhook will only post on first open if enabled.', - }, - { - displayName: 'Click', - name: 'click', - type: 'boolean', - default: false, - description: 'Listing for if the Click webhook is enabled/disabled.', - }, - { - displayName: 'Delivery', - name: 'delivery', - type: 'boolean', - default: false, - description: 'Listing for if the Delivery webhook is enabled/disabled.', - }, - { - displayName: 'Bounce', - name: 'bounce', - type: 'boolean', - default: false, - description: 'Listing for if the Bounce webhook is enabled/disabled.', - }, - { - displayName: 'Bounce Include Content', - name: 'bounceIncludeContent', - type: 'boolean', - default: false, - displayOptions: { - show: { - bounce: [ - true - ], + { + name: 'First Open', + value: 'firstOpen', + description: 'Trigger on first open only.' }, - }, - description: 'Webhook will send full bounce content if IncludeContent is enabled.', - }, - { - displayName: 'Spam Complaint', - name: 'spamComplaint', - type: 'boolean', - default: false, - description: 'Listing for if the Spam webhook is enabled/disabled.', - }, - { - displayName: 'Spam Complaint Include Content', - name: 'spamComplaintIncludeContent', - type: 'boolean', - default: false, - displayOptions: { - show: { - spamComplaint: [ - true - ], + { + name: 'Click', + value: 'click', }, - }, - description: 'Webhook will send full spam content if IncludeContent is enabled.', - }, - { - displayName: 'Subscription Change', - name: 'subscriptionChange', - type: 'boolean', - default: false, - description: 'Listing for if the Subscription Change webhook is enabled/disabled.', + { + name: 'Delivery', + value: 'delivery', + }, + { + name: 'Bounce', + value: 'bounce', + }, + { + name: 'Bounce Content', + value: 'bounceContent', + description: 'Webhook will send full bounce content.' + }, + { + name: 'Spam Complaint', + value: 'spamComplaint', + }, + { + name: 'Spam Complaint Content', + value: 'spamComplaintContent', + description: 'Webhook will send full bounce content.' + }, + { + name: 'Subscription Change', + value: 'subscriptionChange', + }, + ], + default: [], + required: true, + description: 'Webhook events that will be enabled for that endpoint.', }, ], @@ -135,23 +103,28 @@ export class PostmarkTrigger implements INodeType { default: { async checkExists(this: IHookFunctions): Promise { const webhookData = this.getWorkflowStaticData('node'); + const webhookUrl = this.getNodeWebhookUrl('default'); + const events = this.getNodeParameter('events') as string[]; - if (webhookData.webhookId === undefined) { - // No webhook id is set so no webhook can exist - return false; - } - - // Webhook got created before so check if it still exists - const endpoint = `/webhooks/${webhookData.webhookId}`; + // Get all webhooks + const endpoint = `/webhooks`; const responseData = await postmarkApiRequest.call(this, 'GET', endpoint, {}); - if (responseData.ID === undefined) { + // No webhooks exist + if (responseData.Webhooks.length === 0) { return false; } - else if (responseData.ID === webhookData.id) { - return true; + + // If webhooks exist, check if any match current settings + for (const webhook of responseData.Webhooks) { + if (webhook.Url === webhookUrl && eventExists(events, convertTriggerObjectToStringArray(webhook))) { + webhookData.webhookId = webhook.ID; + // webhook identical to current settings. re-assign webhook id to found webhook. + return true; + } } + return false; }, async create(this: IHookFunctions): Promise { @@ -187,44 +160,34 @@ export class PostmarkTrigger implements INodeType { } }; - const open = this.getNodeParameter('open', 0); - const postFirstOpenOnly = this.getNodeParameter('postFirstOpenOnly', 0); - const click = this.getNodeParameter('click', 0); - const delivery = this.getNodeParameter('delivery', 0); - const bounce = this.getNodeParameter('bounce', 0); - const bounceIncludeContent = this.getNodeParameter('bounceIncludeContent', 0); - const spamComplaint = this.getNodeParameter('spamComplaint', 0); - const spamComplaintIncludeContent = this.getNodeParameter('spamComplaintIncludeContent', 0); - const subscriptionChange = this.getNodeParameter('subscriptionChange', 0); + const events = this.getNodeParameter('events') as string[]; - if (open) { + if (events.includes('open')) { body.Triggers.Open.Enabled = true; - - if (postFirstOpenOnly) { - body.Triggers.Open.PostFirstOpenOnly = true; - } } - if (click) { + if (events.includes('firstOpen')) { + body.Triggers.Open.Enabled = true; + body.Triggers.Open.PostFirstOpenOnly = true; + } + if (events.includes('click')) { body.Triggers.Click.Enabled = true; } - if (delivery) { + if (events.includes('delivery')) { body.Triggers.Delivery.Enabled = true; } - if (bounce) { + if (events.includes('bounce')) { body.Triggers.Bounce.Enabled = true; - - if (bounceIncludeContent) { - body.Triggers.Bounce.IncludeContent = true; - } } - if (spamComplaint) { + if (events.includes('bounceContent')) { + body.Triggers.Bounce.IncludeContent = true; + } + if (events.includes('spamComplaint')) { body.Triggers.SpamComplaint.Enabled = true; - - if (spamComplaintIncludeContent) { - body.Triggers.SpamComplaint.IncludeContent = true; - } } - if (subscriptionChange) { + if (events.includes('spamComplaintContent')) { + body.Triggers.SpamComplaint.IncludeContent = true; + } + if (events.includes('subscriptionChange')) { body.Triggers.SubscriptionChange.Enabled = true; } From 7c9ecdb1722f5c0f80327cab6b43b91459c235d4 Mon Sep 17 00:00:00 2001 From: Rupenieks Date: Fri, 26 Jun 2020 14:56:24 +0200 Subject: [PATCH 133/241] Removed console log --- packages/nodes-base/nodes/Postmark/GenericFunctions.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages/nodes-base/nodes/Postmark/GenericFunctions.ts b/packages/nodes-base/nodes/Postmark/GenericFunctions.ts index 5844d28d7c..115fac51f0 100644 --- a/packages/nodes-base/nodes/Postmark/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Postmark/GenericFunctions.ts @@ -37,8 +37,6 @@ export async function postmarkApiRequest(this: IExecuteFunctions | IWebhookFunct } options = Object.assign({}, options, option); - console.log(options); - try { return await this.helpers.request!(options); } catch (error) { From 591630abd16c6a18e803071ca85650aaf800e9d2 Mon Sep 17 00:00:00 2001 From: ricardo Date: Fri, 26 Jun 2020 09:27:41 -0400 Subject: [PATCH 134/241] :bug: Fix timezone issue --- packages/nodes-base/nodes/Zoom/Zoom.node.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/nodes-base/nodes/Zoom/Zoom.node.ts b/packages/nodes-base/nodes/Zoom/Zoom.node.ts index 2395f8a318..7f735d33b8 100644 --- a/packages/nodes-base/nodes/Zoom/Zoom.node.ts +++ b/packages/nodes-base/nodes/Zoom/Zoom.node.ts @@ -319,7 +319,12 @@ export class Zoom implements INodeType { } if (additionalFields.startTime) { - body.start_time = additionalFields.startTime as string; + if (additionalFields.timeZone) { + body.start_time = moment(additionalFields.startTime as string).format('YYYY-MM-DDTHH:mm:ss'); + } else { + // if none timezone it's defined used n8n timezone + body.start_time = moment.tz(additionalFields.startTime as string, this.getTimezone()).format(); + } } if (additionalFields.duration) { @@ -342,6 +347,8 @@ export class Zoom implements INodeType { body.agenda = additionalFields.agenda as string; } + console.log(body); + responseData = await zoomApiRequest.call( this, 'POST', From 3660f535ac4ced653f7257c8c2f9f363f17ba064 Mon Sep 17 00:00:00 2001 From: ricardo Date: Fri, 26 Jun 2020 17:48:07 -0400 Subject: [PATCH 135/241] :zap: Add .svg to gulpfile --- packages/nodes-base/gulpfile.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/nodes-base/gulpfile.js b/packages/nodes-base/gulpfile.js index 9771a4017c..58ba6ec51a 100644 --- a/packages/nodes-base/gulpfile.js +++ b/packages/nodes-base/gulpfile.js @@ -1,7 +1,7 @@ const { src, dest } = require('gulp'); function copyIcons() { - return src('nodes/**/*.png') + return src('nodes/**/*.{png,svg}') .pipe(dest('dist/nodes')); } From a6557e32dc0e29f183f0f96db21835b0c7c42664 Mon Sep 17 00:00:00 2001 From: Pablo Estevez Date: Sun, 28 Jun 2020 11:30:26 -0400 Subject: [PATCH 136/241] :zap: Add option to ignore SSL issues to Graph API node (#703) --- .../nodes-base/nodes/Facebook/FacebookGraphApi.node.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/nodes-base/nodes/Facebook/FacebookGraphApi.node.ts b/packages/nodes-base/nodes/Facebook/FacebookGraphApi.node.ts index 59c55a33f4..f1fc3b8881 100644 --- a/packages/nodes-base/nodes/Facebook/FacebookGraphApi.node.ts +++ b/packages/nodes-base/nodes/Facebook/FacebookGraphApi.node.ts @@ -137,6 +137,13 @@ export class FacebookGraphApi implements INodeType { placeholder: 'videos', required: false, }, + { + displayName: 'Ignore SSL Issues', + name: 'allowUnauthorizedCerts', + type: 'boolean', + default: false, + description: 'Still download the response even if SSL certificate validation is not possible. (Not recommended)', + }, { displayName: 'Send Binary Data', name: 'sendBinaryData', @@ -301,6 +308,7 @@ export class FacebookGraphApi implements INodeType { qs: { access_token: graphApiCredentials!.accessToken, }, + rejectUnauthorized: !this.getNodeParameter('allowUnauthorizedCerts', itemIndex, false) as boolean, }; if (options !== undefined) { From 4d5c166414c3faade7dce0fa0a59d8c007bb44bb Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Mon, 29 Jun 2020 14:39:43 +0200 Subject: [PATCH 137/241] :rocket: Switch to new docs --- docs/CNAME | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/CNAME b/docs/CNAME index 3ea71f7d8f..22a8459481 100644 --- a/docs/CNAME +++ b/docs/CNAME @@ -1 +1 @@ -docs.n8n.io \ No newline at end of file +docs-old.n8n.io From 13f71d3af0308e8a95e3db90d0681d0e344fda3b Mon Sep 17 00:00:00 2001 From: Ricardo Espinoza Date: Mon, 29 Jun 2020 09:38:50 -0400 Subject: [PATCH 138/241] :zap: Improvements to Pipedrive node (#707) --- .../nodes/Pipedrive/GenericFunctions.ts | 9 ++- .../nodes/Pipedrive/Pipedrive.node.ts | 77 +++++++++++++++++++ 2 files changed, 83 insertions(+), 3 deletions(-) diff --git a/packages/nodes-base/nodes/Pipedrive/GenericFunctions.ts b/packages/nodes-base/nodes/Pipedrive/GenericFunctions.ts index 32e8194359..33bf215b12 100644 --- a/packages/nodes-base/nodes/Pipedrive/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Pipedrive/GenericFunctions.ts @@ -5,10 +5,12 @@ import { import { IDataObject, + ILoadOptionsFunctions, } from 'n8n-workflow'; -import { OptionsWithUri } from 'request'; - +import { + OptionsWithUri, +} from 'request'; export interface ICustomInterface { name: string; @@ -33,7 +35,7 @@ export interface ICustomProperties { * @param {object} body * @returns {Promise} */ -export async function pipedriveApiRequest(this: IHookFunctions | IExecuteFunctions, method: string, endpoint: string, body: IDataObject, query?: IDataObject, formData?: IDataObject, downloadFile?: boolean): Promise { // tslint:disable-line:no-any +export async function pipedriveApiRequest(this: IHookFunctions | IExecuteFunctions | ILoadOptionsFunctions, method: string, endpoint: string, body: IDataObject, query?: IDataObject, formData?: IDataObject, downloadFile?: boolean): Promise { // tslint:disable-line:no-any const credentials = this.getCredentials('pipedriveApi'); if (credentials === undefined) { throw new Error('No credentials got returned!'); @@ -66,6 +68,7 @@ export async function pipedriveApiRequest(this: IHookFunctions | IExecuteFunctio } try { + //@ts-ignore const responseData = await this.helpers.request(options); if (downloadFile === true) { diff --git a/packages/nodes-base/nodes/Pipedrive/Pipedrive.node.ts b/packages/nodes-base/nodes/Pipedrive/Pipedrive.node.ts index 8ae9c42630..a5cd93ab9f 100644 --- a/packages/nodes-base/nodes/Pipedrive/Pipedrive.node.ts +++ b/packages/nodes-base/nodes/Pipedrive/Pipedrive.node.ts @@ -1,12 +1,14 @@ import { BINARY_ENCODING, IExecuteFunctions, + ILoadOptionsFunctions, } from 'n8n-core'; import { IDataObject, INodeTypeDescription, INodeExecutionData, INodeType, + INodePropertyOptions, } from 'n8n-workflow'; import { @@ -2047,9 +2049,68 @@ export class Pipedrive implements INodeType { description: 'How many results to return.', }, + // ---------------------------------- + // person:getAll + // ---------------------------------- + { + displayName: 'Additional Fields', + name: 'additionalFields', + type: 'collection', + placeholder: 'Add Field', + displayOptions: { + show: { + operation: [ + 'getAll', + ], + resource: [ + 'person', + ], + }, + }, + default: {}, + options: [ + { + displayName: 'Filter ID', + name: 'filterId', + type: 'options', + typeOptions: { + loadOptionsMethod: 'getFilters', + }, + default: '', + description: 'ID of the filter to use.', + }, + { + displayName: 'First Char', + name: 'firstChar', + type: 'string', + default: '', + description: 'If supplied, only persons whose name starts with the specified letter will be returned ', + }, + ], + }, ], }; + methods = { + loadOptions: { + // Get all the filters to display them to user so that he can + // select them easily + async getFilters(this: ILoadOptionsFunctions): Promise { + const returnData: INodePropertyOptions[] = []; + const { data } = await pipedriveApiRequest.call(this, 'GET', '/filters', {}, { type: 'people' }); + for (const filter of data) { + const filterName = filter.name; + const filterId = filter.id; + returnData.push({ + name: filterName, + value: filterId, + }); + } + return returnData; + }, + } + }; + async execute(this: IExecuteFunctions): Promise { const items = this.getInputData(); @@ -2453,6 +2514,16 @@ export class Pipedrive implements INodeType { qs.limit = this.getNodeParameter('limit', i) as number; } + const additionalFields = this.getNodeParameter('additionalFields', i) as IDataObject; + + if (additionalFields.filterId) { + qs.filter_id = additionalFields.filterId as string; + } + + if (additionalFields.firstChar) { + qs.first_char = additionalFields.firstChar as string; + } + endpoint = `/persons`; } else if (operation === 'update') { @@ -2499,6 +2570,7 @@ export class Pipedrive implements INodeType { } responseData = await pipedriveApiRequest.call(this, requestMethod, endpoint, body, qs, formData, downloadFile); + } if (resource === 'file' && operation === 'download') { @@ -2520,6 +2592,11 @@ export class Pipedrive implements INodeType { items[i].binary![binaryPropertyName] = await this.helpers.prepareBinaryData(responseData.data); } else { + + if (responseData.data === null) { + responseData.data = []; + } + if (Array.isArray(responseData.data)) { returnData.push.apply(returnData, responseData.data as IDataObject[]); } else { From 95068aa132526a3469275b6541c191fd2ea51e1b Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Tue, 30 Jun 2020 16:55:17 +0200 Subject: [PATCH 139/241] :whale: Expose port in dockerfile --- docker/images/n8n-custom/Dockerfile | 2 ++ docker/images/n8n-ubuntu/Dockerfile | 2 ++ docker/images/n8n/Dockerfile | 2 ++ 3 files changed, 6 insertions(+) diff --git a/docker/images/n8n-custom/Dockerfile b/docker/images/n8n-custom/Dockerfile index f4e4af4ed7..d12f8f6b08 100644 --- a/docker/images/n8n-custom/Dockerfile +++ b/docker/images/n8n-custom/Dockerfile @@ -42,3 +42,5 @@ COPY --from=builder /data ./ COPY docker/images/n8n-custom/docker-entrypoint.sh /docker-entrypoint.sh ENTRYPOINT ["tini", "--", "/docker-entrypoint.sh"] + +EXPOSE 5678/tcp diff --git a/docker/images/n8n-ubuntu/Dockerfile b/docker/images/n8n-ubuntu/Dockerfile index 200506f058..94935f0602 100644 --- a/docker/images/n8n-ubuntu/Dockerfile +++ b/docker/images/n8n-ubuntu/Dockerfile @@ -19,3 +19,5 @@ WORKDIR /data COPY docker-entrypoint.sh /docker-entrypoint.sh ENTRYPOINT ["/docker-entrypoint.sh"] + +EXPOSE 5678/tcp diff --git a/docker/images/n8n/Dockerfile b/docker/images/n8n/Dockerfile index c0997dcabd..af8f29cc5c 100644 --- a/docker/images/n8n/Dockerfile +++ b/docker/images/n8n/Dockerfile @@ -22,3 +22,5 @@ WORKDIR /data COPY docker-entrypoint.sh /docker-entrypoint.sh ENTRYPOINT ["tini", "--", "/docker-entrypoint.sh"] + +EXPOSE 5678/tcp From 574167bf3d40cd5a74597ffa73cee59c248eb09d Mon Sep 17 00:00:00 2001 From: Erin McNulty Date: Tue, 30 Jun 2020 11:59:58 -0400 Subject: [PATCH 140/241] :bug: Changed reponseMode to responseMode (#711) --- packages/node-dev/templates/webhook/simple.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/node-dev/templates/webhook/simple.ts b/packages/node-dev/templates/webhook/simple.ts index eaf1521e84..ab81ca51d2 100644 --- a/packages/node-dev/templates/webhook/simple.ts +++ b/packages/node-dev/templates/webhook/simple.ts @@ -27,7 +27,7 @@ export class ClassNameReplace implements INodeType { { name: 'default', httpMethod: 'POST', - reponseMode: 'onReceived', + responseMode: 'onReceived', // Each webhook property can either be hardcoded // like the above ones or referenced from a parameter // like the "path" property bellow From bdd63fd54d7a8ffcdf961450751fc6719ddfdd16 Mon Sep 17 00:00:00 2001 From: Sven Schmidt <0xsven@gmail.com> Date: Tue, 30 Jun 2020 18:02:26 +0200 Subject: [PATCH 141/241] =?UTF-8?q?=F0=9F=93=9A=20Fix=20typo=20in=20create?= =?UTF-8?q?-node=20docs=20(#693)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/create-node.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/create-node.md b/docs/create-node.md index aa19393983..183c11c734 100644 --- a/docs/create-node.md +++ b/docs/create-node.md @@ -135,7 +135,7 @@ When a node can perform multiple operations like edit and delete some kind of en Some nodes may need a lot of options. Add only the very important ones to the top level and for all others, create an "Options" parameter where they can be added if needed. This ensures that the interface stays clean and does not unnecessarily confuse people. A good example of that would be the XML node. -### Follow exiting parameter naming guideline +### Follow existing parameter naming guideline There is not much of a guideline yet but if your node can do multiple things, call the parameter which sets the behavior either "mode" (like "Merge" and "XML" node) or "operation" like the most other ones. If these operations can be done on different resources (like "User" or "Order) create a "resource" parameter (like "Pipedrive" and "Trello" node) From 872bc9df75427ffe742cfc169729dfc99210e195 Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Tue, 30 Jun 2020 20:08:52 +0200 Subject: [PATCH 142/241] :bug: Write env encryption key to config if file does not exist #713 --- packages/core/src/UserSettings.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/core/src/UserSettings.ts b/packages/core/src/UserSettings.ts index 211341ed25..fb38fc779c 100644 --- a/packages/core/src/UserSettings.ts +++ b/packages/core/src/UserSettings.ts @@ -41,8 +41,13 @@ export async function prepareUserSettings(): Promise { userSettings = {}; } - // Settings and/or key do not exist. So generate a new encryption key - userSettings.encryptionKey = randomBytes(24).toString('base64'); + if (process.env[ENCRYPTION_KEY_ENV_OVERWRITE] !== undefined) { + // Use the encryption key which got set via environment + userSettings.encryptionKey = process.env[ENCRYPTION_KEY_ENV_OVERWRITE]; + } else { + // Generate a new encryption key + userSettings.encryptionKey = randomBytes(24).toString('base64'); + } console.log(`UserSettings got generated and saved to: ${settingsPath}`); From fc4ebfedca4071bfd6f57d8db774bb9a3131e89c Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Tue, 30 Jun 2020 20:30:14 +0200 Subject: [PATCH 143/241] :bug: Fix bug that fromFormat field did not get used in pre-check #712 --- packages/nodes-base/nodes/DateTime.node.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/nodes-base/nodes/DateTime.node.ts b/packages/nodes-base/nodes/DateTime.node.ts index 953375e8d9..15c33dcffc 100644 --- a/packages/nodes-base/nodes/DateTime.node.ts +++ b/packages/nodes-base/nodes/DateTime.node.ts @@ -243,9 +243,10 @@ export class DateTime implements INodeType { if (currentDate === undefined) { continue; } - if (!moment(currentDate as string | number).isValid()) { + if (options.fromFormat === undefined && !moment(currentDate as string | number).isValid()) { throw new Error('The date input format could not be recognized. Please set the "From Format" field'); } + if (Number.isInteger(currentDate as unknown as number)) { newDate = moment.unix(currentDate as unknown as number); } else { From 6f51657ef8d8a1ddbd9180e1931bbc1b07ff9f74 Mon Sep 17 00:00:00 2001 From: ricardo Date: Tue, 30 Jun 2020 18:46:45 -0400 Subject: [PATCH 144/241] :sparkles: CircleCI-Node --- .../credentials/CircleCiApi.credentials.ts | 17 ++ .../nodes/CircleCi/CircleCi.node.ts | 137 +++++++++++ .../nodes/CircleCi/GenericFunctions.ts | 67 ++++++ .../nodes/CircleCi/PipelineDescription.ts | 222 ++++++++++++++++++ .../nodes-base/nodes/CircleCi/circleCi.png | Bin 0 -> 4787 bytes packages/nodes-base/package.json | 2 + 6 files changed, 445 insertions(+) create mode 100644 packages/nodes-base/credentials/CircleCiApi.credentials.ts create mode 100644 packages/nodes-base/nodes/CircleCi/CircleCi.node.ts create mode 100644 packages/nodes-base/nodes/CircleCi/GenericFunctions.ts create mode 100644 packages/nodes-base/nodes/CircleCi/PipelineDescription.ts create mode 100644 packages/nodes-base/nodes/CircleCi/circleCi.png diff --git a/packages/nodes-base/credentials/CircleCiApi.credentials.ts b/packages/nodes-base/credentials/CircleCiApi.credentials.ts new file mode 100644 index 0000000000..88ecdc4fe1 --- /dev/null +++ b/packages/nodes-base/credentials/CircleCiApi.credentials.ts @@ -0,0 +1,17 @@ +import { + ICredentialType, + NodePropertyTypes, +} from 'n8n-workflow'; + +export class CircleCiApi implements ICredentialType { + name = 'circleCiApi'; + displayName = 'CircleCI API'; + properties = [ + { + displayName: 'API Key', + name: 'apiKey', + type: 'string' as NodePropertyTypes, + default: '', + }, + ]; +} diff --git a/packages/nodes-base/nodes/CircleCi/CircleCi.node.ts b/packages/nodes-base/nodes/CircleCi/CircleCi.node.ts new file mode 100644 index 0000000000..00eded6366 --- /dev/null +++ b/packages/nodes-base/nodes/CircleCi/CircleCi.node.ts @@ -0,0 +1,137 @@ +import { + IExecuteFunctions, +} from 'n8n-core'; + +import { + IDataObject, + INodeTypeDescription, + INodeExecutionData, + INodeType, +} from 'n8n-workflow'; + +import { + pipelineFields, + pipelineOperations, +} from './PipelineDescription'; + +import { + circleciApiRequest, + circleciApiRequestAllItems, +} from './GenericFunctions'; + +export class CircleCi implements INodeType { + description: INodeTypeDescription = { + displayName: 'CircleCI', + name: 'circleCi', + icon: 'file:circleCi.png', + group: ['output'], + version: 1, + subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}', + description: 'Consume CircleCI API', + defaults: { + name: 'CircleCI', + color: '#04AA51', + }, + inputs: ['main'], + outputs: ['main'], + credentials: [ + { + name: 'circleCiApi', + required: true, + } + ], + properties: [ + { + displayName: 'Resource', + name: 'resource', + type: 'options', + options: [ + { + name: ' Pipeline', + value: 'pipeline', + }, + ], + default: 'pipeline', + description: 'Resource to consume.', + }, + ...pipelineOperations, + ...pipelineFields, + ], + }; + + async execute(this: IExecuteFunctions): Promise { + const items = this.getInputData(); + const returnData: IDataObject[] = []; + const length = items.length as unknown as number; + const qs: IDataObject = {}; + let responseData; + const resource = this.getNodeParameter('resource', 0) as string; + const operation = this.getNodeParameter('operation', 0) as string; + + for (let i = 0; i < length; i++) { + if (resource === 'pipeline') { + if (operation === 'get') { + let slug = this.getNodeParameter('projectSlug', i) as string; + const pipelineNumber = this.getNodeParameter('pipelineNumber', i) as number; + + slug = slug.replace(new RegExp(/\//g), '%2F'); + + const endpoint = `/project/${slug}/pipeline/${pipelineNumber}`; + + responseData = await circleciApiRequest.call(this, 'GET', endpoint, {}, qs); + } + if (operation === 'getAll') { + const filters = this.getNodeParameter('filters', i) as IDataObject; + const returnAll = this.getNodeParameter('returnAll', i) as boolean; + let slug = this.getNodeParameter('projectSlug', i) as string; + + slug = slug.replace(new RegExp(/\//g), '%2F'); + + if (filters.branch) { + qs.branch = filters.branch; + } + + const endpoint = `/project/${slug}/pipeline`; + + if (returnAll === true) { + responseData = await circleciApiRequestAllItems.call(this, 'items', 'GET', endpoint, {}, qs); + + } else { + qs.limit = this.getNodeParameter('limit', i) as number; + responseData = await circleciApiRequest.call(this, 'GET', endpoint, {}, qs); + responseData = responseData.items; + responseData = responseData.splice(0, qs.limit); + } + } + + if (operation === 'trigger') { + let slug = this.getNodeParameter('projectSlug', i) as string; + + const additionalFields = this.getNodeParameter('additionalFields', i) as IDataObject; + + slug = slug.replace(new RegExp(/\//g), '%2F'); + + const endpoint = `/project/${slug}/pipeline`; + + const body: IDataObject = {}; + + if (additionalFields.branch) { + body.branch = additionalFields.branch as string; + } + + if (additionalFields.tag) { + body.tag = additionalFields.tag as string; + } + + responseData = await circleciApiRequest.call(this, 'POST', endpoint, body, qs); + } + } + if (Array.isArray(responseData)) { + returnData.push.apply(returnData, responseData as IDataObject[]); + } else { + returnData.push(responseData as IDataObject); + } + } + return [this.helpers.returnJsonArray(returnData)]; + } +} diff --git a/packages/nodes-base/nodes/CircleCi/GenericFunctions.ts b/packages/nodes-base/nodes/CircleCi/GenericFunctions.ts new file mode 100644 index 0000000000..fb30950a1a --- /dev/null +++ b/packages/nodes-base/nodes/CircleCi/GenericFunctions.ts @@ -0,0 +1,67 @@ +import { + OptionsWithUri, +} from 'request'; + +import { + IExecuteFunctions, + IExecuteSingleFunctions, + IHookFunctions, + ILoadOptionsFunctions, +} from 'n8n-core'; + +import { + IDataObject, +} from 'n8n-workflow'; + +export async function circleciApiRequest(this: IHookFunctions | IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions, method: string, resource: string, body: any = {}, qs: IDataObject = {}, uri?: string, option: IDataObject = {}): Promise { // tslint:disable-line:no-any + const credentials = this.getCredentials('circleCiApi'); + if (credentials === undefined) { + throw new Error('No credentials got returned!'); + } + let options: OptionsWithUri = { + headers: { + 'Circle-Token': credentials.apiKey, + 'Accept': 'application/json', + }, + method, + qs, + body, + uri: uri ||`https://circleci.com/api/v2${resource}`, + json: true + }; + options = Object.assign({}, options, option); + if (Object.keys(options.body).length === 0) { + delete options.body; + } + try { + return await this.helpers.request!(options); + } catch (err) { + if (err.response && err.response.body && err.response.body.message) { + // Try to return the error prettier + throw new Error(`CircleCI error response [${err.statusCode}]: ${err.response.body.message}`); + } + + // If that data does not exist for some reason return the actual error + throw err; } +} + +/** + * Make an API request to paginated CircleCI endpoint + * and return all results + */ +export async function circleciApiRequestAllItems(this: IHookFunctions | IExecuteFunctions| ILoadOptionsFunctions, propertyName: string, method: string, resource: string, body: any = {}, query: IDataObject = {}): Promise { // tslint:disable-line:no-any + + const returnData: IDataObject[] = []; + + let responseData; + + do { + responseData = await circleciApiRequest.call(this, method, resource, body, query); + returnData.push.apply(returnData, responseData[propertyName]); + query['page-token'] = responseData.next_page_token; + } while ( + responseData.next_page_token !== undefined && + responseData.next_page_token !== null + ); + return returnData; +} diff --git a/packages/nodes-base/nodes/CircleCi/PipelineDescription.ts b/packages/nodes-base/nodes/CircleCi/PipelineDescription.ts new file mode 100644 index 0000000000..66b99f3eb3 --- /dev/null +++ b/packages/nodes-base/nodes/CircleCi/PipelineDescription.ts @@ -0,0 +1,222 @@ +import { + INodeProperties, +} from 'n8n-workflow'; + +export const pipelineOperations = [ + { + displayName: 'Operation', + name: 'operation', + type: 'options', + displayOptions: { + show: { + resource: [ + 'pipeline', + ], + }, + }, + options: [ + { + name: 'Get', + value: 'get', + description: 'Get a pipeline', + }, + { + name: 'Get All', + value: 'getAll', + description: 'Get all pipelines', + }, + { + name: 'Trigger', + value: 'trigger', + description: 'Trigger a pipeline', + }, + ], + default: 'get', + description: 'The operation to perform.', + }, +] as INodeProperties[]; + +export const pipelineFields = [ + +/* -------------------------------------------------------------------------- */ +/* pipeline:get */ +/* -------------------------------------------------------------------------- */ + { + displayName: 'Project Slug', + name: 'projectSlug', + type: 'string', + displayOptions: { + show: { + operation: [ + 'get', + ], + resource: [ + 'pipeline', + ], + }, + }, + default: '', + description: 'Project slug in the form vcs-slug/org-name/repo-name', + }, + { + displayName: 'Pipeline Number', + name: 'pipelineNumber', + type: 'number', + displayOptions: { + show: { + operation: [ + 'get', + ], + resource: [ + 'pipeline', + ], + }, + }, + default: 0, + description: 'The number of the pipeline', + }, +/* -------------------------------------------------------------------------- */ +/* pipeline:getAll */ +/* -------------------------------------------------------------------------- */ + { + displayName: 'Project Slug', + name: 'projectSlug', + type: 'string', + displayOptions: { + show: { + operation: [ + 'getAll', + ], + resource: [ + 'pipeline', + ], + }, + }, + default: '', + description: 'Project slug in the form vcs-slug/org-name/repo-name', + }, + { + displayName: 'Return All', + name: 'returnAll', + type: 'boolean', + displayOptions: { + show: { + operation: [ + 'getAll', + ], + resource: [ + 'pipeline', + ], + }, + }, + default: false, + description: 'If all results should be returned or only up to a given limit.', + }, + { + displayName: 'Limit', + name: 'limit', + type: 'number', + displayOptions: { + show: { + operation: [ + 'getAll', + ], + resource: [ + 'pipeline', + ], + returnAll: [ + false, + ], + }, + }, + typeOptions: { + minValue: 1, + maxValue: 500, + }, + default: 100, + description: 'How many results to return.', + }, + { + displayName: 'Filters', + name: 'filters', + type: 'collection', + placeholder: 'Add Filter', + default: {}, + displayOptions: { + show: { + resource: [ + 'pipeline', + ], + operation: [ + 'getAll', + ], + }, + }, + options: [ + { + displayName: 'Branch', + name: 'branch', + type: 'string', + default: '', + description: 'The name of a vcs branch.', + }, + ], + }, +/* -------------------------------------------------------------------------- */ +/* pipeline:trigger */ +/* -------------------------------------------------------------------------- */ + { + displayName: 'Project Slug', + name: 'projectSlug', + type: 'string', + displayOptions: { + show: { + operation: [ + 'trigger', + ], + resource: [ + 'pipeline', + ], + }, + }, + default: '', + description: 'Project slug in the form vcs-slug/org-name/repo-name', + }, + { + displayName: 'Additional Fields', + name: 'additionalFields', + type: 'collection', + placeholder: 'Add Field', + default: {}, + displayOptions: { + show: { + resource: [ + 'pipeline', + ], + operation: [ + 'trigger', + ], + }, + }, + options: [ + { + displayName: 'Branch', + name: 'branch', + type: 'string', + default: '', + description: `The branch where the pipeline ran.
+ The HEAD commit on this branch was used for the pipeline.
+ Note that branch and tag are mutually exclusive.`, + }, + { + displayName: 'Tag', + name: 'tag', + type: 'string', + default: '', + description: `The tag used by the pipeline.
+ The commit that this tag points to was used for the pipeline.
+ Note that branch and tag are mutually exclusive`, + }, + ], + }, +] as INodeProperties[]; diff --git a/packages/nodes-base/nodes/CircleCi/circleCi.png b/packages/nodes-base/nodes/CircleCi/circleCi.png new file mode 100644 index 0000000000000000000000000000000000000000..1708a6a3dd604cd31db2718e9052fb312246e0eb GIT binary patch literal 4787 zcmY*dcRbr$+)k(!vs$xOW7LijJ1Q+=lNhyE3AIOzh*7lmNTo*YloF$6FRh}qHZ3hR zs;DYKhg!Ai%f0vQecy9F=RD8({+{piJ>T=^F9~U^!wBLA0RR9-JzXu+Q$(CCTI$n1 zKziZsDF891I@bZU!#t~}hr4JiJvSpGfcPn=1yBK50hDKw(+L1_1E~Jy0DwO5(jRUL z6#Z920RSX;0M7lZu{p&vDtWg3K}sUsPkW(vb4|A&^D zkkHUj=}>uTzd(10tcr>XL`DuGCnt5Pkivxd203G;d@+LmnEbDg78>Ic=;0sa;pZ!G z=IeaZFE~gY3_dILXZ&-|AP=|yD*0mmZR@l_$k`W&th5Z|kN0UR>@2Ek66k?Gt$gNx zRTlQQ^8dyDtpkIc75_h%`KQyrqo=K21;HSHp6x2g@YNM-0D#3sPwSdF7C2r&pUP{& z)%P>Jcy_k=(9_4q!$u;R;(DGyd>TADzJf)8`a<`5B1j0_tyL!56D{Of!OfC!1F0ti z0woG?8ZheKMF_m3$jFXwZul6P#U9eyx;w{p`?nu?W^Q(Fa;DX1^{Gm@+whn0qmj@T zD)Ja|uZvCsYrPSn@yQhF;NW16f2hZJlXXt+D|^rJ9>u1j2AQPWq9rN2)_05=+`$#? z-cT)!!ub39D=mi+N|kBE2!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U7oD0WYkgm0E-~bf=bJ0wbl3a&k*vidggw-e&)@y4 zS_$zkn3{^X*YGAHI)G2XEi@qICLYy-0OKbgBPu7m;se8j3nW7+E66C0Ms>ci^! zAD}dDHUCBlU-!Zv1n!s6OLr2cZKo5aXu@SnCv^p+(XsGsyCs69ILiB1ZQ<~8vgCYY zMSJ{Vle<$D*JoIxfQzC`6-$X;Ef}(y=qHRh4nm;(n3f0Agu62A%IpGt$a0gzsSFz! z!IYMtFRc`Lfyw9icAN`&MY6nvTwrQpF*m%N${`;-?aBP)Z9bKo{=Y5?Xr4$C3ocYy z)MJ|SmTo4%W&IYoZ(n`=mxU&=A7iW~XYw+A5_^ohb}Rb(la~-QQUxF2^JY9*V{xJ7 z4fN%v)@Fgq?|TOGw@%9Ted3&pNKvV)+v2Uv1Lh<(BKDZNHxiLFg&LBGhAUDKwFw=}CuwfalY;6zeFZ+wxl`)D;M+Yf+yw0CjM#rLtu{RU!e z8}dc-SHG1@tF}E)mZe0AEW{Y|WUaK++7vY$Tc9{-Ha@WLs}2MTr_ff@ed9#Eaz1MN zru{p-L#BP(cq~$|GqD3^JZ9j)>VhlmF;&~k%~aO7AG`J(ibTJ>*QU%q4*nQc6qx^N zkve|XDRBJrk#mTRFBWoa2vTM1rwYjTj9@9>HFrG6ap=s;o)Fv5O{2^<^O4KJ$vjA4 z{@kNELz{-qPWhlC$kcI>5|KIH4{o8TNy7%c-jr%{@x;^^wsaX0xpiplj6Vr0U~qa} zxoFUZg?GW*D2;g2MYmiI&IKq%IzBwOdnhLI!Q4>3+zJ(UjOFmVWU}zJAvN%DL)uqu u+qi14ueG=0kbmwMdp>t4AD;i`fd;;Qu0&L5g!}Bzjh?o#R_%4C*#7|%x28b= literal 0 HcmV?d00001 diff --git a/packages/nodes-base/package.json b/packages/nodes-base/package.json index c19d8e2349..a04293da42 100644 --- a/packages/nodes-base/package.json +++ b/packages/nodes-base/package.json @@ -37,6 +37,7 @@ "dist/credentials/BannerbearApi.credentials.js", "dist/credentials/BitbucketApi.credentials.js", "dist/credentials/BitlyApi.credentials.js", + "dist/credentials/CircleCiApi.credentials.js", "dist/credentials/ChargebeeApi.credentials.js", "dist/credentials/ClearbitApi.credentials.js", "dist/credentials/ClickUpApi.credentials.js", @@ -165,6 +166,7 @@ "dist/nodes/Bitbucket/BitbucketTrigger.node.js", "dist/nodes/Bitly/Bitly.node.js", "dist/nodes/Calendly/CalendlyTrigger.node.js", + "dist/nodes/CircleCi/CircleCi.node.js", "dist/nodes/Chargebee/Chargebee.node.js", "dist/nodes/Chargebee/ChargebeeTrigger.node.js", "dist/nodes/Clearbit/Clearbit.node.js", From d72a7119570025df299acec221bb50314ce71ace Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Wed, 1 Jul 2020 15:08:00 +0200 Subject: [PATCH 145/241] :bug: Fix credential issue with ExecuteWorkflow-Node --- packages/cli/src/WorkflowExecuteAdditionalData.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/cli/src/WorkflowExecuteAdditionalData.ts b/packages/cli/src/WorkflowExecuteAdditionalData.ts index 7a61bfd657..ed20a985f8 100644 --- a/packages/cli/src/WorkflowExecuteAdditionalData.ts +++ b/packages/cli/src/WorkflowExecuteAdditionalData.ts @@ -316,14 +316,14 @@ export async function executeWorkflow(workflowInfo: IExecuteWorkflowInfo, additi // Does not get used so set it simply to empty string const executionId = ''; - // Create new additionalData to have different workflow loaded and to call - // different webooks - const additionalDataIntegrated = await getBase(additionalData.credentials); - additionalDataIntegrated.hooks = getWorkflowHooksIntegrated(mode, executionId, workflowData!, { parentProcessMode: additionalData.hooks!.mode }); - // Get the needed credentials for the current workflow as they will differ to the ones of the // calling workflow. - additionalDataIntegrated.credentials = await WorkflowCredentials(workflowData!.nodes); + const credentials = await WorkflowCredentials(workflowData!.nodes); + + // Create new additionalData to have different workflow loaded and to call + // different webooks + const additionalDataIntegrated = await getBase(credentials); + additionalDataIntegrated.hooks = getWorkflowHooksIntegrated(mode, executionId, workflowData!, { parentProcessMode: additionalData.hooks!.mode }); // Find Start-Node const requiredNodeTypes = ['n8n-nodes-base.start']; From 7de478d502f75f67b458bf350d3a2e795eb98515 Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Thu, 2 Jul 2020 07:18:08 +0200 Subject: [PATCH 146/241] :bookmark: Release n8n-core@0.37.0 --- packages/core/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/package.json b/packages/core/package.json index 598ae14b23..6dc56f7bea 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "n8n-core", - "version": "0.36.0", + "version": "0.37.0", "description": "Core functionality of n8n", "license": "SEE LICENSE IN LICENSE.md", "homepage": "https://n8n.io", From 8c19b2fbaed69ef262948834a92761b8b657e503 Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Thu, 2 Jul 2020 07:19:21 +0200 Subject: [PATCH 147/241] :arrow_up: Set n8n-core@0.37.0 on n8n-nodes-base --- packages/nodes-base/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/nodes-base/package.json b/packages/nodes-base/package.json index c19d8e2349..94689feaf3 100644 --- a/packages/nodes-base/package.json +++ b/packages/nodes-base/package.json @@ -348,7 +348,7 @@ "moment-timezone": "^0.5.28", "mongodb": "^3.5.5", "mysql2": "^2.0.1", - "n8n-core": "~0.36.0", + "n8n-core": "~0.37.0", "nodemailer": "^6.4.6", "pdf-parse": "^1.1.1", "pg-promise": "^9.0.3", From 6720e7593b1046f2a9ef37d4073938b35a12c122 Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Thu, 2 Jul 2020 07:19:57 +0200 Subject: [PATCH 148/241] :bookmark: Release n8n-nodes-base@0.67.0 --- packages/nodes-base/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/nodes-base/package.json b/packages/nodes-base/package.json index 94689feaf3..86980d1efa 100644 --- a/packages/nodes-base/package.json +++ b/packages/nodes-base/package.json @@ -1,6 +1,6 @@ { "name": "n8n-nodes-base", - "version": "0.66.0", + "version": "0.67.0", "description": "Base nodes of n8n", "license": "SEE LICENSE IN LICENSE.md", "homepage": "https://n8n.io", From 69e95730049f31d93f41bf671d3777fd66cdfd6e Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Thu, 2 Jul 2020 07:21:15 +0200 Subject: [PATCH 149/241] :arrow_up: Set n8n-core@0.37.0 and n8n-nodes-base@0.67.0 on n8n --- packages/cli/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/cli/package.json b/packages/cli/package.json index 9e23c91021..6516faa21d 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -100,9 +100,9 @@ "lodash.get": "^4.4.2", "mongodb": "^3.5.5", "mysql2": "^2.0.1", - "n8n-core": "~0.36.0", + "n8n-core": "~0.37.0", "n8n-editor-ui": "~0.48.0", - "n8n-nodes-base": "~0.66.0", + "n8n-nodes-base": "~0.67.0", "n8n-workflow": "~0.33.0", "oauth-1.0a": "^2.2.6", "open": "^7.0.0", From a01a764874908dd979fa7041333b80d3814ac3e7 Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Thu, 2 Jul 2020 07:21:56 +0200 Subject: [PATCH 150/241] :bookmark: Release n8n@0.72.0 --- packages/cli/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/cli/package.json b/packages/cli/package.json index 6516faa21d..4eaaade97f 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "n8n", - "version": "0.71.0", + "version": "0.72.0", "description": "n8n Workflow Automation Tool", "license": "SEE LICENSE IN LICENSE.md", "homepage": "https://n8n.io", From 549b26fa3d0766647a4b44061e238f429f7e6312 Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Thu, 2 Jul 2020 15:07:55 +0200 Subject: [PATCH 151/241] :bug: Fix issue with nodes in stack which do actually not get executed --- packages/core/src/WorkflowExecute.ts | 8 +++++++- packages/workflow/src/Workflow.ts | 8 ++++---- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/packages/core/src/WorkflowExecute.ts b/packages/core/src/WorkflowExecute.ts index 1e8b8898a7..c36ffe997e 100644 --- a/packages/core/src/WorkflowExecute.ts +++ b/packages/core/src/WorkflowExecute.ts @@ -593,9 +593,15 @@ export class WorkflowExecute { } } - this.runExecutionData.resultData.lastNodeExecuted = executionData.node.name; nodeSuccessData = await workflow.runNode(executionData.node, executionData.data, this.runExecutionData, runIndex, this.additionalData, NodeExecuteFunctions, this.mode); + if (nodeSuccessData === undefined) { + // Node did not get executed + nodeSuccessData = null; + } else { + this.runExecutionData.resultData.lastNodeExecuted = executionData.node.name; + } + if (nodeSuccessData === null || nodeSuccessData[0][0] === undefined) { if (executionData.node.alwaysOutputData === true) { nodeSuccessData = nodeSuccessData || []; diff --git a/packages/workflow/src/Workflow.ts b/packages/workflow/src/Workflow.ts index 9a7d3ef1eb..5fbd780524 100644 --- a/packages/workflow/src/Workflow.ts +++ b/packages/workflow/src/Workflow.ts @@ -1085,18 +1085,18 @@ export class Workflow { * @returns {(Promise)} * @memberof Workflow */ - async runNode(node: INode, inputData: ITaskDataConnections, runExecutionData: IRunExecutionData, runIndex: number, additionalData: IWorkflowExecuteAdditionalData, nodeExecuteFunctions: INodeExecuteFunctions, mode: WorkflowExecuteMode): Promise { + async runNode(node: INode, inputData: ITaskDataConnections, runExecutionData: IRunExecutionData, runIndex: number, additionalData: IWorkflowExecuteAdditionalData, nodeExecuteFunctions: INodeExecuteFunctions, mode: WorkflowExecuteMode): Promise { if (node.disabled === true) { // If node is disabled simply pass the data through // return NodeRunHelpers. if (inputData.hasOwnProperty('main') && inputData.main.length > 0) { // If the node is disabled simply return the data from the first main input if (inputData.main[0] === null) { - return null; + return undefined; } return [(inputData.main[0] as INodeExecutionData[])]; } - return null; + return undefined; } const nodeType = this.nodeTypes.getByName(node.type); @@ -1112,7 +1112,7 @@ export class Workflow { if (connectionInputData.length === 0) { // No data for node so return - return null; + return undefined; } if (runExecutionData.resultData.lastNodeExecuted === node.name && runExecutionData.resultData.error !== undefined) { From 63280b74078f891d6e7793486ee753db77011a48 Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Thu, 2 Jul 2020 23:07:28 +0200 Subject: [PATCH 152/241] :bug: Fix build issue --- packages/core/package.json | 2 +- packages/core/src/WorkflowExecute.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/core/package.json b/packages/core/package.json index 6dc56f7bea..7a4b0c7349 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -45,7 +45,7 @@ "crypto-js": "3.1.9-1", "lodash.get": "^4.4.2", "mmmagic": "^0.5.2", - "n8n-workflow": "~0.32.0", + "n8n-workflow": "~0.33.0", "p-cancelable": "^2.0.0", "request": "^2.88.2", "request-promise-native": "^1.0.7" diff --git a/packages/core/src/WorkflowExecute.ts b/packages/core/src/WorkflowExecute.ts index c36ffe997e..c30be39ca1 100644 --- a/packages/core/src/WorkflowExecute.ts +++ b/packages/core/src/WorkflowExecute.ts @@ -459,7 +459,7 @@ export class WorkflowExecute { let executionData: IExecuteData; let executionError: IExecutionError | undefined; let executionNode: INode; - let nodeSuccessData: INodeExecutionData[][] | null; + let nodeSuccessData: INodeExecutionData[][] | null | undefined; let runIndex: number; let startTime: number; let taskData: ITaskData; From ae902589b87f80c3eaf43e5e4b885144d270c8e8 Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Fri, 3 Jul 2020 07:31:08 +0200 Subject: [PATCH 153/241] :zap: Temporary fix to repair build --- packages/nodes-base/nodes/Redis/Redis.node.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/nodes-base/nodes/Redis/Redis.node.ts b/packages/nodes-base/nodes/Redis/Redis.node.ts index 68b7401205..12263b1d64 100644 --- a/packages/nodes-base/nodes/Redis/Redis.node.ts +++ b/packages/nodes-base/nodes/Redis/Redis.node.ts @@ -402,6 +402,7 @@ export class Redis implements INodeType { } else if (type === 'hash') { const clientHset = util.promisify(client.hset).bind(client); for (const key of Object.keys(value)) { + // @ts-ignore await clientHset(keyName, key, (value as IDataObject)[key]!.toString()); } } else if (type === 'list') { From 1f04c9eaac5c8bcd364e2df60860d4487b3901d2 Mon Sep 17 00:00:00 2001 From: einSelbst Date: Fri, 3 Jul 2020 15:35:58 +0200 Subject: [PATCH 154/241] Fix a few typos in node-dev readme I hope I didn't took it to far :) --- packages/node-dev/README.md | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/packages/node-dev/README.md b/packages/node-dev/README.md index 1c3d8df52f..fa817c9124 100644 --- a/packages/node-dev/README.md +++ b/packages/node-dev/README.md @@ -127,7 +127,7 @@ export class MyNode implements INodeType { The "description" property has to be set on all nodes because it contains all the base information. Additionally do all nodes have to have exactly one of the -following methods defined which contains the the actual logic: +following methods defined which contains the actual logic: **Regular node** @@ -138,8 +138,8 @@ Method get called when the workflow gets executed By default always `execute` should be used especially when creating a third-party integration. The reason for that is that it is way more flexible and allows to, for example, return a different amount of items than it received -as input. This is very important when a node should query data like return -all users. In that case, does the node normally just receive one input-item +as input. This is very important when a node should query data like *return +all users*. In that case, does the node normally just receive one input-item but returns as many as users exist. So in doubt always `execute` should be used! @@ -188,10 +188,10 @@ The following properties can be set in the node description: - **outputs** [required]: Types of outputs the node has (currently only "main" exists) and the amount - **outputNames** [optional]: In case a node has multiple outputs names can be set that users know what data to expect - **maxNodes** [optional]: If not an unlimited amount of nodes of that type can exist in a workflow the max-amount can be specified - - **name** [required]: Nme of the node (for n8n to use internally in camelCase) + - **name** [required]: Name of the node (for n8n to use internally, in camelCase) - **properties** [required]: Properties which get displayed in the Editor UI and can be set by the user - **subtitle** [optional]: Text which should be displayed underneath the name of the node in the Editor UI (can be an expression) - - **version** [required]: Version of the node. Currently always "1" (integer). For future usage does not get used yet. + - **version** [required]: Version of the node. Currently always "1" (integer). For future usage, does not get used yet. - **webhooks** [optional]: Webhooks the node should listen to @@ -200,12 +200,12 @@ The following properties can be set in the node description: The following properties can be set in the node properties: - **default** [required]: Default value of the property - - **description** [required]: Description to display users in Editor UI - - **displayName** [required]: Name to display users in Editor UI + - **description** [required]: Description that is displayed to users in the Editor UI + - **displayName** [required]: Name that is displayed to users in the Editor UI - **displayOptions** [optional]: Defines logic to decide if a property should be displayed or not - - **name** [required]: Name of the property (for n8n to use internally in camelCase) + - **name** [required]: Name of the property (for n8n to use internally, in camelCase) - **options** [optional]: The options the user can select when type of property is "collection", "fixedCollection" or "options" - - **placeholder** [optional]: Placeholder text to display users in Editor UI + - **placeholder** [optional]: Placeholder text that is displayed to users in the Editor UI - **type** [required]: Type of the property. If it is for example a "string", "number", ... - **typeOptions** [optional]: Additional options for type. Like for example the min or max value of a number - **required** [optional]: Defines if the value has to be set or if it can stay empty @@ -215,11 +215,11 @@ The following properties can be set in the node properties: The following properties can be set in the node property options. -All properties are optional. The most, however, work only work when the node-property is of a specfic type. +All properties are optional. However, most only work when the node-property is of a specfic type. - - **alwaysOpenEditWindow** [type: string]: If set then the "Editor Window" will always open when the user tries to edit the field. Is helpful when long texts normally get used in the property + - **alwaysOpenEditWindow** [type: string]: If set then the "Editor Window" will always open when the user tries to edit the field. Helpful if long text is typically used in the property. - **loadOptionsMethod** [type: options]: Method to use to load options from an external service - - **maxValue** [type: number]: Maximal value of the number + - **maxValue** [type: number]: Maximum value of the number - **minValue** [type: number]: Minimum value of the number - **multipleValues** [type: all]: If set the property gets turned into an Array and the user can add multiple values - **multipleValueButtonText** [type: all]: Custom text for add button in case "multipleValues" got set From fe56c8778d69cc13442000b6ebbeefa117a2133b Mon Sep 17 00:00:00 2001 From: Innokenty Lebedev Date: Sun, 5 Jul 2020 12:19:13 +0300 Subject: [PATCH 155/241] :bug: Fix slack as_user (#708) * Ignore as_user only when it is false * Update as_user description --- .../nodes/Slack/MessageDescription.ts | 22 ++++++++++++++++++- packages/nodes-base/nodes/Slack/Slack.node.ts | 5 +---- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/packages/nodes-base/nodes/Slack/MessageDescription.ts b/packages/nodes-base/nodes/Slack/MessageDescription.ts index 8d91663155..6619c51812 100644 --- a/packages/nodes-base/nodes/Slack/MessageDescription.ts +++ b/packages/nodes-base/nodes/Slack/MessageDescription.ts @@ -91,7 +91,7 @@ export const messageFields = [ ], }, }, - description: 'Post the message as authenticated user instead of bot.', + description: 'Post the message as authenticated user instead of bot. Works only with user token.', }, { displayName: 'User Name', @@ -486,6 +486,26 @@ export const messageFields = [ }, description: `Timestamp of the message to be updated.`, }, + { + displayName: 'As User', + name: 'as_user', + type: 'boolean', + default: false, + displayOptions: { + show: { + authentication: [ + 'accessToken', + ], + operation: [ + 'update' + ], + resource: [ + 'message', + ], + }, + }, + description: 'Pass true to update the message as the authed user. Works only with user token.', + }, { displayName: 'Update Fields', name: 'updateFields', diff --git a/packages/nodes-base/nodes/Slack/Slack.node.ts b/packages/nodes-base/nodes/Slack/Slack.node.ts index befe931fb5..d6df14ab41 100644 --- a/packages/nodes-base/nodes/Slack/Slack.node.ts +++ b/packages/nodes-base/nodes/Slack/Slack.node.ts @@ -452,12 +452,9 @@ export class Slack implements INodeType { } if (body.as_user === false) { body.username = this.getNodeParameter('username', i) as string; + delete body.as_user; } - // ignore body.as_user as it's deprecated - - delete body.as_user; - if (!jsonParameters) { const attachments = this.getNodeParameter('attachments', i, []) as unknown as Attachment[]; const blocksUi = (this.getNodeParameter('blocksUi', i, []) as IDataObject).blocksValues as IDataObject[]; From 9c58ca8f77eb5217b60517c179dffb94d56bc275 Mon Sep 17 00:00:00 2001 From: Shraddha Shaligram Date: Sun, 5 Jul 2020 02:33:05 -0700 Subject: [PATCH 156/241] :zap: Move Google Task title to top level (#718) --- .../nodes/Google/Task/GoogleTasks.node.ts | 8 ++------ .../nodes/Google/Task/TaskDescription.ts | 15 ++++++++------- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/packages/nodes-base/nodes/Google/Task/GoogleTasks.node.ts b/packages/nodes-base/nodes/Google/Task/GoogleTasks.node.ts index 8e2f06dcf5..603bc1af5e 100644 --- a/packages/nodes-base/nodes/Google/Task/GoogleTasks.node.ts +++ b/packages/nodes-base/nodes/Google/Task/GoogleTasks.node.ts @@ -1,6 +1,6 @@ import { IExecuteFunctions, - } from 'n8n-core'; +} from 'n8n-core'; import { IDataObject, @@ -102,6 +102,7 @@ export class GoogleTasks implements INodeType { body = {}; //https://developers.google.com/tasks/v1/reference/tasks/insert const taskId = this.getNodeParameter('task', i) as string; + body.title = this.getNodeParameter('title', i) as string; const additionalFields = this.getNodeParameter( 'additionalFields', i @@ -121,11 +122,6 @@ export class GoogleTasks implements INodeType { if (additionalFields.notes) { body.notes = additionalFields.notes as string; } - - if (additionalFields.title) { - body.title = additionalFields.title as string; - } - if (additionalFields.dueDate) { body.dueDate = additionalFields.dueDate as string; } diff --git a/packages/nodes-base/nodes/Google/Task/TaskDescription.ts b/packages/nodes-base/nodes/Google/Task/TaskDescription.ts index 8030f0a7f3..3300572f2c 100644 --- a/packages/nodes-base/nodes/Google/Task/TaskDescription.ts +++ b/packages/nodes-base/nodes/Google/Task/TaskDescription.ts @@ -70,6 +70,13 @@ export const taskFields = [ }, default: '', }, + { + displayName: 'Title', + name: 'title', + type: 'string', + default: '', + description: 'Title of the task.', + }, { displayName: 'Additional Fields', name: 'additionalFields', @@ -146,13 +153,7 @@ export const taskFields = [ default: '', description: 'Current status of the task.', }, - { - displayName: 'Title', - name: 'title', - type: 'string', - default: '', - description: 'Title of the task.', - }, + ], }, /* -------------------------------------------------------------------------- */ From 62612d0ad4a62a0d143bea9d9cd467d68a92dacd Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Sun, 5 Jul 2020 13:03:50 +0200 Subject: [PATCH 157/241] :books: Removed docs-folders as they moved to n8n-io/n8n-docs --- docs/.nojekyll | 0 docs/CNAME | 1 - docs/README.md | 10 -- docs/_sidebar.md | 43 ------ docs/configuration.md | 244 ------------------------------- docs/create-node.md | 145 ------------------- docs/data-structure.md | 39 ----- docs/database.md | 109 -------------- docs/development.md | 3 - docs/docker.md | 7 - docs/faq.md | 47 ------ docs/images/n8n-logo.png | Bin 2675 -> 0 bytes docs/images/n8n-screenshot.png | Bin 129698 -> 0 bytes docs/index.html | 53 ------- docs/key-components.md | 25 ---- docs/keyboard-shortcuts.md | 28 ---- docs/license.md | 5 - docs/node-basics.md | 76 ---------- docs/nodes.md | 247 -------------------------------- docs/quick-start.md | 43 ------ docs/security.md | 13 -- docs/sensitive-data.md | 18 --- docs/server-setup.md | 183 ----------------------- docs/setup.md | 35 ----- docs/start-workflows-via-cli.md | 15 -- docs/test.md | 3 - docs/troubleshooting.md | 58 -------- docs/tutorials.md | 26 ---- docs/workflow.md | 111 -------------- 29 files changed, 1587 deletions(-) delete mode 100644 docs/.nojekyll delete mode 100644 docs/CNAME delete mode 100644 docs/README.md delete mode 100644 docs/_sidebar.md delete mode 100644 docs/configuration.md delete mode 100644 docs/create-node.md delete mode 100644 docs/data-structure.md delete mode 100644 docs/database.md delete mode 100644 docs/development.md delete mode 100644 docs/docker.md delete mode 100644 docs/faq.md delete mode 100644 docs/images/n8n-logo.png delete mode 100644 docs/images/n8n-screenshot.png delete mode 100644 docs/index.html delete mode 100644 docs/key-components.md delete mode 100644 docs/keyboard-shortcuts.md delete mode 100644 docs/license.md delete mode 100644 docs/node-basics.md delete mode 100644 docs/nodes.md delete mode 100644 docs/quick-start.md delete mode 100644 docs/security.md delete mode 100644 docs/sensitive-data.md delete mode 100644 docs/server-setup.md delete mode 100644 docs/setup.md delete mode 100644 docs/start-workflows-via-cli.md delete mode 100644 docs/test.md delete mode 100644 docs/troubleshooting.md delete mode 100644 docs/tutorials.md delete mode 100644 docs/workflow.md diff --git a/docs/.nojekyll b/docs/.nojekyll deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/docs/CNAME b/docs/CNAME deleted file mode 100644 index 22a8459481..0000000000 --- a/docs/CNAME +++ /dev/null @@ -1 +0,0 @@ -docs-old.n8n.io diff --git a/docs/README.md b/docs/README.md deleted file mode 100644 index 3454cc15e2..0000000000 --- a/docs/README.md +++ /dev/null @@ -1,10 +0,0 @@ -# n8n Documentation - -This is the documentation of n8n, a free and open [fair-code](http://faircode.io) licensed node-based Workflow Automation Tool. - -It covers everything from setup to usage and development. It is still a work in progress and all contributions are welcome. - - -## What is n8n? - -n8n (pronounced nodemation) helps you to interconnect every app with an API in the world with each other to share and manipulate its data without a single line of code. It is an easy to use, user-friendly and highly customizable service, which uses an intuitive user interface for you to design your unique workflows very fast. Hosted on your server and not based in the cloud, it keeps your sensible data very secure in your own trusted database. diff --git a/docs/_sidebar.md b/docs/_sidebar.md deleted file mode 100644 index 6cbe725286..0000000000 --- a/docs/_sidebar.md +++ /dev/null @@ -1,43 +0,0 @@ -- Home - - - [Welcome](/) - -- Getting started - - - [Key Components](key-components.md) - - [Quick Start](quick-start.md) - - [Setup](setup.md) - - [Tutorials](tutorials.md) - - [Docker](docker.md) - -- Advanced - - - [Configuration](configuration.md) - - [Data Structure](data-structure.md) - - [Database](database.md) - - [Keyboard Shortcuts](keyboard-shortcuts.md) - - [Node Basics](node-basics.md) - - [Nodes](nodes.md) - - [Security](security.md) - - [Sensitive Data](sensitive-data.md) - - [Server Setup](server-setup.md) - - [Start Workflows via CLI](start-workflows-via-cli.md) - - [Workflow](workflow.md) - -- Development - - - [Create Node](create-node.md) - - [Development](development.md) - - -- Other - - - [FAQ](faq.md) - - [License](license.md) - - [Troubleshooting](troubleshooting.md) - - -- Links - - - [![Jobs](https://n8n.io/favicon.ico ':size=16')Jobs](https://jobs.n8n.io) - - [![Website](https://n8n.io/favicon.ico ':size=16')n8n.io](https://n8n.io) diff --git a/docs/configuration.md b/docs/configuration.md deleted file mode 100644 index 63b8c95f12..0000000000 --- a/docs/configuration.md +++ /dev/null @@ -1,244 +0,0 @@ - - -# Configuration - -It is possible to change some of the n8n defaults via special environment variables. -The ones that currently exist are: - - -## Publish - -Sets how n8n should be made available. - -```bash -# The port n8n should be made available on -N8N_PORT=5678 - -# The IP address n8n should listen on -N8N_LISTEN_ADDRESS=0.0.0.0 - -# This ones are currently only important for the webhook URL creation. -# So if "WEBHOOK_TUNNEL_URL" got set they do get ignored. It is however -# encouraged to set them correctly anyway in case they will become -# important in the future. -N8N_PROTOCOL=https -N8N_HOST=n8n.example.com -``` - - -## Base URL - -Tells the frontend how to reach the REST API of the backend. - -```bash -export VUE_APP_URL_BASE_API="https://n8n.example.com/" -``` - - -## Execution Data Manual Runs - -n8n creates a random encryption key automatically on the first launch and saves -it in the `~/.n8n` folder. That key is used to encrypt the credentials before -they get saved to the database. It is also possible to overwrite that key and -set it via an environment variable. - -```bash -export N8N_ENCRYPTION_KEY="" -``` - - -## Execution Data Manual Runs - -Normally executions which got started via the Editor UI will not be saved as -they are normally only for testing and debugging. That default can be changed -with this environment variable. - -```bash -export EXECUTIONS_DATA_SAVE_MANUAL_EXECUTIONS=true -``` - -This setting can also be overwritten on a per workflow basis in the workflow -settings in the Editor UI. - - -## Execution Data Error/Success - -When a workflow gets executed, it will save the result in the database. That's -the case for executions that succeeded and for the ones that failed. The -default behavior can be changed like this: - -```bash -export EXECUTIONS_DATA_SAVE_ON_ERROR=none -export EXECUTIONS_DATA_SAVE_ON_SUCCESS=none -``` - -Possible values are: - - **all**: Saves all data - - **none**: Does not save anything (recommended if a workflow runs very often and/or processes a lot of data, set up "Error Workflow" instead) - -These settings can also be overwritten on a per workflow basis in the workflow -settings in the Editor UI. - - -## Execute In Same Process - -All workflows get executed in their own separate process. This ensures that all CPU cores -get used and that they do not block each other on CPU intensive tasks. Additionally, this makes sure that -the crash of one execution does not take down the whole application. The disadvantage is, however, -that it slows down the start-time considerably and uses much more memory. So in case the -workflows are not CPU intensive and they have to start very fast, it is possible to run them -all directly in the main-process with this setting. - -```bash -export EXECUTIONS_PROCESS=main -``` - - -## Exclude Nodes - -It is possible to not allow users to use nodes of a specific node type. For example, if you -do not want that people can write data to the disk with the "n8n-nodes-base.writeBinaryFile" -node and that they cannot execute commands with the "n8n-nodes-base.executeCommand" node, you can -set the following: - -```bash -export NODES_EXCLUDE="[\"n8n-nodes-base.executeCommand\",\"n8n-nodes-base.writeBinaryFile\"]" -``` - - -## Custom Nodes Location - -Every user can add custom nodes that get loaded by n8n on startup. The default -location is in the subfolder `.n8n/custom` of the user who started n8n. -Additional folders can be defined with an environment variable. - -```bash -export N8N_CUSTOM_EXTENSIONS="/home/jim/n8n/custom-nodes;/data/n8n/nodes" -``` - - -## Use built-in and external modules in Function-Nodes - -For security reasons, importing modules is restricted by default in the Function-Nodes. -It is, however, possible to lift that restriction for built-in and external modules by -setting the following environment variables: -- `NODE_FUNCTION_ALLOW_BUILTIN`: For builtin modules -- `NODE_FUNCTION_ALLOW_EXTERNAL`: For external modules sourced from n8n/node_modules directory. External module support is disabled when env variable is not set. - -```bash -# Allows usage of all builtin modules -export NODE_FUNCTION_ALLOW_BUILTIN=* - -# Allows usage of only crypto -export NODE_FUNCTION_ALLOW_BUILTIN=crypto - -# Allows usage of only crypto and fs -export NODE_FUNCTION_ALLOW_BUILTIN=crypto,fs - -# Allow usage of external npm modules. Wildcard matching is not supported. -export NODE_FUNCTION_ALLOW_EXTERNAL=moment,lodash -``` - - -## SSL - -It is possible to start n8n with SSL enabled by supplying a certificate to use: - - -```bash -export N8N_PROTOCOL=https -export N8N_SSL_KEY=/data/certs/server.key -export N8N_SSL_CERT=/data/certs/server.pem -``` - - - -## Timezone - -The timezone is set by default to "America/New_York". For instance, it is used by the -Cron node to know at what time the workflow should be started. To set a different -default timezone simply set `GENERIC_TIMEZONE` to the appropriate value. For example, -if you want to set the timezone to Berlin (Germany): - -```bash -export GENERIC_TIMEZONE="Europe/Berlin" -``` - -You can find the name of your timezone here: -[https://momentjs.com/timezone/](https://momentjs.com/timezone/) - - -## User Folder - -User-specific data like the encryption key, SQLite database file, and -the ID of the tunnel (if used) gets saved by default in the subfolder -`.n8n` of the user who started n8n. It is possible to overwrite the -user-folder via an environment variable. - -```bash -export N8N_USER_FOLDER="/home/jim/n8n" -``` - - -## Webhook URL - -The webhook URL will normally be created automatically by combining -`N8N_PROTOCOL`, `N8N_HOST` and `N8N_PORT`. However, if n8n runs behind a -reverse proxy that would not work. That's because n8n runs internally -on port 5678 but is exposed to the web via the reverse proxy on port 443. In -that case, it is important to set the webhook URL manually so that it can be -displayed correctly in the Editor UI and even more important is that the correct -webhook URLs get registred with the external services. - -```bash -export WEBHOOK_TUNNEL_URL="https://n8n.example.com/" -``` - - -## Configuration via file - -It is also possible to configure n8n using a configuration file. - -It is not necessary to define all values but only the ones that should be -different from the defaults. - -If needed multiple files can also be supplied to. For example, have generic -base settings and some specific ones depending on the environment. - -The path to the JSON configuration file to use can be set using the environment -variable `N8N_CONFIG_FILES`. - -```bash -# Single file -export N8N_CONFIG_FILES=/folder/my-config.json - -# Multiple files can be comma-separated -export N8N_CONFIG_FILES=/folder/my-config.json,/folder/production.json -``` - -A possible configuration file could look like this: -```json -{ - "executions": { - "process": "main", - "saveDataOnSuccess": "none" - }, - "generic": { - "timezone": "Europe/Berlin" - }, - "security": { - "basicAuth": { - "active": true, - "user": "frank", - "password": "some-secure-password" - } - }, - "nodes": { - "exclude": "[\"n8n-nodes-base.executeCommand\",\"n8n-nodes-base.writeBinaryFile\"]" - } -} -``` - -All possible values which can be set and their defaults can be found here: - -[https://github.com/n8n-io/n8n/blob/master/packages/cli/config/index.ts](https://github.com/n8n-io/n8n/blob/master/packages/cli/config/index.ts) diff --git a/docs/create-node.md b/docs/create-node.md deleted file mode 100644 index 183c11c734..0000000000 --- a/docs/create-node.md +++ /dev/null @@ -1,145 +0,0 @@ -# Create Node - -It is quite easy to create your own nodes in n8n. Mainly three things have to be defined: - - 1. Generic information like name, description, image/icon - 1. The parameters to display via which the user can interact with it - 1. The code to run once the node gets executed - -To simplify the development process, we created a very basic CLI which creates boilerplate code to get started, builds the node (as they are written in TypeScript), and copies it to the correct location. - - -## Create the first basic node - - 1. Install the n8n-node-dev CLI: `npm install -g n8n-node-dev` - 1. Create and go into the newly created folder in which you want to keep the code of the node - 1. Use CLI to create boilerplate node code: `n8n-node-dev new` - 1. Answer the questions (the “Execute” node type is the regular node type that you probably want to create). - It will then create the node in the current folder. - 1. Program… Add the functionality to the node - 1. Build the node and copy to correct location: `n8n-node-dev build` - That command will build the JavaScript version of the node from the TypeScript code and copy it to the user folder where custom nodes get read from `~/.n8n/custom/` - 1. Restart n8n and refresh the window so that the new node gets displayed - - -## Create own custom n8n-nodes-module - -If you want to create multiple custom nodes which are either: - - - Only for yourself/your company - - Are only useful for a small number of people - - Require many or large dependencies - -It is best to create your own `n8n-nodes-module` which can be installed separately. -That is a simple npm package that contains the nodes and is set up in a way -that n8n can automatically find and load them on startup. - -When creating such a module the following rules have to be followed that n8n -can automatically find the nodes in the module: - - - The name of the module has to start with `n8n-nodes-` - - The `package.json` file has to contain a key `n8n` with the paths to nodes and credentials - - The module has to be installed alongside n8n - -An example starter module which contains one node and credentials and implements -the above can be found here: - -[https://github.com/n8n-io/n8n-nodes-starter](https://github.com/n8n-io/n8n-nodes-starter) - - -### Setup to use n8n-nodes-module - -To use a custom `n8n-nodes-module`, it simply has to be installed alongside n8n. -For example like this: - -```bash -# Create folder for n8n installation -mkdir my-n8n -cd my-n8n - -# Install n8n -npm install n8n - -# Install custom nodes module -npm install n8n-nodes-my-custom-nodes - -# Start n8n -n8n -``` - - -### Development/Testing of custom n8n-nodes-module - -This works in the same way as for any other npm module. - -Execute in the folder which contains the code of the custom `n8n-nodes-module` -which should be loaded with n8n: - -```bash -# Build the code -npm run build - -# "Publish" the package locally -npm link -``` - -Then in the folder in which n8n is installed: - -```bash -# "Install" the above locally published module -npm link n8n-nodes-my-custom-nodes - -# Start n8n -n8n -``` - - - -## Node Development Guidelines - - -Please make sure that everything works correctly and that no unnecessary code gets added. It is important to follow the following guidelines: - - -### Do not change incoming data - -Never change the incoming data a node receives (which can be queried with `this.getInputData()`) as it gets shared by all nodes. If data has to get added, changed or deleted it has to be cloned and the new data returned. If that is not done, sibling nodes which execute after the current one will operate on the altered data and would process different data than they were supposed to. -It is however not needed to always clone all the data. If a node for, example only, changes only the binary data but not the JSON data, a new item can be created which reuses the reference to the JSON item. - -An example can be seen in the code of the [ReadBinaryFile-Node](https://github.com/n8n-io/n8n/blob/master/packages/nodes-base/nodes/ReadBinaryFile.node.ts#L69-L83). - - -### Write nodes in TypeScript - -All code of n8n is written in TypeScript and hence, the nodes should also be written in TypeScript. That makes development easier, faster, and avoids at least some bugs. - - -### Use the built in request library - -Some third-party services have their own libraries on npm which make it easier to create an integration. It can be quite tempting to use them. The problem with those is that you add another dependency and not just one you add but also all the dependencies of the dependencies. This means more and more code gets added, has to get loaded, can introduce security vulnerabilities, bugs and so on. So please use the built-in module which can be used like this: - -```typescript -const response = await this.helpers.request(options); -``` - -That is simply using the npm package [`request-promise-native`](https://github.com/request/request-promise-native) which is the basic npm `request` module but with promises. For a full set of `options` consider looking at [the underlying `request` options documentation](https://github.com/request/request#requestoptions-callback). - - -### Reuse parameter names - -When a node can perform multiple operations like edit and delete some kind of entity, for both operations, it would need an entity-id. Do not call them "editId" and "deleteId" simply call them "id". n8n can handle multiple parameters with the same name without a problem as long as only one is visible. To make sure that is the case, the "displayOptions" can be used. By keeping the same name, the value can be kept if a user switches the operation from "edit" to "delete". - - -### Create an "Options" parameter - -Some nodes may need a lot of options. Add only the very important ones to the top level and for all others, create an "Options" parameter where they can be added if needed. This ensures that the interface stays clean and does not unnecessarily confuse people. A good example of that would be the XML node. - - -### Follow existing parameter naming guideline - -There is not much of a guideline yet but if your node can do multiple things, call the parameter which sets the behavior either "mode" (like "Merge" and "XML" node) or "operation" like the most other ones. If these operations can be done on different resources (like "User" or "Order) create a "resource" parameter (like "Pipedrive" and "Trello" node) - - -### Node Icons - -Check existing node icons as a reference when you create own ones. The resolution of an icon should be 60x60px and saved as PNG. diff --git a/docs/data-structure.md b/docs/data-structure.md deleted file mode 100644 index daeea8474d..0000000000 --- a/docs/data-structure.md +++ /dev/null @@ -1,39 +0,0 @@ -# Data Structure - -For "basic usage" it is not necessarily needed to understand how the data that -gets passed from one node to another is structured. However, it becomes important if you want to: - - - create your own node - - write custom expressions - - use the Function or Function Item node - - you want to get the most out of n8n - - -In n8n, all the data that is passed between nodes is an array of objects. It has the following structure: - -```json -[ - { - // Each item has to contain a "json" property. But it can be an empty object like {}. - // Any kind of JSON data is allowed. So arrays and the data being deeply nested is fine. - json: { // The actual data n8n operates on (required) - // This data is only an example it could be any kind of JSON data - jsonKeyName: 'keyValue', - anotherJsonKey: { - lowerLevelJsonKey: 1 - } - }, - // Binary data of item. The most items in n8n do not contain any (optional) - binary: { - // The key-name "binaryKeyName" is only an example. Any kind of key-name is possible. - binaryKeyName: { - data: '....', // Base64 encoded binary data (required) - mimeType: 'image/png', // Optional but should be set if possible (optional) - fileExtension: 'png', // Optional but should be set if possible (optional) - fileName: 'example.png', // Optional but should be set if possible (optional) - } - } - }, - ... -] -``` diff --git a/docs/database.md b/docs/database.md deleted file mode 100644 index 041520cf15..0000000000 --- a/docs/database.md +++ /dev/null @@ -1,109 +0,0 @@ -# Database - -By default, n8n uses SQLite to save credentials, past executions, and workflows. However, -n8n also supports MongoDB and PostgresDB. - - -## Shared Settings - -The following environment variables get used by all databases: - - - `DB_TABLE_PREFIX` (default: '') - Prefix for table names - - -## MongoDB - -!> **WARNING**: Use PostgresDB, if possible! MongoDB has problems saving large - amounts of data in a document, among other issues. So, support - may be dropped in the future. - -To use MongoDB as the database, you can provide the following environment variables like -in the example below: - - `DB_TYPE=mongodb` - - `DB_MONGODB_CONNECTION_URL=` - -Replace the following placeholders with the actual data: - - MONGO_DATABASE - - MONGO_HOST - - MONGO_PORT - - MONGO_USER - - MONGO_PASSWORD - -```bash -export DB_TYPE=mongodb -export DB_MONGODB_CONNECTION_URL=mongodb://MONGO_USER:MONGO_PASSWORD@MONGO_HOST:MONGO_PORT/MONGO_DATABASE -n8n start -``` - - -## PostgresDB - -To use PostgresDB as the database, you can provide the following environment variables - - `DB_TYPE=postgresdb` - - `DB_POSTGRESDB_DATABASE` (default: 'n8n') - - `DB_POSTGRESDB_HOST` (default: 'localhost') - - `DB_POSTGRESDB_PORT` (default: 5432) - - `DB_POSTGRESDB_USER` (default: 'root') - - `DB_POSTGRESDB_PASSWORD` (default: empty) - - `DB_POSTGRESDB_SCHEMA` (default: 'public') - - -```bash -export DB_TYPE=postgresdb -export DB_POSTGRESDB_DATABASE=n8n -export DB_POSTGRESDB_HOST=postgresdb -export DB_POSTGRESDB_PORT=5432 -export DB_POSTGRESDB_USER=n8n -export DB_POSTGRESDB_PASSWORD=n8n -export DB_POSTGRESDB_SCHEMA=n8n - -n8n start -``` - -## MySQL / MariaDB - -The compatibility with MySQL/MariaDB has been tested. Even then, it is advisable to observe the operation of the application with this database as this option has been recently added. If you spot any problems, feel free to submit a burg report or a pull request. - -To use MySQL as database you can provide the following environment variables: - - `DB_TYPE=mysqldb` or `DB_TYPE=mariadb` - - `DB_MYSQLDB_DATABASE` (default: 'n8n') - - `DB_MYSQLDB_HOST` (default: 'localhost') - - `DB_MYSQLDB_PORT` (default: 3306) - - `DB_MYSQLDB_USER` (default: 'root') - - `DB_MYSQLDB_PASSWORD` (default: empty) - - -```bash -export DB_TYPE=mysqldb -export DB_MYSQLDB_DATABASE=n8n -export DB_MYSQLDB_HOST=mysqldb -export DB_MYSQLDB_PORT=3306 -export DB_MYSQLDB_USER=n8n -export DB_MYSQLDB_PASSWORD=n8n - -n8n start -``` - -## SQLite - -This is the default database that gets used if nothing is defined. - -The database file is located at: -`~/.n8n/database.sqlite` - - -## Other Databases - -Currently, only the databases mentioned above are supported. n8n internally uses -[TypeORM](https://typeorm.io), so adding support for the following databases -should not be too much work: - - - CockroachDB - - Microsoft SQL - - Oracle - -If you cannot use any of the currently supported databases for some reason and -you can code, we'd appreciate your support in the form of a pull request. If not, you can request -for support here: - -[https://community.n8n.io/c/feature-requests/cli](https://community.n8n.io/c/feature-requests/cli) diff --git a/docs/development.md b/docs/development.md deleted file mode 100644 index d7d8de4744..0000000000 --- a/docs/development.md +++ /dev/null @@ -1,3 +0,0 @@ -# Development - -Have you found a bug :bug:? Or maybe you have a nice feature :sparkles: to contribute? The [CONTRIBUTING guide](https://github.com/n8n-io/n8n/blob/master/CONTRIBUTING.md) will help you get your development environment ready in minutes. diff --git a/docs/docker.md b/docs/docker.md deleted file mode 100644 index 317b5b9552..0000000000 --- a/docs/docker.md +++ /dev/null @@ -1,7 +0,0 @@ -# Docker - -Detailed information about how to run n8n in Docker can be found in the README -of the [Docker Image](https://github.com/n8n-io/n8n/blob/master/docker/images/n8n/README.md). - -A basic step by step example setup of n8n with docker-compose and Let's Encrypt is available on the -[Server Setup](server-setup.md) page. diff --git a/docs/faq.md b/docs/faq.md deleted file mode 100644 index 2b03a0b76d..0000000000 --- a/docs/faq.md +++ /dev/null @@ -1,47 +0,0 @@ -# FAQ - -## Integrations - - -### Can you create an integration for service X? - -You can request new integrations to be added to our forum. There is a special section for that where -other users can also upvote it so that we know which integrations are important and should be -created next. Request a new feature [here](https://community.n8n.io/c/feature-requests/nodes). - - -### An integration exists already but a feature is missing. Can you add it? - -Adding new functionality to an existing integration is normally not that complicated. So the chance is -high that we can do that quite fast. Post your feature request in the forum and we'll see -what we can do. Request a new feature [here](https://community.n8n.io/c/feature-requests/nodes). - - -### How can I create an integration myself? - -Information about that can be found in the [CONTRIBUTING guide](https://github.com/n8n-io/n8n/blob/master/CONTRIBUTING.md). - - -## License - - -### Which license does n8n use? - -n8n is [fair-code](http://faircode.io) licensed under [Apache 2.0 with Commons Clause](https://github.com/n8n-io/n8n/blob/master/packages/cli/LICENSE.md) - - -### Is n8n open-source? - -No. The [Commons Clause](https://commonsclause.com) that is attached to the Apache 2.0 license takes away some rights. Hence, according to the definition of the [Open Source Initiative (OSI)](https://opensource.org/osd), n8n is not open-source. Nonetheless, the source code is open and everyone (individuals and companies) can use it for free. However, it is not allowed to make money directly with n8n. - -For instance, one cannot charge others to host or support n8n. However, to make things simpler, we grant everyone (individuals and companies) the right to offer consulting or support without prior permission as long as it is less than 30,000 USD ($30k) per annum. -If your revenue from services based on n8n is greater than $30k per annum, we'd invite you to become a partner and apply for a license. If you have any questions about this, feel free to reach out to us at [license@n8n.io](mailto:license@n8n.io). - - -### Why is n8n not open-source but [fair-code](http://faircode.io) licensed instead? - -We love open-source and the idea that everybody can freely use and extend what we wrote. Our community is at the heart of everything that we do and we understand that people who contribute to a project are the main drivers that push a project forward. So to make sure that the project continues to evolve and stay alive in the longer run, we decided to attach the Commons Clause. This ensures that no other person or company can make money directly with n8n. Especially if it competes with how we plan to finance our further development. For the greater majority of the people, it will not make any difference at all. At the same time, it protects the project. - -As n8n itself depends on and uses a lot of other open-source projects, it is only fair that we support them back. That is why we have planned to contribute a certain percentage of revenue/profit every month to these projects. - -We have already started with the first monthly contributions via [Open Collective](https://opencollective.com/n8n). It is not much yet, but we hope to be able to ramp that up substantially over time. diff --git a/docs/images/n8n-logo.png b/docs/images/n8n-logo.png deleted file mode 100644 index a77f36aeeead7e17aa4390937e90f48652d811c8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2675 zcmV-(3XJuMP)Px#Do{*RMF0Q*I89ssZCd|rS~yKx|7}|TZCW@@TdQ7L z|7}`0O000bhQchC013}YL_t(| z+U=d$nyVlTfXlwvzW?h^_X3gxP^@;y)%i}xYWc}R67Y07peQATQ0g?~2gC_}ehC)? z>cK^QXug=*F)F`<^Nw_A=|RQnb6)gN(nC5=eujj*F+9J-a}fPCo`dM|{3p(H5Ivgc zGbMTq(t$*rX%Sm_q39=yeTRx3MHC#(M#gyL z01p`AI%Iu10^NP23~t3uR5<1*Lq9qO^ZV9R^K*q{++=8Uht2&q&MKOKQ57T3Ju1$; z3aSBgkBiGP$t7&v0J;aUx`Agt>gfm68p+t@DvZg=Z!s!LUqu|S&|vv_??CNzXZaB( zdoz7Iq2rmFHlADhPy#Gt$bc~TWd-)F!=cp?UF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ph)rD6}WW1wob zRqrY#O=7b>VLWr8fF}WEbKR>QOenVzP-^hd<3H!Ry3t;oXOrs zUVmO%51{4?KxIK!l8qjm-hByeKc%OFLhQ6C##ws2#!mvB3U;L?mV?R%fr&bDDhN!g zVW5Jqkc?OY^s*z9TT)O>eY%NA6q)@5MdU+;(RWd?3-fg- z(JV0%DE5^#L|cGLTpN5oG1wWXBvmw19e_715o3rPe4C#L6i|HYR0YvRiG}<{L}H;6 zP*3%lWuF=XL%%*3aCr2NHQwTu%ZauCwP;a%0!Fqo(38YZNP>D&RR*apI_XQ-oVGz6 znxR`G?p1&WV~6yWr7MWuKt0+4cIxSuzm(~rbN9ZGI9(GxcxvuIxo$ndrU_`gvE_4R+=$|vfO_)r zz$`z5I>y7A9{bMA-_WDsk_7T2Jv7t*Re@fZyh_fC-anh}n@$+oJYNX(ej{H3GN8PKcP3jUrC87kBJySe@w7fHd8*-j^R5P zQnx(H9r6vNniuajJn;Kc|CKoPKATLVohE#|J^gTOv9L&-M@)1$(J)bU9v1h2E*0!I z6r1i99*)Xh diff --git a/docs/images/n8n-screenshot.png b/docs/images/n8n-screenshot.png deleted file mode 100644 index 55b476cfb61bcf418baf09ebfd3c827ce563b4e8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 129698 zcmce;Wk6Kj+6IjBD34MK(g+Fy($dl(l0!%g9ZGk1st8Eu&<#Tj-3=-|z#v@%NDSS> zPy@_|KJPh4&-;EqzwZ~DwfA1@UiZ4=TGzVwguYRh#lKH^9}5c$UtaFD8Wz@_AuKFx zqrY$8w0s&iF24EmmxZK~BoEH+VM&@g7@Iwjw|i${ zre^le)XS;gOa$xJ1+V;TNe$20oq1e+4YzB|At83B*_&HUeSgz^ex92gW4xf5J=hAi z(%qa@nkyTuSF&L(S+qC9%yP_4>bh5PYt3Iu3`{!n&WX7FeS6{e`YW``` zzWe`MXPxD4-J9b&ckw|7@0OPs3YDQz+JcQ*$B0(tU$SJQY?RzcRUA?-eC|C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@9MP)nVK!&y8Fs845kp*Yp&y}^8KO9Ji{J2+zfN3%z;l7E zGqpO8u4|3iC$BYL&%e^XRtDW61$74#KU<7URC}%ocg}oagR7W7pyzKxH{U>2Do9q^ zimGDPBS}mmIRgp#ga&TUSy?}M%Ea0y?grFZH}j=23-h%zQ3&_K5vHXJ&9mA;%9z=U zC2FjehQmzgjlB-dNu}=l1d;q~i1>pmd0PbqOG*`zs7AlPs=O7mpx|&foyDO^W&K2v z7M2j~M`L$s&_t7XpZ+v!G=+vOvW_-=tqFr|1>enV-Hrj}bz)ADZ;<$nKkt94kZ;Kr zm=DX;vH-)AM6J6s0I4|@VRzk86ZCI;-PL7;VLg!=>ffdYVwHjH);Nf(zh#c8mhB`^spT)gajnv)8W^eJ#BZoKWb`O71LfDH=9I23NBLL)aWCrV|y#HQ5_@j zUzrzj8$djRZiOMYee&KnsrPyO$iEcO)jjF`=)sy2B_+$*Gb5m@_?KY68#zQN?x={E z)7COwc&mA5ddVoCVvuuDd9IMr$UTIXCMr#mH)p3WBq}1pbo*V!VyCUSqZ{Z7e#;SXu#h%<}rN6vgrAEF<2(D@d3mP@+Tq^%U z-6=V@69o!$>L0rKpP=`iQRNoZ^>}D9gv`y}Ht8!Me80gt0YWQ!71m0!!6@=NKBTqUh5%pTCNh|OWc#X&CG!aM zO(Nl{X|*0ERj=gM^-*%NBn?(+U+ea?sCI+j7Svp{)^Tnhl0GiZ+xrCI^!*K-4pQ*a z5Nz{K?jLD@Ztd`~2x0e=6wJgLztNMO9A0-uXsD~m_T zf6`O3v`c;KfVdvYO-EFMELl-KB}-QS53B#th7eQc<1|$N-pw5ewZPc z$>A7)`Aj6MR9PS7KgRMoa_wH3VUBWi?-+n}JMh>^fXf41mXWd^?LL01C~7L?$(cO; EKL8|sWdHyG diff --git a/docs/index.html b/docs/index.html deleted file mode 100644 index bd53af45e6..0000000000 --- a/docs/index.html +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - n8n Documentation - - - - - - - - -
- - - - - - - - - - - - - diff --git a/docs/key-components.md b/docs/key-components.md deleted file mode 100644 index 9caba3a0b0..0000000000 --- a/docs/key-components.md +++ /dev/null @@ -1,25 +0,0 @@ -# Key Components - - -## Connection - -A connection establishes a link between nodes to route data through the workflow. Each node can have one or multiple connections. - - -## Node - -A node is an entry point for retrieving data, a function to process data or an exit for sending data. The data process includes filtering, recomposing and changing data. There can be one or several nodes for your API, service or app. You can easily connect multiple nodes, which allows you to create simple and complex workflows with them intuitively. - -For example, consider a Google Sheets node. It can be used to retrieve or write data to a Google Sheet. - - -## Trigger Node - -A trigger node is a node that starts a workflow and supplies the initial data. What triggers it, depends on the node. It could be the time, a webhook call or an event from an external service. - -For example, consider a Trello trigger node. When a Trello Board gets updated, it will trigger a workflow to start using the data from the updated board. - - -## Workflow - -A workflow is a canvas on which you can place and connect nodes. A workflow can be started manually or by trigger nodes. A workflow run ends when all active and connected nodes have processed their data. diff --git a/docs/keyboard-shortcuts.md b/docs/keyboard-shortcuts.md deleted file mode 100644 index ace6db8d8e..0000000000 --- a/docs/keyboard-shortcuts.md +++ /dev/null @@ -1,28 +0,0 @@ -# Keyboard Shortcuts - -The following keyboard shortcuts can currently be used: - -## General - - - **Ctrl + Left Mouse Button**: Move/Pan Node View - - **Ctrl + a**: Select all nodes - - **Ctrl + Alt + n**: Create new workflow - - **Ctrl + o**: Open workflow - - **Ctrl + s**: Save the current workflow - - **Ctrl + v**: Paste nodes - - **Tab**: Open "Node Creator". Type to filter and navigate with arrow keys. To create press "enter" - - -## With node(s) selected - - - **ArrowDown**: Select sibling node bellow the current one - - **ArrowLeft**: Select node left of the current one - - **ArrowRight**: Select node right of the current one - - **ArrowUp**: Select sibling node above the current one - - **Ctrl + c**: Copy nodes - - **Ctrl + x**: Cut nodes - - **d**: Deactivate nodes - - **Delete**: Delete nodes - - **F2**: Rename node - - **Shift + ArrowLeft**: Select all nodes left of the current one - - **Shift + ArrowRight**: Select all nodes right of the current one diff --git a/docs/license.md b/docs/license.md deleted file mode 100644 index ace732e676..0000000000 --- a/docs/license.md +++ /dev/null @@ -1,5 +0,0 @@ -# License - -n8n is [fair-code](http://faircode.io) licensed under [Apache 2.0 with Commons Clause](https://github.com/n8n-io/n8n/blob/master/packages/cli/LICENSE.md) - -Additional information about the license can be found in the [FAQ](faq.md?id=license) and [fair-code](http://faircode.io). diff --git a/docs/node-basics.md b/docs/node-basics.md deleted file mode 100644 index aea6bf6e33..0000000000 --- a/docs/node-basics.md +++ /dev/null @@ -1,76 +0,0 @@ -# Node Basics - - -## Types - -There are two main node types in n8n: Trigger nodes and Regular nodes. - - -### Trigger Nodes - -The Trigger nodes start a workflow and supply the initial data. A workflow can contain multiple trigger nodes but with each execution, only one of them will execute. This is because the other trigger nodes would not have any input as they are the nodes from which the execution of the workflow starts. - - -### Regular Nodes - -These nodes do the actual work. They can add, remove, and edit the data in the flow as well as request and send data to external APIs. They can do everything possible with Node.js in general. - - -## Credentials - -External services need a way to identify and authenticate users. This data can range from an API key over an email/password combination to a very long multi-line private key and can be saved in n8n as credentials. - -Nodes in n8n can then request that credential information. As an additional layer of security credentials can only be accessed by node types which specifically have the right to do so. - -To make sure that the data is secure, it gets saved to the database encrypted. A random personal encryption key is used which gets automatically generated on the first run of n8n and then saved under `~/.n8n/config`. - - -## Expressions - -With the help of expressions, it is possible to set node parameters dynamically by referencing other data. That can be data from the flow, nodes, the environment or self-generated data. Expressions are normal text with placeholders (everything between {{...}}) that can execute JavaScript code, which offers access to special variables to access data. - -An expression could look like this: - -My name is: `{{$node["Webhook"].json["query"]["name"]}}` - -This one would return "My name is: " and then attach the value that the node with the name "Webhook" outputs and there select the property "query" and its key "name". So if the node would output this data: - -```json -{ - "query": { - "name": "Jim" - } -} -``` - -the value would be: "My name is: Jim" - -The following special variables are available: - - - **$binary**: Incoming binary data of a node - - **$evaluateExpression**: Evaluates a string as expression - - **$env**: Environment variables - - **$items**: Environment variables - - **$json**: Incoming JSON data of a node - - **$node**: Data of other nodes (binary, context, json, parameter, runIndex) - - **$parameters**: Parameters of the current node - - **$runIndex**: The current run index (first time node gets executed it is 0, second time 1, ...) - - **$workflow**: Returns workflow metadata like: active, id, name - -Normally it is not needed to write the JavaScript variables manually as they can be selected with the help of the Expression Editor. - - -## Parameters - -Parameters can be set for most nodes in n8n. The values that get set define what exactly a node does. - -Parameter values are static by default and are always the same no matter what kind of data the node processes. However, it is possible to set the values dynamically with the help of an Expression. Using Expressions, it is possible to make the parameter value dependent on other factors like the data of flow or parameters of other nodes. - -More information about it can be found under [Expressions](#expressions). - - -## Pausing Node - -Sometimes when creating and debugging a workflow, it is helpful to not execute specific nodes. To do that without disconnecting each node, you can pause them. When a node gets paused, the data passes through the node without being changed. - -There are two ways to pause a node. You can either press the pause button which gets displayed above the node when hovering over it or select the node and press “d”. diff --git a/docs/nodes.md b/docs/nodes.md deleted file mode 100644 index 8b9c7cbf0e..0000000000 --- a/docs/nodes.md +++ /dev/null @@ -1,247 +0,0 @@ -# Nodes - -## Function and Function Item Nodes - -These are the most powerful nodes in n8n. With these, almost everything can be done if you know how to -write JavaScript code. Both nodes work very similarly. They give you access to the incoming data -and you can manipulate it. - - -### Difference between both nodes - -The difference is that the code of the Function node gets executed only once. It receives the -full items (JSON and binary data) as an array and expects an array of items as a return value. The items -returned can be totally different from the incoming ones. So it is not only possible to remove and edit -existing items, but also to add or return totally new ones. - -The code of the Function Item node on the other hand gets executed once for every item. It receives -one item at a time as input and also just the JSON data. As a return value, it expects the JSON data -of one single item. That makes it possible to add, remove and edit JSON properties of items -but it is not possible to add new or remove existing items. Accessing and changing binary data is only -possible via the methods `getBinaryData` and `setBinaryData`. - -Both nodes support promises. So instead of returning the item or items directly, it is also possible to -return a promise which resolves accordingly. - - -### Function-Node - -#### Variable: items - -It contains all the items that the node received as input. - -Information about how the data is structured can be found on the page [Data Structure](data-structure.md). - -The data can be accessed and manipulated like this: - -```typescript -// Sets the JSON data property "myFileName" of the first item to the name of the -// file which is set in the binary property "image" of the same item. -items[0].json.myFileName = items[0].binary.image.fileName; - -return items; -``` - -This example creates 10 dummy items with the ids 0 to 9: - -```typescript -const newItems = []; - -for (let i=0;i<10;i++) { - newItems.push({ - json: { - id: i - } - }); -} - -return newItems; -``` - - -#### Method: $item(index: number, runIndex?: number) - -With `$item` it is possible to access the data of parent nodes. That can be the item data but also -the parameters. It expects as input an index of the item the data should be returned for. This is -needed because for each item the data returned can be different. This is probably obvious for the -item data itself but maybe less for data like parameters. The reason why it is also needed, is -that they may contain an expression. Expressions get always executed of the context for an item. -If that would not be the case, for example, the Email Send node not would be able to send multiple -emails at once to different people. Instead, the same person would receive multiple emails. - -The index is 0 based. So `$item(0)` will return the first item, `$item(1)` the second one, ... - -By default the item of the last run of the node will be returned. So if the referenced node ran -3x (its last runIndex is 2) and the current node runs the first time (its runIndex is 0) the -data of runIndex 2 of the referenced node will be returned. - -For more information about what data can be accessed via $node, check [here](#variable-node). - -Example: - -```typescript -// Returns the value of the JSON data property "myNumber" of Node "Set" (first item) -const myNumber = $item(0).$node["Set"].json["myNumber"]; -// Like above but data of the 6th item -const myNumber = $item(5).$node["Set"].json["myNumber"]; - -// Returns the value of the parameter "channel" of Node "Slack". -// If it contains an expression the value will be resolved with the -// data of the first item. -const channel = $item(0).$node["Slack"].parameter["channel"]; -// Like above but resolved with the value of the 10th item. -const channel = $item(9).$node["Slack"].parameter["channel"]; -``` - - -#### Method: $items(nodeName?: string, outputIndex?: number, runIndex?: number) - -Gives access to all the items of current or parent nodes. If no parameters get supplied, -it returns all the items of the current node. -If a node-name is given, it returns the items the node output on its first output -(index: 0, most nodes only have one output, exceptions are IF and Switch-Node) on -its last run. - -Example: - -```typescript -// Returns all the items of the current node and current run -const allItems = $items(); - -// Returns all items the node "IF" outputs (index: 0 which is Output "true" of its most recent run) -const allItems = $items("IF"); - -// Returns all items the node "IF" outputs (index: 0 which is Output "true" of the same run as current node) -const allItems = $items("IF", 0, $runIndex); - -// Returns all items the node "IF" outputs (index: 1 which is Output "false" of run 0 which is the first run) -const allItems = $items("IF", 1, 0); -``` - - -#### Variable: $node - -Works exactly like `$item` with the difference that it will always return the data of the first item and -the last run of the node. - -```typescript -// Returns the fileName of binary property "data" of Node "HTTP Request" -const fileName = $node["HTTP Request"].binary["data"]["fileName"]}} - -// Returns the context data "noItemsLeft" of Node "SplitInBatches" -const noItemsLeft = $node["SplitInBatches"].context["noItemsLeft"]; - -// Returns the value of the JSON data property "myNumber" of Node "Set" -const myNumber = $node["Set"].json['myNumber']; - -// Returns the value of the parameter "channel" of Node "Slack" -const channel = $node["Slack"].parameter["channel"]; - -// Returns the index of the last run of Node "HTTP Request" -const runIndex = $node["HTTP Request"].runIndex}} -``` - - -#### Variable: $runIndex - -Contains the index of the current run of the node. - -```typescript -// Returns all items the node "IF" outputs (index: 0 which is Output "true" of the same run as current node) -const allItems = $items("IF", 0, $runIndex); -``` - - -#### Variable: $workflow - -Gives information about the current workflow. - -```typescript -const isActive = $workflow.active; -const workflowId = $workflow.id; -const workflowName = $workflow.name; -``` - - -#### Method: $evaluateExpression(expression: string, itemIndex: number) - -Evaluates a given string as expression. -If no `itemIndex` is provided it uses by default in the Function-Node the data of item 0 and -in the Function Item-Node the data of the current item. - -Example: - -```javascript -items[0].json.variable1 = $evaluateExpression('{{1+2}}'); -items[0].json.variable2 = $evaluateExpression($node["Set"].json["myExpression"], 1); - -return items; -``` - - -#### Method: getWorkflowStaticData(type) - -Gives access to the static workflow data. -It is possible to save data directly with the workflow. This data should, however, be very small. -A common use case is to for example to save a timestamp of the last item that got processed from -an RSS-Feed or database. It will always return an object. Properties can then read, delete or -set on that object. When the workflow execution succeeds, n8n will check automatically if the data -has changed and will save it, if necessary. - -There are two types of static data. The "global" and the "node" one. Global static data is the -same in the whole workflow. And every node in the workflow can access it. The node static data -, however, is different for every node and only the node which set it can retrieve it again. - -Example: - -```javascript -// Get the global workflow static data -const staticData = getWorkflowStaticData('global'); -// Get the static data of the node -const staticData = getWorkflowStaticData('node'); - -// Access its data -const lastExecution = staticData.lastExecution; - -// Update its data -staticData.lastExecution = new Date().getTime(); - -// Delete data -delete staticData.lastExecution; -``` - -It is important to know that the static data can not be read and written when testing via the UI. -The data there will always be empty and the changes will not persist. Only when a workflow -is active and it gets called by a Trigger or Webhook, the static data will be saved. - - - -### Function Item-Node - - -#### Variable: item - -It contains the "json" data of the currently processed item. - -The data can be accessed and manipulated like this: - -```json -// Uses the data of an already existing key to create a new additional one -item.newIncrementedCounter = item.existingCounter + 1; -return item; -``` - - -#### Method: getBinaryData() - -Returns all the binary data (all keys) of the item which gets currently processed. - - -#### Method: setBinaryData(binaryData) - -Sets all the binary data (all keys) of the item which gets currently processed. - - -#### Method: getWorkflowStaticData(type) - -As described above for Function node. diff --git a/docs/quick-start.md b/docs/quick-start.md deleted file mode 100644 index 0c33cafbe8..0000000000 --- a/docs/quick-start.md +++ /dev/null @@ -1,43 +0,0 @@ -# Quick Start - - -## Give n8n a spin - -To spin up n8n, you can run: - -```bash -npx n8n -``` - -It will download everything that is needed to start n8n. - -You can then access n8n by opening: -[http://localhost:5678](http://localhost:5678) - - -## Start with docker - -To play around with n8n, you can also start it using docker: - -```bash -docker run -it --rm \ - --name n8n \ - -p 5678:5678 \ - n8nio/n8n -``` - -Be aware that all the data will be lost once the docker container gets removed. To -persist the data mount the `~/.n8n` folder: - -```bash -docker run -it --rm \ - --name n8n \ - -p 5678:5678 \ - -v ~/.n8n:/root/.n8n \ - n8nio/n8n -``` - -More information about the Docker setup can be found in the README file of the -[Docker Image](https://github.com/n8n-io/n8n/blob/master/docker/images/n8n/README.md). - -In case you run into issues, check out the [troubleshooting](troubleshooting.md) page or ask for help in the community [forum](https://community.n8n.io/). diff --git a/docs/security.md b/docs/security.md deleted file mode 100644 index 5682b2c29a..0000000000 --- a/docs/security.md +++ /dev/null @@ -1,13 +0,0 @@ -# Security - -By default, n8n can be accessed by everybody. This is okay if you only have it running -locally but if you deploy it on a server which is accessible from the web, you have -to make sure that n8n is protected. -Right now we have very basic protection in place using basic-auth. It can be activated -by setting the following environment variables: - -```bash -export N8N_BASIC_AUTH_ACTIVE=true -export N8N_BASIC_AUTH_USER= -export N8N_BASIC_AUTH_PASSWORD= -``` diff --git a/docs/sensitive-data.md b/docs/sensitive-data.md deleted file mode 100644 index fa7b0bb1b6..0000000000 --- a/docs/sensitive-data.md +++ /dev/null @@ -1,18 +0,0 @@ -# Sensitive Data via File - -To avoid passing sensitive information via environment variables, "_FILE" may be -appended to some environment variables. It will then load the data from a file -with the given name. That makes it possible to load data easily from -Docker and Kubernetes secrets. - -The following environment variables support file input: - - - DB_MONGODB_CONNECTION_URL_FILE - - DB_POSTGRESDB_DATABASE_FILE - - DB_POSTGRESDB_HOST_FILE - - DB_POSTGRESDB_PASSWORD_FILE - - DB_POSTGRESDB_PORT_FILE - - DB_POSTGRESDB_USER_FILE - - DB_POSTGRESDB_SCHEMA_FILE - - N8N_BASIC_AUTH_PASSWORD_FILE - - N8N_BASIC_AUTH_USER_FILE diff --git a/docs/server-setup.md b/docs/server-setup.md deleted file mode 100644 index d34d076a6f..0000000000 --- a/docs/server-setup.md +++ /dev/null @@ -1,183 +0,0 @@ -# Server Setup - -!> ***Important***: Make sure that you secure your n8n instance as described under [Security](security.md). - - -## Example setup with docker-compose - -If you have already installed docker and docker-compose, then you can directly start with step 4. - - -### 1. Install Docker - -This can vary depending on the Linux distribution used. Example bellow is for Ubuntu: - -```bash -sudo apt update -sudo apt install apt-transport-https ca-certificates curl software-properties-common -curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - -sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable" -sudo apt update -sudo apt install docker-ce -y -``` - -### 2. Optional: If it should run as not root user - -Run when logged in as the user that should also be allowed to run docker: - -```bash -sudo usermod -aG docker ${USER} -su - ${USER} -``` - -### 3. Install Docker-compose - -This can vary depending on the Linux distribution used. Example bellow is for Ubuntu: - -Check before what version the latestand replace "1.24.1" with that version accordingly. -https://github.com/docker/compose/releases - -```bash -sudo curl -L https://github.com/docker/compose/releases/download/1.24.1/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose -sudo chmod +x /usr/local/bin/docker-compose -``` - - -### 4. Setup DNS - -Add A record to route the subdomain accordingly. - -``` -Type: A -Name: n8n (or whatever the subdomain should be) -IP address: -``` - - -### 5. Create docker-compose file - -Save this file as `docker-compose.yml` - -Normally no changes should be needed. - -```yaml -version: "3" - -services: - traefik: - image: "traefik" - command: - - "--api=true" - - "--api.insecure=true" - - "--providers.docker=true" - - "--providers.docker.exposedbydefault=false" - - "--entrypoints.websecure.address=:443" - - "--certificatesresolvers.mytlschallenge.acme.tlschallenge=true" - - "--certificatesresolvers.mytlschallenge.acme.email=${SSL_EMAIL}" - - "--certificatesresolvers.mytlschallenge.acme.storage=/letsencrypt/acme.json" - ports: - - "443:443" - volumes: - - ${DATA_FOLDER}/letsencrypt:/letsencrypt - - /var/run/docker.sock:/var/run/docker.sock:ro - - n8n: - image: n8nio/n8n - ports: - - "127.0.0.1:5678:5678" - labels: - - traefik.enable=true - - traefik.http.routers.n8n.rule=Host(`${SUBDOMAIN}.${DOMAIN_NAME}`) - - traefik.http.routers.n8n.tls=true - - traefik.http.routers.n8n.entrypoints=websecure - - traefik.http.routers.n8n.tls.certresolver=mytlschallenge - - traefik.http.middlewares.n8n.headers.SSLRedirect=true - - traefik.http.middlewares.n8n.headers.STSSeconds=315360000 - - traefik.http.middlewares.n8n.headers.browserXSSFilter=true - - traefik.http.middlewares.n8n.headers.contentTypeNosniff=true - - traefik.http.middlewares.n8n.headers.forceSTSHeader=true - - traefik.http.middlewares.n8n.headers.SSLHost=${DOMAIN_NAME} - - traefik.http.middlewares.n8n.headers.STSIncludeSubdomains=true - - traefik.http.middlewares.n8n.headers.STSPreload=true - environment: - - N8N_BASIC_AUTH_ACTIVE=true - - N8N_BASIC_AUTH_USER - - N8N_BASIC_AUTH_PASSWORD - - N8N_HOST=${SUBDOMAIN}.${DOMAIN_NAME} - - N8N_PORT=5678 - - N8N_LISTEN_ADDRESS=0.0.0.0 - - N8N_PROTOCOL=https - - NODE_ENV=production - - WEBHOOK_TUNNEL_URL=https://${SUBDOMAIN}.${DOMAIN_NAME}/ - - VUE_APP_URL_BASE_API=https://${SUBDOMAIN}.${DOMAIN_NAME}/ - volumes: - - /var/run/docker.sock:/var/run/docker.sock - - ${DATA_FOLDER}/.n8n:/root/.n8n -``` - - -### 6. Create `.env` file - -Create `.env` file and change it accordingly. - -```bash -# Folder where data should be saved -DATA_FOLDER=/root/n8n/ - -# The top level domain to serve from -DOMAIN_NAME=example.com - -# The subdomain to serve from -SUBDOMAIN=n8n - -# DOMAIN_NAME and SUBDOMAIN combined decide where n8n will be reachable from -# above example would result in: https://n8n.example.com - -# The user name to use for autentication - IMPORTANT ALWAYS CHANGE! -N8N_BASIC_AUTH_USER=user - -# The password to use for autentication - IMPORTANT ALWAYS CHANGE! -N8N_BASIC_AUTH_PASSWORD=password - -# Optional timezone to set which gets used by Cron-Node by default -# If not set New York time will be used -GENERIC_TIMEZONE=Europe/Berlin - -# The email address to use for the SSL certificate creation -SSL_EMAIL=user@example.com -``` - - -### 7. Create data folder - -Create the folder which is defined as `DATA_FOLDER`. In the example -above, it is `/root/n8n/`. - -In that folder, the database file from SQLite as well as the encryption key will be saved. - -The folder can be created like this: -``` -mkdir /root/n8n/ -``` - - -### 8. Start docker-compose setup - -n8n can now be started via: - -```bash -sudo docker-compose up -d -``` - -In case it should ever be stopped that can be done with this command: -```bash -sudo docker-compose stop -``` - - -### 9. Done - -n8n will now be reachable via the above defined subdomain + domain combination. -The above example would result in: https://n8n.example.com - -n8n will only be reachable via https and not via http. diff --git a/docs/setup.md b/docs/setup.md deleted file mode 100644 index 27e65e54ea..0000000000 --- a/docs/setup.md +++ /dev/null @@ -1,35 +0,0 @@ -# Setup - - -## Installation - -To install n8n globally: - -```bash -npm install n8n -g -``` - -## Start - -After the installation n8n can be started by simply typing in: - -```bash -n8n -# or -n8n start -``` - - -## Start with tunnel - -!> **WARNING**: This is only meant for local development and testing. It should not be used in production! - -To be able to use webhooks for trigger nodes of external services like GitHub, n8n has to be reachable from the web. To make that easy, n8n has a special tunnel service, which redirects requests from our servers to your local n8n instance (uses this code: [https://github.com/localtunnel/localtunnel](https://github.com/localtunnel/localtunnel)). - -To use it, simply start n8n with `--tunnel` - -```bash -n8n start --tunnel -``` - -In case you run into issues, check out the [troubleshooting](troubleshooting.md) page or ask for help in the community [forum](https://community.n8n.io/). diff --git a/docs/start-workflows-via-cli.md b/docs/start-workflows-via-cli.md deleted file mode 100644 index 6327f32963..0000000000 --- a/docs/start-workflows-via-cli.md +++ /dev/null @@ -1,15 +0,0 @@ -# Start Workflows via CLI - -Workflows cannot be only started by triggers, webhooks or manually via the -Editor. It is also possible to start them directly via the CLI. - -Execute a saved workflow by its ID: - -```bash -n8n execute --id -``` - -Execute a workflow from a workflow file: -```bash -n8n execute --file -``` diff --git a/docs/test.md b/docs/test.md deleted file mode 100644 index 02a308b3ad..0000000000 --- a/docs/test.md +++ /dev/null @@ -1,3 +0,0 @@ -# This is a simple test - -with some text diff --git a/docs/troubleshooting.md b/docs/troubleshooting.md deleted file mode 100644 index 7e6b4b058b..0000000000 --- a/docs/troubleshooting.md +++ /dev/null @@ -1,58 +0,0 @@ -# Troubleshooting - -## Windows - -If you are experiencing issues running n8n with the typical flow of: - -```powershell -npx n8n -``` - -### Requirements - -Please ensure that you have the following requirements fulfilled: - -- Install latest version of [NodeJS](https://nodejs.org/en/download/) -- Install [Python 2.7](https://www.python.org/downloads/release/python-2717/) (It is okay to have multiple versions installed on the machine) -- Windows SDK -- C++ Desktop Development Tools -- Windows Build Tools - -#### Install build tools - -If you haven't satisfied the above, follow this procedure through your PowerShell (run with administrative privileges). -This command installs the build tools, windows SDK and the C++ development tools in one package. - -```powershell -npm install --global --production windows-build-tools -``` - -#### Configure npm to use Python version 2.7 - -```powershell -npm config set python python2.7 -``` - -#### Configure npm to use correct msvs version - -```powershell -npm config set msvs_version 2017 --global -``` - -### Lesser known issues: - -#### mmmagic npm package when using MSbuild tools with Visual Studio - -While installing this package, `node-gyp` is run and it might fail to install it with an error appearing in the ballpark of: - -``` -gyp ERR! stack Error: spawn C:\Program Files (x86)\Microsoft Visual Studio\2019\**Enterprise**\MSBuild\Current\Bin\MSBuild.exe ENOENT -``` - -It is seeking the `MSBuild.exe` in a directory that does not exist. If you are using Visual Studio Community or vice versa, you can change the path of MSBuild with command: - -```powershell -npm config set msbuild_path "C:\Program Files (x86)\Microsoft Visual Studio\2019\**Community**\MSBuild\Current\Bin\MSBuild.exe" -``` - -Attempt to install package again after running the command above. diff --git a/docs/tutorials.md b/docs/tutorials.md deleted file mode 100644 index 527274be53..0000000000 --- a/docs/tutorials.md +++ /dev/null @@ -1,26 +0,0 @@ -# Tutorials - - -## Examples - -Example workflows which show what can be done with n8n can be found here: -[https://n8n.io/workflows](https://n8n.io/workflows) - -If you want to know how a node can get used in context, you can search for it here: -[https://n8n.io/nodes](https://n8n.io/nodes). There it shows in which workflows the -node got used. - - - -## Videos - - - [Slack Notification on Github Star](https://www.youtube.com/watch?v=3w7xIMKLVAg) - - [Typeform to Google Sheet and Slack or Email](https://www.youtube.com/watch?v=rn3-d4IiW44) - - -### Community Tutorials - - - [n8n basics 1/3 - Getting Started](https://www.youtube.com/watch?v=JIaxjH2CyFc) - - [n8n basics 2/3 - Simple Workflow](https://www.youtube.com/watch?v=ovlxledZfM4) - - [n8n basics 3/3 - Transforming JSON](https://www.youtube.com/watch?v=wGAEAcfwV8w) - - [n8n Google Integration - Using Google Sheets and Google Api nodes](https://www.youtube.com/watch?v=KFqx8OmkqVE) diff --git a/docs/workflow.md b/docs/workflow.md deleted file mode 100644 index 344504d158..0000000000 --- a/docs/workflow.md +++ /dev/null @@ -1,111 +0,0 @@ -# Workflow - - -## Activate - -Activating a workflow means that the Trigger and Webhook nodes get activated and can trigger a workflow to run. By default all the newly created workflows are deactivated. That means that even if a Trigger node like the Cron node should start a workflow because a predefined time is reached, it will not unless the workflow gets activated. It is only possible to activate a workflow which contains a Trigger or a Webhook node. - - -## Data Flow - -Nodes do not only process one "item", they process multiple ones. So if the Trello node is set to "Create-Card" and it has an expression set for "Name" to be set depending on "name" property, it will create a card for each item, always choosing the name-property-value of the current one. - -This data would, for example, create two boards. One named "test1" the other one named "test2": - -```json -[ - { - name: "test1" - }, - { - name: "test2" - } -] -``` - - -## Error Workflows - -For each workflow, an optional "Error Workflow" can be set. It gets executed in case the execution of the workflow fails. That makes it possible to, for instance, inform the user via Email or Slack if something goes wrong. The same "Error Workflow" can be set on multiple workflows. - -The only difference between a regular workflow and an "Error Workflow" is that it contains an "Error Trigger" node. So it is important to make sure that this node gets created before setting a workflow as "Error Workflow". - -The "Error Trigger" node will trigger in case the execution fails and receives information about it. The data looks like this: - -```json -[ - { - "execution": { - "id": "231", - "url": "https://n8n.example.com/execution/231", - "retryOf": "34", - "error": { - "message": "Example Error Message", - "stack": "Stacktrace" - }, - "lastNodeExecuted": "Node With Error", - "mode": "manual" - }, - "workflow": { - "id": "1", - "name": "Example Workflow" - } - } -] - -``` - -All information is always present except: -- **execution.id**: Only present when the execution gets saved in the database -- **execution.url**: Only present when the execution gets saved in the database -- **execution.retryOf**: Only present when the execution is a retry of a previously failed execution - - -### Setting Error Workflow - -An "Error Workflow" can be set in the Workflow Settings which can be accessed by pressing the "Workflow" button in the menu on the on the left side. The last option is "Settings". In the window that appears, the "Error Workflow" can be selected via the Dropdown "Error Workflow". - - -## Share Workflows - -All workflows are JSON and can be shared very easily. - -There are multiple ways to download a workflow as JSON to then share it with other people via Email, Slack, Skype, Dropbox, … - - 1. Press the "Download" button under the Workflow menu in the sidebar on the left. It then downloads the workflow as a JSON file. - 1. Select the nodes in the editor which should be exported and then copy them (Ctrl + c). The nodes then get saved as JSON in the clipboard and can be pasted wherever desired (Ctrl + v). - -Importing that JSON representation again into n8n is as easy and can also be done in different ways: - - 1. Press "Import from File" or "Import from URL" under the Workflow menu in the sidebar on the left. - 1. Copy the JSON workflow to the clipboard (Ctrl + c) and then simply pasting it directly into the editor (Ctrl + v). - - -## Workflow Settings - -On each workflow, it is possible to set some custom settings and overwrite some of the global default settings. Currently, the following settings can be set: - - -### Error Workflow - -Workflow to run in case the execution of the current workflow fails. More information in section [Error Workflows](#error-workflows). - - -### Timezone - -The timezone to use in the current workflow. If not set, the global Timezone (by default "New York" gets used). For instance, this is important for the Cron Trigger node. - - -### Save Data Error Execution - -If the Execution data of the workflow should be saved when it fails. - - -### Save Data Success Execution - -If the Execution data of the workflow should be saved when it succeeds. - - -### Save Manual Executions - -If executions started from the Editor UI should be saved. From 559afb488bb8960adb60755d9f4aea5e1026d0a5 Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Sun, 5 Jul 2020 19:18:01 +0200 Subject: [PATCH 158/241] :whale: Add Raspberry Pi Docker image --- .github/workflows/docker-images.yml | 5 +++++ docker/images/n8n-rpi/Dockerfile | 20 ++++++++++++++++++++ docker/images/n8n-rpi/README.md | 21 +++++++++++++++++++++ 3 files changed, 46 insertions(+) create mode 100644 docker/images/n8n-rpi/Dockerfile create mode 100644 docker/images/n8n-rpi/README.md diff --git a/.github/workflows/docker-images.yml b/.github/workflows/docker-images.yml index 8d034b5b91..b05b6aa714 100644 --- a/.github/workflows/docker-images.yml +++ b/.github/workflows/docker-images.yml @@ -32,3 +32,8 @@ jobs: run: docker build --build-arg N8N_VERSION=${{steps.vars.outputs.tag}} -t n8nio/n8n:${{steps.vars.outputs.tag}}-ubuntu docker/images/n8n-ubuntu - name: Push Docker image of version (Ubuntu) run: docker push n8nio/n8n:${{steps.vars.outputs.tag}}-ubuntu + + - name: Build the Docker image of version (Rpi) + run: docker build --build-arg N8N_VERSION=${{steps.vars.outputs.tag}} -t n8nio/n8n:${{steps.vars.outputs.tag}}-rpi docker/images/n8n-rpi + - name: Push Docker image of version (Rpi) + run: docker push n8nio/n8n:${{steps.vars.outputs.tag}}-rpi diff --git a/docker/images/n8n-rpi/Dockerfile b/docker/images/n8n-rpi/Dockerfile new file mode 100644 index 0000000000..b60d50bdeb --- /dev/null +++ b/docker/images/n8n-rpi/Dockerfile @@ -0,0 +1,20 @@ +FROM arm32v7/node:12.16 + +ARG N8N_VERSION + +RUN if [ -z "$N8N_VERSION" ] ; then echo "The N8N_VERSION argument is missing!" ; exit 1; fi + +RUN \ + apt-get update && \ + apt-get -y install graphicsmagick gosu + +RUN npm_config_user=root npm install -g full-icu n8n@${N8N_VERSION} + +ENV NODE_ICU_DATA /usr/local/lib/node_modules/full-icu +ENV NODE_ENV production + +WORKDIR /data + +USER node + +CMD n8n diff --git a/docker/images/n8n-rpi/README.md b/docker/images/n8n-rpi/README.md new file mode 100644 index 0000000000..9eca14e3f6 --- /dev/null +++ b/docker/images/n8n-rpi/README.md @@ -0,0 +1,21 @@ +## n8n - Raspberry PI Docker Image + +Dockerfile to build n8n for Raspberry PI. + +For information about how to run n8n with Docker check the generic +[Docker-Readme](https://github.com/n8n-io/n8n/tree/master/docker/images/n8n/README.md) + + +``` +docker build --build-arg N8N_VERSION= -t n8nio/n8n: . + +# For example: +docker build --build-arg N8N_VERSION=0.43.0 -t n8nio/n8n:0.43.0-rpi . +``` + +``` +docker run -it --rm \ + --name n8n \ + -p 5678:5678 \ + n8nio/n8n:0.70.0-rpi +``` From b4b65bb90624ad00e6e3336c276a363548fb60cc Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Sun, 5 Jul 2020 19:22:25 +0200 Subject: [PATCH 159/241] :whale: Build Raspberry Pi Docker image correctly --- .github/workflows/docker-images-rpi.yml | 28 ++++++++++++++ .github/workflows/docker-images.yml | 5 --- docker/images/n8n-custom/Dockerfile copy | 49 ++++++++++++++++++++++++ docker/images/n8n-rhel7/Dockerfile | 23 +++++++++++ docker/images/n8n-rhel7/README.md | 16 ++++++++ 5 files changed, 116 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/docker-images-rpi.yml create mode 100644 docker/images/n8n-custom/Dockerfile copy create mode 100644 docker/images/n8n-rhel7/Dockerfile create mode 100644 docker/images/n8n-rhel7/README.md diff --git a/.github/workflows/docker-images-rpi.yml b/.github/workflows/docker-images-rpi.yml new file mode 100644 index 0000000000..c6db9ed95b --- /dev/null +++ b/.github/workflows/docker-images-rpi.yml @@ -0,0 +1,28 @@ +name: Docker Image CI - Rpi + +on: + push: + tags: + - n8n@* + +jobs: + armv7_job: + runs-on: ubuntu-18.04 + name: Build on ARMv7 (Rpi) + steps: + - uses: actions/checkout@v1 + - name: Get the version + id: vars + run: echo ::set-output name=tag::$(echo ${GITHUB_REF:14}) + + - name: Log in to Docker registry + run: docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }} + + - name: Set up Docker Buildx + uses: crazy-max/ghaction-docker-buildx@v1 + with: + version: latest + - name: Run Buildx (push image) + if: success() + run: | + docker buildx build --platform linux/arm/v7 --build-arg N8N_VERSION=${{steps.vars.outputs.tag}} -t n8nio/n8n:${{steps.vars.outputs.tag}}-rpi --output type=image,push=true docker/images/n8n-rpi diff --git a/.github/workflows/docker-images.yml b/.github/workflows/docker-images.yml index b05b6aa714..8d034b5b91 100644 --- a/.github/workflows/docker-images.yml +++ b/.github/workflows/docker-images.yml @@ -32,8 +32,3 @@ jobs: run: docker build --build-arg N8N_VERSION=${{steps.vars.outputs.tag}} -t n8nio/n8n:${{steps.vars.outputs.tag}}-ubuntu docker/images/n8n-ubuntu - name: Push Docker image of version (Ubuntu) run: docker push n8nio/n8n:${{steps.vars.outputs.tag}}-ubuntu - - - name: Build the Docker image of version (Rpi) - run: docker build --build-arg N8N_VERSION=${{steps.vars.outputs.tag}} -t n8nio/n8n:${{steps.vars.outputs.tag}}-rpi docker/images/n8n-rpi - - name: Push Docker image of version (Rpi) - run: docker push n8nio/n8n:${{steps.vars.outputs.tag}}-rpi diff --git a/docker/images/n8n-custom/Dockerfile copy b/docker/images/n8n-custom/Dockerfile copy new file mode 100644 index 0000000000..19f08a16dd --- /dev/null +++ b/docker/images/n8n-custom/Dockerfile copy @@ -0,0 +1,49 @@ +FROM node:12.16-alpine as builder +# FROM node:12.16-alpine + +# Update everything and install needed dependencies +RUN apk add --update graphicsmagick tzdata git tini su-exec + +USER root + +# Install all needed dependencies +RUN apk --update add --virtual build-dependencies python build-base ca-certificates && \ + npm_config_user=root npm install -g full-icu lerna + +ENV NODE_ICU_DATA /usr/local/lib/node_modules/full-icu + +WORKDIR /data + +COPY lerna.json . +COPY package.json . +COPY packages/cli/ ./packages/cli/ +COPY packages/core/ ./packages/core/ +COPY packages/editor-ui/ ./packages/editor-ui/ +COPY packages/nodes-base/ ./packages/nodes-base/ +COPY packages/workflow/ ./packages/workflow/ +RUN rm -rf node_modules packages/*/node_modules packages/*/dist + +RUN npm install --loglevel notice +RUN lerna bootstrap --hoist +RUN npm run build + + +FROM node:12.16-alpine + +WORKDIR /data + +# Install all needed dependencies +RUN npm_config_user=root npm install -g full-icu + +USER root + +ENV NODE_ICU_DATA /usr/local/lib/node_modules/full-icu + +COPY --from=builder /data ./ + +RUN apk add --update graphicsmagick tzdata git tini su-exec + +COPY docker/images/n8n-dev/docker-entrypoint.sh /docker-entrypoint.sh +ENTRYPOINT ["tini", "--", "/docker-entrypoint.sh"] + +EXPOSE 5678/tcp diff --git a/docker/images/n8n-rhel7/Dockerfile b/docker/images/n8n-rhel7/Dockerfile new file mode 100644 index 0000000000..949d436602 --- /dev/null +++ b/docker/images/n8n-rhel7/Dockerfile @@ -0,0 +1,23 @@ +FROM richxsl/rhel7 + +ARG N8N_VERSION + +RUN if [ -z "$N8N_VERSION" ] ; then echo "The N8N_VERSION argument is missing!" ; exit 1; fi + +RUN \ + yum install -y gcc-c++ make + +RUN \ + curl -sL https://rpm.nodesource.com/setup_12.x | sudo -E bash - + +RUN \ + sudo yum install nodejs + +# Set a custom user to not have n8n run as root +USER root + +RUN npm_config_user=root npm install -g n8n@${N8N_VERSION} + +WORKDIR /data + +CMD "n8n" diff --git a/docker/images/n8n-rhel7/README.md b/docker/images/n8n-rhel7/README.md new file mode 100644 index 0000000000..015f7ac07f --- /dev/null +++ b/docker/images/n8n-rhel7/README.md @@ -0,0 +1,16 @@ +## Build Docker-Image + +``` +docker build --build-arg N8N_VERSION= -t n8nio/n8n: . + +# For example: +docker build --build-arg N8N_VERSION=0.36.1 -t n8nio/n8n:0.36.1-rhel7 . +``` + + +``` +docker run -it --rm \ + --name n8n \ + -p 5678:5678 \ + n8nio/n8n:0.25.0-ubuntu +``` From af4333f268bf3de5422bcdac4ec3e41dc25ac983 Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Mon, 6 Jul 2020 15:05:05 +0200 Subject: [PATCH 160/241] :zap: Some minior improvements on Zoom-Node --- .../credentials/ZoomApi.credentials.ts | 2 +- .../nodes/Zoom/MeetingDescription.ts | 155 ++++++++++-------- packages/nodes-base/nodes/Zoom/Zoom.node.ts | 11 +- 3 files changed, 86 insertions(+), 82 deletions(-) diff --git a/packages/nodes-base/credentials/ZoomApi.credentials.ts b/packages/nodes-base/credentials/ZoomApi.credentials.ts index 3db4aadbe0..dbef996429 100644 --- a/packages/nodes-base/credentials/ZoomApi.credentials.ts +++ b/packages/nodes-base/credentials/ZoomApi.credentials.ts @@ -5,7 +5,7 @@ export class ZoomApi implements ICredentialType { displayName = 'Zoom API'; properties = [ { - displayName: 'Access Token', + displayName: 'JTW Token', name: 'accessToken', type: 'string' as NodePropertyTypes, default: '' diff --git a/packages/nodes-base/nodes/Zoom/MeetingDescription.ts b/packages/nodes-base/nodes/Zoom/MeetingDescription.ts index 130830b9fe..f412235396 100644 --- a/packages/nodes-base/nodes/Zoom/MeetingDescription.ts +++ b/packages/nodes-base/nodes/Zoom/MeetingDescription.ts @@ -50,6 +50,27 @@ export const meetingFields = [ /* -------------------------------------------------------------------------- */ /* meeting:create */ /* -------------------------------------------------------------------------- */ + { + displayName: 'Topic', + name: 'topic', + type: 'string', + typeOptions: { + alwaysOpenEditWindow: true, + }, + default: '', + displayOptions: { + show: { + operation: [ + 'create', + + ], + resource: [ + 'meeting', + ], + }, + }, + description: `Topic of the meeting.`, + }, { displayName: 'Additional Fields', name: 'additionalFields', @@ -88,42 +109,6 @@ export const meetingFields = [ default: 0, description: 'Meeting duration (minutes).', }, - { - displayName: 'Meeting Topic', - name: 'topic', - type: 'string', - typeOptions: { - alwaysOpenEditWindow: true, - }, - default: '', - description: `Meeting topic.`, - }, - { - displayName: 'Meeting Type', - name: 'type', - type: 'options', - options: [ - { - name: 'Instant Meeting', - value: 1, - }, - { - name: 'Scheduled Meeting', - value: 2, - }, - { - name: 'Recurring Meeting with no fixed time', - value: 3, - }, - { - name: 'Recurring Meeting with fixed time', - value: 8, - }, - - ], - default: 2, - description: 'Meeting type.', - }, { displayName: 'Password', name: 'password', @@ -284,13 +269,39 @@ export const meetingFields = [ default: '', description: `Time zone used in the response. The default is the time zone of the calendar.`, }, + { + displayName: 'Type', + name: 'type', + type: 'options', + options: [ + { + name: 'Instant Meeting', + value: 1, + }, + { + name: 'Scheduled Meeting', + value: 2, + }, + { + name: 'Recurring Meeting with no fixed time', + value: 3, + }, + { + name: 'Recurring Meeting with fixed time', + value: 8, + }, + + ], + default: 2, + description: 'Meeting type.', + }, ], }, /* -------------------------------------------------------------------------- */ /* meeting:get */ /* -------------------------------------------------------------------------- */ { - displayName: 'Meeting ID', + displayName: 'ID', name: 'meetingId', type: 'string', default: '', @@ -433,7 +444,7 @@ export const meetingFields = [ /* meeting:delete */ /* -------------------------------------------------------------------------- */ { - displayName: 'Meeting ID', + displayName: 'ID', name: 'meetingId', type: 'string', default: '', @@ -488,7 +499,7 @@ export const meetingFields = [ /* meeting:update */ /* -------------------------------------------------------------------------- */ { - displayName: 'Meeting ID', + displayName: 'ID', name: 'meetingId', type: 'string', default: '', @@ -542,39 +553,6 @@ export const meetingFields = [ default: 0, description: 'Meeting duration (minutes).', }, - { - displayName: 'Meeting Topic', - name: 'topic', - type: 'string', - default: '', - description: `Meeting topic.`, - }, - { - displayName: 'Meeting Type', - name: 'type', - type: 'options', - options: [ - { - name: 'Instant Meeting', - value: 1, - }, - { - name: 'Scheduled Meeting', - value: 2, - }, - { - name: 'Recurring Meeting with no fixed time', - value: 3, - }, - { - name: 'Recurring Meeting with fixed time', - value: 8, - }, - - ], - default: 2, - description: 'Meeting type.', - }, { displayName: 'Password', name: 'password', @@ -735,6 +713,39 @@ export const meetingFields = [ default: '', description: `Time zone used in the response. The default is the time zone of the calendar.`, }, + { + displayName: 'Topic', + name: 'topic', + type: 'string', + default: '', + description: `Meeting topic.`, + }, + { + displayName: 'Type', + name: 'type', + type: 'options', + options: [ + { + name: 'Instant Meeting', + value: 1, + }, + { + name: 'Scheduled Meeting', + value: 2, + }, + { + name: 'Recurring Meeting with no fixed time', + value: 3, + }, + { + name: 'Recurring Meeting with fixed time', + value: 8, + }, + + ], + default: 2, + description: 'Meeting type.', + }, ], }, ] as INodeProperties[]; diff --git a/packages/nodes-base/nodes/Zoom/Zoom.node.ts b/packages/nodes-base/nodes/Zoom/Zoom.node.ts index 7f735d33b8..f7ecff0de8 100644 --- a/packages/nodes-base/nodes/Zoom/Zoom.node.ts +++ b/packages/nodes-base/nodes/Zoom/Zoom.node.ts @@ -252,10 +252,7 @@ export class Zoom implements INodeType { } if (operation === 'create') { //https://marketplace.zoom.us/docs/api-reference/zoom-api/meetings/meetingcreate - const additionalFields = this.getNodeParameter( - 'additionalFields', - i - ) as IDataObject; + const additionalFields = this.getNodeParameter('additionalFields', i) as IDataObject; const body: IDataObject = {}; @@ -310,9 +307,7 @@ export class Zoom implements INodeType { body.settings = settingValues; } - if (additionalFields.topic) { - body.topic = additionalFields.topic as string; - } + body.topic = this.getNodeParameter('topic', i) as string; if (additionalFields.type) { body.type = additionalFields.type as string; @@ -347,8 +342,6 @@ export class Zoom implements INodeType { body.agenda = additionalFields.agenda as string; } - console.log(body); - responseData = await zoomApiRequest.call( this, 'POST', From c4332634eb2ef083842d64b6d715a407d7773b3b Mon Sep 17 00:00:00 2001 From: ricardo Date: Mon, 6 Jul 2020 12:18:36 -0400 Subject: [PATCH 161/241] :zap: Improvements --- .../credentials/CircleCiApi.credentials.ts | 2 +- .../nodes/CircleCi/CircleCi.node.ts | 9 +- .../nodes/CircleCi/PipelineDescription.ts | 92 ++++++++++++++++++- 3 files changed, 95 insertions(+), 8 deletions(-) diff --git a/packages/nodes-base/credentials/CircleCiApi.credentials.ts b/packages/nodes-base/credentials/CircleCiApi.credentials.ts index 88ecdc4fe1..ef3104b5e6 100644 --- a/packages/nodes-base/credentials/CircleCiApi.credentials.ts +++ b/packages/nodes-base/credentials/CircleCiApi.credentials.ts @@ -8,7 +8,7 @@ export class CircleCiApi implements ICredentialType { displayName = 'CircleCI API'; properties = [ { - displayName: 'API Key', + displayName: 'Personal API Token', name: 'apiKey', type: 'string' as NodePropertyTypes, default: '', diff --git a/packages/nodes-base/nodes/CircleCi/CircleCi.node.ts b/packages/nodes-base/nodes/CircleCi/CircleCi.node.ts index 00eded6366..a15a9511e2 100644 --- a/packages/nodes-base/nodes/CircleCi/CircleCi.node.ts +++ b/packages/nodes-base/nodes/CircleCi/CircleCi.node.ts @@ -71,16 +71,18 @@ export class CircleCi implements INodeType { for (let i = 0; i < length; i++) { if (resource === 'pipeline') { if (operation === 'get') { + const vcs = this.getNodeParameter('vcs', i) as string; let slug = this.getNodeParameter('projectSlug', i) as string; const pipelineNumber = this.getNodeParameter('pipelineNumber', i) as number; slug = slug.replace(new RegExp(/\//g), '%2F'); - const endpoint = `/project/${slug}/pipeline/${pipelineNumber}`; + const endpoint = `/project/${vcs}/${slug}/pipeline/${pipelineNumber}`; responseData = await circleciApiRequest.call(this, 'GET', endpoint, {}, qs); } if (operation === 'getAll') { + const vcs = this.getNodeParameter('vcs', i) as string; const filters = this.getNodeParameter('filters', i) as IDataObject; const returnAll = this.getNodeParameter('returnAll', i) as boolean; let slug = this.getNodeParameter('projectSlug', i) as string; @@ -91,7 +93,7 @@ export class CircleCi implements INodeType { qs.branch = filters.branch; } - const endpoint = `/project/${slug}/pipeline`; + const endpoint = `/project/${vcs}/${slug}/pipeline`; if (returnAll === true) { responseData = await circleciApiRequestAllItems.call(this, 'items', 'GET', endpoint, {}, qs); @@ -105,13 +107,14 @@ export class CircleCi implements INodeType { } if (operation === 'trigger') { + const vcs = this.getNodeParameter('vcs', i) as string; let slug = this.getNodeParameter('projectSlug', i) as string; const additionalFields = this.getNodeParameter('additionalFields', i) as IDataObject; slug = slug.replace(new RegExp(/\//g), '%2F'); - const endpoint = `/project/${slug}/pipeline`; + const endpoint = `/project/${vcs}/${slug}/pipeline`; const body: IDataObject = {}; diff --git a/packages/nodes-base/nodes/CircleCi/PipelineDescription.ts b/packages/nodes-base/nodes/CircleCi/PipelineDescription.ts index 66b99f3eb3..4ffd2183d6 100644 --- a/packages/nodes-base/nodes/CircleCi/PipelineDescription.ts +++ b/packages/nodes-base/nodes/CircleCi/PipelineDescription.ts @@ -41,6 +41,33 @@ export const pipelineFields = [ /* -------------------------------------------------------------------------- */ /* pipeline:get */ /* -------------------------------------------------------------------------- */ + { + displayName: 'VCS', + name: 'vcs', + type: 'options', + options: [ + { + name: 'Github', + value: 'github', + }, + { + name: 'Bitbucket', + value: 'bitbucket', + }, + ], + displayOptions: { + show: { + operation: [ + 'get', + ], + resource: [ + 'pipeline', + ], + }, + }, + default: '', + description: 'Version control system', + }, { displayName: 'Project Slug', name: 'projectSlug', @@ -56,12 +83,15 @@ export const pipelineFields = [ }, }, default: '', - description: 'Project slug in the form vcs-slug/org-name/repo-name', + description: 'Project slug in the form org-name/repo-name', }, { displayName: 'Pipeline Number', name: 'pipelineNumber', type: 'number', + typeOptions: { + minValue: 1, + }, displayOptions: { show: { operation: [ @@ -72,12 +102,39 @@ export const pipelineFields = [ ], }, }, - default: 0, + default: 1, description: 'The number of the pipeline', }, /* -------------------------------------------------------------------------- */ /* pipeline:getAll */ /* -------------------------------------------------------------------------- */ + { + displayName: 'VCS', + name: 'vcs', + type: 'options', + options: [ + { + name: 'Github', + value: 'github', + }, + { + name: 'Bitbucket', + value: 'bitbucket', + }, + ], + displayOptions: { + show: { + operation: [ + 'getAll', + ], + resource: [ + 'pipeline', + ], + }, + }, + default: '', + description: 'Version control system', + }, { displayName: 'Project Slug', name: 'projectSlug', @@ -93,7 +150,7 @@ export const pipelineFields = [ }, }, default: '', - description: 'Project slug in the form vcs-slug/org-name/repo-name', + description: 'Project slug in the form org-name/repo-name', }, { displayName: 'Return All', @@ -165,6 +222,33 @@ export const pipelineFields = [ /* -------------------------------------------------------------------------- */ /* pipeline:trigger */ /* -------------------------------------------------------------------------- */ + { + displayName: 'VCS', + name: 'vcs', + type: 'options', + options: [ + { + name: 'Github', + value: 'github', + }, + { + name: 'Bitbucket', + value: 'bitbucket', + }, + ], + displayOptions: { + show: { + operation: [ + 'trigger', + ], + resource: [ + 'pipeline', + ], + }, + }, + default: '', + description: 'Version control system', + }, { displayName: 'Project Slug', name: 'projectSlug', @@ -180,7 +264,7 @@ export const pipelineFields = [ }, }, default: '', - description: 'Project slug in the form vcs-slug/org-name/repo-name', + description: 'Project slug in the form org-name/repo-name', }, { displayName: 'Additional Fields', From 87b67d66701e1e820e24e08513cd917a44c7f867 Mon Sep 17 00:00:00 2001 From: Rupenieks Date: Tue, 7 Jul 2020 09:35:15 +0200 Subject: [PATCH 162/241] :white_check_mark: Replaced png and added descriptions to all events --- .../nodes/Postmark/PostmarkTrigger.node.ts | 5 +++++ .../nodes-base/nodes/Postmark/postmark.png | Bin 3301 -> 1297 bytes 2 files changed, 5 insertions(+) diff --git a/packages/nodes-base/nodes/Postmark/PostmarkTrigger.node.ts b/packages/nodes-base/nodes/Postmark/PostmarkTrigger.node.ts index f6f09afdd4..9cd8f7b01c 100644 --- a/packages/nodes-base/nodes/Postmark/PostmarkTrigger.node.ts +++ b/packages/nodes-base/nodes/Postmark/PostmarkTrigger.node.ts @@ -62,14 +62,17 @@ export class PostmarkTrigger implements INodeType { { name: 'Click', value: 'click', + description: 'Trigger on click.' }, { name: 'Delivery', value: 'delivery', + description: 'Trigger on delivery.' }, { name: 'Bounce', value: 'bounce', + description: 'Trigger on bounce.' }, { name: 'Bounce Content', @@ -79,6 +82,7 @@ export class PostmarkTrigger implements INodeType { { name: 'Spam Complaint', value: 'spamComplaint', + description: 'Trigger on spam complaint.' }, { name: 'Spam Complaint Content', @@ -88,6 +92,7 @@ export class PostmarkTrigger implements INodeType { { name: 'Subscription Change', value: 'subscriptionChange', + description: 'Trigger on subscription change.' }, ], default: [], diff --git a/packages/nodes-base/nodes/Postmark/postmark.png b/packages/nodes-base/nodes/Postmark/postmark.png index 44f90b2a6c25f66c011e849512dbbbea5f128dfa..6298b4ae94bdbd1b930a5bdd870200fa9f8f157a 100644 GIT binary patch delta 1269 zcmV2c7k>o9NklH0HK@eA>;KxcAA})#x!JQ}wZbd=6&_clvw1|S}LX?VP zYCo(=o3#0Al4&v@@7;S`%rqTaXx==gGnUSOF&~dR^L}&Qx##@veM3Esn@(P{0e_OH z1>GpMpc|zYbfeUQZj@TkYlwi><%<$P6JYrvE(Ena8Xy!MunS^D_jD*dWl}+oHR-F7Mm3 zbno_DTVSD@AZL>0w2}~`rk0DWFn`4o#xHo|Q*Gb@dl z$;F)id52*yrlUwmVDVaX@q9Jg;>dgt|tOlR>5gVHH;%igiEjt>s6`|Wt9QcILU z5FUK#+@rhaVQWb4Bfrge5B3t#GOoI6+mu6GC)nqlZSrk)hJTclqmB#)y)d zFL+;mpWSoMQddQE^;t=U za1B}ntRcPHOsgtX0WvUA@A`0b*YbgVb9as80b8q?#*KhZ1%Ga^uefTOLHM3)4_r1A z4fI7@Hy5_uk>5N}^t=cT$|OtlIzu~$Ed%*CUpbpeSNt>y5qbu`ufAs?4hpzR`(y24 zM%|$mG#jVLbb^AhjxpXwWdO!ht1L|*F-9jC)$!bA2N-gL{sRi9A fwV)fNn-cn8xOMsu?|pBW00000NkvXXu0mjfo}+Cw literal 3301 zcmcInc~lek7LKec0xB+`h%v4RlVq|%0s#vcpcQE>sZ`X+3z=bg6Cf8LxkGryVNcfb4HW$rn% z*Wb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sI_Lh z$CT6`G+wZuIhC2p&-g4_L^ry^eE0E|G>b?(bGFp11m|K zQr^Cy=bE+185F}1MuDLK-3tFG?;khFUf>o>mr_vV_ui*VuZRF-|n^I}eN zk7R$Yut9soBqN%0%&hD1VjJM%&ia8v@|qtX|NhvrGoYel!58XB2AO%wmgG6!KR2|^ zI1yhw?A)`Ana=9xe3M|Njg7Xh7+I?&@3&}g9j@`L5$YZmzN}@i+=CTOk2kQ2=4+C= z+J3mmfB80s#bh6HD|z<)rlxoI5{@11X?d=W>8EUPS-y6=bJN3yC+h?QYR46Aq&aD7 ze4BikvE^P)5oJfJv6bDb+3oY~MvF07A%wCO#2;-}KWk-2*}N$)J#n|=?V>h=?Z^gK ziTvWcO9CH*r4CLhLxma6r=HSR8-DOIC_Ad&8eZG~VCa#9h6cwtee+fqO=fqM#Yg;b z{@doB{Vy^*zk0!_*=wBn+CPm@U$|xDrbDEPHrqxwuXhx*TwGt6M5rw&b&u;pdNA!p zvj_WwHx%4)yP`YTfBpIl+XLl*=KaZozd^W^@G#(_G^gm)aGckd%C>pd`DXt@jt`f9 z+tVAD>ulL#qb+Qzi4%3vY7JH0%Ven>1C@A2YSHVbcQam^UawkXkz@Sy5rnl&H|ZOe wby@5&eYzTx^7f#2SJEY`lBH3`11HoU3?)ewA9`$Vj{S)EuJ`lG_lVf>Z!h~rQvd(} From d74e59801a6e5de7ecd5ec0d2d5c7d14e2bbeed3 Mon Sep 17 00:00:00 2001 From: Rupenieks Date: Tue, 7 Jul 2020 10:48:56 +0200 Subject: [PATCH 163/241] Credentials name to Server API Token --- packages/nodes-base/credentials/PostmarkApi.credentials.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/nodes-base/credentials/PostmarkApi.credentials.ts b/packages/nodes-base/credentials/PostmarkApi.credentials.ts index 88df53aa30..b5f73621c4 100644 --- a/packages/nodes-base/credentials/PostmarkApi.credentials.ts +++ b/packages/nodes-base/credentials/PostmarkApi.credentials.ts @@ -9,7 +9,7 @@ export class PostmarkApi implements ICredentialType { displayName = 'Postmark API'; properties = [ { - displayName: 'Server Token', + displayName: 'Server API Token', name: 'serverToken', type: 'string' as NodePropertyTypes, default: '', From 1b8e75dfadc42e0ca450dfb56ced53860acfc744 Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Tue, 7 Jul 2020 11:10:01 +0200 Subject: [PATCH 164/241] :zap: Minor improvements to CircleCI-Node --- .../nodes/CircleCi/PipelineDescription.ts | 111 +++--------------- 1 file changed, 17 insertions(+), 94 deletions(-) diff --git a/packages/nodes-base/nodes/CircleCi/PipelineDescription.ts b/packages/nodes-base/nodes/CircleCi/PipelineDescription.ts index 4ffd2183d6..beb5e345fe 100644 --- a/packages/nodes-base/nodes/CircleCi/PipelineDescription.ts +++ b/packages/nodes-base/nodes/CircleCi/PipelineDescription.ts @@ -39,26 +39,28 @@ export const pipelineOperations = [ export const pipelineFields = [ /* -------------------------------------------------------------------------- */ -/* pipeline:get */ +/* pipeline:shared */ /* -------------------------------------------------------------------------- */ { - displayName: 'VCS', + displayName: 'Provider', name: 'vcs', type: 'options', options: [ - { - name: 'Github', - value: 'github', - }, { name: 'Bitbucket', value: 'bitbucket', }, + { + name: 'Github', + value: 'github', + }, ], displayOptions: { show: { operation: [ 'get', + 'getAll', + 'trigger', ], resource: [ 'pipeline', @@ -76,6 +78,8 @@ export const pipelineFields = [ show: { operation: [ 'get', + 'getAll', + 'trigger', ], resource: [ 'pipeline', @@ -83,8 +87,13 @@ export const pipelineFields = [ }, }, default: '', + placeholder: 'n8n-io/n8n', description: 'Project slug in the form org-name/repo-name', }, + +/* -------------------------------------------------------------------------- */ +/* pipeline:get */ +/* -------------------------------------------------------------------------- */ { displayName: 'Pipeline Number', name: 'pipelineNumber', @@ -105,53 +114,10 @@ export const pipelineFields = [ default: 1, description: 'The number of the pipeline', }, + /* -------------------------------------------------------------------------- */ /* pipeline:getAll */ /* -------------------------------------------------------------------------- */ - { - displayName: 'VCS', - name: 'vcs', - type: 'options', - options: [ - { - name: 'Github', - value: 'github', - }, - { - name: 'Bitbucket', - value: 'bitbucket', - }, - ], - displayOptions: { - show: { - operation: [ - 'getAll', - ], - resource: [ - 'pipeline', - ], - }, - }, - default: '', - description: 'Version control system', - }, - { - displayName: 'Project Slug', - name: 'projectSlug', - type: 'string', - displayOptions: { - show: { - operation: [ - 'getAll', - ], - resource: [ - 'pipeline', - ], - }, - }, - default: '', - description: 'Project slug in the form org-name/repo-name', - }, { displayName: 'Return All', name: 'returnAll', @@ -219,53 +185,10 @@ export const pipelineFields = [ }, ], }, + /* -------------------------------------------------------------------------- */ /* pipeline:trigger */ /* -------------------------------------------------------------------------- */ - { - displayName: 'VCS', - name: 'vcs', - type: 'options', - options: [ - { - name: 'Github', - value: 'github', - }, - { - name: 'Bitbucket', - value: 'bitbucket', - }, - ], - displayOptions: { - show: { - operation: [ - 'trigger', - ], - resource: [ - 'pipeline', - ], - }, - }, - default: '', - description: 'Version control system', - }, - { - displayName: 'Project Slug', - name: 'projectSlug', - type: 'string', - displayOptions: { - show: { - operation: [ - 'trigger', - ], - resource: [ - 'pipeline', - ], - }, - }, - default: '', - description: 'Project slug in the form org-name/repo-name', - }, { displayName: 'Additional Fields', name: 'additionalFields', From c8cadbc03b670e4d70f5fbde0b21b8d71c9618f6 Mon Sep 17 00:00:00 2001 From: smamudhan <48641776+smamudhan@users.noreply.github.com> Date: Tue, 7 Jul 2020 14:42:23 +0530 Subject: [PATCH 165/241] Updated dropdown descriptions to match documentation (#730) * Updated Dropdown Descriptions to match documentation * Removed full stops and hyphens in field descriptions * Removed hyphen on description on line 267 --- .../nodes/Mattermost/Mattermost.node.ts | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/packages/nodes-base/nodes/Mattermost/Mattermost.node.ts b/packages/nodes-base/nodes/Mattermost/Mattermost.node.ts index 0aa50f3d0e..cc7bc65ee3 100644 --- a/packages/nodes-base/nodes/Mattermost/Mattermost.node.ts +++ b/packages/nodes-base/nodes/Mattermost/Mattermost.node.ts @@ -62,7 +62,7 @@ export class Mattermost implements INodeType { }, ], default: 'message', - description: 'The resource to operate on.', + description: 'The resource to operate on', }, @@ -95,22 +95,22 @@ export class Mattermost implements INodeType { { name: 'Delete', value: 'delete', - description: 'Soft-deletes a channel', + description: 'Soft delete a channel', }, { name: 'Member', value: 'members', - description: 'Get a page of members for a channel.', + description: 'Get a page of members for a channel', }, { name: 'Restore', value: 'restore', - description: 'Restores a soft-deleted channel', + description: 'Restores a soft deleted channel', }, { name: 'Statistics', value: 'statistics', - description: 'Get statistics for a channel.', + description: 'Get statistics for a channel', }, ], default: 'create', @@ -131,7 +131,7 @@ export class Mattermost implements INodeType { { name: 'Delete', value: 'delete', - description: 'Soft deletes a post, by marking the post as deleted in the database.', + description: 'Soft delete a post, by marking the post as deleted in the database', }, { name: 'Post', @@ -140,7 +140,7 @@ export class Mattermost implements INodeType { }, ], default: 'post', - description: 'The operation to perform.', + description: 'The operation to perform', }, @@ -191,7 +191,7 @@ export class Mattermost implements INodeType { }, }, required: true, - description: 'The non-unique UI name for the channel.', + description: 'The non-unique UI name for the channel', }, { displayName: 'Name', @@ -210,7 +210,7 @@ export class Mattermost implements INodeType { }, }, required: true, - description: 'The unique handle for the channel, will be present in the channel URL.', + description: 'The unique handle for the channel, will be present in the channel URL', }, { displayName: 'Type', @@ -264,7 +264,7 @@ export class Mattermost implements INodeType { ], }, }, - description: 'The ID of the channel to soft-delete.', + description: 'The ID of the channel to soft delete', }, // ---------------------------------- From eaa9898de565f07c8ad038446f18fd8a0f7e7f11 Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Tue, 7 Jul 2020 11:15:53 +0200 Subject: [PATCH 166/241] :zap: Fix typo --- packages/nodes-base/nodes/CircleCi/PipelineDescription.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/nodes-base/nodes/CircleCi/PipelineDescription.ts b/packages/nodes-base/nodes/CircleCi/PipelineDescription.ts index beb5e345fe..520fdbcd05 100644 --- a/packages/nodes-base/nodes/CircleCi/PipelineDescription.ts +++ b/packages/nodes-base/nodes/CircleCi/PipelineDescription.ts @@ -51,7 +51,7 @@ export const pipelineFields = [ value: 'bitbucket', }, { - name: 'Github', + name: 'GitHub', value: 'github', }, ], From b1ee1efcb1ff802fbd1c514bc1cab990a866f70f Mon Sep 17 00:00:00 2001 From: smamudhan <48641776+smamudhan@users.noreply.github.com> Date: Tue, 7 Jul 2020 15:01:05 +0530 Subject: [PATCH 167/241] Fixed typographical errors for the GitHub node (#732) * Updated Dropdown Descriptions to match documentation * Removed full stops and hyphens in field descriptions * Removed hyphen on description on line 267 * Fixed typographical errors for Github node --- .../nodes-base/nodes/Github/Github.node.ts | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/packages/nodes-base/nodes/Github/Github.node.ts b/packages/nodes-base/nodes/Github/Github.node.ts index 035b381091..408c0a4360 100644 --- a/packages/nodes-base/nodes/Github/Github.node.ts +++ b/packages/nodes-base/nodes/Github/Github.node.ts @@ -17,14 +17,14 @@ import { export class Github implements INodeType { description: INodeTypeDescription = { - displayName: 'Github', + displayName: 'GitHub', name: 'github', icon: 'file:github.png', group: ['input'], version: 1, - description: 'Retrieve data from Github API.', + description: 'Retrieve data from GitHub API.', defaults: { - name: 'Github', + name: 'GitHub', color: '#665533', }, inputs: ['main'], @@ -178,7 +178,7 @@ export class Github implements INodeType { { name: 'Get', value: 'get', - description: 'Get the data of a single issues', + description: 'Get the data of a single issue', }, ], default: 'create', @@ -220,7 +220,7 @@ export class Github implements INodeType { { name: 'List Popular Paths', value: 'listPopularPaths', - description: 'Get the data of a file in repositoryGet the top 10 popular content paths over the last 14 days.', + description: 'Get the top 10 popular content paths over the last 14 days.', }, { name: 'List Referrers', @@ -458,7 +458,7 @@ export class Github implements INodeType { description: 'The name of the author of the commit.', }, { - displayName: 'EMail', + displayName: 'Email', name: 'email', type: 'string', default: '', @@ -491,7 +491,7 @@ export class Github implements INodeType { description: 'The name of the committer of the commit.', }, { - displayName: 'EMail', + displayName: 'Email', name: 'email', type: 'string', default: '', @@ -1014,28 +1014,28 @@ export class Github implements INodeType { name: 'assignee', type: 'string', default: '', - description: 'Return only issuse which are assigned to a specific user.', + description: 'Return only issues which are assigned to a specific user.', }, { displayName: 'Creator', name: 'creator', type: 'string', default: '', - description: 'Return only issuse which were created by a specific user.', + description: 'Return only issues which were created by a specific user.', }, { displayName: 'Mentioned', name: 'mentioned', type: 'string', default: '', - description: 'Return only issuse in which a specific user was mentioned.', + description: 'Return only issues in which a specific user was mentioned.', }, { displayName: 'Labels', name: 'labels', type: 'string', default: '', - description: 'Return only issuse with the given labels. Multiple lables can be separated by comma.', + description: 'Return only issues with the given labels. Multiple lables can be separated by comma.', }, { displayName: 'Updated Since', From 657d5498d6c2e18cd3de942decdf6504e1a326f1 Mon Sep 17 00:00:00 2001 From: Rupenieks Date: Tue, 7 Jul 2020 11:44:55 +0200 Subject: [PATCH 168/241] :construction: Incorrect event description fixed --- packages/nodes-base/nodes/Postmark/PostmarkTrigger.node.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/nodes-base/nodes/Postmark/PostmarkTrigger.node.ts b/packages/nodes-base/nodes/Postmark/PostmarkTrigger.node.ts index 9cd8f7b01c..ed902a1347 100644 --- a/packages/nodes-base/nodes/Postmark/PostmarkTrigger.node.ts +++ b/packages/nodes-base/nodes/Postmark/PostmarkTrigger.node.ts @@ -87,7 +87,7 @@ export class PostmarkTrigger implements INodeType { { name: 'Spam Complaint Content', value: 'spamComplaintContent', - description: 'Webhook will send full bounce content.' + description: 'Webhook will send full spam complaint content.' }, { name: 'Subscription Change', From e55e8c4fd7f8b0a7f398a07ed8038d925c2a0a4f Mon Sep 17 00:00:00 2001 From: "David G. Simmons" Date: Tue, 7 Jul 2020 09:24:21 -0400 Subject: [PATCH 169/241] Added Node for QuestDB --- .../credentials/Questdb.credentials.ts | 73 ++++ .../nodes-base/nodes/QuestDB/QuestDB.node.ts | 337 ++++++++++++++++++ packages/nodes-base/nodes/QuestDB/questdb.png | Bin 0 -> 11244 bytes 3 files changed, 410 insertions(+) create mode 100644 packages/nodes-base/credentials/Questdb.credentials.ts create mode 100644 packages/nodes-base/nodes/QuestDB/QuestDB.node.ts create mode 100644 packages/nodes-base/nodes/QuestDB/questdb.png diff --git a/packages/nodes-base/credentials/Questdb.credentials.ts b/packages/nodes-base/credentials/Questdb.credentials.ts new file mode 100644 index 0000000000..5cd60f960a --- /dev/null +++ b/packages/nodes-base/credentials/Questdb.credentials.ts @@ -0,0 +1,73 @@ +import { + ICredentialType, + NodePropertyTypes, +} from 'n8n-workflow'; + + +export class QuestDB implements ICredentialType { + name = 'questdb'; + displayName = 'QuestDB'; + properties = [ + { + displayName: 'Host', + name: 'host', + type: 'string' as NodePropertyTypes, + default: 'localhost', + }, + { + displayName: 'Database', + name: 'database', + type: 'string' as NodePropertyTypes, + default: 'qdb', + }, + { + displayName: 'User', + name: 'user', + type: 'string' as NodePropertyTypes, + default: 'admin', + }, + { + displayName: 'Password', + name: 'password', + type: 'string' as NodePropertyTypes, + typeOptions: { + password: true, + }, + default: 'quest', + }, + { + displayName: 'SSL', + name: 'ssl', + type: 'options' as NodePropertyTypes, + options: [ + { + name: 'disable', + value: 'disable', + }, + { + name: 'allow', + value: 'allow', + }, + { + name: 'require', + value: 'require', + }, + { + name: 'verify (not implemented)', + value: 'verify', + }, + { + name: 'verify-full (not implemented)', + value: 'verify-full', + } + ], + default: 'disable', + }, + { + displayName: 'Port', + name: 'port', + type: 'number' as NodePropertyTypes, + default: 8812, + }, + ]; +} diff --git a/packages/nodes-base/nodes/QuestDB/QuestDB.node.ts b/packages/nodes-base/nodes/QuestDB/QuestDB.node.ts new file mode 100644 index 0000000000..8e54e102f7 --- /dev/null +++ b/packages/nodes-base/nodes/QuestDB/QuestDB.node.ts @@ -0,0 +1,337 @@ +import { IExecuteFunctions } from 'n8n-core'; +import { + IDataObject, + INodeExecutionData, + INodeType, + INodeTypeDescription, +} from 'n8n-workflow'; + +import * as pgPromise from 'pg-promise'; + + +/** + * Returns of copy of the items which only contains the json data and + * of that only the define properties + * + * @param {INodeExecutionData[]} items The items to copy + * @param {string[]} properties The properties it should include + * @returns + */ +function getItemCopy(items: INodeExecutionData[], properties: string[]): IDataObject[] { + // Prepare the data to insert and copy it to be returned + let newItem: IDataObject; + return items.map((item) => { + newItem = {}; + for (const property of properties) { + if (item.json[property] === undefined) { + newItem[property] = null; + } else { + newItem[property] = JSON.parse(JSON.stringify(item.json[property])); + } + } + return newItem; + }); +} + + +export class QuestDB implements INodeType { + description: INodeTypeDescription = { + displayName: 'QuestDB', + name: 'questdb', + icon: 'file:questdb.png', + group: ['input'], + version: 1, + description: 'Gets, add and update data in QuestDB.', + defaults: { + name: 'QuestDB', + color: '#336791', + }, + inputs: ['main'], + outputs: ['main'], + credentials: [ + { + name: 'questdb', + required: true, + } + ], + properties: [ + { + displayName: 'Operation', + name: 'operation', + type: 'options', + options: [ + { + name: 'Execute Query', + value: 'executeQuery', + description: 'Executes a SQL query.', + }, + { + name: 'Insert', + value: 'insert', + description: 'Insert rows in database.', + }, + { + name: 'Update', + value: 'update', + description: 'Updates rows in database.', + }, + ], + default: 'insert', + description: 'The operation to perform.', + }, + + // ---------------------------------- + // executeQuery + // ---------------------------------- + { + displayName: 'Query', + name: 'query', + type: 'string', + typeOptions: { + rows: 5, + }, + displayOptions: { + show: { + operation: [ + 'executeQuery' + ], + }, + }, + default: '', + placeholder: 'SELECT id, name FROM product WHERE id < 40', + required: true, + description: 'The SQL query to execute.', + }, + + + // ---------------------------------- + // insert + // ---------------------------------- + { + displayName: 'Schema', + name: 'schema', + type: 'string', + displayOptions: { + show: { + operation: [ + 'insert' + ], + }, + }, + default: 'public', + required: true, + description: 'Name of the schema the table belongs to', + }, + { + displayName: 'Table', + name: 'table', + type: 'string', + displayOptions: { + show: { + operation: [ + 'insert' + ], + }, + }, + default: '', + required: true, + description: 'Name of the table in which to insert data to.', + }, + { + displayName: 'Columns', + name: 'columns', + type: 'string', + displayOptions: { + show: { + operation: [ + 'insert' + ], + }, + }, + default: '', + placeholder: 'id,name,description', + description: 'Comma separated list of the properties which should used as columns for the new rows.', + }, + { + displayName: 'Return Fields', + name: 'returnFields', + type: 'string', + displayOptions: { + show: { + operation: [ + 'insert' + ], + }, + }, + default: '*', + description: 'Comma separated list of the fields that the operation will return', + }, + + + // ---------------------------------- + // update + // ---------------------------------- + { + displayName: 'Table', + name: 'table', + type: 'string', + displayOptions: { + show: { + operation: [ + 'update' + ], + }, + }, + default: '', + required: true, + description: 'Name of the table in which to update data in', + }, + { + displayName: 'Update Key', + name: 'updateKey', + type: 'string', + displayOptions: { + show: { + operation: [ + 'update' + ], + }, + }, + default: 'id', + required: true, + description: 'Name of the property which decides which rows in the database should be updated. Normally that would be "id".', + }, + { + displayName: 'Columns', + name: 'columns', + type: 'string', + displayOptions: { + show: { + operation: [ + 'update' + ], + }, + }, + default: '', + placeholder: 'name,description', + description: 'Comma separated list of the properties which should used as columns for rows to update.', + }, + + ] + }; + + + async execute(this: IExecuteFunctions): Promise { + + const credentials = this.getCredentials('questdb'); + + if (credentials === undefined) { + throw new Error('No credentials got returned!'); + } + + const pgp = pgPromise(); + + const config = { + host: credentials.host as string, + port: credentials.port as number, + database: credentials.database as string, + user: credentials.user as string, + password: credentials.password as string, + ssl: !['disable', undefined].includes(credentials.ssl as string | undefined), + sslmode: credentials.ssl as string || 'disable', + }; + + const db = pgp(config); + + let returnItems = []; + + const items = this.getInputData(); + const operation = this.getNodeParameter('operation', 0) as string; + + if (operation === 'executeQuery') { + // ---------------------------------- + // executeQuery + // ---------------------------------- + + const queries: string[] = []; + for (let i = 0; i < items.length; i++) { + queries.push(this.getNodeParameter('query', i) as string); + } + + const queryResult = await db.any(pgp.helpers.concat(queries)); + + returnItems = this.helpers.returnJsonArray(queryResult as IDataObject[]); + + } else if (operation === 'insert') { + // ---------------------------------- + // insert + // ---------------------------------- + + const table = this.getNodeParameter('table', 0) as string; + const schema = this.getNodeParameter('schema', 0) as string; + let returnFields = (this.getNodeParameter('returnFields', 0) as string).split(',') as string[]; + const columnString = this.getNodeParameter('columns', 0) as string; + const columns = columnString.split(',').map(column => column.trim()); + + const cs = new pgp.helpers.ColumnSet(columns); + + const te = new pgp.helpers.TableName({ table, schema }); + + // Prepare the data to insert and copy it to be returned + const insertItems = getItemCopy(items, columns); + + // Generate the multi-row insert query and return the id of new row + returnFields = returnFields.map(value => value.trim()).filter(value => !!value); + const query = pgp.helpers.insert(insertItems, cs, te) + (returnFields.length ? ` RETURNING ${returnFields.join(',')}` : ''); + + // Executing the query to insert the data + const insertData = await db.manyOrNone(query); + + // Add the id to the data + for (let i = 0; i < insertData.length; i++) { + returnItems.push({ + json: { + ...insertData[i], + ...insertItems[i], + } + }); + } + + } else if (operation === 'update') { + // ---------------------------------- + // update + // ---------------------------------- + + const table = this.getNodeParameter('table', 0) as string; + const updateKey = this.getNodeParameter('updateKey', 0) as string; + const columnString = this.getNodeParameter('columns', 0) as string; + + const columns = columnString.split(',').map(column => column.trim()); + + // Make sure that the updateKey does also get queried + if (!columns.includes(updateKey)) { + columns.unshift(updateKey); + } + + // Prepare the data to update and copy it to be returned + const updateItems = getItemCopy(items, columns); + + // Generate the multi-row update query + const query = pgp.helpers.update(updateItems, columns, table) + ' WHERE v.' + updateKey + ' = t.' + updateKey; + + // Executing the query to update the data + await db.none(query); + + returnItems = this.helpers.returnJsonArray(updateItems as IDataObject[]); + + } else { + await pgp.end(); + throw new Error(`The operation "${operation}" is not supported!`); + } + + // Close the connection + await pgp.end(); + + return this.prepareOutputData(returnItems); + } +} diff --git a/packages/nodes-base/nodes/QuestDB/questdb.png b/packages/nodes-base/nodes/QuestDB/questdb.png new file mode 100644 index 0000000000000000000000000000000000000000..90febff64f5d4facdd03c641e2cb6ffd0d2dd373 GIT binary patch literal 11244 zcmZ{K1yCKqvi8B<-A{0Lcemi~&cWT?B{&3vy9R;>m*DR1?(P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6gF8Td@<&L#R{h6zbKtlf1QrgrdU1^Dn#v|S4ofZn}QlF4|$@ z=c7NmZ@_rQLFPouZZtJIb09v_QY^gk*TW6p*fic-3pJH*NnZr%CS^t=vx^*Q;~WNF z%1R4omy>EVl|62F(jemJ)p!H+0}NdcCE@LHBhu^%OPhU>iP1boTj2$5H=36n=6$%1 zHo>~gT!h#{>Y%RBbRhOEM+thPkPrGF#|2(OGaRxs43t=YaaX&FG80lG9h!WGKUtez zRhaC2xZ7X!KVR6aAt|q|m3hSG5Wf{SIJQyK;tAsw3Uc6@j@HJZw|f+jV>JlPc|y1! z`88cfcaH;jk>?jE8;oRD3+ZS@yhX_2G?FMq4yOwl*y+TW`mjKT6<(gn%e<1&umu*j zf7Vnv=Wt<6Q^{cinHc05i2_m6YMgvd8*MH-%)tZ{oYo+vaJ^Frye7t_Op!SV7=tyI zkTQoRtcsWRJC;3;$R2-!x<#4ImU!0lq#hi5aLv*iBUX|3D2UJV3W5I6A)IE@o5e=1 zT$8)Zk2mz0B34`b#l{zSHx#eAJg)nXzt%)3#HYKyxBG{UCm}tJC}qNhT;MwP7_plw yfw+!>Oosz;-rmVkWDnooyRIiQK1@lkem@Y*#u5z_KK%V3Kt@7Ayh_w4`2PXdVy@T# literal 0 HcmV?d00001 From de707f039b3b1273d6ce3e16927cbb2d0dc26a52 Mon Sep 17 00:00:00 2001 From: Ben Hesseldieck Date: Tue, 7 Jul 2020 18:31:38 +0200 Subject: [PATCH 170/241] :tada: executeQuery function extracted --- .../nodes/Postgres/Postgres.node.functions.ts | 48 ++++++ .../nodes/Postgres/Postgres.node.ts | 147 +++++++++--------- 2 files changed, 120 insertions(+), 75 deletions(-) create mode 100644 packages/nodes-base/nodes/Postgres/Postgres.node.functions.ts diff --git a/packages/nodes-base/nodes/Postgres/Postgres.node.functions.ts b/packages/nodes-base/nodes/Postgres/Postgres.node.functions.ts new file mode 100644 index 0000000000..b9aae05372 --- /dev/null +++ b/packages/nodes-base/nodes/Postgres/Postgres.node.functions.ts @@ -0,0 +1,48 @@ +import { IDataObject, INodeExecutionData } from 'n8n-workflow'; +import pgPromise = require('pg-promise'); +import pg = require('pg-promise/typescript/pg-subset'); + +/** + * Executes the given SQL query on the database. + * + * @param {Function} getNodeParam The getter of the Node + * @param {pgPromise.IMain<{}, pg.IClient>} pgp The pgPromise instance + * @param {pgPromise.IDatabase<{}, pg.IClient>} db The pgPromise database connection + * @param {input[]} input The Node's input data + * @returns Promise + */ +export function executeQuery( + getNodeParam: Function, + pgp: pgPromise.IMain<{}, pg.IClient>, + db: pgPromise.IDatabase<{}, pg.IClient>, + input: INodeExecutionData[] +): Promise { + const queries: string[] = []; + for (let i = 0; i < input.length; i++) { + queries.push(getNodeParam('query', i) as string); + } + + return db.any(pgp.helpers.concat(queries)); +} + +// /** +// * Returns of copy of the items which only contains the json data and +// * of that only the define properties +// * +// * @param {items[]} items The items execute the query with +// * @param {string[]} properties The properties it should include +// * @returns +// */ +// export function insert( +// getNodeParam: Function, +// pgp: pgPromise.IMain<{}, pg.IClient>, +// db: pgPromise.IDatabase<{}, pg.IClient>, +// items: INodeExecutionData[] +// ): Promise { +// const queries: string[] = []; +// for (let i = 0; i < items.length; i++) { +// queries.push(getNodeParam('query', i) as string); +// } + +// return db.any(pgp.helpers.concat(queries)); +// } diff --git a/packages/nodes-base/nodes/Postgres/Postgres.node.ts b/packages/nodes-base/nodes/Postgres/Postgres.node.ts index 2fa010576b..2e40dc8290 100644 --- a/packages/nodes-base/nodes/Postgres/Postgres.node.ts +++ b/packages/nodes-base/nodes/Postgres/Postgres.node.ts @@ -3,11 +3,12 @@ import { IDataObject, INodeExecutionData, INodeType, - INodeTypeDescription, + INodeTypeDescription } from 'n8n-workflow'; import * as pgPromise from 'pg-promise'; +import { executeQuery } from './Postgres.node.functions'; /** * Returns of copy of the items which only contains the json data and @@ -17,10 +18,13 @@ import * as pgPromise from 'pg-promise'; * @param {string[]} properties The properties it should include * @returns */ -function getItemCopy(items: INodeExecutionData[], properties: string[]): IDataObject[] { +function getItemCopy( + items: INodeExecutionData[], + properties: string[] +): IDataObject[] { // Prepare the data to insert and copy it to be returned let newItem: IDataObject; - return items.map((item) => { + return items.map(item => { newItem = {}; for (const property of properties) { if (item.json[property] === undefined) { @@ -33,7 +37,6 @@ function getItemCopy(items: INodeExecutionData[], properties: string[]): IDataOb }); } - export class Postgres implements INodeType { description: INodeTypeDescription = { displayName: 'Postgres', @@ -44,14 +47,14 @@ export class Postgres implements INodeType { description: 'Gets, add and update data in Postgres.', defaults: { name: 'Postgres', - color: '#336791', + color: '#336791' }, inputs: ['main'], outputs: ['main'], credentials: [ { name: 'postgres', - required: true, + required: true } ], properties: [ @@ -63,21 +66,21 @@ export class Postgres implements INodeType { { name: 'Execute Query', value: 'executeQuery', - description: 'Executes a SQL query.', + description: 'Executes a SQL query.' }, { name: 'Insert', value: 'insert', - description: 'Insert rows in database.', + description: 'Insert rows in database.' }, { name: 'Update', value: 'update', - description: 'Updates rows in database.', - }, + description: 'Updates rows in database.' + } ], default: 'insert', - description: 'The operation to perform.', + description: 'The operation to perform.' }, // ---------------------------------- @@ -88,22 +91,19 @@ export class Postgres implements INodeType { name: 'query', type: 'string', typeOptions: { - rows: 5, + rows: 5 }, displayOptions: { show: { - operation: [ - 'executeQuery' - ], - }, + operation: ['executeQuery'] + } }, default: '', placeholder: 'SELECT id, name FROM product WHERE id < 40', required: true, - description: 'The SQL query to execute.', + description: 'The SQL query to execute.' }, - // ---------------------------------- // insert // ---------------------------------- @@ -113,14 +113,12 @@ export class Postgres implements INodeType { type: 'string', displayOptions: { show: { - operation: [ - 'insert' - ], - }, + operation: ['insert'] + } }, default: 'public', required: true, - description: 'Name of the schema the table belongs to', + description: 'Name of the schema the table belongs to' }, { displayName: 'Table', @@ -128,14 +126,12 @@ export class Postgres implements INodeType { type: 'string', displayOptions: { show: { - operation: [ - 'insert' - ], - }, + operation: ['insert'] + } }, default: '', required: true, - description: 'Name of the table in which to insert data to.', + description: 'Name of the table in which to insert data to.' }, { displayName: 'Columns', @@ -143,14 +139,13 @@ export class Postgres implements INodeType { type: 'string', displayOptions: { show: { - operation: [ - 'insert' - ], - }, + operation: ['insert'] + } }, default: '', placeholder: 'id,name,description', - description: 'Comma separated list of the properties which should used as columns for the new rows.', + description: + 'Comma separated list of the properties which should used as columns for the new rows.' }, { displayName: 'Return Fields', @@ -158,16 +153,14 @@ export class Postgres implements INodeType { type: 'string', displayOptions: { show: { - operation: [ - 'insert' - ], - }, + operation: ['insert'] + } }, default: '*', - description: 'Comma separated list of the fields that the operation will return', + description: + 'Comma separated list of the fields that the operation will return' }, - // ---------------------------------- // update // ---------------------------------- @@ -177,14 +170,12 @@ export class Postgres implements INodeType { type: 'string', displayOptions: { show: { - operation: [ - 'update' - ], - }, + operation: ['update'] + } }, default: '', required: true, - description: 'Name of the table in which to update data in', + description: 'Name of the table in which to update data in' }, { displayName: 'Update Key', @@ -192,14 +183,13 @@ export class Postgres implements INodeType { type: 'string', displayOptions: { show: { - operation: [ - 'update' - ], - }, + operation: ['update'] + } }, default: 'id', required: true, - description: 'Name of the property which decides which rows in the database should be updated. Normally that would be "id".', + description: + 'Name of the property which decides which rows in the database should be updated. Normally that would be "id".' }, { displayName: 'Columns', @@ -207,22 +197,18 @@ export class Postgres implements INodeType { type: 'string', displayOptions: { show: { - operation: [ - 'update' - ], - }, + operation: ['update'] + } }, default: '', placeholder: 'name,description', - description: 'Comma separated list of the properties which should used as columns for rows to update.', - }, - + description: + 'Comma separated list of the properties which should used as columns for rows to update.' + } ] }; - async execute(this: IExecuteFunctions): Promise { - const credentials = this.getCredentials('postgres'); if (credentials === undefined) { @@ -237,8 +223,10 @@ export class Postgres implements INodeType { database: credentials.database as string, user: credentials.user as string, password: credentials.password as string, - ssl: !['disable', undefined].includes(credentials.ssl as string | undefined), - sslmode: credentials.ssl as string || 'disable', + ssl: !['disable', undefined].includes( + credentials.ssl as string | undefined + ), + sslmode: (credentials.ssl as string) || 'disable' }; const db = pgp(config); @@ -253,15 +241,14 @@ export class Postgres implements INodeType { // executeQuery // ---------------------------------- - const queries: string[] = []; - for (let i = 0; i < items.length; i++) { - queries.push(this.getNodeParameter('query', i) as string); - } - - const queryResult = await db.any(pgp.helpers.concat(queries)); + const queryResult = await executeQuery( + this.getNodeParameter, + pgp, + db, + items + ); returnItems = this.helpers.returnJsonArray(queryResult as IDataObject[]); - } else if (operation === 'insert') { // ---------------------------------- // insert @@ -269,7 +256,10 @@ export class Postgres implements INodeType { const table = this.getNodeParameter('table', 0) as string; const schema = this.getNodeParameter('schema', 0) as string; - let returnFields = (this.getNodeParameter('returnFields', 0) as string).split(',') as string[]; + let returnFields = (this.getNodeParameter( + 'returnFields', + 0 + ) as string).split(',') as string[]; const columnString = this.getNodeParameter('columns', 0) as string; const columns = columnString.split(',').map(column => column.trim()); @@ -281,8 +271,12 @@ export class Postgres implements INodeType { const insertItems = getItemCopy(items, columns); // Generate the multi-row insert query and return the id of new row - returnFields = returnFields.map(value => value.trim()).filter(value => !!value); - const query = pgp.helpers.insert(insertItems, cs, te) + (returnFields.length ? ` RETURNING ${returnFields.join(',')}` : ''); + returnFields = returnFields + .map(value => value.trim()) + .filter(value => !!value); + const query = + pgp.helpers.insert(insertItems, cs, te) + + (returnFields.length ? ` RETURNING ${returnFields.join(',')}` : ''); // Executing the query to insert the data const insertData = await db.manyOrNone(query); @@ -292,11 +286,10 @@ export class Postgres implements INodeType { returnItems.push({ json: { ...insertData[i], - ...insertItems[i], + ...insertItems[i] } }); } - } else if (operation === 'update') { // ---------------------------------- // update @@ -317,13 +310,17 @@ export class Postgres implements INodeType { const updateItems = getItemCopy(items, columns); // Generate the multi-row update query - const query = pgp.helpers.update(updateItems, columns, table) + ' WHERE v.' + updateKey + ' = t.' + updateKey; + const query = + pgp.helpers.update(updateItems, columns, table) + + ' WHERE v.' + + updateKey + + ' = t.' + + updateKey; // Executing the query to update the data await db.none(query); - returnItems = this.helpers.returnJsonArray(updateItems as IDataObject[]); - + returnItems = this.helpers.returnJsonArray(updateItems as IDataObject[]); } else { await pgp.end(); throw new Error(`The operation "${operation}" is not supported!`); From 8aff042e04b6e5ee16e26eb5a77349edd629d2d4 Mon Sep 17 00:00:00 2001 From: Ricardo Espinoza Date: Tue, 7 Jul 2020 13:03:53 -0400 Subject: [PATCH 171/241] * :sparkles: Endpoint to preset credentials * :sparkles: Endpoint to preset credentials * :zap: Improvements * :bug: Small fix * :bug: Small fix --- packages/cli/config/index.ts | 26 +++++++++----- packages/cli/src/CredentialsOverwrites.ts | 3 +- packages/cli/src/Server.ts | 43 +++++++++++++++++++++++ 3 files changed, 62 insertions(+), 10 deletions(-) diff --git a/packages/cli/config/index.ts b/packages/cli/config/index.ts index a3c2cfd03a..847587460f 100644 --- a/packages/cli/config/index.ts +++ b/packages/cli/config/index.ts @@ -128,15 +128,23 @@ const config = convict({ credentials: { overwrite: { - // Allows to set default values for credentials which - // get automatically prefilled and the user does not get - // displayed and can not change. - // Format: { CREDENTIAL_NAME: { PARAMTER: VALUE }} - doc: 'Overwrites for credentials', - format: '*', - default: '{}', - env: 'CREDENTIALS_OVERWRITE' - } + data: { + // Allows to set default values for credentials which + // get automatically prefilled and the user does not get + // displayed and can not change. + // Format: { CREDENTIAL_NAME: { PARAMTER: VALUE }} + doc: 'Overwrites for credentials', + format: '*', + default: '{}', + env: 'CREDENTIALS_OVERWRITE_DATA' + }, + endpoint: { + doc: 'Fetch credentials from API', + format: String, + default: '', + env: 'CREDENTIALS_OVERWRITE_ENDPOINT', + }, + }, }, executions: { diff --git a/packages/cli/src/CredentialsOverwrites.ts b/packages/cli/src/CredentialsOverwrites.ts index a6e115100e..ca09b87626 100644 --- a/packages/cli/src/CredentialsOverwrites.ts +++ b/packages/cli/src/CredentialsOverwrites.ts @@ -20,7 +20,7 @@ class CredentialsOverwritesClass { return; } - const data = await GenericHelpers.getConfigValue('credentials.overwrite') as string; + const data = await GenericHelpers.getConfigValue('credentials.overwrite.data') as string; try { this.overwriteData = JSON.parse(data); @@ -30,6 +30,7 @@ class CredentialsOverwritesClass { } applyOverwrite(type: string, data: ICredentialDataDecryptedObject) { + const overwrites = this.get(type); if (overwrites === undefined) { diff --git a/packages/cli/src/Server.ts b/packages/cli/src/Server.ts index 1b3750a20c..2507b6b136 100644 --- a/packages/cli/src/Server.ts +++ b/packages/cli/src/Server.ts @@ -58,6 +58,9 @@ import { WorkflowExecuteAdditionalData, WorkflowRunner, GenericHelpers, + CredentialsOverwrites, + ICredentialsOverwrite, + LoadNodesAndCredentials, } from './'; import { @@ -105,6 +108,7 @@ class App { testWebhooks: TestWebhooks.TestWebhooks; endpointWebhook: string; endpointWebhookTest: string; + endpointPresetCredentials: string; externalHooks: IExternalHooksClass; saveDataErrorExecution: string; saveDataSuccessExecution: string; @@ -119,6 +123,8 @@ class App { sslKey: string; sslCert: string; + presetCredentialsLoaded: boolean; + constructor() { this.app = express(); @@ -141,6 +147,9 @@ class App { this.sslCert = config.get('ssl_cert'); this.externalHooks = ExternalHooks(); + + this.presetCredentialsLoaded = false; + this.endpointPresetCredentials = config.get('credentials.overwrite.endpoint') as string; } @@ -1650,6 +1659,40 @@ class App { }); + if (this.endpointPresetCredentials !== '') { + + // POST endpoint to set preset credentials + this.app.post(`/${this.endpointPresetCredentials}`, async (req: express.Request, res: express.Response) => { + + if (this.presetCredentialsLoaded === false) { + + const body = req.body as ICredentialsOverwrite; + + if (req.headers['content-type'] !== 'application/json') { + ResponseHelper.sendErrorResponse(res, new Error('Body must be a valid JSON, make sure the content-type is application/json')); + return; + } + + const loadNodesAndCredentials = LoadNodesAndCredentials(); + + const credentialsOverwrites = CredentialsOverwrites(); + + await credentialsOverwrites.init(body); + + const credentialTypes = CredentialTypes(); + + await credentialTypes.init(loadNodesAndCredentials.credentialTypes); + + this.presetCredentialsLoaded = true; + + ResponseHelper.sendSuccessResponse(res, { success: true }, true, 200); + + } else { + ResponseHelper.sendErrorResponse(res, new Error('Preset credentials can be set once')); + } + }); + } + // Serve the website const startTime = (new Date()).toUTCString(); const editorUiPath = require.resolve('n8n-editor-ui'); From 97c8af661c6616a999cbfd58f6df00497c6e0dba Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Tue, 7 Jul 2020 20:35:58 +0200 Subject: [PATCH 172/241] :zap: Small improvement on PostmarkTrigger-Node --- .../nodes/Postmark/GenericFunctions.ts | 8 +- .../nodes/Postmark/PostmarkTrigger.node.ts | 83 +++++++++++-------- 2 files changed, 52 insertions(+), 39 deletions(-) diff --git a/packages/nodes-base/nodes/Postmark/GenericFunctions.ts b/packages/nodes-base/nodes/Postmark/GenericFunctions.ts index 115fac51f0..df1e3a1f09 100644 --- a/packages/nodes-base/nodes/Postmark/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Postmark/GenericFunctions.ts @@ -66,13 +66,15 @@ export function convertTriggerObjectToStringArray (webhookObject : any) : string webhookEvents.push('bounce'); } if (triggers.Bounce.IncludeContent) { - webhookEvents.push('bounceContent'); + webhookEvents.push('includeContent'); } if (triggers.SpamComplaint.Enabled) { webhookEvents.push('spamComplaint'); } if (triggers.SpamComplaint.IncludeContent) { - webhookEvents.push('spamComplaintContent'); + if (!webhookEvents.includes('IncludeContent')) { + webhookEvents.push('includeContent'); + } } if (triggers.SubscriptionChange.Enabled) { webhookEvents.push('subscriptionChange'); @@ -89,5 +91,3 @@ export function eventExists (currentEvents : string[], webhookEvents: string[]) } return true; } - - diff --git a/packages/nodes-base/nodes/Postmark/PostmarkTrigger.node.ts b/packages/nodes-base/nodes/Postmark/PostmarkTrigger.node.ts index ed902a1347..4956d647b7 100644 --- a/packages/nodes-base/nodes/Postmark/PostmarkTrigger.node.ts +++ b/packages/nodes-base/nodes/Postmark/PostmarkTrigger.node.ts @@ -50,55 +50,69 @@ export class PostmarkTrigger implements INodeType { type: 'multiOptions', options: [ { - name: 'Open', - value: 'open', - description: 'Trigger webhook on open.' - }, - { - name: 'First Open', - value: 'firstOpen', - description: 'Trigger on first open only.' + name: 'Bounce', + value: 'bounce', + description: 'Trigger on bounce.', }, { name: 'Click', value: 'click', - description: 'Trigger on click.' + description: 'Trigger on click.', }, { name: 'Delivery', value: 'delivery', - description: 'Trigger on delivery.' + description: 'Trigger on delivery.', }, { - name: 'Bounce', - value: 'bounce', - description: 'Trigger on bounce.' - }, - { - name: 'Bounce Content', - value: 'bounceContent', - description: 'Webhook will send full bounce content.' + name: 'Open', + value: 'open', + description: 'Trigger webhook on open.', }, { name: 'Spam Complaint', value: 'spamComplaint', - description: 'Trigger on spam complaint.' - }, - { - name: 'Spam Complaint Content', - value: 'spamComplaintContent', - description: 'Webhook will send full spam complaint content.' + description: 'Trigger on spam complaint.', }, { name: 'Subscription Change', value: 'subscriptionChange', - description: 'Trigger on subscription change.' + description: 'Trigger on subscription change.', }, ], default: [], required: true, description: 'Webhook events that will be enabled for that endpoint.', }, + { + displayName: 'First Open', + name: 'firstOpen', + description: 'Only fires on first open for event "Open".', + type: 'boolean', + default: false, + displayOptions: { + show: { + events: [ + 'open', + ], + }, + }, + }, + { + displayName: 'Include Content', + name: 'includeContent', + description: 'Includes message content for events "Bounce" and "Spam Complaint".', + type: 'boolean', + default: false, + displayOptions: { + show: { + events: [ + 'bounce', + 'spamComplaint', + ], + }, + }, + }, ], }; @@ -110,6 +124,12 @@ export class PostmarkTrigger implements INodeType { const webhookData = this.getWorkflowStaticData('node'); const webhookUrl = this.getNodeWebhookUrl('default'); const events = this.getNodeParameter('events') as string[]; + if (this.getNodeParameter('includeContent') as boolean) { + events.push('includeContent'); + } + if (this.getNodeParameter('firstOpen') as boolean) { + events.push('firstOpen'); + } // Get all webhooks const endpoint = `/webhooks`; @@ -169,10 +189,7 @@ export class PostmarkTrigger implements INodeType { if (events.includes('open')) { body.Triggers.Open.Enabled = true; - } - if (events.includes('firstOpen')) { - body.Triggers.Open.Enabled = true; - body.Triggers.Open.PostFirstOpenOnly = true; + body.Triggers.Open.PostFirstOpenOnly = this.getNodeParameter('firstOpen') as boolean; } if (events.includes('click')) { body.Triggers.Click.Enabled = true; @@ -182,15 +199,11 @@ export class PostmarkTrigger implements INodeType { } if (events.includes('bounce')) { body.Triggers.Bounce.Enabled = true; - } - if (events.includes('bounceContent')) { - body.Triggers.Bounce.IncludeContent = true; + body.Triggers.Bounce.IncludeContent = this.getNodeParameter('includeContent') as boolean; } if (events.includes('spamComplaint')) { body.Triggers.SpamComplaint.Enabled = true; - } - if (events.includes('spamComplaintContent')) { - body.Triggers.SpamComplaint.IncludeContent = true; + body.Triggers.SpamComplaint.IncludeContent = this.getNodeParameter('includeContent') as boolean; } if (events.includes('subscriptionChange')) { body.Triggers.SubscriptionChange.Enabled = true; From 80aa0bd5ddfd0d15b8f5d66acfb1da9a7b9b4d31 Mon Sep 17 00:00:00 2001 From: Ben Hesseldieck Date: Wed, 8 Jul 2020 09:32:21 +0200 Subject: [PATCH 173/241] :construction: add prettierrc to gitignore --- .gitignore | 1 + packages/nodes-base/nodes/Postgres/Postgres.node.functions.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index b3eac39207..0441d445b4 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,4 @@ _START_PACKAGE .env .vscode .idea +.prettierrc.js diff --git a/packages/nodes-base/nodes/Postgres/Postgres.node.functions.ts b/packages/nodes-base/nodes/Postgres/Postgres.node.functions.ts index b9aae05372..a6d986643d 100644 --- a/packages/nodes-base/nodes/Postgres/Postgres.node.functions.ts +++ b/packages/nodes-base/nodes/Postgres/Postgres.node.functions.ts @@ -15,7 +15,7 @@ export function executeQuery( getNodeParam: Function, pgp: pgPromise.IMain<{}, pg.IClient>, db: pgPromise.IDatabase<{}, pg.IClient>, - input: INodeExecutionData[] + input: INodeExecutionData[], ): Promise { const queries: string[] = []; for (let i = 0; i < input.length; i++) { From 224842c790fd0f976d8d50adef871ef2e5c4fe83 Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Wed, 8 Jul 2020 09:40:47 +0200 Subject: [PATCH 174/241] :zap: Get rid of mmmagic for mime-type detection --- packages/core/package.json | 5 +-- packages/core/src/NodeExecuteFunctions.ts | 39 +++++++++++++---------- 2 files changed, 25 insertions(+), 19 deletions(-) diff --git a/packages/core/package.json b/packages/core/package.json index 7a4b0c7349..ac55db99c9 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -30,7 +30,7 @@ "@types/express": "^4.16.1", "@types/jest": "^24.0.18", "@types/lodash.get": "^4.4.6", - "@types/mmmagic": "^0.4.29", + "@types/mime-types": "^2.1.0", "@types/node": "^10.10.1", "@types/request-promise-native": "^1.0.15", "jest": "^24.9.0", @@ -43,8 +43,9 @@ "client-oauth2": "^4.2.5", "cron": "^1.7.2", "crypto-js": "3.1.9-1", + "file-type": "^14.6.2", "lodash.get": "^4.4.2", - "mmmagic": "^0.5.2", + "mime-types": "^2.1.27", "n8n-workflow": "~0.33.0", "p-cancelable": "^2.0.0", "request": "^2.88.2", diff --git a/packages/core/src/NodeExecuteFunctions.ts b/packages/core/src/NodeExecuteFunctions.ts index d500d56f88..5efbe32914 100644 --- a/packages/core/src/NodeExecuteFunctions.ts +++ b/packages/core/src/NodeExecuteFunctions.ts @@ -44,14 +44,9 @@ import * as express from 'express'; import * as path from 'path'; import { OptionsWithUrl, OptionsWithUri } from 'request'; import * as requestPromise from 'request-promise-native'; - -import { Magic, MAGIC_MIME_TYPE } from 'mmmagic'; - import { createHmac } from 'crypto'; - - -const magic = new Magic(MAGIC_MIME_TYPE); - +import { fromBuffer } from 'file-type'; +import { lookup } from 'mime-types'; /** @@ -66,18 +61,28 @@ const magic = new Magic(MAGIC_MIME_TYPE); */ export async function prepareBinaryData(binaryData: Buffer, filePath?: string, mimeType?: string): Promise { if (!mimeType) { - // If not mime type is given figure it out - mimeType = await new Promise( - (resolve, reject) => { - magic.detect(binaryData, (err: Error, mimeType: string) => { - if (err) { - return reject(err); - } + // If no mime type is given figure it out - return resolve(mimeType); - }); + if (filePath) { + // Use file path to guess mime type + const mimeTypeLookup = lookup(filePath); + if (mimeTypeLookup) { + mimeType = mimeTypeLookup; } - ); + } + + if (!mimeType) { + // Use buffer to guess mime type + const fileTypeData = await fromBuffer(binaryData); + if (fileTypeData) { + mimeType = fileTypeData.mime; + } + } + + if (!mimeType) { + // Fall back to text + mimeType = 'text/plain'; + } } const returnData: IBinaryData = { From b1035d539dd41ff748f176b77217fc3e0c955ddb Mon Sep 17 00:00:00 2001 From: Ben Hesseldieck <1849459+BHesseldieck@users.noreply.github.com> Date: Wed, 8 Jul 2020 10:00:13 +0200 Subject: [PATCH 175/241] :sparkles: MSSQL Node Integration (#729) * basic setup mssql node * executeQuery for MSSQL working * work on insert MSSQL, incomplete * :construction: basic setup update functionality * :hammer: refactor insert for handling >1000 values * :sparkles: complete MSSQL node * :sparkles: add delete action to node * :construction: handling multiple tables and column sets * :bug: enabling usage of expression for every field * :hammer: remove lodash dependency * :sparkles: enable continue on fail option * :racehorse: minify icon * :hammer: improve table creation, item copying, :bug: correct output of node when active continue on fail * :bug: move mssql types to dev dependencies * :art: remove auto formatting from redis * :art: apply corrected syntax format * :rewind: reset Redis node to master stage * :bug: fix building issue --- .../MicrosoftSqlServer.credentials.ts | 47 ++ .../Microsoft/SqlServer/GenericFunctions.ts | 144 ++++++ .../SqlServer/MicrosoftSqlServer.node.ts | 410 ++++++++++++++++++ .../Microsoft/SqlServer/TableInterface.ts | 7 + .../nodes/Microsoft/SqlServer/mssql.png | Bin 0 -> 3447 bytes packages/nodes-base/nodes/utils/utilities.ts | 57 +++ packages/nodes-base/package.json | 6 +- 7 files changed, 670 insertions(+), 1 deletion(-) create mode 100644 packages/nodes-base/credentials/MicrosoftSqlServer.credentials.ts create mode 100644 packages/nodes-base/nodes/Microsoft/SqlServer/GenericFunctions.ts create mode 100644 packages/nodes-base/nodes/Microsoft/SqlServer/MicrosoftSqlServer.node.ts create mode 100644 packages/nodes-base/nodes/Microsoft/SqlServer/TableInterface.ts create mode 100644 packages/nodes-base/nodes/Microsoft/SqlServer/mssql.png create mode 100644 packages/nodes-base/nodes/utils/utilities.ts diff --git a/packages/nodes-base/credentials/MicrosoftSqlServer.credentials.ts b/packages/nodes-base/credentials/MicrosoftSqlServer.credentials.ts new file mode 100644 index 0000000000..b0a14de771 --- /dev/null +++ b/packages/nodes-base/credentials/MicrosoftSqlServer.credentials.ts @@ -0,0 +1,47 @@ +import { ICredentialType, NodePropertyTypes } from 'n8n-workflow'; + +export class MicrosoftSqlServer implements ICredentialType { + name = 'microsoftSqlServer'; + displayName = 'Microsoft SQL Server'; + properties = [ + { + displayName: 'Server', + name: 'server', + type: 'string' as NodePropertyTypes, + default: 'localhost' + }, + { + displayName: 'Database', + name: 'database', + type: 'string' as NodePropertyTypes, + default: 'master' + }, + { + displayName: 'User', + name: 'user', + type: 'string' as NodePropertyTypes, + default: 'sa' + }, + { + displayName: 'Password', + name: 'password', + type: 'string' as NodePropertyTypes, + typeOptions: { + password: true + }, + default: '' + }, + { + displayName: 'Port', + name: 'port', + type: 'number' as NodePropertyTypes, + default: 1433 + }, + { + displayName: 'Domain', + name: 'domain', + type: 'string' as NodePropertyTypes, + default: '' + } + ]; +} diff --git a/packages/nodes-base/nodes/Microsoft/SqlServer/GenericFunctions.ts b/packages/nodes-base/nodes/Microsoft/SqlServer/GenericFunctions.ts new file mode 100644 index 0000000000..8309b35db0 --- /dev/null +++ b/packages/nodes-base/nodes/Microsoft/SqlServer/GenericFunctions.ts @@ -0,0 +1,144 @@ +import { IDataObject, INodeExecutionData } from 'n8n-workflow'; +import { ITables } from './TableInterface'; + +/** + * Returns a copy of the item which only contains the json data and + * of that only the defined properties + * + * @param {INodeExecutionData} item The item to copy + * @param {string[]} properties The properties it should include + * @returns + */ +export function copyInputItem( + item: INodeExecutionData, + properties: string[], +): IDataObject { + // Prepare the data to insert and copy it to be returned + let newItem: IDataObject = {}; + for (const property of properties) { + if (item.json[property] === undefined) { + newItem[property] = null; + } else { + newItem[property] = JSON.parse(JSON.stringify(item.json[property])); + } + } + return newItem; +} + +/** + * Creates an ITables with the columns for the operations + * + * @param {INodeExecutionData[]} items The items to extract the tables/columns for + * @param {function} getNodeParam getter for the Node's Parameters + * @returns {ITables} {tableName: {colNames: [items]}}; + */ +export function createTableStruct( + getNodeParam: Function, + items: INodeExecutionData[], + additionalProperties: string[] = [], + keyName?: string, +): ITables { + return items.reduce((tables, item, index) => { + const table = getNodeParam('table', index) as string; + const columnString = getNodeParam('columns', index) as string; + const columns = columnString.split(',').map(column => column.trim()); + const itemCopy = copyInputItem(item, columns.concat(additionalProperties)); + const keyParam = keyName + ? (getNodeParam(keyName, index) as string) + : undefined; + if (tables[table] === undefined) { + tables[table] = {}; + } + if (tables[table][columnString] === undefined) { + tables[table][columnString] = []; + } + if (keyName) { + itemCopy[keyName] = keyParam; + } + tables[table][columnString].push(itemCopy); + return tables; + }, {} as ITables); +} + +/** + * Executes a queue of queries on given ITables. + * + * @param {ITables} tables The ITables to be processed. + * @param {function} buildQueryQueue function that builds the queue of promises + * @returns {Promise} + */ +export function executeQueryQueue( + tables: ITables, + buildQueryQueue: Function, +): Promise { + return Promise.all( + Object.keys(tables).map(table => { + const columnsResults = Object.keys(tables[table]).map(columnString => { + return Promise.all( + buildQueryQueue({ + table: table, + columnString: columnString, + items: tables[table][columnString], + }), + ); + }); + return Promise.all(columnsResults); + }), + ); +} + +/** + * Extracts the values from the item for INSERT + * + * @param {IDataObject} item The item to extract + * @returns {string} (Val1, Val2, ...) + */ +export function extractValues(item: IDataObject): string { + return `(${Object.values(item as any) + .map(val => (typeof val === 'string' ? `'${val}'` : val)) // maybe other types such as dates have to be handled as well + .join(',')})`; +} + +/** + * Extracts the SET from the item for UPDATE + * + * @param {IDataObject} item The item to extract from + * @param {string[]} columns The columns to update + * @returns {string} col1 = val1, col2 = val2 + */ +export function extractUpdateSet(item: IDataObject, columns: string[]): string { + return columns + .map( + column => + `${column} = ${ + typeof item[column] === 'string' ? `'${item[column]}'` : item[column] + }`, + ) + .join(','); +} + +/** + * Extracts the WHERE condition from the item for UPDATE + * + * @param {IDataObject} item The item to extract from + * @param {string} key The column name to build the condition with + * @returns {string} id = '123' + */ +export function extractUpdateCondition(item: IDataObject, key: string): string { + return `${key} = ${ + typeof item[key] === 'string' ? `'${item[key]}'` : item[key] + }`; +} + +/** + * Extracts the WHERE condition from the items for DELETE + * + * @param {IDataObject[]} items The items to extract the values from + * @param {string} key The column name to extract the value from for the delete condition + * @returns {string} (Val1, Val2, ...) + */ +export function extractDeleteValues(items: IDataObject[], key: string): string { + return `(${items + .map(item => (typeof item[key] === 'string' ? `'${item[key]}'` : item[key])) + .join(',')})`; +} diff --git a/packages/nodes-base/nodes/Microsoft/SqlServer/MicrosoftSqlServer.node.ts b/packages/nodes-base/nodes/Microsoft/SqlServer/MicrosoftSqlServer.node.ts new file mode 100644 index 0000000000..b24d93b0f5 --- /dev/null +++ b/packages/nodes-base/nodes/Microsoft/SqlServer/MicrosoftSqlServer.node.ts @@ -0,0 +1,410 @@ +import { IExecuteFunctions } from 'n8n-core'; +import { + IDataObject, + INodeExecutionData, + INodeType, + INodeTypeDescription, +} from 'n8n-workflow'; + +import { chunk, flatten } from '../../utils/utilities'; + +import * as mssql from 'mssql'; + +import { ITables } from './TableInterface'; + +import { + copyInputItem, + createTableStruct, + executeQueryQueue, + extractDeleteValues, + extractUpdateCondition, + extractUpdateSet, + extractValues, +} from './GenericFunctions'; + +export class MicrosoftSqlServer implements INodeType { + description: INodeTypeDescription = { + displayName: 'Microsoft SQL Server', + name: 'microsoftSqlServer', + icon: 'file:mssql.png', + group: ['input'], + version: 1, + description: 'Gets, add and update data in Microsoft SQL Server.', + defaults: { + name: 'Microsoft SQL Server', + color: '#1d4bab', + }, + inputs: ['main'], + outputs: ['main'], + credentials: [ + { + name: 'microsoftSqlServer', + required: true, + }, + ], + properties: [ + { + displayName: 'Operation', + name: 'operation', + type: 'options', + options: [ + { + name: 'Execute Query', + value: 'executeQuery', + description: 'Executes a SQL query.', + }, + { + name: 'Insert', + value: 'insert', + description: 'Insert rows in database.', + }, + { + name: 'Update', + value: 'update', + description: 'Updates rows in database.', + }, + { + name: 'Delete', + value: 'delete', + description: 'Deletes rows in database.', + }, + ], + default: 'insert', + description: 'The operation to perform.', + }, + + // ---------------------------------- + // executeQuery + // ---------------------------------- + { + displayName: 'Query', + name: 'query', + type: 'string', + typeOptions: { + rows: 5, + }, + displayOptions: { + show: { + operation: ['executeQuery'], + }, + }, + default: '', + placeholder: 'SELECT id, name FROM product WHERE id < 40', + required: true, + description: 'The SQL query to execute.', + }, + + // ---------------------------------- + // insert + // ---------------------------------- + { + displayName: 'Table', + name: 'table', + type: 'string', + displayOptions: { + show: { + operation: ['insert'], + }, + }, + default: '', + required: true, + description: 'Name of the table in which to insert data to.', + }, + { + displayName: 'Columns', + name: 'columns', + type: 'string', + displayOptions: { + show: { + operation: ['insert'], + }, + }, + default: '', + placeholder: 'id,name,description', + description: + 'Comma separated list of the properties which should used as columns for the new rows.', + }, + + // ---------------------------------- + // update + // ---------------------------------- + { + displayName: 'Table', + name: 'table', + type: 'string', + displayOptions: { + show: { + operation: ['update'], + }, + }, + default: '', + required: true, + description: 'Name of the table in which to update data in', + }, + { + displayName: 'Update Key', + name: 'updateKey', + type: 'string', + displayOptions: { + show: { + operation: ['update'], + }, + }, + default: 'id', + required: true, + description: + 'Name of the property which decides which rows in the database should be updated. Normally that would be "id".', + }, + { + displayName: 'Columns', + name: 'columns', + type: 'string', + displayOptions: { + show: { + operation: ['update'], + }, + }, + default: '', + placeholder: 'name,description', + description: + 'Comma separated list of the properties which should used as columns for rows to update.', + }, + + // ---------------------------------- + // delete + // ---------------------------------- + { + displayName: 'Table', + name: 'table', + type: 'string', + displayOptions: { + show: { + operation: ['delete'], + }, + }, + default: '', + required: true, + description: 'Name of the table in which to delete data.', + }, + { + displayName: 'Delete Key', + name: 'deleteKey', + type: 'string', + displayOptions: { + show: { + operation: ['delete'], + }, + }, + default: 'id', + required: true, + description: + 'Name of the property which decides which rows in the database should be deleted. Normally that would be "id".', + }, + ], + }; + + async execute(this: IExecuteFunctions): Promise { + const credentials = this.getCredentials('microsoftSqlServer'); + + if (credentials === undefined) { + throw new Error('No credentials got returned!'); + } + + const config = { + server: credentials.server as string, + port: credentials.port as number, + database: credentials.database as string, + user: credentials.user as string, + password: credentials.password as string, + domain: credentials.domain ? (credentials.domain as string) : undefined, + }; + + const pool = new mssql.ConnectionPool(config); + await pool.connect(); + + let returnItems: any = []; + + const items = this.getInputData(); + const operation = this.getNodeParameter('operation', 0) as string; + + try { + if (operation === 'executeQuery') { + // ---------------------------------- + // executeQuery + // ---------------------------------- + + const rawQuery = this.getNodeParameter('query', 0) as string; + + const queryResult = await pool.request().query(rawQuery); + + const result = + queryResult.recordsets.length > 1 + ? flatten(queryResult.recordsets) + : queryResult.recordsets[0]; + + returnItems = this.helpers.returnJsonArray(result as IDataObject[]); + } else if (operation === 'insert') { + // ---------------------------------- + // insert + // ---------------------------------- + + const tables = createTableStruct(this.getNodeParameter, items); + const queriesResults = await executeQueryQueue( + tables, + ({ + table, + columnString, + items, + }: { + table: string; + columnString: string; + items: IDataObject[]; + }): Promise[] => { + return chunk(items, 1000).map(insertValues => { + const values = insertValues + .map((item: IDataObject) => extractValues(item)) + .join(','); + + return pool + .request() + .query( + `INSERT INTO ${table}(${columnString}) VALUES ${values};`, + ); + }); + }, + ); + + const rowsAffected = flatten(queriesResults).reduce( + (acc: number, resp: mssql.IResult): number => + (acc += resp.rowsAffected.reduce((sum, val) => (sum += val))), + 0, + ); + + returnItems = this.helpers.returnJsonArray({ + rowsAffected, + } as IDataObject); + } else if (operation === 'update') { + // ---------------------------------- + // update + // ---------------------------------- + + const updateKeys = items.map( + (item, index) => this.getNodeParameter('updateKey', index) as string, + ); + const tables = createTableStruct( + this.getNodeParameter, + items, + ['updateKey'], + 'updateKey', + ); + const queriesResults = await executeQueryQueue( + tables, + ({ + table, + columnString, + items, + }: { + table: string; + columnString: string; + items: IDataObject[]; + }): Promise[] => { + return items.map(item => { + const columns = columnString + .split(',') + .map(column => column.trim()); + + const setValues = extractUpdateSet(item, columns); + const condition = extractUpdateCondition( + item, + item.updateKey as string, + ); + + return pool + .request() + .query(`UPDATE ${table} SET ${setValues} WHERE ${condition};`); + }); + }, + ); + + const rowsAffected = flatten(queriesResults).reduce( + (acc: number, resp: mssql.IResult): number => + (acc += resp.rowsAffected.reduce((sum, val) => (sum += val))), + 0, + ); + + returnItems = this.helpers.returnJsonArray({ + rowsAffected, + } as IDataObject); + } else if (operation === 'delete') { + // ---------------------------------- + // delete + // ---------------------------------- + + const tables = items.reduce((tables, item, index) => { + const table = this.getNodeParameter('table', index) as string; + const deleteKey = this.getNodeParameter('deleteKey', index) as string; + if (tables[table] === undefined) { + tables[table] = {}; + } + if (tables[table][deleteKey] === undefined) { + tables[table][deleteKey] = []; + } + tables[table][deleteKey].push(item); + return tables; + }, {} as ITables); + + const queriesResults = await Promise.all( + Object.keys(tables).map(table => { + const deleteKeyResults = Object.keys(tables[table]).map( + deleteKey => { + const deleteItemsList = chunk( + tables[table][deleteKey].map(item => + copyInputItem(item as INodeExecutionData, [deleteKey]), + ), + 1000, + ); + const queryQueue = deleteItemsList.map(deleteValues => { + return pool + .request() + .query( + `DELETE FROM ${table} WHERE ${deleteKey} IN ${extractDeleteValues( + deleteValues, + deleteKey, + )};`, + ); + }); + return Promise.all(queryQueue); + }, + ); + return Promise.all(deleteKeyResults); + }), + ); + + const rowsAffected = flatten(queriesResults).reduce( + (acc: number, resp: mssql.IResult): number => + (acc += resp.rowsAffected.reduce((sum, val) => (sum += val))), + 0, + ); + + returnItems = this.helpers.returnJsonArray({ + rowsAffected, + } as IDataObject); + } else { + await pool.close(); + throw new Error(`The operation "${operation}" is not supported!`); + } + } catch (err) { + if (this.continueOnFail() === true) { + returnItems = items; + } else { + await pool.close(); + throw err; + } + } + + // Close the connection + await pool.close(); + + return this.prepareOutputData(returnItems); + } +} diff --git a/packages/nodes-base/nodes/Microsoft/SqlServer/TableInterface.ts b/packages/nodes-base/nodes/Microsoft/SqlServer/TableInterface.ts new file mode 100644 index 0000000000..a0343e6e0b --- /dev/null +++ b/packages/nodes-base/nodes/Microsoft/SqlServer/TableInterface.ts @@ -0,0 +1,7 @@ +import { IDataObject } from 'n8n-workflow'; + +export interface ITables { + [key: string]: { + [key: string]: Array; + }; +} diff --git a/packages/nodes-base/nodes/Microsoft/SqlServer/mssql.png b/packages/nodes-base/nodes/Microsoft/SqlServer/mssql.png new file mode 100644 index 0000000000000000000000000000000000000000..18349dc1cc58adfd3e724c264f96d2e3546b4474 GIT binary patch literal 3447 zcmXAr2{=^!7sn@r$oeWG(O_0%r?M0wyp|?gWhq-oB8*UEDMAPl!w3;&UxyiFH)fcz zjD6q6zDtVef8XbSpXc8DyXQH-b3W&M&+mC|6xu|Oi$j*)jNm=-$9I_V)uWKQbY4lDieOXER!>7XfRtn&pTT+Y7Et{5w4h^(|x)6!Nvau9e(FXzm0o({hNO{$UCXGNT|p zE(0fmB@;gt)WhJ5ODl9FtQ`vJLBbZ~5v1;Z0Dz8!0-lSD%f<~!aC(Ez+y@k4oq69m;_KMFg!q8Xf7_m zfRQXLr`%ko?ic|+!&(|6A;FaauX?Sm2q_s2D4F@#cf|%KWtsVmulYrm){A*x3jV#F zLhiP7H6iV zxVt#m+ub)cP*+k!p8VY2+L$Mm7UyN+(vscp-?*-f5Q4R?PX z%Oy0aAFc2AFK49wYuGn%bk;p~Fb4+{zk}cZuT!g}qp65PG0*gaOuwn1t)Lr?K0Sn; zYdk*&%*~sE-6i)IgQ%Tvj*?m2@MG&`z}c`l+lyVm5m6b=30 zTb1~~WAwKckFI=F5vHi76Q3I}mc==d!WSCOjj$j|Yl_Riuzfkl$0jA#4?j3LKmJnT zlWU6Ia~j(bRT@JD^BZIQgZm?6MdqKL7rhgv7g(&q9`|5@TrMficiQsl&bzsna4q#8 zvy~EjAWjK*f_s3+-T5f=Bgs{sE^NS&?XPizBLfg$tk+~dxa`8W&jRxKuaY(?$+u-2 zXB%U!J)=Op^;I{}(N`xzXYC5t5;g)?`ny=`a@Mz0L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9F=4GW1;7bt47N%3)wm?SYI?(X4V%vz$D%H9XRwr^E@{8-t~cM`4b)N zOmhSgEpW|=vj4z8z&K5z=1-0Zo9^u(0SrFS^*2F+DYP(_Bk8^M0Eo8<}SPn=!Pb~<10RfW2VQMKrK z85h6Ms^`pq^RQZVfcFo#kng$Z@^#6oV+0y~`%tyi-yq&K<(W>DA#> zHYT0e9fPxsNt086qIm7_Ger!cyTd_Xmc2R;d)NcJPk3ojHm=VGA4sw<3b2QRrx^?p zsuJ&Lm5RzGrf0;W^Wv2!xjb-JH_M5z)5>}$=XGvEJ@lSA8^>5(V&xDKf>`@kS$i5& zD3oZ$oa3OUOFH!;9074@!m4Jjm8Or#8bt4?gyCG*#FFd8u)ZAQR=|rp|WC0_#nORXgD`&Ie7RrxGNE zJac@lQUhc0{kBWblkpoiR;=4K`d{T`#eHdZROnbLcj9#7P_SG3>K6&Y*rc_EFB;HW zC}&GC(}SS3M2CuQ9hQ$@9Jw#4d!cFkJ_yW9OCf`f#^(``4ZJE&X->Mk{nlMBf?;V| z0D9pc3v=_GF@2?pRmX;*;q|+3zjN3ez)h)KseG0GSAAUlkPNu~;Ez&;fPjZwtP2c9oDnrz% SQGp*wkb$m=PRUKXu>S$oUE5&* literal 0 HcmV?d00001 diff --git a/packages/nodes-base/nodes/utils/utilities.ts b/packages/nodes-base/nodes/utils/utilities.ts new file mode 100644 index 0000000000..73105a901c --- /dev/null +++ b/packages/nodes-base/nodes/utils/utilities.ts @@ -0,0 +1,57 @@ +/** + * Creates an array of elements split into groups the length of `size`. + * If `array` can't be split evenly, the final chunk will be the remaining + * elements. + * + * @param {Array} array The array to process. + * @param {number} [size=1] The length of each chunk + * @returns {Array} Returns the new array of chunks. + * @example + * + * chunk(['a', 'b', 'c', 'd'], 2) + * // => [['a', 'b'], ['c', 'd']] + * + * chunk(['a', 'b', 'c', 'd'], 3) + * // => [['a', 'b', 'c'], ['d']] + */ +export function chunk(array: any[], size: number = 1) { + const length = array == null ? 0 : array.length; + if (!length || size < 1) { + return []; + } + let index = 0; + let resIndex = 0; + const result = new Array(Math.ceil(length / size)); + + while (index < length) { + result[resIndex++] = array.slice(index, (index += size)); + } + return result; +} + +/** + * Takes a multidimensional array and converts it to a one-dimensional array. + * + * @param {Array} nestedArray The array to be flattened. + * @returns {Array} Returns the new flattened array. + * @example + * + * flatten([['a', 'b'], ['c', 'd']]) + * // => ['a', 'b', 'c', 'd'] + * + */ +export function flatten(nestedArray: any[][]) { + const result = []; + + (function loop(array: any[]) { + for (var i = 0; i < array.length; i++) { + if (Array.isArray(array[i])) { + loop(array[i]); + } else { + result.push(array[i]); + } + } + })(nestedArray); + + return result; +} diff --git a/packages/nodes-base/package.json b/packages/nodes-base/package.json index 35700feb0a..1d196f3eef 100644 --- a/packages/nodes-base/package.json +++ b/packages/nodes-base/package.json @@ -96,6 +96,7 @@ "dist/credentials/MicrosoftExcelOAuth2Api.credentials.js", "dist/credentials/MicrosoftOAuth2Api.credentials.js", "dist/credentials/MicrosoftOneDriveOAuth2Api.credentials.js", + "dist/credentials/MicrosoftSqlServer.credentials.js", "dist/credentials/MoceanApi.credentials.js", "dist/credentials/MondayComApi.credentials.js", "dist/credentials/MongoDb.credentials.js", @@ -207,7 +208,7 @@ "dist/nodes/Google/Calendar/GoogleCalendar.node.js", "dist/nodes/Google/Drive/GoogleDrive.node.js", "dist/nodes/Google/Sheet/GoogleSheets.node.js", - "dist/nodes/Google/Task/GoogleTasks.node.js", + "dist/nodes/Google/Task/GoogleTasks.node.js", "dist/nodes/GraphQL/GraphQL.node.js", "dist/nodes/Gumroad/GumroadTrigger.node.js", "dist/nodes/Harvest/Harvest.node.js", @@ -241,6 +242,7 @@ "dist/nodes/MessageBird/MessageBird.node.js", "dist/nodes/Microsoft/Excel/MicrosoftExcel.node.js", "dist/nodes/Microsoft/OneDrive/MicrosoftOneDrive.node.js", + "dist/nodes/Microsoft/SqlServer/MicrosoftSqlServer.node.js", "dist/nodes/MoveBinaryData.node.js", "dist/nodes/Mocean/Mocean.node.js", "dist/nodes/MondayCom/MondayCom.node.js", @@ -322,6 +324,7 @@ "@types/lodash.set": "^4.3.6", "@types/moment-timezone": "^0.5.12", "@types/mongodb": "^3.5.4", + "@types/mssql": "^6.0.2", "@types/node": "^10.10.1", "@types/nodemailer": "^6.4.0", "@types/redis": "^2.8.11", @@ -354,6 +357,7 @@ "moment": "2.24.0", "moment-timezone": "^0.5.28", "mongodb": "^3.5.5", + "mssql": "^6.2.0", "mysql2": "^2.0.1", "n8n-core": "~0.37.0", "nodemailer": "^6.4.6", From 6d0210e8f3db665d6642360c04d384d4635d5fea Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Wed, 8 Jul 2020 10:08:00 +0200 Subject: [PATCH 176/241] :shirt: Fix some lint issues --- .../nodes/Microsoft/SqlServer/MicrosoftSqlServer.node.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/nodes-base/nodes/Microsoft/SqlServer/MicrosoftSqlServer.node.ts b/packages/nodes-base/nodes/Microsoft/SqlServer/MicrosoftSqlServer.node.ts index b24d93b0f5..4f6c2342a4 100644 --- a/packages/nodes-base/nodes/Microsoft/SqlServer/MicrosoftSqlServer.node.ts +++ b/packages/nodes-base/nodes/Microsoft/SqlServer/MicrosoftSqlServer.node.ts @@ -222,7 +222,7 @@ export class MicrosoftSqlServer implements INodeType { const pool = new mssql.ConnectionPool(config); await pool.connect(); - let returnItems: any = []; + let returnItems: INodeExecutionData[] = []; const items = this.getInputData(); const operation = this.getNodeParameter('operation', 0) as string; @@ -259,7 +259,7 @@ export class MicrosoftSqlServer implements INodeType { table: string; columnString: string; items: IDataObject[]; - }): Promise[] => { + }): Array> => { return chunk(items, 1000).map(insertValues => { const values = insertValues .map((item: IDataObject) => extractValues(item)) @@ -307,7 +307,7 @@ export class MicrosoftSqlServer implements INodeType { table: string; columnString: string; items: IDataObject[]; - }): Promise[] => { + }): Array> => { return items.map(item => { const columns = columnString .split(',') From b598036b3d014b7ee0dac1d5e937ccead3d8f481 Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Wed, 8 Jul 2020 10:08:00 +0200 Subject: [PATCH 177/241] :shirt: Fix some lint issues --- ...entials.ts => MicrosoftSql.credentials.ts} | 6 +++--- .../{SqlServer => Sql}/GenericFunctions.ts | 0 .../MicrosoftSql.node.ts} | 20 +++++++++--------- .../{SqlServer => Sql}/TableInterface.ts | 0 .../Microsoft/{SqlServer => Sql}/mssql.png | Bin packages/nodes-base/package.json | 4 ++-- 6 files changed, 15 insertions(+), 15 deletions(-) rename packages/nodes-base/credentials/{MicrosoftSqlServer.credentials.ts => MicrosoftSql.credentials.ts} (86%) rename packages/nodes-base/nodes/Microsoft/{SqlServer => Sql}/GenericFunctions.ts (100%) rename packages/nodes-base/nodes/Microsoft/{SqlServer/MicrosoftSqlServer.node.ts => Sql/MicrosoftSql.node.ts} (95%) rename packages/nodes-base/nodes/Microsoft/{SqlServer => Sql}/TableInterface.ts (100%) rename packages/nodes-base/nodes/Microsoft/{SqlServer => Sql}/mssql.png (100%) diff --git a/packages/nodes-base/credentials/MicrosoftSqlServer.credentials.ts b/packages/nodes-base/credentials/MicrosoftSql.credentials.ts similarity index 86% rename from packages/nodes-base/credentials/MicrosoftSqlServer.credentials.ts rename to packages/nodes-base/credentials/MicrosoftSql.credentials.ts index b0a14de771..812e9bfdd7 100644 --- a/packages/nodes-base/credentials/MicrosoftSqlServer.credentials.ts +++ b/packages/nodes-base/credentials/MicrosoftSql.credentials.ts @@ -1,8 +1,8 @@ import { ICredentialType, NodePropertyTypes } from 'n8n-workflow'; -export class MicrosoftSqlServer implements ICredentialType { - name = 'microsoftSqlServer'; - displayName = 'Microsoft SQL Server'; +export class MicrosoftSql implements ICredentialType { + name = 'microsoftSql'; + displayName = 'Microsoft SQL'; properties = [ { displayName: 'Server', diff --git a/packages/nodes-base/nodes/Microsoft/SqlServer/GenericFunctions.ts b/packages/nodes-base/nodes/Microsoft/Sql/GenericFunctions.ts similarity index 100% rename from packages/nodes-base/nodes/Microsoft/SqlServer/GenericFunctions.ts rename to packages/nodes-base/nodes/Microsoft/Sql/GenericFunctions.ts diff --git a/packages/nodes-base/nodes/Microsoft/SqlServer/MicrosoftSqlServer.node.ts b/packages/nodes-base/nodes/Microsoft/Sql/MicrosoftSql.node.ts similarity index 95% rename from packages/nodes-base/nodes/Microsoft/SqlServer/MicrosoftSqlServer.node.ts rename to packages/nodes-base/nodes/Microsoft/Sql/MicrosoftSql.node.ts index b24d93b0f5..1d036147f6 100644 --- a/packages/nodes-base/nodes/Microsoft/SqlServer/MicrosoftSqlServer.node.ts +++ b/packages/nodes-base/nodes/Microsoft/Sql/MicrosoftSql.node.ts @@ -22,23 +22,23 @@ import { extractValues, } from './GenericFunctions'; -export class MicrosoftSqlServer implements INodeType { +export class MicrosoftSql implements INodeType { description: INodeTypeDescription = { - displayName: 'Microsoft SQL Server', - name: 'microsoftSqlServer', + displayName: 'Microsoft SQL', + name: 'microsoftSql', icon: 'file:mssql.png', group: ['input'], version: 1, - description: 'Gets, add and update data in Microsoft SQL Server.', + description: 'Gets, add and update data in Microsoft SQL.', defaults: { - name: 'Microsoft SQL Server', + name: 'Microsoft SQL', color: '#1d4bab', }, inputs: ['main'], outputs: ['main'], credentials: [ { - name: 'microsoftSqlServer', + name: 'microsoftSql', required: true, }, ], @@ -204,7 +204,7 @@ export class MicrosoftSqlServer implements INodeType { }; async execute(this: IExecuteFunctions): Promise { - const credentials = this.getCredentials('microsoftSqlServer'); + const credentials = this.getCredentials('microsoftSql'); if (credentials === undefined) { throw new Error('No credentials got returned!'); @@ -222,7 +222,7 @@ export class MicrosoftSqlServer implements INodeType { const pool = new mssql.ConnectionPool(config); await pool.connect(); - let returnItems: any = []; + let returnItems: INodeExecutionData[] = []; const items = this.getInputData(); const operation = this.getNodeParameter('operation', 0) as string; @@ -259,7 +259,7 @@ export class MicrosoftSqlServer implements INodeType { table: string; columnString: string; items: IDataObject[]; - }): Promise[] => { + }): Array> => { return chunk(items, 1000).map(insertValues => { const values = insertValues .map((item: IDataObject) => extractValues(item)) @@ -307,7 +307,7 @@ export class MicrosoftSqlServer implements INodeType { table: string; columnString: string; items: IDataObject[]; - }): Promise[] => { + }): Array> => { return items.map(item => { const columns = columnString .split(',') diff --git a/packages/nodes-base/nodes/Microsoft/SqlServer/TableInterface.ts b/packages/nodes-base/nodes/Microsoft/Sql/TableInterface.ts similarity index 100% rename from packages/nodes-base/nodes/Microsoft/SqlServer/TableInterface.ts rename to packages/nodes-base/nodes/Microsoft/Sql/TableInterface.ts diff --git a/packages/nodes-base/nodes/Microsoft/SqlServer/mssql.png b/packages/nodes-base/nodes/Microsoft/Sql/mssql.png similarity index 100% rename from packages/nodes-base/nodes/Microsoft/SqlServer/mssql.png rename to packages/nodes-base/nodes/Microsoft/Sql/mssql.png diff --git a/packages/nodes-base/package.json b/packages/nodes-base/package.json index 1d196f3eef..3c51466ea3 100644 --- a/packages/nodes-base/package.json +++ b/packages/nodes-base/package.json @@ -96,7 +96,7 @@ "dist/credentials/MicrosoftExcelOAuth2Api.credentials.js", "dist/credentials/MicrosoftOAuth2Api.credentials.js", "dist/credentials/MicrosoftOneDriveOAuth2Api.credentials.js", - "dist/credentials/MicrosoftSqlServer.credentials.js", + "dist/credentials/MicrosoftSql.credentials.js", "dist/credentials/MoceanApi.credentials.js", "dist/credentials/MondayComApi.credentials.js", "dist/credentials/MongoDb.credentials.js", @@ -242,7 +242,7 @@ "dist/nodes/MessageBird/MessageBird.node.js", "dist/nodes/Microsoft/Excel/MicrosoftExcel.node.js", "dist/nodes/Microsoft/OneDrive/MicrosoftOneDrive.node.js", - "dist/nodes/Microsoft/SqlServer/MicrosoftSqlServer.node.js", + "dist/nodes/Microsoft/Sql/MicrosoftSql.node.js", "dist/nodes/MoveBinaryData.node.js", "dist/nodes/Mocean/Mocean.node.js", "dist/nodes/MondayCom/MondayCom.node.js", From c1161c2699b4933c75331fcc9011129cb02a6254 Mon Sep 17 00:00:00 2001 From: Ben Hesseldieck Date: Wed, 8 Jul 2020 10:50:18 +0200 Subject: [PATCH 178/241] :bug: fix mssql update operation --- packages/nodes-base/nodes/Microsoft/Sql/MicrosoftSql.node.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/nodes-base/nodes/Microsoft/Sql/MicrosoftSql.node.ts b/packages/nodes-base/nodes/Microsoft/Sql/MicrosoftSql.node.ts index 1d036147f6..855a4647a0 100644 --- a/packages/nodes-base/nodes/Microsoft/Sql/MicrosoftSql.node.ts +++ b/packages/nodes-base/nodes/Microsoft/Sql/MicrosoftSql.node.ts @@ -294,7 +294,7 @@ export class MicrosoftSql implements INodeType { const tables = createTableStruct( this.getNodeParameter, items, - ['updateKey'], + ['updateKey'].concat(updateKeys), 'updateKey', ); const queriesResults = await executeQueryQueue( From 9ea4d870cfb1862352dfd400309277a249cae5bf Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Wed, 8 Jul 2020 11:21:57 +0200 Subject: [PATCH 179/241] :bookmark: Release n8n-workflow@0.34.0 --- packages/workflow/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/workflow/package.json b/packages/workflow/package.json index 068dc6d108..b65cf8cb6e 100644 --- a/packages/workflow/package.json +++ b/packages/workflow/package.json @@ -1,6 +1,6 @@ { "name": "n8n-workflow", - "version": "0.33.0", + "version": "0.34.0", "description": "Workflow base code of n8n", "license": "SEE LICENSE IN LICENSE.md", "homepage": "https://n8n.io", From c8718bf96b26640a49eede02bdd2bacfdabe675d Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Wed, 8 Jul 2020 11:22:55 +0200 Subject: [PATCH 180/241] :arrow_up: Set n8n-workflow@0.34.0 on n8n-core --- packages/core/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/package.json b/packages/core/package.json index ac55db99c9..da71092613 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -46,7 +46,7 @@ "file-type": "^14.6.2", "lodash.get": "^4.4.2", "mime-types": "^2.1.27", - "n8n-workflow": "~0.33.0", + "n8n-workflow": "~0.34.0", "p-cancelable": "^2.0.0", "request": "^2.88.2", "request-promise-native": "^1.0.7" From 5e61a77d23883517db2c5ed3cb56d66f68b1c4eb Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Wed, 8 Jul 2020 11:23:38 +0200 Subject: [PATCH 181/241] :bookmark: Release n8n-core@0.38.0 --- packages/core/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/package.json b/packages/core/package.json index da71092613..fe195d2e36 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "n8n-core", - "version": "0.37.0", + "version": "0.38.0", "description": "Core functionality of n8n", "license": "SEE LICENSE IN LICENSE.md", "homepage": "https://n8n.io", From 4d5308379116165b30ecce7780143d888f56330d Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Wed, 8 Jul 2020 11:24:47 +0200 Subject: [PATCH 182/241] :arrow_up: Set n8n-core@0.38.0 and n8n-workflow@0.34.0 on n8n-nodes-base --- packages/nodes-base/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/nodes-base/package.json b/packages/nodes-base/package.json index 3c51466ea3..df0c9782ec 100644 --- a/packages/nodes-base/package.json +++ b/packages/nodes-base/package.json @@ -333,7 +333,7 @@ "@types/xml2js": "^0.4.3", "gulp": "^4.0.0", "jest": "^24.9.0", - "n8n-workflow": "~0.32.0", + "n8n-workflow": "~0.34.0", "ts-jest": "^24.0.2", "tslint": "^5.17.0", "typescript": "~3.7.4" @@ -359,7 +359,7 @@ "mongodb": "^3.5.5", "mssql": "^6.2.0", "mysql2": "^2.0.1", - "n8n-core": "~0.37.0", + "n8n-core": "~0.38.0", "nodemailer": "^6.4.6", "pdf-parse": "^1.1.1", "pg-promise": "^9.0.3", From 66339a6afaa485fd09539071aed7c982976c5793 Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Wed, 8 Jul 2020 11:25:18 +0200 Subject: [PATCH 183/241] :bookmark: Release n8n-nodes-base@0.68.0 --- packages/nodes-base/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/nodes-base/package.json b/packages/nodes-base/package.json index df0c9782ec..1141485b4c 100644 --- a/packages/nodes-base/package.json +++ b/packages/nodes-base/package.json @@ -1,6 +1,6 @@ { "name": "n8n-nodes-base", - "version": "0.67.0", + "version": "0.68.0", "description": "Base nodes of n8n", "license": "SEE LICENSE IN LICENSE.md", "homepage": "https://n8n.io", From d97ed68ce96c033e0363a4833477ae4b5745ee37 Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Wed, 8 Jul 2020 11:26:22 +0200 Subject: [PATCH 184/241] :arrow_up: Set n8n-workflow@0.34.0 on n8n-editor-ui --- packages/editor-ui/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/editor-ui/package.json b/packages/editor-ui/package.json index 9491626ddf..26a5f0862a 100644 --- a/packages/editor-ui/package.json +++ b/packages/editor-ui/package.json @@ -64,7 +64,7 @@ "lodash.debounce": "^4.0.8", "lodash.get": "^4.4.2", "lodash.set": "^4.3.2", - "n8n-workflow": "~0.33.0", + "n8n-workflow": "~0.34.0", "node-sass": "^4.12.0", "prismjs": "^1.17.1", "quill": "^2.0.0-dev.3", From 22cb017c1af0f8ecd9bccd2eede4af420a98294b Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Wed, 8 Jul 2020 11:26:47 +0200 Subject: [PATCH 185/241] :bookmark: Release n8n-editor-ui@0.49.0 --- packages/editor-ui/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/editor-ui/package.json b/packages/editor-ui/package.json index 26a5f0862a..6298fdb18a 100644 --- a/packages/editor-ui/package.json +++ b/packages/editor-ui/package.json @@ -1,6 +1,6 @@ { "name": "n8n-editor-ui", - "version": "0.48.0", + "version": "0.49.0", "description": "Workflow Editor UI for n8n", "license": "SEE LICENSE IN LICENSE.md", "homepage": "https://n8n.io", From bf66609c800136259959c1194254b100f4376409 Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Wed, 8 Jul 2020 11:28:04 +0200 Subject: [PATCH 186/241] :arrow_up: Set n8n-core@0.38.0, n8n-editor-ui@0.49.0, n8n-nodes-base@0.68.0 and n8n-workflow@0.34.0 on n8n --- packages/cli/package.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/cli/package.json b/packages/cli/package.json index 4eaaade97f..a67661d2af 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -100,10 +100,10 @@ "lodash.get": "^4.4.2", "mongodb": "^3.5.5", "mysql2": "^2.0.1", - "n8n-core": "~0.37.0", - "n8n-editor-ui": "~0.48.0", - "n8n-nodes-base": "~0.67.0", - "n8n-workflow": "~0.33.0", + "n8n-core": "~0.38.0", + "n8n-editor-ui": "~0.49.0", + "n8n-nodes-base": "~0.68.0", + "n8n-workflow": "~0.34.0", "oauth-1.0a": "^2.2.6", "open": "^7.0.0", "pg": "^7.11.0", From 243f4ee9b52d049eb44a3c4afd5be72eaae93282 Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Wed, 8 Jul 2020 11:28:39 +0200 Subject: [PATCH 187/241] :bookmark: Release n8n@0.73.0 --- packages/cli/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/cli/package.json b/packages/cli/package.json index a67661d2af..0bda408ec3 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "n8n", - "version": "0.72.0", + "version": "0.73.0", "description": "n8n Workflow Automation Tool", "license": "SEE LICENSE IN LICENSE.md", "homepage": "https://n8n.io", From 0108538fcc94bfdc9edf14babe0789926a274843 Mon Sep 17 00:00:00 2001 From: Ben Hesseldieck Date: Wed, 8 Jul 2020 12:01:16 +0200 Subject: [PATCH 188/241] :construction: insert function extracted --- .../nodes/Postgres/Postgres.node.functions.ts | 94 +++++++--- .../nodes/Postgres/Postgres.node.ts | 175 +++++++----------- 2 files changed, 136 insertions(+), 133 deletions(-) diff --git a/packages/nodes-base/nodes/Postgres/Postgres.node.functions.ts b/packages/nodes-base/nodes/Postgres/Postgres.node.functions.ts index a6d986643d..83a5701bad 100644 --- a/packages/nodes-base/nodes/Postgres/Postgres.node.functions.ts +++ b/packages/nodes-base/nodes/Postgres/Postgres.node.functions.ts @@ -2,6 +2,33 @@ import { IDataObject, INodeExecutionData } from 'n8n-workflow'; import pgPromise = require('pg-promise'); import pg = require('pg-promise/typescript/pg-subset'); +/** + * Returns of copy of the items which only contains the json data and + * of that only the define properties + * + * @param {INodeExecutionData[]} items The items to copy + * @param {string[]} properties The properties it should include + * @returns + */ +function getItemCopy( + items: INodeExecutionData[], + properties: string[], +): IDataObject[] { + // Prepare the data to insert and copy it to be returned + let newItem: IDataObject; + return items.map(item => { + newItem = {}; + for (const property of properties) { + if (item.json[property] === undefined) { + newItem[property] = null; + } else { + newItem[property] = JSON.parse(JSON.stringify(item.json[property])); + } + } + return newItem; + }); +} + /** * Executes the given SQL query on the database. * @@ -9,14 +36,14 @@ import pg = require('pg-promise/typescript/pg-subset'); * @param {pgPromise.IMain<{}, pg.IClient>} pgp The pgPromise instance * @param {pgPromise.IDatabase<{}, pg.IClient>} db The pgPromise database connection * @param {input[]} input The Node's input data - * @returns Promise + * @returns Promise> */ export function executeQuery( getNodeParam: Function, pgp: pgPromise.IMain<{}, pg.IClient>, db: pgPromise.IDatabase<{}, pg.IClient>, input: INodeExecutionData[], -): Promise { +): Promise> { const queries: string[] = []; for (let i = 0; i < input.length; i++) { queries.push(getNodeParam('query', i) as string); @@ -25,24 +52,47 @@ export function executeQuery( return db.any(pgp.helpers.concat(queries)); } -// /** -// * Returns of copy of the items which only contains the json data and -// * of that only the define properties -// * -// * @param {items[]} items The items execute the query with -// * @param {string[]} properties The properties it should include -// * @returns -// */ -// export function insert( -// getNodeParam: Function, -// pgp: pgPromise.IMain<{}, pg.IClient>, -// db: pgPromise.IDatabase<{}, pg.IClient>, -// items: INodeExecutionData[] -// ): Promise { -// const queries: string[] = []; -// for (let i = 0; i < items.length; i++) { -// queries.push(getNodeParam('query', i) as string); -// } +/** + * Returns of copy of the items which only contains the json data and + * of that only the define properties + * + * @param {Function} getNodeParam The getter of the Node + * @param {pgPromise.IMain<{}, pg.IClient>} pgp The pgPromise instance + * @param {pgPromise.IDatabase<{}, pg.IClient>} db The pgPromise database connection + * @param {input[]} input The Node's input data + * @returns Promise + */ +export async function executeInsert( + getNodeParam: Function, + pgp: pgPromise.IMain<{}, pg.IClient>, + db: pgPromise.IDatabase<{}, pg.IClient>, + items: INodeExecutionData[], +): Promise> { + const table = getNodeParam('table', 0) as string; + const schema = getNodeParam('schema', 0) as string; + let returnFields = (getNodeParam('returnFields', 0) as string).split( + ',', + ) as string[]; + const columnString = getNodeParam('columns', 0) as string; + const columns = columnString.split(',').map(column => column.trim()); -// return db.any(pgp.helpers.concat(queries)); -// } + const cs = new pgp.helpers.ColumnSet(columns); + + const te = new pgp.helpers.TableName({ table, schema }); + + // Prepare the data to insert and copy it to be returned + const insertItems = getItemCopy(items, columns); + + // Generate the multi-row insert query and return the id of new row + returnFields = returnFields + .map(value => value.trim()) + .filter(value => !!value); + const query = + pgp.helpers.insert(insertItems, cs, te) + + (returnFields.length ? ` RETURNING ${returnFields.join(',')}` : ''); + + // Executing the query to insert the data + const insertData = await db.manyOrNone(query); + + return [insertData, insertItems]; +} diff --git a/packages/nodes-base/nodes/Postgres/Postgres.node.ts b/packages/nodes-base/nodes/Postgres/Postgres.node.ts index 2e40dc8290..a7fe2b72d8 100644 --- a/packages/nodes-base/nodes/Postgres/Postgres.node.ts +++ b/packages/nodes-base/nodes/Postgres/Postgres.node.ts @@ -3,39 +3,12 @@ import { IDataObject, INodeExecutionData, INodeType, - INodeTypeDescription + INodeTypeDescription, } from 'n8n-workflow'; import * as pgPromise from 'pg-promise'; -import { executeQuery } from './Postgres.node.functions'; - -/** - * Returns of copy of the items which only contains the json data and - * of that only the define properties - * - * @param {INodeExecutionData[]} items The items to copy - * @param {string[]} properties The properties it should include - * @returns - */ -function getItemCopy( - items: INodeExecutionData[], - properties: string[] -): IDataObject[] { - // Prepare the data to insert and copy it to be returned - let newItem: IDataObject; - return items.map(item => { - newItem = {}; - for (const property of properties) { - if (item.json[property] === undefined) { - newItem[property] = null; - } else { - newItem[property] = JSON.parse(JSON.stringify(item.json[property])); - } - } - return newItem; - }); -} +import { executeInsert, executeQuery } from './Postgres.node.functions'; export class Postgres implements INodeType { description: INodeTypeDescription = { @@ -47,15 +20,15 @@ export class Postgres implements INodeType { description: 'Gets, add and update data in Postgres.', defaults: { name: 'Postgres', - color: '#336791' + color: '#336791', }, inputs: ['main'], outputs: ['main'], credentials: [ { name: 'postgres', - required: true - } + required: true, + }, ], properties: [ { @@ -66,21 +39,21 @@ export class Postgres implements INodeType { { name: 'Execute Query', value: 'executeQuery', - description: 'Executes a SQL query.' + description: 'Executes a SQL query.', }, { name: 'Insert', value: 'insert', - description: 'Insert rows in database.' + description: 'Insert rows in database.', }, { name: 'Update', value: 'update', - description: 'Updates rows in database.' - } + description: 'Updates rows in database.', + }, ], default: 'insert', - description: 'The operation to perform.' + description: 'The operation to perform.', }, // ---------------------------------- @@ -91,17 +64,17 @@ export class Postgres implements INodeType { name: 'query', type: 'string', typeOptions: { - rows: 5 + rows: 5, }, displayOptions: { show: { - operation: ['executeQuery'] - } + operation: ['executeQuery'], + }, }, default: '', placeholder: 'SELECT id, name FROM product WHERE id < 40', required: true, - description: 'The SQL query to execute.' + description: 'The SQL query to execute.', }, // ---------------------------------- @@ -113,12 +86,12 @@ export class Postgres implements INodeType { type: 'string', displayOptions: { show: { - operation: ['insert'] - } + operation: ['insert'], + }, }, default: 'public', required: true, - description: 'Name of the schema the table belongs to' + description: 'Name of the schema the table belongs to', }, { displayName: 'Table', @@ -126,12 +99,12 @@ export class Postgres implements INodeType { type: 'string', displayOptions: { show: { - operation: ['insert'] - } + operation: ['insert'], + }, }, default: '', required: true, - description: 'Name of the table in which to insert data to.' + description: 'Name of the table in which to insert data to.', }, { displayName: 'Columns', @@ -139,13 +112,13 @@ export class Postgres implements INodeType { type: 'string', displayOptions: { show: { - operation: ['insert'] - } + operation: ['insert'], + }, }, default: '', placeholder: 'id,name,description', description: - 'Comma separated list of the properties which should used as columns for the new rows.' + 'Comma separated list of the properties which should used as columns for the new rows.', }, { displayName: 'Return Fields', @@ -153,12 +126,12 @@ export class Postgres implements INodeType { type: 'string', displayOptions: { show: { - operation: ['insert'] - } + operation: ['insert'], + }, }, default: '*', description: - 'Comma separated list of the fields that the operation will return' + 'Comma separated list of the fields that the operation will return', }, // ---------------------------------- @@ -170,12 +143,12 @@ export class Postgres implements INodeType { type: 'string', displayOptions: { show: { - operation: ['update'] - } + operation: ['update'], + }, }, default: '', required: true, - description: 'Name of the table in which to update data in' + description: 'Name of the table in which to update data in', }, { displayName: 'Update Key', @@ -183,13 +156,13 @@ export class Postgres implements INodeType { type: 'string', displayOptions: { show: { - operation: ['update'] - } + operation: ['update'], + }, }, default: 'id', required: true, description: - 'Name of the property which decides which rows in the database should be updated. Normally that would be "id".' + 'Name of the property which decides which rows in the database should be updated. Normally that would be "id".', }, { displayName: 'Columns', @@ -197,15 +170,15 @@ export class Postgres implements INodeType { type: 'string', displayOptions: { show: { - operation: ['update'] - } + operation: ['update'], + }, }, default: '', placeholder: 'name,description', description: - 'Comma separated list of the properties which should used as columns for rows to update.' - } - ] + 'Comma separated list of the properties which should used as columns for rows to update.', + }, + ], }; async execute(this: IExecuteFunctions): Promise { @@ -224,9 +197,9 @@ export class Postgres implements INodeType { user: credentials.user as string, password: credentials.password as string, ssl: !['disable', undefined].includes( - credentials.ssl as string | undefined + credentials.ssl as string | undefined, ), - sslmode: (credentials.ssl as string) || 'disable' + sslmode: (credentials.ssl as string) || 'disable', }; const db = pgp(config); @@ -245,7 +218,7 @@ export class Postgres implements INodeType { this.getNodeParameter, pgp, db, - items + items, ); returnItems = this.helpers.returnJsonArray(queryResult as IDataObject[]); @@ -254,40 +227,20 @@ export class Postgres implements INodeType { // insert // ---------------------------------- - const table = this.getNodeParameter('table', 0) as string; - const schema = this.getNodeParameter('schema', 0) as string; - let returnFields = (this.getNodeParameter( - 'returnFields', - 0 - ) as string).split(',') as string[]; - const columnString = this.getNodeParameter('columns', 0) as string; - const columns = columnString.split(',').map(column => column.trim()); - - const cs = new pgp.helpers.ColumnSet(columns); - - const te = new pgp.helpers.TableName({ table, schema }); - - // Prepare the data to insert and copy it to be returned - const insertItems = getItemCopy(items, columns); - - // Generate the multi-row insert query and return the id of new row - returnFields = returnFields - .map(value => value.trim()) - .filter(value => !!value); - const query = - pgp.helpers.insert(insertItems, cs, te) + - (returnFields.length ? ` RETURNING ${returnFields.join(',')}` : ''); - - // Executing the query to insert the data - const insertData = await db.manyOrNone(query); + const [insertData, insertItems] = await executeInsert( + this.getNodeParameter, + pgp, + db, + items, + ); // Add the id to the data for (let i = 0; i < insertData.length; i++) { returnItems.push({ json: { ...insertData[i], - ...insertItems[i] - } + ...insertItems[i], + }, }); } } else if (operation === 'update') { @@ -301,26 +254,26 @@ export class Postgres implements INodeType { const columns = columnString.split(',').map(column => column.trim()); - // Make sure that the updateKey does also get queried - if (!columns.includes(updateKey)) { - columns.unshift(updateKey); - } + // // Make sure that the updateKey does also get queried + // if (!columns.includes(updateKey)) { + // columns.unshift(updateKey); + // } - // Prepare the data to update and copy it to be returned - const updateItems = getItemCopy(items, columns); + // // Prepare the data to update and copy it to be returned + // const updateItems = getItemCopy(items, columns); - // Generate the multi-row update query - const query = - pgp.helpers.update(updateItems, columns, table) + - ' WHERE v.' + - updateKey + - ' = t.' + - updateKey; + // // Generate the multi-row update query + // const query = + // pgp.helpers.update(updateItems, columns, table) + + // ' WHERE v.' + + // updateKey + + // ' = t.' + + // updateKey; - // Executing the query to update the data - await db.none(query); + // // Executing the query to update the data + // await db.none(query); - returnItems = this.helpers.returnJsonArray(updateItems as IDataObject[]); + // returnItems = this.helpers.returnJsonArray(updateItems as IDataObject[]); } else { await pgp.end(); throw new Error(`The operation "${operation}" is not supported!`); From b8ff3c76ae0ba0d311314e53fe3f59fd5b2962a2 Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Wed, 8 Jul 2020 12:29:29 +0200 Subject: [PATCH 189/241] :books: Add back images for README files --- assets/n8n-logo.png | Bin 0 -> 2675 bytes assets/n8n-screenshot.png | Bin 0 -> 129698 bytes 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 assets/n8n-logo.png create mode 100644 assets/n8n-screenshot.png diff --git a/assets/n8n-logo.png b/assets/n8n-logo.png new file mode 100644 index 0000000000000000000000000000000000000000..a77f36aeeead7e17aa4390937e90f48652d811c8 GIT binary patch literal 2675 zcmV-(3XJuMP)Px#Do{*RMF0Q*I89ssZCd|rS~yKx|7}|TZCW@@TdQ7L z|7}`0O000bhQchC013}YL_t(| z+U=d$nyVlTfXlwvzW?h^_X3gxP^@;y)%i}xYWc}R67Y07peQATQ0g?~2gC_}ehC)? z>cK^QXug=*F)F`<^Nw_A=|RQnb6)gN(nC5=eujj*F+9J-a}fPCo`dM|{3p(H5Ivgc zGbMTq(t$*rX%Sm_q39=yeTRx3MHC#(M#gyL z01p`AI%Iu10^NP23~t3uR5<1*Lq9qO^ZV9R^K*q{++=8Uht2&q&MKOKQ57T3Ju1$; z3aSBgkBiGP$t7&v0J;aUx`Agt>gfm68p+t@DvZg=Z!s!LUqu|S&|vv_??CNzXZaB( zdoz7Iq2rmFHlADhPy#Gt$bc~TWd-)F!=cp?UFLmkIDL& zr>peSSiu|j>ZQuUkx)lBL@@;mowYix-xilym~|JM>(*|k5t&irC1akggMnMZbW0SY znzDk6)+`h9S)Y|lKvb+eKWb(^R5yY4ZStmdqi9G9E_0zdv)VV#eFu4KYo-ulL_>{a-Kwass{6g}ZrVZ))y6Z&Y(e?b<;`v;q7ITh zpYb$FNi09o6PDnc1I=Y2Y*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oG1wWXBvmw19e_715o3rPe4C#L6i|HYR0YvRiG}<{L}H;6 zP*3%lWuF=XL%%*3aCr2NHQwTu%ZauCwP;a%0!Fqo(38YZNP>D&RR*apI_XQ-oVGz6 znxR`G?p1&WV~6yWr7MWuKt0+4cIxSuzm(~rbN9ZGI9(GxcxvuIxo$ndrU_`gvE_4R+=$|vfO_)r zz$`z5I>y7A9{bMA-_WDsk_7T2Jv7t*Re@fZyh_fC-anh}n@$+oJYNX(ej{H3GN8PKcP3jUrC87kBJySe@w7fHd8*-j^R5P zQnx(H9r6vNniuajJn;Kc|CKoPKATLVohE#|J^gTOv9L&-M@)1$(J)bU9v1h2E*0!I z6r1i99*)Xh literal 0 HcmV?d00001 diff --git a/assets/n8n-screenshot.png b/assets/n8n-screenshot.png new file mode 100644 index 0000000000000000000000000000000000000000..55b476cfb61bcf418baf09ebfd3c827ce563b4e8 GIT binary patch literal 129698 zcmce;Wk6Kj+6IjBD34MK(g+Fy($dl(l0!%g9ZGk1st8Eu&<#Tj-3=-|z#v@%NDSS> zPy@_|KJPh4&-;EqzwZ~DwfA1@UiZ4=TGzVwguYRh#lKH^9}5c$UtaFD8Wz@_AuKFx zqrY$8w0s&iF24EmmxZK~BoEH+VM&@g7@Iwjw|i${ zre^le)XS;gOa$xJ1+V;TNe$20oq1e+4YzB|At83B*_&HUeSgz^ex92gW4xf5J=hAi z(%qa@nkyTuSF&L(S+qC9%yP_4>bh5PYt3Iu3`{!n&WX7FeS6{e`YW``` zzWe`MXPxD4-J9b&ckw|7@0OPs3YDQz+JcQ*$B0(tU$SJQY?RzcRUA?-eC|C1?jD}`TKm5?8Evnepw?ZBacU#j>5bbQW7FI;gj-JgE> zk;hxA+l;f<&~ANi5^UkY=|I@<;|tAW(`|!!A;5tIg#gg|E(2yvhXkI;c|xnH9?FZBFM7SgwQp zaQX~fx`w1+nX&3A#=K#XN<&gWAk+@?#L4l2hl-%OHqZP#AjMGA8f7cFVrH9ve5_I5 zJEK3-A7lc4>TM@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~i1>pmd0PbqOG*`zs7AlPs=O7mpx|&foyDO^W&K2v z7M2j~M`L$s&_t7XpZ+v!G=+vOvW_-=tqFr|1>enV-Hrj}bz)ADZ;<$nKkt94kZ;Kr zm=DX;vH-)AM6J6s0I4|@VRzk86ZCI;-PL7;VLg!=>ffdYVwHjH);Nf(zh#c8mhB`^spT)gajnv)8W^eJ#BZoKWb`O71LfDH=9I23NBLL)aWCrV|y#HQ5_@j zUzrzj8$djRZiOMYee&KnsrPyO$iEcO)jjF`=)sy2B_+$*Gb5m@_?KY68#zQN?x={E z)7COwc&mA5ddVoCVvuuDd9IMr$UTIXCMr#mH)p3WBq}1pbo*V!VyCUSqZ{Z7e#;SXu#h%<}rN6vgrAEF<2(D@d3mP@+Tq^%U z-6=V@69o!$>L0rKpP=`iQRNoZ^>}D9gv`y}Ht8!Me80gt0YWQ!71m0!!6@=NKBTqUh5%pTCNh|OWc#X&CG!aM zO(Nl{X|*0ERj=gM^-*%NBn?(+U+ea?sCI+j7Svp{)^Tnhl0GiZ+xrCI^!*K-4pQ*a z5Nz{K?jLD@Ztd`~2x0e=6wJgLztNMO9A0-uXsD~m_T zf6`O3v`c;KfVdvYO-EFMELl-KB}-QS53B#th7eQc<1|$N-pw5ewZPc z$>A7)`Aj6MR9PS7KgRMoa_wH3VUBWi?-+n}JMh>^fXf41mXWd^?LL01C~7L?$(cO; EKL8|sWdHyG literal 0 HcmV?d00001 From af1ada2a34867a3022aa0a6e6148e0e85abcb097 Mon Sep 17 00:00:00 2001 From: Tanay Pant <7481165+tanay1337@users.noreply.github.com> Date: Wed, 8 Jul 2020 12:32:26 +0200 Subject: [PATCH 190/241] =?UTF-8?q?=F0=9F=90=9B=20Fix=20broken=20images=20?= =?UTF-8?q?in=20README?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a9a161f9a2..eb692157a1 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ # n8n - Workflow Automation Tool -![n8n.io - Workflow Automation](https://raw.githubusercontent.com/n8n-io/n8n/master/docs/images/n8n-logo.png) +![n8n.io - Workflow Automation](https://raw.githubusercontent.com/n8n-io/n8n/master/assets/n8n-logo.png) n8n is a free and open [fair-code](http://faircode.io) licensed node based Workflow Automation Tool. It can be self-hosted, easily extended, and so also used with internal tools. -n8n.io - Screenshot +n8n.io - Screenshot From bafc1fc45cd15c66c3821368a5f59f3191267c3c Mon Sep 17 00:00:00 2001 From: Tanay Pant Date: Wed, 8 Jul 2020 12:38:25 +0200 Subject: [PATCH 191/241] =?UTF-8?q?=F0=9F=90=9B=20Fix=20broken=20images?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docker/images/n8n/README.md | 4 ++-- packages/cli/README.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docker/images/n8n/README.md b/docker/images/n8n/README.md index e1b39d82d6..7170dda595 100644 --- a/docker/images/n8n/README.md +++ b/docker/images/n8n/README.md @@ -1,10 +1,10 @@ # n8n - Workflow Automation -![n8n.io - Workflow Automation](https://raw.githubusercontent.com/n8n-io/n8n/master/docs/images/n8n-logo.png) +![n8n.io - Workflow Automation](https://raw.githubusercontent.com/n8n-io/n8n/master/assets/n8n-logo.png) n8n is a free and open [fair-code](http://faircode.io) licensed node based Workflow Automation Tool. It can be self-hosted, easily extended, and so also used with internal tools. -n8n.io - Screenshot +n8n.io - Screenshot ## Contents diff --git a/packages/cli/README.md b/packages/cli/README.md index be5f42ae8b..5ae03ffa41 100644 --- a/packages/cli/README.md +++ b/packages/cli/README.md @@ -1,10 +1,10 @@ # n8n - Workflow Automation Tool -![n8n.io - Workflow Automation](https://raw.githubusercontent.com/n8n-io/n8n/master/docs/images/n8n-logo.png) +![n8n.io - Workflow Automation](https://raw.githubusercontent.com/n8n-io/n8n/master/assets/n8n-logo.png) n8n is a free and open [fair-code](http://faircode.io) licensed node based Workflow Automation Tool. It can be self-hosted, easily extended, and so also used with internal tools. -n8n.io - Screenshot +n8n.io - Screenshot ## Contents From 2fea79f5f11f8092aed1fe21d3bbc21567612d85 Mon Sep 17 00:00:00 2001 From: Ben Hesseldieck Date: Wed, 8 Jul 2020 14:36:40 +0200 Subject: [PATCH 192/241] :zap: extract update function --- .../nodes/Postgres/Postgres.node.functions.ts | 52 +++++++++++++++++-- .../nodes/Postgres/Postgres.node.ts | 38 ++------------ 2 files changed, 52 insertions(+), 38 deletions(-) diff --git a/packages/nodes-base/nodes/Postgres/Postgres.node.functions.ts b/packages/nodes-base/nodes/Postgres/Postgres.node.functions.ts index 83a5701bad..8c46ef7e3a 100644 --- a/packages/nodes-base/nodes/Postgres/Postgres.node.functions.ts +++ b/packages/nodes-base/nodes/Postgres/Postgres.node.functions.ts @@ -38,7 +38,7 @@ function getItemCopy( * @param {input[]} input The Node's input data * @returns Promise> */ -export function executeQuery( +export function pgQuery( getNodeParam: Function, pgp: pgPromise.IMain<{}, pg.IClient>, db: pgPromise.IDatabase<{}, pg.IClient>, @@ -53,16 +53,15 @@ export function executeQuery( } /** - * Returns of copy of the items which only contains the json data and - * of that only the define properties + * Inserts the given items into the database. * * @param {Function} getNodeParam The getter of the Node * @param {pgPromise.IMain<{}, pg.IClient>} pgp The pgPromise instance * @param {pgPromise.IDatabase<{}, pg.IClient>} db The pgPromise database connection * @param {input[]} input The Node's input data - * @returns Promise + * @returns Promise> */ -export async function executeInsert( +export async function pgInsert( getNodeParam: Function, pgp: pgPromise.IMain<{}, pg.IClient>, db: pgPromise.IDatabase<{}, pg.IClient>, @@ -96,3 +95,46 @@ export async function executeInsert( return [insertData, insertItems]; } + +/** + * Updates the given items in the database. + * + * @param {Function} getNodeParam The getter of the Node + * @param {pgPromise.IMain<{}, pg.IClient>} pgp The pgPromise instance + * @param {pgPromise.IDatabase<{}, pg.IClient>} db The pgPromise database connection + * @param {input[]} input The Node's input data + * @returns Promise> + */ +export async function pgUpdate( + getNodeParam: Function, + pgp: pgPromise.IMain<{}, pg.IClient>, + db: pgPromise.IDatabase<{}, pg.IClient>, + items: INodeExecutionData[], +): Promise> { + const table = getNodeParam('table', 0) as string; + const updateKey = getNodeParam('updateKey', 0) as string; + const columnString = getNodeParam('columns', 0) as string; + + const columns = columnString.split(',').map(column => column.trim()); + + // Make sure that the updateKey does also get queried + if (!columns.includes(updateKey)) { + columns.unshift(updateKey); + } + + // Prepare the data to update and copy it to be returned + const updateItems = getItemCopy(items, columns); + + // Generate the multi-row update query + const query = + pgp.helpers.update(updateItems, columns, table) + + ' WHERE v.' + + updateKey + + ' = t.' + + updateKey; + + // Executing the query to update the data + await db.none(query); + + return updateItems; +} diff --git a/packages/nodes-base/nodes/Postgres/Postgres.node.ts b/packages/nodes-base/nodes/Postgres/Postgres.node.ts index a7fe2b72d8..702799c5c2 100644 --- a/packages/nodes-base/nodes/Postgres/Postgres.node.ts +++ b/packages/nodes-base/nodes/Postgres/Postgres.node.ts @@ -8,7 +8,7 @@ import { import * as pgPromise from 'pg-promise'; -import { executeInsert, executeQuery } from './Postgres.node.functions'; +import { pgInsert, pgQuery, pgUpdate } from './Postgres.node.functions'; export class Postgres implements INodeType { description: INodeTypeDescription = { @@ -214,12 +214,7 @@ export class Postgres implements INodeType { // executeQuery // ---------------------------------- - const queryResult = await executeQuery( - this.getNodeParameter, - pgp, - db, - items, - ); + const queryResult = await pgQuery(this.getNodeParameter, pgp, db, items); returnItems = this.helpers.returnJsonArray(queryResult as IDataObject[]); } else if (operation === 'insert') { @@ -227,7 +222,7 @@ export class Postgres implements INodeType { // insert // ---------------------------------- - const [insertData, insertItems] = await executeInsert( + const [insertData, insertItems] = await pgInsert( this.getNodeParameter, pgp, db, @@ -248,32 +243,9 @@ export class Postgres implements INodeType { // update // ---------------------------------- - const table = this.getNodeParameter('table', 0) as string; - const updateKey = this.getNodeParameter('updateKey', 0) as string; - const columnString = this.getNodeParameter('columns', 0) as string; + const updateItems = await pgUpdate(this.getNodeParameter, pgp, db, items); - const columns = columnString.split(',').map(column => column.trim()); - - // // Make sure that the updateKey does also get queried - // if (!columns.includes(updateKey)) { - // columns.unshift(updateKey); - // } - - // // Prepare the data to update and copy it to be returned - // const updateItems = getItemCopy(items, columns); - - // // Generate the multi-row update query - // const query = - // pgp.helpers.update(updateItems, columns, table) + - // ' WHERE v.' + - // updateKey + - // ' = t.' + - // updateKey; - - // // Executing the query to update the data - // await db.none(query); - - // returnItems = this.helpers.returnJsonArray(updateItems as IDataObject[]); + returnItems = this.helpers.returnJsonArray(updateItems); } else { await pgp.end(); throw new Error(`The operation "${operation}" is not supported!`); From 10a26ee75d3763a61926b7971ab5ff9713b2c00c Mon Sep 17 00:00:00 2001 From: Ben Hesseldieck Date: Wed, 8 Jul 2020 14:39:44 +0200 Subject: [PATCH 193/241] :bulb: fix function docs --- packages/nodes-base/nodes/Postgres/Postgres.node.functions.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/nodes-base/nodes/Postgres/Postgres.node.functions.ts b/packages/nodes-base/nodes/Postgres/Postgres.node.functions.ts index 8c46ef7e3a..6855217bd4 100644 --- a/packages/nodes-base/nodes/Postgres/Postgres.node.functions.ts +++ b/packages/nodes-base/nodes/Postgres/Postgres.node.functions.ts @@ -58,7 +58,7 @@ export function pgQuery( * @param {Function} getNodeParam The getter of the Node * @param {pgPromise.IMain<{}, pg.IClient>} pgp The pgPromise instance * @param {pgPromise.IDatabase<{}, pg.IClient>} db The pgPromise database connection - * @param {input[]} input The Node's input data + * @param {INodeExecutionData[]} items The items to be inserted * @returns Promise> */ export async function pgInsert( @@ -102,7 +102,7 @@ export async function pgInsert( * @param {Function} getNodeParam The getter of the Node * @param {pgPromise.IMain<{}, pg.IClient>} pgp The pgPromise instance * @param {pgPromise.IDatabase<{}, pg.IClient>} db The pgPromise database connection - * @param {input[]} input The Node's input data + * @param {INodeExecutionData[]} items The items to be updated * @returns Promise> */ export async function pgUpdate( From cdc42f5558b684c143b990aed3b35e2ec01c9e4d Mon Sep 17 00:00:00 2001 From: Ben Hesseldieck Date: Wed, 8 Jul 2020 15:12:54 +0200 Subject: [PATCH 194/241] :bulb: add in code documentation --- .../nodes-base/nodes/Postgres/Postgres.node.functions.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/nodes-base/nodes/Postgres/Postgres.node.functions.ts b/packages/nodes-base/nodes/Postgres/Postgres.node.functions.ts index 6855217bd4..b07835d1f6 100644 --- a/packages/nodes-base/nodes/Postgres/Postgres.node.functions.ts +++ b/packages/nodes-base/nodes/Postgres/Postgres.node.functions.ts @@ -32,7 +32,7 @@ function getItemCopy( /** * Executes the given SQL query on the database. * - * @param {Function} getNodeParam The getter of the Node + * @param {Function} getNodeParam The getter for the Node's parameters * @param {pgPromise.IMain<{}, pg.IClient>} pgp The pgPromise instance * @param {pgPromise.IDatabase<{}, pg.IClient>} db The pgPromise database connection * @param {input[]} input The Node's input data @@ -55,7 +55,7 @@ export function pgQuery( /** * Inserts the given items into the database. * - * @param {Function} getNodeParam The getter of the Node + * @param {Function} getNodeParam The getter for the Node's parameters * @param {pgPromise.IMain<{}, pg.IClient>} pgp The pgPromise instance * @param {pgPromise.IDatabase<{}, pg.IClient>} db The pgPromise database connection * @param {INodeExecutionData[]} items The items to be inserted @@ -99,7 +99,7 @@ export async function pgInsert( /** * Updates the given items in the database. * - * @param {Function} getNodeParam The getter of the Node + * @param {Function} getNodeParam The getter for the Node's parameters * @param {pgPromise.IMain<{}, pg.IClient>} pgp The pgPromise instance * @param {pgPromise.IDatabase<{}, pg.IClient>} db The pgPromise database connection * @param {INodeExecutionData[]} items The items to be updated From 0b55fc2ed7907a3c9b6bb8b9a7963b5016a22e16 Mon Sep 17 00:00:00 2001 From: Ben Hesseldieck Date: Wed, 8 Jul 2020 13:48:35 +0200 Subject: [PATCH 195/241] :bug: fix insert and update return input --- .../nodes/Microsoft/Sql/MicrosoftSql.node.ts | 30 +++++-------------- 1 file changed, 7 insertions(+), 23 deletions(-) diff --git a/packages/nodes-base/nodes/Microsoft/Sql/MicrosoftSql.node.ts b/packages/nodes-base/nodes/Microsoft/Sql/MicrosoftSql.node.ts index 855a4647a0..a13a2425ca 100644 --- a/packages/nodes-base/nodes/Microsoft/Sql/MicrosoftSql.node.ts +++ b/packages/nodes-base/nodes/Microsoft/Sql/MicrosoftSql.node.ts @@ -222,7 +222,7 @@ export class MicrosoftSql implements INodeType { const pool = new mssql.ConnectionPool(config); await pool.connect(); - let returnItems: INodeExecutionData[] = []; + let returnItems = []; const items = this.getInputData(); const operation = this.getNodeParameter('operation', 0) as string; @@ -249,7 +249,7 @@ export class MicrosoftSql implements INodeType { // ---------------------------------- const tables = createTableStruct(this.getNodeParameter, items); - const queriesResults = await executeQueryQueue( + await executeQueryQueue( tables, ({ table, @@ -274,15 +274,7 @@ export class MicrosoftSql implements INodeType { }, ); - const rowsAffected = flatten(queriesResults).reduce( - (acc: number, resp: mssql.IResult): number => - (acc += resp.rowsAffected.reduce((sum, val) => (sum += val))), - 0, - ); - - returnItems = this.helpers.returnJsonArray({ - rowsAffected, - } as IDataObject); + returnItems = items; } else if (operation === 'update') { // ---------------------------------- // update @@ -297,7 +289,7 @@ export class MicrosoftSql implements INodeType { ['updateKey'].concat(updateKeys), 'updateKey', ); - const queriesResults = await executeQueryQueue( + await executeQueryQueue( tables, ({ table, @@ -326,15 +318,7 @@ export class MicrosoftSql implements INodeType { }, ); - const rowsAffected = flatten(queriesResults).reduce( - (acc: number, resp: mssql.IResult): number => - (acc += resp.rowsAffected.reduce((sum, val) => (sum += val))), - 0, - ); - - returnItems = this.helpers.returnJsonArray({ - rowsAffected, - } as IDataObject); + returnItems = items; } else if (operation === 'delete') { // ---------------------------------- // delete @@ -380,14 +364,14 @@ export class MicrosoftSql implements INodeType { }), ); - const rowsAffected = flatten(queriesResults).reduce( + const rowsDeleted = flatten(queriesResults).reduce( (acc: number, resp: mssql.IResult): number => (acc += resp.rowsAffected.reduce((sum, val) => (sum += val))), 0, ); returnItems = this.helpers.returnJsonArray({ - rowsAffected, + rowsDeleted, } as IDataObject); } else { await pool.close(); From 51bd1b473fa21b3853d27fa78004e87c261dbb32 Mon Sep 17 00:00:00 2001 From: Ben Hesseldieck Date: Wed, 8 Jul 2020 16:03:59 +0200 Subject: [PATCH 196/241] :racehorse: adjust icon dimensions and tinify it --- packages/nodes-base/nodes/QuestDB/questdb.png | Bin 11244 -> 2542 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/packages/nodes-base/nodes/QuestDB/questdb.png b/packages/nodes-base/nodes/QuestDB/questdb.png index 90febff64f5d4facdd03c641e2cb6ffd0d2dd373..85543a9c55466d8cf2ff61ff882c0cea0e433688 100644 GIT binary patch literal 2542 zcmV*P)B zRdcXP<98Wem^-f7SfA5aSdliT)>rC$6>O?T;At5EjKAo44BKKA0ED|-oio^A5CCqd z;B6KFYNFd=7~#{gnE?;b|BEo5|j16ab~t30;+exlI6!zOu`t zW1K$#REvtVb^wLHZLC08lRDR368HM_=JMYC>8Q8aqW3<1ttwr~yHP~7h++`H)f(2=( zLI8`v08WOJxqtod!2avg+-47EpgsV3vEOVAeXC$sm@W0ej9Hj4 zNubRB?YcUW$V`v7JAtjbm__tZl z;l+KjOvBl>{_M#PVVHujX#kYU*~Fghg#`eg%=^rI0EE1i!+2GVw0*N$0Bx%K(wFp^ z9hbg;{OG~}Z>pfekov`n^N#@GYz_L;qx!&x=6D3^f&li|wgAB1^RNx;kQVi}5PG*u z?wJ(uq!IwT+yJ=P0I=2Ypc4SZ-~g1#o6c17s}BIQ*8rl=0GZ4Ij>Z6Pu9C@8j>l4p z#8B;)6#%~50CKc`zEp<6Pynpbd%IDByiNDK2?3qb0BNbC(^Y}NReiZm=!F>g!3zMY z*a3ODhR9f!%v6BAQ0a;o=6@LSrw{<6)c}UT0D!&rxC{Wc-2jTii_BS>&{+4pD*&+C z6r0g?w?q2H5B=VY{oHXgq0hbDsrs)C`njYU0002Hb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gn%e<1&umu*j zf7Vnv=Wt<6Q^{cinHc05i2_m6YMgvd8*MH-%)tZ{oYo+vaJ^Frye7t_Op!SV7=tyI zkTQoRtcsWRJC;3;$R2-!x<#4ImU!0lq#hi5aLv*iBUX|3D2UJV3W5I6A)IE@o5e=1 zT$8)Zk2mz0B34`b#l{zSHx#eAJg)nXzt%)3#HYKyxBG{UCm}tJC}qNhT;MwP7_plw yfw+!>Oosz;-rmVkWDnooyRIiQK1@lkem@Y*#u5z_KK%V3Kt@7Ayh_w4`2PXdVy@T# From 8405d48e0c20f72b1026050f67ec44dc621b2897 Mon Sep 17 00:00:00 2001 From: Ben Hesseldieck Date: Wed, 8 Jul 2020 16:30:21 +0200 Subject: [PATCH 197/241] :zap: complete QuestDB Node --- .../nodes-base/nodes/QuestDB/QuestDB.node.ts | 150 +++++------------- packages/nodes-base/package.json | 2 + 2 files changed, 40 insertions(+), 112 deletions(-) diff --git a/packages/nodes-base/nodes/QuestDB/QuestDB.node.ts b/packages/nodes-base/nodes/QuestDB/QuestDB.node.ts index 8e54e102f7..93dcdbe66d 100644 --- a/packages/nodes-base/nodes/QuestDB/QuestDB.node.ts +++ b/packages/nodes-base/nodes/QuestDB/QuestDB.node.ts @@ -8,31 +8,11 @@ import { import * as pgPromise from 'pg-promise'; - -/** - * Returns of copy of the items which only contains the json data and - * of that only the define properties - * - * @param {INodeExecutionData[]} items The items to copy - * @param {string[]} properties The properties it should include - * @returns - */ -function getItemCopy(items: INodeExecutionData[], properties: string[]): IDataObject[] { - // Prepare the data to insert and copy it to be returned - let newItem: IDataObject; - return items.map((item) => { - newItem = {}; - for (const property of properties) { - if (item.json[property] === undefined) { - newItem[property] = null; - } else { - newItem[property] = JSON.parse(JSON.stringify(item.json[property])); - } - } - return newItem; - }); -} - +import { + pgInsert, + pgQuery, + pgUpdate, +} from '../Postgres/Postgres.node.functions'; export class QuestDB implements INodeType { description: INodeTypeDescription = { @@ -44,7 +24,7 @@ export class QuestDB implements INodeType { description: 'Gets, add and update data in QuestDB.', defaults: { name: 'QuestDB', - color: '#336791', + color: '#2C4A79', }, inputs: ['main'], outputs: ['main'], @@ -52,7 +32,7 @@ export class QuestDB implements INodeType { { name: 'questdb', required: true, - } + }, ], properties: [ { @@ -92,9 +72,7 @@ export class QuestDB implements INodeType { }, displayOptions: { show: { - operation: [ - 'executeQuery' - ], + operation: ['executeQuery'], }, }, default: '', @@ -103,7 +81,6 @@ export class QuestDB implements INodeType { description: 'The SQL query to execute.', }, - // ---------------------------------- // insert // ---------------------------------- @@ -113,9 +90,7 @@ export class QuestDB implements INodeType { type: 'string', displayOptions: { show: { - operation: [ - 'insert' - ], + operation: ['insert'], }, }, default: 'public', @@ -128,9 +103,7 @@ export class QuestDB implements INodeType { type: 'string', displayOptions: { show: { - operation: [ - 'insert' - ], + operation: ['insert'], }, }, default: '', @@ -143,14 +116,13 @@ export class QuestDB implements INodeType { type: 'string', displayOptions: { show: { - operation: [ - 'insert' - ], + operation: ['insert'], }, }, default: '', placeholder: 'id,name,description', - description: 'Comma separated list of the properties which should used as columns for the new rows.', + description: + 'Comma separated list of the properties which should used as columns for the new rows.', }, { displayName: 'Return Fields', @@ -158,16 +130,14 @@ export class QuestDB implements INodeType { type: 'string', displayOptions: { show: { - operation: [ - 'insert' - ], + operation: ['insert'], }, }, default: '*', - description: 'Comma separated list of the fields that the operation will return', + description: + 'Comma separated list of the fields that the operation will return', }, - // ---------------------------------- // update // ---------------------------------- @@ -177,9 +147,7 @@ export class QuestDB implements INodeType { type: 'string', displayOptions: { show: { - operation: [ - 'update' - ], + operation: ['update'], }, }, default: '', @@ -192,14 +160,13 @@ export class QuestDB implements INodeType { type: 'string', displayOptions: { show: { - operation: [ - 'update' - ], + operation: ['update'], }, }, default: 'id', required: true, - description: 'Name of the property which decides which rows in the database should be updated. Normally that would be "id".', + description: + 'Name of the property which decides which rows in the database should be updated. Normally that would be "id".', }, { displayName: 'Columns', @@ -207,22 +174,18 @@ export class QuestDB implements INodeType { type: 'string', displayOptions: { show: { - operation: [ - 'update' - ], + operation: ['update'], }, }, default: '', placeholder: 'name,description', - description: 'Comma separated list of the properties which should used as columns for rows to update.', + description: + 'Comma separated list of the properties which should used as columns for rows to update.', }, - - ] + ], }; - async execute(this: IExecuteFunctions): Promise { - const credentials = this.getCredentials('questdb'); if (credentials === undefined) { @@ -237,8 +200,10 @@ export class QuestDB implements INodeType { database: credentials.database as string, user: credentials.user as string, password: credentials.password as string, - ssl: !['disable', undefined].includes(credentials.ssl as string | undefined), - sslmode: credentials.ssl as string || 'disable', + ssl: !['disable', undefined].includes( + credentials.ssl as string | undefined, + ), + sslmode: (credentials.ssl as string) || 'disable', }; const db = pgp(config); @@ -253,39 +218,20 @@ export class QuestDB implements INodeType { // executeQuery // ---------------------------------- - const queries: string[] = []; - for (let i = 0; i < items.length; i++) { - queries.push(this.getNodeParameter('query', i) as string); - } - - const queryResult = await db.any(pgp.helpers.concat(queries)); + const queryResult = await pgQuery(this.getNodeParameter, pgp, db, items); returnItems = this.helpers.returnJsonArray(queryResult as IDataObject[]); - } else if (operation === 'insert') { // ---------------------------------- // insert // ---------------------------------- - const table = this.getNodeParameter('table', 0) as string; - const schema = this.getNodeParameter('schema', 0) as string; - let returnFields = (this.getNodeParameter('returnFields', 0) as string).split(',') as string[]; - const columnString = this.getNodeParameter('columns', 0) as string; - const columns = columnString.split(',').map(column => column.trim()); - - const cs = new pgp.helpers.ColumnSet(columns); - - const te = new pgp.helpers.TableName({ table, schema }); - - // Prepare the data to insert and copy it to be returned - const insertItems = getItemCopy(items, columns); - - // Generate the multi-row insert query and return the id of new row - returnFields = returnFields.map(value => value.trim()).filter(value => !!value); - const query = pgp.helpers.insert(insertItems, cs, te) + (returnFields.length ? ` RETURNING ${returnFields.join(',')}` : ''); - - // Executing the query to insert the data - const insertData = await db.manyOrNone(query); + const [insertData, insertItems] = await pgInsert( + this.getNodeParameter, + pgp, + db, + items, + ); // Add the id to the data for (let i = 0; i < insertData.length; i++) { @@ -293,37 +239,17 @@ export class QuestDB implements INodeType { json: { ...insertData[i], ...insertItems[i], - } + }, }); } - } else if (operation === 'update') { // ---------------------------------- // update // ---------------------------------- - const table = this.getNodeParameter('table', 0) as string; - const updateKey = this.getNodeParameter('updateKey', 0) as string; - const columnString = this.getNodeParameter('columns', 0) as string; - - const columns = columnString.split(',').map(column => column.trim()); - - // Make sure that the updateKey does also get queried - if (!columns.includes(updateKey)) { - columns.unshift(updateKey); - } - - // Prepare the data to update and copy it to be returned - const updateItems = getItemCopy(items, columns); - - // Generate the multi-row update query - const query = pgp.helpers.update(updateItems, columns, table) + ' WHERE v.' + updateKey + ' = t.' + updateKey; - - // Executing the query to update the data - await db.none(query); - - returnItems = this.helpers.returnJsonArray(updateItems as IDataObject[]); + const updateItems = await pgUpdate(this.getNodeParameter, pgp, db, items); + returnItems = this.helpers.returnJsonArray(updateItems); } else { await pgp.end(); throw new Error(`The operation "${operation}" is not supported!`); diff --git a/packages/nodes-base/package.json b/packages/nodes-base/package.json index 3c51466ea3..99fc37c9b0 100644 --- a/packages/nodes-base/package.json +++ b/packages/nodes-base/package.json @@ -112,6 +112,7 @@ "dist/credentials/PipedriveApi.credentials.js", "dist/credentials/Postgres.credentials.js", "dist/credentials/PostmarkApi.credentials.js", + "dist/credentials/Questdb.credentials.js", "dist/credentials/Redis.credentials.js", "dist/credentials/RocketchatApi.credentials.js", "dist/credentials/RundeckApi.credentials.js", @@ -260,6 +261,7 @@ "dist/nodes/Pipedrive/PipedriveTrigger.node.js", "dist/nodes/Postgres/Postgres.node.js", "dist/nodes/Postmark/PostmarkTrigger.node.js", + "dist/nodes/QuestDB/QuestDB.node.js", "dist/nodes/ReadBinaryFile.node.js", "dist/nodes/ReadBinaryFiles.node.js", "dist/nodes/ReadPdf.node.js", From 6870b4dfd3b4602693f3c96bcf3194ae4c050a37 Mon Sep 17 00:00:00 2001 From: Ben Hesseldieck Date: Wed, 8 Jul 2020 16:36:15 +0200 Subject: [PATCH 198/241] :rewind: Revert "adjust icon dimensions and tinify it" This reverts commit 51bd1b473fa21b3853d27fa78004e87c261dbb32. --- packages/nodes-base/nodes/QuestDB/questdb.png | Bin 2542 -> 11244 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/packages/nodes-base/nodes/QuestDB/questdb.png b/packages/nodes-base/nodes/QuestDB/questdb.png index 85543a9c55466d8cf2ff61ff882c0cea0e433688..90febff64f5d4facdd03c641e2cb6ffd0d2dd373 100644 GIT binary patch literal 11244 zcmZ{K1yCKqvi8B<-A{0Lcemi~&cWT?B{&3vy9R;>m*DR1?(PoxlY8&G@78<&o2uFA z?f$;*o}H=PsjmH^q#%U^j}H$30FY#)#Z~@{(tkTF^q;HxdA$?>0KaD?CZ;4KCI(b; zb^uw~n*T9>NlArKQ(eXmpX@mPln+G;q_~T71(${sz!c$)l$91mmxZM%i_GpuBSfGj z&5JvVj0`RmORNPJEJ1gJKY*cOxe?M+!;iFek#Vz~b~J4m*c|#UFI(i+U-D9&{sJU? z)go1f{(&f5qC^{qc$eQ#MLy%G2*6JW!rx(zW$cl1@kr`W%t_447HcHb&0m7J>^+>VguP{RA`-Y&=h|`TW$O~mKvRM0n z4rd)n8-@~rb$!*MXF&lZaiN#)*LX=2sj&7mipB{?USWp{Ec;@^Y%7FTva;1vdLkOL zksCq+mSK&(N4Pk=0>0;xR!^E-@A1zs7Hz*nqANq&EdPGC{Ae-<4V5f1i)8iTz(^>t zxKatwiBI$-du`9sZ^<2sc|6tSrCEVK`(l))_ue2RPL8MH@Q!~E29&hNCF2Q<>wO8B zV~?&U-M1-@^23`QL!bOX_c=as@L8{<-Jem2*FM7qvi7z_JBb*J_3JKOe6)Gu&AUrj zkRaPB^pMYFvhQqlAWbgaz7))`kHz>|E}hxfTyo#&Yn)Up=@F=4;z>02jZ+&H`**>0T{_pAgUt(CsG7{2pmrs-m(h?HV`s0!GS)I zkc!6RyK4c@CjB&PZQx+)4DJxp-b|WkV=UJA#=-`6;Fni^H}MT+s!JO24pxj&d$6ts zRJa?E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1vOEO2(g#Hw>Hwp$iD!PCvnGXl0t;GNpV+h?w`fJj9E$Cca~ zRuQu=93a3sz?uFVpq58FMTjoahl{?168|nR=>IT&07b$EJPeHoPXGV_07*qoM6N<$ Eg1%4-ApigX From 9f39156994173c895edb9daf4bc3a61f2eed60fe Mon Sep 17 00:00:00 2001 From: Ben Hesseldieck Date: Wed, 8 Jul 2020 16:44:05 +0200 Subject: [PATCH 199/241] :racehorse: tinify icon --- packages/nodes-base/nodes/QuestDB/questdb.png | Bin 11244 -> 2835 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/packages/nodes-base/nodes/QuestDB/questdb.png b/packages/nodes-base/nodes/QuestDB/questdb.png index 90febff64f5d4facdd03c641e2cb6ffd0d2dd373..5be1906e5d9d408257f4d2831489dc310126ecaf 100644 GIT binary patch literal 2835 zcmV+u3+(iXP)WmlwQHt2?&Hm}E*bBRV0G7q!a1QW~002>n0CA_HQ;Pte%+=%0+hY^xeFa~dI{<2- z0E4^TWe@6l1$?Vx)>jbz=+>&yllszj{n%Mqt=0g7wg8R7_`Y%gl*a&et>SSDUz
e!5NWn-uMq6!fwT0E)wXyHWw6(*U5(0CTkfZ?KolQIN+`0G!PLkH@dt zSn7@z0GZ2z!c>UCPw=7>@um@l$5^1zREfk>@~jR3wcG%;*8+mP0eZTU%2Rr`OXYqT z_rMSUl*gylR*uS6o6lA4eirku3--JO|Ns7z(OZ_ySNOvL0I%BsrqlqG%Z$TK;cyxN z%jf{A*Z_vW0Arzxz-oTHR`QS(0KVS%cjBr2tlr|GiCWv@ZI$DEFQaAbzlsG9Ib`005J8QchC<0s{mC0{#g8{{H^` z{tW*9{3QPVfJFV+7#05geE$8ftY=zMJt`m){{8&%*v-bVdQvq0{{8xVSvUUu{qx?k ztcZVQME?H%{{H^{{rvRt@$Ki+&8D4|hihL&C;t8Y{OID)&BDODv7MZnmxF3TJ1+kI z{{8gr?9$A}z`mWFeraJTB>nT<*wxj?#>B6mYDSJr*%<%;2RKPYK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!h#{>Y%RBbRhOEM+thPkPrGF#|2(OGaRxs43t=YaaX&FG80lG9h!WGKUtez zRhaC2xZ7X!KVR6aAt|q|m3hSG5Wf{SIJQyK;tAsw3Uc6@j@HJZw|f+jV>JlPc|y1! z`88cfcaH;jk>?jE8;oRD3+ZS@yhX_2G?FMq4yOwl*y+TW`mjKT6<(gn%e<1&umu*j zf7Vnv=Wt<6Q^{cinHc05i2_m6YMgvd8*MH-%)tZ{oYo+vaJ^Frye7t_Op!SV7=tyI zkTQoRtcsWRJC;3;$R2-!x<#4ImU!0lq#hi5aLv*iBUX|3D2UJV3W5I6A)IE@o5e=1 zT$8)Zk2mz0B34`b#l{zSHx#eAJg)nXzt%)3#HYKyxBG{UCm}tJC}qNhT;MwP7_plw yfw+!>Oosz;-rmVkWDnooyRIiQK1@lkem@Y*#u5z_KK%V3Kt@7Ayh_w4`2PXdVy@T# From e32ec5b206581f45ea2a55c231671c041a319536 Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Wed, 8 Jul 2020 16:47:08 +0200 Subject: [PATCH 200/241] :bookmark: Release n8n-nodes-base@0.68.1 --- packages/nodes-base/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/nodes-base/package.json b/packages/nodes-base/package.json index 1141485b4c..b3ccc3e267 100644 --- a/packages/nodes-base/package.json +++ b/packages/nodes-base/package.json @@ -1,6 +1,6 @@ { "name": "n8n-nodes-base", - "version": "0.68.0", + "version": "0.68.1", "description": "Base nodes of n8n", "license": "SEE LICENSE IN LICENSE.md", "homepage": "https://n8n.io", From b3671380e3642d276a557e7d57086d3c5cb7fd2e Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Wed, 8 Jul 2020 16:48:54 +0200 Subject: [PATCH 201/241] :arrow_up: Set n8n-nodes-base@0.68.1 on n8n --- packages/cli/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/cli/package.json b/packages/cli/package.json index 0bda408ec3..ab9d715f37 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -102,7 +102,7 @@ "mysql2": "^2.0.1", "n8n-core": "~0.38.0", "n8n-editor-ui": "~0.49.0", - "n8n-nodes-base": "~0.68.0", + "n8n-nodes-base": "~0.68.1", "n8n-workflow": "~0.34.0", "oauth-1.0a": "^2.2.6", "open": "^7.0.0", From 16bd10fbd11f595862501ecac73f7985d74f853a Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Wed, 8 Jul 2020 16:50:15 +0200 Subject: [PATCH 202/241] :bookmark: Release n8n@0.73.1 --- packages/cli/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/cli/package.json b/packages/cli/package.json index ab9d715f37..e9b16ad9e2 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "n8n", - "version": "0.73.0", + "version": "0.73.1", "description": "n8n Workflow Automation Tool", "license": "SEE LICENSE IN LICENSE.md", "homepage": "https://n8n.io", From e07da55a1a538a05f322b9d089008b65f235f0ea Mon Sep 17 00:00:00 2001 From: smamudhan <48641776+smamudhan@users.noreply.github.com> Date: Thu, 9 Jul 2020 18:03:05 +0530 Subject: [PATCH 203/241] Typographical changes to ensure consistency with docs (#740) * Updated Dropdown Descriptions to match documentation * Removed full stops and hyphens in field descriptions * Removed hyphen on description on line 267 * Fixed typographical errors for Github node * Fixed typo for Zoom Credentials * Changed Postgres node description to match Postgres docs (https://github.com/n8n-io/n8n-docs/pull/30) * Changed Rocketchat displayname to RocketChat * Fixed typographical errors (and matched with docs) for Trello node descriptions * Updated Jira node descriptions to match docs --- packages/nodes-base/credentials/ZoomApi.credentials.ts | 2 +- packages/nodes-base/nodes/Jira/IssueDescription.ts | 4 ++-- packages/nodes-base/nodes/Postgres/Postgres.node.ts | 6 +++--- packages/nodes-base/nodes/Rocketchat/Rocketchat.node.ts | 6 +++--- packages/nodes-base/nodes/Trello/AttachmentDescription.ts | 2 +- packages/nodes-base/nodes/Trello/ChecklistDescription.ts | 6 +++--- packages/nodes-base/nodes/Trello/LabelDescription.ts | 2 +- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/packages/nodes-base/credentials/ZoomApi.credentials.ts b/packages/nodes-base/credentials/ZoomApi.credentials.ts index dbef996429..6efd857568 100644 --- a/packages/nodes-base/credentials/ZoomApi.credentials.ts +++ b/packages/nodes-base/credentials/ZoomApi.credentials.ts @@ -5,7 +5,7 @@ export class ZoomApi implements ICredentialType { displayName = 'Zoom API'; properties = [ { - displayName: 'JTW Token', + displayName: 'JWT Token', name: 'accessToken', type: 'string' as NodePropertyTypes, default: '' diff --git a/packages/nodes-base/nodes/Jira/IssueDescription.ts b/packages/nodes-base/nodes/Jira/IssueDescription.ts index bdb06179df..d29c9a5350 100644 --- a/packages/nodes-base/nodes/Jira/IssueDescription.ts +++ b/packages/nodes-base/nodes/Jira/IssueDescription.ts @@ -41,12 +41,12 @@ export const issueOperations = [ { name: 'Notify', value: 'notify', - description: 'Creates an email notification for an issue and adds it to the mail queue.', + description: 'Create an email notification for an issue and add it to the mail queue', }, { name: 'Status', value: 'transitions', - description: `Returns either all transitions or a transition that can be performed by the user on an issue, based on the issue's status.`, + description: `Return either all transitions or a transition that can be performed by the user on an issue, based on the issue's status`, }, { name: 'Delete', diff --git a/packages/nodes-base/nodes/Postgres/Postgres.node.ts b/packages/nodes-base/nodes/Postgres/Postgres.node.ts index 2fa010576b..ad074a5f51 100644 --- a/packages/nodes-base/nodes/Postgres/Postgres.node.ts +++ b/packages/nodes-base/nodes/Postgres/Postgres.node.ts @@ -63,17 +63,17 @@ export class Postgres implements INodeType { { name: 'Execute Query', value: 'executeQuery', - description: 'Executes a SQL query.', + description: 'Execute an SQL query', }, { name: 'Insert', value: 'insert', - description: 'Insert rows in database.', + description: 'Insert rows in database', }, { name: 'Update', value: 'update', - description: 'Updates rows in database.', + description: 'Update rows in database', }, ], default: 'insert', diff --git a/packages/nodes-base/nodes/Rocketchat/Rocketchat.node.ts b/packages/nodes-base/nodes/Rocketchat/Rocketchat.node.ts index e83a3afbfe..65dd1a6820 100644 --- a/packages/nodes-base/nodes/Rocketchat/Rocketchat.node.ts +++ b/packages/nodes-base/nodes/Rocketchat/Rocketchat.node.ts @@ -48,15 +48,15 @@ interface IPostMessageBody { export class Rocketchat implements INodeType { description: INodeTypeDescription = { - displayName: 'Rocketchat', + displayName: 'RocketChat', name: 'rocketchat', icon: 'file:rocketchat.png', group: ['output'], version: 1, subtitle: '={{$parameter["resource"] + ": " + $parameter["operation"]}}', - description: 'Consume Rocketchat API', + description: 'Consume RocketChat API', defaults: { - name: 'Rocketchat', + name: 'RocketChat', color: '#c02428', }, inputs: ['main'], diff --git a/packages/nodes-base/nodes/Trello/AttachmentDescription.ts b/packages/nodes-base/nodes/Trello/AttachmentDescription.ts index a04f507518..4306b2ed11 100644 --- a/packages/nodes-base/nodes/Trello/AttachmentDescription.ts +++ b/packages/nodes-base/nodes/Trello/AttachmentDescription.ts @@ -29,7 +29,7 @@ export const attachmentOperations = [ { name: 'Get', value: 'get', - description: 'Get the data of an attachments', + description: 'Get the data of an attachment', }, { name: 'Get All', diff --git a/packages/nodes-base/nodes/Trello/ChecklistDescription.ts b/packages/nodes-base/nodes/Trello/ChecklistDescription.ts index 34036f83e2..be11ba6f17 100644 --- a/packages/nodes-base/nodes/Trello/ChecklistDescription.ts +++ b/packages/nodes-base/nodes/Trello/ChecklistDescription.ts @@ -44,17 +44,17 @@ export const checklistOperations = [ { name: 'Get Checklist Items', value: 'getCheckItem', - description: 'Get a specific Checklist on a card', + description: 'Get a specific checklist on a card', }, { name: 'Get Completed Checklist Items', value: 'completedCheckItems', - description: 'Get the completed Checklist items on a card', + description: 'Get the completed checklist items on a card', }, { name: 'Update Checklist Item', value: 'updateCheckItem', - description: 'Update an item in a checklist on a card.', + description: 'Update an item in a checklist on a card', }, ], default: 'getAll', diff --git a/packages/nodes-base/nodes/Trello/LabelDescription.ts b/packages/nodes-base/nodes/Trello/LabelDescription.ts index 9c23053282..2b938ae5de 100644 --- a/packages/nodes-base/nodes/Trello/LabelDescription.ts +++ b/packages/nodes-base/nodes/Trello/LabelDescription.ts @@ -39,7 +39,7 @@ export const labelOperations = [ { name: 'Get All', value: 'getAll', - description: 'Returns all label for the board', + description: 'Returns all labels for the board', }, { name: 'Remove From Card', From 05507fc19b848b8fd8f293b817da734154210d74 Mon Sep 17 00:00:00 2001 From: Ben Hesseldieck Date: Thu, 9 Jul 2020 15:17:47 +0200 Subject: [PATCH 204/241] :tada: basic throtteling with cleaning logs --- .../cli/src/WorkflowExecuteAdditionalData.ts | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/packages/cli/src/WorkflowExecuteAdditionalData.ts b/packages/cli/src/WorkflowExecuteAdditionalData.ts index ed20a985f8..86e5c3fe22 100644 --- a/packages/cli/src/WorkflowExecuteAdditionalData.ts +++ b/packages/cli/src/WorkflowExecuteAdditionalData.ts @@ -41,6 +41,8 @@ import { import * as config from '../config'; +import { LessThanOrEqual } from "typeorm"; + /** * Checks if there was an error and if errorWorkflow is defined. If so it collects @@ -79,6 +81,25 @@ function executeErrorWorkflow(workflowData: IWorkflowBase, fullRunData: IRun, mo } } +/** + * Prunes Saved Execution which are older than configured. + * Throttled to be executed just once in configured timeframe. + * + */ +let inThrottle: boolean; +function pruneSavedExecutions(): void { + console.log('THROTTLE:', inThrottle); + if (!inThrottle) { + inThrottle = true; + Db.collections.Execution!.delete({ startedAt: LessThanOrEqual(new Date().toISOString()) }); + console.log('Deleting logs'); + setTimeout(() => { + console.log('resetting throttle'); + inThrottle = false; + }, 30000); + } +} + /** * Pushes the execution out to all connected clients @@ -251,6 +272,7 @@ function hookFunctionsSave(parentProcessMode?: string): IWorkflowExecuteHooks { // Save the Execution in DB const executionResult = await Db.collections.Execution!.save(executionData as IExecutionFlattedDb); + pruneSavedExecutions() if (fullRunData.finished === true && this.retryOf !== undefined) { // If the retry was successful save the reference it on the original execution From b956444c0e41c24c426daaac91e597093c7ef129 Mon Sep 17 00:00:00 2001 From: Ben Hesseldieck Date: Thu, 9 Jul 2020 16:52:38 +0200 Subject: [PATCH 205/241] :racehorse: pruning execution data complete --- packages/cli/config/index.ts | 25 ++++++++++++-- .../cli/src/WorkflowExecuteAdditionalData.ts | 33 ++++++++++++------- 2 files changed, 44 insertions(+), 14 deletions(-) diff --git a/packages/cli/config/index.ts b/packages/cli/config/index.ts index 847587460f..0022c08b7a 100644 --- a/packages/cli/config/index.ts +++ b/packages/cli/config/index.ts @@ -161,8 +161,8 @@ const config = convict({ // If a workflow executes all the data gets saved by default. This // could be a problem when a workflow gets executed a lot and processes - // a lot of data. To not write the database full it is possible to - // not save the execution at all. + // a lot of data. To not exceed the database's capacity it is possible to + // prune the database regularly or to not save the execution at all. // Depending on if the execution did succeed or error a different // save behaviour can be set. saveDataOnError: { @@ -188,6 +188,27 @@ const config = convict({ default: false, env: 'EXECUTIONS_DATA_SAVE_MANUAL_EXECUTIONS' }, + + // To not exceed the database's capacity and keep its size moderate + // the execution data gets pruned regularly (default: 1 hour interval). + // All saved execution data older than the max age will be deleted. + // Pruning is currently not activated by default, which will change in + // a future version. + pruneData: { + doc: 'Delete data of past executions on a rolling basis', + default: false, + env: 'EXECUTIONS_DATA_PRUNE' + }, + pruneDataMaxAge: { + doc: 'How old (hours) the execution data has to be to get deleted', + default: 336, + env: 'EXECUTIONS_DATA_MAX_AGE' + }, + pruneDataTimeout: { + doc: 'Timeout (ms) after execution data has been pruned', + default: 3600000, + env: 'EXECUTIONS_DATA_PRUNE_TIMEOUT' + }, }, generic: { diff --git a/packages/cli/src/WorkflowExecuteAdditionalData.ts b/packages/cli/src/WorkflowExecuteAdditionalData.ts index 86e5c3fe22..9b55f88b58 100644 --- a/packages/cli/src/WorkflowExecuteAdditionalData.ts +++ b/packages/cli/src/WorkflowExecuteAdditionalData.ts @@ -86,17 +86,22 @@ function executeErrorWorkflow(workflowData: IWorkflowBase, fullRunData: IRun, mo * Throttled to be executed just once in configured timeframe. * */ -let inThrottle: boolean; -function pruneSavedExecutions(): void { - console.log('THROTTLE:', inThrottle); - if (!inThrottle) { - inThrottle = true; - Db.collections.Execution!.delete({ startedAt: LessThanOrEqual(new Date().toISOString()) }); - console.log('Deleting logs'); - setTimeout(() => { - console.log('resetting throttle'); - inThrottle = false; - }, 30000); +let throttling: boolean; +function pruneExecutionData(): void { + if (!throttling) { + throttling = true; + const timeout = config.get('executions.pruneDataTimeout') as number; // in ms + const maxAge = config.get('executions.pruneDataMaxAge') as number; // in h + const date = new Date(); // today + date.setHours(date.getHours() - maxAge); + + // throttle just on success to allow for self healing on failure + Db.collections.Execution!.delete({ startedAt: LessThanOrEqual(date.toISOString()) }) + .then(data => + setTimeout(() => { + throttling = false; + }, timeout) + ).catch(err => throttling = false) } } @@ -272,7 +277,6 @@ function hookFunctionsSave(parentProcessMode?: string): IWorkflowExecuteHooks { // Save the Execution in DB const executionResult = await Db.collections.Execution!.save(executionData as IExecutionFlattedDb); - pruneSavedExecutions() if (fullRunData.finished === true && this.retryOf !== undefined) { // If the retry was successful save the reference it on the original execution @@ -280,6 +284,11 @@ function hookFunctionsSave(parentProcessMode?: string): IWorkflowExecuteHooks { await Db.collections.Execution!.update(this.retryOf, { retrySuccessId: executionResult.id }); } + // Prune old execution data + if (config.get('executions.pruneData')) { + pruneExecutionData() + } + if (!isManualMode) { executeErrorWorkflow(this.workflowData, fullRunData, this.mode, executionResult ? executionResult.id as string : undefined, this.retryOf); } From 3bf34cffa90a1810b265d5ce0872d25db13a658c Mon Sep 17 00:00:00 2001 From: Ben Hesseldieck Date: Thu, 9 Jul 2020 17:16:45 +0200 Subject: [PATCH 206/241] :art: fix format --- .../credentials/Questdb.credentials.ts | 8 ++---- .../nodes/Postgres/Postgres.node.functions.ts | 19 +++---------- .../nodes/Postgres/Postgres.node.ts | 21 +++------------ .../nodes-base/nodes/QuestDB/QuestDB.node.ts | 27 ++++--------------- 4 files changed, 15 insertions(+), 60 deletions(-) diff --git a/packages/nodes-base/credentials/Questdb.credentials.ts b/packages/nodes-base/credentials/Questdb.credentials.ts index 5cd60f960a..3672f6204d 100644 --- a/packages/nodes-base/credentials/Questdb.credentials.ts +++ b/packages/nodes-base/credentials/Questdb.credentials.ts @@ -1,8 +1,4 @@ -import { - ICredentialType, - NodePropertyTypes, -} from 'n8n-workflow'; - +import { ICredentialType, NodePropertyTypes } from 'n8n-workflow'; export class QuestDB implements ICredentialType { name = 'questdb'; @@ -59,7 +55,7 @@ export class QuestDB implements ICredentialType { { name: 'verify-full (not implemented)', value: 'verify-full', - } + }, ], default: 'disable', }, diff --git a/packages/nodes-base/nodes/Postgres/Postgres.node.functions.ts b/packages/nodes-base/nodes/Postgres/Postgres.node.functions.ts index b07835d1f6..fb4c50051c 100644 --- a/packages/nodes-base/nodes/Postgres/Postgres.node.functions.ts +++ b/packages/nodes-base/nodes/Postgres/Postgres.node.functions.ts @@ -10,10 +10,7 @@ import pg = require('pg-promise/typescript/pg-subset'); * @param {string[]} properties The properties it should include * @returns */ -function getItemCopy( - items: INodeExecutionData[], - properties: string[], -): IDataObject[] { +function getItemCopy(items: INodeExecutionData[], properties: string[]): IDataObject[] { // Prepare the data to insert and copy it to be returned let newItem: IDataObject; return items.map(item => { @@ -69,9 +66,7 @@ export async function pgInsert( ): Promise> { const table = getNodeParam('table', 0) as string; const schema = getNodeParam('schema', 0) as string; - let returnFields = (getNodeParam('returnFields', 0) as string).split( - ',', - ) as string[]; + let returnFields = (getNodeParam('returnFields', 0) as string).split(',') as string[]; const columnString = getNodeParam('columns', 0) as string; const columns = columnString.split(',').map(column => column.trim()); @@ -83,9 +78,7 @@ export async function pgInsert( const insertItems = getItemCopy(items, columns); // Generate the multi-row insert query and return the id of new row - returnFields = returnFields - .map(value => value.trim()) - .filter(value => !!value); + returnFields = returnFields.map(value => value.trim()).filter(value => !!value); const query = pgp.helpers.insert(insertItems, cs, te) + (returnFields.length ? ` RETURNING ${returnFields.join(',')}` : ''); @@ -127,11 +120,7 @@ export async function pgUpdate( // Generate the multi-row update query const query = - pgp.helpers.update(updateItems, columns, table) + - ' WHERE v.' + - updateKey + - ' = t.' + - updateKey; + pgp.helpers.update(updateItems, columns, table) + ' WHERE v.' + updateKey + ' = t.' + updateKey; // Executing the query to update the data await db.none(query); diff --git a/packages/nodes-base/nodes/Postgres/Postgres.node.ts b/packages/nodes-base/nodes/Postgres/Postgres.node.ts index 702799c5c2..847620a6fa 100644 --- a/packages/nodes-base/nodes/Postgres/Postgres.node.ts +++ b/packages/nodes-base/nodes/Postgres/Postgres.node.ts @@ -1,10 +1,5 @@ import { IExecuteFunctions } from 'n8n-core'; -import { - IDataObject, - INodeExecutionData, - INodeType, - INodeTypeDescription, -} from 'n8n-workflow'; +import { IDataObject, INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow'; import * as pgPromise from 'pg-promise'; @@ -130,8 +125,7 @@ export class Postgres implements INodeType { }, }, default: '*', - description: - 'Comma separated list of the fields that the operation will return', + description: 'Comma separated list of the fields that the operation will return', }, // ---------------------------------- @@ -196,9 +190,7 @@ export class Postgres implements INodeType { database: credentials.database as string, user: credentials.user as string, password: credentials.password as string, - ssl: !['disable', undefined].includes( - credentials.ssl as string | undefined, - ), + ssl: !['disable', undefined].includes(credentials.ssl as string | undefined), sslmode: (credentials.ssl as string) || 'disable', }; @@ -222,12 +214,7 @@ export class Postgres implements INodeType { // insert // ---------------------------------- - const [insertData, insertItems] = await pgInsert( - this.getNodeParameter, - pgp, - db, - items, - ); + const [insertData, insertItems] = await pgInsert(this.getNodeParameter, pgp, db, items); // Add the id to the data for (let i = 0; i < insertData.length; i++) { diff --git a/packages/nodes-base/nodes/QuestDB/QuestDB.node.ts b/packages/nodes-base/nodes/QuestDB/QuestDB.node.ts index 93dcdbe66d..bc8af9f17c 100644 --- a/packages/nodes-base/nodes/QuestDB/QuestDB.node.ts +++ b/packages/nodes-base/nodes/QuestDB/QuestDB.node.ts @@ -1,18 +1,9 @@ import { IExecuteFunctions } from 'n8n-core'; -import { - IDataObject, - INodeExecutionData, - INodeType, - INodeTypeDescription, -} from 'n8n-workflow'; +import { IDataObject, INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow'; import * as pgPromise from 'pg-promise'; -import { - pgInsert, - pgQuery, - pgUpdate, -} from '../Postgres/Postgres.node.functions'; +import { pgInsert, pgQuery, pgUpdate } from '../Postgres/Postgres.node.functions'; export class QuestDB implements INodeType { description: INodeTypeDescription = { @@ -134,8 +125,7 @@ export class QuestDB implements INodeType { }, }, default: '*', - description: - 'Comma separated list of the fields that the operation will return', + description: 'Comma separated list of the fields that the operation will return', }, // ---------------------------------- @@ -200,9 +190,7 @@ export class QuestDB implements INodeType { database: credentials.database as string, user: credentials.user as string, password: credentials.password as string, - ssl: !['disable', undefined].includes( - credentials.ssl as string | undefined, - ), + ssl: !['disable', undefined].includes(credentials.ssl as string | undefined), sslmode: (credentials.ssl as string) || 'disable', }; @@ -226,12 +214,7 @@ export class QuestDB implements INodeType { // insert // ---------------------------------- - const [insertData, insertItems] = await pgInsert( - this.getNodeParameter, - pgp, - db, - items, - ); + const [insertData, insertItems] = await pgInsert(this.getNodeParameter, pgp, db, items); // Add the id to the data for (let i = 0; i < insertData.length; i++) { From bf81b064e15c5ec0118399f5b04bbab81395fdf5 Mon Sep 17 00:00:00 2001 From: ricardo Date: Thu, 9 Jul 2020 13:37:35 -0400 Subject: [PATCH 207/241] :zap: Improvements to Mailchimp-Node --- .../nodes/Mailchimp/GenericFunctions.ts | 1 - .../nodes/Mailchimp/Mailchimp.node.ts | 348 +++++++++++++++++- 2 files changed, 347 insertions(+), 2 deletions(-) diff --git a/packages/nodes-base/nodes/Mailchimp/GenericFunctions.ts b/packages/nodes-base/nodes/Mailchimp/GenericFunctions.ts index 59362b50d6..99c0af67fd 100644 --- a/packages/nodes-base/nodes/Mailchimp/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Mailchimp/GenericFunctions.ts @@ -49,7 +49,6 @@ export async function mailchimpApiRequest(this: IHookFunctions | IExecuteFunctio const datacenter = (credentials.apiKey as string).split('-').pop(); options.url = `https://${datacenter}.${host}${endpoint}`; - return await this.helpers.request!(options); } else { const credentials = this.getCredentials('mailchimpOAuth2Api') as IDataObject; diff --git a/packages/nodes-base/nodes/Mailchimp/Mailchimp.node.ts b/packages/nodes-base/nodes/Mailchimp/Mailchimp.node.ts index 25dbeb9984..443fd5d20c 100644 --- a/packages/nodes-base/nodes/Mailchimp/Mailchimp.node.ts +++ b/packages/nodes-base/nodes/Mailchimp/Mailchimp.node.ts @@ -47,6 +47,7 @@ interface ICreateMemberBody { timestamp_opt?: string; tags?: string[]; merge_fields?: IDataObject; + interests?: IDataObject; } export class Mailchimp implements INodeType { @@ -112,6 +113,10 @@ export class Mailchimp implements INodeType { name: 'resource', type: 'options', options: [ + { + name: 'List Group', + value: 'listGroup', + }, { name: 'Member', value: 'member', @@ -194,6 +199,28 @@ export class Mailchimp implements INodeType { default: 'create', description: 'The operation to perform.', }, + { + displayName: 'Operation', + name: 'operation', + type: 'options', + required: true, + displayOptions: { + show: { + resource: [ + 'listGroup', + ], + }, + }, + options: [ + { + name: 'Get All', + value: 'getAll', + description: 'Get all groups', + }, + ], + default: 'getAll', + description: 'The operation to perform.', + }, /* -------------------------------------------------------------------------- */ /* member:create */ /* -------------------------------------------------------------------------- */ @@ -534,6 +561,89 @@ export class Mailchimp implements INodeType { }, }, }, + { + displayName: 'Interest Groups', + name: 'groupsUi', + placeholder: 'Add Interest Group', + type: 'fixedCollection', + default: {}, + typeOptions: { + multipleValues: true, + }, + displayOptions: { + show: { + resource:[ + 'member' + ], + operation: [ + 'create', + ], + jsonParameters: [ + false, + ], + }, + }, + options: [ + { + name: 'groupsValues', + displayName: 'Group', + typeOptions: { + multipleValueButtonText: 'Add Interest Group', + }, + values: [ + { + displayName: 'Category ID', + name: 'categoryId', + type: 'options', + typeOptions: { + loadOptionsMethod: 'getGroupCategories', + loadOptionsDependsOn: [ + 'list', + ], + }, + default: '', + }, + { + displayName: 'Category Field ID', + name: 'categoryFieldId', + type: 'string', + default: '', + description: '', + }, + { + displayName: 'Value', + name: 'value', + type: 'boolean', + default: false, + description: '', + }, + ], + }, + ], + }, + { + displayName: 'Interest Groups', + name: 'groupJson', + type: 'json', + typeOptions: { + alwaysOpenEditWindow: true, + }, + default: '', + description: '', + displayOptions: { + show: { + resource:[ + 'member', + ], + operation: [ + 'create', + ], + jsonParameters: [ + true, + ], + }, + }, + }, /* -------------------------------------------------------------------------- */ /* member:delete */ /* -------------------------------------------------------------------------- */ @@ -922,6 +1032,66 @@ export class Mailchimp implements INodeType { default: '', description: 'Type of email this member asked to get', }, + { + displayName: 'Interest Groups', + name: 'groupsUi', + placeholder: 'Add Interest Group', + type: 'fixedCollection', + default: {}, + typeOptions: { + multipleValues: true, + }, + displayOptions: { + show: { + '/resource':[ + 'member' + ], + '/operation':[ + 'update', + ], + '/jsonParameters': [ + false, + ], + }, + }, + options: [ + { + name: 'groupsValues', + displayName: 'Group', + typeOptions: { + multipleValueButtonText: 'Add Interest Group', + }, + values: [ + { + displayName: 'Category ID', + name: 'categoryId', + type: 'options', + typeOptions: { + loadOptionsMethod: 'getGroupCategories', + loadOptionsDependsOn: [ + 'list', + ], + }, + default: '', + }, + { + displayName: 'Category Field ID', + name: 'categoryFieldId', + type: 'string', + default: '', + description: '', + }, + { + displayName: 'Value', + name: 'value', + type: 'boolean', + default: false, + description: '', + }, + ], + }, + ], + }, { displayName: 'Language', name: 'language', @@ -1157,6 +1327,29 @@ export class Mailchimp implements INodeType { }, }, }, + { + displayName: 'Interest Groups', + name: 'groupJson', + type: 'json', + typeOptions: { + alwaysOpenEditWindow: true, + }, + default: '', + description: '', + displayOptions: { + show: { + resource:[ + 'member', + ], + operation: [ + 'update', + ], + jsonParameters: [ + true, + ], + }, + }, + }, /* -------------------------------------------------------------------------- */ /* memberTag:create */ /* -------------------------------------------------------------------------- */ @@ -1250,6 +1443,96 @@ export class Mailchimp implements INodeType { }, ], }, +/* -------------------------------------------------------------------------- */ +/* member:getAll */ +/* -------------------------------------------------------------------------- */ + { + displayName: 'List', + name: 'list', + type: 'options', + typeOptions: { + loadOptionsMethod: 'getLists', + }, + displayOptions: { + show: { + resource: [ + 'listGroup', + ], + operation: [ + 'getAll', + ], + }, + }, + default: '', + options: [], + required: true, + description: 'List of lists', + }, + { + displayName: 'Group Category', + name: 'groupCategory', + type: 'options', + typeOptions: { + loadOptionsMethod: 'getGroupCategories', + loadOptionsDependsOn: [ + 'list', + ], + }, + displayOptions: { + show: { + resource: [ + 'listGroup', + ], + operation: [ + 'getAll', + ], + }, + }, + default: '', + options: [], + required: true, + }, + { + displayName: 'Return All', + name: 'returnAll', + type: 'boolean', + displayOptions: { + show: { + resource: [ + 'listGroup', + ], + operation: [ + 'getAll', + ], + }, + }, + default: false, + description: 'If all results should be returned or only up to a given limit.', + }, + { + displayName: 'Limit', + name: 'limit', + type: 'number', + displayOptions: { + show: { + resource: [ + 'listGroup', + ], + operation: [ + 'getAll', + ], + returnAll: [ + false, + ], + }, + }, + typeOptions: { + minValue: 1, + maxValue: 1000, + }, + default: 500, + description: 'How many results to return.', + }, ], }; @@ -1261,7 +1544,7 @@ export class Mailchimp implements INodeType { // select them easily async getLists(this: ILoadOptionsFunctions): Promise { const returnData: INodePropertyOptions[] = []; - const { lists } = await mailchimpApiRequest.call(this, '/lists', 'GET'); + const lists = await mailchimpApiRequestAllItems.call(this, '/lists', 'GET', 'lists'); for (const list of lists) { const listName = list.name; const listId = list.id; @@ -1289,6 +1572,23 @@ export class Mailchimp implements INodeType { } return returnData; }, + + // Get all the interest fields to display them to user so that he can + // select them easily + async getGroupCategories(this: ILoadOptionsFunctions): Promise { + const returnData: INodePropertyOptions[] = []; + const listId = this.getCurrentNodeParameter('list'); + const { categories } = await mailchimpApiRequest.call(this, `/lists/${listId}/interest-categories`, 'GET'); + for (const category of categories) { + const categoryName = category.title; + const categoryId = category.id; + returnData.push({ + name: categoryName, + value: categoryId, + }); + } + return returnData; + }, } }; @@ -1302,6 +1602,22 @@ export class Mailchimp implements INodeType { const operation = this.getNodeParameter('operation', 0) as string; for (let i = 0; i < length; i++) { + if (resource === 'listGroup') { + //https://mailchimp.com/developer/reference/lists/interest-categories/#get_/lists/-list_id-/interest-categories/-interest_category_id- + if (operation === 'getAll') { + const listId = this.getNodeParameter('list', i) as string; + const categoryId = this.getNodeParameter('groupCategory', i) as string; + const returnAll = this.getNodeParameter('returnAll', i) as boolean; + + if (returnAll === true) { + responseData = await mailchimpApiRequestAllItems.call(this, `/lists/${listId}/interest-categories/${categoryId}/interests`, 'GET', 'interests', {}, qs); + } else { + qs.count = this.getNodeParameter('limit', i) as number; + responseData = await mailchimpApiRequest.call(this, `/lists/${listId}/interest-categories/${categoryId}/interests`, 'GET', {}, qs); + responseData = responseData.interests; + } + } + } if (resource === 'member') { //https://mailchimp.com/developer/reference/lists/list-members/#post_/lists/-list_id-/members if (operation === 'create') { @@ -1363,15 +1679,29 @@ export class Mailchimp implements INodeType { } body.merge_fields = mergeFields; } + + const groupsValues = (this.getNodeParameter('groupsUi', i) as IDataObject).groupsValues as IDataObject[]; + if (groupsValues) { + const groups = {}; + for (let i = 0; i < groupsValues.length; i++) { + // @ts-ignore + groups[groupsValues[i].categoryFieldId] = groupsValues[i].value; + } + body.interests = groups; + } } else { const locationJson = validateJSON(this.getNodeParameter('locationJson', i) as string); const mergeFieldsJson = validateJSON(this.getNodeParameter('mergeFieldsJson', i) as string); + const groupJson = validateJSON(this.getNodeParameter('groupJson', i) as string); if (locationJson) { body.location = locationJson; } if (mergeFieldsJson) { body.merge_fields = mergeFieldsJson; } + if (groupJson) { + body.interests = groupJson; + } } responseData = await mailchimpApiRequest.call(this, `/lists/${listId}/members`, 'POST', body); } @@ -1504,15 +1834,31 @@ export class Mailchimp implements INodeType { body.merge_fields = mergeFields; } } + if (updateFields.groupsUi) { + const groupsValues = (updateFields.groupsUi as IDataObject).groupsValues as IDataObject[]; + if (groupsValues) { + const groups = {}; + for (let i = 0; i < groupsValues.length; i++) { + // @ts-ignore + groups[groupsValues[i].categoryFieldId] = groupsValues[i].value; + } + body.interests = groups; + } + } } else { const locationJson = validateJSON(this.getNodeParameter('locationJson', i) as string); const mergeFieldsJson = validateJSON(this.getNodeParameter('mergeFieldsJson', i) as string); + const groupJson = validateJSON(this.getNodeParameter('groupJson', i) as string); + if (locationJson) { body.location = locationJson; } if (mergeFieldsJson) { body.merge_fields = mergeFieldsJson; } + if (groupJson) { + body.interests = groupJson; + } } responseData = await mailchimpApiRequest.call(this, `/lists/${listId}/members/${email}`, 'PUT', body); } From 5adec0a299a9e1f23e1a6fd039a3765307cd6439 Mon Sep 17 00:00:00 2001 From: ricardo Date: Thu, 9 Jul 2020 16:23:17 -0400 Subject: [PATCH 208/241] :zap: Add search operation to resource person --- .../nodes/Pipedrive/GenericFunctions.ts | 14 ++- .../nodes/Pipedrive/Pipedrive.node.ts | 115 +++++++++++++++++- 2 files changed, 125 insertions(+), 4 deletions(-) diff --git a/packages/nodes-base/nodes/Pipedrive/GenericFunctions.ts b/packages/nodes-base/nodes/Pipedrive/GenericFunctions.ts index 33bf215b12..a263afa096 100644 --- a/packages/nodes-base/nodes/Pipedrive/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Pipedrive/GenericFunctions.ts @@ -48,6 +48,9 @@ export async function pipedriveApiRequest(this: IHookFunctions | IExecuteFunctio query.api_token = credentials.apiToken; const options: OptionsWithUri = { + headers: { + "Accept": "application/json", + }, method, qs: query, uri: `https://api.pipedrive.com/v1${endpoint}`, @@ -93,7 +96,7 @@ export async function pipedriveApiRequest(this: IHookFunctions | IExecuteFunctio if (error.response && error.response.body && error.response.body.error) { // Try to return the error prettier - let errorMessage = `Pipedrive error response [${error.statusCode}]: ${error.response.body.error}`; + let errorMessage = `Pipedrive error response [${error.statusCode}]: ${error.response.body.error.message}`; if (error.response.body.error_info) { errorMessage += ` - ${error.response.body.error_info}`; } @@ -124,7 +127,7 @@ export async function pipedriveApiRequestAllItems(this: IHookFunctions | IExecut if (query === undefined) { query = {}; } - query.limit = 500; + query.limit = 100; query.start = 0; const returnData: IDataObject[] = []; @@ -133,7 +136,12 @@ export async function pipedriveApiRequestAllItems(this: IHookFunctions | IExecut do { responseData = await pipedriveApiRequest.call(this, method, endpoint, body, query); - returnData.push.apply(returnData, responseData.data); + // the search path returns data diferently + if (responseData.data.items) { + returnData.push.apply(returnData, responseData.data.items); + } else { + returnData.push.apply(returnData, responseData.data); + } query.start = responseData.additionalData.pagination.next_start; } while ( diff --git a/packages/nodes-base/nodes/Pipedrive/Pipedrive.node.ts b/packages/nodes-base/nodes/Pipedrive/Pipedrive.node.ts index a5cd93ab9f..8157f94bde 100644 --- a/packages/nodes-base/nodes/Pipedrive/Pipedrive.node.ts +++ b/packages/nodes-base/nodes/Pipedrive/Pipedrive.node.ts @@ -25,7 +25,6 @@ interface CustomProperty { value: string; } - /** * Add the additional fields to the body * @@ -362,6 +361,11 @@ export class Pipedrive implements INodeType { value: 'getAll', description: 'Get data of all persons', }, + { + name: 'Search', + value: 'search', + description: 'Search all persons', + }, { name: 'Update', value: 'update', @@ -2021,6 +2025,7 @@ export class Pipedrive implements INodeType { show: { operation: [ 'getAll', + 'search', ], }, }, @@ -2035,6 +2040,7 @@ export class Pipedrive implements INodeType { show: { operation: [ 'getAll', + 'search', ], returnAll: [ false, @@ -2088,6 +2094,74 @@ export class Pipedrive implements INodeType { }, ], }, + + // ---------------------------------- + // person:search + // ---------------------------------- + { + displayName: 'Term', + name: 'term', + type: 'string', + displayOptions: { + show: { + operation: [ + 'search', + ], + resource: [ + 'person', + ], + }, + }, + default: '', + description: 'The search term to look for. Minimum 2 characters (or 1 if using exact_match).', + }, + { + displayName: 'Additional Fields', + name: 'additionalFields', + type: 'collection', + placeholder: 'Add Field', + displayOptions: { + show: { + operation: [ + 'search', + ], + resource: [ + 'person', + ], + }, + }, + default: {}, + options: [ + { + displayName: 'Exact Match', + name: 'exactMatch', + type: 'boolean', + default: false, + description: 'When enabled, only full exact matches against the given term are returned. It is not case sensitive.', + }, + { + displayName: 'Fields', + name: 'fields', + type: 'string', + default: '', + description: 'A comma-separated string array. The fields to perform the search from. Defaults to all of them.', + }, + { + displayName: 'Include Fields', + name: 'includeFields', + type: 'string', + default: '', + description: 'Supports including optional fields in the results which are not provided by default.', + }, + { + displayName: 'Organization ID', + name: 'organizationId', + type: 'string', + default: '', + description: 'Will filter Deals by the provided Organization ID.', + }, + ], + }, ], }; @@ -2526,6 +2600,39 @@ export class Pipedrive implements INodeType { endpoint = `/persons`; + } else if (operation === 'search') { + // ---------------------------------- + // persons:search + // ---------------------------------- + + requestMethod = 'GET'; + + qs.term = this.getNodeParameter('term', i) as string; + returnAll = this.getNodeParameter('returnAll', i) as boolean; + if (returnAll === false) { + qs.limit = this.getNodeParameter('limit', i) as number; + } + + const additionalFields = this.getNodeParameter('additionalFields', i) as IDataObject; + + if (additionalFields.fields) { + qs.fields = additionalFields.fields as string; + } + + if (additionalFields.exactMatch) { + qs.exact_match = additionalFields.exactMatch as boolean; + } + + if (additionalFields.organizationId) { + qs.organization_id = parseInt(additionalFields.organizationId as string, 10); + } + + if (additionalFields.includeFields) { + qs.include_fields = additionalFields.includeFields as string; + } + + endpoint = `/persons/search`; + } else if (operation === 'update') { // ---------------------------------- // person:update @@ -2562,7 +2669,9 @@ export class Pipedrive implements INodeType { let responseData; if (returnAll === true) { + responseData = await pipedriveApiRequestAllItems.call(this, requestMethod, endpoint, body, qs); + } else { if (customProperties !== undefined) { @@ -2597,6 +2706,10 @@ export class Pipedrive implements INodeType { responseData.data = []; } + if (operation === 'search' && responseData.data && responseData.data.items) { + responseData.data = responseData.data.items; + } + if (Array.isArray(responseData.data)) { returnData.push.apply(returnData, responseData.data as IDataObject[]); } else { From 305894d9b4de60d14fe7d9a8727610a3557f5c51 Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Fri, 10 Jul 2020 10:12:30 +0200 Subject: [PATCH 209/241] :bug: Fix item display issue --- docker/images/n8n/README.md | 151 ++++++++---------- packages/editor-ui/src/components/RunData.vue | 8 +- 2 files changed, 77 insertions(+), 82 deletions(-) diff --git a/docker/images/n8n/README.md b/docker/images/n8n/README.md index 7170dda595..977c53fef4 100644 --- a/docker/images/n8n/README.md +++ b/docker/images/n8n/README.md @@ -6,25 +6,23 @@ n8n is a free and open [fair-code](http://faircode.io) licensed node based Workf n8n.io - Screenshot - ## Contents -- [Demo](#demo) -- [Available integrations](#available-integrations) -- [Documentation](#documentation) -- [Start n8n in Docker](#start-n8n-in-docker) -- [Start with tunnel](#start-with-tunnel) -- [Securing n8n](#securing-n8n) -- [Persist data](#persist-data) -- [Passing Sensitive Data via File](#passing-sensitive-data-via-file) -- [Updating a Running docker-compose Instance](#updating-a-running-docker-compose-instance) -- [Example Setup with Lets Encrypt](#example-setup-with-lets-encrypt) -- [What does n8n mean and how do you pronounce it](#what-does-n8n-mean-and-how-do-you-pronounce-it) -- [Support](#support) -- [Jobs](#jobs) -- [Upgrading](#upgrading) -- [License](#license) - + - [Demo](#demo) + - [Available integrations](#available-integrations) + - [Documentation](#documentation) + - [Start n8n in Docker](#start-n8n-in-docker) + - [Start with tunnel](#start-with-tunnel) + - [Securing n8n](#securing-n8n) + - [Persist data](#persist-data) + - [Passing Sensitive Data via File](#passing-sensitive-data-via-file) + - [Updating a Running docker-compose Instance](#updating-a-running-docker-compose-instance) + - [Example Setup with Lets Encrypt](#example-setup-with-lets-encrypt) + - [What does n8n mean and how do you pronounce it](#what-does-n8n-mean-and-how-do-you-pronounce-it) + - [Support](#support) + - [Jobs](#jobs) + - [Upgrading](#upgrading) + - [License](#license) ## Demo @@ -49,9 +47,9 @@ Additional information and example workflows on the n8n.io website: [https://n8n ``` docker run -it --rm \ - --name n8n \ - -p 5678:5678 \ - n8nio/n8n + --name n8n \ + -p 5678:5678 \ + n8nio/n8n ``` You can then access n8n by opening: @@ -71,14 +69,13 @@ To use it simply start n8n with `--tunnel` ``` docker run -it --rm \ - --name n8n \ - -p 5678:5678 \ - -v ~/.n8n:/root/.n8n \ - n8nio/n8n \ - n8n start --tunnel + --name n8n \ + -p 5678:5678 \ + -v ~/.n8n:/root/.n8n \ + n8nio/n8n \ + n8n start --tunnel ``` - ## Securing n8n By default n8n can be accessed by everybody. This is OK if you have it only running @@ -93,7 +90,6 @@ N8N_BASIC_AUTH_USER= N8N_BASIC_AUTH_PASSWORD= ``` - ## Persist data The workflow data gets by default saved in an SQLite database in the user @@ -102,10 +98,10 @@ settings like webhook URL and encryption key. ``` docker run -it --rm \ - --name n8n \ - -p 5678:5678 \ - -v ~/.n8n:/root/.n8n \ - n8nio/n8n + --name n8n \ + -p 5678:5678 \ + -v ~/.n8n:/root/.n8n \ + n8nio/n8n ``` ### Start with other Database @@ -121,7 +117,6 @@ for the credentials. If none gets found n8n creates automatically one on startup. In case credentials are already saved with a different encryption key it can not be used anymore as encrypting it is not possible anymore. - #### Use with MongoDB > **WARNING**: Use Postgres if possible! Mongo has problems with saving large @@ -129,40 +124,39 @@ it can not be used anymore as encrypting it is not possible anymore. > may be dropped in the future. Replace the following placeholders with the actual data: - - - - - - - - - - + - MONGO_DATABASE + - MONGO_HOST + - MONGO_PORT + - MONGO_USER + - MONGO_PASSWORD ``` docker run -it --rm \ - --name n8n \ - -p 5678:5678 \ + --name n8n \ + -p 5678:5678 \ -e DB_TYPE=mongodb \ -e DB_MONGODB_CONNECTION_URL="mongodb://:@:/" \ - -v ~/.n8n:/root/.n8n \ - n8nio/n8n \ - n8n start + -v ~/.n8n:/root/.n8n \ + n8nio/n8n \ + n8n start ``` A full working setup with docker-compose can be found [here](https://github.com/n8n-io/n8n/blob/master/docker/compose/withMongo/README.md) - #### Use with PostgresDB Replace the following placeholders with the actual data: - - - - - - - - - - - - + - POSTGRES_DATABASE + - POSTGRES_HOST + - POSTGRES_PASSWORD + - POSTGRES_PORT + - POSTGRES_USER + - POSTGRES_SCHEMA ``` docker run -it --rm \ - --name n8n \ - -p 5678:5678 \ + --name n8n \ + -p 5678:5678 \ -e DB_TYPE=postgresdb \ -e DB_POSTGRESDB_DATABASE= \ -e DB_POSTGRESDB_HOST= \ @@ -170,39 +164,37 @@ docker run -it --rm \ -e DB_POSTGRESDB_USER= \ -e DB_POSTGRESDB_SCHEMA= \ -e DB_POSTGRESDB_PASSWORD= \ - -v ~/.n8n:/root/.n8n \ - n8nio/n8n \ - n8n start + -v ~/.n8n:/root/.n8n \ + n8nio/n8n \ + n8n start ``` A full working setup with docker-compose can be found [here](https://github.com/n8n-io/n8n/blob/master/docker/compose/withPostgres/README.md) - #### Use with MySQL Replace the following placeholders with the actual data: - - - - - - - - - - + - MYSQLDB_DATABASE + - MYSQLDB_HOST + - MYSQLDB_PASSWORD + - MYSQLDB_PORT + - MYSQLDB_USER ``` docker run -it --rm \ - --name n8n \ - -p 5678:5678 \ + --name n8n \ + -p 5678:5678 \ -e DB_TYPE=mysqldb \ -e DB_MYSQLDB_DATABASE= \ -e DB_MYSQLDB_HOST= \ -e DB_MYSQLDB_PORT= \ -e DB_MYSQLDB_USER= \ -e DB_MYSQLDB_PASSWORD= \ - -v ~/.n8n:/root/.n8n \ - n8nio/n8n \ - n8n start + -v ~/.n8n:/root/.n8n \ + n8nio/n8n \ + n8n start ``` - ## Passing Sensitive Data via File To avoid passing sensitive information via environment variables "_FILE" may be @@ -211,16 +203,15 @@ with the given name. That makes it possible to load data easily from Docker- and Kubernetes-Secrets. The following environment variables support file input: - - DB_MONGODB_CONNECTION_URL_FILE - - DB_POSTGRESDB_DATABASE_FILE - - DB_POSTGRESDB_HOST_FILE - - DB_POSTGRESDB_PASSWORD_FILE - - DB_POSTGRESDB_PORT_FILE - - DB_POSTGRESDB_USER_FILE - - DB_POSTGRESDB_SCHEMA_FILE - - N8N_BASIC_AUTH_PASSWORD_FILE - - N8N_BASIC_AUTH_USER_FILE - + - DB_MONGODB_CONNECTION_URL_FILE + - DB_POSTGRESDB_DATABASE_FILE + - DB_POSTGRESDB_HOST_FILE + - DB_POSTGRESDB_PASSWORD_FILE + - DB_POSTGRESDB_PORT_FILE + - DB_POSTGRESDB_USER_FILE + - DB_POSTGRESDB_SCHEMA_FILE + - N8N_BASIC_AUTH_PASSWORD_FILE + - N8N_BASIC_AUTH_USER_FILE ## Example Setup with Lets Encrypt @@ -235,7 +226,7 @@ docker pull n8nio/n8n # Stop current setup sudo docker-compose stop # Delete it (will only delete the docker-containers, data is stored separately) -sudo docker-compose rm +sudo docker-compose rm # Then start it again sudo docker-compose up -d ``` @@ -251,11 +242,11 @@ the environment variable `TZ`. Example to use the same timezone for both: ``` docker run -it --rm \ - --name n8n \ - -p 5678:5678 \ + --name n8n \ + -p 5678:5678 \ -e GENERIC_TIMEZONE="Europe/Berlin" \ -e TZ="Europe/Berlin" \ - n8nio/n8n + n8nio/n8n ``` diff --git a/packages/editor-ui/src/components/RunData.vue b/packages/editor-ui/src/components/RunData.vue index b3729e4f68..42fbaa5b19 100644 --- a/packages/editor-ui/src/components/RunData.vue +++ b/packages/editor-ui/src/components/RunData.vue @@ -19,7 +19,7 @@
- + Results: {{ dataCount }} Results: @@ -248,7 +248,11 @@ export default mixins( return executionData.resultData.runData; }, maxDisplayItemsOptions (): number[] { - return [25, 50, 100, 250, 500, 1000, this.dataCount].filter(option => option <= this.dataCount); + const options = [25, 50, 100, 250, 500, 1000].filter(option => option <= this.dataCount); + if (!options.includes(this.dataCount)) { + options.push(this.dataCount); + } + return options; }, node (): INodeUi | null { return this.$store.getters.activeNode; From e3e3f038d6bbc13c940453987c4236387a88b52f Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Fri, 10 Jul 2020 10:25:54 +0200 Subject: [PATCH 210/241] :zap: Minor improvement to Pipedrive-Node --- .../nodes/Pipedrive/GenericFunctions.ts | 2 +- .../nodes-base/nodes/Pipedrive/Pipedrive.node.ts | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/packages/nodes-base/nodes/Pipedrive/GenericFunctions.ts b/packages/nodes-base/nodes/Pipedrive/GenericFunctions.ts index a263afa096..069ff5fe55 100644 --- a/packages/nodes-base/nodes/Pipedrive/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Pipedrive/GenericFunctions.ts @@ -49,7 +49,7 @@ export async function pipedriveApiRequest(this: IHookFunctions | IExecuteFunctio const options: OptionsWithUri = { headers: { - "Accept": "application/json", + Accept: 'application/json', }, method, qs: query, diff --git a/packages/nodes-base/nodes/Pipedrive/Pipedrive.node.ts b/packages/nodes-base/nodes/Pipedrive/Pipedrive.node.ts index 8157f94bde..13786ba94e 100644 --- a/packages/nodes-base/nodes/Pipedrive/Pipedrive.node.ts +++ b/packages/nodes-base/nodes/Pipedrive/Pipedrive.node.ts @@ -2160,6 +2160,13 @@ export class Pipedrive implements INodeType { default: '', description: 'Will filter Deals by the provided Organization ID.', }, + { + displayName: 'RAW Data', + name: 'rawData', + type: 'boolean', + default: false, + description: `Returns the data exactly in the way it got received from the API.`, + }, ], }, ], @@ -2708,6 +2715,15 @@ export class Pipedrive implements INodeType { if (operation === 'search' && responseData.data && responseData.data.items) { responseData.data = responseData.data.items; + const additionalFields = this.getNodeParameter('additionalFields', i) as IDataObject; + if (additionalFields.rawData !== true) { + responseData.data = responseData.data.map((item: { result_score: number, item: object }) => { + return { + result_score: item.result_score, + ...item.item, + }; + }); + } } if (Array.isArray(responseData.data)) { From db972b384fc9d7c8efb4ca0b2dd6344af58b1ef2 Mon Sep 17 00:00:00 2001 From: Ricardo Espinoza Date: Fri, 10 Jul 2020 04:38:23 -0400 Subject: [PATCH 211/241] :bug: Fixes issue #735 (#743) --- packages/nodes-base/nodes/HttpRequest.node.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/nodes-base/nodes/HttpRequest.node.ts b/packages/nodes-base/nodes/HttpRequest.node.ts index 417d80eeea..08d3a0ac15 100644 --- a/packages/nodes-base/nodes/HttpRequest.node.ts +++ b/packages/nodes-base/nodes/HttpRequest.node.ts @@ -802,7 +802,7 @@ export class HttpRequest implements INodeType { if (oAuth2Api !== undefined) { //@ts-ignore - response = await this.helpers.requestOAuth2.call(this, 'oAuth2Api', requestOptions); + response = await this.helpers.requestOAuth2.call(this, 'oAuth2Api', requestOptions, 'Bearer'); } else { response = await this.helpers.request(requestOptions); } From a00fedb35109344ddffb1aa496773f63e83c6860 Mon Sep 17 00:00:00 2001 From: Ben Hesseldieck <1849459+BHesseldieck@users.noreply.github.com> Date: Fri, 10 Jul 2020 10:48:19 +0200 Subject: [PATCH 212/241] :art: Extract postgres functionality (#737) * :tada: executeQuery function extracted * :construction: add prettierrc to gitignore * :construction: insert function extracted * :zap: extract update function * :bulb: fix function docs * :bulb: add in code documentation * :art: fix format * :art: fix format --- .gitignore | 1 + .../nodes/Postgres/Postgres.node.functions.ts | 129 ++++++++++++++++++ .../nodes/Postgres/Postgres.node.ts | 95 ++----------- 3 files changed, 140 insertions(+), 85 deletions(-) create mode 100644 packages/nodes-base/nodes/Postgres/Postgres.node.functions.ts diff --git a/.gitignore b/.gitignore index b3eac39207..0441d445b4 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,4 @@ _START_PACKAGE .env .vscode .idea +.prettierrc.js diff --git a/packages/nodes-base/nodes/Postgres/Postgres.node.functions.ts b/packages/nodes-base/nodes/Postgres/Postgres.node.functions.ts new file mode 100644 index 0000000000..fb4c50051c --- /dev/null +++ b/packages/nodes-base/nodes/Postgres/Postgres.node.functions.ts @@ -0,0 +1,129 @@ +import { IDataObject, INodeExecutionData } from 'n8n-workflow'; +import pgPromise = require('pg-promise'); +import pg = require('pg-promise/typescript/pg-subset'); + +/** + * Returns of copy of the items which only contains the json data and + * of that only the define properties + * + * @param {INodeExecutionData[]} items The items to copy + * @param {string[]} properties The properties it should include + * @returns + */ +function getItemCopy(items: INodeExecutionData[], properties: string[]): IDataObject[] { + // Prepare the data to insert and copy it to be returned + let newItem: IDataObject; + return items.map(item => { + newItem = {}; + for (const property of properties) { + if (item.json[property] === undefined) { + newItem[property] = null; + } else { + newItem[property] = JSON.parse(JSON.stringify(item.json[property])); + } + } + return newItem; + }); +} + +/** + * Executes the given SQL query on the database. + * + * @param {Function} getNodeParam The getter for the Node's parameters + * @param {pgPromise.IMain<{}, pg.IClient>} pgp The pgPromise instance + * @param {pgPromise.IDatabase<{}, pg.IClient>} db The pgPromise database connection + * @param {input[]} input The Node's input data + * @returns Promise> + */ +export function pgQuery( + getNodeParam: Function, + pgp: pgPromise.IMain<{}, pg.IClient>, + db: pgPromise.IDatabase<{}, pg.IClient>, + input: INodeExecutionData[], +): Promise> { + const queries: string[] = []; + for (let i = 0; i < input.length; i++) { + queries.push(getNodeParam('query', i) as string); + } + + return db.any(pgp.helpers.concat(queries)); +} + +/** + * Inserts the given items into the database. + * + * @param {Function} getNodeParam The getter for the Node's parameters + * @param {pgPromise.IMain<{}, pg.IClient>} pgp The pgPromise instance + * @param {pgPromise.IDatabase<{}, pg.IClient>} db The pgPromise database connection + * @param {INodeExecutionData[]} items The items to be inserted + * @returns Promise> + */ +export async function pgInsert( + getNodeParam: Function, + pgp: pgPromise.IMain<{}, pg.IClient>, + db: pgPromise.IDatabase<{}, pg.IClient>, + items: INodeExecutionData[], +): Promise> { + const table = getNodeParam('table', 0) as string; + const schema = getNodeParam('schema', 0) as string; + let returnFields = (getNodeParam('returnFields', 0) as string).split(',') as string[]; + const columnString = getNodeParam('columns', 0) as string; + const columns = columnString.split(',').map(column => column.trim()); + + const cs = new pgp.helpers.ColumnSet(columns); + + const te = new pgp.helpers.TableName({ table, schema }); + + // Prepare the data to insert and copy it to be returned + const insertItems = getItemCopy(items, columns); + + // Generate the multi-row insert query and return the id of new row + returnFields = returnFields.map(value => value.trim()).filter(value => !!value); + const query = + pgp.helpers.insert(insertItems, cs, te) + + (returnFields.length ? ` RETURNING ${returnFields.join(',')}` : ''); + + // Executing the query to insert the data + const insertData = await db.manyOrNone(query); + + return [insertData, insertItems]; +} + +/** + * Updates the given items in the database. + * + * @param {Function} getNodeParam The getter for the Node's parameters + * @param {pgPromise.IMain<{}, pg.IClient>} pgp The pgPromise instance + * @param {pgPromise.IDatabase<{}, pg.IClient>} db The pgPromise database connection + * @param {INodeExecutionData[]} items The items to be updated + * @returns Promise> + */ +export async function pgUpdate( + getNodeParam: Function, + pgp: pgPromise.IMain<{}, pg.IClient>, + db: pgPromise.IDatabase<{}, pg.IClient>, + items: INodeExecutionData[], +): Promise> { + const table = getNodeParam('table', 0) as string; + const updateKey = getNodeParam('updateKey', 0) as string; + const columnString = getNodeParam('columns', 0) as string; + + const columns = columnString.split(',').map(column => column.trim()); + + // Make sure that the updateKey does also get queried + if (!columns.includes(updateKey)) { + columns.unshift(updateKey); + } + + // Prepare the data to update and copy it to be returned + const updateItems = getItemCopy(items, columns); + + // Generate the multi-row update query + const query = + pgp.helpers.update(updateItems, columns, table) + ' WHERE v.' + updateKey + ' = t.' + updateKey; + + // Executing the query to update the data + await db.none(query); + + return updateItems; +} diff --git a/packages/nodes-base/nodes/Postgres/Postgres.node.ts b/packages/nodes-base/nodes/Postgres/Postgres.node.ts index ad074a5f51..f465ca05c8 100644 --- a/packages/nodes-base/nodes/Postgres/Postgres.node.ts +++ b/packages/nodes-base/nodes/Postgres/Postgres.node.ts @@ -3,36 +3,12 @@ import { IDataObject, INodeExecutionData, INodeType, - INodeTypeDescription, + INodeTypeDescription } from 'n8n-workflow'; import * as pgPromise from 'pg-promise'; - -/** - * Returns of copy of the items which only contains the json data and - * of that only the define properties - * - * @param {INodeExecutionData[]} items The items to copy - * @param {string[]} properties The properties it should include - * @returns - */ -function getItemCopy(items: INodeExecutionData[], properties: string[]): IDataObject[] { - // Prepare the data to insert and copy it to be returned - let newItem: IDataObject; - return items.map((item) => { - newItem = {}; - for (const property of properties) { - if (item.json[property] === undefined) { - newItem[property] = null; - } else { - newItem[property] = JSON.parse(JSON.stringify(item.json[property])); - } - } - return newItem; - }); -} - +import { pgInsert, pgQuery, pgUpdate } from './Postgres.node.functions'; export class Postgres implements INodeType { description: INodeTypeDescription = { @@ -52,7 +28,7 @@ export class Postgres implements INodeType { { name: 'postgres', required: true, - } + }, ], properties: [ { @@ -103,7 +79,6 @@ export class Postgres implements INodeType { description: 'The SQL query to execute.', }, - // ---------------------------------- // insert // ---------------------------------- @@ -143,9 +118,7 @@ export class Postgres implements INodeType { type: 'string', displayOptions: { show: { - operation: [ - 'insert' - ], + operation: ['insert'], }, }, default: '', @@ -167,7 +140,6 @@ export class Postgres implements INodeType { description: 'Comma separated list of the fields that the operation will return', }, - // ---------------------------------- // update // ---------------------------------- @@ -216,13 +188,10 @@ export class Postgres implements INodeType { placeholder: 'name,description', description: 'Comma separated list of the properties which should used as columns for rows to update.', }, - - ] + ], }; - async execute(this: IExecuteFunctions): Promise { - const credentials = this.getCredentials('postgres'); if (credentials === undefined) { @@ -253,39 +222,15 @@ export class Postgres implements INodeType { // executeQuery // ---------------------------------- - const queries: string[] = []; - for (let i = 0; i < items.length; i++) { - queries.push(this.getNodeParameter('query', i) as string); - } - - const queryResult = await db.any(pgp.helpers.concat(queries)); + const queryResult = await pgQuery(this.getNodeParameter, pgp, db, items); returnItems = this.helpers.returnJsonArray(queryResult as IDataObject[]); - } else if (operation === 'insert') { // ---------------------------------- // insert // ---------------------------------- - const table = this.getNodeParameter('table', 0) as string; - const schema = this.getNodeParameter('schema', 0) as string; - let returnFields = (this.getNodeParameter('returnFields', 0) as string).split(',') as string[]; - const columnString = this.getNodeParameter('columns', 0) as string; - const columns = columnString.split(',').map(column => column.trim()); - - const cs = new pgp.helpers.ColumnSet(columns); - - const te = new pgp.helpers.TableName({ table, schema }); - - // Prepare the data to insert and copy it to be returned - const insertItems = getItemCopy(items, columns); - - // Generate the multi-row insert query and return the id of new row - returnFields = returnFields.map(value => value.trim()).filter(value => !!value); - const query = pgp.helpers.insert(insertItems, cs, te) + (returnFields.length ? ` RETURNING ${returnFields.join(',')}` : ''); - - // Executing the query to insert the data - const insertData = await db.manyOrNone(query); + const [insertData, insertItems] = await pgInsert(this.getNodeParameter, pgp, db, items); // Add the id to the data for (let i = 0; i < insertData.length; i++) { @@ -293,37 +238,17 @@ export class Postgres implements INodeType { json: { ...insertData[i], ...insertItems[i], - } + }, }); } - } else if (operation === 'update') { // ---------------------------------- // update // ---------------------------------- - const table = this.getNodeParameter('table', 0) as string; - const updateKey = this.getNodeParameter('updateKey', 0) as string; - const columnString = this.getNodeParameter('columns', 0) as string; - - const columns = columnString.split(',').map(column => column.trim()); - - // Make sure that the updateKey does also get queried - if (!columns.includes(updateKey)) { - columns.unshift(updateKey); - } - - // Prepare the data to update and copy it to be returned - const updateItems = getItemCopy(items, columns); - - // Generate the multi-row update query - const query = pgp.helpers.update(updateItems, columns, table) + ' WHERE v.' + updateKey + ' = t.' + updateKey; - - // Executing the query to update the data - await db.none(query); - - returnItems = this.helpers.returnJsonArray(updateItems as IDataObject[]); + const updateItems = await pgUpdate(this.getNodeParameter, pgp, db, items); + returnItems = this.helpers.returnJsonArray(updateItems); } else { await pgp.end(); throw new Error(`The operation "${operation}" is not supported!`); From ae67735d149e8b76b9aaf49b86e5db4681b04293 Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Fri, 10 Jul 2020 10:58:39 +0200 Subject: [PATCH 213/241] :zap: Minor improvements to QuestDb-Node --- ...uestdb.credentials.ts => QuestDb.credentials.ts} | 4 ++-- .../QuestDB.node.ts => QuestDb/QuestDb.node.ts} | 8 ++++---- .../nodes/{QuestDB => QuestDb}/questdb.png | Bin packages/nodes-base/package.json | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) rename packages/nodes-base/credentials/{Questdb.credentials.ts => QuestDb.credentials.ts} (94%) rename packages/nodes-base/nodes/{QuestDB/QuestDB.node.ts => QuestDb/QuestDb.node.ts} (97%) rename packages/nodes-base/nodes/{QuestDB => QuestDb}/questdb.png (100%) diff --git a/packages/nodes-base/credentials/Questdb.credentials.ts b/packages/nodes-base/credentials/QuestDb.credentials.ts similarity index 94% rename from packages/nodes-base/credentials/Questdb.credentials.ts rename to packages/nodes-base/credentials/QuestDb.credentials.ts index 3672f6204d..24c1522737 100644 --- a/packages/nodes-base/credentials/Questdb.credentials.ts +++ b/packages/nodes-base/credentials/QuestDb.credentials.ts @@ -1,7 +1,7 @@ import { ICredentialType, NodePropertyTypes } from 'n8n-workflow'; -export class QuestDB implements ICredentialType { - name = 'questdb'; +export class QuestDb implements ICredentialType { + name = 'questDb'; displayName = 'QuestDB'; properties = [ { diff --git a/packages/nodes-base/nodes/QuestDB/QuestDB.node.ts b/packages/nodes-base/nodes/QuestDb/QuestDb.node.ts similarity index 97% rename from packages/nodes-base/nodes/QuestDB/QuestDB.node.ts rename to packages/nodes-base/nodes/QuestDb/QuestDb.node.ts index bc8af9f17c..20b6d48615 100644 --- a/packages/nodes-base/nodes/QuestDB/QuestDB.node.ts +++ b/packages/nodes-base/nodes/QuestDb/QuestDb.node.ts @@ -5,10 +5,10 @@ import * as pgPromise from 'pg-promise'; import { pgInsert, pgQuery, pgUpdate } from '../Postgres/Postgres.node.functions'; -export class QuestDB implements INodeType { +export class QuestDb implements INodeType { description: INodeTypeDescription = { displayName: 'QuestDB', - name: 'questdb', + name: 'questDb', icon: 'file:questdb.png', group: ['input'], version: 1, @@ -21,7 +21,7 @@ export class QuestDB implements INodeType { outputs: ['main'], credentials: [ { - name: 'questdb', + name: 'questDb', required: true, }, ], @@ -176,7 +176,7 @@ export class QuestDB implements INodeType { }; async execute(this: IExecuteFunctions): Promise { - const credentials = this.getCredentials('questdb'); + const credentials = this.getCredentials('questDb'); if (credentials === undefined) { throw new Error('No credentials got returned!'); diff --git a/packages/nodes-base/nodes/QuestDB/questdb.png b/packages/nodes-base/nodes/QuestDb/questdb.png similarity index 100% rename from packages/nodes-base/nodes/QuestDB/questdb.png rename to packages/nodes-base/nodes/QuestDb/questdb.png diff --git a/packages/nodes-base/package.json b/packages/nodes-base/package.json index 0de5410ea0..94716b7f4b 100644 --- a/packages/nodes-base/package.json +++ b/packages/nodes-base/package.json @@ -112,7 +112,7 @@ "dist/credentials/PipedriveApi.credentials.js", "dist/credentials/Postgres.credentials.js", "dist/credentials/PostmarkApi.credentials.js", - "dist/credentials/Questdb.credentials.js", + "dist/credentials/QuestDb.credentials.js", "dist/credentials/Redis.credentials.js", "dist/credentials/RocketchatApi.credentials.js", "dist/credentials/RundeckApi.credentials.js", @@ -261,7 +261,7 @@ "dist/nodes/Pipedrive/PipedriveTrigger.node.js", "dist/nodes/Postgres/Postgres.node.js", "dist/nodes/Postmark/PostmarkTrigger.node.js", - "dist/nodes/QuestDB/QuestDB.node.js", + "dist/nodes/QuestDb/QuestDb.node.js", "dist/nodes/ReadBinaryFile.node.js", "dist/nodes/ReadBinaryFiles.node.js", "dist/nodes/ReadPdf.node.js", From f33eebcec9d23cf8518e90fc4fc8bfec347ed8ab Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Fri, 10 Jul 2020 12:30:40 +0200 Subject: [PATCH 214/241] :zap: Remove empty description properties --- .../nodes/Mailchimp/Mailchimp.node.ts | 33 ------------------- 1 file changed, 33 deletions(-) diff --git a/packages/nodes-base/nodes/Mailchimp/Mailchimp.node.ts b/packages/nodes-base/nodes/Mailchimp/Mailchimp.node.ts index 443fd5d20c..ff5ee63645 100644 --- a/packages/nodes-base/nodes/Mailchimp/Mailchimp.node.ts +++ b/packages/nodes-base/nodes/Mailchimp/Mailchimp.node.ts @@ -283,27 +283,22 @@ export class Mailchimp implements INodeType { { name: 'Subscribed', value: 'subscribed', - description: '', }, { name: 'Unsubscribed', value: 'unsubscribed', - description: '', }, { name: 'Cleaned', value: 'cleaned', - description: '', }, { name: 'Pending', value: 'pending', - description: '', }, { name: 'Transactional', value: 'transactional', - description: '', }, ], default: '', @@ -314,7 +309,6 @@ export class Mailchimp implements INodeType { name: 'jsonParameters', type: 'boolean', default: false, - description: '', displayOptions: { show: { resource:[ @@ -351,12 +345,10 @@ export class Mailchimp implements INodeType { { name: 'HTML', value: 'html', - description: '', }, { name: 'Text', value: 'text', - description: '', }, ], default: '', @@ -523,7 +515,6 @@ export class Mailchimp implements INodeType { alwaysOpenEditWindow: true, }, default: '', - description: '', displayOptions: { show: { resource:[ @@ -546,7 +537,6 @@ export class Mailchimp implements INodeType { alwaysOpenEditWindow: true, }, default: '', - description: '', displayOptions: { show: { resource:[ @@ -608,14 +598,12 @@ export class Mailchimp implements INodeType { name: 'categoryFieldId', type: 'string', default: '', - description: '', }, { displayName: 'Value', name: 'value', type: 'boolean', default: false, - description: '', }, ], }, @@ -629,7 +617,6 @@ export class Mailchimp implements INodeType { alwaysOpenEditWindow: true, }, default: '', - description: '', displayOptions: { show: { resource:[ @@ -882,12 +869,10 @@ export class Mailchimp implements INodeType { { name: 'HTML', value: 'html', - description: '', }, { name: 'Text', value: 'text', - description: '', }, ], default: '', @@ -901,27 +886,22 @@ export class Mailchimp implements INodeType { { name: 'Subscribed', value: 'subscribed', - description: '', }, { name: 'Unsubscribed', value: 'unsubscribed', - description: '', }, { name: 'Cleaned', value: 'cleaned', - description: '', }, { name: 'Pending', value: 'pending', - description: '', }, { name: 'Transactional', value: 'transactional', - description: '', }, ], default: '', @@ -984,7 +964,6 @@ export class Mailchimp implements INodeType { name: 'jsonParameters', type: 'boolean', default: false, - description: '', displayOptions: { show: { resource:[ @@ -1021,12 +1000,10 @@ export class Mailchimp implements INodeType { { name: 'HTML', value: 'html', - description: '', }, { name: 'Text', value: 'text', - description: '', }, ], default: '', @@ -1079,14 +1056,12 @@ export class Mailchimp implements INodeType { name: 'categoryFieldId', type: 'string', default: '', - description: '', }, { displayName: 'Value', name: 'value', type: 'boolean', default: false, - description: '', }, ], }, @@ -1194,27 +1169,22 @@ export class Mailchimp implements INodeType { { name: 'Subscribed', value: 'subscribed', - description: '', }, { name: 'Unsubscribed', value: 'unsubscribed', - description: '', }, { name: 'Cleaned', value: 'cleaned', - description: '', }, { name: 'Pending', value: 'pending', - description: '', }, { name: 'Transactional', value: 'transactional', - description: '', }, ], default: '', @@ -1289,7 +1259,6 @@ export class Mailchimp implements INodeType { alwaysOpenEditWindow: true, }, default: '', - description: '', displayOptions: { show: { resource:[ @@ -1312,7 +1281,6 @@ export class Mailchimp implements INodeType { alwaysOpenEditWindow: true, }, default: '', - description: '', displayOptions: { show: { resource:[ @@ -1335,7 +1303,6 @@ export class Mailchimp implements INodeType { alwaysOpenEditWindow: true, }, default: '', - description: '', displayOptions: { show: { resource:[ From bcabdc457bbd31a2dacbef9770b657839b47f43a Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Sun, 12 Jul 2020 09:28:08 +0200 Subject: [PATCH 215/241] :bug: Fix naming of events in AffinityTrigger Node --- packages/cli/config/index.ts | 7 +++++++ packages/cli/src/Server.ts | 14 +++++++++++++- packages/editor-ui/public/index.html | 3 ++- packages/editor-ui/src/components/MainSidebar.vue | 4 +++- packages/editor-ui/src/router.ts | 3 ++- packages/editor-ui/src/store.ts | 3 ++- packages/editor-ui/vue.config.js | 2 +- .../nodes/Affinity/AffinityTrigger.node.ts | 6 +++--- 8 files changed, 33 insertions(+), 9 deletions(-) diff --git a/packages/cli/config/index.ts b/packages/cli/config/index.ts index 847587460f..380a93c4a8 100644 --- a/packages/cli/config/index.ts +++ b/packages/cli/config/index.ts @@ -204,6 +204,13 @@ const config = convict({ }, // How n8n can be reached (Editor & REST-API) + path: { + format: String, + default: '/', + arg: 'path', + env: 'N8N_PATH', + doc: 'Path n8n is deployed to' + }, host: { format: String, default: 'localhost', diff --git a/packages/cli/src/Server.ts b/packages/cli/src/Server.ts index 2507b6b136..5cfacd8449 100644 --- a/packages/cli/src/Server.ts +++ b/packages/cli/src/Server.ts @@ -1693,9 +1693,21 @@ class App { }); } + + // Read the index file and replace the path placeholder + const editorUiPath = require.resolve('n8n-editor-ui'); + const filePath = pathJoin(pathDirname(editorUiPath), 'dist', 'index.html'); + let readIndexFile = readFileSync(filePath, 'utf8'); + const n8nPath = config.get('path'); + readIndexFile = readIndexFile.replace(/\/%BASE_PATH%\//g, n8nPath); + + // Serve the altered index.html file separately + this.app.get(`/index.html`, async (req: express.Request, res: express.Response) => { + res.send(readIndexFile); + }); + // Serve the website const startTime = (new Date()).toUTCString(); - const editorUiPath = require.resolve('n8n-editor-ui'); this.app.use('/', express.static(pathJoin(pathDirname(editorUiPath), 'dist'), { index: 'index.html', setHeaders: (res, path) => { diff --git a/packages/editor-ui/public/index.html b/packages/editor-ui/public/index.html index 2f2450023d..9193fda976 100644 --- a/packages/editor-ui/public/index.html +++ b/packages/editor-ui/public/index.html @@ -4,7 +4,8 @@ - + + n8n.io - Workflow Automation diff --git a/packages/editor-ui/src/components/MainSidebar.vue b/packages/editor-ui/src/components/MainSidebar.vue index 71388c2cd3..c5462690cc 100644 --- a/packages/editor-ui/src/components/MainSidebar.vue +++ b/packages/editor-ui/src/components/MainSidebar.vue @@ -16,7 +16,7 @@ @@ -208,6 +208,8 @@ export default mixins( data () { return { aboutDialogVisible: false, + // @ts-ignore + basePath: window.BASE_PATH, isCollapsed: true, credentialNewDialogVisible: false, credentialOpenDialogVisible: false, diff --git a/packages/editor-ui/src/router.ts b/packages/editor-ui/src/router.ts index e82b30b588..4754098c97 100644 --- a/packages/editor-ui/src/router.ts +++ b/packages/editor-ui/src/router.ts @@ -8,7 +8,8 @@ Vue.use(Router); export default new Router({ mode: 'history', - base: process.env.BASE_URL, + // @ts-ignore + base: window.BASE_PATH, routes: [ { path: '/execution/:id', diff --git a/packages/editor-ui/src/store.ts b/packages/editor-ui/src/store.ts index 80454fc9e4..0e1e5f14c4 100644 --- a/packages/editor-ui/src/store.ts +++ b/packages/editor-ui/src/store.ts @@ -38,7 +38,8 @@ export const store = new Vuex.Store({ activeWorkflows: [] as string[], activeActions: [] as string[], activeNode: null as string | null, - baseUrl: process.env.VUE_APP_URL_BASE_API ? process.env.VUE_APP_URL_BASE_API : '/', + // @ts-ignore + baseUrl: window.BASE_PATH ? window.BASE_PATH : '/', credentials: null as ICredentialsResponse[] | null, credentialTypes: null as ICredentialType[] | null, endpointWebhook: 'webhook', diff --git a/packages/editor-ui/vue.config.js b/packages/editor-ui/vue.config.js index cdcd8259f9..c5ffc5fed8 100644 --- a/packages/editor-ui/vue.config.js +++ b/packages/editor-ui/vue.config.js @@ -29,5 +29,5 @@ module.exports = { }, }, }, - publicPath: process.env.VUE_APP_PUBLIC_PATH ? process.env.VUE_APP_PUBLIC_PATH : '/', + publicPath: process.env.VUE_APP_PUBLIC_PATH ? process.env.VUE_APP_PUBLIC_PATH : '/%BASE_PATH%/', }; diff --git a/packages/nodes-base/nodes/Affinity/AffinityTrigger.node.ts b/packages/nodes-base/nodes/Affinity/AffinityTrigger.node.ts index 6b57d46804..3d387e7b4d 100644 --- a/packages/nodes-base/nodes/Affinity/AffinityTrigger.node.ts +++ b/packages/nodes-base/nodes/Affinity/AffinityTrigger.node.ts @@ -52,10 +52,10 @@ export class AffinityTrigger implements INodeType { options: [ { name: 'file.created', - value: 'file.deleted', + value: 'file.created', }, { - name: 'file.created', + name: 'file.deleted', value: 'file.deleted', }, { @@ -136,7 +136,7 @@ export class AffinityTrigger implements INodeType { }, { name: 'opportunity.deleted', - value: 'organization.deleted', + value: 'opportunity.deleted', }, { name: 'person.created', From 941ee06b146d0c72dc8de56288dd45d6abea945a Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Sun, 12 Jul 2020 09:28:08 +0200 Subject: [PATCH 216/241] :zap: Make n8n work in subfolder & Fix events in AffinityTrigger --- docker/compose/subfolderWithSSL/.env | 25 ++++++++ docker/compose/subfolderWithSSL/README.md | 26 +++++++++ .../subfolderWithSSL/docker-compose.yml | 57 +++++++++++++++++++ packages/cli/config/index.ts | 7 +++ packages/cli/src/GenericHelpers.ts | 5 +- packages/cli/src/Server.ts | 39 ++++++++++--- packages/editor-ui/public/index.html | 3 +- .../editor-ui/src/components/MainSidebar.vue | 4 +- packages/editor-ui/src/router.ts | 3 +- packages/editor-ui/src/store.ts | 3 +- packages/editor-ui/vue.config.js | 2 +- .../nodes/Affinity/AffinityTrigger.node.ts | 6 +- 12 files changed, 161 insertions(+), 19 deletions(-) create mode 100644 docker/compose/subfolderWithSSL/.env create mode 100644 docker/compose/subfolderWithSSL/README.md create mode 100644 docker/compose/subfolderWithSSL/docker-compose.yml diff --git a/docker/compose/subfolderWithSSL/.env b/docker/compose/subfolderWithSSL/.env new file mode 100644 index 0000000000..7008bd631a --- /dev/null +++ b/docker/compose/subfolderWithSSL/.env @@ -0,0 +1,25 @@ +# Folder where data should be saved +DATA_FOLDER=/root/n8n/ + +# The top level domain to serve from +DOMAIN_NAME=example.com + +# The subfolder to serve from +SUBFOLDER=app1 +N8N_PATH=/app1/ + +# DOMAIN_NAME and SUBDOMAIN combined decide where n8n will be reachable from +# above example would result in: https://example.com/n8n/ + +# The user name to use for autentication - IMPORTANT ALWAYS CHANGE! +N8N_BASIC_AUTH_USER=user + +# The password to use for autentication - IMPORTANT ALWAYS CHANGE! +N8N_BASIC_AUTH_PASSWORD=password + +# Optional timezone to set which gets used by Cron-Node by default +# If not set New York time will be used +GENERIC_TIMEZONE=Europe/Berlin + +# The email address to use for the SSL certificate creation +SSL_EMAIL=user@example.com diff --git a/docker/compose/subfolderWithSSL/README.md b/docker/compose/subfolderWithSSL/README.md new file mode 100644 index 0000000000..61fcb5b7e7 --- /dev/null +++ b/docker/compose/subfolderWithSSL/README.md @@ -0,0 +1,26 @@ +# n8n on Subfolder with SSL + +Starts n8n and deployes it on a subfolder + + +## Start + +To start n8n in a subfolder simply start docker-compose by executing the following +command in the current folder. + + +**IMPORTANT:** But before you do that change the default users and passwords in the `.env` file! + +``` +docker-compose up -d +``` + +To stop it execute: + +``` +docker-compose stop +``` + +## Configuration + +The default name of the database, user and password for MongoDB can be changed in the `.env` file in the current directory. diff --git a/docker/compose/subfolderWithSSL/docker-compose.yml b/docker/compose/subfolderWithSSL/docker-compose.yml new file mode 100644 index 0000000000..5e540abbb5 --- /dev/null +++ b/docker/compose/subfolderWithSSL/docker-compose.yml @@ -0,0 +1,57 @@ +version: "3" + +services: + traefik: + image: "traefik" + command: + - "--api=true" + - "--api.insecure=true" + - "--api.dashboard=true" + - "--providers.docker=true" + - "--providers.docker.exposedbydefault=false" + - "--entrypoints.websecure.address=:443" + - "--certificatesresolvers.mytlschallenge.acme.tlschallenge=true" + - "--certificatesresolvers.mytlschallenge.acme.email=${SSL_EMAIL}" + - "--certificatesresolvers.mytlschallenge.acme.storage=/letsencrypt/acme.json" + - /home/jan/www/n8n/n8n:/data + ports: + - "443:443" + - "80:80" + volumes: + - ${DATA_FOLDER}/letsencrypt:/letsencrypt + - /var/run/docker.sock:/var/run/docker.sock:ro + n8n: + image: n8nio/n8n + ports: + - "127.0.0.1:5678:5678" + labels: + - traefik.enable=true + - traefik.http.routers.n8n.rule=Host(`${DOMAIN_NAME}`) + - traefik.http.routers.n8n.tls=true + - traefik.http.routers.n8n.entrypoints=websecure + - "traefik.http.routers.n8n.rule=PathPrefix(`/${SUBFOLDER}{regex:$$|/.*}`)" + - "traefik.http.middlewares.n8n-stripprefix.stripprefix.prefixes=/${SUBFOLDER}" + - "traefik.http.routers.n8n.middlewares=n8n-stripprefix" + - traefik.http.routers.n8n.tls.certresolver=mytlschallenge + - traefik.http.middlewares.n8n.headers.SSLRedirect=true + - traefik.http.middlewares.n8n.headers.STSSeconds=315360000 + - traefik.http.middlewares.n8n.headers.browserXSSFilter=true + - traefik.http.middlewares.n8n.headers.contentTypeNosniff=true + - traefik.http.middlewares.n8n.headers.forceSTSHeader=true + - traefik.http.middlewares.n8n.headers.SSLHost=${DOMAIN_NAME} + - traefik.http.middlewares.n8n.headers.STSIncludeSubdomains=true + - traefik.http.middlewares.n8n.headers.STSPreload=true + environment: + - N8N_BASIC_AUTH_ACTIVE=true + - N8N_BASIC_AUTH_USER + - N8N_BASIC_AUTH_PASSWORD + - N8N_HOST=${DOMAIN_NAME} + - N8N_PORT=5678 + - N8N_PROTOCOL=https + - NODE_ENV=production + - N8N_PATH + - WEBHOOK_TUNNEL_URL=http://${DOMAIN_NAME}${N8N_PATH} + - VUE_APP_URL_BASE_API=http://${DOMAIN_NAME}${N8N_PATH} + volumes: + - /var/run/docker.sock:/var/run/docker.sock + - ${DATA_FOLDER}/.n8n:/root/.n8n diff --git a/packages/cli/config/index.ts b/packages/cli/config/index.ts index 847587460f..380a93c4a8 100644 --- a/packages/cli/config/index.ts +++ b/packages/cli/config/index.ts @@ -204,6 +204,13 @@ const config = convict({ }, // How n8n can be reached (Editor & REST-API) + path: { + format: String, + default: '/', + arg: 'path', + env: 'N8N_PATH', + doc: 'Path n8n is deployed to' + }, host: { format: String, default: 'localhost', diff --git a/packages/cli/src/GenericHelpers.ts b/packages/cli/src/GenericHelpers.ts index 8b02b73e8e..cab67f7bce 100644 --- a/packages/cli/src/GenericHelpers.ts +++ b/packages/cli/src/GenericHelpers.ts @@ -40,11 +40,12 @@ export function getBaseUrl(): string { const protocol = config.get('protocol') as string; const host = config.get('host') as string; const port = config.get('port') as number; + const path = config.get('path') as string; if (protocol === 'http' && port === 80 || protocol === 'https' && port === 443) { - return `${protocol}://${host}/`; + return `${protocol}://${host}${path}`; } - return `${protocol}://${host}:${port}/`; + return `${protocol}://${host}:${port}${path}`; } diff --git a/packages/cli/src/Server.ts b/packages/cli/src/Server.ts index 2507b6b136..1a0b75842a 100644 --- a/packages/cli/src/Server.ts +++ b/packages/cli/src/Server.ts @@ -931,7 +931,8 @@ class App { // Authorize OAuth Data this.app.get(`/${this.restEndpoint}/oauth1-credential/auth`, ResponseHelper.send(async (req: express.Request, res: express.Response): Promise => { if (req.query.id === undefined) { - throw new Error('Required credential id is missing!'); + res.status(500).send('Required credential id is missing!'); + return ''; } const result = await Db.collections.Credentials!.findOne(req.query.id as string); @@ -943,7 +944,8 @@ class App { let encryptionKey = undefined; encryptionKey = await UserSettings.getEncryptionKey(); if (encryptionKey === undefined) { - throw new Error('No encryption key got found to decrypt the credentials!'); + res.status(500).send('No encryption key got found to decrypt the credentials!'); + return ''; } // Decrypt the currently saved credentials @@ -1015,7 +1017,8 @@ class App { const { oauth_verifier, oauth_token, cid } = req.query; if (oauth_verifier === undefined || oauth_token === undefined) { - throw new Error('Insufficient parameters for OAuth1 callback'); + const errorResponse = new ResponseHelper.ResponseError('Insufficient parameters for OAuth1 callback. Received following query parameters: ' + JSON.stringify(req.query), undefined, 503); + return ResponseHelper.sendErrorResponse(res, errorResponse); } const result = await Db.collections.Credentials!.findOne(cid as any); // tslint:disable-line:no-any @@ -1085,7 +1088,8 @@ class App { // Authorize OAuth Data this.app.get(`/${this.restEndpoint}/oauth2-credential/auth`, ResponseHelper.send(async (req: express.Request, res: express.Response): Promise => { if (req.query.id === undefined) { - throw new Error('Required credential id is missing!'); + res.status(500).send('Required credential id is missing.'); + return ''; } const result = await Db.collections.Credentials!.findOne(req.query.id as string); @@ -1097,7 +1101,8 @@ class App { let encryptionKey = undefined; encryptionKey = await UserSettings.getEncryptionKey(); if (encryptionKey === undefined) { - throw new Error('No encryption key got found to decrypt the credentials!'); + res.status(500).send('No encryption key got found to decrypt the credentials!'); + return ''; } // Decrypt the currently saved credentials @@ -1161,7 +1166,8 @@ class App { const {code, state: stateEncoded } = req.query; if (code === undefined || stateEncoded === undefined) { - throw new Error('Insufficient parameters for OAuth2 callback'); + const errorResponse = new ResponseHelper.ResponseError('Insufficient parameters for OAuth2 callback. Received following query parameters: ' + JSON.stringify(req.query), undefined, 503); + return ResponseHelper.sendErrorResponse(res, errorResponse); } let state; @@ -1211,17 +1217,20 @@ class App { }, }; } + const redirectUri = `${WebhookHelpers.getWebhookBaseUrl()}${this.restEndpoint}/oauth2-credential/callback`; const oAuthObj = new clientOAuth2({ clientId: _.get(oauthCredentials, 'clientId') as string, clientSecret: _.get(oauthCredentials, 'clientSecret', '') as string, accessTokenUri: _.get(oauthCredentials, 'accessTokenUrl', '') as string, authorizationUri: _.get(oauthCredentials, 'authUrl', '') as string, - redirectUri: `${WebhookHelpers.getWebhookBaseUrl()}${this.restEndpoint}/oauth2-credential/callback`, + redirectUri, scopes: _.split(_.get(oauthCredentials, 'scope', 'openid,') as string, ',') }); - const oauthToken = await oAuthObj.code.getToken(req.originalUrl, options); + const queryParameters = req.originalUrl.split('?').splice(1, 1).join(''); + + const oauthToken = await oAuthObj.code.getToken(`${redirectUri}?${queryParameters}`, options); if (oauthToken === undefined) { const errorResponse = new ResponseHelper.ResponseError('Unable to get access tokens!', undefined, 404); @@ -1693,9 +1702,21 @@ class App { }); } + + // Read the index file and replace the path placeholder + const editorUiPath = require.resolve('n8n-editor-ui'); + const filePath = pathJoin(pathDirname(editorUiPath), 'dist', 'index.html'); + let readIndexFile = readFileSync(filePath, 'utf8'); + const n8nPath = config.get('path'); + readIndexFile = readIndexFile.replace(/\/%BASE_PATH%\//g, n8nPath); + + // Serve the altered index.html file separately + this.app.get(`/index.html`, async (req: express.Request, res: express.Response) => { + res.send(readIndexFile); + }); + // Serve the website const startTime = (new Date()).toUTCString(); - const editorUiPath = require.resolve('n8n-editor-ui'); this.app.use('/', express.static(pathJoin(pathDirname(editorUiPath), 'dist'), { index: 'index.html', setHeaders: (res, path) => { diff --git a/packages/editor-ui/public/index.html b/packages/editor-ui/public/index.html index 2f2450023d..9193fda976 100644 --- a/packages/editor-ui/public/index.html +++ b/packages/editor-ui/public/index.html @@ -4,7 +4,8 @@ - + + n8n.io - Workflow Automation diff --git a/packages/editor-ui/src/components/MainSidebar.vue b/packages/editor-ui/src/components/MainSidebar.vue index 71388c2cd3..a9cf787ef4 100644 --- a/packages/editor-ui/src/components/MainSidebar.vue +++ b/packages/editor-ui/src/components/MainSidebar.vue @@ -16,7 +16,7 @@ @@ -208,6 +208,8 @@ export default mixins( data () { return { aboutDialogVisible: false, + // @ts-ignore + basePath: window.BASE_PATH, isCollapsed: true, credentialNewDialogVisible: false, credentialOpenDialogVisible: false, diff --git a/packages/editor-ui/src/router.ts b/packages/editor-ui/src/router.ts index e82b30b588..4754098c97 100644 --- a/packages/editor-ui/src/router.ts +++ b/packages/editor-ui/src/router.ts @@ -8,7 +8,8 @@ Vue.use(Router); export default new Router({ mode: 'history', - base: process.env.BASE_URL, + // @ts-ignore + base: window.BASE_PATH, routes: [ { path: '/execution/:id', diff --git a/packages/editor-ui/src/store.ts b/packages/editor-ui/src/store.ts index 80454fc9e4..0e1e5f14c4 100644 --- a/packages/editor-ui/src/store.ts +++ b/packages/editor-ui/src/store.ts @@ -38,7 +38,8 @@ export const store = new Vuex.Store({ activeWorkflows: [] as string[], activeActions: [] as string[], activeNode: null as string | null, - baseUrl: process.env.VUE_APP_URL_BASE_API ? process.env.VUE_APP_URL_BASE_API : '/', + // @ts-ignore + baseUrl: window.BASE_PATH ? window.BASE_PATH : '/', credentials: null as ICredentialsResponse[] | null, credentialTypes: null as ICredentialType[] | null, endpointWebhook: 'webhook', diff --git a/packages/editor-ui/vue.config.js b/packages/editor-ui/vue.config.js index cdcd8259f9..c5ffc5fed8 100644 --- a/packages/editor-ui/vue.config.js +++ b/packages/editor-ui/vue.config.js @@ -29,5 +29,5 @@ module.exports = { }, }, }, - publicPath: process.env.VUE_APP_PUBLIC_PATH ? process.env.VUE_APP_PUBLIC_PATH : '/', + publicPath: process.env.VUE_APP_PUBLIC_PATH ? process.env.VUE_APP_PUBLIC_PATH : '/%BASE_PATH%/', }; diff --git a/packages/nodes-base/nodes/Affinity/AffinityTrigger.node.ts b/packages/nodes-base/nodes/Affinity/AffinityTrigger.node.ts index 6b57d46804..3d387e7b4d 100644 --- a/packages/nodes-base/nodes/Affinity/AffinityTrigger.node.ts +++ b/packages/nodes-base/nodes/Affinity/AffinityTrigger.node.ts @@ -52,10 +52,10 @@ export class AffinityTrigger implements INodeType { options: [ { name: 'file.created', - value: 'file.deleted', + value: 'file.created', }, { - name: 'file.created', + name: 'file.deleted', value: 'file.deleted', }, { @@ -136,7 +136,7 @@ export class AffinityTrigger implements INodeType { }, { name: 'opportunity.deleted', - value: 'organization.deleted', + value: 'opportunity.deleted', }, { name: 'person.created', From 8bfc5a4b65803cd9afef1fce106f13968eb5685d Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Sun, 12 Jul 2020 12:48:32 +0200 Subject: [PATCH 217/241] :zap: Small improvements on execution pruning --- packages/cli/config/index.ts | 4 ++-- .../cli/src/WorkflowExecuteAdditionalData.ts | 20 +++++++++---------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/packages/cli/config/index.ts b/packages/cli/config/index.ts index 2390617466..9492b4cb63 100644 --- a/packages/cli/config/index.ts +++ b/packages/cli/config/index.ts @@ -205,8 +205,8 @@ const config = convict({ env: 'EXECUTIONS_DATA_MAX_AGE' }, pruneDataTimeout: { - doc: 'Timeout (ms) after execution data has been pruned', - default: 3600000, + doc: 'Timeout (seconds) after execution data has been pruned', + default: 3600, env: 'EXECUTIONS_DATA_PRUNE_TIMEOUT' }, }, diff --git a/packages/cli/src/WorkflowExecuteAdditionalData.ts b/packages/cli/src/WorkflowExecuteAdditionalData.ts index 9b55f88b58..4230e79f58 100644 --- a/packages/cli/src/WorkflowExecuteAdditionalData.ts +++ b/packages/cli/src/WorkflowExecuteAdditionalData.ts @@ -86,22 +86,22 @@ function executeErrorWorkflow(workflowData: IWorkflowBase, fullRunData: IRun, mo * Throttled to be executed just once in configured timeframe. * */ -let throttling: boolean; +let throttling = false; function pruneExecutionData(): void { if (!throttling) { throttling = true; - const timeout = config.get('executions.pruneDataTimeout') as number; // in ms + const timeout = config.get('executions.pruneDataTimeout') as number; // in seconds const maxAge = config.get('executions.pruneDataMaxAge') as number; // in h const date = new Date(); // today date.setHours(date.getHours() - maxAge); // throttle just on success to allow for self healing on failure - Db.collections.Execution!.delete({ startedAt: LessThanOrEqual(date.toISOString()) }) + Db.collections.Execution!.delete({ stoppedAt: LessThanOrEqual(date.toISOString()) }) .then(data => setTimeout(() => { throttling = false; - }, timeout) - ).catch(err => throttling = false) + }, timeout * 1000) + ).catch(err => throttling = false); } } @@ -215,6 +215,11 @@ function hookFunctionsSave(parentProcessMode?: string): IWorkflowExecuteHooks { workflowExecuteAfter: [ async function (this: WorkflowHooks, fullRunData: IRun, newStaticData: IDataObject): Promise { + // Prune old execution data + if (config.get('executions.pruneData')) { + pruneExecutionData(); + } + const isManualMode = [this.mode, parentProcessMode].includes('manual'); try { @@ -284,11 +289,6 @@ function hookFunctionsSave(parentProcessMode?: string): IWorkflowExecuteHooks { await Db.collections.Execution!.update(this.retryOf, { retrySuccessId: executionResult.id }); } - // Prune old execution data - if (config.get('executions.pruneData')) { - pruneExecutionData() - } - if (!isManualMode) { executeErrorWorkflow(this.workflowData, fullRunData, this.mode, executionResult ? executionResult.id as string : undefined, this.retryOf); } From 687f6087146aa9194ad37b69fec79cc00fecfbff Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Sun, 12 Jul 2020 17:18:50 +0200 Subject: [PATCH 218/241] :zap: Small adjustment to HN-Node --- .../nodes/HackerNews/HackerNews.node.ts | 66 +++++++++++++------ 1 file changed, 46 insertions(+), 20 deletions(-) diff --git a/packages/nodes-base/nodes/HackerNews/HackerNews.node.ts b/packages/nodes-base/nodes/HackerNews/HackerNews.node.ts index 65afe2b83c..b77d5d35bd 100644 --- a/packages/nodes-base/nodes/HackerNews/HackerNews.node.ts +++ b/packages/nodes-base/nodes/HackerNews/HackerNews.node.ts @@ -38,6 +38,10 @@ export class HackerNews implements INodeType { name: 'resource', type: 'options', options: [ + { + name: 'All', + value: 'all', + }, { name: 'Article', value: 'article', @@ -50,9 +54,32 @@ export class HackerNews implements INodeType { default: 'article', description: 'Resource to consume.', }, + + // ---------------------------------- // Operations // ---------------------------------- + { + displayName: 'Operation', + name: 'operation', + type: 'options', + displayOptions: { + show: { + resource: [ + 'all', + ], + }, + }, + options: [ + { + name: 'Get All', + value: 'getAll', + description: 'Get all items', + }, + ], + default: 'getAll', + description: 'Operation to perform.', + }, { displayName: 'Operation', name: 'operation', @@ -70,11 +97,6 @@ export class HackerNews implements INodeType { value: 'get', description: 'Get a Hacker News article', }, - { - name: 'Get All', - value: 'getAll', - description: 'Get all Hacker News articles', - }, ], default: 'get', description: 'Operation to perform.', @@ -148,7 +170,7 @@ export class HackerNews implements INodeType { displayOptions: { show: { resource: [ - 'article', + 'all', ], operation: [ 'getAll', @@ -160,12 +182,12 @@ export class HackerNews implements INodeType { displayName: 'Limit', name: 'limit', type: 'number', - default: 5, + default: 100, description: 'Limit of Hacker News articles to be returned for the query.', displayOptions: { show: { resource: [ - 'article', + 'all', ], operation: [ 'getAll', @@ -211,7 +233,7 @@ export class HackerNews implements INodeType { displayOptions: { show: { resource: [ - 'article', + 'all', ], operation: [ 'getAll', @@ -285,15 +307,8 @@ export class HackerNews implements INodeType { let endpoint = ''; let includeComments = false; - if (resource === 'article') { - - if (operation === 'get') { - - endpoint = `items/${this.getNodeParameter('articleId', i)}`; - const additionalFields = this.getNodeParameter('additionalFields', i) as IDataObject; - includeComments = additionalFields.includeComments as boolean; - - } else if (operation === 'getAll') { + if (resource === 'all') { + if (operation === 'getAll') { const additionalFields = this.getNodeParameter('additionalFields', i) as IDataObject; const keyword = additionalFields.keyword as string; @@ -301,7 +316,7 @@ export class HackerNews implements INodeType { qs = { query: keyword, - tags: tags ? tags.join() : '', + tags: tags ? tags.join() : '', }; returnAll = this.getNodeParameter('returnAll', i) as boolean; @@ -315,6 +330,17 @@ export class HackerNews implements INodeType { } else { throw new Error(`The operation '${operation}' is unknown!`); } + } else if (resource === 'article') { + + if (operation === 'get') { + + endpoint = `items/${this.getNodeParameter('articleId', i)}`; + const additionalFields = this.getNodeParameter('additionalFields', i) as IDataObject; + includeComments = additionalFields.includeComments as boolean; + + } else { + throw new Error(`The operation '${operation}' is unknown!`); + } } else if (resource === 'user') { @@ -335,7 +361,7 @@ export class HackerNews implements INodeType { responseData = await hackerNewsApiRequestAllItems.call(this, 'GET', endpoint, qs); } else { responseData = await hackerNewsApiRequest.call(this, 'GET', endpoint, qs); - if (resource === 'article' && operation === 'getAll') { + if (resource === 'all' && operation === 'getAll') { responseData = responseData.hits; } } From b46161aee761c133ab35bfa8e42b7730fd9ab1ae Mon Sep 17 00:00:00 2001 From: Ricardo Espinoza Date: Sun, 12 Jul 2020 12:12:32 -0400 Subject: [PATCH 219/241] :sparkles: Xero Integration (#639) * :sparkles: Xero Integration * :zap: Add contact resource * :bug: Small fix --- .../credentials/XeroOAuth2Api.credentials.ts | 51 + .../nodes/Xero/ContactDescription.ts | 838 +++++++++++++++ .../nodes-base/nodes/Xero/GenericFunctions.ts | 76 ++ .../nodes/Xero/IContactInterface.ts | 44 + .../nodes/Xero/InvoiceDescription.ts | 983 ++++++++++++++++++ .../nodes-base/nodes/Xero/InvoiceInterface.ts | 40 + packages/nodes-base/nodes/Xero/Xero.node.ts | 681 ++++++++++++ packages/nodes-base/nodes/Xero/xero.png | Bin 0 -> 9587 bytes packages/nodes-base/package.json | 2 + 9 files changed, 2715 insertions(+) create mode 100644 packages/nodes-base/credentials/XeroOAuth2Api.credentials.ts create mode 100644 packages/nodes-base/nodes/Xero/ContactDescription.ts create mode 100644 packages/nodes-base/nodes/Xero/GenericFunctions.ts create mode 100644 packages/nodes-base/nodes/Xero/IContactInterface.ts create mode 100644 packages/nodes-base/nodes/Xero/InvoiceDescription.ts create mode 100644 packages/nodes-base/nodes/Xero/InvoiceInterface.ts create mode 100644 packages/nodes-base/nodes/Xero/Xero.node.ts create mode 100644 packages/nodes-base/nodes/Xero/xero.png diff --git a/packages/nodes-base/credentials/XeroOAuth2Api.credentials.ts b/packages/nodes-base/credentials/XeroOAuth2Api.credentials.ts new file mode 100644 index 0000000000..2db47c13de --- /dev/null +++ b/packages/nodes-base/credentials/XeroOAuth2Api.credentials.ts @@ -0,0 +1,51 @@ +import { + ICredentialType, + NodePropertyTypes, +} from 'n8n-workflow'; + +const scopes = [ + 'offline_access', + 'accounting.transactions', + 'accounting.settings', + 'accounting.contacts', +]; + +export class XeroOAuth2Api implements ICredentialType { + name = 'xeroOAuth2Api'; + extends = [ + 'oAuth2Api', + ]; + displayName = 'Xero OAuth2 API'; + properties = [ + { + displayName: 'Authorization URL', + name: 'authUrl', + type: 'hidden' as NodePropertyTypes, + default: 'https://login.xero.com/identity/connect/authorize', + }, + { + displayName: 'Access Token URL', + name: 'accessTokenUrl', + type: 'hidden' as NodePropertyTypes, + default: 'https://identity.xero.com/connect/token', + }, + { + displayName: 'Scope', + name: 'scope', + type: 'hidden' as NodePropertyTypes, + default: scopes.join(' '), + }, + { + displayName: 'Auth URI Query Parameters', + name: 'authQueryParameters', + type: 'hidden' as NodePropertyTypes, + default: '', + }, + { + displayName: 'Authentication', + name: 'authentication', + type: 'hidden' as NodePropertyTypes, + default: 'header', + }, + ]; +} diff --git a/packages/nodes-base/nodes/Xero/ContactDescription.ts b/packages/nodes-base/nodes/Xero/ContactDescription.ts new file mode 100644 index 0000000000..418aef44ac --- /dev/null +++ b/packages/nodes-base/nodes/Xero/ContactDescription.ts @@ -0,0 +1,838 @@ +import { + INodeProperties, + } from 'n8n-workflow'; + +export const contactOperations = [ + { + displayName: 'Operation', + name: 'operation', + type: 'options', + displayOptions: { + show: { + resource: [ + 'contact', + ], + }, + }, + options: [ + { + name: 'Create', + value: 'create', + description: 'create a contact', + }, + { + name: 'Get', + value: 'get', + description: 'Get a contact', + }, + { + name: 'Get All', + value: 'getAll', + description: 'Get all contacts', + }, + { + name: 'Update', + value: 'update', + description: 'Update a contact', + }, + ], + default: 'create', + description: 'The operation to perform.', + }, +] as INodeProperties[]; + +export const contactFields = [ + +/* -------------------------------------------------------------------------- */ +/* contact:create */ +/* -------------------------------------------------------------------------- */ + { + displayName: 'Organization ID', + name: 'organizationId', + type: 'options', + typeOptions: { + loadOptionsMethod: 'getTenants', + }, + default: '', + displayOptions: { + show: { + resource: [ + 'contact', + ], + operation: [ + 'create', + ], + }, + }, + required: true, + }, + { + displayName: 'Name', + name: 'name', + type: 'string', + default: '', + displayOptions: { + show: { + resource: [ + 'contact', + ], + operation: [ + 'create', + ], + }, + }, + description: 'Full name of contact/organisation', + required: true, + }, + { + displayName: 'Additional Fields', + name: 'additionalFields', + type: 'collection', + placeholder: 'Add Field', + default: {}, + displayOptions: { + show: { + resource: [ + 'contact', + ], + operation: [ + 'create', + ], + }, + }, + options: [ + { + displayName: 'Account Number', + name: 'accountNumber', + type: 'string', + default: '', + description: 'A user defined account number', + }, + // { + // displayName: 'Addresses', + // name: 'addressesUi', + // type: 'fixedCollection', + // typeOptions: { + // multipleValues: true, + // }, + // default: '', + // placeholder: 'Add Address', + // options: [ + // { + // name: 'addressesValues', + // displayName: 'Address', + // values: [ + // { + // displayName: 'Type', + // name: 'type', + // type: 'options', + // options: [ + // { + // name: 'PO Box', + // value: 'POBOX', + // }, + // { + // name: 'Street', + // value: 'STREET', + // }, + // ], + // default: '', + // }, + // { + // displayName: 'Line 1', + // name: 'line1', + // type: 'string', + // default: '', + // }, + // { + // displayName: 'Line 2', + // name: 'line2', + // type: 'string', + // default: '', + // }, + // { + // displayName: 'City', + // name: 'city', + // type: 'string', + // default: '', + // }, + // { + // displayName: 'Region', + // name: 'region', + // type: 'string', + // default: '', + // }, + // { + // displayName: 'Postal Code', + // name: 'postalCode', + // type: 'string', + // default: '', + // }, + // { + // displayName: 'Country', + // name: 'country', + // type: 'string', + // default: '', + // }, + // { + // displayName: 'Attention To', + // name: 'attentionTo', + // type: 'string', + // default: '', + // }, + // ], + // }, + // ], + // }, + { + displayName: 'Bank Account Details', + name: 'bankAccountDetails', + type: 'string', + default: '', + description: 'Bank account number of contact', + }, + { + displayName: 'Contact Number', + name: 'contactNumber', + type: 'string', + default: '', + description: 'This field is read only on the Xero contact screen, used to identify contacts in external systems', + }, + { + displayName: 'Contact Status', + name: 'contactStatus', + type: 'options', + options: [ + { + name: 'Active', + value: 'ACTIVE', + description: 'The Contact is active and can be used in transactions', + }, + { + name: 'Archived', + value: 'ARCHIVED', + description: 'The Contact is archived and can no longer be used in transactions', + }, + { + name: 'GDPR Request', + value: 'GDPRREQUEST', + description: 'The Contact is the subject of a GDPR erasure request', + }, + ], + default: '', + description: 'Current status of a contact - see contact status types', + }, + { + displayName: 'Default Currency', + name: 'defaultCurrency', + type: 'string', + default: '', + description: 'Default currency for raising invoices against contact', + }, + { + displayName: 'Email', + name: 'emailAddress', + type: 'string', + default: '', + description: 'Email address of contact person (umlauts not supported) (max length = 255)', + }, + { + displayName: 'First Name', + name: 'firstName', + type: 'string', + default: '', + description: 'First name of contact person (max length = 255)', + }, + { + displayName: 'Last Name', + name: 'lastName', + type: 'string', + default: '', + description: 'Last name of contact person (max length = 255)', + }, + // { + // displayName: 'Phones', + // name: 'phonesUi', + // type: 'fixedCollection', + // typeOptions: { + // multipleValues: true, + // }, + // default: '', + // placeholder: 'Add Phone', + // options: [ + // { + // name: 'phonesValues', + // displayName: 'Phones', + // values: [ + // { + // displayName: 'Type', + // name: 'type', + // type: 'options', + // options: [ + // { + // name: 'Default', + // value: 'DEFAULT', + // }, + // { + // name: 'DDI', + // value: 'DDI', + // }, + // { + // name: 'Mobile', + // value: 'MOBILE', + // }, + // { + // name: 'Fax', + // value: 'FAX', + // }, + // ], + // default: '', + // }, + // { + // displayName: 'Number', + // name: 'phoneNumber', + // type: 'string', + // default: '', + // }, + // { + // displayName: 'Area Code', + // name: 'phoneAreaCode', + // type: 'string', + // default: '', + // }, + // { + // displayName: 'Country Code', + // name: 'phoneCountryCode', + // type: 'string', + // default: '', + // }, + // ], + // }, + // ], + // }, + { + displayName: 'Purchase Default Account Code', + name: 'purchasesDefaultAccountCode', + type: 'options', + typeOptions: { + loadOptionsMethod: 'getAccountCodes', + }, + default: '', + description: 'The default purchases account code for contacts', + }, + { + displayName: 'Sales Default Account Code', + name: 'salesDefaultAccountCode', + type: 'options', + typeOptions: { + loadOptionsMethod: 'getAccountCodes', + }, + default: '', + description: 'The default sales account code for contacts', + }, + { + displayName: 'Skype', + name: 'skypeUserName', + type: 'string', + default: '', + description: 'Skype user name of contact', + }, + { + displayName: 'Tax Number', + name: 'taxNumber', + type: 'string', + default: '', + description: 'Tax number of contact', + }, + { + displayName: 'Xero Network Key', + name: 'xeroNetworkKey', + type: 'string', + default: '', + description: 'Store XeroNetworkKey for contacts', + }, + ], + }, +/* -------------------------------------------------------------------------- */ +/* contact:get */ +/* -------------------------------------------------------------------------- */ + { + displayName: 'Organization ID', + name: 'organizationId', + type: 'options', + typeOptions: { + loadOptionsMethod: 'getTenants', + }, + default: '', + displayOptions: { + show: { + resource: [ + 'contact', + ], + operation: [ + 'get', + ], + }, + }, + required: true, + }, + { + displayName: 'Contact ID', + name: 'contactId', + type: 'string', + default: '', + displayOptions: { + show: { + resource: [ + 'contact', + ], + operation: [ + 'get', + ], + }, + }, + required: true, + }, +/* -------------------------------------------------------------------------- */ +/* contact:getAll */ +/* -------------------------------------------------------------------------- */ + { + displayName: 'Organization ID', + name: 'organizationId', + type: 'options', + typeOptions: { + loadOptionsMethod: 'getTenants', + }, + default: '', + displayOptions: { + show: { + resource: [ + 'contact', + ], + operation: [ + 'getAll', + ], + }, + }, + required: true, + }, + { + displayName: 'Return All', + name: 'returnAll', + type: 'boolean', + displayOptions: { + show: { + resource: [ + 'contact', + ], + operation: [ + 'getAll', + ], + }, + }, + default: false, + description: 'If all results should be returned or only up to a given limit.', + }, + { + displayName: 'Limit', + name: 'limit', + type: 'number', + displayOptions: { + show: { + resource: [ + 'contact', + ], + operation: [ + 'getAll', + ], + returnAll: [ + false, + ], + }, + }, + typeOptions: { + minValue: 1, + maxValue: 100, + }, + default: 100, + description: 'How many results to return.', + }, + { + displayName: 'Options', + name: 'options', + type: 'collection', + placeholder: 'Add Option', + default: {}, + displayOptions: { + show: { + resource: [ + 'contact', + ], + operation: [ + 'getAll', + ], + }, + }, + options: [ + { + displayName: 'Include Archived', + name: 'includeArchived', + type: 'boolean', + default: false, + description: `Contacts with a status of ARCHIVED will be included in the response`, + }, + { + displayName: 'Order By', + name: 'orderBy', + type: 'string', + placeholder: 'contactID', + default: '', + description: 'Order by any element returned', + }, + { + displayName: 'Sort Order', + name: 'sortOrder', + type: 'options', + options: [ + { + name: 'Asc', + value: 'ASC', + }, + { + name: 'Desc', + value: 'DESC', + }, + ], + default: '', + description: 'Sort order', + }, + { + displayName: 'Where', + name: 'where', + type: 'string', + typeOptions: { + alwaysOpenEditWindow: true, + }, + placeholder: 'EmailAddress!=null&&EmailAddress.StartsWith("boom")', + default: '', + description: `The where parameter allows you to filter on endpoints and elements that don't have explicit parameters. Examples Here`, + }, + ], + }, +/* -------------------------------------------------------------------------- */ +/* contact:update */ +/* -------------------------------------------------------------------------- */ + { + displayName: 'Organization ID', + name: 'organizationId', + type: 'options', + typeOptions: { + loadOptionsMethod: 'getTenants', + }, + default: '', + displayOptions: { + show: { + resource: [ + 'contact', + ], + operation: [ + 'update', + ], + }, + }, + required: true, + }, + { + displayName: 'Contact ID', + name: 'contactId', + type: 'string', + default: '', + displayOptions: { + show: { + resource: [ + 'contact', + ], + operation: [ + 'update', + ], + }, + }, + required: true, + }, + { + displayName: 'Update Fields', + name: 'updateFields', + type: 'collection', + placeholder: 'Add Field', + default: {}, + displayOptions: { + show: { + resource: [ + 'contact', + ], + operation: [ + 'update', + ], + }, + }, + options: [ + { + displayName: 'Account Number', + name: 'accountNumber', + type: 'string', + default: '', + description: 'A user defined account number', + }, + // { + // displayName: 'Addresses', + // name: 'addressesUi', + // type: 'fixedCollection', + // typeOptions: { + // multipleValues: true, + // }, + // default: '', + // placeholder: 'Add Address', + // options: [ + // { + // name: 'addressesValues', + // displayName: 'Address', + // values: [ + // { + // displayName: 'Type', + // name: 'type', + // type: 'options', + // options: [ + // { + // name: 'PO Box', + // value: 'POBOX', + // }, + // { + // name: 'Street', + // value: 'STREET', + // }, + // ], + // default: '', + // }, + // { + // displayName: 'Line 1', + // name: 'line1', + // type: 'string', + // default: '', + // }, + // { + // displayName: 'Line 2', + // name: 'line2', + // type: 'string', + // default: '', + // }, + // { + // displayName: 'City', + // name: 'city', + // type: 'string', + // default: '', + // }, + // { + // displayName: 'Region', + // name: 'region', + // type: 'string', + // default: '', + // }, + // { + // displayName: 'Postal Code', + // name: 'postalCode', + // type: 'string', + // default: '', + // }, + // { + // displayName: 'Country', + // name: 'country', + // type: 'string', + // default: '', + // }, + // { + // displayName: 'Attention To', + // name: 'attentionTo', + // type: 'string', + // default: '', + // }, + // ], + // }, + // ], + // }, + { + displayName: 'Bank Account Details', + name: 'bankAccountDetails', + type: 'string', + default: '', + description: 'Bank account number of contact', + }, + { + displayName: 'Contact Number', + name: 'contactNumber', + type: 'string', + default: '', + description: 'This field is read only on the Xero contact screen, used to identify contacts in external systems', + }, + { + displayName: 'Contact Status', + name: 'contactStatus', + type: 'options', + options: [ + { + name: 'Active', + value: 'ACTIVE', + description: 'The Contact is active and can be used in transactions', + }, + { + name: 'Archived', + value: 'ARCHIVED', + description: 'The Contact is archived and can no longer be used in transactions', + }, + { + name: 'GDPR Request', + value: 'GDPRREQUEST', + description: 'The Contact is the subject of a GDPR erasure request', + }, + ], + default: '', + description: 'Current status of a contact - see contact status types', + }, + { + displayName: 'Default Currency', + name: 'defaultCurrency', + type: 'string', + default: '', + description: 'Default currency for raising invoices against contact', + }, + { + displayName: 'Email', + name: 'emailAddress', + type: 'string', + default: '', + description: 'Email address of contact person (umlauts not supported) (max length = 255)', + }, + { + displayName: 'First Name', + name: 'firstName', + type: 'string', + default: '', + description: 'First name of contact person (max length = 255)', + }, + { + displayName: 'Last Name', + name: 'lastName', + type: 'string', + default: '', + description: 'Last name of contact person (max length = 255)', + }, + { + displayName: 'Name', + name: 'name', + type: 'string', + default: '', + description: 'Full name of contact/organisation', + }, + // { + // displayName: 'Phones', + // name: 'phonesUi', + // type: 'fixedCollection', + // typeOptions: { + // multipleValues: true, + // }, + // default: '', + // placeholder: 'Add Phone', + // options: [ + // { + // name: 'phonesValues', + // displayName: 'Phones', + // values: [ + // { + // displayName: 'Type', + // name: 'type', + // type: 'options', + // options: [ + // { + // name: 'Default', + // value: 'DEFAULT', + // }, + // { + // name: 'DDI', + // value: 'DDI', + // }, + // { + // name: 'Mobile', + // value: 'MOBILE', + // }, + // { + // name: 'Fax', + // value: 'FAX', + // }, + // ], + // default: '', + // }, + // { + // displayName: 'Number', + // name: 'phoneNumber', + // type: 'string', + // default: '', + // }, + // { + // displayName: 'Area Code', + // name: 'phoneAreaCode', + // type: 'string', + // default: '', + // }, + // { + // displayName: 'Country Code', + // name: 'phoneCountryCode', + // type: 'string', + // default: '', + // }, + // ], + // }, + // ], + // }, + { + displayName: 'Purchase Default Account Code', + name: 'purchasesDefaultAccountCode', + type: 'options', + typeOptions: { + loadOptionsMethod: 'getAccountCodes', + }, + default: '', + description: 'The default purchases account code for contacts', + }, + { + displayName: 'Sales Default Account Code', + name: 'salesDefaultAccountCode', + type: 'options', + typeOptions: { + loadOptionsMethod: 'getAccountCodes', + }, + default: '', + description: 'The default sales account code for contacts', + }, + { + displayName: 'Skype', + name: 'skypeUserName', + type: 'string', + default: '', + description: 'Skype user name of contact', + }, + { + displayName: 'Tax Number', + name: 'taxNumber', + type: 'string', + default: '', + description: 'Tax number of contact', + }, + { + displayName: 'Xero Network Key', + name: 'xeroNetworkKey', + type: 'string', + default: '', + description: 'Store XeroNetworkKey for contacts', + }, + ], + }, +] as INodeProperties[]; diff --git a/packages/nodes-base/nodes/Xero/GenericFunctions.ts b/packages/nodes-base/nodes/Xero/GenericFunctions.ts new file mode 100644 index 0000000000..840579bf2f --- /dev/null +++ b/packages/nodes-base/nodes/Xero/GenericFunctions.ts @@ -0,0 +1,76 @@ +import { + OptionsWithUri, + } from 'request'; + +import { + IExecuteFunctions, + IExecuteSingleFunctions, + ILoadOptionsFunctions, +} from 'n8n-core'; + +import { + IDataObject, +} from 'n8n-workflow'; + +export async function xeroApiRequest(this: IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions, method: string, resource: string, body: any = {}, qs: IDataObject = {}, uri?: string, headers: IDataObject = {}): Promise { // tslint:disable-line:no-any + const options: OptionsWithUri = { + headers: { + 'Content-Type': 'application/json', + }, + method, + body, + qs, + uri: uri || `https://api.xero.com/api.xro/2.0${resource}`, + json: true + }; + try { + if (body.organizationId) { + options.headers = { ...options.headers, 'Xero-tenant-id': body.organizationId }; + delete body.organizationId; + } + if (Object.keys(headers).length !== 0) { + options.headers = Object.assign({}, options.headers, headers); + } + if (Object.keys(body).length === 0) { + delete options.body; + } + //@ts-ignore + return await this.helpers.requestOAuth2.call(this, 'xeroOAuth2Api', options); + } catch (error) { + let errorMessage; + + if (error.response && error.response.body && error.response.body.Message) { + + errorMessage = error.response.body.Message; + + if (error.response.body.Elements) { + const elementErrors = []; + for (const element of error.response.body.Elements) { + elementErrors.push(element.ValidationErrors.map((error: IDataObject) => error.Message).join('|')); + } + errorMessage = elementErrors.join('-'); + } + // Try to return the error prettier + throw new Error(`Xero error response [${error.statusCode}]: ${errorMessage}`); + } + throw error; + } +} + +export async function xeroApiRequestAllItems(this: IExecuteFunctions | ILoadOptionsFunctions, propertyName: string ,method: string, endpoint: string, body: any = {}, query: IDataObject = {}): Promise { // tslint:disable-line:no-any + + const returnData: IDataObject[] = []; + + let responseData; + query.page = 1; + + do { + responseData = await xeroApiRequest.call(this, method, endpoint, body, query); + query.page++; + returnData.push.apply(returnData, responseData[propertyName]); + } while ( + responseData[propertyName].length !== 0 + ); + + return returnData; +} diff --git a/packages/nodes-base/nodes/Xero/IContactInterface.ts b/packages/nodes-base/nodes/Xero/IContactInterface.ts new file mode 100644 index 0000000000..1fc5eebe6a --- /dev/null +++ b/packages/nodes-base/nodes/Xero/IContactInterface.ts @@ -0,0 +1,44 @@ + +export interface IAddress { + Type?: string; + AddressLine1?: string; + AddressLine2?: string; + City?: string; + Region?: string; + PostalCode?: string; + Country?: string; + AttentionTo?: string; +} + +export interface IPhone { + Type?: string; + PhoneNumber?: string; + PhoneAreaCode?: string; + PhoneCountryCode?: string; +} + +export interface IContact extends ITenantId { + AccountNumber?: string; + Addresses?: IAddress[]; + BankAccountDetails?: string; + ContactId?: string; + ContactNumber?: string; + ContactStatus?: string; + DefaultCurrency?: string; + EmailAddress?: string; + FirstName?: string; + LastName?: string; + Name?: string; + Phones?: IPhone[]; + PurchaseTrackingCategory?: string; + PurchasesDefaultAccountCode?: string; + SalesDefaultAccountCode?: string; + SalesTrackingCategory?: string; + SkypeUserName?: string; + taxNumber?: string; + xeroNetworkKey?: string; +} + +export interface ITenantId { + organizationId?: string; +} diff --git a/packages/nodes-base/nodes/Xero/InvoiceDescription.ts b/packages/nodes-base/nodes/Xero/InvoiceDescription.ts new file mode 100644 index 0000000000..6591adc24c --- /dev/null +++ b/packages/nodes-base/nodes/Xero/InvoiceDescription.ts @@ -0,0 +1,983 @@ +import { + INodeProperties, + } from 'n8n-workflow'; + +export const invoiceOperations = [ + { + displayName: 'Operation', + name: 'operation', + type: 'options', + displayOptions: { + show: { + resource: [ + 'invoice', + ], + }, + }, + options: [ + { + name: 'Create', + value: 'create', + description: 'Create a invoice', + }, + { + name: 'Get', + value: 'get', + description: 'Get a invoice', + }, + { + name: 'Get All', + value: 'getAll', + description: 'Get all invoices', + }, + { + name: 'Update', + value: 'update', + description: 'Update a invoice', + }, + ], + default: 'create', + description: 'The operation to perform.', + }, +] as INodeProperties[]; + +export const invoiceFields = [ + +/* -------------------------------------------------------------------------- */ +/* invoice:create */ +/* -------------------------------------------------------------------------- */ + { + displayName: 'Organization ID', + name: 'organizationId', + type: 'options', + typeOptions: { + loadOptionsMethod: 'getTenants', + }, + default: '', + displayOptions: { + show: { + resource: [ + 'invoice', + ], + operation: [ + 'create', + ], + }, + }, + required: true, + }, + { + displayName: 'Type', + name: 'type', + type: 'options', + options: [ + { + name: 'Bill', + value: 'ACCPAY', + description: 'Accounts Payable or supplier invoice' + }, + { + name: 'Sales Invoice', + value: 'ACCREC', + description: ' Accounts Receivable or customer invoice' + }, + ], + default: '', + displayOptions: { + show: { + resource: [ + 'invoice', + ], + operation: [ + 'create', + ], + }, + }, + required: true, + description: 'Invoice Type', + }, + { + displayName: 'Contact ID', + name: 'contactId', + type: 'string', + default: '', + displayOptions: { + show: { + resource: [ + 'invoice', + ], + operation: [ + 'create', + ], + }, + }, + required: true, + description: 'Contact ID', + }, + { + displayName: 'Line Items', + name: 'lineItemsUi', + placeholder: 'Add Line Item', + type: 'fixedCollection', + default: '', + typeOptions: { + multipleValues: true, + }, + displayOptions: { + show: { + resource: [ + 'invoice', + ], + operation: [ + 'create', + ] + }, + }, + description: 'Line item data', + options: [ + { + name: 'lineItemsValues', + displayName: 'Line Item', + values: [ + { + displayName: 'Description', + name: 'description', + type: 'string', + default: '', + description: 'A line item with just a description', + }, + { + displayName: 'Quantity', + name: 'quantity', + type: 'number', + default: 1, + typeOptions: { + minValue: 1, + }, + description: 'LineItem Quantity', + }, + { + displayName: 'Unit Amount', + name: 'unitAmount', + type: 'string', + default: '', + description: 'Lineitem unit amount. By default, unit amount will be rounded to two decimal places.', + }, + { + displayName: 'Item Code', + name: 'itemCode', + type: 'options', + typeOptions: { + loadOptionsMethod: 'getItemCodes', + loadOptionsDependsOn: [ + 'organizationId', + ], + }, + default: '', + }, + { + displayName: 'Account Code', + name: 'accountCode', + type: 'options', + typeOptions: { + loadOptionsMethod: 'getAccountCodes', + loadOptionsDependsOn: [ + 'organizationId', + ], + }, + default: '', + }, + { + displayName: 'Tax Type', + name: 'taxType', + type: 'options', + options: [ + { + name: 'Tax on Purchases', + value: 'INPUT', + }, + { + name: 'Tax Exempt', + value: 'NONE', + }, + { + name: 'Tax on Sales', + value: 'OUTPUT', + }, + { + name: 'Sales Tax on Imports ', + value: 'GSTONIMPORTS', + }, + ], + default: '', + required: true, + description: 'Tax Type', + }, + { + displayName: 'Tax Amount', + name: 'taxAmount', + type: 'string', + default: '', + description: 'The tax amount is auto calculated as a percentage of the line amount based on the tax rate.', + }, + { + displayName: 'Line Amount', + name: 'lineAmount', + type: 'string', + default: '', + description: 'The line amount reflects the discounted price if a DiscountRate has been used', + }, + { + displayName: 'Discount Rate', + name: 'discountRate', + type: 'string', + default: '', + description: 'Percentage discount or discount amount being applied to a line item. Only supported on ACCREC invoices - ACCPAY invoices and credit notes in Xero do not support discounts', + }, + // { + // displayName: 'Tracking', + // name: 'trackingUi', + // placeholder: 'Add Tracking', + // description: 'Any LineItem can have a maximum of 2 TrackingCategory elements.', + // type: 'fixedCollection', + // typeOptions: { + // multipleValues: true, + // }, + // default: {}, + // options: [ + // { + // name: 'trackingValues', + // displayName: 'Tracking', + // values: [ + // { + // displayName: 'Name', + // name: 'name', + // type: 'options', + // typeOptions: { + // loadOptionsMethod: 'getTrakingCategories', + // loadOptionsDependsOn: [ + // 'organizationId', + // ], + // }, + // default: '', + // description: 'Name of the tracking category', + // }, + // { + // displayName: 'Option', + // name: 'option', + // type: 'options', + // typeOptions: { + // loadOptionsMethod: 'getTrakingOptions', + // loadOptionsDependsOn: [ + // '/name', + // ], + // }, + // default: '', + // description: 'Name of the option', + // }, + // ], + // }, + // ], + // }, + ], + }, + ], + }, + { + displayName: 'Additional Fields', + name: 'additionalFields', + type: 'collection', + placeholder: 'Add Field', + default: {}, + displayOptions: { + show: { + resource: [ + 'invoice', + ], + operation: [ + 'create', + ], + }, + }, + options: [ + { + displayName: 'Branding Theme ID', + name: 'brandingThemeId', + type: 'options', + typeOptions: { + loadOptionsMethod: 'getBrandingThemes', + loadOptionsDependsOn: [ + 'organizationId', + ], + }, + default: '', + }, + { + displayName: 'Currency', + name: 'currency', + type: 'options', + typeOptions: { + loadOptionsMethod: 'getCurrencies', + loadOptionsDependsOn: [ + 'organizationId', + ], + }, + default: '', + }, + { + displayName: 'Currency Rate', + name: 'currencyRate', + type: 'string', + default: '', + description: 'The currency rate for a multicurrency invoice. If no rate is specified, the XE.com day rate is used.', + }, + { + displayName: 'Date', + name: 'date', + type: 'dateTime', + default: '', + description: 'Date invoice was issued - YYYY-MM-DD. If the Date element is not specified it will default to the current date based on the timezone setting of the organisation', + }, + { + displayName: 'Due Date', + name: 'dueDate', + type: 'dateTime', + default: '', + description: 'Date invoice is due - YYYY-MM-DD', + }, + { + displayName: 'Expected Payment Date', + name: 'expectedPaymentDate', + type: 'dateTime', + default: '', + description: 'Shown on sales invoices (Accounts Receivable) when this has been set', + }, + { + displayName: 'Invoice Number', + name: 'invoiceNumber', + type: 'string', + default: '', + }, + { + displayName: 'Line Amount Type', + name: 'lineAmountType', + type: 'options', + options: [ + { + name: 'Exclusive', + value: 'Exclusive', + description: 'Line items are exclusive of tax', + }, + { + name: 'Inclusive', + value: 'Inclusive', + description: 'Line items are inclusive tax', + }, + { + name: 'NoTax', + value: 'NoTax', + description: 'Line have no tax', + }, + ], + default: 'Exclusive', + }, + { + displayName: 'Planned Payment Date ', + name: 'plannedPaymentDate', + type: 'dateTime', + default: '', + description: 'Shown on bills (Accounts Payable) when this has been set', + }, + { + displayName: 'Reference', + name: 'reference', + type: 'string', + default: '', + description: 'ACCREC only - additional reference number (max length = 255)', + }, + { + displayName: 'Send To Contact', + name: 'sendToContact', + type: 'boolean', + default: false, + description: 'Whether the invoice in the Xero app should be marked as "sent". This can be set only on invoices that have been approved', + }, + { + displayName: 'Status', + name: 'status', + type: 'options', + options: [ + { + name: 'Draft', + value: 'DRAFT', + }, + { + name: 'Submitted', + value: 'SUBMITTED', + }, + { + name: 'Authorised', + value: 'AUTHORISED', + }, + ], + default: 'DRAFT', + }, + { + displayName: 'URL', + name: 'url', + type: 'string', + default: '', + description: 'URL link to a source document - shown as "Go to [appName]" in the Xero app', + }, + ], + }, +/* -------------------------------------------------------------------------- */ +/* invoice:update */ +/* -------------------------------------------------------------------------- */ + { + displayName: 'Organization ID', + name: 'organizationId', + type: 'options', + typeOptions: { + loadOptionsMethod: 'getTenants', + }, + default: '', + displayOptions: { + show: { + resource: [ + 'invoice', + ], + operation: [ + 'update', + ], + }, + }, + required: true, + }, + { + displayName: 'Invoice ID', + name: 'invoiceId', + type: 'string', + default: '', + required: true, + displayOptions: { + show: { + resource: [ + 'invoice', + ], + operation: [ + 'update', + ], + }, + }, + description: 'Invoice ID', + }, + { + displayName: 'Update Fields', + name: 'updateFields', + type: 'collection', + placeholder: 'Add Field', + default: {}, + displayOptions: { + show: { + resource: [ + 'invoice', + ], + operation: [ + 'update', + ], + }, + }, + options: [ + { + displayName: 'Branding Theme ID', + name: 'brandingThemeId', + type: 'options', + typeOptions: { + loadOptionsMethod: 'getBrandingThemes', + loadOptionsDependsOn: [ + 'organizationId', + ], + }, + default: '', + }, + { + displayName: 'Contact ID', + name: 'contactId', + type: 'string', + default: '', + description: 'Contact ID', + }, + { + displayName: 'Currency', + name: 'currency', + type: 'options', + typeOptions: { + loadOptionsMethod: 'getCurrencies', + loadOptionsDependsOn: [ + 'organizationId', + ], + }, + default: '', + }, + { + displayName: 'Currency Rate', + name: 'currencyRate', + type: 'string', + default: '', + description: 'The currency rate for a multicurrency invoice. If no rate is specified, the XE.com day rate is used.', + }, + { + displayName: 'Date', + name: 'date', + type: 'dateTime', + default: '', + description: 'Date invoice was issued - YYYY-MM-DD. If the Date element is not specified it will default to the current date based on the timezone setting of the organisation', + }, + { + displayName: 'Due Date', + name: 'dueDate', + type: 'dateTime', + default: '', + description: 'Date invoice is due - YYYY-MM-DD', + }, + { + displayName: 'Expected Payment Date', + name: 'expectedPaymentDate', + type: 'dateTime', + default: '', + description: 'Shown on sales invoices (Accounts Receivable) when this has been set', + }, + { + displayName: 'Invoice Number', + name: 'invoiceNumber', + type: 'string', + default: '', + }, + { + displayName: 'Line Amount Type', + name: 'lineAmountType', + type: 'options', + options: [ + { + name: 'Exclusive', + value: 'Exclusive', + description: 'Line items are exclusive of tax', + }, + { + name: 'Inclusive', + value: 'Inclusive', + description: 'Line items are inclusive tax', + }, + { + name: 'NoTax', + value: 'NoTax', + description: 'Line have no tax', + }, + ], + default: 'Exclusive', + }, + { + displayName: 'Line Items', + name: 'lineItemsUi', + placeholder: 'Add Line Item', + type: 'fixedCollection', + default: '', + typeOptions: { + multipleValues: true, + }, + description: 'Line item data', + options: [ + { + name: 'lineItemsValues', + displayName: 'Line Item', + values: [ + { + displayName: 'Line Item ID', + name: 'lineItemId', + type: 'string', + default: '', + description: 'The Xero generated identifier for a LineItem', + }, + { + displayName: 'Description', + name: 'description', + type: 'string', + default: '', + description: 'A line item with just a description', + }, + { + displayName: 'Quantity', + name: 'quantity', + type: 'number', + default: 1, + typeOptions: { + minValue: 1, + }, + description: 'LineItem Quantity', + }, + { + displayName: 'Unit Amount', + name: 'unitAmount', + type: 'string', + default: '', + description: 'Lineitem unit amount. By default, unit amount will be rounded to two decimal places.', + }, + { + displayName: 'Item Code', + name: 'itemCode', + type: 'options', + typeOptions: { + loadOptionsMethod: 'getItemCodes', + loadOptionsDependsOn: [ + 'organizationId', + ], + }, + default: '', + }, + { + displayName: 'Account Code', + name: 'accountCode', + type: 'options', + typeOptions: { + loadOptionsMethod: 'getAccountCodes', + loadOptionsDependsOn: [ + 'organizationId', + ], + }, + default: '', + }, + { + displayName: 'Tax Type', + name: 'taxType', + type: 'options', + options: [ + { + name: 'Tax on Purchases', + value: 'INPUT', + }, + { + name: 'Tax Exempt', + value: 'NONE', + }, + { + name: 'Tax on Sales', + value: 'OUTPUT', + }, + { + name: 'Sales Tax on Imports ', + value: 'GSTONIMPORTS', + }, + ], + default: '', + required: true, + description: 'Tax Type', + }, + { + displayName: 'Tax Amount', + name: 'taxAmount', + type: 'string', + default: '', + description: 'The tax amount is auto calculated as a percentage of the line amount based on the tax rate.', + }, + { + displayName: 'Line Amount', + name: 'lineAmount', + type: 'string', + default: '', + description: 'The line amount reflects the discounted price if a DiscountRate has been used', + }, + { + displayName: 'Discount Rate', + name: 'discountRate', + type: 'string', + default: '', + description: 'Percentage discount or discount amount being applied to a line item. Only supported on ACCREC invoices - ACCPAY invoices and credit notes in Xero do not support discounts', + }, + // { + // displayName: 'Tracking', + // name: 'trackingUi', + // placeholder: 'Add Tracking', + // description: 'Any LineItem can have a maximum of 2 TrackingCategory elements.', + // type: 'fixedCollection', + // typeOptions: { + // multipleValues: true, + // }, + // default: {}, + // options: [ + // { + // name: 'trackingValues', + // displayName: 'Tracking', + // values: [ + // { + // displayName: 'Name', + // name: 'name', + // type: 'options', + // typeOptions: { + // loadOptionsMethod: 'getTrakingCategories', + // loadOptionsDependsOn: [ + // 'organizationId', + // ], + // }, + // default: '', + // description: 'Name of the tracking category', + // }, + // { + // displayName: 'Option', + // name: 'option', + // type: 'options', + // typeOptions: { + // loadOptionsMethod: 'getTrakingOptions', + // loadOptionsDependsOn: [ + // '/name', + // ], + // }, + // default: '', + // description: 'Name of the option', + // }, + // ], + // }, + // ], + // }, + ], + }, + ], + }, + { + displayName: 'Planned Payment Date ', + name: 'plannedPaymentDate', + type: 'dateTime', + default: '', + description: 'Shown on bills (Accounts Payable) when this has been set', + }, + { + displayName: 'Reference', + name: 'reference', + type: 'string', + default: '', + description: 'ACCREC only - additional reference number (max length = 255)', + }, + { + displayName: 'Send To Contact', + name: 'sendToContact', + type: 'boolean', + default: false, + description: 'Whether the invoice in the Xero app should be marked as "sent". This can be set only on invoices that have been approved', + }, + { + displayName: 'Status', + name: 'status', + type: 'options', + options: [ + { + name: 'Draft', + value: 'DRAFT', + }, + { + name: 'Submitted', + value: 'SUBMITTED', + }, + { + name: 'Authorised', + value: 'AUTHORISED', + }, + ], + default: 'DRAFT', + }, + { + displayName: 'URL', + name: 'url', + type: 'string', + default: '', + description: 'URL link to a source document - shown as "Go to [appName]" in the Xero app', + }, + ], + }, +/* -------------------------------------------------------------------------- */ +/* invoice:get */ +/* -------------------------------------------------------------------------- */ + { + displayName: 'Organization ID', + name: 'organizationId', + type: 'options', + typeOptions: { + loadOptionsMethod: 'getTenants', + }, + default: '', + displayOptions: { + show: { + resource: [ + 'invoice', + ], + operation: [ + 'get', + ], + }, + }, + required: true, + }, + { + displayName: 'Invoice ID', + name: 'invoiceId', + type: 'string', + default: '', + required: true, + displayOptions: { + show: { + resource: [ + 'invoice', + ], + operation: [ + 'get', + ], + }, + }, + description: 'Invoice ID', + }, +/* -------------------------------------------------------------------------- */ +/* invoice:getAll */ +/* -------------------------------------------------------------------------- */ + { + displayName: 'Organization ID', + name: 'organizationId', + type: 'options', + typeOptions: { + loadOptionsMethod: 'getTenants', + }, + default: '', + displayOptions: { + show: { + resource: [ + 'invoice', + ], + operation: [ + 'getAll', + ], + }, + }, + required: true, + }, + { + displayName: 'Return All', + name: 'returnAll', + type: 'boolean', + displayOptions: { + show: { + resource: [ + 'invoice', + ], + operation: [ + 'getAll', + ], + }, + }, + default: false, + description: 'If all results should be returned or only up to a given limit.', + }, + { + displayName: 'Limit', + name: 'limit', + type: 'number', + displayOptions: { + show: { + resource: [ + 'invoice', + ], + operation: [ + 'getAll', + ], + returnAll: [ + false, + ], + }, + }, + typeOptions: { + minValue: 1, + maxValue: 100, + }, + default: 100, + description: 'How many results to return.', + }, + { + displayName: 'Options', + name: 'options', + type: 'collection', + placeholder: 'Add Option', + default: {}, + displayOptions: { + show: { + resource: [ + 'invoice', + ], + operation: [ + 'getAll', + ], + }, + }, + options: [ + { + displayName: 'Created By My App', + name: 'createdByMyApp', + type: 'boolean', + default: false, + description: `When set to true you'll only retrieve Invoices created by your app`, + }, + { + displayName: 'Order By', + name: 'orderBy', + type: 'string', + placeholder: 'InvoiceID', + default: '', + description: 'Order by any element returned', + }, + { + displayName: 'Sort Order', + name: 'sortOrder', + type: 'options', + options: [ + { + name: 'Asc', + value: 'ASC', + }, + { + name: 'Desc', + value: 'DESC', + }, + ], + default: '', + description: 'Sort order', + }, + { + displayName: 'Statuses', + name: 'statuses', + type: 'multiOptions', + options: [ + { + name: 'Draft', + value: 'DRAFT', + }, + { + name: 'Submitted', + value: 'SUBMITTED', + }, + { + name: 'Authorised', + value: 'AUTHORISED', + }, + ], + default: [], + }, + { + displayName: 'Where', + name: 'where', + type: 'string', + typeOptions: { + alwaysOpenEditWindow: true, + }, + placeholder: 'EmailAddress!=null&&EmailAddress.StartsWith("boom")', + default: '', + description: `The where parameter allows you to filter on endpoints and elements that don't have explicit parameters. Examples Here`, + }, + ], + }, +] as INodeProperties[]; diff --git a/packages/nodes-base/nodes/Xero/InvoiceInterface.ts b/packages/nodes-base/nodes/Xero/InvoiceInterface.ts new file mode 100644 index 0000000000..6d6da63fb9 --- /dev/null +++ b/packages/nodes-base/nodes/Xero/InvoiceInterface.ts @@ -0,0 +1,40 @@ +import { + IDataObject, + } from 'n8n-workflow'; + + export interface ILineItem { + Description?: string; + Quantity?: string; + UnitAmount?: string; + ItemCode?: string; + AccountCode?: string; + LineItemID?: string; + TaxType?: string; + TaxAmount?: string; + LineAmount?: string; + DiscountRate?: string; + Tracking?: IDataObject[]; +} + +export interface IInvoice extends ITenantId { + Type?: string; + LineItems?: ILineItem[]; + Contact?: IDataObject; + Date?: string; + DueDate?: string; + LineAmountType?: string; + InvoiceNumber?: string; + Reference?: string; + BrandingThemeID?: string; + Url?: string; + CurrencyCode?: string; + CurrencyRate?: string; + Status?: string; + SentToContact?: boolean; + ExpectedPaymentDate?: string; + PlannedPaymentDate?: string; +} + +export interface ITenantId { + organizationId?: string; +} diff --git a/packages/nodes-base/nodes/Xero/Xero.node.ts b/packages/nodes-base/nodes/Xero/Xero.node.ts new file mode 100644 index 0000000000..7703bf0c88 --- /dev/null +++ b/packages/nodes-base/nodes/Xero/Xero.node.ts @@ -0,0 +1,681 @@ +import { + IExecuteFunctions, +} from 'n8n-core'; + +import { + IDataObject, + INodeTypeDescription, + INodeExecutionData, + INodeType, + ILoadOptionsFunctions, + INodePropertyOptions, +} from 'n8n-workflow'; + +import { + xeroApiRequest, + xeroApiRequestAllItems, +} from './GenericFunctions'; + +import { + invoiceFields, + invoiceOperations +} from './InvoiceDescription'; + +import { + contactFields, + contactOperations, +} from './ContactDescription'; + +import { + IInvoice, + ILineItem, +} from './InvoiceInterface'; + +import { + IContact, + IPhone, + IAddress, +} from './IContactInterface'; + +export class Xero implements INodeType { + description: INodeTypeDescription = { + displayName: 'Xero', + name: 'xero', + icon: 'file:xero.png', + group: ['output'], + version: 1, + subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}', + description: 'Consume Xero API', + defaults: { + name: 'Xero', + color: '#13b5ea', + }, + inputs: ['main'], + outputs: ['main'], + credentials: [ + { + name: 'xeroOAuth2Api', + required: true, + } + ], + properties: [ + { + displayName: 'Resource', + name: 'resource', + type: 'options', + options: [ + { + name: 'Contact', + value: 'contact', + }, + { + name: 'Invoice', + value: 'invoice', + }, + ], + default: 'invoice', + description: 'Resource to consume.', + }, + // CONTACT + ...contactOperations, + ...contactFields, + // INVOICE + ...invoiceOperations, + ...invoiceFields, + ], + }; + + methods = { + loadOptions: { + // Get all the item codes to display them to user so that he can + // select them easily + async getItemCodes(this: ILoadOptionsFunctions): Promise { + const organizationId = this.getCurrentNodeParameter('organizationId'); + const returnData: INodePropertyOptions[] = []; + const { Items: items } = await xeroApiRequest.call(this, 'GET', '/items', { organizationId }); + for (const item of items) { + const itemName = item.Description; + const itemId = item.Code; + returnData.push({ + name: itemName, + value: itemId, + }); + } + return returnData; + }, + // Get all the account codes to display them to user so that he can + // select them easily + async getAccountCodes(this: ILoadOptionsFunctions): Promise { + const organizationId = this.getCurrentNodeParameter('organizationId'); + const returnData: INodePropertyOptions[] = []; + const { Accounts: accounts } = await xeroApiRequest.call(this, 'GET', '/Accounts', { organizationId }); + for (const account of accounts) { + const accountName = account.Name; + const accountId = account.Code; + returnData.push({ + name: accountName, + value: accountId, + }); + } + return returnData; + }, + // Get all the tenants to display them to user so that he can + // select them easily + async getTenants(this: ILoadOptionsFunctions): Promise { + const returnData: INodePropertyOptions[] = []; + const tenants = await xeroApiRequest.call(this, 'GET', '', {}, {}, 'https://api.xero.com/connections'); + for (const tenant of tenants) { + const tenantName = tenant.tenantName; + const tenantId = tenant.tenantId; + returnData.push({ + name: tenantName, + value: tenantId, + }); + } + return returnData; + }, + // Get all the brading themes to display them to user so that he can + // select them easily + async getBrandingThemes(this: ILoadOptionsFunctions): Promise { + const organizationId = this.getCurrentNodeParameter('organizationId'); + const returnData: INodePropertyOptions[] = []; + const { BrandingThemes: themes } = await xeroApiRequest.call(this, 'GET', '/BrandingThemes', { organizationId }); + for (const theme of themes) { + const themeName = theme.Name; + const themeId = theme.BrandingThemeID; + returnData.push({ + name: themeName, + value: themeId, + }); + } + return returnData; + }, + // Get all the brading themes to display them to user so that he can + // select them easily + async getCurrencies(this: ILoadOptionsFunctions): Promise { + const organizationId = this.getCurrentNodeParameter('organizationId'); + const returnData: INodePropertyOptions[] = []; + const { Currencies: currencies } = await xeroApiRequest.call(this, 'GET', '/Currencies', { organizationId }); + for (const currency of currencies) { + const currencyName = currency.Code; + const currencyId = currency.Description; + returnData.push({ + name: currencyName, + value: currencyId, + }); + } + return returnData; + }, + // Get all the tracking categories to display them to user so that he can + // select them easily + async getTrakingCategories(this: ILoadOptionsFunctions): Promise { + const organizationId = this.getCurrentNodeParameter('organizationId'); + const returnData: INodePropertyOptions[] = []; + const { TrackingCategories: categories } = await xeroApiRequest.call(this, 'GET', '/TrackingCategories', { organizationId }); + for (const category of categories) { + const categoryName = category.Name; + const categoryId = category.TrackingCategoryID; + returnData.push({ + name: categoryName, + value: categoryId, + }); + } + return returnData; + }, + // // Get all the tracking categories to display them to user so that he can + // // select them easily + // async getTrakingOptions(this: ILoadOptionsFunctions): Promise { + // const organizationId = this.getCurrentNodeParameter('organizationId'); + // const name = this.getCurrentNodeParameter('name'); + // const returnData: INodePropertyOptions[] = []; + // const { TrackingCategories: categories } = await xeroApiRequest.call(this, 'GET', '/TrackingCategories', { organizationId }); + // const { Options: options } = categories.filter((category: IDataObject) => category.Name === name)[0]; + // for (const option of options) { + // const optionName = option.Name; + // const optionId = option.TrackingOptionID; + // returnData.push({ + // name: optionName, + // value: optionId, + // }); + // } + // return returnData; + // }, + }, + }; + + async execute(this: IExecuteFunctions): Promise { + const items = this.getInputData(); + const returnData: IDataObject[] = []; + const length = items.length as unknown as number; + const qs: IDataObject = {}; + let responseData; + for (let i = 0; i < length; i++) { + const resource = this.getNodeParameter('resource', 0) as string; + const operation = this.getNodeParameter('operation', 0) as string; + //https://developer.xero.com/documentation/api/invoices + if (resource === 'invoice') { + if (operation === 'create') { + const organizationId = this.getNodeParameter('organizationId', i) as string; + const type = this.getNodeParameter('type', i) as string; + const additionalFields = this.getNodeParameter('additionalFields', i) as IDataObject; + const contactId = this.getNodeParameter('contactId', i) as string; + const lineItemsValues = ((this.getNodeParameter('lineItemsUi', i) as IDataObject).lineItemsValues as IDataObject[]); + + const body: IInvoice = { + organizationId, + Type: type, + Contact: { ContactID: contactId }, + }; + + if (lineItemsValues) { + const lineItems: ILineItem[] = []; + for (const lineItemValue of lineItemsValues) { + const lineItem: ILineItem = { + Tracking: [], + }; + lineItem.AccountCode = lineItemValue.accountCode as string; + lineItem.Description = lineItemValue.description as string; + lineItem.DiscountRate = lineItemValue.discountRate as string; + lineItem.ItemCode = lineItemValue.itemCode as string; + lineItem.LineAmount = lineItemValue.lineAmount as string; + lineItem.Quantity = (lineItemValue.quantity as number).toString(); + lineItem.TaxAmount = lineItemValue.taxAmount as string; + lineItem.TaxType = lineItemValue.taxType as string; + lineItem.UnitAmount = lineItemValue.unitAmount as string; + // if (lineItemValue.trackingUi) { + // //@ts-ignore + // const { trackingValues } = lineItemValue.trackingUi as IDataObject[]; + // if (trackingValues) { + // for (const trackingValue of trackingValues) { + // const tracking: IDataObject = {}; + // tracking.Name = trackingValue.name as string; + // tracking.Option = trackingValue.option as string; + // lineItem.Tracking!.push(tracking); + // } + // } + // } + lineItems.push(lineItem); + } + body.LineItems = lineItems; + } + + if (additionalFields.brandingThemeId) { + body.BrandingThemeID = additionalFields.brandingThemeId as string; + } + if (additionalFields.currency) { + body.CurrencyCode = additionalFields.currency as string; + } + if (additionalFields.currencyRate) { + body.CurrencyRate = additionalFields.currencyRate as string; + } + if (additionalFields.date) { + body.Date = additionalFields.date as string; + } + if (additionalFields.dueDate) { + body.DueDate = additionalFields.dueDate as string; + } + if (additionalFields.dueDate) { + body.DueDate = additionalFields.dueDate as string; + } + if (additionalFields.expectedPaymentDate) { + body.ExpectedPaymentDate = additionalFields.expectedPaymentDate as string; + } + if (additionalFields.invoiceNumber) { + body.InvoiceNumber = additionalFields.invoiceNumber as string; + } + if (additionalFields.lineAmountType) { + body.LineAmountType = additionalFields.lineAmountType as string; + } + if (additionalFields.plannedPaymentDate) { + body.PlannedPaymentDate = additionalFields.plannedPaymentDate as string; + } + if (additionalFields.reference) { + body.Reference = additionalFields.reference as string; + } + if (additionalFields.sendToContact) { + body.SentToContact = additionalFields.sendToContact as boolean; + } + if (additionalFields.status) { + body.Status = additionalFields.status as string; + } + if (additionalFields.url) { + body.Url = additionalFields.url as string; + } + + responseData = await xeroApiRequest.call(this, 'POST', '/Invoices', body); + responseData = responseData.Invoices; + } + if (operation === 'update') { + const invoiceId = this.getNodeParameter('invoiceId', i) as string; + const organizationId = this.getNodeParameter('organizationId', i) as string; + const updateFields = this.getNodeParameter('updateFields', i) as IDataObject; + + const body: IInvoice = { + organizationId, + }; + + if (updateFields.lineItemsUi) { + const lineItemsValues = (updateFields.lineItemsUi as IDataObject).lineItemsValues as IDataObject[]; + if (lineItemsValues) { + const lineItems: ILineItem[] = []; + for (const lineItemValue of lineItemsValues) { + const lineItem: ILineItem = { + Tracking: [], + }; + lineItem.AccountCode = lineItemValue.accountCode as string; + lineItem.Description = lineItemValue.description as string; + lineItem.DiscountRate = lineItemValue.discountRate as string; + lineItem.ItemCode = lineItemValue.itemCode as string; + lineItem.LineAmount = lineItemValue.lineAmount as string; + lineItem.Quantity = (lineItemValue.quantity as number).toString(); + lineItem.TaxAmount = lineItemValue.taxAmount as string; + lineItem.TaxType = lineItemValue.taxType as string; + lineItem.UnitAmount = lineItemValue.unitAmount as string; + // if (lineItemValue.trackingUi) { + // //@ts-ignore + // const { trackingValues } = lineItemValue.trackingUi as IDataObject[]; + // if (trackingValues) { + // for (const trackingValue of trackingValues) { + // const tracking: IDataObject = {}; + // tracking.Name = trackingValue.name as string; + // tracking.Option = trackingValue.option as string; + // lineItem.Tracking!.push(tracking); + // } + // } + // } + lineItems.push(lineItem); + } + body.LineItems = lineItems; + } + } + + if (updateFields.type) { + body.Type = updateFields.type as string; + } + if (updateFields.Contact) { + body.Contact = { ContactID: updateFields.contactId as string }; + } + if (updateFields.brandingThemeId) { + body.BrandingThemeID = updateFields.brandingThemeId as string; + } + if (updateFields.currency) { + body.CurrencyCode = updateFields.currency as string; + } + if (updateFields.currencyRate) { + body.CurrencyRate = updateFields.currencyRate as string; + } + if (updateFields.date) { + body.Date = updateFields.date as string; + } + if (updateFields.dueDate) { + body.DueDate = updateFields.dueDate as string; + } + if (updateFields.dueDate) { + body.DueDate = updateFields.dueDate as string; + } + if (updateFields.expectedPaymentDate) { + body.ExpectedPaymentDate = updateFields.expectedPaymentDate as string; + } + if (updateFields.invoiceNumber) { + body.InvoiceNumber = updateFields.invoiceNumber as string; + } + if (updateFields.lineAmountType) { + body.LineAmountType = updateFields.lineAmountType as string; + } + if (updateFields.plannedPaymentDate) { + body.PlannedPaymentDate = updateFields.plannedPaymentDate as string; + } + if (updateFields.reference) { + body.Reference = updateFields.reference as string; + } + if (updateFields.sendToContact) { + body.SentToContact = updateFields.sendToContact as boolean; + } + if (updateFields.status) { + body.Status = updateFields.status as string; + } + if (updateFields.url) { + body.Url = updateFields.url as string; + } + + responseData = await xeroApiRequest.call(this, 'POST', `/Invoices/${invoiceId}`, body); + responseData = responseData.Invoices; + } + if (operation === 'get') { + const organizationId = this.getNodeParameter('organizationId', i) as string; + const invoiceId = this.getNodeParameter('invoiceId', i) as string; + responseData = await xeroApiRequest.call(this, 'GET', `/Invoices/${invoiceId}`, { organizationId }); + responseData = responseData.Invoices; + } + if (operation === 'getAll') { + const organizationId = this.getNodeParameter('organizationId', i) as string; + const returnAll = this.getNodeParameter('returnAll', i) as boolean; + const options = this.getNodeParameter('options', i) as IDataObject; + if (options.statuses) { + qs.statuses = (options.statuses as string[]).join(','); + } + if (options.orderBy) { + qs.order = `${options.orderBy} ${(options.sortOrder === undefined) ? 'DESC' : options.sortOrder}`; + } + if (options.where) { + qs.where = options.where; + } + if (options.createdByMyApp) { + qs.createdByMyApp = options.createdByMyApp as boolean; + } + if (returnAll) { + responseData = await xeroApiRequestAllItems.call(this, 'Invoices', 'GET', '/Invoices', { organizationId }, qs); + } else { + const limit = this.getNodeParameter('limit', i) as number; + responseData = await xeroApiRequest.call(this, 'GET', `/Invoices`, { organizationId }, qs); + responseData = responseData.Invoices; + responseData = responseData.splice(0, limit); + } + } + } + if (resource === 'contact') { + } + if (operation === 'create') { + const organizationId = this.getNodeParameter('organizationId', i) as string; + const name = this.getNodeParameter('name', i) as string; + const additionalFields = this.getNodeParameter('additionalFields', i) as IDataObject; + // const addressesUi = additionalFields.addressesUi as IDataObject; + // const phonesUi = additionalFields.phonesUi as IDataObject; + + const body: IContact = { + Name: name, + }; + + if (additionalFields.accountNumber) { + body.AccountNumber = additionalFields.accountNumber as string; + } + + if (additionalFields.bankAccountDetails) { + body.BankAccountDetails = additionalFields.bankAccountDetails as string; + } + + if (additionalFields.contactNumber) { + body.ContactNumber = additionalFields.contactNumber as string; + } + + if (additionalFields.contactStatus) { + body.ContactStatus = additionalFields.contactStatus as string; + } + + if (additionalFields.defaultCurrency) { + body.DefaultCurrency = additionalFields.defaultCurrency as string; + } + + if (additionalFields.emailAddress) { + body.EmailAddress = additionalFields.emailAddress as string; + } + + if (additionalFields.firstName) { + body.FirstName = additionalFields.firstName as string; + } + + if (additionalFields.lastName) { + body.LastName = additionalFields.lastName as string; + } + + if (additionalFields.purchasesDefaultAccountCode) { + body.PurchasesDefaultAccountCode = additionalFields.purchasesDefaultAccountCode as string; + } + + if (additionalFields.salesDefaultAccountCode) { + body.SalesDefaultAccountCode = additionalFields.salesDefaultAccountCode as string; + } + + if (additionalFields.skypeUserName) { + body.SkypeUserName = additionalFields.skypeUserName as string; + } + + if (additionalFields.taxNumber) { + body.taxNumber = additionalFields.taxNumber as string; + } + + if (additionalFields.xeroNetworkKey) { + body.xeroNetworkKey = additionalFields.xeroNetworkKey as string; + } + + // if (phonesUi) { + // const phoneValues = phonesUi?.phonesValues as IDataObject[]; + // if (phoneValues) { + // const phones: IPhone[] = []; + // for (const phoneValue of phoneValues) { + // const phone: IPhone = {}; + // phone.Type = phoneValue.type as string; + // phone.PhoneNumber = phoneValue.PhoneNumber as string; + // phone.PhoneAreaCode = phoneValue.phoneAreaCode as string; + // phone.PhoneCountryCode = phoneValue.phoneCountryCode as string; + // phones.push(phone); + // } + // body.Phones = phones; + // } + // } + + // if (addressesUi) { + // const addressValues = addressesUi?.addressesValues as IDataObject[]; + // if (addressValues) { + // const addresses: IAddress[] = []; + // for (const addressValue of addressValues) { + // const address: IAddress = {}; + // address.Type = addressValue.type as string; + // address.AddressLine1 = addressValue.line1 as string; + // address.AddressLine2 = addressValue.line2 as string; + // address.City = addressValue.city as string; + // address.Region = addressValue.region as string; + // address.PostalCode = addressValue.postalCode as string; + // address.Country = addressValue.country as string; + // address.AttentionTo = addressValue.attentionTo as string; + // addresses.push(address); + // } + // body.Addresses = addresses; + // } + // } + + responseData = await xeroApiRequest.call(this, 'POST', '/Contacts', { organizationId, Contacts: [body] }); + responseData = responseData.Contacts; + } + if (operation === 'get') { + const organizationId = this.getNodeParameter('organizationId', i) as string; + const contactId = this.getNodeParameter('contactId', i) as string; + responseData = await xeroApiRequest.call(this, 'GET', `/Contacts/${contactId}`, { organizationId }); + responseData = responseData.Contacts; + } + if (operation === 'getAll') { + const organizationId = this.getNodeParameter('organizationId', i) as string; + const returnAll = this.getNodeParameter('returnAll', i) as boolean; + const options = this.getNodeParameter('options', i) as IDataObject; + if (options.includeArchived) { + qs.includeArchived = options.includeArchived as boolean; + } + if (options.orderBy) { + qs.order = `${options.orderBy} ${(options.sortOrder === undefined) ? 'DESC' : options.sortOrder}`; + } + if (options.where) { + qs.where = options.where; + } + if (returnAll) { + responseData = await xeroApiRequestAllItems.call(this, 'Contacts', 'GET', '/Contacts', { organizationId }, qs); + } else { + const limit = this.getNodeParameter('limit', i) as number; + responseData = await xeroApiRequest.call(this, 'GET', `/Contacts`, { organizationId }, qs); + responseData = responseData.Contacts; + responseData = responseData.splice(0, limit); + } + + } + if (operation === 'update') { + const organizationId = this.getNodeParameter('organizationId', i) as string; + const contactId = this.getNodeParameter('contactId', i) as string; + const updateFields = this.getNodeParameter('updateFields', i) as IDataObject; + // const addressesUi = updateFields.addressesUi as IDataObject; + // const phonesUi = updateFields.phonesUi as IDataObject; + + const body: IContact = {}; + + if (updateFields.accountNumber) { + body.AccountNumber = updateFields.accountNumber as string; + } + + if (updateFields.name) { + body.Name = updateFields.name as string; + } + + if (updateFields.bankAccountDetails) { + body.BankAccountDetails = updateFields.bankAccountDetails as string; + } + + if (updateFields.contactNumber) { + body.ContactNumber = updateFields.contactNumber as string; + } + + if (updateFields.contactStatus) { + body.ContactStatus = updateFields.contactStatus as string; + } + + if (updateFields.defaultCurrency) { + body.DefaultCurrency = updateFields.defaultCurrency as string; + } + + if (updateFields.emailAddress) { + body.EmailAddress = updateFields.emailAddress as string; + } + + if (updateFields.firstName) { + body.FirstName = updateFields.firstName as string; + } + + if (updateFields.lastName) { + body.LastName = updateFields.lastName as string; + } + + if (updateFields.purchasesDefaultAccountCode) { + body.PurchasesDefaultAccountCode = updateFields.purchasesDefaultAccountCode as string; + } + + if (updateFields.salesDefaultAccountCode) { + body.SalesDefaultAccountCode = updateFields.salesDefaultAccountCode as string; + } + + if (updateFields.skypeUserName) { + body.SkypeUserName = updateFields.skypeUserName as string; + } + + if (updateFields.taxNumber) { + body.taxNumber = updateFields.taxNumber as string; + } + + if (updateFields.xeroNetworkKey) { + body.xeroNetworkKey = updateFields.xeroNetworkKey as string; + } + + // if (phonesUi) { + // const phoneValues = phonesUi?.phonesValues as IDataObject[]; + // if (phoneValues) { + // const phones: IPhone[] = []; + // for (const phoneValue of phoneValues) { + // const phone: IPhone = {}; + // phone.Type = phoneValue.type as string; + // phone.PhoneNumber = phoneValue.PhoneNumber as string; + // phone.PhoneAreaCode = phoneValue.phoneAreaCode as string; + // phone.PhoneCountryCode = phoneValue.phoneCountryCode as string; + // phones.push(phone); + // } + // body.Phones = phones; + // } + // } + + // if (addressesUi) { + // const addressValues = addressesUi?.addressesValues as IDataObject[]; + // if (addressValues) { + // const addresses: IAddress[] = []; + // for (const addressValue of addressValues) { + // const address: IAddress = {}; + // address.Type = addressValue.type as string; + // address.AddressLine1 = addressValue.line1 as string; + // address.AddressLine2 = addressValue.line2 as string; + // address.City = addressValue.city as string; + // address.Region = addressValue.region as string; + // address.PostalCode = addressValue.postalCode as string; + // address.Country = addressValue.country as string; + // address.AttentionTo = addressValue.attentionTo as string; + // addresses.push(address); + // } + // body.Addresses = addresses; + // } + // } + + responseData = await xeroApiRequest.call(this, 'POST', `/Contacts/${contactId}`, { organizationId, Contacts: [body] }); + responseData = responseData.Contacts; + } + if (Array.isArray(responseData)) { + returnData.push.apply(returnData, responseData as IDataObject[]); + } else { + returnData.push(responseData as IDataObject); + } + } + return [this.helpers.returnJsonArray(returnData)]; + } +} diff --git a/packages/nodes-base/nodes/Xero/xero.png b/packages/nodes-base/nodes/Xero/xero.png new file mode 100644 index 0000000000000000000000000000000000000000..a9d46c10aacd655047a0039b75024aebcab3cf84 GIT binary patch literal 9587 zcmZ`hB^UV9qhyM&TDM*<}0RRAnww9Xlz5VaLy(YoG?{n69 zckc~>i;BJq08pPycH=;JKjv`MGS&wGf_MOch<5j|wQ%^w-CFehMTKNCf;CS~Y_;ZU z20*AJ>D_nsdVp+ocl^Xpc-n=bjINUL8jW2S9s%7gSvQcC>&@Ustq0%5Z0yDs+h$tY z4Zk1^zxaM<0ynWGX%^trjnY9DIb}ITbu)sKqZey-RQLa+K`nX(3T{8-K3=zSQeL1 zziFW}7cvM0%K<(a`;6y4(vv|DCK#y#9gRT%b55!H`CnHsMn^!p@sK%xDdKzshd>v+ z5OLJwhw2dXbF(UiS?kQ%yNYKwSqiUQl+U=DnB0b~P{;Nc3FiB^=i^{3sC)wybm=It z3c*HBWVy5Ey#=$aoYk3;)Sn^J?O&rBI={X})@Y{Hueh~$WtqZ%4xO+9V4(MW=}tn& z!%Z8(kx$C8+9nKSWMuU2v87iq-jaGWvRic0QY1OH0Eg(KgDc32Odech7?(`(kwl4- zr#&4$=~y}N9p_JS-AsehLiZm;%0V&epUUilPuQ}aTkU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rSBCo$tAm(S!F#qsv%ryZmU)qfV5E|oJU;xQpC zD7?aSeDCHy^~8y{Wo(8AlYHkEabzf?qbGS{n=%Hkh)Ts=nbT?_tNA{f zL6+zCM<=Xk2O0HrF;M22pyj61(0fg@K`0l_JEmH~H*G0RUv+S;ZuHt@<2uYS&k9_^ z2j4-89VtwJ^%i48rzI5`($255rANduP#kU}uMt_3n@Xwn8gnM3*i}>-OYJPhne!-- zb>8V@tb;o--A&669Vzx)uuH0var)Di5WDwtFURSwk0;O5SNuNbf4O6qAzhN;bz=*^ z|CPk;r*7`& Date: Sun, 12 Jul 2020 18:29:11 +0200 Subject: [PATCH 220/241] :zap: Small improvements --- packages/nodes-base/nodes/Xero/Xero.node.ts | 4 ++-- packages/nodes-base/package.json | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/nodes-base/nodes/Xero/Xero.node.ts b/packages/nodes-base/nodes/Xero/Xero.node.ts index 7703bf0c88..31a1df36e8 100644 --- a/packages/nodes-base/nodes/Xero/Xero.node.ts +++ b/packages/nodes-base/nodes/Xero/Xero.node.ts @@ -33,8 +33,8 @@ import { import { IContact, - IPhone, - IAddress, + // IPhone, + // IAddress, } from './IContactInterface'; export class Xero implements INodeType { diff --git a/packages/nodes-base/package.json b/packages/nodes-base/package.json index 159fdd8cd0..17ab0f0ade 100644 --- a/packages/nodes-base/package.json +++ b/packages/nodes-base/package.json @@ -37,8 +37,8 @@ "dist/credentials/BannerbearApi.credentials.js", "dist/credentials/BitbucketApi.credentials.js", "dist/credentials/BitlyApi.credentials.js", - "dist/credentials/CircleCiApi.credentials.js", "dist/credentials/ChargebeeApi.credentials.js", + "dist/credentials/CircleCiApi.credentials.js", "dist/credentials/ClearbitApi.credentials.js", "dist/credentials/ClickUpApi.credentials.js", "dist/credentials/ClockifyApi.credentials.js", @@ -172,9 +172,9 @@ "dist/nodes/Bitbucket/BitbucketTrigger.node.js", "dist/nodes/Bitly/Bitly.node.js", "dist/nodes/Calendly/CalendlyTrigger.node.js", - "dist/nodes/CircleCi/CircleCi.node.js", "dist/nodes/Chargebee/Chargebee.node.js", "dist/nodes/Chargebee/ChargebeeTrigger.node.js", + "dist/nodes/CircleCi/CircleCi.node.js", "dist/nodes/Clearbit/Clearbit.node.js", "dist/nodes/ClickUp/ClickUp.node.js", "dist/nodes/ClickUp/ClickUpTrigger.node.js", From c03c9a06c8c7fa39d0b4fecbf820b5accca2b0da Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Mon, 13 Jul 2020 14:22:34 +0200 Subject: [PATCH 221/241] :zap: Fix logos in README.md files --- packages/core/README.md | 2 +- packages/editor-ui/README.md | 2 +- packages/node-dev/README.md | 2 +- packages/nodes-base/README.md | 2 +- packages/workflow/README.md | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/core/README.md b/packages/core/README.md index c1b11d9fbf..b1e2e31410 100644 --- a/packages/core/README.md +++ b/packages/core/README.md @@ -1,6 +1,6 @@ # n8n-core -![n8n.io - Workflow Automation](https://raw.githubusercontent.com/n8n-io/n8n/master/docs/images/n8n-logo.png) +![n8n.io - Workflow Automation](https://raw.githubusercontent.com/n8n-io/n8n/master/assets/n8n-logo.png) Core components for n8n diff --git a/packages/editor-ui/README.md b/packages/editor-ui/README.md index cf05ce87d1..f4949d3d8e 100644 --- a/packages/editor-ui/README.md +++ b/packages/editor-ui/README.md @@ -1,6 +1,6 @@ # n8n-editor-ui -![n8n.io - Workflow Automation](https://n8n.io/n8n-logo.png) +![n8n.io - Workflow Automation](https://raw.githubusercontent.com/n8n-io/n8n/master/assets/n8n-logo.png) The UI to create and update n8n workflows diff --git a/packages/node-dev/README.md b/packages/node-dev/README.md index fa817c9124..526b45cebf 100644 --- a/packages/node-dev/README.md +++ b/packages/node-dev/README.md @@ -1,6 +1,6 @@ # n8n-node-dev -![n8n.io - Workflow Automation](https://raw.githubusercontent.com/n8n-io/n8n/master/docs/images/n8n-logo.png) +![n8n.io - Workflow Automation](https://raw.githubusercontent.com/n8n-io/n8n/master/assets/n8n-logo.png) Currently very simple and not very sophisticated CLI which makes it easier to create credentials and nodes in TypeScript for n8n. diff --git a/packages/nodes-base/README.md b/packages/nodes-base/README.md index bd069d0c3a..cfa12a488d 100644 --- a/packages/nodes-base/README.md +++ b/packages/nodes-base/README.md @@ -1,6 +1,6 @@ # n8n-nodes-base -![n8n.io - Workflow Automation](https://raw.githubusercontent.com/n8n-io/n8n/master/docs/images/n8n-logo.png) +![n8n.io - Workflow Automation](https://raw.githubusercontent.com/n8n-io/n8n/master/assets/n8n-logo.png) The nodes which are included by default in n8n diff --git a/packages/workflow/README.md b/packages/workflow/README.md index 40a74b1116..4f3ef155a3 100644 --- a/packages/workflow/README.md +++ b/packages/workflow/README.md @@ -1,6 +1,6 @@ # n8n-workflow -![n8n.io - Workflow Automation](https://n8n.io/n8n-logo.png) +![n8n.io - Workflow Automation](https://raw.githubusercontent.com/n8n-io/n8n/master/assets/n8n-logo.png) Workflow base code for n8n From e558a48c82694838fca37d48454dc041dba23131 Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Mon, 13 Jul 2020 17:28:56 +0200 Subject: [PATCH 222/241] :bug: Fix bug if Uplead did not have any data --- packages/nodes-base/nodes/Uplead/Uplead.node.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/nodes-base/nodes/Uplead/Uplead.node.ts b/packages/nodes-base/nodes/Uplead/Uplead.node.ts index e47bdbe71c..93350e99d9 100644 --- a/packages/nodes-base/nodes/Uplead/Uplead.node.ts +++ b/packages/nodes-base/nodes/Uplead/Uplead.node.ts @@ -113,7 +113,9 @@ export class Uplead implements INodeType { if (Array.isArray(responseData.data)) { returnData.push.apply(returnData, responseData.data as IDataObject[]); } else { - returnData.push(responseData.data as IDataObject); + if (responseData.data !== null) { + returnData.push(responseData.data as IDataObject); + } } } return [this.helpers.returnJsonArray(returnData)]; From 93c37f3844e4747ce6969b35bf5a4df49a22c0e0 Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Tue, 14 Jul 2020 12:39:42 +0200 Subject: [PATCH 223/241] :zap: Improve parameter naming on Msg91-Node --- packages/nodes-base/nodes/Msg91/Msg91.node.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/nodes-base/nodes/Msg91/Msg91.node.ts b/packages/nodes-base/nodes/Msg91/Msg91.node.ts index 240a3623e0..8fb0444de5 100644 --- a/packages/nodes-base/nodes/Msg91/Msg91.node.ts +++ b/packages/nodes-base/nodes/Msg91/Msg91.node.ts @@ -68,7 +68,7 @@ export class Msg91 implements INodeType { description: 'The operation to perform.', }, { - displayName: 'From', + displayName: 'Sender ID', name: 'from', type: 'string', default: '', From df3077b5d2f594646bfe89c7e2d782e65ae37c60 Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Tue, 14 Jul 2020 13:59:37 +0200 Subject: [PATCH 224/241] :shirt: Fix lint issue --- package.json | 1 + packages/cli/src/Server.ts | 14 +++++++------- .../nodes/Google/Task/GenericFunctions.ts | 8 ++++---- .../nodes/Microsoft/Sql/GenericFunctions.ts | 10 +++++----- .../nodes/Microsoft/Sql/TableInterface.ts | 2 +- .../nodes/Postgres/Postgres.node.functions.ts | 6 +++--- packages/nodes-base/nodes/Zoom/GenericFunctions.ts | 5 ++--- packages/nodes-base/nodes/utils/utilities.ts | 8 ++++---- 8 files changed, 27 insertions(+), 27 deletions(-) diff --git a/package.json b/package.json index 0c7d8dac15..30fcfb7959 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ "start:default": "cd packages/cli/bin && ./n8n", "start:windows": "cd packages/cli/bin && n8n", "test": "lerna run test", + "tslint": "lerna exec npm run tslint", "watch": "lerna run --parallel watch" }, "devDependencies": { diff --git a/packages/cli/src/Server.ts b/packages/cli/src/Server.ts index e4093e5a15..ee248e4d14 100644 --- a/packages/cli/src/Server.ts +++ b/packages/cli/src/Server.ts @@ -18,7 +18,7 @@ import * as clientOAuth2 from 'client-oauth2'; import * as clientOAuth1 from 'oauth-1.0a'; import { RequestOptions } from 'oauth-1.0a'; import * as csrf from 'csrf'; -import * as requestPromise from 'request-promise-native'; +import * as requestPromise from 'request-promise-native'; import { createHmac } from 'crypto'; import { @@ -120,7 +120,7 @@ class App { restEndpoint: string; protocol: string; - sslKey: string; + sslKey: string; sslCert: string; presetCredentialsLoaded: boolean; @@ -143,7 +143,7 @@ class App { this.activeExecutionsInstance = ActiveExecutions.getInstance(); this.protocol = config.get('protocol'); - this.sslKey = config.get('ssl_key'); + this.sslKey = config.get('ssl_key'); this.sslCert = config.get('ssl_cert'); this.externalHooks = ExternalHooks(); @@ -204,7 +204,7 @@ class App { } // Check for and validate JWT if configured - const jwtAuthActive = config.get('security.jwtAuth.active') as boolean; + const jwtAuthActive = config.get('security.jwtAuth.active') as boolean; if (jwtAuthActive === true) { const jwtAuthHeader = await GenericHelpers.getConfigValue('security.jwtAuth.jwtHeader') as string; if (jwtAuthHeader === '') { @@ -282,7 +282,7 @@ class App { normalize: true, // Trim whitespace inside text nodes normalizeTags: true, // Transform tags to lowercase explicitArray: false, // Only put properties in array if length > 1 - } })); + } })); this.app.use(bodyParser.text({ limit: '16mb', verify: (req, res, buf) => { @@ -981,7 +981,7 @@ class App { const callback = `${WebhookHelpers.getWebhookBaseUrl()}${this.restEndpoint}/oauth1-credential/callback?cid=${req.query.id}`; - const options: RequestOptions = { + const options: RequestOptions = { method: 'POST', url: (_.get(oauthCredentials, 'requestTokenUrl') as string), data: { @@ -1049,7 +1049,7 @@ class App { const decryptedDataOriginal = credentialsHelper.getDecrypted(result.name, result.type, true); const oauthCredentials = credentialsHelper.applyDefaultsAndOverwrites(decryptedDataOriginal, result.type); - const options: OptionsWithUrl = { + const options: OptionsWithUrl = { method: 'POST', url: _.get(oauthCredentials, 'accessTokenUrl') as string, qs: { diff --git a/packages/nodes-base/nodes/Google/Task/GenericFunctions.ts b/packages/nodes-base/nodes/Google/Task/GenericFunctions.ts index c3a5031511..55a690ad73 100644 --- a/packages/nodes-base/nodes/Google/Task/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Google/Task/GenericFunctions.ts @@ -16,11 +16,11 @@ export async function googleApiRequest( this: IExecuteFunctions | IExecuteSingleFunctions | ILoadOptionsFunctions, method: string, resource: string, - body: any = {}, + body: IDataObject = {}, qs: IDataObject = {}, uri?: string, headers: IDataObject = {} -): Promise { +): Promise { // tslint:disable-line:no-any const options: OptionsWithUri = { headers: { 'Content-Type': 'application/json' @@ -65,9 +65,9 @@ export async function googleApiRequestAllItems( propertyName: string, method: string, endpoint: string, - body: any = {}, + body: IDataObject = {}, query: IDataObject = {} -): Promise { +): Promise { // tslint:disable-line:no-any const returnData: IDataObject[] = []; let responseData; diff --git a/packages/nodes-base/nodes/Microsoft/Sql/GenericFunctions.ts b/packages/nodes-base/nodes/Microsoft/Sql/GenericFunctions.ts index 8309b35db0..601d3b5393 100644 --- a/packages/nodes-base/nodes/Microsoft/Sql/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Microsoft/Sql/GenericFunctions.ts @@ -14,7 +14,7 @@ export function copyInputItem( properties: string[], ): IDataObject { // Prepare the data to insert and copy it to be returned - let newItem: IDataObject = {}; + const newItem: IDataObject = {}; for (const property of properties) { if (item.json[property] === undefined) { newItem[property] = null; @@ -70,14 +70,14 @@ export function createTableStruct( export function executeQueryQueue( tables: ITables, buildQueryQueue: Function, -): Promise { +): Promise { // tslint:disable-line:no-any return Promise.all( Object.keys(tables).map(table => { const columnsResults = Object.keys(tables[table]).map(columnString => { return Promise.all( buildQueryQueue({ - table: table, - columnString: columnString, + table, + columnString, items: tables[table][columnString], }), ); @@ -94,7 +94,7 @@ export function executeQueryQueue( * @returns {string} (Val1, Val2, ...) */ export function extractValues(item: IDataObject): string { - return `(${Object.values(item as any) + return `(${Object.values(item as any) // tslint:disable-line:no-any .map(val => (typeof val === 'string' ? `'${val}'` : val)) // maybe other types such as dates have to be handled as well .join(',')})`; } diff --git a/packages/nodes-base/nodes/Microsoft/Sql/TableInterface.ts b/packages/nodes-base/nodes/Microsoft/Sql/TableInterface.ts index a0343e6e0b..c260c36ab3 100644 --- a/packages/nodes-base/nodes/Microsoft/Sql/TableInterface.ts +++ b/packages/nodes-base/nodes/Microsoft/Sql/TableInterface.ts @@ -2,6 +2,6 @@ import { IDataObject } from 'n8n-workflow'; export interface ITables { [key: string]: { - [key: string]: Array; + [key: string]: IDataObject[]; }; } diff --git a/packages/nodes-base/nodes/Postgres/Postgres.node.functions.ts b/packages/nodes-base/nodes/Postgres/Postgres.node.functions.ts index fb4c50051c..4dae3a64c1 100644 --- a/packages/nodes-base/nodes/Postgres/Postgres.node.functions.ts +++ b/packages/nodes-base/nodes/Postgres/Postgres.node.functions.ts @@ -40,7 +40,7 @@ export function pgQuery( pgp: pgPromise.IMain<{}, pg.IClient>, db: pgPromise.IDatabase<{}, pg.IClient>, input: INodeExecutionData[], -): Promise> { +): Promise { const queries: string[] = []; for (let i = 0; i < input.length; i++) { queries.push(getNodeParam('query', i) as string); @@ -63,7 +63,7 @@ export async function pgInsert( pgp: pgPromise.IMain<{}, pg.IClient>, db: pgPromise.IDatabase<{}, pg.IClient>, items: INodeExecutionData[], -): Promise> { +): Promise { const table = getNodeParam('table', 0) as string; const schema = getNodeParam('schema', 0) as string; let returnFields = (getNodeParam('returnFields', 0) as string).split(',') as string[]; @@ -103,7 +103,7 @@ export async function pgUpdate( pgp: pgPromise.IMain<{}, pg.IClient>, db: pgPromise.IDatabase<{}, pg.IClient>, items: INodeExecutionData[], -): Promise> { +): Promise { const table = getNodeParam('table', 0) as string; const updateKey = getNodeParam('updateKey', 0) as string; const columnString = getNodeParam('columns', 0) as string; diff --git a/packages/nodes-base/nodes/Zoom/GenericFunctions.ts b/packages/nodes-base/nodes/Zoom/GenericFunctions.ts index 95e07f09b9..3d036f5f39 100644 --- a/packages/nodes-base/nodes/Zoom/GenericFunctions.ts +++ b/packages/nodes-base/nodes/Zoom/GenericFunctions.ts @@ -70,10 +70,9 @@ export async function zoomApiRequestAllItems( propertyName: string, method: string, endpoint: string, - body: any = {}, + body: IDataObject = {}, query: IDataObject = {} -): Promise { - // tslint:disable-line:no-any +): Promise { // tslint:disable-line:no-any const returnData: IDataObject[] = []; let responseData; query.page_number = 0; diff --git a/packages/nodes-base/nodes/utils/utilities.ts b/packages/nodes-base/nodes/utils/utilities.ts index 73105a901c..0ba469dd10 100644 --- a/packages/nodes-base/nodes/utils/utilities.ts +++ b/packages/nodes-base/nodes/utils/utilities.ts @@ -14,7 +14,7 @@ * chunk(['a', 'b', 'c', 'd'], 3) * // => [['a', 'b', 'c'], ['d']] */ -export function chunk(array: any[], size: number = 1) { +export function chunk(array: any[], size = 1) { // tslint:disable-line:no-any const length = array == null ? 0 : array.length; if (!length || size < 1) { return []; @@ -40,11 +40,11 @@ export function chunk(array: any[], size: number = 1) { * // => ['a', 'b', 'c', 'd'] * */ -export function flatten(nestedArray: any[][]) { +export function flatten(nestedArray: any[][]) { // tslint:disable-line:no-any const result = []; - (function loop(array: any[]) { - for (var i = 0; i < array.length; i++) { + (function loop(array: any[]) { // tslint:disable-line:no-any + for (let i = 0; i < array.length; i++) { if (Array.isArray(array[i])) { loop(array[i]); } else { From 25cc7458949e995d23b43d20820a90225790862d Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Tue, 14 Jul 2020 23:36:05 +0200 Subject: [PATCH 225/241] :bug: Fix editor-ui build --- packages/cli/src/Server.ts | 4 +++- packages/editor-ui/package.json | 2 +- packages/editor-ui/public/index.html | 4 ++-- packages/editor-ui/src/components/MainSidebar.vue | 2 +- packages/editor-ui/src/router.ts | 2 +- packages/editor-ui/src/store.ts | 2 +- packages/editor-ui/vue.config.js | 2 +- 7 files changed, 10 insertions(+), 8 deletions(-) diff --git a/packages/cli/src/Server.ts b/packages/cli/src/Server.ts index ee248e4d14..09ef7e18a6 100644 --- a/packages/cli/src/Server.ts +++ b/packages/cli/src/Server.ts @@ -1711,9 +1711,11 @@ class App { // Read the index file and replace the path placeholder const editorUiPath = require.resolve('n8n-editor-ui'); const filePath = pathJoin(pathDirname(editorUiPath), 'dist', 'index.html'); - let readIndexFile = readFileSync(filePath, 'utf8'); const n8nPath = config.get('path'); + + let readIndexFile = readFileSync(filePath, 'utf8'); readIndexFile = readIndexFile.replace(/\/%BASE_PATH%\//g, n8nPath); + readIndexFile = readIndexFile.replace(/\/favicon.ico/g, `${n8nPath}/favicon.ico`); // Serve the altered index.html file separately this.app.get(`/index.html`, async (req: express.Request, res: express.Response) => { diff --git a/packages/editor-ui/package.json b/packages/editor-ui/package.json index 552fe79330..8a6dfcfb38 100644 --- a/packages/editor-ui/package.json +++ b/packages/editor-ui/package.json @@ -14,7 +14,7 @@ "url": "git+https://github.com/n8n-io/n8n.git" }, "scripts": { - "build": "vue-cli-service build", + "build": "cross-env VUE_APP_PUBLIC_PATH=\"/%BASE_PATH%/\" vue-cli-service build", "dev": "npm run serve", "lint": "vue-cli-service lint", "serve": "cross-env VUE_APP_URL_BASE_API=http://localhost:5678/ vue-cli-service serve", diff --git a/packages/editor-ui/public/index.html b/packages/editor-ui/public/index.html index 9193fda976..b533aea170 100644 --- a/packages/editor-ui/public/index.html +++ b/packages/editor-ui/public/index.html @@ -4,13 +4,13 @@ - + n8n.io - Workflow Automation
diff --git a/packages/editor-ui/src/components/MainSidebar.vue b/packages/editor-ui/src/components/MainSidebar.vue index a9cf787ef4..baea830b01 100644 --- a/packages/editor-ui/src/components/MainSidebar.vue +++ b/packages/editor-ui/src/components/MainSidebar.vue @@ -209,7 +209,7 @@ export default mixins( return { aboutDialogVisible: false, // @ts-ignore - basePath: window.BASE_PATH, + basePath: this.$store.getters.getBaseUrl, isCollapsed: true, credentialNewDialogVisible: false, credentialOpenDialogVisible: false, diff --git a/packages/editor-ui/src/router.ts b/packages/editor-ui/src/router.ts index 4754098c97..348a1ea66b 100644 --- a/packages/editor-ui/src/router.ts +++ b/packages/editor-ui/src/router.ts @@ -9,7 +9,7 @@ Vue.use(Router); export default new Router({ mode: 'history', // @ts-ignore - base: window.BASE_PATH, + base: window.BASE_PATH === '/%BASE_PATH%/' ? '/' : window.BASE_PATH, routes: [ { path: '/execution/:id', diff --git a/packages/editor-ui/src/store.ts b/packages/editor-ui/src/store.ts index 0e1e5f14c4..e0ba93b7cf 100644 --- a/packages/editor-ui/src/store.ts +++ b/packages/editor-ui/src/store.ts @@ -39,7 +39,7 @@ export const store = new Vuex.Store({ activeActions: [] as string[], activeNode: null as string | null, // @ts-ignore - baseUrl: window.BASE_PATH ? window.BASE_PATH : '/', + baseUrl: process.env.VUE_APP_URL_BASE_API ? process.env.VUE_APP_URL_BASE_API : (window.BASE_PATH === '/%BASE_PATH%/' ? '/' : window.BASE_PATH), credentials: null as ICredentialsResponse[] | null, credentialTypes: null as ICredentialType[] | null, endpointWebhook: 'webhook', diff --git a/packages/editor-ui/vue.config.js b/packages/editor-ui/vue.config.js index c5ffc5fed8..cdcd8259f9 100644 --- a/packages/editor-ui/vue.config.js +++ b/packages/editor-ui/vue.config.js @@ -29,5 +29,5 @@ module.exports = { }, }, }, - publicPath: process.env.VUE_APP_PUBLIC_PATH ? process.env.VUE_APP_PUBLIC_PATH : '/%BASE_PATH%/', + publicPath: process.env.VUE_APP_PUBLIC_PATH ? process.env.VUE_APP_PUBLIC_PATH : '/', }; From cf1e4468bb0e1fe96af12eb831c5e32ae5dfec4f Mon Sep 17 00:00:00 2001 From: Ricardo Espinoza Date: Wed, 15 Jul 2020 03:52:28 -0400 Subject: [PATCH 226/241] :bug: fixes bug with latin characters (#758) --- .../nodes-base/nodes/Dropbox/Dropbox.node.ts | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/packages/nodes-base/nodes/Dropbox/Dropbox.node.ts b/packages/nodes-base/nodes/Dropbox/Dropbox.node.ts index 6140568bc2..20c8248c56 100644 --- a/packages/nodes-base/nodes/Dropbox/Dropbox.node.ts +++ b/packages/nodes-base/nodes/Dropbox/Dropbox.node.ts @@ -2,6 +2,7 @@ import { BINARY_ENCODING, IExecuteFunctions, } from 'n8n-core'; + import { IDataObject, INodeTypeDescription, @@ -9,8 +10,9 @@ import { INodeType, } from 'n8n-workflow'; -import { OptionsWithUri } from 'request'; - +import { + OptionsWithUri +} from 'request'; export class Dropbox implements INodeType { description: INodeTypeDescription = { @@ -23,7 +25,7 @@ export class Dropbox implements INodeType { description: 'Access data on Dropbox', defaults: { name: 'Dropbox', - color: '#22BB44', + color: '#0061FF', }, inputs: ['main'], outputs: ['main'], @@ -454,6 +456,7 @@ export class Dropbox implements INodeType { let requestMethod = ''; let body: IDataObject | Buffer; let isJson = false; + let query: IDataObject = {}; let headers: IDataObject; @@ -470,8 +473,9 @@ export class Dropbox implements INodeType { // ---------------------------------- requestMethod = 'POST'; - headers['Dropbox-API-Arg'] = JSON.stringify({ - path: this.getNodeParameter('path', i) as string, + + query.arg = JSON.stringify({ + path: this.getNodeParameter('path', i) as string }); endpoint = 'https://content.dropboxapi.com/2/files/download'; @@ -483,9 +487,10 @@ export class Dropbox implements INodeType { requestMethod = 'POST'; headers['Content-Type'] = 'application/octet-stream'; - headers['Dropbox-API-Arg'] = JSON.stringify({ + + query.arg = JSON.stringify({ mode: 'overwrite', - path: this.getNodeParameter('path', i) as string, + path: this.getNodeParameter('path', i) as string }); endpoint = 'https://content.dropboxapi.com/2/files/upload'; @@ -594,8 +599,8 @@ export class Dropbox implements INodeType { const options: OptionsWithUri = { headers, method: requestMethod, - qs: {}, uri: endpoint, + qs: query, json: isJson, }; From c1378c2f8833e07809084cc98cf9a8ab3ae21c81 Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Wed, 15 Jul 2020 11:54:03 +0200 Subject: [PATCH 227/241] :bug: Fix Expression editor issue #719 --- packages/editor-ui/src/components/ExpressionInput.vue | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/packages/editor-ui/src/components/ExpressionInput.vue b/packages/editor-ui/src/components/ExpressionInput.vue index 543eb12f22..d0c734e2c6 100644 --- a/packages/editor-ui/src/components/ExpressionInput.vue +++ b/packages/editor-ui/src/components/ExpressionInput.vue @@ -122,6 +122,13 @@ export default mixins( readOnly: !!this.resolvedValue, modules: { autoformat: {}, + keyboard: { + bindings: { + 'list autofill': { + prefix: /^$/, + }, + }, + }, }, }); From 95062205db659ae6960ddf250449400cceb3a8e6 Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Wed, 15 Jul 2020 12:34:14 +0200 Subject: [PATCH 228/241] :bookmark: Release n8n-workflow@0.35.0 --- packages/workflow/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/workflow/package.json b/packages/workflow/package.json index b65cf8cb6e..aed6e160ba 100644 --- a/packages/workflow/package.json +++ b/packages/workflow/package.json @@ -1,6 +1,6 @@ { "name": "n8n-workflow", - "version": "0.34.0", + "version": "0.35.0", "description": "Workflow base code of n8n", "license": "SEE LICENSE IN LICENSE.md", "homepage": "https://n8n.io", From 3872c7cba9b2893f1187f89389431cb779bfc8cc Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Wed, 15 Jul 2020 12:35:42 +0200 Subject: [PATCH 229/241] :arrow_up: Set n8n-workflow@0.35.0 on n8n-core --- packages/core/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/package.json b/packages/core/package.json index fe195d2e36..ad54c6baec 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -46,7 +46,7 @@ "file-type": "^14.6.2", "lodash.get": "^4.4.2", "mime-types": "^2.1.27", - "n8n-workflow": "~0.34.0", + "n8n-workflow": "~0.35.0", "p-cancelable": "^2.0.0", "request": "^2.88.2", "request-promise-native": "^1.0.7" From d24d215b437a342b9c505ad7d1415d6f5b58f772 Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Wed, 15 Jul 2020 12:36:07 +0200 Subject: [PATCH 230/241] :bookmark: Release n8n-core@0.39.0 --- packages/core/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/package.json b/packages/core/package.json index ad54c6baec..4fb55a9d8d 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "n8n-core", - "version": "0.38.0", + "version": "0.39.0", "description": "Core functionality of n8n", "license": "SEE LICENSE IN LICENSE.md", "homepage": "https://n8n.io", From 6b86a2bd48f117862410935619eabb82756f4c67 Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Wed, 15 Jul 2020 12:37:30 +0200 Subject: [PATCH 231/241] :arrow_up: Set n8n-core@0.39.0 and n8n-workflow@0.35.0 on n8n-nodes-base --- packages/nodes-base/package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/nodes-base/package.json b/packages/nodes-base/package.json index 17ab0f0ade..e166af04be 100644 --- a/packages/nodes-base/package.json +++ b/packages/nodes-base/package.json @@ -338,7 +338,7 @@ "@types/xml2js": "^0.4.3", "gulp": "^4.0.0", "jest": "^24.9.0", - "n8n-workflow": "~0.34.0", + "n8n-workflow": "~0.35.0", "ts-jest": "^24.0.2", "tslint": "^5.17.0", "typescript": "~3.7.4" @@ -364,7 +364,7 @@ "mongodb": "^3.5.5", "mssql": "^6.2.0", "mysql2": "^2.0.1", - "n8n-core": "~0.38.0", + "n8n-core": "~0.39.0", "nodemailer": "^6.4.6", "pdf-parse": "^1.1.1", "pg-promise": "^9.0.3", From aa9461edbea09b6bb37bfff7ee73317b4466cc1a Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Wed, 15 Jul 2020 12:38:03 +0200 Subject: [PATCH 232/241] :bookmark: Release n8n-nodes-base@0.69.0 --- packages/nodes-base/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/nodes-base/package.json b/packages/nodes-base/package.json index e166af04be..df18bb8fba 100644 --- a/packages/nodes-base/package.json +++ b/packages/nodes-base/package.json @@ -1,6 +1,6 @@ { "name": "n8n-nodes-base", - "version": "0.68.1", + "version": "0.69.0", "description": "Base nodes of n8n", "license": "SEE LICENSE IN LICENSE.md", "homepage": "https://n8n.io", From bbd39e19caec3fd3933dd0c55da528f0b80d8962 Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Wed, 15 Jul 2020 12:39:06 +0200 Subject: [PATCH 233/241] :arrow_up: Set n8n-workflow@0.35.0 on n8n-editor-ui --- packages/editor-ui/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/editor-ui/package.json b/packages/editor-ui/package.json index 8a6dfcfb38..eda1b6ff6f 100644 --- a/packages/editor-ui/package.json +++ b/packages/editor-ui/package.json @@ -66,7 +66,7 @@ "lodash.debounce": "^4.0.8", "lodash.get": "^4.4.2", "lodash.set": "^4.3.2", - "n8n-workflow": "~0.34.0", + "n8n-workflow": "~0.35.0", "node-sass": "^4.12.0", "prismjs": "^1.17.1", "quill": "^2.0.0-dev.3", From 0b66b8e753009bad72c77b4936e5d64746886b8d Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Wed, 15 Jul 2020 12:39:32 +0200 Subject: [PATCH 234/241] :bookmark: Release n8n-editor-ui@0.50.0 --- packages/editor-ui/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/editor-ui/package.json b/packages/editor-ui/package.json index eda1b6ff6f..4bcc6b8579 100644 --- a/packages/editor-ui/package.json +++ b/packages/editor-ui/package.json @@ -1,6 +1,6 @@ { "name": "n8n-editor-ui", - "version": "0.49.0", + "version": "0.50.0", "description": "Workflow Editor UI for n8n", "license": "SEE LICENSE IN LICENSE.md", "homepage": "https://n8n.io", From f8e3e42b46dd96143fd50e809cc0ada18bb07a57 Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Wed, 15 Jul 2020 12:41:15 +0200 Subject: [PATCH 235/241] :arrow_up: Set n8n-core@0.39.0, n8n-editor-ui@0.50.0, n8n-nodes-base@0.69.0 and n8n-workflow@0.35.0 on n8n --- packages/cli/package.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/cli/package.json b/packages/cli/package.json index e9b16ad9e2..549c118e23 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -100,10 +100,10 @@ "lodash.get": "^4.4.2", "mongodb": "^3.5.5", "mysql2": "^2.0.1", - "n8n-core": "~0.38.0", - "n8n-editor-ui": "~0.49.0", - "n8n-nodes-base": "~0.68.1", - "n8n-workflow": "~0.34.0", + "n8n-core": "~0.39.0", + "n8n-editor-ui": "~0.50.0", + "n8n-nodes-base": "~0.69.0", + "n8n-workflow": "~0.35.0", "oauth-1.0a": "^2.2.6", "open": "^7.0.0", "pg": "^7.11.0", From b946d49beac09743d429b1b1f78716a77bda90d5 Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Wed, 15 Jul 2020 12:41:40 +0200 Subject: [PATCH 236/241] :bookmark: Release n8n@0.74.0 --- packages/cli/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/cli/package.json b/packages/cli/package.json index 549c118e23..4749a2ed0d 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "n8n", - "version": "0.73.1", + "version": "0.74.0", "description": "n8n Workflow Automation Tool", "license": "SEE LICENSE IN LICENSE.md", "homepage": "https://n8n.io", From 479606753b9bbbb26468a832858fa556ef573905 Mon Sep 17 00:00:00 2001 From: Tanay Pant <7481165+tanay1337@users.noreply.github.com> Date: Fri, 17 Jul 2020 16:10:31 +0200 Subject: [PATCH 237/241] :sparkles: Add CrateDB node (#768) --- .../credentials/CrateDb.credentials.ts | 69 +++++ .../nodes-base/nodes/CrateDb/CrateDb.node.ts | 246 ++++++++++++++++++ packages/nodes-base/nodes/CrateDb/cratedb.png | Bin 0 -> 475 bytes packages/nodes-base/package.json | 2 + 4 files changed, 317 insertions(+) create mode 100644 packages/nodes-base/credentials/CrateDb.credentials.ts create mode 100644 packages/nodes-base/nodes/CrateDb/CrateDb.node.ts create mode 100644 packages/nodes-base/nodes/CrateDb/cratedb.png diff --git a/packages/nodes-base/credentials/CrateDb.credentials.ts b/packages/nodes-base/credentials/CrateDb.credentials.ts new file mode 100644 index 0000000000..a5e0fb776c --- /dev/null +++ b/packages/nodes-base/credentials/CrateDb.credentials.ts @@ -0,0 +1,69 @@ +import { ICredentialType, NodePropertyTypes } from 'n8n-workflow'; + +export class CrateDb implements ICredentialType { + name = 'crateDb'; + displayName = 'CrateDB'; + properties = [ + { + displayName: 'Host', + name: 'host', + type: 'string' as NodePropertyTypes, + default: 'localhost', + }, + { + displayName: 'Database', + name: 'database', + type: 'string' as NodePropertyTypes, + default: 'doc', + }, + { + displayName: 'User', + name: 'user', + type: 'string' as NodePropertyTypes, + default: 'crate', + }, + { + displayName: 'Password', + name: 'password', + type: 'string' as NodePropertyTypes, + typeOptions: { + password: true, + }, + default: '', + }, + { + displayName: 'SSL', + name: 'ssl', + type: 'options' as NodePropertyTypes, + options: [ + { + name: 'disable', + value: 'disable', + }, + { + name: 'allow', + value: 'allow', + }, + { + name: 'require', + value: 'require', + }, + { + name: 'verify (not implemented)', + value: 'verify', + }, + { + name: 'verify-full (not implemented)', + value: 'verify-full', + }, + ], + default: 'disable', + }, + { + displayName: 'Port', + name: 'port', + type: 'number' as NodePropertyTypes, + default: 5432, + }, + ]; +} diff --git a/packages/nodes-base/nodes/CrateDb/CrateDb.node.ts b/packages/nodes-base/nodes/CrateDb/CrateDb.node.ts new file mode 100644 index 0000000000..1d7ec41dbb --- /dev/null +++ b/packages/nodes-base/nodes/CrateDb/CrateDb.node.ts @@ -0,0 +1,246 @@ +import { IExecuteFunctions } from 'n8n-core'; +import { IDataObject, INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow'; + +import * as pgPromise from 'pg-promise'; + +import { pgInsert, pgQuery, pgUpdate } from '../Postgres/Postgres.node.functions'; + +export class CrateDb implements INodeType { + description: INodeTypeDescription = { + displayName: 'CrateDB', + name: 'crateDb', + icon: 'file:cratedb.png', + group: ['input'], + version: 1, + description: 'Gets, add and update data in CrateDB.', + defaults: { + name: 'CrateDB', + color: '#47889f', + }, + inputs: ['main'], + outputs: ['main'], + credentials: [ + { + name: 'crateDb', + required: true, + }, + ], + properties: [ + { + displayName: 'Operation', + name: 'operation', + type: 'options', + options: [ + { + name: 'Execute Query', + value: 'executeQuery', + description: 'Executes a SQL query.', + }, + { + name: 'Insert', + value: 'insert', + description: 'Insert rows in database.', + }, + { + name: 'Update', + value: 'update', + description: 'Updates rows in database.', + }, + ], + default: 'insert', + description: 'The operation to perform.', + }, + + // ---------------------------------- + // executeQuery + // ---------------------------------- + { + displayName: 'Query', + name: 'query', + type: 'string', + typeOptions: { + rows: 5, + }, + displayOptions: { + show: { + operation: ['executeQuery'], + }, + }, + default: '', + placeholder: 'SELECT id, name FROM product WHERE id < 40', + required: true, + description: 'The SQL query to execute.', + }, + + // ---------------------------------- + // insert + // ---------------------------------- + { + displayName: 'Schema', + name: 'schema', + type: 'string', + displayOptions: { + show: { + operation: ['insert'], + }, + }, + default: 'public', + required: true, + description: 'Name of the schema the table belongs to', + }, + { + displayName: 'Table', + name: 'table', + type: 'string', + displayOptions: { + show: { + operation: ['insert'], + }, + }, + default: '', + required: true, + description: 'Name of the table in which to insert data to.', + }, + { + displayName: 'Columns', + name: 'columns', + type: 'string', + displayOptions: { + show: { + operation: ['insert'], + }, + }, + default: '', + placeholder: 'id,name,description', + description: + 'Comma separated list of the properties which should used as columns for the new rows.', + }, + { + displayName: 'Return Fields', + name: 'returnFields', + type: 'string', + displayOptions: { + show: { + operation: ['insert'], + }, + }, + default: '*', + description: 'Comma separated list of the fields that the operation will return', + }, + + // ---------------------------------- + // update + // ---------------------------------- + { + displayName: 'Table', + name: 'table', + type: 'string', + displayOptions: { + show: { + operation: ['update'], + }, + }, + default: '', + required: true, + description: 'Name of the table in which to update data in', + }, + { + displayName: 'Update Key', + name: 'updateKey', + type: 'string', + displayOptions: { + show: { + operation: ['update'], + }, + }, + default: 'id', + required: true, + description: + 'Name of the property which decides which rows in the database should be updated. Normally that would be "id".', + }, + { + displayName: 'Columns', + name: 'columns', + type: 'string', + displayOptions: { + show: { + operation: ['update'], + }, + }, + default: '', + placeholder: 'name,description', + description: + 'Comma separated list of the properties which should used as columns for rows to update.', + }, + ], + }; + + async execute(this: IExecuteFunctions): Promise { + const credentials = this.getCredentials('crateDb'); + + if (credentials === undefined) { + throw new Error('No credentials got returned!'); + } + + const pgp = pgPromise(); + + const config = { + host: credentials.host as string, + port: credentials.port as number, + database: credentials.database as string, + user: credentials.user as string, + password: credentials.password as string, + ssl: !['disable', undefined].includes(credentials.ssl as string | undefined), + sslmode: (credentials.ssl as string) || 'disable', + }; + + const db = pgp(config); + + let returnItems = []; + + const items = this.getInputData(); + const operation = this.getNodeParameter('operation', 0) as string; + + if (operation === 'executeQuery') { + // ---------------------------------- + // executeQuery + // ---------------------------------- + + const queryResult = await pgQuery(this.getNodeParameter, pgp, db, items); + + returnItems = this.helpers.returnJsonArray(queryResult as IDataObject[]); + } else if (operation === 'insert') { + // ---------------------------------- + // insert + // ---------------------------------- + + const [insertData, insertItems] = await pgInsert(this.getNodeParameter, pgp, db, items); + + // Add the id to the data + for (let i = 0; i < insertData.length; i++) { + returnItems.push({ + json: { + ...insertData[i], + ...insertItems[i], + }, + }); + } + } else if (operation === 'update') { + // ---------------------------------- + // update + // ---------------------------------- + + const updateItems = await pgUpdate(this.getNodeParameter, pgp, db, items); + + returnItems = this.helpers.returnJsonArray(updateItems); + } else { + await pgp.end(); + throw new Error(`The operation "${operation}" is not supported!`); + } + + // Close the connection + await pgp.end(); + + return this.prepareOutputData(returnItems); + } +} diff --git a/packages/nodes-base/nodes/CrateDb/cratedb.png b/packages/nodes-base/nodes/CrateDb/cratedb.png new file mode 100644 index 0000000000000000000000000000000000000000..d2e90eade715e7a78024e942a0107ccefd9fdc76 GIT binary patch literal 475 zcmeAS@N?(olHy`uVBq!ia0vp^HXzKw1|+Ti+$;i8oCO|{#S9GG!XV7ZFl&wk0|R5P zr;B4qM&sLC8~vCZ1sWboe!F($!KN^=xJ5TI9!f`iVly#wQ=Vofa_i;~Cb4}DQoTzR zuc=Mh*VNgYapcgc#|CcwskN+S*EZ}pb3MQ9|B2WgZ*5O7|4scPxIz3Nx@ zuw}d3cW}7=n`par-MKEC(;AzFPbtP1ty>gcKAZjNmRYwR7Cb4A&^nmD{c`Qz-FttA zA7o&-CXsxWA*Sizv;$JfHP6_%`C6Nkk00Fl_`!|Bf;ScxWsXg?_uFgFslWd1e%$V` z=8{zzE4SRv;$TS7^;r5fYH?-66WdGMT4wX#?+gCl#QOT9>S6(h*r&qTY)=j@{1Ky5 zmvOWY$-rg$60BP-?=U@JUio@qh-mEE_a+JI5m+{>1`^(l@-XT=lX#qxB!d<6}t9m3hO| zDxe|6P!cWYwAY=vf<^pq+_#FtDyP5A85iaMXPuBp?(v-w&(zQqD7_^=9vE8;p00i_ I>zopr0Cm^hivR!s literal 0 HcmV?d00001 diff --git a/packages/nodes-base/package.json b/packages/nodes-base/package.json index df18bb8fba..d5e1796141 100644 --- a/packages/nodes-base/package.json +++ b/packages/nodes-base/package.json @@ -46,6 +46,7 @@ "dist/credentials/CodaApi.credentials.js", "dist/credentials/CopperApi.credentials.js", "dist/credentials/CalendlyApi.credentials.js", + "dist/credentials/CrateDb.credentials.js", "dist/credentials/DisqusApi.credentials.js", "dist/credentials/DriftApi.credentials.js", "dist/credentials/DriftOAuth2Api.credentials.js", @@ -182,6 +183,7 @@ "dist/nodes/Cockpit/Cockpit.node.js", "dist/nodes/Coda/Coda.node.js", "dist/nodes/Copper/CopperTrigger.node.js", + "dist/nodes/CrateDb/CrateDb.node.js", "dist/nodes/Cron.node.js", "dist/nodes/Crypto.node.js", "dist/nodes/DateTime.node.js", From ebe2775701f9803165e14f28e11ad0610dc155a1 Mon Sep 17 00:00:00 2001 From: Ben Hesseldieck <1849459+BHesseldieck@users.noreply.github.com> Date: Fri, 17 Jul 2020 17:08:40 +0200 Subject: [PATCH 238/241] :zap: Add index stopped at (#766) * :construction: add index on sqlite * :construction: add migration for postgres * :construction: add mysql migration * :construction: add mongodb migration * :rewind: revert change of default postgresdb user --- packages/cli/config/index.ts | 4 +++ packages/cli/migrations/ormconfig.ts | 10 +++---- packages/cli/src/Db.ts | 28 ++++++++++++++++--- .../src/databases/mongodb/ExecutionEntity.ts | 1 + .../151594910478695-CreateIndexStoppedAt.ts | 22 +++++++++++++++ .../src/databases/mongodb/migrations/index.ts | 1 + .../src/databases/mysqldb/ExecutionEntity.ts | 1 + .../1594902918301-CreateIndexStoppedAt.ts | 20 +++++++++++++ .../src/databases/mysqldb/migrations/index.ts | 1 + .../databases/postgresdb/ExecutionEntity.ts | 1 + .../1594828256133-CreateIndexStoppedAt.ts | 25 +++++++++++++++++ .../databases/postgresdb/migrations/index.ts | 1 + .../src/databases/sqlite/ExecutionEntity.ts | 1 + .../1594825041918-CreateIndexStoppedAt.ts | 20 +++++++++++++ .../src/databases/sqlite/migrations/index.ts | 1 + 15 files changed, 128 insertions(+), 9 deletions(-) create mode 100644 packages/cli/src/databases/mongodb/migrations/151594910478695-CreateIndexStoppedAt.ts create mode 100644 packages/cli/src/databases/mysqldb/migrations/1594902918301-CreateIndexStoppedAt.ts create mode 100644 packages/cli/src/databases/postgresdb/migrations/1594828256133-CreateIndexStoppedAt.ts create mode 100644 packages/cli/src/databases/sqlite/migrations/1594825041918-CreateIndexStoppedAt.ts diff --git a/packages/cli/config/index.ts b/packages/cli/config/index.ts index 9492b4cb63..2759c6d794 100644 --- a/packages/cli/config/index.ts +++ b/packages/cli/config/index.ts @@ -185,6 +185,7 @@ const config = convict({ // in the editor. saveDataManualExecutions: { doc: 'Save data of executions when started manually via editor', + format: 'Boolean', default: false, env: 'EXECUTIONS_DATA_SAVE_MANUAL_EXECUTIONS' }, @@ -196,16 +197,19 @@ const config = convict({ // a future version. pruneData: { doc: 'Delete data of past executions on a rolling basis', + format: 'Boolean', default: false, env: 'EXECUTIONS_DATA_PRUNE' }, pruneDataMaxAge: { doc: 'How old (hours) the execution data has to be to get deleted', + format: Number, default: 336, env: 'EXECUTIONS_DATA_MAX_AGE' }, pruneDataTimeout: { doc: 'Timeout (seconds) after execution data has been pruned', + format: Number, default: 3600, env: 'EXECUTIONS_DATA_PRUNE_TIMEOUT' }, diff --git a/packages/cli/migrations/ormconfig.ts b/packages/cli/migrations/ormconfig.ts index 2a0cda0d9c..1ea583beb4 100644 --- a/packages/cli/migrations/ormconfig.ts +++ b/packages/cli/migrations/ormconfig.ts @@ -44,9 +44,9 @@ module.exports = [ "logging": false, "host": "localhost", "username": "postgres", - "password": "docker", + "password": "", "port": 5432, - "database": "postgres", + "database": "n8n", "schema": "public", "entities": Object.values(PostgresDb), "migrations": [ @@ -68,7 +68,7 @@ module.exports = [ "username": "root", "password": "password", "host": "localhost", - "port": "3308", + "port": "3306", "logging": false, "entities": Object.values(MySQLDb), "migrations": [ @@ -90,7 +90,7 @@ module.exports = [ "username": "root", "password": "password", "host": "localhost", - "port": "3308", + "port": "3306", "logging": false, "entities": Object.values(MySQLDb), "migrations": [ @@ -105,4 +105,4 @@ module.exports = [ "subscribersDir": "./src/databases/mysqldb/Subscribers" } }, -]; \ No newline at end of file +]; diff --git a/packages/cli/src/Db.ts b/packages/cli/src/Db.ts index 3739b779ef..06eeca7976 100644 --- a/packages/cli/src/Db.ts +++ b/packages/cli/src/Db.ts @@ -35,21 +35,25 @@ export let collections: IDatabaseCollections = { import { InitialMigration1587669153312, WebhookModel1589476000887, + CreateIndexStoppedAt1594828256133, } from './databases/postgresdb/migrations'; import { InitialMigration1587563438936, WebhookModel1592679094242, + CreateIndexStoppedAt1594910478695, } from './databases/mongodb/migrations'; import { InitialMigration1588157391238, WebhookModel1592447867632, + CreateIndexStoppedAt1594902918301, } from './databases/mysqldb/migrations'; import { InitialMigration1588102412422, WebhookModel1592445003908, + CreateIndexStoppedAt1594825041918, } from './databases/sqlite/migrations'; import * as path from 'path'; @@ -71,7 +75,11 @@ export async function init(): Promise { entityPrefix, url: await GenericHelpers.getConfigValue('database.mongodb.connectionUrl') as string, useNewUrlParser: true, - migrations: [InitialMigration1587563438936, WebhookModel1592679094242], + migrations: [ + InitialMigration1587563438936, + WebhookModel1592679094242, + CreateIndexStoppedAt1594910478695, + ], migrationsRun: true, migrationsTableName: `${entityPrefix}migrations`, }; @@ -104,7 +112,11 @@ export async function init(): Promise { port: await GenericHelpers.getConfigValue('database.postgresdb.port') as number, username: await GenericHelpers.getConfigValue('database.postgresdb.user') as string, schema: config.get('database.postgresdb.schema'), - migrations: [InitialMigration1587669153312, WebhookModel1589476000887], + migrations: [ + InitialMigration1587669153312, + WebhookModel1589476000887, + CreateIndexStoppedAt1594828256133, + ], migrationsRun: true, migrationsTableName: `${entityPrefix}migrations`, ssl, @@ -123,7 +135,11 @@ export async function init(): Promise { password: await GenericHelpers.getConfigValue('database.mysqldb.password') as string, port: await GenericHelpers.getConfigValue('database.mysqldb.port') as number, username: await GenericHelpers.getConfigValue('database.mysqldb.user') as string, - migrations: [InitialMigration1588157391238, WebhookModel1592447867632], + migrations: [ + InitialMigration1588157391238, + WebhookModel1592447867632, + CreateIndexStoppedAt1594902918301, + ], migrationsRun: true, migrationsTableName: `${entityPrefix}migrations`, }; @@ -135,7 +151,11 @@ export async function init(): Promise { type: 'sqlite', database: path.join(n8nFolder, 'database.sqlite'), entityPrefix, - migrations: [InitialMigration1588102412422, WebhookModel1592445003908], + migrations: [ + InitialMigration1588102412422, + WebhookModel1592445003908, + CreateIndexStoppedAt1594825041918 + ], migrationsRun: true, migrationsTableName: `${entityPrefix}migrations`, }; diff --git a/packages/cli/src/databases/mongodb/ExecutionEntity.ts b/packages/cli/src/databases/mongodb/ExecutionEntity.ts index ba5071a36d..02a639d66a 100644 --- a/packages/cli/src/databases/mongodb/ExecutionEntity.ts +++ b/packages/cli/src/databases/mongodb/ExecutionEntity.ts @@ -39,6 +39,7 @@ export class ExecutionEntity implements IExecutionFlattedDb { @Column('Date') startedAt: Date; + @Index() @Column('Date') stoppedAt: Date; diff --git a/packages/cli/src/databases/mongodb/migrations/151594910478695-CreateIndexStoppedAt.ts b/packages/cli/src/databases/mongodb/migrations/151594910478695-CreateIndexStoppedAt.ts new file mode 100644 index 0000000000..9cfe4480dc --- /dev/null +++ b/packages/cli/src/databases/mongodb/migrations/151594910478695-CreateIndexStoppedAt.ts @@ -0,0 +1,22 @@ +import { MigrationInterface } from "typeorm"; +import { + MongoQueryRunner, +} from 'typeorm/driver/mongodb/MongoQueryRunner'; + +import * as config from '../../../../config'; + +export class CreateIndexStoppedAt1594910478695 implements MigrationInterface { + name = 'CreateIndexStoppedAt1594910478695' + + public async up(queryRunner: MongoQueryRunner): Promise { + const tablePrefix = config.get('database.tablePrefix'); + await queryRunner.manager.createCollectionIndex(`${tablePrefix}execution_entity`, 'stoppedAt', { name: `IDX_${tablePrefix}execution_entity_stoppedAt`}); + } + + public async down(queryRunner: MongoQueryRunner): Promise { + const tablePrefix = config.get('database.tablePrefix'); + await queryRunner.manager.dropCollectionIndex + (`${tablePrefix}execution_entity`, `IDX_${tablePrefix}execution_entity_stoppedAt`); + } + +} diff --git a/packages/cli/src/databases/mongodb/migrations/index.ts b/packages/cli/src/databases/mongodb/migrations/index.ts index 4072ab582d..ae4a6deb38 100644 --- a/packages/cli/src/databases/mongodb/migrations/index.ts +++ b/packages/cli/src/databases/mongodb/migrations/index.ts @@ -1,2 +1,3 @@ export * from './1587563438936-InitialMigration'; export * from './1592679094242-WebhookModel'; +export * from './151594910478695-CreateIndexStoppedAt'; diff --git a/packages/cli/src/databases/mysqldb/ExecutionEntity.ts b/packages/cli/src/databases/mysqldb/ExecutionEntity.ts index e0c084fcfc..3db01032b2 100644 --- a/packages/cli/src/databases/mysqldb/ExecutionEntity.ts +++ b/packages/cli/src/databases/mysqldb/ExecutionEntity.ts @@ -39,6 +39,7 @@ export class ExecutionEntity implements IExecutionFlattedDb { @Column('datetime') startedAt: Date; + @Index() @Column('datetime') stoppedAt: Date; diff --git a/packages/cli/src/databases/mysqldb/migrations/1594902918301-CreateIndexStoppedAt.ts b/packages/cli/src/databases/mysqldb/migrations/1594902918301-CreateIndexStoppedAt.ts new file mode 100644 index 0000000000..2cc4c86367 --- /dev/null +++ b/packages/cli/src/databases/mysqldb/migrations/1594902918301-CreateIndexStoppedAt.ts @@ -0,0 +1,20 @@ +import {MigrationInterface, QueryRunner} from "typeorm"; + +import * as config from '../../../../config'; + +export class CreateIndexStoppedAt1594902918301 implements MigrationInterface { + name = 'CreateIndexStoppedAt1594902918301' + + public async up(queryRunner: QueryRunner): Promise { + const tablePrefix = config.get('database.tablePrefix'); + + await queryRunner.query('CREATE INDEX `IDX_' + tablePrefix + 'cefb067df2402f6aed0638a6c1` ON `' + tablePrefix + 'execution_entity` (`stoppedAt`)'); + } + + public async down(queryRunner: QueryRunner): Promise { + const tablePrefix = config.get('database.tablePrefix'); + + await queryRunner.query('DROP INDEX `IDX_' + tablePrefix + 'cefb067df2402f6aed0638a6c1` ON `' + tablePrefix + 'execution_entity`'); + } + +} diff --git a/packages/cli/src/databases/mysqldb/migrations/index.ts b/packages/cli/src/databases/mysqldb/migrations/index.ts index 9e5abd3b8c..7c0cb217ef 100644 --- a/packages/cli/src/databases/mysqldb/migrations/index.ts +++ b/packages/cli/src/databases/mysqldb/migrations/index.ts @@ -1,2 +1,3 @@ export * from './1588157391238-InitialMigration'; export * from './1592447867632-WebhookModel'; +export * from './1594902918301-CreateIndexStoppedAt'; diff --git a/packages/cli/src/databases/postgresdb/ExecutionEntity.ts b/packages/cli/src/databases/postgresdb/ExecutionEntity.ts index 8a7f691f0f..8b45336c2f 100644 --- a/packages/cli/src/databases/postgresdb/ExecutionEntity.ts +++ b/packages/cli/src/databases/postgresdb/ExecutionEntity.ts @@ -39,6 +39,7 @@ export class ExecutionEntity implements IExecutionFlattedDb { @Column('timestamp') startedAt: Date; + @Index() @Column('timestamp') stoppedAt: Date; diff --git a/packages/cli/src/databases/postgresdb/migrations/1594828256133-CreateIndexStoppedAt.ts b/packages/cli/src/databases/postgresdb/migrations/1594828256133-CreateIndexStoppedAt.ts new file mode 100644 index 0000000000..7dd9578634 --- /dev/null +++ b/packages/cli/src/databases/postgresdb/migrations/1594828256133-CreateIndexStoppedAt.ts @@ -0,0 +1,25 @@ +import {MigrationInterface, QueryRunner} from "typeorm"; + +import * as config from '../../../../config'; + +export class CreateIndexStoppedAt1594828256133 implements MigrationInterface { + name = 'CreateIndexStoppedAt1594828256133' + + public async up(queryRunner: QueryRunner): Promise { + let tablePrefix = config.get('database.tablePrefix'); + const tablePrefixPure = tablePrefix; + const schema = config.get('database.postgresdb.schema'); + if (schema) { + tablePrefix = schema + '.' + tablePrefix; + } + + await queryRunner.query(`CREATE INDEX IF NOT EXISTS IDX_${tablePrefixPure}33228da131bb1112247cf52a42 ON ${tablePrefix}execution_entity ("stoppedAt") `); + } + + public async down(queryRunner: QueryRunner): Promise { + let tablePrefix = config.get('database.tablePrefix'); + + await queryRunner.query(`DROP INDEX IDX_${tablePrefix}33228da131bb1112247cf52a42`); + } + +} diff --git a/packages/cli/src/databases/postgresdb/migrations/index.ts b/packages/cli/src/databases/postgresdb/migrations/index.ts index 827f01796c..3b10537067 100644 --- a/packages/cli/src/databases/postgresdb/migrations/index.ts +++ b/packages/cli/src/databases/postgresdb/migrations/index.ts @@ -1,3 +1,4 @@ export * from './1587669153312-InitialMigration'; export * from './1589476000887-WebhookModel'; +export * from './1594828256133-CreateIndexStoppedAt'; diff --git a/packages/cli/src/databases/sqlite/ExecutionEntity.ts b/packages/cli/src/databases/sqlite/ExecutionEntity.ts index 825fed7fb5..bb7de2605d 100644 --- a/packages/cli/src/databases/sqlite/ExecutionEntity.ts +++ b/packages/cli/src/databases/sqlite/ExecutionEntity.ts @@ -39,6 +39,7 @@ export class ExecutionEntity implements IExecutionFlattedDb { @Column() startedAt: Date; + @Index() @Column() stoppedAt: Date; diff --git a/packages/cli/src/databases/sqlite/migrations/1594825041918-CreateIndexStoppedAt.ts b/packages/cli/src/databases/sqlite/migrations/1594825041918-CreateIndexStoppedAt.ts new file mode 100644 index 0000000000..cfa4812020 --- /dev/null +++ b/packages/cli/src/databases/sqlite/migrations/1594825041918-CreateIndexStoppedAt.ts @@ -0,0 +1,20 @@ +import {MigrationInterface, QueryRunner} from "typeorm"; + +import * as config from '../../../../config'; + +export class CreateIndexStoppedAt1594825041918 implements MigrationInterface { + name = 'CreateIndexStoppedAt1594825041918' + + public async up(queryRunner: QueryRunner): Promise { + const tablePrefix = config.get('database.tablePrefix'); + + await queryRunner.query(`CREATE INDEX "IDX_${tablePrefix}cefb067df2402f6aed0638a6c1" ON "execution_entity" ("stoppedAt") `); + } + + public async down(queryRunner: QueryRunner): Promise { + const tablePrefix = config.get('database.tablePrefix'); + + await queryRunner.query(`DROP INDEX "IDX_${tablePrefix}cefb067df2402f6aed0638a6c1"`); + } + +} diff --git a/packages/cli/src/databases/sqlite/migrations/index.ts b/packages/cli/src/databases/sqlite/migrations/index.ts index a830a007c7..f0a2068b92 100644 --- a/packages/cli/src/databases/sqlite/migrations/index.ts +++ b/packages/cli/src/databases/sqlite/migrations/index.ts @@ -1,2 +1,3 @@ export * from './1588102412422-InitialMigration'; export * from './1592445003908-WebhookModel'; +export * from './1594825041918-CreateIndexStoppedAt' From 35cb56675e6414ec64d7cc456e084d6a5667bd47 Mon Sep 17 00:00:00 2001 From: ricardo Date: Wed, 22 Jul 2020 17:52:40 -0400 Subject: [PATCH 239/241] :zap: Small improvements --- .../credentials/NextCloudApi.credentials.ts | 2 +- .../credentials/NextCloudOAuth2Api.credentials.ts | 2 +- .../nodes-base/nodes/NextCloud/GenericFunctions.ts | 5 ++--- .../nodes-base/nodes/NextCloud/NextCloud.node.ts | 12 ++++++++---- 4 files changed, 12 insertions(+), 9 deletions(-) diff --git a/packages/nodes-base/credentials/NextCloudApi.credentials.ts b/packages/nodes-base/credentials/NextCloudApi.credentials.ts index c75632df00..3081455506 100644 --- a/packages/nodes-base/credentials/NextCloudApi.credentials.ts +++ b/packages/nodes-base/credentials/NextCloudApi.credentials.ts @@ -12,7 +12,7 @@ export class NextCloudApi implements ICredentialType { displayName: 'Web DAV URL', name: 'webDavUrl', type: 'string' as NodePropertyTypes, - placeholder: 'https://nextcloud.example.com/remote.php/webdav/', + placeholder: 'https://nextcloud.example.com/remote.php/webdav', default: '', }, { diff --git a/packages/nodes-base/credentials/NextCloudOAuth2Api.credentials.ts b/packages/nodes-base/credentials/NextCloudOAuth2Api.credentials.ts index dbb4efcda1..9379ee5203 100644 --- a/packages/nodes-base/credentials/NextCloudOAuth2Api.credentials.ts +++ b/packages/nodes-base/credentials/NextCloudOAuth2Api.credentials.ts @@ -15,7 +15,7 @@ export class NextCloudOAuth2Api implements ICredentialType { displayName: 'Web DAV URL', name: 'webDavUrl', type: 'string' as NodePropertyTypes, - placeholder: 'https://nextcloud.example.com/remote.php/webdav/', + placeholder: 'https://nextcloud.example.com/remote.php/webdav', default: '', }, { diff --git a/packages/nodes-base/nodes/NextCloud/GenericFunctions.ts b/packages/nodes-base/nodes/NextCloud/GenericFunctions.ts index fc4e7646bf..2198cb5513 100644 --- a/packages/nodes-base/nodes/NextCloud/GenericFunctions.ts +++ b/packages/nodes-base/nodes/NextCloud/GenericFunctions.ts @@ -4,9 +4,8 @@ import { } from 'n8n-core'; import { - IDataObject, -} from 'n8n-workflow'; -import { OptionsWithUri } from 'request'; + OptionsWithUri, +} from 'request'; /** * Make an API request to NextCloud diff --git a/packages/nodes-base/nodes/NextCloud/NextCloud.node.ts b/packages/nodes-base/nodes/NextCloud/NextCloud.node.ts index 8b3f0620fc..a5b3109c6e 100644 --- a/packages/nodes-base/nodes/NextCloud/NextCloud.node.ts +++ b/packages/nodes-base/nodes/NextCloud/NextCloud.node.ts @@ -2,6 +2,7 @@ import { BINARY_ENCODING, IExecuteFunctions, } from 'n8n-core'; + import { IDataObject, INodeTypeDescription, @@ -9,10 +10,13 @@ import { INodeType, } from 'n8n-workflow'; -import { parseString } from 'xml2js'; -import { OptionsWithUri } from 'request'; -import { nextCloudApiRequest } from './GenericFunctions'; +import { + parseString, +} from 'xml2js'; +import { + nextCloudApiRequest, +} from './GenericFunctions'; export class NextCloud implements INodeType { description: INodeTypeDescription = { @@ -25,7 +29,7 @@ export class NextCloud implements INodeType { description: 'Access data on NextCloud', defaults: { name: 'NextCloud', - color: '#22BB44', + color: '#1cafff', }, inputs: ['main'], outputs: ['main'], From 5545bc7dfc72588575d356790323f61a2a724195 Mon Sep 17 00:00:00 2001 From: Rupenieks Date: Thu, 23 Jul 2020 11:14:03 +0200 Subject: [PATCH 240/241] :construction: Removed update function, fixed insert function --- .../nodes-base/nodes/QuestDb/QuestDb.node.ts | 126 +++++++++--------- 1 file changed, 63 insertions(+), 63 deletions(-) diff --git a/packages/nodes-base/nodes/QuestDb/QuestDb.node.ts b/packages/nodes-base/nodes/QuestDb/QuestDb.node.ts index 20b6d48615..b3ae15efee 100644 --- a/packages/nodes-base/nodes/QuestDb/QuestDb.node.ts +++ b/packages/nodes-base/nodes/QuestDb/QuestDb.node.ts @@ -4,6 +4,7 @@ import { IDataObject, INodeExecutionData, INodeType, INodeTypeDescription } from import * as pgPromise from 'pg-promise'; import { pgInsert, pgQuery, pgUpdate } from '../Postgres/Postgres.node.functions'; +import { table } from 'console'; export class QuestDb implements INodeType { description: INodeTypeDescription = { @@ -40,12 +41,7 @@ export class QuestDb implements INodeType { name: 'Insert', value: 'insert', description: 'Insert rows in database.', - }, - { - name: 'Update', - value: 'update', - description: 'Updates rows in database.', - }, + } ], default: 'insert', description: 'The operation to perform.', @@ -131,47 +127,47 @@ export class QuestDb implements INodeType { // ---------------------------------- // update // ---------------------------------- - { - displayName: 'Table', - name: 'table', - type: 'string', - displayOptions: { - show: { - operation: ['update'], - }, - }, - default: '', - required: true, - description: 'Name of the table in which to update data in', - }, - { - displayName: 'Update Key', - name: 'updateKey', - type: 'string', - displayOptions: { - show: { - operation: ['update'], - }, - }, - default: 'id', - required: true, - description: - 'Name of the property which decides which rows in the database should be updated. Normally that would be "id".', - }, - { - displayName: 'Columns', - name: 'columns', - type: 'string', - displayOptions: { - show: { - operation: ['update'], - }, - }, - default: '', - placeholder: 'name,description', - description: - 'Comma separated list of the properties which should used as columns for rows to update.', - }, + // { + // displayName: 'Table', + // name: 'table', + // type: 'string', + // displayOptions: { + // show: { + // operation: ['update'], + // }, + // }, + // default: '', + // required: true, + // description: 'Name of the table in which to update data in', + // }, + // { + // displayName: 'Update Key', + // name: 'updateKey', + // type: 'string', + // displayOptions: { + // show: { + // operation: ['update'], + // }, + // }, + // default: 'id', + // required: true, + // description: + // 'Name of the property which decides which rows in the database should be updated. Normally that would be "id".', + // }, + // { + // displayName: 'Columns', + // name: 'columns', + // type: 'string', + // displayOptions: { + // show: { + // operation: ['update'], + // }, + // }, + // default: '', + // placeholder: 'name,description', + // description: + // 'Comma separated list of the properties which should used as columns for rows to update.', + // }, ], }; @@ -213,26 +209,30 @@ export class QuestDb implements INodeType { // ---------------------------------- // insert // ---------------------------------- + const tableName = this.getNodeParameter('table', 0) as string; + const returnFields = this.getNodeParameter('returnFields', 0) as string; + + let queries : string[] = []; + items.map(item => { + let columns = Object.keys(item.json); - const [insertData, insertItems] = await pgInsert(this.getNodeParameter, pgp, db, items); + let values : string = columns.map((col : string) => { + if (typeof item.json[col] === 'string') { + return `\'${item.json[col]}\'`; + } else { + return item.json[col]; + } + }).join(','); - // Add the id to the data - for (let i = 0; i < insertData.length; i++) { - returnItems.push({ - json: { - ...insertData[i], - ...insertItems[i], - }, - }); - } - } else if (operation === 'update') { - // ---------------------------------- - // update - // ---------------------------------- + let query = `INSERT INTO ${tableName} (${columns.join(',')}) VALUES (${values});`; + queries.push(query); + }); + + await db.any(pgp.helpers.concat(queries)); - const updateItems = await pgUpdate(this.getNodeParameter, pgp, db, items); + let returnedItems = await db.any(`SELECT ${returnFields} from ${tableName}`); - returnItems = this.helpers.returnJsonArray(updateItems); + returnItems = this.helpers.returnJsonArray(returnedItems as IDataObject[]); } else { await pgp.end(); throw new Error(`The operation "${operation}" is not supported!`); From 138a4d75189470859131fcd46d6db9f1d4ae057e Mon Sep 17 00:00:00 2001 From: ricardo Date: Thu, 23 Jul 2020 14:53:31 -0400 Subject: [PATCH 241/241] :zap: Small improvements --- packages/nodes-base/credentials/GitlabOAuth2Api.credentials.ts | 2 +- packages/nodes-base/nodes/Gitlab/Gitlab.node.ts | 1 - packages/nodes-base/nodes/Gitlab/GitlabTrigger.node.ts | 1 - 3 files changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/nodes-base/credentials/GitlabOAuth2Api.credentials.ts b/packages/nodes-base/credentials/GitlabOAuth2Api.credentials.ts index 60cc091836..bfd7f5afbc 100644 --- a/packages/nodes-base/credentials/GitlabOAuth2Api.credentials.ts +++ b/packages/nodes-base/credentials/GitlabOAuth2Api.credentials.ts @@ -34,7 +34,7 @@ export class GitlabOAuth2Api implements ICredentialType { { displayName: 'Scope', name: 'scope', - type: 'string' as NodePropertyTypes, + type: 'hidden' as NodePropertyTypes, default: 'api', }, { diff --git a/packages/nodes-base/nodes/Gitlab/Gitlab.node.ts b/packages/nodes-base/nodes/Gitlab/Gitlab.node.ts index 920a2867ec..fa485e452a 100644 --- a/packages/nodes-base/nodes/Gitlab/Gitlab.node.ts +++ b/packages/nodes-base/nodes/Gitlab/Gitlab.node.ts @@ -13,7 +13,6 @@ import { gitlabApiRequest, } from './GenericFunctions'; - export class Gitlab implements INodeType { description: INodeTypeDescription = { displayName: 'Gitlab', diff --git a/packages/nodes-base/nodes/Gitlab/GitlabTrigger.node.ts b/packages/nodes-base/nodes/Gitlab/GitlabTrigger.node.ts index a3e9b9ee2a..fbb4c261e9 100644 --- a/packages/nodes-base/nodes/Gitlab/GitlabTrigger.node.ts +++ b/packages/nodes-base/nodes/Gitlab/GitlabTrigger.node.ts @@ -14,7 +14,6 @@ import { gitlabApiRequest, } from './GenericFunctions'; - export class GitlabTrigger implements INodeType { description: INodeTypeDescription = { displayName: 'Gitlab Trigger',