@lcap/nasl 2.14.0 → 2.15.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.
Files changed (172) hide show
  1. package/out/automate/engine/index.js +2 -2
  2. package/out/automate/engine/index.js.map +1 -1
  3. package/out/automate/engine/viewCache.js +5 -5
  4. package/out/automate/engine/viewCache.js.map +1 -1
  5. package/out/common/BaseNode.js +3 -1
  6. package/out/common/BaseNode.js.map +1 -1
  7. package/out/concepts/AnonymousFunction__.d.ts +170 -0
  8. package/out/concepts/AnonymousFunction__.js +439 -0
  9. package/out/concepts/AnonymousFunction__.js.map +1 -0
  10. package/out/concepts/App__.js +7 -1
  11. package/out/concepts/App__.js.map +1 -1
  12. package/out/concepts/Assignee__.js +1 -1
  13. package/out/concepts/Assignee__.js.map +1 -1
  14. package/out/concepts/AssignmentLine__.d.ts +40 -0
  15. package/out/concepts/AssignmentLine__.js +109 -0
  16. package/out/concepts/AssignmentLine__.js.map +1 -0
  17. package/out/concepts/BatchAssignment__.d.ts +248 -0
  18. package/out/concepts/BatchAssignment__.js +742 -0
  19. package/out/concepts/BatchAssignment__.js.map +1 -0
  20. package/out/concepts/BindAttribute__.js +2 -0
  21. package/out/concepts/BindAttribute__.js.map +1 -1
  22. package/out/concepts/BindEvent__.js +9 -4
  23. package/out/concepts/BindEvent__.js.map +1 -1
  24. package/out/concepts/BindStyle__.d.ts +126 -0
  25. package/out/concepts/BindStyle__.js +233 -0
  26. package/out/concepts/BindStyle__.js.map +1 -0
  27. package/out/concepts/CallLogic__.js +3 -4
  28. package/out/concepts/CallLogic__.js.map +1 -1
  29. package/out/concepts/CallQueryComponent__.d.ts +1 -1
  30. package/out/concepts/ConstructArgument__.d.ts +40 -0
  31. package/out/concepts/ConstructArgument__.js +108 -0
  32. package/out/concepts/ConstructArgument__.js.map +1 -0
  33. package/out/concepts/Construct__.d.ts +189 -0
  34. package/out/concepts/Construct__.js +340 -0
  35. package/out/concepts/Construct__.js.map +1 -0
  36. package/out/concepts/EnumItem__.js +1 -1
  37. package/out/concepts/EnumItem__.js.map +1 -1
  38. package/out/concepts/Interface__.d.ts +1 -0
  39. package/out/concepts/Interface__.js +58 -0
  40. package/out/concepts/Interface__.js.map +1 -1
  41. package/out/concepts/Logic__.js +3 -3
  42. package/out/concepts/Logic__.js.map +1 -1
  43. package/out/concepts/MatchCase__.d.ts +256 -0
  44. package/out/concepts/MatchCase__.js +584 -0
  45. package/out/concepts/MatchCase__.js.map +1 -0
  46. package/out/concepts/Match__.d.ts +117 -0
  47. package/out/concepts/Match__.js +434 -0
  48. package/out/concepts/Match__.js.map +1 -0
  49. package/out/concepts/OqlQueryComponent__.d.ts +73 -0
  50. package/out/concepts/OqlQueryComponent__.js +395 -0
  51. package/out/concepts/OqlQueryComponent__.js.map +1 -0
  52. package/out/concepts/ProcessElement__.d.ts +2 -2
  53. package/out/concepts/ProcessElement__.js +30 -21
  54. package/out/concepts/ProcessElement__.js.map +1 -1
  55. package/out/concepts/Process__.d.ts +81 -0
  56. package/out/concepts/Process__.js +98 -2
  57. package/out/concepts/Process__.js.map +1 -1
  58. package/out/concepts/SelectMembers__.d.ts +141 -0
  59. package/out/concepts/SelectMembers__.js +290 -0
  60. package/out/concepts/SelectMembers__.js.map +1 -0
  61. package/out/concepts/SqlQueryComponent__.d.ts +4 -0
  62. package/out/concepts/SqlQueryComponent__.js +144 -2
  63. package/out/concepts/SqlQueryComponent__.js.map +1 -1
  64. package/out/concepts/Variable__.js +0 -1
  65. package/out/concepts/Variable__.js.map +1 -1
  66. package/out/concepts/ViewElement__.js +10 -1
  67. package/out/concepts/ViewElement__.js.map +1 -1
  68. package/out/concepts/View__.js +4 -1
  69. package/out/concepts/View__.js.map +1 -1
  70. package/out/concepts/basics/stdlib/index.js +2 -1
  71. package/out/concepts/basics/stdlib/index.js.map +1 -1
  72. package/out/concepts/basics/stdlib/nasl.auth.js +26 -0
  73. package/out/concepts/basics/stdlib/nasl.auth.js.map +1 -1
  74. package/out/concepts/basics/stdlib/nasl.process.js +98 -0
  75. package/out/concepts/basics/stdlib/nasl.process.js.map +1 -1
  76. package/out/concepts/basics/stdlib/nasl.ui.js +54 -0
  77. package/out/concepts/basics/stdlib/nasl.ui.js.map +1 -1
  78. package/out/concepts/basics/stdlib/nasl.util.js +2 -2
  79. package/out/concepts/basics/stdlib/nasl.util.js.map +1 -1
  80. package/out/concepts/basics/stdlib/nasl.validation.js +4 -0
  81. package/out/concepts/basics/stdlib/nasl.validation.js.map +1 -1
  82. package/out/enums/KEYWORDS.js +1 -0
  83. package/out/enums/KEYWORDS.js.map +1 -1
  84. package/out/generator/genBundleFiles.d.ts +1 -0
  85. package/out/generator/genBundleFiles.js +2 -0
  86. package/out/generator/genBundleFiles.js.map +1 -1
  87. package/out/server/extendBaseNode.js +32 -4
  88. package/out/server/extendBaseNode.js.map +1 -1
  89. package/out/server/getLogics.js +42 -14
  90. package/out/server/getLogics.js.map +1 -1
  91. package/out/server/getProcesses.d.ts +2 -2
  92. package/out/server/getProcesses.js +47 -21
  93. package/out/server/getProcesses.js.map +1 -1
  94. package/out/server/naslServer.js +46 -19
  95. package/out/server/naslServer.js.map +1 -1
  96. package/out/server/naslStdlibMap.js +1 -0
  97. package/out/server/naslStdlibMap.js.map +1 -1
  98. package/out/server/process2LogicNamespace.js +25 -21
  99. package/out/server/process2LogicNamespace.js.map +1 -1
  100. package/out/server/translator.js +35 -8
  101. package/out/server/translator.js.map +1 -1
  102. package/out/service/logic/api.d.ts +9 -0
  103. package/out/service/logic/api.js +11 -0
  104. package/out/service/logic/api.js.map +1 -0
  105. package/out/service/logic/index.d.ts +2 -0
  106. package/out/service/logic/index.js +10 -0
  107. package/out/service/logic/index.js.map +1 -0
  108. package/out/service/storage/init.js +18 -6
  109. package/out/service/storage/init.js.map +1 -1
  110. package/out/templator/genCreateBlock.js +1 -1
  111. package/out/templator/genCreateBlock.js.map +1 -1
  112. package/out/templator/genCurdEditMultipleKeyBlock.js +4 -5
  113. package/out/templator/genCurdEditMultipleKeyBlock.js.map +1 -1
  114. package/out/templator/genCurdMultipleKeyBlock.js +4 -4
  115. package/out/templator/genCurdMultipleKeyBlock.js.map +1 -1
  116. package/out/templator/genEditTableBlock.js +5 -3
  117. package/out/templator/genEditTableBlock.js.map +1 -1
  118. package/out/templator/genGetBlock.js +3 -2
  119. package/out/templator/genGetBlock.js.map +1 -1
  120. package/out/templator/genTableBlock.js +4 -2
  121. package/out/templator/genTableBlock.js.map +1 -1
  122. package/out/templator/genUpdateBlock.js +1 -1
  123. package/out/templator/genUpdateBlock.js.map +1 -1
  124. package/out/templator/sql-parser/index.d.ts +1 -0
  125. package/out/templator/sql-parser/index.js +228 -0
  126. package/out/templator/sql-parser/index.js.map +1 -0
  127. package/out/templator/sql-parser/parser.js +26664 -0
  128. package/out/templator/sql-parser/parser.js.map +1 -0
  129. package/package.json +1 -1
  130. package/src/automate/engine/index.js +1 -1
  131. package/src/automate/engine/viewCache.js +23 -23
  132. package/src/automate/template/myProcess.js +12295 -0
  133. package/src/common/BaseNode.ts +5 -1
  134. package/src/concepts/App__.ts +8 -1
  135. package/src/concepts/Assignee__.ts +1 -1
  136. package/src/concepts/BindAttribute__.ts +3 -1
  137. package/src/concepts/BindEvent__.ts +8 -4
  138. package/src/concepts/CallLogic__.ts +3 -4
  139. package/src/concepts/EnumItem__.ts +1 -1
  140. package/src/concepts/Interface__.ts +66 -7
  141. package/src/concepts/Logic__.ts +3 -3
  142. package/src/concepts/ProcessElement__.ts +34 -24
  143. package/src/concepts/Process__.ts +98 -2
  144. package/src/concepts/SqlQueryComponent__.ts +143 -2
  145. package/src/concepts/Variable__.ts +0 -1
  146. package/src/concepts/ViewElement__.ts +12 -20
  147. package/src/concepts/View__.ts +4 -1
  148. package/src/concepts/basics/stdlib/index.ts +2 -1
  149. package/src/concepts/basics/stdlib/nasl.auth.ts +25 -0
  150. package/src/concepts/basics/stdlib/nasl.io.ts +48 -0
  151. package/src/concepts/basics/stdlib/nasl.process.ts +98 -0
  152. package/src/concepts/basics/stdlib/nasl.ui.ts +54 -0
  153. package/src/concepts/basics/stdlib/nasl.util.ts +2 -2
  154. package/src/concepts/basics/stdlib/nasl.validation.ts +4 -0
  155. package/src/enums/KEYWORDS.ts +1 -0
  156. package/src/generator/genBundleFiles.ts +3 -0
  157. package/src/server/extendBaseNode.ts +31 -4
  158. package/src/server/getLogics.ts +43 -14
  159. package/src/server/getProcesses.ts +47 -21
  160. package/src/server/naslServer.ts +44 -21
  161. package/src/server/naslStdlibMap.ts +1 -0
  162. package/src/server/process2LogicNamespace.ts +27 -21
  163. package/src/server/translator.ts +35 -8
  164. package/src/service/storage/init.ts +18 -6
  165. package/src/templator/genCreateBlock.ts +1 -1
  166. package/src/templator/genCurdEditMultipleKeyBlock.ts +4 -7
  167. package/src/templator/genCurdMultipleKeyBlock.ts +4 -4
  168. package/src/templator/genEditTableBlock.ts +5 -3
  169. package/src/templator/genGetBlock.ts +3 -2
  170. package/src/templator/genTableBlock.ts +4 -2
  171. package/src/templator/genUpdateBlock.ts +1 -1
  172. package/src/automate/template/process.js +0 -11810
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@lcap/nasl",
3
3
  "description": "NetEase Application Specific Language",
