+ added new tools

This commit is contained in:
Miquel Colomer 2021-02-25 10:47:36 +01:00
parent 0a0509a4ae
commit 4851cb806e
2 changed files with 12 additions and 12 deletions

View file

@ -1,6 +1,6 @@
import {
INodeProperties,
IDataObject,
INodeProperties
} from 'n8n-workflow';
import {

View file

@ -1,6 +1,6 @@
import {
INodeProperties,
IDataObject,
INodeProperties
} from 'n8n-workflow';
import {
@ -41,19 +41,19 @@ for(const group of (groups as IDataObject).groups as IDataObject[]) {
const options = [];
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) + " <a href='" + link + "' target='_blank'>Info</a>"
description: (tool.ed as string) + ` <a href="${link}" target='_blank'>Info</a>`
};
options.push(option);
}
}
//Tool
item.options = <any>options.sort((a, b) => (a.name > b.name) ? 1 : -1);
item.default = <string>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);
}
@ -65,8 +65,8 @@ 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,