n8n-core 1.66.0 → 1.67.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.
Files changed (47) hide show
  1. package/dist/NodeExecuteFunctions.d.ts +10 -4
  2. package/dist/NodeExecuteFunctions.js +14 -300
  3. package/dist/NodeExecuteFunctions.js.map +1 -1
  4. package/dist/WorkflowExecute.d.ts +1 -1
  5. package/dist/WorkflowExecute.js +6 -6
  6. package/dist/WorkflowExecute.js.map +1 -1
  7. package/dist/build.tsbuildinfo +1 -1
  8. package/dist/index.d.ts +1 -0
  9. package/dist/index.js +1 -0
  10. package/dist/index.js.map +1 -1
  11. package/dist/node-execution-context/execute-single-context.d.ts +28 -0
  12. package/dist/node-execution-context/execute-single-context.js +104 -0
  13. package/dist/node-execution-context/execute-single-context.js.map +1 -0
  14. package/dist/node-execution-context/helpers/binary-helpers.d.ts +15 -0
  15. package/dist/node-execution-context/helpers/binary-helpers.js +117 -0
  16. package/dist/node-execution-context/helpers/binary-helpers.js.map +1 -0
  17. package/dist/node-execution-context/helpers/request-helpers.d.ts +20 -0
  18. package/dist/node-execution-context/helpers/request-helpers.js +192 -0
  19. package/dist/node-execution-context/helpers/request-helpers.js.map +1 -0
  20. package/dist/node-execution-context/helpers/scheduling-helpers.d.ts +8 -0
  21. package/dist/node-execution-context/helpers/scheduling-helpers.js +21 -0
  22. package/dist/node-execution-context/helpers/scheduling-helpers.js.map +1 -0
  23. package/dist/node-execution-context/helpers/ssh-tunnel-helpers.d.ts +6 -0
  24. package/dist/node-execution-context/helpers/ssh-tunnel-helpers.js +20 -0
  25. package/dist/node-execution-context/helpers/ssh-tunnel-helpers.js.map +1 -0
  26. package/dist/node-execution-context/hook-context.d.ts +14 -0
  27. package/dist/node-execution-context/hook-context.js +42 -0
  28. package/dist/node-execution-context/hook-context.js.map +1 -0
  29. package/dist/node-execution-context/index.d.ts +6 -0
  30. package/dist/node-execution-context/index.js +16 -0
  31. package/dist/node-execution-context/index.js.map +1 -0
  32. package/dist/node-execution-context/load-options-context.d.ts +11 -0
  33. package/dist/node-execution-context/load-options-context.js +46 -0
  34. package/dist/node-execution-context/load-options-context.js.map +1 -0
  35. package/dist/node-execution-context/node-execution-context.d.ts +30 -0
  36. package/dist/node-execution-context/node-execution-context.js +83 -0
  37. package/dist/node-execution-context/node-execution-context.js.map +1 -0
  38. package/dist/node-execution-context/poll-context.d.ts +12 -0
  39. package/dist/node-execution-context/poll-context.js +45 -0
  40. package/dist/node-execution-context/poll-context.js.map +1 -0
  41. package/dist/node-execution-context/trigger-context.d.ts +12 -0
  42. package/dist/node-execution-context/trigger-context.js +47 -0
  43. package/dist/node-execution-context/trigger-context.js.map +1 -0
  44. package/dist/node-execution-context/webhook-context.d.ts +24 -0
  45. package/dist/node-execution-context/webhook-context.js +111 -0
  46. package/dist/node-execution-context/webhook-context.js.map +1 -0
  47. package/package.json +6 -6
