@n8n/i18n 1.19.0 → 1.21.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.cjs +7829 -3976
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3871 -3676
- package/dist/index.d.ts +3871 -3676
- package/dist/index.js +7792 -3974
- package/dist/index.js.map +1 -1
- package/dist/types-BEthcX4W.d.cts +3813 -0
- package/dist/types-me2l4Lvz.d.ts +3813 -0
- package/dist/types.cjs +0 -1
- package/dist/types.d.cts +2 -3656
- package/dist/types.d.ts +2 -3656
- package/dist/types.js +1 -1
- package/dist/utils-CmS9ahSc.cjs +75 -0
- package/dist/utils-CmS9ahSc.cjs.map +1 -0
- package/dist/utils-Ct4O795q.js +51 -0
- package/dist/utils-Ct4O795q.js.map +1 -0
- package/dist/utils.cjs +5 -12
- package/dist/utils.d.cts +5 -3
- package/dist/utils.d.ts +5 -3
- package/dist/utils.js +3 -13
- package/package.json +8 -8
- package/dist/chunk-MOPMPZJO.cjs +0 -34
- package/dist/chunk-MOPMPZJO.cjs.map +0 -1
- package/dist/chunk-NITZKE2M.js +0 -34
- package/dist/chunk-NITZKE2M.js.map +0 -1
- package/dist/types.cjs.map +0 -1
- package/dist/types.js.map +0 -1
- package/dist/utils.cjs.map +0 -1
- package/dist/utils.js.map +0 -1
package/dist/types.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export { };
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
|
|
2
|
+
//#region src/utils.ts
|
|
3
|
+
/**
|
|
4
|
+
* Derive the middle key, i.e. the segment of the render key located between
|
|
5
|
+
* the initial key (path to parameters root) and the property to render.
|
|
6
|
+
*
|
|
7
|
+
* Used by `nodeText()` to handle nested params.
|
|
8
|
+
*
|
|
9
|
+
* Location: `n8n-nodes-base.nodes.github.nodeView.<middleKey>.placeholder`
|
|
10
|
+
*/
|
|
11
|
+
function deriveMiddleKey(path, parameter) {
|
|
12
|
+
let middleKey = parameter.name;
|
|
13
|
+
if (isTopLevelCollection(path, parameter) || isNestedInCollectionLike(path)) middleKey = insertOptionsAndValues(normalize(path).split(".")).join(".");
|
|
14
|
+
if (isNestedCollection(path, parameter) || isFixedCollection(path, parameter)) middleKey = insertOptionsAndValues([...normalize(path).split("."), parameter.name]).join(".");
|
|
15
|
+
return middleKey;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Check if a param path is for a param nested inside a `collection` or
|
|
19
|
+
* `fixedCollection` param.
|
|
20
|
+
*/
|
|
21
|
+
const isNestedInCollectionLike = (path) => path.split(".").length >= 3;
|
|
22
|
+
const isTopLevelCollection = (path, parameter) => path.split(".").length === 2 && parameter.type === "collection";
|
|
23
|
+
const isNestedCollection = (path, parameter) => path.split(".").length > 2 && parameter.type === "collection";
|
|
24
|
+
/**
|
|
25
|
+
* Check if the param is a normal `fixedCollection`, i.e. a FC other than the wrapper
|
|
26
|
+
* that sits at the root of a node's top-level param and contains all of them.
|
|
27
|
+
*/
|
|
28
|
+
const isFixedCollection = (path, parameter) => parameter.type === "fixedCollection" && path !== "parameters";
|
|
29
|
+
/**
|
|
30
|
+
* Remove all indices and the `parameters.` prefix from a parameter path.
|
|
31
|
+
*
|
|
32
|
+
* Example: `parameters.a[0].b` → `a.b`
|
|
33
|
+
*/
|
|
34
|
+
const normalize = (path) => path.replace(/\[.*?\]/g, "").replace("parameters.", "");
|
|
35
|
+
/**
|
|
36
|
+
* Insert `'options'` and `'values'` on an alternating basis in a string array of
|
|
37
|
+
* indefinite length. Helper to create a valid render key for a collection-like param.
|
|
38
|
+
*
|
|
39
|
+
* Example: `['a', 'b', 'c']` → `['a', 'options', 'b', 'values', 'c']`
|
|
40
|
+
*/
|
|
41
|
+
const insertOptionsAndValues = (pathSegments) => {
|
|
42
|
+
return pathSegments.reduce((acc, cur, i) => {
|
|
43
|
+
acc.push(cur);
|
|
44
|
+
if (i === pathSegments.length - 1) return acc;
|
|
45
|
+
acc.push(i % 2 === 0 ? "options" : "values");
|
|
46
|
+
return acc;
|
|
47
|
+
}, []);
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
//#endregion
|
|
51
|
+
Object.defineProperty(exports, 'deriveMiddleKey', {
|
|
52
|
+
enumerable: true,
|
|
53
|
+
get: function () {
|
|
54
|
+
return deriveMiddleKey;
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
Object.defineProperty(exports, 'insertOptionsAndValues', {
|
|
58
|
+
enumerable: true,
|
|
59
|
+
get: function () {
|
|
60
|
+
return insertOptionsAndValues;
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
Object.defineProperty(exports, 'isNestedInCollectionLike', {
|
|
64
|
+
enumerable: true,
|
|
65
|
+
get: function () {
|
|
66
|
+
return isNestedInCollectionLike;
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
Object.defineProperty(exports, 'normalize', {
|
|
70
|
+
enumerable: true,
|
|
71
|
+
get: function () {
|
|
72
|
+
return normalize;
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
//# sourceMappingURL=utils-CmS9ahSc.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils-CmS9ahSc.cjs","names":[],"sources":["../src/utils.ts"],"sourcesContent":["/**\n * Derive the middle key, i.e. the segment of the render key located between\n * the initial key (path to parameters root) and the property to render.\n *\n * Used by `nodeText()` to handle nested params.\n *\n * Location: `n8n-nodes-base.nodes.github.nodeView.<middleKey>.placeholder`\n */\nexport function deriveMiddleKey(path: string, parameter: { name: string; type?: string }) {\n\tlet middleKey = parameter.name;\n\n\tif (isTopLevelCollection(path, parameter) || isNestedInCollectionLike(path)) {\n\t\tconst pathSegments = normalize(path).split('.');\n\t\tmiddleKey = insertOptionsAndValues(pathSegments).join('.');\n\t}\n\n\tif (isNestedCollection(path, parameter) || isFixedCollection(path, parameter)) {\n\t\tconst pathSegments = [...normalize(path).split('.'), parameter.name];\n\t\tmiddleKey = insertOptionsAndValues(pathSegments).join('.');\n\t}\n\n\treturn middleKey;\n}\n\n/**\n * Check if a param path is for a param nested inside a `collection` or\n * `fixedCollection` param.\n */\nexport const isNestedInCollectionLike = (path: string) => path.split('.').length >= 3;\n\nconst isTopLevelCollection = (path: string, parameter: { type?: string }) =>\n\tpath.split('.').length === 2 && parameter.type === 'collection';\n\nconst isNestedCollection = (path: string, parameter: { type?: string }) =>\n\tpath.split('.').length > 2 && parameter.type === 'collection';\n\n/**\n * Check if the param is a normal `fixedCollection`, i.e. a FC other than the wrapper\n * that sits at the root of a node's top-level param and contains all of them.\n */\nconst isFixedCollection = (path: string, parameter: { type?: string }) =>\n\tparameter.type === 'fixedCollection' && path !== 'parameters';\n\n/**\n * Remove all indices and the `parameters.` prefix from a parameter path.\n *\n * Example: `parameters.a[0].b` → `a.b`\n */\nexport const normalize = (path: string) => path.replace(/\\[.*?\\]/g, '').replace('parameters.', '');\n\n/**\n * Insert `'options'` and `'values'` on an alternating basis in a string array of\n * indefinite length. Helper to create a valid render key for a collection-like param.\n *\n * Example: `['a', 'b', 'c']` → `['a', 'options', 'b', 'values', 'c']`\n */\nexport const insertOptionsAndValues = (pathSegments: string[]) => {\n\treturn pathSegments.reduce<string[]>((acc, cur, i) => {\n\t\tacc.push(cur);\n\n\t\tif (i === pathSegments.length - 1) return acc;\n\n\t\tacc.push(i % 2 === 0 ? 'options' : 'values');\n\n\t\treturn acc;\n\t}, []);\n};\n"],"mappings":";;;;;;;;;;AAQA,SAAgB,gBAAgB,MAAc,WAA4C;CACzF,IAAI,YAAY,UAAU;AAE1B,KAAI,qBAAqB,MAAM,UAAU,IAAI,yBAAyB,KAAK,CAE1E,aAAY,uBADS,UAAU,KAAK,CAAC,MAAM,IAAI,CACC,CAAC,KAAK,IAAI;AAG3D,KAAI,mBAAmB,MAAM,UAAU,IAAI,kBAAkB,MAAM,UAAU,CAE5E,aAAY,uBADS,CAAC,GAAG,UAAU,KAAK,CAAC,MAAM,IAAI,EAAE,UAAU,KAAK,CACpB,CAAC,KAAK,IAAI;AAG3D,QAAO;;;;;;AAOR,MAAa,4BAA4B,SAAiB,KAAK,MAAM,IAAI,CAAC,UAAU;AAEpF,MAAM,wBAAwB,MAAc,cAC3C,KAAK,MAAM,IAAI,CAAC,WAAW,KAAK,UAAU,SAAS;AAEpD,MAAM,sBAAsB,MAAc,cACzC,KAAK,MAAM,IAAI,CAAC,SAAS,KAAK,UAAU,SAAS;;;;;AAMlD,MAAM,qBAAqB,MAAc,cACxC,UAAU,SAAS,qBAAqB,SAAS;;;;;;AAOlD,MAAa,aAAa,SAAiB,KAAK,QAAQ,YAAY,GAAG,CAAC,QAAQ,eAAe,GAAG;;;;;;;AAQlG,MAAa,0BAA0B,iBAA2B;AACjE,QAAO,aAAa,QAAkB,KAAK,KAAK,MAAM;AACrD,MAAI,KAAK,IAAI;AAEb,MAAI,MAAM,aAAa,SAAS,EAAG,QAAO;AAE1C,MAAI,KAAK,IAAI,MAAM,IAAI,YAAY,SAAS;AAE5C,SAAO;IACL,EAAE,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
//#region src/utils.ts
|
|
2
|
+
/**
|
|
3
|
+
* Derive the middle key, i.e. the segment of the render key located between
|
|
4
|
+
* the initial key (path to parameters root) and the property to render.
|
|
5
|
+
*
|
|
6
|
+
* Used by `nodeText()` to handle nested params.
|
|
7
|
+
*
|
|
8
|
+
* Location: `n8n-nodes-base.nodes.github.nodeView.<middleKey>.placeholder`
|
|
9
|
+
*/
|
|
10
|
+
function deriveMiddleKey(path, parameter) {
|
|
11
|
+
let middleKey = parameter.name;
|
|
12
|
+
if (isTopLevelCollection(path, parameter) || isNestedInCollectionLike(path)) middleKey = insertOptionsAndValues(normalize(path).split(".")).join(".");
|
|
13
|
+
if (isNestedCollection(path, parameter) || isFixedCollection(path, parameter)) middleKey = insertOptionsAndValues([...normalize(path).split("."), parameter.name]).join(".");
|
|
14
|
+
return middleKey;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Check if a param path is for a param nested inside a `collection` or
|
|
18
|
+
* `fixedCollection` param.
|
|
19
|
+
*/
|
|
20
|
+
const isNestedInCollectionLike = (path) => path.split(".").length >= 3;
|
|
21
|
+
const isTopLevelCollection = (path, parameter) => path.split(".").length === 2 && parameter.type === "collection";
|
|
22
|
+
const isNestedCollection = (path, parameter) => path.split(".").length > 2 && parameter.type === "collection";
|
|
23
|
+
/**
|
|
24
|
+
* Check if the param is a normal `fixedCollection`, i.e. a FC other than the wrapper
|
|
25
|
+
* that sits at the root of a node's top-level param and contains all of them.
|
|
26
|
+
*/
|
|
27
|
+
const isFixedCollection = (path, parameter) => parameter.type === "fixedCollection" && path !== "parameters";
|
|
28
|
+
/**
|
|
29
|
+
* Remove all indices and the `parameters.` prefix from a parameter path.
|
|
30
|
+
*
|
|
31
|
+
* Example: `parameters.a[0].b` → `a.b`
|
|
32
|
+
*/
|
|
33
|
+
const normalize = (path) => path.replace(/\[.*?\]/g, "").replace("parameters.", "");
|
|
34
|
+
/**
|
|
35
|
+
* Insert `'options'` and `'values'` on an alternating basis in a string array of
|
|
36
|
+
* indefinite length. Helper to create a valid render key for a collection-like param.
|
|
37
|
+
*
|
|
38
|
+
* Example: `['a', 'b', 'c']` → `['a', 'options', 'b', 'values', 'c']`
|
|
39
|
+
*/
|
|
40
|
+
const insertOptionsAndValues = (pathSegments) => {
|
|
41
|
+
return pathSegments.reduce((acc, cur, i) => {
|
|
42
|
+
acc.push(cur);
|
|
43
|
+
if (i === pathSegments.length - 1) return acc;
|
|
44
|
+
acc.push(i % 2 === 0 ? "options" : "values");
|
|
45
|
+
return acc;
|
|
46
|
+
}, []);
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
//#endregion
|
|
50
|
+
export { deriveMiddleKey, insertOptionsAndValues, isNestedInCollectionLike, normalize };
|
|
51
|
+
//# sourceMappingURL=utils-Ct4O795q.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils-Ct4O795q.js","names":[],"sources":["../src/utils.ts"],"sourcesContent":["/**\n * Derive the middle key, i.e. the segment of the render key located between\n * the initial key (path to parameters root) and the property to render.\n *\n * Used by `nodeText()` to handle nested params.\n *\n * Location: `n8n-nodes-base.nodes.github.nodeView.<middleKey>.placeholder`\n */\nexport function deriveMiddleKey(path: string, parameter: { name: string; type?: string }) {\n\tlet middleKey = parameter.name;\n\n\tif (isTopLevelCollection(path, parameter) || isNestedInCollectionLike(path)) {\n\t\tconst pathSegments = normalize(path).split('.');\n\t\tmiddleKey = insertOptionsAndValues(pathSegments).join('.');\n\t}\n\n\tif (isNestedCollection(path, parameter) || isFixedCollection(path, parameter)) {\n\t\tconst pathSegments = [...normalize(path).split('.'), parameter.name];\n\t\tmiddleKey = insertOptionsAndValues(pathSegments).join('.');\n\t}\n\n\treturn middleKey;\n}\n\n/**\n * Check if a param path is for a param nested inside a `collection` or\n * `fixedCollection` param.\n */\nexport const isNestedInCollectionLike = (path: string) => path.split('.').length >= 3;\n\nconst isTopLevelCollection = (path: string, parameter: { type?: string }) =>\n\tpath.split('.').length === 2 && parameter.type === 'collection';\n\nconst isNestedCollection = (path: string, parameter: { type?: string }) =>\n\tpath.split('.').length > 2 && parameter.type === 'collection';\n\n/**\n * Check if the param is a normal `fixedCollection`, i.e. a FC other than the wrapper\n * that sits at the root of a node's top-level param and contains all of them.\n */\nconst isFixedCollection = (path: string, parameter: { type?: string }) =>\n\tparameter.type === 'fixedCollection' && path !== 'parameters';\n\n/**\n * Remove all indices and the `parameters.` prefix from a parameter path.\n *\n * Example: `parameters.a[0].b` → `a.b`\n */\nexport const normalize = (path: string) => path.replace(/\\[.*?\\]/g, '').replace('parameters.', '');\n\n/**\n * Insert `'options'` and `'values'` on an alternating basis in a string array of\n * indefinite length. Helper to create a valid render key for a collection-like param.\n *\n * Example: `['a', 'b', 'c']` → `['a', 'options', 'b', 'values', 'c']`\n */\nexport const insertOptionsAndValues = (pathSegments: string[]) => {\n\treturn pathSegments.reduce<string[]>((acc, cur, i) => {\n\t\tacc.push(cur);\n\n\t\tif (i === pathSegments.length - 1) return acc;\n\n\t\tacc.push(i % 2 === 0 ? 'options' : 'values');\n\n\t\treturn acc;\n\t}, []);\n};\n"],"mappings":";;;;;;;;;AAQA,SAAgB,gBAAgB,MAAc,WAA4C;CACzF,IAAI,YAAY,UAAU;AAE1B,KAAI,qBAAqB,MAAM,UAAU,IAAI,yBAAyB,KAAK,CAE1E,aAAY,uBADS,UAAU,KAAK,CAAC,MAAM,IAAI,CACC,CAAC,KAAK,IAAI;AAG3D,KAAI,mBAAmB,MAAM,UAAU,IAAI,kBAAkB,MAAM,UAAU,CAE5E,aAAY,uBADS,CAAC,GAAG,UAAU,KAAK,CAAC,MAAM,IAAI,EAAE,UAAU,KAAK,CACpB,CAAC,KAAK,IAAI;AAG3D,QAAO;;;;;;AAOR,MAAa,4BAA4B,SAAiB,KAAK,MAAM,IAAI,CAAC,UAAU;AAEpF,MAAM,wBAAwB,MAAc,cAC3C,KAAK,MAAM,IAAI,CAAC,WAAW,KAAK,UAAU,SAAS;AAEpD,MAAM,sBAAsB,MAAc,cACzC,KAAK,MAAM,IAAI,CAAC,SAAS,KAAK,UAAU,SAAS;;;;;AAMlD,MAAM,qBAAqB,MAAc,cACxC,UAAU,SAAS,qBAAqB,SAAS;;;;;;AAOlD,MAAa,aAAa,SAAiB,KAAK,QAAQ,YAAY,GAAG,CAAC,QAAQ,eAAe,GAAG;;;;;;;AAQlG,MAAa,0BAA0B,iBAA2B;AACjE,QAAO,aAAa,QAAkB,KAAK,KAAK,MAAM;AACrD,MAAI,KAAK,IAAI;AAEb,MAAI,MAAM,aAAa,SAAS,EAAG,QAAO;AAE1C,MAAI,KAAK,IAAI,MAAM,IAAI,YAAY,SAAS;AAE5C,SAAO;IACL,EAAE,CAAC"}
|
package/dist/utils.cjs
CHANGED
|
@@ -1,13 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
const require_utils = require('./utils-CmS9ahSc.cjs');
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
exports.deriveMiddleKey = _chunkMOPMPZJOcjs.deriveMiddleKey; exports.insertOptionsAndValues = _chunkMOPMPZJOcjs.insertOptionsAndValues; exports.isNestedInCollectionLike = _chunkMOPMPZJOcjs.isNestedInCollectionLike; exports.normalize = _chunkMOPMPZJOcjs.normalize;
|
|
13
|
-
//# sourceMappingURL=utils.cjs.map
|
|
3
|
+
exports.deriveMiddleKey = require_utils.deriveMiddleKey;
|
|
4
|
+
exports.insertOptionsAndValues = require_utils.insertOptionsAndValues;
|
|
5
|
+
exports.isNestedInCollectionLike = require_utils.isNestedInCollectionLike;
|
|
6
|
+
exports.normalize = require_utils.normalize;
|
package/dist/utils.d.cts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
//#region src/utils.d.ts
|
|
1
2
|
declare function deriveMiddleKey(path: string, parameter: {
|
|
2
|
-
|
|
3
|
-
|
|
3
|
+
name: string;
|
|
4
|
+
type?: string;
|
|
4
5
|
}): string;
|
|
5
6
|
declare const isNestedInCollectionLike: (path: string) => boolean;
|
|
6
7
|
declare const normalize: (path: string) => string;
|
|
7
8
|
declare const insertOptionsAndValues: (pathSegments: string[]) => string[];
|
|
8
|
-
|
|
9
|
+
//#endregion
|
|
9
10
|
export { deriveMiddleKey, insertOptionsAndValues, isNestedInCollectionLike, normalize };
|
|
11
|
+
//# sourceMappingURL=utils.d.cts.map
|
package/dist/utils.d.ts
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
//#region src/utils.d.ts
|
|
1
2
|
declare function deriveMiddleKey(path: string, parameter: {
|
|
2
|
-
|
|
3
|
-
|
|
3
|
+
name: string;
|
|
4
|
+
type?: string;
|
|
4
5
|
}): string;
|
|
5
6
|
declare const isNestedInCollectionLike: (path: string) => boolean;
|
|
6
7
|
declare const normalize: (path: string) => string;
|
|
7
8
|
declare const insertOptionsAndValues: (pathSegments: string[]) => string[];
|
|
8
|
-
|
|
9
|
+
//#endregion
|
|
9
10
|
export { deriveMiddleKey, insertOptionsAndValues, isNestedInCollectionLike, normalize };
|
|
11
|
+
//# sourceMappingURL=utils.d.ts.map
|
package/dist/utils.js
CHANGED
|
@@ -1,13 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
isNestedInCollectionLike,
|
|
5
|
-
normalize
|
|
6
|
-
} from "./chunk-NITZKE2M.js";
|
|
7
|
-
export {
|
|
8
|
-
deriveMiddleKey,
|
|
9
|
-
insertOptionsAndValues,
|
|
10
|
-
isNestedInCollectionLike,
|
|
11
|
-
normalize
|
|
12
|
-
};
|
|
13
|
-
//# sourceMappingURL=utils.js.map
|
|
1
|
+
import { deriveMiddleKey, insertOptionsAndValues, isNestedInCollectionLike, normalize } from "./utils-Ct4O795q.js";
|
|
2
|
+
|
|
3
|
+
export { deriveMiddleKey, insertOptionsAndValues, isNestedInCollectionLike, normalize };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@n8n/i18n",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.21.0",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
7
7
|
"LICENSE.md",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"vue-i18n": "^11.1.2",
|
|
27
|
-
"n8n-workflow": "1.
|
|
27
|
+
"n8n-workflow": "1.114.0"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@testing-library/jest-dom": "^6.6.3",
|
|
@@ -34,14 +34,14 @@
|
|
|
34
34
|
"@vue/tsconfig": "^0.7.0",
|
|
35
35
|
"@vueuse/core": "^10.11.0",
|
|
36
36
|
"vue": "^3.5.13",
|
|
37
|
-
"
|
|
37
|
+
"tsdown": "^0.15.6",
|
|
38
38
|
"typescript": "5.9.2",
|
|
39
|
-
"vite": "
|
|
39
|
+
"vite": "npm:rolldown-vite@latest",
|
|
40
40
|
"vitest": "^3.1.3",
|
|
41
41
|
"vue-tsc": "^2.2.8",
|
|
42
|
-
"@n8n/
|
|
42
|
+
"@n8n/vitest-config": "1.5.0",
|
|
43
43
|
"@n8n/typescript-config": "1.3.0",
|
|
44
|
-
"@n8n/
|
|
44
|
+
"@n8n/eslint-config": "0.0.1"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
47
47
|
"vue": "^3.5.13"
|
|
@@ -57,8 +57,8 @@
|
|
|
57
57
|
"url": "git+https://github.com/n8n-io/n8n.git"
|
|
58
58
|
},
|
|
59
59
|
"scripts": {
|
|
60
|
-
"dev": "
|
|
61
|
-
"build": "
|
|
60
|
+
"dev": "tsdown --watch",
|
|
61
|
+
"build": "tsdown",
|
|
62
62
|
"preview": "vite preview",
|
|
63
63
|
"typecheck": "vue-tsc --noEmit",
|
|
64
64
|
"test": "vitest run",
|
package/dist/chunk-MOPMPZJO.cjs
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});// src/utils.ts
|
|
2
|
-
function deriveMiddleKey(path, parameter) {
|
|
3
|
-
let middleKey = parameter.name;
|
|
4
|
-
if (isTopLevelCollection(path, parameter) || isNestedInCollectionLike(path)) {
|
|
5
|
-
const pathSegments = normalize(path).split(".");
|
|
6
|
-
middleKey = insertOptionsAndValues(pathSegments).join(".");
|
|
7
|
-
}
|
|
8
|
-
if (isNestedCollection(path, parameter) || isFixedCollection(path, parameter)) {
|
|
9
|
-
const pathSegments = [...normalize(path).split("."), parameter.name];
|
|
10
|
-
middleKey = insertOptionsAndValues(pathSegments).join(".");
|
|
11
|
-
}
|
|
12
|
-
return middleKey;
|
|
13
|
-
}
|
|
14
|
-
var isNestedInCollectionLike = (path) => path.split(".").length >= 3;
|
|
15
|
-
var isTopLevelCollection = (path, parameter) => path.split(".").length === 2 && parameter.type === "collection";
|
|
16
|
-
var isNestedCollection = (path, parameter) => path.split(".").length > 2 && parameter.type === "collection";
|
|
17
|
-
var isFixedCollection = (path, parameter) => parameter.type === "fixedCollection" && path !== "parameters";
|
|
18
|
-
var normalize = (path) => path.replace(/\[.*?\]/g, "").replace("parameters.", "");
|
|
19
|
-
var insertOptionsAndValues = (pathSegments) => {
|
|
20
|
-
return pathSegments.reduce((acc, cur, i) => {
|
|
21
|
-
acc.push(cur);
|
|
22
|
-
if (i === pathSegments.length - 1) return acc;
|
|
23
|
-
acc.push(i % 2 === 0 ? "options" : "values");
|
|
24
|
-
return acc;
|
|
25
|
-
}, []);
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
exports.deriveMiddleKey = deriveMiddleKey; exports.isNestedInCollectionLike = isNestedInCollectionLike; exports.normalize = normalize; exports.insertOptionsAndValues = insertOptionsAndValues;
|
|
34
|
-
//# sourceMappingURL=chunk-MOPMPZJO.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/n8n/n8n/packages/frontend/@n8n/i18n/dist/chunk-MOPMPZJO.cjs","../src/utils.ts"],"names":[],"mappings":"AAAA;ACQO,SAAS,eAAA,CAAgB,IAAA,EAAc,SAAA,EAA4C;AACzF,EAAA,IAAI,UAAA,EAAY,SAAA,CAAU,IAAA;AAE1B,EAAA,GAAA,CAAI,oBAAA,CAAqB,IAAA,EAAM,SAAS,EAAA,GAAK,wBAAA,CAAyB,IAAI,CAAA,EAAG;AAC5E,IAAA,MAAM,aAAA,EAAe,SAAA,CAAU,IAAI,CAAA,CAAE,KAAA,CAAM,GAAG,CAAA;AAC9C,IAAA,UAAA,EAAY,sBAAA,CAAuB,YAAY,CAAA,CAAE,IAAA,CAAK,GAAG,CAAA;AAAA,EAC1D;AAEA,EAAA,GAAA,CAAI,kBAAA,CAAmB,IAAA,EAAM,SAAS,EAAA,GAAK,iBAAA,CAAkB,IAAA,EAAM,SAAS,CAAA,EAAG;AAC9E,IAAA,MAAM,aAAA,EAAe,CAAC,GAAG,SAAA,CAAU,IAAI,CAAA,CAAE,KAAA,CAAM,GAAG,CAAA,EAAG,SAAA,CAAU,IAAI,CAAA;AACnE,IAAA,UAAA,EAAY,sBAAA,CAAuB,YAAY,CAAA,CAAE,IAAA,CAAK,GAAG,CAAA;AAAA,EAC1D;AAEA,EAAA,OAAO,SAAA;AACR;AAMO,IAAM,yBAAA,EAA2B,CAAC,IAAA,EAAA,GAAiB,IAAA,CAAK,KAAA,CAAM,GAAG,CAAA,CAAE,OAAA,GAAU,CAAA;AAEpF,IAAM,qBAAA,EAAuB,CAAC,IAAA,EAAc,SAAA,EAAA,GAC3C,IAAA,CAAK,KAAA,CAAM,GAAG,CAAA,CAAE,OAAA,IAAW,EAAA,GAAK,SAAA,CAAU,KAAA,IAAS,YAAA;AAEpD,IAAM,mBAAA,EAAqB,CAAC,IAAA,EAAc,SAAA,EAAA,GACzC,IAAA,CAAK,KAAA,CAAM,GAAG,CAAA,CAAE,OAAA,EAAS,EAAA,GAAK,SAAA,CAAU,KAAA,IAAS,YAAA;AAMlD,IAAM,kBAAA,EAAoB,CAAC,IAAA,EAAc,SAAA,EAAA,GACxC,SAAA,CAAU,KAAA,IAAS,kBAAA,GAAqB,KAAA,IAAS,YAAA;AAO3C,IAAM,UAAA,EAAY,CAAC,IAAA,EAAA,GAAiB,IAAA,CAAK,OAAA,CAAQ,UAAA,EAAY,EAAE,CAAA,CAAE,OAAA,CAAQ,aAAA,EAAe,EAAE,CAAA;AAQ1F,IAAM,uBAAA,EAAyB,CAAC,YAAA,EAAA,GAA2B;AACjE,EAAA,OAAO,YAAA,CAAa,MAAA,CAAiB,CAAC,GAAA,EAAK,GAAA,EAAK,CAAA,EAAA,GAAM;AACrD,IAAA,GAAA,CAAI,IAAA,CAAK,GAAG,CAAA;AAEZ,IAAA,GAAA,CAAI,EAAA,IAAM,YAAA,CAAa,OAAA,EAAS,CAAA,EAAG,OAAO,GAAA;AAE1C,IAAA,GAAA,CAAI,IAAA,CAAK,EAAA,EAAI,EAAA,IAAM,EAAA,EAAI,UAAA,EAAY,QAAQ,CAAA;AAE3C,IAAA,OAAO,GAAA;AAAA,EACR,CAAA,EAAG,CAAC,CAAC,CAAA;AACN,CAAA;ADxCA;AACA;AACE;AACA;AACA;AACA;AACF,+LAAC","file":"/home/runner/work/n8n/n8n/packages/frontend/@n8n/i18n/dist/chunk-MOPMPZJO.cjs","sourcesContent":[null,"/**\n * Derive the middle key, i.e. the segment of the render key located between\n * the initial key (path to parameters root) and the property to render.\n *\n * Used by `nodeText()` to handle nested params.\n *\n * Location: `n8n-nodes-base.nodes.github.nodeView.<middleKey>.placeholder`\n */\nexport function deriveMiddleKey(path: string, parameter: { name: string; type?: string }) {\n\tlet middleKey = parameter.name;\n\n\tif (isTopLevelCollection(path, parameter) || isNestedInCollectionLike(path)) {\n\t\tconst pathSegments = normalize(path).split('.');\n\t\tmiddleKey = insertOptionsAndValues(pathSegments).join('.');\n\t}\n\n\tif (isNestedCollection(path, parameter) || isFixedCollection(path, parameter)) {\n\t\tconst pathSegments = [...normalize(path).split('.'), parameter.name];\n\t\tmiddleKey = insertOptionsAndValues(pathSegments).join('.');\n\t}\n\n\treturn middleKey;\n}\n\n/**\n * Check if a param path is for a param nested inside a `collection` or\n * `fixedCollection` param.\n */\nexport const isNestedInCollectionLike = (path: string) => path.split('.').length >= 3;\n\nconst isTopLevelCollection = (path: string, parameter: { type?: string }) =>\n\tpath.split('.').length === 2 && parameter.type === 'collection';\n\nconst isNestedCollection = (path: string, parameter: { type?: string }) =>\n\tpath.split('.').length > 2 && parameter.type === 'collection';\n\n/**\n * Check if the param is a normal `fixedCollection`, i.e. a FC other than the wrapper\n * that sits at the root of a node's top-level param and contains all of them.\n */\nconst isFixedCollection = (path: string, parameter: { type?: string }) =>\n\tparameter.type === 'fixedCollection' && path !== 'parameters';\n\n/**\n * Remove all indices and the `parameters.` prefix from a parameter path.\n *\n * Example: `parameters.a[0].b` → `a.b`\n */\nexport const normalize = (path: string) => path.replace(/\\[.*?\\]/g, '').replace('parameters.', '');\n\n/**\n * Insert `'options'` and `'values'` on an alternating basis in a string array of\n * indefinite length. Helper to create a valid render key for a collection-like param.\n *\n * Example: `['a', 'b', 'c']` → `['a', 'options', 'b', 'values', 'c']`\n */\nexport const insertOptionsAndValues = (pathSegments: string[]) => {\n\treturn pathSegments.reduce<string[]>((acc, cur, i) => {\n\t\tacc.push(cur);\n\n\t\tif (i === pathSegments.length - 1) return acc;\n\n\t\tacc.push(i % 2 === 0 ? 'options' : 'values');\n\n\t\treturn acc;\n\t}, []);\n};\n"]}
|
package/dist/chunk-NITZKE2M.js
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
// src/utils.ts
|
|
2
|
-
function deriveMiddleKey(path, parameter) {
|
|
3
|
-
let middleKey = parameter.name;
|
|
4
|
-
if (isTopLevelCollection(path, parameter) || isNestedInCollectionLike(path)) {
|
|
5
|
-
const pathSegments = normalize(path).split(".");
|
|
6
|
-
middleKey = insertOptionsAndValues(pathSegments).join(".");
|
|
7
|
-
}
|
|
8
|
-
if (isNestedCollection(path, parameter) || isFixedCollection(path, parameter)) {
|
|
9
|
-
const pathSegments = [...normalize(path).split("."), parameter.name];
|
|
10
|
-
middleKey = insertOptionsAndValues(pathSegments).join(".");
|
|
11
|
-
}
|
|
12
|
-
return middleKey;
|
|
13
|
-
}
|
|
14
|
-
var isNestedInCollectionLike = (path) => path.split(".").length >= 3;
|
|
15
|
-
var isTopLevelCollection = (path, parameter) => path.split(".").length === 2 && parameter.type === "collection";
|
|
16
|
-
var isNestedCollection = (path, parameter) => path.split(".").length > 2 && parameter.type === "collection";
|
|
17
|
-
var isFixedCollection = (path, parameter) => parameter.type === "fixedCollection" && path !== "parameters";
|
|
18
|
-
var normalize = (path) => path.replace(/\[.*?\]/g, "").replace("parameters.", "");
|
|
19
|
-
var insertOptionsAndValues = (pathSegments) => {
|
|
20
|
-
return pathSegments.reduce((acc, cur, i) => {
|
|
21
|
-
acc.push(cur);
|
|
22
|
-
if (i === pathSegments.length - 1) return acc;
|
|
23
|
-
acc.push(i % 2 === 0 ? "options" : "values");
|
|
24
|
-
return acc;
|
|
25
|
-
}, []);
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
export {
|
|
29
|
-
deriveMiddleKey,
|
|
30
|
-
isNestedInCollectionLike,
|
|
31
|
-
normalize,
|
|
32
|
-
insertOptionsAndValues
|
|
33
|
-
};
|
|
34
|
-
//# sourceMappingURL=chunk-NITZKE2M.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/utils.ts"],"sourcesContent":["/**\n * Derive the middle key, i.e. the segment of the render key located between\n * the initial key (path to parameters root) and the property to render.\n *\n * Used by `nodeText()` to handle nested params.\n *\n * Location: `n8n-nodes-base.nodes.github.nodeView.<middleKey>.placeholder`\n */\nexport function deriveMiddleKey(path: string, parameter: { name: string; type?: string }) {\n\tlet middleKey = parameter.name;\n\n\tif (isTopLevelCollection(path, parameter) || isNestedInCollectionLike(path)) {\n\t\tconst pathSegments = normalize(path).split('.');\n\t\tmiddleKey = insertOptionsAndValues(pathSegments).join('.');\n\t}\n\n\tif (isNestedCollection(path, parameter) || isFixedCollection(path, parameter)) {\n\t\tconst pathSegments = [...normalize(path).split('.'), parameter.name];\n\t\tmiddleKey = insertOptionsAndValues(pathSegments).join('.');\n\t}\n\n\treturn middleKey;\n}\n\n/**\n * Check if a param path is for a param nested inside a `collection` or\n * `fixedCollection` param.\n */\nexport const isNestedInCollectionLike = (path: string) => path.split('.').length >= 3;\n\nconst isTopLevelCollection = (path: string, parameter: { type?: string }) =>\n\tpath.split('.').length === 2 && parameter.type === 'collection';\n\nconst isNestedCollection = (path: string, parameter: { type?: string }) =>\n\tpath.split('.').length > 2 && parameter.type === 'collection';\n\n/**\n * Check if the param is a normal `fixedCollection`, i.e. a FC other than the wrapper\n * that sits at the root of a node's top-level param and contains all of them.\n */\nconst isFixedCollection = (path: string, parameter: { type?: string }) =>\n\tparameter.type === 'fixedCollection' && path !== 'parameters';\n\n/**\n * Remove all indices and the `parameters.` prefix from a parameter path.\n *\n * Example: `parameters.a[0].b` → `a.b`\n */\nexport const normalize = (path: string) => path.replace(/\\[.*?\\]/g, '').replace('parameters.', '');\n\n/**\n * Insert `'options'` and `'values'` on an alternating basis in a string array of\n * indefinite length. Helper to create a valid render key for a collection-like param.\n *\n * Example: `['a', 'b', 'c']` → `['a', 'options', 'b', 'values', 'c']`\n */\nexport const insertOptionsAndValues = (pathSegments: string[]) => {\n\treturn pathSegments.reduce<string[]>((acc, cur, i) => {\n\t\tacc.push(cur);\n\n\t\tif (i === pathSegments.length - 1) return acc;\n\n\t\tacc.push(i % 2 === 0 ? 'options' : 'values');\n\n\t\treturn acc;\n\t}, []);\n};\n"],"mappings":";AAQO,SAAS,gBAAgB,MAAc,WAA4C;AACzF,MAAI,YAAY,UAAU;AAE1B,MAAI,qBAAqB,MAAM,SAAS,KAAK,yBAAyB,IAAI,GAAG;AAC5E,UAAM,eAAe,UAAU,IAAI,EAAE,MAAM,GAAG;AAC9C,gBAAY,uBAAuB,YAAY,EAAE,KAAK,GAAG;AAAA,EAC1D;AAEA,MAAI,mBAAmB,MAAM,SAAS,KAAK,kBAAkB,MAAM,SAAS,GAAG;AAC9E,UAAM,eAAe,CAAC,GAAG,UAAU,IAAI,EAAE,MAAM,GAAG,GAAG,UAAU,IAAI;AACnE,gBAAY,uBAAuB,YAAY,EAAE,KAAK,GAAG;AAAA,EAC1D;AAEA,SAAO;AACR;AAMO,IAAM,2BAA2B,CAAC,SAAiB,KAAK,MAAM,GAAG,EAAE,UAAU;AAEpF,IAAM,uBAAuB,CAAC,MAAc,cAC3C,KAAK,MAAM,GAAG,EAAE,WAAW,KAAK,UAAU,SAAS;AAEpD,IAAM,qBAAqB,CAAC,MAAc,cACzC,KAAK,MAAM,GAAG,EAAE,SAAS,KAAK,UAAU,SAAS;AAMlD,IAAM,oBAAoB,CAAC,MAAc,cACxC,UAAU,SAAS,qBAAqB,SAAS;AAO3C,IAAM,YAAY,CAAC,SAAiB,KAAK,QAAQ,YAAY,EAAE,EAAE,QAAQ,eAAe,EAAE;AAQ1F,IAAM,yBAAyB,CAAC,iBAA2B;AACjE,SAAO,aAAa,OAAiB,CAAC,KAAK,KAAK,MAAM;AACrD,QAAI,KAAK,GAAG;AAEZ,QAAI,MAAM,aAAa,SAAS,EAAG,QAAO;AAE1C,QAAI,KAAK,IAAI,MAAM,IAAI,YAAY,QAAQ;AAE3C,WAAO;AAAA,EACR,GAAG,CAAC,CAAC;AACN;","names":[]}
|
package/dist/types.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/n8n/n8n/packages/frontend/@n8n/i18n/dist/types.cjs"],"names":[],"mappings":"AAAA","file":"/home/runner/work/n8n/n8n/packages/frontend/@n8n/i18n/dist/types.cjs"}
|
package/dist/types.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/dist/utils.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/n8n/n8n/packages/frontend/@n8n/i18n/dist/utils.cjs"],"names":[],"mappings":"AAAA;AACE;AACA;AACA;AACA;AACF,wDAA6B;AAC7B;AACE;AACA;AACA;AACA;AACF,uQAAC","file":"/home/runner/work/n8n/n8n/packages/frontend/@n8n/i18n/dist/utils.cjs"}
|
package/dist/utils.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|