@n8n/workflow-sdk 0.2.0 → 0.3.1
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/LICENSE_EE.md +27 -0
- package/dist/build.tsbuildinfo +1 -1
- package/dist/codegen/constants.d.ts +2 -2
- package/dist/expression/index.d.ts +1 -2
- package/dist/expression/index.js +0 -87
- package/dist/expression/index.js.map +1 -1
- package/dist/expression.d.ts +1 -1
- package/dist/expression.js +1 -2
- package/dist/expression.js.map +1 -1
- package/dist/generate-types/zod-helpers.d.ts +8 -8
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -3
- package/dist/index.js.map +1 -1
- package/dist/types/base.d.ts +0 -32
- package/dist/types/base.js.map +1 -1
- package/package.json +15 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AiConnectionType } from './types';
|
|
2
2
|
export declare const AI_CONNECTION_TO_CONFIG_KEY: Record<AiConnectionType, string>;
|
|
3
3
|
export declare const AI_CONNECTION_TO_BUILDER: Record<AiConnectionType, string>;
|
|
4
|
-
export declare const AI_ALWAYS_ARRAY_TYPES: Set<"
|
|
5
|
-
export declare const AI_OPTIONAL_ARRAY_TYPES: Set<"
|
|
4
|
+
export declare const AI_ALWAYS_ARRAY_TYPES: Set<"ai_document" | "ai_embedding" | "ai_languageModel" | "ai_memory" | "ai_outputParser" | "ai_retriever" | "ai_reranker" | "ai_textSplitter" | "ai_tool" | "ai_vectorStore">;
|
|
5
|
+
export declare const AI_OPTIONAL_ARRAY_TYPES: Set<"ai_document" | "ai_embedding" | "ai_languageModel" | "ai_memory" | "ai_outputParser" | "ai_retriever" | "ai_reranker" | "ai_textSplitter" | "ai_tool" | "ai_vectorStore">;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { FromAIArgumentType } from '../types/base';
|
|
2
2
|
export declare function parseExpression(expr: string): string;
|
|
3
3
|
export declare function isExpression(value: unknown): boolean;
|
|
4
|
-
export declare function serializeExpression<T>(fn: Expression<T>): string;
|
|
5
4
|
export declare function expr(expression: string): string;
|
|
6
5
|
export declare function createFromAIExpression(key: string, description?: string, type?: FromAIArgumentType, defaultValue?: string | number | boolean | object): string;
|
package/dist/expression/index.js
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.parseExpression = parseExpression;
|
|
4
4
|
exports.isExpression = isExpression;
|
|
5
|
-
exports.serializeExpression = serializeExpression;
|
|
6
5
|
exports.expr = expr;
|
|
7
6
|
exports.createFromAIExpression = createFromAIExpression;
|
|
8
7
|
const n8n_workflow_1 = require("n8n-workflow");
|
|
@@ -13,92 +12,6 @@ function parseExpression(expr) {
|
|
|
13
12
|
function isExpression(value) {
|
|
14
13
|
return typeof value === 'string' && value.startsWith('={{') && value.endsWith('}}');
|
|
15
14
|
}
|
|
16
|
-
function createExpressionProxy(path = []) {
|
|
17
|
-
const handler = {
|
|
18
|
-
get(_target, prop) {
|
|
19
|
-
if (prop === Symbol.toPrimitive || prop === 'valueOf' || prop === 'toString') {
|
|
20
|
-
return () => buildPath(path);
|
|
21
|
-
}
|
|
22
|
-
if (prop === '__path__') {
|
|
23
|
-
return path;
|
|
24
|
-
}
|
|
25
|
-
if (typeof prop === 'symbol') {
|
|
26
|
-
return undefined;
|
|
27
|
-
}
|
|
28
|
-
return createExpressionProxy([...path, String(prop)]);
|
|
29
|
-
},
|
|
30
|
-
apply(_target, _thisArg, args) {
|
|
31
|
-
const lastPart = path[path.length - 1];
|
|
32
|
-
const parentPath = path.slice(0, -1);
|
|
33
|
-
if (lastPart === 'keys' && parentPath.join('.') === 'binary') {
|
|
34
|
-
return { __path__: ['__SPECIAL__', 'Object.keys($binary)'] };
|
|
35
|
-
}
|
|
36
|
-
if (path.length === 1 && path[0] === '$') {
|
|
37
|
-
const nodeName = String(args[0]);
|
|
38
|
-
return createExpressionProxy(['$', `('${nodeName}')`, 'item']);
|
|
39
|
-
}
|
|
40
|
-
const argsStr = args.map((a) => JSON.stringify(a)).join(', ');
|
|
41
|
-
return createExpressionProxy([...parentPath, `${lastPart}(${argsStr})`]);
|
|
42
|
-
},
|
|
43
|
-
};
|
|
44
|
-
return new Proxy(function () { }, handler);
|
|
45
|
-
}
|
|
46
|
-
const EXPRESSION_ROOT_MAPPINGS = {
|
|
47
|
-
json: '$json',
|
|
48
|
-
binary: '$binary',
|
|
49
|
-
env: '$env',
|
|
50
|
-
vars: '$vars',
|
|
51
|
-
secrets: '$secrets',
|
|
52
|
-
itemIndex: '$itemIndex',
|
|
53
|
-
runIndex: '$runIndex',
|
|
54
|
-
now: '$now',
|
|
55
|
-
today: '$today',
|
|
56
|
-
execution: '$execution',
|
|
57
|
-
workflow: '$workflow',
|
|
58
|
-
input: '$input',
|
|
59
|
-
$: '$',
|
|
60
|
-
};
|
|
61
|
-
function buildPath(path) {
|
|
62
|
-
if (path.length === 0)
|
|
63
|
-
return '';
|
|
64
|
-
if (path[0] === '__SPECIAL__') {
|
|
65
|
-
return path[1];
|
|
66
|
-
}
|
|
67
|
-
let result = '';
|
|
68
|
-
for (let i = 0; i < path.length; i++) {
|
|
69
|
-
const part = path[i];
|
|
70
|
-
if (i === 0) {
|
|
71
|
-
result = EXPRESSION_ROOT_MAPPINGS[part] ?? part;
|
|
72
|
-
continue;
|
|
73
|
-
}
|
|
74
|
-
if (part.startsWith('(')) {
|
|
75
|
-
result += part;
|
|
76
|
-
continue;
|
|
77
|
-
}
|
|
78
|
-
if (part.includes('(')) {
|
|
79
|
-
result += '.' + part;
|
|
80
|
-
continue;
|
|
81
|
-
}
|
|
82
|
-
result += '.' + part;
|
|
83
|
-
}
|
|
84
|
-
return result;
|
|
85
|
-
}
|
|
86
|
-
function serializeExpression(fn) {
|
|
87
|
-
const proxy = createExpressionProxy([]);
|
|
88
|
-
const result = fn(proxy);
|
|
89
|
-
let exprPath;
|
|
90
|
-
if (result && typeof result === 'object' && '__path__' in result) {
|
|
91
|
-
const path = result.__path__;
|
|
92
|
-
exprPath = buildPath(path);
|
|
93
|
-
}
|
|
94
|
-
else if (typeof result === 'string') {
|
|
95
|
-
exprPath = String(result);
|
|
96
|
-
}
|
|
97
|
-
else {
|
|
98
|
-
exprPath = String(result);
|
|
99
|
-
}
|
|
100
|
-
return `={{ ${exprPath} }}`;
|
|
101
|
-
}
|
|
102
15
|
function isPlaceholderLike(value) {
|
|
103
16
|
return (typeof value === 'object' &&
|
|
104
17
|
value !== null &&
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/expression/index.ts"],"names":[],"mappings":";;AASA,0CAGC;AAKD,oCAEC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/expression/index.ts"],"names":[],"mappings":";;AASA,0CAGC;AAKD,oCAEC;AAyCD,oBAqBC;AA2FD,wDA8BC;AA1MD,+CAA6D;AAS7D,SAAgB,eAAe,CAAC,IAAY;IAC3C,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,6BAA6B,CAAC,CAAC;IACxD,OAAO,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AAChC,CAAC;AAKD,SAAgB,YAAY,CAAC,KAAc;IAC1C,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;AACrF,CAAC;AAmBD,SAAS,iBAAiB,CAAC,KAAc;IACxC,OAAO,CACN,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,KAAK,IAAI;QACd,eAAe,IAAI,KAAK;QACvB,KAAiC,CAAC,aAAa,KAAK,IAAI;QACzD,MAAM,IAAI,KAAK;QACf,OAAQ,KAAiC,CAAC,IAAI,KAAK,QAAQ,CAC3D,CAAC;AACH,CAAC;AAED,SAAS,mBAAmB,CAAC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4CAA6B,CAAC;IAG7C,MAAM,YAAY,GAAG,iBAAiB,CAAC,GAAG,CAAC,CAAC;IAC5C,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC,CAAC;IAGnC,IAAI,WAAW,KAAK,SAAS,IAAI,IAAI,KAAK,QAAQ,IAAI,YAAY,KAAK,SAAS,EAAE,CAAC;QAClF,MAAM,IAAI,GAAG,WAAW,IAAI,EAAE,CAAC;QAC/B,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;IAC5B,CAAC;IAGD,IAAI,IAAI,KAAK,QAAQ,IAAI,YAAY,KAAK,SAAS,EAAE,CAAC;QACrD,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;IAC5B,CAAC;IAGD,IAAI,YAAY,KAAK,SAAS,EAAE,CAAC;QAChC,IAAI,CAAC,IAAI,CAAC,qBAAqB,CAAC,YAAY,CAAC,CAAC,CAAC;IAChD,CAAC;IAED,OAAO,OAAO,MAAM,YAAY,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC;AACvD,CAAC"}
|
package/dist/expression.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { parseExpression, isExpression, expr, createFromAIExpression, } from './expression/index';
|
package/dist/expression.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createFromAIExpression = exports.expr = exports.isExpression = exports.parseExpression =
|
|
3
|
+
exports.createFromAIExpression = exports.expr = exports.isExpression = exports.parseExpression = void 0;
|
|
4
4
|
var index_1 = require("./expression/index");
|
|
5
|
-
Object.defineProperty(exports, "serializeExpression", { enumerable: true, get: function () { return index_1.serializeExpression; } });
|
|
6
5
|
Object.defineProperty(exports, "parseExpression", { enumerable: true, get: function () { return index_1.parseExpression; } });
|
|
7
6
|
Object.defineProperty(exports, "isExpression", { enumerable: true, get: function () { return index_1.isExpression; } });
|
|
8
7
|
Object.defineProperty(exports, "expr", { enumerable: true, get: function () { return index_1.expr; } });
|
package/dist/expression.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expression.js","sourceRoot":"","sources":["../src/expression.ts"],"names":[],"mappings":";;;AACA,
|
|
1
|
+
{"version":3,"file":"expression.js","sourceRoot":"","sources":["../src/expression.ts"],"names":[],"mappings":";;;AACA,4CAK4B;AAJ3B,wGAAA,eAAe,OAAA;AACf,qGAAA,YAAY,OAAA;AACZ,6FAAA,IAAI,OAAA;AACJ,+GAAA,sBAAsB,OAAA"}
|
|
@@ -11,14 +11,14 @@ export declare const resourceLocatorValueSchema: z.ZodUnion<[z.ZodObject<{
|
|
|
11
11
|
cachedResultName: z.ZodOptional<z.ZodString>;
|
|
12
12
|
cachedResultUrl: z.ZodOptional<z.ZodString>;
|
|
13
13
|
}, "strip", z.ZodTypeAny, {
|
|
14
|
-
value: string | number;
|
|
15
14
|
__rl: true;
|
|
15
|
+
value: string | number;
|
|
16
16
|
mode: string;
|
|
17
17
|
cachedResultName?: string | undefined;
|
|
18
18
|
cachedResultUrl?: string | undefined;
|
|
19
19
|
}, {
|
|
20
|
-
value: string | number;
|
|
21
20
|
__rl: true;
|
|
21
|
+
value: string | number;
|
|
22
22
|
mode: string;
|
|
23
23
|
cachedResultName?: string | undefined;
|
|
24
24
|
cachedResultUrl?: string | undefined;
|
|
@@ -143,13 +143,13 @@ export declare const assignmentSchema: z.ZodObject<{
|
|
|
143
143
|
}, "strip", z.ZodTypeAny, {
|
|
144
144
|
id: string;
|
|
145
145
|
name: string;
|
|
146
|
-
type?: string | undefined;
|
|
147
146
|
value?: unknown;
|
|
147
|
+
type?: string | undefined;
|
|
148
148
|
}, {
|
|
149
149
|
id: string;
|
|
150
150
|
name: string;
|
|
151
|
-
type?: string | undefined;
|
|
152
151
|
value?: unknown;
|
|
152
|
+
type?: string | undefined;
|
|
153
153
|
}>;
|
|
154
154
|
export declare const assignmentCollectionValueSchema: z.ZodObject<{
|
|
155
155
|
assignments: z.ZodArray<z.ZodObject<{
|
|
@@ -160,27 +160,27 @@ export declare const assignmentCollectionValueSchema: z.ZodObject<{
|
|
|
160
160
|
}, "strip", z.ZodTypeAny, {
|
|
161
161
|
id: string;
|
|
162
162
|
name: string;
|
|
163
|
-
type?: string | undefined;
|
|
164
163
|
value?: unknown;
|
|
164
|
+
type?: string | undefined;
|
|
165
165
|
}, {
|
|
166
166
|
id: string;
|
|
167
167
|
name: string;
|
|
168
|
-
type?: string | undefined;
|
|
169
168
|
value?: unknown;
|
|
169
|
+
type?: string | undefined;
|
|
170
170
|
}>, "many">;
|
|
171
171
|
}, "strip", z.ZodTypeAny, {
|
|
172
172
|
assignments: {
|
|
173
173
|
id: string;
|
|
174
174
|
name: string;
|
|
175
|
-
type?: string | undefined;
|
|
176
175
|
value?: unknown;
|
|
176
|
+
type?: string | undefined;
|
|
177
177
|
}[];
|
|
178
178
|
}, {
|
|
179
179
|
assignments: {
|
|
180
180
|
id: string;
|
|
181
181
|
name: string;
|
|
182
|
-
type?: string | undefined;
|
|
183
182
|
value?: unknown;
|
|
183
|
+
type?: string | undefined;
|
|
184
184
|
}[];
|
|
185
185
|
}>;
|
|
186
186
|
export declare const iDataObjectSchema: z.ZodType<Record<string, unknown>>;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type { WorkflowBuilder, WorkflowBuilderStatic, WorkflowBuilderOptions, WorkflowSettings, WorkflowJSON, NodeJSON, NodeInstance, TriggerInstance, NodeChain, NodeConfig, NodeInput, TriggerInput, SubnodeConfig, CredentialReference, OnError, DeclaredConnection, SubnodeInstance, LanguageModelInstance, MemoryInstance, ToolInstance, OutputParserInstance, EmbeddingInstance, VectorStoreInstance, RetrieverInstance, DocumentLoaderInstance, TextSplitterInstance,
|
|
1
|
+
export type { WorkflowBuilder, WorkflowBuilderStatic, WorkflowBuilderOptions, WorkflowSettings, WorkflowJSON, NodeJSON, NodeInstance, TriggerInstance, NodeChain, NodeConfig, NodeInput, TriggerInput, SubnodeConfig, CredentialReference, OnError, DeclaredConnection, SubnodeInstance, LanguageModelInstance, MemoryInstance, ToolInstance, OutputParserInstance, EmbeddingInstance, VectorStoreInstance, RetrieverInstance, DocumentLoaderInstance, TextSplitterInstance, ExecutionContext, WorkflowContext, IfElseComposite, SwitchCaseComposite, StickyNoteConfig, SplitInBatchesBuilder, PlaceholderValue, NewCredentialValue, AllItemsContext, EachItemContext, CodeResult, ConnectionTarget, GraphNode, WorkflowFn, NodeFn, TriggerFn, StickyFn, PlaceholderFn, NewCredentialFn, IfElseFn, IfElseConfig, SwitchCaseFn, SwitchCaseConfig, SplitInBatchesFn, SplitInBatchesConfig, RunOnceForAllItemsFn, RunOnceForEachItemFn, GenericValue, IDataObject, IConnection, NodeInputConnections, INodeConnections, IConnections, FromAIArgumentType, } from './types/base';
|
|
2
2
|
export { isNodeChain, isNodeInstance } from './types/base';
|
|
3
3
|
export type { AnyNode, AnyChain, AnyTrigger, NodeParameters } from './types/aliases';
|
|
4
4
|
export { workflow } from './workflow-builder';
|
|
@@ -9,7 +9,7 @@ export type { IfElseTarget } from './workflow-builder/control-flow-builders/if-e
|
|
|
9
9
|
export type { SwitchCaseTarget } from './workflow-builder/control-flow-builders/switch-case';
|
|
10
10
|
export { splitInBatches } from './workflow-builder/control-flow-builders/split-in-batches';
|
|
11
11
|
export { nextBatch } from './workflow-builder/control-flow-builders/next-batch';
|
|
12
|
-
export {
|
|
12
|
+
export { parseExpression, isExpression, expr, createFromAIExpression, } from './expression';
|
|
13
13
|
export { runOnceForAllItems, runOnceForEachItem } from './utils/code-helpers';
|
|
14
14
|
export { isPlainObject, getProperty, hasProperty } from './utils/safe-access';
|
|
15
15
|
export { validateWorkflow, ValidationError, ValidationWarning, setSchemaBaseDirs, type ValidationResult, type ValidationOptions, type ValidationErrorCode, } from './validation';
|
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.isSplitInBatchesType = exports.isStickyNoteType = exports.isMergeNodeType = exports.isSwitchNodeType = exports.isIfNodeType = exports.NODE_TYPES = exports.registerDefaultPlugins = exports.pluginRegistry = exports.PluginRegistry = exports.parseWorkflowCodeToBuilder = exports.parseWorkflowCode = exports.generateWorkflowCode = exports.setSchemaBaseDirs = exports.ValidationWarning = exports.ValidationError = exports.validateWorkflow = exports.hasProperty = exports.getProperty = exports.isPlainObject = exports.runOnceForEachItem = exports.runOnceForAllItems = exports.createFromAIExpression = exports.expr = exports.isExpression = exports.parseExpression = exports.
|
|
18
|
-
exports.isDataTableType = exports.isWebhookType =
|
|
17
|
+
exports.isHttpRequestType = exports.isSplitInBatchesType = exports.isStickyNoteType = exports.isMergeNodeType = exports.isSwitchNodeType = exports.isIfNodeType = exports.NODE_TYPES = exports.registerDefaultPlugins = exports.pluginRegistry = exports.PluginRegistry = exports.parseWorkflowCodeToBuilder = exports.parseWorkflowCode = exports.generateWorkflowCode = exports.setSchemaBaseDirs = exports.ValidationWarning = exports.ValidationError = exports.validateWorkflow = exports.hasProperty = exports.getProperty = exports.isPlainObject = exports.runOnceForEachItem = exports.runOnceForAllItems = exports.createFromAIExpression = 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.isDataTableType = exports.isWebhookType = 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; } });
|
|
@@ -47,7 +47,6 @@ Object.defineProperty(exports, "splitInBatches", { enumerable: true, get: functi
|
|
|
47
47
|
var next_batch_1 = require("./workflow-builder/control-flow-builders/next-batch");
|
|
48
48
|
Object.defineProperty(exports, "nextBatch", { enumerable: true, get: function () { return next_batch_1.nextBatch; } });
|
|
49
49
|
var expression_1 = require("./expression");
|
|
50
|
-
Object.defineProperty(exports, "serializeExpression", { enumerable: true, get: function () { return expression_1.serializeExpression; } });
|
|
51
50
|
Object.defineProperty(exports, "parseExpression", { enumerable: true, get: function () { return expression_1.parseExpression; } });
|
|
52
51
|
Object.defineProperty(exports, "isExpression", { enumerable: true, get: function () { return expression_1.isExpression; } });
|
|
53
52
|
Object.defineProperty(exports, "expr", { enumerable: true, get: function () { return expression_1.expr; } });
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AA6EA,qCAA2D;AAAlD,mGAAA,WAAW,OAAA;AAAE,sGAAA,cAAc,OAAA;AAMpC,uDAA8C;AAArC,4GAAA,QAAQ,OAAA;AAGjB,8EASuD;AARtD,oGAAA,IAAI,OAAA;AACJ,uGAAA,OAAO,OAAA;AACP,sGAAA,MAAM,OAAA;AACN,2GAAA,WAAW,OAAA;AACX,6GAAA,aAAa,OAAA;AACb,sGAAA,MAAM,OAAA;AACN,0GAAA,UAAU,OAAA;AACV,qGAAA,KAAK,OAAA;AA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A,eAAe,OAAA"}
|
package/dist/types/base.d.ts
CHANGED
|
@@ -112,23 +112,6 @@ export interface OutputSelector<TType extends string, TVersion extends string, T
|
|
|
112
112
|
readonly outputIndex: number;
|
|
113
113
|
to<T extends NodeInstance<string, string, unknown>>(target: T | T[] | InputTarget): NodeChain<NodeInstance<TType, TVersion, TOutput>, T>;
|
|
114
114
|
}
|
|
115
|
-
export interface BinaryField {
|
|
116
|
-
fileName?: string;
|
|
117
|
-
directory?: string;
|
|
118
|
-
mimeType?: string;
|
|
119
|
-
fileExtension?: string;
|
|
120
|
-
fileSize?: string;
|
|
121
|
-
}
|
|
122
|
-
export type BinaryContext = {
|
|
123
|
-
[fieldName: string]: BinaryField | (() => string[]);
|
|
124
|
-
} & {
|
|
125
|
-
keys(): string[];
|
|
126
|
-
};
|
|
127
|
-
export interface InputContext {
|
|
128
|
-
first(): IDataObject;
|
|
129
|
-
all(): IDataObject[];
|
|
130
|
-
item: IDataObject;
|
|
131
|
-
}
|
|
132
115
|
export interface ExecutionContext {
|
|
133
116
|
id: string;
|
|
134
117
|
mode: 'test' | 'production';
|
|
@@ -139,21 +122,6 @@ export interface WorkflowContext {
|
|
|
139
122
|
name?: string;
|
|
140
123
|
active: boolean;
|
|
141
124
|
}
|
|
142
|
-
export interface ExpressionContext {
|
|
143
|
-
json: IDataObject;
|
|
144
|
-
binary: BinaryContext;
|
|
145
|
-
input: InputContext;
|
|
146
|
-
env: IDataObject;
|
|
147
|
-
vars: IDataObject;
|
|
148
|
-
secrets: IDataObject;
|
|
149
|
-
now: Date;
|
|
150
|
-
today: Date;
|
|
151
|
-
itemIndex: number;
|
|
152
|
-
runIndex: number;
|
|
153
|
-
execution: ExecutionContext;
|
|
154
|
-
workflow: WorkflowContext;
|
|
155
|
-
}
|
|
156
|
-
export type Expression<T> = ($: ExpressionContext) => T;
|
|
157
125
|
export interface NodeConfig<TParams = IDataObject> {
|
|
158
126
|
parameters?: TParams;
|
|
159
127
|
credentials?: Record<string, CredentialReference | NewCredentialValue>;
|
package/dist/types/base.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.js","sourceRoot":"","sources":["../../src/types/base.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"base.js","sourceRoot":"","sources":["../../src/types/base.ts"],"names":[],"mappings":";;AA4dA,kCAWC;AAKD,wCAQC;AAxBD,SAAgB,WAAW,CAC1B,KAAc;IAKd,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IAC9D,IAAI,CAAC,CAAC,UAAU,IAAI,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IAEzC,MAAM,YAAY,GAAI,KAAiC,CAAC,QAAQ,CAAC;IACjE,OAAO,YAAY,KAAK,IAAI,CAAC;AAC9B,CAAC;AAKD,SAAgB,cAAc,CAAC,KAAc;IAC5C,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IAC9D,IAAI,CAAC,CAAC,MAAM,IAAI,KAAK,IAAI,SAAS,IAAI,KAAK,IAAI,QAAQ,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,CAAC,EAAE,CAAC;QACpF,OAAO,KAAK,CAAC;IACd,CAAC;IAED,MAAM,MAAM,GAAI,KAAiC,CAAC,EAAE,CAAC;IACrD,OAAO,OAAO,MAAM,KAAK,UAAU,CAAC;AACrC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@n8n/workflow-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "TypeScript SDK for programmatically creating n8n workflows",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -23,7 +23,9 @@
|
|
|
23
23
|
"module": "src/index.ts",
|
|
24
24
|
"types": "dist/index.d.ts",
|
|
25
25
|
"files": [
|
|
26
|
-
"dist/**/*"
|
|
26
|
+
"dist/**/*",
|
|
27
|
+
"LICENSE.md",
|
|
28
|
+
"LICENSE_EE.md"
|
|
27
29
|
],
|
|
28
30
|
"devDependencies": {
|
|
29
31
|
"@types/adm-zip": "^0.5.7",
|
|
@@ -35,7 +37,17 @@
|
|
|
35
37
|
"acorn": "8.14.0",
|
|
36
38
|
"uuid": "10.0.0",
|
|
37
39
|
"zod": "3.25.67",
|
|
38
|
-
"n8n-workflow": "2.
|
|
40
|
+
"n8n-workflow": "2.10.1"
|
|
41
|
+
},
|
|
42
|
+
"license": "SEE LICENSE IN LICENSE.md",
|
|
43
|
+
"homepage": "https://n8n.io",
|
|
44
|
+
"author": {
|
|
45
|
+
"name": "Jan Oberhauser",
|
|
46
|
+
"email": "jan@n8n.io"
|
|
47
|
+
},
|
|
48
|
+
"repository": {
|
|
49
|
+
"type": "git",
|
|
50
|
+
"url": "git+https://github.com/n8n-io/n8n.git"
|
|
39
51
|
},
|
|
40
52
|
"scripts": {
|
|
41
53
|
"clean": "rimraf dist .turbo",
|