n8n-core 1.77.3 → 1.79.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 (95) hide show
  1. package/dist/build.tsbuildinfo +1 -1
  2. package/dist/credentials.d.ts +1 -0
  3. package/dist/credentials.js +7 -0
  4. package/dist/credentials.js.map +1 -1
  5. package/dist/execution-engine/active-workflows.d.ts +2 -1
  6. package/dist/execution-engine/active-workflows.js.map +1 -1
  7. package/dist/execution-engine/execution-lifecycle-hooks.d.ts +24 -0
  8. package/dist/execution-engine/execution-lifecycle-hooks.js +30 -0
  9. package/dist/execution-engine/execution-lifecycle-hooks.js.map +1 -0
  10. package/dist/execution-engine/index.d.ts +2 -0
  11. package/dist/execution-engine/index.js +4 -0
  12. package/dist/execution-engine/index.js.map +1 -1
  13. package/dist/execution-engine/interfaces.d.ts +7 -0
  14. package/dist/execution-engine/interfaces.js +3 -0
  15. package/dist/execution-engine/interfaces.js.map +1 -0
  16. package/dist/execution-engine/node-execution-context/base-execute-context.d.ts +5 -5
  17. package/dist/execution-engine/node-execution-context/base-execute-context.js.map +1 -1
  18. package/dist/execution-engine/node-execution-context/credentials-test-context.d.ts +7 -0
  19. package/dist/execution-engine/node-execution-context/credentials-test-context.js +37 -0
  20. package/dist/execution-engine/node-execution-context/credentials-test-context.js.map +1 -0
  21. package/dist/execution-engine/node-execution-context/execute-context.d.ts +3 -1
  22. package/dist/execution-engine/node-execution-context/execute-context.js +27 -15
  23. package/dist/execution-engine/node-execution-context/execute-context.js.map +1 -1
  24. package/dist/execution-engine/node-execution-context/execute-single-context.d.ts +1 -1
  25. package/dist/execution-engine/node-execution-context/execute-single-context.js +9 -7
  26. package/dist/execution-engine/node-execution-context/execute-single-context.js.map +1 -1
  27. package/dist/execution-engine/node-execution-context/hook-context.js +5 -4
  28. package/dist/execution-engine/node-execution-context/hook-context.js.map +1 -1
  29. package/dist/execution-engine/node-execution-context/index.d.ts +7 -0
  30. package/dist/execution-engine/node-execution-context/index.js +28 -1
  31. package/dist/execution-engine/node-execution-context/index.js.map +1 -1
  32. package/dist/execution-engine/node-execution-context/load-options-context.js +4 -3
  33. package/dist/execution-engine/node-execution-context/load-options-context.js.map +1 -1
  34. package/dist/execution-engine/node-execution-context/node-execution-context.d.ts +9 -9
  35. package/dist/execution-engine/node-execution-context/node-execution-context.js.map +1 -1
  36. package/dist/execution-engine/node-execution-context/poll-context.js +8 -5
  37. package/dist/execution-engine/node-execution-context/poll-context.js.map +1 -1
  38. package/dist/execution-engine/node-execution-context/supply-data-context.js +23 -15
  39. package/dist/execution-engine/node-execution-context/supply-data-context.js.map +1 -1
  40. package/dist/execution-engine/node-execution-context/trigger-context.js +10 -6
  41. package/dist/execution-engine/node-execution-context/trigger-context.js.map +1 -1
  42. package/dist/execution-engine/node-execution-context/utils/binary-helper-functions.d.ts +10 -0
  43. package/dist/execution-engine/node-execution-context/utils/binary-helper-functions.js +183 -0
  44. package/dist/execution-engine/node-execution-context/utils/binary-helper-functions.js.map +1 -0
  45. package/dist/execution-engine/node-execution-context/utils/construct-execution-metadata.d.ts +4 -0
  46. package/dist/execution-engine/node-execution-context/utils/construct-execution-metadata.js +11 -0
  47. package/dist/execution-engine/node-execution-context/utils/construct-execution-metadata.js.map +1 -0
  48. package/dist/execution-engine/node-execution-context/utils/copy-input-items.d.ts +2 -0
  49. package/dist/execution-engine/node-execution-context/utils/copy-input-items.js +19 -0
  50. package/dist/execution-engine/node-execution-context/utils/copy-input-items.js.map +1 -0
  51. package/dist/execution-engine/node-execution-context/utils/deduplication-helper-functions.d.ts +2 -0
  52. package/dist/execution-engine/node-execution-context/utils/deduplication-helper-functions.js +38 -0
  53. package/dist/execution-engine/node-execution-context/utils/deduplication-helper-functions.js.map +1 -0
  54. package/dist/execution-engine/node-execution-context/utils/file-system-helper-functions.d.ts +3 -0
  55. package/dist/execution-engine/node-execution-context/utils/file-system-helper-functions.js +98 -0
  56. package/dist/execution-engine/node-execution-context/utils/file-system-helper-functions.js.map +1 -0
  57. package/dist/execution-engine/node-execution-context/utils/get-input-connection-data.d.ts +1 -1
  58. package/dist/execution-engine/node-execution-context/utils/get-input-connection-data.js +2 -2
  59. package/dist/execution-engine/node-execution-context/utils/get-input-connection-data.js.map +1 -1
  60. package/dist/execution-engine/node-execution-context/utils/normalize-items.d.ts +2 -0
  61. package/dist/execution-engine/node-execution-context/utils/normalize-items.js +36 -0
  62. package/dist/execution-engine/node-execution-context/utils/normalize-items.js.map +1 -0
  63. package/dist/execution-engine/node-execution-context/utils/parse-incoming-message.d.ts +16 -0
  64. package/dist/execution-engine/node-execution-context/utils/parse-incoming-message.js +57 -0
  65. package/dist/execution-engine/node-execution-context/utils/parse-incoming-message.js.map +1 -0
  66. package/dist/execution-engine/node-execution-context/utils/request-helper-functions.d.ts +16 -0
  67. package/dist/execution-engine/node-execution-context/utils/request-helper-functions.js +1158 -0
  68. package/dist/execution-engine/node-execution-context/utils/request-helper-functions.js.map +1 -0
  69. package/dist/execution-engine/node-execution-context/utils/return-json-array.d.ts +2 -0
  70. package/dist/execution-engine/node-execution-context/utils/return-json-array.js +19 -0
  71. package/dist/execution-engine/node-execution-context/utils/return-json-array.js.map +1 -0
  72. package/dist/execution-engine/node-execution-context/utils/scheduling-helper-functions.d.ts +2 -0
  73. package/dist/execution-engine/node-execution-context/utils/scheduling-helper-functions.js +13 -0
  74. package/dist/execution-engine/node-execution-context/utils/scheduling-helper-functions.js.map +1 -0
  75. package/dist/execution-engine/node-execution-context/utils/ssh-tunnel-helper-functions.d.ts +2 -0
  76. package/dist/execution-engine/node-execution-context/utils/ssh-tunnel-helper-functions.js +13 -0
  77. package/dist/execution-engine/node-execution-context/utils/ssh-tunnel-helper-functions.js.map +1 -0
  78. package/dist/execution-engine/node-execution-context/utils/webhook-helper-functions.d.ts +3 -0
  79. package/dist/execution-engine/node-execution-context/utils/webhook-helper-functions.js +31 -0
  80. package/dist/execution-engine/node-execution-context/utils/webhook-helper-functions.js.map +1 -0
  81. package/dist/execution-engine/node-execution-context/webhook-context.js +9 -6
  82. package/dist/execution-engine/node-execution-context/webhook-context.js.map +1 -1
  83. package/dist/execution-engine/routing-node.d.ts +13 -15
  84. package/dist/execution-engine/routing-node.js +42 -39
  85. package/dist/execution-engine/routing-node.js.map +1 -1
  86. package/dist/execution-engine/triggers-and-pollers.d.ts +2 -1
  87. package/dist/execution-engine/triggers-and-pollers.js +19 -23
  88. package/dist/execution-engine/triggers-and-pollers.js.map +1 -1
  89. package/dist/execution-engine/workflow-execute.d.ts +0 -1
  90. package/dist/execution-engine/workflow-execute.js +25 -27
  91. package/dist/execution-engine/workflow-execute.js.map +1 -1
  92. package/dist/node-execute-functions.d.ts +1 -63
  93. package/dist/node-execute-functions.js +0 -1641
  94. package/dist/node-execute-functions.js.map +1 -1
  95. package/package.json +5 -5
