@lcap/nasl 2.22.1 → 2.22.2

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 (116) hide show
  1. package/out/breakpoint/generator/AfterStartNode.d.ts +7 -0
  2. package/out/breakpoint/generator/AfterStartNode.js +27 -0
  3. package/out/breakpoint/generator/AfterStartNode.js.map +1 -0
  4. package/out/breakpoint/generator/BeforeEndNode.d.ts +7 -0
  5. package/out/breakpoint/generator/BeforeEndNode.js +27 -0
  6. package/out/breakpoint/generator/BeforeEndNode.js.map +1 -0
  7. package/out/breakpoint/generator/BreakpointNode.d.ts +14 -0
  8. package/out/breakpoint/generator/BreakpointNode.js +200 -0
  9. package/out/breakpoint/generator/BreakpointNode.js.map +1 -0
  10. package/out/breakpoint/generator/index.d.ts +4 -0
  11. package/out/breakpoint/generator/index.js +98 -0
  12. package/out/breakpoint/generator/index.js.map +1 -0
  13. package/out/breakpoint/index.d.ts +3 -0
  14. package/out/breakpoint/index.js +20 -0
  15. package/out/breakpoint/index.js.map +1 -0
  16. package/out/breakpoint/shared/constants.d.ts +31 -0
  17. package/out/breakpoint/shared/constants.js +89 -0
  18. package/out/breakpoint/shared/constants.js.map +1 -0
  19. package/out/breakpoint/shared/index.d.ts +3 -0
  20. package/out/breakpoint/shared/index.js +33 -0
  21. package/out/breakpoint/shared/index.js.map +1 -0
  22. package/out/breakpoint/shared/operations.d.ts +10 -0
  23. package/out/breakpoint/shared/operations.js +25 -0
  24. package/out/breakpoint/shared/operations.js.map +1 -0
  25. package/out/breakpoint/shared/socket.d.ts +47 -0
  26. package/out/breakpoint/shared/socket.js +210 -0
  27. package/out/breakpoint/shared/socket.js.map +1 -0
  28. package/out/breakpoint/shared/utils.d.ts +23 -0
  29. package/out/breakpoint/shared/utils.js +165 -0
  30. package/out/breakpoint/shared/utils.js.map +1 -0
  31. package/out/breakpoint/store/core.d.ts +32 -0
  32. package/out/breakpoint/store/core.js +388 -0
  33. package/out/breakpoint/store/core.js.map +1 -0
  34. package/out/breakpoint/store/dock.d.ts +1 -0
  35. package/out/breakpoint/store/dock.js +127 -0
  36. package/out/breakpoint/store/dock.js.map +1 -0
  37. package/out/breakpoint/store/index.d.ts +2 -0
  38. package/out/breakpoint/store/index.js +19 -0
  39. package/out/breakpoint/store/index.js.map +1 -0
  40. package/out/common/asyncFuncMap.d.ts +2 -0
  41. package/out/common/asyncFuncMap.js +16 -0
  42. package/out/common/asyncFuncMap.js.map +1 -0
  43. package/out/concepts/AnonymousFunction__.js +1 -1
  44. package/out/concepts/AnonymousFunction__.js.map +1 -1
  45. package/out/concepts/AuthInterface__.d.ts +37 -0
  46. package/out/concepts/AuthInterface__.js +141 -0
  47. package/out/concepts/AuthInterface__.js.map +1 -0
  48. package/out/concepts/AuthLogicForCallInterface__.d.ts +138 -0
  49. package/out/concepts/AuthLogicForCallInterface__.js +493 -0
  50. package/out/concepts/AuthLogicForCallInterface__.js.map +1 -0
  51. package/out/concepts/AuthLogic__.d.ts +66 -0
  52. package/out/concepts/AuthLogic__.js +206 -0
  53. package/out/concepts/AuthLogic__.js.map +1 -0
  54. package/out/concepts/BackendVariable__.d.ts +137 -0
  55. package/out/concepts/BackendVariable__.js +422 -0
  56. package/out/concepts/BackendVariable__.js.map +1 -0
  57. package/out/concepts/Backend__.d.ts +134 -0
  58. package/out/concepts/Backend__.js +274 -0
  59. package/out/concepts/Backend__.js.map +1 -0
  60. package/out/concepts/CallAuthInterface__.d.ts +126 -0
  61. package/out/concepts/CallAuthInterface__.js +408 -0
  62. package/out/concepts/CallAuthInterface__.js.map +1 -0
  63. package/out/concepts/Destination__.js +6 -4
  64. package/out/concepts/Destination__.js.map +1 -1
  65. package/out/concepts/FrontendVariable__.d.ts +21 -0
  66. package/out/concepts/FrontendVariable__.js +64 -0
  67. package/out/concepts/FrontendVariable__.js.map +1 -0
  68. package/out/concepts/Match__.js +25 -6
  69. package/out/concepts/Match__.js.map +1 -1
  70. package/out/concepts/OverriddenLogic__.d.ts +643 -0
  71. package/out/concepts/OverriddenLogic__.js +1602 -0
  72. package/out/concepts/OverriddenLogic__.js.map +1 -0
  73. package/out/concepts/Param__.js +1 -1
  74. package/out/concepts/Param__.js.map +1 -1
  75. package/out/concepts/basics/stdlib/nasl.http.d.ts +7 -0
  76. package/out/concepts/basics/stdlib/nasl.http.js +167 -0
  77. package/out/concepts/basics/stdlib/nasl.http.js.map +1 -0
  78. package/out/server/naslServer.js +4 -0
  79. package/out/server/naslServer.js.map +1 -1
  80. package/out/service/creator/errHandles.js +5 -0
  81. package/out/service/creator/errHandles.js.map +1 -1
  82. package/out/templator/genCreateBlock.js +2 -1
  83. package/out/templator/genCreateBlock.js.map +1 -1
  84. package/out/templator/genCurdEditMultipleKeyBlock.js +6 -3
  85. package/out/templator/genCurdEditMultipleKeyBlock.js.map +1 -1
  86. package/out/templator/genCurdMultipleKeyBlock.js +4 -2
  87. package/out/templator/genCurdMultipleKeyBlock.js.map +1 -1
  88. package/out/templator/genEditTableBlock.js +2 -1
  89. package/out/templator/genEditTableBlock.js.map +1 -1
  90. package/out/templator/genUpdateBlock.js +2 -1
  91. package/out/templator/genUpdateBlock.js.map +1 -1
  92. package/package.json +2 -2
  93. package/src/concepts/AnonymousFunction__.ts +1 -1
  94. package/src/concepts/Destination__.ts +7 -5
  95. package/src/concepts/Match__.ts +24 -6
  96. package/src/concepts/Param__.ts +1 -1
  97. package/src/concepts/dist/App__.js +2204 -0
  98. package/src/concepts/dist/CallLogic__.js +1149 -0
  99. package/src/concepts/dist/Destination__.js +756 -0
  100. package/src/concepts/dist/Logic__.js +1612 -0
  101. package/src/concepts/dist/Match__.js +768 -0
  102. package/src/concepts/dist/MsgTriggerEvent__.js +245 -0
  103. package/src/concepts/dist/OqlQueryComponent__.js +377 -0
  104. package/src/concepts/dist/Param__.js +1 -1
  105. package/src/generator/dist/genBundleFiles.js +15 -4
  106. package/src/generator/dist/genReleaseBody.js +501 -0
  107. package/src/server/dist/naslServer.js +25 -6
  108. package/src/server/naslServer.ts +4 -0
  109. package/src/service/creator/errHandles.js +8 -3
  110. package/src/service/storage/dist/init.js +34 -32
  111. package/src/templator/genCreateBlock.ts +2 -1
  112. package/src/templator/genCurdEditMultipleKeyBlock.ts +6 -3
  113. package/src/templator/genCurdMultipleKeyBlock.ts +4 -2
  114. package/src/templator/genEditTableBlock.ts +2 -1
  115. package/src/templator/genUpdateBlock.ts +2 -1
  116. package/test/examples/qzbusiness.json +1 -98265
