@acorex/platform 0.0.0-ACOREX
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/README.md +7 -0
- package/auth/README.md +3 -0
- package/common/README.md +3 -0
- package/core/README.md +4 -0
- package/fesm2022/acorex-platform-auth.mjs +1362 -0
- package/fesm2022/acorex-platform-auth.mjs.map +1 -0
- package/fesm2022/acorex-platform-common-common-settings.provider-G9XcXXOG.mjs +127 -0
- package/fesm2022/acorex-platform-common-common-settings.provider-G9XcXXOG.mjs.map +1 -0
- package/fesm2022/acorex-platform-common.mjs +4601 -0
- package/fesm2022/acorex-platform-common.mjs.map +1 -0
- package/fesm2022/acorex-platform-core.mjs +4374 -0
- package/fesm2022/acorex-platform-core.mjs.map +1 -0
- package/fesm2022/acorex-platform-domain.mjs +3234 -0
- package/fesm2022/acorex-platform-domain.mjs.map +1 -0
- package/fesm2022/acorex-platform-layout-builder.mjs +2847 -0
- package/fesm2022/acorex-platform-layout-builder.mjs.map +1 -0
- package/fesm2022/acorex-platform-layout-components-binding-expression-editor-popup.component-CXEdvDTf.mjs +121 -0
- package/fesm2022/acorex-platform-layout-components-binding-expression-editor-popup.component-CXEdvDTf.mjs.map +1 -0
- package/fesm2022/acorex-platform-layout-components.mjs +8583 -0
- package/fesm2022/acorex-platform-layout-components.mjs.map +1 -0
- package/fesm2022/acorex-platform-layout-designer.mjs +2474 -0
- package/fesm2022/acorex-platform-layout-designer.mjs.map +1 -0
- package/fesm2022/acorex-platform-layout-entity.mjs +19150 -0
- package/fesm2022/acorex-platform-layout-entity.mjs.map +1 -0
- package/fesm2022/acorex-platform-layout-views.mjs +1468 -0
- package/fesm2022/acorex-platform-layout-views.mjs.map +1 -0
- package/fesm2022/acorex-platform-layout-widget-core.mjs +2950 -0
- package/fesm2022/acorex-platform-layout-widget-core.mjs.map +1 -0
- package/fesm2022/acorex-platform-layout-widgets-button-widget-designer.component-Dy7jF-oD.mjs +72 -0
- package/fesm2022/acorex-platform-layout-widgets-button-widget-designer.component-Dy7jF-oD.mjs.map +1 -0
- package/fesm2022/acorex-platform-layout-widgets-file-list-popup.component-9uCkMxcc.mjs +158 -0
- package/fesm2022/acorex-platform-layout-widgets-file-list-popup.component-9uCkMxcc.mjs.map +1 -0
- package/fesm2022/acorex-platform-layout-widgets-image-preview.popup-C_EPAvCU.mjs +29 -0
- package/fesm2022/acorex-platform-layout-widgets-image-preview.popup-C_EPAvCU.mjs.map +1 -0
- package/fesm2022/acorex-platform-layout-widgets-page-widget-designer.component-D10yO28c.mjs +172 -0
- package/fesm2022/acorex-platform-layout-widgets-page-widget-designer.component-D10yO28c.mjs.map +1 -0
- package/fesm2022/acorex-platform-layout-widgets-repeater-widget-column.component-BGQqY5Mw.mjs +111 -0
- package/fesm2022/acorex-platform-layout-widgets-repeater-widget-column.component-BGQqY5Mw.mjs.map +1 -0
- package/fesm2022/acorex-platform-layout-widgets-tabular-data-edit-popup.component-DmzNTYiS.mjs +274 -0
- package/fesm2022/acorex-platform-layout-widgets-tabular-data-edit-popup.component-DmzNTYiS.mjs.map +1 -0
- package/fesm2022/acorex-platform-layout-widgets-tabular-data-view-popup.component-BNG_588B.mjs +64 -0
- package/fesm2022/acorex-platform-layout-widgets-tabular-data-view-popup.component-BNG_588B.mjs.map +1 -0
- package/fesm2022/acorex-platform-layout-widgets-text-block-widget-designer.component-Vo4fWHtX.mjs +34 -0
- package/fesm2022/acorex-platform-layout-widgets-text-block-widget-designer.component-Vo4fWHtX.mjs.map +1 -0
- package/fesm2022/acorex-platform-layout-widgets.mjs +29791 -0
- package/fesm2022/acorex-platform-layout-widgets.mjs.map +1 -0
- package/fesm2022/acorex-platform-native.mjs +155 -0
- package/fesm2022/acorex-platform-native.mjs.map +1 -0
- package/fesm2022/acorex-platform-runtime-catalog-command-definition.mjs +20 -0
- package/fesm2022/acorex-platform-runtime-catalog-command-definition.mjs.map +1 -0
- package/fesm2022/acorex-platform-runtime-catalog-query-definition.mjs +20 -0
- package/fesm2022/acorex-platform-runtime-catalog-query-definition.mjs.map +1 -0
- package/fesm2022/acorex-platform-runtime.mjs +899 -0
- package/fesm2022/acorex-platform-runtime.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-default-entity-master-create-view.component-Cvvr4HnL.mjs +160 -0
- package/fesm2022/acorex-platform-themes-default-entity-master-create-view.component-Cvvr4HnL.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-TYoLN1Jq.mjs +120 -0
- package/fesm2022/acorex-platform-themes-default-entity-master-modify-view.component-TYoLN1Jq.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-default-entity-master-single-view.component-C2z5Lq9y.mjs +237 -0
- package/fesm2022/acorex-platform-themes-default-entity-master-single-view.component-C2z5Lq9y.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-default-error-401.component-C7EYJzSr.mjs +31 -0
- package/fesm2022/acorex-platform-themes-default-error-401.component-C7EYJzSr.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-default-error-404.component-7MVLMwIa.mjs +25 -0
- package/fesm2022/acorex-platform-themes-default-error-404.component-7MVLMwIa.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-default-error-offline.component-DR6G8gPC.mjs +19 -0
- package/fesm2022/acorex-platform-themes-default-error-offline.component-DR6G8gPC.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-default.mjs +2589 -0
- package/fesm2022/acorex-platform-themes-default.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-shared-icon-chooser-column.component-CqkWJYdv.mjs +55 -0
- package/fesm2022/acorex-platform-themes-shared-icon-chooser-column.component-CqkWJYdv.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-shared-icon-chooser-view.component-BOTuLdWN.mjs +57 -0
- package/fesm2022/acorex-platform-themes-shared-icon-chooser-view.component-BOTuLdWN.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-shared-settings.provider-DSs1o1M6.mjs +168 -0
- package/fesm2022/acorex-platform-themes-shared-settings.provider-DSs1o1M6.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-shared-theme-color-chooser-column.component-CHfrTtol.mjs +65 -0
- package/fesm2022/acorex-platform-themes-shared-theme-color-chooser-column.component-CHfrTtol.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-shared-theme-color-chooser-view.component-BSmvnUVq.mjs +64 -0
- package/fesm2022/acorex-platform-themes-shared-theme-color-chooser-view.component-BSmvnUVq.mjs.map +1 -0
- package/fesm2022/acorex-platform-themes-shared.mjs +2125 -0
- package/fesm2022/acorex-platform-themes-shared.mjs.map +1 -0
- package/fesm2022/acorex-platform-workflow.mjs +2501 -0
- package/fesm2022/acorex-platform-workflow.mjs.map +1 -0
- package/fesm2022/acorex-platform.mjs +6 -0
- package/fesm2022/acorex-platform.mjs.map +1 -0
- package/layout/builder/README.md +1578 -0
- package/layout/components/README.md +3 -0
- package/layout/designer/README.md +4 -0
- package/layout/entity/README.md +4 -0
- package/layout/views/README.md +3 -0
- package/layout/widget-core/README.md +4 -0
- package/layout/widgets/README.md +3 -0
- package/native/README.md +4 -0
- package/package.json +103 -0
- package/runtime/README.md +3 -0
- package/themes/default/README.md +3 -0
- package/themes/shared/README.md +3 -0
- package/types/acorex-platform-auth.d.ts +680 -0
- package/types/acorex-platform-common.d.ts +2926 -0
- package/types/acorex-platform-core.d.ts +2896 -0
- package/types/acorex-platform-domain.d.ts +2353 -0
- package/types/acorex-platform-layout-builder.d.ts +926 -0
- package/types/acorex-platform-layout-components.d.ts +2903 -0
- package/types/acorex-platform-layout-designer.d.ts +422 -0
- package/types/acorex-platform-layout-entity.d.ts +3189 -0
- package/types/acorex-platform-layout-views.d.ts +667 -0
- package/types/acorex-platform-layout-widget-core.d.ts +1086 -0
- package/types/acorex-platform-layout-widgets.d.ts +5478 -0
- package/types/acorex-platform-native.d.ts +28 -0
- package/types/acorex-platform-runtime-catalog-command-definition.d.ts +137 -0
- package/types/acorex-platform-runtime-catalog-query-definition.d.ts +125 -0
- package/types/acorex-platform-runtime.d.ts +470 -0
- package/types/acorex-platform-themes-default.d.ts +573 -0
- package/types/acorex-platform-themes-shared.d.ts +170 -0
- package/types/acorex-platform-workflow.d.ts +1806 -0
- package/types/acorex-platform.d.ts +2 -0
- package/workflow/README.md +4 -0
|
@@ -0,0 +1,2353 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { InjectionToken, Type, EnvironmentProviders } from '@angular/core';
|
|
3
|
+
import { AXPExpression, AXPMetaData, AXPDataType, AXPOptionsData, AXPValidationRules } from '@acorex/platform/core';
|
|
4
|
+
import * as i1 from '@acorex/platform/runtime';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Token for entity CRUD setup. Consumed by AXPDomainModule.
|
|
8
|
+
* The actual provider is provideEntity() from @acorex/platform/layout/entity
|
|
9
|
+
* to avoid circular dependency (domain must not depend on layout/entity).
|
|
10
|
+
*/
|
|
11
|
+
declare const AXP_ENTITY_CRUD_SETUP: InjectionToken<void>;
|
|
12
|
+
|
|
13
|
+
declare enum AXPDomainActionSide {
|
|
14
|
+
Client = "client",
|
|
15
|
+
Server = "server",
|
|
16
|
+
Both = "both"
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Interface for defining actions
|
|
20
|
+
*/
|
|
21
|
+
interface AXPDomainAction {
|
|
22
|
+
event: string;
|
|
23
|
+
side: 'client' | 'server' | 'both';
|
|
24
|
+
condition?: AXPExpression;
|
|
25
|
+
expression: AXPExpression;
|
|
26
|
+
}
|
|
27
|
+
declare enum AXPEntityCommandScope {
|
|
28
|
+
TypeLevel = "typeLevel",
|
|
29
|
+
Selected = "selected",
|
|
30
|
+
Individual = "individual",
|
|
31
|
+
Section = "section"
|
|
32
|
+
}
|
|
33
|
+
interface AXPDomainRealtedModuleEntity {
|
|
34
|
+
moduleId?: string;
|
|
35
|
+
module?: {
|
|
36
|
+
id?: string;
|
|
37
|
+
name?: string;
|
|
38
|
+
title?: string;
|
|
39
|
+
};
|
|
40
|
+
entityId?: string;
|
|
41
|
+
entity?: {
|
|
42
|
+
id?: string;
|
|
43
|
+
name?: string;
|
|
44
|
+
title?: string;
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Where the validation rule runs: client-side only, server-side only, or both.
|
|
50
|
+
*/
|
|
51
|
+
type AXPValidationRunAt = 'client' | 'server' | 'both';
|
|
52
|
+
/**
|
|
53
|
+
* Validation rule definition (catalog model): metadata for available validation rules.
|
|
54
|
+
* Used in UI to list validation rules: name (rule key), title, description, and runAt.
|
|
55
|
+
* The actual rule usage on properties uses AXPValidationRule from @acorex/platform/core.
|
|
56
|
+
*/
|
|
57
|
+
interface AXPValidationRuleDefinition extends AXPDomainRealtedModuleEntity {
|
|
58
|
+
rule: string;
|
|
59
|
+
title: string;
|
|
60
|
+
description?: string;
|
|
61
|
+
icon?: string;
|
|
62
|
+
/** Where the validation runs: client-side, server-side, or both. Default: 'client' */
|
|
63
|
+
runAt?: AXPValidationRunAt;
|
|
64
|
+
message?: string;
|
|
65
|
+
options?: AXPPropertyDefinition[];
|
|
66
|
+
}
|
|
67
|
+
interface AXPValidationRuleValue {
|
|
68
|
+
rule: string;
|
|
69
|
+
title?: string;
|
|
70
|
+
message?: string;
|
|
71
|
+
options?: AXPMetaData;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
interface AXPPropertyFeatures {
|
|
75
|
+
searchable?: {
|
|
76
|
+
enabled: boolean;
|
|
77
|
+
fullText: boolean;
|
|
78
|
+
};
|
|
79
|
+
filterable?: {
|
|
80
|
+
enabled: boolean;
|
|
81
|
+
inline: boolean;
|
|
82
|
+
};
|
|
83
|
+
sortable?: {
|
|
84
|
+
enabled: boolean;
|
|
85
|
+
};
|
|
86
|
+
auditable?: {
|
|
87
|
+
enabled: boolean;
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
interface AXPPropertyDefinition {
|
|
91
|
+
name: string;
|
|
92
|
+
title: string;
|
|
93
|
+
description?: string;
|
|
94
|
+
icon?: string;
|
|
95
|
+
defaultValue?: unknown;
|
|
96
|
+
disabled?: boolean;
|
|
97
|
+
dataType?: AXPDataType;
|
|
98
|
+
interface: AXPInterfaceDefinitionValue;
|
|
99
|
+
validations?: AXPValidationRuleValue[];
|
|
100
|
+
features?: AXPPropertyFeatures;
|
|
101
|
+
metadata?: AXPMetaData;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/** Widget category for interface grouping (e.g. Editors, Layout, Action). */
|
|
105
|
+
interface AXPInterfaceCategory {
|
|
106
|
+
name: string;
|
|
107
|
+
title: string;
|
|
108
|
+
order?: number;
|
|
109
|
+
}
|
|
110
|
+
/** Widget interface definition stored in DB (display metadata + option definitions). Values are stored in schema. */
|
|
111
|
+
interface AXPInterfaceDefinition {
|
|
112
|
+
name: string;
|
|
113
|
+
title?: string;
|
|
114
|
+
description?: string;
|
|
115
|
+
icon?: string;
|
|
116
|
+
dataType?: AXPDataType;
|
|
117
|
+
/** Widget categories (e.g. Editors, Layout). */
|
|
118
|
+
categories?: AXPInterfaceCategory | AXPInterfaceCategory[];
|
|
119
|
+
/** Widget groups (e.g. form-element, entity-widget). */
|
|
120
|
+
groups?: string[];
|
|
121
|
+
/** Widget type: editor, view, filter, container, action, etc. */
|
|
122
|
+
type?: string;
|
|
123
|
+
/** Default filter widget name when used as filter (e.g. string-filter, number-filter). */
|
|
124
|
+
defaultFilterWidgetName?: string;
|
|
125
|
+
optionDefinitions?: AXPPropertyDefinition[];
|
|
126
|
+
}
|
|
127
|
+
interface AXPInterfaceDefinitionValue {
|
|
128
|
+
name: string;
|
|
129
|
+
title: string;
|
|
130
|
+
options?: AXPOptionsData;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Plugin definition (catalog model): metadata for available plugins.
|
|
135
|
+
* Used in UI to list plugins: name, title, optional icon, description, and options schema.
|
|
136
|
+
*/
|
|
137
|
+
interface AXPPluginDefinition extends AXPDomainRealtedModuleEntity {
|
|
138
|
+
name: string;
|
|
139
|
+
title: string;
|
|
140
|
+
description?: string;
|
|
141
|
+
icon?: string;
|
|
142
|
+
options?: AXPPropertyDefinition[];
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Plugin value in entity: name + optional options (key-value).
|
|
146
|
+
* Fills the definition when used on an entity.
|
|
147
|
+
*/
|
|
148
|
+
interface AXPPluginDefinitionValue {
|
|
149
|
+
name: string;
|
|
150
|
+
options?: AXPMetaData;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
declare enum AXPRelationshipKind {
|
|
154
|
+
Association = 0,
|
|
155
|
+
Composition = 1,
|
|
156
|
+
Aggregation = 2
|
|
157
|
+
}
|
|
158
|
+
declare enum AXPRelationshipCardinality {
|
|
159
|
+
OneToOne = 0,
|
|
160
|
+
OneToMany = 1,
|
|
161
|
+
ManyToMany = 2
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Standalone relation definition with full source and target.
|
|
165
|
+
* Relations live in their own collection, independent of aggregates.
|
|
166
|
+
*/
|
|
167
|
+
interface AXPRelationDefinition {
|
|
168
|
+
id?: string;
|
|
169
|
+
type: AXPRelationshipCardinality;
|
|
170
|
+
kind: AXPRelationshipKind;
|
|
171
|
+
source: {
|
|
172
|
+
aggregate: string;
|
|
173
|
+
entity: string;
|
|
174
|
+
key: string;
|
|
175
|
+
};
|
|
176
|
+
target: {
|
|
177
|
+
aggregate: string;
|
|
178
|
+
entity: string;
|
|
179
|
+
key: string;
|
|
180
|
+
};
|
|
181
|
+
isRequired: boolean;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* Discriminated JSON for `AXPMenuDefinitionRecord.command`.
|
|
186
|
+
* Modal navigation is omitted (Angular `Type` is not JSON-serializable).
|
|
187
|
+
*/
|
|
188
|
+
type AXPMenuDefinitionStoredCommand = {
|
|
189
|
+
kind: 'navigate';
|
|
190
|
+
navigateType: 'router';
|
|
191
|
+
path: string;
|
|
192
|
+
extras?: Record<string, unknown>;
|
|
193
|
+
} | {
|
|
194
|
+
kind: 'execute';
|
|
195
|
+
name: string;
|
|
196
|
+
options?: Record<string, unknown>;
|
|
197
|
+
};
|
|
198
|
+
/**
|
|
199
|
+
* Optional reference to an entity list route: resolved at runtime via `AXPEntityService.createPath`.
|
|
200
|
+
*/
|
|
201
|
+
interface AXPMenuDefinitionEntityListRef {
|
|
202
|
+
module: string;
|
|
203
|
+
entity: string;
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* Serializable menu definition for definition stores (Dexie/Firestore in mock today).
|
|
207
|
+
* Mirrors persisted shape for `AXPEntityDefinitionCrudService` menu APIs — not identical to shell `AXPMenuItem`.
|
|
208
|
+
*/
|
|
209
|
+
interface AXPMenuDefinitionRecord {
|
|
210
|
+
/** Same as `AXPMenuItem.name` (unique key). */
|
|
211
|
+
name: string;
|
|
212
|
+
text: string;
|
|
213
|
+
description?: string;
|
|
214
|
+
icon?: string;
|
|
215
|
+
priority?: number;
|
|
216
|
+
type?: 'menu' | 'group' | 'break';
|
|
217
|
+
/**
|
|
218
|
+
* Parent menu `name` for `context.find(attachParentName).addItems(...)`.
|
|
219
|
+
* Empty omits attachment (provider may add to root — see implementation).
|
|
220
|
+
*/
|
|
221
|
+
attachParentName?: string;
|
|
222
|
+
/** Literal router path; if both this and `entityListRef` are set, implementations may prefer this. */
|
|
223
|
+
path?: string;
|
|
224
|
+
entityListRef?: AXPMenuDefinitionEntityListRef;
|
|
225
|
+
policyFeatures?: string[];
|
|
226
|
+
policyPermissions?: string[];
|
|
227
|
+
badgeKey?: string;
|
|
228
|
+
command?: AXPMenuDefinitionStoredCommand;
|
|
229
|
+
/**
|
|
230
|
+
* Optional module classification (references `PlatformManagement.ModuleDefinitions` when using the category plugin).
|
|
231
|
+
*/
|
|
232
|
+
categoryIds?: string[];
|
|
233
|
+
/** Denormalized labels for list/display (mirrors product category pattern). */
|
|
234
|
+
categories?: Array<{
|
|
235
|
+
id: string;
|
|
236
|
+
title?: string;
|
|
237
|
+
}>;
|
|
238
|
+
meta?: Record<string, unknown>;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
/**
|
|
242
|
+
* One level of child permissions under a root permission (fluent `addChild` only).
|
|
243
|
+
* Nested `children` under leaves are not part of the storage contract.
|
|
244
|
+
*/
|
|
245
|
+
interface AXPPermissionLeafRecord {
|
|
246
|
+
name: string;
|
|
247
|
+
title: string;
|
|
248
|
+
description?: string;
|
|
249
|
+
requiredFeatures?: string[];
|
|
250
|
+
}
|
|
251
|
+
/**
|
|
252
|
+
* Root permission row: one `addPermission` … `endPermission` chain, with optional sibling `addChild` entries.
|
|
253
|
+
*/
|
|
254
|
+
interface AXPPermissionDefinitionRecord {
|
|
255
|
+
name: string;
|
|
256
|
+
title: string;
|
|
257
|
+
description?: string;
|
|
258
|
+
requiredFeatures?: string[];
|
|
259
|
+
/** At most one level — matches `AXPPermissionDefinitionProviderContext` fluent API. */
|
|
260
|
+
children?: AXPPermissionLeafRecord[];
|
|
261
|
+
}
|
|
262
|
+
/**
|
|
263
|
+
* Serializable permission group for definition stores (Dexie/Firestore).
|
|
264
|
+
* Aligns with `AXPPermissionGroupDefinition` / fluent providers; one row per group.
|
|
265
|
+
*/
|
|
266
|
+
interface AXPPermissionGroupDefinitionRecord {
|
|
267
|
+
name: string;
|
|
268
|
+
title: string;
|
|
269
|
+
description?: string;
|
|
270
|
+
permissions: AXPPermissionDefinitionRecord[];
|
|
271
|
+
/**
|
|
272
|
+
* Optional module classification (references `PlatformManagement.ModuleDefinitions` when using the category plugin).
|
|
273
|
+
*/
|
|
274
|
+
categoryIds?: string[];
|
|
275
|
+
/** Denormalized labels for list/display (mirrors product category pattern). */
|
|
276
|
+
categories?: Array<{
|
|
277
|
+
id: string;
|
|
278
|
+
title?: string;
|
|
279
|
+
}>;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
/** Surfaces where a command may be exposed (tooling / automation). Build-time: optional on `defineCommand`. */
|
|
283
|
+
type AXPCommandCapability = 'ai' | 'workflow';
|
|
284
|
+
/**
|
|
285
|
+
* Persisted command registry row (e.g. Dexie/Firestore via AXPEntityDefinitionCrudService).
|
|
286
|
+
* `name` is the runtime command key; `active` is the toggle stored for mock/admin UIs.
|
|
287
|
+
*/
|
|
288
|
+
interface AXPCommandRegistryRecord {
|
|
289
|
+
name: string;
|
|
290
|
+
active: boolean;
|
|
291
|
+
/** Human / AI-oriented description of what the command does. */
|
|
292
|
+
description?: string;
|
|
293
|
+
/** Input parameters as schema rows (same shape as interface `optionDefinitions`). */
|
|
294
|
+
inputOptionDefinitions?: AXPPropertyDefinition[];
|
|
295
|
+
/** Output shape as schema rows (same shape as interface `optionDefinitions`). */
|
|
296
|
+
outputOptionDefinitions?: AXPPropertyDefinition[];
|
|
297
|
+
/** Display title from build-time command metadata (`*.definition.ts`). */
|
|
298
|
+
catalogTitle?: string;
|
|
299
|
+
/** Where the command runs (metadata). */
|
|
300
|
+
executionMode?: 'frontend' | 'backend' | 'both';
|
|
301
|
+
/** Pretty-printed JSON of the outcomes definition from metadata (readonly display). */
|
|
302
|
+
outcomesDefinitionJson?: string;
|
|
303
|
+
/** Pretty-printed JSON of AI hints from metadata (readonly display). */
|
|
304
|
+
aiMetadataJson?: string;
|
|
305
|
+
/**
|
|
306
|
+
* Optional capability flags (from build-time `capabilities` on command metadata).
|
|
307
|
+
* Omitted or empty means no declared surface; consumers may still apply legacy rules (e.g. AI `ai-tool` tag).
|
|
308
|
+
*/
|
|
309
|
+
capabilities?: AXPCommandCapability[];
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
/**
|
|
313
|
+
* Persisted query registry row (e.g. Dexie/Firestore via AXPEntityDefinitionCrudService).
|
|
314
|
+
* `name` is the runtime query key; `active` is the toggle stored for mock/admin UIs.
|
|
315
|
+
* Queries expose `fetch(input)` only — no command outcomes.
|
|
316
|
+
*/
|
|
317
|
+
interface AXPQueryRegistryRecord {
|
|
318
|
+
name: string;
|
|
319
|
+
active: boolean;
|
|
320
|
+
/** Human / AI-oriented description of what the query returns. */
|
|
321
|
+
description?: string;
|
|
322
|
+
/** Input parameters (filter / criteria) as property definition rows. */
|
|
323
|
+
inputOptionDefinitions?: AXPPropertyDefinition[];
|
|
324
|
+
/** Result shape as property definition rows (documentation / tooling). */
|
|
325
|
+
outputOptionDefinitions?: AXPPropertyDefinition[];
|
|
326
|
+
/** Display title from build-time query metadata (`*.query.definition.ts`). */
|
|
327
|
+
catalogTitle?: string;
|
|
328
|
+
/** Where the query runs (metadata). */
|
|
329
|
+
executionMode?: 'frontend' | 'backend' | 'both';
|
|
330
|
+
/** Pretty-printed JSON of AI hints from metadata (readonly display). */
|
|
331
|
+
aiMetadataJson?: string;
|
|
332
|
+
/**
|
|
333
|
+
* Optional capability flags (from build-time `capabilities` on query metadata).
|
|
334
|
+
* Omitted or empty means no declared surface; consumers may still apply legacy rules (e.g. AI `ai-tool` tag).
|
|
335
|
+
*/
|
|
336
|
+
capabilities?: AXPCommandCapability[];
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
/**
|
|
340
|
+
* Service interface for CRUD operations on entity and related definition records stored in Dexie/Firestore.
|
|
341
|
+
* Provided by connectivity mock when using Dexie or Firestore as entity definition source.
|
|
342
|
+
* Use this service from anywhere in the app (not just mock).
|
|
343
|
+
*/
|
|
344
|
+
interface AXPEntityDefinitionCrudService {
|
|
345
|
+
list(): Promise<{
|
|
346
|
+
name: string;
|
|
347
|
+
module: string;
|
|
348
|
+
entityName?: string;
|
|
349
|
+
}[]>;
|
|
350
|
+
getRaw(moduleName: string, entityName: string): Promise<Record<string, unknown> | null>;
|
|
351
|
+
create(entityName: string, definition: Record<string, unknown>): Promise<void>;
|
|
352
|
+
update(entityName: string, definition: Record<string, unknown>): Promise<void>;
|
|
353
|
+
delete(entityName: string): Promise<void>;
|
|
354
|
+
listInterfaces(): Promise<AXPInterfaceDefinition[]>;
|
|
355
|
+
listInterfacesByCategory(categoryName: string): Promise<AXPInterfaceDefinition[]>;
|
|
356
|
+
getInterface(name: string): Promise<AXPInterfaceDefinition | null>;
|
|
357
|
+
createInterface(name: string, definition: AXPInterfaceDefinition): Promise<void>;
|
|
358
|
+
updateInterface(name: string, definition: AXPInterfaceDefinition): Promise<void>;
|
|
359
|
+
deleteInterface(name: string): Promise<void>;
|
|
360
|
+
listPlugins(): Promise<AXPPluginDefinition[]>;
|
|
361
|
+
getPlugin(name: string): Promise<AXPPluginDefinition | null>;
|
|
362
|
+
createPlugin(name: string, definition: AXPPluginDefinition): Promise<void>;
|
|
363
|
+
updatePlugin(name: string, definition: AXPPluginDefinition): Promise<void>;
|
|
364
|
+
deletePlugin(name: string): Promise<void>;
|
|
365
|
+
listValidations(): Promise<AXPValidationRuleDefinition[]>;
|
|
366
|
+
getValidation(name: string): Promise<AXPValidationRuleDefinition | null>;
|
|
367
|
+
createValidation(name: string, definition: AXPValidationRuleDefinition): Promise<void>;
|
|
368
|
+
updateValidation(name: string, definition: AXPValidationRuleDefinition): Promise<void>;
|
|
369
|
+
deleteValidation(name: string): Promise<void>;
|
|
370
|
+
listRelations(): Promise<Array<AXPRelationDefinition & {
|
|
371
|
+
id: string;
|
|
372
|
+
}>>;
|
|
373
|
+
getRelation(id: string): Promise<AXPRelationDefinition | null>;
|
|
374
|
+
createRelation(id: string, definition: AXPRelationDefinition): Promise<void>;
|
|
375
|
+
updateRelation(id: string, definition: AXPRelationDefinition): Promise<void>;
|
|
376
|
+
deleteRelation(id: string): Promise<void>;
|
|
377
|
+
listModules(): Promise<Array<{
|
|
378
|
+
name: string;
|
|
379
|
+
title?: string;
|
|
380
|
+
icon?: string;
|
|
381
|
+
}>>;
|
|
382
|
+
getModule(name: string): Promise<{
|
|
383
|
+
name: string;
|
|
384
|
+
title?: string;
|
|
385
|
+
icon?: string;
|
|
386
|
+
} | null>;
|
|
387
|
+
createModule(name: string, definition: {
|
|
388
|
+
name: string;
|
|
389
|
+
title?: string;
|
|
390
|
+
icon?: string;
|
|
391
|
+
}): Promise<void>;
|
|
392
|
+
updateModule(name: string, definition: {
|
|
393
|
+
name: string;
|
|
394
|
+
title?: string;
|
|
395
|
+
icon?: string;
|
|
396
|
+
}): Promise<void>;
|
|
397
|
+
deleteModule(name: string): Promise<void>;
|
|
398
|
+
listAggregates(filter?: {
|
|
399
|
+
module?: string;
|
|
400
|
+
}): Promise<Array<{
|
|
401
|
+
id: string;
|
|
402
|
+
definition: Record<string, unknown>;
|
|
403
|
+
}>>;
|
|
404
|
+
getAggregate(id: string): Promise<Record<string, unknown> | null>;
|
|
405
|
+
createAggregate(id: string, definition: Record<string, unknown>): Promise<void>;
|
|
406
|
+
updateAggregate(id: string, definition: Record<string, unknown>): Promise<void>;
|
|
407
|
+
deleteAggregate(id: string): Promise<void>;
|
|
408
|
+
listMenus(): Promise<Array<{
|
|
409
|
+
id: string;
|
|
410
|
+
definition: AXPMenuDefinitionRecord;
|
|
411
|
+
}>>;
|
|
412
|
+
getMenu(id: string): Promise<AXPMenuDefinitionRecord | null>;
|
|
413
|
+
createMenu(id: string, definition: AXPMenuDefinitionRecord): Promise<void>;
|
|
414
|
+
updateMenu(id: string, definition: AXPMenuDefinitionRecord): Promise<void>;
|
|
415
|
+
deleteMenu(id: string): Promise<void>;
|
|
416
|
+
listPermissionGroups(): Promise<Array<{
|
|
417
|
+
id: string;
|
|
418
|
+
definition: AXPPermissionGroupDefinitionRecord;
|
|
419
|
+
}>>;
|
|
420
|
+
getPermissionGroup(id: string): Promise<AXPPermissionGroupDefinitionRecord | null>;
|
|
421
|
+
createPermissionGroup(id: string, definition: AXPPermissionGroupDefinitionRecord): Promise<void>;
|
|
422
|
+
updatePermissionGroup(id: string, definition: AXPPermissionGroupDefinitionRecord): Promise<void>;
|
|
423
|
+
deletePermissionGroup(id: string): Promise<void>;
|
|
424
|
+
listCommands(): Promise<Array<{
|
|
425
|
+
id: string;
|
|
426
|
+
definition: AXPCommandRegistryRecord;
|
|
427
|
+
}>>;
|
|
428
|
+
getCommand(id: string): Promise<AXPCommandRegistryRecord | null>;
|
|
429
|
+
createCommand(id: string, definition: AXPCommandRegistryRecord): Promise<void>;
|
|
430
|
+
updateCommand(id: string, definition: AXPCommandRegistryRecord): Promise<void>;
|
|
431
|
+
deleteCommand(id: string): Promise<void>;
|
|
432
|
+
listQueries(): Promise<Array<{
|
|
433
|
+
id: string;
|
|
434
|
+
definition: AXPQueryRegistryRecord;
|
|
435
|
+
}>>;
|
|
436
|
+
getQuery(id: string): Promise<AXPQueryRegistryRecord | null>;
|
|
437
|
+
createQuery(id: string, definition: AXPQueryRegistryRecord): Promise<void>;
|
|
438
|
+
updateQuery(id: string, definition: AXPQueryRegistryRecord): Promise<void>;
|
|
439
|
+
deleteQuery(id: string): Promise<void>;
|
|
440
|
+
}
|
|
441
|
+
declare const AXP_ENTITY_DEFINITION_CRUD_SERVICE: InjectionToken<AXPEntityDefinitionCrudService | null>;
|
|
442
|
+
|
|
443
|
+
declare class AXPDomainModule {
|
|
444
|
+
private _commandSetup;
|
|
445
|
+
/**
|
|
446
|
+
* Optional bootstrap hooks for registered property definitions (see {@link AXP_PROPERTY_SETUP} and related tokens).
|
|
447
|
+
*/
|
|
448
|
+
private _propertySetup;
|
|
449
|
+
private _propertyMiddlewareSetup;
|
|
450
|
+
private _propertyLoaderSetup;
|
|
451
|
+
/**
|
|
452
|
+
* Injection token for domain loader setup initialization.
|
|
453
|
+
*
|
|
454
|
+
* Used during application bootstrap to register domain loaders
|
|
455
|
+
* that can provide domain definitions on-demand when they're not found in
|
|
456
|
+
* the registry.
|
|
457
|
+
*/
|
|
458
|
+
private _domainLoaderSetup;
|
|
459
|
+
private _domainMiddlewareSetup;
|
|
460
|
+
private _domainSetup;
|
|
461
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AXPDomainModule, never>;
|
|
462
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<AXPDomainModule, never, [typeof i1.AXPRuntimeModule], never>;
|
|
463
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<AXPDomainModule>;
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
declare enum AXPEntityType {
|
|
467
|
+
Entity = 0,
|
|
468
|
+
AggregateRoot = 1,
|
|
469
|
+
ValueObject = 2
|
|
470
|
+
}
|
|
471
|
+
interface AXPEntityDefinition {
|
|
472
|
+
name: string;
|
|
473
|
+
title: string;
|
|
474
|
+
fields: AXPEntityPropertyDefinition[];
|
|
475
|
+
type: AXPEntityType;
|
|
476
|
+
/** Entity plugins (e.g. common.history, common.lock). Name + optional options only. */
|
|
477
|
+
plugins?: AXPPluginDefinitionValue[];
|
|
478
|
+
/** Property groups for layout */
|
|
479
|
+
groups?: Array<{
|
|
480
|
+
id: string;
|
|
481
|
+
title: string;
|
|
482
|
+
}>;
|
|
483
|
+
/** List/table columns */
|
|
484
|
+
columns?: Array<{
|
|
485
|
+
name: string;
|
|
486
|
+
}>;
|
|
487
|
+
/** Display formats */
|
|
488
|
+
formats?: {
|
|
489
|
+
individual?: string;
|
|
490
|
+
plural?: string;
|
|
491
|
+
};
|
|
492
|
+
/** Layout interfaces (master create/update/single/list). Pass-through for converter. */
|
|
493
|
+
interfaces?: Record<string, unknown>;
|
|
494
|
+
/** Module name (e.g. ContentManagement). Derived from path or explicit. */
|
|
495
|
+
module?: string;
|
|
496
|
+
/** Entity icon. */
|
|
497
|
+
icon?: string;
|
|
498
|
+
}
|
|
499
|
+
interface AXPEntityPropertyFeatures {
|
|
500
|
+
nullable: boolean;
|
|
501
|
+
readOnly: boolean;
|
|
502
|
+
}
|
|
503
|
+
/**
|
|
504
|
+
* Entity field: flattened embedded property definition (interface, validations, features) plus entity-only metadata.
|
|
505
|
+
* Top-level name/title are the entity property name/title.
|
|
506
|
+
*/
|
|
507
|
+
interface AXPEntityPropertyDefinition extends AXPPropertyDefinition {
|
|
508
|
+
actions?: AXPDomainAction[];
|
|
509
|
+
/** Nullable/readOnly for entity binding; distinct from property.features (searchable, filterable, etc.). */
|
|
510
|
+
fieldFeatures?: AXPEntityPropertyFeatures;
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
type AXPAggregateEntityList = {
|
|
514
|
+
[key: string]: () => Promise<AXPEntityDefinition>;
|
|
515
|
+
};
|
|
516
|
+
/**
|
|
517
|
+
* Aggregate definition. Relations are stored in a separate collection (like MySQL join table).
|
|
518
|
+
* Join when needed via relations collection.
|
|
519
|
+
*/
|
|
520
|
+
interface AXPAggregateDefinition {
|
|
521
|
+
name: string;
|
|
522
|
+
title: string;
|
|
523
|
+
entities: AXPEntityDefinition[] | AXPAggregateEntityList | Record<string, string>;
|
|
524
|
+
validations: AXPValidationRules;
|
|
525
|
+
actions: AXPDomainAction[];
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
interface AXPModuleDefinition {
|
|
529
|
+
name: string;
|
|
530
|
+
title: string;
|
|
531
|
+
aggregates: AXPAggregateDefinition[];
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
/**
|
|
535
|
+
* Simple runtime model for aggregate definitions with parent references and navigation helpers.
|
|
536
|
+
* Relations are stored in a separate collection; join when needed.
|
|
537
|
+
*/
|
|
538
|
+
declare class AXPAggregateModel {
|
|
539
|
+
readonly name: string;
|
|
540
|
+
readonly title: string;
|
|
541
|
+
readonly validations: AXPValidationRules;
|
|
542
|
+
readonly actions: AXPDomainAction[];
|
|
543
|
+
readonly parent: any;
|
|
544
|
+
readonly entityReferences: Record<string, string>;
|
|
545
|
+
constructor(definition: AXPAggregateDefinition, parent: any);
|
|
546
|
+
/**
|
|
547
|
+
* Extract entity references from various entity definition formats
|
|
548
|
+
* and convert to simple string map
|
|
549
|
+
*/
|
|
550
|
+
private extractEntityReferences;
|
|
551
|
+
/**
|
|
552
|
+
* Get entity reference by name
|
|
553
|
+
*
|
|
554
|
+
* @param entityName Name of the entity
|
|
555
|
+
* @returns Entity reference string or undefined if not found
|
|
556
|
+
*/
|
|
557
|
+
getEntityReference(entityName: string): string | undefined;
|
|
558
|
+
/**
|
|
559
|
+
* Get full path for an entity in this aggregate
|
|
560
|
+
*
|
|
561
|
+
* @param entityName Name of the entity
|
|
562
|
+
* @returns Full entity path
|
|
563
|
+
*/
|
|
564
|
+
getEntityPath(entityName: string): string;
|
|
565
|
+
/**
|
|
566
|
+
* Get all available entity names
|
|
567
|
+
*
|
|
568
|
+
* @returns Array of entity names
|
|
569
|
+
*/
|
|
570
|
+
getEntityNames(): string[];
|
|
571
|
+
/**
|
|
572
|
+
* Check if entity exists in this aggregate
|
|
573
|
+
*
|
|
574
|
+
* @param entityName Name of the entity
|
|
575
|
+
* @returns True if entity exists
|
|
576
|
+
*/
|
|
577
|
+
hasEntity(entityName: string): boolean;
|
|
578
|
+
/**
|
|
579
|
+
* Get parent module
|
|
580
|
+
*
|
|
581
|
+
* @returns Parent module model
|
|
582
|
+
*/
|
|
583
|
+
getModule(): any;
|
|
584
|
+
/**
|
|
585
|
+
* Get full aggregate path (module.aggregate)
|
|
586
|
+
*
|
|
587
|
+
* @returns Full path string
|
|
588
|
+
*/
|
|
589
|
+
getPath(): string;
|
|
590
|
+
/**
|
|
591
|
+
* Get aggregate statistics
|
|
592
|
+
*
|
|
593
|
+
* @returns Statistics object
|
|
594
|
+
*/
|
|
595
|
+
getStatistics(): {
|
|
596
|
+
entityCount: number;
|
|
597
|
+
actionCount: number;
|
|
598
|
+
validationCount: number;
|
|
599
|
+
};
|
|
600
|
+
/**
|
|
601
|
+
* Convert back to interface definition
|
|
602
|
+
*
|
|
603
|
+
* @returns Aggregate definition
|
|
604
|
+
*/
|
|
605
|
+
toDefinition(): AXPAggregateDefinition;
|
|
606
|
+
/**
|
|
607
|
+
* Validate the aggregate structure (synchronous validation only)
|
|
608
|
+
*
|
|
609
|
+
* @returns Array of validation errors
|
|
610
|
+
*/
|
|
611
|
+
validate(): string[];
|
|
612
|
+
}
|
|
613
|
+
|
|
614
|
+
/**
|
|
615
|
+
* Simple runtime model for module definitions with navigation helpers.
|
|
616
|
+
*
|
|
617
|
+
* This model is a pure data structure that provides:
|
|
618
|
+
* - Access to module properties and metadata
|
|
619
|
+
* - Navigation helpers for finding aggregates
|
|
620
|
+
* - Hierarchy navigation and path generation
|
|
621
|
+
*
|
|
622
|
+
* All loading and resolution logic has been moved to AXPDomainRegistry.
|
|
623
|
+
*/
|
|
624
|
+
declare class AXPModuleModel {
|
|
625
|
+
readonly name: string;
|
|
626
|
+
readonly title: string;
|
|
627
|
+
readonly aggregates: AXPAggregateModel[];
|
|
628
|
+
constructor(definition: AXPModuleDefinition);
|
|
629
|
+
/**
|
|
630
|
+
* Find aggregate by name
|
|
631
|
+
*
|
|
632
|
+
* @param name Aggregate name
|
|
633
|
+
* @returns Aggregate model or undefined if not found
|
|
634
|
+
*/
|
|
635
|
+
findAggregate(name: string): AXPAggregateModel | undefined;
|
|
636
|
+
/**
|
|
637
|
+
* Get all aggregates
|
|
638
|
+
*
|
|
639
|
+
* @returns Array of all aggregate models
|
|
640
|
+
*/
|
|
641
|
+
getAllAggregates(): AXPAggregateModel[];
|
|
642
|
+
/**
|
|
643
|
+
* Check if aggregate exists in this module
|
|
644
|
+
*
|
|
645
|
+
* @param name Aggregate name
|
|
646
|
+
* @returns True if aggregate exists
|
|
647
|
+
*/
|
|
648
|
+
hasAggregate(name: string): boolean;
|
|
649
|
+
/**
|
|
650
|
+
* Get all aggregate names
|
|
651
|
+
*
|
|
652
|
+
* @returns Array of aggregate names
|
|
653
|
+
*/
|
|
654
|
+
getAggregateNames(): string[];
|
|
655
|
+
/**
|
|
656
|
+
* Find entity reference across all aggregates
|
|
657
|
+
*
|
|
658
|
+
* @param entityName Entity name to search for
|
|
659
|
+
* @returns Object with aggregate and entity reference, or undefined if not found
|
|
660
|
+
*/
|
|
661
|
+
findEntityReference(entityName: string): {
|
|
662
|
+
aggregate: AXPAggregateModel;
|
|
663
|
+
entityReference: string;
|
|
664
|
+
} | undefined;
|
|
665
|
+
/**
|
|
666
|
+
* Get entity path for a specific entity in a specific aggregate
|
|
667
|
+
*
|
|
668
|
+
* @param aggregateName Aggregate name
|
|
669
|
+
* @param entityName Entity name
|
|
670
|
+
* @returns Full entity path
|
|
671
|
+
*/
|
|
672
|
+
getEntityPath(aggregateName: string, entityName: string): string;
|
|
673
|
+
/**
|
|
674
|
+
* Get aggregate path
|
|
675
|
+
*
|
|
676
|
+
* @param aggregateName Aggregate name
|
|
677
|
+
* @returns Full aggregate path
|
|
678
|
+
*/
|
|
679
|
+
getAggregatePath(aggregateName: string): string;
|
|
680
|
+
/**
|
|
681
|
+
* Get all entity references across all aggregates
|
|
682
|
+
*
|
|
683
|
+
* @returns Map of entity name to full path
|
|
684
|
+
*/
|
|
685
|
+
getAllEntityReferences(): Record<string, string>;
|
|
686
|
+
/**
|
|
687
|
+
* Relations are stored in a separate collection. Use relation queries for join when needed.
|
|
688
|
+
* @deprecated Relations are no longer nested in aggregates.
|
|
689
|
+
*/
|
|
690
|
+
getAllRelations(): Array<{
|
|
691
|
+
aggregate: AXPAggregateModel;
|
|
692
|
+
relation: any;
|
|
693
|
+
}>;
|
|
694
|
+
/**
|
|
695
|
+
* Validate the module structure (synchronous validation only)
|
|
696
|
+
*
|
|
697
|
+
* @returns Array of validation errors
|
|
698
|
+
*/
|
|
699
|
+
validate(): string[];
|
|
700
|
+
/**
|
|
701
|
+
* Get module statistics
|
|
702
|
+
*
|
|
703
|
+
* @returns Statistics object
|
|
704
|
+
*/
|
|
705
|
+
getStatistics(): {
|
|
706
|
+
aggregateCount: number;
|
|
707
|
+
entityCount: number;
|
|
708
|
+
actionCount: number;
|
|
709
|
+
validationCount: number;
|
|
710
|
+
};
|
|
711
|
+
/**
|
|
712
|
+
* Convert back to interface definition
|
|
713
|
+
*
|
|
714
|
+
* @returns Module definition
|
|
715
|
+
*/
|
|
716
|
+
toDefinition(): AXPModuleDefinition;
|
|
717
|
+
}
|
|
718
|
+
|
|
719
|
+
/**
|
|
720
|
+
* Runtime model for a {@link AXPPropertyDefinition} with helper methods.
|
|
721
|
+
*/
|
|
722
|
+
declare class AXPPropertyModel {
|
|
723
|
+
readonly name: string;
|
|
724
|
+
readonly title: string;
|
|
725
|
+
readonly interface: AXPInterfaceDefinitionValue;
|
|
726
|
+
readonly validations: AXPValidationRules;
|
|
727
|
+
readonly features: AXPPropertyFeatures;
|
|
728
|
+
readonly metadata?: AXPMetaData;
|
|
729
|
+
readonly description?: string;
|
|
730
|
+
readonly icon?: string;
|
|
731
|
+
readonly defaultValue?: unknown;
|
|
732
|
+
readonly disabled?: boolean;
|
|
733
|
+
readonly dataType: AXPDataType;
|
|
734
|
+
constructor(definition: AXPPropertyDefinition);
|
|
735
|
+
/**
|
|
736
|
+
* Get widget options
|
|
737
|
+
*/
|
|
738
|
+
getWidgetOptions(): AXPOptionsData | undefined;
|
|
739
|
+
/**
|
|
740
|
+
* Check if the property is disabled
|
|
741
|
+
*/
|
|
742
|
+
isDisabled(): boolean;
|
|
743
|
+
/**
|
|
744
|
+
* Check if searchable
|
|
745
|
+
*/
|
|
746
|
+
isSearchable(): boolean;
|
|
747
|
+
/**
|
|
748
|
+
* Check if full text searchable
|
|
749
|
+
*/
|
|
750
|
+
isFullTextSearchable(): boolean;
|
|
751
|
+
/**
|
|
752
|
+
* Check if filterable
|
|
753
|
+
*/
|
|
754
|
+
isFilterable(): boolean;
|
|
755
|
+
/**
|
|
756
|
+
* Check if inline filterable
|
|
757
|
+
*/
|
|
758
|
+
isInlineFilterable(): boolean;
|
|
759
|
+
/**
|
|
760
|
+
* Check if sortable
|
|
761
|
+
*/
|
|
762
|
+
isSortable(): boolean;
|
|
763
|
+
/**
|
|
764
|
+
* Check if auditable
|
|
765
|
+
*/
|
|
766
|
+
isAuditable(): boolean;
|
|
767
|
+
/**
|
|
768
|
+
* Validate the property definition structure
|
|
769
|
+
*/
|
|
770
|
+
validate(): Promise<string[]>;
|
|
771
|
+
/**
|
|
772
|
+
* Get property capabilities
|
|
773
|
+
*/
|
|
774
|
+
getCapabilities(): {
|
|
775
|
+
searchable: boolean;
|
|
776
|
+
fullTextSearchable: boolean;
|
|
777
|
+
filterable: boolean;
|
|
778
|
+
inlineFilterable: boolean;
|
|
779
|
+
sortable: boolean;
|
|
780
|
+
auditable: boolean;
|
|
781
|
+
disabled: boolean;
|
|
782
|
+
};
|
|
783
|
+
/**
|
|
784
|
+
* Get property summary
|
|
785
|
+
*/
|
|
786
|
+
getSummary(): {
|
|
787
|
+
widget: string;
|
|
788
|
+
hasOptions: boolean;
|
|
789
|
+
hasMetadata: boolean;
|
|
790
|
+
hasValidations: boolean;
|
|
791
|
+
capabilityCount: number;
|
|
792
|
+
};
|
|
793
|
+
/**
|
|
794
|
+
* Convert back to interface definition
|
|
795
|
+
*/
|
|
796
|
+
toDefinition(): AXPPropertyDefinition;
|
|
797
|
+
}
|
|
798
|
+
|
|
799
|
+
/**
|
|
800
|
+
* Loads {@link AXPPropertyDefinition} instances on demand when not registered in {@link AXPPropertyRegistry}.
|
|
801
|
+
*/
|
|
802
|
+
interface AXPPropertyLoader {
|
|
803
|
+
/**
|
|
804
|
+
* Optional priority for loader ordering. Higher numbers = higher priority.
|
|
805
|
+
* If not specified, uses registration order.
|
|
806
|
+
*/
|
|
807
|
+
readonly priority?: number;
|
|
808
|
+
/**
|
|
809
|
+
* Determines if this loader can handle the given registered property name.
|
|
810
|
+
*/
|
|
811
|
+
canLoad(propertyName: string): boolean;
|
|
812
|
+
/**
|
|
813
|
+
* Loads the property definition for the given name, or null if not found.
|
|
814
|
+
*/
|
|
815
|
+
load(propertyName: string): Promise<AXPPropertyDefinition | null>;
|
|
816
|
+
}
|
|
817
|
+
|
|
818
|
+
/**
|
|
819
|
+
* Context class for schema middleware operations providing a fluent API for schema manipulation.
|
|
820
|
+
*
|
|
821
|
+
* This class serves as the interface between middleware functions and schema definitions,
|
|
822
|
+
* offering methods to modify various aspects of a schema including:
|
|
823
|
+
* - Widget configuration and options
|
|
824
|
+
* - Validation rules
|
|
825
|
+
* - Feature flags (searchable, filterable, sortable)
|
|
826
|
+
* - Metadata and custom properties
|
|
827
|
+
* - UI behavior (visibility, readonly state)
|
|
828
|
+
*
|
|
829
|
+
* All methods return `this` to enable fluent method chaining.
|
|
830
|
+
*
|
|
831
|
+
* @example
|
|
832
|
+
* ```typescript
|
|
833
|
+
* // Example middleware using the context
|
|
834
|
+
* (context) => {
|
|
835
|
+
* context
|
|
836
|
+
* .addValidation({ rule: 'required' })
|
|
837
|
+
* .searchable(true)
|
|
838
|
+
* .withDefaultValue('default text')
|
|
839
|
+
* .readonly(false);
|
|
840
|
+
* }
|
|
841
|
+
* ```
|
|
842
|
+
*/
|
|
843
|
+
declare class AXPPropertyMiddlewareContext {
|
|
844
|
+
private _definition;
|
|
845
|
+
constructor(definition: AXPPropertyDefinition);
|
|
846
|
+
/**
|
|
847
|
+
* Get the current schema definition (readonly access)
|
|
848
|
+
*/
|
|
849
|
+
get definition(): Readonly<AXPPropertyDefinition>;
|
|
850
|
+
/**
|
|
851
|
+
* Get the schema name for conditional logic
|
|
852
|
+
*/
|
|
853
|
+
get name(): string;
|
|
854
|
+
/**
|
|
855
|
+
* Set a default value for the widget
|
|
856
|
+
* @param defaultValue The default value to set
|
|
857
|
+
*/
|
|
858
|
+
withDefaultValue(defaultValue: unknown): this;
|
|
859
|
+
/**
|
|
860
|
+
* Remove the default value from the widget
|
|
861
|
+
*/
|
|
862
|
+
removeDefaultValue(): this;
|
|
863
|
+
/**
|
|
864
|
+
* Add multiple validation rules to the schema
|
|
865
|
+
* @param rules Array of validation rules to add
|
|
866
|
+
*/
|
|
867
|
+
withValidation(rules: any[]): this;
|
|
868
|
+
/**
|
|
869
|
+
* Add a single validation rule to the schema
|
|
870
|
+
* @param rule The validation rule to add
|
|
871
|
+
*/
|
|
872
|
+
addValidation(rule: any): this;
|
|
873
|
+
/**
|
|
874
|
+
* Add a single validation rule (alias for addValidation for backward compatibility)
|
|
875
|
+
* @param rule The validation rule to add
|
|
876
|
+
*/
|
|
877
|
+
withValidationRule(rule: any): this;
|
|
878
|
+
/**
|
|
879
|
+
* Remove all validation rules from the schema
|
|
880
|
+
*/
|
|
881
|
+
clearValidations(): this;
|
|
882
|
+
/**
|
|
883
|
+
* Remove a specific validation rule by its rule name
|
|
884
|
+
* @param ruleName The name of the rule to remove (e.g., 'required', 'email')
|
|
885
|
+
*/
|
|
886
|
+
removeValidation(ruleName: string): this;
|
|
887
|
+
/**
|
|
888
|
+
* Set or merge widget options
|
|
889
|
+
* @param options Object containing widget-specific options to merge
|
|
890
|
+
*/
|
|
891
|
+
withWidgetOptions(options: Record<string, unknown>): this;
|
|
892
|
+
/**
|
|
893
|
+
* Remove a specific widget option by key
|
|
894
|
+
* @param optionKey The key of the option to remove
|
|
895
|
+
*/
|
|
896
|
+
removeWidgetOption(optionKey: string): this;
|
|
897
|
+
/**
|
|
898
|
+
* Change the widget type for this schema
|
|
899
|
+
* @param widgetType The new widget type identifier
|
|
900
|
+
*/
|
|
901
|
+
withWidgetType(widgetType: string): this;
|
|
902
|
+
/**
|
|
903
|
+
* Configure general features using an object
|
|
904
|
+
* @param features Object containing feature configurations to merge
|
|
905
|
+
*/
|
|
906
|
+
withFeatures(features: Partial<any>): this;
|
|
907
|
+
/**
|
|
908
|
+
* Configure searchable feature with fine-grained control
|
|
909
|
+
* @param enabled Whether searching is enabled
|
|
910
|
+
* @param fullText Whether full-text search is enabled
|
|
911
|
+
*/
|
|
912
|
+
searchable(enabled?: boolean, fullText?: boolean): this;
|
|
913
|
+
/**
|
|
914
|
+
* Configure filterable feature with inline filter support
|
|
915
|
+
* @param enabled Whether filtering is enabled
|
|
916
|
+
* @param inline Whether inline filtering is supported
|
|
917
|
+
*/
|
|
918
|
+
filterable(enabled?: boolean, inline?: boolean): this;
|
|
919
|
+
/**
|
|
920
|
+
* Configure sortable feature
|
|
921
|
+
* @param enabled Whether sorting is enabled
|
|
922
|
+
*/
|
|
923
|
+
sortable(enabled?: boolean): this;
|
|
924
|
+
/**
|
|
925
|
+
* Add or merge metadata to the schema
|
|
926
|
+
* @param metadata Object containing metadata to merge
|
|
927
|
+
*/
|
|
928
|
+
withMetadata(metadata: any): this;
|
|
929
|
+
/**
|
|
930
|
+
* Remove a specific metadata property by key
|
|
931
|
+
* @param key The metadata key to remove
|
|
932
|
+
*/
|
|
933
|
+
removeMetadata(key: string): this;
|
|
934
|
+
/**
|
|
935
|
+
* Set the disabled state of the widget
|
|
936
|
+
* @param isDisabled Whether the widget should be disabled
|
|
937
|
+
*/
|
|
938
|
+
disabled(isDisabled?: boolean): this;
|
|
939
|
+
/**
|
|
940
|
+
* Set the visibility of the widget
|
|
941
|
+
* @param visible Whether the widget should be visible
|
|
942
|
+
*/
|
|
943
|
+
withVisibility(visible: boolean): this;
|
|
944
|
+
/**
|
|
945
|
+
* Set the readonly state of the widget
|
|
946
|
+
* @param isReadonly Whether the widget should be readonly
|
|
947
|
+
*/
|
|
948
|
+
readonly(isReadonly?: boolean): this;
|
|
949
|
+
}
|
|
950
|
+
|
|
951
|
+
/**
|
|
952
|
+
* Middleware that can transform a property definition during resolution.
|
|
953
|
+
*
|
|
954
|
+
* @param context - Mutable {@link AXPPropertyMiddlewareContext} wrapping a cloned {@link AXPPropertyDefinition}.
|
|
955
|
+
*/
|
|
956
|
+
type AXPPropertyMiddleware = (context: AXPPropertyMiddlewareContext) => void | Promise<void>;
|
|
957
|
+
|
|
958
|
+
/**
|
|
959
|
+
* Options for registering a schema with additional metadata and middleware
|
|
960
|
+
*/
|
|
961
|
+
interface AXPPropertyRegistrationOptions {
|
|
962
|
+
/** Optional description for documentation purposes */
|
|
963
|
+
description?: string;
|
|
964
|
+
/** Tags for categorizing and finding schemas */
|
|
965
|
+
tags?: string[];
|
|
966
|
+
/** Version information for schema evolution */
|
|
967
|
+
version?: string;
|
|
968
|
+
/** Schema-specific middleware that applies only to this schema */
|
|
969
|
+
middleware?: AXPPropertyMiddleware[];
|
|
970
|
+
}
|
|
971
|
+
/**
|
|
972
|
+
* Internal representation of a registered schema with metadata
|
|
973
|
+
*/
|
|
974
|
+
interface AXPRegisteredProperty {
|
|
975
|
+
/** Unique identifier for the schema */
|
|
976
|
+
name: string;
|
|
977
|
+
/** The actual schema definition */
|
|
978
|
+
definition: AXPPropertyDefinition;
|
|
979
|
+
/** Registration options and metadata */
|
|
980
|
+
options: AXPPropertyRegistrationOptions;
|
|
981
|
+
/** Timestamp when the schema was registered */
|
|
982
|
+
registeredAt: Date;
|
|
983
|
+
}
|
|
984
|
+
/**
|
|
985
|
+
* Central registry for managing schema definitions, middleware, and dynamic loading.
|
|
986
|
+
*
|
|
987
|
+
* Provides:
|
|
988
|
+
* - Schema registration and retrieval
|
|
989
|
+
* - Middleware processing pipeline
|
|
990
|
+
* - On-demand schema loading
|
|
991
|
+
* - Caching and performance optimization
|
|
992
|
+
*/
|
|
993
|
+
declare class AXPPropertyRegistry {
|
|
994
|
+
private readonly _registrations;
|
|
995
|
+
private readonly _globalMiddleware;
|
|
996
|
+
private readonly _modelCache;
|
|
997
|
+
private _loaders;
|
|
998
|
+
constructor();
|
|
999
|
+
/**
|
|
1000
|
+
* Register a schema definition with optional metadata and middleware
|
|
1001
|
+
*/
|
|
1002
|
+
register(definition: AXPPropertyDefinition, options?: AXPPropertyRegistrationOptions): void;
|
|
1003
|
+
/**
|
|
1004
|
+
* Register multiple schemas at once for batch operations
|
|
1005
|
+
*/
|
|
1006
|
+
registerBatch(entries: {
|
|
1007
|
+
name: string;
|
|
1008
|
+
definition: AXPPropertyDefinition;
|
|
1009
|
+
options?: AXPPropertyRegistrationOptions;
|
|
1010
|
+
}[]): void;
|
|
1011
|
+
/**
|
|
1012
|
+
* Remove a schema from the registry
|
|
1013
|
+
*/
|
|
1014
|
+
unregister(name: string): boolean;
|
|
1015
|
+
/**
|
|
1016
|
+
* Check if a schema is currently registered
|
|
1017
|
+
*/
|
|
1018
|
+
isRegistered(name: string): boolean;
|
|
1019
|
+
/**
|
|
1020
|
+
* Resolve a schema by name with full middleware processing and caching.
|
|
1021
|
+
* Supports on-demand loading if schema is not registered.
|
|
1022
|
+
*/
|
|
1023
|
+
resolve(name: string): Promise<AXPPropertyModel>;
|
|
1024
|
+
/**
|
|
1025
|
+
* Synchronous resolution without middleware processing.
|
|
1026
|
+
* Use only when middleware is not needed for performance.
|
|
1027
|
+
*/
|
|
1028
|
+
resolveSync(name: string): AXPPropertyModel;
|
|
1029
|
+
/**
|
|
1030
|
+
* Add global middleware that applies to all schema resolutions
|
|
1031
|
+
*/
|
|
1032
|
+
addGlobalMiddleware(middleware: AXPPropertyMiddleware): void;
|
|
1033
|
+
/**
|
|
1034
|
+
* Remove specific global middleware
|
|
1035
|
+
*/
|
|
1036
|
+
removeGlobalMiddleware(middleware: AXPPropertyMiddleware): boolean;
|
|
1037
|
+
/**
|
|
1038
|
+
* Clear all global middleware
|
|
1039
|
+
*/
|
|
1040
|
+
clearGlobalMiddleware(): void;
|
|
1041
|
+
/**
|
|
1042
|
+
* Add a schema loader for on-demand loading
|
|
1043
|
+
*/
|
|
1044
|
+
addLoader(loader: Type<AXPPropertyLoader>): void;
|
|
1045
|
+
/**
|
|
1046
|
+
* Get all registered schema names
|
|
1047
|
+
*/
|
|
1048
|
+
getRegisteredNames(): string[];
|
|
1049
|
+
/**
|
|
1050
|
+
* Get detailed registration information for a schema
|
|
1051
|
+
*/
|
|
1052
|
+
getRegisteredProperty(name: string): AXPRegisteredProperty | undefined;
|
|
1053
|
+
/**
|
|
1054
|
+
* Get all registered properties with their metadata
|
|
1055
|
+
*/
|
|
1056
|
+
getAllRegisteredProperties(): AXPRegisteredProperty[];
|
|
1057
|
+
/**
|
|
1058
|
+
* Find registered properties by tag for categorization
|
|
1059
|
+
*/
|
|
1060
|
+
findByTag(tag: string): AXPRegisteredProperty[];
|
|
1061
|
+
/**
|
|
1062
|
+
* Find registered properties by widget type for widget-specific operations
|
|
1063
|
+
*/
|
|
1064
|
+
findByWidget(widgetType: string): AXPRegisteredProperty[];
|
|
1065
|
+
/**
|
|
1066
|
+
* Get comprehensive registry statistics
|
|
1067
|
+
*/
|
|
1068
|
+
getStatistics(): {
|
|
1069
|
+
propertyCount: number;
|
|
1070
|
+
globalMiddlewareCount: number;
|
|
1071
|
+
propertiesByWidget: {
|
|
1072
|
+
[widget: string]: number;
|
|
1073
|
+
};
|
|
1074
|
+
propertiesByTag: {
|
|
1075
|
+
[tag: string]: number;
|
|
1076
|
+
};
|
|
1077
|
+
};
|
|
1078
|
+
/**
|
|
1079
|
+
* Clear all cached models (useful when schemas need to be reloaded)
|
|
1080
|
+
*/
|
|
1081
|
+
clearCache(): void;
|
|
1082
|
+
/**
|
|
1083
|
+
* Invalidate cache for a specific schema
|
|
1084
|
+
*/
|
|
1085
|
+
invalidateCache(name: string): void;
|
|
1086
|
+
/**
|
|
1087
|
+
* Clear all registered schemas, middleware, and cached models
|
|
1088
|
+
*/
|
|
1089
|
+
clear(): void;
|
|
1090
|
+
/**
|
|
1091
|
+
* Attempt to load schema from registered loaders
|
|
1092
|
+
*/
|
|
1093
|
+
private loadFromLoaders;
|
|
1094
|
+
/**
|
|
1095
|
+
* Get loaders sorted by priority (lazy initialization)
|
|
1096
|
+
*/
|
|
1097
|
+
private getLoaders;
|
|
1098
|
+
/**
|
|
1099
|
+
* Create a deep clone of a schema definition to prevent mutations
|
|
1100
|
+
*/
|
|
1101
|
+
private cloneDefinition;
|
|
1102
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AXPPropertyRegistry, never>;
|
|
1103
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<AXPPropertyRegistry>;
|
|
1104
|
+
}
|
|
1105
|
+
|
|
1106
|
+
/**
|
|
1107
|
+
* High-level facade for registered property definitions ({@link AXPPropertyDefinition}).
|
|
1108
|
+
*
|
|
1109
|
+
* Wraps {@link AXPPropertyRegistry} with convenience methods for resolution and discovery.
|
|
1110
|
+
*/
|
|
1111
|
+
declare class AXPPropertyService {
|
|
1112
|
+
private readonly registry;
|
|
1113
|
+
/**
|
|
1114
|
+
* Register a property definition with optional configuration
|
|
1115
|
+
*/
|
|
1116
|
+
register(definition: AXPPropertyDefinition, options?: AXPPropertyRegistrationOptions): void;
|
|
1117
|
+
/**
|
|
1118
|
+
* Register multiple property definitions at once
|
|
1119
|
+
*/
|
|
1120
|
+
registerBatch(entries: {
|
|
1121
|
+
name: string;
|
|
1122
|
+
definition: AXPPropertyDefinition;
|
|
1123
|
+
options?: AXPPropertyRegistrationOptions;
|
|
1124
|
+
}[]): void;
|
|
1125
|
+
/**
|
|
1126
|
+
* Remove a property definition from the registry
|
|
1127
|
+
*/
|
|
1128
|
+
unregister(name: string): boolean;
|
|
1129
|
+
/**
|
|
1130
|
+
* Check if a property definition is registered by name
|
|
1131
|
+
*/
|
|
1132
|
+
isRegistered(name: string): boolean;
|
|
1133
|
+
/**
|
|
1134
|
+
* Get all registered property names
|
|
1135
|
+
*/
|
|
1136
|
+
getRegisteredNames(): string[];
|
|
1137
|
+
/**
|
|
1138
|
+
* Clear all registrations and reset the registry
|
|
1139
|
+
*/
|
|
1140
|
+
clear(): void;
|
|
1141
|
+
/**
|
|
1142
|
+
* Resolve a registered property by name with full middleware processing
|
|
1143
|
+
*/
|
|
1144
|
+
resolve(name: string): Promise<AXPPropertyModel>;
|
|
1145
|
+
/**
|
|
1146
|
+
* Resolve synchronously without middleware (for performance)
|
|
1147
|
+
*/
|
|
1148
|
+
resolveSync(name: string): AXPPropertyModel;
|
|
1149
|
+
/**
|
|
1150
|
+
* Resolve multiple registered properties for form building and batch operations
|
|
1151
|
+
*/
|
|
1152
|
+
resolveMultiple(fieldConfigs: {
|
|
1153
|
+
name: string;
|
|
1154
|
+
propertyName: string;
|
|
1155
|
+
}[]): Promise<{
|
|
1156
|
+
name: string;
|
|
1157
|
+
property: AXPPropertyModel;
|
|
1158
|
+
}[]>;
|
|
1159
|
+
/**
|
|
1160
|
+
* Add global middleware that applies to all property resolutions
|
|
1161
|
+
*/
|
|
1162
|
+
addGlobalMiddleware(middleware: AXPPropertyMiddleware): void;
|
|
1163
|
+
/**
|
|
1164
|
+
* Remove specific global middleware
|
|
1165
|
+
*/
|
|
1166
|
+
removeGlobalMiddleware(middleware: AXPPropertyMiddleware): boolean;
|
|
1167
|
+
/**
|
|
1168
|
+
* Clear all global middleware
|
|
1169
|
+
*/
|
|
1170
|
+
clearGlobalMiddleware(): void;
|
|
1171
|
+
/**
|
|
1172
|
+
* Get detailed information about a registered property definition
|
|
1173
|
+
*/
|
|
1174
|
+
getRegisteredProperty(name: string): AXPRegisteredProperty | undefined;
|
|
1175
|
+
/**
|
|
1176
|
+
* Get all registered property definitions with their metadata
|
|
1177
|
+
*/
|
|
1178
|
+
getAllRegisteredProperties(): AXPRegisteredProperty[];
|
|
1179
|
+
/**
|
|
1180
|
+
* Find registered properties by tag for categorization and grouping
|
|
1181
|
+
*/
|
|
1182
|
+
findByTag(tag: string): AXPRegisteredProperty[];
|
|
1183
|
+
/**
|
|
1184
|
+
* Find registered properties by widget type for widget-specific operations
|
|
1185
|
+
*/
|
|
1186
|
+
findByWidget(widgetType: string): AXPRegisteredProperty[];
|
|
1187
|
+
/**
|
|
1188
|
+
* Get comprehensive registry statistics and analytics
|
|
1189
|
+
*/
|
|
1190
|
+
getStatistics(): {
|
|
1191
|
+
mostUsedWidgets: string[];
|
|
1192
|
+
mostUsedTags: string[];
|
|
1193
|
+
propertyCount: number;
|
|
1194
|
+
globalMiddlewareCount: number;
|
|
1195
|
+
propertiesByWidget: {
|
|
1196
|
+
[widget: string]: number;
|
|
1197
|
+
};
|
|
1198
|
+
propertiesByTag: {
|
|
1199
|
+
[tag: string]: number;
|
|
1200
|
+
};
|
|
1201
|
+
};
|
|
1202
|
+
/**
|
|
1203
|
+
* Validate that all referenced property names exist in the registry
|
|
1204
|
+
*/
|
|
1205
|
+
validatePropertyReferences(propertyNames: string[]): {
|
|
1206
|
+
valid: boolean;
|
|
1207
|
+
missingPropertyNames: string[];
|
|
1208
|
+
};
|
|
1209
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AXPPropertyService, never>;
|
|
1210
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<AXPPropertyService>;
|
|
1211
|
+
}
|
|
1212
|
+
|
|
1213
|
+
/**
|
|
1214
|
+
* Configuration for a schema loader with optional priority setting
|
|
1215
|
+
*/
|
|
1216
|
+
interface AXPPropertyLoaderConfig {
|
|
1217
|
+
/** The loader class to instantiate */
|
|
1218
|
+
loader: Type<AXPPropertyLoader>;
|
|
1219
|
+
/** Optional priority for loader ordering (higher = higher priority) */
|
|
1220
|
+
priority?: number;
|
|
1221
|
+
}
|
|
1222
|
+
/**
|
|
1223
|
+
* Provide schema loaders for on-demand schema loading.
|
|
1224
|
+
*
|
|
1225
|
+
* Schema loaders enable the registry to load schemas that are not registered
|
|
1226
|
+
* at build time. This is useful for:
|
|
1227
|
+
* - Loading schemas from external APIs
|
|
1228
|
+
* - Dynamic schema generation
|
|
1229
|
+
* - Lazy loading of large schema sets
|
|
1230
|
+
* - Development-time schema hot-reloading
|
|
1231
|
+
*
|
|
1232
|
+
* @param loaders Array of loader classes or loader configurations
|
|
1233
|
+
* @returns Environment providers for dependency injection
|
|
1234
|
+
*
|
|
1235
|
+
* @example
|
|
1236
|
+
* ```typescript
|
|
1237
|
+
* // Simple loader registration
|
|
1238
|
+
* providePropertyLoaders([
|
|
1239
|
+
* HttpSchemaLoader,
|
|
1240
|
+
* FileSystemSchemaLoader
|
|
1241
|
+
* ])
|
|
1242
|
+
*
|
|
1243
|
+
* // With priority configuration
|
|
1244
|
+
* providePropertyLoaders([
|
|
1245
|
+
* { loader: HttpSchemaLoader, priority: 10 },
|
|
1246
|
+
* { loader: FileSystemSchemaLoader, priority: 5 }
|
|
1247
|
+
* ])
|
|
1248
|
+
* ```
|
|
1249
|
+
*/
|
|
1250
|
+
declare function providePropertyLoaders(loaders: Array<Type<AXPPropertyLoader> | AXPPropertyLoaderConfig>): EnvironmentProviders;
|
|
1251
|
+
|
|
1252
|
+
/**
|
|
1253
|
+
* Schema entry for registration containing definition and optional metadata
|
|
1254
|
+
*/
|
|
1255
|
+
interface AXPPropertyEntry {
|
|
1256
|
+
/** The schema definition to register */
|
|
1257
|
+
definition: AXPPropertyDefinition;
|
|
1258
|
+
/** Optional registration options and metadata */
|
|
1259
|
+
options?: AXPPropertyRegistrationOptions;
|
|
1260
|
+
}
|
|
1261
|
+
/**
|
|
1262
|
+
* Provide schema setups for registration during application bootstrap.
|
|
1263
|
+
*
|
|
1264
|
+
* This is the primary way to register schemas that are known at build time.
|
|
1265
|
+
* Schemas registered this way are immediately available in the registry.
|
|
1266
|
+
*
|
|
1267
|
+
* @param schemas Array of schema entries to register
|
|
1268
|
+
* @returns Environment providers for dependency injection
|
|
1269
|
+
*
|
|
1270
|
+
* @example
|
|
1271
|
+
* ```typescript
|
|
1272
|
+
* providePropertySetups([
|
|
1273
|
+
* {
|
|
1274
|
+
* definition: emailSchema,
|
|
1275
|
+
* options: {
|
|
1276
|
+
* tags: ['user', 'contact'],
|
|
1277
|
+
* description: 'Email field schema'
|
|
1278
|
+
* }
|
|
1279
|
+
* },
|
|
1280
|
+
* {
|
|
1281
|
+
* definition: phoneSchema,
|
|
1282
|
+
* options: { tags: ['contact'] }
|
|
1283
|
+
* }
|
|
1284
|
+
* ])
|
|
1285
|
+
* ```
|
|
1286
|
+
*/
|
|
1287
|
+
declare function providePropertySetups(entries: AXPPropertyEntry[]): EnvironmentProviders;
|
|
1288
|
+
/**
|
|
1289
|
+
* Convenience function to provide a single schema setup.
|
|
1290
|
+
*
|
|
1291
|
+
* Useful when you need to register just one schema or want to keep
|
|
1292
|
+
* schema registrations separate for organizational purposes.
|
|
1293
|
+
*
|
|
1294
|
+
* @param definition The schema definition to register
|
|
1295
|
+
* @param options Optional registration options and metadata
|
|
1296
|
+
* @returns Environment providers for dependency injection
|
|
1297
|
+
*
|
|
1298
|
+
* @example
|
|
1299
|
+
* ```typescript
|
|
1300
|
+
* provideProperty(emailSchema, {
|
|
1301
|
+
* tags: ['user', 'contact'],
|
|
1302
|
+
* description: 'User email field'
|
|
1303
|
+
* })
|
|
1304
|
+
* ```
|
|
1305
|
+
*/
|
|
1306
|
+
declare function provideProperty(definition: AXPPropertyDefinition, options?: AXPPropertyRegistrationOptions): EnvironmentProviders;
|
|
1307
|
+
/**
|
|
1308
|
+
* Provide schema setups from a factory function for dynamic registration.
|
|
1309
|
+
*
|
|
1310
|
+
* Useful when schemas need to be generated at runtime, loaded from external
|
|
1311
|
+
* sources, or depend on configuration that's not available at build time.
|
|
1312
|
+
*
|
|
1313
|
+
* @param schemaFactory Factory function that returns schema entries
|
|
1314
|
+
* @returns Environment providers for dependency injection
|
|
1315
|
+
*
|
|
1316
|
+
* @example
|
|
1317
|
+
* ```typescript
|
|
1318
|
+
* providePropertiesFromFactory(async () => {
|
|
1319
|
+
* const config = await loadConfiguration();
|
|
1320
|
+
* return config.schemas.map(schema => ({
|
|
1321
|
+
* definition: schema,
|
|
1322
|
+
* options: { tags: ['dynamic'] }
|
|
1323
|
+
* }));
|
|
1324
|
+
* })
|
|
1325
|
+
* ```
|
|
1326
|
+
*/
|
|
1327
|
+
declare function providePropertiesFromFactory(factory: () => AXPPropertyEntry[] | Promise<AXPPropertyEntry[]>): EnvironmentProviders;
|
|
1328
|
+
|
|
1329
|
+
/**
|
|
1330
|
+
* Middleware entry for registration - can be either a simple function or targeted middleware
|
|
1331
|
+
*/
|
|
1332
|
+
type AXPPropertyMiddlewareEntry = AXPPropertyMiddleware | {
|
|
1333
|
+
target: string | RegExp;
|
|
1334
|
+
middleware: AXPPropertyMiddleware;
|
|
1335
|
+
};
|
|
1336
|
+
/**
|
|
1337
|
+
* Provide schema middleware for registration in the application.
|
|
1338
|
+
*
|
|
1339
|
+
* Supports both global middleware (applies to all schemas) and targeted middleware
|
|
1340
|
+
* (applies only to schemas matching specific patterns).
|
|
1341
|
+
*
|
|
1342
|
+
* @param middleware Array of middleware entries to register
|
|
1343
|
+
* @returns Environment providers for dependency injection
|
|
1344
|
+
*
|
|
1345
|
+
* @example
|
|
1346
|
+
* ```typescript
|
|
1347
|
+
* // Global middleware
|
|
1348
|
+
* providePropertyMiddleware([
|
|
1349
|
+
* (context) => {
|
|
1350
|
+
* if (context.definition.dataType === 'string') {
|
|
1351
|
+
* context.searchable(true);
|
|
1352
|
+
* }
|
|
1353
|
+
* }
|
|
1354
|
+
* ])
|
|
1355
|
+
*
|
|
1356
|
+
* // Targeted middleware
|
|
1357
|
+
* providePropertyMiddleware([
|
|
1358
|
+
* {
|
|
1359
|
+
* target: /^user_/,
|
|
1360
|
+
* middleware: (context) => context.withMetadata({ category: 'user' })
|
|
1361
|
+
* }
|
|
1362
|
+
* ])
|
|
1363
|
+
* ```
|
|
1364
|
+
*/
|
|
1365
|
+
declare function providePropertyMiddleware(middleware: AXPPropertyMiddlewareEntry[]): EnvironmentProviders;
|
|
1366
|
+
|
|
1367
|
+
/**
|
|
1368
|
+
* Targeted middleware extension (name or regex) for property resolution.
|
|
1369
|
+
*/
|
|
1370
|
+
declare const AXP_PROPERTY_EXTENSION: InjectionToken<{
|
|
1371
|
+
target: string | RegExp;
|
|
1372
|
+
middleware: AXPPropertyMiddleware;
|
|
1373
|
+
}>;
|
|
1374
|
+
/**
|
|
1375
|
+
* Bootstrap hook: register property definitions known at build time.
|
|
1376
|
+
*/
|
|
1377
|
+
declare const AXP_PROPERTY_SETUP: InjectionToken<void>;
|
|
1378
|
+
/**
|
|
1379
|
+
* Bootstrap hook: register global middleware for every property resolution.
|
|
1380
|
+
*/
|
|
1381
|
+
declare const AXP_PROPERTY_MIDDLEWARE_SETUP: InjectionToken<void>;
|
|
1382
|
+
/**
|
|
1383
|
+
* Bootstrap hook: register on-demand property loaders.
|
|
1384
|
+
*/
|
|
1385
|
+
declare const AXP_PROPERTY_LOADER_SETUP: InjectionToken<void>;
|
|
1386
|
+
|
|
1387
|
+
/**
|
|
1388
|
+
* Strips entity-only fields so the payload matches {@link AXPPropertyDefinition}.
|
|
1389
|
+
*/
|
|
1390
|
+
declare function toPropertyDefinition(def: AXPEntityPropertyDefinition): AXPPropertyDefinition;
|
|
1391
|
+
/**
|
|
1392
|
+
* Runtime model for entity field definitions with parent references and helper methods
|
|
1393
|
+
*/
|
|
1394
|
+
declare class AXPEntityFieldModel {
|
|
1395
|
+
readonly name: string;
|
|
1396
|
+
readonly title: string;
|
|
1397
|
+
readonly description?: string;
|
|
1398
|
+
readonly validations?: AXPValidationRules;
|
|
1399
|
+
readonly actions?: AXPDomainAction[];
|
|
1400
|
+
readonly fieldFeatures?: AXPEntityPropertyFeatures;
|
|
1401
|
+
readonly defaultValue?: unknown;
|
|
1402
|
+
/** Resolved property definition model (interface, validations, features). */
|
|
1403
|
+
readonly property: AXPPropertyModel;
|
|
1404
|
+
/** Same as entity field name; aligns with registered property definition name when applicable. */
|
|
1405
|
+
readonly propertyName: string;
|
|
1406
|
+
readonly parent: any;
|
|
1407
|
+
readonly propertyService: AXPPropertyService;
|
|
1408
|
+
private readonly entityPropertyDefinition;
|
|
1409
|
+
constructor(definition: AXPEntityPropertyDefinition, parent: any, propertyService: AXPPropertyService);
|
|
1410
|
+
/**
|
|
1411
|
+
* Check if field is nullable
|
|
1412
|
+
*/
|
|
1413
|
+
isNullable(): boolean;
|
|
1414
|
+
/**
|
|
1415
|
+
* Check if field is readonly
|
|
1416
|
+
*/
|
|
1417
|
+
isReadonly(): boolean;
|
|
1418
|
+
/**
|
|
1419
|
+
* Check if field is required (has required validation)
|
|
1420
|
+
*/
|
|
1421
|
+
isRequired(): boolean;
|
|
1422
|
+
/**
|
|
1423
|
+
* Check if field is searchable
|
|
1424
|
+
*/
|
|
1425
|
+
isSearchable(): boolean;
|
|
1426
|
+
/**
|
|
1427
|
+
* Check if field supports full text search
|
|
1428
|
+
*/
|
|
1429
|
+
isFullTextSearchable(): boolean;
|
|
1430
|
+
/**
|
|
1431
|
+
* Check if field is filterable
|
|
1432
|
+
*/
|
|
1433
|
+
isFilterable(): boolean;
|
|
1434
|
+
/**
|
|
1435
|
+
* Check if field has inline filtering
|
|
1436
|
+
*/
|
|
1437
|
+
hasInlineFiltering(): boolean;
|
|
1438
|
+
/**
|
|
1439
|
+
* Check if field is sortable
|
|
1440
|
+
*/
|
|
1441
|
+
isSortable(): boolean;
|
|
1442
|
+
/**
|
|
1443
|
+
* Check if field is auditable
|
|
1444
|
+
*/
|
|
1445
|
+
isAuditable(): boolean;
|
|
1446
|
+
/**
|
|
1447
|
+
* Registered property name (same as entity field name in the embedded model).
|
|
1448
|
+
*/
|
|
1449
|
+
getPropertyName(): string;
|
|
1450
|
+
/**
|
|
1451
|
+
* Registration metadata when this field's definition name is registered; otherwise embedded summary.
|
|
1452
|
+
*/
|
|
1453
|
+
getPropertyInfo(): unknown;
|
|
1454
|
+
/**
|
|
1455
|
+
* Rebuild the property model from embedded definition (e.g. after definition updates).
|
|
1456
|
+
*/
|
|
1457
|
+
refreshProperty(): void;
|
|
1458
|
+
/**
|
|
1459
|
+
* Get parent entity
|
|
1460
|
+
*/
|
|
1461
|
+
getEntity(): any;
|
|
1462
|
+
/**
|
|
1463
|
+
* Get parent aggregate
|
|
1464
|
+
*/
|
|
1465
|
+
getAggregate(): any;
|
|
1466
|
+
/**
|
|
1467
|
+
* Get parent module
|
|
1468
|
+
*/
|
|
1469
|
+
getModule(): any;
|
|
1470
|
+
/**
|
|
1471
|
+
* Get full path (module.aggregate.entity.field)
|
|
1472
|
+
*/
|
|
1473
|
+
getPath(): string;
|
|
1474
|
+
/**
|
|
1475
|
+
* Validate the field structure
|
|
1476
|
+
*/
|
|
1477
|
+
validate(): Promise<string[]>;
|
|
1478
|
+
/**
|
|
1479
|
+
* Get field statistics
|
|
1480
|
+
*/
|
|
1481
|
+
getStatistics(): {
|
|
1482
|
+
hasValidations: boolean;
|
|
1483
|
+
hasActions: boolean;
|
|
1484
|
+
hasFieldFeatures: boolean;
|
|
1485
|
+
hasDefaultValue: boolean;
|
|
1486
|
+
validationCount: number;
|
|
1487
|
+
actionCount: number;
|
|
1488
|
+
};
|
|
1489
|
+
/**
|
|
1490
|
+
* Get field capabilities
|
|
1491
|
+
*/
|
|
1492
|
+
getCapabilities(): {
|
|
1493
|
+
searchable: boolean;
|
|
1494
|
+
filterable: boolean;
|
|
1495
|
+
sortable: boolean;
|
|
1496
|
+
auditable: boolean;
|
|
1497
|
+
nullable: boolean;
|
|
1498
|
+
readonly: boolean;
|
|
1499
|
+
required: boolean;
|
|
1500
|
+
};
|
|
1501
|
+
/**
|
|
1502
|
+
* Convert back to interface definition
|
|
1503
|
+
*/
|
|
1504
|
+
toDefinition(): AXPEntityPropertyDefinition;
|
|
1505
|
+
}
|
|
1506
|
+
|
|
1507
|
+
/**
|
|
1508
|
+
* Runtime model for entity definitions with parent references and helper methods
|
|
1509
|
+
*/
|
|
1510
|
+
declare class AXPEntityModel {
|
|
1511
|
+
readonly name: string;
|
|
1512
|
+
readonly title: string;
|
|
1513
|
+
readonly fields: AXPEntityFieldModel[];
|
|
1514
|
+
readonly type: AXPEntityType;
|
|
1515
|
+
readonly parent: any;
|
|
1516
|
+
readonly propertyService: AXPPropertyService;
|
|
1517
|
+
constructor(definition: AXPEntityDefinition, parent: any, propertyService: AXPPropertyService);
|
|
1518
|
+
/**
|
|
1519
|
+
* Find field by name
|
|
1520
|
+
*/
|
|
1521
|
+
findField(name: string): AXPEntityFieldModel | undefined;
|
|
1522
|
+
/**
|
|
1523
|
+
* Get all fields
|
|
1524
|
+
*/
|
|
1525
|
+
getAllFields(): AXPEntityFieldModel[];
|
|
1526
|
+
/**
|
|
1527
|
+
* Get required fields
|
|
1528
|
+
*/
|
|
1529
|
+
getRequiredFields(): AXPEntityFieldModel[];
|
|
1530
|
+
/**
|
|
1531
|
+
* Get readonly fields
|
|
1532
|
+
*/
|
|
1533
|
+
getReadonlyFields(): AXPEntityFieldModel[];
|
|
1534
|
+
/**
|
|
1535
|
+
* Get searchable fields
|
|
1536
|
+
*/
|
|
1537
|
+
getSearchableFields(): AXPEntityFieldModel[];
|
|
1538
|
+
/**
|
|
1539
|
+
* Get filterable fields
|
|
1540
|
+
*/
|
|
1541
|
+
getFilterableFields(): AXPEntityFieldModel[];
|
|
1542
|
+
/**
|
|
1543
|
+
* Get sortable fields
|
|
1544
|
+
*/
|
|
1545
|
+
getSortableFields(): AXPEntityFieldModel[];
|
|
1546
|
+
/**
|
|
1547
|
+
* Check if this entity is an aggregate root
|
|
1548
|
+
*/
|
|
1549
|
+
isAggregateRoot(): boolean;
|
|
1550
|
+
/**
|
|
1551
|
+
* Check if this entity is a regular entity
|
|
1552
|
+
*/
|
|
1553
|
+
isEntity(): boolean;
|
|
1554
|
+
/**
|
|
1555
|
+
* Check if this entity is a value object
|
|
1556
|
+
*/
|
|
1557
|
+
isValueObject(): boolean;
|
|
1558
|
+
/**
|
|
1559
|
+
* Get parent aggregate
|
|
1560
|
+
*/
|
|
1561
|
+
getAggregate(): any;
|
|
1562
|
+
/**
|
|
1563
|
+
* Get parent module
|
|
1564
|
+
*/
|
|
1565
|
+
getModule(): any;
|
|
1566
|
+
/**
|
|
1567
|
+
* Get full path (module.aggregate.entity)
|
|
1568
|
+
*/
|
|
1569
|
+
getPath(): string;
|
|
1570
|
+
/**
|
|
1571
|
+
* Validate the entity structure
|
|
1572
|
+
*/
|
|
1573
|
+
validate(): Promise<string[]>;
|
|
1574
|
+
/**
|
|
1575
|
+
* Get entity statistics
|
|
1576
|
+
*/
|
|
1577
|
+
getStatistics(): {
|
|
1578
|
+
fieldCount: number;
|
|
1579
|
+
requiredFieldCount: number;
|
|
1580
|
+
readonlyFieldCount: number;
|
|
1581
|
+
searchableFieldCount: number;
|
|
1582
|
+
filterableFieldCount: number;
|
|
1583
|
+
sortableFieldCount: number;
|
|
1584
|
+
};
|
|
1585
|
+
/**
|
|
1586
|
+
* Convert back to interface definition
|
|
1587
|
+
*/
|
|
1588
|
+
toDefinition(): AXPEntityDefinition;
|
|
1589
|
+
}
|
|
1590
|
+
|
|
1591
|
+
/**
|
|
1592
|
+
* Runtime model for standalone relation definitions.
|
|
1593
|
+
* Relations live in their own collection; join when needed.
|
|
1594
|
+
*/
|
|
1595
|
+
declare class AXPRelationModel {
|
|
1596
|
+
readonly type: AXPRelationshipCardinality;
|
|
1597
|
+
readonly kind: AXPRelationshipKind;
|
|
1598
|
+
readonly target: {
|
|
1599
|
+
aggregate: string;
|
|
1600
|
+
entity: string;
|
|
1601
|
+
key: string;
|
|
1602
|
+
};
|
|
1603
|
+
readonly source: {
|
|
1604
|
+
aggregate: string;
|
|
1605
|
+
entity: string;
|
|
1606
|
+
key: string;
|
|
1607
|
+
};
|
|
1608
|
+
readonly isRequired: boolean;
|
|
1609
|
+
readonly parent: any;
|
|
1610
|
+
constructor(definition: AXPRelationDefinition, parent: any);
|
|
1611
|
+
/**
|
|
1612
|
+
* Check if relation is one-to-one
|
|
1613
|
+
*/
|
|
1614
|
+
isOneToOne(): boolean;
|
|
1615
|
+
/**
|
|
1616
|
+
* Check if relation is one-to-many
|
|
1617
|
+
*/
|
|
1618
|
+
isOneToMany(): boolean;
|
|
1619
|
+
/**
|
|
1620
|
+
* Check if relation is many-to-many
|
|
1621
|
+
*/
|
|
1622
|
+
isManyToMany(): boolean;
|
|
1623
|
+
/**
|
|
1624
|
+
* Check if relation is association
|
|
1625
|
+
*/
|
|
1626
|
+
isAssociation(): boolean;
|
|
1627
|
+
/**
|
|
1628
|
+
* Check if relation is composition
|
|
1629
|
+
*/
|
|
1630
|
+
isComposition(): boolean;
|
|
1631
|
+
/**
|
|
1632
|
+
* Check if relation is aggregation
|
|
1633
|
+
*/
|
|
1634
|
+
isAggregation(): boolean;
|
|
1635
|
+
/**
|
|
1636
|
+
* Get parent aggregate
|
|
1637
|
+
*/
|
|
1638
|
+
getAggregate(): any;
|
|
1639
|
+
/**
|
|
1640
|
+
* Get parent module
|
|
1641
|
+
*/
|
|
1642
|
+
getModule(): any;
|
|
1643
|
+
/**
|
|
1644
|
+
* Get full path (module.aggregate.relation)
|
|
1645
|
+
*/
|
|
1646
|
+
getPath(): string;
|
|
1647
|
+
/**
|
|
1648
|
+
* Get relation description
|
|
1649
|
+
*/
|
|
1650
|
+
getDescription(): string;
|
|
1651
|
+
/**
|
|
1652
|
+
* Get cardinality description
|
|
1653
|
+
*/
|
|
1654
|
+
getCardinalityDescription(): string;
|
|
1655
|
+
/**
|
|
1656
|
+
* Get kind description
|
|
1657
|
+
*/
|
|
1658
|
+
getKindDescription(): string;
|
|
1659
|
+
/**
|
|
1660
|
+
* Get relation summary
|
|
1661
|
+
*/
|
|
1662
|
+
getSummary(): string;
|
|
1663
|
+
/**
|
|
1664
|
+
* Validate the relation structure
|
|
1665
|
+
*/
|
|
1666
|
+
validate(): string[];
|
|
1667
|
+
/**
|
|
1668
|
+
* Get relation characteristics
|
|
1669
|
+
*/
|
|
1670
|
+
getCharacteristics(): {
|
|
1671
|
+
type: string;
|
|
1672
|
+
kind: string;
|
|
1673
|
+
required: boolean;
|
|
1674
|
+
isOwning: boolean;
|
|
1675
|
+
isNavigable: boolean;
|
|
1676
|
+
};
|
|
1677
|
+
/**
|
|
1678
|
+
* Check if relation involves entity
|
|
1679
|
+
*/
|
|
1680
|
+
involvesEntity(entityName: string): boolean;
|
|
1681
|
+
/**
|
|
1682
|
+
* Check if relation targets aggregate
|
|
1683
|
+
*/
|
|
1684
|
+
targetsAggregate(aggregateName: string): boolean;
|
|
1685
|
+
/**
|
|
1686
|
+
* Get the other entity in the relation
|
|
1687
|
+
*/
|
|
1688
|
+
getOtherEntity(entityName: string): string | null;
|
|
1689
|
+
/**
|
|
1690
|
+
* Convert back to interface definition (AXPRelationDefinition with full source/target)
|
|
1691
|
+
*/
|
|
1692
|
+
toDefinition(): AXPRelationDefinition;
|
|
1693
|
+
}
|
|
1694
|
+
|
|
1695
|
+
/**
|
|
1696
|
+
* Helper utility class for working with module models
|
|
1697
|
+
*
|
|
1698
|
+
* @deprecated This helper class is deprecated and will be updated to work with the new domain registry system.
|
|
1699
|
+
* Use AXPDomainService for domain operations instead.
|
|
1700
|
+
*
|
|
1701
|
+
* TODO: Update this helper to work with the new simplified models and domain registry system.
|
|
1702
|
+
*/
|
|
1703
|
+
declare class AXPModuleHelper {
|
|
1704
|
+
/**
|
|
1705
|
+
* @deprecated Use AXPDomainService.findEntitiesByName() instead
|
|
1706
|
+
*/
|
|
1707
|
+
static findEntitiesByName(module: AXPModuleModel, name: string): AXPEntityModel[];
|
|
1708
|
+
/**
|
|
1709
|
+
* @deprecated Use AXPDomainService with entity field queries instead
|
|
1710
|
+
*/
|
|
1711
|
+
static findFieldsByName(module: AXPModuleModel, fieldName: string): AXPEntityFieldModel[];
|
|
1712
|
+
/**
|
|
1713
|
+
* @deprecated Use AXPDomainService with entity type queries instead
|
|
1714
|
+
*/
|
|
1715
|
+
static findEntitiesByType(module: AXPModuleModel, type: AXPEntityType): AXPEntityModel[];
|
|
1716
|
+
/**
|
|
1717
|
+
* @deprecated Use AXPDomainService with field validation queries instead
|
|
1718
|
+
*/
|
|
1719
|
+
static findFieldsWithValidation(module: AXPModuleModel, validationRule: string): AXPEntityFieldModel[];
|
|
1720
|
+
/**
|
|
1721
|
+
* @deprecated Use AXPDomainService with field queries instead
|
|
1722
|
+
*/
|
|
1723
|
+
static findFieldsByDataType(module: AXPModuleModel, dataType: string): AXPEntityFieldModel[];
|
|
1724
|
+
/**
|
|
1725
|
+
* @deprecated Use AXPDomainService with required field queries instead
|
|
1726
|
+
*/
|
|
1727
|
+
static findRequiredFields(module: AXPModuleModel): AXPEntityFieldModel[];
|
|
1728
|
+
/**
|
|
1729
|
+
* @deprecated Use AXPDomainService with nullable field queries instead
|
|
1730
|
+
*/
|
|
1731
|
+
static findNullableFields(module: AXPModuleModel): AXPEntityFieldModel[];
|
|
1732
|
+
/**
|
|
1733
|
+
* @deprecated Use AXPDomainService with default value queries instead
|
|
1734
|
+
*/
|
|
1735
|
+
static findFieldsWithDefaultValues(module: AXPModuleModel): AXPEntityFieldModel[];
|
|
1736
|
+
/**
|
|
1737
|
+
* @deprecated Use AXPDomainService with registered property name queries instead
|
|
1738
|
+
*/
|
|
1739
|
+
static findFieldsByRegisteredPropertyName(module: AXPModuleModel, propertyName: string): AXPEntityFieldModel[];
|
|
1740
|
+
/**
|
|
1741
|
+
* @deprecated Use module.validate() method instead
|
|
1742
|
+
*/
|
|
1743
|
+
static validateModule(module: AXPModuleModel): string[];
|
|
1744
|
+
/**
|
|
1745
|
+
* @deprecated Use aggregate relation queries instead
|
|
1746
|
+
*/
|
|
1747
|
+
static findRelationsByType(module: AXPModuleModel, relationType: string): any[];
|
|
1748
|
+
/**
|
|
1749
|
+
* @deprecated Use AXPDomainService with entity dependency queries instead
|
|
1750
|
+
*/
|
|
1751
|
+
static findEntityDependencies(module: AXPModuleModel, entityName: string): any[];
|
|
1752
|
+
/**
|
|
1753
|
+
* @deprecated Use module.getStatistics() method instead
|
|
1754
|
+
*/
|
|
1755
|
+
static getModuleStatistics(module: AXPModuleModel): any;
|
|
1756
|
+
/**
|
|
1757
|
+
* @deprecated Use AXPDomainService with entity queries instead
|
|
1758
|
+
*/
|
|
1759
|
+
static getAllEntities(module: AXPModuleModel): AXPEntityModel[];
|
|
1760
|
+
/**
|
|
1761
|
+
* @deprecated Use AXPDomainService with field queries instead
|
|
1762
|
+
*/
|
|
1763
|
+
static getAllFields(module: AXPModuleModel): AXPEntityFieldModel[];
|
|
1764
|
+
}
|
|
1765
|
+
|
|
1766
|
+
/**
|
|
1767
|
+
* Union type for all domain definition types
|
|
1768
|
+
*/
|
|
1769
|
+
type AXPDomainDefinition = AXPModuleDefinition | AXPAggregateDefinition | AXPEntityDefinition;
|
|
1770
|
+
/**
|
|
1771
|
+
* Domain path information parsed from path string
|
|
1772
|
+
*/
|
|
1773
|
+
interface AXPDomainPathInfo {
|
|
1774
|
+
module: string;
|
|
1775
|
+
aggregate?: string;
|
|
1776
|
+
entity?: string;
|
|
1777
|
+
type: 'module' | 'aggregate' | 'entity';
|
|
1778
|
+
fullPath: string;
|
|
1779
|
+
}
|
|
1780
|
+
/**
|
|
1781
|
+
* Interface for domain loaders that can provide domain definitions on-demand
|
|
1782
|
+
*/
|
|
1783
|
+
interface AXPDomainLoader {
|
|
1784
|
+
/**
|
|
1785
|
+
* Optional priority for loader ordering. Higher numbers = higher priority.
|
|
1786
|
+
* If not specified, uses registration order.
|
|
1787
|
+
*/
|
|
1788
|
+
readonly priority?: number;
|
|
1789
|
+
/**
|
|
1790
|
+
* Determines if this loader can handle the given domain path
|
|
1791
|
+
* @param path The domain path to load (e.g., "user-management.user-aggregate.user")
|
|
1792
|
+
* @param type The type of domain object being requested
|
|
1793
|
+
* @returns true if this loader can load the domain definition
|
|
1794
|
+
*/
|
|
1795
|
+
canLoad(path: string, type: 'module' | 'aggregate' | 'entity'): boolean;
|
|
1796
|
+
/**
|
|
1797
|
+
* Loads the domain definition for the given path
|
|
1798
|
+
* @param path The domain path to load
|
|
1799
|
+
* @param type The type of domain object being requested
|
|
1800
|
+
* @returns Promise that resolves to the domain definition or null if not found
|
|
1801
|
+
*/
|
|
1802
|
+
load(path: string, type: 'module' | 'aggregate' | 'entity'): Promise<AXPDomainDefinition | null>;
|
|
1803
|
+
}
|
|
1804
|
+
|
|
1805
|
+
/**
|
|
1806
|
+
* Context class for domain middleware operations providing a fluent API for domain definition manipulation.
|
|
1807
|
+
*
|
|
1808
|
+
* This class serves as the interface between middleware functions and domain definitions,
|
|
1809
|
+
* offering methods to modify various aspects of a domain definition including:
|
|
1810
|
+
* - Metadata and custom properties
|
|
1811
|
+
* - Validation rules
|
|
1812
|
+
* - Feature flags and configuration
|
|
1813
|
+
* - Transformations and augmentations
|
|
1814
|
+
*
|
|
1815
|
+
* All methods return `this` to enable fluent method chaining.
|
|
1816
|
+
*/
|
|
1817
|
+
declare class AXPDomainMiddlewareContext {
|
|
1818
|
+
private _definition;
|
|
1819
|
+
private _type;
|
|
1820
|
+
constructor(definition: AXPDomainDefinition, type: 'module' | 'aggregate' | 'entity');
|
|
1821
|
+
/**
|
|
1822
|
+
* Get the current definition (read-only access)
|
|
1823
|
+
*/
|
|
1824
|
+
get definition(): AXPDomainDefinition;
|
|
1825
|
+
/**
|
|
1826
|
+
* Get the type of domain object being processed
|
|
1827
|
+
*/
|
|
1828
|
+
get type(): 'module' | 'aggregate' | 'entity';
|
|
1829
|
+
/**
|
|
1830
|
+
* Set metadata for the domain definition
|
|
1831
|
+
*/
|
|
1832
|
+
setMetadata(key: string, value: any): this;
|
|
1833
|
+
/**
|
|
1834
|
+
* Get metadata value
|
|
1835
|
+
*/
|
|
1836
|
+
getMetadata(key: string): any;
|
|
1837
|
+
/**
|
|
1838
|
+
* Add validation rule to the definition (for entities and aggregates)
|
|
1839
|
+
*/
|
|
1840
|
+
addValidation(rule: any): this;
|
|
1841
|
+
/**
|
|
1842
|
+
* Transform fields (for entities)
|
|
1843
|
+
*/
|
|
1844
|
+
transformFields(transformer: (field: any) => any): this;
|
|
1845
|
+
/**
|
|
1846
|
+
* Add field to entity definition
|
|
1847
|
+
*/
|
|
1848
|
+
addField(field: any): this;
|
|
1849
|
+
/**
|
|
1850
|
+
* Set title with transformation
|
|
1851
|
+
*/
|
|
1852
|
+
setTitle(title: string): this;
|
|
1853
|
+
/**
|
|
1854
|
+
* Apply conditional logic
|
|
1855
|
+
*/
|
|
1856
|
+
when(condition: boolean, callback: (context: this) => void): this;
|
|
1857
|
+
/**
|
|
1858
|
+
* Replace the entire definition
|
|
1859
|
+
*/
|
|
1860
|
+
replaceDefinition(newDefinition: AXPDomainDefinition): this;
|
|
1861
|
+
}
|
|
1862
|
+
/**
|
|
1863
|
+
* Middleware function that can transform domain definitions
|
|
1864
|
+
* @param context - Domain middleware context providing definition info and configuration methods
|
|
1865
|
+
*/
|
|
1866
|
+
type AXPDomainMiddleware = (context: AXPDomainMiddlewareContext) => void | Promise<void>;
|
|
1867
|
+
|
|
1868
|
+
/**
|
|
1869
|
+
* Central registry for managing domain definitions, middleware, and dynamic loading.
|
|
1870
|
+
*
|
|
1871
|
+
* Provides:
|
|
1872
|
+
* - Path-based domain resolution (module.aggregate.entity)
|
|
1873
|
+
* - Definition-level caching with fresh model creation
|
|
1874
|
+
* - Type-specific middleware processing
|
|
1875
|
+
* - On-demand domain loading with first-wins strategy
|
|
1876
|
+
* - Model creation and dependency injection
|
|
1877
|
+
*/
|
|
1878
|
+
declare class AXPDomainRegistry {
|
|
1879
|
+
private readonly _definitionCache;
|
|
1880
|
+
private readonly _moduleMiddleware;
|
|
1881
|
+
private readonly _aggregateMiddleware;
|
|
1882
|
+
private readonly _entityMiddleware;
|
|
1883
|
+
private _loaders;
|
|
1884
|
+
private readonly propertyService;
|
|
1885
|
+
/**
|
|
1886
|
+
* Resolve a domain object by path with full middleware processing.
|
|
1887
|
+
* Supports definition-level caching with fresh model creation.
|
|
1888
|
+
*
|
|
1889
|
+
* @param path Domain path (e.g., "user-management.user-aggregate.user")
|
|
1890
|
+
* @returns Promise that resolves to the domain model
|
|
1891
|
+
*/
|
|
1892
|
+
resolve<T>(path: string): Promise<T>;
|
|
1893
|
+
/**
|
|
1894
|
+
* Parse domain path string into structured information
|
|
1895
|
+
*
|
|
1896
|
+
* @param path Domain path to parse
|
|
1897
|
+
* @returns Parsed path information
|
|
1898
|
+
*/
|
|
1899
|
+
private parsePath;
|
|
1900
|
+
/**
|
|
1901
|
+
* Register a domain loader for on-demand loading
|
|
1902
|
+
*
|
|
1903
|
+
* @param loader The loader instance to register
|
|
1904
|
+
*/
|
|
1905
|
+
addLoader(loader: AXPDomainLoader): void;
|
|
1906
|
+
/**
|
|
1907
|
+
* Load definition from registered loaders using first-wins strategy
|
|
1908
|
+
*
|
|
1909
|
+
* @param path Domain path to load
|
|
1910
|
+
* @param type Type of domain object
|
|
1911
|
+
* @returns Promise that resolves to definition or undefined
|
|
1912
|
+
*/
|
|
1913
|
+
private loadFromLoaders;
|
|
1914
|
+
/**
|
|
1915
|
+
* Add middleware for module processing
|
|
1916
|
+
*/
|
|
1917
|
+
addModuleMiddleware(middleware: AXPDomainMiddleware): void;
|
|
1918
|
+
/**
|
|
1919
|
+
* Add middleware for aggregate processing
|
|
1920
|
+
*/
|
|
1921
|
+
addAggregateMiddleware(middleware: AXPDomainMiddleware): void;
|
|
1922
|
+
/**
|
|
1923
|
+
* Add middleware for entity processing
|
|
1924
|
+
*/
|
|
1925
|
+
addEntityMiddleware(middleware: AXPDomainMiddleware): void;
|
|
1926
|
+
/**
|
|
1927
|
+
* Apply type-specific middleware to definition
|
|
1928
|
+
*
|
|
1929
|
+
* @param definition Raw definition from cache or loader
|
|
1930
|
+
* @param type Type of domain object
|
|
1931
|
+
* @param path Original path for context
|
|
1932
|
+
* @returns Processed definition
|
|
1933
|
+
*/
|
|
1934
|
+
private applyTypeMiddleware;
|
|
1935
|
+
/**
|
|
1936
|
+
* Get middleware collection for specific type
|
|
1937
|
+
*
|
|
1938
|
+
* @param type Domain object type
|
|
1939
|
+
* @returns Array of middleware functions
|
|
1940
|
+
*/
|
|
1941
|
+
private getMiddlewareForType;
|
|
1942
|
+
/**
|
|
1943
|
+
* Create domain model from processed definition
|
|
1944
|
+
*
|
|
1945
|
+
* @param definition Processed definition (after middleware)
|
|
1946
|
+
* @param pathInfo Parsed path information
|
|
1947
|
+
* @returns Created domain model
|
|
1948
|
+
*/
|
|
1949
|
+
private createModel;
|
|
1950
|
+
/**
|
|
1951
|
+
* Clear definition cache for a specific path
|
|
1952
|
+
*
|
|
1953
|
+
* @param path Path to clear from cache
|
|
1954
|
+
*/
|
|
1955
|
+
invalidateCache(path: string): void;
|
|
1956
|
+
/**
|
|
1957
|
+
* Clear all cached definitions
|
|
1958
|
+
*/
|
|
1959
|
+
clearCache(): void;
|
|
1960
|
+
/**
|
|
1961
|
+
* Get cache statistics
|
|
1962
|
+
*/
|
|
1963
|
+
getCacheStats(): {
|
|
1964
|
+
size: number;
|
|
1965
|
+
paths: string[];
|
|
1966
|
+
};
|
|
1967
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AXPDomainRegistry, never>;
|
|
1968
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<AXPDomainRegistry>;
|
|
1969
|
+
}
|
|
1970
|
+
|
|
1971
|
+
/**
|
|
1972
|
+
* High-level facade service for domain operations.
|
|
1973
|
+
*
|
|
1974
|
+
* Provides simplified interfaces to the domain registry with additional
|
|
1975
|
+
* business logic and convenience methods for common operations.
|
|
1976
|
+
*
|
|
1977
|
+
* This service acts as the main entry point for domain model resolution
|
|
1978
|
+
* and provides a clean API for consuming applications.
|
|
1979
|
+
*/
|
|
1980
|
+
declare class AXPDomainService {
|
|
1981
|
+
private readonly registry;
|
|
1982
|
+
/**
|
|
1983
|
+
* Get module by name
|
|
1984
|
+
*
|
|
1985
|
+
* @param name Module name
|
|
1986
|
+
* @returns Promise that resolves to module model
|
|
1987
|
+
*/
|
|
1988
|
+
getModule(name: string): Promise<AXPModuleModel>;
|
|
1989
|
+
/**
|
|
1990
|
+
* Check if module exists
|
|
1991
|
+
*
|
|
1992
|
+
* @param name Module name
|
|
1993
|
+
* @returns Promise that resolves to boolean
|
|
1994
|
+
*/
|
|
1995
|
+
moduleExists(name: string): Promise<boolean>;
|
|
1996
|
+
/**
|
|
1997
|
+
* Get aggregate by module and aggregate names
|
|
1998
|
+
*
|
|
1999
|
+
* @param moduleName Module name
|
|
2000
|
+
* @param aggregateName Aggregate name
|
|
2001
|
+
* @returns Promise that resolves to aggregate model
|
|
2002
|
+
*/
|
|
2003
|
+
getAggregate(moduleName: string, aggregateName: string): Promise<AXPAggregateModel>;
|
|
2004
|
+
/**
|
|
2005
|
+
* Get aggregate by path
|
|
2006
|
+
*
|
|
2007
|
+
* @param path Aggregate path (module.aggregate)
|
|
2008
|
+
* @returns Promise that resolves to aggregate model
|
|
2009
|
+
*/
|
|
2010
|
+
getAggregateByPath(path: string): Promise<AXPAggregateModel>;
|
|
2011
|
+
/**
|
|
2012
|
+
* Check if aggregate exists
|
|
2013
|
+
*
|
|
2014
|
+
* @param moduleName Module name
|
|
2015
|
+
* @param aggregateName Aggregate name
|
|
2016
|
+
* @returns Promise that resolves to boolean
|
|
2017
|
+
*/
|
|
2018
|
+
aggregateExists(moduleName: string, aggregateName: string): Promise<boolean>;
|
|
2019
|
+
/**
|
|
2020
|
+
* Get entity by full path
|
|
2021
|
+
*
|
|
2022
|
+
* @param path Full entity path (module.aggregate.entity)
|
|
2023
|
+
* @returns Promise that resolves to entity model
|
|
2024
|
+
*/
|
|
2025
|
+
getEntity(path: string): Promise<AXPEntityModel>;
|
|
2026
|
+
/**
|
|
2027
|
+
* Get entity by component parts
|
|
2028
|
+
*
|
|
2029
|
+
* @param moduleName Module name
|
|
2030
|
+
* @param aggregateName Aggregate name
|
|
2031
|
+
* @param entityName Entity name
|
|
2032
|
+
* @returns Promise that resolves to entity model
|
|
2033
|
+
*/
|
|
2034
|
+
getEntityByParts(moduleName: string, aggregateName: string, entityName: string): Promise<AXPEntityModel>;
|
|
2035
|
+
/**
|
|
2036
|
+
* Check if entity exists
|
|
2037
|
+
*
|
|
2038
|
+
* @param path Full entity path
|
|
2039
|
+
* @returns Promise that resolves to boolean
|
|
2040
|
+
*/
|
|
2041
|
+
entityExists(path: string): Promise<boolean>;
|
|
2042
|
+
/**
|
|
2043
|
+
* Get multiple modules in parallel
|
|
2044
|
+
*
|
|
2045
|
+
* @param moduleNames Array of module names
|
|
2046
|
+
* @returns Promise that resolves to array of module models
|
|
2047
|
+
*/
|
|
2048
|
+
getModules(moduleNames: string[]): Promise<AXPModuleModel[]>;
|
|
2049
|
+
/**
|
|
2050
|
+
* Get multiple aggregates in parallel
|
|
2051
|
+
*
|
|
2052
|
+
* @param aggregatePaths Array of aggregate paths
|
|
2053
|
+
* @returns Promise that resolves to array of aggregate models
|
|
2054
|
+
*/
|
|
2055
|
+
getAggregates(aggregatePaths: string[]): Promise<AXPAggregateModel[]>;
|
|
2056
|
+
/**
|
|
2057
|
+
* Get multiple entities in parallel
|
|
2058
|
+
*
|
|
2059
|
+
* @param entityPaths Array of entity paths
|
|
2060
|
+
* @returns Promise that resolves to array of entity models
|
|
2061
|
+
*/
|
|
2062
|
+
getEntities(entityPaths: string[]): Promise<AXPEntityModel[]>;
|
|
2063
|
+
/**
|
|
2064
|
+
* Find entities by name across all loaded modules
|
|
2065
|
+
*
|
|
2066
|
+
* @param entityName Entity name to search for
|
|
2067
|
+
* @returns Promise that resolves to array of matching entity paths
|
|
2068
|
+
*/
|
|
2069
|
+
findEntitiesByName(entityName: string): Promise<string[]>;
|
|
2070
|
+
/**
|
|
2071
|
+
* Get all aggregates for a module
|
|
2072
|
+
*
|
|
2073
|
+
* @param moduleName Module name
|
|
2074
|
+
* @returns Promise that resolves to array of aggregate models
|
|
2075
|
+
*/
|
|
2076
|
+
getModuleAggregates(moduleName: string): Promise<AXPAggregateModel[]>;
|
|
2077
|
+
/**
|
|
2078
|
+
* Get all entity references for an aggregate
|
|
2079
|
+
*
|
|
2080
|
+
* @param moduleName Module name
|
|
2081
|
+
* @param aggregateName Aggregate name
|
|
2082
|
+
* @returns Promise that resolves to entity references map
|
|
2083
|
+
*/
|
|
2084
|
+
getAggregateEntityReferences(moduleName: string, aggregateName: string): Promise<Record<string, string>>;
|
|
2085
|
+
/**
|
|
2086
|
+
* Validate module and all its components
|
|
2087
|
+
*
|
|
2088
|
+
* @param moduleName Module name
|
|
2089
|
+
* @returns Promise that resolves to validation errors array
|
|
2090
|
+
*/
|
|
2091
|
+
validateModule(moduleName: string): Promise<string[]>;
|
|
2092
|
+
/**
|
|
2093
|
+
* Validate aggregate and its components
|
|
2094
|
+
*
|
|
2095
|
+
* @param moduleName Module name
|
|
2096
|
+
* @param aggregateName Aggregate name
|
|
2097
|
+
* @returns Promise that resolves to validation errors array
|
|
2098
|
+
*/
|
|
2099
|
+
validateAggregate(moduleName: string, aggregateName: string): Promise<string[]>;
|
|
2100
|
+
/**
|
|
2101
|
+
* Get statistics for a module
|
|
2102
|
+
*
|
|
2103
|
+
* @param moduleName Module name
|
|
2104
|
+
* @returns Promise that resolves to module statistics
|
|
2105
|
+
*/
|
|
2106
|
+
getModuleStatistics(moduleName: string): Promise<any>;
|
|
2107
|
+
/**
|
|
2108
|
+
* Get statistics for an aggregate
|
|
2109
|
+
*
|
|
2110
|
+
* @param moduleName Module name
|
|
2111
|
+
* @param aggregateName Aggregate name
|
|
2112
|
+
* @returns Promise that resolves to aggregate statistics
|
|
2113
|
+
*/
|
|
2114
|
+
getAggregateStatistics(moduleName: string, aggregateName: string): Promise<any>;
|
|
2115
|
+
/**
|
|
2116
|
+
* Clear registry cache
|
|
2117
|
+
*/
|
|
2118
|
+
clearCache(): void;
|
|
2119
|
+
/**
|
|
2120
|
+
* Get cache statistics
|
|
2121
|
+
*
|
|
2122
|
+
* @returns Cache statistics object
|
|
2123
|
+
*/
|
|
2124
|
+
getCacheStatistics(): {
|
|
2125
|
+
size: number;
|
|
2126
|
+
paths: string[];
|
|
2127
|
+
};
|
|
2128
|
+
/**
|
|
2129
|
+
* Invalidate cache for specific path
|
|
2130
|
+
*
|
|
2131
|
+
* @param path Domain path to invalidate
|
|
2132
|
+
*/
|
|
2133
|
+
invalidateCache(path: string): void;
|
|
2134
|
+
/**
|
|
2135
|
+
* Parse domain path into components
|
|
2136
|
+
*
|
|
2137
|
+
* @param path Domain path to parse
|
|
2138
|
+
* @returns Parsed path components
|
|
2139
|
+
*/
|
|
2140
|
+
parsePath(path: string): {
|
|
2141
|
+
module: string;
|
|
2142
|
+
aggregate?: string;
|
|
2143
|
+
entity?: string;
|
|
2144
|
+
type: string;
|
|
2145
|
+
};
|
|
2146
|
+
/**
|
|
2147
|
+
* Build path from components
|
|
2148
|
+
*
|
|
2149
|
+
* @param module Module name
|
|
2150
|
+
* @param aggregate Aggregate name (optional)
|
|
2151
|
+
* @param entity Entity name (optional)
|
|
2152
|
+
* @returns Built path string
|
|
2153
|
+
*/
|
|
2154
|
+
buildPath(module: string, aggregate?: string, entity?: string): string;
|
|
2155
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AXPDomainService, never>;
|
|
2156
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<AXPDomainService>;
|
|
2157
|
+
}
|
|
2158
|
+
|
|
2159
|
+
/**
|
|
2160
|
+
* Configuration for a domain loader with optional priority setting
|
|
2161
|
+
*/
|
|
2162
|
+
interface AXPDomainLoaderConfig {
|
|
2163
|
+
/** The loader class or instance to register */
|
|
2164
|
+
loader: Type<AXPDomainLoader> | AXPDomainLoader;
|
|
2165
|
+
/** Optional priority for loader ordering (higher = higher priority) */
|
|
2166
|
+
priority?: number;
|
|
2167
|
+
}
|
|
2168
|
+
/**
|
|
2169
|
+
* Provide domain loaders for on-demand domain loading.
|
|
2170
|
+
*
|
|
2171
|
+
* Domain loaders enable the registry to load domain definitions that are not registered
|
|
2172
|
+
* at build time. This is useful for:
|
|
2173
|
+
* - Loading domain definitions from external APIs
|
|
2174
|
+
* - Dynamic domain generation
|
|
2175
|
+
* - Lazy loading of large domain sets
|
|
2176
|
+
* - Development-time domain hot-reloading
|
|
2177
|
+
*
|
|
2178
|
+
* @param loaders Array of loader classes, instances, or loader configurations
|
|
2179
|
+
* @returns Environment providers for dependency injection
|
|
2180
|
+
*
|
|
2181
|
+
* @example
|
|
2182
|
+
* ```typescript
|
|
2183
|
+
* // Simple loader registration
|
|
2184
|
+
* provideDomainLoaders([
|
|
2185
|
+
* HttpDomainLoader,
|
|
2186
|
+
* FileSystemDomainLoader,
|
|
2187
|
+
* new MemoryDomainLoader()
|
|
2188
|
+
* ])
|
|
2189
|
+
*
|
|
2190
|
+
* // With priority configuration
|
|
2191
|
+
* provideDomainLoaders([
|
|
2192
|
+
* { loader: HttpDomainLoader, priority: 10 },
|
|
2193
|
+
* { loader: FileSystemDomainLoader, priority: 5 },
|
|
2194
|
+
* { loader: new MemoryDomainLoader(), priority: 15 }
|
|
2195
|
+
* ])
|
|
2196
|
+
* ```
|
|
2197
|
+
*/
|
|
2198
|
+
declare function provideDomainLoaders(loaders: Array<Type<AXPDomainLoader> | AXPDomainLoader | AXPDomainLoaderConfig>): EnvironmentProviders;
|
|
2199
|
+
/**
|
|
2200
|
+
* Provide a single domain loader for convenience
|
|
2201
|
+
*
|
|
2202
|
+
* @param loader Loader class, instance, or configuration
|
|
2203
|
+
* @returns Environment providers for dependency injection
|
|
2204
|
+
*/
|
|
2205
|
+
declare function provideDomainLoader(loader: Type<AXPDomainLoader> | AXPDomainLoader | AXPDomainLoaderConfig): EnvironmentProviders;
|
|
2206
|
+
|
|
2207
|
+
/**
|
|
2208
|
+
* Injection tokens for type-specific middleware setup
|
|
2209
|
+
*/
|
|
2210
|
+
declare const AXP_MODULE_MIDDLEWARE_SETUP = "AXP_MODULE_MIDDLEWARE_SETUP";
|
|
2211
|
+
declare const AXP_AGGREGATE_MIDDLEWARE_SETUP = "AXP_AGGREGATE_MIDDLEWARE_SETUP";
|
|
2212
|
+
declare const AXP_ENTITY_MIDDLEWARE_SETUP = "AXP_ENTITY_MIDDLEWARE_SETUP";
|
|
2213
|
+
/**
|
|
2214
|
+
* Provide middleware for module processing.
|
|
2215
|
+
*
|
|
2216
|
+
* Module middleware is applied when resolving module definitions and can:
|
|
2217
|
+
* - Add metadata and custom properties
|
|
2218
|
+
* - Validate module structure
|
|
2219
|
+
* - Transform module definitions
|
|
2220
|
+
* - Add computed properties
|
|
2221
|
+
*
|
|
2222
|
+
* @param middleware Array of middleware functions to register
|
|
2223
|
+
* @returns Environment providers for dependency injection
|
|
2224
|
+
*
|
|
2225
|
+
* @example
|
|
2226
|
+
* ```typescript
|
|
2227
|
+
* provideModuleMiddleware([
|
|
2228
|
+
* (context) => {
|
|
2229
|
+
* // Add common module metadata
|
|
2230
|
+
* context.setMetadata('loadedAt', new Date());
|
|
2231
|
+
* context.setMetadata('version', '1.0.0');
|
|
2232
|
+
* },
|
|
2233
|
+
* (context) => {
|
|
2234
|
+
* // Add namespace prefix if not present
|
|
2235
|
+
* if (!context.definition.name.includes('.')) {
|
|
2236
|
+
* context.definition.name = `app.${context.definition.name}`;
|
|
2237
|
+
* }
|
|
2238
|
+
* }
|
|
2239
|
+
* ])
|
|
2240
|
+
* ```
|
|
2241
|
+
*/
|
|
2242
|
+
declare function provideModuleMiddleware(middleware: AXPDomainMiddleware[]): EnvironmentProviders;
|
|
2243
|
+
/**
|
|
2244
|
+
* Provide middleware for aggregate processing.
|
|
2245
|
+
*
|
|
2246
|
+
* Aggregate middleware is applied when resolving aggregate definitions and can:
|
|
2247
|
+
* - Add metadata and custom properties
|
|
2248
|
+
* - Validate aggregate structure
|
|
2249
|
+
* - Transform entity references
|
|
2250
|
+
* - Add computed relations
|
|
2251
|
+
*
|
|
2252
|
+
* @param middleware Array of middleware functions to register
|
|
2253
|
+
* @returns Environment providers for dependency injection
|
|
2254
|
+
*
|
|
2255
|
+
* @example
|
|
2256
|
+
* ```typescript
|
|
2257
|
+
* provideAggregateMiddleware([
|
|
2258
|
+
* (context) => {
|
|
2259
|
+
* // Add aggregate metadata
|
|
2260
|
+
* context.setMetadata('type', 'business-aggregate');
|
|
2261
|
+
* },
|
|
2262
|
+
* (context) => {
|
|
2263
|
+
* // Validate entity references
|
|
2264
|
+
* const entities = context.definition.entities;
|
|
2265
|
+
* if (Object.keys(entities).length === 0) {
|
|
2266
|
+
* throw new Error('Aggregate must have at least one entity');
|
|
2267
|
+
* }
|
|
2268
|
+
* }
|
|
2269
|
+
* ])
|
|
2270
|
+
* ```
|
|
2271
|
+
*/
|
|
2272
|
+
declare function provideAggregateMiddleware(middleware: AXPDomainMiddleware[]): EnvironmentProviders;
|
|
2273
|
+
/**
|
|
2274
|
+
* Provide middleware for entity processing.
|
|
2275
|
+
*
|
|
2276
|
+
* Entity middleware is applied when resolving entity definitions and can:
|
|
2277
|
+
* - Add auto-generated fields (id, timestamps)
|
|
2278
|
+
* - Apply field transformations
|
|
2279
|
+
* - Add validation rules
|
|
2280
|
+
* - Set default values
|
|
2281
|
+
*
|
|
2282
|
+
* @param middleware Array of middleware functions to register
|
|
2283
|
+
* @returns Environment providers for dependency injection
|
|
2284
|
+
*
|
|
2285
|
+
* @example
|
|
2286
|
+
* ```typescript
|
|
2287
|
+
* provideEntityMiddleware([
|
|
2288
|
+
* (context) => {
|
|
2289
|
+
* // Add auto-generated ID field if not present
|
|
2290
|
+
* if (!context.definition.fields.some(f => f.name === 'id')) {
|
|
2291
|
+
* context.addField({
|
|
2292
|
+
* name: 'id',
|
|
2293
|
+
* type: 'uuid',
|
|
2294
|
+
* required: true,
|
|
2295
|
+
* generated: true
|
|
2296
|
+
* });
|
|
2297
|
+
* }
|
|
2298
|
+
* },
|
|
2299
|
+
* (context) => {
|
|
2300
|
+
* // Add timestamp fields
|
|
2301
|
+
* context.addField({
|
|
2302
|
+
* name: 'createdAt',
|
|
2303
|
+
* type: 'datetime',
|
|
2304
|
+
* required: true,
|
|
2305
|
+
* generated: true
|
|
2306
|
+
* });
|
|
2307
|
+
* context.addField({
|
|
2308
|
+
* name: 'updatedAt',
|
|
2309
|
+
* type: 'datetime',
|
|
2310
|
+
* required: true,
|
|
2311
|
+
* generated: true
|
|
2312
|
+
* });
|
|
2313
|
+
* }
|
|
2314
|
+
* ])
|
|
2315
|
+
* ```
|
|
2316
|
+
*/
|
|
2317
|
+
declare function provideEntityMiddleware(middleware: AXPDomainMiddleware[]): EnvironmentProviders;
|
|
2318
|
+
/**
|
|
2319
|
+
* Provide combined middleware for all domain types.
|
|
2320
|
+
*
|
|
2321
|
+
* This is a convenience function that allows registering middleware for multiple
|
|
2322
|
+
* domain types in a single call.
|
|
2323
|
+
*
|
|
2324
|
+
* @param config Configuration object with middleware for each type
|
|
2325
|
+
* @returns Environment providers for dependency injection
|
|
2326
|
+
*
|
|
2327
|
+
* @example
|
|
2328
|
+
* ```typescript
|
|
2329
|
+
* provideDomainMiddleware({
|
|
2330
|
+
* modules: [
|
|
2331
|
+
* (context) => context.setMetadata('loadedAt', new Date())
|
|
2332
|
+
* ],
|
|
2333
|
+
* aggregates: [
|
|
2334
|
+
* (context) => context.setMetadata('type', 'business-aggregate')
|
|
2335
|
+
* ],
|
|
2336
|
+
* entities: [
|
|
2337
|
+
* (context) => {
|
|
2338
|
+
* if (!context.definition.fields.some(f => f.name === 'id')) {
|
|
2339
|
+
* context.addField({ name: 'id', type: 'uuid', required: true });
|
|
2340
|
+
* }
|
|
2341
|
+
* }
|
|
2342
|
+
* ]
|
|
2343
|
+
* })
|
|
2344
|
+
* ```
|
|
2345
|
+
*/
|
|
2346
|
+
declare function provideDomainMiddleware(config: {
|
|
2347
|
+
modules?: AXPDomainMiddleware[];
|
|
2348
|
+
aggregates?: AXPDomainMiddleware[];
|
|
2349
|
+
entities?: AXPDomainMiddleware[];
|
|
2350
|
+
}): EnvironmentProviders;
|
|
2351
|
+
|
|
2352
|
+
export { AXPAggregateModel, AXPDomainActionSide, AXPDomainMiddlewareContext, AXPDomainModule, AXPDomainRegistry, AXPDomainService, AXPEntityCommandScope, AXPEntityFieldModel, AXPEntityModel, AXPEntityType, AXPModuleHelper, AXPModuleModel, AXPPropertyMiddlewareContext, AXPPropertyModel, AXPPropertyRegistry, AXPPropertyService, AXPRelationModel, AXPRelationshipCardinality, AXPRelationshipKind, AXP_AGGREGATE_MIDDLEWARE_SETUP, AXP_ENTITY_CRUD_SETUP, AXP_ENTITY_DEFINITION_CRUD_SERVICE, AXP_ENTITY_MIDDLEWARE_SETUP, AXP_MODULE_MIDDLEWARE_SETUP, AXP_PROPERTY_EXTENSION, AXP_PROPERTY_LOADER_SETUP, AXP_PROPERTY_MIDDLEWARE_SETUP, AXP_PROPERTY_SETUP, provideAggregateMiddleware, provideDomainLoader, provideDomainLoaders, provideDomainMiddleware, provideEntityMiddleware, provideModuleMiddleware, providePropertiesFromFactory, provideProperty, providePropertyLoaders, providePropertyMiddleware, providePropertySetups, toPropertyDefinition };
|
|
2353
|
+
export type { AXPAggregateDefinition, AXPAggregateEntityList, AXPCommandCapability, AXPCommandRegistryRecord, AXPDomainAction, AXPDomainDefinition, AXPDomainLoader, AXPDomainLoaderConfig, AXPDomainMiddleware, AXPDomainPathInfo, AXPDomainRealtedModuleEntity, AXPEntityDefinition, AXPEntityDefinitionCrudService, AXPEntityPropertyDefinition, AXPEntityPropertyFeatures, AXPInterfaceCategory, AXPInterfaceDefinition, AXPInterfaceDefinitionValue, AXPMenuDefinitionEntityListRef, AXPMenuDefinitionRecord, AXPMenuDefinitionStoredCommand, AXPModuleDefinition, AXPPermissionDefinitionRecord, AXPPermissionGroupDefinitionRecord, AXPPermissionLeafRecord, AXPPluginDefinition, AXPPluginDefinitionValue, AXPPropertyDefinition, AXPPropertyEntry, AXPPropertyFeatures, AXPPropertyLoader, AXPPropertyLoaderConfig, AXPPropertyMiddleware, AXPPropertyMiddlewareEntry, AXPPropertyRegistrationOptions, AXPQueryRegistryRecord, AXPRegisteredProperty, AXPRelationDefinition, AXPValidationRuleDefinition, AXPValidationRuleValue, AXPValidationRunAt };
|