@@ -0,0 +1,42 @@
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 request_helpers_1 = require("./helpers/request-helpers");
7
+ const node_execution_context_1 = require("./node-execution-context");
8
+ class HookContext extends node_execution_context_1.NodeExecutionContext {
9
+ constructor(workflow, node, additionalData, mode, activation, webhookData) {
10
+ super(workflow, node, additionalData, mode);
11
+ this.activation = activation;
12
+ this.webhookData = webhookData;
13
+ this.helpers = new request_helpers_1.RequestHelpers(this, workflow, node, additionalData);
14
+ }
15
+ getActivationMode() {
16
+ return this.activation;
17
+ }
18
+ async getCredentials(type) {
19
+ return await (0, NodeExecuteFunctions_1.getCredentials)(this.workflow, this.node, type, this.additionalData, this.mode);
20
+ }
21
+ getNodeParameter(parameterName, fallbackValue, options) {
22
+ const runExecutionData = null;
23
+ const itemIndex = 0;
24
+ const runIndex = 0;
25
+ const connectionInputData = [];
26
+ 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);
27
+ }
28
+ getNodeWebhookUrl(name) {
29
+ 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);
30
+ }
31
+ getWebhookName() {
32
+ if (this.webhookData === undefined) {
33
+ throw new n8n_workflow_1.ApplicationError('Only supported in webhook functions');
34
+ }
35
+ return this.webhookData.webhookDescription.name;
36
+ }
37
+ getWebhookDescription(name) {
38
+ return (0, NodeExecuteFunctions_1.getWebhookDescription)(name, this.workflow, this.node);
39
+ }
40
+ }
41
+ exports.HookContext = HookContext;
42
+ //# 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,iEAMgC;AAEhC,+DAA2D;AAC3D,qEAAgE;AAEhE,MAAa,WAAY,SAAQ,6CAAoB;IAGpD,YACC,QAAkB,EAClB,IAAW,EACX,cAA8C,EAC9C,IAAyB,EACR,UAAgC,EAChC,WAA0B;QAE3C,KAAK,CAAC,QAAQ,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,CAAC,CAAC;QAH3B,eAAU,GAAV,UAAU,CAAsB;QAChC,gBAAW,GAAX,WAAW,CAAe;QAI3C,IAAI,CAAC,OAAO,GAAG,IAAI,gCAAc,CAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,cAAc,CAAC,CAAC;IACzE,CAAC;IAED,iBAAiB;QAChB,OAAO,IAAI,CAAC,UAAU,CAAC;IACxB,CAAC;IAED,KAAK,CAAC,cAAc,CAAoD,IAAY;QACnF,OAAO,M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AAE,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,46 @@
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 request_helpers_1 = require("./helpers/request-helpers");
8
+ const ssh_tunnel_helpers_1 = require("./helpers/ssh-tunnel-helpers");
9
+ const node_execution_context_1 = require("./node-execution-context");
10
+ class LoadOptionsContext extends node_execution_context_1.NodeExecutionContext {
11
+ constructor(workflow, node, additionalData, path) {
12
+ super(workflow, node, additionalData, 'internal');
13
+ this.path = path;
14
+ this.helpers = {
15
+ ...new request_helpers_1.RequestHelpers(this, workflow, node, additionalData).exported,
16
+ ...new ssh_tunnel_helpers_1.SSHTunnelHelpers().exported,
17
+ };
18
+ }
19
+ async getCredentials(type) {
20
+ return await (0, NodeExecuteFunctions_1.getCredentials)(this.workflow, this.node, type, this.additionalData, this.mode);
21
+ }
22
+ getCurrentNodeParameter(parameterPath, options) {
23
+ const nodeParameters = this.additionalData.currentNodeParameters;
24
+ if (parameterPath.charAt(0) === '&') {
25
+ parameterPath = `${this.path.split('.').slice(1, -1).join('.')}.${parameterPath.slice(1)}`;
26
+ }
27
+ let returnData = (0, lodash_1.get)(nodeParameters, parameterPath);
28
+ if (options?.extractValue) {
29
+ const nodeType = this.workflow.nodeTypes.getByNameAndVersion(this.node.type, this.node.typeVersion);
30
+ returnData = (0, ExtractValue_1.extractValue)(returnData, parameterPath, this.node, nodeType);
31
+ }
32
+ return returnData;
33
+ }
34
+ getCurrentNodeParameters() {
35
+ return this.additionalData.currentNodeParameters;
36
+ }
37
+ getNodeParameter(parameterName, fallbackValue, options) {
38
+ const runExecutionData = null;
39
+ const itemIndex = 0;
40
+ const runIndex = 0;
41
+ const connectionInputData = [];
42
+ 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);
43
+ }
44
+ }
45
+ exports.LoadOptionsContext = LoadOptionsContext;
46
+ //# 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,iEAA6F;AAE7F,+DAA2D;AAC3D,qEAAgE;AAChE,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,CAA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AC;IACnB,CAAC;IAED,wBAAwB;QACvB,OAAO,IAAI,CAAC,cAAc,CAAC,qBAAqB,CAAC;IAClD,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;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,IAAW,EACX,cAA8C,EAC9C,IAAyB;QAHzB,aAAQ,GAAR,QAAQ,CAAU;QAClB,SAAI,GAAJ,IAAI,CAAO;QACX,mBAAc,GAAd,cAAc,CAAgC;QAC9C,SAAI,GAAJ,IAAI,CAAqB;QAN1B,qBAAgB,GAAG,kBAAS,CAAC,GAAG,CAAC,mCAAgB,CAAC,CAAC;IAOnE,CAAC;IAEJ,IAAI,MAAM;QACT,OAAO,0BAAW,CAAC;IACpB,CAAC;IAED,cAAc;QACb,OAAO,IAAI,CAAC,cAAc,CAAC,WAAY,CAAC;IACzC,CAAC;IAED,OAAO;QACN,OAAO,IAAA,uBAAQ,EAAC,IAAI,CAAC,IAAI,C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BACf,WAAW,EAAE,IAAI,CAAC,WAAW;aAC7B,CAAC,CAAC;QACJ,CAAC;QACD,OAAO,MAAM,CAAC;IACf,CAAC;IAED,iBAAiB;QAChB,OAAO,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,aAAa,EAAE,CAAC;IAChD,CAAC;IAED,aAAa;QACZ,OAAO,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC;IACvC,CAAC;IAED,kBAAkB;QACjB,OAAO,IAAI,CAAC,cAAc,CAAC,eAAe,CAAC;IAC5C,CAAC;IAED,aAAa;QACZ,OAAO,IAAI,CAAC,gBAAgB,CAAC,UAAU,CAAC;IACzC,CAAC;IAED,WAAW;QACV,OAAO,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC;IAC/B,CAAC;IAED,wBAAwB,CAAC,IAAY;QACpC,OAAO,IAAI,CAAC,cAAc,CAAC,iBAAiB,CAAC,wBAAwB,CAAC,IAAI,CAAC,CAAC;IAC7E,CAAC;IAED,KAAK,CAAC,iBAAiB,CAAC,UAAgC;QACvD,OAAO,CAAC,UAAU,CAAC,CAAC;IACrB,CAAC;CACD;AA5FD,oDA4FC"}
@@ -0,0 +1,12 @@
1
+ import type { ICredentialDataDecryptedObject, IGetNodeParameterOptions, INode, IPollFunctions, 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,45 @@
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 binary_helpers_1 = require("./helpers/binary-helpers");
7
+ const request_helpers_1 = require("./helpers/request-helpers");
8
+ const scheduling_helpers_1 = require("./helpers/scheduling-helpers");
9
+ const node_execution_context_1 = require("./node-execution-context");
10
+ const throwOnEmit = () => {
11
+ throw new n8n_workflow_1.ApplicationError('Overwrite PollContext.__emit function');
12
+ };
13
+ const throwOnEmitError = () => {
14
+ throw new n8n_workflow_1.ApplicationError('Overwrite PollContext.__emitError function');
15
+ };
16
+ class PollContext extends node_execution_context_1.NodeExecutionContext {
17
+ constructor(workflow, node, additionalData, mode, activation, __emit = throwOnEmit, __emitError = throwOnEmitError) {
18
+ super(workflow, node, additionalData, mode);
19
+ this.activation = activation;
20
+ this.__emit = __emit;
21
+ this.__emitError = __emitError;
22
+ this.helpers = {
23
+ createDeferredPromise: n8n_workflow_1.createDeferredPromise,
24
+ returnJsonArray: NodeExecuteFunctions_1.returnJsonArray,
25
+ ...new binary_helpers_1.BinaryHelpers(workflow, additionalData).exported,
26
+ ...new request_helpers_1.RequestHelpers(this, workflow, node, additionalData).exported,
27
+ ...new scheduling_helpers_1.SchedulingHelpers(workflow).exported,
28
+ };
29
+ }
30
+ getActivationMode() {
31
+ return this.activation;
32
+ }
33
+ async getCredentials(type) {
34
+ return await (0, NodeExecuteFunctions_1.getCredentials)(this.workflow, this.node, type, this.additionalData, this.mode);
35
+ }
36
+ getNodeParameter(parameterName, fallbackValue, options) {
37
+ const runExecutionData = null;
38
+ const itemIndex = 0;
39
+ const runIndex = 0;
40
+ const connectionInputData = [];
41
+ 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);
42
+ }
43
+ }
44
+ exports.PollContext = PollContext;
45
+ //# 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,iEAKgC;AAEhC,6DAAyD;AACzD,+DAA2D;AAC3D,qEAAiE;AACjE,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,IAAI,8BAAa,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAC,QAAQ;YACvD,GAAG,IAAI,gCAAc,CAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,cAAc,CAAC,CAAC,QAAQ;YACpE,GAAG,IAAI,sCAAiB,CAAC,QAAQ,CAAC,CAAC,QAAQ;SAC3C,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;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,47 @@
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 binary_helpers_1 = require("./helpers/binary-helpers");
7
+ const request_helpers_1 = require("./helpers/request-helpers");
8
+ const scheduling_helpers_1 = require("./helpers/scheduling-helpers");
9
+ const ssh_tunnel_helpers_1 = require("./helpers/ssh-tunnel-helpers");
10
+ const node_execution_context_1 = require("./node-execution-context");
11
+ const throwOnEmit = () => {
12
+ throw new n8n_workflow_1.ApplicationError('Overwrite TriggerContext.emit function');
13
+ };
14
+ const throwOnEmitError = () => {
15
+ throw new n8n_workflow_1.ApplicationError('Overwrite TriggerContext.emitError function');
16
+ };
17
+ class TriggerContext extends node_execution_context_1.NodeExecutionContext {
18
+ constructor(workflow, node, additionalData, mode, activation, emit = throwOnEmit, emitError = throwOnEmitError) {
19
+ super(workflow, node, additionalData, mode);
20
+ this.activation = activation;
21
+ this.emit = emit;
22
+ this.emitError = emitError;
23
+ this.helpers = {
24
+ createDeferredPromise: n8n_workflow_1.createDeferredPromise,
25
+ returnJsonArray: NodeExecuteFunctions_1.returnJsonArray,
26
+ ...new binary_helpers_1.BinaryHelpers(workflow, additionalData).exported,
27
+ ...new request_helpers_1.RequestHelpers(this, workflow, node, additionalData).exported,
28
+ ...new scheduling_helpers_1.SchedulingHelpers(workflow).exported,
29
+ ...new ssh_tunnel_helpers_1.SSHTunnelHelpers().exported,
30
+ };
31
+ }
32
+ getActivationMode() {
33
+ return this.activation;
34
+ }
35
+ async getCredentials(type) {
36
+ return await (0, NodeExecuteFunctions_1.getCredentials)(this.workflow, this.node, type, this.additionalData, this.mode);
37
+ }
38
+ getNodeParameter(parameterName, fallbackValue, options) {
39
+ const runExecutionData = null;
40
+ const itemIndex = 0;
41
+ const runIndex = 0;
42
+ const connectionInputData = [];
43
+ 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);
44
+ }
45
+ }
46
+ exports.TriggerContext = TriggerContext;
47
+ //# 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,iEAKgC;AAEhC,6DAAyD;AACzD,+DAA2D;AAC3D,qEAAiE;AACjE,qEAAgE;AAChE,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,IAAI,8BAAa,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAC,QAAQ;YACvD,GAAG,IAAI,gCAAc,CAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,cAAc,CAAC,CAAC,QAAQ;YACpE,GAAG,IAAI,sCAAiB,CAAC,QAAQ,CAAC,CAAC,QAAQ;YAC3C,GAAG,IAAI,qCAAgB,EAAE,CAAC,QAAQ;SAClC,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
+ }
@@ -0,0 +1,111 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.WebhookContext = void 0;
4
+ const n8n_workflow_1 = require("n8n-workflow");
5
+ const NodeExecuteFunctions_1 = require("../NodeExecuteFunctions");
6
+ const binary_helpers_1 = require("./helpers/binary-helpers");
7
+ const request_helpers_1 = require("./helpers/request-helpers");
8
+ const node_execution_context_1 = require("./node-execution-context");
9
+ class WebhookContext extends node_execution_context_1.NodeExecutionContext {
10
+ constructor(workflow, node, additionalData, mode, webhookData, closeFunctions, runExecutionData) {
11
+ super(workflow, node, additionalData, mode);
12
+ this.webhookData = webhookData;
13
+ this.closeFunctions = closeFunctions;
14
+ this.runExecutionData = runExecutionData;
15
+ this.helpers = {
16
+ createDeferredPromise: n8n_workflow_1.createDeferredPromise,
17
+ returnJsonArray: NodeExecuteFunctions_1.returnJsonArray,
18
+ ...new binary_helpers_1.BinaryHelpers(workflow, additionalData).exported,
19
+ ...new request_helpers_1.RequestHelpers(this, workflow, node, additionalData).exported,
20
+ };
21
+ this.nodeHelpers = {
22
+ copyBinaryFile: async (filePath, fileName, mimeType) => await (0, NodeExecuteFunctions_1.copyBinaryFile)(this.workflow.id, this.additionalData.executionId, filePath, fileName, mimeType),
23
+ };
24
+ }
25
+ async getCredentials(type) {
26
+ return await (0, NodeExecuteFunctions_1.getCredentials)(this.workflow, this.node, type, this.additionalData, this.mode);
27
+ }
28
+ getBodyData() {
29
+ return this.assertHttpRequest().body;
30
+ }
31
+ getHeaderData() {
32
+ return this.assertHttpRequest().headers;
33
+ }
34
+ getParamsData() {
35
+ return this.assertHttpRequest().params;
36
+ }
37
+ getQueryData() {
38
+ return this.assertHttpRequest().query;
39
+ }
40
+ getRequestObject() {
41
+ return this.assertHttpRequest();
42
+ }
43
+ getResponseObject() {
44
+ if (this.additionalData.httpResponse === undefined) {
45
+ throw new n8n_workflow_1.ApplicationError('Response is missing');
46
+ }
47
+ return this.additionalData.httpResponse;
48
+ }
49
+ assertHttpRequest() {
50
+ const { httpRequest } = this.additionalData;
51
+ if (httpRequest === undefined) {
52
+ throw new n8n_workflow_1.ApplicationError('Request is missing');
53
+ }
54
+ return httpRequest;
55
+ }
56
+ getNodeWebhookUrl(name) {
57
+ return (0, NodeExecuteFunctions_1.getNodeWebhookUrl)(name, this.workflow, this.node, this.additionalData, this.mode, (0, NodeExecuteFunctions_1.getAdditionalKeys)(this.additionalData, this.mode, null));
58
+ }
59
+ getWebhookName() {
60
+ return this.webhookData.webhookDescription.name;
61
+ }
62
+ async getInputConnectionData(inputName, itemIndex) {
63
+ const connectionInputData = [
64
+ { json: this.additionalData.httpRequest?.body || {} },
65
+ ];
66
+ const runExecutionData = {
67
+ resultData: {
68
+ runData: {},
69
+ },
70
+ };
71
+ const executeData = {
72
+ data: {
73
+ main: [connectionInputData],
74
+ },
75
+ node: this.node,
76
+ source: null,
77
+ };
78
+ const runIndex = 0;
79
+ return await NodeExecuteFunctions_1.getInputConnectionData.call(this, this.workflow, runExecutionData, runIndex, connectionInputData, {}, this.additionalData, executeData, this.mode, this.closeFunctions, inputName, itemIndex);
80
+ }
81
+ evaluateExpression(expression, evaluateItemIndex) {
82
+ const itemIndex = evaluateItemIndex ?? 0;
83
+ const runIndex = 0;
84
+ let connectionInputData = [];
85
+ let executionData;
86
+ if (this.runExecutionData?.executionData !== undefined) {
87
+ executionData = this.runExecutionData.executionData.nodeExecutionStack[0];
88
+ if (executionData !== undefined) {
89
+ connectionInputData = executionData.data.main[0];
90
+ }
91
+ }
92
+ const additionalKeys = (0, NodeExecuteFunctions_1.getAdditionalKeys)(this.additionalData, this.mode, this.runExecutionData);
93
+ return this.workflow.expression.resolveSimpleParameterValue(`=${expression}`, {}, this.runExecutionData, runIndex, itemIndex, this.node.name, connectionInputData, this.mode, additionalKeys, executionData);
94
+ }
95
+ getNodeParameter(parameterName, fallbackValue, options) {
96
+ const itemIndex = 0;
97
+ const runIndex = 0;
98
+ let connectionInputData = [];
99
+ let executionData;
100
+ if (this.runExecutionData?.executionData !== undefined) {
101
+ executionData = this.runExecutionData.executionData.nodeExecutionStack[0];
102
+ if (executionData !== undefined) {
103
+ connectionInputData = executionData.data.main[0];
104
+ }
105
+ }
106
+ const additionalKeys = (0, NodeExecuteFunctions_1.getAdditionalKeys)(this.additionalData, this.mode, this.runExecutionData);
107
+ return (0, NodeExecuteFunctions_1.getNodeParameter)(this.workflow, this.runExecutionData, runIndex, connectionInputData, this.node, parameterName, itemIndex, this.mode, additionalKeys, executionData, fallbackValue, options);
108
+ }
109
+ }
110
+ exports.WebhookContext = WebhookContext;
111
+ //# sourceMappingURL=webhook-context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"webhook-context.js","sourceRoot":"","sources":["../../src/node-execution-context/webhook-context.ts"],"names":[],"mappings":";;;AAoBA,+CAAuE;AAGvE,iEAQgC;AAEhC,6DAAyD;AACzD,+DAA2D;AAC3D,qEAAgE;AAEhE,MAAa,cAAe,SAAQ,6CAAoB;IAKvD,YACC,QAAkB,EAClB,IAAW,EACX,cAA8C,EAC9C,IAAyB,EACR,WAAyB,EACzB,cAA+B,EAC/B,gBAA0C;QAE3D,KAAK,CAAC,QAAQ,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,CAAC,CAAC;QAJ3B,gBAAW,GAAX,WAAW,CAAc;QACzB,mBAAc,GAAd,cAAc,CAAiB;QAC/B,qBAAgB,GAAhB,gBAAgB,CAA0B;QAI3D,IAAI,CAAC,OAAO,GAAG;YACd,qBAAqB,EAArB,oCAAqB;YACrB,eAAe,EAAf,sCAAe;YACf,GAAG,IAAI,8BAAa,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAC,QAAQ;YACvD,GAAG,IAAI,gCAAc,CAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,cAAc,CAAC,CAAC,QAAQ;SACpE,CAAC;QAEF,IAAI,CAAC,WAAW,GAAG;YAClB,cAAc,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,CACtD,MAAM,IAAA,qCAAc,EACnB,IAAI,CAAC,QAAQ,CAAC,EAAE,EAChB,IAAI,CAAC,cAAc,CAAC,WAAY,EAChC,QAAQ,EACR,QAAQ,EACR,QAAQ,CACR;SACF,CAAC;IACH,CAAC;IAED,KAAK,CAAC,cAAc,CAAoD,IAAY;QACnF,OAAO,MAAM,IAAA,qCAAc,EAAI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ACb,aAAa,EACb,OAAO,CACP,CAAC;IACH,CAAC;CACD;AAnMD,wCAmMC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n8n-core",
3
- "version": "1.66.0",
3
+ "version": "1.67.0",
4
4
  "description": "Core functionality of n8n",
