@acorex/modules 18.0.14 → 18.0.16

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 (91) hide show
  1. package/application-management/index.d.ts +10 -0
  2. package/application-management/lib/application-management-mock-data.d.ts +75 -0
  3. package/application-management/lib/application-management.module.d.ts +11 -2
  4. package/application-management/lib/application-management.service.d.ts +23 -0
  5. package/application-management/lib/entities/application-module.entity.d.ts +3 -0
  6. package/application-management/lib/entities/applications.entity.d.ts +3 -0
  7. package/application-management/lib/entities/edition.entity.d.ts +3 -0
  8. package/application-management/lib/entities/entity.entity.d.ts +3 -0
  9. package/application-management/lib/entities/feature.entity.d.ts +3 -0
  10. package/application-management/lib/entities/modules.entity.d.ts +3 -0
  11. package/application-management/lib/entities/permission.entity.d.ts +3 -0
  12. package/application-management/lib/entities/property.entity.d.ts +3 -0
  13. package/application-management/lib/module-designer/module-designer.component.d.ts +18 -0
  14. package/application-management/lib/module-designer/module-designer.service.d.ts +34 -0
  15. package/auth/lib/error-handler.d.ts +1 -1
  16. package/backend/lib/data/api/comment.service.d.ts +15 -0
  17. package/backend/lib/data/api/module-designer.service.d.ts +43 -0
  18. package/backend/lib/data/index.d.ts +2 -1
  19. package/backend/lib/data/local/local-data-provider.d.ts +1 -2
  20. package/esm2022/application-management/index.mjs +11 -1
  21. package/esm2022/application-management/lib/application-management-mock-data.mjs +89 -0
  22. package/esm2022/application-management/lib/application-management.module.mjs +56 -7
  23. package/esm2022/application-management/lib/application-management.service.mjs +66 -0
  24. package/esm2022/application-management/lib/entities/application-module.entity.mjs +273 -0
  25. package/esm2022/application-management/lib/entities/applications.entity.mjs +311 -0
  26. package/esm2022/application-management/lib/entities/edition.entity.mjs +284 -0
  27. package/esm2022/application-management/lib/entities/entity.entity.mjs +284 -0
  28. package/esm2022/application-management/lib/entities/feature.entity.mjs +284 -0
  29. package/esm2022/application-management/lib/entities/modules.entity.mjs +324 -0
  30. package/esm2022/application-management/lib/entities/permission.entity.mjs +284 -0
  31. package/esm2022/application-management/lib/entities/property.entity.mjs +449 -0
  32. package/esm2022/application-management/lib/module-designer/module-designer.component.mjs +91 -0
  33. package/esm2022/application-management/lib/module-designer/module-designer.service.mjs +3 -0
  34. package/esm2022/auth/lib/account/account.module.mjs +1 -6
  35. package/esm2022/auth/lib/error-handler.mjs +6 -6
  36. package/esm2022/backend/lib/auth/oidc/oidc.strategy.mjs +2 -3
  37. package/esm2022/backend/lib/backend.module.mjs +23 -5
  38. package/esm2022/backend/lib/data/api/comment.service.mjs +48 -0
  39. package/esm2022/backend/lib/data/api/data-provider.mjs +6 -4
  40. package/esm2022/backend/lib/data/api/module-designer.service.mjs +95 -0
  41. package/esm2022/backend/lib/data/index.mjs +3 -2
  42. package/esm2022/backend/lib/data/local/local-data-provider.mjs +2 -2
  43. package/esm2022/form-management/acorex-modules-form-management.mjs +5 -0
  44. package/esm2022/form-management/index.mjs +2 -0
  45. package/esm2022/form-management/lib/designer/designer.page.mjs +24 -0
  46. package/esm2022/form-management/lib/form-management.module.mjs +29 -0
  47. package/fesm2022/acorex-modules-application-management-module-designer.component-KlwqCJCF.mjs +100 -0
  48. package/fesm2022/acorex-modules-application-management-module-designer.component-KlwqCJCF.mjs.map +1 -0
  49. package/fesm2022/acorex-modules-application-management.mjs +2693 -7
  50. package/fesm2022/acorex-modules-application-management.mjs.map +1 -1
  51. package/fesm2022/{acorex-modules-auth-acorex-modules-auth-DDSvztIU.mjs → acorex-modules-auth-acorex-modules-auth-D09VaQPe.mjs} +12 -17
  52. package/fesm2022/acorex-modules-auth-acorex-modules-auth-D09VaQPe.mjs.map +1 -0
  53. package/fesm2022/{acorex-modules-auth-app-chooser.component-CQ87lFLo.mjs → acorex-modules-auth-app-chooser.component-DN1ZJiZs.mjs} +2 -2
  54. package/fesm2022/{acorex-modules-auth-app-chooser.component-CQ87lFLo.mjs.map → acorex-modules-auth-app-chooser.component-DN1ZJiZs.mjs.map} +1 -1
  55. package/fesm2022/{acorex-modules-auth-login.module-Ceocgnz0.mjs → acorex-modules-auth-login.module-CGA5aTg2.mjs} +5 -5
  56. package/fesm2022/{acorex-modules-auth-login.module-Ceocgnz0.mjs.map → acorex-modules-auth-login.module-CGA5aTg2.mjs.map} +1 -1
  57. package/fesm2022/{acorex-modules-auth-master.layout-D30jFVFm.mjs → acorex-modules-auth-master.layout-ZJWzjLrb.mjs} +2 -2
  58. package/fesm2022/{acorex-modules-auth-master.layout-D30jFVFm.mjs.map → acorex-modules-auth-master.layout-ZJWzjLrb.mjs.map} +1 -1
  59. package/fesm2022/{acorex-modules-auth-password.component-DvmIgK3z.mjs → acorex-modules-auth-password.component-C4yqf342.mjs} +3 -3
  60. package/fesm2022/{acorex-modules-auth-password.component-DvmIgK3z.mjs.map → acorex-modules-auth-password.component-C4yqf342.mjs.map} +1 -1
  61. package/fesm2022/{acorex-modules-auth-password.component-QQakXucW.mjs → acorex-modules-auth-password.component-MJhNk3UI.mjs} +2 -2
  62. package/fesm2022/{acorex-modules-auth-password.component-QQakXucW.mjs.map → acorex-modules-auth-password.component-MJhNk3UI.mjs.map} +1 -1
  63. package/fesm2022/{acorex-modules-auth-routes-Bu1uHALz.mjs → acorex-modules-auth-routes-DhORV1Js.mjs} +2 -2
  64. package/fesm2022/{acorex-modules-auth-routes-Bu1uHALz.mjs.map → acorex-modules-auth-routes-DhORV1Js.mjs.map} +1 -1
  65. package/fesm2022/{acorex-modules-auth-two-factor.module-CEcPMx4l.mjs → acorex-modules-auth-two-factor.module-BWKP0_jO.mjs} +3 -3
  66. package/fesm2022/{acorex-modules-auth-two-factor.module-CEcPMx4l.mjs.map → acorex-modules-auth-two-factor.module-BWKP0_jO.mjs.map} +1 -1
  67. package/fesm2022/acorex-modules-auth.mjs +4 -4
  68. package/fesm2022/acorex-modules-backend.mjs +159 -141
  69. package/fesm2022/acorex-modules-backend.mjs.map +1 -1
  70. package/fesm2022/acorex-modules-form-management-designer.page-SoPH2V7i.mjs +27 -0
  71. package/fesm2022/acorex-modules-form-management-designer.page-SoPH2V7i.mjs.map +1 -0
  72. package/fesm2022/acorex-modules-form-management.mjs +36 -0
  73. package/fesm2022/acorex-modules-form-management.mjs.map +1 -0
  74. package/form-management/README.md +4 -0
  75. package/form-management/index.d.ts +1 -0
  76. package/form-management/lib/designer/designer.page.d.ts +5 -0
  77. package/form-management/lib/form-management.module.d.ts +7 -0
  78. package/package.json +6 -6
  79. package/backend/lib/data/local/data-Conditioner.d.ts +0 -6
  80. package/esm2022/backend/lib/data/local/data-Conditioner.mjs +0 -138
  81. package/esm2022/log-management/acorex-modules-log-management.mjs +0 -5
  82. package/esm2022/log-management/index.mjs +0 -3
  83. package/esm2022/log-management/lib/audit-logs.entity.mjs +0 -391
  84. package/esm2022/log-management/lib/log-management.module.mjs +0 -16
  85. package/fesm2022/acorex-modules-auth-acorex-modules-auth-DDSvztIU.mjs.map +0 -1
  86. package/fesm2022/acorex-modules-log-management.mjs +0 -414
  87. package/fesm2022/acorex-modules-log-management.mjs.map +0 -1
  88. package/log-management/README.md +0 -4
  89. package/log-management/index.d.ts +0 -2
  90. package/log-management/lib/audit-logs.entity.d.ts +0 -3
  91. package/log-management/lib/log-management.module.d.ts +0 -6
@@ -1,23 +1,2709 @@
1
+ import { AXPEntityDefinitionRegistryService } from '@acorex/platform/layout/entity';
2
+ import { AXPRootLayoutComponent } from '@acorex/platform/themes/default';
1
3
  import * as i0 from '@angular/core';
2
- import { NgModule } from '@angular/core';
4
+ import { Injector, NgModule, Optional, Inject, Injectable } from '@angular/core';
5
+ import * as i1 from '@angular/router';
6
+ import { RouterModule } from '@angular/router';
7
+ import { AXPDataGenerator, AXPStorageService, AXPEntityDataProviderImpl, AXPEntityQueryType, AXPEntityCommandScope } from '@acorex/platform/common';
8
+ import { applySortArray, applyFilterArray } from '@acorex/platform/core';
9
+ import { AXPWidgetsCatalog } from '@acorex/platform/layout/builder';
3
10
 
