n8n-workflow 1.88.0 → 1.90.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/FromAIParseUtils.d.ts +1 -0
- package/dist/FromAIParseUtils.js +15 -0
- package/dist/FromAIParseUtils.js.map +1 -1
- package/dist/Graph/graphUtils.d.ts +34 -0
- package/dist/Graph/graphUtils.js +132 -0
- package/dist/Graph/graphUtils.js.map +1 -0
- package/dist/Interfaces.d.ts +15 -1
- package/dist/Interfaces.js.map +1 -1
- package/dist/NodeHelpers.d.ts +3 -10
- package/dist/NodeHelpers.js +3 -185
- package/dist/NodeHelpers.js.map +1 -1
- package/dist/NodeReferenceParserUtils.d.ts +4 -0
- package/dist/NodeReferenceParserUtils.js +58 -0
- package/dist/NodeReferenceParserUtils.js.map +1 -0
- package/dist/Workflow.js +2 -36
- package/dist/Workflow.js.map +1 -1
- package/dist/WorkflowDataProxy.js +1 -1
- package/dist/WorkflowDataProxy.js.map +1 -1
- package/dist/build.tsbuildinfo +1 -1
- package/package.json +5 -5
|
@@ -9,3 +9,4 @@ export type FromAIArgument = {
|
|
|
9
9
|
export declare function generateZodSchema(placeholder: FromAIArgument): z.ZodTypeAny;
|
|
10
10
|
export declare function extractFromAICalls(str: string): FromAIArgument[];
|
|
11
11
|
export declare function traverseNodeParameters(payload: unknown, collectedArgs: FromAIArgument[]): void;
|
|
12
|
+
export declare function traverseNodeParametersWithParamNames(payload: unknown, collectedArgs: Map<string, FromAIArgument>, name?: string): void;
|
package/dist/FromAIParseUtils.js
CHANGED
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.generateZodSchema = generateZodSchema;
|
|
4
4
|
exports.extractFromAICalls = extractFromAICalls;
|
|
5
5
|
exports.traverseNodeParameters = traverseNodeParameters;
|
|
6
|
+
exports.traverseNodeParametersWithParamNames = traverseNodeParametersWithParamNames;
|
|
6
7
|
const zod_1 = require("zod");
|
|
7
8
|
const utils_1 = require("./utils");
|
|
8
9
|
class ParseError extends Error {
|
|
@@ -212,4 +213,18 @@ function traverseNodeParameters(payload, collectedArgs) {
|
|
|
212
213
|
Object.values(payload).forEach((value) => traverseNodeParameters(value, collectedArgs));
|
|
213
214
|
}
|
|
214
215
|
}
|
|
216
|
+
function traverseNodeParametersWithParamNames(payload, collectedArgs, name) {
|
|
217
|
+
if (typeof payload === 'string') {
|
|
218
|
+
const fromAICalls = extractFromAICalls(payload);
|
|
219
|
+
fromAICalls.forEach((call) => collectedArgs.set(name, call));
|
|
220
|
+
}
|
|
221
|
+
else if (Array.isArray(payload)) {
|
|
222
|
+
payload.forEach((item, index) => traverseNodeParametersWithParamNames(item, collectedArgs, name + `[${index}]`));
|
|
223
|
+
}
|
|
224
|
+
else if (typeof payload === 'object' && payload !== null) {
|
|
225
|
+
for (const [key, value] of Object.entries(payload)) {
|
|
226
|
+
traverseNodeParametersWithParamNames(value, collectedArgs, name ? name + '.' + key : key);
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
}
|
|
215
230
|
//# sourceMappingURL=FromAIParseUtils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FromAIParseUtils.js","sourceRoot":"","sources":["../src/FromAIParseUtils.ts"],"names":[],"mappings":";;AAuBA,8CAiFC;AA+HD,gDAqEC;AAOD,wDASC;
|
|
1
|
+
{"version":3,"file":"FromAIParseUtils.js","sourceRoot":"","sources":["../src/FromAIParseUtils.ts"],"names":[],"mappings":";;AAuBA,8CAiFC;AA+HD,gDAqEC;AAOD,wDASC;AAED,oFAiBC;AA/UD,6BAAwB;AAExB,mCAAoC;AAcpC,MAAM,UAAW,SAAQ,KAAK;CAAG;AAOjC,SAAgB,iBAAiB,CAAC,WAA2B;IAC5D,IAAI,MAAoB,CAAC;IAEzB,QAAQ,WAAW,CAAC,IAAI,EAAE,WAAW,EAAE,EAAE,CAAC;QACzC,KAAK,QAAQ;YACZ,MAAM,GAAG,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CACnD,OAAgB,EAChB,aAA0C,EAC1C,IAAa;IAEb,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;QACjC,MAAM,WAAW,GAAG,kBAAkB,CAAC,OAAO,CAAC,CAAC;QAChD,WAAW,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,aAAa,CAAC,GAAG,CAAC,IAAc,EAAE,IAAI,CAAC,CAAC,CAAC;IACxE,CAAC;SAAM,IAAI,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;QACnC,OAAO,CAAC,OAAO,CAAC,CAAC,IAAa,EAAE,KAAa,EAAE,EAAE,CAChD,oCAAoC,CAAC,IAAI,EAAE,aAAa,EAAE,IAAI,GAAG,IAAI,KAAK,GAAG,CAAC,CAC9E,CAAC;IACH,CAAC;SAAM,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;QAC5D,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;YACpD,oCAAoC,CAAC,KAAK,EAAE,aAAa,EAAE,IAAI,CAAC,CAAC,CAAC,IAAI,GAAG,GAAG,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;QAC3F,CAAC;IACF,CAAC;AACF,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
type MultipleInputNodesError = {
|
|
2
|
+
errorCode: 'Multiple Input Nodes';
|
|
3
|
+
nodes: Set<string>;
|
|
4
|
+
};
|
|
5
|
+
type MultipleOutputNodesError = {
|
|
6
|
+
errorCode: 'Multiple Output Nodes';
|
|
7
|
+
nodes: Set<string>;
|
|
8
|
+
};
|
|
9
|
+
type InputEdgeToNonRootNode = {
|
|
10
|
+
errorCode: 'Input Edge To Non-Root Node';
|
|
11
|
+
node: string;
|
|
12
|
+
};
|
|
13
|
+
type OutputEdgeFromNonLeafNode = {
|
|
14
|
+
errorCode: 'Output Edge From Non-Leaf Node';
|
|
15
|
+
node: string;
|
|
16
|
+
};
|
|
17
|
+
type NoContinuousPathFromRootToLeaf = {
|
|
18
|
+
errorCode: 'No Continuous Path From Root To Leaf In Selection';
|
|
19
|
+
start: string;
|
|
20
|
+
end: string;
|
|
21
|
+
};
|
|
22
|
+
export type ExtractableErrorResult = MultipleInputNodesError | MultipleOutputNodesError | InputEdgeToNonRootNode | OutputEdgeFromNonLeafNode | NoContinuousPathFromRootToLeaf;
|
|
23
|
+
type AdjacencyList = Map<string, Set<string>>;
|
|
24
|
+
export declare function getInputEdges(graphIds: Set<string>, adjacencyList: AdjacencyList): Array<[string, string]>;
|
|
25
|
+
export declare function getOutputEdges(graphIds: Set<string>, adjacencyList: AdjacencyList): Array<[string, string]>;
|
|
26
|
+
export declare function getRootNodes(graphIds: Set<string>, adjacencyList: AdjacencyList): Set<string>;
|
|
27
|
+
export declare function getLeafNodes(graphIds: Set<string>, adjacencyList: AdjacencyList): Set<string>;
|
|
28
|
+
export declare function hasPath(start: string, end: string, adjacencyList: AdjacencyList): boolean;
|
|
29
|
+
export type ExtractableSubgraphData = {
|
|
30
|
+
start?: string;
|
|
31
|
+
end?: string;
|
|
32
|
+
};
|
|
33
|
+
export declare function parseExtractableSubgraphSelection(graphIds: Set<string>, adjacencyList: AdjacencyList): ExtractableSubgraphData | ExtractableErrorResult[];
|
|
34
|
+
export {};
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getInputEdges = getInputEdges;
|
|
4
|
+
exports.getOutputEdges = getOutputEdges;
|
|
5
|
+
exports.getRootNodes = getRootNodes;
|
|
6
|
+
exports.getLeafNodes = getLeafNodes;
|
|
7
|
+
exports.hasPath = hasPath;
|
|
8
|
+
exports.parseExtractableSubgraphSelection = parseExtractableSubgraphSelection;
|
|
9
|
+
function getInputEdges(graphIds, adjacencyList) {
|
|
10
|
+
const result = [];
|
|
11
|
+
for (const [from, tos] of adjacencyList.entries()) {
|
|
12
|
+
if (graphIds.has(from))
|
|
13
|
+
continue;
|
|
14
|
+
for (const to of tos) {
|
|
15
|
+
if (graphIds.has(to)) {
|
|
16
|
+
result.push([from, to]);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return result;
|
|
21
|
+
}
|
|
22
|
+
function getOutputEdges(graphIds, adjacencyList) {
|
|
23
|
+
const result = [];
|
|
24
|
+
for (const [from, tos] of adjacencyList.entries()) {
|
|
25
|
+
if (!graphIds.has(from))
|
|
26
|
+
continue;
|
|
27
|
+
for (const to of tos) {
|
|
28
|
+
if (!graphIds.has(to)) {
|
|
29
|
+
result.push([from, to]);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
return result;
|
|
34
|
+
}
|
|
35
|
+
function intersection(a, b) {
|
|
36
|
+
const result = new Set();
|
|
37
|
+
for (const x of a) {
|
|
38
|
+
if (b.has(x))
|
|
39
|
+
result.add(x);
|
|
40
|
+
}
|
|
41
|
+
return result;
|
|
42
|
+
}
|
|
43
|
+
function union(a, b) {
|
|
44
|
+
const result = new Set();
|
|
45
|
+
for (const x of a)
|
|
46
|
+
result.add(x);
|
|
47
|
+
for (const x of b)
|
|
48
|
+
result.add(x);
|
|
49
|
+
return result;
|
|
50
|
+
}
|
|
51
|
+
function difference(minuend, subtrahend) {
|
|
52
|
+
const result = new Set(minuend.values());
|
|
53
|
+
for (const x of subtrahend) {
|
|
54
|
+
result.delete(x);
|
|
55
|
+
}
|
|
56
|
+
return result;
|
|
57
|
+
}
|
|
58
|
+
function getRootNodes(graphIds, adjacencyList) {
|
|
59
|
+
let innerNodes = new Set();
|
|
60
|
+
for (const nodeId of graphIds) {
|
|
61
|
+
innerNodes = union(innerNodes, adjacencyList.get(nodeId) ?? new Set());
|
|
62
|
+
}
|
|
63
|
+
return difference(graphIds, innerNodes);
|
|
64
|
+
}
|
|
65
|
+
function getLeafNodes(graphIds, adjacencyList) {
|
|
66
|
+
const result = new Set();
|
|
67
|
+
for (const nodeId of graphIds) {
|
|
68
|
+
if (intersection(adjacencyList.get(nodeId) ?? new Set(), graphIds).size === 0) {
|
|
69
|
+
result.add(nodeId);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
return result;
|
|
73
|
+
}
|
|
74
|
+
function hasPath(start, end, adjacencyList) {
|
|
75
|
+
const seen = new Set();
|
|
76
|
+
const paths = [start];
|
|
77
|
+
while (true) {
|
|
78
|
+
const next = paths.pop();
|
|
79
|
+
if (next === end)
|
|
80
|
+
return true;
|
|
81
|
+
if (next === undefined)
|
|
82
|
+
return false;
|
|
83
|
+
seen.add(next);
|
|
84
|
+
paths.push(...difference(adjacencyList.get(next) ?? new Set(), seen));
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
function parseExtractableSubgraphSelection(graphIds, adjacencyList) {
|
|
88
|
+
const errors = [];
|
|
89
|
+
const inputEdges = getInputEdges(graphIds, adjacencyList);
|
|
90
|
+
const inputNodes = new Set(inputEdges.map((x) => x[1]));
|
|
91
|
+
const rootNodes = getRootNodes(graphIds, adjacencyList);
|
|
92
|
+
for (const inputNode of difference(inputNodes, rootNodes).values()) {
|
|
93
|
+
errors.push({
|
|
94
|
+
errorCode: 'Input Edge To Non-Root Node',
|
|
95
|
+
node: inputNode,
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
const rootInputNodes = intersection(rootNodes, inputNodes);
|
|
99
|
+
if (rootInputNodes.size > 1) {
|
|
100
|
+
errors.push({
|
|
101
|
+
errorCode: 'Multiple Input Nodes',
|
|
102
|
+
nodes: rootInputNodes,
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
const outputEdges = getOutputEdges(graphIds, adjacencyList);
|
|
106
|
+
const outputNodes = new Set(outputEdges.map((x) => x[0]));
|
|
107
|
+
const leafNodes = getLeafNodes(graphIds, adjacencyList);
|
|
108
|
+
for (const outputNode of difference(outputNodes, leafNodes).values()) {
|
|
109
|
+
errors.push({
|
|
110
|
+
errorCode: 'Output Edge From Non-Leaf Node',
|
|
111
|
+
node: outputNode,
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
const leafOutputNodes = intersection(leafNodes, outputNodes);
|
|
115
|
+
if (leafOutputNodes.size > 1) {
|
|
116
|
+
errors.push({
|
|
117
|
+
errorCode: 'Multiple Output Nodes',
|
|
118
|
+
nodes: leafOutputNodes,
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
const start = rootInputNodes.values().next().value;
|
|
122
|
+
const end = leafOutputNodes.values().next().value;
|
|
123
|
+
if (start && end && !hasPath(start, end, adjacencyList)) {
|
|
124
|
+
errors.push({
|
|
125
|
+
errorCode: 'No Continuous Path From Root To Leaf In Selection',
|
|
126
|
+
start,
|
|
127
|
+
end,
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
return errors.length > 0 ? errors : { start, end };
|
|
131
|
+
}
|
|
132
|
+
//# sourceMappingURL=graphUtils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graphUtils.js","sourceRoot":"","sources":["../../src/Graph/graphUtils.ts"],"names":[],"mappings":";;AAsCA,sCAgBC;AAKD,wCAgBC;AAyBD,oCAQC;AAED,oCAQC;AAED,0BAWC;AAqBD,8EAuDC;AAzKD,SAAgB,aAAa,CAC5B,QAAqB,EACrB,aAA4B;IAE5B,MAAM,MAAM,GAA4B,EAAE,CAAC;IAC3C,KAAK,MAAM,CAAC,IAAI,EAAE,GAAG,CAAC,IAAI,aAAa,CAAC,OAAO,EAAE,EAAE,CAAC;QACnD,IAAI,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC;YAAE,SAAS;QAEjC,KAAK,MAAM,EAAE,IAAI,GAAG,EAAE,CAAC;YACtB,IAAI,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,CAAC;gBACtB,MAAM,CAAC,IAAI,CA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CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC1D,MAAM,SAAS,GAAG,YAAY,CAAC,QAAQ,EAAE,aAAa,CAAC,CAAC;IACxD,KAAK,MAAM,UAAU,IAAI,UAAU,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC;QACtE,MAAM,CAAC,IAAI,CAAC;YACX,SAAS,EAAE,gCAAgC;YAC3C,IAAI,EAAE,UAAU;SAChB,CAAC,CAAC;IACJ,CAAC;IAED,MAAM,eAAe,GAAG,YAAY,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;IAC7D,IAAI,eAAe,CAAC,IAAI,GAAG,CAAC,EAAE,CAAC;QAC9B,MAAM,CAAC,IAAI,CAAC;YACX,SAAS,EAAE,uBAAuB;YAClC,KAAK,EAAE,eAAe;SACtB,CAAC,CAAC;IACJ,CAAC;IAED,MAAM,KAAK,GAAG,cAAc,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC;IACnD,MAAM,GAAG,GAAG,eAAe,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC;IAElD,IAAI,KAAK,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,EAAE,aAAa,CAAC,EAAE,CAAC;QACzD,MAAM,CAAC,IAAI,CAAC;YACX,SAAS,EAAE,mDAAmD;YAC9D,KAAK;YACL,GAAG;SACH,CAAC,CAAC;IACJ,CAAC;IAED,OAAO,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC;AACpD,CAAC"}
|
package/dist/Interfaces.d.ts
CHANGED
|
@@ -464,6 +464,14 @@ export interface BinaryHelperFunctions {
|
|
|
464
464
|
export type DeduplicationScope = 'node' | 'workflow';
|
|
465
465
|
export type DeduplicationItemTypes = string | number;
|
|
466
466
|
export type DeduplicationMode = 'entries' | 'latestIncrementalKey' | 'latestDate';
|
|
467
|
+
export interface IProcessedDataLatest {
|
|
468
|
+
mode: DeduplicationMode;
|
|
469
|
+
data: DeduplicationItemTypes;
|
|
470
|
+
}
|
|
471
|
+
export interface IProcessedDataEntries {
|
|
472
|
+
mode: DeduplicationMode;
|
|
473
|
+
data: DeduplicationItemTypes[];
|
|
474
|
+
}
|
|
467
475
|
export interface IDeduplicationOutput {
|
|
468
476
|
new: DeduplicationItemTypes[];
|
|
469
477
|
processed: DeduplicationItemTypes[];
|
|
@@ -694,6 +702,7 @@ export interface INode {
|
|
|
694
702
|
credentials?: INodeCredentials;
|
|
695
703
|
webhookId?: string;
|
|
696
704
|
extendsCredential?: string;
|
|
705
|
+
rewireOutputLogTo?: NodeConnectionType;
|
|
697
706
|
}
|
|
698
707
|
export interface IPinData {
|
|
699
708
|
[nodeName: string]: INodeExecutionData[];
|
|
@@ -1654,11 +1663,14 @@ export interface WorkflowTestData {
|
|
|
1654
1663
|
};
|
|
1655
1664
|
};
|
|
1656
1665
|
output: {
|
|
1666
|
+
assertBinaryData?: boolean;
|
|
1657
1667
|
nodeExecutionOrder?: string[];
|
|
1668
|
+
nodeExecutionStack?: IExecuteData[];
|
|
1658
1669
|
testAllOutputs?: boolean;
|
|
1659
1670
|
nodeData: {
|
|
1660
1671
|
[key: string]: any[][];
|
|
1661
1672
|
};
|
|
1673
|
+
error?: string;
|
|
1662
1674
|
};
|
|
1663
1675
|
nock?: {
|
|
1664
1676
|
baseUrl: string;
|
|
@@ -1676,6 +1688,7 @@ export interface WorkflowTestData {
|
|
|
1676
1688
|
mode: WorkflowExecuteMode;
|
|
1677
1689
|
input: INodeExecutionData;
|
|
1678
1690
|
};
|
|
1691
|
+
credentials?: Record<string, ICredentialDataDecryptedObject>;
|
|
1679
1692
|
}
|
|
1680
1693
|
export type LogLevel = (typeof LOG_LEVELS)[number];
|
|
1681
1694
|
export type LogMetadata = {
|
|
@@ -1852,7 +1865,8 @@ export interface WorkflowInputsData {
|
|
|
1852
1865
|
fields: ResourceMapperField[];
|
|
1853
1866
|
dataMode: string;
|
|
1854
1867
|
subworkflowInfo?: {
|
|
1855
|
-
|
|
1868
|
+
workflowId?: string;
|
|
1869
|
+
triggerId?: string;
|
|
1856
1870
|
};
|
|
1857
1871
|
}
|
|
1858
1872
|
export interface ResourceMapperField {
|
package/dist/Interfaces.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Interfaces.js","sourceRoot":"","sources":["../src/Interfaces.ts"],"names":[],"mappings":";;;AA6FA,MAAsB,YAAY;IASjC,YAAY,eAAwC,EAAE,IAAY,EAAE,IAAa;QAChF,IAAI,CAAC,EAAE,GAAG,eAAe,CAAC,EAAE,IAAI,SAAS,CAAC;QAC1C,IAAI,CAAC,IAAI,GAAG,eAAe,CAAC,IAAI,CAAC;QACjC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IAClB,CAAC;CAOD;AArBD,oCAqBC;AAuED,MAAsB,kBAAkB;CAyCvC;AAzCD,gDAyCC;
|
|
1
|
+
{"version":3,"file":"Interfaces.js","sourceRoot":"","sources":["../src/Interfaces.ts"],"names":[],"mappings":";;;AA6FA,MAAsB,YAAY;IASjC,YAAY,eAAwC,EAAE,IAAY,EAAE,IAAa;QAChF,IAAI,CAAC,EAAE,GAAG,eAAe,CAAC,EAAE,IAAI,SAAS,CAAC;QAC1C,IAAI,CAAC,IAAI,GAAG,eAAe,CAAC,IAAI,CAAC;QACjC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IAClB,CAAC;CAOD;AArBD,oCAqBC;AAuED,MAAsB,kBAAkB;CAyCvC;AAzCD,gDAyCC;AAq4CD,MAAsB,IAAI;CAKzB;AALD,oBAKC;AAqNY,QAAA,mBAAmB,GAAG;IAClC,OAAO,EAAE,UAAU;IACnB,OAAO,EAAE,UAAU;IACnB,UAAU,EAAE,aAAa;IACzB,WAAW,EAAE,cAAc;IAC3B,eAAe,EAAE,kBAAkB;IACnC,QAAQ,EAAE,WAAW;IACrB,cAAc,EAAE,iBAAiB;IACjC,WAAW,EAAE,cAAc;IAC3B,cAAc,EAAE,iBAAiB;IACjC,MAAM,EAAE,SAAS;IACjB,aAAa,EAAE,gBAAgB;IAC/B,IAAI,EAAE,MAAM;CACH,CAAC;AAME,QAAA,mBAAmB,GAAyB;IACxD,2BAAmB,CAAC,OAAO;IAC3B,2BAAmB,CAAC,OAAO;IAC3B,2BAAmB,CAAC,UAAU;IAC9B,2BAAmB,CAAC,WAAW;IAC/B,2BAAmB,CAAC,eAAe;IACnC,2BAAmB,CAAC,QAAQ;IAC5B,2BAAmB,CAAC,cAAc;IAClC,2BAAmB,CAAC,WAAW;IAC/B,2BAAmB,CAAC,cAAc;IAClC,2BAAmB,CAAC,MAAM;IAC1B,2BAAmB,CAAC,aAAa;IACjC,2BAAmB,CAAC,IAAI;CACxB,CAAC"}
|
package/dist/NodeHelpers.d.ts
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
import type { IContextObject, INode, INodeCredentialDescription, INodeIssues, INodeParameters, INodeProperties, INodePropertyCollection, INodeType, IParameterDependencies, IRunExecutionData, IVersionedNodeType, INodeTypeDescription, INodeOutputConfiguration, INodeInputConfiguration,
|
|
1
|
+
import type { IContextObject, INode, INodeCredentialDescription, INodeIssues, INodeParameters, INodeProperties, INodePropertyCollection, INodeType, IParameterDependencies, IRunExecutionData, IVersionedNodeType, INodeTypeDescription, INodeOutputConfiguration, INodeInputConfiguration, NodeConnectionType } from './Interfaces';
|
|
2
2
|
import type { Workflow } from './Workflow';
|
|
3
3
|
export declare const cronNodeOptions: INodePropertyCollection[];
|
|
4
4
|
export declare function isSubNodeType(typeDescription: Pick<INodeTypeDescription, 'outputs'> | null): boolean;
|
|
5
|
-
export declare function applyDeclarativeNodeOptionParameters(nodeType: INodeType): void;
|
|
6
5
|
export declare function displayParameter(nodeValues: INodeParameters, parameter: INodeProperties | INodeCredentialDescription, node: Pick<INode, 'typeVersion'> | null, nodeTypeDescription: INodeTypeDescription | null, nodeValuesRoot?: INodeParameters, displayKey?: 'displayOptions' | 'disabledOptions'): boolean;
|
|
7
6
|
export declare function displayParameterPath(nodeValues: INodeParameters, parameter: INodeProperties | INodeCredentialDescription, path: string, node: Pick<INode, 'typeVersion'> | null, nodeTypeDescription: INodeTypeDescription | null, displayKey?: 'displayOptions' | 'disabledOptions'): boolean;
|
|
8
7
|
export declare function getContext(runExecutionData: IRunExecutionData, type: string, node?: INode): IContextObject;
|
|
9
|
-
|
|
10
|
-
export type GetNodeParametersOptions = {
|
|
8
|
+
type GetNodeParametersOptions = {
|
|
11
9
|
onlySimpleTypes?: boolean;
|
|
12
10
|
dataIsResolved?: boolean;
|
|
13
11
|
nodeValuesRoot?: INodeParameters;
|
|
@@ -19,14 +17,8 @@ export declare function getNodeWebhookPath(workflowId: string, node: INode, path
|
|
|
19
17
|
export declare function getNodeWebhookUrl(baseUrl: string, workflowId: string, node: INode, path: string, isFullPath?: boolean): string;
|
|
20
18
|
export declare function getConnectionTypes(connections: Array<NodeConnectionType | INodeInputConfiguration | INodeOutputConfiguration>): NodeConnectionType[];
|
|
21
19
|
export declare function getNodeInputs(workflow: Workflow, node: INode, nodeTypeData: INodeTypeDescription): Array<NodeConnectionType | INodeInputConfiguration>;
|
|
22
|
-
export declare function getNodeHints(workflow: Workflow, node: INode, nodeTypeData: INodeTypeDescription, nodeInputData?: {
|
|
23
|
-
runExecutionData: IRunExecutionData | null;
|
|
24
|
-
runIndex: number;
|
|
25
|
-
connectionInputData: INodeExecutionData[];
|
|
26
|
-
}): NodeHint[];
|
|
27
20
|
export declare function getNodeOutputs(workflow: Workflow, node: INode, nodeTypeData: INodeTypeDescription): Array<NodeConnectionType | INodeOutputConfiguration>;
|
|
28
21
|
export declare function getNodeParametersIssues(nodePropertiesArray: INodeProperties[], node: INode, nodeTypeDescription: INodeTypeDescription | null, pinDataNodeNames?: string[]): INodeIssues | null;
|
|
29
|
-
export declare function nodeIssuesToString(issues: INodeIssues, node?: INode): string[];
|
|
30
22
|
export declare function getParameterValueByPath(nodeValues: INodeParameters, parameterName: string, path: string): import("./Interfaces").NodeParameterValueType;
|
|
31
23
|
export declare function getParameterIssues(nodeProperties: INodeProperties, nodeValues: INodeParameters, path: string, node: INode, nodeTypeDescription: INodeTypeDescription | null): INodeIssues;
|
|
32
24
|
export declare function mergeIssues(destination: INodeIssues, source: INodeIssues | null): void;
|
|
@@ -34,3 +26,4 @@ export declare function mergeNodeProperties(mainProperties: INodeProperties[], a
|
|
|
34
26
|
export declare function getVersionedNodeType(object: IVersionedNodeType | INodeType, version?: number): INodeType;
|
|
35
27
|
export declare function isTriggerNode(nodeTypeData: INodeTypeDescription): boolean;
|
|
36
28
|
export declare function isExecutable(workflow: Workflow, node: INode, nodeTypeData: INodeTypeDescription): boolean;
|
|
29
|
+
export {};
|
package/dist/NodeHelpers.js
CHANGED
|
@@ -5,20 +5,16 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.cronNodeOptions = void 0;
|
|
7
7
|
exports.isSubNodeType = isSubNodeType;
|
|
8
|
-
exports.applyDeclarativeNodeOptionParameters = applyDeclarativeNodeOptionParameters;
|
|
9
8
|
exports.displayParameter = displayParameter;
|
|
10
9
|
exports.displayParameterPath = displayParameterPath;
|
|
11
10
|
exports.getContext = getContext;
|
|
12
|
-
exports.getParameterResolveOrder = getParameterResolveOrder;
|
|
13
11
|
exports.getNodeParameters = getNodeParameters;
|
|
14
12
|
exports.getNodeWebhookPath = getNodeWebhookPath;
|
|
15
13
|
exports.getNodeWebhookUrl = getNodeWebhookUrl;
|
|
16
14
|
exports.getConnectionTypes = getConnectionTypes;
|
|
17
15
|
exports.getNodeInputs = getNodeInputs;
|
|
18
|
-
exports.getNodeHints = getNodeHints;
|
|
19
16
|
exports.getNodeOutputs = getNodeOutputs;
|
|
20
17
|
exports.getNodeParametersIssues = getNodeParametersIssues;
|
|
21
|
-
exports.nodeIssuesToString = nodeIssuesToString;
|
|
22
18
|
exports.getParameterValueByPath = getParameterValueByPath;
|
|
23
19
|
exports.getParameterIssues = getParameterIssues;
|
|
24
20
|
exports.mergeIssues = mergeIssues;
|
|
@@ -219,82 +215,6 @@ exports.cronNodeOptions = [
|
|
|
219
215
|
],
|
|
220
216
|
},
|
|
221
217
|
];
|
|
222
|
-
const declarativeNodeOptionParameters = {
|
|
223
|
-
displayName: 'Request Options',
|
|
224
|
-
name: 'requestOptions',
|
|
225
|
-
type: 'collection',
|
|
226
|
-
isNodeSetting: true,
|
|
227
|
-
placeholder: 'Add Option',
|
|
228
|
-
default: {},
|
|
229
|
-
options: [
|
|
230
|
-
{
|
|
231
|
-
displayName: 'Batching',
|
|
232
|
-
name: 'batching',
|
|
233
|
-
placeholder: 'Add Batching',
|
|
234
|
-
type: 'fixedCollection',
|
|
235
|
-
typeOptions: {
|
|
236
|
-
multipleValues: false,
|
|
237
|
-
},
|
|
238
|
-
default: {
|
|
239
|
-
batch: {},
|
|
240
|
-
},
|
|
241
|
-
options: [
|
|
242
|
-
{
|
|
243
|
-
displayName: 'Batching',
|
|
244
|
-
name: 'batch',
|
|
245
|
-
values: [
|
|
246
|
-
{
|
|
247
|
-
displayName: 'Items per Batch',
|
|
248
|
-
name: 'batchSize',
|
|
249
|
-
type: 'number',
|
|
250
|
-
typeOptions: {
|
|
251
|
-
minValue: -1,
|
|
252
|
-
},
|
|
253
|
-
default: 50,
|
|
254
|
-
description: 'Input will be split in batches to throttle requests. -1 for disabled. 0 will be treated as 1.',
|
|
255
|
-
},
|
|
256
|
-
{
|
|
257
|
-
displayName: 'Batch Interval (ms)',
|
|
258
|
-
name: 'batchInterval',
|
|
259
|
-
type: 'number',
|
|
260
|
-
typeOptions: {
|
|
261
|
-
minValue: 0,
|
|
262
|
-
},
|
|
263
|
-
default: 1000,
|
|
264
|
-
description: 'Time (in milliseconds) between each batch of requests. 0 for disabled.',
|
|
265
|
-
},
|
|
266
|
-
],
|
|
267
|
-
},
|
|
268
|
-
],
|
|
269
|
-
},
|
|
270
|
-
{
|
|
271
|
-
displayName: 'Ignore SSL Issues (Insecure)',
|
|
272
|
-
name: 'allowUnauthorizedCerts',
|
|
273
|
-
type: 'boolean',
|
|
274
|
-
noDataExpression: true,
|
|
275
|
-
default: false,
|
|
276
|
-
description: 'Whether to accept the response even if SSL certificate validation is not possible',
|
|
277
|
-
},
|
|
278
|
-
{
|
|
279
|
-
displayName: 'Proxy',
|
|
280
|
-
name: 'proxy',
|
|
281
|
-
type: 'string',
|
|
282
|
-
default: '',
|
|
283
|
-
placeholder: 'e.g. http://myproxy:3128',
|
|
284
|
-
description: 'HTTP proxy to use. If authentication is required it can be defined as follow: http://username:password@myproxy:3128',
|
|
285
|
-
},
|
|
286
|
-
{
|
|
287
|
-
displayName: 'Timeout',
|
|
288
|
-
name: 'timeout',
|
|
289
|
-
type: 'number',
|
|
290
|
-
typeOptions: {
|
|
291
|
-
minValue: 1,
|
|
292
|
-
},
|
|
293
|
-
default: 10000,
|
|
294
|
-
description: 'Time in ms to wait for the server to send response headers (and start the response body) before aborting the request',
|
|
295
|
-
},
|
|
296
|
-
],
|
|
297
|
-
};
|
|
298
218
|
function isSubNodeType(typeDescription) {
|
|
299
219
|
if (!typeDescription?.outputs || typeof typeDescription.outputs === 'string') {
|
|
300
220
|
return false;
|
|
@@ -304,47 +224,6 @@ function isSubNodeType(typeDescription) {
|
|
|
304
224
|
? outputTypes.filter((output) => output !== Interfaces_1.NodeConnectionTypes.Main).length > 0
|
|
305
225
|
: false;
|
|
306
226
|
}
|
|
307
|
-
function applyDeclarativeNodeOptionParameters(nodeType) {
|
|
308
|
-
if (nodeType.execute ||
|
|
309
|
-
nodeType.trigger ||
|
|
310
|
-
nodeType.webhook ||
|
|
311
|
-
nodeType.description.polling ||
|
|
312
|
-
isSubNodeType(nodeType.description)) {
|
|
313
|
-
return;
|
|
314
|
-
}
|
|
315
|
-
const parameters = nodeType.description.properties;
|
|
316
|
-
if (!parameters) {
|
|
317
|
-
return;
|
|
318
|
-
}
|
|
319
|
-
const existingRequestOptionsIndex = parameters.findIndex((parameter) => parameter.name === 'requestOptions');
|
|
320
|
-
if (existingRequestOptionsIndex !== -1) {
|
|
321
|
-
parameters[existingRequestOptionsIndex] = {
|
|
322
|
-
...declarativeNodeOptionParameters,
|
|
323
|
-
options: [
|
|
324
|
-
...(declarativeNodeOptionParameters.options || []),
|
|
325
|
-
...(parameters[existingRequestOptionsIndex]?.options || []),
|
|
326
|
-
],
|
|
327
|
-
};
|
|
328
|
-
const options = parameters[existingRequestOptionsIndex]?.options;
|
|
329
|
-
if (options) {
|
|
330
|
-
options.sort((a, b) => {
|
|
331
|
-
if ('displayName' in a && 'displayName' in b) {
|
|
332
|
-
if (a.displayName < b.displayName) {
|
|
333
|
-
return -1;
|
|
334
|
-
}
|
|
335
|
-
if (a.displayName > b.displayName) {
|
|
336
|
-
return 1;
|
|
337
|
-
}
|
|
338
|
-
}
|
|
339
|
-
return 0;
|
|
340
|
-
});
|
|
341
|
-
}
|
|
342
|
-
}
|
|
343
|
-
else {
|
|
344
|
-
parameters.push(declarativeNodeOptionParameters);
|
|
345
|
-
}
|
|
346
|
-
return;
|
|
347
|
-
}
|
|
348
227
|
const getPropertyValues = (nodeValues, propertyName, node, nodeTypeDescription, nodeValuesRoot) => {
|
|
349
228
|
let value;
|
|
350
229
|
if (propertyName.charAt(0) === '/') {
|
|
@@ -802,42 +681,6 @@ function getNodeInputs(workflow, node, nodeTypeData) {
|
|
|
802
681
|
return [];
|
|
803
682
|
}
|
|
804
683
|
}
|
|
805
|
-
function getNodeHints(workflow, node, nodeTypeData, nodeInputData) {
|
|
806
|
-
const hints = [];
|
|
807
|
-
if (nodeTypeData?.hints?.length) {
|
|
808
|
-
for (const hint of nodeTypeData.hints) {
|
|
809
|
-
if (hint.displayCondition) {
|
|
810
|
-
try {
|
|
811
|
-
let display;
|
|
812
|
-
if (nodeInputData === undefined) {
|
|
813
|
-
display = (workflow.expression.getSimpleParameterValue(node, hint.displayCondition, 'internal', {}) || false);
|
|
814
|
-
}
|
|
815
|
-
else {
|
|
816
|
-
const { runExecutionData, runIndex, connectionInputData } = nodeInputData;
|
|
817
|
-
display = workflow.expression.getParameterValue(hint.displayCondition, runExecutionData ?? null, runIndex, 0, node.name, connectionInputData, 'manual', {});
|
|
818
|
-
}
|
|
819
|
-
if (typeof display === 'string' && display.trim() === 'true') {
|
|
820
|
-
display = true;
|
|
821
|
-
}
|
|
822
|
-
if (typeof display !== 'boolean') {
|
|
823
|
-
console.warn(`Condition was not resolved as boolean in '${node.name}' node for hint: `, hint.message);
|
|
824
|
-
continue;
|
|
825
|
-
}
|
|
826
|
-
if (display) {
|
|
827
|
-
hints.push(hint);
|
|
828
|
-
}
|
|
829
|
-
}
|
|
830
|
-
catch (e) {
|
|
831
|
-
console.warn(`Could not calculate display condition in '${node.name}' node for hint: `, hint.message);
|
|
832
|
-
}
|
|
833
|
-
}
|
|
834
|
-
else {
|
|
835
|
-
hints.push(hint);
|
|
836
|
-
}
|
|
837
|
-
}
|
|
838
|
-
}
|
|
839
|
-
return hints;
|
|
840
|
-
}
|
|
841
684
|
function getNodeOutputs(workflow, node, nodeTypeData) {
|
|
842
685
|
let outputs = [];
|
|
843
686
|
if (Array.isArray(nodeTypeData.outputs)) {
|
|
@@ -887,33 +730,6 @@ function getNodeParametersIssues(nodePropertiesArray, node, nodeTypeDescription,
|
|
|
887
730
|
}
|
|
888
731
|
return foundIssues;
|
|
889
732
|
}
|
|
890
|
-
function nodeIssuesToString(issues, node) {
|
|
891
|
-
const nodeIssues = [];
|
|
892
|
-
if (issues.execution !== undefined) {
|
|
893
|
-
nodeIssues.push('Execution Error.');
|
|
894
|
-
}
|
|
895
|
-
const objectProperties = ['parameters', 'credentials', 'input'];
|
|
896
|
-
let issueText;
|
|
897
|
-
let parameterName;
|
|
898
|
-
for (const propertyName of objectProperties) {
|
|
899
|
-
if (issues[propertyName] !== undefined) {
|
|
900
|
-
for (parameterName of Object.keys(issues[propertyName])) {
|
|
901
|
-
for (issueText of issues[propertyName][parameterName]) {
|
|
902
|
-
nodeIssues.push(issueText);
|
|
903
|
-
}
|
|
904
|
-
}
|
|
905
|
-
}
|
|
906
|
-
}
|
|
907
|
-
if (issues.typeUnknown !== undefined) {
|
|
908
|
-
if (node !== undefined) {
|
|
909
|
-
nodeIssues.push(`Node Type "${node.type}" is not known.`);
|
|
910
|
-
}
|
|
911
|
-
else {
|
|
912
|
-
nodeIssues.push('Node Type is not known.');
|
|
913
|
-
}
|
|
914
|
-
}
|
|
915
|
-
return nodeIssues;
|
|
916
|
-
}
|
|
917
733
|
const validateResourceLocatorParameter = (value, parameterMode) => {
|
|
918
734
|
const valueToValidate = value?.value?.toString() || '';
|
|
919
735
|
if (valueToValidate.startsWith('=')) {
|
|
@@ -1197,6 +1013,8 @@ function isTriggerNode(nodeTypeData) {
|
|
|
1197
1013
|
function isExecutable(workflow, node, nodeTypeData) {
|
|
1198
1014
|
const outputs = getNodeOutputs(workflow, node, nodeTypeData);
|
|
1199
1015
|
const outputNames = getConnectionTypes(outputs);
|
|
1200
|
-
return outputNames.includes(Interfaces_1.NodeConnectionTypes.Main) ||
|
|
1016
|
+
return (outputNames.includes(Interfaces_1.NodeConnectionTypes.Main) ||
|
|
1017
|
+
isTriggerNode(nodeTypeData) ||
|
|
1018
|
+
nodeTypeData.usableAsTool === true);
|
|
1201
1019
|
}
|
|
1202
1020
|
//# sourceMappingURL=NodeHelpers.js.map
|