n8n-core 1.65.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.
- package/dist/NodeExecuteFunctions.d.ts +11 -4
- package/dist/NodeExecuteFunctions.js +131 -321
- package/dist/NodeExecuteFunctions.js.map +1 -1
- package/dist/PartialExecutionUtils/getIncomingData.d.ts +4 -0
- package/dist/PartialExecutionUtils/getIncomingData.js +14 -0
- package/dist/PartialExecutionUtils/getIncomingData.js.map +1 -1
- package/dist/PartialExecutionUtils/getSourceDataGroups.d.ts +6 -1
- package/dist/PartialExecutionUtils/getSourceDataGroups.js +34 -13
- package/dist/PartialExecutionUtils/getSourceDataGroups.js.map +1 -1
- package/dist/PartialExecutionUtils/recreateNodeExecutionStack.d.ts +4 -2
- package/dist/PartialExecutionUtils/recreateNodeExecutionStack.js +67 -57
- package/dist/PartialExecutionUtils/recreateNodeExecutionStack.js.map +1 -1
- package/dist/WorkflowExecute.d.ts +1 -1
- package/dist/WorkflowExecute.js +7 -7
- 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 +104 -0
- package/dist/node-execution-context/execute-single-context.js.map +1 -0
- package/dist/node-execution-context/helpers/binary-helpers.d.ts +15 -0
- package/dist/node-execution-context/helpers/binary-helpers.js +117 -0
- package/dist/node-execution-context/helpers/binary-helpers.js.map +1 -0
- package/dist/node-execution-context/helpers/request-helpers.d.ts +20 -0
- package/dist/node-execution-context/helpers/request-helpers.js +192 -0
- package/dist/node-execution-context/helpers/request-helpers.js.map +1 -0
- package/dist/node-execution-context/helpers/scheduling-helpers.d.ts +8 -0
- package/dist/node-execution-context/helpers/scheduling-helpers.js +21 -0
- package/dist/node-execution-context/helpers/scheduling-helpers.js.map +1 -0
- package/dist/node-execution-context/helpers/ssh-tunnel-helpers.d.ts +6 -0
- package/dist/node-execution-context/helpers/ssh-tunnel-helpers.js +20 -0
- package/dist/node-execution-context/helpers/ssh-tunnel-helpers.js.map +1 -0
- package/dist/node-execution-context/hook-context.d.ts +14 -0
- package/dist/node-execution-context/hook-context.js +42 -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 +46 -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 +45 -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 +47 -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 +111 -0
- package/dist/node-execution-context/webhook-context.js.map +1 -0
- package/package.json +8 -8
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import type { AxiosRequestConfig } from 'axios';
|
|
2
2
|
import { IncomingMessage } from 'http';
|
|
3
|
-
import type { CloseFunction, IAdditionalCredentialOptions, IAllExecuteFunctions, IBinaryData, ICredentialDataDecryptedObject, ICredentialTestFunctions, IDataObject, IExecuteData, IExecuteFunctions, IExecuteSingleFunctions, IGetNodeParameterOptions, IHookFunctions, IHttpRequestOptions,
|
|
3
|
+
import type { CloseFunction, IAdditionalCredentialOptions, IAllExecuteFunctions, IBinaryData, ICredentialDataDecryptedObject, ICredentialTestFunctions, IDataObject, IExecuteData, IExecuteFunctions, IExecuteSingleFunctions, IGetNodeParameterOptions, IHookFunctions, IHttpRequestOptions, IN8nHttpFullResponse, IN8nHttpResponse, INode, INodeExecutionData, INodeType, IOAuth2Options, IPairedItemData, IPollFunctions, IRequestOptions, IRunExecutionData, ITaskDataConnections, ITriggerFunctions, IWebhookData, IWebhookDescription, IWebhookFunctions, IWorkflowDataProxyAdditionalKeys, IWorkflowExecuteAdditionalData, NodeExecutionWithMetadata, NodeParameterValueType, PaginationOptions, Workflow, WorkflowActivateMode, WorkflowExecuteMode, EnsureTypeOptions, IDeduplicationOutput, IDeduplicationOutputItems, ICheckProcessedOptions, DeduplicationScope, DeduplicationItemTypes, ICheckProcessedContextData, ISupplyDataFunctions, WebhookType } from 'n8n-workflow';
|
|
4
|
+
import { NodeConnectionType } from 'n8n-workflow';
|
|
4
5
|
import { Readable } from 'stream';
|
|
5
6
|
import type { BinaryData } from './BinaryData/types';
|
|
7
|
+
export declare const validateUrl: (url?: string) => boolean;
|
|
6
8
|
export declare function parseRequestObject(requestObject: IRequestOptions): Promise<AxiosRequestConfig<any>>;
|
|
7
9
|
export declare function parseIncomingMessage(message: IncomingMessage): void;
|
|
10
|
+
export declare function binaryToString(body: Buffer | Readable, encoding?: BufferEncoding): Promise<string>;
|
|
8
11
|
export declare function proxyRequestToAxios(workflow: Workflow | undefined, additionalData: IWorkflowExecuteAdditionalData | undefined, node: INode | undefined, uriOrObject: string | IRequestOptions, options?: IRequestOptions): Promise<any>;
|
|
9
12
|
export declare const removeEmptyBody: (requestOptions: IHttpRequestOptions | IRequestOptions) => void;
|
|
13
|
+
export declare function httpRequest(requestOptions: IHttpRequestOptions): Promise<IN8nHttpFullResponse | IN8nHttpResponse>;
|
|
10
14
|
export declare function getBinaryPath(binaryDataId: string): string;
|
|
11
15
|
export declare function getBinaryMetadata(binaryDataId: string): Promise<BinaryData.Metadata>;
|
|
12
16
|
export declare function getBinaryStream(binaryDataId: string, chunkSize?: number): Promise<Readable>;
|
|
@@ -14,11 +18,13 @@ export declare function assertBinaryData(inputData: ITaskDataConnections, node:
|
|
|
14
18
|
export declare function getBinaryDataBuffer(inputData: ITaskDataConnections, itemIndex: number, propertyName: string, inputIndex: number): Promise<Buffer>;
|
|
15
19
|
export declare function setBinaryDataBuffer(binaryData: IBinaryData, bufferOrStream: Buffer | Readable, workflowId: string, executionId: string): Promise<IBinaryData>;
|
|
16
20
|
export declare function copyBinaryFile(workflowId: string, executionId: string, filePath: string, fileName: string, mimeType?: string): Promise<IBinaryData>;
|
|
21
|
+
export declare function prepareBinaryData(binaryData: Buffer | Readable, executionId: string, workflowId: string, filePath?: string, mimeType?: string): Promise<IBinaryData>;
|
|
17
22
|
export declare function checkProcessedAndRecord(items: DeduplicationItemTypes[], scope: DeduplicationScope, contextData: ICheckProcessedContextData, options: ICheckProcessedOptions): Promise<IDeduplicationOutput>;
|
|
18
23
|
export declare function checkProcessedItemsAndRecord(key: string, items: IDataObject[], scope: DeduplicationScope, contextData: ICheckProcessedContextData, options: ICheckProcessedOptions): Promise<IDeduplicationOutputItems>;
|
|
19
24
|
export declare function removeProcessed(items: DeduplicationItemTypes[], scope: DeduplicationScope, contextData: ICheckProcessedContextData, options: ICheckProcessedOptions): Promise<void>;
|
|
20
25
|
export declare function clearAllProcessedItems(scope: DeduplicationScope, contextData: ICheckProcessedContextData, options: ICheckProcessedOptions): Promise<void>;
|
|
21
26
|
export declare function getProcessedDataCount(scope: DeduplicationScope, contextData: ICheckProcessedContextData, options: ICheckProcessedOptions): Promise<number>;
|
|
27
|
+
export declare function applyPaginationRequestData(requestData: IRequestOptions, paginationRequestData: PaginationOptions['request']): IRequestOptions;
|
|
22
28
|
export declare function requestOAuth2(this: IAllExecuteFunctions, credentialsType: string, requestOptions: IHttpRequestOptions | IRequestOptions, node: INode, additionalData: IWorkflowExecuteAdditionalData, oAuth2Options?: IOAuth2Options, isN8nRequest?: boolean): Promise<any>;
|
|
23
29
|
export declare function requestOAuth1(this: IAllExecuteFunctions, credentialsType: string, requestOptions: IHttpRequestOptions | IRequestOptions, isN8nRequest?: boolean): Promise<any>;
|
|
24
30
|
export declare function httpRequestWithAuthentication(this: IAllExecuteFunctions, credentialsType: string, requestOptions: IHttpRequestOptions, workflow: Workflow, node: INode, additionalData: IWorkflowExecuteAdditionalData, additionalCredentialOptions?: IAdditionalCredentialOptions): Promise<any>;
|
|
@@ -41,15 +47,16 @@ export declare function ensureType(toType: EnsureTypeOptions, parameterValue: an
|
|
|
41
47
|
}): string | number | boolean | object;
|
|
42
48
|
export declare function getNodeParameter(workflow: Workflow, runExecutionData: IRunExecutionData | null, runIndex: number, connectionInputData: INodeExecutionData[], node: INode, parameterName: string, itemIndex: number, mode: WorkflowExecuteMode, additionalKeys: IWorkflowDataProxyAdditionalKeys, executeData?: IExecuteData, fallbackValue?: any, options?: IGetNodeParameterOptions): NodeParameterValueType | object;
|
|
43
49
|
export declare function continueOnFail(node: INode): boolean;
|
|
44
|
-
export declare function getNodeWebhookUrl(name:
|
|
45
|
-
export declare function getWebhookDescription(name:
|
|
50
|
+
export declare function getNodeWebhookUrl(name: WebhookType, workflow: Workflow, node: INode, additionalData: IWorkflowExecuteAdditionalData, mode: WorkflowExecuteMode, additionalKeys: IWorkflowDataProxyAdditionalKeys, isTest?: boolean): string | undefined;
|
|
51
|
+
export declare function getWebhookDescription(name: WebhookType, workflow: Workflow, node: INode): IWebhookDescription | undefined;
|
|
52
|
+
export declare function getInputConnectionData(this: IAllExecuteFunctions, workflow: Workflow, runExecutionData: IRunExecutionData, runIndex: number, connectionInputData: INodeExecutionData[], inputData: ITaskDataConnections, additionalData: IWorkflowExecuteAdditionalData, executeData: IExecuteData, mode: WorkflowExecuteMode, closeFunctions: CloseFunction[], inputName: NodeConnectionType, itemIndex: number, abortSignal?: AbortSignal): Promise<unknown>;
|
|
46
53
|
export declare function isFilePathBlocked(filePath: string): boolean;
|
|
47
54
|
export declare function copyInputItems(items: INodeExecutionData[], properties: string[]): IDataObject[];
|
|
48
55
|
export declare function getExecutePollFunctions(workflow: Workflow, node: INode, additionalData: IWorkflowExecuteAdditionalData, mode: WorkflowExecuteMode, activation: WorkflowActivateMode): IPollFunctions;
|
|
49
56
|
export declare function getExecuteTriggerFunctions(workflow: Workflow, node: INode, additionalData: IWorkflowExecuteAdditionalData, mode: WorkflowExecuteMode, activation: WorkflowActivateMode): ITriggerFunctions;
|
|
50
57
|
export declare function getExecuteFunctions(workflow: Workflow, runExecutionData: IRunExecutionData, runIndex: number, connectionInputData: INodeExecutionData[], inputData: ITaskDataConnections, node: INode, additionalData: IWorkflowExecuteAdditionalData, executeData: IExecuteData, mode: WorkflowExecuteMode, closeFunctions: CloseFunction[], abortSignal?: AbortSignal): IExecuteFunctions;
|
|
58
|
+
export declare function getSupplyDataFunctions(workflow: Workflow, runExecutionData: IRunExecutionData, runIndex: number, connectionInputData: INodeExecutionData[], inputData: ITaskDataConnections, node: INode, additionalData: IWorkflowExecuteAdditionalData, executeData: IExecuteData, mode: WorkflowExecuteMode, closeFunctions: CloseFunction[], abortSignal?: AbortSignal): ISupplyDataFunctions;
|
|
51
59
|
export declare function getExecuteSingleFunctions(workflow: Workflow, runExecutionData: IRunExecutionData, runIndex: number, connectionInputData: INodeExecutionData[], inputData: ITaskDataConnections, node: INode, itemIndex: number, additionalData: IWorkflowExecuteAdditionalData, executeData: IExecuteData, mode: WorkflowExecuteMode, abortSignal?: AbortSignal): IExecuteSingleFunctions;
|
|
52
60
|
export declare function getCredentialTestFunctions(): ICredentialTestFunctions;
|
|
53
|
-
export declare function getLoadOptionsFunctions(workflow: Workflow, node: INode, path: string, additionalData: IWorkflowExecuteAdditionalData): ILoadOptionsFunctions;
|
|
54
61
|
export declare function getExecuteHookFunctions(workflow: Workflow, node: INode, additionalData: IWorkflowExecuteAdditionalData, mode: WorkflowExecuteMode, activation: WorkflowActivateMode, webhookData?: IWebhookData): IHookFunctions;
|
|
55
62
|
export declare function getExecuteWebhookFunctions(workflow: Workflow, node: INode, additionalData: IWorkflowExecuteAdditionalData, mode: WorkflowExecuteMode, webhookData: IWebhookData, closeFunctions: CloseFunction[], runExecutionData: IRunExecutionData | null): IWebhookFunctions;
|
|
@@ -26,10 +26,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
26
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.validateValueAgainstSchema = exports.removeEmptyBody = void 0;
|
|
29
|
+
exports.validateValueAgainstSchema = exports.removeEmptyBody = exports.validateUrl = void 0;
|
|
30
30
|
exports.parseRequestObject = parseRequestObject;
|
|
31
31
|
exports.parseIncomingMessage = parseIncomingMessage;
|
|
32
|
+
exports.binaryToString = binaryToString;
|
|
32
33
|
exports.proxyRequestToAxios = proxyRequestToAxios;
|
|
34
|
+
exports.httpRequest = httpRequest;
|
|
33
35
|
exports.getBinaryPath = getBinaryPath;
|
|
34
36
|
exports.getBinaryMetadata = getBinaryMetadata;
|
|
35
37
|
exports.getBinaryStream = getBinaryStream;
|
|
@@ -37,11 +39,13 @@ exports.assertBinaryData = assertBinaryData;
|
|
|
37
39
|
exports.getBinaryDataBuffer = getBinaryDataBuffer;
|
|
38
40
|
exports.setBinaryDataBuffer = setBinaryDataBuffer;
|
|
39
41
|
exports.copyBinaryFile = copyBinaryFile;
|
|
42
|
+
exports.prepareBinaryData = prepareBinaryData;
|
|
40
43
|
exports.checkProcessedAndRecord = checkProcessedAndRecord;
|
|
41
44
|
exports.checkProcessedItemsAndRecord = checkProcessedItemsAndRecord;
|
|
42
45
|
exports.removeProcessed = removeProcessed;
|
|
43
46
|
exports.clearAllProcessedItems = clearAllProcessedItems;
|
|
44
47
|
exports.getProcessedDataCount = getProcessedDataCount;
|
|
48
|
+
exports.applyPaginationRequestData = applyPaginationRequestData;
|
|
45
49
|
exports.requestOAuth2 = requestOAuth2;
|
|
46
50
|
exports.requestOAuth1 = requestOAuth1;
|
|
47
51
|
exports.httpRequestWithAuthentication = httpRequestWithAuthentication;
|
|
@@ -57,14 +61,15 @@ exports.getNodeParameter = getNodeParameter;
|
|
|
57
61
|
exports.continueOnFail = continueOnFail;
|
|
58
62
|
exports.getNodeWebhookUrl = getNodeWebhookUrl;
|
|
59
63
|
exports.getWebhookDescription = getWebhookDescription;
|
|
64
|
+
exports.getInputConnectionData = getInputConnectionData;
|
|
60
65
|
exports.isFilePathBlocked = isFilePathBlocked;
|
|
61
66
|
exports.copyInputItems = copyInputItems;
|
|
62
67
|
exports.getExecutePollFunctions = getExecutePollFunctions;
|
|
63
68
|
exports.getExecuteTriggerFunctions = getExecuteTriggerFunctions;
|
|
64
69
|
exports.getExecuteFunctions = getExecuteFunctions;
|
|
70
|
+
exports.getSupplyDataFunctions = getSupplyDataFunctions;
|
|
65
71
|
exports.getExecuteSingleFunctions = getExecuteSingleFunctions;
|
|
66
72
|
exports.getCredentialTestFunctions = getCredentialTestFunctions;
|
|
67
|
-
exports.getLoadOptionsFunctions = getLoadOptionsFunctions;
|
|
68
73
|
exports.getExecuteHookFunctions = getExecuteHookFunctions;
|
|
69
74
|
exports.getExecuteWebhookFunctions = getExecuteWebhookFunctions;
|
|
70
75
|
const client_oauth2_1 = require("@n8n/client-oauth2");
|
|
@@ -98,7 +103,7 @@ const data_deduplication_service_1 = require("./data-deduplication-service");
|
|
|
98
103
|
const ExecutionMetadata_1 = require("./ExecutionMetadata");
|
|
99
104
|
const ExtractValue_1 = require("./ExtractValue");
|
|
100
105
|
const InstanceSettings_1 = require("./InstanceSettings");
|
|
101
|
-
const
|
|
106
|
+
const node_execution_context_1 = require("./node-execution-context");
|
|
102
107
|
const Secrets_1 = require("./Secrets");
|
|
103
108
|
const SSHClientsManager_1 = require("./SSHClientsManager");
|
|
104
109
|
axios_1.default.defaults.timeout = 300000;
|
|
@@ -152,6 +157,7 @@ const validateUrl = (url) => {
|
|
|
152
157
|
return false;
|
|
153
158
|
}
|
|
154
159
|
};
|
|
160
|
+
exports.validateUrl = validateUrl;
|
|
155
161
|
function searchForHeader(config, headerName) {
|
|
156
162
|
if (config.headers === undefined) {
|
|
157
163
|
return undefined;
|
|
@@ -1782,7 +1788,7 @@ const addExecutionDataFunctions = async (type, nodeName, data, runExecutionData,
|
|
|
1782
1788
|
});
|
|
1783
1789
|
}
|
|
1784
1790
|
};
|
|
1785
|
-
async function getInputConnectionData(workflow, runExecutionData, runIndex, connectionInputData, additionalData, executeData, mode, closeFunctions, inputName, itemIndex) {
|
|
1791
|
+
async function getInputConnectionData(workflow, runExecutionData, runIndex, connectionInputData, inputData, additionalData, executeData, mode, closeFunctions, inputName, itemIndex, abortSignal) {
|
|
1786
1792
|
const node = this.getNode();
|
|
1787
1793
|
const nodeType = workflow.nodeTypes.getByNameAndVersion(node.type, node.typeVersion);
|
|
1788
1794
|
const inputs = n8n_workflow_1.NodeHelpers.getNodeInputs(workflow, node, nodeType.description);
|
|
@@ -1816,26 +1822,7 @@ async function getInputConnectionData(workflow, runExecutionData, runIndex, conn
|
|
|
1816
1822
|
.filter((connectedNode) => connectedNode.disabled !== true)
|
|
1817
1823
|
.map(async (connectedNode) => {
|
|
1818
1824
|
const nodeType = workflow.nodeTypes.getByNameAndVersion(connectedNode.type, connectedNode.typeVersion);
|
|
1819
|
-
const context =
|
|
1820
|
-
context.getNodeParameter = (parameterName, itemIndex, fallbackValue, options) => {
|
|
1821
|
-
return getNodeParameter(workflow, runExecutionData, runIndex, connectionInputData, connectedNode, parameterName, itemIndex, mode, getAdditionalKeys(additionalData, mode, runExecutionData), executeData, fallbackValue, { ...(options || {}), contextNode: node });
|
|
1822
|
-
};
|
|
1823
|
-
context.getNode = () => {
|
|
1824
|
-
return (0, n8n_workflow_1.deepCopy)(connectedNode);
|
|
1825
|
-
};
|
|
1826
|
-
context.getCredentials = async (key) => {
|
|
1827
|
-
try {
|
|
1828
|
-
return await getCredentials(workflow, connectedNode, key, additionalData, mode, executeData, runExecutionData, runIndex, connectionInputData, itemIndex);
|
|
1829
|
-
}
|
|
1830
|
-
catch (error) {
|
|
1831
|
-
let currentNodeRunIndex = 0;
|
|
1832
|
-
if (runExecutionData.resultData.runData.hasOwnProperty(node.name)) {
|
|
1833
|
-
currentNodeRunIndex = runExecutionData.resultData.runData[node.name].length;
|
|
1834
|
-
}
|
|
1835
|
-
await addExecutionDataFunctions('input', connectedNode.name, error, runExecutionData, inputName, additionalData, node.name, runIndex, currentNodeRunIndex);
|
|
1836
|
-
throw error;
|
|
1837
|
-
}
|
|
1838
|
-
};
|
|
1825
|
+
const context = getSupplyDataFunctions(workflow, runExecutionData, runIndex, connectionInputData, inputData, connectedNode, additionalData, executeData, mode, closeFunctions, abortSignal);
|
|
1839
1826
|
if (!nodeType.supplyData) {
|
|
1840
1827
|
if (nodeType.description.outputs.includes("ai_tool")) {
|
|
1841
1828
|
nodeType.supplyData = async function () {
|
|
@@ -1982,7 +1969,7 @@ const getRequestHelperFunctions = (workflow, node, additionalData, runExecutionD
|
|
|
1982
1969
|
do {
|
|
1983
1970
|
paginateRequestData = getResolvedValue(paginationOptions.request, itemIndex, runIndex, executeData, additionalKeys, false);
|
|
1984
1971
|
const tempRequestOptions = applyPaginationRequestData(requestOptions, paginateRequestData);
|
|
1985
|
-
if (!validateUrl(tempRequestOptions.uri)) {
|
|
1972
|
+
if (!(0, exports.validateUrl)(tempRequestOptions.uri)) {
|
|
1986
1973
|
throw new n8n_workflow_1.NodeOperationError(node, `'${paginateRequestData.url}' is not a valid URL.`, {
|
|
1987
1974
|
itemIndex,
|
|
1988
1975
|
runIndex,
|
|
@@ -2105,12 +2092,6 @@ const getRequestHelperFunctions = (workflow, node, additionalData, runExecutionD
|
|
|
2105
2092
|
const getSSHTunnelFunctions = () => ({
|
|
2106
2093
|
getSSHClient: async (credentials) => await typedi_1.default.get(SSHClientsManager_1.SSHClientsManager).getClient(credentials),
|
|
2107
2094
|
});
|
|
2108
|
-
const getSchedulingFunctions = (workflow) => {
|
|
2109
|
-
const scheduledTaskManager = typedi_1.default.get(ScheduledTaskManager_1.ScheduledTaskManager);
|
|
2110
|
-
return {
|
|
2111
|
-
registerCron: (cronExpression, onTick) => scheduledTaskManager.registerCron(workflow, cronExpression, onTick),
|
|
2112
|
-
};
|
|
2113
|
-
};
|
|
2114
2095
|
const getAllowedPaths = () => {
|
|
2115
2096
|
const restrictFileAccessTo = process.env[Constants_1.RESTRICT_FILE_ACCESS_TO];
|
|
2116
2097
|
if (!restrictFileAccessTo) {
|
|
@@ -2242,65 +2223,10 @@ function copyInputItems(items, properties) {
|
|
|
2242
2223
|
});
|
|
2243
2224
|
}
|
|
2244
2225
|
function getExecutePollFunctions(workflow, node, additionalData, mode, activation) {
|
|
2245
|
-
return (
|
|
2246
|
-
return {
|
|
2247
|
-
...getCommonWorkflowFunctions(workflow, node, additionalData),
|
|
2248
|
-
__emit: () => {
|
|
2249
|
-
throw new n8n_workflow_1.ApplicationError('Overwrite NodeExecuteFunctions.getExecutePollFunctions.__emit function');
|
|
2250
|
-
},
|
|
2251
|
-
__emitError() {
|
|
2252
|
-
throw new n8n_workflow_1.ApplicationError('Overwrite NodeExecuteFunctions.getExecutePollFunctions.__emitError function');
|
|
2253
|
-
},
|
|
2254
|
-
getMode: () => mode,
|
|
2255
|
-
getActivationMode: () => activation,
|
|
2256
|
-
getCredentials: async (type) => await getCredentials(workflow, node, type, additionalData, mode),
|
|
2257
|
-
getNodeParameter: (parameterName, fallbackValue, options) => {
|
|
2258
|
-
const runExecutionData = null;
|
|
2259
|
-
const itemIndex = 0;
|
|
2260
|
-
const runIndex = 0;
|
|
2261
|
-
const connectionInputData = [];
|
|
2262
|
-
return getNodeParameter(workflow, runExecutionData, runIndex, connectionInputData, node, parameterName, itemIndex, mode, getAdditionalKeys(additionalData, mode, runExecutionData), undefined, fallbackValue, options);
|
|
2263
|
-
},
|
|
2264
|
-
helpers: {
|
|
2265
|
-
createDeferredPromise: n8n_workflow_1.createDeferredPromise,
|
|
2266
|
-
...getRequestHelperFunctions(workflow, node, additionalData),
|
|
2267
|
-
...getBinaryHelperFunctions(additionalData, workflow.id),
|
|
2268
|
-
...getSchedulingFunctions(workflow),
|
|
2269
|
-
returnJsonArray,
|
|
2270
|
-
},
|
|
2271
|
-
};
|
|
2272
|
-
})(workflow, node);
|
|
2226
|
+
return new node_execution_context_1.PollContext(workflow, node, additionalData, mode, activation);
|
|
2273
2227
|
}
|
|
2274
2228
|
function getExecuteTriggerFunctions(workflow, node, additionalData, mode, activation) {
|
|
2275
|
-
return (
|
|
2276
|
-
return {
|
|
2277
|
-
...getCommonWorkflowFunctions(workflow, node, additionalData),
|
|
2278
|
-
emit: () => {
|
|
2279
|
-
throw new n8n_workflow_1.ApplicationError('Overwrite NodeExecuteFunctions.getExecuteTriggerFunctions.emit function');
|
|
2280
|
-
},
|
|
2281
|
-
emitError: () => {
|
|
2282
|
-
throw new n8n_workflow_1.ApplicationError('Overwrite NodeExecuteFunctions.getExecuteTriggerFunctions.emit function');
|
|
2283
|
-
},
|
|
2284
|
-
getMode: () => mode,
|
|
2285
|
-
getActivationMode: () => activation,
|
|
2286
|
-
getCredentials: async (type) => await getCredentials(workflow, node, type, additionalData, mode),
|
|
2287
|
-
getNodeParameter: (parameterName, fallbackValue, options) => {
|
|
2288
|
-
const runExecutionData = null;
|
|
2289
|
-
const itemIndex = 0;
|
|
2290
|
-
const runIndex = 0;
|
|
2291
|
-
const connectionInputData = [];
|
|
2292
|
-
return getNodeParameter(workflow, runExecutionData, runIndex, connectionInputData, node, parameterName, itemIndex, mode, getAdditionalKeys(additionalData, mode, runExecutionData), undefined, fallbackValue, options);
|
|
2293
|
-
},
|
|
2294
|
-
helpers: {
|
|
2295
|
-
createDeferredPromise: n8n_workflow_1.createDeferredPromise,
|
|
2296
|
-
...getSSHTunnelFunctions(),
|
|
2297
|
-
...getRequestHelperFunctions(workflow, node, additionalData),
|
|
2298
|
-
...getBinaryHelperFunctions(additionalData, workflow.id),
|
|
2299
|
-
...getSchedulingFunctions(workflow),
|
|
2300
|
-
returnJsonArray,
|
|
2301
|
-
},
|
|
2302
|
-
};
|
|
2303
|
-
})(workflow, node);
|
|
2229
|
+
return new node_execution_context_1.TriggerContext(workflow, node, additionalData, mode, activation);
|
|
2304
2230
|
}
|
|
2305
2231
|
function getExecuteFunctions(workflow, runExecutionData, runIndex, connectionInputData, inputData, node, additionalData, executeData, mode, closeFunctions, abortSignal) {
|
|
2306
2232
|
return ((workflow, runExecutionData, connectionInputData, inputData, node) => {
|
|
@@ -2313,7 +2239,7 @@ function getExecuteFunctions(workflow, runExecutionData, runIndex, connectionInp
|
|
|
2313
2239
|
continueOnFail: () => {
|
|
2314
2240
|
return continueOnFail(node);
|
|
2315
2241
|
},
|
|
2316
|
-
evaluateExpression
|
|
2242
|
+
evaluateExpression(expression, itemIndex) {
|
|
2317
2243
|
return workflow.expression.resolveSimpleParameterValue(`=${expression}`, {}, runExecutionData, runIndex, itemIndex, node.name, connectionInputData, mode, getAdditionalKeys(additionalData, mode, runExecutionData), executeData);
|
|
2318
2244
|
},
|
|
2319
2245
|
async executeWorkflow(workflowInfo, inputData, parentCallbackManager) {
|
|
@@ -2331,7 +2257,7 @@ function getExecuteFunctions(workflow, runExecutionData, runIndex, connectionInp
|
|
|
2331
2257
|
return n8n_workflow_1.NodeHelpers.getContext(runExecutionData, type, node);
|
|
2332
2258
|
},
|
|
2333
2259
|
async getInputConnectionData(inputName, itemIndex) {
|
|
2334
|
-
return await getInputConnectionData.call(this, workflow, runExecutionData, runIndex, connectionInputData, additionalData, executeData, mode, closeFunctions, inputName, itemIndex);
|
|
2260
|
+
return await getInputConnectionData.call(this, workflow, runExecutionData, runIndex, connectionInputData, inputData, additionalData, executeData, mode, closeFunctions, inputName, itemIndex, abortSignal);
|
|
2335
2261
|
},
|
|
2336
2262
|
getNodeInputs() {
|
|
2337
2263
|
const nodeType = workflow.nodeTypes.getByNameAndVersion(node.type, node.typeVersion);
|
|
@@ -2458,7 +2384,7 @@ function getExecuteFunctions(workflow, runExecutionData, runIndex, connectionInp
|
|
|
2458
2384
|
constructExecutionMetaData,
|
|
2459
2385
|
},
|
|
2460
2386
|
nodeHelpers: getNodeHelperFunctions(additionalData, workflow.id),
|
|
2461
|
-
logAiEvent:
|
|
2387
|
+
logAiEvent: (eventName, msg) => {
|
|
2462
2388
|
return additionalData.logAiEvent(eventName, {
|
|
2463
2389
|
executionId: additionalData.executionId ?? 'unsaved-execution',
|
|
2464
2390
|
nodeName: node.name,
|
|
@@ -2473,77 +2399,122 @@ function getExecuteFunctions(workflow, runExecutionData, runIndex, connectionInp
|
|
|
2473
2399
|
};
|
|
2474
2400
|
})(workflow, runExecutionData, connectionInputData, inputData, node);
|
|
2475
2401
|
}
|
|
2476
|
-
function
|
|
2477
|
-
return
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
|
|
2485
|
-
|
|
2486
|
-
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
|
|
2493
|
-
|
|
2494
|
-
|
|
2495
|
-
|
|
2496
|
-
|
|
2497
|
-
|
|
2402
|
+
function getSupplyDataFunctions(workflow, runExecutionData, runIndex, connectionInputData, inputData, node, additionalData, executeData, mode, closeFunctions, abortSignal) {
|
|
2403
|
+
return {
|
|
2404
|
+
...getCommonWorkflowFunctions(workflow, node, additionalData),
|
|
2405
|
+
...executionCancellationFunctions(abortSignal),
|
|
2406
|
+
getMode: () => mode,
|
|
2407
|
+
getCredentials: async (type, itemIndex) => await getCredentials(workflow, node, type, additionalData, mode, executeData, runExecutionData, runIndex, connectionInputData, itemIndex),
|
|
2408
|
+
continueOnFail: () => continueOnFail(node),
|
|
2409
|
+
evaluateExpression: (expression, itemIndex) => workflow.expression.resolveSimpleParameterValue(`=${expression}`, {}, runExecutionData, runIndex, itemIndex, node.name, connectionInputData, mode, getAdditionalKeys(additionalData, mode, runExecutionData), executeData),
|
|
2410
|
+
executeWorkflow: async (workflowInfo, inputData, parentCallbackManager) => await additionalData
|
|
2411
|
+
.executeWorkflow(workflowInfo, additionalData, {
|
|
2412
|
+
parentWorkflowId: workflow.id?.toString(),
|
|
2413
|
+
inputData,
|
|
2414
|
+
parentWorkflowSettings: workflow.settings,
|
|
2415
|
+
node,
|
|
2416
|
+
parentCallbackManager,
|
|
2417
|
+
})
|
|
2418
|
+
.then(async (result) => await typedi_1.default.get(BinaryData_service_1.BinaryDataService).duplicateBinaryData(workflow.id, additionalData.executionId, result)),
|
|
2419
|
+
getNodeOutputs() {
|
|
2420
|
+
const nodeType = workflow.nodeTypes.getByNameAndVersion(node.type, node.typeVersion);
|
|
2421
|
+
return n8n_workflow_1.NodeHelpers.getNodeOutputs(workflow, node, nodeType.description).map((output) => {
|
|
2422
|
+
if (typeof output === 'string') {
|
|
2423
|
+
return {
|
|
2424
|
+
type: output,
|
|
2425
|
+
};
|
|
2498
2426
|
}
|
|
2499
|
-
|
|
2500
|
-
|
|
2501
|
-
|
|
2502
|
-
|
|
2427
|
+
return output;
|
|
2428
|
+
});
|
|
2429
|
+
},
|
|
2430
|
+
async getInputConnectionData(inputName, itemIndex) {
|
|
2431
|
+
return await getInputConnectionData.call(this, workflow, runExecutionData, runIndex, connectionInputData, inputData, additionalData, executeData, mode, closeFunctions, inputName, itemIndex, abortSignal);
|
|
2432
|
+
},
|
|
2433
|
+
getInputData: (inputIndex = 0, inputName = 'main') => {
|
|
2434
|
+
if (!inputData.hasOwnProperty(inputName)) {
|
|
2435
|
+
return [];
|
|
2436
|
+
}
|
|
2437
|
+
if (inputData[inputName].length < inputIndex) {
|
|
2438
|
+
throw new n8n_workflow_1.ApplicationError('Could not get input with given index', {
|
|
2439
|
+
extra: { inputIndex, inputName },
|
|
2440
|
+
});
|
|
2441
|
+
}
|
|
2442
|
+
if (inputData[inputName][inputIndex] === null) {
|
|
2443
|
+
throw new n8n_workflow_1.ApplicationError('Value of input was not set', {
|
|
2444
|
+
extra: { inputIndex, inputName },
|
|
2445
|
+
});
|
|
2446
|
+
}
|
|
2447
|
+
return inputData[inputName][inputIndex];
|
|
2448
|
+
},
|
|
2449
|
+
getNodeParameter: ((parameterName, itemIndex, fallbackValue, options) => getNodeParameter(workflow, runExecutionData, runIndex, connectionInputData, node, parameterName, itemIndex, mode, getAdditionalKeys(additionalData, mode, runExecutionData), executeData, fallbackValue, options)),
|
|
2450
|
+
getWorkflowDataProxy: (itemIndex) => new n8n_workflow_1.WorkflowDataProxy(workflow, runExecutionData, runIndex, itemIndex, node.name, connectionInputData, {}, mode, getAdditionalKeys(additionalData, mode, runExecutionData), executeData).getDataProxy(),
|
|
2451
|
+
sendMessageToUI(...args) {
|
|
2452
|
+
if (mode !== 'manual') {
|
|
2453
|
+
return;
|
|
2454
|
+
}
|
|
2455
|
+
try {
|
|
2456
|
+
if (additionalData.sendDataToUI) {
|
|
2457
|
+
args = args.map((arg) => {
|
|
2458
|
+
if (arg.isLuxonDateTime && arg.invalidReason)
|
|
2459
|
+
return { ...arg };
|
|
2460
|
+
if (arg.isLuxonDateTime)
|
|
2461
|
+
return new Date(arg.ts).toString();
|
|
2462
|
+
if (arg instanceof Date)
|
|
2463
|
+
return arg.toString();
|
|
2464
|
+
return arg;
|
|
2503
2465
|
});
|
|
2504
|
-
|
|
2505
|
-
|
|
2506
|
-
|
|
2507
|
-
extra: { inputIndex, inputName, itemIndex },
|
|
2466
|
+
additionalData.sendDataToUI('sendConsoleMessage', {
|
|
2467
|
+
source: `[Node: "${node.name}"]`,
|
|
2468
|
+
messages: args,
|
|
2508
2469
|
});
|
|
2509
2470
|
}
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
|
|
2525
|
-
|
|
2526
|
-
|
|
2527
|
-
|
|
2528
|
-
|
|
2529
|
-
|
|
2530
|
-
|
|
2531
|
-
|
|
2532
|
-
|
|
2533
|
-
|
|
2534
|
-
|
|
2535
|
-
|
|
2536
|
-
|
|
2537
|
-
|
|
2538
|
-
|
|
2539
|
-
|
|
2540
|
-
|
|
2541
|
-
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
|
|
2545
|
-
|
|
2546
|
-
|
|
2471
|
+
}
|
|
2472
|
+
catch (error) {
|
|
2473
|
+
n8n_workflow_1.LoggerProxy.warn(`There was a problem sending message to UI: ${error.message}`);
|
|
2474
|
+
}
|
|
2475
|
+
},
|
|
2476
|
+
logAiEvent: (eventName, msg) => additionalData.logAiEvent(eventName, {
|
|
2477
|
+
executionId: additionalData.executionId ?? 'unsaved-execution',
|
|
2478
|
+
nodeName: node.name,
|
|
2479
|
+
workflowName: workflow.name ?? 'Unnamed workflow',
|
|
2480
|
+
nodeType: node.type,
|
|
2481
|
+
workflowId: workflow.id ?? 'unsaved-workflow',
|
|
2482
|
+
msg,
|
|
2483
|
+
}),
|
|
2484
|
+
addInputData(connectionType, data) {
|
|
2485
|
+
const nodeName = this.getNode().name;
|
|
2486
|
+
let currentNodeRunIndex = 0;
|
|
2487
|
+
if (runExecutionData.resultData.runData.hasOwnProperty(nodeName)) {
|
|
2488
|
+
currentNodeRunIndex = runExecutionData.resultData.runData[nodeName].length;
|
|
2489
|
+
}
|
|
2490
|
+
addExecutionDataFunctions('input', this.getNode().name, data, runExecutionData, connectionType, additionalData, node.name, runIndex, currentNodeRunIndex).catch((error) => {
|
|
2491
|
+
n8n_workflow_1.LoggerProxy.warn(`There was a problem logging input data of node "${this.getNode().name}": ${error.message}`);
|
|
2492
|
+
});
|
|
2493
|
+
return { index: currentNodeRunIndex };
|
|
2494
|
+
},
|
|
2495
|
+
addOutputData(connectionType, currentNodeRunIndex, data) {
|
|
2496
|
+
addExecutionDataFunctions('output', this.getNode().name, data, runExecutionData, connectionType, additionalData, node.name, runIndex, currentNodeRunIndex).catch((error) => {
|
|
2497
|
+
n8n_workflow_1.LoggerProxy.warn(`There was a problem logging output data of node "${this.getNode().name}": ${error.message}`);
|
|
2498
|
+
});
|
|
2499
|
+
},
|
|
2500
|
+
helpers: {
|
|
2501
|
+
createDeferredPromise: n8n_workflow_1.createDeferredPromise,
|
|
2502
|
+
copyInputItems,
|
|
2503
|
+
...getRequestHelperFunctions(workflow, node, additionalData, runExecutionData, connectionInputData),
|
|
2504
|
+
...getSSHTunnelFunctions(),
|
|
2505
|
+
...getFileSystemHelperFunctions(node),
|
|
2506
|
+
...getBinaryHelperFunctions(additionalData, workflow.id),
|
|
2507
|
+
...getCheckProcessedHelperFunctions(workflow, node),
|
|
2508
|
+
assertBinaryData: (itemIndex, propertyName) => assertBinaryData(inputData, node, itemIndex, propertyName, 0),
|
|
2509
|
+
getBinaryDataBuffer: async (itemIndex, propertyName) => await getBinaryDataBuffer(inputData, itemIndex, propertyName, 0),
|
|
2510
|
+
returnJsonArray,
|
|
2511
|
+
normalizeItems,
|
|
2512
|
+
constructExecutionMetaData,
|
|
2513
|
+
},
|
|
2514
|
+
};
|
|
2515
|
+
}
|
|
2516
|
+
function getExecuteSingleFunctions(workflow, runExecutionData, runIndex, connectionInputData, inputData, node, itemIndex, additionalData, executeData, mode, abortSignal) {
|
|
2517
|
+
return new node_execution_context_1.ExecuteSingleContext(workflow, node, additionalData, mode, runExecutionData, runIndex, connectionInputData, inputData, itemIndex, executeData, abortSignal);
|
|
2547
2518
|
}
|
|
2548
2519
|
function getCredentialTestFunctions() {
|
|
2549
2520
|
return {
|
|
@@ -2555,171 +2526,10 @@ function getCredentialTestFunctions() {
|
|
|
2555
2526
|
},
|
|
2556
2527
|
};
|
|
2557
2528
|
}
|
|
2558
|
-
function getLoadOptionsFunctions(workflow, node, path, additionalData) {
|
|
2559
|
-
return ((workflow, node, path) => {
|
|
2560
|
-
return {
|
|
2561
|
-
...getCommonWorkflowFunctions(workflow, node, additionalData),
|
|
2562
|
-
getCredentials: async (type) => await getCredentials(workflow, node, type, additionalData, 'internal'),
|
|
2563
|
-
getCurrentNodeParameter: (parameterPath, options) => {
|
|
2564
|
-
const nodeParameters = additionalData.currentNodeParameters;
|
|
2565
|
-
if (parameterPath.charAt(0) === '&') {
|
|
2566
|
-
parameterPath = `${path.split('.').slice(1, -1).join('.')}.${parameterPath.slice(1)}`;
|
|
2567
|
-
}
|
|
2568
|
-
let returnData = (0, get_1.default)(nodeParameters, parameterPath);
|
|
2569
|
-
if (options?.extractValue) {
|
|
2570
|
-
const nodeType = workflow.nodeTypes.getByNameAndVersion(node.type, node.typeVersion);
|
|
2571
|
-
if (nodeType === undefined) {
|
|
2572
|
-
throw new n8n_workflow_1.ApplicationError('Node type is not known so cannot return parameter value', {
|
|
2573
|
-
tags: { nodeType: node.type },
|
|
2574
|
-
});
|
|
2575
|
-
}
|
|
2576
|
-
returnData = (0, ExtractValue_1.extractValue)(returnData, parameterPath, node, nodeType);
|
|
2577
|
-
}
|
|
2578
|
-
return returnData;
|
|
2579
|
-
},
|
|
2580
|
-
getCurrentNodeParameters: () => additionalData.currentNodeParameters,
|
|
2581
|
-
getNodeParameter: (parameterName, fallbackValue, options) => {
|
|
2582
|
-
const runExecutionData = null;
|
|
2583
|
-
const itemIndex = 0;
|
|
2584
|
-
const runIndex = 0;
|
|
2585
|
-
const mode = 'internal';
|
|
2586
|
-
const connectionInputData = [];
|
|
2587
|
-
return getNodeParameter(workflow, runExecutionData, runIndex, connectionInputData, node, parameterName, itemIndex, mode, getAdditionalKeys(additionalData, mode, runExecutionData), undefined, fallbackValue, options);
|
|
2588
|
-
},
|
|
2589
|
-
helpers: {
|
|
2590
|
-
...getSSHTunnelFunctions(),
|
|
2591
|
-
...getRequestHelperFunctions(workflow, node, additionalData),
|
|
2592
|
-
},
|
|
2593
|
-
};
|
|
2594
|
-
})(workflow, node, path);
|
|
2595
|
-
}
|
|
2596
2529
|
function getExecuteHookFunctions(workflow, node, additionalData, mode, activation, webhookData) {
|
|
2597
|
-
return (
|
|
2598
|
-
return {
|
|
2599
|
-
...getCommonWorkflowFunctions(workflow, node, additionalData),
|
|
2600
|
-
getCredentials: async (type) => await getCredentials(workflow, node, type, additionalData, mode),
|
|
2601
|
-
getMode: () => mode,
|
|
2602
|
-
getActivationMode: () => activation,
|
|
2603
|
-
getNodeParameter: (parameterName, fallbackValue, options) => {
|
|
2604
|
-
const runExecutionData = null;
|
|
2605
|
-
const itemIndex = 0;
|
|
2606
|
-
const runIndex = 0;
|
|
2607
|
-
const connectionInputData = [];
|
|
2608
|
-
return getNodeParameter(workflow, runExecutionData, runIndex, connectionInputData, node, parameterName, itemIndex, mode, getAdditionalKeys(additionalData, mode, runExecutionData), undefined, fallbackValue, options);
|
|
2609
|
-
},
|
|
2610
|
-
getNodeWebhookUrl: (name) => {
|
|
2611
|
-
return getNodeWebhookUrl(name, workflow, node, additionalData, mode, getAdditionalKeys(additionalData, mode, null), webhookData?.isTest);
|
|
2612
|
-
},
|
|
2613
|
-
getWebhookName() {
|
|
2614
|
-
if (webhookData === undefined) {
|
|
2615
|
-
throw new n8n_workflow_1.ApplicationError('Only supported in webhook functions');
|
|
2616
|
-
}
|
|
2617
|
-
return webhookData.webhookDescription.name;
|
|
2618
|
-
},
|
|
2619
|
-
getWebhookDescription: (name) => getWebhookDescription(name, workflow, node),
|
|
2620
|
-
helpers: getRequestHelperFunctions(workflow, node, additionalData),
|
|
2621
|
-
};
|
|
2622
|
-
})(workflow, node);
|
|
2530
|
+
return new node_execution_context_1.HookContext(workflow, node, additionalData, mode, activation, webhookData);
|
|
2623
2531
|
}
|
|
2624
2532
|
function getExecuteWebhookFunctions(workflow, node, additionalData, mode, webhookData, closeFunctions, runExecutionData) {
|
|
2625
|
-
return (
|
|
2626
|
-
return {
|
|
2627
|
-
...getCommonWorkflowFunctions(workflow, node, additionalData),
|
|
2628
|
-
getBodyData() {
|
|
2629
|
-
if (additionalData.httpRequest === undefined) {
|
|
2630
|
-
throw new n8n_workflow_1.ApplicationError('Request is missing');
|
|
2631
|
-
}
|
|
2632
|
-
return additionalData.httpRequest.body;
|
|
2633
|
-
},
|
|
2634
|
-
getCredentials: async (type) => await getCredentials(workflow, node, type, additionalData, mode),
|
|
2635
|
-
getHeaderData() {
|
|
2636
|
-
if (additionalData.httpRequest === undefined) {
|
|
2637
|
-
throw new n8n_workflow_1.ApplicationError('Request is missing');
|
|
2638
|
-
}
|
|
2639
|
-
return additionalData.httpRequest.headers;
|
|
2640
|
-
},
|
|
2641
|
-
async getInputConnectionData(inputName, itemIndex) {
|
|
2642
|
-
const connectionInputData = [
|
|
2643
|
-
{ json: additionalData.httpRequest?.body || {} },
|
|
2644
|
-
];
|
|
2645
|
-
const runExecutionData = {
|
|
2646
|
-
resultData: {
|
|
2647
|
-
runData: {},
|
|
2648
|
-
},
|
|
2649
|
-
};
|
|
2650
|
-
const executeData = {
|
|
2651
|
-
data: {
|
|
2652
|
-
main: [connectionInputData],
|
|
2653
|
-
},
|
|
2654
|
-
node,
|
|
2655
|
-
source: null,
|
|
2656
|
-
};
|
|
2657
|
-
const runIndex = 0;
|
|
2658
|
-
return await getInputConnectionData.call(this, workflow, runExecutionData, runIndex, connectionInputData, additionalData, executeData, mode, closeFunctions, inputName, itemIndex);
|
|
2659
|
-
},
|
|
2660
|
-
getMode: () => mode,
|
|
2661
|
-
evaluateExpression: (expression, evaluateItemIndex) => {
|
|
2662
|
-
const itemIndex = evaluateItemIndex === undefined ? 0 : evaluateItemIndex;
|
|
2663
|
-
const runIndex = 0;
|
|
2664
|
-
let connectionInputData = [];
|
|
2665
|
-
let executionData;
|
|
2666
|
-
if (runExecutionData?.executionData !== undefined) {
|
|
2667
|
-
executionData = runExecutionData.executionData.nodeExecutionStack[0];
|
|
2668
|
-
if (executionData !== undefined) {
|
|
2669
|
-
connectionInputData = executionData.data.main[0];
|
|
2670
|
-
}
|
|
2671
|
-
}
|
|
2672
|
-
const additionalKeys = getAdditionalKeys(additionalData, mode, runExecutionData);
|
|
2673
|
-
return workflow.expression.resolveSimpleParameterValue(`=${expression}`, {}, runExecutionData, runIndex, itemIndex, node.name, connectionInputData, mode, additionalKeys, executionData);
|
|
2674
|
-
},
|
|
2675
|
-
getNodeParameter: (parameterName, fallbackValue, options) => {
|
|
2676
|
-
const itemIndex = 0;
|
|
2677
|
-
const runIndex = 0;
|
|
2678
|
-
let connectionInputData = [];
|
|
2679
|
-
let executionData;
|
|
2680
|
-
if (runExecutionData?.executionData !== undefined) {
|
|
2681
|
-
executionData = runExecutionData.executionData.nodeExecutionStack[0];
|
|
2682
|
-
if (executionData !== undefined) {
|
|
2683
|
-
connectionInputData = executionData.data.main[0];
|
|
2684
|
-
}
|
|
2685
|
-
}
|
|
2686
|
-
const additionalKeys = getAdditionalKeys(additionalData, mode, runExecutionData);
|
|
2687
|
-
return getNodeParameter(workflow, runExecutionData, runIndex, connectionInputData, node, parameterName, itemIndex, mode, additionalKeys, executionData, fallbackValue, options);
|
|
2688
|
-
},
|
|
2689
|
-
getParamsData() {
|
|
2690
|
-
if (additionalData.httpRequest === undefined) {
|
|
2691
|
-
throw new n8n_workflow_1.ApplicationError('Request is missing');
|
|
2692
|
-
}
|
|
2693
|
-
return additionalData.httpRequest.params;
|
|
2694
|
-
},
|
|
2695
|
-
getQueryData() {
|
|
2696
|
-
if (additionalData.httpRequest === undefined) {
|
|
2697
|
-
throw new n8n_workflow_1.ApplicationError('Request is missing');
|
|
2698
|
-
}
|
|
2699
|
-
return additionalData.httpRequest.query;
|
|
2700
|
-
},
|
|
2701
|
-
getRequestObject() {
|
|
2702
|
-
if (additionalData.httpRequest === undefined) {
|
|
2703
|
-
throw new n8n_workflow_1.ApplicationError('Request is missing');
|
|
2704
|
-
}
|
|
2705
|
-
return additionalData.httpRequest;
|
|
2706
|
-
},
|
|
2707
|
-
getResponseObject() {
|
|
2708
|
-
if (additionalData.httpResponse === undefined) {
|
|
2709
|
-
throw new n8n_workflow_1.ApplicationError('Response is missing');
|
|
2710
|
-
}
|
|
2711
|
-
return additionalData.httpResponse;
|
|
2712
|
-
},
|
|
2713
|
-
getNodeWebhookUrl: (name) => getNodeWebhookUrl(name, workflow, node, additionalData, mode, getAdditionalKeys(additionalData, mode, null)),
|
|
2714
|
-
getWebhookName: () => webhookData.webhookDescription.name,
|
|
2715
|
-
helpers: {
|
|
2716
|
-
createDeferredPromise: n8n_workflow_1.createDeferredPromise,
|
|
2717
|
-
...getRequestHelperFunctions(workflow, node, additionalData),
|
|
2718
|
-
...getBinaryHelperFunctions(additionalData, workflow.id),
|
|
2719
|
-
returnJsonArray,
|
|
2720
|
-
},
|
|
2721
|
-
nodeHelpers: getNodeHelperFunctions(additionalData, workflow.id),
|
|
2722
|
-
};
|
|
2723
|
-
})(workflow, node, runExecutionData);
|
|
2533
|
+
return new node_execution_context_1.WebhookContext(workflow, node, additionalData, mode, webhookData, closeFunctions, runExecutionData);
|
|
2724
2534
|
}
|
|
2725
2535
|
//# sourceMappingURL=NodeExecuteFunctions.js.map
|