@acorex/modules 18.0.14 → 18.0.15

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 (45) hide show
  1. package/application-management/index.d.ts +8 -0
  2. package/application-management/lib/application-management-mock-data.d.ts +75 -0
  3. package/application-management/lib/application-management.service.d.ts +21 -0
  4. package/application-management/lib/application-module.entity.d.ts +3 -0
  5. package/application-management/lib/applications.entity.d.ts +3 -0
  6. package/application-management/lib/edition.entity.d.ts +3 -0
  7. package/application-management/lib/entity.entity.d.ts +3 -0
  8. package/application-management/lib/feature.entity.d.ts +3 -0
  9. package/application-management/lib/modules.entity.d.ts +3 -0
  10. package/application-management/lib/permission.entity.d.ts +3 -0
  11. package/esm2022/application-management/index.mjs +9 -1
  12. package/esm2022/application-management/lib/application-management-mock-data.mjs +89 -0
  13. package/esm2022/application-management/lib/application-management.service.mjs +60 -0
  14. package/esm2022/application-management/lib/application-module.entity.mjs +273 -0
  15. package/esm2022/application-management/lib/applications.entity.mjs +311 -0
  16. package/esm2022/application-management/lib/edition.entity.mjs +284 -0
  17. package/esm2022/application-management/lib/entity.entity.mjs +284 -0
  18. package/esm2022/application-management/lib/feature.entity.mjs +284 -0
  19. package/esm2022/application-management/lib/modules.entity.mjs +324 -0
  20. package/esm2022/application-management/lib/permission.entity.mjs +284 -0
  21. package/esm2022/auth/lib/account/account.module.mjs +1 -6
  22. package/esm2022/backend/lib/auth/oidc/oidc.strategy.mjs +2 -3
  23. package/esm2022/backend/lib/data/api/data-provider.mjs +5 -3
  24. package/fesm2022/acorex-modules-application-management.mjs +2165 -2
  25. package/fesm2022/acorex-modules-application-management.mjs.map +1 -1
  26. package/fesm2022/{acorex-modules-auth-acorex-modules-auth-DDSvztIU.mjs → acorex-modules-auth-acorex-modules-auth-BD7I4S8c.mjs} +8 -13
  27. package/fesm2022/{acorex-modules-auth-acorex-modules-auth-DDSvztIU.mjs.map → acorex-modules-auth-acorex-modules-auth-BD7I4S8c.mjs.map} +1 -1
  28. package/fesm2022/{acorex-modules-auth-app-chooser.component-CQ87lFLo.mjs → acorex-modules-auth-app-chooser.component-Cfl1D1Cw.mjs} +2 -2
  29. package/fesm2022/{acorex-modules-auth-app-chooser.component-CQ87lFLo.mjs.map → acorex-modules-auth-app-chooser.component-Cfl1D1Cw.mjs.map} +1 -1
  30. package/fesm2022/{acorex-modules-auth-login.module-Ceocgnz0.mjs → acorex-modules-auth-login.module-BQG4ObmU.mjs} +4 -4
  31. package/fesm2022/{acorex-modules-auth-login.module-Ceocgnz0.mjs.map → acorex-modules-auth-login.module-BQG4ObmU.mjs.map} +1 -1
  32. package/fesm2022/{acorex-modules-auth-master.layout-D30jFVFm.mjs → acorex-modules-auth-master.layout-DoPCP7C0.mjs} +2 -2
  33. package/fesm2022/{acorex-modules-auth-master.layout-D30jFVFm.mjs.map → acorex-modules-auth-master.layout-DoPCP7C0.mjs.map} +1 -1
  34. package/fesm2022/{acorex-modules-auth-password.component-QQakXucW.mjs → acorex-modules-auth-password.component-CfhiS2hO.mjs} +2 -2
  35. package/fesm2022/{acorex-modules-auth-password.component-QQakXucW.mjs.map → acorex-modules-auth-password.component-CfhiS2hO.mjs.map} +1 -1
  36. package/fesm2022/{acorex-modules-auth-password.component-DvmIgK3z.mjs → acorex-modules-auth-password.component-fyMD7oKR.mjs} +2 -2
  37. package/fesm2022/{acorex-modules-auth-password.component-DvmIgK3z.mjs.map → acorex-modules-auth-password.component-fyMD7oKR.mjs.map} +1 -1
  38. package/fesm2022/{acorex-modules-auth-routes-Bu1uHALz.mjs → acorex-modules-auth-routes-95DQOnjS.mjs} +2 -2
  39. package/fesm2022/{acorex-modules-auth-routes-Bu1uHALz.mjs.map → acorex-modules-auth-routes-95DQOnjS.mjs.map} +1 -1
  40. package/fesm2022/{acorex-modules-auth-two-factor.module-CEcPMx4l.mjs → acorex-modules-auth-two-factor.module-BkErlA-n.mjs} +2 -2
  41. package/fesm2022/{acorex-modules-auth-two-factor.module-CEcPMx4l.mjs.map → acorex-modules-auth-two-factor.module-BkErlA-n.mjs.map} +1 -1
  42. package/fesm2022/acorex-modules-auth.mjs +1 -1
  43. package/fesm2022/acorex-modules-backend.mjs +5 -4
  44. package/fesm2022/acorex-modules-backend.mjs.map +1 -1
  45. package/package.json +7 -7
@@ -1,5 +1,8 @@
1
1
  import * as i0 from '@angular/core';
2
- import { NgModule } from '@angular/core';
2
+ import { NgModule, Injectable } from '@angular/core';
3
+ import { AXPDataGenerator, AXPStorageService, AXPEntityDataProviderImpl, AXPEntityQueryType, AXPEntityCommandScope } from '@acorex/platform/common';
4
+ import { applySortArray, applyFilterArray } from '@acorex/modules/backend';
5
+ import { AXPWidgetsCatalog } from '@acorex/platform/layout/builder';
3
6
 
4
7
  class AXMApplicationManagementModule {
5
8
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXMApplicationManagementModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
@@ -15,9 +18,2169 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImpor
15
18
  }]
16
19
  }] });
17
20
 
