n8n-workflow 2.42.3 → 2.42.4

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.
@@ -1,33 +1,24 @@
1
1
  import { N8N_NODES_API_VERSION } from '@n8n/constants';
2
- export { N8N_NODES_API_VERSION };
2
+ import { formatNodesApiLevel, parseNodesApiLevel } from '@n8n/utils/nodes-api-level';
3
+ export { N8N_NODES_API_VERSION, formatNodesApiLevel, parseNodesApiLevel };
3
4
  /** Minimal package.json shape needed to check node API compatibility. */
4
5
  export interface NodesApiVersionPackageJson {
5
6
  n8n?: {
6
- /**
7
- * Node-authoring API level the package requires. Absent in legacy
8
- * packages, which are treated as requiring level 1.
9
- */
10
7
  n8nNodesApiVersion?: unknown;
11
8
  };
12
9
  }
13
10
  export type NodesApiVersionCheck = {
14
11
  compatible: true;
15
- /** Effective required API level; 1 for packages without metadata. */
16
- version: number;
17
12
  } | {
18
13
  compatible: false;
19
- reason: 'malformed' | 'unsupported';
20
- /** The declared value, as read from package.json. */
14
+ reason: 'malformed';
21
15
  declared: unknown;
16
+ } | {
17
+ compatible: false;
18
+ reason: 'unsupported';
19
+ declared: unknown;
20
+ /** As `<major>.<minor>`, for messages and metadata. */
21
+ required: string;
22
22
  };
23
- /**
24
- * Read a community package's declared node-authoring API level and check it
25
- * against the level this runtime supports (`required <= N8N_NODES_API_VERSION`).
26
- *
27
- * Missing `n8n.n8nNodesApiVersion` means a legacy package and resolves to
28
- * level 1. Malformed values (non-integer, non-positive, non-number) are
29
- * reported as incompatible — the runtime cannot distinguish an old package
30
- * from a corrupt or hostile one if both fall back to legacy.
31
- */
32
23
  export declare function checkNodesApiVersion(pkgJson: NodesApiVersionPackageJson): NodesApiVersionCheck;
33
24
  //# sourceMappingURL=nodes-api-version.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"nodes-api-version.d.ts","sourceRoot":"","sources":["../../src/nodes-api-version.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,q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EAAE,MAAM,CAAC;CAChB,CAAC;AAWL,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,0BAA0B,GAAG,oBAAoB,CAgB9F"}
@@ -1,29 +1,34 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.N8N_NODES_API_VERSION = void 0;
3
+ exports.parseNodesApiLevel = exports.formatNodesApiLevel = exports.N8N_NODES_API_VERSION = void 0;
4
4
  exports.checkNodesApiVersion = checkNodesApiVersion;
5
5
  const constants_1 = require("@n8n/constants");
6
6
  Object.defineProperty(exports, "N8N_NODES_API_VERSION", { enumerable: true, get: function () { return constants_1.N8N_NODES_API_VERSION; } });
7
- /**
8
- * Read a community package's declared node-authoring API level and check it
9
- * against the level this runtime supports (`required <= N8N_NODES_API_VERSION`).
10
- *
11
- * Missing `n8n.n8nNodesApiVersion` means a legacy package and resolves to
12
- * level 1. Malformed values (non-integer, non-positive, non-number) are
13
- * reported as incompatible — the runtime cannot distinguish an old package
14
- * from a corrupt or hostile one if both fall back to legacy.
15
- */
7
+ const nodes_api_level_1 = require("@n8n/utils/nodes-api-level");
8
+ Object.defineProperty(exports, "formatNodesApiLevel", { enumerable: true, get: function () { return nodes_api_level_1.formatNodesApiLevel; } });
9
+ Object.defineProperty(exports, "parseNodesApiLevel", { enumerable: true, get: function () { return nodes_api_level_1.parseNodesApiLevel; } });
10
+ function supportedLevel() {
11
+ const level = (0, nodes_api_level_1.parseNodesApiLevel)(constants_1.N8N_NODES_API_VERSION);
12
+ if (level === null)
13
+ throw new Error(`N8N_NODES_API_VERSION is not a level: ${constants_1.N8N_NODES_API_VERSION}`);
14
+ return level;
15
+ }
16
+ // A missing declaration is a legacy package at level 1. A malformed one is
17
+ // incompatible: the runtime cannot tell an old package from a corrupt one.
16
18
  function checkNodesApiVersion(pkgJson) {
17
19
  const declared = pkgJson?.n8n?.n8nNodesApiVersion;
18
- if (declared === undefined) {
19
- return { compatible: true, version: 1 };
20
- }
21
- if (typeof declared !== 'number' || !Number.isInteger(declared) || declared < 1) {
20
+ if (declared === undefined)
21
+ return { compatible: true };
22
+ const required = (0, nodes_api_level_1.parseNodesApiLevel)(declared);
23
+ if (required === null)
22
24
  return { compatible: false, reason: 'malformed', declared };
23
- }
24
- if (declared <= constants_1.N8N_NODES_API_VERSION) {
25
- return { compatible: true, version: declared };
26
- }
27
- return { compatible: false, reason: 'unsupported', declared };
25
+ if (required.compare(supportedLevel()) <= 0)
26
+ return { compatible: true };
27
+ return {
28
+ compatible: false,
29
+ reason: 'unsupported',
30
+ declared,
31
+ required: (0, nodes_api_level_1.formatNodesApiLevel)(required),
32
+ };
28
33
  }
