n8n-core 1.21.1 → 1.23.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/ActiveWorkflows.js +12 -2
- package/dist/ActiveWorkflows.js.map +1 -1
- package/dist/Interfaces.d.ts +1 -0
- package/dist/NodeExecuteFunctions.d.ts +3 -3
- package/dist/NodeExecuteFunctions.js +57 -32
- package/dist/NodeExecuteFunctions.js.map +1 -1
- package/dist/ObjectStore/ObjectStore.service.ee.d.ts +7 -11
- package/dist/ObjectStore/ObjectStore.service.ee.js +7 -1
- package/dist/ObjectStore/ObjectStore.service.ee.js.map +1 -1
- package/dist/ObjectStore/types.d.ts +7 -1
- package/dist/WorkflowExecute.js +2 -1
- package/dist/WorkflowExecute.js.map +1 -1
- package/dist/build.tsbuildinfo +1 -1
- package/package.json +5 -6
package/dist/ActiveWorkflows.js
CHANGED
|
@@ -1,9 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
2
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
9
|
exports.ActiveWorkflows = void 0;
|
|
10
|
+
const typedi_1 = require("typedi");
|
|
4
11
|
const cron_1 = require("cron");
|
|
5
12
|
const n8n_workflow_1 = require("n8n-workflow");
|
|
6
|
-
class ActiveWorkflows {
|
|
13
|
+
let ActiveWorkflows = class ActiveWorkflows {
|
|
7
14
|
constructor() {
|
|
8
15
|
this.activeWorkflows = {};
|
|
9
16
|
}
|
|
@@ -119,6 +126,9 @@ class ActiveWorkflows {
|
|
|
119
126
|
throw new n8n_workflow_1.WorkflowDeactivationError(`Failed to deactivate ${target} of workflow ID "${workflowId}": "${error.message}"`, { cause: error, workflowId });
|
|
120
127
|
}
|
|
121
128
|
}
|
|
122
|
-
}
|
|
129
|
+
};
|
|
123
130
|
exports.ActiveWorkflows = ActiveWorkflows;
|
|
131
|
+
exports.ActiveWorkflows = ActiveWorkflows = __decorate([
|
|
132
|
+
(0, typedi_1.Service)()
|
|
133
|
+
], ActiveWorkflows);
|
|
124
134
|
//# sourceMappingURL=ActiveWorkflows.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ActiveWorkflows.js","sourceRoot":"","sources":["../src/ActiveWorkflows.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ActiveWorkflows.js","sourceRoot":"","sources":["../src/ActiveWorkflows.ts"],"names":[],"mappings":";;;;;;;;;AAAA,mCAAiC;AACjC,+BAA+B;AAc/B,+CAMsB;AAKf,IAAM,eAAe,GAArB,MAAM,eAAe;IAArB;QACE,oBAAe,GAA4C,EAAE,CAAC;IA2NvE,CAAC;IAtNA,QAAQ,CAAC,UAAkB;QAC1B,OAAO,IAAI,CAAC,eAAe,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC;IACxD,CAAC;IAKD,kBAAkB;QACjB,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;IAC1C,CAAC;IAKD,GAAG,CAAC,UAAkB;QACrB,OAAO,IAAI,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC;IACzC,CAAC;IASD,KAAK,CAAC,GAAG,CACR,UAAkB,EAClB,QAAkB,EAClB,cAA8C,EAC9C,IAAyB,EACzB,UAAgC,EAChC,mBAAgD,EAChD,gBAA0C;QAE1C,IAAI,CAAC,eAAe,CAAC,UAAU,CAAC,GAAG,EAAE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C,GAAG,CAAC,EAAE,CAAC,CAAC;YAEzD,MAAM,IAAI,wCAAyB,CAClC,wBAAwB,MAAM,oBAAoB,UAAU,OAAO,KAAK,CAAC,OAAO,GAAG,EACnF,EAAE,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,CAC5B,CAAC;QACH,CAAC;IACF,CAAC;CACD,CAAA;AA5NY,0CAAe;0BAAf,eAAe;IAD3B,IAAA,gBAAO,GAAE;GACG,eAAe,CA4N3B"}
|
package/dist/Interfaces.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { IPollResponse, ITriggerResponse, IWorkflowSettings as IWorkflowSettingsWorkflow, ValidationResult } from 'n8n-workflow';
|
|
2
|
+
export type Class<T = object, A extends unknown[] = unknown[]> = new (...args: A) => T;
|
|
2
3
|
export interface IProcessMessage {
|
|
3
4
|
data?: any;
|
|
4
5
|
type: string;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
/// <reference types="node" />
|
|
4
4
|
/// <reference types="node/http" />
|
|
5
5
|
import { IncomingMessage } from 'http';
|
|
6
|
-
import type { IAdditionalCredentialOptions, IAllExecuteFunctions, IBinaryData, ICredentialDataDecryptedObject, ICredentialTestFunctions, IDataObject, IExecuteData, IExecuteFunctions, IExecuteSingleFunctions, IGetNodeParameterOptions, IHookFunctions, IHttpRequestOptions, ILoadOptionsFunctions, INode, INodeExecutionData, INodeType, IOAuth2Options, IPairedItemData, IPollFunctions, IRunExecutionData, ITaskDataConnections, ITriggerFunctions, IWebhookData, IWebhookDescription, IWebhookFunctions, IWorkflowDataProxyAdditionalKeys, IWorkflowExecuteAdditionalData, NodeExecutionWithMetadata, NodeParameterValueType, Workflow, WorkflowActivateMode, WorkflowExecuteMode } from 'n8n-workflow';
|
|
6
|
+
import type { CloseFunction, IAdditionalCredentialOptions, IAllExecuteFunctions, IBinaryData, ICredentialDataDecryptedObject, ICredentialTestFunctions, IDataObject, IExecuteData, IExecuteFunctions, IExecuteSingleFunctions, IGetNodeParameterOptions, IHookFunctions, IHttpRequestOptions, ILoadOptionsFunctions, INode, INodeExecutionData, INodeType, IOAuth2Options, IPairedItemData, IPollFunctions, IRunExecutionData, ITaskDataConnections, ITriggerFunctions, IWebhookData, IWebhookDescription, IWebhookFunctions, IWorkflowDataProxyAdditionalKeys, IWorkflowExecuteAdditionalData, NodeExecutionWithMetadata, NodeParameterValueType, Workflow, WorkflowActivateMode, WorkflowExecuteMode } from 'n8n-workflow';
|
|
7
7
|
import type { OptionsWithUrl } from 'request';
|
|
8
8
|
import type { OptionsWithUri, RequestPromiseOptions } from 'request-promise-native';
|
|
9
9
|
import { Readable } from 'stream';
|
|
@@ -39,9 +39,9 @@ export declare function getWebhookDescription(name: string, workflow: Workflow,
|
|
|
39
39
|
export declare function copyInputItems(items: INodeExecutionData[], properties: string[]): IDataObject[];
|
|
40
40
|
export declare function getExecutePollFunctions(workflow: Workflow, node: INode, additionalData: IWorkflowExecuteAdditionalData, mode: WorkflowExecuteMode, activation: WorkflowActivateMode): IPollFunctions;
|
|
41
41
|
export declare function getExecuteTriggerFunctions(workflow: Workflow, node: INode, additionalData: IWorkflowExecuteAdditionalData, mode: WorkflowExecuteMode, activation: WorkflowActivateMode): ITriggerFunctions;
|
|
42
|
-
export declare function getExecuteFunctions(workflow: Workflow, runExecutionData: IRunExecutionData, runIndex: number, connectionInputData: INodeExecutionData[], inputData: ITaskDataConnections, node: INode, additionalData: IWorkflowExecuteAdditionalData, executeData: IExecuteData, mode: WorkflowExecuteMode, abortSignal?: AbortSignal): IExecuteFunctions;
|
|
42
|
+
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;
|
|
43
43
|
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;
|
|
44
44
|
export declare function getCredentialTestFunctions(): ICredentialTestFunctions;
|
|
45
45
|
export declare function getLoadOptionsFunctions(workflow: Workflow, node: INode, path: string, additionalData: IWorkflowExecuteAdditionalData): ILoadOptionsFunctions;
|
|
46
|
-
export declare function getExecuteHookFunctions(workflow: Workflow, node: INode, additionalData: IWorkflowExecuteAdditionalData, mode: WorkflowExecuteMode, activation: WorkflowActivateMode,
|
|
46
|
+
export declare function getExecuteHookFunctions(workflow: Workflow, node: INode, additionalData: IWorkflowExecuteAdditionalData, mode: WorkflowExecuteMode, activation: WorkflowActivateMode, webhookData?: IWebhookData): IHookFunctions;
|
|
47
47
|
export declare function getExecuteWebhookFunctions(workflow: Workflow, node: INode, additionalData: IWorkflowExecuteAdditionalData, mode: WorkflowExecuteMode, webhookData: IWebhookData): IWebhookFunctions;
|
|
@@ -64,6 +64,12 @@ axios_1.default.defaults.paramsSerializer = (params) => {
|
|
|
64
64
|
}
|
|
65
65
|
return (0, qs_1.stringify)(params, { arrayFormat: 'indices' });
|
|
66
66
|
};
|
|
67
|
+
axios_1.default.interceptors.request.use((config) => {
|
|
68
|
+
if (config.data === undefined) {
|
|
69
|
+
config.headers.setContentType(false, false);
|
|
70
|
+
}
|
|
71
|
+
return config;
|
|
72
|
+
});
|
|
67
73
|
const pushFormDataValue = (form, key, value) => {
|
|
68
74
|
if ((value === null || value === void 0 ? void 0 : value.hasOwnProperty('value')) && value.hasOwnProperty('options')) {
|
|
69
75
|
form.append(key, value.value, value.options);
|
|
@@ -88,21 +94,21 @@ const createFormDataObject = (data) => {
|
|
|
88
94
|
});
|
|
89
95
|
return formData;
|
|
90
96
|
};
|
|
91
|
-
function searchForHeader(
|
|
92
|
-
if (headers === undefined) {
|
|
97
|
+
function searchForHeader(config, headerName) {
|
|
98
|
+
if (config.headers === undefined) {
|
|
93
99
|
return undefined;
|
|
94
100
|
}
|
|
95
|
-
const headerNames = Object.keys(headers);
|
|
101
|
+
const headerNames = Object.keys(config.headers);
|
|
96
102
|
headerName = headerName.toLowerCase();
|
|
97
103
|
return headerNames.find((thisHeader) => thisHeader.toLowerCase() === headerName);
|
|
98
104
|
}
|
|
99
|
-
async function generateContentLengthHeader(
|
|
100
|
-
if (!(
|
|
105
|
+
async function generateContentLengthHeader(config) {
|
|
106
|
+
if (!(config.data instanceof form_data_1.default)) {
|
|
101
107
|
return;
|
|
102
108
|
}
|
|
103
109
|
try {
|
|
104
110
|
const length = await new Promise((res, rej) => {
|
|
105
|
-
|
|
111
|
+
config.data.getLength((error, length) => {
|
|
106
112
|
if (error) {
|
|
107
113
|
rej(error);
|
|
108
114
|
return;
|
|
@@ -110,16 +116,17 @@ async function generateContentLengthHeader(formData, headers) {
|
|
|
110
116
|
res(length);
|
|
111
117
|
});
|
|
112
118
|
});
|
|
113
|
-
headers =
|
|
119
|
+
config.headers = {
|
|
120
|
+
...config.headers,
|
|
114
121
|
'content-length': length,
|
|
115
|
-
}
|
|
122
|
+
};
|
|
116
123
|
}
|
|
117
124
|
catch (error) {
|
|
118
125
|
n8n_workflow_1.LoggerProxy.error('Unable to calculate form data length', { error });
|
|
119
126
|
}
|
|
120
127
|
}
|
|
121
128
|
async function parseRequestObject(requestObject) {
|
|
122
|
-
var _a, _b, _c;
|
|
129
|
+
var _a, _b, _c, _d, _e;
|
|
123
130
|
const axiosConfig = {};
|
|
124
131
|
if (requestObject.headers !== undefined) {
|
|
125
132
|
axiosConfig.headers = requestObject.headers;
|
|
@@ -127,7 +134,7 @@ async function parseRequestObject(requestObject) {
|
|
|
127
134
|
const contentTypeHeaderKeyName = axiosConfig.headers &&
|
|
128
135
|
Object.keys(axiosConfig.headers).find((headerName) => headerName.toLowerCase() === 'content-type');
|
|
129
136
|
const contentType = contentTypeHeaderKeyName &&
|
|
130
|
-
axiosConfig.headers[contentTypeHeaderKeyName];
|
|
137
|
+
((_a = axiosConfig.headers) === null || _a === void 0 ? void 0 : _a[contentTypeHeaderKeyName]);
|
|
131
138
|
if (contentType === 'application/x-www-form-urlencoded' && requestObject.formData === undefined) {
|
|
132
139
|
if (typeof requestObject.body === 'string') {
|
|
133
140
|
axiosConfig.data = requestObject.body;
|
|
@@ -142,7 +149,7 @@ async function parseRequestObject(requestObject) {
|
|
|
142
149
|
}
|
|
143
150
|
}
|
|
144
151
|
}
|
|
145
|
-
else if (contentType
|
|
152
|
+
else if (contentType === null || contentType === void 0 ? void 0 : contentType.includes('multipart/form-data')) {
|
|
146
153
|
if (requestObject.formData !== undefined && requestObject.formData instanceof form_data_1.default) {
|
|
147
154
|
axiosConfig.data = requestObject.formData;
|
|
148
155
|
}
|
|
@@ -153,10 +160,10 @@ async function parseRequestObject(requestObject) {
|
|
|
153
160
|
};
|
|
154
161
|
axiosConfig.data = createFormDataObject(allData);
|
|
155
162
|
}
|
|
156
|
-
|
|
163
|
+
(_b = axiosConfig.headers) === null || _b === void 0 ? true : delete _b[contentTypeHeaderKeyName];
|
|
157
164
|
const headers = axiosConfig.data.getHeaders();
|
|
158
165
|
axiosConfig.headers = Object.assign(axiosConfig.headers || {}, headers);
|
|
159
|
-
await generateContentLengthHeader(axiosConfig
|
|
166
|
+
await generateContentLengthHeader(axiosConfig);
|
|
160
167
|
}
|
|
161
168
|
else {
|
|
162
169
|
if (requestObject.form !== undefined && requestObject.body === undefined) {
|
|
@@ -165,7 +172,7 @@ async function parseRequestObject(requestObject) {
|
|
|
165
172
|
? (0, qs_1.stringify)(requestObject.form, { format: 'RFC3986' })
|
|
166
173
|
: (0, qs_1.stringify)(requestObject.form).toString();
|
|
167
174
|
if (axiosConfig.headers !== undefined) {
|
|
168
|
-
const headerName = searchForHeader(axiosConfig
|
|
175
|
+
const headerName = searchForHeader(axiosConfig, 'content-type');
|
|
169
176
|
if (headerName) {
|
|
170
177
|
delete axiosConfig.headers[headerName];
|
|
171
178
|
}
|
|
@@ -180,7 +187,12 @@ async function parseRequestObject(requestObject) {
|
|
|
180
187
|
else if (requestObject.formData !== undefined) {
|
|
181
188
|
if (axiosConfig.headers !== undefined) {
|
|
182
189
|
const headers = Object.keys(axiosConfig.headers);
|
|
183
|
-
headers.forEach((header) =>
|
|
190
|
+
headers.forEach((header) => {
|
|
191
|
+
var _a;
|
|
192
|
+
if (header.toLowerCase() === 'content-type') {
|
|
193
|
+
(_a = axiosConfig.headers) === null || _a === void 0 ? true : delete _a[header];
|
|
194
|
+
}
|
|
195
|
+
});
|
|
184
196
|
}
|
|
185
197
|
if (requestObject.formData instanceof form_data_1.default) {
|
|
186
198
|
axiosConfig.data = requestObject.formData;
|
|
@@ -190,7 +202,7 @@ async function parseRequestObject(requestObject) {
|
|
|
190
202
|
}
|
|
191
203
|
const headers = axiosConfig.data.getHeaders();
|
|
192
204
|
axiosConfig.headers = Object.assign(axiosConfig.headers || {}, headers);
|
|
193
|
-
await generateContentLengthHeader(axiosConfig
|
|
205
|
+
await generateContentLengthHeader(axiosConfig);
|
|
194
206
|
}
|
|
195
207
|
else if (requestObject.body !== undefined) {
|
|
196
208
|
if (requestObject.form !== undefined && requestObject.body) {
|
|
@@ -200,13 +212,13 @@ async function parseRequestObject(requestObject) {
|
|
|
200
212
|
}
|
|
201
213
|
}
|
|
202
214
|
if (requestObject.uri !== undefined) {
|
|
203
|
-
axiosConfig.url = (
|
|
215
|
+
axiosConfig.url = (_c = requestObject.uri) === null || _c === void 0 ? void 0 : _c.toString();
|
|
204
216
|
}
|
|
205
217
|
if (requestObject.url !== undefined) {
|
|
206
|
-
axiosConfig.url = (
|
|
218
|
+
axiosConfig.url = (_d = requestObject.url) === null || _d === void 0 ? void 0 : _d.toString();
|
|
207
219
|
}
|
|
208
220
|
if (requestObject.baseURL !== undefined) {
|
|
209
|
-
axiosConfig.baseURL = (
|
|
221
|
+
axiosConfig.baseURL = (_e = requestObject.baseURL) === null || _e === void 0 ? void 0 : _e.toString();
|
|
210
222
|
}
|
|
211
223
|
if (requestObject.method !== undefined) {
|
|
212
224
|
axiosConfig.method = requestObject.method;
|
|
@@ -524,7 +536,7 @@ async function proxyRequestToAxios(workflow, additionalData, node, uriOrObject,
|
|
|
524
536
|
return configObject.resolveWithFullResponse
|
|
525
537
|
? {
|
|
526
538
|
body,
|
|
527
|
-
headers: response.headers,
|
|
539
|
+
headers: { ...response.headers },
|
|
528
540
|
statusCode: response.status,
|
|
529
541
|
statusMessage: response.statusText,
|
|
530
542
|
request: response.request,
|
|
@@ -573,6 +585,7 @@ async function proxyRequestToAxios(workflow, additionalData, node, uriOrObject,
|
|
|
573
585
|
}
|
|
574
586
|
exports.proxyRequestToAxios = proxyRequestToAxios;
|
|
575
587
|
function convertN8nRequestToAxios(n8nRequest) {
|
|
588
|
+
var _a;
|
|
576
589
|
const { headers, method, timeout, auth, proxy, url } = n8nRequest;
|
|
577
590
|
const axiosRequest = {
|
|
578
591
|
headers: headers !== null && headers !== void 0 ? headers : {},
|
|
@@ -606,7 +619,7 @@ function convertN8nRequestToAxios(n8nRequest) {
|
|
|
606
619
|
}
|
|
607
620
|
const { body } = n8nRequest;
|
|
608
621
|
if (body) {
|
|
609
|
-
const existingContentTypeHeaderKey = searchForHeader(axiosRequest
|
|
622
|
+
const existingContentTypeHeaderKey = searchForHeader(axiosRequest, 'content-type');
|
|
610
623
|
if (existingContentTypeHeaderKey === undefined) {
|
|
611
624
|
axiosRequest.headers = axiosRequest.headers || {};
|
|
612
625
|
if (body instanceof form_data_1.default) {
|
|
@@ -619,7 +632,7 @@ function convertN8nRequestToAxios(n8nRequest) {
|
|
|
619
632
|
axiosRequest.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
620
633
|
}
|
|
621
634
|
}
|
|
622
|
-
else if (axiosRequest.headers[existingContentTypeHeaderKey] === 'application/x-www-form-urlencoded') {
|
|
635
|
+
else if (((_a = axiosRequest.headers) === null || _a === void 0 ? void 0 : _a[existingContentTypeHeaderKey]) === 'application/x-www-form-urlencoded') {
|
|
623
636
|
axiosRequest.data = new url_1.URLSearchParams(n8nRequest.body);
|
|
624
637
|
}
|
|
625
638
|
if (typeof body === 'string' || (typeof body === 'object' && !(0, n8n_workflow_1.isObjectEmpty)(body))) {
|
|
@@ -627,14 +640,20 @@ function convertN8nRequestToAxios(n8nRequest) {
|
|
|
627
640
|
}
|
|
628
641
|
}
|
|
629
642
|
if (n8nRequest.json) {
|
|
630
|
-
const key = searchForHeader(axiosRequest
|
|
643
|
+
const key = searchForHeader(axiosRequest, 'accept');
|
|
631
644
|
if (!key) {
|
|
632
|
-
axiosRequest.headers
|
|
645
|
+
axiosRequest.headers = {
|
|
646
|
+
...axiosRequest.headers,
|
|
647
|
+
Accept: 'application/json',
|
|
648
|
+
};
|
|
633
649
|
}
|
|
634
650
|
}
|
|
635
|
-
const userAgentHeader = searchForHeader(axiosRequest
|
|
651
|
+
const userAgentHeader = searchForHeader(axiosRequest, 'user-agent');
|
|
636
652
|
if (!userAgentHeader) {
|
|
637
|
-
axiosRequest.headers
|
|
653
|
+
axiosRequest.headers = {
|
|
654
|
+
...axiosRequest.headers,
|
|
655
|
+
'User-Agent': 'n8n',
|
|
656
|
+
};
|
|
638
657
|
}
|
|
639
658
|
if (n8nRequest.ignoreHttpStatusErrors) {
|
|
640
659
|
axiosRequest.validateStatus = () => true;
|
|
@@ -690,14 +709,16 @@ exports.getBinaryStream = getBinaryStream;
|
|
|
690
709
|
function assertBinaryData(inputData, node, itemIndex, propertyName, inputIndex) {
|
|
691
710
|
const binaryKeyData = inputData.main[inputIndex][itemIndex].binary;
|
|
692
711
|
if (binaryKeyData === undefined) {
|
|
693
|
-
throw new n8n_workflow_1.NodeOperationError(node, '
|
|
712
|
+
throw new n8n_workflow_1.NodeOperationError(node, `This operation expects the node's input data to contain a binary file '${propertyName}', but none was found [item ${itemIndex}]`, {
|
|
694
713
|
itemIndex,
|
|
714
|
+
description: 'Make sure that the previous node outputs a binary file',
|
|
695
715
|
});
|
|
696
716
|
}
|
|
697
717
|
const binaryPropertyData = binaryKeyData[propertyName];
|
|
698
718
|
if (binaryPropertyData === undefined) {
|
|
699
|
-
throw new n8n_workflow_1.NodeOperationError(node, `
|
|
719
|
+
throw new n8n_workflow_1.NodeOperationError(node, `The item has no binary field '${propertyName}' [item ${itemIndex}]`, {
|
|
700
720
|
itemIndex,
|
|
721
|
+
description: 'Check that the parameter where you specified the input binary field name is correct, and that it matches a field in the binary input',
|
|
701
722
|
});
|
|
702
723
|
}
|
|
703
724
|
return binaryPropertyData;
|
|
@@ -1935,7 +1956,7 @@ function getExecuteTriggerFunctions(workflow, node, additionalData, mode, activa
|
|
|
1935
1956
|
})(workflow, node);
|
|
1936
1957
|
}
|
|
1937
1958
|
exports.getExecuteTriggerFunctions = getExecuteTriggerFunctions;
|
|
1938
|
-
function getExecuteFunctions(workflow, runExecutionData, runIndex, connectionInputData, inputData, node, additionalData, executeData, mode, abortSignal) {
|
|
1959
|
+
function getExecuteFunctions(workflow, runExecutionData, runIndex, connectionInputData, inputData, node, additionalData, executeData, mode, closeFunctions, abortSignal) {
|
|
1939
1960
|
return ((workflow, runExecutionData, connectionInputData, inputData, node) => {
|
|
1940
1961
|
return {
|
|
1941
1962
|
...getCommonWorkflowFunctions(workflow, node, additionalData),
|
|
@@ -2019,7 +2040,11 @@ function getExecuteFunctions(workflow, runExecutionData, runIndex, connectionInp
|
|
|
2019
2040
|
}
|
|
2020
2041
|
};
|
|
2021
2042
|
try {
|
|
2022
|
-
|
|
2043
|
+
const response = await nodeType.supplyData.call(context, itemIndex);
|
|
2044
|
+
if (response.closeFunction) {
|
|
2045
|
+
closeFunctions.push(response.closeFunction);
|
|
2046
|
+
}
|
|
2047
|
+
return response;
|
|
2023
2048
|
}
|
|
2024
2049
|
catch (error) {
|
|
2025
2050
|
if (error.functionality === 'configuration-node')
|
|
@@ -2271,7 +2296,7 @@ function getLoadOptionsFunctions(workflow, node, path, additionalData) {
|
|
|
2271
2296
|
})(workflow, node, path);
|
|
2272
2297
|
}
|
|
2273
2298
|
exports.getLoadOptionsFunctions = getLoadOptionsFunctions;
|
|
2274
|
-
function getExecuteHookFunctions(workflow, node, additionalData, mode, activation,
|
|
2299
|
+
function getExecuteHookFunctions(workflow, node, additionalData, mode, activation, webhookData) {
|
|
2275
2300
|
return ((workflow, node) => {
|
|
2276
2301
|
return {
|
|
2277
2302
|
...getCommonWorkflowFunctions(workflow, node, additionalData),
|
|
@@ -2286,7 +2311,7 @@ function getExecuteHookFunctions(workflow, node, additionalData, mode, activatio
|
|
|
2286
2311
|
return getNodeParameter(workflow, runExecutionData, runIndex, connectionInputData, node, parameterName, itemIndex, mode, getAdditionalKeys(additionalData, mode, runExecutionData), undefined, fallbackValue, options);
|
|
2287
2312
|
},
|
|
2288
2313
|
getNodeWebhookUrl: (name) => {
|
|
2289
|
-
return getNodeWebhookUrl(name, workflow, node, additionalData, mode, getAdditionalKeys(additionalData, mode, null), isTest);
|
|
2314
|
+
return getNodeWebhookUrl(name, workflow, node, additionalData, mode, getAdditionalKeys(additionalData, mode, null), webhookData === null || webhookData === void 0 ? void 0 : webhookData.isTest);
|
|
2290
2315
|
},
|
|
2291
2316
|
getWebhookName() {
|
|
2292
2317
|
if (webhookData === undefined) {
|