21
+ const APPLICATIONS = Array.from({ length: 5 }).map((_, i) => {
22
+ const source = ['appOne', 'appTwo', 'appThree', 'myCoolApp', 'awesomeApp', 'superApp'];
23
+ const name = AXPDataGenerator.pick(source);
24
+ return {
25
+ id: AXPDataGenerator.uuid(),
26
+ name: name,
27
+ title: name,
28
+ isArchived: AXPDataGenerator.boolean(),
29
+ };
30
+ });
31
+ const MODULES = Array.from({ length: 5 }).map((_, i) => {
32
+ const source = [
33
+ 'UserManagement',
34
+ 'Analytics',
35
+ 'Reporting',
36
+ 'PaymentGateway',
37
+ 'NotificationService',
38
+ 'InventoryManagement',
39
+ ];
40
+ const name = AXPDataGenerator.pick(source);
41
+ return {
42
+ id: AXPDataGenerator.uuid(),
43
+ name: name,
44
+ title: name,
45
+ isArchived: AXPDataGenerator.boolean(),
46
+ };
47
+ });
48
+ const APPLICATIONS_MODULES = Array.from({ length: 5 }).map((_, i) => {
49
+ return {
50
+ id: AXPDataGenerator.uuid(),
51
+ application: AXPDataGenerator.pick(APPLICATIONS),
52
+ module: AXPDataGenerator.pick(MODULES),
53
+ };
54
+ });
55
+ const EDITIONS = Array.from({ length: 5 }).map((_, i) => {
56
+ const source = ['Standard', 'Premium', 'Gold', 'Silver', 'Bronze', 'Platinum', 'Enterprise'];
57
+ const name = AXPDataGenerator.pick(source);
58
+ return {
59
+ id: AXPDataGenerator.uuid(),
60
+ application: AXPDataGenerator.pick(APPLICATIONS),
61
+ name: name,
62
+ title: name,
63
+ isArchived: AXPDataGenerator.boolean(),
64
+ };
65
+ });
66
+ const FEATURES = Array.from({ length: 5 }).map((_, i) => {
67
+ const source = [
68
+ 'User Authentication',
69
+ 'Data Encryption',
70
+ 'Real-time Notifications',
71
+ 'Customizable Dashboards',
72
+ 'API Access',
73
+ 'Multi-language Support',
74
+ 'Analytics and Reporting',
75
+ 'Offline Mode',
76
+ ];
77
+ const name = AXPDataGenerator.pick(source);
78
+ return {
79
+ id: AXPDataGenerator.uuid(),
80
+ module: AXPDataGenerator.pick(MODULES),
81
+ name: name,
82
+ title: name,
83
+ isArchived: AXPDataGenerator.boolean(),
84
+ };
85
+ });
86
+ const ENTITIES = Array.from({ length: 5 }).map((_, i) => {
87
+ const source = ['User', 'Product', 'Order', 'Customer', 'Transaction', 'Category', 'Review', 'InventoryItem'];
88
+ const name = AXPDataGenerator.pick(source);
89
+ return {
90
+ id: AXPDataGenerator.uuid(),
91
+ module: AXPDataGenerator.pick(MODULES),
92
+ name: name,
93
+ title: name,
94
+ isArchived: AXPDataGenerator.boolean(),
95
+ };
96
+ });
97
+ const PERMISSIONS = Array.from({ length: 5 }).map((_, i) => {
98
+ const source = ['Read', 'Write', 'Update', 'Delete', 'ManageUsers', 'ViewReports', 'AccessSettings', 'CreateContent'];
99
+ const name = AXPDataGenerator.pick(source);
100
+ return {
101
+ id: AXPDataGenerator.uuid(),
102
+ module: AXPDataGenerator.pick(MODULES),
103
+ name: name,
104
+ title: name,
105
+ isArchived: AXPDataGenerator.boolean(),
106
+ };
107
+ });
108
+
109
+ class AXPApplicationManagementService {
110
+ constructor(injector) {
111
+ const storageService = injector.get(AXPStorageService);
112
+ //
113
+ this._applicationDataProvider = new AXPEntityDataProviderImpl(storageService, 'applications');
114
+ this._applicationDataProvider.initial(APPLICATIONS);
115
+ //
116
+ this._moduleDataProvider = new AXPEntityDataProviderImpl(storageService, 'modules');
117
+ this._moduleDataProvider.initial(MODULES);
118
+ //
119
+ this._applicationModuleDataProvider = new AXPEntityDataProviderImpl(storageService, 'applications-modules');
120
+ this._applicationModuleDataProvider.initial(APPLICATIONS_MODULES);
121
+ //
122
+ this._editionDataProvider = new AXPEntityDataProviderImpl(storageService, 'editions');
123
+ this._editionDataProvider.initial(EDITIONS);
124
+ //
125
+ this._featureDataProvider = new AXPEntityDataProviderImpl(storageService, 'features');
126
+ this._featureDataProvider.initial(FEATURES);
127
+ //
128
+ this._entityDataProvider = new AXPEntityDataProviderImpl(storageService, 'entities');
129
+ this._entityDataProvider.initial(ENTITIES);
130
+ //
131
+ this._permissionDataProvider = new AXPEntityDataProviderImpl(storageService, 'permissions');
132
+ this._permissionDataProvider.initial(PERMISSIONS);
133
+ }
134
+ get applicationDataProvider() {
135
+ return this._applicationDataProvider;
136
+ }
137
+ get moduleDataProvider() {
138
+ return this._moduleDataProvider;
139
+ }
140
+ get applicationModuleDataProvider() {
141
+ return this._applicationModuleDataProvider;
142
+ }
143
+ get editionDataProvider() {
144
+ return this._editionDataProvider;
145
+ }
146
+ get featureDataProvider() {
147
+ return this._featureDataProvider;
148
+ }
149
+ get entityDataProvider() {
150
+ return this._entityDataProvider;
151
+ }
152
+ get permissionDataProvider() {
153
+ return this._permissionDataProvider;
154
+ }
155
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXPApplicationManagementService, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Injectable }); }
156
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXPApplicationManagementService, providedIn: 'root' }); }
157
+ }
158
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXPApplicationManagementService, decorators: [{
159
+ type: Injectable,
160
+ args: [{
161
+ providedIn: 'root',
162
+ }]
163
+ }], ctorParameters: () => [{ type: i0.Injector }] });
164
+
165
+ async function applicationModuleEntityFactory(injector) {
166
+ const dataService = injector.get(AXPApplicationManagementService);
167
+ const entityDef = {
168
+ module: 'application-management',
169
+ name: 'application-module',
170
+ source: 'application-management.application-module',
171
+ title: 'Modules',
172
+ formats: {
173
+ individual: 'Application Module',
174
+ plural: 'Application Module',
175
+ },
176
+ relatedEntities: [],
177
+ groups: [
178
+ {
179
+ id: 'application-module',
180
+ title: 'Application Module',
181
+ },
182
+ ],
183
+ properties: [
184
+ {
185
+ name: 'application.title',
186
+ title: 'Application Title',
187
+ groupId: 'application-module',
188
+ schema: {
189
+ dataType: 'text',
190
+ interface: {
191
+ type: AXPWidgetsCatalog.text,
192
+ },
193
+ },
194
+ },
195
+ {
196
+ name: 'module.title',
197
+ title: 'Module Title',
198
+ groupId: 'application-module',
199
+ schema: {
200
+ dataType: 'text',
201
+ interface: {
202
+ type: AXPWidgetsCatalog.text,
203
+ },
204
+ },
205
+ },
206
+ ],
207
+ columns: [{ name: 'application.title' }, { name: 'module.title' }, { name: 'isArchived' }],
208
+ commands: {
209
+ create: {
210
+ execute: async (data) => {
211
+ const entity = Object.assign(data, { id: AXPDataGenerator.uuid() });
212
+ dataService.applicationModuleDataProvider.insertOne(entity);
213
+ return Promise.resolve(entity);
214
+ },
215
+ },
216
+ delete: {
217
+ execute: async (id) => {
218
+ await await dataService.applicationModuleDataProvider.deleteOne(id);
219
+ return Promise.resolve();
220
+ },
221
+ },
222
+ update: {
223
+ execute: async (data) => {
224
+ return new Promise((resolve) => {
225
+ setTimeout(async () => {
226
+ await dataService.applicationModuleDataProvider.updateOne(data.id, data);
227
+ resolve(data);
228
+ }, 1000);
229
+ });
230
+ },
231
+ },
232
+ },
233
+ queries: {
234
+ byKey: {
235
+ execute: async (id) => {
236
+ return new Promise((resolve) => {
237
+ setTimeout(async () => {
238
+ const entity = await dataService.applicationModuleDataProvider.getOne(id);
239
+ resolve(entity);
240
+ }, 500);
241
+ });
242
+ },
243
+ type: AXPEntityQueryType.Single,
244
+ },
245
+ list: {
246
+ execute: async (e) => {
247
+ const list = await dataService.applicationModuleDataProvider.getAll();
248
+ const sortedItems = applySortArray(list, e.sort);
249
+ const filteredItems = applyFilterArray(sortedItems, e.filter ? [e.filter] : []);
250
+ return Promise.resolve({
251
+ total: filteredItems.length,
252
+ items: filteredItems.slice(e.skip, (e.skip ?? 0) + (e.take ?? 0)),
253
+ });
254
+ },
255
+ type: AXPEntityQueryType.List,
256
+ },
257
+ },
258
+ interfaces: {
259
+ master: {
260
+ create: {
261
+ sections: [
262
+ {
263
+ id: 'application',
264
+ },
265
+ ],
266
+ properties: [
267
+ {
268
+ name: 'name',
269
+ layout: {
270
+ positions: {
271
+ lg: {
272
+ colSpan: 6,
273
+ },
274
+ },
275
+ },
276
+ },
277
+ {
278
+ name: 'title',
279
+ layout: {
280
+ positions: {
281
+ lg: {
282
+ colSpan: 6,
283
+ },
284
+ },
285
+ },
286
+ },
287
+ {
288
+ name: 'isArchived',
289
+ layout: {
290
+ positions: {
291
+ lg: {
292
+ colSpan: 12,
293
+ },
294
+ },
295
+ },
296
+ },
297
+ ],
298
+ },
299
+ update: {
300
+ sections: [
301
+ {
302
+ id: 'application',
303
+ },
304
+ ],
305
+ properties: [
306
+ {
307
+ name: 'name',
308
+ layout: {
309
+ positions: {
310
+ lg: {
311
+ colSpan: 6,
312
+ },
313
+ },
314
+ },
315
+ },
316
+ {
317
+ name: 'title',
318
+ layout: {
319
+ positions: {
320
+ lg: {
321
+ colSpan: 6,
322
+ },
323
+ },
324
+ },
325
+ },
326
+ {
327
+ name: 'isArchived',
328
+ layout: {
329
+ positions: {
330
+ lg: {
331
+ colSpan: 12,
332
+ },
333
+ },
334
+ },
335
+ },
336
+ ],
337
+ },
338
+ single: {
339
+ title: '{{title}}',
340
+ sections: [
341
+ {
342
+ id: 'application',
343
+ layout: {
344
+ positions: {
345
+ lg: {
346
+ colSpan: 12,
347
+ },
348
+ },
349
+ },
350
+ },
351
+ ],
352
+ properties: [
353
+ {
354
+ name: 'name',
355
+ layout: {
356
+ positions: {
357
+ lg: {
358
+ colSpan: 6,
359
+ },
360
+ },
361
+ },
362
+ },
363
+ {
364
+ name: 'title',
365
+ layout: {
366
+ positions: {
367
+ lg: {
368
+ colSpan: 6,
369
+ },
370
+ },
371
+ },
372
+ },
373
+ {
374
+ name: 'isArchived',
375
+ layout: {
376
+ positions: {
377
+ lg: {
378
+ colSpan: 12,
379
+ },
380
+ },
381
+ },
382
+ },
383
+ ],
384
+ actions: [],
385
+ },
386
+ list: {
387
+ actions: [
388
+ {
389
+ title: 'Create New',
390
+ command: 'create-entity',
391
+ priority: 'primary',
392
+ type: 'create',
393
+ scope: AXPEntityCommandScope.TypeLevel,
394
+ },
395
+ {
396
+ title: 'Delete Items',
397
+ command: 'delete-entity',
398
+ priority: 'primary',
399
+ type: 'delete',
400
+ scope: AXPEntityCommandScope.Selected,
401
+ },
402
+ {
403
+ title: 'Details',
404
+ command: 'open-entity',
405
+ priority: 'primary',
406
+ type: 'view',
407
+ scope: AXPEntityCommandScope.Individual,
408
+ },
409
+ {
410
+ title: 'Delete',
411
+ command: 'delete-entity',
412
+ priority: 'primary',
413
+ type: 'delete',
414
+ scope: AXPEntityCommandScope.Individual,
415
+ },
416
+ ],
417
+ views: [
418
+ {
419
+ name: 'all',
420
+ title: 'All Items',
421
+ fixed: true,
422
+ columns: [],
423
+ conditions: [],
424
+ sorts: [],
425
+ },
426
+ ],
427
+ },
428
+ },
429
+ },
430
+ };
431
+ return entityDef;
432
+ }
433
+
434
+ async function applicationEntityFactory(injector) {
435
+ const dataService = injector.get(AXPApplicationManagementService);
436
+ const applicationEntityDef = {
437
+ module: 'application-management',
438
+ name: 'application',
439
+ source: 'application-management.application',
440
+ title: 'Application',
441
+ formats: {
442
+ individual: 'Application',
443
+ plural: 'Application',
444
+ },
445
+ relatedEntities: [
446
+ {
447
+ entity: 'application-management.application-module',
448
+ columns: ['application.title', 'module.title'],
449
+ conditions: [
450
+ {
451
+ name: 'application.id',
452
+ operator: {
453
+ type: 'equal',
454
+ },
455
+ value: 'id',
456
+ },
457
+ ],
458
+ },
459
+ {
460
+ entity: 'application-management.edition',
461
+ columns: ['name', 'title', 'isArchived'],
462
+ conditions: [
463
+ {
464
+ name: 'application.id',
465
+ operator: {
466
+ type: 'equal',
467
+ },
468
+ value: 'id',
469
+ },
470
+ ],
471
+ },
472
+ ],
473
+ groups: [
474
+ {
475
+ id: 'application',
476
+ title: 'Application',
477
+ },
478
+ ],
479
+ properties: [
480
+ {
481
+ name: 'name',
482
+ title: 'Name',
483
+ groupId: 'application',
484
+ schema: {
485
+ dataType: 'string',
486
+ interface: {
487
+ type: AXPWidgetsCatalog.text,
488
+ },
489
+ },
490
+ },
491
+ {
492
+ name: 'title',
493
+ title: 'Title',
494
+ groupId: 'application',
495
+ schema: {
496
+ dataType: 'string',
497
+ interface: {
498
+ type: AXPWidgetsCatalog.text,
499
+ },
500
+ },
501
+ },
502
+ {
503
+ name: 'isArchived',
504
+ title: 'Archived',
505
+ groupId: 'application',
506
+ schema: {
507
+ dataType: 'boolean',
508
+ interface: {
509
+ type: AXPWidgetsCatalog.toggle,
510
+ },
511
+ },
512
+ },
513
+ ],
514
+ columns: [{ name: 'name' }, { name: 'title' }, { name: 'isArchived' }],
515
+ commands: {
516
+ create: {
517
+ execute: async (data) => {
518
+ const entity = Object.assign(data, { id: AXPDataGenerator.uuid() });
519
+ dataService.applicationDataProvider.insertOne(entity);
520
+ return Promise.resolve(entity);
521
+ },
522
+ },
523
+ delete: {
524
+ execute: async (id) => {
525
+ await await dataService.applicationDataProvider.deleteOne(id);
526
+ return Promise.resolve();
527
+ },
528
+ },
529
+ update: {
530
+ execute: async (data) => {
531
+ return new Promise((resolve) => {
532
+ setTimeout(async () => {
533
+ await dataService.applicationDataProvider.updateOne(data.id, data);
534
+ resolve(data);
535
+ }, 1000);
536
+ });
537
+ },
538
+ },
539
+ },
540
+ queries: {
541
+ byKey: {
542
+ execute: async (id) => {
543
+ return new Promise((resolve) => {
544
+ setTimeout(async () => {
545
+ const entity = await dataService.applicationDataProvider.getOne(id);
546
+ resolve(entity);
547
+ }, 500);
548
+ });
549
+ },
550
+ type: AXPEntityQueryType.Single,
551
+ },
552
+ list: {
553
+ execute: async (e) => {
554
+ const list = await dataService.applicationDataProvider.getAll();
555
+ const sortedItems = applySortArray(list, e.sort);
556
+ const filteredItems = applyFilterArray(sortedItems, e.filter ? [e.filter] : []);
557
+ return Promise.resolve({
558
+ total: filteredItems.length,
559
+ items: filteredItems.slice(e.skip, (e.skip ?? 0) + (e.take ?? 0)),
560
+ });
561
+ },
562
+ type: AXPEntityQueryType.List,
563
+ },
564
+ },
565
+ interfaces: {
566
+ master: {
567
+ create: {
568
+ sections: [
569
+ {
570
+ id: 'application',
571
+ },
572
+ ],
573
+ properties: [
574
+ {
575
+ name: 'name',
576
+ layout: {
577
+ positions: {
578
+ lg: {
579
+ colSpan: 6,
580
+ },
581
+ },
582
+ },
583
+ },
584
+ {
585
+ name: 'title',
586
+ layout: {
587
+ positions: {
588
+ lg: {
589
+ colSpan: 6,
590
+ },
591
+ },
592
+ },
593
+ },
594
+ {
595
+ name: 'isArchived',
596
+ layout: {
597
+ positions: {
598
+ lg: {
599
+ colSpan: 12,
600
+ },
601
+ },
602
+ },
603
+ },
604
+ ],
605
+ },
606
+ update: {
607
+ sections: [
608
+ {
609
+ id: 'application',
610
+ },
611
+ ],
612
+ properties: [
613
+ {
614
+ name: 'name',
615
+ layout: {
616
+ positions: {
617
+ lg: {
618
+ colSpan: 6,
619
+ },
620
+ },
621
+ },
622
+ },
623
+ {
624
+ name: 'title',
625
+ layout: {
626
+ positions: {
627
+ lg: {
628
+ colSpan: 6,
629
+ },
630
+ },
631
+ },
632
+ },
633
+ {
634
+ name: 'isArchived',
635
+ layout: {
636
+ positions: {
637
+ lg: {
638
+ colSpan: 12,
639
+ },
640
+ },
641
+ },
642
+ },
643
+ ],
644
+ },
645
+ single: {
646
+ title: '{{title}}',
647
+ sections: [
648
+ {
649
+ id: 'application',
650
+ layout: {
651
+ positions: {
652
+ lg: {
653
+ colSpan: 12,
654
+ },
655
+ },
656
+ },
657
+ },
658
+ ],
659
+ properties: [
660
+ {
661
+ name: 'name',
662
+ layout: {
663
+ positions: {
664
+ lg: {
665
+ colSpan: 6,
666
+ },
667
+ },
668
+ },
669
+ },
670
+ {
671
+ name: 'title',
672
+ layout: {
673
+ positions: {
674
+ lg: {
675
+ colSpan: 6,
676
+ },
677
+ },
678
+ },
679
+ },
680
+ {
681
+ name: 'isArchived',
682
+ layout: {
683
+ positions: {
684
+ lg: {
685
+ colSpan: 12,
686
+ },
687
+ },
688
+ },
689
+ },
690
+ ],
691
+ actions: [],
692
+ },
693
+ list: {
694
+ actions: [
695
+ {
696
+ title: 'Create New',
697
+ command: 'create-entity',
698
+ priority: 'primary',
699
+ type: 'create',
700
+ scope: AXPEntityCommandScope.TypeLevel,
701
+ },
702
+ {
703
+ title: 'Delete Items',
704
+ command: 'delete-entity',
705
+ priority: 'primary',
706
+ type: 'delete',
707
+ scope: AXPEntityCommandScope.Selected,
708
+ },
709
+ {
710
+ title: 'Details',
711
+ command: 'open-entity',
712
+ priority: 'primary',
713
+ type: 'view',
714
+ scope: AXPEntityCommandScope.Individual,
715
+ },
716
+ {
717
+ title: 'Delete',
718
+ command: 'delete-entity',
719
+ priority: 'primary',
720
+ type: 'delete',
721
+ scope: AXPEntityCommandScope.Individual,
722
+ },
723
+ ],
724
+ views: [
725
+ {
726
+ name: 'all',
727
+ title: 'All Items',
728
+ fixed: true,
729
+ columns: [],
730
+ conditions: [],
731
+ sorts: [],
732
+ },
733
+ ],
734
+ },
735
+ },
736
+ },
737
+ };
738
+ return applicationEntityDef;
739
+ }
740
+
741
+ async function editionEntityFactory(injector) {
742
+ const dataService = injector.get(AXPApplicationManagementService);
743
+ const applicationEntityDef = {
744
+ module: 'application-management',
745
+ name: 'edition',
746
+ source: 'application-management.edition',
747
+ title: 'Editions',
748
+ formats: {
749
+ individual: 'Editions',
750
+ plural: 'Editions',
751
+ },
752
+ relatedEntities: [],
753
+ groups: [
754
+ {
755
+ id: 'edition',
756
+ title: 'Edition',
757
+ },
758
+ ],
759
+ properties: [
760
+ {
761
+ name: 'name',
762
+ title: 'Name',
763
+ groupId: 'edition',
764
+ schema: {
765
+ dataType: 'string',
766
+ interface: {
767
+ type: AXPWidgetsCatalog.text,
768
+ },
769
+ },
770
+ },
771
+ {
772
+ name: 'title',
773
+ title: 'Title',
774
+ groupId: 'edition',
775
+ schema: {
776
+ dataType: 'string',
777
+ interface: {
778
+ type: AXPWidgetsCatalog.text,
779
+ },
780
+ },
781
+ },
782
+ {
783
+ name: 'isArchived',
784
+ title: 'Archived',
785
+ groupId: 'application',
786
+ schema: {
787
+ dataType: 'boolean',
788
+ interface: {
789
+ type: AXPWidgetsCatalog.toggle,
790
+ },
791
+ },
792
+ },
793
+ ],
794
+ columns: [{ name: 'name' }, { name: 'title' }, { name: 'isArchived' }],
795
+ commands: {
796
+ create: {
797
+ execute: async (data) => {
798
+ const entity = Object.assign(data, { id: AXPDataGenerator.uuid() });
799
+ dataService.editionDataProvider.insertOne(entity);
800
+ return Promise.resolve(entity);
801
+ },
802
+ },
803
+ delete: {
804
+ execute: async (id) => {
805
+ await await dataService.editionDataProvider.deleteOne(id);
806
+ return Promise.resolve();
807
+ },
808
+ },
809
+ update: {
810
+ execute: async (data) => {
811
+ return new Promise((resolve) => {
812
+ setTimeout(async () => {
813
+ await dataService.editionDataProvider.updateOne(data.id, data);
814
+ resolve(data);
815
+ }, 1000);
816
+ });
817
+ },
818
+ },
819
+ },
820
+ queries: {
821
+ byKey: {
822
+ execute: async (id) => {
823
+ return new Promise((resolve) => {
824
+ setTimeout(async () => {
825
+ const entity = await dataService.editionDataProvider.getOne(id);
826
+ resolve(entity);
827
+ }, 500);
828
+ });
829
+ },
830
+ type: AXPEntityQueryType.Single,
831
+ },
832
+ list: {
833
+ execute: async (e) => {
834
+ const list = await dataService.editionDataProvider.getAll();
835
+ const sortedItems = applySortArray(list, e.sort);
836
+ const filteredItems = applyFilterArray(sortedItems, e.filter ? [e.filter] : []);
837
+ return Promise.resolve({
838
+ total: filteredItems.length,
839
+ items: filteredItems.slice(e.skip, (e.skip ?? 0) + (e.take ?? 0)),
840
+ });
841
+ },
842
+ type: AXPEntityQueryType.List,
843
+ },
844
+ },
845
+ interfaces: {
846
+ master: {
847
+ create: {
848
+ sections: [
849
+ {
850
+ id: 'application',
851
+ },
852
+ ],
853
+ properties: [
854
+ {
855
+ name: 'name',
856
+ layout: {
857
+ positions: {
858
+ lg: {
859
+ colSpan: 6,
860
+ },
861
+ },
862
+ },
863
+ },
864
+ {
865
+ name: 'title',
866
+ layout: {
867
+ positions: {
868
+ lg: {
869
+ colSpan: 6,
870
+ },
871
+ },
872
+ },
873
+ },
874
+ {
875
+ name: 'isArchived',
876
+ layout: {
877
+ positions: {
878
+ lg: {
879
+ colSpan: 12,
880
+ },
881
+ },
882
+ },
883
+ },
884
+ ],
885
+ },
886
+ update: {
887
+ sections: [
888
+ {
889
+ id: 'application',
890
+ },
891
+ ],
892
+ properties: [
893
+ {
894
+ name: 'name',
895
+ layout: {
896
+ positions: {
897
+ lg: {
898
+ colSpan: 6,
899
+ },
900
+ },
901
+ },
902
+ },
903
+ {
904
+ name: 'title',
905
+ layout: {
906
+ positions: {
907
+ lg: {
908
+ colSpan: 6,
909
+ },
910
+ },
911
+ },
912
+ },
913
+ {
914
+ name: 'isArchived',
915
+ layout: {
916
+ positions: {
917
+ lg: {
918
+ colSpan: 12,
919
+ },
920
+ },
921
+ },
922
+ },
923
+ ],
924
+ },
925
+ single: {
926
+ title: '{{title}}',
927
+ sections: [
928
+ {
929
+ id: 'application',
930
+ layout: {
931
+ positions: {
932
+ lg: {
933
+ colSpan: 12,
934
+ },
935
+ },
936
+ },
937
+ },
938
+ ],
939
+ properties: [
940
+ {
941
+ name: 'name',
942
+ layout: {
943
+ positions: {
944
+ lg: {
945
+ colSpan: 6,
946
+ },
947
+ },
948
+ },
949
+ },
950
+ {
951
+ name: 'title',
952
+ layout: {
953
+ positions: {
954
+ lg: {
955
+ colSpan: 6,
956
+ },
957
+ },
958
+ },
959
+ },
960
+ {
961
+ name: 'isArchived',
962
+ layout: {
963
+ positions: {
964
+ lg: {
965
+ colSpan: 12,
966
+ },
967
+ },
968
+ },
969
+ },
970
+ ],
971
+ actions: [],
972
+ },
973
+ list: {
974
+ actions: [
975
+ {
976
+ title: 'Create New',
977
+ command: 'create-entity',
978
+ priority: 'primary',
979
+ type: 'create',
980
+ scope: AXPEntityCommandScope.TypeLevel,
981
+ },
982
+ {
983
+ title: 'Delete Items',
984
+ command: 'delete-entity',
985
+ priority: 'primary',
986
+ type: 'delete',
987
+ scope: AXPEntityCommandScope.Selected,
988
+ },
989
+ {
990
+ title: 'Details',
991
+ command: 'open-entity',
992
+ priority: 'primary',
993
+ type: 'view',
994
+ scope: AXPEntityCommandScope.Individual,
995
+ },
996
+ {
997
+ title: 'Delete',
998
+ command: 'delete-entity',
999
+ priority: 'primary',
1000
+ type: 'delete',
1001
+ scope: AXPEntityCommandScope.Individual,
1002
+ },
1003
+ ],
1004
+ views: [
1005
+ {
1006
+ name: 'all',
1007
+ title: 'All Items',
1008
+ fixed: true,
1009
+ columns: [],
1010
+ conditions: [],
1011
+ sorts: [],
1012
+ },
1013
+ ],
1014
+ },
1015
+ },
1016
+ },
1017
+ };
1018
+ return applicationEntityDef;
1019
+ }
1020
+
1021
+ async function entityEntityFactory(injector) {
1022
+ const dataService = injector.get(AXPApplicationManagementService);
1023
+ const entityDef = {
1024
+ module: 'application-management',
1025
+ name: 'entity',
1026
+ source: 'application-management.entity',
1027
+ title: 'Entities',
1028
+ formats: {
1029
+ individual: 'Entity',
1030
+ plural: 'Entities',
1031
+ },
1032
+ relatedEntities: [],
1033
+ groups: [
1034
+ {
1035
+ id: 'entity',
1036
+ title: 'Entity',
1037
+ },
1038
+ ],
1039
+ properties: [
1040
+ {
1041
+ name: 'name',
1042
+ title: 'Name',
1043
+ groupId: 'entity',
1044
+ schema: {
1045
+ dataType: 'string',
1046
+ interface: {
1047
+ type: AXPWidgetsCatalog.text,
1048
+ },
1049
+ },
1050
+ },
1051
+ {
1052
+ name: 'title',
1053
+ title: 'Title',
1054
+ groupId: 'entity',
1055
+ schema: {
1056
+ dataType: 'string',
1057
+ interface: {
1058
+ type: AXPWidgetsCatalog.text,
1059
+ },
1060
+ },
1061
+ },
1062
+ {
1063
+ name: 'isArchived',
1064
+ title: 'Archived',
1065
+ groupId: 'entity',
1066
+ schema: {
1067
+ dataType: 'boolean',
1068
+ interface: {
1069
+ type: AXPWidgetsCatalog.toggle,
1070
+ },
1071
+ },
1072
+ },
1073
+ ],
1074
+ columns: [{ name: 'name' }, { name: 'title' }, { name: 'isArchived' }],
1075
+ commands: {
1076
+ create: {
1077
+ execute: async (data) => {
1078
+ const entity = Object.assign(data, { id: AXPDataGenerator.uuid() });
1079
+ dataService.entityDataProvider.insertOne(entity);
1080
+ return Promise.resolve(entity);
1081
+ },
1082
+ },
1083
+ delete: {
1084
+ execute: async (id) => {
1085
+ await await dataService.entityDataProvider.deleteOne(id);
1086
+ return Promise.resolve();
1087
+ },
1088
+ },
1089
+ update: {
1090
+ execute: async (data) => {
1091
+ return new Promise((resolve) => {
1092
+ setTimeout(async () => {
1093
+ await dataService.entityDataProvider.updateOne(data.id, data);
1094
+ resolve(data);
1095
+ }, 1000);
1096
+ });
1097
+ },
1098
+ },
1099
+ },
1100
+ queries: {
1101
+ byKey: {
1102
+ execute: async (id) => {
1103
+ return new Promise((resolve) => {
1104
+ setTimeout(async () => {
1105
+ const entity = await dataService.entityDataProvider.getOne(id);
1106
+ resolve(entity);
1107
+ }, 500);
1108
+ });
1109
+ },
1110
+ type: AXPEntityQueryType.Single,
1111
+ },
1112
+ list: {
1113
+ execute: async (e) => {
1114
+ const list = await dataService.entityDataProvider.getAll();
1115
+ const sortedItems = applySortArray(list, e.sort);
1116
+ const filteredItems = applyFilterArray(sortedItems, e.filter ? [e.filter] : []);
1117
+ return Promise.resolve({
1118
+ total: filteredItems.length,
1119
+ items: filteredItems.slice(e.skip, (e.skip ?? 0) + (e.take ?? 0)),
1120
+ });
1121
+ },
1122
+ type: AXPEntityQueryType.List,
1123
+ },
1124
+ },
1125
+ interfaces: {
1126
+ master: {
1127
+ create: {
1128
+ sections: [
1129
+ {
1130
+ id: 'entity',
1131
+ },
1132
+ ],
1133
+ properties: [
1134
+ {
1135
+ name: 'name',
1136
+ layout: {
1137
+ positions: {
1138
+ lg: {
1139
+ colSpan: 6,
1140
+ },
1141
+ },
1142
+ },
1143
+ },
1144
+ {
1145
+ name: 'title',
1146
+ layout: {
1147
+ positions: {
1148
+ lg: {
1149
+ colSpan: 6,
1150
+ },
1151
+ },
1152
+ },
1153
+ },
1154
+ {
1155
+ name: 'isArchived',
1156
+ layout: {
1157
+ positions: {
1158
+ lg: {
1159
+ colSpan: 12,
1160
+ },
1161
+ },
1162
+ },
1163
+ },
1164
+ ],
1165
+ },
1166
+ update: {
1167
+ sections: [
1168
+ {
1169
+ id: 'entity',
1170
+ },
1171
+ ],
1172
+ properties: [
1173
+ {
1174
+ name: 'name',
1175
+ layout: {
1176
+ positions: {
1177
+ lg: {
1178
+ colSpan: 6,
1179
+ },
1180
+ },
1181
+ },
1182
+ },
1183
+ {
1184
+ name: 'title',
1185
+ layout: {
1186
+ positions: {
1187
+ lg: {
1188
+ colSpan: 6,
1189
+ },
1190
+ },
1191
+ },
1192
+ },
1193
+ {
1194
+ name: 'isArchived',
1195
+ layout: {
1196
+ positions: {
1197
+ lg: {
1198
+ colSpan: 12,
1199
+ },
1200
+ },
1201
+ },
1202
+ },
1203
+ ],
1204
+ },
1205
+ single: {
1206
+ title: '{{title}}',
1207
+ sections: [
1208
+ {
1209
+ id: 'entity',
1210
+ layout: {
1211
+ positions: {
1212
+ lg: {
1213
+ colSpan: 12,
1214
+ },
1215
+ },
1216
+ },
1217
+ },
1218
+ ],
1219
+ properties: [
1220
+ {
1221
+ name: 'name',
1222
+ layout: {
1223
+ positions: {
1224
+ lg: {
1225
+ colSpan: 6,
1226
+ },
1227
+ },
1228
+ },
1229
+ },
1230
+ {
1231
+ name: 'title',
1232
+ layout: {
1233
+ positions: {
1234
+ lg: {
1235
+ colSpan: 6,
1236
+ },
1237
+ },
1238
+ },
1239
+ },
1240
+ {
1241
+ name: 'isArchived',
1242
+ layout: {
1243
+ positions: {
1244
+ lg: {
1245
+ colSpan: 12,
1246
+ },
1247
+ },
1248
+ },
1249
+ },
1250
+ ],
1251
+ actions: [],
1252
+ },
1253
+ list: {
1254
+ actions: [
1255
+ {
1256
+ title: 'Create New',
1257
+ command: 'create-entity',
1258
+ priority: 'primary',
1259
+ type: 'create',
1260
+ scope: AXPEntityCommandScope.TypeLevel,
1261
+ },
1262
+ {
1263
+ title: 'Delete Items',
1264
+ command: 'delete-entity',
1265
+ priority: 'primary',
1266
+ type: 'delete',
1267
+ scope: AXPEntityCommandScope.Selected,
1268
+ },
1269
+ {
1270
+ title: 'Details',
1271
+ command: 'open-entity',
1272
+ priority: 'primary',
1273
+ type: 'view',
1274
+ scope: AXPEntityCommandScope.Individual,
1275
+ },
1276
+ {
1277
+ title: 'Delete',
1278
+ command: 'delete-entity',
1279
+ priority: 'primary',
1280
+ type: 'delete',
1281
+ scope: AXPEntityCommandScope.Individual,
1282
+ },
1283
+ ],
1284
+ views: [
1285
+ {
1286
+ name: 'all',
1287
+ title: 'All Items',
1288
+ fixed: true,
1289
+ columns: [],
1290
+ conditions: [],
1291
+ sorts: [],
1292
+ },
1293
+ ],
1294
+ },
1295
+ },
1296
+ },
1297
+ };
1298
+ return entityDef;
1299
+ }
1300
+
1301
+ async function featureEntityFactory(injector) {
1302
+ const dataService = injector.get(AXPApplicationManagementService);
1303
+ const EntityDef = {
1304
+ module: 'application-management',
1305
+ name: 'feature',
1306
+ source: 'application-management.feature',
1307
+ title: 'Features',
1308
+ formats: {
1309
+ individual: 'Feature',
1310
+ plural: 'Feature',
1311
+ },
1312
+ relatedEntities: [],
1313
+ groups: [
1314
+ {
1315
+ id: 'feature',
1316
+ title: 'Feature',
1317
+ },
1318
+ ],
1319
+ properties: [
1320
+ {
1321
+ name: 'name',
1322
+ title: 'Name',
1323
+ groupId: 'feature',
1324
+ schema: {
1325
+ dataType: 'string',
1326
+ interface: {
1327
+ type: AXPWidgetsCatalog.text,
1328
+ },
1329
+ },
1330
+ },
1331
+ {
1332
+ name: 'title',
1333
+ title: 'Title',
1334
+ groupId: 'feature',
1335
+ schema: {
1336
+ dataType: 'string',
1337
+ interface: {
1338
+ type: AXPWidgetsCatalog.text,
1339
+ },
1340
+ },
1341
+ },
1342
+ {
1343
+ name: 'isArchived',
1344
+ title: 'Archived',
1345
+ groupId: 'feature',
1346
+ schema: {
1347
+ dataType: 'boolean',
1348
+ interface: {
1349
+ type: AXPWidgetsCatalog.toggle,
1350
+ },
1351
+ },
1352
+ },
1353
+ ],
1354
+ columns: [{ name: 'name' }, { name: 'title' }, { name: 'isArchived' }],
1355
+ commands: {
1356
+ create: {
1357
+ execute: async (data) => {
1358
+ const entity = Object.assign(data, { id: AXPDataGenerator.uuid() });
1359
+ dataService.featureDataProvider.insertOne(entity);
1360
+ return Promise.resolve(entity);
1361
+ },
1362
+ },
1363
+ delete: {
1364
+ execute: async (id) => {
1365
+ await await dataService.featureDataProvider.deleteOne(id);
1366
+ return Promise.resolve();
1367
+ },
1368
+ },
1369
+ update: {
1370
+ execute: async (data) => {
1371
+ return new Promise((resolve) => {
1372
+ setTimeout(async () => {
1373
+ await dataService.featureDataProvider.updateOne(data.id, data);
1374
+ resolve(data);
1375
+ }, 1000);
1376
+ });
1377
+ },
1378
+ },
1379
+ },
1380
+ queries: {
1381
+ byKey: {
1382
+ execute: async (id) => {
1383
+ return new Promise((resolve) => {
1384
+ setTimeout(async () => {
1385
+ const entity = await dataService.featureDataProvider.getOne(id);
1386
+ resolve(entity);
1387
+ }, 500);
1388
+ });
1389
+ },
1390
+ type: AXPEntityQueryType.Single,
1391
+ },
1392
+ list: {
1393
+ execute: async (e) => {
1394
+ const list = await dataService.featureDataProvider.getAll();
1395
+ const sortedItems = applySortArray(list, e.sort);
1396
+ const filteredItems = applyFilterArray(sortedItems, e.filter ? [e.filter] : []);
1397
+ return Promise.resolve({
1398
+ total: filteredItems.length,
1399
+ items: filteredItems.slice(e.skip, (e.skip ?? 0) + (e.take ?? 0)),
1400
+ });
1401
+ },
1402
+ type: AXPEntityQueryType.List,
1403
+ },
1404
+ },
1405
+ interfaces: {
1406
+ master: {
1407
+ create: {
1408
+ sections: [
1409
+ {
1410
+ id: 'feature',
1411
+ },
1412
+ ],
1413
+ properties: [
1414
+ {
1415
+ name: 'name',
1416
+ layout: {
1417
+ positions: {
1418
+ lg: {
1419
+ colSpan: 6,
1420
+ },
1421
+ },
1422
+ },
1423
+ },
1424
+ {
1425
+ name: 'title',
1426
+ layout: {
1427
+ positions: {
1428
+ lg: {
1429
+ colSpan: 6,
1430
+ },
1431
+ },
1432
+ },
1433
+ },
1434
+ {
1435
+ name: 'isArchived',
1436
+ layout: {
1437
+ positions: {
1438
+ lg: {
1439
+ colSpan: 12,
1440
+ },
1441
+ },
1442
+ },
1443
+ },
1444
+ ],
1445
+ },
1446
+ update: {
1447
+ sections: [
1448
+ {
1449
+ id: 'feature',
1450
+ },
1451
+ ],
1452
+ properties: [
1453
+ {
1454
+ name: 'name',
1455
+ layout: {
1456
+ positions: {
1457
+ lg: {
1458
+ colSpan: 6,
1459
+ },
1460
+ },
1461
+ },
1462
+ },
1463
+ {
1464
+ name: 'title',
1465
+ layout: {
1466
+ positions: {
1467
+ lg: {
1468
+ colSpan: 6,
1469
+ },
1470
+ },
1471
+ },
1472
+ },
1473
+ {
1474
+ name: 'isArchived',
1475
+ layout: {
1476
+ positions: {
1477
+ lg: {
1478
+ colSpan: 12,
1479
+ },
1480
+ },
1481
+ },
1482
+ },
1483
+ ],
1484
+ },
1485
+ single: {
1486
+ title: '{{title}}',
1487
+ sections: [
1488
+ {
1489
+ id: 'feature',
1490
+ layout: {
1491
+ positions: {
1492
+ lg: {
1493
+ colSpan: 12,
1494
+ },
1495
+ },
1496
+ },
1497
+ },
1498
+ ],
1499
+ properties: [
1500
+ {
1501
+ name: 'name',
1502
+ layout: {
1503
+ positions: {
1504
+ lg: {
1505
+ colSpan: 6,
1506
+ },
1507
+ },
1508
+ },
1509
+ },
1510
+ {
1511
+ name: 'title',
1512
+ layout: {
1513
+ positions: {
1514
+ lg: {
1515
+ colSpan: 6,
1516
+ },
1517
+ },
1518
+ },
1519
+ },
1520
+ {
1521
+ name: 'isArchived',
1522
+ layout: {
1523
+ positions: {
1524
+ lg: {
1525
+ colSpan: 12,
1526
+ },
1527
+ },
1528
+ },
1529
+ },
1530
+ ],
1531
+ actions: [],
1532
+ },
1533
+ list: {
1534
+ actions: [
1535
+ {
1536
+ title: 'Create New',
1537
+ command: 'create-entity',
1538
+ priority: 'primary',
1539
+ type: 'create',
1540
+ scope: AXPEntityCommandScope.TypeLevel,
1541
+ },
1542
+ {
1543
+ title: 'Delete Items',
1544
+ command: 'delete-entity',
1545
+ priority: 'primary',
1546
+ type: 'delete',
1547
+ scope: AXPEntityCommandScope.Selected,
1548
+ },
1549
+ {
1550
+ title: 'Details',
1551
+ command: 'open-entity',
1552
+ priority: 'primary',
1553
+ type: 'view',
1554
+ scope: AXPEntityCommandScope.Individual,
1555
+ },
1556
+ {
1557
+ title: 'Delete',
1558
+ command: 'delete-entity',
1559
+ priority: 'primary',
1560
+ type: 'delete',
1561
+ scope: AXPEntityCommandScope.Individual,
1562
+ },
1563
+ ],
1564
+ views: [
1565
+ {
1566
+ name: 'all',
1567
+ title: 'All Items',
1568
+ fixed: true,
1569
+ columns: [],
1570
+ conditions: [],
1571
+ sorts: [],
1572
+ },
1573
+ ],
1574
+ },
1575
+ },
1576
+ },
1577
+ };
1578
+ return EntityDef;
1579
+ }
1580
+
1581
+ async function modulesEntityFactory(injector) {
1582
+ const dataService = injector.get(AXPApplicationManagementService);
1583
+ const entityDef = {
1584
+ module: 'application-management',
1585
+ name: 'module',
1586
+ source: 'application-management.module',
1587
+ title: 'Modules',
1588
+ formats: {
1589
+ individual: 'Modules',
1590
+ plural: 'Modules',
1591
+ },
1592
+ relatedEntities: [
1593
+ {
1594
+ entity: 'application-management.feature',
1595
+ columns: ['module.title', 'name', 'title', 'isArchived'],
1596
+ conditions: [
1597
+ {
1598
+ name: 'module.id',
1599
+ operator: {
1600
+ type: 'equal',
1601
+ },
1602
+ value: 'id',
1603
+ },
1604
+ ],
1605
+ },
1606
+ {
1607
+ entity: 'application-management.entity',
1608
+ columns: ['module.title', 'name', 'title', 'isArchived'],
1609
+ conditions: [
1610
+ {
1611
+ name: 'module.id',
1612
+ operator: {
1613
+ type: 'equal',
1614
+ },
1615
+ value: 'id',
1616
+ },
1617
+ ],
1618
+ },
1619
+ {
1620
+ entity: 'application-management.permission',
1621
+ columns: ['module.title', 'name', 'title', 'isArchived'],
1622
+ conditions: [
1623
+ {
1624
+ name: 'module.id',
1625
+ operator: {
1626
+ type: 'equal',
1627
+ },
1628
+ value: 'id',
1629
+ },
1630
+ ],
1631
+ },
1632
+ ],
1633
+ groups: [
1634
+ {
1635
+ id: 'modules',
1636
+ title: 'Modules',
1637
+ },
1638
+ ],
1639
+ properties: [
1640
+ {
1641
+ name: 'name',
1642
+ title: 'Name',
1643
+ groupId: 'modules',
1644
+ schema: {
1645
+ dataType: 'string',
1646
+ interface: {
1647
+ type: AXPWidgetsCatalog.text,
1648
+ },
1649
+ },
1650
+ },
1651
+ {
1652
+ name: 'title',
1653
+ title: 'Title',
1654
+ groupId: 'modules',
1655
+ schema: {
1656
+ dataType: 'string',
1657
+ interface: {
1658
+ type: AXPWidgetsCatalog.text,
1659
+ },
1660
+ },
1661
+ },
1662
+ {
1663
+ name: 'isArchived',
1664
+ title: 'Archived',
1665
+ groupId: 'modules',
1666
+ schema: {
1667
+ dataType: 'boolean',
1668
+ interface: {
1669
+ type: AXPWidgetsCatalog.toggle,
1670
+ },
1671
+ },
1672
+ },
1673
+ ],
1674
+ columns: [{ name: 'name' }, { name: 'title' }, { name: 'isArchived' }],
1675
+ commands: {
1676
+ create: {
1677
+ execute: async (data) => {
1678
+ const entity = Object.assign(data, { id: AXPDataGenerator.uuid() });
1679
+ dataService.moduleDataProvider.insertOne(entity);
1680
+ return Promise.resolve(entity);
1681
+ },
1682
+ },
1683
+ delete: {
1684
+ execute: async (id) => {
1685
+ await await dataService.moduleDataProvider.deleteOne(id);
1686
+ return Promise.resolve();
1687
+ },
1688
+ },
1689
+ update: {
1690
+ execute: async (data) => {
1691
+ return new Promise((resolve) => {
1692
+ setTimeout(async () => {
1693
+ await dataService.moduleDataProvider.updateOne(data.id, data);
1694
+ resolve(data);
1695
+ }, 1000);
1696
+ });
1697
+ },
1698
+ },
1699
+ },
1700
+ queries: {
1701
+ byKey: {
1702
+ execute: async (id) => {
1703
+ return new Promise((resolve) => {
1704
+ setTimeout(async () => {
1705
+ const entity = await dataService.moduleDataProvider.getOne(id);
1706
+ resolve(entity);
1707
+ }, 500);
1708
+ });
1709
+ },
1710
+ type: AXPEntityQueryType.Single,
1711
+ },
1712
+ list: {
1713
+ execute: async (e) => {
1714
+ const list = await dataService.moduleDataProvider.getAll();
1715
+ const sortedItems = applySortArray(list, e.sort);
1716
+ const filteredItems = applyFilterArray(sortedItems, e.filter ? [e.filter] : []);
1717
+ return Promise.resolve({
1718
+ total: filteredItems.length,
1719
+ items: filteredItems.slice(e.skip, (e.skip ?? 0) + (e.take ?? 0)),
1720
+ });
1721
+ },
1722
+ type: AXPEntityQueryType.List,
1723
+ },
1724
+ },
1725
+ interfaces: {
1726
+ master: {
1727
+ create: {
1728
+ sections: [
1729
+ {
1730
+ id: 'modules',
1731
+ },
1732
+ ],
1733
+ properties: [
1734
+ {
1735
+ name: 'name',
1736
+ layout: {
1737
+ positions: {
1738
+ lg: {
1739
+ colSpan: 6,
1740
+ },
1741
+ },
1742
+ },
1743
+ },
1744
+ {
1745
+ name: 'title',
1746
+ layout: {
1747
+ positions: {
1748
+ lg: {
1749
+ colSpan: 6,
1750
+ },
1751
+ },
1752
+ },
1753
+ },
1754
+ {
1755
+ name: 'isArchived',
1756
+ layout: {
1757
+ positions: {
1758
+ lg: {
1759
+ colSpan: 12,
1760
+ },
1761
+ },
1762
+ },
1763
+ },
1764
+ ],
1765
+ },
1766
+ update: {
1767
+ sections: [
1768
+ {
1769
+ id: 'application',
1770
+ },
1771
+ ],
1772
+ properties: [
1773
+ {
1774
+ name: 'name',
1775
+ layout: {
1776
+ positions: {
1777
+ lg: {
1778
+ colSpan: 6,
1779
+ },
1780
+ },
1781
+ },
1782
+ },
1783
+ {
1784
+ name: 'title',
1785
+ layout: {
1786
+ positions: {
1787
+ lg: {
1788
+ colSpan: 6,
1789
+ },
1790
+ },
1791
+ },
1792
+ },
1793
+ {
1794
+ name: 'isArchived',
1795
+ layout: {
1796
+ positions: {
1797
+ lg: {
1798
+ colSpan: 12,
1799
+ },
1800
+ },
1801
+ },
1802
+ },
1803
+ ],
1804
+ },
1805
+ single: {
1806
+ title: '{{title}}',
1807
+ sections: [
1808
+ {
1809
+ id: 'modules',
1810
+ layout: {
1811
+ positions: {
1812
+ lg: {
1813
+ colSpan: 12,
1814
+ },
1815
+ },
1816
+ },
1817
+ },
1818
+ ],
1819
+ properties: [
1820
+ {
1821
+ name: 'name',
1822
+ layout: {
1823
+ positions: {
1824
+ lg: {
1825
+ colSpan: 6,
1826
+ },
1827
+ },
1828
+ },
1829
+ },
1830
+ {
1831
+ name: 'title',
1832
+ layout: {
1833
+ positions: {
1834
+ lg: {
1835
+ colSpan: 6,
1836
+ },
1837
+ },
1838
+ },
1839
+ },
1840
+ {
1841
+ name: 'isArchived',
1842
+ layout: {
1843
+ positions: {
1844
+ lg: {
1845
+ colSpan: 12,
1846
+ },
1847
+ },
1848
+ },
1849
+ },
1850
+ ],
1851
+ actions: [],
1852
+ },
1853
+ list: {
1854
+ actions: [
1855
+ {
1856
+ title: 'Create New',
1857
+ command: 'create-entity',
1858
+ priority: 'primary',
1859
+ type: 'create',
1860
+ scope: AXPEntityCommandScope.TypeLevel,
1861
+ },
1862
+ {
1863
+ title: 'Delete Items',
1864
+ command: 'delete-entity',
1865
+ priority: 'primary',
1866
+ type: 'delete',
1867
+ scope: AXPEntityCommandScope.Selected,
1868
+ },
1869
+ {
1870
+ title: 'Details',
1871
+ command: 'open-entity',
1872
+ priority: 'primary',
1873
+ type: 'view',
1874
+ scope: AXPEntityCommandScope.Individual,
1875
+ },
1876
+ {
1877
+ title: 'Delete',
1878
+ command: 'delete-entity',
1879
+ priority: 'primary',
1880
+ type: 'delete',
1881
+ scope: AXPEntityCommandScope.Individual,
1882
+ },
1883
+ ],
1884
+ views: [
1885
+ {
1886
+ name: 'all',
1887
+ title: 'All Items',
1888
+ fixed: true,
1889
+ columns: [],
1890
+ conditions: [],
1891
+ sorts: [],
1892
+ },
1893
+ ],
1894
+ },
1895
+ },
1896
+ },
1897
+ };
1898
+ return entityDef;
1899
+ }
1900
+
1901
+ async function permissionEntityFactory(injector) {
1902
+ const dataService = injector.get(AXPApplicationManagementService);
1903
+ const entityDef = {
1904
+ module: 'application-management',
1905
+ name: 'permission',
1906
+ source: 'application-management.permission',
1907
+ title: 'Permissions',
1908
+ formats: {
1909
+ individual: 'Permission',
1910
+ plural: 'Permissions',
1911
+ },
1912
+ relatedEntities: [],
1913
+ groups: [
1914
+ {
1915
+ id: 'permission',
1916
+ title: 'Permission',
1917
+ },
1918
+ ],
1919
+ properties: [
1920
+ {
1921
+ name: 'name',
1922
+ title: 'Name',
1923
+ groupId: 'permission',
1924
+ schema: {
1925
+ dataType: 'string',
1926
+ interface: {
1927
+ type: AXPWidgetsCatalog.text,
1928
+ },
1929
+ },
1930
+ },
1931
+ {
1932
+ name: 'title',
1933
+ title: 'Title',
1934
+ groupId: 'permission',
1935
+ schema: {
1936
+ dataType: 'string',
1937
+ interface: {
1938
+ type: AXPWidgetsCatalog.text,
1939
+ },
1940
+ },
1941
+ },
1942
+ {
1943
+ name: 'isArchived',
1944
+ title: 'Archived',
1945
+ groupId: 'permission',
1946
+ schema: {
1947
+ dataType: 'boolean',
1948
+ interface: {
1949
+ type: AXPWidgetsCatalog.toggle,
1950
+ },
1951
+ },
1952
+ },
1953
+ ],
1954
+ columns: [{ name: 'name' }, { name: 'title' }, { name: 'isArchived' }],
1955
+ commands: {
1956
+ create: {
1957
+ execute: async (data) => {
1958
+ const entity = Object.assign(data, { id: AXPDataGenerator.uuid() });
1959
+ dataService.permissionDataProvider.insertOne(entity);
1960
+ return Promise.resolve(entity);
1961
+ },
1962
+ },
1963
+ delete: {
1964
+ execute: async (id) => {
1965
+ await await dataService.permissionDataProvider.deleteOne(id);
1966
+ return Promise.resolve();
1967
+ },
1968
+ },
1969
+ update: {
1970
+ execute: async (data) => {
1971
+ return new Promise((resolve) => {
1972
+ setTimeout(async () => {
1973
+ await dataService.permissionDataProvider.updateOne(data.id, data);
1974
+ resolve(data);
1975
+ }, 1000);
1976
+ });
1977
+ },
1978
+ },
1979
+ },
1980
+ queries: {
1981
+ byKey: {
1982
+ execute: async (id) => {
1983
+ return new Promise((resolve) => {
1984
+ setTimeout(async () => {
1985
+ const entity = await dataService.permissionDataProvider.getOne(id);
1986
+ resolve(entity);
1987
+ }, 500);
1988
+ });
1989
+ },
1990
+ type: AXPEntityQueryType.Single,
1991
+ },
1992
+ list: {
1993
+ execute: async (e) => {
1994
+ const list = await dataService.permissionDataProvider.getAll();
1995
+ const sortedItems = applySortArray(list, e.sort);
1996
+ const filteredItems = applyFilterArray(sortedItems, e.filter ? [e.filter] : []);
1997
+ return Promise.resolve({
1998
+ total: filteredItems.length,
1999
+ items: filteredItems.slice(e.skip, (e.skip ?? 0) + (e.take ?? 0)),
2000
+ });
2001
+ },
2002
+ type: AXPEntityQueryType.List,
2003
+ },
2004
+ },
2005
+ interfaces: {
2006
+ master: {
2007
+ create: {
2008
+ sections: [
2009
+ {
2010
+ id: 'permission',
2011
+ },
2012
+ ],
2013
+ properties: [
2014
+ {
2015
+ name: 'name',
2016
+ layout: {
2017
+ positions: {
2018
+ lg: {
2019
+ colSpan: 6,
2020
+ },
2021
+ },
2022
+ },
2023
+ },
2024
+ {
2025
+ name: 'title',
2026
+ layout: {
2027
+ positions: {
2028
+ lg: {
2029
+ colSpan: 6,
2030
+ },
2031
+ },
2032
+ },
2033
+ },
2034
+ {
2035
+ name: 'isArchived',
2036
+ layout: {
2037
+ positions: {
2038
+ lg: {
2039
+ colSpan: 12,
2040
+ },
2041
+ },
2042
+ },
2043
+ },
2044
+ ],
2045
+ },
2046
+ update: {
2047
+ sections: [
2048
+ {
2049
+ id: 'permission',
2050
+ },
2051
+ ],
2052
+ properties: [
2053
+ {
2054
+ name: 'name',
2055
+ layout: {
2056
+ positions: {
2057
+ lg: {
2058
+ colSpan: 6,
2059
+ },
2060
+ },
2061
+ },
2062
+ },
2063
+ {
2064
+ name: 'title',
2065
+ layout: {
2066
+ positions: {
2067
+ lg: {
2068
+ colSpan: 6,
2069
+ },
2070
+ },
2071
+ },
2072
+ },
2073
+ {
2074
+ name: 'isArchived',
2075
+ layout: {
2076
+ positions: {
2077
+ lg: {
2078
+ colSpan: 12,
2079
+ },
2080
+ },
2081
+ },
2082
+ },
2083
+ ],
2084
+ },
2085
+ single: {
2086
+ title: '{{title}}',
2087
+ sections: [
2088
+ {
2089
+ id: 'permission',
2090
+ layout: {
2091
+ positions: {
2092
+ lg: {
2093
+ colSpan: 12,
2094
+ },
2095
+ },
2096
+ },
2097
+ },
2098
+ ],
2099
+ properties: [
2100
+ {
2101
+ name: 'name',
2102
+ layout: {
2103
+ positions: {
2104
+ lg: {
2105
+ colSpan: 6,
2106
+ },
2107
+ },
2108
+ },
2109
+ },
2110
+ {
2111
+ name: 'title',
2112
+ layout: {
2113
+ positions: {
2114
+ lg: {
2115
+ colSpan: 6,
2116
+ },
2117
+ },
2118
+ },
2119
+ },
2120
+ {
2121
+ name: 'isArchived',
2122
+ layout: {
2123
+ positions: {
2124
+ lg: {
2125
+ colSpan: 12,
2126
+ },
2127
+ },
2128
+ },
2129
+ },
2130
+ ],
2131
+ actions: [],
2132
+ },
2133
+ list: {
2134
+ actions: [
2135
+ {
2136
+ title: 'Create New',
2137
+ command: 'create-entity',
2138
+ priority: 'primary',
2139
+ type: 'create',
2140
+ scope: AXPEntityCommandScope.TypeLevel,
2141
+ },
2142
+ {
2143
+ title: 'Delete Items',
2144
+ command: 'delete-entity',
2145
+ priority: 'primary',
2146
+ type: 'delete',
2147
+ scope: AXPEntityCommandScope.Selected,
2148
+ },
2149
+ {
2150
+ title: 'Details',
2151
+ command: 'open-entity',
2152
+ priority: 'primary',
2153
+ type: 'view',
2154
+ scope: AXPEntityCommandScope.Individual,
2155
+ },
2156
+ {
2157
+ title: 'Delete',
2158
+ command: 'delete-entity',
2159
+ priority: 'primary',
2160
+ type: 'delete',
2161
+ scope: AXPEntityCommandScope.Individual,
2162
+ },
2163
+ ],
2164
+ views: [
2165
+ {
2166
+ name: 'all',
2167
+ title: 'All Items',
2168
+ fixed: true,
2169
+ columns: [],
2170
+ conditions: [],
2171
+ sorts: [],
2172
+ },
2173
+ ],
2174
+ },
2175
+ },
2176
+ },
2177
+ };
2178
+ return entityDef;
2179
+ }
2180
+
18
2181
  /**
19
2182
  * Generated bundle index. Do not edit.
20
2183
  */
21
2184
 
22
- export { AXMApplicationManagementModule };
2185
+ export { AXMApplicationManagementModule, AXPApplicationManagementService, applicationEntityFactory, applicationModuleEntityFactory, editionEntityFactory, entityEntityFactory, featureEntityFactory, modulesEntityFactory, permissionEntityFactory };
23
2186
  //# sourceMappingURL=acorex-modules-application-management.mjs.map