11
+ const routes = [
12
+ {
13
+ component: AXPRootLayoutComponent,
14
+ path: 'console',
15
+ children: [
16
+ {
17
+ path: 'module-designer',
18
+ loadComponent: () => import('./acorex-modules-application-management-module-designer.component-KlwqCJCF.mjs').then((c) => c.AXMModuleDesignerComponent),
19
+ },
20
+ ],
21
+ },
22
+ ];
4
23
  class AXMApplicationManagementModule {
5
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXMApplicationManagementModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
6
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.0", ngImport: i0, type: AXMApplicationManagementModule }); }
7
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXMApplicationManagementModule }); }
24
+ static forRoot() {
25
+ return {
26
+ ngModule: AXMApplicationManagementModule,
27
+ providers: [
28
+ {
29
+ provide: 'AXP_REGISTER_MODULES_ENTITIES',
30
+ useFactory: async (entityRegistry, injector) => {
31
+ const modulesEntity = await (await Promise.resolve().then(function () { return modules_entity; })).modulesEntityFactory(injector);
32
+ entityRegistry.register(modulesEntity);
33
+ //
34
+ const entityEntity = await (await Promise.resolve().then(function () { return entity_entity; })).entityEntityFactory(injector);
35
+ entityRegistry.register(entityEntity);
36
+ //
37
+ const permissionEntity = await (await Promise.resolve().then(function () { return permission_entity; })).permissionEntityFactory(injector);
38
+ entityRegistry.register(permissionEntity);
39
+ //
40
+ const featureEntity = await (await Promise.resolve().then(function () { return feature_entity; })).featureEntityFactory(injector);
41
+ entityRegistry.register(featureEntity);
42
+ },
43
+ deps: [AXPEntityDefinitionRegistryService, Injector], // Add any dependencies if needed
44
+ },
45
+ ],
46
+ };
47
+ }
48
+ /**
49
+ * @ignore
50
+ */
51
+ constructor(instances) { }
52
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXMApplicationManagementModule, deps: [{ token: 'AXP_REGISTER_MODULES_ENTITIES', optional: true }], target: i0.ɵɵFactoryTarget.NgModule }); }
53
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.0", ngImport: i0, type: AXMApplicationManagementModule, imports: [i1.RouterModule] }); }
54
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXMApplicationManagementModule, imports: [RouterModule.forChild(routes)] }); }
8
55
  }
