@n8n/workflow-sdk 0.30.0 → 0.31.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/index.d.ts CHANGED
@@ -15,6 +15,9 @@ export { runOnceForAllItems, runOnceForEachItem } from './utils/code-helpers';
15
15
  export { dropInvalidWorkflowJsonGroups, toEngineConnections, toGroupValidationNodes, } from './utils/workflow-json-engine-helpers';
16
16
  export { isPlainObject, getProperty, hasProperty } from './utils/safe-access';
17
17
  export { validateWorkflow, ValidationError, ValidationWarning, getSchemaBaseDirs, setSchemaBaseDirs, type ValidationResult, type ValidationOptions, type ValidationErrorCode, validateNodeConfig, type SchemaValidationResult, type IssueSeverity, isInformationalIssue, partitionValidationIssues, validateWorkflowBuilder, type ValidateWorkflowBuilderOptions, type ValidateWorkflowBuilderResult, type CollectedValidationIssue, } from './validation';
18
+ export { lintPythonCode } from './lint/code-node/python';
19
+ export type { SourceLintIssue } from './lint/types';
20
+ export type { CodeExecutionMode } from './lint/code-node/extract-snippets';
18
21
  export { generateWorkflowCode } from './codegen/index';
19
22
  export { emitInstanceAi, SDK_IMPORTABLE_FUNCTIONS, type EmitInstanceAiOptions, } from './codegen/index';
20
23
  export { parseWorkflowCode, parseWorkflowCodeToBuilder } from './codegen/parse-workflow-code';
package/dist/index.js CHANGED
@@ -14,8 +14,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.parseWorkflowCode = exports.SDK_IMPORTABLE_FUNCTIONS = exports.emitInstanceAi = exports.generateWorkflowCode = exports.validateWorkflowBuilder = exports.partitionValidationIssues = exports.isInformationalIssue = exports.validateNodeConfig = exports.setSchemaBaseDirs = exports.getSchemaBaseDirs = exports.ValidationWarning = exports.ValidationError = exports.validateWorkflow = exports.hasProperty = exports.getProperty = exports.isPlainObject = exports.toGroupValidationNodes = exports.toEngineConnections = exports.dropInvalidWorkflowJsonGroups = exports.runOnceForEachItem = exports.runOnceForAllItems = exports.createFromAIExpression = exports.nodeJson = exports.expr = exports.isExpression = exports.parseExpression = exports.nextBatch = exports.splitInBatches = exports.fromAi = exports.textSplitter = exports.documentLoader = exports.retriever = exports.vectorStore = exports.embeddings = exports.embedding = exports.outputParser = exports.tool = exports.memory = exports.languageModel = exports.merge = exports.switchCase = exports.ifElse = exports.newCredential = exports.placeholder = exports.sticky = exports.trigger = exports.node = exports.workflow = exports.isNodeInstance = exports.isNodeChain = void 0;
18
- exports.NODE_Y_SPACING = exports.NODE_X_SPACING = exports.DEFAULT_NODE_SIZE = exports.GRID_SIZE = exports.isDataTableType = exports.isWebhookType = exports.isHttpRequestType = exports.isSplitInBatchesType = exports.isStickyNoteType = exports.isMergeNodeType = exports.isSwitchNodeType = exports.isIfNodeType = exports.NODE_TYPES = exports.matchesDisplayOptions = exports.normalizePinData = exports.inferSchemasFromRunData = exports.discoverOutputSchemaForNode = exports.needsPinData = exports.registerDefaultPlugins = exports.pluginRegistry = exports.PluginRegistry = exports.parseWorkflowCodeToBuilder = void 0;
17
+ exports.SDK_IMPORTABLE_FUNCTIONS = exports.emitInstanceAi = exports.generateWorkflowCode = exports.lintPythonCode = exports.validateWorkflowBuilder = exports.partitionValidationIssues = exports.isInformationalIssue = exports.validateNodeConfig = exports.setSchemaBaseDirs = exports.getSchemaBaseDirs = exports.ValidationWarning = exports.ValidationError = exports.validateWorkflow = exports.hasProperty = exports.getProperty = exports.isPlainObject = exports.toGroupValidationNodes = exports.toEngineConnections = exports.dropInvalidWorkflowJsonGroups = exports.runOnceForEachItem = exports.runOnceForAllItems = exports.createFromAIExpression = exports.nodeJson = exports.expr = exports.isExpression = exports.parseExpression = exports.nextBatch = exports.splitInBatches = exports.fromAi = exports.textSplitter = exports.documentLoader = exports.retriever = exports.vectorStore = exports.embeddings = exports.embedding = exports.outputParser = exports.tool = exports.memory = exports.languageModel = exports.merge = exports.switchCase = exports.ifElse = exports.newCredential = exports.placeholder = exports.sticky = exports.trigger = exports.node = exports.workflow = exports.isNodeInstance = exports.isNodeChain = void 0;
18
+ exports.NODE_Y_SPACING = exports.NODE_X_SPACING = exports.DEFAULT_NODE_SIZE = exports.GRID_SIZE = exports.isDataTableType = exports.isWebhookType = exports.isHttpRequestType = exports.isSplitInBatchesType = exports.isStickyNoteType = exports.isMergeNodeType = exports.isSwitchNodeType = exports.isIfNodeType = exports.NODE_TYPES = exports.matchesDisplayOptions = exports.normalizePinData = exports.inferSchemasFromRunData = exports.discoverOutputSchemaForNode = exports.needsPinData = exports.registerDefaultPlugins = exports.pluginRegistry = exports.PluginRegistry = exports.parseWorkflowCodeToBuilder = exports.parseWorkflowCode = void 0;
19
19
  var base_1 = require("./types/base");
