@lcap/nasl 2.18.0-beta.5 → 2.18.0-beta.7

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 (88) hide show
  1. package/out/common/BaseNode.js +1 -0
  2. package/out/common/BaseNode.js.map +1 -1
  3. package/out/concepts/BatchAssignment__.js +63 -46
  4. package/out/concepts/BatchAssignment__.js.map +1 -1
  5. package/out/concepts/CallLogic__.d.ts +2 -1
  6. package/out/concepts/CallLogic__.js +26 -11
  7. package/out/concepts/CallLogic__.js.map +1 -1
  8. package/out/concepts/Destination__.d.ts +2 -1
  9. package/out/concepts/Destination__.js +90 -22
  10. package/out/concepts/Destination__.js.map +1 -1
  11. package/out/concepts/Logic__.js +6 -7
  12. package/out/concepts/Logic__.js.map +1 -1
  13. package/out/concepts/MatchExpression__.d.ts +97 -0
  14. package/out/concepts/MatchExpression__.js +281 -0
  15. package/out/concepts/MatchExpression__.js.map +1 -0
  16. package/out/concepts/ViewElement__.js +1 -1
  17. package/out/concepts/ViewElement__.js.map +1 -1
  18. package/out/concepts/View__.js +4 -0
  19. package/out/concepts/View__.js.map +1 -1
  20. package/out/generator/genBundleFiles.js +32 -182
  21. package/out/generator/genBundleFiles.js.map +1 -1
  22. package/out/generator/genMetaData.d.ts +1 -10
  23. package/out/generator/genMetaData.js +189 -50
  24. package/out/generator/genMetaData.js.map +1 -1
  25. package/out/generator/genReleaseBody.js +11 -2
  26. package/out/generator/genReleaseBody.js.map +1 -1
  27. package/out/server/extendBaseNode.js +4 -18
  28. package/out/server/extendBaseNode.js.map +1 -1
  29. package/out/server/formatTsUtils.d.ts +1 -2
  30. package/out/server/formatTsUtils.js +30 -47
  31. package/out/server/formatTsUtils.js.map +1 -1
  32. package/out/server/getProcesses.js +1 -1
  33. package/out/server/getProcesses.js.map +1 -1
  34. package/out/server/naslServer.js +8 -7
  35. package/out/server/naslServer.js.map +1 -1
  36. package/out/server/translator.js +19 -4
  37. package/out/server/translator.js.map +1 -1
  38. package/out/templator/sql-parser/index.d.ts +1 -0
  39. package/out/templator/sql-parser/index.js +228 -0
  40. package/out/templator/sql-parser/index.js.map +1 -0
  41. package/out/templator/sql-parser/parser.js +26664 -0
  42. package/out/templator/sql-parser/parser.js.map +1 -0
  43. package/package.json +2 -2
  44. package/sandbox/stdlib/dist/nasl.logging.js +0 -0
  45. package/sandbox/stdlib/nasl.util.ts +1 -1
  46. package/src/automate/engine/dist/index.dev.js +517 -0
  47. package/src/common/BaseNode.ts +1 -0
  48. package/src/common/dist/BaseNode.js +1101 -0
  49. package/src/concepts/BatchAssignment__.ts +66 -50
  50. package/src/concepts/CallLogic__.ts +26 -11
  51. package/src/concepts/Destination__.ts +92 -22
  52. package/src/concepts/Logic__.ts +6 -7
  53. package/src/concepts/ViewElement__.ts +8 -29
  54. package/src/concepts/View__.ts +4 -0
  55. package/src/concepts/basics/stdlib/dist/nasl.util.js +1503 -0
  56. package/src/concepts/basics/stdlib/dist/reference2TypeAnnotationList.js +24 -0
  57. package/src/concepts/dist/Anchor__.js +179 -0
  58. package/src/concepts/dist/Assignment__.js +301 -0
  59. package/src/concepts/dist/CallFunction__.js +513 -0
  60. package/src/concepts/dist/CallInterface__.js +533 -0
  61. package/src/concepts/dist/CallLogic__.js +892 -0
  62. package/src/concepts/dist/ForEachStatement__.js +426 -0
  63. package/src/concepts/dist/MatchCase__.js +587 -0
  64. package/src/concepts/dist/Match__.js +631 -0
  65. package/src/concepts/dist/MemberExpression__.js +348 -0
  66. package/src/concepts/dist/Param__.js +538 -0
  67. package/src/concepts/dist/Return__.js +494 -0
  68. package/src/concepts/dist/Variable__.js +537 -0
  69. package/src/concepts/dist/ViewElement__.js +1680 -0
  70. package/src/generator/dist/genBundleFiles.js +261 -0
  71. package/src/generator/dist/genMetaData.js +249 -0
  72. package/src/generator/genBundleFiles.ts +34 -219
  73. package/src/generator/genMetaData.ts +182 -77
  74. package/src/generator/genReleaseBody.ts +10 -3
  75. package/src/server/dist/formatTsUtils.js +683 -0
  76. package/src/server/dist/naslServer.js +3474 -0
  77. package/src/server/extendBaseNode.ts +4 -19
  78. package/src/server/formatTsUtils.ts +30 -46
  79. package/src/server/getProcesses.ts +1 -1
  80. package/src/server/naslServer.ts +8 -7
  81. package/src/server/translator.ts +18 -4
  82. package/src/service/storage/dist/init.js +572 -0
  83. package/ts-worker/dist/webpack.config.dev.js +108 -0
  84. package/dist/bundle.js +0 -3962
  85. package/dist/bundle.js.LICENSE.txt +0 -16
  86. package/out/generator/release.d.ts +0 -1
  87. package/out/generator/release.js +0 -51
  88. package/out/generator/release.js.map +0 -1
