@easyrpa/script-creator 1.0.1 → 1.0.5
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 +89 -1
- package/dist/index.js +27 -2
- package/package.json +1 -1
- package/dist/types.d.ts +0 -87
- package/dist/types.js +0 -19
- package/dist/utils.d.ts +0 -3
- package/dist/utils.js +0 -8
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { ExternalDataNodeType, ExternalDataEdgeType, MetaDataType, VariablesNamesType, CollectionType } from "./types";
|
|
2
1
|
export interface IScriptCreator {
|
|
3
2
|
collections: CollectionType[];
|
|
4
3
|
metaData?: MetaDataType;
|
|
@@ -30,3 +29,92 @@ export declare class ScriptCreator implements IScriptCreator {
|
|
|
30
29
|
private createCallNodeFunction;
|
|
31
30
|
private createScriptString;
|
|
32
31
|
}
|
|
32
|
+
export type CollectionType = {
|
|
33
|
+
name: string;
|
|
34
|
+
nodes: ExternalDataNodeType[];
|
|
35
|
+
};
|
|
36
|
+
export type ExternalDataNodeType = {
|
|
37
|
+
name: string;
|
|
38
|
+
label: {
|
|
39
|
+
ru: string;
|
|
40
|
+
en: string;
|
|
41
|
+
};
|
|
42
|
+
collection: string;
|
|
43
|
+
cid: string;
|
|
44
|
+
parentsId: string[];
|
|
45
|
+
type: NodeTypes;
|
|
46
|
+
path: string;
|
|
47
|
+
scriptPath: string;
|
|
48
|
+
id: string;
|
|
49
|
+
inputHandles: ExternalDataHandleType[];
|
|
50
|
+
outputHandles: ExternalDataHandleType[];
|
|
51
|
+
stateTerminals: ExternalDataStateTerminalType[];
|
|
52
|
+
connectedEdges: ExternalDataEdgeType[];
|
|
53
|
+
contentValues?: ContentValuesType;
|
|
54
|
+
children?: ExternalDataNodeType[];
|
|
55
|
+
dataSubFlow?: ExternalDataDefaultFlowType;
|
|
56
|
+
scriptLineNumber?: number;
|
|
57
|
+
};
|
|
58
|
+
export type ExternalDataDefaultFlowType = {
|
|
59
|
+
nodes: ExternalDataNodeType[];
|
|
60
|
+
edges: ExternalDataEdgeType[];
|
|
61
|
+
};
|
|
62
|
+
export type ContentValuesType = {
|
|
63
|
+
[key: string]: string | number | {
|
|
64
|
+
[key: string]: string | number;
|
|
65
|
+
} | (string | number)[];
|
|
66
|
+
};
|
|
67
|
+
export type ExternalDataEdgeType = {
|
|
68
|
+
target: string;
|
|
69
|
+
targetCid: string;
|
|
70
|
+
targetHandle?: string;
|
|
71
|
+
source: string;
|
|
72
|
+
sourceCid: string;
|
|
73
|
+
sourceHandle?: string;
|
|
74
|
+
isReplacement: boolean;
|
|
75
|
+
};
|
|
76
|
+
export type ExternalDataStateTerminalType = {
|
|
77
|
+
inputHandles: ExternalDataHandleType[];
|
|
78
|
+
outputHandles: ExternalDataHandleType[];
|
|
79
|
+
handlesType: HandleTypes;
|
|
80
|
+
cid: string;
|
|
81
|
+
};
|
|
82
|
+
export type ExternalDataHandleType = {
|
|
83
|
+
name: string;
|
|
84
|
+
hidden: boolean;
|
|
85
|
+
value: string;
|
|
86
|
+
connectedEdges: ExternalDataEdgeType[];
|
|
87
|
+
dataHandleSubFlowTerminal?: ExternalDataHandleType;
|
|
88
|
+
nodeСid: string;
|
|
89
|
+
};
|
|
90
|
+
export declare enum HandleTypes {
|
|
91
|
+
INPUT = "input",
|
|
92
|
+
OUTPUT = "output"
|
|
93
|
+
}
|
|
94
|
+
export declare enum NodeTypes {
|
|
95
|
+
CONTROL = "control",
|
|
96
|
+
CONTAINER = "container",
|
|
97
|
+
STATETERMINAL = "stateTerminal",
|
|
98
|
+
SUBFLOW = "subFlow",
|
|
99
|
+
EXTERNALSTATETERMINAL = "externalStateTerminal"
|
|
100
|
+
}
|
|
101
|
+
export declare enum LanguageNames {
|
|
102
|
+
RU = "ru",
|
|
103
|
+
EN = "en"
|
|
104
|
+
}
|
|
105
|
+
export type VariablesNamesType = {
|
|
106
|
+
nodesVariableName: string;
|
|
107
|
+
containerDataName: string;
|
|
108
|
+
nodesJsonVariableName: string;
|
|
109
|
+
inputDictName: string;
|
|
110
|
+
inHandlesName: string;
|
|
111
|
+
defaultScriptName: string;
|
|
112
|
+
};
|
|
113
|
+
export type MetaDataType = {
|
|
114
|
+
appLanguage?: LanguageNames;
|
|
115
|
+
};
|
|
116
|
+
export type EdgeSortedType = ExternalDataEdgeType & {
|
|
117
|
+
visited?: boolean;
|
|
118
|
+
};
|
|
119
|
+
export declare const getSubFlowName: (subFlow: ExternalDataNodeType) => string;
|
|
120
|
+
export declare const normalize: (p: string) => string;
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import fsPromises from "fs/promises";
|
|
2
2
|
import path from "path";
|
|
3
|
-
import { HandleTypes, NodeTypes, } from "./types";
|
|
4
|
-
import { getSubFlowName, normalize } from "./utils";
|
|
5
3
|
export class ScriptCreator {
|
|
6
4
|
constructor(collections, config) {
|
|
7
5
|
this.logDebugVariablesPath = config?.logDebugVariablesPath;
|
|
@@ -458,3 +456,30 @@ export class ScriptCreator {
|
|
|
458
456
|
return resultArray.join("\n");
|
|
459
457
|
}
|
|
460
458
|
}
|
|
459
|
+
export var HandleTypes;
|
|
460
|
+
(function (HandleTypes) {
|
|
461
|
+
HandleTypes["INPUT"] = "input";
|
|
462
|
+
HandleTypes["OUTPUT"] = "output";
|
|
463
|
+
})(HandleTypes || (HandleTypes = {}));
|
|
464
|
+
export var NodeTypes;
|
|
465
|
+
(function (NodeTypes) {
|
|
466
|
+
NodeTypes["CONTROL"] = "control";
|
|
467
|
+
NodeTypes["CONTAINER"] = "container";
|
|
468
|
+
NodeTypes["STATETERMINAL"] = "stateTerminal";
|
|
469
|
+
NodeTypes["SUBFLOW"] = "subFlow";
|
|
470
|
+
NodeTypes["EXTERNALSTATETERMINAL"] = "externalStateTerminal";
|
|
471
|
+
})(NodeTypes || (NodeTypes = {}));
|
|
472
|
+
export var LanguageNames;
|
|
473
|
+
(function (LanguageNames) {
|
|
474
|
+
LanguageNames["RU"] = "ru";
|
|
475
|
+
LanguageNames["EN"] = "en";
|
|
476
|
+
})(LanguageNames || (LanguageNames = {}));
|
|
477
|
+
;
|
|
478
|
+
//utils
|
|
479
|
+
//получение имени SubFLow
|
|
480
|
+
export const getSubFlowName = (subFlow) => {
|
|
481
|
+
return `${subFlow.name}_${subFlow.cid}`;
|
|
482
|
+
};
|
|
483
|
+
export const normalize = (p) => {
|
|
484
|
+
return path.normalize(p.replaceAll('\\', '/'));
|
|
485
|
+
};
|
package/package.json
CHANGED
package/dist/types.d.ts
DELETED
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
export type CollectionType = {
|
|
2
|
-
name: string;
|
|
3
|
-
nodes: ExternalDataNodeType[];
|
|
4
|
-
};
|
|
5
|
-
export type ExternalDataNodeType = {
|
|
6
|
-
name: string;
|
|
7
|
-
label: {
|
|
8
|
-
ru: string;
|
|
9
|
-
en: string;
|
|
10
|
-
};
|
|
11
|
-
collection: string;
|
|
12
|
-
cid: string;
|
|
13
|
-
parentsId: string[];
|
|
14
|
-
type: NodeTypes;
|
|
15
|
-
path: string;
|
|
16
|
-
scriptPath: string;
|
|
17
|
-
id: string;
|
|
18
|
-
inputHandles: ExternalDataHandleType[];
|
|
19
|
-
outputHandles: ExternalDataHandleType[];
|
|
20
|
-
stateTerminals: ExternalDataStateTerminalType[];
|
|
21
|
-
connectedEdges: ExternalDataEdgeType[];
|
|
22
|
-
contentValues?: ContentValuesType;
|
|
23
|
-
children?: ExternalDataNodeType[];
|
|
24
|
-
dataSubFlow?: ExternalDataDefaultFlowType;
|
|
25
|
-
scriptLineNumber?: number;
|
|
26
|
-
};
|
|
27
|
-
export type ExternalDataDefaultFlowType = {
|
|
28
|
-
nodes: ExternalDataNodeType[];
|
|
29
|
-
edges: ExternalDataEdgeType[];
|
|
30
|
-
};
|
|
31
|
-
export type ContentValuesType = {
|
|
32
|
-
[key: string]: string | number | {
|
|
33
|
-
[key: string]: string | number;
|
|
34
|
-
} | (string | number)[];
|
|
35
|
-
};
|
|
36
|
-
export type ExternalDataEdgeType = {
|
|
37
|
-
target: string;
|
|
38
|
-
targetCid: string;
|
|
39
|
-
targetHandle?: string;
|
|
40
|
-
source: string;
|
|
41
|
-
sourceCid: string;
|
|
42
|
-
sourceHandle?: string;
|
|
43
|
-
isReplacement: boolean;
|
|
44
|
-
};
|
|
45
|
-
export type ExternalDataStateTerminalType = {
|
|
46
|
-
inputHandles: ExternalDataHandleType[];
|
|
47
|
-
outputHandles: ExternalDataHandleType[];
|
|
48
|
-
handlesType: HandleTypes;
|
|
49
|
-
cid: string;
|
|
50
|
-
};
|
|
51
|
-
export type ExternalDataHandleType = {
|
|
52
|
-
name: string;
|
|
53
|
-
hidden: boolean;
|
|
54
|
-
value: string;
|
|
55
|
-
connectedEdges: ExternalDataEdgeType[];
|
|
56
|
-
dataHandleSubFlowTerminal?: ExternalDataHandleType;
|
|
57
|
-
nodeСid: string;
|
|
58
|
-
};
|
|
59
|
-
export declare enum HandleTypes {
|
|
60
|
-
INPUT = "input",
|
|
61
|
-
OUTPUT = "output"
|
|
62
|
-
}
|
|
63
|
-
export declare enum NodeTypes {
|
|
64
|
-
CONTROL = "control",
|
|
65
|
-
CONTAINER = "container",
|
|
66
|
-
STATETERMINAL = "stateTerminal",
|
|
67
|
-
SUBFLOW = "subFlow",
|
|
68
|
-
EXTERNALSTATETERMINAL = "externalStateTerminal"
|
|
69
|
-
}
|
|
70
|
-
export declare enum LanguageNames {
|
|
71
|
-
RU = "ru",
|
|
72
|
-
EN = "en"
|
|
73
|
-
}
|
|
74
|
-
export type VariablesNamesType = {
|
|
75
|
-
nodesVariableName: string;
|
|
76
|
-
containerDataName: string;
|
|
77
|
-
nodesJsonVariableName: string;
|
|
78
|
-
inputDictName: string;
|
|
79
|
-
inHandlesName: string;
|
|
80
|
-
defaultScriptName: string;
|
|
81
|
-
};
|
|
82
|
-
export type MetaDataType = {
|
|
83
|
-
appLanguage?: LanguageNames;
|
|
84
|
-
};
|
|
85
|
-
export type EdgeSortedType = ExternalDataEdgeType & {
|
|
86
|
-
visited?: boolean;
|
|
87
|
-
};
|
package/dist/types.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
export var HandleTypes;
|
|
2
|
-
(function (HandleTypes) {
|
|
3
|
-
HandleTypes["INPUT"] = "input";
|
|
4
|
-
HandleTypes["OUTPUT"] = "output";
|
|
5
|
-
})(HandleTypes || (HandleTypes = {}));
|
|
6
|
-
export var NodeTypes;
|
|
7
|
-
(function (NodeTypes) {
|
|
8
|
-
NodeTypes["CONTROL"] = "control";
|
|
9
|
-
NodeTypes["CONTAINER"] = "container";
|
|
10
|
-
NodeTypes["STATETERMINAL"] = "stateTerminal";
|
|
11
|
-
NodeTypes["SUBFLOW"] = "subFlow";
|
|
12
|
-
NodeTypes["EXTERNALSTATETERMINAL"] = "externalStateTerminal";
|
|
13
|
-
})(NodeTypes || (NodeTypes = {}));
|
|
14
|
-
export var LanguageNames;
|
|
15
|
-
(function (LanguageNames) {
|
|
16
|
-
LanguageNames["RU"] = "ru";
|
|
17
|
-
LanguageNames["EN"] = "en";
|
|
18
|
-
})(LanguageNames || (LanguageNames = {}));
|
|
19
|
-
;
|
package/dist/utils.d.ts
DELETED
package/dist/utils.js
DELETED