5
5
  "main": "dist/index",
6
6
  "types": "dist/index.d.ts",
@@ -26,7 +26,7 @@
26
26
  "@types/xml2js": "^0.4.14"
27
27
  },
28
28
  "dependencies": {
29
- "@langchain/core": "0.3.3",
29
+ "@langchain/core": "0.3.15",
30
30
  "aws4": "1.11.0",
31
31
  "axios": "1.7.4",
32
32
  "concat-stream": "2.0.0",
@@ -47,9 +47,9 @@
47
47
  "uuid": "10.0.0",
48
48
  "xml2js": "0.6.2",
49
49
  "zod": "3.23.8",
50
- "@n8n/config": "1.16.0",
50
+ "n8n-workflow": "1.66.0",
51
51
  "@n8n/client-oauth2": "0.21.0",
52
- "n8n-workflow": "1.65.0"
52
+ "@n8n/config": "1.17.0"
53
53
  },
54
54
  "license": "SEE LICENSE IN LICENSE.md",
55
55
  "homepage": "https://n8n.io",
@@ -64,13 +64,13 @@
64
64
  "scripts": {
65
65
  "clean": "rimraf dist .turbo",
66
66
  "typecheck": "tsc --noEmit",
67
- "build": "tsc -p tsconfig.build.json",
67
+ "build": "tsc -p tsconfig.build.json && tsc-alias -p tsconfig.build.json",
68
68
  "dev": "pnpm watch",
69
69
  "format": "biome format --write .",
70
70
  "format:check": "biome ci .",
71
71
  "lint": "eslint . --quiet",
72
72
  "lintfix": "eslint . --fix",
73
- "watch": "tsc -p tsconfig.build.json --watch",
73
+ "watch": "tsc-watch -p tsconfig.build.json --onCompilationComplete \"tsc-alias -p tsconfig.build.json\"",
74
74
  "test": "jest"
75
75
  }
76
76
  }