n8n-core 1.66.0 → 1.67.1
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/NodeExecuteFunctions.d.ts +17 -4
- package/dist/NodeExecuteFunctions.js +33 -305
- package/dist/NodeExecuteFunctions.js.map +1 -1
- package/dist/WorkflowExecute.d.ts +1 -1
- package/dist/WorkflowExecute.js +6 -6
- package/dist/WorkflowExecute.js.map +1 -1
- package/dist/build.tsbuildinfo +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/node-execution-context/execute-single-context.d.ts +28 -0
- package/dist/node-execution-context/execute-single-context.js +102 -0
- package/dist/node-execution-context/execute-single-context.js.map +1 -0
- package/dist/node-execution-context/hook-context.d.ts +14 -0
- package/dist/node-execution-context/hook-context.js +41 -0
- package/dist/node-execution-context/hook-context.js.map +1 -0
- package/dist/node-execution-context/index.d.ts +6 -0
- package/dist/node-execution-context/index.js +16 -0
- package/dist/node-execution-context/index.js.map +1 -0
- package/dist/node-execution-context/load-options-context.d.ts +11 -0
- package/dist/node-execution-context/load-options-context.js +44 -0
- package/dist/node-execution-context/load-options-context.js.map +1 -0
- package/dist/node-execution-context/node-execution-context.d.ts +30 -0
- package/dist/node-execution-context/node-execution-context.js +83 -0
- package/dist/node-execution-context/node-execution-context.js.map +1 -0
- package/dist/node-execution-context/poll-context.d.ts +12 -0
- package/dist/node-execution-context/poll-context.js +42 -0
- package/dist/node-execution-context/poll-context.js.map +1 -0
- package/dist/node-execution-context/trigger-context.d.ts +12 -0
- package/dist/node-execution-context/trigger-context.js +43 -0
- package/dist/node-execution-context/trigger-context.js.map +1 -0
- package/dist/node-execution-context/webhook-context.d.ts +24 -0
- package/dist/node-execution-context/webhook-context.js +109 -0
- package/dist/node-execution-context/webhook-context.js.map +1 -0
- package/package.json +6 -6
package/dist/index.d.ts
CHANGED
|
@@ -19,3 +19,4 @@ export { ObjectStoreService } from './ObjectStore/ObjectStore.service.ee';
|
|
|
19
19
|
export { BinaryData } from './BinaryData/types';
|
|
20
20
|
export { isStoredMode as isValidNonDefaultMode } from './BinaryData/utils';
|
|
21
21
|
export * from './ExecutionMetadata';
|
|
22
|
+
export * from './node-execution-context';
|
package/dist/index.js
CHANGED
|
@@ -51,4 +51,5 @@ Object.defineProperty(exports, "ObjectStoreService", { enumerable: true, get: fu
|
|
|
51
51
|
var utils_1 = require("./BinaryData/utils");
|
|
52
52
|
Object.defineProperty(exports, "isValidNonDefaultMode", { enumerable: true, get: function () { return utils_1.isStoredMode; } });
|
|
53
53
|
__exportStar(require("./ExecutionMetadata"), exports);
|
|
54
|
+
__exportStar(require("./node-execution-context"), exports);
|
|
54
55
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6EAA+D;AAetD,oDAAoB;AAb7B,2CAAyB;AACzB,oDAAkC;AAClC,kEAAgD;AAChD,qDAAmC;AACnC,mCAAkC;AAAzB,gGAAA,MAAM,OAAA;AACf,gDAA8B;AAC9B,8CAA4B;AAC5B,gDAA8B;AAC9B,oDAAkC;AAClC,+CAA6B;AAC7B,uDAAoE;AAA3D,oHAAA,gBAAgB,OAAA;AACzB,yDAAuC;AACvC,oDAAkC;AAElC,+DAA6C;AAC7C,2CAAyB;AACzB,+EAA0E;AAAjE,4HAAA,kBAAkB,OAAA;AAE3B,4CAA2E;AAAlE,8GAAA,YAAY,OAAyB;AAC9C,sDAAoC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6EAA+D;AAetD,oDAAoB;AAb7B,2CAAyB;AACzB,oDAAkC;AAClC,kEAAgD;AAChD,qDAAmC;AACnC,mCAAkC;AAAzB,gGAAA,MAAM,OAAA;AACf,gDAA8B;AAC9B,8CAA4B;AAC5B,gDAA8B;AAC9B,oDAAkC;AAClC,+CAA6B;AAC7B,uDAAoE;AAA3D,oHAAA,gBAAgB,OAAA;AACzB,yDAAuC;AACvC,oDAAkC;AAElC,+DAA6C;AAC7C,2CAAyB;AACzB,+EAA0E;AAAjE,4HAAA,kBAAkB,OAAA;AAE3B,4CAA2E;AAAlE,8GAAA,YAAY,OAAyB;AAC9C,sDAAoC;AACpC,2DAAyC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { ICredentialDataDecryptedObject, IGetNodeParameterOptions, INode, INodeExecutionData, IRunExecutionData, IExecuteSingleFunctions, IWorkflowExecuteAdditionalData, Workflow, WorkflowExecuteMode, ITaskDataConnections, IExecuteData, ContextType, AiEvent, ISourceData } from 'n8n-workflow';
|
|
2
|
+
import { NodeExecutionContext } from './node-execution-context';
|
|
3
|
+
export declare class ExecuteSingleContext extends NodeExecutionContext implements IExecuteSingleFunctions {
|
|
4
|
+
private readonly runExecutionData;
|
|
5
|
+
private readonly runIndex;
|
|
6
|
+
private readonly connectionInputData;
|
|
7
|
+
private readonly inputData;
|
|
8
|
+
private readonly itemIndex;
|
|
9
|
+
private readonly executeData;
|
|
10
|
+
private readonly abortSignal?;
|
|
11
|
+
readonly helpers: IExecuteSingleFunctions['helpers'];
|
|
12
|
+
constructor(workflow: Workflow, node: INode, additionalData: IWorkflowExecuteAdditionalData, mode: WorkflowExecuteMode, runExecutionData: IRunExecutionData, runIndex: number, connectionInputData: INodeExecutionData[], inputData: ITaskDataConnections, itemIndex: number, executeData: IExecuteData, abortSignal?: AbortSignal | undefined);
|
|
13
|
+
getExecutionCancelSignal(): AbortSignal | undefined;
|
|
14
|
+
onExecutionCancellation(handler: () => unknown): void;
|
|
15
|
+
continueOnFail(): boolean;
|
|
16
|
+
evaluateExpression(expression: string, evaluateItemIndex: number | undefined): import("n8n-workflow").NodeParameterValue | import("n8n-workflow").INodeParameters | import("n8n-workflow").INodeParameters[] | import("n8n-workflow").NodeParameterValue[];
|
|
17
|
+
getContext(type: ContextType): import("n8n-workflow").IContextObject;
|
|
18
|
+
getInputData(inputIndex?: number, inputName?: string): INodeExecutionData | {
|
|
19
|
+
json: {};
|
|
20
|
+
};
|
|
21
|
+
getItemIndex(): number;
|
|
22
|
+
getNodeParameter(parameterName: string, fallbackValue?: any, options?: IGetNodeParameterOptions): object | import("n8n-workflow").NodeParameterValueType;
|
|
23
|
+
getCredentials<T extends object = ICredentialDataDecryptedObject>(type: string): Promise<T>;
|
|
24
|
+
getExecuteData(): IExecuteData;
|
|
25
|
+
getWorkflowDataProxy(): import("n8n-workflow").IWorkflowDataProxyData;
|
|
26
|
+
getInputSourceData(inputIndex?: number, inputName?: string): ISourceData;
|
|
27
|
+
logAiEvent(eventName: AiEvent, msg: string): void;
|
|
28
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ExecuteSingleContext = void 0;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const NodeExecuteFunctions_1 = require("../NodeExecuteFunctions");
|
|
6
|
+
const node_execution_context_1 = require("./node-execution-context");
|
|
7
|
+
class ExecuteSingleContext extends node_execution_context_1.NodeExecutionContext {
|
|
8
|
+
constructor(workflow, node, additionalData, mode, runExecutionData, runIndex, connectionInputData, inputData, itemIndex, executeData, abortSignal) {
|
|
9
|
+
super(workflow, node, additionalData, mode);
|
|
10
|
+
this.runExecutionData = runExecutionData;
|
|
11
|
+
this.runIndex = runIndex;
|
|
12
|
+
this.connectionInputData = connectionInputData;
|
|
13
|
+
this.inputData = inputData;
|
|
14
|
+
this.itemIndex = itemIndex;
|
|
15
|
+
this.executeData = executeData;
|
|
16
|
+
this.abortSignal = abortSignal;
|
|
17
|
+
this.helpers = {
|
|
18
|
+
createDeferredPromise: n8n_workflow_1.createDeferredPromise,
|
|
19
|
+
returnJsonArray: NodeExecuteFunctions_1.returnJsonArray,
|
|
20
|
+
...(0, NodeExecuteFunctions_1.getRequestHelperFunctions)(workflow, node, additionalData, runExecutionData, connectionInputData),
|
|
21
|
+
...(0, NodeExecuteFunctions_1.getBinaryHelperFunctions)(additionalData, workflow.id),
|
|
22
|
+
assertBinaryData: (propertyName, inputIndex = 0) => (0, NodeExecuteFunctions_1.assertBinaryData)(inputData, node, itemIndex, propertyName, inputIndex),
|
|
23
|
+
getBinaryDataBuffer: async (propertyName, inputIndex = 0) => await (0, NodeExecuteFunctions_1.getBinaryDataBuffer)(inputData, itemIndex, propertyName, inputIndex),
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
getExecutionCancelSignal() {
|
|
27
|
+
return this.abortSignal;
|
|
28
|
+
}
|
|
29
|
+
onExecutionCancellation(handler) {
|
|
30
|
+
const fn = () => {
|
|
31
|
+
this.abortSignal?.removeEventListener('abort', fn);
|
|
32
|
+
handler();
|
|
33
|
+
};
|
|
34
|
+
this.abortSignal?.addEventListener('abort', fn);
|
|
35
|
+
}
|
|
36
|
+
continueOnFail() {
|
|
37
|
+
return (0, NodeExecuteFunctions_1.continueOnFail)(this.node);
|
|
38
|
+
}
|
|
39
|
+
evaluateExpression(expression, evaluateItemIndex) {
|
|
40
|
+
evaluateItemIndex = evaluateItemIndex ?? this.itemIndex;
|
|
41
|
+
return this.workflow.expression.resolveSimpleParameterValue(`=${expression}`, {}, this.runExecutionData, this.runIndex, evaluateItemIndex, this.node.name, this.connectionInputData, this.mode, (0, NodeExecuteFunctions_1.getAdditionalKeys)(this.additionalData, this.mode, this.runExecutionData), this.executeData);
|
|
42
|
+
}
|
|
43
|
+
getContext(type) {
|
|
44
|
+
return n8n_workflow_1.NodeHelpers.getContext(this.runExecutionData, type, this.node);
|
|
45
|
+
}
|
|
46
|
+
getInputData(inputIndex = 0, inputName = 'main') {
|
|
47
|
+
if (!this.inputData.hasOwnProperty(inputName)) {
|
|
48
|
+
return { json: {} };
|
|
49
|
+
}
|
|
50
|
+
if (this.inputData[inputName].length < inputIndex) {
|
|
51
|
+
throw new n8n_workflow_1.ApplicationError('Could not get input index', {
|
|
52
|
+
extra: { inputIndex, inputName },
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
const allItems = this.inputData[inputName][inputIndex];
|
|
56
|
+
if (allItems === null || allItems === undefined) {
|
|
57
|
+
throw new n8n_workflow_1.ApplicationError('Input index was not set', {
|
|
58
|
+
extra: { inputIndex, inputName },
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
const data = allItems[this.itemIndex];
|
|
62
|
+
if (data === null || data === undefined) {
|
|
63
|
+
throw new n8n_workflow_1.ApplicationError('Value of input with given index was not set', {
|
|
64
|
+
extra: { inputIndex, inputName, itemIndex: this.itemIndex },
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
return data;
|
|
68
|
+
}
|
|
69
|
+
getItemIndex() {
|
|
70
|
+
return this.itemIndex;
|
|
71
|
+
}
|
|
72
|
+
getNodeParameter(parameterName, fallbackValue, options) {
|
|
73
|
+
return (0, NodeExecuteFunctions_1.getNodeParameter)(this.workflow, this.runExecutionData, this.runIndex, this.connectionInputData, this.node, parameterName, this.itemIndex, this.mode, (0, NodeExecuteFunctions_1.getAdditionalKeys)(this.additionalData, this.mode, this.runExecutionData), this.executeData, fallbackValue, options);
|
|
74
|
+
}
|
|
75
|
+
async getCredentials(type) {
|
|
76
|
+
return await (0, NodeExecuteFunctions_1.getCredentials)(this.workflow, this.node, type, this.additionalData, this.mode, this.executeData, this.runExecutionData, this.runIndex, this.connectionInputData, this.itemIndex);
|
|
77
|
+
}
|
|
78
|
+
getExecuteData() {
|
|
79
|
+
return this.executeData;
|
|
80
|
+
}
|
|
81
|
+
getWorkflowDataProxy() {
|
|
82
|
+
return new n8n_workflow_1.WorkflowDataProxy(this.workflow, this.runExecutionData, this.runIndex, this.itemIndex, this.node.name, this.connectionInputData, {}, this.mode, (0, NodeExecuteFunctions_1.getAdditionalKeys)(this.additionalData, this.mode, this.runExecutionData), this.executeData).getDataProxy();
|
|
83
|
+
}
|
|
84
|
+
getInputSourceData(inputIndex = 0, inputName = 'main') {
|
|
85
|
+
if (this.executeData?.source === null) {
|
|
86
|
+
throw new n8n_workflow_1.ApplicationError('Source data is missing');
|
|
87
|
+
}
|
|
88
|
+
return this.executeData.source[inputName][inputIndex];
|
|
89
|
+
}
|
|
90
|
+
logAiEvent(eventName, msg) {
|
|
91
|
+
return this.additionalData.logAiEvent(eventName, {
|
|
92
|
+
executionId: this.additionalData.executionId ?? 'unsaved-execution',
|
|
93
|
+
nodeName: this.node.name,
|
|
94
|
+
workflowName: this.workflow.name ?? 'Unnamed workflow',
|
|
95
|
+
nodeType: this.node.type,
|
|
96
|
+
workflowId: this.workflow.id ?? 'unsaved-workflow',
|
|
97
|
+
msg,
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
exports.ExecuteSingleContext = ExecuteSingleContext;
|
|
102
|
+
//# sourceMappingURL=execute-single-context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"execute-single-context.js","sourceRoot":"","sources":["../../src/node-execution-context/execute-single-context.ts"],"names":[],"mappings":";;;AAgBA,+CAKsB;AAGtB,iEAUgC;AAEhC,qEAAgE;AAEhE,MAAa,oBAAqB,SAAQ,6CAAoB;IAG7D,YACC,QAAkB,EAClB,IAAW,EACX,cAA8C,EAC9C,IAAyB,EACR,gBAAmC,EACnC,QAAgB,EAChB,mBAAyC,EACzC,SAA+B,EAC/B,SAAiB,EACjB,WAAyB,EACzB,WAAyB;QAE1C,KAAK,CAAC,QAAQ,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,CAAC,CAAC;QAR3B,qBAAgB,GAAhB,gBAAgB,CAAmB;QACnC,aAAQ,GAAR,QAAQ,CAAQ;QAChB,wBAAmB,GAAnB,mBAAmB,CAAsB;QACzC,cAA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AQ,EACb,IAAI,CAAC,gBAAgB,EACrB,IAAI,CAAC,QAAQ,EACb,IAAI,CAAC,SAAS,EACd,IAAI,CAAC,IAAI,CAAC,IAAI,EACd,IAAI,CAAC,mBAAmB,EACxB,EAAE,EACF,IAAI,CAAC,IAAI,EACT,IAAA,wCAAiB,EAAC,IAAI,CAAC,cAAc,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,gBAAgB,CAAC,EACxE,IAAI,CAAC,WAAW,CAChB,CAAC,YAAY,EAAE,CAAC;IAClB,CAAC;IAED,kBAAkB,CAAC,UAAU,GAAG,CAAC,EAAE,SAAS,GAAG,MAAM;QACpD,IAAI,IAAI,CAAC,WAAW,EAAE,MAAM,KAAK,IAAI,EAAE,CAAC;YAEvC,MAAM,IAAI,+BAAgB,CAAC,wBAAwB,CAAC,CAAC;QACtD,CAAC;QACD,OAAO,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,UAAU,CAAgB,CAAC;IACtE,CAAC;IAED,UAAU,CAAC,SAAkB,EAAE,GAAW;QACzC,OAAO,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,SAAS,EAAE;YAChD,WAAW,EAAE,IAAI,CAAC,cAAc,CAAC,WAAW,IAAI,mBAAmB;YACnE,QAAQ,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI;YACxB,YAAY,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,IAAI,kBAAkB;YACtD,QAAQ,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI;YACxB,UAAU,EAAE,IAAI,CAAC,QAAQ,CAAC,EAAE,IAAI,kBAAkB;YAClD,GAAG;SACH,CAAC,CAAC;IACJ,CAAC;CACD;AAnLD,oDAmLC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ICredentialDataDecryptedObject, IGetNodeParameterOptions, INode, IHookFunctions, IWorkflowExecuteAdditionalData, NodeParameterValueType, Workflow, WorkflowActivateMode, WorkflowExecuteMode, IWebhookData, WebhookType } from 'n8n-workflow';
|
|
2
|
+
import { NodeExecutionContext } from './node-execution-context';
|
|
3
|
+
export declare class HookContext extends NodeExecutionContext implements IHookFunctions {
|
|
4
|
+
private readonly activation;
|
|
5
|
+
private readonly webhookData?;
|
|
6
|
+
readonly helpers: IHookFunctions['helpers'];
|
|
7
|
+
constructor(workflow: Workflow, node: INode, additionalData: IWorkflowExecuteAdditionalData, mode: WorkflowExecuteMode, activation: WorkflowActivateMode, webhookData?: IWebhookData | undefined);
|
|
8
|
+
getActivationMode(): WorkflowActivateMode;
|
|
9
|
+
getCredentials<T extends object = ICredentialDataDecryptedObject>(type: string): Promise<T>;
|
|
10
|
+
getNodeParameter(parameterName: string, fallbackValue?: any, options?: IGetNodeParameterOptions): NodeParameterValueType | object;
|
|
11
|
+
getNodeWebhookUrl(name: WebhookType): string | undefined;
|
|
12
|
+
getWebhookName(): string;
|
|
13
|
+
getWebhookDescription(name: WebhookType): import("n8n-workflow").IWebhookDescription | undefined;
|
|
14
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.HookContext = void 0;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const NodeExecuteFunctions_1 = require("../NodeExecuteFunctions");
|
|
6
|
+
const node_execution_context_1 = require("./node-execution-context");
|
|
7
|
+
class HookContext extends node_execution_context_1.NodeExecutionContext {
|
|
8
|
+
constructor(workflow, node, additionalData, mode, activation, webhookData) {
|
|
9
|
+
super(workflow, node, additionalData, mode);
|
|
10
|
+
this.activation = activation;
|
|
11
|
+
this.webhookData = webhookData;
|
|
12
|
+
this.helpers = (0, NodeExecuteFunctions_1.getRequestHelperFunctions)(workflow, node, additionalData);
|
|
13
|
+
}
|
|
14
|
+
getActivationMode() {
|
|
15
|
+
return this.activation;
|
|
16
|
+
}
|
|
17
|
+
async getCredentials(type) {
|
|
18
|
+
return await (0, NodeExecuteFunctions_1.getCredentials)(this.workflow, this.node, type, this.additionalData, this.mode);
|
|
19
|
+
}
|
|
20
|
+
getNodeParameter(parameterName, fallbackValue, options) {
|
|
21
|
+
const runExecutionData = null;
|
|
22
|
+
const itemIndex = 0;
|
|
23
|
+
const runIndex = 0;
|
|
24
|
+
const connectionInputData = [];
|
|
25
|
+
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);
|
|
26
|
+
}
|
|
27
|
+
getNodeWebhookUrl(name) {
|
|
28
|
+
return (0, NodeExecuteFunctions_1.getNodeWebhookUrl)(name, this.workflow, this.node, this.additionalData, this.mode, (0, NodeExecuteFunctions_1.getAdditionalKeys)(this.additionalData, this.mode, null), this.webhookData?.isTest);
|
|
29
|
+
}
|
|
30
|
+
getWebhookName() {
|
|
31
|
+
if (this.webhookData === undefined) {
|
|
32
|
+
throw new n8n_workflow_1.ApplicationError('Only supported in webhook functions');
|
|
33
|
+
}
|
|
34
|
+
return this.webhookData.webhookDescription.name;
|
|
35
|
+
}
|
|
36
|
+
getWebhookDescription(name) {
|
|
37
|
+
return (0, NodeExecuteFunctions_1.getWebhookDescription)(name, this.workflow, this.node);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
exports.HookContext = HookContext;
|
|
41
|
+
//# sourceMappingURL=hook-context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hook-context.js","sourceRoot":"","sources":["../../src/node-execution-context/hook-context.ts"],"names":[],"mappings":";;;AAeA,+CAAgD;AAGhD,iEAOgC;AAEhC,qEAAgE;AAEhE,MAAa,WAAY,SAAQ,6CAAoB;IAGpD,YACC,QAAkB,EAClB,IAAW,EACX,cAA8C,EAC9C,IAAyB,EACR,UAAgC,EAChC,WAA0B;QAE3C,KAAK,C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AE,IAAI,CAAC,EACvD,IAAI,CAAC,WAAW,EAAE,MAAM,CACxB,CAAC;IACH,CAAC;IAED,cAAc;QACb,IAAI,IAAI,CAAC,WAAW,KAAK,SAAS,EAAE,CAAC;YACpC,MAAM,IAAI,+BAAgB,CAAC,qCAAqC,CAAC,CAAC;QACnE,CAAC;QACD,OAAO,IAAI,CAAC,WAAW,CAAC,kBAAkB,CAAC,IAAI,CAAC;IACjD,CAAC;IAED,qBAAqB,CAAC,IAAiB;QACtC,OAAO,IAAA,4CAAqB,EAAC,IAAI,EAAE,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;IAC9D,CAAC;CACD;AAzED,kCAyEC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { ExecuteSingleContext } from './execute-single-context';
|
|
2
|
+
export { HookContext } from './hook-context';
|
|
3
|
+
export { LoadOptionsContext } from './load-options-context';
|
|
4
|
+
export { PollContext } from './poll-context';
|
|
5
|
+
export { TriggerContext } from './trigger-context';
|
|
6
|
+
export { WebhookContext } from './webhook-context';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WebhookContext = exports.TriggerContext = exports.PollContext = exports.LoadOptionsContext = exports.HookContext = exports.ExecuteSingleContext = void 0;
|
|
4
|
+
var execute_single_context_1 = require("./execute-single-context");
|
|
5
|
+
Object.defineProperty(exports, "ExecuteSingleContext", { enumerable: true, get: function () { return execute_single_context_1.ExecuteSingleContext; } });
|
|
6
|
+
var hook_context_1 = require("./hook-context");
|
|
7
|
+
Object.defineProperty(exports, "HookContext", { enumerable: true, get: function () { return hook_context_1.HookContext; } });
|
|
8
|
+
var load_options_context_1 = require("./load-options-context");
|
|
9
|
+
Object.defineProperty(exports, "LoadOptionsContext", { enumerable: true, get: function () { return load_options_context_1.LoadOptionsContext; } });
|
|
10
|
+
var poll_context_1 = require("./poll-context");
|
|
11
|
+
Object.defineProperty(exports, "PollContext", { enumerable: true, get: function () { return poll_context_1.PollContext; } });
|
|
12
|
+
var trigger_context_1 = require("./trigger-context");
|
|
13
|
+
Object.defineProperty(exports, "TriggerContext", { enumerable: true, get: function () { return trigger_context_1.TriggerContext; } });
|
|
14
|
+
var webhook_context_1 = require("./webhook-context");
|
|
15
|
+
Object.defineProperty(exports, "WebhookContext", { enumerable: true, get: function () { return webhook_context_1.WebhookContext; } });
|
|
16
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ICredentialDataDecryptedObject, IGetNodeParameterOptions, INode, ILoadOptionsFunctions, IWorkflowExecuteAdditionalData, NodeParameterValueType, Workflow } from 'n8n-workflow';
|
|
2
|
+
import { NodeExecutionContext } from './node-execution-context';
|
|
3
|
+
export declare class LoadOptionsContext extends NodeExecutionContext implements ILoadOptionsFunctions {
|
|
4
|
+
private readonly path;
|
|
5
|
+
readonly helpers: ILoadOptionsFunctions['helpers'];
|
|
6
|
+
constructor(workflow: Workflow, node: INode, additionalData: IWorkflowExecuteAdditionalData, path: string);
|
|
7
|
+
getCredentials<T extends object = ICredentialDataDecryptedObject>(type: string): Promise<T>;
|
|
8
|
+
getCurrentNodeParameter(parameterPath: string, options?: IGetNodeParameterOptions): NodeParameterValueType | object | undefined;
|
|
9
|
+
getCurrentNodeParameters(): import("n8n-workflow").INodeParameters | undefined;
|
|
10
|
+
getNodeParameter(parameterName: string, fallbackValue?: any, options?: IGetNodeParameterOptions): NodeParameterValueType | object;
|
|
11
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LoadOptionsContext = void 0;
|
|
4
|
+
const lodash_1 = require("lodash");
|
|
5
|
+
const ExtractValue_1 = require("../ExtractValue");
|
|
6
|
+
const NodeExecuteFunctions_1 = require("../NodeExecuteFunctions");
|
|
7
|
+
const node_execution_context_1 = require("./node-execution-context");
|
|
8
|
+
class LoadOptionsContext extends node_execution_context_1.NodeExecutionContext {
|
|
9
|
+
constructor(workflow, node, additionalData, path) {
|
|
10
|
+
super(workflow, node, additionalData, 'internal');
|
|
11
|
+
this.path = path;
|
|
12
|
+
this.helpers = {
|
|
13
|
+
...(0, NodeExecuteFunctions_1.getSSHTunnelFunctions)(),
|
|
14
|
+
...(0, NodeExecuteFunctions_1.getRequestHelperFunctions)(workflow, node, additionalData),
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
async getCredentials(type) {
|
|
18
|
+
return await (0, NodeExecuteFunctions_1.getCredentials)(this.workflow, this.node, type, this.additionalData, this.mode);
|
|
19
|
+
}
|
|
20
|
+
getCurrentNodeParameter(parameterPath, options) {
|
|
21
|
+
const nodeParameters = this.additionalData.currentNodeParameters;
|
|
22
|
+
if (parameterPath.charAt(0) === '&') {
|
|
23
|
+
parameterPath = `${this.path.split('.').slice(1, -1).join('.')}.${parameterPath.slice(1)}`;
|
|
24
|
+
}
|
|
25
|
+
let returnData = (0, lodash_1.get)(nodeParameters, parameterPath);
|
|
26
|
+
if (options?.extractValue) {
|
|
27
|
+
const nodeType = this.workflow.nodeTypes.getByNameAndVersion(this.node.type, this.node.typeVersion);
|
|
28
|
+
returnData = (0, ExtractValue_1.extractValue)(returnData, parameterPath, this.node, nodeType);
|
|
29
|
+
}
|
|
30
|
+
return returnData;
|
|
31
|
+
}
|
|
32
|
+
getCurrentNodeParameters() {
|
|
33
|
+
return this.additionalData.currentNodeParameters;
|
|
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
|
+
}
|
|
43
|
+
exports.LoadOptionsContext = LoadOptionsContext;
|
|
44
|
+
//# sourceMappingURL=load-options-context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"load-options-context.js","sourceRoot":"","sources":["../../src/node-execution-context/load-options-context.ts"],"names":[],"mappings":";;;AAAA,mCAA6B;AAa7B,iDAA8C;AAE9C,iEAMgC;AAEhC,qEAAgE;AAEhE,MAAa,kBAAmB,SAAQ,6CAAoB;IAG3D,YACC,QAAkB,EAClB,IAAW,EACX,cAA8C,EAC7B,IAAY;QAE7B,KAAK,CAAC,QAAQ,EAAE,IAAI,EAAE,cAAc,EAAE,UAAU,CAAC,CAAC;QAFjC,SAAI,GAAJ,IAAI,CAAQ;QAI7B,IAAI,CAAC,OAAO,GAAG;YACd,GAAG,IAAA,4CAAqB,GAAE;YAC1B,GAAG,IAAA,gDAAyB,EAAC,QAAQ,EAAE,IAAI,EAAE,cAAc,CAAC;SAC5D,CAAC;IACH,CAAC;IAED,KAAK,CAAC,cAAc,CAAoD,IAAY;QACnF,OAAO,MAAM,IAAA,qCAAc,EAAI,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,cAAc,EAAE,IAAI,CAAC,IAAI,CAAC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aAAa,EACb,SAAS,EACT,IAAI,CAAC,IAAI,EACT,IAAA,wCAAiB,EAAC,IAAI,CAAC,cAAc,EAAE,IAAI,CAAC,IAAI,EAAE,gBAAgB,CAAC,EACnE,SAAS,EACT,aAAa,EACb,OAAO,CACP,CAAC;IACH,CAAC;CACD;AAhFD,gDAgFC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { FunctionsBase, INode, INodeExecutionData, IWorkflowExecuteAdditionalData, NodeTypeAndVersion, Workflow, WorkflowExecuteMode } from 'n8n-workflow';
|
|
2
|
+
import { LoggerProxy } from 'n8n-workflow';
|
|
3
|
+
import { InstanceSettings } from '../InstanceSettings';
|
|
4
|
+
export declare abstract class NodeExecutionContext implements Omit<FunctionsBase, 'getCredentials'> {
|
|
5
|
+
protected readonly workflow: Workflow;
|
|
6
|
+
protected readonly node: INode;
|
|
7
|
+
protected readonly additionalData: IWorkflowExecuteAdditionalData;
|
|
8
|
+
protected readonly mode: WorkflowExecuteMode;
|
|
9
|
+
protected readonly instanceSettings: InstanceSettings;
|
|
10
|
+
constructor(workflow: Workflow, node: INode, additionalData: IWorkflowExecuteAdditionalData, mode: WorkflowExecuteMode);
|
|
11
|
+
get logger(): typeof LoggerProxy;
|
|
12
|
+
getExecutionId(): string;
|
|
13
|
+
getNode(): INode;
|
|
14
|
+
getWorkflow(): {
|
|
15
|
+
id: string;
|
|
16
|
+
name: string | undefined;
|
|
17
|
+
active: boolean;
|
|
18
|
+
};
|
|
19
|
+
getMode(): WorkflowExecuteMode;
|
|
20
|
+
getWorkflowStaticData(type: string): import("n8n-workflow").IDataObject;
|
|
21
|
+
getChildNodes(nodeName: string): NodeTypeAndVersion[];
|
|
22
|
+
getParentNodes(nodeName: string): NodeTypeAndVersion[];
|
|
23
|
+
getKnownNodeTypes(): import("n8n-workflow").IDataObject;
|
|
24
|
+
getRestApiUrl(): string;
|
|
25
|
+
getInstanceBaseUrl(): string;
|
|
26
|
+
getInstanceId(): string;
|
|
27
|
+
getTimezone(): string;
|
|
28
|
+
getCredentialsProperties(type: string): import("n8n-workflow").INodeProperties[];
|
|
29
|
+
prepareOutputData(outputData: INodeExecutionData[]): Promise<INodeExecutionData[][]>;
|
|
30
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NodeExecutionContext = void 0;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const typedi_1 = require("typedi");
|
|
6
|
+
const InstanceSettings_1 = require("../InstanceSettings");
|
|
7
|
+
class NodeExecutionContext {
|
|
8
|
+
constructor(workflow, node, additionalData, mode) {
|
|
9
|
+
this.workflow = workflow;
|
|
10
|
+
this.node = node;
|
|
11
|
+
this.additionalData = additionalData;
|
|
12
|
+
this.mode = mode;
|
|
13
|
+
this.instanceSettings = typedi_1.Container.get(InstanceSettings_1.InstanceSettings);
|
|
14
|
+
}
|
|
15
|
+
get logger() {
|
|
16
|
+
return n8n_workflow_1.LoggerProxy;
|
|
17
|
+
}
|
|
18
|
+
getExecutionId() {
|
|
19
|
+
return this.additionalData.executionId;
|
|
20
|
+
}
|
|
21
|
+
getNode() {
|
|
22
|
+
return (0, n8n_workflow_1.deepCopy)(this.node);
|
|
23
|
+
}
|
|
24
|
+
getWorkflow() {
|
|
25
|
+
const { id, name, active } = this.workflow;
|
|
26
|
+
return { id, name, active };
|
|
27
|
+
}
|
|
28
|
+
getMode() {
|
|
29
|
+
return this.mode;
|
|
30
|
+
}
|
|
31
|
+
getWorkflowStaticData(type) {
|
|
32
|
+
return this.workflow.getStaticData(type, this.node);
|
|
33
|
+
}
|
|
34
|
+
getChildNodes(nodeName) {
|
|
35
|
+
const output = [];
|
|
36
|
+
const nodeNames = this.workflow.getChildNodes(nodeName);
|
|
37
|
+
for (const n of nodeNames) {
|
|
38
|
+
const node = this.workflow.nodes[n];
|
|
39
|
+
output.push({
|
|
40
|
+
name: node.name,
|
|
41
|
+
type: node.type,
|
|
42
|
+
typeVersion: node.typeVersion,
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
return output;
|
|
46
|
+
}
|
|
47
|
+
getParentNodes(nodeName) {
|
|
48
|
+
const output = [];
|
|
49
|
+
const nodeNames = this.workflow.getParentNodes(nodeName);
|
|
50
|
+
for (const n of nodeNames) {
|
|
51
|
+
const node = this.workflow.nodes[n];
|
|
52
|
+
output.push({
|
|
53
|
+
name: node.name,
|
|
54
|
+
type: node.type,
|
|
55
|
+
typeVersion: node.typeVersion,
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
return output;
|
|
59
|
+
}
|
|
60
|
+
getKnownNodeTypes() {
|
|
61
|
+
return this.workflow.nodeTypes.getKnownTypes();
|
|
62
|
+
}
|
|
63
|
+
getRestApiUrl() {
|
|
64
|
+
return this.additionalData.restApiUrl;
|
|
65
|
+
}
|
|
66
|
+
getInstanceBaseUrl() {
|
|
67
|
+
return this.additionalData.instanceBaseUrl;
|
|
68
|
+
}
|
|
69
|
+
getInstanceId() {
|
|
70
|
+
return this.instanceSettings.instanceId;
|
|
71
|
+
}
|
|
72
|
+
getTimezone() {
|
|
73
|
+
return this.workflow.timezone;
|
|
74
|
+
}
|
|
75
|
+
getCredentialsProperties(type) {
|
|
76
|
+
return this.additionalData.credentialsHelper.getCredentialsProperties(type);
|
|
77
|
+
}
|
|
78
|
+
async prepareOutputData(outputData) {
|
|
79
|
+
return [outputData];
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
exports.NodeExecutionContext = NodeExecutionContext;
|
|
83
|
+
//# sourceMappingURL=node-execution-context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node-execution-context.js","sourceRoot":"","sources":["../../src/node-execution-context/node-execution-context.ts"],"names":[],"mappings":";;;AASA,+CAAqD;AACrD,mCAAmC;AAEnC,yDAAsD;AAEtD,MAAsB,oBAAoB;IAGzC,YACoB,QAAkB,EAClB,I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, IWorkflowExecuteAdditionalData, NodeParameterValueType, Workflow, WorkflowActivateMode, WorkflowExecuteMode } from 'n8n-workflow';
|
|
2
|
+
import { NodeExecutionContext } from './node-execution-context';
|
|
3
|
+
export declare class PollContext extends NodeExecutionContext implements IPollFunctions {
|
|
4
|
+
private readonly activation;
|
|
5
|
+
readonly __emit: IPollFunctions['__emit'];
|
|
6
|
+
readonly __emitError: IPollFunctions['__emitError'];
|
|
7
|
+
readonly helpers: IPollFunctions['helpers'];
|
|
8
|
+
constructor(workflow: Workflow, node: INode, additionalData: IWorkflowExecuteAdditionalData, mode: WorkflowExecuteMode, activation: WorkflowActivateMode, __emit?: IPollFunctions['__emit'], __emitError?: IPollFunctions['__emitError']);
|
|
9
|
+
getActivationMode(): WorkflowActivateMode;
|
|
10
|
+
getCredentials<T extends object = ICredentialDataDecryptedObject>(type: string): Promise<T>;
|
|
11
|
+
getNodeParameter(parameterName: string, fallbackValue?: any, options?: IGetNodeParameterOptions): NodeParameterValueType | object;
|
|
12
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PollContext = void 0;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const NodeExecuteFunctions_1 = require("../NodeExecuteFunctions");
|
|
6
|
+
const node_execution_context_1 = require("./node-execution-context");
|
|
7
|
+
const throwOnEmit = () => {
|
|
8
|
+
throw new n8n_workflow_1.ApplicationError('Overwrite PollContext.__emit function');
|
|
9
|
+
};
|
|
10
|
+
const throwOnEmitError = () => {
|
|
11
|
+
throw new n8n_workflow_1.ApplicationError('Overwrite PollContext.__emitError function');
|
|
12
|
+
};
|
|
13
|
+
class PollContext extends node_execution_context_1.NodeExecutionContext {
|
|
14
|
+
constructor(workflow, node, additionalData, mode, activation, __emit = throwOnEmit, __emitError = throwOnEmitError) {
|
|
15
|
+
super(workflow, node, additionalData, mode);
|
|
16
|
+
this.activation = activation;
|
|
17
|
+
this.__emit = __emit;
|
|
18
|
+
this.__emitError = __emitError;
|
|
19
|
+
this.helpers = {
|
|
20
|
+
createDeferredPromise: n8n_workflow_1.createDeferredPromise,
|
|
21
|
+
returnJsonArray: NodeExecuteFunctions_1.returnJsonArray,
|
|
22
|
+
...(0, NodeExecuteFunctions_1.getRequestHelperFunctions)(workflow, node, additionalData),
|
|
23
|
+
...(0, NodeExecuteFunctions_1.getBinaryHelperFunctions)(additionalData, workflow.id),
|
|
24
|
+
...(0, NodeExecuteFunctions_1.getSchedulingFunctions)(workflow),
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
getActivationMode() {
|
|
28
|
+
return this.activation;
|
|
29
|
+
}
|
|
30
|
+
async getCredentials(type) {
|
|
31
|
+
return await (0, NodeExecuteFunctions_1.getCredentials)(this.workflow, this.node, type, this.additionalData, this.mode);
|
|
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);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
exports.PollContext = PollContext;
|
|
42
|
+
//# sourceMappingURL=poll-context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"poll-context.js","sourceRoot":"","sources":["../../src/node-execution-context/poll-context.ts"],"names":[],"mappings":";;;AAaA,+CAAuE;AAGvE,iEAQgC;AAEhC,qEAAgE;AAEhE,MAAM,WAAW,GAAG,GAAG,EAAE;IACxB,MAAM,IAAI,+BAAgB,CAAC,uCAAuC,CAAC,CAAC;AACrE,CAAC,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,CAAC,QAAQ,EACb,gBAAgB,EAChB,QAAQ,EACR,mBAAmB,EACnB,IAAI,CAAC,IAAI,EACT,aAAa,EACb,SAAS,EACT,IAAI,CAAC,IAAI,EACT,IAAA,wCAAiB,EAAC,IAAI,CAAC,cAAc,EAAE,IAAI,CAAC,IAAI,EAAE,gBAAgB,CAAC,EACnE,SAAS,EACT,aAAa,EACb,OAAO,CACP,CAAC;IACH,CAAC;CACD;AAzDD,kCAyDC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ICredentialDataDecryptedObject, IGetNodeParameterOptions, INode, ITriggerFunctions, IWorkflowExecuteAdditionalData, NodeParameterValueType, Workflow, WorkflowActivateMode, WorkflowExecuteMode } from 'n8n-workflow';
|
|
2
|
+
import { NodeExecutionContext } from './node-execution-context';
|
|
3
|
+
export declare class TriggerContext extends NodeExecutionContext implements ITriggerFunctions {
|
|
4
|
+
private readonly activation;
|
|
5
|
+
readonly emit: ITriggerFunctions['emit'];
|
|
6
|
+
readonly emitError: ITriggerFunctions['emitError'];
|
|
7
|
+
readonly helpers: ITriggerFunctions['helpers'];
|
|
8
|
+
constructor(workflow: Workflow, node: INode, additionalData: IWorkflowExecuteAdditionalData, mode: WorkflowExecuteMode, activation: WorkflowActivateMode, emit?: ITriggerFunctions['emit'], emitError?: ITriggerFunctions['emitError']);
|
|
9
|
+
getActivationMode(): WorkflowActivateMode;
|
|
10
|
+
getCredentials<T extends object = ICredentialDataDecryptedObject>(type: string): Promise<T>;
|
|
11
|
+
getNodeParameter(parameterName: string, fallbackValue?: any, options?: IGetNodeParameterOptions): NodeParameterValueType | object;
|
|
12
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TriggerContext = void 0;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const NodeExecuteFunctions_1 = require("../NodeExecuteFunctions");
|
|
6
|
+
const node_execution_context_1 = require("./node-execution-context");
|
|
7
|
+
const throwOnEmit = () => {
|
|
8
|
+
throw new n8n_workflow_1.ApplicationError('Overwrite TriggerContext.emit function');
|
|
9
|
+
};
|
|
10
|
+
const throwOnEmitError = () => {
|
|
11
|
+
throw new n8n_workflow_1.ApplicationError('Overwrite TriggerContext.emitError function');
|
|
12
|
+
};
|
|
13
|
+
class TriggerContext extends node_execution_context_1.NodeExecutionContext {
|
|
14
|
+
constructor(workflow, node, additionalData, mode, activation, emit = throwOnEmit, emitError = throwOnEmitError) {
|
|
15
|
+
super(workflow, node, additionalData, mode);
|
|
16
|
+
this.activation = activation;
|
|
17
|
+
this.emit = emit;
|
|
18
|
+
this.emitError = emitError;
|
|
19
|
+
this.helpers = {
|
|
20
|
+
createDeferredPromise: n8n_workflow_1.createDeferredPromise,
|
|
21
|
+
returnJsonArray: NodeExecuteFunctions_1.returnJsonArray,
|
|
22
|
+
...(0, NodeExecuteFunctions_1.getSSHTunnelFunctions)(),
|
|
23
|
+
...(0, NodeExecuteFunctions_1.getRequestHelperFunctions)(workflow, node, additionalData),
|
|
24
|
+
...(0, NodeExecuteFunctions_1.getBinaryHelperFunctions)(additionalData, workflow.id),
|
|
25
|
+
...(0, NodeExecuteFunctions_1.getSchedulingFunctions)(workflow),
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
getActivationMode() {
|
|
29
|
+
return this.activation;
|
|
30
|
+
}
|
|
31
|
+
async getCredentials(type) {
|
|
32
|
+
return await (0, NodeExecuteFunctions_1.getCredentials)(this.workflow, this.node, type, this.additionalData, this.mode);
|
|
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);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
exports.TriggerContext = TriggerContext;
|
|
43
|
+
//# sourceMappingURL=trigger-context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trigger-context.js","sourceRoot":"","sources":["../../src/node-execution-context/trigger-context.ts"],"names":[],"mappings":";;;AAaA,+CAAuE;AAGvE,iEASgC;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,IAAA,qCAAc,EAAI,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,cAAc,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;IAChG,CAAC;IAED,gBAAgB,CACf,aAAqB,EAErB,aAAmB,EACnB,OAAkC;QAElC,MAAM,gBAAgB,GAA6B,IAAI,CAAC;QACxD,MAAM,SAAS,GAAG,CAAC,CAAC;QACpB,MAAM,QAAQ,GAAG,CAAC,CAAC;QACnB,MAAM,mBAAmB,GAAyB,EAAE,CAAC;QAErD,OAAO,IAAA,uCAAgB,EACtB,IAAI,CAAC,QAAQ,EACb,gBAAgB,EAChB,QAAQ,EACR,mBAAmB,EACnB,IAAI,CAAC,IAAI,EACT,aAAa,EACb,SAAS,EACT,IAAI,CAAC,IAAI,EACT,IAAA,wCAAiB,EAAC,IAAI,CAAC,cAAc,EAAE,IAAI,CAAC,IAAI,EAAE,gBAAgB,CAAC,EACnE,SAAS,EACT,aAAa,EACb,OAAO,CACP,CAAC;IACH,CAAC;CACD;AA1DD,wCA0DC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { Request, Response } from 'express';
|
|
2
|
+
import type { CloseFunction, ICredentialDataDecryptedObject, IDataObject, IGetNodeParameterOptions, INode, IRunExecutionData, IWebhookData, IWebhookFunctions, IWorkflowExecuteAdditionalData, NodeConnectionType, NodeParameterValueType, WebhookType, Workflow, WorkflowExecuteMode } from 'n8n-workflow';
|
|
3
|
+
import { NodeExecutionContext } from './node-execution-context';
|
|
4
|
+
export declare class WebhookContext extends NodeExecutionContext implements IWebhookFunctions {
|
|
5
|
+
private readonly webhookData;
|
|
6
|
+
private readonly closeFunctions;
|
|
7
|
+
private readonly runExecutionData;
|
|
8
|
+
readonly helpers: IWebhookFunctions['helpers'];
|
|
9
|
+
readonly nodeHelpers: IWebhookFunctions['nodeHelpers'];
|
|
10
|
+
constructor(workflow: Workflow, node: INode, additionalData: IWorkflowExecuteAdditionalData, mode: WorkflowExecuteMode, webhookData: IWebhookData, closeFunctions: CloseFunction[], runExecutionData: IRunExecutionData | null);
|
|
11
|
+
getCredentials<T extends object = ICredentialDataDecryptedObject>(type: string): Promise<T>;
|
|
12
|
+
getBodyData(): IDataObject;
|
|
13
|
+
getHeaderData(): import("http").IncomingHttpHeaders;
|
|
14
|
+
getParamsData(): object;
|
|
15
|
+
getQueryData(): object;
|
|
16
|
+
getRequestObject(): Request;
|
|
17
|
+
getResponseObject(): Response;
|
|
18
|
+
private assertHttpRequest;
|
|
19
|
+
getNodeWebhookUrl(name: WebhookType): string | undefined;
|
|
20
|
+
getWebhookName(): WebhookType;
|
|
21
|
+
getInputConnectionData(inputName: NodeConnectionType, itemIndex: number): Promise<unknown>;
|
|
22
|
+
evaluateExpression(expression: string, evaluateItemIndex?: number): import("n8n-workflow").NodeParameterValue | import("n8n-workflow").INodeParameters | import("n8n-workflow").INodeParameters[] | import("n8n-workflow").NodeParameterValue[];
|
|
23
|
+
getNodeParameter(parameterName: string, fallbackValue?: any, options?: IGetNodeParameterOptions): NodeParameterValueType | object;
|
|
24
|
+
}
|