From 4851cb806e7609f895ed983b15b7ec305a355485 Mon Sep 17 00:00:00 2001 From: Miquel Colomer Date: Thu, 25 Feb 2021 10:47:36 +0100 Subject: [PATCH] + added new tools --- .../nodes/UProc/GroupDescription.ts | 4 ++-- .../nodes-base/nodes/UProc/ToolDescription.ts | 20 +++++++++---------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/packages/nodes-base/nodes/UProc/GroupDescription.ts b/packages/nodes-base/nodes/UProc/GroupDescription.ts index 446ffba631..f1483a0dac 100644 --- a/packages/nodes-base/nodes/UProc/GroupDescription.ts +++ b/packages/nodes-base/nodes/UProc/GroupDescription.ts @@ -1,6 +1,6 @@ import { - INodeProperties, IDataObject, + INodeProperties } from 'n8n-workflow'; import { @@ -18,7 +18,7 @@ const finalGroups = { const options = []; -for(const group of (groups as IDataObject).groups as IDataObject[]){ +for (const group of (groups as IDataObject).groups as IDataObject[]) { const item = { name: group.translated, value: group.name, diff --git a/packages/nodes-base/nodes/UProc/ToolDescription.ts b/packages/nodes-base/nodes/UProc/ToolDescription.ts index a65ec7225d..6fa7bf7d01 100644 --- a/packages/nodes-base/nodes/UProc/ToolDescription.ts +++ b/packages/nodes-base/nodes/UProc/ToolDescription.ts @@ -1,6 +1,6 @@ import { - INodeProperties, IDataObject, + INodeProperties } from 'n8n-workflow'; import { @@ -21,7 +21,7 @@ function capitalize(str: string): string { const operations = []; -for(const group of (groups as IDataObject).groups as IDataObject[]) { +for (const group of (groups as IDataObject).groups as IDataObject[]) { const item = { displayName: 'Operation', name: 'tool', @@ -39,21 +39,21 @@ for(const group of (groups as IDataObject).groups as IDataObject[]) { }; const options = []; - for(const tool of (tools as IDataObject).processors as IDataObject[]){ + for (const tool of (tools as IDataObject).processors as IDataObject[]) { if (tool.g === group.name) { - const link = 'https://app.uproc.io/#/tools/processor/' + (tool.k as string).replace(/([A-Z]+)/g, "-$1").toLowerCase().replace('-', '/').replace('-', '/'); + const link = 'https://app.uproc.io/#/tools/processor/' + (tool.k as string).replace(/([A-Z]+)/g, '-$1').toLowerCase().replace('-', '/').replace('-', '/'); const option = { name: tool.d as string, value: tool.k, - description: (tool.ed as string) + " Info" + description: (tool.ed as string) + ` Info` }; options.push(option); } } //Tool - item.options = options.sort((a, b) => (a.name > b.name) ? 1 : -1); - item.default = options[0].value; + item.options = (options.sort((a, b) => (a.name > b.name) ? 1 : -1) as any); // tslint:disable-line:no-any + item.default = (options[0].value as string); operations.push(item); } @@ -61,12 +61,12 @@ export const toolOperations = operations as INodeProperties[]; let parameters = []; //all tools -for(const tool of (tools as IDataObject).processors as IDataObject[]) { +for (const tool of (tools as IDataObject).processors as IDataObject[]) { //all parameters in tool for (const param of (tool as IDataObject).p as IDataObject[]) { const displayName = param.n as string; - const capitalizedDisplayName = capitalize(displayName.replace(/_/g, " ")); - const description = "The '" + capitalizedDisplayName + "' value to use as a parameter for this Operation"; + const capitalizedDisplayName = capitalize(displayName.replace(/_/g, ' ')); + const description = `The "${capitalizedDisplayName}" value to use as a parameter for this Operation`; const parameter = { displayName: capitalizedDisplayName, name: param.n,