@lcap/nasl 4.4.1-rc.4 → 4.4.2-rc.2
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/out/generator/release-body/data.js +1 -1
- package/out/generator/release-body/data.js.map +1 -1
- package/out/generator/release-body/internal.d.ts +1 -0
- package/out/generator/release-body/internal.d.ts.map +1 -1
- package/out/generator/release-body/internal.js.map +1 -1
- package/out/generator/release-body/utils.d.ts +1 -0
- package/out/generator/release-body/utils.d.ts.map +1 -1
- package/out/generator/release-body/utils.js +1 -0
- package/out/generator/release-body/utils.js.map +1 -1
- package/out/index.d.ts +1 -1
- package/out/index.d.ts.map +1 -1
- package/out/index.js +2 -1
- package/out/index.js.map +1 -1
- package/out/natural/exports/nasl2Files.d.ts.map +1 -1
- package/out/natural/exports/nasl2Files.js +32 -1
- package/out/natural/exports/nasl2Files.js.map +1 -1
- package/out/natural/exports/transform2BatchActions/apply.d.ts +11 -0
- package/out/natural/exports/transform2BatchActions/apply.d.ts.map +1 -0
- package/out/natural/exports/transform2BatchActions/apply.js +68 -0
- package/out/natural/exports/transform2BatchActions/apply.js.map +1 -0
- package/out/natural/exports/transform2BatchActions/diff/directories.d.ts +17 -0
- package/out/natural/exports/transform2BatchActions/diff/directories.d.ts.map +1 -0
- package/out/natural/exports/transform2BatchActions/diff/directories.js +215 -0
- package/out/natural/exports/transform2BatchActions/diff/directories.js.map +1 -0
- package/out/natural/exports/transform2BatchActions/diff/index.d.ts +21 -0
- package/out/natural/exports/transform2BatchActions/diff/index.d.ts.map +1 -0
- package/out/natural/exports/transform2BatchActions/diff/index.js +20 -0
- package/out/natural/exports/transform2BatchActions/diff/index.js.map +1 -0
- package/out/natural/exports/transform2BatchActions/diff/nodes.d.ts +162 -0
- package/out/natural/exports/transform2BatchActions/diff/nodes.d.ts.map +1 -0
- package/out/natural/exports/transform2BatchActions/diff/nodes.js +464 -0
- package/out/natural/exports/transform2BatchActions/diff/nodes.js.map +1 -0
- package/out/natural/exports/transform2BatchActions/diff/roles.d.ts +18 -0
- package/out/natural/exports/transform2BatchActions/diff/roles.d.ts.map +1 -0
- package/out/natural/exports/transform2BatchActions/diff/roles.js +52 -0
- package/out/natural/exports/transform2BatchActions/diff/roles.js.map +1 -0
- package/out/natural/exports/transform2BatchActions/index.d.ts +41 -0
- package/out/natural/exports/transform2BatchActions/index.d.ts.map +1 -0
- package/out/natural/exports/transform2BatchActions/index.js +61 -0
- package/out/natural/exports/transform2BatchActions/index.js.map +1 -0
- package/out/natural/exports/transform2BatchActions/parse.d.ts +24 -0
- package/out/natural/exports/transform2BatchActions/parse.d.ts.map +1 -0
- package/out/natural/exports/transform2BatchActions/parse.js +234 -0
- package/out/natural/exports/transform2BatchActions/parse.js.map +1 -0
- package/out/natural/exports/transform2BatchActions/types.d.ts +147 -0
- package/out/natural/exports/transform2BatchActions/types.d.ts.map +1 -0
- package/out/natural/exports/transform2BatchActions/types.js +7 -0
- package/out/natural/exports/transform2BatchActions/types.js.map +1 -0
- package/out/natural/old/parser/transformTSCode.js +1 -1
- package/out/natural/old/parser/transformTSCode.js.map +1 -1
- package/out/natural/parser/parseNaturalTS.d.ts.map +1 -1
- package/out/natural/parser/parseNaturalTS.js +61 -1
- package/out/natural/parser/parseNaturalTS.js.map +1 -1
- package/out/natural/parser/parseNaturalTSXView.d.ts.map +1 -1
- package/out/natural/parser/parseNaturalTSXView.js +55 -6
- package/out/natural/parser/parseNaturalTSXView.js.map +1 -1
- package/out/natural/transforms/checker/checkIdentifierName.d.ts +6 -0
- package/out/natural/transforms/checker/checkIdentifierName.d.ts.map +1 -0
- package/out/natural/transforms/checker/checkIdentifierName.js +15 -0
- package/out/natural/transforms/checker/checkIdentifierName.js.map +1 -0
- package/out/natural/transforms/checker/checkViewElement.d.ts.map +1 -1
- package/out/natural/transforms/checker/checkViewElement.js +2 -0
- package/out/natural/transforms/checker/checkViewElement.js.map +1 -1
- package/out/natural/transforms/checker/index.d.ts +1 -0
- package/out/natural/transforms/checker/index.d.ts.map +1 -1
- package/out/natural/transforms/checker/index.js +3 -1
- package/out/natural/transforms/checker/index.js.map +1 -1
- package/out/natural/transforms/transform2Config.d.ts +17 -0
- package/out/natural/transforms/transform2Config.d.ts.map +1 -0
- package/out/natural/transforms/transform2Config.js +114 -0
- package/out/natural/transforms/transform2Config.js.map +1 -0
- package/out/natural/transforms/transform2GlobalLogicDeclaration.d.ts.map +1 -1
- package/out/natural/transforms/transform2GlobalLogicDeclaration.js +4 -1
- package/out/natural/transforms/transform2GlobalLogicDeclaration.js.map +1 -1
- package/out/natural/transforms/transform2Logic.d.ts.map +1 -1
- package/out/natural/transforms/transform2Logic.js +6 -12
- package/out/natural/transforms/transform2Logic.js.map +1 -1
- package/out/natural/transforms/transform2LogicItem.d.ts +1 -0
- package/out/natural/transforms/transform2LogicItem.d.ts.map +1 -1
- package/out/natural/transforms/transform2LogicItem.js +80 -42
- package/out/natural/transforms/transform2LogicItem.js.map +1 -1
- package/out/natural/transforms/transform2Param.d.ts +1 -1
- package/out/natural/transforms/transform2Param.d.ts.map +1 -1
- package/out/natural/transforms/transform2Param.js +19 -1
- package/out/natural/transforms/transform2Param.js.map +1 -1
- package/out/natural/transforms/transform2Roles.d.ts +3 -0
- package/out/natural/transforms/transform2Roles.d.ts.map +1 -0
- package/out/natural/transforms/transform2Roles.js +30 -0
- package/out/natural/transforms/transform2Roles.js.map +1 -0
- package/out/natural/transforms/transform2TypeAnnotation.d.ts.map +1 -1
- package/out/natural/transforms/transform2TypeAnnotation.js +8 -4
- package/out/natural/transforms/transform2TypeAnnotation.js.map +1 -1
- package/out/natural/transforms/transform2Variable.d.ts.map +1 -1
- package/out/natural/transforms/transform2Variable.js +4 -0
- package/out/natural/transforms/transform2Variable.js.map +1 -1
- package/out/natural/transforms/utils/flattenStatementsWithComments.d.ts +11 -0
- package/out/natural/transforms/utils/flattenStatementsWithComments.d.ts.map +1 -0
- package/out/natural/transforms/utils/flattenStatementsWithComments.js +36 -0
- package/out/natural/transforms/utils/flattenStatementsWithComments.js.map +1 -0
- package/out/natural/transforms/utils/parseDecorator.d.ts +2 -2
- package/out/natural/transforms/utils/parseDecorator.d.ts.map +1 -1
- package/out/natural/transforms/utils/parseDecorator.js +8 -5
- package/out/natural/transforms/utils/parseDecorator.js.map +1 -1
- package/out/natural/utils/index.d.ts +5 -0
- package/out/natural/utils/index.d.ts.map +1 -1
- package/out/natural/utils/index.js +11 -1
- package/out/natural/utils/index.js.map +1 -1
- package/out/natural/utils/nasl-file-types.d.ts +6 -1
- package/out/natural/utils/nasl-file-types.d.ts.map +1 -1
- package/out/natural/utils/nasl-file-types.js +49 -2
- package/out/natural/utils/nasl-file-types.js.map +1 -1
- package/out/server/extendBaseNode.d.ts.map +1 -1
- package/out/server/extendBaseNode.js +8 -3
- package/out/server/extendBaseNode.js.map +1 -1
- package/out/service/instruct-ruler/ruler.d.ts +3 -1
- package/out/service/instruct-ruler/ruler.d.ts.map +1 -1
- package/out/service/instruct-ruler/ruler.js +2 -1
- package/out/service/instruct-ruler/ruler.js.map +1 -1
- package/out/service/storage/init.d.ts +5 -0
- package/out/service/storage/init.d.ts.map +1 -1
- package/out/service/storage/init.js +2 -1
- package/out/service/storage/init.js.map +1 -1
- package/out/service/storage/specTools.js +2 -2
- package/out/service/storage/specTools.js.map +1 -1
- package/package.json +10 -9
- package/sandbox/stdlib/nasl.util.ts +16 -15
- package/out/natural/exports/transform2BatchActions.d.ts +0 -114
- package/out/natural/exports/transform2BatchActions.d.ts.map +0 -1
- package/out/natural/exports/transform2BatchActions.js +0 -1233
- package/out/natural/exports/transform2BatchActions.js.map +0 -1
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* 目录节点 diff
|
|
4
|
+
* 处理 app.directories 及 dataSources[0].directories 的同步
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.handleAppDirectories = void 0;
|
|
8
|
+
/**
|
|
9
|
+
* 构建全局 definition 索引(一次性构建,避免重复遍历)
|
|
10
|
+
*/
|
|
11
|
+
const buildGlobalDefIndex = (allDirs) => {
|
|
12
|
+
const defMap = new Map();
|
|
13
|
+
const dirDefMap = new Map();
|
|
14
|
+
for (const dir of allDirs) {
|
|
15
|
+
if (!dir?.definitions || !dir.name)
|
|
16
|
+
continue;
|
|
17
|
+
const defKeys = new Set();
|
|
18
|
+
for (const def of dir.definitions) {
|
|
19
|
+
if (!def)
|
|
20
|
+
continue;
|
|
21
|
+
const key = `${def.namespace}:${def.name}`;
|
|
22
|
+
defMap.set(key, { def, dirName: dir.name, dirPath: dir.nodePath });
|
|
23
|
+
defKeys.add(key);
|
|
24
|
+
}
|
|
25
|
+
if (defKeys.size > 0) {
|
|
26
|
+
dirDefMap.set(dir.name, defKeys);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
return { defMap, dirDefMap };
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* 深度比较两个 definition 是否需要更新(只比较关键属性)
|
|
33
|
+
*/
|
|
34
|
+
const needsDefinitionUpdate = (appDef, instanceDef) => {
|
|
35
|
+
if (appDef === instanceDef)
|
|
36
|
+
return false;
|
|
37
|
+
return (appDef.referredConcept !== instanceDef.referredConcept ||
|
|
38
|
+
appDef.namespace !== instanceDef.namespace ||
|
|
39
|
+
appDef.name !== instanceDef.name);
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* 同步目录的 definitions
|
|
43
|
+
*/
|
|
44
|
+
const syncDirectoryDefinitions = (instanceDir, appDir, globalDefIndex, pendingActions, errors) => {
|
|
45
|
+
try {
|
|
46
|
+
if (!instanceDir?.definitions || instanceDir.definitions.length === 0)
|
|
47
|
+
return;
|
|
48
|
+
const appDefMap = new Map((appDir?.definitions || []).map((def) => [`${def.namespace}:${def.name}`, def]));
|
|
49
|
+
for (const instanceDef of instanceDir.definitions) {
|
|
50
|
+
if (!instanceDef)
|
|
51
|
+
continue;
|
|
52
|
+
const key = `${instanceDef.namespace}:${instanceDef.name}`;
|
|
53
|
+
const defObject = instanceDef.toJSON();
|
|
54
|
+
const appDefInCurrentDir = appDefMap.get(key);
|
|
55
|
+
if (appDefInCurrentDir) {
|
|
56
|
+
if (needsDefinitionUpdate(appDefInCurrentDir, instanceDef)) {
|
|
57
|
+
pendingActions.push({ action: 'delete', path: appDefInCurrentDir.nodePath, object: null }, { action: 'create', path: `${appDir.nodePath}.definitions[0]`, object: defObject });
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
const defInOtherDir = globalDefIndex.defMap.get(key);
|
|
62
|
+
if (defInOtherDir && defInOtherDir.dirName !== appDir.name) {
|
|
63
|
+
pendingActions.push({ action: 'delete', path: defInOtherDir.def.nodePath, object: null });
|
|
64
|
+
}
|
|
65
|
+
pendingActions.push({
|
|
66
|
+
action: 'create',
|
|
67
|
+
path: `${appDir.nodePath}.definitions[0]`,
|
|
68
|
+
object: defObject,
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
catch (error) {
|
|
74
|
+
errors.push({
|
|
75
|
+
item: instanceDir?.name || 'unknown',
|
|
76
|
+
type: 'definitionSync',
|
|
77
|
+
error: error,
|
|
78
|
+
level: 4,
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
/**
|
|
83
|
+
* 删除新目录中的 definitions 在其他目录中的旧引用
|
|
84
|
+
*/
|
|
85
|
+
const deleteOldDefinitionReferences = (instanceDir, globalDefIndex, pendingActions) => {
|
|
86
|
+
if (!instanceDir?.definitions || instanceDir.definitions.length === 0)
|
|
87
|
+
return;
|
|
88
|
+
for (const instanceDef of instanceDir.definitions) {
|
|
89
|
+
if (!instanceDef)
|
|
90
|
+
continue;
|
|
91
|
+
const key = `${instanceDef.namespace}:${instanceDef.name}`;
|
|
92
|
+
const oldDef = globalDefIndex.defMap.get(key);
|
|
93
|
+
if (oldDef) {
|
|
94
|
+
pendingActions.push({ action: 'delete', path: oldDef.def.nodePath, object: null });
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
/**
|
|
99
|
+
* 同步单个目录(新增或同步 definitions)
|
|
100
|
+
*/
|
|
101
|
+
const syncSingleDirectory = (instanceDir, appDir, globalDefIndex, parentPath, pendingActions, errors, errorType) => {
|
|
102
|
+
try {
|
|
103
|
+
if (!appDir) {
|
|
104
|
+
deleteOldDefinitionReferences(instanceDir, globalDefIndex, pendingActions);
|
|
105
|
+
pendingActions.push({
|
|
106
|
+
action: 'create',
|
|
107
|
+
path: parentPath,
|
|
108
|
+
object: instanceDir.toJSON(),
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
else {
|
|
112
|
+
syncDirectoryDefinitions(instanceDir, appDir, globalDefIndex, pendingActions, errors);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
catch (error) {
|
|
116
|
+
errors.push({
|
|
117
|
+
item: instanceDir?.name || 'unknown',
|
|
118
|
+
type: errorType,
|
|
119
|
+
error: error,
|
|
120
|
+
level: 4,
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
/**
|
|
125
|
+
* 处理 app directories 同步
|
|
126
|
+
* 处理 'LOGICS'、'ENUMS'、'STRUCTURES' 以及 dataSources[0].directories
|
|
127
|
+
*/
|
|
128
|
+
const handleAppDirectories = (appInstance, app, batchActions, errors) => {
|
|
129
|
+
if (!appInstance || !app) {
|
|
130
|
+
errors.push({
|
|
131
|
+
item: 'handleAppDirectories',
|
|
132
|
+
type: 'invalidParams',
|
|
133
|
+
error: new Error('appInstance 或 app 参数无效'),
|
|
134
|
+
level: 5,
|
|
135
|
+
});
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
try {
|
|
139
|
+
const hasInstanceDirs = appInstance.directories?.some((dir) => ['LOGICS', 'ENUMS', 'STRUCTURES'].includes(dir?.name) && dir.children?.length > 0);
|
|
140
|
+
const hasDataSourceDirs = appInstance.dataSources?.[0]?.directories?.length > 0;
|
|
141
|
+
if (!hasInstanceDirs && !hasDataSourceDirs)
|
|
142
|
+
return;
|
|
143
|
+
const pendingActions = [];
|
|
144
|
+
// 处理根目录类型 (LOGICS, ENUMS, STRUCTURES)
|
|
145
|
+
const rootDirectoryTypes = ['LOGICS', 'ENUMS', 'STRUCTURES'];
|
|
146
|
+
for (const rootType of rootDirectoryTypes) {
|
|
147
|
+
try {
|
|
148
|
+
const instanceRootDir = appInstance.directories?.find((dir) => dir?.name === rootType);
|
|
149
|
+
if (!instanceRootDir?.children?.length)
|
|
150
|
+
continue;
|
|
151
|
+
const appRootDir = app.directories?.find((dir) => dir?.name === rootType);
|
|
152
|
+
if (!appRootDir) {
|
|
153
|
+
pendingActions.push({
|
|
154
|
+
action: 'create',
|
|
155
|
+
path: 'app.directories[0]',
|
|
156
|
+
object: instanceRootDir.toJSON(),
|
|
157
|
+
});
|
|
158
|
+
continue;
|
|
159
|
+
}
|
|
160
|
+
const allAppChildDirs = appRootDir.children || [];
|
|
161
|
+
const appChildDirMap = new Map(allAppChildDirs.filter((dir) => dir?.name).map((dir) => [dir.name, dir]));
|
|
162
|
+
const globalDefIndex = buildGlobalDefIndex(allAppChildDirs);
|
|
163
|
+
for (const instanceChildDir of instanceRootDir.children) {
|
|
164
|
+
if (!instanceChildDir?.name)
|
|
165
|
+
continue;
|
|
166
|
+
syncSingleDirectory(instanceChildDir, appChildDirMap.get(instanceChildDir.name), globalDefIndex, `${appRootDir.nodePath}.children[0]`, pendingActions, errors, 'directorySync');
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
catch (error) {
|
|
170
|
+
errors.push({
|
|
171
|
+
item: rootType,
|
|
172
|
+
type: 'rootDirectorySync',
|
|
173
|
+
error: error,
|
|
174
|
+
level: 4,
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
// 处理数据源 (Entity) directories
|
|
179
|
+
if (appInstance.dataSources?.[0]?.directories && app.dataSources?.[0]) {
|
|
180
|
+
try {
|
|
181
|
+
const instanceDataSource = appInstance.dataSources[0];
|
|
182
|
+
const appDataSource = app.dataSources[0];
|
|
183
|
+
const allAppEntityDirs = appDataSource.directories || [];
|
|
184
|
+
const entityDirMap = new Map(allAppEntityDirs.filter((dir) => dir?.name).map((dir) => [dir.name, dir]));
|
|
185
|
+
const globalDefIndex = buildGlobalDefIndex(allAppEntityDirs);
|
|
186
|
+
for (const instanceDir of instanceDataSource.directories) {
|
|
187
|
+
if (!instanceDir?.name)
|
|
188
|
+
continue;
|
|
189
|
+
syncSingleDirectory(instanceDir, entityDirMap.get(instanceDir.name), globalDefIndex, `${appDataSource.nodePath}.directories[0]`, pendingActions, errors, 'entityDirectorySync');
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
catch (error) {
|
|
193
|
+
errors.push({
|
|
194
|
+
item: 'dataSources',
|
|
195
|
+
type: 'dataSourceDirectorySync',
|
|
196
|
+
error: error,
|
|
197
|
+
level: 4,
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
if (pendingActions.length > 0) {
|
|
202
|
+
batchActions.actions.push(...pendingActions);
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
catch (error) {
|
|
206
|
+
errors.push({
|
|
207
|
+
item: 'handleAppDirectories',
|
|
208
|
+
type: 'directorySync',
|
|
209
|
+
error: error,
|
|
210
|
+
level: 4,
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
};
|
|
214
|
+
exports.handleAppDirectories = handleAppDirectories;
|
|
215
|
+
//# sourceMappingURL=directories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"directories.js","sourceRoot":"","sources":["../../../../../src/natural/exports/transform2BatchActions/diff/directories.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAeH;;GAEG;AACH,MAAM,mBAAmB,GAAG,CAAC,OAAc,EAAkB,E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../../../../concepts';
|
|
6
|
+
import type { ItemType, Operators } from '../types';
|
|
7
|
+
/**
|
|
8
|
+
* 执行完整的 diff:(appInstance, app, itemTypes) → batchActions
|
|
9
|
+
*/
|
|
10
|
+
export declare const diffAll: (appInstance: App, app: App, itemTypes: Array<{
|
|
11
|
+
type: ItemType;
|
|
12
|
+
name: string;
|
|
13
|
+
action: string;
|
|
14
|
+
parentViewNames?: string[];
|
|
15
|
+
}>, batchActions: Operators, errors: Array<{
|
|
16
|
+
item: string;
|
|
17
|
+
type: string;
|
|
18
|
+
error: Error;
|
|
19
|
+
level: number;
|
|
20
|
+
}>) => void;
|
|
21
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/natural/exports/transform2BatchActions/diff/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,GAAG,EAAE,MAAM,sBAAsB,CAAC;AAC3C,OAAO,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAKpD;;GAEG;AACH,eAAO,MAAM,OAAO,gBACL,GAAG,OACX,GAAG,aACG,MAAM;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,eAAe,CAAC,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC,gBAChF,SAAS,UACf,MAAM;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,KACzE,IAIF,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* diff 阶段协调层
|
|
4
|
+
* 调用各节点类型的 diff 逻辑,合并结果到 batchActions
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.diffAll = void 0;
|
|
8
|
+
const nodes_1 = require("./nodes");
|
|
9
|
+
const roles_1 = require("./roles");
|
|
10
|
+
const directories_1 = require("./directories");
|
|
11
|
+
/**
|
|
12
|
+
* 执行完整的 diff:(appInstance, app, itemTypes) → batchActions
|
|
13
|
+
*/
|
|
14
|
+
const diffAll = (appInstance, app, itemTypes, batchActions, errors) => {
|
|
15
|
+
(0, nodes_1.processNodeItems)(appInstance, app, itemTypes, batchActions, errors);
|
|
16
|
+
(0, directories_1.handleAppDirectories)(appInstance, app, batchActions, errors);
|
|
17
|
+
(0, roles_1.handleAppRoles)(appInstance, app, batchActions);
|
|
18
|
+
};
|
|
19
|
+
exports.diffAll = diffAll;
|
|
20
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/natural/exports/transform2BatchActions/diff/index.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAIH,mCAA2C;AAC3C,mCAAyC;AACzC,+CAAqD;AAErD;;GAEG;AACI,MAAM,OAAO,GAAG,CACrB,WAAgB,EAChB,GAAQ,EACR,SAA8F,EAC9F,YAAuB,EACvB,MAA0E,EACpE,EAAE;IACR,IAAA,wBAAgB,EAAC,WAAW,EAAE,GAAG,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,CAAC,CAAC;IACpE,IAAA,kCAAoB,EAAC,WAAW,EAAE,GAAG,EAAE,YAAY,EAAE,MAAM,CAAC,CAAC;IAC7D,IAAA,sBAAc,EAAC,WAAW,EAAE,GAAG,EAAE,YAAY,CAAC,CAAC;AACjD,CAAC,CAAC;AAVW,QAAA,OAAO,WAUlB"}
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 标准节点 diff
|
|
3
|
+
* 处理 entity/structure/enum/logic/view/variables/theme 节点的增删改
|
|
4
|
+
* 含:类型守卫、TypeHandler 工厂、节点处理函数、节点遍历主循环
|
|
5
|
+
*/
|
|
6
|
+
import { type ItemType, type Operators, type SingleNodeHandler, type ViewHandler, type GlobalVariablesHandler, type ThemeHandler, type ConfigurationHandler, type TypeHandler } from '../types';
|
|
7
|
+
export declare const isSingleNodeHandler: (handler: TypeHandler) => handler is SingleNodeHandler;
|
|
8
|
+
export declare const isViewHandler: (handler: TypeHandler) => handler is ViewHandler;
|
|
9
|
+
export declare const isGlobalVariablesHandler: (handler: TypeHandler) => handler is GlobalVariablesHandler;
|
|
10
|
+
export declare const isThemeHandler: (handler: TypeHandler) => handler is ThemeHandler;
|
|
11
|
+
export declare const isConfigurationHandler: (handler: TypeHandler) => handler is ConfigurationHandler;
|
|
12
|
+
/**
|
|
13
|
+
* 构建嵌套视图的 NASL 路径
|
|
14
|
+
*/
|
|
15
|
+
export declare const buildNestedViewPath: (parentViewNames: string[], viewName: string) => string;
|
|
16
|
+
/**
|
|
17
|
+
* 创建视图查找函数
|
|
18
|
+
*/
|
|
19
|
+
export declare const createViewFinder: (instance: any) => (name: string, parentViewNames?: string[]) => any;
|
|
20
|
+
/**
|
|
21
|
+
* 创建各类型节点的处理器(工厂函数)
|
|
22
|
+
*/
|
|
23
|
+
export declare const createTypeHandlers: (appInstance: any, app: any) => {
|
|
24
|
+
entity: {
|
|
25
|
+
type: "entity";
|
|
26
|
+
path: string;
|
|
27
|
+
findMethod: (name: string) => any;
|
|
28
|
+
findExisting: (name: string) => any;
|
|
29
|
+
};
|
|
30
|
+
structure: {
|
|
31
|
+
type: "structure";
|
|
32
|
+
path: string;
|
|
33
|
+
findMethod: (name: string) => any;
|
|
34
|
+
findExisting: (name: string) => any;
|
|
35
|
+
};
|
|
36
|
+
enum: {
|
|
37
|
+
type: "enum";
|
|
38
|
+
path: string;
|
|
39
|
+
findMethod: (name: string) => any;
|
|
40
|
+
findExisting: (name: string) => any;
|
|
41
|
+
};
|
|
42
|
+
logic: {
|
|
43
|
+
type: "logic";
|
|
44
|
+
path: string;
|
|
45
|
+
findMethod: (name: string) => any;
|
|
46
|
+
findExisting: (name: string) => any;
|
|
47
|
+
};
|
|
48
|
+
view: {
|
|
49
|
+
type: "view";
|
|
50
|
+
path: string;
|
|
51
|
+
findMethod: (name: string, parentViewNames?: string[]) => any;
|
|
52
|
+
findExisting: (name: string, parentViewNames?: string[]) => any;
|
|
53
|
+
};
|
|
54
|
+
backendVariables: {
|
|
55
|
+
type: "backendVariables";
|
|
56
|
+
path: string;
|
|
57
|
+
findMethod: (name?: string) => any;
|
|
58
|
+
findExisting: (name?: string) => any;
|
|
59
|
+
};
|
|
60
|
+
frontendVariables: {
|
|
61
|
+
type: "frontendVariables";
|
|
62
|
+
path: string;
|
|
63
|
+
findMethod: (name?: string) => any;
|
|
64
|
+
findExisting: (name?: string) => any;
|
|
65
|
+
};
|
|
66
|
+
theme: {
|
|
67
|
+
type: "theme";
|
|
68
|
+
path: string;
|
|
69
|
+
findMethod: () => any;
|
|
70
|
+
findExisting: () => any;
|
|
71
|
+
};
|
|
72
|
+
configuration: {
|
|
73
|
+
type: "configuration";
|
|
74
|
+
path: (groupName: string) => string;
|
|
75
|
+
findMethod: (groupName: string, propName?: string) => any;
|
|
76
|
+
findExisting: (groupName: string, propName?: string) => any;
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
/**
|
|
80
|
+
* 通用删除操作处理
|
|
81
|
+
*/
|
|
82
|
+
export declare const handleDeleteOperation: (params: {
|
|
83
|
+
handler: SingleNodeHandler | ViewHandler | GlobalVariablesHandler;
|
|
84
|
+
itemName: string;
|
|
85
|
+
itemType: ItemType;
|
|
86
|
+
batchActions: Operators;
|
|
87
|
+
errors: Array<{
|
|
88
|
+
item: string;
|
|
89
|
+
type: string;
|
|
90
|
+
error: Error;
|
|
91
|
+
level: number;
|
|
92
|
+
}>;
|
|
93
|
+
parentViewNames?: string[];
|
|
94
|
+
errorMessageTemplate?: string;
|
|
95
|
+
}) => void;
|
|
96
|
+
/**
|
|
97
|
+
* 处理全局变量类型(一个文件对应多个节点)
|
|
98
|
+
*/
|
|
99
|
+
export declare const processGlobalVariables: (params: {
|
|
100
|
+
handler: GlobalVariablesHandler;
|
|
101
|
+
action: string;
|
|
102
|
+
itemType: ItemType;
|
|
103
|
+
batchActions: Operators;
|
|
104
|
+
errors: Array<{
|
|
105
|
+
item: string;
|
|
106
|
+
type: string;
|
|
107
|
+
error: Error;
|
|
108
|
+
level: number;
|
|
109
|
+
}>;
|
|
110
|
+
}) => void;
|
|
111
|
+
/**
|
|
112
|
+
* 处理配置类型(一个文件对应多个 ConfigProperty 节点)
|
|
113
|
+
*/
|
|
114
|
+
export declare const processConfigurationProperties: (params: {
|
|
115
|
+
handler: ConfigurationHandler;
|
|
116
|
+
groupName: string;
|
|
117
|
+
action: string;
|
|
118
|
+
itemType: ItemType;
|
|
119
|
+
batchActions: Operators;
|
|
120
|
+
errors: Array<{
|
|
121
|
+
item: string;
|
|
122
|
+
type: string;
|
|
123
|
+
error: Error;
|
|
124
|
+
level: number;
|
|
125
|
+
}>;
|
|
126
|
+
}) => void;
|
|
127
|
+
/**
|
|
128
|
+
* 处理单节点类型(一个文件对应一个节点)
|
|
129
|
+
*/
|
|
130
|
+
export declare const processSingleNode: (params: {
|
|
131
|
+
handler: SingleNodeHandler | ViewHandler;
|
|
132
|
+
itemName: string;
|
|
133
|
+
itemType: ItemType;
|
|
134
|
+
action: string;
|
|
135
|
+
parentViewNames?: string[];
|
|
136
|
+
batchActions: Operators;
|
|
137
|
+
errors: Array<{
|
|
138
|
+
item: string;
|
|
139
|
+
type: string;
|
|
140
|
+
error: Error;
|
|
141
|
+
level: number;
|
|
142
|
+
}>;
|
|
143
|
+
}) => void;
|
|
144
|
+
/**
|
|
145
|
+
* 检查项目类型是否允许空名称
|
|
146
|
+
*/
|
|
147
|
+
export declare const isNameOptional: (itemType: ItemType) => boolean;
|
|
148
|
+
/**
|
|
149
|
+
* 遍历 itemTypes,为每个节点生成对应的 BatchAction
|
|
150
|
+
*/
|
|
151
|
+
export declare const processNodeItems: (appInstance: any, app: any, itemTypes: Array<{
|
|
152
|
+
type: ItemType;
|
|
153
|
+
name: string;
|
|
154
|
+
action: string;
|
|
155
|
+
parentViewNames?: string[];
|
|
156
|
+
}>, batchActions: Operators, errors: Array<{
|
|
157
|
+
item: string;
|
|
158
|
+
type: string;
|
|
159
|
+
error: Error;
|
|
160
|
+
level: number;
|
|
161
|
+
}>) => void;
|
|
162
|
+
//# sourceMappingURL=nodes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nodes.d.ts","sourceRoot":"","sources":["../../../../../src/natural/exports/transform2BatchActions/diff/nodes.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,KAAK,QAAQ,EACb,KAAK,SAAS,EACd,KAAK,iBAAiB,EACtB,KAAK,WAAW,EAChB,KAAK,sBAAsB,EAC3B,KAAK,YAAY,EACjB,KAAK,oBAAoB,EACzB,KAAK,WAAW,EACjB,MAAM,UAAU,CAAC;AAIlB,eAAO,MAAM,mBAAmB,YAAa,WAAW,iCAEvD,CAAC;AAEF,eAAO,MAAM,aAAa,YAAa,WAAW,2BAEjD,CAAC;AAEF,eAAO,MAAM,wBAAwB,YAC1B,WAAW,sCAGrB,CAAC;AAEF,eAAO,MAAM,cAAc,YAAa,WAAW,4BAElD,CAAC;AAEF,eAAO,MAAM,sBAAsB,YAAa,WAAW,oCAE1D,CAAC;AAIF;;GAEG;AACH,eAAO,MAAM,mBAAmB,oBAAqB,MAAM,EAAE,YAAY,MAAM,KAAG,MAYjF,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gBAAgB,aAChB,GAAG,YACP,MAAM,oBAAmB,MAAM,EAAE,QAGvC,CAAC;AAIJ;;GAEG;AACH,eAAO,MAAM,kBAAkB,gBAAiB,GAAG,OAAO,GAAG;;;;2BAItC,MAAM;6BACJ,MAAM;;;;;2BAKR,MAAM;6BACJ,MAAM;;;;;2B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