mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-22 04:10:01 +00:00
+ added new tools
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
import {
|
import {
|
||||||
INodeProperties,
|
|
||||||
IDataObject,
|
IDataObject,
|
||||||
|
INodeProperties
|
||||||
} from 'n8n-workflow';
|
} from 'n8n-workflow';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
@@ -18,7 +18,7 @@ const finalGroups = {
|
|||||||
|
|
||||||
const options = [];
|
const options = [];
|
||||||
|
|
||||||
for(const group of (groups as IDataObject).groups as IDataObject[]){
|
for (const group of (groups as IDataObject).groups as IDataObject[]) {
|
||||||
const item = {
|
const item = {
|
||||||
name: group.translated,
|
name: group.translated,
|
||||||
value: group.name,
|
value: group.name,
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import {
|
import {
|
||||||
INodeProperties,
|
|
||||||
IDataObject,
|
IDataObject,
|
||||||
|
INodeProperties
|
||||||
} from 'n8n-workflow';
|
} from 'n8n-workflow';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
@@ -21,7 +21,7 @@ function capitalize(str: string): string {
|
|||||||
|
|
||||||
const operations = [];
|
const operations = [];
|
||||||
|
|
||||||
for(const group of (groups as IDataObject).groups as IDataObject[]) {
|
for (const group of (groups as IDataObject).groups as IDataObject[]) {
|
||||||
const item = {
|
const item = {
|
||||||
displayName: 'Operation',
|
displayName: 'Operation',
|
||||||
name: 'tool',
|
name: 'tool',
|
||||||
@@ -39,21 +39,21 @@ for(const group of (groups as IDataObject).groups as IDataObject[]) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const options = [];
|
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) {
|
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 = {
|
const option = {
|
||||||
name: tool.d as string,
|
name: tool.d as string,
|
||||||
value: tool.k,
|
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);
|
options.push(option);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//Tool
|
//Tool
|
||||||
item.options = <any>options.sort((a, b) => (a.name > b.name) ? 1 : -1);
|
item.options = (options.sort((a, b) => (a.name > b.name) ? 1 : -1) as any); // tslint:disable-line:no-any
|
||||||
item.default = <string>options[0].value;
|
item.default = (options[0].value as string);
|
||||||
operations.push(item);
|
operations.push(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -61,12 +61,12 @@ export const toolOperations = operations as INodeProperties[];
|
|||||||
|
|
||||||
let parameters = [];
|
let parameters = [];
|
||||||
//all tools
|
//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
|
//all parameters in tool
|
||||||
for (const param of (tool as IDataObject).p as IDataObject[]) {
|
for (const param of (tool as IDataObject).p as IDataObject[]) {
|
||||||
const displayName = param.n as string;
|
const displayName = param.n as string;
|
||||||
const capitalizedDisplayName = capitalize(displayName.replace(/_/g, " "));
|
const capitalizedDisplayName = capitalize(displayName.replace(/_/g, ' '));
|
||||||
const description = "The '" + capitalizedDisplayName + "' value to use as a parameter for this Operation";
|
const description = `The "${capitalizedDisplayName}" value to use as a parameter for this Operation`;
|
||||||
const parameter = {
|
const parameter = {
|
||||||
displayName: capitalizedDisplayName,
|
displayName: capitalizedDisplayName,
|
||||||
name: param.n,
|
name: param.n,
|
||||||
|
|||||||
Reference in New Issue
Block a user