n8n-workflow 2.28.1 → 2.28.3
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/cjs/build.tsbuildinfo +1 -1
- package/dist/cjs/common/index.d.ts +1 -0
- package/dist/cjs/common/index.d.ts.map +1 -1
- package/dist/cjs/common/index.js +2 -1
- package/dist/cjs/common/index.js.map +1 -1
- package/dist/cjs/common/resolve-variables.d.ts +25 -0
- package/dist/cjs/common/resolve-variables.d.ts.map +1 -0
- package/dist/cjs/common/resolve-variables.js +39 -0
- package/dist/cjs/common/resolve-variables.js.map +1 -0
- package/dist/esm/common/index.d.ts +1 -0
- package/dist/esm/common/index.d.ts.map +1 -1
- package/dist/esm/common/index.js +1 -0
- package/dist/esm/common/index.js.map +1 -1
- package/dist/esm/common/resolve-variables.d.ts +25 -0
- package/dist/esm/common/resolve-variables.d.ts.map +1 -0
- package/dist/esm/common/resolve-variables.js +26 -0
- package/dist/esm/common/resolve-variables.js.map +1 -0
- package/dist/esm/typecheck.tsbuildinfo +1 -1
- package/package.json +6 -6
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/common/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kCAAkC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/common/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kCAAkC,CAAC;AACjD,cAAc,qBAAqB,CAAC"}
|
package/dist/cjs/common/index.js
CHANGED
|
@@ -18,7 +18,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
18
18
|
if (v !== undefined) module.exports = v;
|
|
19
19
|
}
|
|
20
20
|
else if (typeof define === "function" && define.amd) {
|
|
21
|
-
define(["require", "exports", "./find-ai-root-node-names", "./get-child-nodes", "./get-connected-nodes", "./get-node-by-name", "./get-parent-nodes", "./map-connections-by-destination"], factory);
|
|
21
|
+
define(["require", "exports", "./find-ai-root-node-names", "./get-child-nodes", "./get-connected-nodes", "./get-node-by-name", "./get-parent-nodes", "./map-connections-by-destination", "./resolve-variables"], factory);
|
|
22
22
|
}
|
|
23
23
|
})(function (require, exports) {
|
|
24
24
|
"use strict";
|
|
@@ -29,5 +29,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
29
29
|
__exportStar(require("./get-node-by-name"), exports);
|
|
30
30
|
__exportStar(require("./get-parent-nodes"), exports);
|
|
31
31
|
__exportStar(require("./map-connections-by-destination"), exports);
|
|
32
|
+
__exportStar(require("./resolve-variables"), exports);
|
|
32
33
|
});
|
|
33
34
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/common/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;IAAA,4DAA0C;IAC1C,oDAAkC;IAClC,wDAAsC;IACtC,qDAAmC;IACnC,qDAAmC;IACnC,mEAAiD"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/common/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;IAAA,4DAA0C;IAC1C,oDAAkC;IAClC,wDAAsC;IACtC,qDAAmC;IACnC,qDAAmC;IACnC,mEAAiD;IACjD,sDAAoC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A variable that is either global (no `project`) or scoped to a project.
|
|
3
|
+
* Structural shape shared by the backend `Variables` entity and the
|
|
4
|
+
* frontend `EnvironmentVariable` type.
|
|
5
|
+
*/
|
|
6
|
+
export interface ScopedVariable {
|
|
7
|
+
key: string;
|
|
8
|
+
value: string | boolean | number;
|
|
9
|
+
project?: {
|
|
10
|
+
id: string;
|
|
11
|
+
} | null;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Resolves variables to a flat key→value map.
|
|
15
|
+
*
|
|
16
|
+
* Globals are applied first, then variables belonging to `projectId` overwrite
|
|
17
|
+
* them. This makes project variables win over same-key globals regardless of
|
|
18
|
+
* the input order, which would otherwise leave the result dependent on
|
|
19
|
+
* database row or store insertion order.
|
|
20
|
+
*
|
|
21
|
+
* @param variables Global and project-scoped variables, in any order
|
|
22
|
+
* @param projectId Project whose variables take precedence, if any
|
|
23
|
+
*/
|
|
24
|
+
export declare function resolveVariables(variables: ScopedVariable[], projectId?: string): Record<string, string | boolean | number>;
|
|
25
|
+
//# sourceMappingURL=resolve-variables.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve-variables.d.ts","sourceRoot":"","sources":["../../../src/common/resolve-variables.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC9B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;IACjC,OAAO,CAAC,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;CAChC;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAC/B,SAAS,EAAE,cAAc,EAAE,EAC3B,SAAS,CAAC,EAAE,MAAM,GAChB,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC,CAgB3C"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
(function (factory) {
|
|
2
|
+
if (typeof module === "object" && typeof module.exports === "object") {
|
|
3
|
+
var v = factory(require, exports);
|
|
4
|
+
if (v !== undefined) module.exports = v;
|
|
5
|
+
}
|
|
6
|
+
else if (typeof define === "function" && define.amd) {
|
|
7
|
+
define(["require", "exports"], factory);
|
|
8
|
+
}
|
|
9
|
+
})(function (require, exports) {
|
|
10
|
+
"use strict";
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.resolveVariables = resolveVariables;
|
|
13
|
+
/**
|
|
14
|
+
* Resolves variables to a flat key→value map.
|
|
15
|
+
*
|
|
16
|
+
* Globals are applied first, then variables belonging to `projectId` overwrite
|
|
17
|
+
* them. This makes project variables win over same-key globals regardless of
|
|
18
|
+
* the input order, which would otherwise leave the result dependent on
|
|
19
|
+
* database row or store insertion order.
|
|
20
|
+
*
|
|
21
|
+
* @param variables Global and project-scoped variables, in any order
|
|
22
|
+
* @param projectId Project whose variables take precedence, if any
|
|
23
|
+
*/
|
|
24
|
+
function resolveVariables(variables, projectId) {
|
|
25
|
+
const resolved = {};
|
|
26
|
+
for (const variable of variables) {
|
|
27
|
+
if (!variable.project) {
|
|
28
|
+
resolved[variable.key] = variable.value;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
for (const variable of variables) {
|
|
32
|
+
if (projectId && variable.project?.id === projectId) {
|
|
33
|
+
resolved[variable.key] = variable.value;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return resolved;
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
//# sourceMappingURL=resolve-variables.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve-variables.js","sourceRoot":"","sources":["../../../src/common/resolve-variables.ts"],"names":[],"mappings":";;;;;;;;;;;IAsBA,4CAmBC;IA9BD;;;;;;;;;;OAUG;IACH,SAAgB,gBAAgB,CAC/B,SAA2B,EAC3B,SAAkB;QAElB,MAAM,QAAQ,GAA8C,EAAE,CAAC;QAE/D,KAAK,MAAM,QAAQ,IAAI,SAAS,EAAE,CAAC;YAClC,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC;gBACvB,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC;YACzC,CAAC;QACF,CAAC;QAED,KAAK,MAAM,QAAQ,IAAI,SAAS,EAAE,CAAC;YAClC,IAAI,SAAS,IAAI,QAAQ,CAAC,OAAO,EAAE,EAAE,KAAK,SAAS,EAAE,CAAC;gBACrD,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC;YACzC,CAAC;QACF,CAAC;QAED,OAAO,QAAQ,CAAC;IACjB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/common/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kCAAkC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/common/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kCAAkC,CAAC;AACjD,cAAc,qBAAqB,CAAC"}
|
package/dist/esm/common/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/common/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kCAAkC,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/common/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kCAAkC,CAAC;AACjD,cAAc,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A variable that is either global (no `project`) or scoped to a project.
|
|
3
|
+
* Structural shape shared by the backend `Variables` entity and the
|
|
4
|
+
* frontend `EnvironmentVariable` type.
|
|
5
|
+
*/
|
|
6
|
+
export interface ScopedVariable {
|
|
7
|
+
key: string;
|
|
8
|
+
value: string | boolean | number;
|
|
9
|
+
project?: {
|
|
10
|
+
id: string;
|
|
11
|
+
} | null;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Resolves variables to a flat key→value map.
|
|
15
|
+
*
|
|
16
|
+
* Globals are applied first, then variables belonging to `projectId` overwrite
|
|
17
|
+
* them. This makes project variables win over same-key globals regardless of
|
|
18
|
+
* the input order, which would otherwise leave the result dependent on
|
|
19
|
+
* database row or store insertion order.
|
|
20
|
+
*
|
|
21
|
+
* @param variables Global and project-scoped variables, in any order
|
|
22
|
+
* @param projectId Project whose variables take precedence, if any
|
|
23
|
+
*/
|
|
24
|
+
export declare function resolveVariables(variables: ScopedVariable[], projectId?: string): Record<string, string | boolean | number>;
|
|
25
|
+
//# sourceMappingURL=resolve-variables.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve-variables.d.ts","sourceRoot":"","sources":["../../../src/common/resolve-variables.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC9B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC;IACjC,OAAO,CAAC,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;CAChC;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAC/B,SAAS,EAAE,cAAc,EAAE,EAC3B,SAAS,CAAC,EAAE,MAAM,GAChB,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,GAAG,MAAM,CAAC,CAgB3C"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolves variables to a flat key→value map.
|
|
3
|
+
*
|
|
4
|
+
* Globals are applied first, then variables belonging to `projectId` overwrite
|
|
5
|
+
* them. This makes project variables win over same-key globals regardless of
|
|
6
|
+
* the input order, which would otherwise leave the result dependent on
|
|
7
|
+
* database row or store insertion order.
|
|
8
|
+
*
|
|
9
|
+
* @param variables Global and project-scoped variables, in any order
|
|
10
|
+
* @param projectId Project whose variables take precedence, if any
|
|
11
|
+
*/
|
|
12
|
+
export function resolveVariables(variables, projectId) {
|
|
13
|
+
const resolved = {};
|
|
14
|
+
for (const variable of variables) {
|
|
15
|
+
if (!variable.project) {
|
|
16
|
+
resolved[variable.key] = variable.value;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
for (const variable of variables) {
|
|
20
|
+
if (projectId && variable.project?.id === projectId) {
|
|
21
|
+
resolved[variable.key] = variable.value;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
return resolved;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=resolve-variables.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve-variables.js","sourceRoot":"","sources":["../../../src/common/resolve-variables.ts"],"names":[],"mappings":"AAWA;;;;;;;;;;GAUG;AACH,MAAM,UAAU,gBAAgB,CAC/B,SAA2B,EAC3B,SAAkB;IAElB,MAAM,QAAQ,GAA8C,EAAE,CAAC;IAE/D,KAAK,MAAM,QAAQ,IAAI,SAAS,EAAE,CAAC;QAClC,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC;YACvB,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC;QACzC,CAAC;IACF,CAAC;IAED,KAAK,MAAM,QAAQ,IAAI,SAAS,EAAE,CAAC;QAClC,IAAI,SAAS,IAAI,QAAQ,CAAC,OAAO,EAAE,EAAE,KAAK,SAAS,EAAE,CAAC;YACrD,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC;QACzC,CAAC;IACF,CAAC;IAED,OAAO,QAAQ,CAAC;AACjB,CAAC"}
|