n8n-core 1.69.0 → 1.71.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/BinaryData/BinaryData.service.js +17 -7
- package/dist/BinaryData/BinaryData.service.js.map +1 -1
- package/dist/CreateNodeAsTool.d.ts +6 -3
- package/dist/CreateNodeAsTool.js.map +1 -1
- package/dist/DirectoryLoader.js +17 -7
- package/dist/DirectoryLoader.js.map +1 -1
- package/dist/NodeExecuteFunctions.d.ts +18 -17
- package/dist/NodeExecuteFunctions.js +39 -759
- package/dist/NodeExecuteFunctions.js.map +1 -1
- package/dist/PartialExecutionUtils/DirectedGraph.d.ts +1 -0
- package/dist/PartialExecutionUtils/DirectedGraph.js +23 -8
- package/dist/PartialExecutionUtils/DirectedGraph.js.map +1 -1
- package/dist/PartialExecutionUtils/filterDisabledNodes.d.ts +2 -0
- package/dist/PartialExecutionUtils/filterDisabledNodes.js +16 -0
- package/dist/PartialExecutionUtils/filterDisabledNodes.js.map +1 -0
- package/dist/PartialExecutionUtils/findStartNodes.d.ts +2 -2
- package/dist/PartialExecutionUtils/findStartNodes.js +2 -2
- package/dist/PartialExecutionUtils/findStartNodes.js.map +1 -1
- package/dist/PartialExecutionUtils/findSubgraph.js +1 -8
- package/dist/PartialExecutionUtils/findSubgraph.js.map +1 -1
- package/dist/PartialExecutionUtils/findTriggerForPartialExecution.js +17 -7
- package/dist/PartialExecutionUtils/findTriggerForPartialExecution.js.map +1 -1
- package/dist/PartialExecutionUtils/getIncomingData.js +17 -7
- package/dist/PartialExecutionUtils/getIncomingData.js.map +1 -1
- package/dist/PartialExecutionUtils/handleCycles.js +17 -7
- package/dist/PartialExecutionUtils/handleCycles.js.map +1 -1
- package/dist/PartialExecutionUtils/index.d.ts +1 -0
- package/dist/PartialExecutionUtils/index.js +3 -1
- package/dist/PartialExecutionUtils/index.js.map +1 -1
- package/dist/PartialExecutionUtils/recreateNodeExecutionStack.js +17 -7
- package/dist/PartialExecutionUtils/recreateNodeExecutionStack.js.map +1 -1
- package/dist/WorkflowExecute.d.ts +1 -1
- package/dist/WorkflowExecute.js +34 -16
- package/dist/WorkflowExecute.js.map +1 -1
- package/dist/build.tsbuildinfo +1 -1
- package/dist/data-deduplication-service.js +17 -7
- package/dist/data-deduplication-service.js.map +1 -1
- package/dist/index.js +17 -7
- package/dist/index.js.map +1 -1
- package/dist/node-execution-context/base-execute-context.d.ts +29 -0
- package/dist/node-execution-context/base-execute-context.js +120 -0
- package/dist/node-execution-context/base-execute-context.js.map +1 -0
- package/dist/node-execution-context/execute-context.d.ts +20 -0
- package/dist/node-execution-context/execute-context.js +92 -0
- package/dist/node-execution-context/execute-context.js.map +1 -0
- package/dist/node-execution-context/execute-single-context.d.ts +5 -19
- package/dist/node-execution-context/execute-single-context.js +8 -56
- package/dist/node-execution-context/execute-single-context.js.map +1 -1
- package/dist/node-execution-context/helpers/binary-helpers.d.ts +0 -0
- package/dist/node-execution-context/helpers/binary-helpers.js +2 -0
- package/dist/node-execution-context/helpers/binary-helpers.js.map +1 -0
- package/dist/node-execution-context/hook-context.d.ts +1 -2
- package/dist/node-execution-context/hook-context.js +2 -9
- package/dist/node-execution-context/hook-context.js.map +1 -1
- package/dist/node-execution-context/index.d.ts +3 -0
- package/dist/node-execution-context/index.js +7 -1
- package/dist/node-execution-context/index.js.map +1 -1
- package/dist/node-execution-context/load-options-context.d.ts +0 -1
- package/dist/node-execution-context/load-options-context.js +1 -8
- package/dist/node-execution-context/load-options-context.js.map +1 -1
- package/dist/node-execution-context/node-execution-context.d.ts +11 -2
- package/dist/node-execution-context/node-execution-context.js +115 -1
- package/dist/node-execution-context/node-execution-context.js.map +1 -1
- package/dist/node-execution-context/poll-context.d.ts +1 -2
- package/dist/node-execution-context/poll-context.js +1 -8
- package/dist/node-execution-context/poll-context.js.map +1 -1
- package/dist/node-execution-context/supply-data-context.d.ts +14 -0
- package/dist/node-execution-context/supply-data-context.js +65 -0
- package/dist/node-execution-context/supply-data-context.js.map +1 -0
- package/dist/node-execution-context/trigger-context.d.ts +1 -2
- package/dist/node-execution-context/trigger-context.js +1 -8
- package/dist/node-execution-context/trigger-context.js.map +1 -1
- package/dist/node-execution-context/utils.d.ts +11 -0
- package/dist/node-execution-context/utils.js +275 -0
- package/dist/node-execution-context/utils.js.map +1 -0
- package/dist/node-execution-context/webhook-context.d.ts +1 -4
- package/dist/node-execution-context/webhook-context.js +12 -34
- package/dist/node-execution-context/webhook-context.js.map +1 -1
- package/package.json +5 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/node-execution-context/index.ts"],"names":[],"mappings":";;;AACA,mEAAgE;AAAvD,8HAAA,oBAAoB,OAAA;AAC7B,+CAA6C;AAApC,2GAAA,WAAW,OAAA;AACpB,+DAA4D;AAAnD,0HAAA,kBAAkB,OAAA;AAC3B,+CAA6C;AAApC,2GAAA,WAAW,OAAA;AACpB,qDAAmD;AAA1C,iHAAA,cAAc,OAAA;AACvB,qDAAmD;AAA1C,iHAAA,cAAc,OAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/node-execution-context/index.ts"],"names":[],"mappings":";;;AACA,qDAAmD;AAA1C,iHAAA,cAAc,OAAA;AACvB,mEAAgE;AAAvD,8HAAA,oBAAoB,OAAA;AAC7B,+CAA6C;AAApC,2GAAA,WAAW,OAAA;AACpB,+DAA4D;AAAnD,0HAAA,kBAAkB,OAAA;AAC3B,+CAA6C;AAApC,2GAAA,WAAW,OAAA;AACpB,6DAA0D;AAAjD,wHAAA,iBAAiB,OAAA;AAC1B,qDAAmD;AAA1C,iHAAA,cAAc,OAAA;AACvB,qDAAmD;AAA1C,iHAAA,cAAc,OAAA;AAEvB,iCAA4C;AAAnC,0GAAA,iBAAiB,OAAA"}
|
|
@@ -7,5 +7,4 @@ export declare class LoadOptionsContext extends NodeExecutionContext implements
|
|
|
7
7
|
getCredentials<T extends object = ICredentialDataDecryptedObject>(type: string): Promise<T>;
|
|
8
8
|
getCurrentNodeParameter(parameterPath: string, options?: IGetNodeParameterOptions): NodeParameterValueType | object | undefined;
|
|
9
9
|
getCurrentNodeParameters(): import("n8n-workflow").INodeParameters | undefined;
|
|
10
|
-
getNodeParameter(parameterName: string, fallbackValue?: any, options?: IGetNodeParameterOptions): NodeParameterValueType | object;
|
|
11
10
|
}
|
|
@@ -15,7 +15,7 @@ class LoadOptionsContext extends node_execution_context_1.NodeExecutionContext {
|
|
|
15
15
|
};
|
|
16
16
|
}
|
|
17
17
|
async getCredentials(type) {
|
|
18
|
-
return await
|
|
18
|
+
return await this._getCredentials(type);
|
|
19
19
|
}
|
|
20
20
|
getCurrentNodeParameter(parameterPath, options) {
|
|
21
21
|
const nodeParameters = this.additionalData.currentNodeParameters;
|
|
@@ -32,13 +32,6 @@ class LoadOptionsContext extends node_execution_context_1.NodeExecutionContext {
|
|
|
32
32
|
getCurrentNodeParameters() {
|
|
33
33
|
return this.additionalData.currentNodeParameters;
|
|
34
34
|
}
|
|
35
|
-
getNodeParameter(parameterName, fallbackValue, options) {
|
|
36
|
-
const runExecutionData = null;
|
|
37
|
-
const itemIndex = 0;
|
|
38
|
-
const runIndex = 0;
|
|
39
|
-
const connectionInputData = [];
|
|
40
|
-
return (0, NodeExecuteFunctions_1.getNodeParameter)(this.workflow, runExecutionData, runIndex, connectionInputData, this.node, parameterName, itemIndex, this.mode, (0, NodeExecuteFunctions_1.getAdditionalKeys)(this.additionalData, this.mode, runExecutionData), undefined, fallbackValue, options);
|
|
41
|
-
}
|
|
42
35
|
}
|
|
43
36
|
exports.LoadOptionsContext = LoadOptionsContext;
|
|
44
37
|
//# sourceMappingURL=load-options-context.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"load-options-context.js","sourceRoot":"","sources":["../../src/node-execution-context/load-options-context.ts"],"names":[],"mappings":";;;AAAA,mCAA6B;
|
|
1
|
+
{"version":3,"file":"load-options-context.js","sourceRoot":"","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B,CAAC;YACF,UAAU,GAAG,IAAA,2BAAY,EACxB,UAAU,EACV,aAAa,EACb,IAAI,CAAC,IAAI,EACT,QAAQ,CACkB,CAAC;QAC7B,CAAC;QAED,OAAO,UAAU,CAAC;IACnB,CAAC;IAED,wBAAwB;QACvB,OAAO,IAAI,CAAC,cAAc,CAAC,qBAAqB,CAAC;IAClD,CAAC;CACD;AArDD,gDAqDC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { FunctionsBase, INode, INodeExecutionData, IWorkflowExecuteAdditionalData, NodeTypeAndVersion, Workflow, WorkflowExecuteMode } from 'n8n-workflow';
|
|
1
|
+
import type { FunctionsBase, ICredentialDataDecryptedObject, IExecuteData, IGetNodeParameterOptions, INode, INodeExecutionData, IRunExecutionData, IWorkflowExecuteAdditionalData, NodeParameterValueType, NodeTypeAndVersion, Workflow, WorkflowExecuteMode } from 'n8n-workflow';
|
|
2
2
|
import { LoggerProxy } from 'n8n-workflow';
|
|
3
3
|
import { InstanceSettings } from '../InstanceSettings';
|
|
4
4
|
export declare abstract class NodeExecutionContext implements Omit<FunctionsBase, 'getCredentials'> {
|
|
@@ -6,8 +6,12 @@ export declare abstract class NodeExecutionContext implements Omit<FunctionsBase
|
|
|
6
6
|
protected readonly node: INode;
|
|
7
7
|
protected readonly additionalData: IWorkflowExecuteAdditionalData;
|
|
8
8
|
protected readonly mode: WorkflowExecuteMode;
|
|
9
|
+
protected readonly runExecutionData: IRunExecutionData | null;
|
|
10
|
+
protected readonly runIndex: number;
|
|
11
|
+
protected readonly connectionInputData: INodeExecutionData[];
|
|
12
|
+
protected readonly executeData?: IExecuteData | undefined;
|
|
9
13
|
protected readonly instanceSettings: InstanceSettings;
|
|
10
|
-
constructor(workflow: Workflow, node: INode, additionalData: IWorkflowExecuteAdditionalData, mode: WorkflowExecuteMode);
|
|
14
|
+
constructor(workflow: Workflow, node: INode, additionalData: IWorkflowExecuteAdditionalData, mode: WorkflowExecuteMode, runExecutionData?: IRunExecutionData | null, runIndex?: number, connectionInputData?: INodeExecutionData[], executeData?: IExecuteData | undefined);
|
|
11
15
|
get logger(): typeof LoggerProxy;
|
|
12
16
|
getExecutionId(): string;
|
|
13
17
|
getNode(): INode;
|
|
@@ -26,5 +30,10 @@ export declare abstract class NodeExecutionContext implements Omit<FunctionsBase
|
|
|
26
30
|
getInstanceId(): string;
|
|
27
31
|
getTimezone(): string;
|
|
28
32
|
getCredentialsProperties(type: string): import("n8n-workflow").INodeProperties[];
|
|
33
|
+
protected _getCredentials<T extends object = ICredentialDataDecryptedObject>(type: string, executeData?: IExecuteData, connectionInputData?: INodeExecutionData[], itemIndex?: number): Promise<T>;
|
|
34
|
+
protected get additionalKeys(): import("n8n-workflow").IDataObject;
|
|
35
|
+
getNodeParameter(parameterName: string, fallbackValue?: any, options?: IGetNodeParameterOptions): NodeParameterValueType | object;
|
|
36
|
+
protected _getNodeParameter(parameterName: string, itemIndex: number, fallbackValue?: any, options?: IGetNodeParameterOptions): NodeParameterValueType | object;
|
|
37
|
+
evaluateExpression(expression: string, itemIndex?: number): import("n8n-workflow").NodeParameterValue | import("n8n-workflow").INodeParameters | import("n8n-workflow").INodeParameters[] | import("n8n-workflow").NodeParameterValue[];
|
|
29
38
|
prepareOutputData(outputData: INodeExecutionData[]): Promise<INodeExecutionData[][]>;
|
|
30
39
|
}
|
|
@@ -1,15 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.NodeExecutionContext = void 0;
|
|
4
|
+
const lodash_1 = require("lodash");
|
|
4
5
|
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
6
|
const typedi_1 = require("typedi");
|
|
7
|
+
const Constants_1 = require("../Constants");
|
|
8
|
+
const ExtractValue_1 = require("../ExtractValue");
|
|
6
9
|
const InstanceSettings_1 = require("../InstanceSettings");
|
|
10
|
+
const utils_1 = require("./utils");
|
|
7
11
|
class NodeExecutionContext {
|
|
8
|
-
constructor(workflow, node, additionalData, mode) {
|
|
12
|
+
constructor(workflow, node, additionalData, mode, runExecutionData = null, runIndex = 0, connectionInputData = [], executeData) {
|
|
9
13
|
this.workflow = workflow;
|
|
10
14
|
this.node = node;
|
|
11
15
|
this.additionalData = additionalData;
|
|
12
16
|
this.mode = mode;
|
|
17
|
+
this.runExecutionData = runExecutionData;
|
|
18
|
+
this.runIndex = runIndex;
|
|
19
|
+
this.connectionInputData = connectionInputData;
|
|
20
|
+
this.executeData = executeData;
|
|
13
21
|
this.instanceSettings = typedi_1.Container.get(InstanceSettings_1.InstanceSettings);
|
|
14
22
|
}
|
|
15
23
|
get logger() {
|
|
@@ -75,6 +83,112 @@ class NodeExecutionContext {
|
|
|
75
83
|
getCredentialsProperties(type) {
|
|
76
84
|
return this.additionalData.credentialsHelper.getCredentialsProperties(type);
|
|
77
85
|
}
|
|
86
|
+
async _getCredentials(type, executeData, connectionInputData, itemIndex) {
|
|
87
|
+
const { workflow, node, additionalData, mode, runExecutionData, runIndex } = this;
|
|
88
|
+
const nodeType = workflow.nodeTypes.getByNameAndVersion(node.type, node.typeVersion);
|
|
89
|
+
const fullAccess = [Constants_1.HTTP_REQUEST_NODE_TYPE, Constants_1.HTTP_REQUEST_TOOL_NODE_TYPE].includes(node.type);
|
|
90
|
+
let nodeCredentialDescription;
|
|
91
|
+
if (!fullAccess) {
|
|
92
|
+
if (nodeType.description.credentials === undefined) {
|
|
93
|
+
throw new n8n_workflow_1.NodeOperationError(node, `Node type "${node.type}" does not have any credentials defined`, { level: 'warning' });
|
|
94
|
+
}
|
|
95
|
+
nodeCredentialDescription = nodeType.description.credentials.find((credentialTypeDescription) => credentialTypeDescription.name === type);
|
|
96
|
+
if (nodeCredentialDescription === undefined) {
|
|
97
|
+
throw new n8n_workflow_1.NodeOperationError(node, `Node type "${node.type}" does not have any credentials of type "${type}" defined`, { level: 'warning' });
|
|
98
|
+
}
|
|
99
|
+
if (!n8n_workflow_1.NodeHelpers.displayParameter(additionalData.currentNodeParameters || node.parameters, nodeCredentialDescription, node, node.parameters)) {
|
|
100
|
+
throw new n8n_workflow_1.NodeOperationError(node, 'Credentials not found');
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
if (!fullAccess && !node.credentials?.[type]) {
|
|
104
|
+
if (nodeCredentialDescription?.required === true) {
|
|
105
|
+
if (!node.credentials) {
|
|
106
|
+
throw new n8n_workflow_1.NodeOperationError(node, 'Node does not have any credentials set', {
|
|
107
|
+
level: 'warning',
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
if (!node.credentials[type]) {
|
|
111
|
+
throw new n8n_workflow_1.NodeOperationError(node, `Node does not have any credentials set for "${type}"`, {
|
|
112
|
+
level: 'warning',
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
else {
|
|
117
|
+
throw new n8n_workflow_1.NodeOperationError(node, 'Node does not require credentials');
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
if (fullAccess && !node.credentials?.[type]) {
|
|
121
|
+
throw new n8n_workflow_1.NodeOperationError(node, 'Credentials not found');
|
|
122
|
+
}
|
|
123
|
+
let expressionResolveValues;
|
|
124
|
+
if (connectionInputData && runExecutionData && runIndex !== undefined) {
|
|
125
|
+
expressionResolveValues = {
|
|
126
|
+
connectionInputData,
|
|
127
|
+
itemIndex: itemIndex || 0,
|
|
128
|
+
node,
|
|
129
|
+
runExecutionData,
|
|
130
|
+
runIndex,
|
|
131
|
+
workflow,
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
const nodeCredentials = node.credentials
|
|
135
|
+
? node.credentials[type]
|
|
136
|
+
: {};
|
|
137
|
+
const decryptedDataObject = await additionalData.credentialsHelper.getDecrypted(additionalData, nodeCredentials, type, mode, executeData, false, expressionResolveValues);
|
|
138
|
+
return decryptedDataObject;
|
|
139
|
+
}
|
|
140
|
+
get additionalKeys() {
|
|
141
|
+
return (0, utils_1.getAdditionalKeys)(this.additionalData, this.mode, this.runExecutionData);
|
|
142
|
+
}
|
|
143
|
+
getNodeParameter(parameterName, fallbackValue, options) {
|
|
144
|
+
const itemIndex = 0;
|
|
145
|
+
return this._getNodeParameter(parameterName, itemIndex, fallbackValue, options);
|
|
146
|
+
}
|
|
147
|
+
_getNodeParameter(parameterName, itemIndex, fallbackValue, options) {
|
|
148
|
+
const { workflow, node, mode, runExecutionData, runIndex, connectionInputData, executeData } = this;
|
|
149
|
+
const nodeType = workflow.nodeTypes.getByNameAndVersion(node.type, node.typeVersion);
|
|
150
|
+
const value = (0, lodash_1.get)(node.parameters, parameterName, fallbackValue);
|
|
151
|
+
if (value === undefined) {
|
|
152
|
+
throw new n8n_workflow_1.ApplicationError('Could not get parameter', { extra: { parameterName } });
|
|
153
|
+
}
|
|
154
|
+
if (options?.rawExpressions) {
|
|
155
|
+
return value;
|
|
156
|
+
}
|
|
157
|
+
const { additionalKeys } = this;
|
|
158
|
+
let returnData;
|
|
159
|
+
try {
|
|
160
|
+
returnData = workflow.expression.getParameterValue(value, runExecutionData, runIndex, itemIndex, node.name, connectionInputData, mode, additionalKeys, executeData, false, {}, options?.contextNode?.name);
|
|
161
|
+
(0, utils_1.cleanupParameterData)(returnData);
|
|
162
|
+
}
|
|
163
|
+
catch (e) {
|
|
164
|
+
if (e instanceof n8n_workflow_1.ExpressionError &&
|
|
165
|
+
node.continueOnFail &&
|
|
166
|
+
node.type === 'n8n-nodes-base.set') {
|
|
167
|
+
returnData = [{ name: undefined, value: undefined }];
|
|
168
|
+
}
|
|
169
|
+
else {
|
|
170
|
+
if (e.context)
|
|
171
|
+
e.context.parameter = parameterName;
|
|
172
|
+
e.cause = value;
|
|
173
|
+
throw e;
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
if (options?.extractValue) {
|
|
177
|
+
returnData = (0, ExtractValue_1.extractValue)(returnData, parameterName, node, nodeType, itemIndex);
|
|
178
|
+
}
|
|
179
|
+
if (options?.ensureType) {
|
|
180
|
+
returnData = (0, utils_1.ensureType)(options.ensureType, returnData, parameterName, {
|
|
181
|
+
itemIndex,
|
|
182
|
+
runIndex,
|
|
183
|
+
nodeCause: node.name,
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
returnData = (0, utils_1.validateValueAgainstSchema)(node, nodeType, returnData, parameterName, runIndex, itemIndex);
|
|
187
|
+
return returnData;
|
|
188
|
+
}
|
|
189
|
+
evaluateExpression(expression, itemIndex = 0) {
|
|
190
|
+
return this.workflow.expression.resolveSimpleParameterValue(`=${expression}`, {}, this.runExecutionData, this.runIndex, itemIndex, this.node.name, this.connectionInputData, this.mode, this.additionalKeys, this.executeData);
|
|
191
|
+
}
|
|
78
192
|
async prepareOutputData(outputData) {
|
|
79
193
|
return [outputData];
|
|
80
194
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node-execution-context.js","sourceRoot":"","sources":["../../src/node-execution-context/node-execution-context.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"node-execution-context.js","sourceRoot":"","sources":["../../src/node-execution-context/node-execution-context.ts"],"names":[],"mappings":";;;AAAA,mCAA6B;AAkB7B,+CAOsB;AACtB,mCAAmC;AAEnC,2CAAkF;AAClF,iDAA8C;AAC9C,yDAAsD;AAEtD,mCAKiB;AAEjB,MAAsB,oBAAoB;IAGzC,YACoB,QAAkB,EAClB,IAAW,EACX,cAA8C,EAC9C,IAAyB,EACzB,mBAA6C,IAAI,EACjD,WAAW,CAAC,EACZ,sBAA4C,EAAE,EAC9C,WAA0B;QAP1B,aAAQ,GAAR,QAAQ,CAAU;QAClB,SAAI,GAAJ,IAAI,CAAO;QACX,mBAAc,GAAd,cAAc,CAAgC;QAC9C,SAAI,GAAJ,IAAI,CAAqB;QACzB,qBAAgB,GAAhB,gBAAgB,CAAiC;QACjD,aAAQ,GAAR,QAAQ,CAAI;QACZ,wBAAmB,GAAnB,mBAAmB,CAA2B;QAC9C,gBAAW,GAAX,WAAW,CAAe;QAV3B,qBAAgB,GAAG,kBAAS,CA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CAChB,CAAC;IACH,CAAC;IAED,KAAK,CAAC,iBAAiB,CAAC,UAAgC;QACvD,OAAO,CAAC,UAAU,CAAC,CAAC;IACrB,CAAC;CACD;AAzVD,oDAyVC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ICredentialDataDecryptedObject,
|
|
1
|
+
import type { ICredentialDataDecryptedObject, INode, IPollFunctions, IWorkflowExecuteAdditionalData, Workflow, WorkflowActivateMode, WorkflowExecuteMode } from 'n8n-workflow';
|
|
2
2
|
import { NodeExecutionContext } from './node-execution-context';
|
|
3
3
|
export declare class PollContext extends NodeExecutionContext implements IPollFunctions {
|
|
4
4
|
private readonly activation;
|
|
@@ -8,5 +8,4 @@ export declare class PollContext extends NodeExecutionContext implements IPollFu
|
|
|
8
8
|
constructor(workflow: Workflow, node: INode, additionalData: IWorkflowExecuteAdditionalData, mode: WorkflowExecuteMode, activation: WorkflowActivateMode, __emit?: IPollFunctions['__emit'], __emitError?: IPollFunctions['__emitError']);
|
|
9
9
|
getActivationMode(): WorkflowActivateMode;
|
|
10
10
|
getCredentials<T extends object = ICredentialDataDecryptedObject>(type: string): Promise<T>;
|
|
11
|
-
getNodeParameter(parameterName: string, fallbackValue?: any, options?: IGetNodeParameterOptions): NodeParameterValueType | object;
|
|
12
11
|
}
|
|
@@ -28,14 +28,7 @@ class PollContext extends node_execution_context_1.NodeExecutionContext {
|
|
|
28
28
|
return this.activation;
|
|
29
29
|
}
|
|
30
30
|
async getCredentials(type) {
|
|
31
|
-
return await
|
|
32
|
-
}
|
|
33
|
-
getNodeParameter(parameterName, fallbackValue, options) {
|
|
34
|
-
const runExecutionData = null;
|
|
35
|
-
const itemIndex = 0;
|
|
36
|
-
const runIndex = 0;
|
|
37
|
-
const connectionInputData = [];
|
|
38
|
-
return (0, NodeExecuteFunctions_1.getNodeParameter)(this.workflow, runExecutionData, runIndex, connectionInputData, this.node, parameterName, itemIndex, this.mode, (0, NodeExecuteFunctions_1.getAdditionalKeys)(this.additionalData, this.mode, runExecutionData), undefined, fallbackValue, options);
|
|
31
|
+
return await this._getCredentials(type);
|
|
39
32
|
}
|
|
40
33
|
}
|
|
41
34
|
exports.PollContext = PollContext;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"poll-context.js","sourceRoot":"","sources":["../../src/node-execution-context/poll-context.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"poll-context.js","sourceRoot":"","sources":["../../src/node-execution-context/poll-context.ts"],"names":[],"mappings":";;;AASA,+CAAuE;AAGvE,iEAKgC;AAEhC,qEAAgE;AAEhE,MAAM,WAAW,GAAG,GAAG,EAAE;IACxB,MAAM,IAAI,+BAAgB,CAAC,uCAAuC,CAAC,CAAC;AACrE,CAAC,CAAC;AAEF,MAAM,gBAAgB,GAAG,GAAG,EAAE;IAC7B,MAAM,IAAI,+BAAgB,CAAC,4CAA4C,CAAC,CAAC;AAC1E,CAAC,CAAC;AAEF,MAAa,WAAY,SAAQ,6CAAoB;IAGpD,YACC,QAAkB,EAClB,IAAW,EACX,cAA8C,EAC9C,IAAyB,EACR,UAAgC,EACxC,SAAmC,WAAW,EAC9C,cAA6C,gBAAgB;QAEtE,KAAK,CAAC,QAAQ,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,CAAC,CAAC;QAJ3B,eAAU,GAAV,UAAU,CAAsB;QACxC,WAAM,GAAN,MAAM,CAAwC;QAC9C,gBAAW,GAAX,WAAW,CAAkD;QAItE,IAAI,CAAC,OAAO,GAAG;YACd,qBAAqB,EAArB,oCAAqB;YACrB,eAAe,EAAf,sCAAe;YACf,GAAG,IAAA,gDAAyB,EAAC,QAAQ,EAAE,IAAI,EAAE,cAAc,CAAC;YAC5D,GAAG,IAAA,+CAAwB,EAAC,cAAc,EAAE,QAAQ,CAAC,EAAE,CAAC;YACxD,GAAG,IAAA,6CAAsB,EAAC,QAAQ,CAAC;SACnC,CAAC;IACH,CAAC;IAED,iBAAiB;QAChB,OAAO,IAAI,CAAC,UAAU,CAAC;IACxB,CAAC;IAED,KAAK,CAAC,cAAc,CAAoD,IAAY;QACnF,OAAO,MAAM,IAAI,CAAC,eAAe,CAAI,IAAI,CAAC,CAAC;IAC5C,CAAC;CACD;AA9BD,kCA8BC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { CloseFunction, IExecuteData, INode, INodeExecutionData, IRunExecutionData, ISupplyDataFunctions, ITaskDataConnections, ITaskMetadata, IWorkflowExecuteAdditionalData, NodeConnectionType, Workflow, WorkflowExecuteMode } from 'n8n-workflow';
|
|
2
|
+
import { BaseExecuteContext } from './base-execute-context';
|
|
3
|
+
export declare class SupplyDataContext extends BaseExecuteContext implements ISupplyDataFunctions {
|
|
4
|
+
private readonly closeFunctions;
|
|
5
|
+
readonly helpers: ISupplyDataFunctions['helpers'];
|
|
6
|
+
readonly getNodeParameter: ISupplyDataFunctions['getNodeParameter'];
|
|
7
|
+
constructor(workflow: Workflow, node: INode, additionalData: IWorkflowExecuteAdditionalData, mode: WorkflowExecuteMode, runExecutionData: IRunExecutionData, runIndex: number, connectionInputData: INodeExecutionData[], inputData: ITaskDataConnections, executeData: IExecuteData, closeFunctions: CloseFunction[], abortSignal?: AbortSignal);
|
|
8
|
+
getInputConnectionData(inputName: NodeConnectionType, itemIndex: number): Promise<unknown>;
|
|
9
|
+
getInputData(inputIndex?: number, inputName?: string): INodeExecutionData[];
|
|
10
|
+
addInputData(connectionType: NodeConnectionType, data: INodeExecutionData[][]): {
|
|
11
|
+
index: number;
|
|
12
|
+
};
|
|
13
|
+
addOutputData(connectionType: NodeConnectionType, currentNodeRunIndex: number, data: INodeExecutionData[][], metadata?: ITaskMetadata): void;
|
|
14
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SupplyDataContext = void 0;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const NodeExecuteFunctions_1 = require("../NodeExecuteFunctions");
|
|
6
|
+
const base_execute_context_1 = require("./base-execute-context");
|
|
7
|
+
class SupplyDataContext extends base_execute_context_1.BaseExecuteContext {
|
|
8
|
+
constructor(workflow, node, additionalData, mode, runExecutionData, runIndex, connectionInputData, inputData, executeData, closeFunctions, abortSignal) {
|
|
9
|
+
super(workflow, node, additionalData, mode, runExecutionData, runIndex, connectionInputData, inputData, executeData, abortSignal);
|
|
10
|
+
this.closeFunctions = closeFunctions;
|
|
11
|
+
this.helpers = {
|
|
12
|
+
createDeferredPromise: n8n_workflow_1.createDeferredPromise,
|
|
13
|
+
copyInputItems: NodeExecuteFunctions_1.copyInputItems,
|
|
14
|
+
...(0, NodeExecuteFunctions_1.getRequestHelperFunctions)(workflow, node, additionalData, runExecutionData, connectionInputData),
|
|
15
|
+
...(0, NodeExecuteFunctions_1.getSSHTunnelFunctions)(),
|
|
16
|
+
...(0, NodeExecuteFunctions_1.getFileSystemHelperFunctions)(node),
|
|
17
|
+
...(0, NodeExecuteFunctions_1.getBinaryHelperFunctions)(additionalData, workflow.id),
|
|
18
|
+
...(0, NodeExecuteFunctions_1.getCheckProcessedHelperFunctions)(workflow, node),
|
|
19
|
+
assertBinaryData: (itemIndex, propertyName) => (0, NodeExecuteFunctions_1.assertBinaryData)(inputData, node, itemIndex, propertyName, 0),
|
|
20
|
+
getBinaryDataBuffer: async (itemIndex, propertyName) => await (0, NodeExecuteFunctions_1.getBinaryDataBuffer)(inputData, itemIndex, propertyName, 0),
|
|
21
|
+
returnJsonArray: NodeExecuteFunctions_1.returnJsonArray,
|
|
22
|
+
normalizeItems: NodeExecuteFunctions_1.normalizeItems,
|
|
23
|
+
constructExecutionMetaData: NodeExecuteFunctions_1.constructExecutionMetaData,
|
|
24
|
+
};
|
|
25
|
+
this.getNodeParameter = ((parameterName, itemIndex, fallbackValue, options) => this._getNodeParameter(parameterName, itemIndex, fallbackValue, options));
|
|
26
|
+
}
|
|
27
|
+
async getInputConnectionData(inputName, itemIndex) {
|
|
28
|
+
return await NodeExecuteFunctions_1.getInputConnectionData.call(this, this.workflow, this.runExecutionData, this.runIndex, this.connectionInputData, this.inputData, this.additionalData, this.executeData, this.mode, this.closeFunctions, inputName, itemIndex, this.abortSignal);
|
|
29
|
+
}
|
|
30
|
+
getInputData(inputIndex = 0, inputName = 'main') {
|
|
31
|
+
if (!this.inputData.hasOwnProperty(inputName)) {
|
|
32
|
+
return [];
|
|
33
|
+
}
|
|
34
|
+
if (this.inputData[inputName].length < inputIndex) {
|
|
35
|
+
throw new n8n_workflow_1.ApplicationError('Could not get input with given index', {
|
|
36
|
+
extra: { inputIndex, inputName },
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
if (this.inputData[inputName][inputIndex] === null) {
|
|
40
|
+
throw new n8n_workflow_1.ApplicationError('Value of input was not set', {
|
|
41
|
+
extra: { inputIndex, inputName },
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
return this.inputData[inputName][inputIndex];
|
|
45
|
+
}
|
|
46
|
+
addInputData(connectionType, data) {
|
|
47
|
+
const nodeName = this.node.name;
|
|
48
|
+
let currentNodeRunIndex = 0;
|
|
49
|
+
if (this.runExecutionData.resultData.runData.hasOwnProperty(nodeName)) {
|
|
50
|
+
currentNodeRunIndex = this.runExecutionData.resultData.runData[nodeName].length;
|
|
51
|
+
}
|
|
52
|
+
(0, NodeExecuteFunctions_1.addExecutionDataFunctions)('input', nodeName, data, this.runExecutionData, connectionType, this.additionalData, nodeName, this.runIndex, currentNodeRunIndex).catch((error) => {
|
|
53
|
+
this.logger.warn(`There was a problem logging input data of node "${nodeName}": ${error.message}`);
|
|
54
|
+
});
|
|
55
|
+
return { index: currentNodeRunIndex };
|
|
56
|
+
}
|
|
57
|
+
addOutputData(connectionType, currentNodeRunIndex, data, metadata) {
|
|
58
|
+
const nodeName = this.node.name;
|
|
59
|
+
(0, NodeExecuteFunctions_1.addExecutionDataFunctions)('output', nodeName, data, this.runExecutionData, connectionType, this.additionalData, nodeName, this.runIndex, currentNodeRunIndex, metadata).catch((error) => {
|
|
60
|
+
this.logger.warn(`There was a problem logging output data of node "${nodeName}": ${error.message}`);
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
exports.SupplyDataContext = SupplyDataContext;
|
|
65
|
+
//# sourceMappingURL=supply-data-context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"supply-data-context.js","sourceRoot":"","sources":["../../src/node-execution-context/supply-data-context.ts"],"names":[],"mappings":";;;AAeA,+CAAuE;AAGvE,iEAcgC;AAEhC,iEAA4D;AAE5D,MAAa,iBAAkB,SAAQ,yCAAkB;IAKxD,YACC,QAAkB,EAClB,IAAW,EACX,cAA8C,EAC9C,IAAyB,EACzB,gBAAmC,EACnC,QAAgB,EAChB,mBAAyC,EACzC,SAA+B,EAC/B,WAAyB,EACR,cAA+B,EAChD,WAAyB;QAEzB,KAAK,CACJ,QAAQ,EACR,IAAI,EACJ,cAAc,EACd,IAAI,EACJ,gBAAgB,EAChB,QAAQ,EACR,mBAAmB,EACnB,SAAS,EACT,WAAW,EACX,WAAW,CACX,CAAC;QAde,mBAAc,GAAd,cAAc,CAAiB;QAgBhD,IAAI,CAAC,OAAO,GAAG;YACd,qBAAqB,EAArB,oCAAqB;YACrB,cAAc,EAAd,qCAAc;YACd,GAAG,IAAA,gDAAyB,EAC3B,QAAQ,EACR,IAAI,EACJ,cAAc,EACd,gBAAgB,EAChB,mBAAmB,CACnB;YACD,GAAG,IAAA,4CAAqB,GAAE;YAC1B,GAAG,IAAA,mDAA4B,EAAC,IAAI,CAAC;YACrC,GAAG,IAAA,+CAAwB,EAAC,cAAc,EAAE,QAAQ,CAAC,EAAE,CAAC;YACxD,GAAG,IAAA,uDAAgC,EAAC,QAAQ,EAAE,IAAI,CAAC;YACnD,gBAAgB,EAAE,CAAC,SAAS,EAAE,YAAY,EAAE,EAAE,CAC7C,IAAA,uCAAgB,EAAC,SAAS,E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AyB,EACxB,QAAQ,EACR,QAAQ,EACR,IAAI,EACJ,IAAI,CAAC,gBAAgB,EACrB,cAAc,EACd,IAAI,CAAC,cAAc,EACnB,QAAQ,EACR,IAAI,CAAC,QAAQ,EACb,mBAAmB,EACnB,QAAQ,CACR,CAAC,KAAK,CAAC,CAAC,KAAK,EAAE,EAAE;YACjB,IAAI,CAAC,MAAM,CAAC,IAAI,CACf,oDAAoD,QAAQ,MAE3D,KAAK,CAAC,OACP,EAAE,CACF,CAAC;QACH,CAAC,CAAC,CAAC;IACJ,CAAC;CACD;AAzKD,8CAyKC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ICredentialDataDecryptedObject,
|
|
1
|
+
import type { ICredentialDataDecryptedObject, INode, ITriggerFunctions, IWorkflowExecuteAdditionalData, Workflow, WorkflowActivateMode, WorkflowExecuteMode } from 'n8n-workflow';
|
|
2
2
|
import { NodeExecutionContext } from './node-execution-context';
|
|
3
3
|
export declare class TriggerContext extends NodeExecutionContext implements ITriggerFunctions {
|
|
4
4
|
private readonly activation;
|
|
@@ -8,5 +8,4 @@ export declare class TriggerContext extends NodeExecutionContext implements ITri
|
|
|
8
8
|
constructor(workflow: Workflow, node: INode, additionalData: IWorkflowExecuteAdditionalData, mode: WorkflowExecuteMode, activation: WorkflowActivateMode, emit?: ITriggerFunctions['emit'], emitError?: ITriggerFunctions['emitError']);
|
|
9
9
|
getActivationMode(): WorkflowActivateMode;
|
|
10
10
|
getCredentials<T extends object = ICredentialDataDecryptedObject>(type: string): Promise<T>;
|
|
11
|
-
getNodeParameter(parameterName: string, fallbackValue?: any, options?: IGetNodeParameterOptions): NodeParameterValueType | object;
|
|
12
11
|
}
|
|
@@ -29,14 +29,7 @@ class TriggerContext extends node_execution_context_1.NodeExecutionContext {
|
|
|
29
29
|
return this.activation;
|
|
30
30
|
}
|
|
31
31
|
async getCredentials(type) {
|
|
32
|
-
return await
|
|
33
|
-
}
|
|
34
|
-
getNodeParameter(parameterName, fallbackValue, options) {
|
|
35
|
-
const runExecutionData = null;
|
|
36
|
-
const itemIndex = 0;
|
|
37
|
-
const runIndex = 0;
|
|
38
|
-
const connectionInputData = [];
|
|
39
|
-
return (0, NodeExecuteFunctions_1.getNodeParameter)(this.workflow, runExecutionData, runIndex, connectionInputData, this.node, parameterName, itemIndex, this.mode, (0, NodeExecuteFunctions_1.getAdditionalKeys)(this.additionalData, this.mode, runExecutionData), undefined, fallbackValue, options);
|
|
32
|
+
return await this._getCredentials(type);
|
|
40
33
|
}
|
|
41
34
|
}
|
|
42
35
|
exports.TriggerContext = TriggerContext;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"trigger-context.js","sourceRoot":"","sources":["../../src/node-execution-context/trigger-context.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"trigger-context.js","sourceRoot":"","sources":["../../src/node-execution-context/trigger-context.ts"],"names":[],"mappings":";;;AASA,+CAAuE;AAGvE,iEAMgC;AAEhC,qEAAgE;AAEhE,MAAM,WAAW,GAAG,GAAG,EAAE;IACxB,MAAM,IAAI,+BAAgB,CAAC,wCAAwC,CAAC,CAAC;AACtE,CAAC,CAAC;AAEF,MAAM,gBAAgB,GAAG,GAAG,EAAE;IAC7B,MAAM,IAAI,+BAAgB,CAAC,6CAA6C,CAAC,CAAC;AAC3E,CAAC,CAAC;AAEF,MAAa,cAAe,SAAQ,6CAAoB;IAGvD,YACC,QAAkB,EAClB,IAAW,EACX,cAA8C,EAC9C,IAAyB,EACR,UAAgC,EACxC,OAAkC,WAAW,EAC7C,YAA4C,gBAAgB;QAErE,KAAK,CAAC,QAAQ,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,CAAC,CAAC;QAJ3B,eAAU,GAAV,UAAU,CAAsB;QACxC,SAAI,GAAJ,IAAI,CAAyC;QAC7C,cAAS,GAAT,SAAS,CAAmD;QAIrE,IAAI,CAAC,OAAO,GAAG;YACd,qBAAqB,EAArB,oCAAqB;YACrB,eAAe,EAAf,sCAAe;YACf,GAAG,IAAA,4CAAqB,GAAE;YAC1B,GAAG,IAAA,gDAAyB,EAAC,QAAQ,EAAE,IAAI,EAAE,cAAc,CAAC;YAC5D,GAAG,IAAA,+CAAwB,EAAC,cAAc,EAAE,QAAQ,CAAC,EAAE,CAAC;YACxD,GAAG,IAAA,6CAAsB,EAAC,QAAQ,CAAC;SACnC,CAAC;IACH,CAAC;IAED,iBAAiB;QAChB,OAAO,IAAI,CAAC,UAAU,CAAC;IACxB,CAAC;IAED,KAAK,CAAC,cAAc,CAAoD,IAAY;QACnF,OAAO,MAAM,IAAI,CAAC,eAAe,CAAI,IAAI,CAAC,CAAC;IAC5C,CAAC;CACD;AA/BD,wCA+BC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { EnsureTypeOptions, INode, INodeType, IRunExecutionData, IWorkflowDataProxyAdditionalKeys, IWorkflowExecuteAdditionalData, NodeParameterValueType, WorkflowExecuteMode } from 'n8n-workflow';
|
|
2
|
+
export declare function cleanupParameterData(inputData: NodeParameterValueType): void;
|
|
3
|
+
export declare const validateValueAgainstSchema: (node: INode, nodeType: INodeType, parameterValue: string | number | boolean | object | null | undefined, parameterName: string, runIndex: number, itemIndex: number) => any;
|
|
4
|
+
export declare function ensureType(toType: EnsureTypeOptions, parameterValue: any, parameterName: string, errorOptions?: {
|
|
5
|
+
itemIndex?: number;
|
|
6
|
+
runIndex?: number;
|
|
7
|
+
nodeCause?: string;
|
|
8
|
+
}): string | number | boolean | object;
|
|
9
|
+
export declare function getAdditionalKeys(additionalData: IWorkflowExecuteAdditionalData, mode: WorkflowExecuteMode, runExecutionData: IRunExecutionData | null, options?: {
|
|
10
|
+
secretsEnabled?: boolean;
|
|
11
|
+
}): IWorkflowDataProxyAdditionalKeys;
|