@acorex/platform 20.6.0-next.9 → 21.0.0-next.1
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.
- package/auth/index.d.ts +91 -12
- package/common/index.d.ts +615 -44
- package/core/index.d.ts +718 -422
- package/fesm2022/acorex-platform-auth.mjs +152 -39
- package/fesm2022/acorex-platform-auth.mjs.map +1 -1
- package/fesm2022/acorex-platform-common.mjs +1009 -112
- package/fesm2022/acorex-platform-common.mjs.map +1 -1
- package/fesm2022/acorex-platform-core.mjs +887 -408
- package/fesm2022/acorex-platform-core.mjs.map +1 -1
- package/fesm2022/acorex-platform-domain.mjs +99 -11
- package/fesm2022/acorex-platform-domain.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-builder.mjs +555 -492
- package/fesm2022/acorex-platform-layout-builder.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-components.mjs +2446 -2733
- package/fesm2022/acorex-platform-layout-components.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-designer.mjs +9 -9
- package/fesm2022/acorex-platform-layout-designer.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-entity.mjs +9708 -4721
- package/fesm2022/acorex-platform-layout-entity.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-views.mjs +32 -26
- package/fesm2022/acorex-platform-layout-views.mjs.map +1 -1
- package/fesm2022/acorex-platform-layout-widget-core.mjs +252 -182
- package/fesm2022/acorex-platform-layout-widget-core.mjs.map +1 -1
- package/fesm2022/{acorex-platform-layout-widgets-file-list-popup.component-D0y-9nE5.mjs → acorex-platform-layout-widgets-file-list-popup.component-CxrsI6Hn.mjs} +2 -2
- package/fesm2022/acorex-platform-layout-widgets-file-list-popup.component-CxrsI6Hn.mjs.map +1 -0
- package/fesm2022/acorex-platform-layout-widgets-image-preview.popup-V31OpYah.mjs +30 -0
- package/fesm2022/acorex-platform-layout-widgets-image-preview.popup-V31OpYah.mjs.map +1 -0
- package/fesm2022/{acorex-platform-layout-widgets-tabular-data-edit-popup.component-C1l2KSDa.mjs → acorex-platform-layout-widgets-tabular-data-edit-popup.component-Ck7-wpT2.mjs} +2 -2
- package/fesm2022/acorex-platform-layout-widgets-tabular-data-edit-popup.component-Ck7-wpT2.mjs.map +1 -0
- package/fesm2022/{acorex-platform-layout-widgets-tabular-data-view-popup.component-D-31ej0C.mjs → acorex-platform-layout-widgets-tabular-data-view-popup.component-y8vjUiVs.mjs} +2 -2
- package/fesm2022/acorex-platform-layout-widgets-tabular-data-view-popup.component-y8vjUiVs.mjs.map +1 -0
- package/fesm2022/acorex-platform-layout-widgets.mjs +9791 -6928
- package/fesm2022/acorex-platform-layout-widgets.mjs.map +1 -1
- package/fesm2022/acorex-platform-runtime.mjs +79 -3
- package/fesm2022/acorex-platform-runtime.mjs.map +1 -1
- package/fesm2022/acorex-platform-themes-default-entity-master-create-view.component-VIGuU5M4.mjs +157 -0
- package/fesm2022/acorex-platform-themes-default-entity-master-create-view.component-VIGuU5M4.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-DyDa_hyd.mjs +1542 -0
- package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-DyDa_hyd.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-Ua3ZA5hk.mjs +101 -0
- package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-Ua3ZA5hk.mjs.map +1 -0
- package/fesm2022/{acorex-platform-themes-default-entity-master-single-view.component-B_P0a5KW.mjs → acorex-platform-themes-default-entity-master-single-view.component-eMBby9k4.mjs} +3 -3
- package/fesm2022/acorex-platform-themes-default-entity-master-single-view.component-eMBby9k4.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-default.mjs +282 -43
- package/fesm2022/acorex-platform-themes-default.mjs.map +1 -1
- package/fesm2022/acorex-platform-themes-shared-icon-chooser-column.component-C0EpfU2k.mjs +55 -0
- package/fesm2022/acorex-platform-themes-shared-icon-chooser-column.component-C0EpfU2k.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-shared.mjs +42 -137
- package/fesm2022/acorex-platform-themes-shared.mjs.map +1 -1
- package/fesm2022/acorex-platform-workflow.mjs +658 -45
- package/fesm2022/acorex-platform-workflow.mjs.map +1 -1
- package/layout/builder/index.d.ts +10 -34
- package/layout/components/index.d.ts +694 -375
- package/layout/designer/index.d.ts +4 -4
- package/layout/entity/index.d.ts +802 -183
- package/layout/views/index.d.ts +5 -58
- package/layout/widget-core/index.d.ts +63 -75
- package/layout/widgets/README.md +0 -1
- package/layout/widgets/index.d.ts +493 -129
- package/package.json +1 -1
- package/runtime/index.d.ts +36 -8
- package/themes/default/index.d.ts +44 -75
- package/themes/shared/index.d.ts +11 -49
- package/workflow/index.d.ts +401 -90
- package/fesm2022/acorex-platform-layout-entity-create-entity.command-DGeylNSY.mjs +0 -52
- package/fesm2022/acorex-platform-layout-entity-create-entity.command-DGeylNSY.mjs.map +0 -1
- package/fesm2022/acorex-platform-layout-widgets-extra-properties-schema-widget-edit.component-fhhZOWul.mjs +0 -50
- package/fesm2022/acorex-platform-layout-widgets-extra-properties-schema-widget-edit.component-fhhZOWul.mjs.map +0 -1
- package/fesm2022/acorex-platform-layout-widgets-extra-properties-schema-widget-view.component-C3Qbs0fz.mjs +0 -42
- package/fesm2022/acorex-platform-layout-widgets-extra-properties-schema-widget-view.component-C3Qbs0fz.mjs.map +0 -1
- package/fesm2022/acorex-platform-layout-widgets-extra-properties-values-widget-edit.component-CngQBUlN.mjs +0 -55
- package/fesm2022/acorex-platform-layout-widgets-extra-properties-values-widget-edit.component-CngQBUlN.mjs.map +0 -1
- package/fesm2022/acorex-platform-layout-widgets-extra-properties-values-widget-view.component-DSNo9e4W.mjs +0 -50
- package/fesm2022/acorex-platform-layout-widgets-extra-properties-values-widget-view.component-DSNo9e4W.mjs.map +0 -1
- package/fesm2022/acorex-platform-layout-widgets-extra-properties-widget-edit.component-CL0CwEHX.mjs +0 -48
- package/fesm2022/acorex-platform-layout-widgets-extra-properties-widget-edit.component-CL0CwEHX.mjs.map +0 -1
- package/fesm2022/acorex-platform-layout-widgets-extra-properties-widget-view.component-B6Fi0xTw.mjs +0 -42
- package/fesm2022/acorex-platform-layout-widgets-extra-properties-widget-view.component-B6Fi0xTw.mjs.map +0 -1
- package/fesm2022/acorex-platform-layout-widgets-file-list-popup.component-D0y-9nE5.mjs.map +0 -1
- package/fesm2022/acorex-platform-layout-widgets-tabular-data-edit-popup.component-C1l2KSDa.mjs.map +0 -1
- package/fesm2022/acorex-platform-layout-widgets-tabular-data-view-popup.component-D-31ej0C.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-default-entity-master-create-view.component-WbPPqDON.mjs +0 -115
- package/fesm2022/acorex-platform-themes-default-entity-master-create-view.component-WbPPqDON.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-CD7rJIMh.mjs +0 -803
- package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-CD7rJIMh.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-BTA6h7Xd.mjs +0 -101
- package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-BTA6h7Xd.mjs.map +0 -1
- package/fesm2022/acorex-platform-themes-default-entity-master-single-view.component-B_P0a5KW.mjs.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { InjectionToken, makeEnvironmentProviders, inject, NgModule, Injectable } from '@angular/core';
|
|
3
|
-
import {
|
|
3
|
+
import { AXPEntityService } from '@acorex/platform/layout/entity';
|
|
4
4
|
import { AXPCommandRegistry, AXPQueryRegistry, AXPRuntimeModule } from '@acorex/platform/runtime';
|
|
5
5
|
|
|
6
6
|
const AXP_ENTITY_CRUD_SETUP = new InjectionToken('AXP_ENTITY_CRUD_SETUP');
|
|
@@ -12,36 +12,124 @@ function provideEntity(entityKeys) {
|
|
|
12
12
|
useFactory: () => {
|
|
13
13
|
const commandRegistry = inject(AXPCommandRegistry);
|
|
14
14
|
const queryRegistry = inject(AXPQueryRegistry);
|
|
15
|
+
const entityService = inject(AXPEntityService);
|
|
15
16
|
for (const entityKey of entityKeys) {
|
|
16
|
-
const
|
|
17
|
+
const dataAccessor = entityService.withEntity(entityKey).data();
|
|
17
18
|
// Register Commands
|
|
18
19
|
commandRegistry.register(`${entityKey}:Create`, async () => ({
|
|
19
20
|
execute: async (input) => {
|
|
20
|
-
|
|
21
|
-
|
|
21
|
+
try {
|
|
22
|
+
const id = await dataAccessor.create(input);
|
|
23
|
+
const entity = await dataAccessor.byKey(id);
|
|
24
|
+
if (!entity) {
|
|
25
|
+
throw new Error('Entity not found after creation');
|
|
26
|
+
}
|
|
27
|
+
return {
|
|
28
|
+
success: true,
|
|
29
|
+
data: entity,
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
catch (error) {
|
|
33
|
+
return {
|
|
34
|
+
success: false,
|
|
35
|
+
message: {
|
|
36
|
+
text: error instanceof Error ? error.message : 'Failed to create entity',
|
|
37
|
+
},
|
|
38
|
+
};
|
|
39
|
+
}
|
|
22
40
|
}
|
|
23
41
|
}));
|
|
24
42
|
commandRegistry.register(`${entityKey}:Update`, async () => ({
|
|
25
|
-
execute: ({ id, ...rest }) =>
|
|
43
|
+
execute: async ({ id, ...rest }) => {
|
|
44
|
+
try {
|
|
45
|
+
const updated = await dataAccessor.update(id, rest);
|
|
46
|
+
return {
|
|
47
|
+
success: true,
|
|
48
|
+
data: updated,
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
catch (error) {
|
|
52
|
+
return {
|
|
53
|
+
success: false,
|
|
54
|
+
message: {
|
|
55
|
+
text: error instanceof Error ? error.message : 'Failed to update entity',
|
|
56
|
+
},
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
}
|
|
26
60
|
}));
|
|
27
61
|
commandRegistry.register(`${entityKey}:Delete`, async () => ({
|
|
28
|
-
execute: (id) =>
|
|
62
|
+
execute: async (id) => {
|
|
63
|
+
try {
|
|
64
|
+
await dataAccessor.delete(id);
|
|
65
|
+
return {
|
|
66
|
+
success: true,
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
catch (error) {
|
|
70
|
+
return {
|
|
71
|
+
success: false,
|
|
72
|
+
message: {
|
|
73
|
+
text: error instanceof Error ? error.message : 'Failed to delete entity',
|
|
74
|
+
},
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
}
|
|
29
78
|
}));
|
|
30
79
|
// Register Queries
|
|
31
80
|
queryRegistry.register(`${entityKey}:GetById`, async () => ({
|
|
32
|
-
fetch: (id) =>
|
|
81
|
+
fetch: (id) => dataAccessor.byKey(id)
|
|
33
82
|
}));
|
|
34
83
|
queryRegistry.register(`${entityKey}:GetList`, async () => ({
|
|
35
|
-
fetch: (request) =>
|
|
84
|
+
fetch: (request) => dataAccessor.query(request)
|
|
36
85
|
}));
|
|
86
|
+
// Implement getRoots, getChildren, and getByCategory using query with appropriate filters
|
|
37
87
|
queryRegistry.register(`${entityKey}:GetRoots`, async () => ({
|
|
38
|
-
fetch: (request) =>
|
|
88
|
+
fetch: async (request) => {
|
|
89
|
+
return await dataAccessor.query({
|
|
90
|
+
skip: 0,
|
|
91
|
+
take: 1000,
|
|
92
|
+
filter: {
|
|
93
|
+
field: 'parentId',
|
|
94
|
+
operator: {
|
|
95
|
+
type: 'isEmpty',
|
|
96
|
+
},
|
|
97
|
+
value: true,
|
|
98
|
+
},
|
|
99
|
+
});
|
|
100
|
+
}
|
|
39
101
|
}));
|
|
40
102
|
queryRegistry.register(`${entityKey}:GetChildren`, async () => ({
|
|
41
|
-
fetch: (request) =>
|
|
103
|
+
fetch: async (request) => {
|
|
104
|
+
const parentKey = request.parentKey ?? 'parentId';
|
|
105
|
+
return await dataAccessor.query({
|
|
106
|
+
skip: 0,
|
|
107
|
+
take: 1000,
|
|
108
|
+
filter: {
|
|
109
|
+
field: parentKey,
|
|
110
|
+
operator: {
|
|
111
|
+
type: 'equal',
|
|
112
|
+
},
|
|
113
|
+
value: request.parentId,
|
|
114
|
+
},
|
|
115
|
+
});
|
|
116
|
+
}
|
|
42
117
|
}));
|
|
43
118
|
queryRegistry.register(`${entityKey}:GetByCategory`, async () => ({
|
|
44
|
-
fetch: (request) =>
|
|
119
|
+
fetch: async (request) => {
|
|
120
|
+
const categoryKey = request.categoryKey ?? 'categoryIds';
|
|
121
|
+
return await dataAccessor.query({
|
|
122
|
+
skip: 0,
|
|
123
|
+
take: 1000,
|
|
124
|
+
filter: {
|
|
125
|
+
field: categoryKey,
|
|
126
|
+
operator: {
|
|
127
|
+
type: 'contains',
|
|
128
|
+
},
|
|
129
|
+
value: request.categoryId,
|
|
130
|
+
},
|
|
131
|
+
});
|
|
132
|
+
}
|
|
45
133
|
}));
|
|
46
134
|
}
|
|
47
135
|
return true;
|