@lcap/nasl 2.18.0-beta.7 → 2.19.0-beta.1
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/automate/template/myProcess.js +1 -1
- package/out/automate/template/myProcess.js.map +1 -1
- package/out/bak/translator.js +2 -1
- package/out/bak/translator.js.map +1 -1
- package/out/common/Command.d.ts +1 -0
- package/out/common/Command.js +5 -1
- package/out/common/Command.js.map +1 -1
- package/out/concepts/AnonymousFunction__.d.ts +1 -0
- package/out/concepts/AnonymousFunction__.js +40 -2
- package/out/concepts/AnonymousFunction__.js.map +1 -1
- package/out/concepts/App__.d.ts +10 -0
- package/out/concepts/App__.js +132 -0
- package/out/concepts/App__.js.map +1 -1
- package/out/concepts/Assignee__.js +4 -3
- package/out/concepts/Assignee__.js.map +1 -1
- package/out/concepts/BatchAssignment__.d.ts +2 -0
- package/out/concepts/BatchAssignment__.js +45 -1
- package/out/concepts/BatchAssignment__.js.map +1 -1
- package/out/concepts/BindAttribute__.js +8 -1
- package/out/concepts/BindAttribute__.js.map +1 -1
- package/out/concepts/CallFunction__.js +51 -18
- package/out/concepts/CallFunction__.js.map +1 -1
- package/out/concepts/CallInterface__.js +6 -4
- package/out/concepts/CallInterface__.js.map +1 -1
- package/out/concepts/CallLogic__.js +87 -15
- package/out/concepts/CallLogic__.js.map +1 -1
- package/out/concepts/CallQueryComponent__.js +4 -1
- package/out/concepts/CallQueryComponent__.js.map +1 -1
- package/out/concepts/DataSource__.d.ts +2 -0
- package/out/concepts/DataSource__.js +55 -1
- package/out/concepts/DataSource__.js.map +1 -1
- package/out/concepts/ForEachStatement__.js +2 -0
- package/out/concepts/ForEachStatement__.js.map +1 -1
- package/out/concepts/Identifier__.d.ts +1 -0
- package/out/concepts/Identifier__.js +18 -7
- package/out/concepts/Identifier__.js.map +1 -1
- package/out/concepts/LogicItem__.d.ts +1 -1
- package/out/concepts/LogicItem__.js.map +1 -1
- package/out/concepts/Logic__.d.ts +1 -0
- package/out/concepts/Logic__.js +27 -14
- package/out/concepts/Logic__.js.map +1 -1
- package/out/concepts/Match__.js +13 -8
- package/out/concepts/Match__.js.map +1 -1
- package/out/concepts/NewComposite__.d.ts +345 -0
- package/out/concepts/NewComposite__.js +1067 -0
- package/out/concepts/NewComposite__.js.map +1 -0
- package/out/concepts/NewList__.d.ts +130 -0
- package/out/concepts/NewList__.js +353 -0
- package/out/concepts/NewList__.js.map +1 -0
- package/out/concepts/NewMap__.d.ts +221 -0
- package/out/concepts/NewMap__.js +492 -0
- package/out/concepts/NewMap__.js.map +1 -0
- package/out/concepts/New__.d.ts +19 -0
- package/out/concepts/New__.js +66 -0
- package/out/concepts/New__.js.map +1 -0
- package/out/concepts/Param__.d.ts +2 -0
- package/out/concepts/Param__.js +40 -3
- package/out/concepts/Param__.js.map +1 -1
- package/out/concepts/ProcessElement__.js +31 -10
- package/out/concepts/ProcessElement__.js.map +1 -1
- package/out/concepts/ProcessOutcome__.js +1 -1
- package/out/concepts/ProcessOutcome__.js.map +1 -1
- package/out/concepts/ProcessOutcomes__.d.ts +30 -0
- package/out/concepts/{ConstructArgument__.js → ProcessOutcomes__.js} +27 -48
- package/out/concepts/ProcessOutcomes__.js.map +1 -0
- package/out/concepts/Return__.js +2 -1
- package/out/concepts/Return__.js.map +1 -1
- package/out/concepts/SelectMembers__.js +3 -3
- package/out/concepts/SelectMembers__.js.map +1 -1
- package/out/concepts/StringInterpolation__.js +12 -2
- package/out/concepts/StringInterpolation__.js.map +1 -1
- package/out/concepts/TypeAnnotation__.d.ts +4 -0
- package/out/concepts/TypeAnnotation__.js +66 -12
- package/out/concepts/TypeAnnotation__.js.map +1 -1
- package/out/concepts/ValidationRule__.js +1 -1
- package/out/concepts/ValidationRule__.js.map +1 -1
- package/out/concepts/Variable__.js +2 -1
- package/out/concepts/Variable__.js.map +1 -1
- package/out/concepts/ViewElement__.js +12 -0
- package/out/concepts/ViewElement__.js.map +1 -1
- package/out/concepts/View__.d.ts +1 -0
- package/out/concepts/View__.js +9 -0
- package/out/concepts/View__.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.auth.js +1 -1
- package/out/concepts/basics/stdlib/nasl.auth.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.logging.js +5 -0
- package/out/concepts/basics/stdlib/nasl.logging.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.ui.js +2 -0
- package/out/concepts/basics/stdlib/nasl.ui.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.util.js +151 -19
- package/out/concepts/basics/stdlib/nasl.util.js.map +1 -1
- package/out/concepts/index__.d.ts +5 -0
- package/out/concepts/index__.js +5 -0
- package/out/concepts/index__.js.map +1 -1
- package/out/enums/KEYWORDS.js +1 -0
- package/out/enums/KEYWORDS.js.map +1 -1
- package/out/generator/genMetaData.js +1 -6
- package/out/generator/genMetaData.js.map +1 -1
- package/out/generator/genReleaseBody.d.ts +2 -0
- package/out/generator/genReleaseBody.js +18 -1
- package/out/generator/genReleaseBody.js.map +1 -1
- package/out/generator/index.d.ts +1 -0
- package/out/generator/index.js +1 -0
- package/out/generator/index.js.map +1 -1
- package/out/generator/permission.d.ts +9 -0
- package/out/generator/permission.js +235 -0
- package/out/generator/permission.js.map +1 -0
- package/out/index.d.ts +1 -1
- package/out/index.js +2 -1
- package/out/index.js.map +1 -1
- package/out/server/entity2LogicNamespace.js +69 -9
- package/out/server/entity2LogicNamespace.js.map +1 -1
- package/out/server/extendBaseNode.js +7 -3
- package/out/server/extendBaseNode.js.map +1 -1
- package/out/server/formatTsUtils.js +6 -0
- package/out/server/formatTsUtils.js.map +1 -1
- package/out/server/getLogics.d.ts +2 -1
- package/out/server/getLogics.js +11 -0
- package/out/server/getLogics.js.map +1 -1
- package/out/server/getMemberIdentifier.js +1 -1
- package/out/server/getMemberIdentifier.js.map +1 -1
- package/out/server/naslServer.d.ts +1 -1
- package/out/server/naslServer.js +161 -22
- package/out/server/naslServer.js.map +1 -1
- package/out/server/process2LogicNamespace.js +8 -0
- package/out/server/process2LogicNamespace.js.map +1 -1
- package/out/server/translator.js +53 -8
- package/out/server/translator.js.map +1 -1
- package/out/service/creator/add.configs.js +4 -0
- package/out/service/creator/add.configs.js.map +1 -1
- package/out/service/datasource/api.d.ts +12 -0
- package/out/service/datasource/api.js +14 -0
- package/out/service/datasource/api.js.map +1 -0
- package/out/service/datasource/index.d.ts +2 -0
- package/out/service/datasource/index.js +10 -0
- package/out/service/datasource/index.js.map +1 -0
- package/out/service/storage/init.js +8 -1
- package/out/service/storage/init.js.map +1 -1
- package/out/templator/genEditTableBlock.js +4 -5
- package/out/templator/genEditTableBlock.js.map +1 -1
- package/out/templator/genGetBlock.js +4 -3
- package/out/templator/genGetBlock.js.map +1 -1
- package/out/templator/genGridViewBlock.js +16 -14
- package/out/templator/genGridViewBlock.js.map +1 -1
- package/out/templator/genListViewBlock.js +5 -5
- package/out/templator/genListViewBlock.js.map +1 -1
- package/out/templator/genTableBlock.js +6 -10
- package/out/templator/genTableBlock.js.map +1 -1
- package/package.json +1 -1
- package/sandbox/stdlib/dist/nasl.util.js +0 -0
- package/sandbox/stdlib/nasl.auth.ts +1 -1
- package/sandbox/stdlib/nasl.core.ts +4 -0
- package/sandbox/stdlib/nasl.logging.ts +4 -4
- package/sandbox/stdlib/nasl.util.ts +13 -4
- package/src/automate/template/myProcess.js +1 -1
- package/src/bak/translator.js +4 -1
- package/src/common/Command.ts +4 -0
- package/src/concepts/AnonymousFunction__.ts +48 -2
- package/src/concepts/App__.ts +140 -41
- package/src/concepts/Assignee__.ts +4 -3
- package/src/concepts/BatchAssignment__.ts +45 -1
- package/src/concepts/BindAttribute__.ts +9 -2
- package/src/concepts/CallFunction__.ts +65 -31
- package/src/concepts/CallInterface__.ts +6 -22
- package/src/concepts/CallLogic__.ts +62 -13
- package/src/concepts/CallQueryComponent__.ts +4 -1
- package/src/concepts/DataSource__.ts +56 -1
- package/src/concepts/ForEachStatement__.ts +2 -0
- package/src/concepts/Identifier__.ts +18 -7
- package/src/concepts/LogicItem__.ts +1 -1
- package/src/concepts/Logic__.ts +48 -32
- package/src/concepts/Match__.ts +12 -8
- package/src/concepts/NewComposite__.ts +1356 -0
- package/src/concepts/NewList__.ts +444 -0
- package/src/concepts/NewMap__.ts +678 -0
- package/src/concepts/New__.ts +73 -0
- package/src/concepts/Param__.ts +238 -199
- package/src/concepts/ProcessElement__.ts +32 -10
- package/src/concepts/ProcessOutcome__.ts +1 -1
- package/src/concepts/ProcessOutcomes__.ts +90 -0
- package/src/concepts/Return__.ts +4 -1
- package/src/concepts/SelectMembers__.ts +3 -3
- package/src/concepts/StringInterpolation__.ts +21 -11
- package/src/concepts/TypeAnnotation__.ts +71 -50
- package/src/concepts/ValidationRule__.ts +19 -1
- package/src/concepts/Variable__.ts +4 -1
- package/src/concepts/ViewElement__.ts +38 -1
- package/src/concepts/View__.ts +12 -2
- package/src/concepts/basics/stdlib/dist/nasl.util.js +133 -34
- package/src/concepts/basics/stdlib/nasl.auth.ts +1 -1
- package/src/concepts/basics/stdlib/nasl.logging.ts +5 -0
- package/src/concepts/basics/stdlib/nasl.ui.ts +2 -0
- package/src/concepts/basics/stdlib/nasl.util.ts +153 -19
- package/src/concepts/dist/BindAttribute__.js +760 -0
- package/src/concepts/dist/BindEvent__.js +732 -0
- package/src/concepts/dist/CallFunction__.js +21 -7
- package/src/concepts/dist/CallLogic__.js +50 -10
- package/src/concepts/dist/Identifier__.js +311 -0
- package/src/concepts/dist/StringInterpolation__.js +231 -0
- package/src/concepts/dist/TypeAnnotation__.js +834 -0
- package/src/concepts/dist/ViewElement__.js +12 -0
- package/src/concepts/dist/View__.js +1601 -0
- package/src/concepts/index__.ts +5 -0
- package/src/enums/KEYWORDS.ts +1 -0
- package/src/generator/dist/genMetaData.js +1 -5
- package/src/generator/dist/permission.js +392 -0
- package/src/generator/genMetaData.ts +1 -6
- package/src/generator/genReleaseBody.ts +21 -3
- package/src/generator/index.ts +1 -0
- package/src/generator/permission.ts +271 -0
- package/src/index.ts +1 -1
- package/src/server/dist/naslServer.js +385 -269
- package/src/server/entity2LogicNamespace.ts +70 -10
- package/src/server/extendBaseNode.ts +7 -3
- package/src/server/formatTsUtils.ts +6 -0
- package/src/server/getLogics.ts +13 -1
- package/src/server/getMemberIdentifier.ts +1 -1
- package/src/server/naslServer.ts +162 -29
- package/src/server/process2LogicNamespace.ts +8 -0
- package/src/server/translator.ts +52 -9
- package/src/service/creator/add.configs.js +4 -0
- package/src/service/dataSource/api.js +11 -0
- package/src/service/dataSource/index.js +6 -0
- package/src/service/storage/dist/init.js +8 -1
- package/src/service/storage/init.ts +9 -2
- package/src/service/video/VideoTranscribe.js +1 -0
- package/src/templator/dist/genEditTableBlock.js +204 -0
- package/src/templator/dist/genGridViewBlock.js +265 -0
- package/src/templator/dist/genListViewBlock.js +84 -0
- package/src/templator/dist/genTableBlock.js +209 -0
- package/src/templator/dist/utils.js +527 -0
- package/src/templator/genEditTableBlock.ts +8 -16
- package/src/templator/genGetBlock.ts +18 -19
- package/src/templator/genGridViewBlock.ts +18 -18
- package/src/templator/genListViewBlock.ts +8 -11
- package/src/templator/genTableBlock.ts +6 -10
- package/ts-worker/dist/webpack.config.dev.js +1 -3
- package/ts-worker/lib/tsserver.js +8 -1
- package/out/automate/engine/2.14-components.d.ts +0 -1115
- package/out/automate/engine/2.14-components.js +0 -1087
- package/out/automate/engine/2.14-components.js.map +0 -1
- package/out/concepts/ConstructArgument__.d.ts +0 -40
- package/out/concepts/ConstructArgument__.js.map +0 -1
- package/out/concepts/Construct__.d.ts +0 -189
- package/out/concepts/Construct__.js +0 -340
- package/out/concepts/Construct__.js.map +0 -1
- package/out/concepts/MatchExpression__.d.ts +0 -97
- package/out/concepts/MatchExpression__.js +0 -281
- package/out/concepts/MatchExpression__.js.map +0 -1
- package/out/templator/sql-parser/index.d.ts +0 -1
- package/out/templator/sql-parser/index.js +0 -228
- package/out/templator/sql-parser/index.js.map +0 -1
- package/out/templator/sql-parser/parser.js +0 -26664
- package/out/templator/sql-parser/parser.js.map +0 -1
- package/src/concepts/dist/Anchor__.js +0 -179
- package/src/concepts/dist/Assignment__.js +0 -301
- package/src/concepts/dist/CallInterface__.js +0 -533
- package/src/concepts/dist/ForEachStatement__.js +0 -426
- package/src/concepts/dist/MatchCase__.js +0 -587
- package/src/concepts/dist/Match__.js +0 -631
- package/src/concepts/dist/MemberExpression__.js +0 -348
- package/src/concepts/dist/Param__.js +0 -538
- package/src/concepts/dist/Return__.js +0 -494
- package/src/concepts/dist/Variable__.js +0 -537
- package/src/server/dist/formatTsUtils.js +0 -683
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CallLogic, EntityProperty, BindEvent, App, Namespace, Entity, BaseNode, Logic, Param, TypeAnnotation, Function, Return } from '..';
|
|
1
|
+
import { CallLogic, EntityProperty, BindEvent, App, Namespace, Entity, BaseNode, Logic, Param, TypeAnnotation, Function, Return, AnonymousFunction, NewList } from '..';
|
|
2
2
|
|
|
3
3
|
export function entity2LogicNamespace(entity: Entity) {
|
|
4
4
|
const properties = entity.properties;
|
|
@@ -86,6 +86,26 @@ export function entity2LogicNamespace(entity: Entity) {
|
|
|
86
86
|
}),
|
|
87
87
|
required: true,
|
|
88
88
|
}),
|
|
89
|
+
new Param({
|
|
90
|
+
name: 'properties',
|
|
91
|
+
defaultExpression: new AnonymousFunction({
|
|
92
|
+
description: '',
|
|
93
|
+
params: [
|
|
94
|
+
new Param({
|
|
95
|
+
name: 'item',
|
|
96
|
+
typeAnnotation: new TypeAnnotation({
|
|
97
|
+
typeKind: 'reference',
|
|
98
|
+
typeNamespace: entity.getNamespace(),
|
|
99
|
+
typeName: entity.name,
|
|
100
|
+
}),
|
|
101
|
+
}),
|
|
102
|
+
],
|
|
103
|
+
body: new NewList({
|
|
104
|
+
concept: 'NewList',
|
|
105
|
+
}),
|
|
106
|
+
}),
|
|
107
|
+
required: false,
|
|
108
|
+
}),
|
|
89
109
|
],
|
|
90
110
|
returns: [
|
|
91
111
|
new Return({
|
|
@@ -135,15 +155,6 @@ export function entity2LogicNamespace(entity: Entity) {
|
|
|
135
155
|
name: 'updateBy',
|
|
136
156
|
description: '根据条件,将body除id外所有属性更新到数据记录',
|
|
137
157
|
params: [
|
|
138
|
-
new Param({
|
|
139
|
-
name: 'body',
|
|
140
|
-
typeAnnotation: new TypeAnnotation({
|
|
141
|
-
typeKind: 'reference',
|
|
142
|
-
typeNamespace: entity.getNamespace(),
|
|
143
|
-
typeName: entity.name,
|
|
144
|
-
}),
|
|
145
|
-
required: true,
|
|
146
|
-
}),
|
|
147
158
|
new Param({
|
|
148
159
|
name: 'filter',
|
|
149
160
|
defaultExpression: new Function({
|
|
@@ -167,6 +178,35 @@ export function entity2LogicNamespace(entity: Entity) {
|
|
|
167
178
|
}),
|
|
168
179
|
required: true,
|
|
169
180
|
}),
|
|
181
|
+
new Param({
|
|
182
|
+
name: 'body',
|
|
183
|
+
typeAnnotation: new TypeAnnotation({
|
|
184
|
+
typeKind: 'reference',
|
|
185
|
+
typeNamespace: entity.getNamespace(),
|
|
186
|
+
typeName: entity.name,
|
|
187
|
+
}),
|
|
188
|
+
required: true,
|
|
189
|
+
}),
|
|
190
|
+
new Param({
|
|
191
|
+
name: 'properties',
|
|
192
|
+
defaultExpression: new AnonymousFunction({
|
|
193
|
+
description: '',
|
|
194
|
+
params: [
|
|
195
|
+
new Param({
|
|
196
|
+
name: 'item',
|
|
197
|
+
typeAnnotation: new TypeAnnotation({
|
|
198
|
+
typeKind: 'reference',
|
|
199
|
+
typeNamespace: entity.getNamespace(),
|
|
200
|
+
typeName: entity.name,
|
|
201
|
+
}),
|
|
202
|
+
}),
|
|
203
|
+
],
|
|
204
|
+
body: new NewList({
|
|
205
|
+
concept: 'NewList',
|
|
206
|
+
}),
|
|
207
|
+
}),
|
|
208
|
+
required: false,
|
|
209
|
+
}),
|
|
170
210
|
],
|
|
171
211
|
returns: [
|
|
172
212
|
new Return({
|
|
@@ -257,6 +297,26 @@ export function entity2LogicNamespace(entity: Entity) {
|
|
|
257
297
|
}),
|
|
258
298
|
required: true,
|
|
259
299
|
}),
|
|
300
|
+
new Param({
|
|
301
|
+
name: 'properties',
|
|
302
|
+
defaultExpression: new AnonymousFunction({
|
|
303
|
+
description: '',
|
|
304
|
+
params: [
|
|
305
|
+
new Param({
|
|
306
|
+
name: 'item',
|
|
307
|
+
typeAnnotation: new TypeAnnotation({
|
|
308
|
+
typeKind: 'reference',
|
|
309
|
+
typeNamespace: entity.getNamespace(),
|
|
310
|
+
typeName: entity.name,
|
|
311
|
+
}),
|
|
312
|
+
}),
|
|
313
|
+
],
|
|
314
|
+
body: new NewList({
|
|
315
|
+
concept: 'NewList',
|
|
316
|
+
}),
|
|
317
|
+
}),
|
|
318
|
+
required: false,
|
|
319
|
+
}),
|
|
260
320
|
],
|
|
261
321
|
returns: [
|
|
262
322
|
new Return({
|
|
@@ -230,7 +230,11 @@ BaseNode.prototype.prepareDelete = async function prepareDelete() {
|
|
|
230
230
|
return null;
|
|
231
231
|
const minRange: MinRange = naslServer._findMinRange(record, fileNode as FileNode);
|
|
232
232
|
if (minRange) {
|
|
233
|
-
|
|
233
|
+
/**
|
|
234
|
+
* 调用方是 调用逻辑或者跳转页面, 去删除对应位置的内容
|
|
235
|
+
* 如果是跳转页面,因为流程下的特殊翻译,需要过滤下 非页面下的参数修改,查找到页面跳转
|
|
236
|
+
*/
|
|
237
|
+
if (minRange.node instanceof CallLogic || (node.parentNode instanceof View && minRange.node instanceof Destination)) {
|
|
234
238
|
minRange.node.deleteCalleeArg(Index);
|
|
235
239
|
}
|
|
236
240
|
}
|
|
@@ -339,14 +343,14 @@ BaseNode.prototype.addParamsPrepare = async function addParamsPrepare(needAdd =
|
|
|
339
343
|
/**
|
|
340
344
|
* 在原型上增加方法来调用
|
|
341
345
|
*/
|
|
342
|
-
BaseNode.prototype.getCurrentTypeAnnotation = async function getCurrentTypeAnnotation() {
|
|
346
|
+
BaseNode.prototype.getCurrentTypeAnnotation = async function getCurrentTypeAnnotation(outTime? :number) {
|
|
343
347
|
try {
|
|
344
348
|
/**
|
|
345
349
|
* 查找这个节点是不是有依赖
|
|
346
350
|
*/
|
|
347
351
|
const app = this.getAncestor('App');
|
|
348
352
|
const naslServer = (app as any).naslServer as NaslServer;
|
|
349
|
-
return naslServer.getCurrentTypeAnnotation(this);
|
|
353
|
+
return naslServer.getCurrentTypeAnnotation(this, outTime || 2000);
|
|
350
354
|
} catch (err) {
|
|
351
355
|
console.log(err);
|
|
352
356
|
}
|
|
@@ -513,6 +513,8 @@ export function formatVariableData(data: unknown | variableItem[], node: BaseNod
|
|
|
513
513
|
item.expression = memberExpression;
|
|
514
514
|
item.variableParent = parent;
|
|
515
515
|
item.typeKey = typeKey;
|
|
516
|
+
// 标记实体属性是否是符合类型
|
|
517
|
+
item.isComplexType = item.typeAnnotation?.isComplexType();
|
|
516
518
|
}
|
|
517
519
|
// 如果有类型而且类型不是没有子集的类型,就把他当前的类型拿到
|
|
518
520
|
if (typeKey && !isNoChildType(typeKey)) {
|
|
@@ -532,6 +534,10 @@ export function formatVariableData(data: unknown | variableItem[], node: BaseNod
|
|
|
532
534
|
// 如果是从实体或者数据结构取的属性,就需要重置一下类型
|
|
533
535
|
item.concept = 'CompletionProperty';
|
|
534
536
|
const completionProperty = new CompletionProperty(item);
|
|
537
|
+
// 标记实体属性是否是符合类型
|
|
538
|
+
if (typeof item.isComplexType === 'boolean') {
|
|
539
|
+
Object.assign(completionProperty, { isComplexType: item.isComplexType });
|
|
540
|
+
}
|
|
535
541
|
if (!parent) {
|
|
536
542
|
// 变量 param return 在这里添加图标
|
|
537
543
|
completionProperty.icon = getNodeiconFromLogic(completionProperty, node);
|
package/src/server/getLogics.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Identifier } from './../concepts/Identifier__';
|
|
1
2
|
import { CallLogic, BindEvent, App, Namespace, Entity, BaseNode, Logic, Param, TypeAnnotation, Return, Process, ViewElement, stdlibNamespace, EnumItem } from '..';
|
|
2
3
|
import { process2LogicNamespace } from './process2LogicNamespace';
|
|
3
4
|
import { moduleToLogicNamesapce } from './getExtensionModules';
|
|
@@ -56,7 +57,7 @@ function iterator(tree: FakeNode | FakeProcessNode, searchContent: string, fakeN
|
|
|
56
57
|
function toHump(name: string): string {
|
|
57
58
|
return name.replace(/\-(\w)/g, (all, letter) => letter.toUpperCase());
|
|
58
59
|
}
|
|
59
|
-
export async function getLogics(node: CallLogic | BindEvent, needAllLogic: boolean = true) {
|
|
60
|
+
export async function getLogics(node: CallLogic | BindEvent| Identifier, needAllLogic: boolean = true) {
|
|
60
61
|
const app = node.rootNode as App;
|
|
61
62
|
if (node.concept === 'CallLogic' || node.concept === 'BindEvent') {
|
|
62
63
|
const result = [];
|
|
@@ -264,6 +265,17 @@ export async function getLogics(node: CallLogic | BindEvent, needAllLogic: boole
|
|
|
264
265
|
result.push(systemTree);
|
|
265
266
|
}
|
|
266
267
|
return result;
|
|
268
|
+
} else if (node.concept === 'Identifier') {
|
|
269
|
+
const extensions = app.dependencies.map(moduleToLogicNamesapce).filter((item) => item.logics && item.logics.length);
|
|
270
|
+
const tree = new Namespace({
|
|
271
|
+
name: 'category`',
|
|
272
|
+
path: `${app.getNamespace()}.logics`,
|
|
273
|
+
title: '全局逻辑',
|
|
274
|
+
logics: app.logics,
|
|
275
|
+
children: [...extensions],
|
|
276
|
+
});
|
|
277
|
+
|
|
278
|
+
return [tree];
|
|
267
279
|
}
|
|
268
280
|
}
|
|
269
281
|
|
|
@@ -191,7 +191,7 @@ export async function getMemberIdentifier(node: BaseNode) {
|
|
|
191
191
|
|
|
192
192
|
// 这个可能需要自己算一下
|
|
193
193
|
const result = [
|
|
194
|
-
{ name: '
|
|
194
|
+
{ name: '常量', children: literals, expanded: true, icon: 'category' },
|
|
195
195
|
{ name: '枚举', children: newEnums, expanded: false, icon: 'category' },
|
|
196
196
|
{ name: '变量', children: completionData, expanded: true, icon: 'category' },
|
|
197
197
|
{ name: '公共变量', children: globalVariable, expanded: false, icon: 'category' },
|
package/src/server/naslServer.ts
CHANGED
|
@@ -202,7 +202,34 @@ export class NaslServer {
|
|
|
202
202
|
// 收集到一个行为集合
|
|
203
203
|
const eventValue = $event.value;
|
|
204
204
|
eventValue.forEach(async (item: EventPayload) => {
|
|
205
|
-
|
|
205
|
+
/**
|
|
206
|
+
* 多个行为进行合并
|
|
207
|
+
* 合并规则是
|
|
208
|
+
* 1.[a,b,c,c] 在cc的时候,在已有一个c,又来一个c的时候,如果他们不都是file级别的节点
|
|
209
|
+
* 就可以前面的内容去掉,只保留最后一个
|
|
210
|
+
* 2.[a,b,c,b,c] 在bc已存在,又来了bc 这就都要保留,因为可能顺序有相关性,不能去掉
|
|
211
|
+
* 理论上只处理同时几个操作 合并,
|
|
212
|
+
* 3.有field的也直接保留
|
|
213
|
+
*/
|
|
214
|
+
try {
|
|
215
|
+
const changeEvent = item.originEvent;
|
|
216
|
+
const changeNode = changeEvent.target;
|
|
217
|
+
const { fileNode } = this.getCurrentSource(changeNode);
|
|
218
|
+
if (changeNode !== fileNode || !changeEvent.field) {
|
|
219
|
+
const findIndex = this.changeStackList.findIndex((changeStackItem: EventPayload) => {
|
|
220
|
+
const target = changeStackItem.target;
|
|
221
|
+
const { fileNode: targetFileNode } = this.getCurrentSource(target);
|
|
222
|
+
return targetFileNode === fileNode;
|
|
223
|
+
});
|
|
224
|
+
if (findIndex === this.changeStackList.length - 1) {
|
|
225
|
+
this.changeStackList.pop();
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
this.changeStackList.push(item.originEvent);
|
|
229
|
+
} catch (err) {
|
|
230
|
+
console.log(err);
|
|
231
|
+
this.changeStackList.push(item.originEvent);
|
|
232
|
+
}
|
|
206
233
|
});
|
|
207
234
|
|
|
208
235
|
// 如果有长度开始执行状态机
|
|
@@ -615,7 +642,8 @@ export class NaslServer {
|
|
|
615
642
|
return '';
|
|
616
643
|
}
|
|
617
644
|
async getDataSchemaStructureOrTypeAnnotation(node: ViewElement) {
|
|
618
|
-
if (!(node instanceof ViewElement))
|
|
645
|
+
if (!(node instanceof ViewElement))
|
|
646
|
+
return;
|
|
619
647
|
|
|
620
648
|
const { currentSource, fileNode } = this.getCurrentSource(node);
|
|
621
649
|
const quickInfo = await this._getTypeQuickinfo({
|
|
@@ -626,16 +654,18 @@ export class NaslServer {
|
|
|
626
654
|
if (quickInfo.responseRequired) {
|
|
627
655
|
const displayString = quickInfo?.response?.displayString || '';
|
|
628
656
|
const flag = displayString.includes('<') && displayString.includes('>');
|
|
629
|
-
if(!flag)
|
|
657
|
+
if (!flag)
|
|
658
|
+
return;
|
|
630
659
|
|
|
631
660
|
const types = /\<([^()]+)\>/g.exec(displayString);
|
|
632
|
-
|
|
661
|
+
const typeStr = types && types[1];
|
|
633
662
|
const app = node.app;
|
|
634
663
|
if (typeStr.includes('__name: "AStructure_')) {
|
|
635
664
|
const properties: StructureProperty[] = [];
|
|
636
665
|
typeStr
|
|
637
666
|
.replace(/([^:\s]+):\s+([^;]+);/g, ($1, name, typeKey) => {
|
|
638
|
-
if(name === '__name')
|
|
667
|
+
if (name === '__name')
|
|
668
|
+
return;
|
|
639
669
|
|
|
640
670
|
typeKey = `app.${typeKey}`;
|
|
641
671
|
const keys = typeKey.split('.');
|
|
@@ -647,12 +677,12 @@ export class NaslServer {
|
|
|
647
677
|
typeKind: 'reference',
|
|
648
678
|
typeName,
|
|
649
679
|
typeNamespace,
|
|
650
|
-
})
|
|
651
|
-
}))
|
|
680
|
+
}),
|
|
681
|
+
}));
|
|
652
682
|
return '';
|
|
653
683
|
});
|
|
654
684
|
return TypeAnnotation.createTypeAnonymousStructure(properties);
|
|
655
|
-
} else if(typeStr.startsWith('structures'))
|
|
685
|
+
} else if (typeStr.startsWith('structures'))
|
|
656
686
|
return app.findNodeByCompleteName(`app.${typeStr}`);
|
|
657
687
|
}
|
|
658
688
|
}
|
|
@@ -814,7 +844,8 @@ export class NaslServer {
|
|
|
814
844
|
// record.suggestionDiagnostics = record.suggestionDiagnostics.filter((item) => !item.text.includes(`implicitly has an 'any' type, but a better type may be inferred from usage.`));
|
|
815
845
|
// }
|
|
816
846
|
record.suggestionDiagnostics = record.suggestionDiagnostics
|
|
817
|
-
.filter((item) => [`'__LogicEmpty' is declared but its value is never read.`, `'__destinationEmpty__' is declared but its value is never read.`
|
|
847
|
+
.filter((item) => [`'__LogicEmpty' is declared but its value is never read.`, `'__destinationEmpty__' is declared but its value is never read.`
|
|
848
|
+
, `'__UpdateNoProperty__' is declared but its value is never read.`].includes(item.text))
|
|
818
849
|
.map((diag) => this._resolveDiagnostic(diag as unknown as tsProtocol.DiagnosticWithFileName, node as FileNode, record))
|
|
819
850
|
.filter((diag) => !!diag);
|
|
820
851
|
|
|
@@ -847,7 +878,7 @@ export class NaslServer {
|
|
|
847
878
|
}
|
|
848
879
|
if (removed)
|
|
849
880
|
return diagnostics;
|
|
850
|
-
fileNode?.sourceMap.forEach(
|
|
881
|
+
fileNode?.sourceMap.forEach((value, node) => {
|
|
851
882
|
if (node instanceof Match) {
|
|
852
883
|
const { cases, expression } = node || {};
|
|
853
884
|
const typeAnnotationMap: any = {};
|
|
@@ -857,7 +888,7 @@ export class NaslServer {
|
|
|
857
888
|
count: 0,
|
|
858
889
|
};
|
|
859
890
|
if (Array.isArray(cases)) {
|
|
860
|
-
cases.forEach(
|
|
891
|
+
cases.forEach((caseItem, index) => {
|
|
861
892
|
let isDisabled = false;
|
|
862
893
|
// 是最后一项
|
|
863
894
|
if (index === cases.length - 1) {
|
|
@@ -997,7 +1028,7 @@ export class NaslServer {
|
|
|
997
1028
|
if (removed)
|
|
998
1029
|
return diagnostics;
|
|
999
1030
|
|
|
1000
|
-
fileNode?.sourceMap.forEach(
|
|
1031
|
+
fileNode?.sourceMap.forEach((value, node) => {
|
|
1001
1032
|
if (node instanceof ViewElement && node.view === fileNode) {
|
|
1002
1033
|
if (node.tag) {
|
|
1003
1034
|
node.bindAttrs.forEach((bindAttr) => {
|
|
@@ -1111,6 +1142,40 @@ export class NaslServer {
|
|
|
1111
1142
|
},
|
|
1112
1143
|
};
|
|
1113
1144
|
diagnostics.push(diagnostic);
|
|
1145
|
+
} else if (propertyValue.value) {
|
|
1146
|
+
const dataSource: any = fileNode;
|
|
1147
|
+
// 数据源有连接错误
|
|
1148
|
+
let envText;
|
|
1149
|
+
if (propertyValue.env === 'dev') {
|
|
1150
|
+
if (dataSource.__devConnectError) {
|
|
1151
|
+
envText = '开发';
|
|
1152
|
+
} else if (dataSource.__devConnectError === false) {
|
|
1153
|
+
return;
|
|
1154
|
+
}
|
|
1155
|
+
} else if (propertyValue.env === 'online') {
|
|
1156
|
+
if (dataSource.__onlineConnectError) {
|
|
1157
|
+
envText = '生产';
|
|
1158
|
+
} else if (dataSource.__onlineConnectError === false) {
|
|
1159
|
+
return;
|
|
1160
|
+
}
|
|
1161
|
+
}
|
|
1162
|
+
// 手动插入报错
|
|
1163
|
+
if (envText) {
|
|
1164
|
+
const diagnostic = {
|
|
1165
|
+
node: fileNode,
|
|
1166
|
+
severity: 'error',
|
|
1167
|
+
message: `数据源配置:数据源 ${property.name} ${envText}环境数据源连接不通,请先检查${envText}环境数据源配置`,
|
|
1168
|
+
// 保留原来的内容方便查询一些问题
|
|
1169
|
+
originalDiagnostic: {
|
|
1170
|
+
fileName: '',
|
|
1171
|
+
start: <any>null,
|
|
1172
|
+
end: <any>null,
|
|
1173
|
+
category: 'error',
|
|
1174
|
+
text: `DataSource connection error`,
|
|
1175
|
+
},
|
|
1176
|
+
};
|
|
1177
|
+
return diagnostics.push(diagnostic);
|
|
1178
|
+
}
|
|
1114
1179
|
}
|
|
1115
1180
|
});
|
|
1116
1181
|
}
|
|
@@ -1121,17 +1186,18 @@ export class NaslServer {
|
|
|
1121
1186
|
if (fileNode.parentNode instanceof App && !fileNode.parentNode.logics.includes(fileNode))
|
|
1122
1187
|
return diagnostics;
|
|
1123
1188
|
|
|
1124
|
-
fileNode?.sourceMap.forEach(
|
|
1189
|
+
fileNode?.sourceMap.forEach((value, node) => {
|
|
1190
|
+
//OQL支持返回复合类型数据了
|
|
1125
1191
|
// SqlQueryComponent内部返回值类型,如果是嵌套的就需要报错
|
|
1126
|
-
if ((node instanceof OqlQueryComponent || node instanceof SqlQueryComponent) && (node as SqlQueryComponent).getTypeBanError()) {
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
}
|
|
1192
|
+
// if ((node instanceof OqlQueryComponent || node instanceof SqlQueryComponent) && (node as SqlQueryComponent).getTypeBanError()) {
|
|
1193
|
+
// const diagnostic = {
|
|
1194
|
+
// node,
|
|
1195
|
+
// severity: 'error',
|
|
1196
|
+
// message: 'SQL查询:返回类型内部,不支持复杂类型。',
|
|
1197
|
+
// };
|
|
1198
|
+
// node.tsErrorDetail = diagnostic;
|
|
1199
|
+
// diagnostics.push(diagnostic);
|
|
1200
|
+
// }
|
|
1135
1201
|
if (node instanceof Return || node instanceof Variable) {
|
|
1136
1202
|
if (!node.typeAnnotation && !node.__TypeAnnotation) {
|
|
1137
1203
|
const nodeTypeName = node.concept === 'Return' ? '输出参数' : '局部变量';
|
|
@@ -1167,6 +1233,11 @@ export class NaslServer {
|
|
|
1167
1233
|
this.checkNodeError(node, diagnostics);
|
|
1168
1234
|
});
|
|
1169
1235
|
}
|
|
1236
|
+
if (fileNode instanceof Process) {
|
|
1237
|
+
fileNode?.sourceMap.forEach((value, node) => {
|
|
1238
|
+
this.checkNodeError(node, diagnostics);
|
|
1239
|
+
});
|
|
1240
|
+
}
|
|
1170
1241
|
return diagnostics;
|
|
1171
1242
|
}
|
|
1172
1243
|
|
|
@@ -1226,6 +1297,16 @@ export class NaslServer {
|
|
|
1226
1297
|
}
|
|
1227
1298
|
});
|
|
1228
1299
|
}
|
|
1300
|
+
if (node instanceof MatchCase && (node.getAncestor('Match') as Match)?.isExpression && node.body.length === 0 && !node.isDisabled) {
|
|
1301
|
+
const diagnostic = {
|
|
1302
|
+
node,
|
|
1303
|
+
severity: 'error',
|
|
1304
|
+
message: '匹配分支:表达式不能为空',
|
|
1305
|
+
titleTip: '表达式不能为空',
|
|
1306
|
+
};
|
|
1307
|
+
node.tsErrorDetail = diagnostic;
|
|
1308
|
+
diagnostics.push(diagnostic);
|
|
1309
|
+
}
|
|
1229
1310
|
// 如果节点是match的patterns 里的
|
|
1230
1311
|
if (node?.parentKey === 'patterns' && node.parentNode instanceof MatchCase) {
|
|
1231
1312
|
const matchNode = node.getAncestor('Match');
|
|
@@ -1244,9 +1325,30 @@ export class NaslServer {
|
|
|
1244
1325
|
node.tsErrorDetail = diagnostic;
|
|
1245
1326
|
diagnostics.push(diagnostic);
|
|
1246
1327
|
}
|
|
1328
|
+
// 如果TypeAnnotation 还存在,但是本身已经不是union类型,就是已经从union换别的类型了就都要报错
|
|
1329
|
+
} else if (node instanceof TypeAnnotation && matchExpressionType?.typeKind !== 'union') {
|
|
1330
|
+
const diagnostic = {
|
|
1331
|
+
node,
|
|
1332
|
+
severity: 'error',
|
|
1333
|
+
message: '匹配:选择类型不存在',
|
|
1334
|
+
titleTip: '该类型已被删除',
|
|
1335
|
+
};
|
|
1336
|
+
node.tsErrorDetail = diagnostic;
|
|
1337
|
+
diagnostics.push(diagnostic);
|
|
1338
|
+
// 如果可枚举变量的 ,变量 还存在,但是本身已经是union类型,就是已经从别的类型 换了union就都要报错
|
|
1339
|
+
} else if (!(node instanceof TypeAnnotation) && matchExpressionType?.typeKind === 'union') {
|
|
1340
|
+
const diagnostic = {
|
|
1341
|
+
node,
|
|
1342
|
+
severity: 'error',
|
|
1343
|
+
message: '匹配:选择值不存在',
|
|
1344
|
+
titleTip: '该值无法匹配,请重新选择类型',
|
|
1345
|
+
};
|
|
1346
|
+
node.tsErrorDetail = diagnostic;
|
|
1347
|
+
diagnostics.push(diagnostic);
|
|
1247
1348
|
}
|
|
1248
1349
|
if (node.tsErrorDetail) {
|
|
1249
|
-
|
|
1350
|
+
// 如果父级是枚举,而且子集选的是变量,就提示枚举值已被删除
|
|
1351
|
+
if (matchExpressionType?.typeNamespace?.includes('enums') && (node instanceof MemberExpression)) {
|
|
1250
1352
|
node.tsErrorDetail.titleTip = '该枚举值已被删除';
|
|
1251
1353
|
} else if (!node.tsErrorDetail.titleTip) {
|
|
1252
1354
|
node.tsErrorDetail.titleTip = '该值已被删除';
|
|
@@ -1263,6 +1365,25 @@ export class NaslServer {
|
|
|
1263
1365
|
node.tsErrorDetail = diagnostic;
|
|
1264
1366
|
diagnostics.push(diagnostic);
|
|
1265
1367
|
}
|
|
1368
|
+
/**
|
|
1369
|
+
* 如果节点是内置函数
|
|
1370
|
+
* 穷举在线上的情况,不在线上就void报错, calllogic 和 callinterface 因为原来有报错,所以就忽略掉
|
|
1371
|
+
* && 他在父级中,不在body
|
|
1372
|
+
* && 也不再 if的线上
|
|
1373
|
+
* && 也不再 switch的线上consequent
|
|
1374
|
+
* && 也不再草稿区域
|
|
1375
|
+
* && 不在 parentNode.parentNode(只用处理两层的,超过两层上就需要报错,只用直接是参数位第一层的需要) 是 callfunction 和 callInfterfase中,因为这两本身有强制类型,内置函数或者一些带T的声明那种,
|
|
1376
|
+
* && 而且也没有类型,就说明在槽位里,就需要报错
|
|
1377
|
+
*/
|
|
1378
|
+
if (node instanceof CallFunction && node.parentKey !== 'body' && node.parentKey !== 'alternate' && node.parentKey !== 'playground' && node.parentKey !== 'consequent' && node.parentNode?.parentNode?.concept !== 'CallLogic' && node.parentNode?.parentNode?.concept !== 'CallInterface' && !node.__TypeAnnotation) {
|
|
1379
|
+
const diagnostic = {
|
|
1380
|
+
node,
|
|
1381
|
+
severity: 'error',
|
|
1382
|
+
message: `类型不匹配,传入类型:void`,
|
|
1383
|
+
};
|
|
1384
|
+
node.tsErrorDetail = diagnostic;
|
|
1385
|
+
diagnostics.push(diagnostic);
|
|
1386
|
+
}
|
|
1266
1387
|
}
|
|
1267
1388
|
|
|
1268
1389
|
/* 接口导入查找 */
|
|
@@ -2289,7 +2410,7 @@ export class NaslServer {
|
|
|
2289
2410
|
* @returns 不需要去查就可以返回类型的节点
|
|
2290
2411
|
*/
|
|
2291
2412
|
getCurrentNodeKnownTypeAnnotation(node: BaseNode) {
|
|
2292
|
-
if (node.concept === 'StringLiteral' || node.concept === 'BooleanLiteral' || node.concept === 'NullLiteral') {
|
|
2413
|
+
if (node.concept === 'StringLiteral' || node.concept === 'StringInterpolation' || node.concept === 'BooleanLiteral' || node.concept === 'NullLiteral') {
|
|
2293
2414
|
let type = 'String';
|
|
2294
2415
|
switch (node.concept) {
|
|
2295
2416
|
case 'NullLiteral':
|
|
@@ -2306,7 +2427,7 @@ export class NaslServer {
|
|
|
2306
2427
|
return TypeAnnotation.createPrimitive('Boolean');
|
|
2307
2428
|
}
|
|
2308
2429
|
// Convert和new都是自身携带类型的,就不进行修改
|
|
2309
|
-
if (node instanceof CallFunction && node.calleeNamespace === 'nasl.util' && (
|
|
2430
|
+
if (node instanceof CallFunction && node.calleeNamespace === 'nasl.util' && (['Convert', 'New', 'FromString'].includes(node.calleeName))) {
|
|
2310
2431
|
if (node.typeArguments.length) {
|
|
2311
2432
|
return node.typeArguments[0];
|
|
2312
2433
|
}
|
|
@@ -2396,6 +2517,9 @@ export class NaslServer {
|
|
|
2396
2517
|
'Return',
|
|
2397
2518
|
'Variable',
|
|
2398
2519
|
'Match',
|
|
2520
|
+
'NewComposite',
|
|
2521
|
+
'NewList',
|
|
2522
|
+
'NewMap',
|
|
2399
2523
|
].includes(node.concept))
|
|
2400
2524
|
return;
|
|
2401
2525
|
// 要去ls那边获取的
|
|
@@ -2442,12 +2566,18 @@ export class NaslServer {
|
|
|
2442
2566
|
let newCode = item.code.substring(0, indexOf);
|
|
2443
2567
|
newCode = newCode.substring(newCode.lastIndexOf('\n'), indexOf);
|
|
2444
2568
|
fileDetail.offset = newCode.length + 'return '.length;
|
|
2569
|
+
} else if (['NewComposite', 'NewList', 'NewMap'].includes(node.concept)) {
|
|
2570
|
+
fileDetail.line = item.range.end.line;
|
|
2571
|
+
const indexOf = item.code.indexOf('return __newComposite');
|
|
2572
|
+
let newCode = item.code.substring(0, indexOf);
|
|
2573
|
+
newCode = newCode.substring(newCode.lastIndexOf('\n'), indexOf);
|
|
2574
|
+
fileDetail.offset = newCode.length + 'return '.length;
|
|
2445
2575
|
}
|
|
2446
2576
|
args.push(fileDetail);
|
|
2447
2577
|
});
|
|
2448
|
-
console.time('请求')
|
|
2578
|
+
console.time('请求');
|
|
2449
2579
|
const resultMap: any = (await this.getNaslNodeTypeFull(args)).response;
|
|
2450
|
-
console.timeEnd('请求')
|
|
2580
|
+
console.timeEnd('请求');
|
|
2451
2581
|
|
|
2452
2582
|
// console.log(resultMap);
|
|
2453
2583
|
|
|
@@ -2499,6 +2629,9 @@ export class NaslServer {
|
|
|
2499
2629
|
} else if (value.typeAnnotation) {
|
|
2500
2630
|
node.__TypeAnnotation = (Object.freeze(value.typeAnnotation) as TypeAnnotation);
|
|
2501
2631
|
}
|
|
2632
|
+
} else {
|
|
2633
|
+
// 清空原来已经赋值上去的类型,可能原来有现在没有了
|
|
2634
|
+
node.__TypeAnnotation = null;
|
|
2502
2635
|
}
|
|
2503
2636
|
} catch (err) {
|
|
2504
2637
|
if (globalThis.window) {
|
|
@@ -2773,7 +2906,7 @@ export class NaslServer {
|
|
|
2773
2906
|
};
|
|
2774
2907
|
}
|
|
2775
2908
|
|
|
2776
|
-
async getCurrentTypeAnnotation(node: BaseNode) {
|
|
2909
|
+
async getCurrentTypeAnnotation(node: BaseNode, outTime: number = 600) {
|
|
2777
2910
|
if (node.__TypeAnnotation) {
|
|
2778
2911
|
return node.__TypeAnnotation;
|
|
2779
2912
|
}
|
|
@@ -2787,7 +2920,7 @@ export class NaslServer {
|
|
|
2787
2920
|
} else {
|
|
2788
2921
|
resolve(null);
|
|
2789
2922
|
}
|
|
2790
|
-
},
|
|
2923
|
+
}, outTime);
|
|
2791
2924
|
const mySetInterval = setInterval(() => {
|
|
2792
2925
|
if (node.__isCorrectTypeAnnotation) {
|
|
2793
2926
|
resolve(node.__TypeAnnotation);
|
|
@@ -89,6 +89,10 @@ export function processToTreeFragment(process: Process) {
|
|
|
89
89
|
k.getNamespace = function () {
|
|
90
90
|
return path;
|
|
91
91
|
};
|
|
92
|
+
const api = `/api/${process.name}/${e.name}/${k.name}`;
|
|
93
|
+
k.getPath = function () {
|
|
94
|
+
return api;
|
|
95
|
+
};
|
|
92
96
|
});
|
|
93
97
|
|
|
94
98
|
fragment.elements.push({
|
|
@@ -107,6 +111,10 @@ export function processToTreeFragment(process: Process) {
|
|
|
107
111
|
launchLogic.getNamespace = function () {
|
|
108
112
|
return path;
|
|
109
113
|
};
|
|
114
|
+
const api = `/api/${process.name}/${launchLogic.name}`;
|
|
115
|
+
launchLogic.getPath = function () {
|
|
116
|
+
return api;
|
|
117
|
+
};
|
|
110
118
|
|
|
111
119
|
fragment.logics.push(launchLogic);
|
|
112
120
|
launchLogic.parentKey = 'readonly';
|