@lcap/nasl 3.12.1-rc.1 → 3.12.1-rc.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.
@@ -23,9 +23,10 @@ var __importStar = (this && this.__importStar) || function (mod) {
23
23
  return result;
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.genReleaseBodyForParallel = exports.genReleaseBody = exports.checkIfSkipAnnotation = exports.getFrontendBundleFiles = exports.getNaslAnnotatedJSON = exports.replaceAssets = exports.replaceFrontendAssets = exports.replaceFrontendTypesAssets = void 0;
26
+ exports.genReleaseBodyForParallel = exports.genReleaseBody = exports.checkIfSkipAnnotation = exports.getFrontendBundleFiles = exports.getNaslAnnotatedJSONFile = exports.addEntityToNaslAnnotatedJSON = exports.getNaslAnnotatedJSON = exports.replaceAssets = exports.replaceFrontendAssets = exports.replaceFrontendTypesAssets = void 0;
27
27
  const concepts_1 = require("../../concepts");
28
28
  const genBundleFiles_1 = require("../genBundleFiles");
29
+ const is_view_logic_1 = require("../../service/instruct-ruler/rules/is-view-logic");
29
30
  const utils_1 = require("./utils");
30
31
  const permission_1 = require("../permission");
31
32
  const validation_1 = require("./validation");
@@ -81,7 +82,7 @@ function replaceAssets(app, json, opt) {
81
82
  if (opt?.ignoreFiles && Array.isArray(assets) && assets.length) {
82
83
  const assetsMap = opt.assetsMap;
83
84
  // 正则
84
- const regex = utils.transAssetsToRegx(assets, 'fileUrl');
85
+ const regex = utils.MediaURLOrPathRegex;
85
86
  replaceFrontendTypesAssets(json.frontendTypes, (node, key, url) => {
86
87
  if (['staticStyle'].includes(key)) {
87
88
  node[key] = url.replace(regex, (url) => {
@@ -154,395 +155,6 @@ async function getNaslAnnotatedJSON(app, opt, skipAnn = false) {
154
155
  NaslAnnotatedJSON = skipAnn ?
155
156
  await app.naslServer.fastGetNaslAnnotatedJSON(app) :
156
157
  await app.naslServer.getNaslAnnotatedJSON(app, true);
157
- // 暂时发布的时候加一个实体
158
- // 为了服务端发布,使用文件系统,标注的nasl 强制增加一个
159
- // 服务端承诺 10月份回挪走, @钟春燕 @杨剑飞
160
- if (Object.keys(opt?.validations?.downloadFileTasks || {}).length) {
161
- const defaultDS = NaslAnnotatedJSON.dataSources.find((item) => item.name === 'defaultDS');
162
- const tableName = 'lcap_async_task_' + (app.id || '').slice(0, 6);
163
- defaultDS.entities.push({
164
- "concept": "Entity",
165
- "name": "LCAPAsyncTask",
166
- "uuid": "fe2cef1efd9c4189951b1f0bb6eacf11",
167
- "tableName": tableName,
168
- "description": null,
169
- "origin": "ide",
170
- "composedBy": null,
171
- "properties": [
172
- {
173
- "concept": "EntityProperty",
174
- "name": "id",
175
- "uuid": "af657c05c1e545769887cfd2104257bb",
176
- "columnName": "id",
177
- "label": "主键",
178
- "description": "主键",
179
- "required": true,
180
- "primaryKey": true,
181
- "relationNamespace": null,
182
- "relationEntity": null,
183
- "relationProperty": null,
184
- "deleteRule": null,
185
- "display": {
186
- "inTable": false,
187
- "inFilter": false,
188
- "inForm": false,
189
- "inDetail": false
190
- },
191
- "rules": [],
192
- "generationRule": "auto",
193
- "sequence": "Entity11299220825",
194
- "composedBy": null,
195
- "typeAnnotation": {
196
- "concept": "TypeAnnotation",
197
- "typeKind": "primitive",
198
- "typeNamespace": "nasl.core",
199
- "typeName": "Long"
200
- },
201
- "databaseTypeAnnotation": null,
202
- "defaultValue": null
203
- },
204
- {
205
- "concept": "EntityProperty",
206
- "name": "task_id",
207
- "uuid": "1ee6f95909b34416bc091775766e9733",
208
- "columnName": "task_id",
209
- "label": "任务id",
210
- "description": null,
211
- "required": true,
212
- "primaryKey": false,
213
- "relationNamespace": null,
214
- "relationEntity": null,
215
- "relationProperty": null,
216
- "deleteRule": null,
217
- "display": {
218
- "inTable": true,
219
- "inFilter": true,
220
- "inForm": true,
221
- "inDetail": true
222
- },
223
- "rules": [],
224
- "generationRule": "manual",
225
- "sequence": null,
226
- "composedBy": null,
227
- "typeAnnotation": {
228
- "concept": "TypeAnnotation",
229
- "typeKind": "primitive",
230
- "typeNamespace": "nasl.core",
231
- "typeName": "String"
232
- },
233
- "databaseTypeAnnotation": null,
234
- "defaultValue": null
235
- },
236
- {
237
- "concept": "EntityProperty",
238
- "name": "task_status",
239
- "uuid": "4b11c717968d43e7a5dccb329d444cc1",
240
- "columnName": "task_status",
241
- "label": "任务状态",
242
- "description": null,
243
- "required": true,
244
- "primaryKey": false,
245
- "relationNamespace": null,
246
- "relationEntity": null,
247
- "relationProperty": null,
248
- "deleteRule": null,
249
- "display": {
250
- "inTable": true,
251
- "inFilter": true,
252
- "inForm": true,
253
- "inDetail": true
254
- },
255
- "rules": [],
256
- "generationRule": "manual",
257
- "sequence": null,
258
- "composedBy": null,
259
- "typeAnnotation": {
260
- "concept": "TypeAnnotation",
261
- "typeKind": "primitive",
262
- "typeNamespace": "nasl.core",
263
- "typeName": "String"
264
- },
265
- "databaseTypeAnnotation": null,
266
- "defaultValue": null
267
- },
268
- {
269
- "concept": "EntityProperty",
270
- "name": "task_name",
271
- "uuid": "e069c6541835457483a37df8c0cdafc0",
272
- "columnName": "task_name",
273
- "label": "任务名称",
274
- "description": null,
275
- "required": true,
276
- "primaryKey": false,
277
- "relationNamespace": null,
278
- "relationEntity": null,
279
- "relationProperty": null,
280
- "deleteRule": null,
281
- "display": {
282
- "inTable": true,
283
- "inFilter": true,
284
- "inForm": true,
285
- "inDetail": true
286
- },
287
- "rules": [],
288
- "generationRule": "manual",
289
- "sequence": null,
290
- "composedBy": null,
291
- "typeAnnotation": {
292
- "concept": "TypeAnnotation",
293
- "typeKind": "primitive",
294
- "typeNamespace": "nasl.core",
295
- "typeName": "String"
296
- },
297
- "databaseTypeAnnotation": null,
298
- "defaultValue": null
299
- },
300
- {
301
- "concept": "EntityProperty",
302
- "name": "result",
303
- "uuid": "6a6a3b70e5d04831a1da89e6d72b445c",
304
- "columnName": "result",
305
- "label": "任务结果",
306
- "description": null,
307
- "required": false,
308
- "primaryKey": false,
309
- "relationNamespace": null,
310
- "relationEntity": null,
311
- "relationProperty": null,
312
- "deleteRule": null,
313
- "display": {
314
- "inTable": true,
315
- "inFilter": true,
316
- "inForm": true,
317
- "inDetail": true
318
- },
319
- "rules": [
320
- "maxLength(16777215)"
321
- ],
322
- "generationRule": "manual",
323
- "sequence": null,
324
- "composedBy": null,
325
- "typeAnnotation": {
326
- "concept": "TypeAnnotation",
327
- "typeKind": "primitive",
328
- "typeNamespace": "nasl.core",
329
- "typeName": "String"
330
- },
331
- "databaseTypeAnnotation": null,
332
- "defaultValue": null
333
- },
334
- {
335
- "concept": "EntityProperty",
336
- "name": "error_msg",
337
- "uuid": "7c1c143003784277882b044aa88224d9",
338
- "columnName": "error_msg",
339
- "label": "任务异常信息",
340
- "description": null,
341
- "required": false,
342
- "primaryKey": false,
343
- "relationNamespace": null,
344
- "relationEntity": null,
345
- "relationProperty": null,
346
- "deleteRule": null,
347
- "display": {
348
- "inTable": true,
349
- "inFilter": true,
350
- "inForm": true,
351
- "inDetail": true
352
- },
353
- "rules": [
354
- "maxLength(16777215)"
355
- ],
356
- "generationRule": "manual",
357
- "sequence": null,
358
- "composedBy": null,
359
- "typeAnnotation": {
360
- "concept": "TypeAnnotation",
361
- "typeKind": "primitive",
362
- "typeNamespace": "nasl.core",
363
- "typeName": "String"
364
- },
365
- "databaseTypeAnnotation": null,
366
- "defaultValue": null
367
- },
368
- {
369
- "concept": "EntityProperty",
370
- "name": "job_parameters",
371
- "uuid": "82f83a95684642568701562d9d91571c",
372
- "columnName": "job_parameters",
373
- "label": "任务参数",
374
- "description": null,
375
- "required": false,
376
- "primaryKey": false,
377
- "relationNamespace": null,
378
- "relationEntity": null,
379
- "relationProperty": null,
380
- "deleteRule": null,
381
- "display": {
382
- "inTable": true,
383
- "inFilter": true,
384
- "inForm": true,
385
- "inDetail": true
386
- },
387
- "rules": [
388
- "maxLength(16777215)"
389
- ],
390
- "generationRule": "manual",
391
- "sequence": null,
392
- "composedBy": null,
393
- "typeAnnotation": {
394
- "concept": "TypeAnnotation",
395
- "typeKind": "primitive",
396
- "typeNamespace": "nasl.core",
397
- "typeName": "String"
398
- },
399
- "databaseTypeAnnotation": null,
400
- "defaultValue": null
401
- },
402
- {
403
- "concept": "EntityProperty",
404
- "name": "file_plugin_code",
405
- "uuid": "f05f15779bd84edb8f358ef8483acc23",
406
- "columnName": "file_plugin_code",
407
- "label": "文件插件唯一标识",
408
- "description": "文件插件唯一标识",
409
- "required": false,
410
- "primaryKey": false,
411
- "relationNamespace": null,
412
- "relationEntity": null,
413
- "relationProperty": null,
414
- "deleteRule": null,
415
- "display": {
416
- "inTable": true,
417
- "inFilter": true,
418
- "inForm": true,
419
- "inDetail": true
420
- },
421
- "rules": [],
422
- "generationRule": "manual",
423
- "sequence": null,
424
- "composedBy": null,
425
- "typeAnnotation": {
426
- "concept": "TypeAnnotation",
427
- "typeKind": "primitive",
428
- "typeNamespace": "nasl.core",
429
- "typeName": "String"
430
- },
431
- "databaseTypeAnnotation": null,
432
- "defaultValue": null
433
- },
434
- {
435
- "concept": "EntityProperty",
436
- "name": "file_type",
437
- "uuid": "79355d76950a48609b123417e08f85bc",
438
- "columnName": "file_type",
439
- "label": "需要生成的文件类型",
440
- "description": null,
441
- "required": false,
442
- "primaryKey": false,
443
- "relationNamespace": null,
444
- "relationEntity": null,
445
- "relationProperty": null,
446
- "deleteRule": null,
447
- "display": {
448
- "inTable": true,
449
- "inFilter": true,
450
- "inForm": true,
451
- "inDetail": true
452
- },
453
- "rules": [],
454
- "generationRule": "manual",
455
- "sequence": null,
456
- "composedBy": null,
457
- "typeAnnotation": {
458
- "concept": "TypeAnnotation",
459
- "typeKind": "primitive",
460
- "typeNamespace": "nasl.core",
461
- "typeName": "String"
462
- },
463
- "databaseTypeAnnotation": null,
464
- "defaultValue": null
465
- },
466
- {
467
- "concept": "EntityProperty",
468
- "name": "createdTime",
469
- "uuid": "273fa6230d8b4c068b57a76f7b08bdfa",
470
- "columnName": "created_time",
471
- "label": "创建时间",
472
- "description": "创建时间",
473
- "required": false,
474
- "primaryKey": false,
475
- "relationNamespace": null,
476
- "relationEntity": null,
477
- "relationProperty": null,
478
- "deleteRule": null,
479
- "display": {
480
- "inTable": true,
481
- "inFilter": false,
482
- "inForm": false,
483
- "inDetail": false
484
- },
485
- "rules": [],
486
- "generationRule": "auto",
487
- "sequence": null,
488
- "composedBy": null,
489
- "typeAnnotation": {
490
- "concept": "TypeAnnotation",
491
- "typeKind": "primitive",
492
- "typeNamespace": "nasl.core",
493
- "typeName": "DateTime"
494
- },
495
- "databaseTypeAnnotation": null,
496
- "defaultValue": null
497
- },
498
- {
499
- "concept": "EntityProperty",
500
- "name": "updatedTime",
501
- "uuid": "7d2ec9616309424fbd37830b1e8f1a9d",
502
- "columnName": "updated_time",
503
- "label": "更新时间",
504
- "description": "更新时间",
505
- "required": false,
506
- "primaryKey": false,
507
- "relationNamespace": null,
508
- "relationEntity": null,
509
- "relationProperty": null,
510
- "deleteRule": null,
511
- "display": {
512
- "inTable": true,
513
- "inFilter": false,
514
- "inForm": false,
515
- "inDetail": false
516
- },
517
- "rules": [],
518
- "generationRule": "auto",
519
- "sequence": null,
520
- "composedBy": null,
521
- "typeAnnotation": {
522
- "concept": "TypeAnnotation",
523
- "typeKind": "primitive",
524
- "typeNamespace": "nasl.core",
525
- "typeName": "DateTime"
526
- },
527
- "databaseTypeAnnotation": null,
528
- "defaultValue": null
529
- }
530
- ],
531
- "indexes": [
532
- {
533
- "concept": "EntityIndex",
534
- "name": "uni_task_id",
535
- "indexName": null,
536
- "propertyNames": [
537
- "task_id"
538
- ],
539
- "unique": true,
540
- "description": null
541
- }
542
- ],
543
- "applyAnnotations": null
544
- });
545
- }
546
158
  await opt?.logPublishFunc?.('语言', '获取全量类型标注成功');
547
159
  // 打印传给服务端的 nasl,为了服务端排查问题方便
548
160
  if (utils.isDebugMode) {
@@ -559,6 +171,398 @@ async function getNaslAnnotatedJSON(app, opt, skipAnn = false) {
559
171
  return NaslAnnotatedJSON;
560
172
  }
561
173
  exports.getNaslAnnotatedJSON = getNaslAnnotatedJSON;
174
+ // 暂时发布的时候加一个实体
175
+ // 为了服务端发布,使用文件系统,标注的nasl 强制增加一个
176
+ // 服务端承诺 10月份回挪走, @钟春燕 @杨剑飞
177
+ function addEntityToNaslAnnotatedJSON(app, NaslAnnotatedJSON, validations) {
178
+ if (Object.keys(validations?.downloadFileTasks || {}).length) {
179
+ const defaultDS = NaslAnnotatedJSON.dataSources.find((item) => item.name === 'defaultDS');
180
+ const tableName = 'lcap_async_task_' + (app.id || '').slice(0, 6);
181
+ defaultDS.entities.push({
182
+ "concept": "Entity",
183
+ "name": "LCAPAsyncTask",
184
+ "uuid": "fe2cef1efd9c4189951b1f0bb6eacf11",
185
+ "tableName": tableName,
186
+ "description": null,
187
+ "origin": "ide",
188
+ "composedBy": null,
189
+ "properties": [
190
+ {
191
+ "concept": "EntityProperty",
192
+ "name": "id",
193
+ "uuid": "af657c05c1e545769887cfd2104257bb",
194
+ "columnName": "id",
195
+ "label": "主键",
196
+ "description": "主键",
197
+ "required": true,
198
+ "primaryKey": true,
199
+ "relationNamespace": null,
200
+ "relationEntity": null,
201
+ "relationProperty": null,
202
+ "deleteRule": null,
203
+ "display": {
204
+ "inTable": false,
205
+ "inFilter": false,
206
+ "inForm": false,
207
+ "inDetail": false
208
+ },
209
+ "rules": [],
210
+ "generationRule": "auto",
211
+ "sequence": "Entity11299220825",
212
+ "composedBy": null,
213
+ "typeAnnotation": {
214
+ "concept": "TypeAnnotation",
215
+ "typeKind": "primitive",
216
+ "typeNamespace": "nasl.core",
217
+ "typeName": "Long"
218
+ },
219
+ "databaseTypeAnnotation": null,
220
+ "defaultValue": null
221
+ },
222
+ {
223
+ "concept": "EntityProperty",
224
+ "name": "task_id",
225
+ "uuid": "1ee6f95909b34416bc091775766e9733",
226
+ "columnName": "task_id",
227
+ "label": "任务id",
228
+ "description": null,
229
+ "required": true,
230
+ "primaryKey": false,
231
+ "relationNamespace": null,
232
+ "relationEntity": null,
233
+ "relationProperty": null,
234
+ "deleteRule": null,
235
+ "display": {
236
+ "inTable": true,
237
+ "inFilter": true,
238
+ "inForm": true,
239
+ "inDetail": true
240
+ },
241
+ "rules": [],
242
+ "generationRule": "manual",
243
+ "sequence": null,
244
+ "composedBy": null,
245
+ "typeAnnotation": {
246
+ "concept": "TypeAnnotation",
247
+ "typeKind": "primitive",
248
+ "typeNamespace": "nasl.core",
249
+ "typeName": "String"
250
+ },
251
+ "databaseTypeAnnotation": null,
252
+ "defaultValue": null
253
+ },
254
+ {
255
+ "concept": "EntityProperty",
256
+ "name": "task_status",
257
+ "uuid": "4b11c717968d43e7a5dccb329d444cc1",
258
+ "columnName": "task_status",
259
+ "label": "任务状态",
260
+ "description": null,
261
+ "required": true,
262
+ "primaryKey": false,
263
+ "relationNamespace": null,
264
+ "relationEntity": null,
265
+ "relationProperty": null,
266
+ "deleteRule": null,
267
+ "display": {
268
+ "inTable": true,
269
+ "inFilter": true,
270
+ "inForm": true,
271
+ "inDetail": true
272
+ },
273
+ "rules": [],
274
+ "generationRule": "manual",
275
+ "sequence": null,
276
+ "composedBy": null,
277
+ "typeAnnotation": {
278
+ "concept": "TypeAnnotation",
279
+ "typeKind": "primitive",
280
+ "typeNamespace": "nasl.core",
281
+ "typeName": "String"
282
+ },
283
+ "databaseTypeAnnotation": null,
284
+ "defaultValue": null
285
+ },
286
+ {
287
+ "concept": "EntityProperty",
288
+ "name": "task_name",
289
+ "uuid": "e069c6541835457483a37df8c0cdafc0",
290
+ "columnName": "task_name",
291
+ "label": "任务名称",
292
+ "description": null,
293
+ "required": true,
294
+ "primaryKey": false,
295
+ "relationNamespace": null,
296
+ "relationEntity": null,
297
+ "relationProperty": null,
298
+ "deleteRule": null,
299
+ "display": {
300
+ "inTable": true,
301
+ "inFilter": true,
302
+ "inForm": true,
303
+ "inDetail": true
304
+ },
305
+ "rules": [],
306
+ "generationRule": "manual",
307
+ "sequence": null,
308
+ "composedBy": null,
309
+ "typeAnnotation": {
310
+ "concept": "TypeAnnotation",
311
+ "typeKind": "primitive",
312
+ "typeNamespace": "nasl.core",
313
+ "typeName": "String"
314
+ },
315
+ "databaseTypeAnnotation": null,
316
+ "defaultValue": null
317
+ },
318
+ {
319
+ "concept": "EntityProperty",
320
+ "name": "result",
321
+ "uuid": "6a6a3b70e5d04831a1da89e6d72b445c",
322
+ "columnName": "result",
323
+ "label": "任务结果",
324
+ "description": null,
325
+ "required": false,
326
+ "primaryKey": false,
327
+ "relationNamespace": null,
328
+ "relationEntity": null,
329
+ "relationProperty": null,
330
+ "deleteRule": null,
331
+ "display": {
332
+ "inTable": true,
333
+ "inFilter": true,
334
+ "inForm": true,
335
+ "inDetail": true
336
+ },
337
+ "rules": [
338
+ "maxLength(16777215)"
339
+ ],
340
+ "generationRule": "manual",
341
+ "sequence": null,
342
+ "composedBy": null,
343
+ "typeAnnotation": {
344
+ "concept": "TypeAnnotation",
345
+ "typeKind": "primitive",
346
+ "typeNamespace": "nasl.core",
347
+ "typeName": "String"
348
+ },
349
+ "databaseTypeAnnotation": null,
350
+ "defaultValue": null
351
+ },
352
+ {
353
+ "concept": "EntityProperty",
354
+ "name": "error_msg",
355
+ "uuid": "7c1c143003784277882b044aa88224d9",
356
+ "columnName": "error_msg",
357
+ "label": "任务异常信息",
358
+ "description": null,
359
+ "required": false,
360
+ "primaryKey": false,
361
+ "relationNamespace": null,
362
+ "relationEntity": null,
363
+ "relationProperty": null,
364
+ "deleteRule": null,
365
+ "display": {
366
+ "inTable": true,
367
+ "inFilter": true,
368
+ "inForm": true,
369
+ "inDetail": true
370
+ },
371
+ "rules": [
372
+ "maxLength(16777215)"
373
+ ],
374
+ "generationRule": "manual",
375
+ "sequence": null,
376
+ "composedBy": null,
377
+ "typeAnnotation": {
378
+ "concept": "TypeAnnotation",
379
+ "typeKind": "primitive",
380
+ "typeNamespace": "nasl.core",
381
+ "typeName": "String"
382
+ },
383
+ "databaseTypeAnnotation": null,
384
+ "defaultValue": null
385
+ },
386
+ {
387
+ "concept": "EntityProperty",
388
+ "name": "job_parameters",
389
+ "uuid": "82f83a95684642568701562d9d91571c",
390
+ "columnName": "job_parameters",
391
+ "label": "任务参数",
392
+ "description": null,
393
+ "required": false,
394
+ "primaryKey": false,
395
+ "relationNamespace": null,
396
+ "relationEntity": null,
397
+ "relationProperty": null,
398
+ "deleteRule": null,
399
+ "display": {
400
+ "inTable": true,
401
+ "inFilter": true,
402
+ "inForm": true,
403
+ "inDetail": true
404
+ },
405
+ "rules": [
406
+ "maxLength(16777215)"
407
+ ],
408
+ "generationRule": "manual",
409
+ "sequence": null,
410
+ "composedBy": null,
411
+ "typeAnnotation": {
412
+ "concept": "TypeAnnotation",
413
+ "typeKind": "primitive",
414
+ "typeNamespace": "nasl.core",
415
+ "typeName": "String"
416
+ },
417
+ "databaseTypeAnnotation": null,
418
+ "defaultValue": null
419
+ },
420
+ {
421
+ "concept": "EntityProperty",
422
+ "name": "file_plugin_code",
423
+ "uuid": "f05f15779bd84edb8f358ef8483acc23",
424
+ "columnName": "file_plugin_code",
425
+ "label": "文件插件唯一标识",
426
+ "description": "文件插件唯一标识",
427
+ "required": false,
428
+ "primaryKey": false,
429
+ "relationNamespace": null,
430
+ "relationEntity": null,
431
+ "relationProperty": null,
432
+ "deleteRule": null,
433
+ "display": {
434
+ "inTable": true,
435
+ "inFilter": true,
436
+ "inForm": true,
437
+ "inDetail": true
438
+ },
439
+ "rules": [],
440
+ "generationRule": "manual",
441
+ "sequence": null,
442
+ "composedBy": null,
443
+ "typeAnnotation": {
444
+ "concept": "TypeAnnotation",
445
+ "typeKind": "primitive",
446
+ "typeNamespace": "nasl.core",
447
+ "typeName": "String"
448
+ },
449
+ "databaseTypeAnnotation": null,
450
+ "defaultValue": null
451
+ },
452
+ {
453
+ "concept": "EntityProperty",
454
+ "name": "file_type",
455
+ "uuid": "79355d76950a48609b123417e08f85bc",
456
+ "columnName": "file_type",
457
+ "label": "需要生成的文件类型",
458
+ "description": null,
459
+ "required": false,
460
+ "primaryKey": false,
461
+ "relationNamespace": null,
462
+ "relationEntity": null,
463
+ "relationProperty": null,
464
+ "deleteRule": null,
465
+ "display": {
466
+ "inTable": true,
467
+ "inFilter": true,
468
+ "inForm": true,
469
+ "inDetail": true
470
+ },
471
+ "rules": [],
472
+ "generationRule": "manual",
473
+ "sequence": null,
474
+ "composedBy": null,
475
+ "typeAnnotation": {
476
+ "concept": "TypeAnnotation",
477
+ "typeKind": "primitive",
478
+ "typeNamespace": "nasl.core",
479
+ "typeName": "String"
480
+ },
481
+ "databaseTypeAnnotation": null,
482
+ "defaultValue": null
483
+ },
484
+ {
485
+ "concept": "EntityProperty",
486
+ "name": "createdTime",
487
+ "uuid": "273fa6230d8b4c068b57a76f7b08bdfa",
488
+ "columnName": "created_time",
489
+ "label": "创建时间",
490
+ "description": "创建时间",
491
+ "required": false,
492
+ "primaryKey": false,
493
+ "relationNamespace": null,
494
+ "relationEntity": null,
495
+ "relationProperty": null,
496
+ "deleteRule": null,
497
+ "display": {
498
+ "inTable": true,
499
+ "inFilter": false,
500
+ "inForm": false,
501
+ "inDetail": false
502
+ },
503
+ "rules": [],
504
+ "generationRule": "auto",
505
+ "sequence": null,
506
+ "composedBy": null,
507
+ "typeAnnotation": {
508
+ "concept": "TypeAnnotation",
509
+ "typeKind": "primitive",
510
+ "typeNamespace": "nasl.core",
511
+ "typeName": "DateTime"
512
+ },
513
+ "databaseTypeAnnotation": null,
514
+ "defaultValue": null
515
+ },
516
+ {
517
+ "concept": "EntityProperty",
518
+ "name": "updatedTime",
519
+ "uuid": "7d2ec9616309424fbd37830b1e8f1a9d",
520
+ "columnName": "updated_time",
521
+ "label": "更新时间",
522
+ "description": "更新时间",
523
+ "required": false,
524
+ "primaryKey": false,
525
+ "relationNamespace": null,
526
+ "relationEntity": null,
527
+ "relationProperty": null,
528
+ "deleteRule": null,
529
+ "display": {
530
+ "inTable": true,
531
+ "inFilter": false,
532
+ "inForm": false,
533
+ "inDetail": false
534
+ },
535
+ "rules": [],
536
+ "generationRule": "auto",
537
+ "sequence": null,
538
+ "composedBy": null,
539
+ "typeAnnotation": {
540
+ "concept": "TypeAnnotation",
541
+ "typeKind": "primitive",
542
+ "typeNamespace": "nasl.core",
543
+ "typeName": "DateTime"
544
+ },
545
+ "databaseTypeAnnotation": null,
546
+ "defaultValue": null
547
+ }
548
+ ],
549
+ "indexes": [
550
+ {
551
+ "concept": "EntityIndex",
552
+ "name": "uni_task_id",
553
+ "indexName": null,
554
+ "propertyNames": [
555
+ "task_id"
556
+ ],
557
+ "unique": true,
558
+ "description": null
559
+ }
560
+ ],
561
+ "applyAnnotations": null
562
+ });
563
+ }
564
+ }
565
+ exports.addEntityToNaslAnnotatedJSON = addEntityToNaslAnnotatedJSON;
562
566
  /**
563
567
  * 获取全量标注文件
564
568
  * @description 数据将会被 stringify
@@ -569,6 +573,7 @@ async function getNaslAnnotatedJSONFile(app, opt, skipAnn = false) {
569
573
  content: JSON.stringify(await getNaslAnnotatedJSON(app, opt, skipAnn)),
570
574
  };
571
575
  }
576
+ exports.getNaslAnnotatedJSONFile = getNaslAnnotatedJSONFile;
572
577
  async function getFrontendBundleFiles(app, opt) {
573
578
  let files = [];
574
579
  const config = {
@@ -598,6 +603,8 @@ async function mergeBodyData(app, opt) {
598
603
  const authReport = (0, utils_1.getAuthReport)(app, opt.frontends);
599
604
  await opt.logPublishFunc?.('权限', '分析权限数据成功!');
600
605
  const logicPageResourceDtoList = (0, permission_1.genPermissionData)(app);
606
+ // 缓存应用权限数据
607
+ await (0, is_view_logic_1.cachePermission)(app, logicPageResourceDtoList);
601
608
  // 与老板逻辑权限数据对比
602
609
  // await testWithOldPermissionResult(app, logicPageResourceDtoList);
603
610
  const allFrontends = (0, utils_1.getFrontendByTypes)(app?.frontendTypes);
@@ -687,20 +694,10 @@ async function genReleaseBody(app, opt) {
687
694
  console.timeEnd('mergeBodyData');
688
695
  const callLogicValidations = await (0, validation_1.getCallLogicData)(app, opt.validations?.validationRules);
689
696
  console.timeEnd('--backend--');
690
- // @ts-ignore
691
- const skipAnn = checkIfSkipAnnotation(app.__v_raw ?? app, opt?.env, opt?.skipPreviewAnnotation);
692
- skipAnn && console.warn('%c 已跳过类型标注,有问题咨询 Zirun,之后会在 preference 里加开关,并在服务端落库记录', 'background: #222; color: #bada55');
693
- skipAnn && console.log('%c 已跳过类型标注,有问题咨询 Zirun,之后会在 preference 里加开关,并在服务端落库记录', 'background: #222; color: #bada55');
694
- console.time('getNaslAnnotatedJSON');
695
- const annotationFile = opt.isIncremental ? undefined : await getNaslAnnotatedJSONFile(app, opt, skipAnn);
696
- console.timeEnd('getNaslAnnotatedJSON');
697
697
  console.time('getFrontendBundleFiles');
698
698
  const files = (opt.ignoreFiles || opt.isIncremental) ? [] : await getFrontendBundleFiles(app, opt);
699
699
  await utils.delay(100);
700
700
  console.timeEnd('getFrontendBundleFiles');
701
- if (annotationFile) {
702
- files.push(annotationFile);
703
- }
704
701
  // 增量发布需要组合生成器上下文数据
705
702
  if (opt.isIncremental) {
706
703
  body.generatorConfig = (0, utils_1.encodeBundleFileGeneratorConfig)({