29
34
  //# sourceMappingURL=nodes-api-version.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"nodes-api-version.js","sourceRoot":"","sources":["../../src/nodes-api-version.ts"],"names":[],"mappings":";;;;AAAA,8CAAuD;sGAA9C,iCAAqB;AA4B9B;;;;;;;;GAQG;AACH,8BAAqC,OAAmC;IACvE,MAAM,QAAQ,GAAG,OAAO,EAAE,GAAG,EAAE,kBAAkB,CAAC;IAElD,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;QAC5B,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;IACzC,CAAC;IAED,IAAI,OAAO,QAAQ,KAAK,QAAQ,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,QAAQ,GAAG,CAAC,EAAE,CAAC;QACjF,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,CAAC;IAC7D,CAAC;IAED,IAAI,QAAQ,IAAI,iCAAqB,EAAE,CAAC;QACvC,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC;IAChD,CAAC;IAED,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,QAAQ,EAAE,CAAC;AAC/D,CAAC"}
1
+ {"version":3,"file":"nodes-api-version.js","sourceRoot":"","sources":["../../src/nodes-api-version.ts"],"names":[],"mappings":";;;;AAAA,8CAAuD;sGAA9C,iCAAqB;AAC9B,gEAAqF;oGAA5E,qCAAmB;mGAAE,oCAAkB;AA0BhD,SAAS,cAAc;IACtB,MAAM,KAAK,GAAG,IAAA,oCAAkB,EAAC,iCAAqB,CAAC,CAAC;IACxD,IAAI,KAAK,KAAK,IAAI;QACjB,MAAM,IAAI,KAAK,CAAC,yCAAyC,iCAAqB,EAAE,CAAC,CAAC;IACnF,OAAO,KAAK,CAAC;AACd,CAAC;AAED,2EAA2E;AAC3E,2EAA2E;AAC3E,8BAAqC,OAAmC;IACvE,MAAM,QAAQ,GAAG,OAAO,EAAE,GAAG,EAAE,kBAAkB,CAAC;IAElD,IAAI,QAAQ,KAAK,SAAS;QAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC;IAExD,MAAM,QAAQ,GAAG,IAAA,oCAAkB,EAAC,QAAQ,CAAC,CAAC;IAC9C,IAAI,QAAQ,KAAK,IAAI;QAAE,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,CAAC;IAEnF,IAAI,QAAQ,CAAC,OAAO,CAAC,cAAc,EAAE,CAAC,IAAI,CAAC;QAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC;IAEzE,OAAO;QACN,UAAU,EAAE,KAAK;QACjB,MAAM,EAAE,aAAa;QACrB,QAAQ;QACR,QAAQ,EAAE,IAAA,qCAAmB,EAAC,QAAQ,CAAC;KACvC,CAAC;AACH,CAAC"}
@@ -1,33 +1,24 @@
1
1
  import { N8N_NODES_API_VERSION } from '@n8n/constants';
2
- export { N8N_NODES_API_VERSION };
2
+ import { formatNodesApiLevel, parseNodesApiLevel } from '@n8n/utils/nodes-api-level';
3
+ export { N8N_NODES_API_VERSION, formatNodesApiLevel, parseNodesApiLevel };
3
4
  /** Minimal package.json shape needed to check node API compatibility. */
4
5
  export interface NodesApiVersionPackageJson {
5
6
  n8n?: {
6
- /**
7
- * Node-authoring API level the package requires. Absent in legacy
8
- * packages, which are treated as requiring level 1.
9
- */
10
7
  n8nNodesApiVersion?: unknown;
11
8
  };
12
9
  }
13
10
  export type NodesApiVersionCheck = {
14
11
  compatible: true;
15
- /** Effective required API level; 1 for packages without metadata. */
16
- version: number;
17
12
  } | {
18
13
  compatible: false;
19
- reason: 'malformed' | 'unsupported';
20
- /** The declared value, as read from package.json. */
14
+ reason: 'malformed';
21
15
  declared: unknown;
16
+ } | {
17
+ compatible: false;
18
+ reason: 'unsupported';
19
+ declared: unknown;
20
+ /** As `<major>.<minor>`, for messages and metadata. */
21
+ required: string;
22
22
  };
23
- /**
24
- * Read a community package's declared node-authoring API level and check it
25
- * against the level this runtime supports (`required <= N8N_NODES_API_VERSION`).
26
- *
27
- * Missing `n8n.n8nNodesApiVersion` means a legacy package and resolves to
28
- * level 1. Malformed values (non-integer, non-positive, non-number) are
29
- * reported as incompatible — the runtime cannot distinguish an old package
30
- * from a corrupt or hostile one if both fall back to legacy.
31
- */
32
23
  export declare function checkNodesApiVersion(pkgJson: NodesApiVersionPackageJson): NodesApiVersionCheck;
