@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.
Files changed (188) hide show
  1. package/out/automate/engine/operators.d.ts +2 -2
  2. package/out/automate/engine/operators.js +14 -5
  3. package/out/automate/engine/operators.js.map +1 -1
  4. package/out/common/BaseNode.d.ts +6 -0
  5. package/out/common/BaseNode.js +45 -8
  6. package/out/common/BaseNode.js.map +1 -1
  7. package/out/concepts/Abort__.d.ts +1 -1
  8. package/out/concepts/Abort__.js +3 -3
  9. package/out/concepts/Abort__.js.map +1 -1
  10. package/out/concepts/App__.d.ts +0 -2
  11. package/out/concepts/App__.js +0 -42
  12. package/out/concepts/App__.js.map +1 -1
  13. package/out/concepts/BindAttribute__.js +18 -0
  14. package/out/concepts/BindAttribute__.js.map +1 -1
  15. package/out/concepts/BindEvent__.js +21 -22
  16. package/out/concepts/BindEvent__.js.map +1 -1
  17. package/out/concepts/CallFunction__.js.map +1 -1
  18. package/out/concepts/CallQueryComponent__.js +16 -16
  19. package/out/concepts/CallQueryComponent__.js.map +1 -1
  20. package/out/concepts/ConfigPropertyValue__.js.map +1 -1
  21. package/out/concepts/DataSource__.d.ts +0 -1
  22. package/out/concepts/DataSource__.js +0 -3
  23. package/out/concepts/DataSource__.js.map +1 -1
  24. package/out/concepts/EntityProperty__.d.ts +0 -23
  25. package/out/concepts/EntityProperty__.js +0 -121
  26. package/out/concepts/EntityProperty__.js.map +1 -1
  27. package/out/concepts/InterfaceParam__.d.ts +0 -3
  28. package/out/concepts/InterfaceParam__.js +0 -64
  29. package/out/concepts/InterfaceParam__.js.map +1 -1
  30. package/out/concepts/Interface__.d.ts +0 -3
  31. package/out/concepts/Interface__.js +4 -8
  32. package/out/concepts/Interface__.js.map +1 -1
  33. package/out/concepts/Logic__.d.ts +1 -1
  34. package/out/concepts/Logic__.js +22 -42
  35. package/out/concepts/Logic__.js.map +1 -1
  36. package/out/concepts/MatchCase__.js +1 -1
  37. package/out/concepts/MatchCase__.js.map +1 -1
  38. package/out/concepts/MemberExpression__.js +1 -1
  39. package/out/concepts/MemberExpression__.js.map +1 -1
  40. package/out/concepts/Module__.d.ts +0 -12
  41. package/out/concepts/Module__.js +0 -7
  42. package/out/concepts/Module__.js.map +1 -1
  43. package/out/concepts/NewMap__.js +5 -1
  44. package/out/concepts/NewMap__.js.map +1 -1
  45. package/out/concepts/NumericLiteral__.js +9 -3
  46. package/out/concepts/NumericLiteral__.js.map +1 -1
  47. package/out/concepts/OqlQueryComponent__.d.ts +0 -1
  48. package/out/concepts/OqlQueryComponent__.js +0 -46
  49. package/out/concepts/OqlQueryComponent__.js.map +1 -1
  50. package/out/concepts/Param__.d.ts +0 -3
  51. package/out/concepts/Param__.js +1 -67
  52. package/out/concepts/Param__.js.map +1 -1
  53. package/out/concepts/Rect__.js.map +1 -1
  54. package/out/concepts/Return__.d.ts +0 -3
  55. package/out/concepts/Return__.js +1 -67
  56. package/out/concepts/Return__.js.map +1 -1
  57. package/out/concepts/SqlQueryComponent__.d.ts +0 -1
  58. package/out/concepts/SqlQueryComponent__.js +0 -46
  59. package/out/concepts/SqlQueryComponent__.js.map +1 -1
  60. package/out/concepts/StructureProperty__.d.ts +0 -3
  61. package/out/concepts/StructureProperty__.js +0 -65
  62. package/out/concepts/StructureProperty__.js.map +1 -1
  63. package/out/concepts/TypeAnnotation__.d.ts +1 -3
  64. package/out/concepts/TypeAnnotation__.js +12 -31
  65. package/out/concepts/TypeAnnotation__.js.map +1 -1
  66. package/out/concepts/Variable__.d.ts +0 -3
  67. package/out/concepts/Variable__.js +1 -67
  68. package/out/concepts/Variable__.js.map +1 -1
  69. package/out/concepts/ViewComponent__.d.ts +7 -0
  70. package/out/concepts/ViewComponent__.js +7 -0
  71. package/out/concepts/ViewComponent__.js.map +1 -1
  72. package/out/concepts/ViewElement__.js +1 -1
  73. package/out/concepts/ViewElement__.js.map +1 -1
  74. package/out/concepts/basics/stdlib/nasl.collection.js +2 -2
  75. package/out/concepts/basics/stdlib/nasl.collection.js.map +1 -1
  76. package/out/concepts/basics/stdlib/nasl.core.js +3 -3
  77. package/out/concepts/basics/stdlib/nasl.core.js.map +1 -1
  78. package/out/concepts/basics/stdlib/nasl.interface.js +1 -1
  79. package/out/concepts/basics/stdlib/nasl.interface.js.map +1 -1
  80. package/out/concepts/basics/stdlib/nasl.process.js +6 -6
  81. package/out/concepts/basics/stdlib/nasl.process.js.map +1 -1
  82. package/out/concepts/basics/stdlib/nasl.ui.js +43 -43
  83. package/out/concepts/basics/stdlib/nasl.ui.js.map +1 -1
  84. package/out/concepts/basics/stdlib/nasl.util.js +19 -46
  85. package/out/concepts/basics/stdlib/nasl.util.js.map +1 -1
  86. package/out/concepts/basics/stdlib/nasl.validation.js +13 -13
  87. package/out/concepts/basics/stdlib/nasl.validation.js.map +1 -1
  88. package/out/concepts/basics/types/coreTypeList.js +5 -1
  89. package/out/concepts/basics/types/coreTypeList.js.map +1 -1
  90. package/out/concepts/index__.d.ts +0 -1
  91. package/out/concepts/index__.js +0 -1
  92. package/out/concepts/index__.js.map +1 -1
  93. package/out/generator/genReleaseBody.js +0 -3
  94. package/out/generator/genReleaseBody.js.map +1 -1
  95. package/out/sentry/index.d.ts +28 -0
  96. package/out/sentry/index.js +104 -0
  97. package/out/sentry/index.js.map +1 -0
  98. package/out/server/entity2LogicNamespace.js +1 -1
  99. package/out/server/entity2LogicNamespace.js.map +1 -1
  100. package/out/server/extendBaseNode.js +65 -0
  101. package/out/server/extendBaseNode.js.map +1 -1
  102. package/out/server/formatTsUtils.js +5 -5
  103. package/out/server/formatTsUtils.js.map +1 -1
  104. package/out/server/getLogics.js +9 -7
  105. package/out/server/getLogics.js.map +1 -1
  106. package/out/server/naslServer.d.ts +2 -2
  107. package/out/server/naslServer.js +120 -51
  108. package/out/server/naslServer.js.map +1 -1
  109. package/out/server/translator.js +3 -2
  110. package/out/server/translator.js.map +1 -1
  111. package/out/service/creator/errHandles.js +5 -0
  112. package/out/service/creator/errHandles.js.map +1 -1
  113. package/out/service/storage/init.js +6 -8
  114. package/out/service/storage/init.js.map +1 -1
  115. package/out/templator/genQueryComponent.js +2 -2
  116. package/out/templator/genQueryComponent.js.map +1 -1
  117. package/out/templator/genSelectBlock.js +9 -1
  118. package/out/templator/genSelectBlock.js.map +1 -1
  119. package/out/templator/utils.d.ts +32 -0
  120. package/out/templator/utils.js +7 -7
  121. package/out/templator/utils.js.map +1 -1
  122. package/package.json +2 -2
  123. package/sandbox/stdlib/nasl.auth.ts +3 -1
  124. package/sandbox/stdlib/nasl.browser.ts +1 -1
  125. package/sandbox/stdlib/nasl.collection.ts +9 -9
  126. package/sandbox/stdlib/nasl.core.ts +100 -38
  127. package/sandbox/stdlib/nasl.interface.ts +1 -1
  128. package/sandbox/stdlib/nasl.langUtil.ts +4 -4
  129. package/sandbox/stdlib/nasl.oql.ts +156 -156
  130. package/sandbox/stdlib/nasl.process.ts +6 -6
  131. package/sandbox/stdlib/nasl.ui.ts +42 -42
  132. package/sandbox/stdlib/nasl.util.ts +45 -44
  133. package/sandbox/stdlib/nasl.validation.ts +8 -8
  134. package/src/automate/engine/operators.js +13 -5
  135. package/src/automate/upgrader/2.20.js +1 -0
  136. package/src/common/BaseNode.ts +32 -1
  137. package/src/concepts/Abort__.ts +4 -3
  138. package/src/concepts/App__.ts +2 -38
  139. package/src/concepts/BindAttribute__.ts +17 -1
  140. package/src/concepts/BindEvent__.ts +21 -21
  141. package/src/concepts/CallFunction__.ts +0 -1
  142. package/src/concepts/CallQueryComponent__.ts +16 -74
  143. package/src/concepts/ConfigPropertyValue__.ts +0 -4
  144. package/src/concepts/DataSource__.ts +0 -4
  145. package/src/concepts/EntityProperty__.ts +0 -129
  146. package/src/concepts/InterfaceParam__.ts +0 -55
  147. package/src/concepts/Interface__.ts +4 -4
  148. package/src/concepts/Logic__.ts +31 -47
  149. package/src/concepts/MatchCase__.ts +1 -1
  150. package/src/concepts/MemberExpression__.ts +1 -1
  151. package/src/concepts/Module__.ts +0 -6
  152. package/src/concepts/NewMap__.ts +5 -1
  153. package/src/concepts/NumericLiteral__.ts +9 -4
  154. package/src/concepts/OqlQueryComponent__.ts +0 -40
  155. package/src/concepts/Param__.ts +3 -59
  156. package/src/concepts/Rect__.ts +0 -8
  157. package/src/concepts/Return__.ts +1 -58
  158. package/src/concepts/SqlQueryComponent__.ts +0 -40
  159. package/src/concepts/StructureProperty__.ts +0 -57
  160. package/src/concepts/TypeAnnotation__.ts +12 -72
  161. package/src/concepts/Variable__.ts +1 -58
  162. package/src/concepts/ViewComponent__.ts +6 -0
  163. package/src/concepts/ViewElement__.ts +7 -7
  164. package/src/concepts/basics/stdlib/nasl.collection.ts +2 -2
  165. package/src/concepts/basics/stdlib/nasl.core.ts +3 -3
  166. package/src/concepts/basics/stdlib/nasl.interface.ts +1 -1
  167. package/src/concepts/basics/stdlib/nasl.process.ts +6 -6
  168. package/src/concepts/basics/stdlib/nasl.ui.ts +43 -43
  169. package/src/concepts/basics/stdlib/nasl.util.ts +19 -46
  170. package/src/concepts/basics/stdlib/nasl.validation.ts +13 -13
  171. package/src/concepts/basics/types/coreTypeList.ts +5 -1
  172. package/src/concepts/index__.ts +0 -1
  173. package/src/generator/genReleaseBody.ts +0 -2
  174. package/src/sentry/index.ts +134 -0
  175. package/src/server/entity2LogicNamespace.ts +1 -1
  176. package/src/server/extendBaseNode.ts +61 -1
  177. package/src/server/formatTsUtils.ts +5 -5
  178. package/src/server/getLogics.ts +8 -7
  179. package/src/server/naslServer.ts +120 -53
  180. package/src/server/translator.ts +3 -2
  181. package/src/service/creator/errHandles.js +6 -0
  182. package/src/service/storage/init.ts +6 -8
  183. package/src/templator/genQueryComponent.ts +5 -5
  184. package/src/templator/genSelectBlock.ts +9 -1
  185. package/src/templator/utils.ts +7 -7
  186. package/ts-worker/lib/Messager.js +0 -3
  187. package/ts-worker/src/index.js +0 -1
  188. 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.Long,
