n8n-core 1.107.1 → 1.108.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 (24) hide show
  1. package/dist/build.tsbuildinfo +1 -1
  2. package/dist/errors/error-reporter.d.ts +2 -1
  3. package/dist/errors/error-reporter.js +5 -2
  4. package/dist/errors/error-reporter.js.map +1 -1
  5. package/dist/execution-engine/index.d.ts +2 -0
  6. package/dist/execution-engine/index.js.map +1 -1
  7. package/dist/execution-engine/node-execution-context/execute-context.js +2 -0
  8. package/dist/execution-engine/node-execution-context/execute-context.js.map +1 -1
  9. package/dist/execution-engine/node-execution-context/load-options-context.js +2 -0
  10. package/dist/execution-engine/node-execution-context/load-options-context.js.map +1 -1
  11. package/dist/execution-engine/node-execution-context/supply-data-context.js +2 -0
  12. package/dist/execution-engine/node-execution-context/supply-data-context.js.map +1 -1
  13. package/dist/execution-engine/node-execution-context/utils/data-store-helper-functions.d.ts +2 -0
  14. package/dist/execution-engine/node-execution-context/utils/data-store-helper-functions.js +13 -0
  15. package/dist/execution-engine/node-execution-context/utils/data-store-helper-functions.js.map +1 -0
  16. package/dist/execution-engine/node-execution-context/utils/file-system-helper-functions.js +8 -8
  17. package/dist/execution-engine/node-execution-context/utils/file-system-helper-functions.js.map +1 -1
  18. package/dist/execution-engine/workflow-execute.d.ts +10 -1
  19. package/dist/execution-engine/workflow-execute.js +129 -100
  20. package/dist/execution-engine/workflow-execute.js.map +1 -1
  21. package/dist/html-sandbox.d.ts +2 -6
  22. package/dist/html-sandbox.js +7 -100
  23. package/dist/html-sandbox.js.map +1 -1
  24. package/package.json +8 -8
@@ -1,109 +1,16 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isHtmlRenderedContentType = exports.createHtmlSandboxTransformStream = exports.bufferEscapeHtml = exports.sandboxHtmlResponse = exports.hasHtml = exports.isIframeSandboxDisabled = void 0;
3
+ exports.isHtmlRenderedContentType = exports.getWebhookSandboxCSP = exports.isWebhookHtmlSandboxingDisabled = void 0;
4
4
  const config_1 = require("@n8n/config");
5
5
  const di_1 = require("@n8n/di");