4
- "version": "2.14.0",
4
+ "version": "2.15.1",
5
5
  "author": "Forrest <rainforest92@126.com>",
6
6
  "scripts": {
7
7
  "dev": "tsc -watch -p ./",
@@ -5,7 +5,7 @@ import { getConceptConstructor, getConceptMeta } from '../../decorators/index';
5
5
  // import { unique, firstUpperCase } from '../../utils/string';
6
6
  import { uniqueName, componentUniqueName } from './uniqueName';
7
7
  import { ops as operatorModule, ComponentOps } from './operators';
8
- import { processComponent } from '../template/process';
8
+ import { processComponent } from '../template/myProcess';
9
9
 
10
10
  let id = 0;
11
11
  class TemplateMeta {
@@ -1,7 +1,7 @@
1
1
  import { BindEvent } from '../../concepts';
2
2
  import { components, commonEvents } from './2.14-components';
3
3
  function iterateUp(node, callback) {
4
- while(node) {
4
+ while (node) {
5
5
  callback(node);
6
6
  node = node.parentNode;
7
7
  }
@@ -14,12 +14,12 @@ export function resetViewCache() {
14
14
  views = [];
15
15
  }
16
16
  export function resolveViewCache() {
17
- views.forEach(v => {
17
+ views.forEach((v) => {
18
18
  if (v.slotScope) {
19
- if (v.slotTarget !== 'cell'
20
- && v.slotTarget !== 'item'
19
+ if (v.slotTarget !== 'cell'
20
+ && v.slotTarget !== 'item'
21
21
  && v.slotTarget !== 'default'
22
- && v.slotTarget !== 'expand-content'
22
+ && v.slotTarget !== 'expand-content'
23
23
  && v.slotTarget !== 'editcell')
24
24
  v.slotScope = undefined;
25
25
  }
@@ -32,28 +32,28 @@ export function resolveViewCache() {
32
32
  calleeName: undefined,
33
33
  arguments: [],
34
34
  logics: [],
35
- })
35
+ });
36
36
  }
37
- const _curView = v.concept === 'View' ? v : v.view;
38
-
37
+ const _curView = v.concept === 'View' ? v : v.view;
38
+
39
39
  bindEvents.forEach((be) => {
40
- if(!eventMap[be.name]){
40
+ if (!eventMap[be.name]) {
41
41
  const t = genBindEvent(be.name);
42
42
  t.parentNode = v;
43
- t.parentKey = 'bindEvents'
43
+ t.parentKey = 'bindEvents';
44
44
  eventMap[be.name] = t;
45
45
  }
46
46
 
47
47
  const bindEventTrunk = eventMap[be.name];
48
48
 
49
49
  if (be.calleeName) {
50
- let argStrs = [];
50
+ const argStrs = [];
51
51
  let args = [];
52
52
  iterateUp(be, (item) => {
53
- if(item.tag === 'template' && item.slotScope === 'scope') {
54
- argStrs.push(`scope${argStrs.length > 0 ? argStrs.length - 1 : ''}`)
53
+ if (item.tag === 'template' && item.slotScope === 'scope') {
54
+ argStrs.push(`scope${argStrs.length > 0 ? argStrs.length - 1 : ''}`);
55
55
  }
56
- })
56
+ });
57
57
  argStrs.unshift('event');
58
58
  args = argStrs.map((name) => ({
59
59
  concept: 'Argument',
@@ -68,8 +68,8 @@ export function resolveViewCache() {
68
68
  const logic = _curView.logics.find((logic) => logic.name === be.calleeName);
69
69
  if (logic) {
70
70
  args = args.slice(0, logic.params.length);
71
- if (args.length < logic.params.length
72
- && logic.params.length === 2
71
+ if (args.length < logic.params.length
72
+ && logic.params.length === 2
73
73
  && logic.params[1].name === 'scope') {
74
74
  logic.params.splice(1, 1);
75
75
  }
@@ -104,7 +104,7 @@ export function resolveViewCache() {
104
104
  {
105
105
  concept: 'Start',
106
106
  label: '开始',
107
- folded: false
107
+ folded: false,
108
108
  },
109
109
  {
110
110
  concept: 'CallLogic',
@@ -117,8 +117,8 @@ export function resolveViewCache() {
117
117
  {
118
118
  concept: 'End',
119
119
  label: '结束',
120
- folded: false
121
- }
120
+ folded: false,
121
+ },
122
122
  ],
123
123
  playground: [],
124
124
  });
@@ -126,8 +126,8 @@ export function resolveViewCache() {
126
126
  });
127
127
  Object.keys(eventMap).forEach((k) => {
128
128
  v.bindEvents.push(eventMap[k]);
129
- })
130
- })
129
+ });
130
+ });
131
131
  }
132
132
 
133
133
  export function getViewCache() {
@@ -135,5 +135,5 @@ export function getViewCache() {
135
135
  }
136
136
 
137
137
  export function getViews() {
138
- return views
139
- }
138
+ return views;
139
+ }