33
24
  //# sourceMappingURL=nodes-api-version.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"nodes-api-version.d.ts","sourceRoot":"","sources":["../../src/nodes-api-version.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAEvD,OAAO,EAAE,qBAAqB,EAAE,CAAC;AAEjC,yEAAyE;AACzE,MAAM,WAAW,0BAA0B;IAC1C,GAAG,CAAC,EAAE;QACL;;;WAGG;QACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;KAC7B,CAAC;CACF;AAED,MAAM,MAAM,oBAAoB,GAC7B;IACA,UAAU,EAAE,IAAI,CAAC;IACjB,qEAAqE;IACrE,OAAO,EAAE,MAAM,CAAC;CACf,GACD;IACA,UAAU,EAAE,KAAK,CAAC;IAClB,MAAM,EAAE,WAAW,GAAG,aAAa,CAAC;IACpC,qDAAqD;IACrD,QAAQ,EAAE,OAAO,CAAC;CACjB,CAAC;AAEL;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,0BAA0B,GAAG,oBAAoB,CAgB9F"}
1
+ {"version":3,"file":"nodes-api-version.d.ts","sourceRoot":"","sources":["../../src/nodes-api-version.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AACvD,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAErF,OAAO,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,CAAC;AAE1E,yEAAyE;AACzE,MAAM,WAAW,0BAA0B;IAC1C,GAAG,CAAC,EAAE;QACL,kBAAkB,CAAC,EAAE,OAAO,CAAC;KAC7B,CAAC;CACF;AAED,MAAM,MAAM,oBAAoB,GAC7B;IAAE,UAAU,EAAE,IAAI,CAAA;CAAE,GACpB;IACA,UAAU,EAAE,KAAK,CAAC;IAClB,MAAM,EAAE,WAAW,CAAC;IACpB,QAAQ,EAAE,OAAO,CAAC;CACjB,GACD;IACA,UAAU,EAAE,KAAK,CAAC;IAClB,MAAM,EAAE,aAAa,CAAC;IACtB,QAAQ,EAAE,OAAO,CAAC;IAClB,uDAAuD;IACvD,QAAQ,EAAE,MAAM,CAAC;CAChB,CAAC;AAWL,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,0BAA0B,GAAG,oBAAoB,CAgB9F"}
@@ -1,25 +1,28 @@
1
1
  import { N8N_NODES_API_VERSION } from '@n8n/constants';
2
- export { N8N_NODES_API_VERSION };
3
- /**
4
- * Read a community package's declared node-authoring API level and check it
5
- * against the level this runtime supports (`required <= N8N_NODES_API_VERSION`).
6
- *
7
- * Missing `n8n.n8nNodesApiVersion` means a legacy package and resolves to
8
- * level 1. Malformed values (non-integer, non-positive, non-number) are
9
- * reported as incompatible — the runtime cannot distinguish an old package
10
- * from a corrupt or hostile one if both fall back to legacy.
11
- */
2
+ import { formatNodesApiLevel, parseNodesApiLevel } from '@n8n/utils/nodes-api-level';
3
+ export { N8N_NODES_API_VERSION, formatNodesApiLevel, parseNodesApiLevel };
4
+ function supportedLevel() {
5
+ const level = parseNodesApiLevel(N8N_NODES_API_VERSION);
6
+ if (level === null)
7
+ throw new Error(`N8N_NODES_API_VERSION is not a level: ${N8N_NODES_API_VERSION}`);
8
+ return level;
9
+ }
10
+ // A missing declaration is a legacy package at level 1. A malformed one is
11
+ // incompatible: the runtime cannot tell an old package from a corrupt one.
12
12
  export function checkNodesApiVersion(pkgJson) {
13
13
  const declared = pkgJson?.n8n?.n8nNodesApiVersion;
14
- if (declared === undefined) {
15
- return { compatible: true, version: 1 };
16
- }
17
- if (typeof declared !== 'number' || !Number.isInteger(declared) || declared < 1) {
14
+ if (declared === undefined)
15
+ return { compatible: true };
16
+ const required = parseNodesApiLevel(declared);
17
+ if (required === null)
18
18
  return { compatible: false, reason: 'malformed', declared };
19
- }
20
- if (declared <= N8N_NODES_API_VERSION) {
21
- return { compatible: true, version: declared };
22
- }
23
- return { compatible: false, reason: 'unsupported', declared };
19
+ if (required.compare(supportedLevel()) <= 0)
20
+ return { compatible: true };
21
+ return {
22
+ compatible: false,
23
+ reason: 'unsupported',
24
+ declared,
25
+ required: formatNodesApiLevel(required),
26
+ };
24
27
  }
25
28
  //# sourceMappingURL=nodes-api-version.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"nodes-api-version.js","sourceRoot":"","sources":["../../src/nodes-api-version.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAEvD,OAAO,EAAE,qBAAqB,EAAE,CAAC;AA0BjC;;;;;;;;GAQG;AACH,MAAM,UAAU,oBAAoB,CAAC,OAAmC;IACvE,MAAM,Q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