core-package-mini-n8n 1.1.4 → 1.1.6
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 +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/dist/types/linkedlist.d.ts +14 -0
- package/dist/types/linkedlist.d.ts.map +1 -0
- package/dist/types/linkedlist.js +54 -0
- package/dist/types/linkedlist.js.map +1 -0
- package/dist/types/node-base.d.ts +4 -1
- package/dist/types/node-base.d.ts.map +1 -1
- package/dist/types/node-base.js +8 -1
- package/dist/types/node-base.js.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +2 -3
- package/src/types/linkedlist.ts +58 -0
- package/src/types/node-base.ts +2 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { NodeBase, NodeInput, NodeReturn, NodeProperty, NodeConfig } from "./types/node-base";
|
|
2
|
+
import { LinkedList, Node } from "./types/linkedlist";
|
|
2
3
|
export type { NodeInput, NodeReturn, NodeProperty, NodeConfig };
|
|
3
4
|
export { NodeBase };
|
|
5
|
+
export { LinkedList, Node };
|
|
4
6
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,QAAQ,EAAE,SAAS,EAAE,UAAU,EAC/B,YAAY,EAAE,UAAU,EAC3B,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,QAAQ,EAAE,SAAS,EAAE,UAAU,EAC/B,YAAY,EAAE,UAAU,EAC3B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAEtD,YAAY,EAAE,SAAS,EAAE,UAAU,EAAE,YAAY,EAAE,UAAU,EAAE,CAAA;AAC/D,OAAO,EAAE,QAAQ,EAAE,CAAA;AACnB,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.NodeBase = void 0;
|
|
3
|
+
exports.Node = exports.LinkedList = exports.NodeBase = void 0;
|
|
4
4
|
const node_base_1 = require("./types/node-base");
|
|
5
5
|
Object.defineProperty(exports, "NodeBase", { enumerable: true, get: function () { return node_base_1.NodeBase; } });
|
|
6
|
+
const linkedlist_1 = require("./types/linkedlist");
|
|
7
|
+
Object.defineProperty(exports, "LinkedList", { enumerable: true, get: function () { return linkedlist_1.LinkedList; } });
|
|
8
|
+
Object.defineProperty(exports, "Node", { enumerable: true, get: function () { return linkedlist_1.Node; } });
|
|
6
9
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,iDAG2B;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,iDAG2B;AAIlB,yFANL,oBAAQ,OAMK;AAHjB,mDAAsD;AAI7C,2FAJA,uBAAU,OAIA;AAAE,qFAJA,iBAAI,OAIA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { NodeBase } from "./node-base";
|
|
2
|
+
export declare class Node {
|
|
3
|
+
value: NodeBase;
|
|
4
|
+
next: Node | null;
|
|
5
|
+
constructor(value: NodeBase, next: Node | null);
|
|
6
|
+
}
|
|
7
|
+
export declare class LinkedList {
|
|
8
|
+
head: Node | null;
|
|
9
|
+
tail: Node | null;
|
|
10
|
+
constructor();
|
|
11
|
+
add(value: NodeBase): void;
|
|
12
|
+
show(): null | undefined;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=linkedlist.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"linkedlist.d.ts","sourceRoot":"","sources":["../../src/types/linkedlist.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,qBAAa,IAAI;IACb,KAAK,EAAE,QAAQ,CAAC;IAChB,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC;gBAEN,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,GAAG,IAAI;CAIjD;AAED,qBAAa,UAAU;IACnB,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC;IAClB,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC;;IAOlB,GAAG,CAAC,KAAK,EAAE,QAAQ;IAsBnB,IAAI;CAaP"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LinkedList = exports.Node = void 0;
|
|
4
|
+
class Node {
|
|
5
|
+
value;
|
|
6
|
+
next;
|
|
7
|
+
constructor(value, next) {
|
|
8
|
+
this.value = value;
|
|
9
|
+
this.next = next;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
exports.Node = Node;
|
|
13
|
+
class LinkedList {
|
|
14
|
+
head;
|
|
15
|
+
tail;
|
|
16
|
+
constructor() {
|
|
17
|
+
this.head = null;
|
|
18
|
+
this.tail = null;
|
|
19
|
+
}
|
|
20
|
+
add(value) {
|
|
21
|
+
if (!this.head) {
|
|
22
|
+
this.head = new Node(value, null);
|
|
23
|
+
this.tail = null;
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
if (!this.head.next) {
|
|
27
|
+
const next = new Node(value, null);
|
|
28
|
+
this.head.next = next;
|
|
29
|
+
this.tail = next;
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
const oldNext = this.tail;
|
|
33
|
+
const newNext = new Node(value, null);
|
|
34
|
+
if (oldNext) {
|
|
35
|
+
oldNext.next = newNext;
|
|
36
|
+
}
|
|
37
|
+
this.tail = newNext;
|
|
38
|
+
}
|
|
39
|
+
show() {
|
|
40
|
+
if (!this.head)
|
|
41
|
+
return null;
|
|
42
|
+
let start = this.head;
|
|
43
|
+
while (start != null) {
|
|
44
|
+
if (start.value instanceof LinkedList) {
|
|
45
|
+
start = start.value.head;
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
start = start.next;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
exports.LinkedList = LinkedList;
|
|
54
|
+
//# sourceMappingURL=linkedlist.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"linkedlist.js","sourceRoot":"","sources":["../../src/types/linkedlist.ts"],"names":[],"mappings":";;;AAEA,MAAa,IAAI;IACb,KAAK,CAAW;IAChB,IAAI,CAAc;IAElB,YAAY,KAAe,EAAE,IAAiB;QAC1C,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACrB,CAAC;CACJ;AARD,oBAQC;AAED,MAAa,UAAU;IACnB,IAAI,CAAc;IAClB,IAAI,CAAc;IAElB;QACI,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACrB,CAAC;IAED,GAAG,CAAC,KAAe;QACf,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;YACb,IAAI,CAAC,IAAI,GAAG,IAAI,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;YAClC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;YACjB,OAAO;QACX,CAAC;QAED,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;YAClB,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;YACnC,IAAI,CAAC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;YACtB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;YACjB,OAAO;QACX,CAAC;QAED,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC;QAC1B,MAAM,OAAO,GAAG,IAAI,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;QACtC,IAAI,OAAO,EAAE,CAAC;YACV,OAAO,CAAC,IAAI,GAAG,OAAO,CAAC;QAC3B,CAAC;QACD,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC;IACxB,CAAC;IAED,IAAI;QACA,IAAI,CAAC,IAAI,CAAC,IAAI;YAAE,OAAO,IAAI,CAAC;QAE5B,IAAI,KAAK,GAA6B,IAAI,CAAC,IAAI,CAAC;QAEhD,OAAO,KAAK,IAAI,IAAI,EAAE,CAAC;YACnB,IAAI,KAAK,CAAC,KAAK,YAAY,UAAU,EAAE,CAAC;gBACpC,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC;YAC7B,CAAC;iBAAM,CAAC;gBACJ,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC;YACvB,CAAC;QACL,CAAC;IACL,CAAC;CACJ;AA5CD,gCA4CC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { LinkedList } from "./linkedlist";
|
|
1
2
|
export interface NodeReturn {
|
|
2
3
|
[key: string]: any;
|
|
3
4
|
}
|
|
@@ -29,8 +30,10 @@ export interface NodeConfig {
|
|
|
29
30
|
properties: Array<NodeProperty>;
|
|
30
31
|
}
|
|
31
32
|
export declare abstract class NodeBase {
|
|
33
|
+
protected state: any;
|
|
34
|
+
constructor(state: any);
|
|
32
35
|
parseExpression(expression: string): string;
|
|
33
36
|
getConfig(): NodeConfig;
|
|
34
|
-
execute(input: NodeInput): Promise<NodeReturn>;
|
|
37
|
+
execute(input: NodeInput): Promise<NodeReturn | LinkedList>;
|
|
35
38
|
}
|
|
36
39
|
//# sourceMappingURL=node-base.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node-base.d.ts","sourceRoot":"","sources":["../../src/types/node-base.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"node-base.d.ts","sourceRoot":"","sources":["../../src/types/node-base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,MAAM,WAAW,UAAU;IACvB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACtB;AAED,MAAM,WAAW,SAAS;IACtB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;IACnB,QAAQ,EAAE;QACN,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;KACtB,CAAA;CACJ;AAED,MAAM,WAAW,YAAY;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,OAAO,CAAC;IAClB,OAAO,EAAE,GAAG,CAAC;IACb,OAAO,CAAC,EAAE,KAAK,CAAC;QACZ,KAAK,EAAE,MAAM,CAAC;QACd,KAAK,EAAE,MAAM,CAAC;KACjB,CAAC,CAAC;IACH,aAAa,CAAC,EAAE,KAAK,CAAC;QAClB,QAAQ,EAAE,MAAM,CAAC;QACjB,aAAa,EAAE,MAAM,CAAC;KACzB,CAAC,CAAC;CACN;AAED,MAAM,WAAW,UAAU;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,KAAK,CAAC,YAAY,CAAC,CAAA;CAClC;AAED,8BAAsB,QAAQ;IAE1B,SAAS,CAAC,KAAK,EAAE,GAAG,CAAC;gBAET,KAAK,EAAE,GAAG;IAItB,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM;IAgB3C,SAAS,IAAI,UAAU;IAIvB,OAAO,CAAC,KAAK,EAAE,SAAS,GAAG,OAAO,CAAC,UAAU,GAAG,UAAU,CAAC;CAG9D"}
|
package/dist/types/node-base.js
CHANGED
|
@@ -2,13 +2,20 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.NodeBase = void 0;
|
|
4
4
|
class NodeBase {
|
|
5
|
+
state;
|
|
6
|
+
constructor(state) {
|
|
7
|
+
this.state = state;
|
|
8
|
+
}
|
|
5
9
|
parseExpression(expression) {
|
|
6
10
|
const regex = /{{(.*?)}}/g;
|
|
7
11
|
const matches = expression.match(regex);
|
|
8
12
|
if (matches) {
|
|
9
13
|
matches.forEach((match) => {
|
|
10
14
|
const key = match.replace("{{", "").replace("}}", "");
|
|
11
|
-
|
|
15
|
+
let value = eval(key);
|
|
16
|
+
if (typeof value == "object") {
|
|
17
|
+
value = JSON.stringify(value);
|
|
18
|
+
}
|
|
12
19
|
expression = expression.replace(match, value);
|
|
13
20
|
});
|
|
14
21
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node-base.js","sourceRoot":"","sources":["../../src/types/node-base.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"node-base.js","sourceRoot":"","sources":["../../src/types/node-base.ts"],"names":[],"mappings":";;;AAoCA,MAAsB,QAAQ;IAEhB,KAAK,CAAM;IAErB,YAAY,KAAU;QAClB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACvB,CAAC;IAED,eAAe,CAAC,UAAkB;QAC9B,MAAM,KAAK,GAAG,YAAY,CAAC;QAC3B,MAAM,OAAO,GAAG,UAAU,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QACxC,IAAI,OAAO,EAAE,CAAC;YACV,OAAO,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;gBACtB,MAAM,GAAG,GAAG,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;gBACtD,IAAI,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC;gBACtB,IAAI,OAAO,KAAK,IAAI,QAAQ,EAAE,CAAC;oBAC3B,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;gBAClC,CAAC;gBACD,UAAU,GAAG,UAAU,CAAC,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;YAClD,CAAC,CAAC,CAAA;QACN,CAAC;QACD,OAAO,UAAU,CAAC;IACtB,CAAC;IAED,SAAS;QACL,MAAM,IAAI,KAAK,CAAC,wBAAwB,CAAC,CAAC;IAC9C,CAAC;IAED,OAAO,CAAC,KAAgB;QACpB,MAAM,IAAI,KAAK,CAAC,wBAAwB,CAAC,CAAC;IAC9C,CAAC;CACJ;AA/BD,4BA+BC"}
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -2,9 +2,8 @@ import {
|
|
|
2
2
|
NodeBase, NodeInput, NodeReturn,
|
|
3
3
|
NodeProperty, NodeConfig
|
|
4
4
|
} from "./types/node-base";
|
|
5
|
+
import { LinkedList, Node } from "./types/linkedlist";
|
|
5
6
|
|
|
6
7
|
export type { NodeInput, NodeReturn, NodeProperty, NodeConfig }
|
|
7
8
|
export { NodeBase }
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
export { LinkedList, Node }
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { NodeBase } from "./node-base";
|
|
2
|
+
|
|
3
|
+
export class Node {
|
|
4
|
+
value: NodeBase;
|
|
5
|
+
next: Node | null;
|
|
6
|
+
|
|
7
|
+
constructor(value: NodeBase, next: Node | null) {
|
|
8
|
+
this.value = value;
|
|
9
|
+
this.next = next;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export class LinkedList {
|
|
14
|
+
head: Node | null;
|
|
15
|
+
tail: Node | null;
|
|
16
|
+
|
|
17
|
+
constructor() {
|
|
18
|
+
this.head = null;
|
|
19
|
+
this.tail = null;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
add(value: NodeBase) {
|
|
23
|
+
if (!this.head) {
|
|
24
|
+
this.head = new Node(value, null);
|
|
25
|
+
this.tail = null;
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
if (!this.head.next) {
|
|
30
|
+
const next = new Node(value, null);
|
|
31
|
+
this.head.next = next;
|
|
32
|
+
this.tail = next;
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const oldNext = this.tail;
|
|
37
|
+
const newNext = new Node(value, null);
|
|
38
|
+
if (oldNext) {
|
|
39
|
+
oldNext.next = newNext;
|
|
40
|
+
}
|
|
41
|
+
this.tail = newNext;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
show() {
|
|
45
|
+
if (!this.head) return null;
|
|
46
|
+
|
|
47
|
+
let start: Node | null | LinkedList = this.head;
|
|
48
|
+
|
|
49
|
+
while (start != null) {
|
|
50
|
+
if (start.value instanceof LinkedList) {
|
|
51
|
+
start = start.value.head;
|
|
52
|
+
} else {
|
|
53
|
+
start = start.next;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
package/src/types/node-base.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { LinkedList } from "./linkedlist";
|
|
1
2
|
|
|
2
3
|
export interface NodeReturn {
|
|
3
4
|
[key: string]: any;
|
|
@@ -61,7 +62,7 @@ export abstract class NodeBase {
|
|
|
61
62
|
throw new Error("Method not implemented");
|
|
62
63
|
}
|
|
63
64
|
|
|
64
|
-
execute(input: NodeInput): Promise<NodeReturn> {
|
|
65
|
+
execute(input: NodeInput): Promise<NodeReturn | LinkedList> {
|
|
65
66
|
throw new Error("Method not implemented");
|
|
66
67
|
}
|
|
67
68
|
}
|