@lcap/nasl 2.21.0-beta.2 → 2.21.0-beta.3
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/engine/operators.d.ts +2 -2
- package/out/automate/engine/operators.js +14 -5
- package/out/automate/engine/operators.js.map +1 -1
- package/out/common/BaseNode.d.ts +6 -0
- package/out/common/BaseNode.js +45 -8
- package/out/common/BaseNode.js.map +1 -1
- package/out/concepts/Abort__.d.ts +1 -1
- package/out/concepts/Abort__.js +3 -3
- package/out/concepts/Abort__.js.map +1 -1
- package/out/concepts/App__.d.ts +0 -2
- package/out/concepts/App__.js +0 -42
- package/out/concepts/App__.js.map +1 -1
- package/out/concepts/BindAttribute__.js +18 -0
- package/out/concepts/BindAttribute__.js.map +1 -1
- package/out/concepts/BindEvent__.js +21 -22
- package/out/concepts/BindEvent__.js.map +1 -1
- package/out/concepts/CallFunction__.js.map +1 -1
- package/out/concepts/CallQueryComponent__.js +16 -16
- package/out/concepts/CallQueryComponent__.js.map +1 -1
- package/out/concepts/ConfigPropertyValue__.js.map +1 -1
- package/out/concepts/DataSource__.d.ts +0 -1
- package/out/concepts/DataSource__.js +0 -3
- package/out/concepts/DataSource__.js.map +1 -1
- package/out/concepts/EntityProperty__.d.ts +0 -23
- package/out/concepts/EntityProperty__.js +0 -121
- package/out/concepts/EntityProperty__.js.map +1 -1
- package/out/concepts/InterfaceParam__.d.ts +0 -3
- package/out/concepts/InterfaceParam__.js +0 -64
- package/out/concepts/InterfaceParam__.js.map +1 -1
- package/out/concepts/Interface__.d.ts +0 -3
- package/out/concepts/Interface__.js +4 -8
- package/out/concepts/Interface__.js.map +1 -1
- package/out/concepts/Logic__.d.ts +1 -1
- package/out/concepts/Logic__.js +22 -42
- package/out/concepts/Logic__.js.map +1 -1
- package/out/concepts/MatchCase__.js +1 -1
- package/out/concepts/MatchCase__.js.map +1 -1
- package/out/concepts/MemberExpression__.js +1 -1
- package/out/concepts/MemberExpression__.js.map +1 -1
- package/out/concepts/Module__.d.ts +0 -12
- package/out/concepts/Module__.js +0 -7
- package/out/concepts/Module__.js.map +1 -1
- package/out/concepts/NewMap__.js +5 -1
- package/out/concepts/NewMap__.js.map +1 -1
- package/out/concepts/NumericLiteral__.js +9 -3
- package/out/concepts/NumericLiteral__.js.map +1 -1
- package/out/concepts/OqlQueryComponent__.d.ts +0 -1
- package/out/concepts/OqlQueryComponent__.js +0 -46
- package/out/concepts/OqlQueryComponent__.js.map +1 -1
- package/out/concepts/Param__.d.ts +0 -3
- package/out/concepts/Param__.js +1 -67
- package/out/concepts/Param__.js.map +1 -1
- package/out/concepts/Rect__.js.map +1 -1
- package/out/concepts/Return__.d.ts +0 -3
- package/out/concepts/Return__.js +1 -67
- package/out/concepts/Return__.js.map +1 -1
- package/out/concepts/SqlQueryComponent__.d.ts +0 -1
- package/out/concepts/SqlQueryComponent__.js +0 -46
- package/out/concepts/SqlQueryComponent__.js.map +1 -1
- package/out/concepts/StructureProperty__.d.ts +0 -3
- package/out/concepts/StructureProperty__.js +0 -65
- package/out/concepts/StructureProperty__.js.map +1 -1
- package/out/concepts/TypeAnnotation__.d.ts +1 -3
- package/out/concepts/TypeAnnotation__.js +12 -31
- package/out/concepts/TypeAnnotation__.js.map +1 -1
- package/out/concepts/Variable__.d.ts +0 -3
- package/out/concepts/Variable__.js +1 -67
- package/out/concepts/Variable__.js.map +1 -1
- package/out/concepts/ViewComponent__.d.ts +7 -0
- package/out/concepts/ViewComponent__.js +7 -0
- package/out/concepts/ViewComponent__.js.map +1 -1
- package/out/concepts/ViewElement__.js +1 -1
- package/out/concepts/ViewElement__.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.collection.js +2 -2
- package/out/concepts/basics/stdlib/nasl.collection.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.core.js +3 -3
- package/out/concepts/basics/stdlib/nasl.core.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.interface.js +1 -1
- package/out/concepts/basics/stdlib/nasl.interface.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.process.js +6 -6
- package/out/concepts/basics/stdlib/nasl.process.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.ui.js +43 -43
- package/out/concepts/basics/stdlib/nasl.ui.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.util.js +19 -46
- package/out/concepts/basics/stdlib/nasl.util.js.map +1 -1
- package/out/concepts/basics/stdlib/nasl.validation.js +13 -13
- package/out/concepts/basics/stdlib/nasl.validation.js.map +1 -1
- package/out/concepts/basics/types/coreTypeList.js +5 -1
- package/out/concepts/basics/types/coreTypeList.js.map +1 -1
- package/out/concepts/index__.d.ts +0 -1
- package/out/concepts/index__.js +0 -1
- package/out/concepts/index__.js.map +1 -1
- package/out/generator/genReleaseBody.js +0 -3
- package/out/generator/genReleaseBody.js.map +1 -1
- package/out/sentry/index.d.ts +28 -0
- package/out/sentry/index.js +104 -0
- package/out/sentry/index.js.map +1 -0
- package/out/server/entity2LogicNamespace.js +1 -1
- package/out/server/entity2LogicNamespace.js.map +1 -1
- package/out/server/extendBaseNode.js +65 -0
- package/out/server/extendBaseNode.js.map +1 -1
- package/out/server/formatTsUtils.js +5 -5
- package/out/server/formatTsUtils.js.map +1 -1
- package/out/server/getLogics.js +9 -7
- package/out/server/getLogics.js.map +1 -1
- package/out/server/naslServer.d.ts +2 -2
- package/out/server/naslServer.js +120 -51
- package/out/server/naslServer.js.map +1 -1
- package/out/server/translator.js +3 -2
- package/out/server/translator.js.map +1 -1
- package/out/service/creator/errHandles.js +5 -0
- package/out/service/creator/errHandles.js.map +1 -1
- package/out/service/storage/init.js +6 -8
- package/out/service/storage/init.js.map +1 -1
- package/out/templator/genQueryComponent.js +2 -2
- package/out/templator/genQueryComponent.js.map +1 -1
- package/out/templator/genSelectBlock.js +9 -1
- package/out/templator/genSelectBlock.js.map +1 -1
- package/out/templator/utils.d.ts +32 -0
- package/out/templator/utils.js +7 -7
- package/out/templator/utils.js.map +1 -1
- package/package.json +2 -2
- package/sandbox/stdlib/nasl.auth.ts +3 -1
- package/sandbox/stdlib/nasl.browser.ts +1 -1
- package/sandbox/stdlib/nasl.collection.ts +9 -9
- package/sandbox/stdlib/nasl.core.ts +100 -38
- package/sandbox/stdlib/nasl.interface.ts +1 -1
- package/sandbox/stdlib/nasl.langUtil.ts +4 -4
- package/sandbox/stdlib/nasl.oql.ts +156 -156
- package/sandbox/stdlib/nasl.process.ts +6 -6
- package/sandbox/stdlib/nasl.ui.ts +42 -42
- package/sandbox/stdlib/nasl.util.ts +45 -44
- package/sandbox/stdlib/nasl.validation.ts +8 -8
- package/src/automate/engine/operators.js +13 -5
- package/src/automate/upgrader/2.20.js +1 -0
- package/src/common/BaseNode.ts +32 -1
- package/src/concepts/Abort__.ts +4 -3
- package/src/concepts/App__.ts +2 -38
- package/src/concepts/BindAttribute__.ts +17 -1
- package/src/concepts/BindEvent__.ts +21 -21
- package/src/concepts/CallFunction__.ts +0 -1
- package/src/concepts/CallQueryComponent__.ts +16 -74
- package/src/concepts/ConfigPropertyValue__.ts +0 -4
- package/src/concepts/DataSource__.ts +0 -4
- package/src/concepts/EntityProperty__.ts +0 -129
- package/src/concepts/InterfaceParam__.ts +0 -55
- package/src/concepts/Interface__.ts +4 -4
- package/src/concepts/Logic__.ts +31 -47
- package/src/concepts/MatchCase__.ts +1 -1
- package/src/concepts/MemberExpression__.ts +1 -1
- package/src/concepts/Module__.ts +0 -6
- package/src/concepts/NewMap__.ts +5 -1
- package/src/concepts/NumericLiteral__.ts +9 -4
- package/src/concepts/OqlQueryComponent__.ts +0 -40
- package/src/concepts/Param__.ts +3 -59
- package/src/concepts/Rect__.ts +0 -8
- package/src/concepts/Return__.ts +1 -58
- package/src/concepts/SqlQueryComponent__.ts +0 -40
- package/src/concepts/StructureProperty__.ts +0 -57
- package/src/concepts/TypeAnnotation__.ts +12 -72
- package/src/concepts/Variable__.ts +1 -58
- package/src/concepts/ViewComponent__.ts +6 -0
- package/src/concepts/ViewElement__.ts +7 -7
- package/src/concepts/basics/stdlib/nasl.collection.ts +2 -2
- package/src/concepts/basics/stdlib/nasl.core.ts +3 -3
- package/src/concepts/basics/stdlib/nasl.interface.ts +1 -1
- package/src/concepts/basics/stdlib/nasl.process.ts +6 -6
- package/src/concepts/basics/stdlib/nasl.ui.ts +43 -43
- package/src/concepts/basics/stdlib/nasl.util.ts +19 -46
- package/src/concepts/basics/stdlib/nasl.validation.ts +13 -13
- package/src/concepts/basics/types/coreTypeList.ts +5 -1
- package/src/concepts/index__.ts +0 -1
- package/src/generator/genReleaseBody.ts +0 -2
- package/src/sentry/index.ts +134 -0
- package/src/server/entity2LogicNamespace.ts +1 -1
- package/src/server/extendBaseNode.ts +61 -1
- package/src/server/formatTsUtils.ts +5 -5
- package/src/server/getLogics.ts +8 -7
- package/src/server/naslServer.ts +120 -53
- package/src/server/translator.ts +3 -2
- package/src/service/creator/errHandles.js +6 -0
- package/src/service/storage/init.ts +6 -8
- package/src/templator/genQueryComponent.ts +5 -5
- package/src/templator/genSelectBlock.ts +9 -1
- package/src/templator/utils.ts +7 -7
- package/ts-worker/lib/Messager.js +0 -3
- package/ts-worker/src/index.js +0 -1
- package/src/concepts/DatabaseTypeAnnotation__.ts +0 -88
|
@@ -166,11 +166,11 @@ export function genQueryLogic(allEntities: Array<Entity>, nameGroup: NameGroup,
|
|
|
166
166
|
params: [
|
|
167
167
|
NaslNode.Param({
|
|
168
168
|
name: 'page',
|
|
169
|
-
typeAnnotation: NaslCoreTypeAnnotation.
|
|
169
|
+
typeAnnotation: NaslCoreTypeAnnotation.Integer,
|
|
170
170
|
}),
|
|
171
171
|
NaslNode.Param({
|
|
172
172
|
name: 'size',
|
|
173
|
-
typeAnnotation: NaslCoreTypeAnnotation.
|
|
173
|
+
typeAnnotation: NaslCoreTypeAnnotation.Integer,
|
|
174
174
|
}),
|
|
175
175
|
],
|
|
176
176
|
returns: [
|
|
@@ -276,10 +276,10 @@ export async function joinEntity(callQueryComponent: CallQueryComponent, entity:
|
|
|
276
276
|
typeName: entity.name,
|
|
277
277
|
}),
|
|
278
278
|
}), recordStructure, 'properties');
|
|
279
|
-
|
|
280
|
-
if
|
|
279
|
+
|
|
280
|
+
if(recordStructure instanceof Structure)
|
|
281
281
|
recordStructure.addProperty(structureProperty);
|
|
282
|
-
else if
|
|
282
|
+
else if(recordStructure instanceof TypeAnnotation)
|
|
283
283
|
recordStructure.properties.push(structureProperty);
|
|
284
284
|
|
|
285
285
|
const newJoinPartLogicItem = QueryJoinExpression.from(queryJoinExpression, callQueryComponent, 'joinParts');
|
|
@@ -186,7 +186,15 @@ export function genSelectItemAddLogic(entity: Entity, nameGroup: NameGroup, view
|
|
|
186
186
|
callLogics.push(NaslLogicItem.Assignment({
|
|
187
187
|
left: itemExpression.expression,
|
|
188
188
|
right: NaslLogicItem.Identifier({
|
|
189
|
-
name:
|
|
189
|
+
name: nameGroup.itemInputVariableName,
|
|
190
|
+
}),
|
|
191
|
+
}));
|
|
192
|
+
callLogics.push(NaslLogicItem.Assignment({
|
|
193
|
+
left: NaslLogicItem.Identifier({
|
|
194
|
+
name: nameGroup.itemInputVariableName,
|
|
195
|
+
}),
|
|
196
|
+
right: NaslLogicItem.StringLiteral({
|
|
197
|
+
value: '',
|
|
190
198
|
}),
|
|
191
199
|
}));
|
|
192
200
|
callLogics.push(NaslLogicItem.Assignment({
|
package/src/templator/utils.ts
CHANGED
|
@@ -189,17 +189,17 @@ function genNaslUIGenericTypeAnnotation(typeName: string) {
|
|
|
189
189
|
|
|
190
190
|
export const NaslCoreTypeAnnotation = {
|
|
191
191
|
Boolean: genNaslCoreTypeAnnotation('Boolean'),
|
|
192
|
-
|
|
193
|
-
|
|
192
|
+
Integer: genNaslCoreTypeAnnotation('Integer', 'Integer 整数'),
|
|
193
|
+
Double: genNaslCoreTypeAnnotation('Double'),
|
|
194
194
|
Decimal: genNaslCoreTypeAnnotation('Decimal'),
|
|
195
|
-
Long: genNaslCoreTypeAnnotation('Long', '
|
|
196
|
-
String: genNaslCoreTypeAnnotation('String', 'String
|
|
197
|
-
|
|
195
|
+
Long: genNaslCoreTypeAnnotation('Long', 'Long 长整数'),
|
|
196
|
+
String: genNaslCoreTypeAnnotation('String', 'String 字符串'),
|
|
197
|
+
Text: genNaslCoreTypeAnnotation('Text'),
|
|
198
198
|
Binary: genNaslCoreTypeAnnotation('Binary'),
|
|
199
199
|
Date: genNaslCoreTypeAnnotation('Date'),
|
|
200
200
|
Time: genNaslCoreTypeAnnotation('Time'),
|
|
201
201
|
DateTime: genNaslCoreTypeAnnotation('DateTime'),
|
|
202
|
-
|
|
202
|
+
Email: genNaslCoreTypeAnnotation('Email'),
|
|
203
203
|
};
|
|
204
204
|
|
|
205
205
|
export const NaslUITypeAnnotation = {
|
|
@@ -262,7 +262,7 @@ export const NaslTypeAnnotation = {
|
|
|
262
262
|
concept: 'TypeAnnotation',
|
|
263
263
|
typeKind: 'primitive',
|
|
264
264
|
typeNamespace: 'nasl.core',
|
|
265
|
-
typeName: '
|
|
265
|
+
typeName: 'Integer',
|
|
266
266
|
},
|
|
267
267
|
}],
|
|
268
268
|
}),
|
|
@@ -138,7 +138,6 @@ class Messager {
|
|
|
138
138
|
* @override
|
|
139
139
|
*/
|
|
140
140
|
onMessageReceived(e) {
|
|
141
|
-
console.log('onMessageReceived: ', e);
|
|
142
141
|
if (!e.data)
|
|
143
142
|
return;
|
|
144
143
|
this.onDataReceived(e.data);
|
|
@@ -148,7 +147,6 @@ class Messager {
|
|
|
148
147
|
* @override
|
|
149
148
|
*/
|
|
150
149
|
onDataReceived(data) {
|
|
151
|
-
console.log('onDataReceived: ', data);
|
|
152
150
|
if (data.protocol !== this.options.protocol)
|
|
153
151
|
return;
|
|
154
152
|
if (data.type === 'response') {
|
|
@@ -160,7 +158,6 @@ class Messager {
|
|
|
160
158
|
}
|
|
161
159
|
if (data.command) {
|
|
162
160
|
const func = this.options.context[data.command];
|
|
163
|
-
console.log('func: ', this.options.context, func);
|
|
164
161
|
if (!func)
|
|
165
162
|
// 函数不存在时不 response
|
|
166
163
|
return;
|
package/ts-worker/src/index.js
CHANGED
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
//================================================================================
|
|
2
|
-
// 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
|
|
3
|
-
// ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
|
|
4
|
-
//================================================================================
|
|
5
|
-
import { EventPayload, Params } from '../common/EventEmitter';
|
|
6
|
-
import { concept, excludedInJSON, property } from '../decorators';
|
|
7
|
-
|
|
8
|
-
import * as utils from '../utils';
|
|
9
|
-
import { v4 as uuidv4 } from 'uuid';
|
|
10
|
-
import BaseNode from '../common/BaseNode';
|
|
11
|
-
import classMap from '../common/classMap';
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* 数据库存储类型
|
|
16
|
-
*/
|
|
17
|
-
@concept('数据库存储类型')
|
|
18
|
-
export class DatabaseTypeAnnotation extends BaseNode {
|
|
19
|
-
/**
|
|
20
|
-
* 产品概念
|
|
21
|
-
*/
|
|
22
|
-
@property()
|
|
23
|
-
concept: 'DatabaseTypeAnnotation' = 'DatabaseTypeAnnotation';
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* 类型名
|
|
27
|
-
*/
|
|
28
|
-
@property()
|
|
29
|
-
typeName: string = undefined;
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* arguments
|
|
33
|
-
*/
|
|
34
|
-
@property()
|
|
35
|
-
arguments: Map<string, string> = undefined;
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* @param source 需要合并的部分参数
|
|
41
|
-
*/
|
|
42
|
-
constructor(source?: Partial<DatabaseTypeAnnotation>) {
|
|
43
|
-
source = Object.assign({}, DatabaseTypeAnnotation.getDefaultOptions(), source);
|
|
44
|
-
super(source);
|
|
45
|
-
super.subConstructor(source);
|
|
46
|
-
}
|
|
47
|
-
getClassName() {
|
|
48
|
-
return 'DatabaseTypeAnnotation';
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
static from(source: any, parentNode?: any, parentKey?: string): DatabaseTypeAnnotation {
|
|
52
|
-
return super.from(source, parentNode, parentKey) as DatabaseTypeAnnotation;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* 从父级删除该节点
|
|
57
|
-
* @internal
|
|
58
|
-
*/
|
|
59
|
-
_delete() {
|
|
60
|
-
let params: Params = null;
|
|
61
|
-
if (this.parentNode) {
|
|
62
|
-
params = (this.parentNode as any)?.__removeDatabaseTypeAnnotation?.(this);
|
|
63
|
-
}
|
|
64
|
-
return params;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
//================================================================================
|
|
73
|
-
// ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
|
|
74
|
-
// 自动生成的代码已结束。下面可以手动编写。
|
|
75
|
-
//================================================================================
|
|
76
|
-
|
|
77
|
-
//================================================================================
|
|
78
|
-
// 从这里开始到结尾注释之间的代码由 NASL Workbench 自动生成,请不手动修改!
|
|
79
|
-
// ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓ ↓
|
|
80
|
-
//================================================================================
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
classMap.DatabaseTypeAnnotation = DatabaseTypeAnnotation;
|
|
84
|
-
export default DatabaseTypeAnnotation;
|
|
85
|
-
//================================================================================
|
|
86
|
-
// ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
|
|
87
|
-
// 自动生成的代码已结束。下面可以手动编写。
|
|
88
|
-
//================================================================================
|