@@ -0,0 +1,98 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getFileSystemHelperFunctions = void 0;
4
+ exports.isFilePathBlocked = isFilePathBlocked;
5
+ const di_1 = require("@n8n/di");
6
+ const n8n_workflow_1 = require("n8n-workflow");
7
+ const node_fs_1 = require("node:fs");
8
+ const promises_1 = require("node:fs/promises");
9
+ const node_path_1 = require("node:path");
10
+ const constants_1 = require("../../../constants");
11
+ const instance_settings_1 = require("../../../instance-settings");
12
+ const getAllowedPaths = () => {
13
+ const restrictFileAccessTo = process.env[constants_1.RESTRICT_FILE_ACCESS_TO];
14
+ if (!restrictFileAccessTo) {
15
+ return [];
16
+ }
17
+ const allowedPaths = restrictFileAccessTo
18
+ .split(';')
19
+ .map((path) => path.trim())
20
+ .filter((path) => path);
21
+ return allowedPaths;
22
+ };
23
+ function isFilePathBlocked(filePath) {
24
+ const allowedPaths = getAllowedPaths();
25
+ const resolvedFilePath = (0, node_path_1.resolve)(filePath);
26
+ const blockFileAccessToN8nFiles = process.env[constants_1.BLOCK_FILE_ACCESS_TO_N8N_FILES] !== 'false';
27
+ if (allowedPaths.length) {
28
+ for (const path of allowedPaths) {
29
+ if (resolvedFilePath.startsWith(path)) {
30
+ return false;
31
+ }
32
+ }
33
+ return true;
34
+ }
35
+ if (blockFileAccessToN8nFiles) {
36
+ const { n8nFolder, staticCacheDir } = di_1.Container.get(instance_settings_1.InstanceSettings);
37
+ const restrictedPaths = [n8nFolder, staticCacheDir];
38
+ if (process.env[constants_1.CONFIG_FILES]) {
39
+ restrictedPaths.push(...process.env[constants_1.CONFIG_FILES].split(','));
40
+ }
41
+ if (process.env[constants_1.CUSTOM_EXTENSION_ENV]) {
42
+ const customExtensionFolders = process.env[constants_1.CUSTOM_EXTENSION_ENV].split(';');
43
+ restrictedPaths.push(...customExtensionFolders);
44
+ }
45
+ if (process.env[constants_1.BINARY_DATA_STORAGE_PATH]) {
46
+ restrictedPaths.push(process.env[constants_1.BINARY_DATA_STORAGE_PATH]);
47
+ }
48
+ if (process.env[constants_1.UM_EMAIL_TEMPLATES_INVITE]) {
49
+ restrictedPaths.push(process.env[constants_1.UM_EMAIL_TEMPLATES_INVITE]);
50
+ }
51
+ if (process.env[constants_1.UM_EMAIL_TEMPLATES_PWRESET]) {
52
+ restrictedPaths.push(process.env[constants_1.UM_EMAIL_TEMPLATES_PWRESET]);
53
+ }
54
+ for (const path of restrictedPaths) {
55
+ if (resolvedFilePath.startsWith(path)) {
56
+ return true;
57
+ }
58
+ }
59
+ }
60
+ return false;
61
+ }
62
+ const getFileSystemHelperFunctions = (node) => ({
63
+ async createReadStream(filePath) {
64
+ try {
65
+ await (0, promises_1.access)(filePath);
66
+ }
67
+ catch (error) {
68
+ throw error.code === 'ENOENT'
69
+ ?
70
+ new n8n_workflow_1.NodeOperationError(node, error, {
71
+ message: `The file "${String(filePath)}" could not be accessed.`,
72
+ level: 'warning',
73
+ })
74
+ : error;
75
+ }
76
+ if (isFilePathBlocked(filePath)) {
77
+ const allowedPaths = getAllowedPaths();
78
+ const message = allowedPaths.length ? ` Allowed paths: ${allowedPaths.join(', ')}` : '';
79
+ throw new n8n_workflow_1.NodeOperationError(node, `Access to the file is not allowed.${message}`, {
80
+ level: 'warning',
81
+ });
82
+ }
83
+ return (0, node_fs_1.createReadStream)(filePath);
84
+ },
85
+ getStoragePath() {
86
+ return (0, node_path_1.join)(di_1.Container.get(instance_settings_1.InstanceSettings).n8nFolder, `storage/${node.type}`);
87
+ },
88
+ async writeContentToFile(filePath, content, flag) {
89
+ if (isFilePathBlocked(filePath)) {
90
+ throw new n8n_workflow_1.NodeOperationError(node, `The file "${String(filePath)}" is not writable.`, {
91
+ level: 'warning',
92
+ });
93
+ }
94
+ return await (0, promises_1.writeFile)(filePath, content, { encoding: 'binary', flag });
95
+ },
96
+ });
97
+ exports.getFileSystemHelperFunctions = getFileSystemHelperFunctions;
98
+ //# sourceMappingURL=file-system-helper-functions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"file-system-helper-functions.js","sourceRoot":"","sources":["../../../../src/execution-engine/node-execution-context/utils/file-system-helper-functions.ts"],"names":[],"mappings":";;;AA8BA,8CAoDC;AAlFD,gCAAoC;AAEpC,+CAAkD;AAClD,qCAA2C;AAC3C,+CAAgF;AAChF,yCAA0C;AAE1C,2CAQqB;AACrB,2DAAuD;AAEvD,MAAM,eAAe,GAAG,GAAG,EAAE;IAC5B,MAAM,oBAAoB,GAAG,OAAO,CAAC,GAAG,CAAC,mCAAuB,CAAC,CAAC;IAClE,IAAI,CAAC,oBAAoB,EAAE,CAAC;QAC3B,OAAO,EAAE,CAAC;IACX,CAAC;IACD,MAAM,YAAY,GAAG,oBAAoB;SACvC,KAAK,CAAC,GAAG,CAAC;SACV,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;SAC1B,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC;IACzB,OAAO,YAAY,CAAC;AACrB,CAAC,CAAC;AAEF,SAAgB,iBAAiB,CAAC,QAAgB;IACjD,MAAM,YAAY,GAAG,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KAAK,EAAE,SAAS;aAChB,CAAC,CAAC;QACJ,CAAC;QACD,OAAO,IAAA,0BAAgB,EAAC,QAAQ,CAAC,CAAC;IACnC,CAAC;IAED,cAAc;QACb,OAAO,IAAA,gBAAI,EAAC,cAAS,CAAC,GAAG,CAAC,oCAAgB,CAAC,CAAC,SAAS,EAAE,WAAW,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;IAChF,CAAC;IAED,KAAK,CAAC,kBAAkB,CAAC,QAAQ,EAAE,OAAO,EAAE,IAAI;QAC/C,IAAI,iBAAiB,CAAC,QAAkB,CAAC,EAAE,CAAC;YAC3C,MAAM,IAAI,iCAAkB,CAAC,IAAI,EAAE,aAAa,MAAM,CAAC,QAAQ,CAAC,oBAAoB,EAAE;gBACrF,KAAK,EAAE,SAAS;aAChB,CAAC,CAAC;QACJ,CAAC;QACD,OAAO,MAAM,IAAA,oBAAW,EAAC,QAAQ,EAAE,OAAO,EAAE,EAAE,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;IAC3E,CAAC;CACD,CAAC,CAAC;AApCU,QAAA,4BAA4B,gCAoCtC"}
@@ -1,4 +1,4 @@
1
1
  import type { CloseFunction, IExecuteData, INodeExecutionData, IRunExecutionData, ITaskDataConnections, IWorkflowExecuteAdditionalData, Workflow, WorkflowExecuteMode, AINodeConnectionType } from 'n8n-workflow';