20
20
  Object.defineProperty(exports, "isNodeChain", { enumerable: true, get: function () { return base_1.isNodeChain; } });
21
21
  Object.defineProperty(exports, "isNodeInstance", { enumerable: true, get: function () { return base_1.isNodeInstance; } });
@@ -73,6 +73,8 @@ Object.defineProperty(exports, "validateNodeConfig", { enumerable: true, get: fu
73
73
  Object.defineProperty(exports, "isInformationalIssue", { enumerable: true, get: function () { return validation_1.isInformationalIssue; } });
74
74
  Object.defineProperty(exports, "partitionValidationIssues", { enumerable: true, get: function () { return validation_1.partitionValidationIssues; } });
75
75
  Object.defineProperty(exports, "validateWorkflowBuilder", { enumerable: true, get: function () { return validation_1.validateWorkflowBuilder; } });
76
+ var python_1 = require("./lint/code-node/python");
77
+ Object.defineProperty(exports, "lintPythonCode", { enumerable: true, get: function () { return python_1.lintPythonCode; } });
76
78
  var index_1 = require("./codegen/index");
77
79
  Object.defineProperty(exports, "generateWorkflowCode", { enumerable: true, get: function () { return index_1.generateWorkflowCode; } });
78
80
  var index_2 = require("./codegen/index");
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"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yD;AAAhD,wGAAA,cAAc,OAAA;AAKvB,yCAAuD;AAA9C,6GAAA,oBAAoB,OAAA;AAC7B,yCAIyB;AAHxB,uGAAA,cAAc,OAAA;AACd,iHAAA,wBAAwB,OAAA;AAGzB,qEAA8F;AAArF,wHAAA,iBAAiB,OAAA;AAAE,iIAAA,0BAA0B,OAAA;AAGtD,mDAAiC;AAGjC,8CAA4B;AAG5B,sDAaoC;AAXnC,yGAAA,cAAc,OAAA;AACd,yGAAA,cAAc,OAAA;AAEd,iHAAA,sBAAsB,OAAA;AAWvB,mDAM0B;AALzB,8GAAA,YAAY,OAAA;AACZ,6HAAA,2BAA2B,OAAA;AAC3B,yHAAA,uBAAuB,OAAA;AACvB,kHAAA,gBAAgB,OAAA;AAKjB,gEAIsC;AAHrC,wHAAA,qBAAqB,OAAA;AAMtB,yCAWqB;AAVpB,uGAAA,UAAU,OAAA;AAEV,yGAAA,YAAY,OAAA;AACZ,6GAAA,gBAAgB,OAAA;AAChB,4GAAA,eAAe,OAAA;AACf,6GAAA,gBAAgB,OAAA;AAChB,iHAAA,oBAAoB,OAAA;AACpB,8GAAA,iBAAiB,OAAA;AACjB,0GAAA,aAAa,OAAA;AACb,4GAAA,eAAe,OAAA;AAKhB,0DAKsC;AAJrC,sGAAA,SAAS,OAAA;AACT,8GAAA,iBAAiB,OAAA;AACjB,2GAAA,cAAc,OAAA;AACd,2GAAA,cAAc,OAAA"}
@@ -1,5 +1,7 @@
1
+ import type { CodeExecutionMode } from './extract-snippets';
1
2
  import { type SourceLintIssue } from '../types';
2
3
  export interface LintPythonCodeOptions {
4
+ mode?: CodeExecutionMode;
3
5
  nodeName?: string;
4
6
  }
5
7
  export declare function lintPythonCode(pythonCode: string, options?: LintPythonCodeOptions): SourceLintIssue[];
@@ -2,14 +2,63 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.lintPythonCode = lintPythonCode;
4
4
  const types_1 = require("../types");
5
- const PYTHON_NETWORK_IMPORT = /(?:^|\n)\s*(?:import|from)\s+(?:requests|urllib(?:\.[\w.]+)?|httpx|aiohttp|http\.client)\b/m;
6
- const PYTHON_NETWORK_FROM_IMPORT = /(?:^|\n)\s*from\s+http\s+import\s+client\b/m;
5
+ const NETWORK_MODULES = new Set(['requests', 'urllib', 'httpx', 'aiohttp', 'http']);
6
+ const UNSUPPORTED_GLOBAL_NAMES = [
7
+ '_input',
8
+ '_json',
9
+ '_node',
10
+ '_workflow',
11
+ '_execution',
12
+ '_prevNode',
13
+ '_runIndex',
14
+ '_today',
15
+ '_now',
16
+ '_jmespath',
17
+ '_env',
18
+ '_vars',
19
+ '_binary',
20
+ '_getWorkflowStaticData',
21
+ ];
22
+ const UNSUPPORTED_GLOBAL = new RegExp(String.raw `(?<![\w.$])(?:${UNSUPPORTED_GLOBAL_NAMES.join('|')})\b|(?<![\w.$])_\s*\(|(?<![\w$])\$[A-Za-z_]`);
23
+ const MODE_ACCESSOR = {
24
+ runOnceForAllItems: { defined: '_items', undefined: '_item' },
25
+ runOnceForEachItem: { defined: '_item', undefined: '_items' },
26
+ };
27
+ const IMPORT_LINE = /^[ \t]*(?:import[ \t]+([\w.,\t ]+)|from[ \t]+([\w.]+)[ \t]+import\b)/gm;
28
+ function stripComments(pythonCode) {
29
+ return pythonCode.replace(/#.*$/gm, '');
30
+ }
31
+ function importRoot(specifier) {
32
+ const trimmed = specifier.trim();
33
+ return trimmed.startsWith('.') ? trimmed : trimmed.split(/[\s.]/)[0];
34
+ }
35
+ function importedRootModules(pythonCode) {
36
+ const roots = new Set();
37
+ for (const [, names, fromModule] of pythonCode.matchAll(IMPORT_LINE)) {
38
+ for (const specifier of names ? names.split(',') : [fromModule]) {
39
+ const root = importRoot(specifier);
40
+ if (root)
41
+ roots.add(root);
42
+ }
43
+ }
44
+ return roots;
45
+ }
46
+ function wrongModeAccessor(pythonCode, mode) {
47
+ if (!mode)
48
+ return undefined;
49
+ const { undefined: wrong } = MODE_ACCESSOR[mode];
50
+ return new RegExp(String.raw `(?<![\w.$])${wrong}\b`).test(pythonCode) ? wrong : undefined;
51
+ }
7
52
  function lintPythonCode(pythonCode, options = {}) {
8
53
  if (pythonCode.length === 0)
9
54
  return [];
55
+ const code = stripComments(pythonCode);
56
+ const roots = importedRootModules(code);
57
+ const networkModules = [...roots].filter((module) => NETWORK_MODULES.has(module));
58
+ const otherModules = [...roots].filter((module) => !NETWORK_MODULES.has(module));
10
59
  const issues = [];
11
60
  const namePrefix = options.nodeName ? `'${options.nodeName}' ` : '';
12
- if (PYTHON_NETWORK_IMPORT.test(pythonCode) || PYTHON_NETWORK_FROM_IMPORT.test(pythonCode)) {
61
+ if (networkModules.length > 0) {
13
62
  issues.push((0, types_1.lintIssue)({
14
63
  code: 'CODE_NODE_NETWORK_CALL',
15
64
  message: `${namePrefix}Code node uses requests/urllib/httpx or another HTTP library. ` +
@@ -20,6 +69,42 @@ function lintPythonCode(pythonCode, options = {}) {
20
69
  parameterPath: 'pythonCode',
21
70
  }));
22
71
  }
72
+ if (otherModules.length > 0) {
73
+ issues.push((0, types_1.lintIssue)({
74
+ code: 'CODE_NODE_PYTHON_IMPORT',
75
+ message: `${namePrefix}Code node imports ${otherModules.join(', ')}, but the native Python runner ` +
76
+ 'imports nothing unless the deployment allowlists it, and the default allows nothing — ' +
77
+ 'relative imports are rejected outright either way. Rewrite using builtins and ' +
78
+ 'str/list/dict methods, or switch the node to JavaScript.',
79
+ lintTarget: 'pythonCode',
80
+ nodeName: options.nodeName,
81
+ parameterPath: 'pythonCode',
82
+ }));
83
+ }
84
+ const wrongAccessor = wrongModeAccessor(code, options.mode);
85
+ if (wrongAccessor !== undefined && options.mode) {
86
+ const { defined } = MODE_ACCESSOR[options.mode];
87
+ issues.push((0, types_1.lintIssue)({
88
+ code: 'CODE_MODE_API_MISUSE',
89
+ message: `${namePrefix}uses mode: '${options.mode}' but reads ${wrongAccessor}, which the runner ` +
90
+ `only defines in the other mode. Read ${defined} instead, or switch the node mode.`,
91
+ lintTarget: 'pythonCode',
92
+ nodeName: options.nodeName,
93
+ parameterPath: 'pythonCode',
94
+ }));
95
+ }
96
+ if (UNSUPPORTED_GLOBAL.test(code)) {
97
+ issues.push((0, types_1.lintIssue)({
98
+ code: 'CODE_NODE_PYTHON_UNSUPPORTED_GLOBAL',
99
+ message: `${namePrefix}Code node reads a variable the native Python runner does not define ` +
100
+ '(_("Node Name"), _input, _json, _today, $-prefixed helpers). ' +
101
+ 'The only globals are _items in runOnceForAllItems mode, _item in runOnceForEachItem mode, ' +
102
+ 'and print(). Pass data in from an upstream node instead of reaching for another node.',
103
+ lintTarget: 'pythonCode',
104
+ nodeName: options.nodeName,
105
+ parameterPath: 'pythonCode',
106
+ }));
107
+ }
23
108
  return issues;
24
109
  }
25
110
  //# sourceMappingURL=python.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"python.js","sourceRoot":"","sources":["../../../src/lint/code-node/python.ts"],"names":[],"mappings":";;;AAAA,oCAA2D;AAG3D,MAAM,qBAAqB,GAC1B,6FAA6F,CAAC;AAG/F,MAAM,0BAA0B,GAAG,6CAA6C,CAAC;AASjF,wBACC,UAAkB,EAClB,OAAO,GAA0B,EAAE;IAEnC,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAEvC,MAAM,MAAM,GAAsB,EAAE,CAAC;IACrC,MAAM,UAAU,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,OAAO,CAAC,QAAQ,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;IAEpE,IAAI,qBAAqB,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,0BAA0B,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE,CAAC;QAC3F,MAAM,CAAC,IAAI,CACV,IAAA,iBAAS,EAAC;YACT,IAAI,EAAE,wBAAwB;YAC9B,OAAO,EACN,GAAG,UAAU,gEAAgE;gBAC7E,kGAAkG;gBAClG,8CAA8C;YAC/C,UAAU,EAAE,YAAY;YACxB,QA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Aa,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAChD,MAAM,CAAC,IAAI,CACV,IAAA,iBAAS,EAAC;YACT,IAAI,EAAE,sBAAsB;YAC5B,OAAO,EACN,GAAG,UAAU,eAAe,OAAO,CAAC,IAAI,eAAe,aAAa,qBAAqB;gBACzF,wCAAwC,OAAO,oCAAoC;YACpF,UAAU,EAAE,YAAY;YACxB,QAAQ,EAAE,OAAO,CAAC,QAAQ;YAC1B,aAAa,EAAE,YAAY;SAC3B,CAAC,CACF,CAAC;IACH,CAAC;IAED,IAAI,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;QACnC,MAAM,CAAC,IAAI,CACV,IAAA,iBAAS,EAAC;YACT,IAAI,EAAE,qCAAqC;YAC3C,OAAO,EACN,GAAG,UAAU,sEAAsE;gBACnF,+DAA+D;gBAC/D,4FAA4F;gBAC5F,uFAAuF;YACxF,UAAU,EAAE,YAAY;YACxB,QAAQ,EAAE,OAAO,CAAC,QAAQ;YAC1B,aAAa,EAAE,YAAY;SAC3B,CAAC,CACF,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAC;AACf,CAAC"}
@@ -36,7 +36,7 @@ function lintWorkflowSource(source) {
36
36
  })));
37
37
  }