@@ -0,0 +1,1503 @@
1
+ "use strict";
2
+ exports.__esModule = true;
3
+ var Namespace__1 = require("../../Namespace__");
4
+ var Param__1 = require("../../Param__");
5
+ var Return__1 = require("../../Return__");
6
+ var Logic__1 = require("../../Logic__");
7
+ var Function__1 = require("../../Function__");
8
+ var TypeAnnotation__1 = require("../../TypeAnnotation__");
9
+ var TypeParam__1 = require("../../TypeParam__");
10
+ var NumericLiteral__1 = require("../../NumericLiteral__");
11
+ var Identifier__1 = require("../../Identifier__");
12
+ var BooleanLiteral__1 = require("../../BooleanLiteral__");
13
+ var StringLiteral__1 = require("../../StringLiteral__");
14
+ var AnonymousFunction__1 = require("../../AnonymousFunction__");
15
+ exports["default"] = new Namespace__1["default"]({
16
+ name: 'util',
17
+ logics: [
18
+ new Logic__1["default"]({
19
+ name: 'consoleLog',
20
+ params: [
21
+ new Param__1["default"]({
22
+ name: 'arg',
23
+ typeAnnotation: TypeAnnotation__1["default"].createPrimitive('String')
24
+ }),
25
+ ]
26
+ }),
27
+ new Logic__1["default"]({
28
+ name: 'jsonSerialize',
29
+ params: [
30
+ new Param__1["default"]({
31
+ name: 'arg'
32
+ }),
33
+ ],
34
+ returns: [
35
+ new Return__1["default"]({
36
+ name: 'result',
37
+ typeAnnotation: TypeAnnotation__1["default"].createPrimitive('String')
38
+ }),
39
+ ]
40
+ }),
41
+ new Logic__1["default"]({
42
+ name: 'jsonDeserialize',
43
+ typeParams: [
44
+ new TypeParam__1["default"]({
45
+ name: 'T'
46
+ }),
47
+ ],
48
+ params: [
49
+ new Param__1["default"]({
50
+ name: 'arg',
51
+ typeAnnotation: TypeAnnotation__1["default"].createPrimitive('String')
52
+ }),
53
+ ],
54
+ returns: [
55
+ new Return__1["default"]({
56
+ name: 'result',
57
+ typeAnnotation: TypeAnnotation__1["default"].createTypeParam('T'),
58
+ useComponent: { type: 's-datatype-select' }
59
+ }),
60
+ ]
61
+ }),
62
+ ],
63
+ functions: [
64
+ new Function__1["default"]({
65
+ name: 'Convert',
66
+ description: '各基础数据类型之间转换',
67
+ typeParams: [
68
+ new TypeParam__1["default"]({
69
+ name: 'T'
70
+ }),
71
+ ],
72
+ params: [
73
+ new Param__1["default"]({
74
+ name: 'value',
75
+ // typeAnnotation: new TypeAnnotation()
76
+ defaultExpression: new Identifier__1["default"]()
77
+ }),
78
+ ],
79
+ returns: [
80
+ new Return__1["default"]({
81
+ typeAnnotation: TypeAnnotation__1["default"].createTypeParam('T')
82
+ }),
83
+ ]
84
+ }),
85
+ new Function__1["default"]({
86
+ name: 'ToString',
87
+ description: '各类型转换成字符串',
88
+ params: [
89
+ new Param__1["default"]({
90
+ name: 'value',
91
+ defaultExpression: new Identifier__1["default"]()
92
+ }),
93
+ ],
94
+ returns: [
95
+ new Return__1["default"]({
96
+ typeAnnotation: TypeAnnotation__1["default"].createPrimitive('String')
97
+ }),
98
+ ]
99
+ }),
100
+ new Function__1["default"]({
101
+ name: 'FromString',
102
+ description: '字符串转换成其他类型',
103
+ typeParams: [
104
+ new TypeParam__1["default"]({
105
+ name: 'T'
106
+ }),
107
+ ],
108
+ params: [
109
+ new Param__1["default"]({
110
+ name: 'value',
111
+ defaultExpression: new Identifier__1["default"]()
112
+ }),
113
+ ],
114
+ returns: [
115
+ new Return__1["default"]({
116
+ typeAnnotation: TypeAnnotation__1["default"].createTypeParam('T')
117
+ }),
118
+ ]
119
+ }),
120
+ new Function__1["default"]({
121
+ name: 'IndexOf',
122
+ description: '搜索字符串位置',
123
+ params: [
124
+ new Param__1["default"]({
125
+ name: 'str',
126
+ typeAnnotation: TypeAnnotation__1["default"].createPrimitive('String')
127
+ }),
128
+ new Param__1["default"]({
129
+ name: 'search',
130
+ typeAnnotation: TypeAnnotation__1["default"].createPrimitive('String')
131
+ }),
132
+ new Param__1["default"]({
133
+ name: 'fromIndex',
134
+ defaultExpression: new NumericLiteral__1["default"]({ value: '0' })
135
+ }),
136
+ new Param__1["default"]({
137
+ name: 'ignoreCase',
138
+ description: '是否忽略大小写',
139
+ defaultExpression: new BooleanLiteral__1["default"]({ value: 'true' }),
140
+ options: [
141
+ { text: 'true', value: 'true' },
142
+ { text: 'false', value: 'false' },
143
+ ]
144
+ }),
145
+ ],
146
+ returns: [
147
+ new Return__1["default"]({
148
+ typeAnnotation: TypeAnnotation__1["default"].createTypeParam('T')
149
+ }),
150
+ ]
151
+ }),
152
+ new Function__1["default"]({
153
+ name: 'LastIndexOf',
154
+ description: '从末尾搜索字符串位置',
155
+ params: [
156
+ new Param__1["default"]({
157
+ name: 'str',
158
+ typeAnnotation: TypeAnnotation__1["default"].createPrimitive('String')
159
+ }),
160
+ new Param__1["default"]({
161
+ name: 'search',
162
+ typeAnnotation: TypeAnnotation__1["default"].createPrimitive('String')
163
+ }),
164
+ new Param__1["default"]({
165
+ name: 'ignoreCase',
166
+ description: '是否忽略大小写',
167
+ defaultExpression: new BooleanLiteral__1["default"]({ value: 'false' }),
168
+ options: [
169
+ { text: 'true', value: 'true' },
170
+ { text: 'false', value: 'false' },
171
+ ]
172
+ }),
173
+ ],
174
+ returns: [
175
+ new Return__1["default"]({
176
+ typeAnnotation: TypeAnnotation__1["default"].createTypeParam('T')
177
+ }),
178
+ ]
179
+ }),
180
+ new Function__1["default"]({
181
+ name: 'Replace',
182
+ description: '字符串替换。返回替换后的新字符串。',
183
+ params: [
184
+ new Param__1["default"]({
185
+ name: 'str',
186
+ typeAnnotation: TypeAnnotation__1["default"].createPrimitive('String')
187
+ }),
188
+ new Param__1["default"]({
189
+ name: 'search',
190
+ typeAnnotation: TypeAnnotation__1["default"].createPrimitive('String')
191
+ }),
192
+ new Param__1["default"]({
193
+ name: 'replace',
194
+ typeAnnotation: TypeAnnotation__1["default"].createPrimitive('String')
195
+ }),
196
+ ],
197
+ returns: [
198
+ new Return__1["default"]({
199
+ typeAnnotation: TypeAnnotation__1["default"].createTypeParam('T')
200
+ }),
201
+ ]
202
+ }),
203
+ new Function__1["default"]({
204
+ name: 'SubString',
205
+ description: '字符串截取。返回截取的字符串。',
206
+ params: [
207
+ new Param__1["default"]({
208
+ name: 'str',
209
+ typeAnnotation: TypeAnnotation__1["default"].createPrimitive('String')
210
+ }),
211
+ new Param__1["default"]({
212
+ name: 'start',
213
+ typeAnnotation: TypeAnnotation__1["default"].createPrimitive('String')
214
+ }),
215
+ new Param__1["default"]({
216
+ name: 'length',
217
+ typeAnnotation: TypeAnnotation__1["default"].createPrimitive('String')
218
+ }),
219
+ ],
220
+ returns: [
221
+ new Return__1["default"]({
222
+ typeAnnotation: TypeAnnotation__1["default"].createPrimitive('String')
223
+ }),
224
+ ]
225
+ }),
226
+ new Function__1["default"]({
227
+ name: 'EnumToList',
228
+ description: '返回枚举value和text的List集合',
229
+ typeParams: [
230
+ new TypeParam__1["default"]({
231
+ name: 'enum',
232
+ useComponent: { type: 's-enum-select' }
233
+ }),
234
+ ],
235
+ returns: [
236
+ new Return__1["default"]({
237
+ typeAnnotation: TypeAnnotation__1["default"].createGeneric('List', {
238
+ typeArguments: [TypeAnnotation__1["default"].createPrimitive('String')]
239
+ })
240
+ }),
241
+ ]
242
+ }),
243
+ new Function__1["default"]({
244
+ name: 'EnumValueToText',
245
+ description: '返回枚举指定value的标题字符串',
246
+ typeParams: [
247
+ new TypeParam__1["default"]({
248
+ name: 'enum',
249
+ useComponent: { type: 's-enum-select' }
250
+ }),
251
+ ],
252
+ params: [
253
+ new Param__1["default"]({
254
+ name: 'value',
255
+ typeAnnotation: TypeAnnotation__1["default"].createPrimitive('String')
256
+ }),
257
+ ],
258
+ returns: [
259
+ new Return__1["default"]({
260
+ typeAnnotation: TypeAnnotation__1["default"].createPrimitive('String')
261
+ }),
262
+ ]
263
+ }),
264
+ new Function__1["default"]({
265
+ name: 'StringToEnumValue',
266
+ description: '在指定enum中找到与参数str相同的枚举值并返回。',
267
+ typeParams: [
268
+ new TypeParam__1["default"]({
269
+ name: 'enum',
270
+ useComponent: { type: 's-enum-select' }
271
+ }),
272
+ ],
273
+ params: [
274
+ new Param__1["default"]({
275
+ name: 'value',
276
+ typeAnnotation: TypeAnnotation__1["default"].createPrimitive('String')
277
+ }),
278
+ ],
279
+ returns: [
280
+ new Return__1["default"]({
281
+ typeAnnotation: TypeAnnotation__1["default"].createPrimitive('String')
282
+ }),
283
+ ]
284
+ }),
285
+ new Function__1["default"]({
286
+ name: 'Split',
287
+ description: '将字符串参数,用分割符分割成字符串列表,并返回',
288
+ params: [
289
+ new Param__1["default"]({
290
+ name: 'str',
291
+ typeAnnotation: TypeAnnotation__1["default"].createPrimitive('String')
292
+ }),
293
+ new Param__1["default"]({
294
+ name: 'separator',
295
+ typeAnnotation: TypeAnnotation__1["default"].createPrimitive('String')
296
+ }),
297
+ ],
298
+ returns: [
299
+ new Return__1["default"]({
300
+ typeAnnotation: TypeAnnotation__1["default"].createGeneric('List', {
301
+ typeArguments: [TypeAnnotation__1["default"].createPrimitive('String')]
302
+ })
303
+ }),
304
+ ]
305
+ }),
306
+ new Function__1["default"]({
307
+ name: 'Join',
308
+ description: '将列表的项,用连接符连接成一个字符串,并返回',
309
+ params: [
310
+ new Param__1["default"]({
311
+ name: 'list',
312
+ typeAnnotation: TypeAnnotation__1["default"].createGeneric('List', {
313
+ typeArguments: [TypeAnnotation__1["default"].createPrimitive('String')]
314
+ })
315
+ }),
316
+ new Param__1["default"]({
317
+ name: 'separator',
318
+ typeAnnotation: TypeAnnotation__1["default"].createPrimitive('String')
319
+ }),
320
+ ],
321
+ returns: [
322
+ new Return__1["default"]({
323
+ typeAnnotation: TypeAnnotation__1["default"].createPrimitive('String')
324
+ }),
325
+ ]
326
+ }),
327
+ new Function__1["default"]({
328
+ name: 'Concat',
329
+ description: '将所有字符串参数连接并返回',
330
+ params: [
331
+ new Param__1["default"]({
332
+ name: 'str1',
333
+ typeAnnotation: TypeAnnotation__1["default"].createPrimitive('String')
334
+ }),
335
+ new Param__1["default"]({
336
+ name: 'str2',
337
+ typeAnnotation: TypeAnnotation__1["default"].createPrimitive('String')
338
+ }),
339
+ ],
340
+ returns: [
341
+ new Return__1["default"]({
342
+ typeAnnotation: TypeAnnotation__1["default"].createPrimitive('String')
343
+ }),
344
+ ]
345
+ }),
346
+ new Function__1["default"]({
347
+ name: 'Length',
348
+ description: '返回String或Map或List的长度',
349
+ params: [
350
+ new Param__1["default"]({
351
+ name: 'param',
352
+ typeAnnotation: TypeAnnotation__1["default"].createPrimitive('String')
353
+ }),
354
+ ],
355
+ returns: [
356
+ new Return__1["default"]({
357
+ typeAnnotation: TypeAnnotation__1["default"].createPrimitive('Integer')
358
+ }),
359
+ ]
360
+ }),
361
+ new Function__1["default"]({
362
+ name: 'ToLower',
363
+ description: '返回全部小写的字符串',
364
+ params: [
365
+ new Param__1["default"]({
366
+ name: 'str1',
367
+ typeAnnotation: TypeAnnotation__1["default"].createPrimitive('String')
368
+ }),
369
+ ],
370
+ returns: [
371
+ new Return__1["default"]({
372
+ typeAnnotation: TypeAnnotation__1["default"].createPrimitive('String')
373
+ }),
374
+ ]
375
+ }),
376
+ new Function__1["default"]({
377
+ name: 'ToUpper',
378
+ description: '返回全部大写的字符串',
379
+ params: [
380
+ new Param__1["default"]({
381
+ name: 'str1',
382
+ typeAnnotation: TypeAnnotation__1["default"].createPrimitive('String')
383
+ }),
384
+ ],
385
+ returns: [
386
+ new Return__1["default"]({
387
+ typeAnnotation: TypeAnnotation__1["default"].createPrimitive('String')
388
+ }),
389
+ ]
390
+ }),
391
+ new Function__1["default"]({
392
+ name: 'Trim',
393
+ description: '删除字符串的前后空格。返回裁剪后的新字符串。',
394
+ params: [
395
+ new Param__1["default"]({
396
+ name: 'str1',
397
+ typeAnnotation: TypeAnnotation__1["default"].createPrimitive('String')
398
+ }),
399
+ ],
400
+ returns: [
401
+ new Return__1["default"]({
402
+ typeAnnotation: TypeAnnotation__1["default"].createPrimitive('String')
403
+ }),
404
+ ]
405
+ }),
406
+ new Function__1["default"]({
407
+ name: 'Get',
408
+ description: '获得列表位于指定索引处的项',
409
+ params: [
410
+ new Param__1["default"]({
411
+ name: 'list',
412
+ typeAnnotation: TypeAnnotation__1["default"].createGeneric('List', {
413
+ typeArguments: [TypeAnnotation__1["default"].createTypeParam('T')]
414
+ })
415
+ }),
416
+ new Param__1["default"]({
417
+ name: 'index',
418
+ typeAnnotation: TypeAnnotation__1["default"].createPrimitive('Integer')
419
+ }),
420
+ ],
421
+ returns: [
422
+ new Return__1["default"]({
423
+ typeAnnotation: TypeAnnotation__1["default"].createTypeParam('T')
424
+ }),
425
+ ]
426
+ }),
427
+ new Function__1["default"]({
428
+ name: 'Set',
429
+ description: '(修改原数据)为列表的指定索引项赋值(覆盖原索引项)',
430
+ params: [
431
+ new Param__1["default"]({
432
+ name: 'list',
433
+ typeAnnotation: TypeAnnotation__1["default"].createGeneric('List', {
434
+ typeArguments: [TypeAnnotation__1["default"].createTypeParam('T')]
435
+ })
436
+ }),
437
+ new Param__1["default"]({
438
+ name: 'index',
439
+ typeAnnotation: TypeAnnotation__1["default"].createPrimitive('Integer')
440
+ }),
441
+ new Param__1["default"]({
442
+ name: 'item',
443
+ typeAnnotation: TypeAnnotation__1["default"].createTypeParam('T')
444
+ }),
445
+ ],
446
+ returns: [
447
+ new Return__1["default"]({
448
+ typeAnnotation: TypeAnnotation__1["default"].createTypeParam('T')
449
+ }),
450
+ ]
451
+ }),
452
+ new Function__1["default"]({
453
+ name: 'Contains',
454
+ description: '测试列表是否包含某一项,返回测试结果',
455
+ params: [
456
+ new Param__1["default"]({
457
+ name: 'list',
458
+ typeAnnotation: TypeAnnotation__1["default"].createGeneric('List', {
459
+ typeArguments: [TypeAnnotation__1["default"].createTypeParam('T')]
460
+ })
461
+ }),
462
+ new Param__1["default"]({
463
+ name: 'item',
464
+ typeAnnotation: TypeAnnotation__1["default"].createTypeParam('T')
465
+ }),
466
+ ],
467
+ returns: [
468
+ new Return__1["default"]({
469
+ typeAnnotation: TypeAnnotation__1["default"].createTypeParam('Boolean')
470
+ }),
471
+ ]
472
+ }),
473
+ new Function__1["default"]({
474
+ name: 'Add',
475
+ description: '(修改原数据)在列表末尾追加项。',
476
+ params: [
477
+ new Param__1["default"]({
478
+ name: 'list',
479
+ typeAnnotation: TypeAnnotation__1["default"].createGeneric('List', {
480
+ typeArguments: [TypeAnnotation__1["default"].createTypeParam('T')]
481
+ })
482
+ }),
483
+ new Param__1["default"]({
484
+ name: 'item',
485
+ typeAnnotation: TypeAnnotation__1["default"].createTypeParam('T')
486
+ }),
487
+ ]
488
+ }),
489
+ new Function__1["default"]({
490
+ name: 'AddAll',
491
+ description: '(修改原数据)为一个列表添加另一列表中的多项内容。返回新列表的长度',
492
+ params: [
493
+ new Param__1["default"]({
494
+ name: 'list',
495
+ typeAnnotation: TypeAnnotation__1["default"].createGeneric('List', {
496
+ typeArguments: [TypeAnnotation__1["default"].createTypeParam('T')]
497
+ })
498
+ }),
499
+ new Param__1["default"]({
500
+ name: 'addList',
501
+ typeAnnotation: TypeAnnotation__1["default"].createGeneric('List', {
502
+ typeArguments: [TypeAnnotation__1["default"].createTypeParam('T')]
503
+ })
504
+ }),
505
+ ],
506
+ returns: [
507
+ new Return__1["default"]({
508
+ typeAnnotation: TypeAnnotation__1["default"].createPrimitive('Integer')
509
+ }),
510
+ ]
511
+ }),
512
+ new Function__1["default"]({
513
+ name: 'Insert',
514
+ description: '(修改原数据)在列表的指定索引处插入新项(原索引项依次后推)',
515
+ params: [
516
+ new Param__1["default"]({
517
+ name: 'list',
518
+ typeAnnotation: TypeAnnotation__1["default"].createGeneric('List', {
519
+ typeArguments: [TypeAnnotation__1["default"].createTypeParam('T')]
520
+ })
521
+ }),
522
+ new Param__1["default"]({
523
+ name: 'index',
524
+ typeAnnotation: TypeAnnotation__1["default"].createPrimitive('Integer')
525
+ }),
526
+ new Param__1["default"]({
527
+ name: 'item',
528
+ typeAnnotation: TypeAnnotation__1["default"].createTypeParam('T')
529
+ }),
530
+ ]
531
+ }),
532
+ new Function__1["default"]({
533
+ name: 'Remove',
534
+ description: '(修改原数据)删除列表的某项',
535
+ params: [
536
+ new Param__1["default"]({
537
+ name: 'list',
538
+ typeAnnotation: TypeAnnotation__1["default"].createGeneric('List', {
539
+ typeArguments: [TypeAnnotation__1["default"].createTypeParam('T')]
540
+ })
541
+ }),
542
+ new Param__1["default"]({
543
+ name: 'item',
544
+ typeAnnotation: TypeAnnotation__1["default"].createTypeParam('T')
545
+ }),
546
+ ]
547
+ }),
548
+ new Function__1["default"]({
549
+ name: 'RemoveAt',
550
+ description: '(修改原数据)在列表中删除位于指定索引的项。返回被删除的项',
551
+ params: [
552
+ new Param__1["default"]({
553
+ name: 'list',
554
+ typeAnnotation: TypeAnnotation__1["default"].createGeneric('List', {
555
+ typeArguments: [TypeAnnotation__1["default"].createTypeParam('T')]
556
+ })
557
+ }),
558
+ new Param__1["default"]({
559
+ name: 'index',
560
+ typeAnnotation: TypeAnnotation__1["default"].createPrimitive('Integer')
561
+ }),
562
+ ],
563
+ returns: [
564
+ new Return__1["default"]({
565
+ typeAnnotation: TypeAnnotation__1["default"].createTypeParam('T')
566
+ }),
567
+ ]
568
+ }),
569
+ new Function__1["default"]({
570
+ name: 'ListHead',
571
+ description: '返回列表的首项',
572
+ params: [
573
+ new Param__1["default"]({
574
+ name: 'list'
575
+ }),
576
+ ],
577
+ returns: [
578
+ new Return__1["default"]({
579
+ typeAnnotation: TypeAnnotation__1["default"].createTypeParam('T')
580
+ }),
581
+ ]
582
+ }),
583
+ new Function__1["default"]({
584
+ name: 'ListLast',
585
+ description: '返回列表的末项',
586
+ params: [
587
+ new Param__1["default"]({
588
+ name: 'list'
589
+ }),
590
+ ],
591
+ returns: [
592
+ new Return__1["default"]({
593
+ typeAnnotation: TypeAnnotation__1["default"].createTypeParam('T')
594
+ }),
595
+ ]
596
+ }),
597
+ new Function__1["default"]({
598
+ name: 'ListFlatten',
599
+ description: '将嵌套列表摊平一层并返回(List<List<T>> 变为 List<T>)',
600
+ params: [
601
+ new Param__1["default"]({
602
+ name: 'list'
603
+ }),
604
+ ],
605
+ returns: [
606
+ new Return__1["default"]({
607
+ typeAnnotation: TypeAnnotation__1["default"].createGeneric('List', {
608
+ typeArguments: [TypeAnnotation__1["default"].createTypeParam('T')]
609
+ })
610
+ }),
611
+ ]
612
+ }),
613
+ new Function__1["default"]({
614
+ name: 'ListToMap',
615
+ description: '选取列表项的某些属性,根据这些属性将列表变为 Map 并返回',
616
+ params: [
617
+ new Param__1["default"]({
618
+ name: 'list'
619
+ }),
620
+ new Param__1["default"]({
621
+ name: 'by',
622
+ description: "<div>(${0}) \u2192 Boolean | Integer | Long | Decimal | String</div>\n <div>(${0}) \u2192 V</div>",
623
+ defaultExpression: new AnonymousFunction__1["default"]({
624
+ params: [
625
+ new Param__1["default"]({
626
+ name: 'item',
627
+ typeAnnotation: null
628
+ }),
629
+ ],
630
+ body: new Identifier__1["default"]()
631
+ })
632
+ }),
633
+ new Param__1["default"]({
634
+ name: 'byVal',
635
+ defaultExpression: new AnonymousFunction__1["default"]({
636
+ params: [
637
+ new Param__1["default"]({
638
+ name: 'item',
639
+ typeAnnotation: null
640
+ }),
641
+ ],
642
+ body: new Identifier__1["default"]()
643
+ })
644
+ }),
645
+ ]
646
+ }),
647
+ new Function__1["default"]({
648
+ name: 'ListTransform',
649
+ description: '对列表的每一项调用函数 by,得到新项;返回新项构成的列表',
650
+ params: [
651
+ new Param__1["default"]({
652
+ name: 'list'
653
+ }),
654
+ new Param__1["default"]({
655
+ name: 'by',
656
+ description: '(${0}) → T',
657
+ defaultExpression: new AnonymousFunction__1["default"]({
658
+ params: [
659
+ new Param__1["default"]({
660
+ name: 'item',
661
+ typeAnnotation: null
662
+ }),
663
+ ]
664
+ })
665
+ }),
666
+ ],
667
+ returns: [
668
+ new Return__1["default"]({
669
+ typeAnnotation: TypeAnnotation__1["default"].createGeneric('List', {
670
+ typeArguments: [TypeAnnotation__1["default"].createTypeParam('T')]
671
+ })
672
+ }),
673
+ ]
674
+ }),
675
+ new Function__1["default"]({
676
+ name: 'ListSum',
677
+ description: '返回数值列表中所有项的和',
678
+ params: [
679
+ new Param__1["default"]({
680
+ name: 'list'
681
+ }),
682
+ ],
683
+ returns: [
684
+ new Return__1["default"]({
685
+ typeAnnotation: TypeAnnotation__1["default"].createTypeParam('T')
686
+ }),
687
+ ]
688
+ }),
689
+ new Function__1["default"]({
690
+ name: 'ListProduct',
691
+ description: '返回数值列表中所有项的积',
692
+ params: [
693
+ new Param__1["default"]({
694
+ name: 'list'
695
+ }),
696
+ ],
697
+ returns: [
698
+ new Return__1["default"]({
699
+ typeAnnotation: TypeAnnotation__1["default"].createTypeParam('T')
700
+ }),
701
+ ]
702
+ }),
703
+ new Function__1["default"]({
704
+ name: 'ListAverage',
705
+ description: '返回数值列表中所有项的平均值',
706
+ params: [
707
+ new Param__1["default"]({
708
+ name: 'list'
709
+ }),
710
+ ],
711
+ returns: [
712
+ new Return__1["default"]({
713
+ typeAnnotation: TypeAnnotation__1["default"].createTypeParam('T')
714
+ }),
715
+ ]
716
+ }),
717
+ new Function__1["default"]({
718
+ name: 'ListMax',
719
+ description: '返回数值列表中所有项的最大值',
720
+ params: [
721
+ new Param__1["default"]({
722
+ name: 'list'
723
+ }),
724
+ ],
725
+ returns: [
726
+ new Return__1["default"]({
727
+ typeAnnotation: TypeAnnotation__1["default"].createTypeParam('T')
728
+ }),
729
+ ]
730
+ }),
731
+ new Function__1["default"]({
732
+ name: 'ListMin',
733
+ description: '返回数值列表中所有项的最小值',
734
+ params: [
735
+ new Param__1["default"]({
736
+ name: 'list'
737
+ }),
738
+ ],
739
+ returns: [
740
+ new Return__1["default"]({
741
+ typeAnnotation: TypeAnnotation__1["default"].createTypeParam('T')
742
+ }),
743
+ ]
744
+ }),
745
+ new Function__1["default"]({
746
+ name: 'MapGet',
747
+ description: '查询出Map中key为指定值的value值列表',
748
+ params: [
749
+ new Param__1["default"]({
750
+ name: 'map',
751
+ typeAnnotation: TypeAnnotation__1["default"].createGeneric('map', {
752
+ typeArguments: [
753
+ TypeAnnotation__1["default"].createTypeParam('K'),
754
+ TypeAnnotation__1["default"].createTypeParam('V'),
755
+ ]
756
+ })
757
+ }),
758
+ new Param__1["default"]({
759
+ name: 'key',
760
+ typeAnnotation: TypeAnnotation__1["default"].createTypeParam('K')
761
+ }),
762
+ ],
763
+ returns: [
764
+ new Return__1["default"]({
765
+ typeAnnotation: TypeAnnotation__1["default"].createTypeParam('V')
766
+ }),
767
+ ]
768
+ }),
769
+ new Function__1["default"]({
770
+ name: 'MapPut',
771
+ description: '(修改原数据)为Map中添加键值对',
772
+ params: [
773
+ new Param__1["default"]({
774
+ name: 'map',
775
+ typeAnnotation: TypeAnnotation__1["default"].createGeneric('map', {
776
+ typeArguments: [
777
+ TypeAnnotation__1["default"].createTypeParam('K'),
778
+ TypeAnnotation__1["default"].createTypeParam('V'),
779
+ ]
780
+ })
781
+ }),
782
+ new Param__1["default"]({
783
+ name: 'key',
784
+ typeAnnotation: TypeAnnotation__1["default"].createTypeParam('K')
785
+ }),
786
+ new Param__1["default"]({
787
+ name: 'value',
788
+ typeAnnotation: TypeAnnotation__1["default"].createTypeParam('V')
789
+ }),
790
+ ]
791
+ }),
792
+ new Function__1["default"]({
793
+ name: 'MapRemove',
794
+ description: '(修改原数据)删除Map中的键值对',
795
+ params: [
796
+ new Param__1["default"]({
797
+ name: 'map',
798
+ typeAnnotation: TypeAnnotation__1["default"].createGeneric('map', {
799
+ typeArguments: [
800
+ TypeAnnotation__1["default"].createTypeParam('K'),
801
+ TypeAnnotation__1["default"].createTypeParam('V'),
802
+ ]
803
+ })
804
+ }),
805
+ new Param__1["default"]({
806
+ name: 'key',
807
+ typeAnnotation: TypeAnnotation__1["default"].createTypeParam('K')
808
+ }),
809
+ ]
810
+ }),
811
+ new Function__1["default"]({
812
+ name: 'MapContains',
813
+ description: '判断Map中是否存在参数指定的键值对',
814
+ params: [
815
+ new Param__1["default"]({
816
+ name: 'map',
817
+ typeAnnotation: TypeAnnotation__1["default"].createGeneric('map', {
818
+ typeArguments: [
819
+ TypeAnnotation__1["default"].createTypeParam('K'),
820
+ TypeAnnotation__1["default"].createTypeParam('V'),
821
+ ]
822
+ })
823
+ }),
824
+ new Param__1["default"]({
825
+ name: 'key',
826
+ typeAnnotation: TypeAnnotation__1["default"].createTypeParam('K')
827
+ }),
828
+ ],
829
+ returns: [
830
+ new Return__1["default"]({
831
+ typeAnnotation: TypeAnnotation__1["default"].createTypeParam('Boolean')
832
+ }),
833
+ ]
834
+ }),
835
+ new Function__1["default"]({
836
+ name: 'MapKeys',
837
+ description: '输出Map中key集合',
838
+ params: [
839
+ new Param__1["default"]({
840
+ name: 'map',
841
+ typeAnnotation: TypeAnnotation__1["default"].createGeneric('map', {
842
+ typeArguments: [
843
+ TypeAnnotation__1["default"].createTypeParam('K'),
844
+ TypeAnnotation__1["default"].createTypeParam('V'),
845
+ ]
846
+ })
847
+ }),
848
+ ],
849
+ returns: [
850
+ new Return__1["default"]({
851
+ typeAnnotation: TypeAnnotation__1["default"].createGeneric('List', {
852
+ typeArguments: [TypeAnnotation__1["default"].createTypeParam('K')]
853
+ })
854
+ }),
855
+ ]
856
+ }),
857
+ new Function__1["default"]({
858
+ name: 'MapValues',
859
+ description: '输出Map中value集合',
860
+ params: [
861
+ new Param__1["default"]({
862
+ name: 'map',
863
+ typeAnnotation: TypeAnnotation__1["default"].createGeneric('map', {
864
+ typeArguments: [
865
+ TypeAnnotation__1["default"].createTypeParam('K'),
866
+ TypeAnnotation__1["default"].createTypeParam('V'),
867
+ ]
868
+ })
869
+ }),
870
+ ],
871
+ returns: [
872
+ new Return__1["default"]({
873
+ typeAnnotation: TypeAnnotation__1["default"].createGeneric('List', {
874
+ typeArguments: [TypeAnnotation__1["default"].createTypeParam('V')]
875
+ })
876
+ }),
877
+ ]
878
+ }),
879
+ new Function__1["default"]({
880
+ name: 'MapFilter',
881
+ description: '在指定Map中过滤出符合条件参数的Map列表',
882
+ params: [
883
+ new Param__1["default"]({
884
+ name: 'map'
885
+ }),
886
+ new Param__1["default"]({
887
+ name: 'by',
888
+ description: '(${0},${1}) → Boolean',
889
+ defaultExpression: new AnonymousFunction__1["default"]({
890
+ name: '',
891
+ description: '',
892
+ params: [
893
+ new Param__1["default"]({
894
+ name: 'key',
895
+ typeAnnotation: null
896
+ }),
897
+ new Param__1["default"]({
898
+ name: 'value',
899
+ typeAnnotation: null
900
+ }),
901
+ ]
902
+ })
903
+ }),
904
+ ],
905
+ returns: [
906
+ new Return__1["default"]({
907
+ typeAnnotation: TypeAnnotation__1["default"].createGeneric('map', {
908
+ typeArguments: [
909
+ TypeAnnotation__1["default"].createTypeParam('K'),
910
+ TypeAnnotation__1["default"].createTypeParam('V'),
911
+ ]
912
+ })
913
+ }),
914
+ ]
915
+ }),
916
+ new Function__1["default"]({
917
+ name: 'MapTransform',
918
+ description: '对 Map 的每一项调用函数 by,得到新项,并返回新项构成的 Map。(Map 的每一项从 (K0, V0) 变为 (K, V)。)',
919
+ params: [
920
+ new Param__1["default"]({
921
+ name: 'map'
922
+ }),
923
+ new Param__1["default"]({
924
+ name: 'by',
925
+ description: "<div>(${0}, ${1}) \u2192 Boolean | Integer | Long | Decimal | String</div>\n <div>(${0}, ${1}) \u2192 V</div>",
926
+ defaultExpression: new AnonymousFunction__1["default"]({
927
+ params: [
928
+ new Param__1["default"]({
929
+ name: 'key',
930
+ typeAnnotation: null
931
+ }),
932
+ new Param__1["default"]({
933
+ name: 'value',
934
+ typeAnnotation: null
935
+ }),
936
+ ],
937
+ body: new Identifier__1["default"]({
938
+ name: 'key'
939
+ })
940
+ })
941
+ }),
942
+ new Param__1["default"]({
943
+ name: 'byVal',
944
+ defaultExpression: new AnonymousFunction__1["default"]({
945
+ params: [
946
+ new Param__1["default"]({
947
+ name: 'key',
948
+ typeAnnotation: null
949
+ }),
950
+ new Param__1["default"]({
951
+ name: 'value',
952
+ typeAnnotation: null
953
+ }),
954
+ ]
955
+ })
956
+ }),
957
+ ],
958
+ returns: [
959
+ new Return__1["default"]({
960
+ typeAnnotation: TypeAnnotation__1["default"].createGeneric('Map', {
961
+ typeArguments: [TypeAnnotation__1["default"].createTypeParam('K'), TypeAnnotation__1["default"].createTypeParam('V')]
962
+ })
963
+ }),
964
+ ]
965
+ }),
966
+ new Function__1["default"]({
967
+ name: 'CurrDate',
968
+ description: '返回当前日期',
969
+ params: [],
970
+ returns: [
971
+ new Return__1["default"]({
972
+ typeAnnotation: TypeAnnotation__1["default"].createPrimitive('Date')
973
+ }),
974
+ ]
975
+ }),
976
+ new Function__1["default"]({
977
+ name: 'CurrTime',
978
+ description: '返回当前时间',
979
+ params: [],
980
+ returns: [
981
+ new Return__1["default"]({
982
+ typeAnnotation: TypeAnnotation__1["default"].createTypeParam('Time')
983
+ }),
984
+ ]
985
+ }),
986
+ new Function__1["default"]({
987
+ name: 'CurrDateTime',
988
+ description: '返回当前日期时间',
989
+ params: [],
990
+ returns: [
991
+ new Return__1["default"]({
992
+ typeAnnotation: TypeAnnotation__1["default"].createPrimitive('DateTime')
993
+ }),
994
+ ]
995
+ }),
996
+ new Function__1["default"]({
997
+ name: 'FormatDate',
998
+ description: '返回格式化日期字符串',
999
+ params: [
1000
+ new Param__1["default"]({
1001
+ name: 'date',
1002
+ typeAnnotation: TypeAnnotation__1["default"].createPrimitive('Date')
1003
+ }),
1004
+ new Param__1["default"]({
1005
+ name: 'formatter',
1006
+ defaultValue: 'yyyy-MM-dd',
1007
+ defaultExpression: new StringLiteral__1["default"]({ value: 'yyyy-MM-dd' }),
1008
+ typeAnnotation: TypeAnnotation__1["default"].createPrimitive('String')
1009
+ }),
1010
+ ],
1011
+ returns: [
1012
+ new Return__1["default"]({
1013
+ typeAnnotation: TypeAnnotation__1["default"].createPrimitive('String')
1014
+ }),
1015
+ ]
1016
+ }),
1017
+ new Function__1["default"]({
1018
+ name: 'FormatDateTime',
1019
+ description: '返回格式化日期时间字符串',
1020
+ params: [
1021
+ new Param__1["default"]({
1022
+ name: 'date',
1023
+ typeAnnotation: TypeAnnotation__1["default"].createPrimitive('DateTime')
1024
+ }),
1025
+ new Param__1["default"]({
1026
+ name: 'formatter',
1027
+ typeAnnotation: TypeAnnotation__1["default"].createPrimitive('String'),
1028
+ defaultValue: 'yyyy-MM-dd HH:mm:ss',
1029
+ defaultExpression: new StringLiteral__1["default"]({ value: 'yyyy-MM-dd HH:mm:ss' })
1030
+ }),
1031
+ ],
1032
+ returns: [
1033
+ new Return__1["default"]({
1034
+ typeAnnotation: TypeAnnotation__1["default"].createPrimitive('String')
1035
+ }),
1036
+ ]
1037
+ }),
1038
+ new Function__1["default"]({
1039
+ name: 'FormatNumber',
1040
+ description: '返回格式化的数字字符串',
1041
+ params: [
1042
+ new Param__1["default"]({
1043
+ name: 'value',
1044
+ typeAnnotation: TypeAnnotation__1["default"].createPrimitive('Decimal'),
1045
+ defaultExpression: new Identifier__1["default"]()
1046
+ }),
1047
+ new Param__1["default"]({
1048
+ name: 'digits',
1049
+ typeAnnotation: TypeAnnotation__1["default"].createPrimitive('Integer'),
1050
+ description: '保留小数位数',
1051
+ defaultValue: '2',
1052
+ defaultExpression: new NumericLiteral__1["default"]({ value: '2' })
1053
+ }),
1054
+ new Param__1["default"]({
1055
+ name: 'showGroups',
1056
+ typeAnnotation: TypeAnnotation__1["default"].createPrimitive('Boolean'),
1057
+ defaultValue: 'false',
1058
+ defaultExpression: new BooleanLiteral__1["default"]({ value: 'false' }),
1059
+ options: [
1060
+ { text: 'true', value: 'true' },
1061
+ { text: 'false', value: 'false' },
1062
+ ],
1063
+ description: '是否显示千分位:true显示,false不显示'
1064
+ }),
1065
+ ],
1066
+ returns: [
1067
+ new Return__1["default"]({
1068
+ typeAnnotation: TypeAnnotation__1["default"].createPrimitive('String')
1069
+ }),
1070
+ ]
1071
+ }),
1072
+ new Function__1["default"]({
1073
+ name: 'AddDays',
1074
+ description: '返回日期天数加法计算结果',
1075
+ params: [
1076
+ new Param__1["default"]({
1077
+ name: 'dateTime',
1078
+ typeAnnotation: TypeAnnotation__1["default"].createPrimitive('DateTime')
1079
+ }),
1080
+ new Param__1["default"]({
1081
+ name: 'amount',
1082
+ typeAnnotation: TypeAnnotation__1["default"].createPrimitive('Integer')
1083
+ }),
1084
+ ],
1085
+ returns: [
1086
+ new Return__1["default"]({
1087
+ typeAnnotation: TypeAnnotation__1["default"].createPrimitive('DateTime')
1088
+ }),
1089
+ ]
1090
+ }),
1091
+ new Function__1["default"]({
1092
+ name: 'AddMonths',
1093
+ description: '返回月份加法计算结果',
1094
+ params: [
1095
+ new Param__1["default"]({
1096
+ name: 'dateTime',
1097
+ typeAnnotation: TypeAnnotation__1["default"].createPrimitive('DateTime')
1098
+ }),
1099
+ new Param__1["default"]({
1100
+ name: 'amount',
1101
+ typeAnnotation: TypeAnnotation__1["default"].createPrimitive('Integer')
1102
+ }),
1103
+ ],
1104
+ returns: [
1105
+ new Return__1["default"]({
1106
+ typeAnnotation: TypeAnnotation__1["default"].createPrimitive('DateTime')
1107
+ }),
1108
+ ]
1109
+ }),
1110
+ new Function__1["default"]({
1111
+ name: 'DateDiff',
1112
+ description: '返回日期比较结果',
1113
+ params: [
1114
+ new Param__1["default"]({
1115
+ name: 'dateTime1',
1116
+ typeAnnotation: TypeAnnotation__1["default"].createPrimitive('DateTime'),
1117
+ defaultExpression: new Identifier__1["default"]()
1118
+ }),
1119
+ new Param__1["default"]({
1120
+ name: 'dateTime2',
1121
+ typeAnnotation: TypeAnnotation__1["default"].createPrimitive('DateTime'),
1122
+ defaultExpression: new Identifier__1["default"]()
1123
+ }),
1124
+ new Param__1["default"]({
1125
+ name: 'calcType',
1126
+ description: '计算类型。如选择天数,则计算前两个参数的天数差值。',
1127
+ typeAnnotation: TypeAnnotation__1["default"].createPrimitive('String'),
1128
+ defaultValue: 'd',
1129
+ defaultExpression: new StringLiteral__1["default"]({ value: 'd' }),
1130
+ options: [
1131
+ { text: '年数', value: 'y' },
1132
+ { text: '季度数', value: 'q' },
1133
+ { text: '月数', value: 'M' },
1134
+ { text: '星期数', value: 'w' },
1135
+ { text: '天数', value: 'd' },
1136
+ { text: '小时数', value: 'h' },
1137
+ { text: '分钟数', value: 'm' },
1138
+ { text: '秒数', value: 's' },
1139
+ ]
1140
+ }),
1141
+ ],
1142
+ returns: [
1143
+ new Return__1["default"]({
1144
+ typeAnnotation: TypeAnnotation__1["default"].createPrimitive('Integer')
1145
+ }),
1146
+ ]
1147
+ }),
1148
+ new Function__1["default"]({
1149
+ name: 'Clone',
1150
+ description: '复制一个所选参数的实例',
1151
+ params: [
1152
+ new Param__1["default"]({
1153
+ name: 'struct',
1154
+ typeAnnotation: TypeAnnotation__1["default"].createTypeParam('T')
1155
+ }),
1156
+ ],
1157
+ returns: [
1158
+ new Return__1["default"]({
1159
+ typeAnnotation: TypeAnnotation__1["default"].createTypeParam('T')
1160
+ }),
1161
+ ]
1162
+ }),
1163
+ new Function__1["default"]({
1164
+ name: 'Clear',
1165
+ description: '(修改原数据)清除复杂对象数据(不支持清除 Integer 等基础类型的值)',
1166
+ params: [
1167
+ new Param__1["default"]({
1168
+ name: 'struct',
1169
+ typeAnnotation: TypeAnnotation__1["default"].createTypeParam('T')
1170
+ }),
1171
+ ],
1172
+ returns: [
1173
+ new Return__1["default"]({
1174
+ typeAnnotation: TypeAnnotation__1["default"].createTypeParam('T')
1175
+ }),
1176
+ ]
1177
+ }),
1178
+ new Function__1["default"]({
1179
+ name: 'RandomInt',
1180
+ description: '产生随机整数',
1181
+ params: [
1182
+ new Param__1["default"]({
1183
+ name: 'start',
1184
+ typeAnnotation: TypeAnnotation__1["default"].createPrimitive('Integer')
1185
+ }),
1186
+ new Param__1["default"]({
1187
+ name: 'end',
1188
+ typeAnnotation: TypeAnnotation__1["default"].createPrimitive('Integer')
1189
+ }),
1190
+ ],
1191
+ returns: [
1192
+ new Return__1["default"]({
1193
+ typeAnnotation: TypeAnnotation__1["default"].createPrimitive('Integer')
1194
+ }),
1195
+ ]
1196
+ }),
1197
+ new Function__1["default"]({
1198
+ name: 'CreateListPage',
1199
+ description: '将List<T>列表转换为列表分页',
1200
+ params: [
1201
+ new Param__1["default"]({
1202
+ name: 'list',
1203
+ typeAnnotation: TypeAnnotation__1["default"].createGeneric('List', {
1204
+ typeArguments: [TypeAnnotation__1["default"].createTypeParam('T')]
1205
+ })
1206
+ }),
1207
+ new Param__1["default"]({
1208
+ name: 'total',
1209
+ typeAnnotation: TypeAnnotation__1["default"].createPrimitive('Integer')
1210
+ }),
1211
+ ],
1212
+ returns: [
1213
+ new Return__1["default"]({
1214
+ typeAnnotation: TypeAnnotation__1["default"].createPrimitive('PageOf', {
1215
+ typeArguments: [TypeAnnotation__1["default"].createTypeParam('T')]
1216
+ })
1217
+ }),
1218
+ ]
1219
+ }),
1220
+ new Function__1["default"]({
1221
+ name: 'ListSort',
1222
+ description: '(修改原数据)为列表按指定规则排序',
1223
+ params: [
1224
+ new Param__1["default"]({
1225
+ name: 'list',
1226
+ typeAnnotation: TypeAnnotation__1["default"].createGeneric('List', {
1227
+ typeArguments: [TypeAnnotation__1["default"].createTypeParam('T')]
1228
+ })
1229
+ }),
1230
+ new Param__1["default"]({
1231
+ name: 'by',
1232
+ defaultExpression: new Function__1["default"]({
1233
+ name: '',
1234
+ description: '',
1235
+ params: [
1236
+ new Param__1["default"]({
1237
+ name: 'item',
1238
+ typeAnnotation: null
1239
+ }),
1240
+ ]
1241
+ })
1242
+ }),
1243
+ new Param__1["default"]({
1244
+ name: 'sort',
1245
+ description: '下拉选择升序、降序',
1246
+ typeAnnotation: TypeAnnotation__1["default"].createPrimitive('Boolean'),
1247
+ defaultValue: 'asc',
1248
+ defaultExpression: new BooleanLiteral__1["default"]({ value: 'true' }),
1249
+ options: [
1250
+ { text: 'asc', value: 'true' },
1251
+ { text: 'desc', value: 'false' },
1252
+ ]
1253
+ }),
1254
+ ],
1255
+ returns: []
1256
+ }),
1257
+ new Function__1["default"]({
1258
+ name: 'ListFind',
1259
+ description: '返回列表中第一个符合条件的项',
1260
+ params: [
1261
+ new Param__1["default"]({
1262
+ name: 'list',
1263
+ typeAnnotation: TypeAnnotation__1["default"].createGeneric('List', {
1264
+ typeArguments: [TypeAnnotation__1["default"].createTypeParam('T')]
1265
+ })
1266
+ }),
1267
+ new Param__1["default"]({
1268
+ name: 'by',
1269
+ defaultExpression: new Function__1["default"]({
1270
+ name: '',
1271
+ description: '',
1272
+ params: [
1273
+ new Param__1["default"]({
1274
+ name: 'item',
1275
+ typeAnnotation: null
1276
+ }),
1277
+ ]
1278
+ })
1279
+ }),
1280
+ ],
1281
+ returns: [
1282
+ new Return__1["default"]({
1283
+ typeAnnotation: TypeAnnotation__1["default"].createTypeParam('T')
1284
+ }),
1285
+ ]
1286
+ }),
1287
+ new Function__1["default"]({
1288
+ name: 'ListFindIndex',
1289
+ description: '返回列表中第一个符合条件的项的索引值',
1290
+ params: [
1291
+ new Param__1["default"]({
1292
+ name: 'list',
1293
+ typeAnnotation: TypeAnnotation__1["default"].createGeneric('List', {
1294
+ typeArguments: [TypeAnnotation__1["default"].createTypeParam('T')]
1295
+ })
1296
+ }),
1297
+ new Param__1["default"]({
1298
+ name: 'by',
1299
+ defaultExpression: new Function__1["default"]({
1300
+ name: '',
1301
+ description: '',
1302
+ params: [
1303
+ new Param__1["default"]({
1304
+ name: 'item',
1305
+ typeAnnotation: null
1306
+ }),
1307
+ ]
1308
+ })
1309
+ }),
1310
+ ],
1311
+ returns: [
1312
+ new Return__1["default"]({
1313
+ typeAnnotation: TypeAnnotation__1["default"].createPrimitive('Integer')
1314
+ }),
1315
+ ]
1316
+ }),
1317
+ new Function__1["default"]({
1318
+ name: 'ListFilter',
1319
+ description: '筛选列表中符合条件的所有项,返回这些项构成的新的列表',
1320
+ params: [
1321
+ new Param__1["default"]({
1322
+ name: 'list'
1323
+ }),
1324
+ new Param__1["default"]({
1325
+ name: 'by',
1326
+ description: '(${0}) → Boolean',
1327
+ defaultExpression: new AnonymousFunction__1["default"]({
1328
+ params: [
1329
+ new Param__1["default"]({
1330
+ name: 'item',
1331
+ typeAnnotation: null
1332
+ }),
1333
+ ]
1334
+ })
1335
+ }),
1336
+ ],
1337
+ returns: [
1338
+ new Return__1["default"]({
1339
+ name: 'list',
1340
+ typeAnnotation: TypeAnnotation__1["default"].createGeneric('List', {
1341
+ typeArguments: [TypeAnnotation__1["default"].createTypeParam('T')]
1342
+ })
1343
+ }),
1344
+ ]
1345
+ }),
1346
+ new Function__1["default"]({
1347
+ name: 'ListReverse',
1348
+ description: '(修改原数据)将列表的所有项反向排列(例如第一项变为最后一项)',
1349
+ params: [
1350
+ new Param__1["default"]({
1351
+ name: 'list',
1352
+ typeAnnotation: TypeAnnotation__1["default"].createGeneric('List', {
1353
+ typeArguments: [TypeAnnotation__1["default"].createTypeParam('T')]
1354
+ })
1355
+ }),
1356
+ ],
1357
+ returns: []
1358
+ }),
1359
+ new Function__1["default"]({
1360
+ name: 'ListDistinct',
1361
+ description: '(修改原数据)为列表去除重复项',
1362
+ params: [
1363
+ new Param__1["default"]({
1364
+ name: 'list',
1365
+ typeAnnotation: TypeAnnotation__1["default"].createGeneric('List', {
1366
+ typeArguments: [TypeAnnotation__1["default"].createTypeParam('T')]
1367
+ })
1368
+ }),
1369
+ ],
1370
+ returns: []
1371
+ }),
1372
+ new Function__1["default"]({
1373
+ name: 'ListDistinctBy',
1374
+ description: '按某个属性为列表去除重复项。返回去除重复项后的列表',
1375
+ params: [
1376
+ new Param__1["default"]({
1377
+ name: 'list'
1378
+ }),
1379
+ new Param__1["default"]({
1380
+ name: 'by',
1381
+ description: '(${0}) → T',
1382
+ defaultExpression: new AnonymousFunction__1["default"]({
1383
+ params: [
1384
+ new Param__1["default"]({
1385
+ name: 'item',
1386
+ typeAnnotation: null
1387
+ }),
1388
+ ],
1389
+ body: new Identifier__1["default"]()
1390
+ })
1391
+ }),
1392
+ ],
1393
+ returns: [new Return__1["default"]({
1394
+ typeAnnotation: TypeAnnotation__1["default"].createGeneric('List', {
1395
+ typeArguments: [
1396
+ TypeAnnotation__1["default"].createTypeParam('T'),
1397
+ ]
1398
+ })
1399
+ })]
1400
+ }),
1401
+ new Function__1["default"]({
1402
+ name: 'ListGroupBy',
1403
+ description: '按某个属性为列表分组。以选中的属性为 key 建立 Map 并返回。',
1404
+ params: [
1405
+ new Param__1["default"]({
1406
+ name: 'list'
1407
+ }),
1408
+ new Param__1["default"]({
1409
+ name: 'by',
1410
+ description: '(${0}) → Boolean | Integer | Long | Decimal | String',
1411
+ defaultExpression: new AnonymousFunction__1["default"]({
1412
+ params: [
1413
+ new Param__1["default"]({
1414
+ name: 'item',
1415
+ typeAnnotation: null
1416
+ }),
1417
+ ],
1418
+ body: new Identifier__1["default"]()
1419
+ })
1420
+ }),
1421
+ ],
1422
+ returns: [new Return__1["default"]({
1423
+ typeAnnotation: TypeAnnotation__1["default"].createGeneric('map', {
1424
+ typeArguments: [
1425
+ TypeAnnotation__1["default"].createTypeParam('K'),
1426
+ TypeAnnotation__1["default"].createGeneric('List', {
1427
+ typeArguments: [TypeAnnotation__1["default"].createTypeParam('A')]
1428
+ }),
1429
+ ]
1430
+ })
1431
+ })]
1432
+ }),
1433
+ new Function__1["default"]({
1434
+ name: 'ListSlice',
1435
+ description: '将列表按照规则切片,返回切片后的子列表',
1436
+ params: [
1437
+ new Param__1["default"]({
1438
+ name: 'list',
1439
+ typeAnnotation: TypeAnnotation__1["default"].createGeneric('List', {
1440
+ typeArguments: [TypeAnnotation__1["default"].createTypeParam('T')]
1441
+ })
1442
+ }),
1443
+ new Param__1["default"]({
1444
+ name: 'start',
1445
+ typeAnnotation: TypeAnnotation__1["default"].createPrimitive('Integer')
1446
+ }),
1447
+ new Param__1["default"]({
1448
+ name: 'end',
1449
+ typeAnnotation: TypeAnnotation__1["default"].createPrimitive('Integer')
1450
+ }),
1451
+ ],
1452
+ returns: [
1453
+ new Return__1["default"]({
1454
+ typeAnnotation: TypeAnnotation__1["default"].createGeneric('List', {
1455
+ typeArguments: [TypeAnnotation__1["default"].createTypeParam('T')]
1456
+ })
1457
+ }),
1458
+ ]
1459
+ }),
1460
+ new Function__1["default"]({
1461
+ name: 'SliceToListPage',
1462
+ description: '将列表按照规则切片,返回切片后的列表分页',
1463
+ params: [
1464
+ new Param__1["default"]({
1465
+ name: 'list',
1466
+ typeAnnotation: TypeAnnotation__1["default"].createGeneric('List', {
1467
+ typeArguments: [TypeAnnotation__1["default"].createTypeParam('T')]
1468
+ })
1469
+ }),
1470
+ new Param__1["default"]({
1471
+ name: 'page',
1472
+ typeAnnotation: TypeAnnotation__1["default"].createPrimitive('Integer')
1473
+ }),
1474
+ new Param__1["default"]({
1475
+ name: 'size',
1476
+ typeAnnotation: TypeAnnotation__1["default"].createPrimitive('Integer')
1477
+ }),
1478
+ ],
1479
+ returns: [
1480
+ new Return__1["default"]({
1481
+ typeAnnotation: TypeAnnotation__1["default"].createGeneric('PageOf', {
1482
+ typeArguments: [TypeAnnotation__1["default"].createTypeParam('T')]
1483
+ })
1484
+ }),
1485
+ ]
1486
+ }),
1487
+ new Function__1["default"]({
1488
+ name: 'New',
1489
+ description: '根据参数选择的类型,返回该参数的实例化对象',
1490
+ typeParams: [
1491
+ new TypeParam__1["default"]({
1492
+ name: 'T'
1493
+ }),
1494
+ ],
1495
+ params: [],
1496
+ returns: [
1497
+ new Return__1["default"]({
1498
+ typeAnnotation: TypeAnnotation__1["default"].createTypeParam('T')
1499
+ }),
1500
+ ]
1501
+ }),
1502
+ ]
1503
+ });