169
+ typeAnnotation: NaslCoreTypeAnnotation.Integer,
170
170
  }),
171
171
  NaslNode.Param({
172
172
  name: 'size',
173
- typeAnnotation: NaslCoreTypeAnnotation.Long,
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 (recordStructure instanceof Structure)
279
+
280
+ if(recordStructure instanceof Structure)
281
281
  recordStructure.addProperty(structureProperty);
282
- else if (recordStructure instanceof TypeAnnotation)
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: view.getVariableUniqueName('itemInputVariable'),
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({
@@ -189,17 +189,17 @@ function genNaslUIGenericTypeAnnotation(typeName: string) {
189
189
 
190
190
  export const NaslCoreTypeAnnotation = {
191
191
  Boolean: genNaslCoreTypeAnnotation('Boolean'),
192
- // Integer: genNaslCoreTypeAnnotation('Integer', 'Integer 整数'),
193
- // Double: genNaslCoreTypeAnnotation('Double'),
192
+ Integer: genNaslCoreTypeAnnotation('Integer', 'Integer 整数'),
193
+ Double: genNaslCoreTypeAnnotation('Double'),
194
194
  Decimal: genNaslCoreTypeAnnotation('Decimal'),
195
- Long: genNaslCoreTypeAnnotation('Long', ' Integer 整数'),
196
- String: genNaslCoreTypeAnnotation('String', 'String 文本'),
197
- // Text: genNaslCoreTypeAnnotation('Text'),
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
- // Email: genNaslCoreTypeAnnotation('Email'),
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: 'Long',
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;
@@ -141,7 +141,6 @@ const context = {
141
141
  },
142
142
  // 在初始化之前添加文件
143
143
  addFile(file) {
144
- console.log('ts-worker addFile');
145
144
  this.system.writeFile(file.file, file.fileContent);
146
145
  },
147
146
  /**
@@ -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
- //================================================================================