38
38
  else {
39
- embeddedIssues.push(...(0, python_1.lintPythonCode)(snippet.code).map((issue) => ({
39
+ embeddedIssues.push(...(0, python_1.lintPythonCode)(snippet.code, { mode: snippet.mode }).map((issue) => ({
40
40
  ...issue,
41
41
  ...base,
42
42
  })));
@@ -1 +1 @@
1
- {"version":3,"file":"lint-workflow-source.js","sourceRoot":"","sources":["../../src/lint/lint-workflow-source.ts"],"names":[],"mappings":";;;AAAA,wDAAkD;AAClD,yCAAoD;AACpD,mEAA2F;AAC3F,uCAA4C;AAC5C,+CAAoD;AACpD,+DAAmF;AACnF,mCAA0D;AAM1D,4BAAmC,MAAc;IAChD,MAAM,EAAE,IAAI,EAAE,cAAc,EAAE,GAAG,IAAA,wCAAoB,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AAC,CAAC;IAEjE,MAAM,cAAc,GAAsB,EAAE,CAAC;IAC7C,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;QAChC,MAAM,IAAI,GAAG,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC;QAC5D,IAAI,OAAO,CAAC,SAAS,KAAK,QAAQ,EAAE,CAAC;YACpC,cAAc,CAAC,IAAI,CAClB,GAAG,IAAA,eAAU,EAAC,OAAO,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;gBACnE,GAAG,KAAK;gBACR,GAAG,IAAI;aACP,CAAC,CAAC,CACH,CAAC;QACH,CAAC;aAAM,CAAC;YACP,cAAc,CAAC,IAAI,CAClB,GAAG,IAAA,uBAAc,EAAC,OAAO,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;gBACvE,GAAG,KAAK;gBACR,GAAG,IAAI;aACP,CAAC,CAAC,CACH,CAAC;QACH,CAAC;IACF,CAAC;IAED,OAAO,IAAA,iCAAsB,EAAC,CAAC,GAAG,SAAS,EAAE,GAAG,cAAc,CAAC,CAAC,CAAC;AAClE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@n8n/workflow-sdk",
3
- "version": "0.30.0",
3
+ "version": "0.31.0",
4
4
  "description": "TypeScript SDK for programmatically creating n8n workflows",
5
5
  "exports": {
6
6
  ".": {
@@ -9,8 +9,8 @@
9
9
  },
10
10
  "./package.json": "./package.json",
11
11
  "./scripts/generate-types": {
12
- "types": "./src/generate-types/generate-types.ts",
13
- "default": "./src/generate-types/generate-types.ts"
12
+ "types": "./dist/generate-types/generate-types.d.ts",
13
+ "default": "./dist/generate-types/generate-types.js"
14
14
  },
15
15
  "./dist/generate-types/generate-types": {
16
16
  "default": "./dist/generate-types/generate-types.js"
@@ -77,9 +77,9 @@
77
77
  "adm-zip": "^0.6.0",
78
78
  "typescript": "7.0.2",
79
79
  "vitest": "^4.1.9",
80
- "@n8n/eslint-plugin-community-nodes": "0.30.0",
81
- "@n8n/typescript-config": "1.10.0",
82
- "@n8n/vitest-config": "1.21.0"
80
+ "@n8n/typescript-config": "1.11.0",
81
+ "@n8n/vitest-config": "1.21.0",
82
+ "@n8n/eslint-plugin-community-nodes": "0.31.0"
83
83
  },
84
84
  "dependencies": {
85
85
  "@dagrejs/dagre": "^1.1.4",
@@ -87,9 +87,9 @@
87
87
  "lodash": "4.18.1",
88
88
  "uuid": "11.1.1",
89
89
  "zod": "3.25.76",
90
- "@n8n/constants": "0.36.0",
91
- "n8n-workflow": "2.37.0",
92
- "@n8n/utils": "1.45.0"
90
+ "@n8n/constants": "0.37.0",
91
+ "n8n-workflow": "2.38.0",
92
+ "@n8n/utils": "1.46.0"
93
93
  },
94
94
  "license": "SEE LICENSE IN LICENSE.md",
95
95
  "homepage": "https://n8n.io",