9
56
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXMApplicationManagementModule, decorators: [{
10
57
  type: NgModule,
11
58
  args: [{
12
- imports: [],
59
+ imports: [RouterModule.forChild(routes)],
13
60
  exports: [],
14
61
  declarations: [],
15
62
  }]
16
- }] });
63
+ }], ctorParameters: () => [{ type: undefined, decorators: [{
64
+ type: Optional
65
+ }, {
66
+ type: Inject,
67
+ args: ['AXP_REGISTER_MODULES_ENTITIES']
68
+ }] }] });
69
+
70
+ const APPLICATIONS = Array.from({ length: 5 }).map((_, i) => {
71
+ const source = ['appOne', 'appTwo', 'appThree', 'myCoolApp', 'awesomeApp', 'superApp'];
72
+ const name = AXPDataGenerator.pick(source);
73
+ return {
74
+ id: AXPDataGenerator.uuid(),
75
+ name: name,
76
+ title: name,
77
+ isArchived: AXPDataGenerator.boolean(),
78
+ };
79
+ });
80
+ const MODULES = Array.from({ length: 5 }).map((_, i) => {
81
+ const source = [
82
+ 'UserManagement',
83
+ 'Analytics',
84
+ 'Reporting',
85
+ 'PaymentGateway',
86
+ 'NotificationService',
87
+ 'InventoryManagement',
88
+ ];
89
+ const name = AXPDataGenerator.pick(source);
90
+ return {
91
+ id: AXPDataGenerator.uuid(),
92
+ name: name,
93
+ title: name,
94
+ isArchived: AXPDataGenerator.boolean(),
95
+ };
96
+ });
97
+ const APPLICATIONS_MODULES = Array.from({ length: 5 }).map((_, i) => {
98
+ return {
99
+ id: AXPDataGenerator.uuid(),
100
+ application: AXPDataGenerator.pick(APPLICATIONS),
101
+ module: AXPDataGenerator.pick(MODULES),
102
+ };
103
+ });
104
+ const EDITIONS = Array.from({ length: 5 }).map((_, i) => {
105
+ const source = ['Standard', 'Premium', 'Gold', 'Silver', 'Bronze', 'Platinum', 'Enterprise'];
106
+ const name = AXPDataGenerator.pick(source);
107
+ return {
108
+ id: AXPDataGenerator.uuid(),
109
+ application: AXPDataGenerator.pick(APPLICATIONS),
110
+ name: name,
111
+ title: name,
112
+ isArchived: AXPDataGenerator.boolean(),
113
+ };
114
+ });
115
+ const FEATURES = Array.from({ length: 5 }).map((_, i) => {
116
+ const source = [
117
+ 'User Authentication',
118
+ 'Data Encryption',
119
+ 'Real-time Notifications',
120
+ 'Customizable Dashboards',
121
+ 'API Access',
122
+ 'Multi-language Support',
123
+ 'Analytics and Reporting',
124
+ 'Offline Mode',
125
+ ];
126
+ const name = AXPDataGenerator.pick(source);
127
+ return {
128
+ id: AXPDataGenerator.uuid(),
129
+ module: AXPDataGenerator.pick(MODULES),
130
+ name: name,
131
+ title: name,
132
+ isArchived: AXPDataGenerator.boolean(),
133
+ };
134
+ });
135
+ const ENTITIES = Array.from({ length: 5 }).map((_, i) => {
136
+ const source = ['User', 'Product', 'Order', 'Customer', 'Transaction', 'Category', 'Review', 'InventoryItem'];
137
+ const name = AXPDataGenerator.pick(source);
138
+ return {
139
+ id: AXPDataGenerator.uuid(),
140
+ module: AXPDataGenerator.pick(MODULES),
141
+ name: name,
142
+ title: name,
143
+ isArchived: AXPDataGenerator.boolean(),
144
+ };
145
+ });
146
+ const PERMISSIONS = Array.from({ length: 5 }).map((_, i) => {
147
+ const source = ['Read', 'Write', 'Update', 'Delete', 'ManageUsers', 'ViewReports', 'AccessSettings', 'CreateContent'];
148
+ const name = AXPDataGenerator.pick(source);
149
+ return {
150
+ id: AXPDataGenerator.uuid(),
151
+ module: AXPDataGenerator.pick(MODULES),
152
+ name: name,
153
+ title: name,
154
+ isArchived: AXPDataGenerator.boolean(),
155
+ };
156
+ });
157
+
158
+ class AXPApplicationManagementService {
159
+ constructor(injector) {
160
+ const storageService = injector.get(AXPStorageService);
161
+ //
162
+ this._applicationDataProvider = new AXPEntityDataProviderImpl(storageService, 'applications');
163
+ this._applicationDataProvider.initial(APPLICATIONS);
164
+ //
165
+ this._moduleDataProvider = new AXPEntityDataProviderImpl(storageService, 'modules');
166
+ this._moduleDataProvider.initial(MODULES);
167
+ //
168
+ this._applicationModuleDataProvider = new AXPEntityDataProviderImpl(storageService, 'applications-modules');
169
+ this._applicationModuleDataProvider.initial(APPLICATIONS_MODULES);
170
+ //
171
+ this._editionDataProvider = new AXPEntityDataProviderImpl(storageService, 'editions');
172
+ this._editionDataProvider.initial(EDITIONS);
173
+ //
174
+ this._featureDataProvider = new AXPEntityDataProviderImpl(storageService, 'features');
175
+ this._featureDataProvider.initial(FEATURES);
176
+ //
177
+ this._entityDataProvider = new AXPEntityDataProviderImpl(storageService, 'entities');
178
+ this._entityDataProvider.initial(ENTITIES);
179
+ //
180
+ this._propertyDataProvider = new AXPEntityDataProviderImpl(storageService, 'properties');
181
+ this._propertyDataProvider.initial([]);
182
+ //
183
+ this._permissionDataProvider = new AXPEntityDataProviderImpl(storageService, 'permissions');
184
+ this._permissionDataProvider.initial(PERMISSIONS);
185
+ }
186
+ get applicationDataProvider() {
187
+ return this._applicationDataProvider;
188
+ }
189
+ get moduleDataProvider() {
190
+ return this._moduleDataProvider;
191
+ }
192
+ get applicationModuleDataProvider() {
193
+ return this._applicationModuleDataProvider;
194
+ }
195
+ get editionDataProvider() {
196
+ return this._editionDataProvider;
197
+ }
198
+ get featureDataProvider() {
199
+ return this._featureDataProvider;
200
+ }
201
+ get entityDataProvider() {
202
+ return this._entityDataProvider;
203
+ }
204
+ get propertyDataProvider() {
205
+ return this._propertyDataProvider;
206
+ }
207
+ get permissionDataProvider() {
208
+ return this._permissionDataProvider;
209
+ }
210
+ 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 }); }
211
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXPApplicationManagementService, providedIn: 'root' }); }
212
+ }
213
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXPApplicationManagementService, decorators: [{
214
+ type: Injectable,
215
+ args: [{
216
+ providedIn: 'root',
217
+ }]
218
+ }], ctorParameters: () => [{ type: i0.Injector }] });
219
+
220
+ async function applicationModuleEntityFactory(injector) {
221
+ const dataService = injector.get(AXPApplicationManagementService);
222
+ const entityDef = {
223
+ module: 'application-management',
224
+ name: 'application-module',
225
+ source: 'application-management.application-module',
226
+ title: 'Modules',
227
+ formats: {
228
+ individual: 'Application Module',
229
+ plural: 'Application Module',
230
+ },
231
+ relatedEntities: [],
232
+ groups: [
233
+ {
234
+ id: 'application-module',
235
+ title: 'Application Module',
236
+ },
237
+ ],
238
+ properties: [
239
+ {
240
+ name: 'application.title',
241
+ title: 'Application Title',
242
+ groupId: 'application-module',
243
+ schema: {
244
+ dataType: 'text',
245
+ interface: {
246
+ type: AXPWidgetsCatalog.text,
247
+ },
248
+ },
249
+ },
250
+ {
251
+ name: 'module.title',
252
+ title: 'Module Title',
253
+ groupId: 'application-module',
254
+ schema: {
255
+ dataType: 'text',
256
+ interface: {
257
+ type: AXPWidgetsCatalog.text,
258
+ },
259
+ },
260
+ },
261
+ ],
262
+ columns: [{ name: 'application.title' }, { name: 'module.title' }, { name: 'isArchived' }],
263
+ commands: {
264
+ create: {
265
+ execute: async (data) => {
266
+ const entity = Object.assign(data, { id: AXPDataGenerator.uuid() });
267
+ dataService.applicationModuleDataProvider.insertOne(entity);
268
+ return Promise.resolve(entity);
269
+ },
270
+ },
271
+ delete: {
272
+ execute: async (id) => {
273
+ await await dataService.applicationModuleDataProvider.deleteOne(id);
274
+ return Promise.resolve();
275
+ },
276
+ },
277
+ update: {
278
+ execute: async (data) => {
279
+ return new Promise((resolve) => {
280
+ setTimeout(async () => {
281
+ await dataService.applicationModuleDataProvider.updateOne(data.id, data);
282
+ resolve(data);
283
+ }, 1000);
284
+ });
285
+ },
286
+ },
287
+ },
288
+ queries: {
289
+ byKey: {
290
+ execute: async (id) => {
291
+ return new Promise((resolve) => {
292
+ setTimeout(async () => {
293
+ const entity = await dataService.applicationModuleDataProvider.getOne(id);
294
+ resolve(entity);
295
+ }, 500);
296
+ });
297
+ },
298
+ type: AXPEntityQueryType.Single,
299
+ },
300
+ list: {
301
+ execute: async (e) => {
302
+ const list = await dataService.applicationModuleDataProvider.getAll();
303
+ const sortedItems = applySortArray(list, e.sort);
304
+ const filteredItems = applyFilterArray(sortedItems, e.filter ? [e.filter] : []);
305
+ return Promise.resolve({
306
+ total: filteredItems.length,
307
+ items: filteredItems.slice(e.skip, (e.skip ?? 0) + (e.take ?? 0)),
308
+ });
309
+ },
310
+ type: AXPEntityQueryType.List,
311
+ },
312
+ },
313
+ interfaces: {
314
+ master: {
315
+ create: {
316
+ sections: [
317
+ {
318
+ id: 'application',
319
+ },
320
+ ],
321
+ properties: [
322
+ {
323
+ name: 'name',
324
+ layout: {
325
+ positions: {
326
+ lg: {
327
+ colSpan: 6,
328
+ },
329
+ },
330
+ },
331
+ },
332
+ {
333
+ name: 'title',
334
+ layout: {
335
+ positions: {
336
+ lg: {
337
+ colSpan: 6,
338
+ },
339
+ },
340
+ },
341
+ },
342
+ {
343
+ name: 'isArchived',
344
+ layout: {
345
+ positions: {
346
+ lg: {
347
+ colSpan: 12,
348
+ },
349
+ },
350
+ },
351
+ },
352
+ ],
353
+ },
354
+ update: {
355
+ sections: [
356
+ {
357
+ id: 'application',
358
+ },
359
+ ],
360
+ properties: [
361
+ {
362
+ name: 'name',
363
+ layout: {
364
+ positions: {
365
+ lg: {
366
+ colSpan: 6,
367
+ },
368
+ },
369
+ },
370
+ },
371
+ {
372
+ name: 'title',
373
+ layout: {
374
+ positions: {
375
+ lg: {
376
+ colSpan: 6,
377
+ },
378
+ },
379
+ },
380
+ },
381
+ {
382
+ name: 'isArchived',
383
+ layout: {
384
+ positions: {
385
+ lg: {
386
+ colSpan: 12,
387
+ },
388
+ },
389
+ },
390
+ },
391
+ ],
392
+ },
393
+ single: {
394
+ title: '{{title}}',
395
+ sections: [
396
+ {
397
+ id: 'application',
398
+ layout: {
399
+ positions: {
400
+ lg: {
401
+ colSpan: 12,
402
+ },
403
+ },
404
+ },
405
+ },
406
+ ],
407
+ properties: [
408
+ {
409
+ name: 'name',
410
+ layout: {
411
+ positions: {
412
+ lg: {
413
+ colSpan: 6,
414
+ },
415
+ },
416
+ },
417
+ },
418
+ {
419
+ name: 'title',
420
+ layout: {
421
+ positions: {
422
+ lg: {
423
+ colSpan: 6,
424
+ },
425
+ },
426
+ },
427
+ },
428
+ {
429
+ name: 'isArchived',
430
+ layout: {
431
+ positions: {
432
+ lg: {
433
+ colSpan: 12,
434
+ },
435
+ },
436
+ },
437
+ },
438
+ ],
439
+ actions: [],
440
+ },
441
+ list: {
442
+ actions: [
443
+ {
444
+ title: 'Create New',
445
+ command: 'create-entity',
446
+ priority: 'primary',
447
+ type: 'create',
448
+ scope: AXPEntityCommandScope.TypeLevel,
449
+ },
450
+ {
451
+ title: 'Delete Items',
452
+ command: 'delete-entity',
453
+ priority: 'primary',
454
+ type: 'delete',
455
+ scope: AXPEntityCommandScope.Selected,
456
+ },
457
+ {
458
+ title: 'Details',
459
+ command: 'open-entity',
460
+ priority: 'primary',
461
+ type: 'view',
462
+ scope: AXPEntityCommandScope.Individual,
463
+ },
464
+ {
465
+ title: 'Delete',
466
+ command: 'delete-entity',
467
+ priority: 'primary',
468
+ type: 'delete',
469
+ scope: AXPEntityCommandScope.Individual,
470
+ },
471
+ ],
472
+ views: [
473
+ {
474
+ name: 'all',
475
+ title: 'All Items',
476
+ fixed: true,
477
+ columns: [],
478
+ conditions: [],
479
+ sorts: [],
480
+ },
481
+ ],
482
+ },
483
+ },
484
+ },
485
+ };
486
+ return entityDef;
487
+ }
488
+
489
+ async function applicationEntityFactory(injector) {
490
+ const dataService = injector.get(AXPApplicationManagementService);
491
+ const applicationEntityDef = {
492
+ module: 'application-management',
493
+ name: 'application',
494
+ source: 'application-management.application',
495
+ title: 'Application',
496
+ formats: {
497
+ individual: 'Application',
498
+ plural: 'Application',
499
+ },
500
+ relatedEntities: [
501
+ {
502
+ entity: 'application-management.application-module',
503
+ columns: ['application.title', 'module.title'],
504
+ conditions: [
505
+ {
506
+ name: 'application.id',
507
+ operator: {
508
+ type: 'equal',
509
+ },
510
+ value: 'id',
511
+ },
512
+ ],
513
+ },
514
+ {
515
+ entity: 'application-management.edition',
516
+ columns: ['name', 'title', 'isArchived'],
517
+ conditions: [
518
+ {
519
+ name: 'application.id',
520
+ operator: {
521
+ type: 'equal',
522
+ },
523
+ value: 'id',
524
+ },
525
+ ],
526
+ },
527
+ ],
528
+ groups: [
529
+ {
530
+ id: 'application',
531
+ title: 'Application',
532
+ },
533
+ ],
534
+ properties: [
535
+ {
536
+ name: 'name',
537
+ title: 'Name',
538
+ groupId: 'application',
539
+ schema: {
540
+ dataType: 'string',
541
+ interface: {
542
+ type: AXPWidgetsCatalog.text,
543
+ },
544
+ },
545
+ },
546
+ {
547
+ name: 'title',
548
+ title: 'Title',
549
+ groupId: 'application',
550
+ schema: {
551
+ dataType: 'string',
552
+ interface: {
553
+ type: AXPWidgetsCatalog.text,
554
+ },
555
+ },
556
+ },
557
+ {
558
+ name: 'isArchived',
559
+ title: 'Archived',
560
+ groupId: 'application',
561
+ schema: {
562
+ dataType: 'boolean',
563
+ interface: {
564
+ type: AXPWidgetsCatalog.toggle,
565
+ },
566
+ },
567
+ },
568
+ ],
569
+ columns: [{ name: 'name' }, { name: 'title' }, { name: 'isArchived' }],
570
+ commands: {
571
+ create: {
572
+ execute: async (data) => {
573
+ const entity = Object.assign(data, { id: AXPDataGenerator.uuid() });
574
+ dataService.applicationDataProvider.insertOne(entity);
575
+ return Promise.resolve(entity);
576
+ },
577
+ },
578
+ delete: {
579
+ execute: async (id) => {
580
+ await await dataService.applicationDataProvider.deleteOne(id);
581
+ return Promise.resolve();
582
+ },
583
+ },
584
+ update: {
585
+ execute: async (data) => {
586
+ return new Promise((resolve) => {
587
+ setTimeout(async () => {
588
+ await dataService.applicationDataProvider.updateOne(data.id, data);
589
+ resolve(data);
590
+ }, 1000);
591
+ });
592
+ },
593
+ },
594
+ },
595
+ queries: {
596
+ byKey: {
597
+ execute: async (id) => {
598
+ return new Promise((resolve) => {
599
+ setTimeout(async () => {
600
+ const entity = await dataService.applicationDataProvider.getOne(id);
601
+ resolve(entity);
602
+ }, 500);
603
+ });
604
+ },
605
+ type: AXPEntityQueryType.Single,
606
+ },
607
+ list: {
608
+ execute: async (e) => {
609
+ const list = await dataService.applicationDataProvider.getAll();
610
+ const sortedItems = applySortArray(list, e.sort);
611
+ const filteredItems = applyFilterArray(sortedItems, e.filter ? [e.filter] : []);
612
+ return Promise.resolve({
613
+ total: filteredItems.length,
614
+ items: filteredItems.slice(e.skip, (e.skip ?? 0) + (e.take ?? 0)),
615
+ });
616
+ },
617
+ type: AXPEntityQueryType.List,
618
+ },
619
+ },
620
+ interfaces: {
621
+ master: {
622
+ create: {
623
+ sections: [
624
+ {
625
+ id: 'application',
626
+ },
627
+ ],
628
+ properties: [
629
+ {
630
+ name: 'name',
631
+ layout: {
632
+ positions: {
633
+ lg: {
634
+ colSpan: 6,
635
+ },
636
+ },
637
+ },
638
+ },
639
+ {
640
+ name: 'title',
641
+ layout: {
642
+ positions: {
643
+ lg: {
644
+ colSpan: 6,
645
+ },
646
+ },
647
+ },
648
+ },
649
+ {
650
+ name: 'isArchived',
651
+ layout: {
652
+ positions: {
653
+ lg: {
654
+ colSpan: 12,
655
+ },
656
+ },
657
+ },
658
+ },
659
+ ],
660
+ },
661
+ update: {
662
+ sections: [
663
+ {
664
+ id: 'application',
665
+ },
666
+ ],
667
+ properties: [
668
+ {
669
+ name: 'name',
670
+ layout: {
671
+ positions: {
672
+ lg: {
673
+ colSpan: 6,
674
+ },
675
+ },
676
+ },
677
+ },
678
+ {
679
+ name: 'title',
680
+ layout: {
681
+ positions: {
682
+ lg: {
683
+ colSpan: 6,
684
+ },
685
+ },
686
+ },
687
+ },
688
+ {
689
+ name: 'isArchived',
690
+ layout: {
691
+ positions: {
692
+ lg: {
693
+ colSpan: 12,
694
+ },
695
+ },
696
+ },
697
+ },
698
+ ],
699
+ },
700
+ single: {
701
+ title: '{{title}}',
702
+ sections: [
703
+ {
704
+ id: 'application',
705
+ layout: {
706
+ positions: {
707
+ lg: {
708
+ colSpan: 12,
709
+ },
710
+ },
711
+ },
712
+ },
713
+ ],
714
+ properties: [
715
+ {
716
+ name: 'name',
717
+ layout: {
718
+ positions: {
719
+ lg: {
720
+ colSpan: 6,
721
+ },
722
+ },
723
+ },
724
+ },
725
+ {
726
+ name: 'title',
727
+ layout: {
728
+ positions: {
729
+ lg: {
730
+ colSpan: 6,
731
+ },
732
+ },
733
+ },
734
+ },
735
+ {
736
+ name: 'isArchived',
737
+ layout: {
738
+ positions: {
739
+ lg: {
740
+ colSpan: 12,
741
+ },
742
+ },
743
+ },
744
+ },
745
+ ],
746
+ actions: [],
747
+ },
748
+ list: {
749
+ actions: [
750
+ {
751
+ title: 'Create New',
752
+ command: 'create-entity',
753
+ priority: 'primary',
754
+ type: 'create',
755
+ scope: AXPEntityCommandScope.TypeLevel,
756
+ },
757
+ {
758
+ title: 'Delete Items',
759
+ command: 'delete-entity',
760
+ priority: 'primary',
761
+ type: 'delete',
762
+ scope: AXPEntityCommandScope.Selected,
763
+ },
764
+ {
765
+ title: 'Details',
766
+ command: 'open-entity',
767
+ priority: 'primary',
768
+ type: 'view',
769
+ scope: AXPEntityCommandScope.Individual,
770
+ },
771
+ {
772
+ title: 'Delete',
773
+ command: 'delete-entity',
774
+ priority: 'primary',
775
+ type: 'delete',
776
+ scope: AXPEntityCommandScope.Individual,
777
+ },
778
+ ],
779
+ views: [
780
+ {
781
+ name: 'all',
782
+ title: 'All Items',
783
+ fixed: true,
784
+ columns: [],
785
+ conditions: [],
786
+ sorts: [],
787
+ },
788
+ ],
789
+ },
790
+ },
791
+ },
792
+ };
793
+ return applicationEntityDef;
794
+ }
795
+
796
+ async function editionEntityFactory(injector) {
797
+ const dataService = injector.get(AXPApplicationManagementService);
798
+ const entityDef = {
799
+ module: 'application-management',
800
+ name: 'edition',
801
+ source: 'application-management.edition',
802
+ title: 'Editions',
803
+ formats: {
804
+ individual: 'Editions',
805
+ plural: 'Editions',
806
+ },
807
+ relatedEntities: [],
808
+ groups: [
809
+ {
810
+ id: 'edition',
811
+ title: 'Edition',
812
+ },
813
+ ],
814
+ properties: [
815
+ {
816
+ name: 'name',
817
+ title: 'Name',
818
+ groupId: 'edition',
819
+ schema: {
820
+ dataType: 'string',
821
+ interface: {
822
+ type: AXPWidgetsCatalog.text,
823
+ },
824
+ },
825
+ },
826
+ {
827
+ name: 'title',
828
+ title: 'Title',
829
+ groupId: 'edition',
830
+ schema: {
831
+ dataType: 'string',
832
+ interface: {
833
+ type: AXPWidgetsCatalog.text,
834
+ },
835
+ },
836
+ },
837
+ {
838
+ name: 'isArchived',
839
+ title: 'Archived',
840
+ groupId: 'edition',
841
+ schema: {
842
+ dataType: 'boolean',
843
+ interface: {
844
+ type: AXPWidgetsCatalog.toggle,
845
+ },
846
+ },
847
+ },
848
+ ],
849
+ columns: [{ name: 'name' }, { name: 'title' }, { name: 'isArchived' }],
850
+ commands: {
851
+ create: {
852
+ execute: async (data) => {
853
+ const entity = Object.assign(data, { id: AXPDataGenerator.uuid() });
854
+ dataService.editionDataProvider.insertOne(entity);
855
+ return Promise.resolve(entity);
856
+ },
857
+ },
858
+ delete: {
859
+ execute: async (id) => {
860
+ await await dataService.editionDataProvider.deleteOne(id);
861
+ return Promise.resolve();
862
+ },
863
+ },
864
+ update: {
865
+ execute: async (data) => {
866
+ return new Promise((resolve) => {
867
+ setTimeout(async () => {
868
+ await dataService.editionDataProvider.updateOne(data.id, data);
869
+ resolve(data);
870
+ }, 1000);
871
+ });
872
+ },
873
+ },
874
+ },
875
+ queries: {
876
+ byKey: {
877
+ execute: async (id) => {
878
+ return new Promise((resolve) => {
879
+ setTimeout(async () => {
880
+ const entity = await dataService.editionDataProvider.getOne(id);
881
+ resolve(entity);
882
+ }, 500);
883
+ });
884
+ },
885
+ type: AXPEntityQueryType.Single,
886
+ },
887
+ list: {
888
+ execute: async (e) => {
889
+ const list = await dataService.editionDataProvider.getAll();
890
+ const sortedItems = applySortArray(list, e.sort);
891
+ const filteredItems = applyFilterArray(sortedItems, e.filter ? [e.filter] : []);
892
+ return Promise.resolve({
893
+ total: filteredItems.length,
894
+ items: filteredItems.slice(e.skip, (e.skip ?? 0) + (e.take ?? 0)),
895
+ });
896
+ },
897
+ type: AXPEntityQueryType.List,
898
+ },
899
+ },
900
+ interfaces: {
901
+ master: {
902
+ create: {
903
+ sections: [
904
+ {
905
+ id: 'edition',
906
+ },
907
+ ],
908
+ properties: [
909
+ {
910
+ name: 'name',
911
+ layout: {
912
+ positions: {
913
+ lg: {
914
+ colSpan: 6,
915
+ },
916
+ },
917
+ },
918
+ },
919
+ {
920
+ name: 'title',
921
+ layout: {
922
+ positions: {
923
+ lg: {
924
+ colSpan: 6,
925
+ },
926
+ },
927
+ },
928
+ },
929
+ {
930
+ name: 'isArchived',
931
+ layout: {
932
+ positions: {
933
+ lg: {
934
+ colSpan: 12,
935
+ },
936
+ },
937
+ },
938
+ },
939
+ ],
940
+ },
941
+ update: {
942
+ sections: [
943
+ {
944
+ id: 'edition',
945
+ },
946
+ ],
947
+ properties: [
948
+ {
949
+ name: 'name',
950
+ layout: {
951
+ positions: {
952
+ lg: {
953
+ colSpan: 6,
954
+ },
955
+ },
956
+ },
957
+ },
958
+ {
959
+ name: 'title',
960
+ layout: {
961
+ positions: {
962
+ lg: {
963
+ colSpan: 6,
964
+ },
965
+ },
966
+ },
967
+ },
968
+ {
969
+ name: 'isArchived',
970
+ layout: {
971
+ positions: {
972
+ lg: {
973
+ colSpan: 12,
974
+ },
975
+ },
976
+ },
977
+ },
978
+ ],
979
+ },
980
+ single: {
981
+ title: '{{title}}',
982
+ sections: [
983
+ {
984
+ id: 'edition',
985
+ layout: {
986
+ positions: {
987
+ lg: {
988
+ colSpan: 12,
989
+ },
990
+ },
991
+ },
992
+ },
993
+ ],
994
+ properties: [
995
+ {
996
+ name: 'name',
997
+ layout: {
998
+ positions: {
999
+ lg: {
1000
+ colSpan: 6,
1001
+ },
1002
+ },
1003
+ },
1004
+ },
1005
+ {
1006
+ name: 'title',
1007
+ layout: {
1008
+ positions: {
1009
+ lg: {
1010
+ colSpan: 6,
1011
+ },
1012
+ },
1013
+ },
1014
+ },
1015
+ {
1016
+ name: 'isArchived',
1017
+ layout: {
1018
+ positions: {
1019
+ lg: {
1020
+ colSpan: 12,
1021
+ },
1022
+ },
1023
+ },
1024
+ },
1025
+ ],
1026
+ actions: [],
1027
+ },
1028
+ list: {
1029
+ actions: [
1030
+ {
1031
+ title: 'Create New',
1032
+ command: 'create-entity',
1033
+ priority: 'primary',
1034
+ type: 'create',
1035
+ scope: AXPEntityCommandScope.TypeLevel,
1036
+ },
1037
+ {
1038
+ title: 'Delete Items',
1039
+ command: 'delete-entity',
1040
+ priority: 'primary',
1041
+ type: 'delete',
1042
+ scope: AXPEntityCommandScope.Selected,
1043
+ },
1044
+ {
1045
+ title: 'Details',
1046
+ command: 'open-entity',
1047
+ priority: 'primary',
1048
+ type: 'view',
1049
+ scope: AXPEntityCommandScope.Individual,
1050
+ },
1051
+ {
1052
+ title: 'Delete',
1053
+ command: 'delete-entity',
1054
+ priority: 'primary',
1055
+ type: 'delete',
1056
+ scope: AXPEntityCommandScope.Individual,
1057
+ },
1058
+ ],
1059
+ views: [
1060
+ {
1061
+ name: 'all',
1062
+ title: 'All Items',
1063
+ fixed: true,
1064
+ columns: [],
1065
+ conditions: [],
1066
+ sorts: [],
1067
+ },
1068
+ ],
1069
+ },
1070
+ },
1071
+ },
1072
+ };
1073
+ return entityDef;
1074
+ }
1075
+
1076
+ async function entityEntityFactory(injector) {
1077
+ const dataService = injector.get(AXPApplicationManagementService);
1078
+ const entityDef = {
1079
+ module: 'application-management',
1080
+ name: 'entity',
1081
+ source: 'application-management.entity',
1082
+ title: 'Entities',
1083
+ formats: {
1084
+ individual: 'Entity',
1085
+ plural: 'Entities',
1086
+ },
1087
+ relatedEntities: [],
1088
+ groups: [
1089
+ {
1090
+ id: 'entity',
1091
+ title: 'Entity',
1092
+ },
1093
+ ],
1094
+ properties: [
1095
+ {
1096
+ name: 'name',
1097
+ title: 'Name',
1098
+ groupId: 'entity',
1099
+ schema: {
1100
+ dataType: 'string',
1101
+ interface: {
1102
+ type: AXPWidgetsCatalog.text,
1103
+ },
1104
+ },
1105
+ },
1106
+ {
1107
+ name: 'title',
1108
+ title: 'Title',
1109
+ groupId: 'entity',
1110
+ schema: {
1111
+ dataType: 'string',
1112
+ interface: {
1113
+ type: AXPWidgetsCatalog.text,
1114
+ },
1115
+ },
1116
+ },
1117
+ {
1118
+ name: 'isArchived',
1119
+ title: 'Archived',
1120
+ groupId: 'entity',
1121
+ schema: {
1122
+ dataType: 'boolean',
1123
+ interface: {
1124
+ type: AXPWidgetsCatalog.toggle,
1125
+ },
1126
+ },
1127
+ },
1128
+ ],
1129
+ columns: [{ name: 'name' }, { name: 'title' }, { name: 'isArchived' }],
1130
+ commands: {
1131
+ create: {
1132
+ execute: async (data) => {
1133
+ const entity = Object.assign(data, { id: AXPDataGenerator.uuid() });
1134
+ dataService.entityDataProvider.insertOne(entity);
1135
+ return Promise.resolve(entity);
1136
+ },
1137
+ },
1138
+ delete: {
1139
+ execute: async (id) => {
1140
+ await await dataService.entityDataProvider.deleteOne(id);
1141
+ return Promise.resolve();
1142
+ },
1143
+ },
1144
+ update: {
1145
+ execute: async (data) => {
1146
+ return new Promise((resolve) => {
1147
+ setTimeout(async () => {
1148
+ await dataService.entityDataProvider.updateOne(data.id, data);
1149
+ resolve(data);
1150
+ }, 1000);
1151
+ });
1152
+ },
1153
+ },
1154
+ },
1155
+ queries: {
1156
+ byKey: {
1157
+ execute: async (id) => {
1158
+ return new Promise((resolve) => {
1159
+ setTimeout(async () => {
1160
+ const entity = await dataService.entityDataProvider.getOne(id);
1161
+ resolve(entity);
1162
+ }, 500);
1163
+ });
1164
+ },
1165
+ type: AXPEntityQueryType.Single,
1166
+ },
1167
+ list: {
1168
+ execute: async (e) => {
1169
+ const list = await dataService.entityDataProvider.getAll();
1170
+ const sortedItems = applySortArray(list, e.sort);
1171
+ const filteredItems = applyFilterArray(sortedItems, e.filter ? [e.filter] : []);
1172
+ return Promise.resolve({
1173
+ total: filteredItems.length,
1174
+ items: filteredItems.slice(e.skip, (e.skip ?? 0) + (e.take ?? 0)),
1175
+ });
1176
+ },
1177
+ type: AXPEntityQueryType.List,
1178
+ },
1179
+ },
1180
+ interfaces: {
1181
+ master: {
1182
+ create: {
1183
+ sections: [
1184
+ {
1185
+ id: 'entity',
1186
+ },
1187
+ ],
1188
+ properties: [
1189
+ {
1190
+ name: 'name',
1191
+ layout: {
1192
+ positions: {
1193
+ lg: {
1194
+ colSpan: 6,
1195
+ },
1196
+ },
1197
+ },
1198
+ },
1199
+ {
1200
+ name: 'title',
1201
+ layout: {
1202
+ positions: {
1203
+ lg: {
1204
+ colSpan: 6,
1205
+ },
1206
+ },
1207
+ },
1208
+ },
1209
+ {
1210
+ name: 'isArchived',
1211
+ layout: {
1212
+ positions: {
1213
+ lg: {
1214
+ colSpan: 12,
1215
+ },
1216
+ },
1217
+ },
1218
+ },
1219
+ ],
1220
+ },
1221
+ update: {
1222
+ sections: [
1223
+ {
1224
+ id: 'entity',
1225
+ },
1226
+ ],
1227
+ properties: [
1228
+ {
1229
+ name: 'name',
1230
+ layout: {
1231
+ positions: {
1232
+ lg: {
1233
+ colSpan: 6,
1234
+ },
1235
+ },
1236
+ },
1237
+ },
1238
+ {
1239
+ name: 'title',
1240
+ layout: {
1241
+ positions: {
1242
+ lg: {
1243
+ colSpan: 6,
1244
+ },
1245
+ },
1246
+ },
1247
+ },
1248
+ {
1249
+ name: 'isArchived',
1250
+ layout: {
1251
+ positions: {
1252
+ lg: {
1253
+ colSpan: 12,
1254
+ },
1255
+ },
1256
+ },
1257
+ },
1258
+ ],
1259
+ },
1260
+ single: {
1261
+ title: '{{title}}',
1262
+ sections: [
1263
+ {
1264
+ id: 'entity',
1265
+ layout: {
1266
+ positions: {
1267
+ lg: {
1268
+ colSpan: 12,
1269
+ },
1270
+ },
1271
+ },
1272
+ },
1273
+ ],
1274
+ properties: [
1275
+ {
1276
+ name: 'name',
1277
+ layout: {
1278
+ positions: {
1279
+ lg: {
1280
+ colSpan: 6,
1281
+ },
1282
+ },
1283
+ },
1284
+ },
1285
+ {
1286
+ name: 'title',
1287
+ layout: {
1288
+ positions: {
1289
+ lg: {
1290
+ colSpan: 6,
1291
+ },
1292
+ },
1293
+ },
1294
+ },
1295
+ {
1296
+ name: 'isArchived',
1297
+ layout: {
1298
+ positions: {
1299
+ lg: {
1300
+ colSpan: 12,
1301
+ },
1302
+ },
1303
+ },
1304
+ },
1305
+ ],
1306
+ actions: [],
1307
+ },
1308
+ list: {
1309
+ actions: [
1310
+ {
1311
+ title: 'Create New',
1312
+ command: 'create-entity',
1313
+ priority: 'primary',
1314
+ type: 'create',
1315
+ scope: AXPEntityCommandScope.TypeLevel,
1316
+ },
1317
+ {
1318
+ title: 'Delete Items',
1319
+ command: 'delete-entity',
1320
+ priority: 'primary',
1321
+ type: 'delete',
1322
+ scope: AXPEntityCommandScope.Selected,
1323
+ },
1324
+ {
1325
+ title: 'Details',
1326
+ command: 'open-entity',
1327
+ priority: 'primary',
1328
+ type: 'view',
1329
+ scope: AXPEntityCommandScope.Individual,
1330
+ },
1331
+ {
1332
+ title: 'Delete',
1333
+ command: 'delete-entity',
1334
+ priority: 'primary',
1335
+ type: 'delete',
1336
+ scope: AXPEntityCommandScope.Individual,
1337
+ },
1338
+ ],
1339
+ views: [
1340
+ {
1341
+ name: 'all',
1342
+ title: 'All Items',
1343
+ fixed: true,
1344
+ columns: [],
1345
+ conditions: [],
1346
+ sorts: [],
1347
+ },
1348
+ ],
1349
+ },
1350
+ },
1351
+ },
1352
+ };
1353
+ return entityDef;
1354
+ }
1355
+
1356
+ var entity_entity = /*#__PURE__*/Object.freeze({
1357
+ __proto__: null,
1358
+ entityEntityFactory: entityEntityFactory
1359
+ });
1360
+
1361
+ async function featureEntityFactory(injector) {
1362
+ const dataService = injector.get(AXPApplicationManagementService);
1363
+ const EntityDef = {
1364
+ module: 'application-management',
1365
+ name: 'feature',
1366
+ source: 'application-management.feature',
1367
+ title: 'Features',
1368
+ formats: {
1369
+ individual: 'Feature',
1370
+ plural: 'Feature',
1371
+ },
1372
+ relatedEntities: [],
1373
+ groups: [
1374
+ {
1375
+ id: 'feature',
1376
+ title: 'Feature',
1377
+ },
1378
+ ],
1379
+ properties: [
1380
+ {
1381
+ name: 'name',
1382
+ title: 'Name',
1383
+ groupId: 'feature',
1384
+ schema: {
1385
+ dataType: 'string',
1386
+ interface: {
1387
+ type: AXPWidgetsCatalog.text,
1388
+ },
1389
+ },
1390
+ },
1391
+ {
1392
+ name: 'title',
1393
+ title: 'Title',
1394
+ groupId: 'feature',
1395
+ schema: {
1396
+ dataType: 'string',
1397
+ interface: {
1398
+ type: AXPWidgetsCatalog.text,
1399
+ },
1400
+ },
1401
+ },
1402
+ {
1403
+ name: 'isArchived',
1404
+ title: 'Archived',
1405
+ groupId: 'feature',
1406
+ schema: {
1407
+ dataType: 'boolean',
1408
+ interface: {
1409
+ type: AXPWidgetsCatalog.toggle,
1410
+ },
1411
+ },
1412
+ },
1413
+ ],
1414
+ columns: [{ name: 'name' }, { name: 'title' }, { name: 'isArchived' }],
1415
+ commands: {
1416
+ create: {
1417
+ execute: async (data) => {
1418
+ const entity = Object.assign(data, { id: AXPDataGenerator.uuid() });
1419
+ dataService.featureDataProvider.insertOne(entity);
1420
+ return Promise.resolve(entity);
1421
+ },
1422
+ },
1423
+ delete: {
1424
+ execute: async (id) => {
1425
+ await await dataService.featureDataProvider.deleteOne(id);
1426
+ return Promise.resolve();
1427
+ },
1428
+ },
1429
+ update: {
1430
+ execute: async (data) => {
1431
+ return new Promise((resolve) => {
1432
+ setTimeout(async () => {
1433
+ await dataService.featureDataProvider.updateOne(data.id, data);
1434
+ resolve(data);
1435
+ }, 1000);
1436
+ });
1437
+ },
1438
+ },
1439
+ },
1440
+ queries: {
1441
+ byKey: {
1442
+ execute: async (id) => {
1443
+ return new Promise((resolve) => {
1444
+ setTimeout(async () => {
1445
+ const entity = await dataService.featureDataProvider.getOne(id);
1446
+ resolve(entity);
1447
+ }, 500);
1448
+ });
1449
+ },
1450
+ type: AXPEntityQueryType.Single,
1451
+ },
1452
+ list: {
1453
+ execute: async (e) => {
1454
+ const list = await dataService.featureDataProvider.getAll();
1455
+ const sortedItems = applySortArray(list, e.sort);
1456
+ const filteredItems = applyFilterArray(sortedItems, e.filter ? [e.filter] : []);
1457
+ return Promise.resolve({
1458
+ total: filteredItems.length,
1459
+ items: filteredItems.slice(e.skip, (e.skip ?? 0) + (e.take ?? 0)),
1460
+ });
1461
+ },
1462
+ type: AXPEntityQueryType.List,
1463
+ },
1464
+ },
1465
+ interfaces: {
1466
+ master: {
1467
+ create: {
1468
+ sections: [
1469
+ {
1470
+ id: 'feature',
1471
+ },
1472
+ ],
1473
+ properties: [
1474
+ {
1475
+ name: 'name',
1476
+ layout: {
1477
+ positions: {
1478
+ lg: {
1479
+ colSpan: 6,
1480
+ },
1481
+ },
1482
+ },
1483
+ },
1484
+ {
1485
+ name: 'title',
1486
+ layout: {
1487
+ positions: {
1488
+ lg: {
1489
+ colSpan: 6,
1490
+ },
1491
+ },
1492
+ },
1493
+ },
1494
+ {
1495
+ name: 'isArchived',
1496
+ layout: {
1497
+ positions: {
1498
+ lg: {
1499
+ colSpan: 12,
1500
+ },
1501
+ },
1502
+ },
1503
+ },
1504
+ ],
1505
+ },
1506
+ update: {
1507
+ sections: [
1508
+ {
1509
+ id: 'feature',
1510
+ },
1511
+ ],
1512
+ properties: [
1513
+ {
1514
+ name: 'name',
1515
+ layout: {
1516
+ positions: {
1517
+ lg: {
1518
+ colSpan: 6,
1519
+ },
1520
+ },
1521
+ },
1522
+ },
1523
+ {
1524
+ name: 'title',
1525
+ layout: {
1526
+ positions: {
1527
+ lg: {
1528
+ colSpan: 6,
1529
+ },
1530
+ },
1531
+ },
1532
+ },
1533
+ {
1534
+ name: 'isArchived',
1535
+ layout: {
1536
+ positions: {
1537
+ lg: {
1538
+ colSpan: 12,
1539
+ },
1540
+ },
1541
+ },
1542
+ },
1543
+ ],
1544
+ },
1545
+ single: {
1546
+ title: '{{title}}',
1547
+ sections: [
1548
+ {
1549
+ id: 'feature',
1550
+ layout: {
1551
+ positions: {
1552
+ lg: {
1553
+ colSpan: 12,
1554
+ },
1555
+ },
1556
+ },
1557
+ },
1558
+ ],
1559
+ properties: [
1560
+ {
1561
+ name: 'name',
1562
+ layout: {
1563
+ positions: {
1564
+ lg: {
1565
+ colSpan: 6,
1566
+ },
1567
+ },
1568
+ },
1569
+ },
1570
+ {
1571
+ name: 'title',
1572
+ layout: {
1573
+ positions: {
1574
+ lg: {
1575
+ colSpan: 6,
1576
+ },
1577
+ },
1578
+ },
1579
+ },
1580
+ {
1581
+ name: 'isArchived',
1582
+ layout: {
1583
+ positions: {
1584
+ lg: {
1585
+ colSpan: 12,
1586
+ },
1587
+ },
1588
+ },
1589
+ },
1590
+ ],
1591
+ actions: [],
1592
+ },
1593
+ list: {
1594
+ actions: [
1595
+ {
1596
+ title: 'Create New',
1597
+ command: 'create-entity',
1598
+ priority: 'primary',
1599
+ type: 'create',
1600
+ scope: AXPEntityCommandScope.TypeLevel,
1601
+ },
1602
+ {
1603
+ title: 'Delete Items',
1604
+ command: 'delete-entity',
1605
+ priority: 'primary',
1606
+ type: 'delete',
1607
+ scope: AXPEntityCommandScope.Selected,
1608
+ },
1609
+ {
1610
+ title: 'Details',
1611
+ command: 'open-entity',
1612
+ priority: 'primary',
1613
+ type: 'view',
1614
+ scope: AXPEntityCommandScope.Individual,
1615
+ },
1616
+ {
1617
+ title: 'Delete',
1618
+ command: 'delete-entity',
1619
+ priority: 'primary',
1620
+ type: 'delete',
1621
+ scope: AXPEntityCommandScope.Individual,
1622
+ },
1623
+ ],
1624
+ views: [
1625
+ {
1626
+ name: 'all',
1627
+ title: 'All Items',
1628
+ fixed: true,
1629
+ columns: [],
1630
+ conditions: [],
1631
+ sorts: [],
1632
+ },
1633
+ ],
1634
+ },
1635
+ },
1636
+ },
1637
+ };
1638
+ return EntityDef;
1639
+ }
1640
+
1641
+ var feature_entity = /*#__PURE__*/Object.freeze({
1642
+ __proto__: null,
1643
+ featureEntityFactory: featureEntityFactory
1644
+ });
1645
+
1646
+ async function modulesEntityFactory(injector) {
1647
+ const dataService = injector.get(AXPApplicationManagementService);
1648
+ const entityDef = {
1649
+ module: 'application-management',
1650
+ name: 'module',
1651
+ source: 'application-management.module',
1652
+ title: 'Modules',
1653
+ formats: {
1654
+ individual: 'Modules',
1655
+ plural: 'Modules',
1656
+ },
1657
+ relatedEntities: [
1658
+ {
1659
+ entity: 'application-management.entity',
1660
+ columns: ['module.title', 'name', 'title', 'isArchived'],
1661
+ conditions: [
1662
+ {
1663
+ name: 'module.id',
1664
+ operator: {
1665
+ type: 'equal',
1666
+ },
1667
+ value: 'id',
1668
+ },
1669
+ ],
1670
+ },
1671
+ {
1672
+ entity: 'application-management.feature',
1673
+ columns: ['module.title', 'name', 'title', 'isArchived'],
1674
+ conditions: [
1675
+ {
1676
+ name: 'module.id',
1677
+ operator: {
1678
+ type: 'equal',
1679
+ },
1680
+ value: 'id',
1681
+ },
1682
+ ],
1683
+ },
1684
+ {
1685
+ entity: 'application-management.permission',
1686
+ columns: ['module.title', 'name', 'title', 'isArchived'],
1687
+ conditions: [
1688
+ {
1689
+ name: 'module.id',
1690
+ operator: {
1691
+ type: 'equal',
1692
+ },
1693
+ value: 'id',
1694
+ },
1695
+ ],
1696
+ },
1697
+ ],
1698
+ groups: [
1699
+ {
1700
+ id: 'modules',
1701
+ title: 'Modules',
1702
+ },
1703
+ ],
1704
+ properties: [
1705
+ {
1706
+ name: 'name',
1707
+ title: 'Name',
1708
+ groupId: 'modules',
1709
+ schema: {
1710
+ dataType: 'string',
1711
+ interface: {
1712
+ type: AXPWidgetsCatalog.text,
1713
+ },
1714
+ },
1715
+ },
1716
+ {
1717
+ name: 'title',
1718
+ title: 'Title',
1719
+ groupId: 'modules',
1720
+ schema: {
1721
+ dataType: 'string',
1722
+ interface: {
1723
+ type: AXPWidgetsCatalog.text,
1724
+ },
1725
+ },
1726
+ },
1727
+ {
1728
+ name: 'isArchived',
1729
+ title: 'Archived',
1730
+ groupId: 'modules',
1731
+ schema: {
1732
+ dataType: 'boolean',
1733
+ interface: {
1734
+ type: AXPWidgetsCatalog.toggle,
1735
+ },
1736
+ },
1737
+ },
1738
+ ],
1739
+ columns: [{ name: 'name' }, { name: 'title' }, { name: 'isArchived' }],
1740
+ commands: {
1741
+ create: {
1742
+ execute: async (data) => {
1743
+ const entity = Object.assign(data, { id: AXPDataGenerator.uuid() });
1744
+ dataService.moduleDataProvider.insertOne(entity);
1745
+ return Promise.resolve(entity);
1746
+ },
1747
+ },
1748
+ delete: {
1749
+ execute: async (id) => {
1750
+ await await dataService.moduleDataProvider.deleteOne(id);
1751
+ return Promise.resolve();
1752
+ },
1753
+ },
1754
+ update: {
1755
+ execute: async (data) => {
1756
+ return new Promise((resolve) => {
1757
+ setTimeout(async () => {
1758
+ await dataService.moduleDataProvider.updateOne(data.id, data);
1759
+ resolve(data);
1760
+ }, 1000);
1761
+ });
1762
+ },
1763
+ },
1764
+ },
1765
+ queries: {
1766
+ byKey: {
1767
+ execute: async (id) => {
1768
+ return new Promise((resolve) => {
1769
+ setTimeout(async () => {
1770
+ const entity = await dataService.moduleDataProvider.getOne(id);
1771
+ resolve(entity);
1772
+ }, 500);
1773
+ });
1774
+ },
1775
+ type: AXPEntityQueryType.Single,
1776
+ },
1777
+ list: {
1778
+ execute: async (e) => {
1779
+ const list = await dataService.moduleDataProvider.getAll();
1780
+ const sortedItems = applySortArray(list, e.sort);
1781
+ const filteredItems = applyFilterArray(sortedItems, e.filter ? [e.filter] : []);
1782
+ return Promise.resolve({
1783
+ total: filteredItems.length,
1784
+ items: filteredItems.slice(e.skip, (e.skip ?? 0) + (e.take ?? 0)),
1785
+ });
1786
+ },
1787
+ type: AXPEntityQueryType.List,
1788
+ },
1789
+ },
1790
+ interfaces: {
1791
+ master: {
1792
+ create: {
1793
+ sections: [
1794
+ {
1795
+ id: 'modules',
1796
+ },
1797
+ ],
1798
+ properties: [
1799
+ {
1800
+ name: 'name',
1801
+ layout: {
1802
+ positions: {
1803
+ lg: {
1804
+ colSpan: 6,
1805
+ },
1806
+ },
1807
+ },
1808
+ },
1809
+ {
1810
+ name: 'title',
1811
+ layout: {
1812
+ positions: {
1813
+ lg: {
1814
+ colSpan: 6,
1815
+ },
1816
+ },
1817
+ },
1818
+ },
1819
+ {
1820
+ name: 'isArchived',
1821
+ layout: {
1822
+ positions: {
1823
+ lg: {
1824
+ colSpan: 12,
1825
+ },
1826
+ },
1827
+ },
1828
+ },
1829
+ ],
1830
+ },
1831
+ update: {
1832
+ sections: [
1833
+ {
1834
+ id: 'application',
1835
+ },
1836
+ ],
1837
+ properties: [
1838
+ {
1839
+ name: 'name',
1840
+ layout: {
1841
+ positions: {
1842
+ lg: {
1843
+ colSpan: 6,
1844
+ },
1845
+ },
1846
+ },
1847
+ },
1848
+ {
1849
+ name: 'title',
1850
+ layout: {
1851
+ positions: {
1852
+ lg: {
1853
+ colSpan: 6,
1854
+ },
1855
+ },
1856
+ },
1857
+ },
1858
+ {
1859
+ name: 'isArchived',
1860
+ layout: {
1861
+ positions: {
1862
+ lg: {
1863
+ colSpan: 12,
1864
+ },
1865
+ },
1866
+ },
1867
+ },
1868
+ ],
1869
+ },
1870
+ single: {
1871
+ title: '{{title}}',
1872
+ sections: [
1873
+ {
1874
+ id: 'modules',
1875
+ layout: {
1876
+ positions: {
1877
+ lg: {
1878
+ colSpan: 12,
1879
+ },
1880
+ },
1881
+ },
1882
+ },
1883
+ ],
1884
+ properties: [
1885
+ {
1886
+ name: 'name',
1887
+ layout: {
1888
+ positions: {
1889
+ lg: {
1890
+ colSpan: 6,
1891
+ },
1892
+ },
1893
+ },
1894
+ },
1895
+ {
1896
+ name: 'title',
1897
+ layout: {
1898
+ positions: {
1899
+ lg: {
1900
+ colSpan: 6,
1901
+ },
1902
+ },
1903
+ },
1904
+ },
1905
+ {
1906
+ name: 'isArchived',
1907
+ layout: {
1908
+ positions: {
1909
+ lg: {
1910
+ colSpan: 12,
1911
+ },
1912
+ },
1913
+ },
1914
+ },
1915
+ ],
1916
+ actions: [],
1917
+ },
1918
+ list: {
1919
+ actions: [
1920
+ {
1921
+ title: 'Create New',
1922
+ command: 'create-entity',
1923
+ priority: 'primary',
1924
+ type: 'create',
1925
+ scope: AXPEntityCommandScope.TypeLevel,
1926
+ },
1927
+ {
1928
+ title: 'Delete Items',
1929
+ command: 'delete-entity',
1930
+ priority: 'primary',
1931
+ type: 'delete',
1932
+ scope: AXPEntityCommandScope.Selected,
1933
+ },
1934
+ {
1935
+ title: 'Details',
1936
+ command: 'open-entity',
1937
+ priority: 'primary',
1938
+ type: 'view',
1939
+ scope: AXPEntityCommandScope.Individual,
1940
+ },
1941
+ {
1942
+ title: 'Delete',
1943
+ command: 'delete-entity',
1944
+ priority: 'primary',
1945
+ type: 'delete',
1946
+ scope: AXPEntityCommandScope.Individual,
1947
+ },
1948
+ ],
1949
+ views: [
1950
+ {
1951
+ name: 'all',
1952
+ title: 'All Items',
1953
+ fixed: true,
1954
+ columns: [],
1955
+ conditions: [],
1956
+ sorts: [],
1957
+ },
1958
+ ],
1959
+ },
1960
+ },
1961
+ },
1962
+ };
1963
+ return entityDef;
1964
+ }
1965
+
1966
+ var modules_entity = /*#__PURE__*/Object.freeze({
1967
+ __proto__: null,
1968
+ modulesEntityFactory: modulesEntityFactory
1969
+ });
1970
+
1971
+ async function permissionEntityFactory(injector) {
1972
+ const dataService = injector.get(AXPApplicationManagementService);
1973
+ const entityDef = {
1974
+ module: 'application-management',
1975
+ name: 'permission',
1976
+ source: 'application-management.permission',
1977
+ title: 'Permissions',
1978
+ formats: {
1979
+ individual: 'Permission',
1980
+ plural: 'Permissions',
1981
+ },
1982
+ relatedEntities: [],
1983
+ groups: [
1984
+ {
1985
+ id: 'permission',
1986
+ title: 'Permission',
1987
+ },
1988
+ ],
1989
+ properties: [
1990
+ {
1991
+ name: 'name',
1992
+ title: 'Name',
1993
+ groupId: 'permission',
1994
+ schema: {
1995
+ dataType: 'string',
1996
+ interface: {
1997
+ type: AXPWidgetsCatalog.text,
1998
+ },
1999
+ },
2000
+ },
2001
+ {
2002
+ name: 'title',
2003
+ title: 'Title',
2004
+ groupId: 'permission',
2005
+ schema: {
2006
+ dataType: 'string',
2007
+ interface: {
2008
+ type: AXPWidgetsCatalog.text,
2009
+ },
2010
+ },
2011
+ },
2012
+ {
2013
+ name: 'isArchived',
2014
+ title: 'Archived',
2015
+ groupId: 'permission',
2016
+ schema: {
2017
+ dataType: 'boolean',
2018
+ interface: {
2019
+ type: AXPWidgetsCatalog.toggle,
2020
+ },
2021
+ },
2022
+ },
2023
+ ],
2024
+ columns: [{ name: 'name' }, { name: 'title' }, { name: 'isArchived' }],
2025
+ commands: {
2026
+ create: {
2027
+ execute: async (data) => {
2028
+ const entity = Object.assign(data, { id: AXPDataGenerator.uuid() });
2029
+ dataService.permissionDataProvider.insertOne(entity);
2030
+ return Promise.resolve(entity);
2031
+ },
2032
+ },
2033
+ delete: {
2034
+ execute: async (id) => {
2035
+ await await dataService.permissionDataProvider.deleteOne(id);
2036
+ return Promise.resolve();
2037
+ },
2038
+ },
2039
+ update: {
2040
+ execute: async (data) => {
2041
+ return new Promise((resolve) => {
2042
+ setTimeout(async () => {
2043
+ await dataService.permissionDataProvider.updateOne(data.id, data);
2044
+ resolve(data);
2045
+ }, 1000);
2046
+ });
2047
+ },
2048
+ },
2049
+ },
2050
+ queries: {
2051
+ byKey: {
2052
+ execute: async (id) => {
2053
+ return new Promise((resolve) => {
2054
+ setTimeout(async () => {
2055
+ const entity = await dataService.permissionDataProvider.getOne(id);
2056
+ resolve(entity);
2057
+ }, 500);
2058
+ });
2059
+ },
2060
+ type: AXPEntityQueryType.Single,
2061
+ },
2062
+ list: {
2063
+ execute: async (e) => {
2064
+ const list = await dataService.permissionDataProvider.getAll();
2065
+ const sortedItems = applySortArray(list, e.sort);
2066
+ const filteredItems = applyFilterArray(sortedItems, e.filter ? [e.filter] : []);
2067
+ return Promise.resolve({
2068
+ total: filteredItems.length,
2069
+ items: filteredItems.slice(e.skip, (e.skip ?? 0) + (e.take ?? 0)),
2070
+ });
2071
+ },
2072
+ type: AXPEntityQueryType.List,
2073
+ },
2074
+ },
2075
+ interfaces: {
2076
+ master: {
2077
+ create: {
2078
+ sections: [
2079
+ {
2080
+ id: 'permission',
2081
+ },
2082
+ ],
2083
+ properties: [
2084
+ {
2085
+ name: 'name',
2086
+ layout: {
2087
+ positions: {
2088
+ lg: {
2089
+ colSpan: 6,
2090
+ },
2091
+ },
2092
+ },
2093
+ },
2094
+ {
2095
+ name: 'title',
2096
+ layout: {
2097
+ positions: {
2098
+ lg: {
2099
+ colSpan: 6,
2100
+ },
2101
+ },
2102
+ },
2103
+ },
2104
+ {
2105
+ name: 'isArchived',
2106
+ layout: {
2107
+ positions: {
2108
+ lg: {
2109
+ colSpan: 12,
2110
+ },
2111
+ },
2112
+ },
2113
+ },
2114
+ ],
2115
+ },
2116
+ update: {
2117
+ sections: [
2118
+ {
2119
+ id: 'permission',
2120
+ },
2121
+ ],
2122
+ properties: [
2123
+ {
2124
+ name: 'name',
2125
+ layout: {
2126
+ positions: {
2127
+ lg: {
2128
+ colSpan: 6,
2129
+ },
2130
+ },
2131
+ },
2132
+ },
2133
+ {
2134
+ name: 'title',
2135
+ layout: {
2136
+ positions: {
2137
+ lg: {
2138
+ colSpan: 6,
2139
+ },
2140
+ },
2141
+ },
2142
+ },
2143
+ {
2144
+ name: 'isArchived',
2145
+ layout: {
2146
+ positions: {
2147
+ lg: {
2148
+ colSpan: 12,
2149
+ },
2150
+ },
2151
+ },
2152
+ },
2153
+ ],
2154
+ },
2155
+ single: {
2156
+ title: '{{title}}',
2157
+ sections: [
2158
+ {
2159
+ id: 'permission',
2160
+ layout: {
2161
+ positions: {
2162
+ lg: {
2163
+ colSpan: 12,
2164
+ },
2165
+ },
2166
+ },
2167
+ },
2168
+ ],
2169
+ properties: [
2170
+ {
2171
+ name: 'name',
2172
+ layout: {
2173
+ positions: {
2174
+ lg: {
2175
+ colSpan: 6,
2176
+ },
2177
+ },
2178
+ },
2179
+ },
2180
+ {
2181
+ name: 'title',
2182
+ layout: {
2183
+ positions: {
2184
+ lg: {
2185
+ colSpan: 6,
2186
+ },
2187
+ },
2188
+ },
2189
+ },
2190
+ {
2191
+ name: 'isArchived',
2192
+ layout: {
2193
+ positions: {
2194
+ lg: {
2195
+ colSpan: 12,
2196
+ },
2197
+ },
2198
+ },
2199
+ },
2200
+ ],
2201
+ actions: [],
2202
+ },
2203
+ list: {
2204
+ actions: [
2205
+ {
2206
+ title: 'Create New',
2207
+ command: 'create-entity',
2208
+ priority: 'primary',
2209
+ type: 'create',
2210
+ scope: AXPEntityCommandScope.TypeLevel,
2211
+ },
2212
+ {
2213
+ title: 'Delete Items',
2214
+ command: 'delete-entity',
2215
+ priority: 'primary',
2216
+ type: 'delete',
2217
+ scope: AXPEntityCommandScope.Selected,
2218
+ },
2219
+ {
2220
+ title: 'Details',
2221
+ command: 'open-entity',
2222
+ priority: 'primary',
2223
+ type: 'view',
2224
+ scope: AXPEntityCommandScope.Individual,
2225
+ },
2226
+ {
2227
+ title: 'Delete',
2228
+ command: 'delete-entity',
2229
+ priority: 'primary',
2230
+ type: 'delete',
2231
+ scope: AXPEntityCommandScope.Individual,
2232
+ },
2233
+ ],
2234
+ views: [
2235
+ {
2236
+ name: 'all',
2237
+ title: 'All Items',
2238
+ fixed: true,
2239
+ columns: [],
2240
+ conditions: [],
2241
+ sorts: [],
2242
+ },
2243
+ ],
2244
+ },
2245
+ },
2246
+ },
2247
+ };
2248
+ return entityDef;
2249
+ }
2250
+
2251
+ var permission_entity = /*#__PURE__*/Object.freeze({
2252
+ __proto__: null,
2253
+ permissionEntityFactory: permissionEntityFactory
2254
+ });
2255
+
2256
+ async function propertyEntityFactory(injector) {
2257
+ const dataService = injector.get(AXPApplicationManagementService);
2258
+ const entityDef = {
2259
+ module: 'application-management',
2260
+ name: 'property',
2261
+ source: 'application-management.property',
2262
+ title: 'Properties',
2263
+ formats: {
2264
+ individual: 'Property',
2265
+ plural: 'Properties',
2266
+ },
2267
+ relatedEntities: [],
2268
+ groups: [
2269
+ {
2270
+ id: 'property',
2271
+ title: 'Property',
2272
+ },
2273
+ {
2274
+ id: 'schema',
2275
+ title: 'Schema',
2276
+ },
2277
+ {
2278
+ id: 'interface',
2279
+ title: 'Interface',
2280
+ },
2281
+ ],
2282
+ properties: [
2283
+ {
2284
+ name: 'name',
2285
+ title: 'Name',
2286
+ groupId: 'property',
2287
+ schema: {
2288
+ dataType: 'string',
2289
+ interface: {
2290
+ type: AXPWidgetsCatalog.text,
2291
+ },
2292
+ },
2293
+ },
2294
+ {
2295
+ name: 'title',
2296
+ title: 'Title',
2297
+ groupId: 'property',
2298
+ schema: {
2299
+ dataType: 'string',
2300
+ interface: {
2301
+ type: AXPWidgetsCatalog.text,
2302
+ },
2303
+ },
2304
+ },
2305
+ {
2306
+ name: 'groupId',
2307
+ title: 'group Id',
2308
+ groupId: 'property',
2309
+ schema: {
2310
+ dataType: 'string',
2311
+ interface: {
2312
+ type: AXPWidgetsCatalog.text,
2313
+ },
2314
+ },
2315
+ },
2316
+ {
2317
+ name: 'schema.dataType',
2318
+ title: 'Data Type',
2319
+ groupId: 'schema',
2320
+ schema: {
2321
+ dataType: 'string',
2322
+ interface: {
2323
+ type: AXPWidgetsCatalog.text,
2324
+ },
2325
+ },
2326
+ },
2327
+ {
2328
+ name: 'schema.defaultValue',
2329
+ title: 'Default Value',
2330
+ groupId: 'schema',
2331
+ schema: {
2332
+ dataType: 'string',
2333
+ interface: {
2334
+ type: AXPWidgetsCatalog.text,
2335
+ },
2336
+ },
2337
+ },
2338
+ {
2339
+ name: 'schema.nullable',
2340
+ title: 'Nullable',
2341
+ groupId: 'schema',
2342
+ schema: {
2343
+ dataType: 'boolean',
2344
+ interface: {
2345
+ type: AXPWidgetsCatalog.toggle,
2346
+ },
2347
+ },
2348
+ },
2349
+ {
2350
+ name: 'schema.interface.type',
2351
+ title: 'Data Type',
2352
+ groupId: 'interface',
2353
+ schema: {
2354
+ dataType: 'string',
2355
+ interface: {
2356
+ type: AXPWidgetsCatalog.select,
2357
+ options: {
2358
+ dataSource: Object.values(AXPWidgetsCatalog),
2359
+ },
2360
+ },
2361
+ },
2362
+ },
2363
+ ],
2364
+ columns: [
2365
+ { name: 'name' },
2366
+ { name: 'title' },
2367
+ { name: 'groupId' },
2368
+ { name: 'schema.dataType' },
2369
+ { name: 'schema.defaultValue' },
2370
+ { name: 'schema.defaultValue' },
2371
+ { name: 'schema.nullable' },
2372
+ { name: 'schema.interface.type' },
2373
+ ],
2374
+ commands: {
2375
+ create: {
2376
+ execute: async (data) => {
2377
+ const entity = Object.assign(data, { id: AXPDataGenerator.uuid() });
2378
+ dataService.propertyDataProvider.insertOne(entity);
2379
+ return Promise.resolve(entity);
2380
+ },
2381
+ },
2382
+ delete: {
2383
+ execute: async (id) => {
2384
+ await await dataService.propertyDataProvider.deleteOne(id);
2385
+ return Promise.resolve();
2386
+ },
2387
+ },
2388
+ update: {
2389
+ execute: async (data) => {
2390
+ return new Promise((resolve) => {
2391
+ setTimeout(async () => {
2392
+ await dataService.propertyDataProvider.updateOne(data.id, data);
2393
+ resolve(data);
2394
+ }, 1000);
2395
+ });
2396
+ },
2397
+ },
2398
+ },
2399
+ queries: {
2400
+ byKey: {
2401
+ execute: async (id) => {
2402
+ return new Promise((resolve) => {
2403
+ setTimeout(async () => {
2404
+ const entity = await dataService.propertyDataProvider.getOne(id);
2405
+ resolve(entity);
2406
+ }, 500);
2407
+ });
2408
+ },
2409
+ type: AXPEntityQueryType.Single,
2410
+ },
2411
+ list: {
2412
+ execute: async (e) => {
2413
+ const list = await dataService.propertyDataProvider.getAll();
2414
+ const sortedItems = applySortArray(list, e.sort);
2415
+ const filteredItems = applyFilterArray(sortedItems, e.filter ? [e.filter] : []);
2416
+ return Promise.resolve({
2417
+ total: filteredItems.length,
2418
+ items: filteredItems.slice(e.skip, (e.skip ?? 0) + (e.take ?? 0)),
2419
+ });
2420
+ },
2421
+ type: AXPEntityQueryType.List,
2422
+ },
2423
+ },
2424
+ interfaces: {
2425
+ master: {
2426
+ create: {
2427
+ sections: [
2428
+ {
2429
+ id: 'property',
2430
+ },
2431
+ {
2432
+ id: 'schema',
2433
+ },
2434
+ {
2435
+ id: 'interface',
2436
+ },
2437
+ ],
2438
+ properties: [
2439
+ {
2440
+ name: 'name',
2441
+ layout: {
2442
+ positions: {
2443
+ lg: {
2444
+ colSpan: 6,
2445
+ },
2446
+ },
2447
+ },
2448
+ },
2449
+ {
2450
+ name: 'title',
2451
+ layout: {
2452
+ positions: {
2453
+ lg: {
2454
+ colSpan: 6,
2455
+ },
2456
+ },
2457
+ },
2458
+ },
2459
+ {
2460
+ name: 'groupId',
2461
+ layout: {
2462
+ positions: {
2463
+ lg: {
2464
+ colSpan: 12,
2465
+ },
2466
+ },
2467
+ },
2468
+ },
2469
+ {
2470
+ name: 'schema.defaultValue',
2471
+ layout: {
2472
+ positions: {
2473
+ lg: {
2474
+ colSpan: 6,
2475
+ },
2476
+ },
2477
+ },
2478
+ },
2479
+ {
2480
+ name: 'schema.nullable',
2481
+ layout: {
2482
+ positions: {
2483
+ lg: {
2484
+ colSpan: 6,
2485
+ },
2486
+ },
2487
+ },
2488
+ },
2489
+ {
2490
+ name: 'schema.interface.type',
2491
+ layout: {
2492
+ positions: {
2493
+ lg: {
2494
+ colSpan: 12,
2495
+ },
2496
+ },
2497
+ },
2498
+ },
2499
+ ],
2500
+ },
2501
+ update: {
2502
+ sections: [
2503
+ {
2504
+ id: 'property',
2505
+ },
2506
+ {
2507
+ id: 'schema',
2508
+ },
2509
+ {
2510
+ id: 'interface',
2511
+ },
2512
+ ],
2513
+ properties: [
2514
+ {
2515
+ name: 'name',
2516
+ layout: {
2517
+ positions: {
2518
+ lg: {
2519
+ colSpan: 6,
2520
+ },
2521
+ },
2522
+ },
2523
+ },
2524
+ {
2525
+ name: 'title',
2526
+ layout: {
2527
+ positions: {
2528
+ lg: {
2529
+ colSpan: 6,
2530
+ },
2531
+ },
2532
+ },
2533
+ },
2534
+ {
2535
+ name: 'groupId',
2536
+ layout: {
2537
+ positions: {
2538
+ lg: {
2539
+ colSpan: 12,
2540
+ },
2541
+ },
2542
+ },
2543
+ },
2544
+ {
2545
+ name: 'schema.defaultValue',
2546
+ layout: {
2547
+ positions: {
2548
+ lg: {
2549
+ colSpan: 6,
2550
+ },
2551
+ },
2552
+ },
2553
+ },
2554
+ {
2555
+ name: 'schema.nullable',
2556
+ layout: {
2557
+ positions: {
2558
+ lg: {
2559
+ colSpan: 6,
2560
+ },
2561
+ },
2562
+ },
2563
+ },
2564
+ {
2565
+ name: 'schema.interface.type',
2566
+ layout: {
2567
+ positions: {
2568
+ lg: {
2569
+ colSpan: 6,
2570
+ },
2571
+ },
2572
+ },
2573
+ },
2574
+ ],
2575
+ },
2576
+ single: {
2577
+ title: '{{title}}',
2578
+ sections: [
2579
+ {
2580
+ id: 'property',
2581
+ },
2582
+ {
2583
+ id: 'schema',
2584
+ },
2585
+ {
2586
+ id: 'interface',
2587
+ },
2588
+ ],
2589
+ properties: [
2590
+ {
2591
+ name: 'name',
2592
+ layout: {
2593
+ positions: {
2594
+ lg: {
2595
+ colSpan: 6,
2596
+ },
2597
+ },
2598
+ },
2599
+ },
2600
+ {
2601
+ name: 'title',
2602
+ layout: {
2603
+ positions: {
2604
+ lg: {
2605
+ colSpan: 6,
2606
+ },
2607
+ },
2608
+ },
2609
+ },
2610
+ {
2611
+ name: 'groupId',
2612
+ layout: {
2613
+ positions: {
2614
+ lg: {
2615
+ colSpan: 12,
2616
+ },
2617
+ },
2618
+ },
2619
+ },
2620
+ {
2621
+ name: 'schema.defaultValue',
2622
+ layout: {
2623
+ positions: {
2624
+ lg: {
2625
+ colSpan: 6,
2626
+ },
2627
+ },
2628
+ },
2629
+ },
2630
+ {
2631
+ name: 'schema.nullable',
2632
+ layout: {
2633
+ positions: {
2634
+ lg: {
2635
+ colSpan: 6,
2636
+ },
2637
+ },
2638
+ },
2639
+ },
2640
+ {
2641
+ name: 'schema.interface.type',
2642
+ layout: {
2643
+ positions: {
2644
+ lg: {
2645
+ colSpan: 6,
2646
+ },
2647
+ },
2648
+ },
2649
+ },
2650
+ ],
2651
+ actions: [],
2652
+ },
2653
+ list: {
2654
+ actions: [
2655
+ {
2656
+ title: 'Create New',
2657
+ command: 'create-entity',
2658
+ priority: 'primary',
2659
+ type: 'create',
2660
+ scope: AXPEntityCommandScope.TypeLevel,
2661
+ },
2662
+ {
2663
+ title: 'Delete Items',
2664
+ command: 'delete-entity',
2665
+ priority: 'primary',
2666
+ type: 'delete',
2667
+ scope: AXPEntityCommandScope.Selected,
2668
+ },
2669
+ {
2670
+ title: 'Details',
2671
+ command: 'open-entity',
2672
+ priority: 'primary',
2673
+ type: 'view',
2674
+ scope: AXPEntityCommandScope.Individual,
2675
+ },
2676
+ {
2677
+ title: 'Delete',
2678
+ command: 'delete-entity',
2679
+ priority: 'primary',
2680
+ type: 'delete',
2681
+ scope: AXPEntityCommandScope.Individual,
2682
+ },
2683
+ ],
2684
+ views: [
2685
+ {
2686
+ name: 'all',
2687
+ title: 'All Items',
2688
+ fixed: true,
2689
+ columns: [],
2690
+ conditions: [],
2691
+ sorts: [],
2692
+ },
2693
+ ],
2694
+ },
2695
+ },
2696
+ },
2697
+ };
2698
+ return entityDef;
2699
+ }
2700
+
2701
+ class AXPModuleDesignerService {
2702
+ }
17
2703
 
18
2704
  /**
19
2705
  * Generated bundle index. Do not edit.
20
2706
  */
21
2707
 
22
- export { AXMApplicationManagementModule };
2708
+ export { AXMApplicationManagementModule, AXPApplicationManagementService, AXPModuleDesignerService, applicationEntityFactory, applicationModuleEntityFactory, editionEntityFactory, entityEntityFactory, featureEntityFactory, modulesEntityFactory, permissionEntityFactory, propertyEntityFactory, routes };
23
2709
  //# sourceMappingURL=acorex-modules-application-management.mjs.map