2
- import { SupplyDataContext } from '../../node-execution-context';
3
2
  import type { ExecuteContext, WebhookContext } from '../../node-execution-context';
3
+ import { SupplyDataContext } from '../../node-execution-context/supply-data-context';
4
4
  export declare function getInputConnectionData(this: ExecuteContext | WebhookContext | SupplyDataContext, workflow: Workflow, runExecutionData: IRunExecutionData, parentRunIndex: number, connectionInputData: INodeExecutionData[], parentInputData: ITaskDataConnections, additionalData: IWorkflowExecuteAdditionalData, executeData: IExecuteData, mode: WorkflowExecuteMode, closeFunctions: CloseFunction[], connectionType: AINodeConnectionType, itemIndex: number, abortSignal?: AbortSignal): Promise<unknown>;
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getInputConnectionData = getInputConnectionData;
4
4
  const n8n_workflow_1 = require("n8n-workflow");
5
5
  const create_node_as_tool_1 = require("./create-node-as-tool");
6
- const node_execution_context_1 = require("../../node-execution-context");
6
+ const supply_data_context_1 = require("../../node-execution-context/supply-data-context");
7
7
  async function getInputConnectionData(workflow, runExecutionData, parentRunIndex, connectionInputData, parentInputData, additionalData, executeData, mode, closeFunctions, connectionType, itemIndex, abortSignal) {
8
8
  const parentNode = this.getNode();
9
9
  const inputConfiguration = this.nodeInputs.find((input) => input.type === connectionType);
@@ -26,7 +26,7 @@ async function getInputConnectionData(workflow, runExecutionData, parentRunIndex
26
26
  const nodes = [];
27
27
  for (const connectedNode of connectedNodes) {
28
28
  const connectedNodeType = workflow.nodeTypes.getByNameAndVersion(connectedNode.type, connectedNode.typeVersion);
29
- const contextFactory = (runIndex, inputData) => new node_execution_context_1.SupplyDataContext(workflow, connectedNode, additionalData, mode, runExecutionData, runIndex, connectionInputData, inputData, connectionType, executeData, closeFunctions, abortSignal);
29
+ const contextFactory = (runIndex, inputData) => new supply_data_context_1.SupplyDataContext(workflow, connectedNode, additionalData, mode, runExecutionData, runIndex, connectionInputData, inputData, connectionType, executeData, closeFunctions, abortSignal);
30
30
  if (!connectedNodeType.supplyData) {
31
31
  if (connectedNodeType.description.outputs.includes("ai_tool")) {
32
32
  let toolRunIndex = 0;
@@ -1 +1 @@
1
- {"version":3,"file":"get-input-connection-data.js","sourceRoot":"","sources":["../../../../src/execution-engine/node-execution-context/utils/get-input-connection-data.ts"],"names":[],"mappings":";;AA0BA,wDA6JC;AAzKD,+CAKsB;AAEtB,+DAAyD;AAEzD,yEAAiE;AAG1D,KAAK,UAAU,sBAAsB,CAE3C,QAAkB,EAClB,gBAAmC,EACnC,cAAsB,EACtB,mBAAyC,EACzC,eAAqC,EACrC,cAA8C,EAC9C,WAAyB,EACzB,IAAyB,EACzB,cAA+B,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U,CAAC,OAAO,CAAC,cAAc,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;oBACzE,mBAAmB,GAAG,gBAAgB,CAAC,UAAU,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC;gBACnF,CAAC;gBAGD,MAAM,OAAO,CAAC,yBAAyB,CACtC,OAAO,EACP,KAAK,EACL,cAAc,EACd,UAAU,CAAC,IAAI,EACf,mBAAmB,CACnB,CAAC;gBAGF,MAAM,IAAI,iCAAkB,CAAC,aAAa,EAAE,qBAAqB,aAAa,CAAC,IAAI,EAAE,EAAE;oBACtF,SAAS;oBACT,aAAa,EAAE,oBAAoB;oBAEnC,WAAW,EAAE,KAAK,CAAC,OAAO;iBAC1B,CAAC,CAAC;YACJ,CAAC;QACF,CAAC;IACF,CAAC;IAED,OAAO,kBAAkB,CAAC,cAAc,KAAK,CAAC;QAC7C,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,QAAQ;QAC5B,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;AACvC,CAAC"}
1
+ {"version":3,"file":"get-input-connection-data.js","sourceRoot":"","sources":["../../../../src/execution-engine/node-execution-context/utils/get-input-connection-data.ts"],"names":[],"mappings":";;AA0BA,wDA6JC;AAzKD,+CAKsB;AAEtB,+DAAyD;AAGzD,0FAAqF;AAE9E,KAAK,UAAU,sBAAsB,CAE3C,QAAkB,EAClB,gBAAmC,EACnC,cAAsB,EACtB,mBAAyC,EACzC,eAAqC,EACrC,cAA8C,EAC9C,WAAyB,EACzB,IAAyB,EACzB,cAA+B,EAC/B,cAAoC,EACpC,SAAiB,EACjB,WAAyB;IAEzB,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,EAAE,CAAC;IAElC,MAAM,kBAAkB,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,CAA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C,MAAM,CAAC;gBACnF,CAAC;gBAGD,MAAM,OAAO,CAAC,yBAAyB,CACtC,OAAO,EACP,KAAK,EACL,cAAc,EACd,UAAU,CAAC,IAAI,EACf,mBAAmB,CACnB,CAAC;gBAGF,MAAM,IAAI,iCAAkB,CAAC,aAAa,EAAE,qBAAqB,aAAa,CAAC,IAAI,EAAE,EAAE;oBACtF,SAAS;oBACT,aAAa,EAAE,oBAAoB;oBAEnC,WAAW,EAAE,KAAK,CAAC,OAAO;iBAC1B,CAAC,CAAC;YACJ,CAAC;QACF,CAAC;IACF,CAAC;IAED,OAAO,kBAAkB,CAAC,cAAc,KAAK,CAAC;QAC7C,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,QAAQ;QAC5B,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;AACvC,CAAC"}
@@ -0,0 +1,2 @@
1
+ import type { INodeExecutionData } from 'n8n-workflow';
2
+ export declare function normalizeItems(executionData: INodeExecutionData | INodeExecutionData[]): INodeExecutionData[];
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.normalizeItems = normalizeItems;
4
+ const n8n_workflow_1 = require("n8n-workflow");
5
+ function normalizeItems(executionData) {
6
+ if (typeof executionData === 'object' && !Array.isArray(executionData)) {
7
+ executionData = executionData.json ? [executionData] : [{ json: executionData }];
8
+ }
9
+ if (executionData.every((item) => typeof item === 'object' && 'json' in item))
10
+ return executionData;
11
+ if (executionData.some((item) => typeof item === 'object' && 'json' in item)) {
12
+ throw new n8n_workflow_1.ApplicationError('Inconsistent item format');
13
+ }
14
+ if (executionData.every((item) => typeof item === 'object' && 'binary' in item)) {
15
+ const normalizedItems = [];
16
+ executionData.forEach((item) => {
17
+ const json = Object.keys(item).reduce((acc, key) => {
18
+ if (key === 'binary')
19
+ return acc;
20
+ return { ...acc, [key]: item[key] };
21
+ }, {});
22
+ normalizedItems.push({
23
+ json,
24
+ binary: item.binary,
25
+ });
26
+ });
27
+ return normalizedItems;
28
+ }
29
+ if (executionData.some((item) => typeof item === 'object' && 'binary' in item)) {
30
+ throw new n8n_workflow_1.ApplicationError('Inconsistent item format');
31
+ }
32
+ return executionData.map((item) => {
33
+ return { json: item };
34
+ });
35
+ }
36
+ //# sourceMappingURL=normalize-items.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"normalize-items.js","sourceRoot":"","sources":["../../../../src/execution-engine/node-execution-context/utils/normalize-items.ts"],"names":[],"mappings":";;AASA,wCAqCC;AA7CD,+CAAgD;AAQhD,SAAgB,cAAc,CAC7B,aAAwD;IAExD,IAAI,OAAO,aAAa,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,aAAa,CAAC,EAAE,CAAC;QACxE,aAAa,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,aAA4B,EAAE,CAAC,CAAC;IACjG,CAAC;IAED,IAAI,aAAa,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,IAAI,KAAK,QAAQ,IAAI,MAAM,IAAI,IAAI,CAAC;QAC5E,OAAO,aAAa,CAAC;IAEtB,IAAI,aAAa,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,IAAI,KAAK,QAAQ,IAAI,MAAM,IAAI,IAAI,CAAC,EAAE,CAAC;QAC9E,MAAM,IAAI,+BAAgB,CAAC,0BAA0B,CAAC,CAAC;IACxD,CAAC;IAED,IAAI,aAAa,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,IAAI,KAAK,QAAQ,IAAI,QAAQ,IAAI,IAAI,CAAC,EAAE,CAAC;QACjF,MAAM,eAAe,GAAyB,EAAE,CAAC;QACjD,aAAa,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;YAC9B,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;gBAClD,IAAI,GAAG,KAAK,QAAQ;oBAAE,OAAO,GAAG,CAAC;gBACjC,OAAO,EAAE,GAAG,GAAG,EAAE,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;YACrC,CAAC,EAAE,EAAE,CAAC,CAAC;YAEP,eAAe,CAAC,IAAI,CAAC;gBACpB,IAAI;gBACJ,MAAM,EAAE,IAAI,CAAC,MAAM;aACnB,CAAC,CAAC;QACJ,CAAC,CAAC,CAAC;QACH,OAAO,eAAe,CAAC;IACxB,CAAC;IAED,IAAI,aAAa,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,IAAI,KAAK,QAAQ,IAAI,QAAQ,IAAI,IAAI,CAAC,EAAE,CAAC;QAChF,MAAM,IAAI,+BAAgB,CAAC,0BAA0B,CAAC,CAAC;IACxD,CAAC;IAED,OAAO,aAAa,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;QACjC,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IACvB,CAAC,CAAC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,16 @@
1
+ import type { IncomingMessage } from 'http';
2
+ interface IContentType {
3
+ type: string;
4
+ parameters: {
5
+ charset: string;
6
+ [key: string]: string;
7
+ };
8
+ }
9
+ export declare const parseContentType: (contentType?: string) => IContentType | null;
10
+ interface IContentDisposition {
11
+ type: string;
12
+ filename?: string;
13
+ }
14
+ export declare const parseContentDisposition: (contentDisposition?: string) => IContentDisposition | null;
15
+ export declare function parseIncomingMessage(message: IncomingMessage): void;
16
+ export {};
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.parseContentDisposition = exports.parseContentType = void 0;
4
+ exports.parseIncomingMessage = parseIncomingMessage;
5
+ function parseHeaderParameters(parameters) {
6
+ return parameters.reduce((acc, param) => {
7
+ const [key, value] = param.split('=');
8
+ let decodedValue = decodeURIComponent(value).trim();
9
+ if (decodedValue.startsWith('"') && decodedValue.endsWith('"')) {
10
+ decodedValue = decodedValue.slice(1, -1);
11
+ }
12
+ acc[key.toLowerCase().trim()] = decodedValue;
13
+ return acc;
14
+ }, {});
15
+ }
16
+ const parseContentType = (contentType) => {
17
+ if (!contentType) {
18
+ return null;
19
+ }
20
+ const [type, ...parameters] = contentType.split(';');
21
+ return {
22
+ type: type.toLowerCase(),
23
+ parameters: { charset: 'utf-8', ...parseHeaderParameters(parameters) },
24
+ };
25
+ };
26
+ exports.parseContentType = parseContentType;
27
+ const parseContentDisposition = (contentDisposition) => {
28
+ if (!contentDisposition) {
29
+ return null;
30
+ }
31
+ if (!contentDisposition.startsWith('attachment') && !contentDisposition.startsWith('inline')) {
32
+ contentDisposition = `attachment; ${contentDisposition}`;
33
+ }
34
+ const [type, ...parameters] = contentDisposition.split(';');
35
+ const parsedParameters = parseHeaderParameters(parameters);
36
+ let { filename } = parsedParameters;
37
+ const wildcard = parsedParameters['filename*'];
38
+ if (wildcard) {
39
+ const [_encoding, _locale, content] = wildcard?.split("'") ?? [];
40
+ filename = content;
41
+ }
42
+ return { type, filename };
43
+ };
44
+ exports.parseContentDisposition = parseContentDisposition;
45
+ function parseIncomingMessage(message) {
46
+ const contentType = (0, exports.parseContentType)(message.headers['content-type']);
47
+ if (contentType) {
48
+ const { type, parameters } = contentType;
49
+ message.contentType = type;
50
+ message.encoding = parameters.charset.toLowerCase();
51
+ }
52
+ const contentDisposition = (0, exports.parseContentDisposition)(message.headers['content-disposition']);
53
+ if (contentDisposition) {
54
+ message.contentDisposition = contentDisposition;
55
+ }
56
+ }
57
+ //# sourceMappingURL=parse-incoming-message.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parse-incoming-message.js","sourceRoot":"","sources":["../../../../src/execution-engine/node-execution-context/utils/parse-incoming-message.ts"],"names":[],"mappings":";;;AAkFA,oDAYC;AA5FD,SAAS,qBAAqB,CAAC,UAAoB;IAClD,OAAO,UAAU,CAAC,MAAM,CACvB,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE;QACd,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACtC,IAAI,YAAY,GAAG,kBAAkB,CAAC,KAAK,CAAC,CAAC,IAAI,EAAE,CAAC;QACpD,IAAI,YAAY,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,YAAY,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;YAChE,YAAY,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QAC1C,CAAC;QACD,GAAG,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,YAAY,CAAC;QAC7C,OAAO,GAAG,CAAC;IACZ,CAAC,EACD,EAA4B,CAC5B,CAAC;AACH,CAAC;AAcM,MAAM,gBAAgB,GAAG,CAAC,WAAoB,EAAuB,EAAE;IAC7E,IAAI,CAAC,WAAW,EAAE,CAAC;QAClB,OAAO,IAAI,CAAC;IACb,CAAC;IAED,MAAM,CAAC,IAAI,EAAE,GAAG,UAAU,CAAC,GAAG,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IAErD,OAAO;QACN,IAAI,EAAE,IAAI,CAAC,WAAW,EAAE;QACxB,UAAU,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,qBAAqB,CAAC,UAAU,CAAC,EAAE;KACtE,CAAC;AACH,CAAC,CAAC;AAXW,QAAA,gBAAgB,oBAW3B;AAWK,MAAM,uBAAuB,GAAG,CACtC,kBAA2B,EACE,EAAE;IAC/B,IAAI,CAAC,kBAAkB,EAAE,CAAC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,kBAAkB,EAAE,CAAC;QACxB,OAAO,CAAC,kBAAkB,GAAG,kBAAkB,CAAC;IACjD,CAAC;AACF,CAAC"}
@@ -0,0 +1,16 @@
1
+ import type { AxiosRequestConfig, AxiosResponse } from 'axios';
2
+ import FormData from 'form-data';
3
+ import type { IAdditionalCredentialOptions, IAllExecuteFunctions, IHttpRequestOptions, IN8nHttpFullResponse, IN8nHttpResponse, INode, INodeExecutionData, IOAuth2Options, IRequestOptions, IRunExecutionData, IWorkflowExecuteAdditionalData, PaginationOptions, RequestHelperFunctions, Workflow } from 'n8n-workflow';
4
+ export declare function invokeAxios(axiosConfig: AxiosRequestConfig, authOptions?: IRequestOptions['auth']): Promise<AxiosResponse<any, any>>;
5
+ export declare const createFormDataObject: (data: Record<string, unknown>) => FormData;
6
+ export declare function parseRequestObject(requestObject: IRequestOptions): Promise<AxiosRequestConfig<any>>;
7
+ export declare function proxyRequestToAxios(workflow: Workflow | undefined, additionalData: IWorkflowExecuteAdditionalData | undefined, node: INode | undefined, uriOrObject: string | IRequestOptions, options?: IRequestOptions): Promise<any>;
8
+ export declare function convertN8nRequestToAxios(n8nRequest: IHttpRequestOptions): AxiosRequestConfig;
9
+ export declare const removeEmptyBody: (requestOptions: IHttpRequestOptions | IRequestOptions) => void;
10
+ export declare function httpRequest(requestOptions: IHttpRequestOptions): Promise<IN8nHttpFullResponse | IN8nHttpResponse>;
11
+ export declare function applyPaginationRequestData(requestData: IRequestOptions, paginationRequestData: PaginationOptions['request']): IRequestOptions;
12
+ export declare function requestOAuth2(this: IAllExecuteFunctions, credentialsType: string, requestOptions: IHttpRequestOptions | IRequestOptions, node: INode, additionalData: IWorkflowExecuteAdditionalData, oAuth2Options?: IOAuth2Options, isN8nRequest?: boolean): Promise<any>;
13
+ export declare function requestOAuth1(this: IAllExecuteFunctions, credentialsType: string, requestOptions: IHttpRequestOptions | IRequestOptions, isN8nRequest?: boolean): Promise<any>;
14
+ export declare function httpRequestWithAuthentication(this: IAllExecuteFunctions, credentialsType: string, requestOptions: IHttpRequestOptions, workflow: Workflow, node: INode, additionalData: IWorkflowExecuteAdditionalData, additionalCredentialOptions?: IAdditionalCredentialOptions): Promise<any>;
15
+ export declare function requestWithAuthentication(this: IAllExecuteFunctions, credentialsType: string, requestOptions: IRequestOptions, workflow: Workflow, node: INode, additionalData: IWorkflowExecuteAdditionalData, additionalCredentialOptions?: IAdditionalCredentialOptions, itemIndex?: number): Promise<any>;
16
+ export declare const getRequestHelperFunctions: (workflow: Workflow, node: INode, additionalData: IWorkflowExecuteAdditionalData, runExecutionData?: IRunExecutionData | null, connectionInputData?: INodeExecutionData[]) => RequestHelperFunctions;