6
- const htmlparser2_1 = require("htmlparser2");
7
- const stream_1 = require("stream");
8
- const isIframeSandboxDisabled = () => {
9
- return di_1.Container.get(config_1.SecurityConfig).disableIframeSandboxing;
6
+ const isWebhookHtmlSandboxingDisabled = () => {
7
+ return di_1.Container.get(config_1.SecurityConfig).disableWebhookHtmlSandboxing;
10
8
  };
11
- exports.isIframeSandboxDisabled = isIframeSandboxDisabled;
12
- const hasHtml = (str) => {
13
- try {
14
- const doc = (0, htmlparser2_1.parseDocument)(str);
15
- return doc.children.some((node) => node.type === htmlparser2_1.ElementType.Tag);
16
- }
17
- catch {
18
- return false;
19
- }
9
+ exports.isWebhookHtmlSandboxingDisabled = isWebhookHtmlSandboxingDisabled;
10
+ const getWebhookSandboxCSP = () => {
11
+ return 'sandbox allow-downloads allow-forms allow-modals allow-orientation-lock allow-pointer-lock allow-popups allow-presentation allow-scripts allow-top-navigation allow-top-navigation-by-user-activation allow-top-navigation-to-custom-protocols';
20
12
  };
21
- exports.hasHtml = hasHtml;
22
- const sandboxHtmlResponse = (data, forceSandbox = false) => {
23
- if ((0, exports.isIframeSandboxDisabled)())
24
- return data;
25
- let text;
26
- if (typeof data !== 'string') {
27
- text = JSON.stringify(data);
28
- }
29
- else {
30
- text = data;
31
- }
32
- if (!forceSandbox && !(0, exports.hasHtml)(text))
33
- return text;
34
- const escapedHtml = text.replaceAll('&', '&').replaceAll('"', '"');
35
- return `<iframe srcdoc="${escapedHtml}" sandbox="allow-scripts allow-forms allow-popups allow-modals allow-orientation-lock allow-pointer-lock allow-presentation allow-popups-to-escape-sandbox allow-top-navigation-by-user-activation"
36
- style="position:fixed; top:0; left:0; width:100vw; height:100vh; border:none; overflow:auto;"
37
- allowtransparency="true"></iframe>`;
38
- };
39
- exports.sandboxHtmlResponse = sandboxHtmlResponse;
40
- const bufferEscapeHtml = (input) => {
41
- const ampersand = Buffer.from('&', 'utf8').readUInt8(0);
42
- const escapedAmpersand = Buffer.from('&amp;', 'utf8');
43
- const doublequote = Buffer.from('"', 'utf8').readUInt8(0);
44
- const escapedDoublequote = Buffer.from('&quot;', 'utf8');
45
- let ampersandCount = 0;
46
- let doublequoteCount = 0;
47
- for (let i = 0; i < input.length; i++) {
48
- if (input[i] === ampersand)
49
- ampersandCount++;
50
- else if (input[i] === doublequote)
51
- doublequoteCount++;
52
- }
53
- if (ampersandCount === 0 && doublequoteCount === 0)
54
- return Buffer.from(input);
55
- const resultLength = input.length +
56
- ampersandCount * (escapedAmpersand.length - 1) +
57
- doublequoteCount * (escapedDoublequote.length - 1);
58
- const output = Buffer.alloc(resultLength);
59
- let writeOffset = 0;
60
- for (let i = 0; i < input.length; i++) {
61
- if (input[i] === ampersand) {
62
- escapedAmpersand.copy(output, writeOffset);
63
- writeOffset += escapedAmpersand.length;
64
- }
65
- else if (input[i] === doublequote) {
66
- escapedDoublequote.copy(output, writeOffset);
67
- writeOffset += escapedDoublequote.length;
68
- }
69
- else {
70
- output[writeOffset++] = input[i];
71
- }
72
- }
73
- return output;
74
- };
75
- exports.bufferEscapeHtml = bufferEscapeHtml;
76
- const createHtmlSandboxTransformStream = () => {
77
- let isFirstChunk = true;
78
- const prefix = Buffer.from('<iframe srcdoc="', 'utf8');
79
- const suffix = Buffer.from('" sandbox="allow-scripts allow-forms allow-popups allow-modals allow-orientation-lock allow-pointer-lock allow-presentation allow-popups-to-escape-sandbox allow-top-navigation-by-user-activation" style="position:fixed; top:0; left:0; width:100vw; height:100vh; border:none; overflow:auto;" allowtransparency="true"></iframe>', 'utf8');
80
- return new stream_1.Transform({
81
- transform(chunk, encoding, done) {
82
- try {
83
- chunk = Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk, encoding);
84
- const escapedChunk = (0, exports.bufferEscapeHtml)(chunk);
85
- const transformedChunk = isFirstChunk
86
- ? Buffer.concat([prefix, escapedChunk])
87
- : escapedChunk;
88
- isFirstChunk = false;
89
- done(null, transformedChunk);
90
- }
91
- catch (error) {
92
- done(error);
93
- }
94
- },
95
- flush(done) {
96
- try {
97
- this.push(isFirstChunk ? Buffer.concat([prefix, suffix]) : suffix);
98
- done();
99
- }
100
- catch (error) {
101
- done(error);
102
- }
103
- },
104
- });
105
- };
106
- exports.createHtmlSandboxTransformStream = createHtmlSandboxTransformStream;
13
+ exports.getWebhookSandboxCSP = getWebhookSandboxCSP;
107
14
  const isHtmlRenderedContentType = (contentType) => {
108
15
  const contentTypeLower = contentType.toLowerCase();
109
16
  return (contentTypeLower.startsWith('text/html') || contentTypeLower.startsWith('application/xhtml+xml'));
@@ -1 +1 @@
1
- {"version":3,"file":"html-sandbox.js","sourceRoot":"","sources":["../src/html-sandbox.ts"],"names":[],"mappings":";;;AAAA,wCAA6C;AAC7C,gCAAoC;AACpC,6CAAyD;AAEzD,mCAAmC;AAE5B,MAAM,uBAAuB,GAAG,GAAG,EAAE;IAC3C,OAAO,cAAS,CAAC,GAAG,CAAC,uBAAc,CAAC,CAAC,uBAAuB,CAAC;AAC9D,CAAC,CAAC;AAFW,QAAA,uBAAuB,2BAElC;AAKK,MAAM,OAAO,GAAG,CAAC,GAAW,EAAE,EAAE;IACtC,IAAI,CAAC;QACJ,MAAM,GAAG,GAAG,IAAA,2BAAa,EAAC,GAAG,CAAC,CAAC;QAC/B,OAAO,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,yBAAW,CAAC,GAAG,CAAC,CAAC;IACnE,CAAC;IAAC,MAAM,CAAC;QACR,OAAO,KAAK,CAAC;IACd,CAAC;AACF,CAAC,CAAC;AAPW,QAAA,OAAO,WAOlB;AAYK,MAAM,mBAAmB,GAAG,CAAI,IAAO,EAAE,YAAY,GAAG,KAAK,EAAE,EAAE;IACvE,IAAI,IAAA,+BAAuB,GAAE;QAAE,OAAO,IAAI,CAAC;IAE3C,I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gBAAgB,CAAC,UAAU,CAAC,WAAW,CAAC,IAAI,gBAAgB,CAAC,UAAU,CAAC,uBAAuB,CAAC,CAChG,CAAC;AACH,CAAC,CAAC;AAPW,QAAA,yBAAyB,6BAOpC"}
1
+ {"version":3,"file":"html-sandbox.js","sourceRoot":"","sources":["../src/html-sandbox.ts"],"names":[],"mappings":";;;AAAA,wCAA6C;AAC7C,gCAAoC;AAE7B,MAAM,+BAA+B,GAAG,GAAG,EAAE;IACnD,OAAO,cAAS,CAAC,GAAG,CAAC,uBAAc,CAAC,CAAC,4BAA4B,CAAC;AACnE,CAAC,CAAC;AAFW,QAAA,+BAA+B,mCAE1C;AAKK,MAAM,oBAAoB,GAAG,GAAW,EAAE;IAChD,OAAO,gPAAgP,CAAC;AACzP,CAAC,CAAC;AAFW,QAAA,oBAAoB,wBAE/B;AAMK,MAAM,yBAAyB,GAAG,CAAC,WAAmB,EAAE,EAAE;IAChE,MAAM,gBAAgB,GAAG,WAAW,CAAC,WAAW,EAAE,CAAC;IAEnD,OAAO,CAEN,gBAAgB,CAAC,UAAU,CAAC,WAAW,CAAC,IAAI,gBAAgB,CAAC,UAAU,CAAC,uBAAuB,CAAC,CAChG,CAAC;AACH,CAAC,CAAC;AAPW,QAAA,yBAAyB,6BAOpC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n8n-core",
3
- "version": "1.107.1",
3
+ "version": "1.108.0",
4
4
  "description": "Core functionality of n8n",
5
5
  "main": "dist/index",
6
6
  "types": "dist/index.d.ts",
@@ -23,8 +23,8 @@
23
23
  "@types/proxy-from-env": "^1.0.4",
24
24
  "@types/uuid": "^10.0.0",
25
25
  "@types/xml2js": "^0.4.14",
26
- "@n8n/errors": "^0.4.0",
27
- "@n8n/typescript-config": "1.3.0"
26
+ "@n8n/typescript-config": "1.3.0",
27
+ "@n8n/errors": "^0.4.0"
28
28
  },
29
29
  "dependencies": {
30
30
  "@aws-sdk/client-s3": "3.808.0",
@@ -58,13 +58,13 @@
58
58
  "winston": "3.14.2",
59
59
  "xml2js": "0.6.2",
60
60
  "zod": "3.25.67",
61
- "@n8n/backend-common": "^0.18.0",
61
+ "@n8n/client-oauth2": "0.28.0",
62
+ "@n8n/config": "1.52.0",
62
63
  "@n8n/constants": "0.11.0",
63
- "@n8n/decorators": "0.18.0",
64
- "@n8n/config": "1.51.0",
64
+ "@n8n/backend-common": "^0.19.0",
65
+ "@n8n/decorators": "0.19.0",
65
66
  "@n8n/di": "0.9.0",
66
- "@n8n/client-oauth2": "0.28.0",
67
- "n8n-workflow": "1.105.0"
67
+ "n8n-workflow": "1.106.0"
68
68
  },
69
69
  "license": "SEE LICENSE IN LICENSE.md",
70
70
  "homepage": "https://n8n.io",