@@ -0,0 +1,2204 @@
1
+ "use strict";
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
8
+ };
9
+ return function (d, b) {
10
+ extendStatics(d, b);
11
+ function __() { this.constructor = d; }
12
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
13
+ };
14
+ })();
15
+ var __assign = (this && this.__assign) || function () {
16
+ __assign = Object.assign || function(t) {
17
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
18
+ s = arguments[i];
19
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
20
+ t[p] = s[p];
21
+ }
22
+ return t;
23
+ };
24
+ return __assign.apply(this, arguments);
25
+ };
26
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
27
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
28
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
29
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
30
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
31
+ };
32
+ var __spreadArrays = (this && this.__spreadArrays) || function () {
33
+ for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
34
+ for (var r = Array(s), k = 0, i = 0; i < il; i++)
35
+ for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
36
+ r[k] = a[j];
37
+ return r;
38
+ };
39
+ exports.__esModule = true;
40
+ exports.App = void 0;
41
+ var jsoner_1 = require("../service/storage/jsoner");
42
+ var utils_1 = require("../automate/engine/utils");
43
+ var ConfigProperty__1 = require("./ConfigProperty__");
44
+ var decorators_1 = require("../decorators");
45
+ var utils = require("../utils");
46
+ var BaseNode_1 = require("../common/BaseNode");
47
+ var classMap_1 = require("../common/classMap");
48
+ var DataSource__1 = require("./DataSource__");
49
+ var Structure__1 = require("./Structure__");
50
+ var Enum__1 = require("./Enum__");
51
+ var Logic__1 = require("./Logic__");
52
+ var OverriddenLogic__1 = require("./OverriddenLogic__");
53
+ var Interface__1 = require("./Interface__");
54
+ var AuthInterface__1 = require("./AuthInterface__");
55
+ var Frontend__1 = require("./Frontend__");
56
+ var Backend__1 = require("./Backend__");
57
+ var Process__1 = require("./Process__");
58
+ var Role__1 = require("./Role__");
59
+ var Configuration__1 = require("./Configuration__");
60
+ var Module__1 = require("./Module__");
61
+ var Connector__1 = require("./Connector__");
62
+ var AuthLogic__1 = require("./AuthLogic__");
63
+ var AuthLogicForCallInterface__1 = require("./AuthLogicForCallInterface__");
64
+ /**
65
+ * 应用
66
+ */
67
+ var App = /** @class */ (function (_super) {
68
+ __extends(App, _super);
69
+ /**
70
+ * @param source 需要合并的部分参数
71
+ */
72
+ function App(source) {
73
+ var _this = this;
74
+ source = Object.assign({}, App_1.getDefaultOptions(), source);
75
+ _this = _super.call(this, source) || this;
76
+ /**
77
+ * 应用 Id
78
+ */
79
+ _this.id = undefined;
80
+ /**
81
+ * 产品概念
82
+ */
83
+ _this.concept = 'App';
84
+ /**
85
+ * IDE 版本
86
+ */
87
+ _this.ideVersion = undefined;
88
+ /**
89
+ * 应用标识
90
+ */
91
+ _this.name = undefined;
92
+ /**
93
+ * 应用标题
94
+ */
95
+ _this.title = undefined;
96
+ /**
97
+ * 应用图标
98
+ */
99
+ _this.icon = undefined;
100
+ /**
101
+ * 应用描述
102
+ */
103
+ _this.desc = undefined;
104
+ /**
105
+ * 域名
106
+ */
107
+ _this.dnsAddr = undefined;
108
+ /**
109
+ * 是否有用户中心
110
+ */
111
+ _this.hasUserCenter = undefined;
112
+ /**
113
+ * 是否有权限
114
+ */
115
+ _this.hasAuth = undefined;
116
+ /**
117
+ * 数据源列表
118
+ */
119
+ _this.dataSources = [];
120
+ /**
121
+ * 数据结构列表
122
+ */
123
+ _this.structures = [];
124
+ /**
125
+ * 枚举列表
126
+ */
127
+ _this.enums = [];
128
+ /**
129
+ * 逻辑列表
130
+ */
131
+ _this.logics = [];
132
+ /**
133
+ * 逻辑列表
134
+ */
135
+ _this.overriddenLogics = [];
136
+ /**
137
+ * interfaces
138
+ */
139
+ _this.interfaces = [];
140
+ /**
141
+ * 端列表
142
+ */
143
+ _this.frontends = [];
144
+ /**
145
+ * 后端
146
+ */
147
+ _this.backend = new Backend__1["default"]();
148
+ /**
149
+ * 流程列表
150
+ */
151
+ _this.processes = [];
152
+ /**
153
+ * 角色列表
154
+ */
155
+ _this.roles = [];
156
+ /**
157
+ * 配置管理
158
+ */
159
+ _this.configuration = new Configuration__1["default"]();
160
+ /**
161
+ * 扩展模块列表
162
+ */
163
+ _this.dependencies = [];
164
+ /**
165
+ * 接口应用列表(兼容老版)
166
+ */
167
+ _this.interfaceDependencies = [];
168
+ /**
169
+ * 集成
170
+ */
171
+ _this.integration = undefined;
172
+ /**
173
+ * 暴露接口的接口鉴权
174
+ */
175
+ _this.authLogics = [];
176
+ /**
177
+ * 调用接口的鉴权模板
178
+ */
179
+ _this.authLogicsForCallInterface = [];
180
+ /**
181
+ * 是否为官方应用
182
+ */
183
+ _this.officialType = undefined;
184
+ /**
185
+ * 轻舟项目 Id
186
+ */
187
+ _this.projectId = undefined;
188
+ /**
189
+ * 租户 Id
190
+ */
191
+ _this.tenantId = undefined;
192
+ /**
193
+ * 租户 Id
194
+ */
195
+ _this.userGroupId = undefined;
196
+ /**
197
+ * 多环境
198
+ */
199
+ _this.envs = undefined;
200
+ /**
201
+ * 多环境
202
+ */
203
+ _this.envList = ['dev', 'online'];
204
+ /**
205
+ * 发布状态
206
+ */
207
+ _this.deploying = undefined;
208
+ /**
209
+ * 发布 Id
210
+ */
211
+ _this.deploymentId = undefined;
212
+ /**
213
+ * 从模板创建的模板 Id
214
+ */
215
+ _this.templateId = undefined;
216
+ /**
217
+ * 全局设置
218
+ */
219
+ _this.preferenceMap = {};
220
+ _this.packageInfos = [];
221
+ /**
222
+ * 当前正在发布的环境,临时状态
223
+ */
224
+ _this.curDeployEnv = 'dev';
225
+ _this.__databaseTypeMap = {};
226
+ _super.prototype.subConstructor.call(_this, source);
227
+ return _this;
228
+ }
229
+ App_1 = App;
230
+ App.prototype.getClassName = function () {
231
+ return 'App';
232
+ };
233
+ App.from = function (source, parentNode, parentKey) {
234
+ return _super.from.call(this, source, parentNode, parentKey);
235
+ };
236
+ /**
237
+ * 从父级删除该节点
238
+ * @internal
239
+ */
240
+ App.prototype._delete = function () {
241
+ var _a, _b;
242
+ var params = null;
243
+ if (this.parentNode) {
244
+ params = (_b = (_a = this.parentNode) === null || _a === void 0 ? void 0 : _a.__removeApp) === null || _b === void 0 ? void 0 : _b.call(_a, this);
245
+ }
246
+ return params;
247
+ };
248
+ /**
249
+ * 设置集成
250
+ */
251
+ App.prototype.setIntegration = function (integration) {
252
+ integration._delete();
253
+ var relationOptions = { parentNode: this, parentKey: 'integration' };
254
+ Object.assign(integration, relationOptions);
255
+ var object = {
256
+ integration: integration
257
+ };
258
+ this.update(__assign({}, object));
259
+ };
260
+ App.prototype.getDataSourceUniqueName = function (name) {
261
+ if (name === void 0) { name = 'dataSource1'; }
262
+ return utils.unique(name, this.getDataSourceExistingNames(), undefined, true);
263
+ };
264
+ App.prototype._insertDataSourceAt = function (options, index) {
265
+ var dataSourceOptions = {};
266
+ var relationOptions = { parentNode: this, parentKey: 'dataSources' };
267
+ var dataSource;
268
+ if (!options) {
269
+ dataSource = DataSource__1["default"].from(__assign(__assign({}, dataSourceOptions), { name: this.getDataSourceUniqueName() }), this, 'dataSources');
270
+ }
271
+ else if (typeof options === 'string') {
272
+ dataSource = DataSource__1["default"].from(__assign(__assign({}, dataSourceOptions), { name: options }), this, 'dataSources');
273
+ }
274
+ else if (options instanceof DataSource__1["default"]) {
275
+ options.ensureDelete(); // 同一实例不支持多处存在
276
+ dataSource = options;
277
+ Object.assign(dataSource, relationOptions);
278
+ }
279
+ else {
280
+ dataSource = DataSource__1["default"].from(__assign(__assign({}, dataSourceOptions), options), this, 'dataSources');
281
+ }
282
+ this.dataSources.splice(index, 0, dataSource);
283
+ return dataSource;
284
+ };
285
+ App.prototype.insertDataSourceAt = function (options, index) {
286
+ var node = this._insertDataSourceAt(options, index);
287
+ node.create({
288
+ index: index,
289
+ parentNode: this,
290
+ parentKey: 'dataSources'
291
+ });
292
+ return node;
293
+ };
294
+ App.prototype._addDataSource = function (options) {
295
+ var index = this.dataSources.length;
296
+ return this._insertDataSourceAt(options, index);
297
+ };
298
+ App.prototype.addDataSource = function (options) {
299
+ var node = this._addDataSource(options);
300
+ var index = this.dataSources.indexOf(node);
301
+ node.create({
302
+ index: index,
303
+ parentNode: this,
304
+ parentKey: 'dataSources'
305
+ });
306
+ return node;
307
+ };
308
+ App.prototype.getStructureExistingNames = function (excludedList) {
309
+ if (excludedList === void 0) { excludedList = []; }
310
+ var excludedSet = new Set(excludedList);
311
+ return (this.structures || []).filter(function (item) { return !excludedSet.has(item); }).map(function (item) { return item.name; });
312
+ };
313
+ App.prototype.getStructureUniqueName = function (name) {
314
+ if (name === void 0) { name = 'Structure1'; }
315
+ return utils.unique(name, this.getStructureExistingNames(), undefined, true);
316
+ };
317
+ App.prototype._insertStructureAt = function (options, index) {
318
+ var structureOptions = {};
319
+ var relationOptions = { parentNode: this, parentKey: 'structures' };
320
+ var structure;
321
+ if (!options) {
322
+ structure = Structure__1["default"].from(__assign(__assign({}, structureOptions), { name: this.getStructureUniqueName() }), this, 'structures');
323
+ }
324
+ else if (typeof options === 'string') {
325
+ structure = Structure__1["default"].from(__assign(__assign({}, structureOptions), { name: options }), this, 'structures');
326
+ }
327
+ else if (options instanceof Structure__1["default"]) {
328
+ options.ensureDelete(); // 同一实例不支持多处存在
329
+ structure = options;
330
+ Object.assign(structure, relationOptions);
331
+ }
332
+ else {
333
+ structure = Structure__1["default"].from(__assign(__assign({}, structureOptions), options), this, 'structures');
334
+ }
335
+ this.structures.splice(index, 0, structure);
336
+ return structure;
337
+ };
338
+ App.prototype.insertStructureAt = function (options, index) {
339
+ var node = this._insertStructureAt(options, index);
340
+ node.create({
341
+ index: index,
342
+ parentNode: this,
343
+ parentKey: 'structures'
344
+ });
345
+ return node;
346
+ };
347
+ App.prototype._addStructure = function (options) {
348
+ var index = 0;
349
+ return this._insertStructureAt(options, index);
350
+ };
351
+ App.prototype.addStructure = function (options) {
352
+ var node = this._addStructure(options);
353
+ var index = this.structures.indexOf(node);
354
+ node.create({
355
+ index: index,
356
+ parentNode: this,
357
+ parentKey: 'structures'
358
+ });
359
+ return node;
360
+ };
361
+ App.prototype.getEnumExistingNames = function (excludedList) {
362
+ if (excludedList === void 0) { excludedList = []; }
363
+ var excludedSet = new Set(excludedList);
364
+ return (this.enums || []).filter(function (item) { return !excludedSet.has(item); }).map(function (item) { return item.name; });
365
+ };
366
+ App.prototype.getEnumUniqueName = function (name) {
367
+ if (name === void 0) { name = 'Enum1'; }
368
+ return utils.unique(name, this.getEnumExistingNames(), undefined, true);
369
+ };
370
+ App.prototype._insertEnumAt = function (options, index) {
371
+ var enumerationOptions = {};
372
+ var relationOptions = { parentNode: this, parentKey: 'enums' };
373
+ var enumeration;
374
+ if (!options) {
375
+ enumeration = Enum__1["default"].from(__assign(__assign({}, enumerationOptions), { name: this.getEnumUniqueName() }), this, 'enums');
376
+ }
377
+ else if (typeof options === 'string') {
378
+ enumeration = Enum__1["default"].from(__assign(__assign({}, enumerationOptions), { name: options }), this, 'enums');
379
+ }
380
+ else if (options instanceof Enum__1["default"]) {
381
+ options.ensureDelete(); // 同一实例不支持多处存在
382
+ enumeration = options;
383
+ Object.assign(enumeration, relationOptions);
384
+ }
385
+ else {
386
+ enumeration = Enum__1["default"].from(__assign(__assign({}, enumerationOptions), options), this, 'enums');
387
+ }
388
+ this.enums.splice(index, 0, enumeration);
389
+ return enumeration;
390
+ };
391
+ App.prototype.insertEnumAt = function (options, index) {
392
+ var node = this._insertEnumAt(options, index);
393
+ node.create({
394
+ index: index,
395
+ parentNode: this,
396
+ parentKey: 'enums'
397
+ });
398
+ return node;
399
+ };
400
+ App.prototype._addEnum = function (options) {
401
+ var index = 0;
402
+ return this._insertEnumAt(options, index);
403
+ };
404
+ App.prototype.addEnum = function (options) {
405
+ var node = this._addEnum(options);
406
+ var index = this.enums.indexOf(node);
407
+ node.create({
408
+ index: index,
409
+ parentNode: this,
410
+ parentKey: 'enums'
411
+ });
412
+ return node;
413
+ };
414
+ App.prototype.getLogicExistingNames = function (excludedList) {
415
+ if (excludedList === void 0) { excludedList = []; }
416
+ var excludedSet = new Set(excludedList);
417
+ return (this.logics || []).filter(function (item) { return !excludedSet.has(item); }).map(function (item) { return item.name; });
418
+ };
419
+ App.prototype.getLogicUniqueName = function (name) {
420
+ if (name === void 0) { name = 'logic1'; }
421
+ return utils.unique(name, this.getLogicExistingNames(), undefined, true);
422
+ };
423
+ App.prototype._insertLogicAt = function (options, index) {
424
+ var logicOptions = {};
425
+ var relationOptions = { parentNode: this, parentKey: 'logics' };
426
+ var logic;
427
+ if (!options) {
428
+ logic = Logic__1["default"].from(__assign(__assign({}, logicOptions), { name: this.getLogicUniqueName() }), this, 'logics');
429
+ }
430
+ else if (typeof options === 'string') {
431
+ logic = Logic__1["default"].from(__assign(__assign({}, logicOptions), { name: options }), this, 'logics');
432
+ }
433
+ else if (options instanceof Logic__1["default"]) {
434
+ options.ensureDelete(); // 同一实例不支持多处存在
435
+ logic = options;
436
+ Object.assign(logic, relationOptions);
437
+ }
438
+ else {
439
+ logic = Logic__1["default"].from(__assign(__assign({}, logicOptions), options), this, 'logics');
440
+ }
441
+ this.logics.splice(index, 0, logic);
442
+ return logic;
443
+ };
444
+ App.prototype.insertLogicAt = function (options, index) {
445
+ var node = this._insertLogicAt(options, index);
446
+ node.create({
447
+ index: index,
448
+ parentNode: this,
449
+ parentKey: 'logics'
450
+ });
451
+ return node;
452
+ };
453
+ App.prototype._addLogic = function (options) {
454
+ var index = 0;
455
+ return this._insertLogicAt(options, index);
456
+ };
457
+ App.prototype.addLogic = function (options) {
458
+ var node = this._addLogic(options);
459
+ var index = this.logics.indexOf(node);
460
+ node.create({
461
+ index: index,
462
+ parentNode: this,
463
+ parentKey: 'logics'
464
+ });
465
+ return node;
466
+ };
467
+ App.prototype._insertAuthLogicInAuthLogicsAt = function (options, index) {
468
+ var authLogicOptions = {};
469
+ var relationOptions = { parentNode: this, parentKey: 'authLogics' };
470
+ var authLogic;
471
+ if (!options) {
472
+ authLogic = AuthLogic__1["default"].from(__assign(__assign({}, authLogicOptions), { name: this.getAuthLogicUniqueName() }), this, 'authLogics');
473
+ }
474
+ else if (typeof options === 'string') {
475
+ authLogic = AuthLogic__1["default"].from(__assign(__assign({}, authLogicOptions), { name: options }), this, 'authLogics');
476
+ }
477
+ else if (options instanceof AuthLogic__1["default"]) {
478
+ options.ensureDelete(); // 同一实例不支持多处存在
479
+ authLogic = options;
480
+ Object.assign(authLogic, relationOptions);
481
+ }
482
+ else {
483
+ authLogic = AuthLogic__1["default"].from(__assign(__assign({}, authLogicOptions), options), this, 'authLogics');
484
+ }
485
+ this.authLogics.splice(index, 0, authLogic);
486
+ return authLogic;
487
+ };
488
+ App.prototype.insertAuthLogicInAuthLogicsAt = function (options, index) {
489
+ var node = this._insertAuthLogicInAuthLogicsAt(options, index);
490
+ node.create({
491
+ index: index,
492
+ parentNode: this,
493
+ parentKey: 'authLogics'
494
+ });
495
+ return node;
496
+ };
497
+ App.prototype._addAuthLogicInAuthLogics = function (options) {
498
+ var index = this.authLogics.length;
499
+ return this._insertAuthLogicInAuthLogicsAt(options, index);
500
+ };
501
+ App.prototype.addAuthLogicInAuthLogics = function (options) {
502
+ var node = this._addAuthLogicInAuthLogics(options);
503
+ var index = this.authLogics.indexOf(node);
504
+ node.create({
505
+ index: index,
506
+ parentNode: this,
507
+ parentKey: 'authLogics'
508
+ });
509
+ return node;
510
+ };
511
+ App.prototype.getOverriddenLogicExistingNames = function (excludedList) {
512
+ if (excludedList === void 0) { excludedList = []; }
513
+ var excludedSet = new Set(excludedList);
514
+ return (this.overriddenLogics || []).filter(function (item) { return !excludedSet.has(item); }).map(function (item) { return item.name; });
515
+ };
516
+ App.prototype.getOverriddenLogicUniqueName = function (name) {
517
+ if (name === void 0) { name = 'overriddenLogic1'; }
518
+ return utils.unique(name, this.getOverriddenLogicExistingNames(), undefined, true);
519
+ };
520
+ App.prototype._insertOverriddenLogicAt = function (options, index) {
521
+ var overriddenLogicOptions = {};
522
+ var relationOptions = { parentNode: this, parentKey: 'overriddenLogics' };
523
+ var overriddenLogic;
524
+ if (!options) {
525
+ overriddenLogic = OverriddenLogic__1["default"].from(__assign(__assign({}, overriddenLogicOptions), { name: this.getOverriddenLogicUniqueName() }), this, 'overriddenLogics');
526
+ }
527
+ else if (typeof options === 'string') {
528
+ overriddenLogic = OverriddenLogic__1["default"].from(__assign(__assign({}, overriddenLogicOptions), { name: options }), this, 'overriddenLogics');
529
+ }
530
+ else if (options instanceof OverriddenLogic__1["default"]) {
531
+ options.ensureDelete(); // 同一实例不支持多处存在
532
+ overriddenLogic = options;
533
+ Object.assign(overriddenLogic, relationOptions);
534
+ }
535
+ else {
536
+ overriddenLogic = OverriddenLogic__1["default"].from(__assign(__assign({}, overriddenLogicOptions), options), this, 'overriddenLogics');
537
+ }
538
+ this.overriddenLogics.splice(index, 0, overriddenLogic);
539
+ return overriddenLogic;
540
+ };
541
+ App.prototype.insertOverriddenLogicAt = function (options, index) {
542
+ var node = this._insertOverriddenLogicAt(options, index);
543
+ node.create({
544
+ index: index,
545
+ parentNode: this,
546
+ parentKey: 'overriddenLogics'
547
+ });
548
+ return node;
549
+ };
550
+ App.prototype._addOverriddenLogic = function (options) {
551
+ var index = 0;
552
+ return this._insertOverriddenLogicAt(options, index);
553
+ };
554
+ App.prototype.addOverriddenLogic = function (options) {
555
+ var node = this._addOverriddenLogic(options);
556
+ var index = this.overriddenLogics.indexOf(node);
557
+ node.create({
558
+ index: index,
559
+ parentNode: this,
560
+ parentKey: 'overriddenLogics'
561
+ });
562
+ return node;
563
+ };
564
+ App.prototype.getInterfaceExistingNames = function (excludedList) {
565
+ if (excludedList === void 0) { excludedList = []; }
566
+ var excludedSet = new Set(excludedList);
567
+ return (this.interfaces || []).filter(function (item) { return !excludedSet.has(item); }).map(function (item) { return item.name; });
568
+ };
569
+ App.prototype.getInterfaceUniqueName = function (name) {
570
+ if (name === void 0) { name = 'Interface1'; }
571
+ return utils.unique(name, this.getInterfaceExistingNames(), undefined, true);
572
+ };
573
+ App.prototype._insertInterfaceInInterfacesAt = function (options, index) {
574
+ var itfaceOptions = {};
575
+ var relationOptions = { parentNode: this, parentKey: 'interfaces' };
576
+ var itface;
577
+ if (!options) {
578
+ itface = Interface__1["default"].from(__assign(__assign({}, itfaceOptions), { name: this.getInterfaceUniqueName() }), this, 'interfaces');
579
+ }
580
+ else if (typeof options === 'string') {
581
+ itface = Interface__1["default"].from(__assign(__assign({}, itfaceOptions), { name: options }), this, 'interfaces');
582
+ }
583
+ else if (options instanceof Interface__1["default"]) {
584
+ options.ensureDelete(); // 同一实例不支持多处存在
585
+ itface = options;
586
+ Object.assign(itface, relationOptions);
587
+ }
588
+ else {
589
+ itface = Interface__1["default"].from(__assign(__assign({}, itfaceOptions), options), this, 'interfaces');
590
+ }
591
+ this.interfaces.splice(index, 0, itface);
592
+ return itface;
593
+ };
594
+ App.prototype.insertInterfaceInInterfacesAt = function (options, index) {
595
+ var node = this._insertInterfaceInInterfacesAt(options, index);
596
+ node.create({
597
+ index: index,
598
+ parentNode: this,
599
+ parentKey: 'interfaces'
600
+ });
601
+ return node;
602
+ };
603
+ App.prototype._addInterfaceInInterfaces = function (options) {
604
+ var index = 0;
605
+ return this._insertInterfaceInInterfacesAt(options, index);
606
+ };
607
+ App.prototype.addInterfaceInInterfaces = function (options) {
608
+ var node = this._addInterfaceInInterfaces(options);
609
+ var index = this.interfaces.indexOf(node);
610
+ node.create({
611
+ index: index,
612
+ parentNode: this,
613
+ parentKey: 'interfaces'
614
+ });
615
+ return node;
616
+ };
617
+ App.prototype._insertAuthInterfaceInInterfacesAt = function (options, index) {
618
+ var itfaceOptions = {};
619
+ var relationOptions = { parentNode: this, parentKey: 'interfaces' };
620
+ var itface;
621
+ if (!options) {
622
+ itface = AuthInterface__1["default"].from(__assign(__assign({}, itfaceOptions), { name: this.getAuthInterfaceUniqueName() }), this, 'interfaces');
623
+ }
624
+ else if (typeof options === 'string') {
625
+ itface = AuthInterface__1["default"].from(__assign(__assign({}, itfaceOptions), { name: options }), this, 'interfaces');
626
+ }
627
+ else if (options instanceof AuthInterface__1["default"]) {
628
+ options.ensureDelete(); // 同一实例不支持多处存在
629
+ itface = options;
630
+ Object.assign(itface, relationOptions);
631
+ }
632
+ else {
633
+ itface = AuthInterface__1["default"].from(__assign(__assign({}, itfaceOptions), options), this, 'interfaces');
634
+ }
635
+ this.interfaces.splice(index, 0, itface);
636
+ return itface;
637
+ };
638
+ App.prototype.insertAuthInterfaceInInterfacesAt = function (options, index) {
639
+ var node = this._insertAuthInterfaceInInterfacesAt(options, index);
640
+ node.create({
641
+ index: index,
642
+ parentNode: this,
643
+ parentKey: 'interfaces'
644
+ });
645
+ return node;
646
+ };
647
+ App.prototype._addAuthInterfaceInInterfaces = function (options) {
648
+ var index = 0;
649
+ return this._insertAuthInterfaceInInterfacesAt(options, index);
650
+ };
651
+ App.prototype.addAuthInterfaceInInterfaces = function (options) {
652
+ var node = this._addAuthInterfaceInInterfaces(options);
653
+ var index = this.interfaces.indexOf(node);
654
+ node.create({
655
+ index: index,
656
+ parentNode: this,
657
+ parentKey: 'interfaces'
658
+ });
659
+ return node;
660
+ };
661
+ App.prototype.getFrontendExistingNames = function (excludedList) {
662
+ if (excludedList === void 0) { excludedList = []; }
663
+ var excludedSet = new Set(excludedList);
664
+ return (this.frontends || []).filter(function (item) { return !excludedSet.has(item); }).map(function (item) { return item.name; });
665
+ };
666
+ App.prototype.getFrontendUniqueName = function (name) {
667
+ if (name === void 0) { name = 'frontend1'; }
668
+ return utils.unique(name, this.getFrontendExistingNames(), undefined, true);
669
+ };
670
+ App.prototype._insertFrontendAt = function (options, index) {
671
+ var frontendOptions = {};
672
+ var relationOptions = { parentNode: this, parentKey: 'frontends' };
673
+ var frontend;
674
+ if (!options) {
675
+ frontend = Frontend__1["default"].from(__assign(__assign({}, frontendOptions), { name: this.getFrontendUniqueName() }), this, 'frontends');
676
+ }
677
+ else if (typeof options === 'string') {
678
+ frontend = Frontend__1["default"].from(__assign(__assign({}, frontendOptions), { name: options }), this, 'frontends');
679
+ }
680
+ else if (options instanceof Frontend__1["default"]) {
681
+ options.ensureDelete(); // 同一实例不支持多处存在
682
+ frontend = options;
683
+ Object.assign(frontend, relationOptions);
684
+ }
685
+ else {
686
+ frontend = Frontend__1["default"].from(__assign(__assign({}, frontendOptions), options), this, 'frontends');
687
+ }
688
+ this.frontends.splice(index, 0, frontend);
689
+ return frontend;
690
+ };
691
+ App.prototype.insertFrontendAt = function (options, index) {
692
+ var node = this._insertFrontendAt(options, index);
693
+ node.create({
694
+ index: index,
695
+ parentNode: this,
696
+ parentKey: 'frontends'
697
+ });
698
+ return node;
699
+ };
700
+ App.prototype._addFrontend = function (options) {
701
+ var index = this.frontends.length;
702
+ return this._insertFrontendAt(options, index);
703
+ };
704
+ App.prototype.addFrontend = function (options) {
705
+ var node = this._addFrontend(options);
706
+ var index = this.frontends.indexOf(node);
707
+ node.create({
708
+ index: index,
709
+ parentNode: this,
710
+ parentKey: 'frontends'
711
+ });
712
+ return node;
713
+ };
714
+ App.prototype.getProcessExistingNames = function (excludedList) {
715
+ if (excludedList === void 0) { excludedList = []; }
716
+ var excludedSet = new Set(excludedList);
717
+ return (this.processes || []).filter(function (item) { return !excludedSet.has(item); }).map(function (item) { return item.name; });
718
+ };
719
+ App.prototype.getProcessUniqueName = function (name) {
720
+ if (name === void 0) { name = 'Process1'; }
721
+ return utils.unique(name, this.getProcessExistingNames(), undefined, true);
722
+ };
723
+ App.prototype._insertProcessAt = function (options, index) {
724
+ var processOptions = {};
725
+ var relationOptions = { parentNode: this, parentKey: 'processes' };
726
+ var process;
727
+ if (!options) {
728
+ process = Process__1["default"].from(__assign(__assign({}, processOptions), { name: this.getProcessUniqueName() }), this, 'processes');
729
+ }
730
+ else if (typeof options === 'string') {
731
+ process = Process__1["default"].from(__assign(__assign({}, processOptions), { name: options }), this, 'processes');
732
+ }
733
+ else if (options instanceof Process__1["default"]) {
734
+ options.ensureDelete(); // 同一实例不支持多处存在
735
+ process = options;
736
+ Object.assign(process, relationOptions);
737
+ }
738
+ else {
739
+ process = Process__1["default"].from(__assign(__assign({}, processOptions), options), this, 'processes');
740
+ }
741
+ this.processes.splice(index, 0, process);
742
+ return process;
743
+ };
744
+ App.prototype.insertProcessAt = function (options, index) {
745
+ var node = this._insertProcessAt(options, index);
746
+ node.create({
747
+ index: index,
748
+ parentNode: this,
749
+ parentKey: 'processes'
750
+ });
751
+ return node;
752
+ };
753
+ App.prototype._addProcess = function (options) {
754
+ var index = 0;
755
+ return this._insertProcessAt(options, index);
756
+ };
757
+ App.prototype.addProcess = function (options) {
758
+ var node = this._addProcess(options);
759
+ var index = this.processes.indexOf(node);
760
+ node.create({
761
+ index: index,
762
+ parentNode: this,
763
+ parentKey: 'processes'
764
+ });
765
+ return node;
766
+ };
767
+ App.prototype.getRoleExistingNames = function (excludedList) {
768
+ if (excludedList === void 0) { excludedList = []; }
769
+ var excludedSet = new Set(excludedList);
770
+ return (this.roles || []).filter(function (item) { return !excludedSet.has(item); }).map(function (item) { return item.name; });
771
+ };
772
+ App.prototype.getRoleUniqueName = function (name) {
773
+ if (name === void 0) { name = 'role1'; }
774
+ return utils.unique(name, this.getRoleExistingNames(), undefined, true);
775
+ };
776
+ App.prototype._insertRoleAt = function (options, index) {
777
+ var roleOptions = {};
778
+ var relationOptions = { parentNode: this, parentKey: 'roles' };
779
+ var role;
780
+ if (!options) {
781
+ role = Role__1["default"].from(__assign(__assign({}, roleOptions), { name: this.getRoleUniqueName() }), this, 'roles');
782
+ }
783
+ else if (typeof options === 'string') {
784
+ role = Role__1["default"].from(__assign(__assign({}, roleOptions), { name: options }), this, 'roles');
785
+ }
786
+ else if (options instanceof Role__1["default"]) {
787
+ options.ensureDelete(); // 同一实例不支持多处存在
788
+ role = options;
789
+ Object.assign(role, relationOptions);
790
+ }
791
+ else {
792
+ role = Role__1["default"].from(__assign(__assign({}, roleOptions), options), this, 'roles');
793
+ }
794
+ this.roles.splice(index, 0, role);
795
+ return role;
796
+ };
797
+ App.prototype.insertRoleAt = function (options, index) {
798
+ var node = this._insertRoleAt(options, index);
799
+ node.create({
800
+ index: index,
801
+ parentNode: this,
802
+ parentKey: 'roles'
803
+ });
804
+ return node;
805
+ };
806
+ App.prototype._addRole = function (options) {
807
+ var index = this.roles.length;
808
+ return this._insertRoleAt(options, index);
809
+ };
810
+ App.prototype.addRole = function (options) {
811
+ var node = this._addRole(options);
812
+ var index = this.roles.indexOf(node);
813
+ node.create({
814
+ index: index,
815
+ parentNode: this,
816
+ parentKey: 'roles'
817
+ });
818
+ return node;
819
+ };
820
+ App.prototype.getModuleExistingNames = function (excludedList) {
821
+ if (excludedList === void 0) { excludedList = []; }
822
+ var excludedSet = new Set(excludedList);
823
+ return (this.dependencies || []).filter(function (item) { return !excludedSet.has(item); }).map(function (item) { return item.name; });
824
+ };
825
+ App.prototype.getModuleUniqueName = function (name) {
826
+ if (name === void 0) { name = 'module1'; }
827
+ return utils.unique(name, this.getModuleExistingNames(), undefined, false);
828
+ };
829
+ App.prototype._insertModuleInDependenciesAt = function (options, index) {
830
+ var moduleOptions = {};
831
+ var relationOptions = { parentNode: this, parentKey: 'dependencies' };
832
+ var module;
833
+ if (!options) {
834
+ module = Module__1["default"].from(__assign(__assign({}, moduleOptions), { name: this.getModuleUniqueName() }), this, 'dependencies');
835
+ }
836
+ else if (typeof options === 'string') {
837
+ module = Module__1["default"].from(__assign(__assign({}, moduleOptions), { name: options }), this, 'dependencies');
838
+ }
839
+ else if (options instanceof Module__1["default"]) {
840
+ options.ensureDelete(); // 同一实例不支持多处存在
841
+ module = options;
842
+ Object.assign(module, relationOptions);
843
+ }
844
+ else {
845
+ module = Module__1["default"].from(__assign(__assign({}, moduleOptions), options), this, 'dependencies');
846
+ }
847
+ this.dependencies.splice(index, 0, module);
848
+ return module;
849
+ };
850
+ App.prototype.insertModuleInDependenciesAt = function (options, index) {
851
+ var node = this._insertModuleInDependenciesAt(options, index);
852
+ node.create({
853
+ index: index,
854
+ parentNode: this,
855
+ parentKey: 'dependencies'
856
+ });
857
+ return node;
858
+ };
859
+ App.prototype._addModuleInDependencies = function (options) {
860
+ var index = this.dependencies.length;
861
+ return this._insertModuleInDependenciesAt(options, index);
862
+ };
863
+ App.prototype.addModuleInDependencies = function (options) {
864
+ var node = this._addModuleInDependencies(options);
865
+ var index = this.dependencies.indexOf(node);
866
+ node.create({
867
+ index: index,
868
+ parentNode: this,
869
+ parentKey: 'dependencies'
870
+ });
871
+ return node;
872
+ };
873
+ App.prototype._insertConnectorInDependenciesAt = function (options, index) {
874
+ var connectorOptions = {};
875
+ var relationOptions = { parentNode: this, parentKey: 'dependencies' };
876
+ var connector;
877
+ if (!options) {
878
+ connector = Connector__1["default"].from(__assign(__assign({}, connectorOptions), { name: this.getConnectorUniqueName() }), this, 'dependencies');
879
+ }
880
+ else if (typeof options === 'string') {
881
+ connector = Connector__1["default"].from(__assign(__assign({}, connectorOptions), { name: options }), this, 'dependencies');
882
+ }
883
+ else if (options instanceof Connector__1["default"]) {
884
+ options.ensureDelete(); // 同一实例不支持多处存在
885
+ connector = options;
886
+ Object.assign(connector, relationOptions);
887
+ }
888
+ else {
889
+ connector = Connector__1["default"].from(__assign(__assign({}, connectorOptions), options), this, 'dependencies');
890
+ }
891
+ this.dependencies.splice(index, 0, connector);
892
+ return connector;
893
+ };
894
+ App.prototype.insertConnectorInDependenciesAt = function (options, index) {
895
+ var node = this._insertConnectorInDependenciesAt(options, index);
896
+ node.create({
897
+ index: index,
898
+ parentNode: this,
899
+ parentKey: 'dependencies'
900
+ });
901
+ return node;
902
+ };
903
+ App.prototype._addConnectorInDependencies = function (options) {
904
+ var index = this.dependencies.length;
905
+ return this._insertConnectorInDependenciesAt(options, index);
906
+ };
907
+ App.prototype.addConnectorInDependencies = function (options) {
908
+ var node = this._addConnectorInDependencies(options);
909
+ var index = this.dependencies.indexOf(node);
910
+ node.create({
911
+ index: index,
912
+ parentNode: this,
913
+ parentKey: 'dependencies'
914
+ });
915
+ return node;
916
+ };
917
+ App.prototype._insertModuleInInterfaceDependenciesAt = function (options, index) {
918
+ var moduleOptions = {};
919
+ var relationOptions = { parentNode: this, parentKey: 'interfaceDependencies' };
920
+ var module;
921
+ if (!options) {
922
+ module = Module__1["default"].from(__assign(__assign({}, moduleOptions), { name: this.getModuleUniqueName() }), this, 'interfaceDependencies');
923
+ }
924
+ else if (typeof options === 'string') {
925
+ module = Module__1["default"].from(__assign(__assign({}, moduleOptions), { name: options }), this, 'interfaceDependencies');
926
+ }
927
+ else if (options instanceof Module__1["default"]) {
928
+ options.ensureDelete(); // 同一实例不支持多处存在
929
+ module = options;
930
+ Object.assign(module, relationOptions);
931
+ }
932
+ else {
933
+ module = Module__1["default"].from(__assign(__assign({}, moduleOptions), options), this, 'interfaceDependencies');
934
+ }
935
+ this.interfaceDependencies.splice(index, 0, module);
936
+ return module;
937
+ };
938
+ App.prototype.insertModuleInInterfaceDependenciesAt = function (options, index) {
939
+ var node = this._insertModuleInInterfaceDependenciesAt(options, index);
940
+ node.create({
941
+ index: index,
942
+ parentNode: this,
943
+ parentKey: 'interfaceDependencies'
944
+ });
945
+ return node;
946
+ };
947
+ App.prototype._addModuleInInterfaceDependencies = function (options) {
948
+ var index = this.interfaceDependencies.length;
949
+ return this._insertModuleInInterfaceDependenciesAt(options, index);
950
+ };
951
+ App.prototype.addModuleInInterfaceDependencies = function (options) {
952
+ var node = this._addModuleInInterfaceDependencies(options);
953
+ var index = this.interfaceDependencies.indexOf(node);
954
+ node.create({
955
+ index: index,
956
+ parentNode: this,
957
+ parentKey: 'interfaceDependencies'
958
+ });
959
+ return node;
960
+ };
961
+ App.prototype.getAuthLogicForCallInterfaceExistingNames = function (excludedList) {
962
+ if (excludedList === void 0) { excludedList = []; }
963
+ var excludedSet = new Set(excludedList);
964
+ return (this.authLogicsForCallInterface || []).filter(function (item) { return !excludedSet.has(item); }).map(function (item) { return item.name; });
965
+ };
966
+ App.prototype.getAuthLogicForCallInterfaceUniqueName = function (name) {
967
+ if (name === void 0) { name = 'authLogicForCallInterface1'; }
968
+ return utils.unique(name, this.getAuthLogicForCallInterfaceExistingNames(), undefined, false);
969
+ };
970
+ App.prototype._insertAuthLogicForCallInterfaceAt = function (options, index) {
971
+ var authLogicForCallInterfaceOptions = {};
972
+ var relationOptions = { parentNode: this, parentKey: 'authLogicsForCallInterface' };
973
+ var authLogicForCallInterface;
974
+ if (!options) {
975
+ authLogicForCallInterface = AuthLogicForCallInterface__1["default"].from(__assign(__assign({}, authLogicForCallInterfaceOptions), { name: this.getAuthLogicForCallInterfaceUniqueName() }), this, 'authLogicsForCallInterface');
976
+ }
977
+ else if (typeof options === 'string') {
978
+ authLogicForCallInterface = AuthLogicForCallInterface__1["default"].from(__assign(__assign({}, authLogicForCallInterfaceOptions), { name: options }), this, 'authLogicsForCallInterface');
979
+ }
980
+ else if (options instanceof AuthLogicForCallInterface__1["default"]) {
981
+ options.ensureDelete(); // 同一实例不支持多处存在
982
+ authLogicForCallInterface = options;
983
+ Object.assign(authLogicForCallInterface, relationOptions);
984
+ }
985
+ else {
986
+ authLogicForCallInterface = AuthLogicForCallInterface__1["default"].from(__assign(__assign({}, authLogicForCallInterfaceOptions), options), this, 'authLogicsForCallInterface');
987
+ }
988
+ this.authLogicsForCallInterface.splice(index, 0, authLogicForCallInterface);
989
+ return authLogicForCallInterface;
990
+ };
991
+ App.prototype.insertAuthLogicForCallInterfaceAt = function (options, index) {
992
+ var node = this._insertAuthLogicForCallInterfaceAt(options, index);
993
+ node.create({
994
+ index: index,
995
+ parentNode: this,
996
+ parentKey: 'authLogicsForCallInterface'
997
+ });
998
+ return node;
999
+ };
1000
+ App.prototype._addAuthLogicForCallInterface = function (options) {
1001
+ var index = this.authLogicsForCallInterface.length;
1002
+ return this._insertAuthLogicForCallInterfaceAt(options, index);
1003
+ };
1004
+ App.prototype.addAuthLogicForCallInterface = function (options) {
1005
+ var node = this._addAuthLogicForCallInterface(options);
1006
+ var index = this.authLogicsForCallInterface.indexOf(node);
1007
+ node.create({
1008
+ index: index,
1009
+ parentNode: this,
1010
+ parentKey: 'authLogicsForCallInterface'
1011
+ });
1012
+ return node;
1013
+ };
1014
+ App.prototype.removeDataSource = function (options) {
1015
+ var dataSource;
1016
+ if (typeof options === 'string') {
1017
+ dataSource = this.dataSources.find(function (item) { return item.name === options; });
1018
+ if (!dataSource) {
1019
+ throw new Error('找不到数据源 ' + options);
1020
+ }
1021
+ }
1022
+ else {
1023
+ dataSource = options;
1024
+ }
1025
+ return dataSource["delete"]();
1026
+ };
1027
+ App.prototype.__removeDataSource = function (dataSource) {
1028
+ var parentKey = dataSource.parentKey;
1029
+ var params = {
1030
+ parentNode: this,
1031
+ parentKey: parentKey,
1032
+ index: -1,
1033
+ object: null,
1034
+ oldObject: dataSource
1035
+ };
1036
+ if (parentKey) {
1037
+ params.parentKey = parentKey;
1038
+ if (Array.isArray(this[parentKey])) {
1039
+ var index = this[parentKey].indexOf(dataSource);
1040
+ ~index && this[parentKey].splice(index, 1);
1041
+ params.index = index;
1042
+ }
1043
+ else if (this[parentKey] === dataSource) {
1044
+ params.index = 0;
1045
+ this[parentKey] = undefined;
1046
+ }
1047
+ }
1048
+ return params;
1049
+ };
1050
+ App.prototype.removeStructure = function (options) {
1051
+ var structure;
1052
+ if (typeof options === 'string') {
1053
+ structure = this.structures.find(function (item) { return item.name === options; });
1054
+ if (!structure) {
1055
+ throw new Error('找不到数据结构 ' + options);
1056
+ }
1057
+ }
1058
+ else {
1059
+ structure = options;
1060
+ }
1061
+ return structure["delete"]();
1062
+ };
1063
+ App.prototype.__removeStructure = function (structure) {
1064
+ var parentKey = structure.parentKey;
1065
+ var params = {
1066
+ parentNode: this,
1067
+ parentKey: parentKey,
1068
+ index: -1,
1069
+ object: null,
1070
+ oldObject: structure
1071
+ };
1072
+ if (parentKey) {
1073
+ params.parentKey = parentKey;
1074
+ if (Array.isArray(this[parentKey])) {
1075
+ var index = this[parentKey].indexOf(structure);
1076
+ ~index && this[parentKey].splice(index, 1);
1077
+ params.index = index;
1078
+ }
1079
+ else if (this[parentKey] === structure) {
1080
+ params.index = 0;
1081
+ this[parentKey] = undefined;
1082
+ }
1083
+ }
1084
+ return params;
1085
+ };
1086
+ App.prototype.removeEnum = function (options) {
1087
+ var enumeration;
1088
+ if (typeof options === 'string') {
1089
+ enumeration = this.enums.find(function (item) { return item.name === options; });
1090
+ if (!enumeration) {
1091
+ throw new Error('找不到枚举 ' + options);
1092
+ }
1093
+ }
1094
+ else {
1095
+ enumeration = options;
1096
+ }
1097
+ return enumeration["delete"]();
1098
+ };
1099
+ App.prototype.__removeEnum = function (enumeration) {
1100
+ var parentKey = enumeration.parentKey;
1101
+ var params = {
1102
+ parentNode: this,
1103
+ parentKey: parentKey,
1104
+ index: -1,
1105
+ object: null,
1106
+ oldObject: enumeration
1107
+ };
1108
+ if (parentKey) {
1109
+ params.parentKey = parentKey;
1110
+ if (Array.isArray(this[parentKey])) {
1111
+ var index = this[parentKey].indexOf(enumeration);
1112
+ ~index && this[parentKey].splice(index, 1);
1113
+ params.index = index;
1114
+ }
1115
+ else if (this[parentKey] === enumeration) {
1116
+ params.index = 0;
1117
+ this[parentKey] = undefined;
1118
+ }
1119
+ }
1120
+ return params;
1121
+ };
1122
+ App.prototype.removeLogic = function (options) {
1123
+ var logic;
1124
+ if (typeof options === 'string') {
1125
+ logic = this.logics.find(function (item) { return item.name === options; });
1126
+ if (!logic) {
1127
+ throw new Error('找不到逻辑 ' + options);
1128
+ }
1129
+ }
1130
+ else {
1131
+ logic = options;
1132
+ }
1133
+ return logic["delete"]();
1134
+ };
1135
+ App.prototype.removeAuthLogicInAuthLogics = function (options) {
1136
+ var authLogic;
1137
+ if (typeof options === 'string') {
1138
+ authLogic = this.authLogics.find(function (item) { return item.name === options; });
1139
+ if (!authLogic) {
1140
+ throw new Error('找不到开放接口的鉴权逻辑 ' + options);
1141
+ }
1142
+ }
1143
+ else {
1144
+ authLogic = options;
1145
+ }
1146
+ return authLogic["delete"]();
1147
+ };
1148
+ App.prototype.__removeLogic = function (logic) {
1149
+ var parentKey = logic.parentKey;
1150
+ var params = {
1151
+ parentNode: this,
1152
+ parentKey: parentKey,
1153
+ index: -1,
1154
+ object: null,
1155
+ oldObject: logic
1156
+ };
1157
+ if (parentKey) {
1158
+ params.parentKey = parentKey;
1159
+ if (Array.isArray(this[parentKey])) {
1160
+ var index = this[parentKey].indexOf(logic);
1161
+ ~index && this[parentKey].splice(index, 1);
1162
+ params.index = index;
1163
+ }
1164
+ else if (this[parentKey] === logic) {
1165
+ params.index = 0;
1166
+ this[parentKey] = undefined;
1167
+ }
1168
+ }
1169
+ return params;
1170
+ };
1171
+ App.prototype.removeOverriddenLogic = function (options) {
1172
+ var overriddenLogic;
1173
+ if (typeof options === 'string') {
1174
+ overriddenLogic = this.overriddenLogics.find(function (item) { return item.name === options; });
1175
+ if (!overriddenLogic) {
1176
+ throw new Error('找不到逻辑 ' + options);
1177
+ }
1178
+ }
1179
+ else {
1180
+ overriddenLogic = options;
1181
+ }
1182
+ return overriddenLogic["delete"]();
1183
+ };
1184
+ App.prototype.__removeOverriddenLogic = function (overriddenLogic) {
1185
+ var parentKey = overriddenLogic.parentKey;
1186
+ var params = {
1187
+ parentNode: this,
1188
+ parentKey: parentKey,
1189
+ index: -1,
1190
+ object: null,
1191
+ oldObject: overriddenLogic
1192
+ };
1193
+ if (parentKey) {
1194
+ params.parentKey = parentKey;
1195
+ if (Array.isArray(this[parentKey])) {
1196
+ var index = this[parentKey].indexOf(overriddenLogic);
1197
+ ~index && this[parentKey].splice(index, 1);
1198
+ params.index = index;
1199
+ }
1200
+ else if (this[parentKey] === overriddenLogic) {
1201
+ params.index = 0;
1202
+ this[parentKey] = undefined;
1203
+ }
1204
+ }
1205
+ return params;
1206
+ };
1207
+ App.prototype.removeInterfaceInInterfaces = function (options) {
1208
+ var itface;
1209
+ if (typeof options === 'string') {
1210
+ itface = this.interfaces.find(function (item) { return item.name === options; });
1211
+ if (!itface) {
1212
+ throw new Error('找不到接口 ' + options);
1213
+ }
1214
+ }
1215
+ else {
1216
+ itface = options;
1217
+ }
1218
+ return itface["delete"]();
1219
+ };
1220
+ App.prototype.removeAuthInterfaceInInterfaces = function (options) {
1221
+ var itface;
1222
+ if (typeof options === 'string') {
1223
+ itface = this.interfaces.find(function (item) { return item.name === options; });
1224
+ if (!itface) {
1225
+ throw new Error('找不到接口 ' + options);
1226
+ }
1227
+ }
1228
+ else {
1229
+ itface = options;
1230
+ }
1231
+ return itface["delete"]();
1232
+ };
1233
+ App.prototype.__removeInterface = function (itface) {
1234
+ var parentKey = itface.parentKey;
1235
+ var params = {
1236
+ parentNode: this,
1237
+ parentKey: parentKey,
1238
+ index: -1,
1239
+ object: null,
1240
+ oldObject: itface
1241
+ };
1242
+ if (parentKey) {
1243
+ params.parentKey = parentKey;
1244
+ if (Array.isArray(this[parentKey])) {
1245
+ var index = this[parentKey].indexOf(itface);
1246
+ ~index && this[parentKey].splice(index, 1);
1247
+ params.index = index;
1248
+ }
1249
+ else if (this[parentKey] === itface) {
1250
+ params.index = 0;
1251
+ this[parentKey] = undefined;
1252
+ }
1253
+ }
1254
+ return params;
1255
+ };
1256
+ App.prototype.removeFrontend = function (options) {
1257
+ var frontend;
1258
+ if (typeof options === 'string') {
1259
+ frontend = this.frontends.find(function (item) { return item.name === options; });
1260
+ if (!frontend) {
1261
+ throw new Error('找不到端 ' + options);
1262
+ }
1263
+ }
1264
+ else {
1265
+ frontend = options;
1266
+ }
1267
+ return frontend["delete"]();
1268
+ };
1269
+ App.prototype.__removeFrontend = function (frontend) {
1270
+ var parentKey = frontend.parentKey;
1271
+ var params = {
1272
+ parentNode: this,
1273
+ parentKey: parentKey,
1274
+ index: -1,
1275
+ object: null,
1276
+ oldObject: frontend
1277
+ };
1278
+ if (parentKey) {
1279
+ params.parentKey = parentKey;
1280
+ if (Array.isArray(this[parentKey])) {
1281
+ var index = this[parentKey].indexOf(frontend);
1282
+ ~index && this[parentKey].splice(index, 1);
1283
+ params.index = index;
1284
+ }
1285
+ else if (this[parentKey] === frontend) {
1286
+ params.index = 0;
1287
+ this[parentKey] = undefined;
1288
+ }
1289
+ }
1290
+ return params;
1291
+ };
1292
+ App.prototype.removeBackend = function (options) {
1293
+ var backend;
1294
+ if (typeof options === 'string') {
1295
+ backend = this.backend;
1296
+ if (!backend) {
1297
+ throw new Error('找不到后端 ' + options);
1298
+ }
1299
+ }
1300
+ else {
1301
+ backend = options;
1302
+ }
1303
+ return backend["delete"]();
1304
+ };
1305
+ App.prototype.__removeBackend = function (backend) {
1306
+ var parentKey = backend.parentKey;
1307
+ var params = {
1308
+ parentNode: this,
1309
+ parentKey: parentKey,
1310
+ index: -1,
1311
+ object: null,
1312
+ oldObject: backend
1313
+ };
1314
+ if (parentKey) {
1315
+ params.parentKey = parentKey;
1316
+ if (Array.isArray(this[parentKey])) {
1317
+ var index = this[parentKey].indexOf(backend);
1318
+ ~index && this[parentKey].splice(index, 1);
1319
+ params.index = index;
1320
+ }
1321
+ else if (this[parentKey] === backend) {
1322
+ params.index = 0;
1323
+ this[parentKey] = undefined;
1324
+ }
1325
+ }
1326
+ return params;
1327
+ };
1328
+ App.prototype.removeProcess = function (options) {
1329
+ var process;
1330
+ if (typeof options === 'string') {
1331
+ process = this.processes.find(function (item) { return item.name === options; });
1332
+ if (!process) {
1333
+ throw new Error('找不到流程 ' + options);
1334
+ }
1335
+ }
1336
+ else {
1337
+ process = options;
1338
+ }
1339
+ return process["delete"]();
1340
+ };
1341
+ App.prototype.__removeProcess = function (process) {
1342
+ var parentKey = process.parentKey;
1343
+ var params = {
1344
+ parentNode: this,
1345
+ parentKey: parentKey,
1346
+ index: -1,
1347
+ object: null,
1348
+ oldObject: process
1349
+ };
1350
+ if (parentKey) {
1351
+ params.parentKey = parentKey;
1352
+ if (Array.isArray(this[parentKey])) {
1353
+ var index = this[parentKey].indexOf(process);
1354
+ ~index && this[parentKey].splice(index, 1);
1355
+ params.index = index;
1356
+ }
1357
+ else if (this[parentKey] === process) {
1358
+ params.index = 0;
1359
+ this[parentKey] = undefined;
1360
+ }
1361
+ }
1362
+ return params;
1363
+ };
1364
+ App.prototype.removeRole = function (options) {
1365
+ var role;
1366
+ if (typeof options === 'string') {
1367
+ role = this.roles.find(function (item) { return item.name === options; });
1368
+ if (!role) {
1369
+ throw new Error('找不到角色 ' + options);
1370
+ }
1371
+ }
1372
+ else {
1373
+ role = options;
1374
+ }
1375
+ return role["delete"]();
1376
+ };
1377
+ App.prototype.__removeRole = function (role) {
1378
+ var parentKey = role.parentKey;
1379
+ var params = {
1380
+ parentNode: this,
1381
+ parentKey: parentKey,
1382
+ index: -1,
1383
+ object: null,
1384
+ oldObject: role
1385
+ };
1386
+ if (parentKey) {
1387
+ params.parentKey = parentKey;
1388
+ if (Array.isArray(this[parentKey])) {
1389
+ var index = this[parentKey].indexOf(role);
1390
+ ~index && this[parentKey].splice(index, 1);
1391
+ params.index = index;
1392
+ }
1393
+ else if (this[parentKey] === role) {
1394
+ params.index = 0;
1395
+ this[parentKey] = undefined;
1396
+ }
1397
+ }
1398
+ return params;
1399
+ };
1400
+ App.prototype.removeConfiguration = function (options) {
1401
+ var configuration;
1402
+ if (typeof options === 'string') {
1403
+ configuration = this.configuration;
1404
+ if (!configuration) {
1405
+ throw new Error('找不到配置管理 ' + options);
1406
+ }
1407
+ }
1408
+ else {
1409
+ configuration = options;
1410
+ }
1411
+ return configuration["delete"]();
1412
+ };
1413
+ App.prototype.__removeConfiguration = function (configuration) {
1414
+ var parentKey = configuration.parentKey;
1415
+ var params = {
1416
+ parentNode: this,
1417
+ parentKey: parentKey,
1418
+ index: -1,
1419
+ object: null,
1420
+ oldObject: configuration
1421
+ };
1422
+ if (parentKey) {
1423
+ params.parentKey = parentKey;
1424
+ if (Array.isArray(this[parentKey])) {
1425
+ var index = this[parentKey].indexOf(configuration);
1426
+ ~index && this[parentKey].splice(index, 1);
1427
+ params.index = index;
1428
+ }
1429
+ else if (this[parentKey] === configuration) {
1430
+ params.index = 0;
1431
+ this[parentKey] = undefined;
1432
+ }
1433
+ }
1434
+ return params;
1435
+ };
1436
+ App.prototype.removeModuleInDependencies = function (options) {
1437
+ var module;
1438
+ if (typeof options === 'string') {
1439
+ module = this.dependencies.find(function (item) { return item.name === options; });
1440
+ if (!module) {
1441
+ throw new Error('找不到模块 ' + options);
1442
+ }
1443
+ }
1444
+ else {
1445
+ module = options;
1446
+ }
1447
+ return module["delete"]();
1448
+ };
1449
+ App.prototype.removeConnectorInDependencies = function (options) {
1450
+ var connector;
1451
+ if (typeof options === 'string') {
1452
+ connector = this.dependencies.find(function (item) { return item.name === options; });
1453
+ if (!connector) {
1454
+ throw new Error('找不到连接器 ' + options);
1455
+ }
1456
+ }
1457
+ else {
1458
+ connector = options;
1459
+ }
1460
+ return connector["delete"]();
1461
+ };
1462
+ App.prototype.removeModuleInInterfaceDependencies = function (options) {
1463
+ var module;
1464
+ if (typeof options === 'string') {
1465
+ module = this.interfaceDependencies.find(function (item) { return item.name === options; });
1466
+ if (!module) {
1467
+ throw new Error('找不到模块 ' + options);
1468
+ }
1469
+ }
1470
+ else {
1471
+ module = options;
1472
+ }
1473
+ return module["delete"]();
1474
+ };
1475
+ App.prototype.__removeModule = function (module) {
1476
+ var parentKey = module.parentKey;
1477
+ var params = {
1478
+ parentNode: this,
1479
+ parentKey: parentKey,
1480
+ index: -1,
1481
+ object: null,
1482
+ oldObject: module
1483
+ };
1484
+ if (parentKey) {
1485
+ params.parentKey = parentKey;
1486
+ if (Array.isArray(this[parentKey])) {
1487
+ var index = this[parentKey].indexOf(module);
1488
+ ~index && this[parentKey].splice(index, 1);
1489
+ params.index = index;
1490
+ }
1491
+ else if (this[parentKey] === module) {
1492
+ params.index = 0;
1493
+ this[parentKey] = undefined;
1494
+ }
1495
+ }
1496
+ return params;
1497
+ };
1498
+ App.prototype.removeIntegration = function (options) {
1499
+ var integration;
1500
+ if (typeof options === 'string') {
1501
+ integration = this.integration;
1502
+ if (!integration) {
1503
+ throw new Error('找不到集成 ' + options);
1504
+ }
1505
+ }
1506
+ else {
1507
+ integration = options;
1508
+ }
1509
+ return integration["delete"]();
1510
+ };
1511
+ App.prototype.__removeIntegration = function (integration) {
1512
+ var parentKey = integration.parentKey;
1513
+ var params = {
1514
+ parentNode: this,
1515
+ parentKey: parentKey,
1516
+ index: -1,
1517
+ object: null,
1518
+ oldObject: integration
1519
+ };
1520
+ if (parentKey) {
1521
+ params.parentKey = parentKey;
1522
+ if (Array.isArray(this[parentKey])) {
1523
+ var index = this[parentKey].indexOf(integration);
1524
+ ~index && this[parentKey].splice(index, 1);
1525
+ params.index = index;
1526
+ }
1527
+ else if (this[parentKey] === integration) {
1528
+ params.index = 0;
1529
+ this[parentKey] = undefined;
1530
+ }
1531
+ }
1532
+ return params;
1533
+ };
1534
+ App.prototype.removeAuthLogicForCallInterface = function (options) {
1535
+ var authLogicForCallInterface;
1536
+ if (typeof options === 'string') {
1537
+ authLogicForCallInterface = this.authLogicsForCallInterface.find(function (item) { return item.name === options; });
1538
+ if (!authLogicForCallInterface) {
1539
+ throw new Error('找不到调用的鉴权逻辑 ' + options);
1540
+ }
1541
+ }
1542
+ else {
1543
+ authLogicForCallInterface = options;
1544
+ }
1545
+ return authLogicForCallInterface["delete"]();
1546
+ };
1547
+ App.prototype.__removeAuthLogic = function (authLogic) {
1548
+ var parentKey = authLogic.parentKey;
1549
+ var params = {
1550
+ parentNode: this,
1551
+ parentKey: parentKey,
1552
+ index: -1,
1553
+ object: null,
1554
+ oldObject: authLogic
1555
+ };
1556
+ if (parentKey) {
1557
+ params.parentKey = parentKey;
1558
+ if (Array.isArray(this[parentKey])) {
1559
+ var index = this[parentKey].indexOf(authLogic);
1560
+ ~index && this[parentKey].splice(index, 1);
1561
+ params.index = index;
1562
+ }
1563
+ else if (this[parentKey] === authLogic) {
1564
+ params.index = 0;
1565
+ this[parentKey] = undefined;
1566
+ }
1567
+ }
1568
+ return params;
1569
+ };
1570
+ //================================================================================
1571
+ // ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
1572
+ // 自动生成的代码已结束。下面可以手动编写。
1573
+ //================================================================================
1574
+ App.prototype.findDataSourceByName = function (name) {
1575
+ return this.dataSources.find(function (dataSourceItem) { return dataSourceItem.name === name; });
1576
+ };
1577
+ Object.defineProperty(App.prototype, "defaultDS", {
1578
+ get: function () {
1579
+ var _a;
1580
+ return (_a = this.dataSources) === null || _a === void 0 ? void 0 : _a.find(function (dataSource) { return dataSource.name === 'defaultDS'; });
1581
+ },
1582
+ enumerable: false,
1583
+ configurable: true
1584
+ });
1585
+ App.prototype.findEnumByName = function (name) {
1586
+ return this.enums.find(function (enumItem) { return enumItem.name === name; });
1587
+ };
1588
+ App.prototype.findStructureByName = function (name) {
1589
+ return this.structures.find(function (item) { return item.name === name; });
1590
+ };
1591
+ App.prototype.findLogicByName = function (name) {
1592
+ return this.logics.find(function (logic) { return logic.name === name; });
1593
+ };
1594
+ /**
1595
+ * 获取命名空间
1596
+ */
1597
+ App.prototype.getNamespace = function () {
1598
+ return 'app';
1599
+ };
1600
+ App.prototype.getTsNamespace = function () {
1601
+ return "app";
1602
+ };
1603
+ App.prototype.findNodeByPath = function (nodePath) {
1604
+ return jsoner_1.queryNodeByPath(this, nodePath);
1605
+ };
1606
+ App.prototype.findNodeByCompleteName = function (completeName) {
1607
+ var nameArr = (completeName === null || completeName === void 0 ? void 0 : completeName.split('.')) || [];
1608
+ var node = this;
1609
+ // 先处理平台的
1610
+ if (completeName.startsWith('nasl')) {
1611
+ node = utils_1.getNaslNodeByNodeCallee(nameArr.splice(0, nameArr.length - 1).join('.'), nameArr[nameArr.length - 1]);
1612
+ return node;
1613
+ }
1614
+ var start = nameArr.shift();
1615
+ var mod = 0;
1616
+ var modulesMap = {
1617
+ extensions: node.dependencies,
1618
+ apis: node.interfaceDependencies,
1619
+ components: node.componentDependencies
1620
+ };
1621
+ var modules = modulesMap[start];
1622
+ if (Array.isArray(modules)) {
1623
+ var moduleName_1 = nameArr.shift();
1624
+ node = modules.find(function (moduleItem) { return moduleItem.name === moduleName_1; });
1625
+ }
1626
+ var _loop_1 = function (index) {
1627
+ if (!node) {
1628
+ return { value: null };
1629
+ }
1630
+ var nameItem = nameArr[index];
1631
+ // const isKeyword = index % 2 === mod;
1632
+ // if (!isKeyword && Array.isArray(node)) {
1633
+ // node = node.find(({ name }) => name === nameItem);
1634
+ // } else {
1635
+ // node = node[nameItem];
1636
+ // }
1637
+ if (Array.isArray(node)) {
1638
+ node = node.find(function (_a) {
1639
+ var name = _a.name;
1640
+ return name === nameItem;
1641
+ });
1642
+ }
1643
+ else {
1644
+ node = node[nameItem];
1645
+ }
1646
+ };
1647
+ for (var index = 0; index < nameArr.length; index++) {
1648
+ var state_1 = _loop_1(index);
1649
+ if (typeof state_1 === "object")
1650
+ return state_1.value;
1651
+ }
1652
+ return node;
1653
+ };
1654
+ App.prototype.loadEnvList = function () {
1655
+ this.envList = ['dev', 'online'];
1656
+ };
1657
+ App.prototype.loadPackageInfo = function (scope) {
1658
+ var dependencyMap = window.globalData.ideVersionDetail.dependencies;
1659
+ var packageInfo = {
1660
+ template: { name: '', version: '', scope: scope },
1661
+ ui: { name: '', version: '', scope: scope },
1662
+ scope: scope
1663
+ };
1664
+ packageInfo.template.name = scope === 'h5' ? '@lcap/mobile-template' : 'lcap-pc-template';
1665
+ packageInfo.template.version = scope === 'h5' ? dependencyMap.FrontendArchH5.version : dependencyMap.FrontendArchPC.version;
1666
+ packageInfo.ui.name = scope === 'h5' ? '@lcap/mobile-ui' : 'cloud-ui.vusion';
1667
+ packageInfo.ui.version = scope === 'h5' ? dependencyMap.FrontendComponentLibraryH5.version : dependencyMap.FrontendComponentLibraryPC.version;
1668
+ return packageInfo;
1669
+ };
1670
+ App.prototype.loadPackageInfos = function () {
1671
+ var _this = this;
1672
+ this.packageInfos = [];
1673
+ var scopes = ['pc', 'h5'];
1674
+ scopes.forEach(function (scope) {
1675
+ _this.packageInfos.push(_this.loadPackageInfo(scope));
1676
+ });
1677
+ };
1678
+ /**
1679
+ * 根据 packageInfo 的信息生成用于 load 的 assetsInfo
1680
+ * 在环境中需要 basic 和 custom 分开 load,否则容易报错
1681
+ * @param prefix
1682
+ */
1683
+ App.prototype.genAllAssetsInfo = function (prefix, scope) {
1684
+ // const packageInfo = this.packageInfo;
1685
+ var packageInfo = this.packageInfos.find(function (info) { return info.scope === scope; });
1686
+ var result = {
1687
+ basic: {
1688
+ js: [
1689
+ prefix + "/packages/vue@2/dist/vue.min.js",
1690
+ // `${prefix}/packages/vue-router@3/dist/vue-router.min.js`,
1691
+ scope === 'h5' ? prefix + "/packages/@lcap/mobile-ui@" + packageInfo.ui.version + "/dist-theme/index.js" : prefix + "/packages/cloud-ui.vusion@" + packageInfo.ui.version + "/dist-theme/index.js",
1692
+ scope === 'h5' ? prefix + "/packages/@lcap/mobile-template@" + packageInfo.template.version + "/cloudAdminDesigner.umd.min.js" : prefix + "/packages/lcap-pc-template@" + packageInfo.template.version + "/cloudAdminDesigner.umd.min.js",
1693
+ ],
1694
+ css: [
1695
+ scope === 'h5' ? prefix + "/packages/@lcap/mobile-ui@" + packageInfo.ui.version + "/dist-theme/index.css" : prefix + "/packages/cloud-ui.vusion@" + packageInfo.ui.version + "/dist-theme/index.css",
1696
+ scope === 'h5' ? prefix + "/packages/@lcap/mobile-template@" + packageInfo.template.version + "/cloudAdminDesigner.css" : prefix + "/packages/lcap-pc-template@" + packageInfo.template.version + "/cloudAdminDesigner.css",
1697
+ ]
1698
+ },
1699
+ custom: {
1700
+ js: [],
1701
+ css: [],
1702
+ names: []
1703
+ }
1704
+ };
1705
+ var frontends = this.frontends.filter(function (frontend) { return frontend.type === scope; });
1706
+ var existingSet = new Set();
1707
+ frontends.forEach(function (frontend) {
1708
+ frontend.componentDependencies.forEach(function (dep) {
1709
+ var name = dep.name, version = dep.version;
1710
+ var jsName = prefix + "/packages/" + name + "@" + version + "/dist-theme/index.js";
1711
+ if (!existingSet.has(jsName)) {
1712
+ existingSet.add(jsName);
1713
+ result.custom.js.push(jsName);
1714
+ if (utils.shouldLoadCss(name, version)) {
1715
+ result.custom.css.push(prefix + "/packages/" + name + "@" + version + "/dist-theme/index.css");
1716
+ }
1717
+ result.custom.names.push(name);
1718
+ }
1719
+ });
1720
+ });
1721
+ this.dependencies.forEach(function (dep) {
1722
+ (dep.frontends || []).forEach(function (frontend) {
1723
+ if (frontend.type === scope) {
1724
+ var jsName = prefix + "/packages/" + dep.name + "@" + dep.version + "/dist-theme/index.js";
1725
+ if (!existingSet.has(jsName)) {
1726
+ existingSet.add(jsName);
1727
+ result.custom.js.push(jsName);
1728
+ result.custom.names.push(dep.name);
1729
+ }
1730
+ }
1731
+ });
1732
+ });
1733
+ return result;
1734
+ };
1735
+ App.prototype.onChange = function ($event) {
1736
+ this.emit('change', $event);
1737
+ };
1738
+ App.prototype.addModuleInDependenciesWithDataSource = function (options) {
1739
+ var _this = this;
1740
+ var _a;
1741
+ this.emit('collect:start', {
1742
+ actionMsg: '导入依赖库'
1743
+ });
1744
+ var existSameNameNode = this.dependencies.find(function (l) { return l.name === options.name; });
1745
+ // 同名同版本的依赖库会替换 同名不同版本的依赖库会保留并设置为禁用
1746
+ // (options as Module).enable = true;
1747
+ if (existSameNameNode) {
1748
+ // const hasSameVersion = existSameNameNode.version === (options as Module).version;
1749
+ // if (hasSameVersion) {
1750
+ existSameNameNode["delete"]();
1751
+ // }
1752
+ // 同名的依赖库 只启用第一个
1753
+ // (options as Module).enable = hasSameVersion;
1754
+ }
1755
+ // 导入依赖库的时候如果有logic 且logic 可以被覆写 需要在app overideLogic 新增一个
1756
+ // 但是导入局部模板的时候已经手动新增了 这里就不需要了
1757
+ // 当依赖库被删除 的时候同样要删除 overideLogic
1758
+ // 支持局部模板导出导入overideLogic
1759
+ // 只复制 depLogic 输入输出参数
1760
+ var node = this.addModuleInDependencies(options);
1761
+ if ((node === null || node === void 0 ? void 0 : node.logics) && (node === null || node === void 0 ? void 0 : node.logics.length) > 0) {
1762
+ node.logics.forEach(function (logic) {
1763
+ if (logic === null || logic === void 0 ? void 0 : logic.overridable) {
1764
+ var existing = _this.overriddenLogics.find(function (ol) { return ol.name === logic.name; });
1765
+ !existing && _this.addOverriddenLogic({
1766
+ name: logic.name,
1767
+ description: logic.description,
1768
+ overriddenModule: node.name,
1769
+ returns: logic.returns.map(function (r) { return r.toJSON(); }),
1770
+ params: logic.params.map(function (r) { return r.toJSON(); })
1771
+ });
1772
+ }
1773
+ });
1774
+ }
1775
+ // 启用的依赖库才创建数据源
1776
+ // if (node.enable && node.dataSources) {
1777
+ if (node.dataSources) {
1778
+ var dataSourceGroup_1 = (_a = this.configuration) === null || _a === void 0 ? void 0 : _a.getGroup('dataSource');
1779
+ if (dataSourceGroup_1) {
1780
+ node.dataSources.forEach(function (datasource) {
1781
+ var body = ConfigProperty__1["default"].from({
1782
+ name: datasource.name,
1783
+ description: '',
1784
+ isPrivate: false,
1785
+ values: [
1786
+ { env: 'dev', value: '', concept: 'ConfigPropertyValue' },
1787
+ { env: 'online', value: '', concept: 'ConfigPropertyValue' },
1788
+ ]
1789
+ });
1790
+ dataSourceGroup_1.addConfigProperty(body);
1791
+ });
1792
+ }
1793
+ }
1794
+ this.emit('collect:end');
1795
+ };
1796
+ App.prototype.statistics = function () {
1797
+ var sum = function (list) { return list.reduce(function (curr, prev) { return prev + curr; }, 0); };
1798
+ var countView = function (list) { return list.length + sum(list.map(function (view) { return countView(view.children); })); };
1799
+ return {
1800
+ entityCount: sum(this.dataSources.map(function (dataSource) { return dataSource.entities.length; })),
1801
+ structureCount: this.structures.length,
1802
+ enumCount: this.enums.length,
1803
+ logicCount: this.logics.length,
1804
+ viewCount: sum(this.frontends.map(function (frontend) { return countView(frontend.views); })),
1805
+ processCount: this.processes.length
1806
+ };
1807
+ };
1808
+ /**
1809
+ * 需要包含依赖库里的dataSources,不自动生成
1810
+ */
1811
+ App.prototype.getDataSourceExistingNames = function (excludedList) {
1812
+ if (excludedList === void 0) { excludedList = []; }
1813
+ var excludedSet = new Set(excludedList);
1814
+ var dependDatasources = [];
1815
+ var modules = __spreadArrays(this.dependencies);
1816
+ modules.forEach(function (module) {
1817
+ if (Array.isArray(module.dataSources)) {
1818
+ dependDatasources.push.apply(dependDatasources, module.dataSources);
1819
+ }
1820
+ });
1821
+ var dataSources = this.dataSources.concat(dependDatasources);
1822
+ return (dataSources || []).filter(function (item) { return !excludedSet.has(item); }).map(function (item) { return item.name; });
1823
+ };
1824
+ /**
1825
+ * 更新全局设置 preferenceMap
1826
+ */
1827
+ App.prototype.updatePreferenceMap = function (preferences) {
1828
+ if (preferences === void 0) { preferences = {}; }
1829
+ this.emit('collect:start', { actionMsg: '修改实体表名列名' });
1830
+ var oldPreferenceMap = __assign({}, this.preferenceMap);
1831
+ Object.assign(this.preferenceMap, preferences);
1832
+ // 更新实体表名和列名
1833
+ this.dataSources.forEach(function (ds) {
1834
+ ds.entities.forEach(function (e) {
1835
+ if (oldPreferenceMap['namingConvention.tableName'] !== preferences['namingConvention.tableName']) {
1836
+ e.formatTableName();
1837
+ }
1838
+ if (oldPreferenceMap['namingConvention.columnName'] !== preferences['namingConvention.columnName']) {
1839
+ e.formatPropertyColumnName();
1840
+ }
1841
+ });
1842
+ });
1843
+ // 使撤销生效
1844
+ Object.assign(this.preferenceMap, oldPreferenceMap);
1845
+ this.update({
1846
+ preferenceMap: preferences
1847
+ });
1848
+ this.emit('collect:end');
1849
+ };
1850
+ /* 判断接口是否有误,需要重新导出 */
1851
+ App.prototype.getQualifiedInterface = function (interfaces) {
1852
+ var _this = this;
1853
+ if (interfaces === void 0) { interfaces = this.interfaces; }
1854
+ var errorList = [];
1855
+ interfaces.forEach(function (item) {
1856
+ var _a, _b, _c, _d, _e, _f, _g;
1857
+ var logic = _this.logics.find(function (logic) { return logic.name === item.originLogicName; });
1858
+ var logicParamMap = {};
1859
+ logic.params.forEach(function (param) {
1860
+ logicParamMap[param.name] = param.typeAnnotation;
1861
+ });
1862
+ item.params.forEach(function (param) {
1863
+ var _a;
1864
+ var logicTypeAnnotation = (_a = logicParamMap[param.name]) === null || _a === void 0 ? void 0 : _a.toJSON();
1865
+ delete logicParamMap[param.name];
1866
+ if (!logicTypeAnnotation) {
1867
+ return errorList.push({
1868
+ logicName: logic.name,
1869
+ interfaceName: item.name,
1870
+ param: param.name,
1871
+ type: 1,
1872
+ message: "\u53C2\u6570\u201C" + param.name + "\u201D\u5DF2\u88AB\u5220\u9664\uFF0C\u8BF7\u786E\u5B9A\u8BF7\u6C42\u7C7B\u578B\u65E0\u8BEF\u540E\u70B9\u51FB\u201C\u91CD\u65B0\u5BFC\u51FA\u201D"
1873
+ });
1874
+ }
1875
+ var interfaceTypeAnnotation = param.typeAnnotation.toJSON();
1876
+ var isSame = false;
1877
+ if ((logicTypeAnnotation === null || logicTypeAnnotation === void 0 ? void 0 : logicTypeAnnotation.typeNamespace) === 'app.enums') {
1878
+ if (interfaceTypeAnnotation.typeNamespace === 'nasl.core' && interfaceTypeAnnotation.typeName === 'String') {
1879
+ isSame = true;
1880
+ }
1881
+ }
1882
+ if (JSON.stringify(logicTypeAnnotation) === JSON.stringify(interfaceTypeAnnotation)) {
1883
+ isSame = true;
1884
+ }
1885
+ if (!isSame) {
1886
+ errorList.push({
1887
+ logicName: logic.name,
1888
+ interfaceName: item.name,
1889
+ param: param.name,
1890
+ type: 2,
1891
+ message: "\u53C2\u6570\u201C" + param.name + "\u201D\u6570\u636E\u7C7B\u578B\u53D8\u66F4\uFF0C\u8BF7\u786E\u5B9A\u8BF7\u6C42\u7C7B\u578B\u65E0\u8BEF\u540E\u70B9\u51FB\u201C\u91CD\u65B0\u5BFC\u51FA\u201D"
1892
+ });
1893
+ }
1894
+ });
1895
+ var logicReturns = logic.returns;
1896
+ var interfaceReturns = item.returns;
1897
+ if ((logicReturns === null || logicReturns === void 0 ? void 0 : logicReturns.length) > (interfaceReturns === null || interfaceReturns === void 0 ? void 0 : interfaceReturns.length)) {
1898
+ if (!logicReturns[0].typeAnnotation) {
1899
+ errorList.push({
1900
+ logicName: logic.name,
1901
+ interfaceName: item.name,
1902
+ resultName: logicReturns[0].name,
1903
+ type: 4,
1904
+ message: "\u8F93\u51FA\u53C2\u6570\u53D1\u751F\u53D8\u66F4\uFF0C\u8BF7\u70B9\u51FB\u201C\u91CD\u65B0\u5BFC\u51FA\u201D"
1905
+ });
1906
+ }
1907
+ else {
1908
+ errorList.push({
1909
+ logicName: logic.name,
1910
+ interfaceName: item.name,
1911
+ resultName: logicReturns[0].name,
1912
+ type: 4,
1913
+ message: "\u8F93\u51FA\u53C2\u6570\u53D1\u751F\u53D8\u66F4\uFF0C\u8BF7\u70B9\u51FB\u201C\u91CD\u65B0\u5BFC\u51FA\u201D"
1914
+ });
1915
+ }
1916
+ }
1917
+ else if ((logicReturns === null || logicReturns === void 0 ? void 0 : logicReturns.length) < (interfaceReturns === null || interfaceReturns === void 0 ? void 0 : interfaceReturns.length)) {
1918
+ errorList.push({
1919
+ logicName: logic.name,
1920
+ interfaceName: item.name,
1921
+ resultName: interfaceReturns[0].name,
1922
+ type: 4,
1923
+ message: "\u8F93\u51FA\u53C2\u6570\u53D1\u751F\u53D8\u66F4\uFF0C\u8BF7\u70B9\u51FB\u201C\u91CD\u65B0\u5BFC\u51FA\u201D"
1924
+ });
1925
+ }
1926
+ else if ((logicReturns === null || logicReturns === void 0 ? void 0 : logicReturns.length) === (interfaceReturns === null || interfaceReturns === void 0 ? void 0 : interfaceReturns.length)) {
1927
+ if (logicReturns.length !== 0) {
1928
+ if (logicReturns[0].name !== interfaceReturns[0].name) {
1929
+ errorList.push({
1930
+ logicName: logic.name,
1931
+ interfaceName: item.name,
1932
+ resultName: logicReturns[0].name,
1933
+ type: 4,
1934
+ message: "\u8F93\u51FA\u53C2\u6570\u53D1\u751F\u53D8\u66F4\uFF0C\u8BF7\u70B9\u51FB\u201C\u91CD\u65B0\u5BFC\u51FA\u201D"
1935
+ });
1936
+ }
1937
+ else if (!logicReturns[0].typeAnnotation) {
1938
+ if (!((_a = logicReturns[0]) === null || _a === void 0 ? void 0 : _a.__TypeAnnotation)) {
1939
+ errorList.push({
1940
+ logicName: logic.name,
1941
+ interfaceName: item.name,
1942
+ resultName: logicReturns[0].name,
1943
+ type: 7,
1944
+ message: "\u8F93\u51FA\u53C2\u6570\u201C" + logicReturns[0].name + "\u201D\u6CA1\u6709\u6570\u636E\u7C7B\u578B\uFF0C\u65E0\u6CD5\u5BFC\u51FA"
1945
+ });
1946
+ }
1947
+ else if (!((_b = logicReturns[0]) === null || _b === void 0 ? void 0 : _b.__TypeAnnotation.isSame((_c = interfaceReturns[0]) === null || _c === void 0 ? void 0 : _c.typeAnnotation))) {
1948
+ errorList.push({
1949
+ logicName: logic.name,
1950
+ interfaceName: item.name,
1951
+ resultName: logicReturns[0].name,
1952
+ type: 4,
1953
+ message: "\u8F93\u51FA\u53C2\u6570\u53D1\u751F\u53D8\u66F4\uFF0C\u8BF7\u70B9\u51FB\u201C\u91CD\u65B0\u5BFC\u51FA\u201D"
1954
+ });
1955
+ }
1956
+ }
1957
+ else if (JSON.stringify((_e = (_d = logicReturns[0]) === null || _d === void 0 ? void 0 : _d.typeAnnotation) === null || _e === void 0 ? void 0 : _e.toJSON()) !== JSON.stringify((_g = (_f = interfaceReturns[0]) === null || _f === void 0 ? void 0 : _f.typeAnnotation) === null || _g === void 0 ? void 0 : _g.toJSON())) {
1958
+ errorList.push({
1959
+ logicName: logic.name,
1960
+ interfaceName: item.name,
1961
+ resultName: logicReturns[0].name,
1962
+ type: 4,
1963
+ message: "\u8F93\u51FA\u53C2\u6570\u53D1\u751F\u53D8\u66F4\uFF0C\u8BF7\u70B9\u51FB\u201C\u91CD\u65B0\u5BFC\u51FA\u201D"
1964
+ });
1965
+ }
1966
+ }
1967
+ }
1968
+ for (var i in logicParamMap) {
1969
+ errorList.push({
1970
+ logicName: logic.name,
1971
+ param: i,
1972
+ message: "\u65B0\u589E\u53C2\u6570\u201C" + i + "\u201D\uFF0C\u8BF7\u786E\u5B9A\u8BF7\u6C42\u7C7B\u578B\u65E0\u8BEF\u540E\u70B9\u51FB\u201C\u91CD\u65B0\u5BFC\u51FA\u201D",
1973
+ type: 3
1974
+ });
1975
+ }
1976
+ });
1977
+ return errorList;
1978
+ };
1979
+ App.prototype.addFrontendForType = function (options) {
1980
+ var insertIndex = -1;
1981
+ this.frontends.forEach(function (frontend, index) {
1982
+ if (frontend.type === options.type) {
1983
+ insertIndex = index;
1984
+ }
1985
+ });
1986
+ if (options.type === 'h5' && insertIndex === -1) {
1987
+ insertIndex = this.frontends.length;
1988
+ }
1989
+ var node = this._insertFrontendAt(options, insertIndex + 1);
1990
+ var index = this.frontends.indexOf(node);
1991
+ node.create({
1992
+ index: index,
1993
+ parentNode: this,
1994
+ parentKey: 'frontends'
1995
+ });
1996
+ return node;
1997
+ };
1998
+ App.prototype.getFrontendExistingTitles = function (excludedList) {
1999
+ if (excludedList === void 0) { excludedList = []; }
2000
+ var excludedSet = new Set(excludedList);
2001
+ return (this.frontends || []).filter(function (item) { return !excludedSet.has(item); }).map(function (item) { return item.title; });
2002
+ };
2003
+ App.prototype.getExtensionsCallbackLogics = function () {
2004
+ var resultLogics = [];
2005
+ this.frontends.forEach(function (frontend) {
2006
+ resultLogics = __spreadArrays(resultLogics, frontend.getExtensionsCallbackLogics());
2007
+ });
2008
+ return Array.from(new Set(resultLogics));
2009
+ };
2010
+ App.prototype.getJavaLogicUniqueName = function (name) {
2011
+ if (name === void 0) { name = 'javalogic1'; }
2012
+ return utils.unique(name, this.getLogicExistingNames(), undefined, true);
2013
+ };
2014
+ App.prototype.getJavaLogicClassUniqueName = function (name) {
2015
+ if (name === void 0) { name = 'Javalogic1'; }
2016
+ return utils.unique(name, this.getLogicExistingNames(), undefined, true) + 'Service';
2017
+ };
2018
+ App.prototype.genAllCustomComponents = function () {
2019
+ var frontends = this.frontends;
2020
+ var compMap = {
2021
+ pc: [],
2022
+ h5: []
2023
+ };
2024
+ var existingSet = new Set();
2025
+ frontends.forEach(function (frontend) {
2026
+ if (frontend.componentDependencies) {
2027
+ frontend.componentDependencies.forEach(function (dep) {
2028
+ var name = dep.name;
2029
+ if (!existingSet.has(name)) {
2030
+ compMap[frontend.type].push(dep);
2031
+ }
2032
+ });
2033
+ }
2034
+ });
2035
+ return compMap;
2036
+ };
2037
+ Object.defineProperty(App.prototype, "sysPrefixPath", {
2038
+ /**
2039
+ * 获取 “系统统一路径前缀”
2040
+ * @returns
2041
+ */
2042
+ get: function () {
2043
+ var _this = this;
2044
+ var _a, _b, _c, _d, _e, _f;
2045
+ var uniformPathPrefix = (_f = (_e = (_d = (_c = (_b = (_a = this.configuration) === null || _a === void 0 ? void 0 : _a.groups) === null || _b === void 0 ? void 0 : _b.find(function (item) { return item.name === 'system'; })) === null || _c === void 0 ? void 0 : _c.properties) === null || _d === void 0 ? void 0 : _d.find(function (item) { return item.name === 'uniformPathPrefix'; })) === null || _e === void 0 ? void 0 : _e.values.find(function (item) { return item.env === _this.curDeployEnv; })) === null || _f === void 0 ? void 0 : _f.value;
2046
+ var sysPrefixPath = uniformPathPrefix && uniformPathPrefix !== '/' ? uniformPathPrefix : '';
2047
+ return sysPrefixPath;
2048
+ },
2049
+ enumerable: false,
2050
+ configurable: true
2051
+ });
2052
+ App.prototype.getAuthLogicExistingNames = function (excludedList) {
2053
+ if (excludedList === void 0) { excludedList = []; }
2054
+ var excludedSet = new Set(excludedList);
2055
+ return (this.authLogics || []).filter(function (item) { return !excludedSet.has(item); }).map(function (item) { return item.name; });
2056
+ };
2057
+ App.prototype.getAuthLogicUniqueName = function (name) {
2058
+ if (name === void 0) { name = 'authentication1'; }
2059
+ return utils.unique(name, this.getAuthLogicExistingNames(), undefined, true);
2060
+ };
2061
+ App.prototype.getAuthInterfaceUniqueName = function (name) {
2062
+ if (name === void 0) { name = 'authInterface1'; }
2063
+ // never used
2064
+ };
2065
+ Object.defineProperty(App.prototype, "appTimeZone", {
2066
+ get: function () {
2067
+ var _this = this;
2068
+ var _a, _b, _c, _d, _e, _f;
2069
+ return (_f = (_e = (_d = (_c = (_b = (_a = this.configuration) === null || _a === void 0 ? void 0 : _a.groups) === null || _b === void 0 ? void 0 : _b.find(function (item) { return item.name === 'system'; })) === null || _c === void 0 ? void 0 : _c.properties) === null || _d === void 0 ? void 0 : _d.find(function (item) { return item.name === 'appTimeZone'; })) === null || _e === void 0 ? void 0 : _e.values.find(function (item) { return item.env === _this.curDeployEnv; })) === null || _f === void 0 ? void 0 : _f.value;
2070
+ },
2071
+ enumerable: false,
2072
+ configurable: true
2073
+ });
2074
+ // FIXME: 没有设置 dontGenGetUniqueName 为什么 不会生成 唯一标识逻辑???
2075
+ App.prototype.getConnectorExistingNames = function (excludedList) {
2076
+ if (excludedList === void 0) { excludedList = []; }
2077
+ var excludedSet = new Set(excludedList);
2078
+ return (this.dependencies || []).filter(function (item) { return !excludedSet.has(item); }).map(function (item) { return item.name; });
2079
+ };
2080
+ App.prototype.getConnectorUniqueName = function (name) {
2081
+ if (name === void 0) { name = 'connector1'; }
2082
+ return utils.unique(name, this.getConnectorExistingNames(), undefined, false);
2083
+ };
2084
+ var App_1;
2085
+ __decorate([
2086
+ decorators_1.property()
2087
+ ], App.prototype, "id");
2088
+ __decorate([
2089
+ decorators_1.property()
2090
+ ], App.prototype, "concept");
2091
+ __decorate([
2092
+ decorators_1.property()
2093
+ ], App.prototype, "ideVersion");
2094
+ __decorate([
2095
+ decorators_1.property()
2096
+ ], App.prototype, "name");
2097
+ __decorate([
2098
+ decorators_1.property()
2099
+ ], App.prototype, "title");
2100
+ __decorate([
2101
+ decorators_1.property()
2102
+ ], App.prototype, "icon");
2103
+ __decorate([
2104
+ decorators_1.property()
2105
+ ], App.prototype, "desc");
2106
+ __decorate([
2107
+ decorators_1.property()
2108
+ ], App.prototype, "dnsAddr");
2109
+ __decorate([
2110
+ decorators_1.property()
2111
+ ], App.prototype, "hasUserCenter");
2112
+ __decorate([
2113
+ decorators_1.property()
2114
+ ], App.prototype, "hasAuth");
2115
+ __decorate([
2116
+ decorators_1.property('DataSource')
2117
+ ], App.prototype, "dataSources");
2118
+ __decorate([
2119
+ decorators_1.property('Structure')
2120
+ ], App.prototype, "structures");
2121
+ __decorate([
2122
+ decorators_1.property('Enum')
2123
+ ], App.prototype, "enums");
2124
+ __decorate([
2125
+ decorators_1.property('Logic')
2126
+ ], App.prototype, "logics");
2127
+ __decorate([
2128
+ decorators_1.property('OverriddenLogic')
2129
+ ], App.prototype, "overriddenLogics");
2130
+ __decorate([
2131
+ decorators_1.property('Interface | AuthInterface')
2132
+ ], App.prototype, "interfaces");
2133
+ __decorate([
2134
+ decorators_1.property('Frontend')
2135
+ ], App.prototype, "frontends");
2136
+ __decorate([
2137
+ decorators_1.property('Backend')
2138
+ ], App.prototype, "backend");
2139
+ __decorate([
2140
+ decorators_1.property('Process')
2141
+ ], App.prototype, "processes");
2142
+ __decorate([
2143
+ decorators_1.property('Role')
2144
+ ], App.prototype, "roles");
2145
+ __decorate([
2146
+ decorators_1.property('Configuration')
2147
+ ], App.prototype, "configuration");
2148
+ __decorate([
2149
+ decorators_1.property('Module | Connector')
2150
+ ], App.prototype, "dependencies");
2151
+ __decorate([
2152
+ decorators_1.property('Module')
2153
+ ], App.prototype, "interfaceDependencies");
2154
+ __decorate([
2155
+ decorators_1.property('Integration')
2156
+ ], App.prototype, "integration");
2157
+ __decorate([
2158
+ decorators_1.property('AuthLogic')
2159
+ ], App.prototype, "authLogics");
2160
+ __decorate([
2161
+ decorators_1.property('AuthLogicForCallInterface')
2162
+ ], App.prototype, "authLogicsForCallInterface");
2163
+ __decorate([
2164
+ decorators_1.excludedInJSON()
2165
+ ], App.prototype, "officialType");
2166
+ __decorate([
2167
+ decorators_1.excludedInJSON()
2168
+ ], App.prototype, "projectId");
2169
+ __decorate([
2170
+ decorators_1.excludedInJSON()
2171
+ ], App.prototype, "tenantId");
2172
+ __decorate([
2173
+ decorators_1.excludedInJSON()
2174
+ ], App.prototype, "userGroupId");
2175
+ __decorate([
2176
+ decorators_1.excludedInJSON()
2177
+ ], App.prototype, "envs");
2178
+ __decorate([
2179
+ decorators_1.excludedInJSON()
2180
+ ], App.prototype, "envList");
2181
+ __decorate([
2182
+ decorators_1.excludedInJSON()
2183
+ ], App.prototype, "deploying");
2184
+ __decorate([
2185
+ decorators_1.excludedInJSON()
2186
+ ], App.prototype, "deploymentId");
2187
+ __decorate([
2188
+ decorators_1.excludedInJSON()
2189
+ ], App.prototype, "templateId");
2190
+ __decorate([
2191
+ decorators_1.property()
2192
+ ], App.prototype, "preferenceMap");
2193
+ App = App_1 = __decorate([
2194
+ decorators_1.concept('应用')
2195
+ ], App);
2196
+ return App;
2197
+ }(BaseNode_1["default"]));
2198
+ exports.App = App;
2199
+ classMap_1["default"].App = App;
2200
+ exports["default"] = App;
2201
+ //================================================================================
2202
+ // ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑ ↑
2203
+ // 自动生成的代码已结束。下面可以手动编写。
2204
+ //================================================================================