@acorex/platform 20.0.5 → 20.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (88) hide show
  1. package/auth/index.d.ts +37 -32
  2. package/common/index.d.ts +104 -4
  3. package/core/index.d.ts +4 -0
  4. package/domain/index.d.ts +2010 -42
  5. package/fesm2022/acorex-platform-auth.mjs +57 -21
  6. package/fesm2022/acorex-platform-auth.mjs.map +1 -1
  7. package/fesm2022/acorex-platform-common.mjs +332 -90
  8. package/fesm2022/acorex-platform-common.mjs.map +1 -1
  9. package/fesm2022/acorex-platform-core.mjs +54 -42
  10. package/fesm2022/acorex-platform-core.mjs.map +1 -1
  11. package/fesm2022/acorex-platform-domain.mjs +3338 -31
  12. package/fesm2022/acorex-platform-domain.mjs.map +1 -1
  13. package/fesm2022/acorex-platform-layout-builder.mjs +174 -168
  14. package/fesm2022/acorex-platform-layout-builder.mjs.map +1 -1
  15. package/fesm2022/acorex-platform-layout-components.mjs +281 -89
  16. package/fesm2022/acorex-platform-layout-components.mjs.map +1 -1
  17. package/fesm2022/acorex-platform-layout-designer.mjs +72 -72
  18. package/fesm2022/acorex-platform-layout-designer.mjs.map +1 -1
  19. package/fesm2022/acorex-platform-layout-entity.mjs +210 -130
  20. package/fesm2022/acorex-platform-layout-entity.mjs.map +1 -1
  21. package/fesm2022/acorex-platform-layout-views.mjs +342 -119
  22. package/fesm2022/acorex-platform-layout-views.mjs.map +1 -1
  23. package/fesm2022/acorex-platform-native.mjs +7 -7
  24. package/fesm2022/acorex-platform-native.mjs.map +1 -1
  25. package/fesm2022/acorex-platform-runtime.mjs +51 -48
  26. package/fesm2022/acorex-platform-runtime.mjs.map +1 -1
  27. package/fesm2022/{acorex-platform-themes-default-create-entity-view.component-BxYe1IlE.mjs → acorex-platform-themes-default-create-entity-view.component-DyVB3PZT.mjs} +4 -4
  28. package/fesm2022/{acorex-platform-themes-default-create-entity-view.component-BxYe1IlE.mjs.map → acorex-platform-themes-default-create-entity-view.component-DyVB3PZT.mjs.map} +1 -1
  29. package/fesm2022/{acorex-platform-themes-default-entity-master-create-view.component-CzSqhYfE.mjs → acorex-platform-themes-default-entity-master-create-view.component-CsWVOu-r.mjs} +4 -4
  30. package/fesm2022/{acorex-platform-themes-default-entity-master-create-view.component-CzSqhYfE.mjs.map → acorex-platform-themes-default-entity-master-create-view.component-CsWVOu-r.mjs.map} +1 -1
  31. package/fesm2022/{acorex-platform-themes-default-entity-master-list-view.component-BxdQ5JWS.mjs → acorex-platform-themes-default-entity-master-list-view.component-DgyzWR29.mjs} +20 -20
  32. package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-DgyzWR29.mjs.map +1 -0
  33. package/fesm2022/{acorex-platform-themes-default-entity-master-modify-view.component-12xcM8FJ.mjs → acorex-platform-themes-default-entity-master-modify-view.component-gJap_TBH.mjs} +4 -4
  34. package/fesm2022/{acorex-platform-themes-default-entity-master-modify-view.component-12xcM8FJ.mjs.map → acorex-platform-themes-default-entity-master-modify-view.component-gJap_TBH.mjs.map} +1 -1
  35. package/fesm2022/{acorex-platform-themes-default-entity-master-single-view.component-D99jLndX.mjs → acorex-platform-themes-default-entity-master-single-view.component-BUNm9JV5.mjs} +8 -8
  36. package/fesm2022/acorex-platform-themes-default-entity-master-single-view.component-BUNm9JV5.mjs.map +1 -0
  37. package/fesm2022/{acorex-platform-themes-default-error-401.component-8QfQ3hNo.mjs → acorex-platform-themes-default-error-401.component-DP3msj3d.mjs} +4 -4
  38. package/fesm2022/{acorex-platform-themes-default-error-401.component-8QfQ3hNo.mjs.map → acorex-platform-themes-default-error-401.component-DP3msj3d.mjs.map} +1 -1
  39. package/fesm2022/{acorex-platform-themes-default-error-404.component-D9npA9_W.mjs → acorex-platform-themes-default-error-404.component-uvBHGbHY.mjs} +4 -4
  40. package/fesm2022/{acorex-platform-themes-default-error-404.component-D9npA9_W.mjs.map → acorex-platform-themes-default-error-404.component-uvBHGbHY.mjs.map} +1 -1
  41. package/fesm2022/{acorex-platform-themes-default-error-offline.component-BQpVnLzt.mjs → acorex-platform-themes-default-error-offline.component-CdXIik4U.mjs} +4 -4
  42. package/fesm2022/{acorex-platform-themes-default-error-offline.component-BQpVnLzt.mjs.map → acorex-platform-themes-default-error-offline.component-CdXIik4U.mjs.map} +1 -1
  43. package/fesm2022/acorex-platform-themes-default.mjs +469 -51
  44. package/fesm2022/acorex-platform-themes-default.mjs.map +1 -1
  45. package/fesm2022/acorex-platform-themes-shared.mjs +22 -23
  46. package/fesm2022/acorex-platform-themes-shared.mjs.map +1 -1
  47. package/fesm2022/{acorex-platform-widgets-button-widget-designer.component-BIZkWv8q.mjs → acorex-platform-widgets-button-widget-designer.component-CgUkYMwV.mjs} +4 -4
  48. package/fesm2022/{acorex-platform-widgets-button-widget-designer.component-BIZkWv8q.mjs.map → acorex-platform-widgets-button-widget-designer.component-CgUkYMwV.mjs.map} +1 -1
  49. package/fesm2022/{acorex-platform-widgets-checkbox-widget-column.component-MjSzOXIJ.mjs → acorex-platform-widgets-checkbox-widget-column.component-Dn0U56O7.mjs} +4 -4
  50. package/fesm2022/{acorex-platform-widgets-checkbox-widget-column.component-MjSzOXIJ.mjs.map → acorex-platform-widgets-checkbox-widget-column.component-Dn0U56O7.mjs.map} +1 -1
  51. package/fesm2022/{acorex-platform-widgets-checkbox-widget-designer.component-5kuroU6r.mjs → acorex-platform-widgets-checkbox-widget-designer.component-BD0-kCi0.mjs} +5 -5
  52. package/fesm2022/acorex-platform-widgets-checkbox-widget-designer.component-BD0-kCi0.mjs.map +1 -0
  53. package/fesm2022/{acorex-platform-widgets-checkbox-widget-view.component-BgrIeNW0.mjs → acorex-platform-widgets-checkbox-widget-view.component-CzCWGDil.mjs} +4 -4
  54. package/fesm2022/{acorex-platform-widgets-checkbox-widget-view.component-BgrIeNW0.mjs.map → acorex-platform-widgets-checkbox-widget-view.component-CzCWGDil.mjs.map} +1 -1
  55. package/fesm2022/{acorex-platform-widgets-color-box-widget-designer.component-BTxAgvMQ.mjs → acorex-platform-widgets-color-box-widget-designer.component-BSRAHIPQ.mjs} +4 -4
  56. package/fesm2022/{acorex-platform-widgets-color-box-widget-designer.component-BTxAgvMQ.mjs.map → acorex-platform-widgets-color-box-widget-designer.component-BSRAHIPQ.mjs.map} +1 -1
  57. package/fesm2022/{acorex-platform-widgets-contact-widget-filter.component-DCUfKMJ6.mjs → acorex-platform-widgets-contact-widget-filter.component-CtCAgeH9.mjs} +4 -4
  58. package/fesm2022/{acorex-platform-widgets-contact-widget-filter.component-DCUfKMJ6.mjs.map → acorex-platform-widgets-contact-widget-filter.component-CtCAgeH9.mjs.map} +1 -1
  59. package/fesm2022/{acorex-platform-widgets-file-list-popup.component-yqqPJMg2.mjs → acorex-platform-widgets-file-list-popup.component-hyJf0xT2.mjs} +4 -4
  60. package/fesm2022/{acorex-platform-widgets-file-list-popup.component-yqqPJMg2.mjs.map → acorex-platform-widgets-file-list-popup.component-hyJf0xT2.mjs.map} +1 -1
  61. package/fesm2022/acorex-platform-widgets-file-rename-popup.component-BSm6Qew2.mjs +211 -0
  62. package/fesm2022/acorex-platform-widgets-file-rename-popup.component-BSm6Qew2.mjs.map +1 -0
  63. package/fesm2022/{acorex-platform-widgets-page-widget-designer.component-tITe8tiu.mjs → acorex-platform-widgets-page-widget-designer.component-Dlu4Tkou.mjs} +6 -4
  64. package/fesm2022/acorex-platform-widgets-page-widget-designer.component-Dlu4Tkou.mjs.map +1 -0
  65. package/fesm2022/{acorex-platform-widgets-rich-text-popup.component-Bk20MsqK.mjs → acorex-platform-widgets-rich-text-popup.component-DB2IMaLw.mjs} +4 -4
  66. package/fesm2022/{acorex-platform-widgets-rich-text-popup.component-Bk20MsqK.mjs.map → acorex-platform-widgets-rich-text-popup.component-DB2IMaLw.mjs.map} +1 -1
  67. package/fesm2022/{acorex-platform-widgets-tabular-data-edit-popup.component-2srL34Aq.mjs → acorex-platform-widgets-tabular-data-edit-popup.component-CBOUSkL4.mjs} +4 -4
  68. package/fesm2022/{acorex-platform-widgets-tabular-data-edit-popup.component-2srL34Aq.mjs.map → acorex-platform-widgets-tabular-data-edit-popup.component-CBOUSkL4.mjs.map} +1 -1
  69. package/fesm2022/{acorex-platform-widgets-tabular-data-view-popup.component-D9654sA3.mjs → acorex-platform-widgets-tabular-data-view-popup.component-Dl5U2HFR.mjs} +4 -4
  70. package/fesm2022/{acorex-platform-widgets-tabular-data-view-popup.component-D9654sA3.mjs.map → acorex-platform-widgets-tabular-data-view-popup.component-Dl5U2HFR.mjs.map} +1 -1
  71. package/fesm2022/{acorex-platform-widgets-text-block-widget-designer.component-C1VgsL1j.mjs → acorex-platform-widgets-text-block-widget-designer.component-CG_2APU3.mjs} +4 -4
  72. package/fesm2022/{acorex-platform-widgets-text-block-widget-designer.component-C1VgsL1j.mjs.map → acorex-platform-widgets-text-block-widget-designer.component-CG_2APU3.mjs.map} +1 -1
  73. package/fesm2022/acorex-platform-widgets.mjs +942 -706
  74. package/fesm2022/acorex-platform-widgets.mjs.map +1 -1
  75. package/fesm2022/acorex-platform-workflow.mjs +25 -25
  76. package/fesm2022/acorex-platform-workflow.mjs.map +1 -1
  77. package/layout/builder/index.d.ts +21 -13
  78. package/layout/components/index.d.ts +106 -2
  79. package/layout/entity/index.d.ts +9 -0
  80. package/layout/views/index.d.ts +83 -24
  81. package/package.json +1 -1
  82. package/runtime/index.d.ts +5 -5
  83. package/widgets/index.d.ts +16 -4
  84. package/domain/README.md +0 -3
  85. package/fesm2022/acorex-platform-themes-default-entity-master-list-view.component-BxdQ5JWS.mjs.map +0 -1
  86. package/fesm2022/acorex-platform-themes-default-entity-master-single-view.component-D99jLndX.mjs.map +0 -1
  87. package/fesm2022/acorex-platform-widgets-checkbox-widget-designer.component-5kuroU6r.mjs.map +0 -1
  88. package/fesm2022/acorex-platform-widgets-page-widget-designer.component-tITe8tiu.mjs.map +0 -1
package/domain/index.d.ts CHANGED
@@ -1,18 +1,80 @@
1
1
  import * as i0 from '@angular/core';
2
- import { InjectionToken, EnvironmentProviders } from '@angular/core';
2
+ import { InjectionToken, EnvironmentProviders, Type } from '@angular/core';
3
3
  import * as i1 from '@acorex/platform/runtime';
4
- import { AXPOptionsData } from '@acorex/platform/core';
4
+ import { AXPExpression, AXPValidationRules, AXPOptionsData, AXPMetaData } from '@acorex/platform/core';
5
5
 
6
6
  declare const AXP_ENTITY_CRUD_SETUP: InjectionToken<void>;
7
7
  declare function provideEntity(entityKeys: string[]): EnvironmentProviders;
8
8
 
9
9
  declare class AXPDomainModule {
10
10
  private _commandSetup;
11
+ /**
12
+ * Injection token for schema setup initialization.
13
+ *
14
+ * Used during application bootstrap to register global middleware
15
+ * that applies to all schema resolutions. This enables centralized
16
+ * schema processing logic.
17
+ */
18
+ private _schemaSetup;
19
+ private _schemaMiddlewareSetup;
20
+ private _schemaLoaderSetup;
21
+ /**
22
+ * Injection token for domain loader setup initialization.
23
+ *
24
+ * Used during application bootstrap to register domain loaders
25
+ * that can provide domain definitions on-demand when they're not found in
26
+ * the registry.
27
+ */
28
+ private _domainLoaderSetup;
29
+ private _domainMiddlewareSetup;
30
+ private _domainSetup;
11
31
  static ɵfac: i0.ɵɵFactoryDeclaration<AXPDomainModule, never>;
12
32
  static ɵmod: i0.ɵɵNgModuleDeclaration<AXPDomainModule, never, [typeof i1.AXPRuntimeModule], never>;
13
33
  static ɵinj: i0.ɵɵInjectorDeclaration<AXPDomainModule>;
14
34
  }
15
35
 
36
+ /**
37
+ * Interface for defining actions
38
+ */
39
+ interface AXPDomainAction {
40
+ event: string;
41
+ side: 'client' | 'server' | 'both';
42
+ condition?: AXPExpression;
43
+ expression: AXPExpression;
44
+ }
45
+ declare enum AXPEntityCommandScope {
46
+ TypeLevel = "typeLevel",
47
+ Selected = "selected",
48
+ Individual = "individual",
49
+ Section = "section"
50
+ }
51
+
52
+ declare enum AXPEntityType {
53
+ Entity = 0,
54
+ AggregateRoot = 1,
55
+ ValueObject = 2
56
+ }
57
+ interface AXPEntityDefinition {
58
+ name: string;
59
+ title: string;
60
+ fields: AXPEntityFieldDefinition[];
61
+ type: AXPEntityType;
62
+ }
63
+ interface AXPEntityFieldFeatures {
64
+ nullable: boolean;
65
+ readOnly: boolean;
66
+ }
67
+ interface AXPEntityFieldDefinition {
68
+ name: string;
69
+ title: string;
70
+ description?: string;
71
+ validations?: AXPValidationRules;
72
+ actions?: AXPDomainAction[];
73
+ features?: AXPEntityFieldFeatures;
74
+ defaultValue?: any;
75
+ schema: string;
76
+ }
77
+
16
78
  declare enum AXPRelationshipKind {
17
79
  Association = 0,
18
80
  Composition = 1,
@@ -23,57 +85,1963 @@ declare enum AXPRelationshipCardinality {
23
85
  OneToMany = 1,
24
86
  ManyToMany = 2
25
87
  }
26
- declare enum AXPEntityType {
27
- Entity = 0,
28
- AggregateRoot = 1,
29
- ValueObject = 2
30
- }
31
- interface AXPRelationshipDefinition {
32
- key: string;
33
- source: {
34
- path: string;
35
- field: string;
36
- };
88
+ /**
89
+ * Interface for defining relationships between aggregates
90
+ */
91
+ interface AXPAggregateRelationDefinition {
92
+ type: AXPRelationshipCardinality;
93
+ kind: AXPRelationshipKind;
37
94
  target: {
38
- path: string;
39
- field: string;
95
+ aggregate: string;
96
+ entity: string;
97
+ key: string;
40
98
  };
41
- kind: AXPRelationshipKind;
42
- cardinality: AXPRelationshipCardinality;
99
+ source: {
100
+ entity: string;
101
+ key: string;
102
+ };
103
+ isRequired: boolean;
43
104
  }
105
+
106
+ type AXPAggregateEntityList = {
107
+ [key: string]: () => Promise<AXPEntityDefinition>;
108
+ };
109
+ interface AXPAggregateDefinition {
110
+ name: string;
111
+ title: string;
112
+ entities: AXPEntityDefinition[] | AXPAggregateEntityList | Record<string, string>;
113
+ relations: AXPAggregateRelationDefinition[];
114
+ validations: AXPValidationRules;
115
+ actions: AXPDomainAction[];
116
+ }
117
+
44
118
  interface AXPModuleDefinition {
45
- key: string;
119
+ name: string;
46
120
  title: string;
47
- description: string;
48
- icon: string;
49
121
  aggregates: AXPAggregateDefinition[];
50
122
  }
51
- interface AXPAggregateDefinition {
52
- key: string;
53
- title: string;
54
- entities: AXPEntityDefinition[];
123
+
124
+ type AXPSchemaDataType = 'string' | 'number' | 'boolean' | 'date' | 'object' | 'array' | 'blob';
125
+ interface AXPSchemaInterface {
126
+ widget: string;
127
+ options?: AXPOptionsData;
128
+ disabled?: boolean;
55
129
  }
56
- interface AXPEntityDefinition {
57
- key: string;
58
- title: string;
59
- fields: AXPEntityFieldDefinition[];
60
- type: AXPEntityType;
130
+ interface AXPSchemaFeatures {
131
+ searchable?: {
132
+ enabled: boolean;
133
+ fullText: boolean;
134
+ };
135
+ filterable?: {
136
+ enabled: boolean;
137
+ inline: boolean;
138
+ };
139
+ sortable?: {
140
+ enabled: boolean;
141
+ };
142
+ auditable?: {
143
+ enabled: boolean;
144
+ };
61
145
  }
62
- interface AXPEntityFieldDefinition {
63
- key: string;
64
- title: string;
65
- dataType: string;
66
- widget: {
146
+ interface AXPSchemaDefinition {
147
+ name: string;
148
+ dataType: AXPSchemaDataType;
149
+ interface: AXPSchemaInterface;
150
+ validations?: AXPValidationRules;
151
+ features?: AXPSchemaFeatures;
152
+ metadata?: AXPMetaData;
153
+ }
154
+
155
+ /**
156
+ * Runtime model for relation definitions with parent references and helper methods
157
+ */
158
+ declare class AXPRelationModel {
159
+ readonly type: AXPRelationshipCardinality;
160
+ readonly kind: AXPRelationshipKind;
161
+ readonly target: {
162
+ aggregate: string;
163
+ entity: string;
164
+ key: string;
165
+ };
166
+ readonly source: {
167
+ entity: string;
168
+ key: string;
169
+ };
170
+ readonly isRequired: boolean;
171
+ readonly parent: any;
172
+ constructor(definition: AXPAggregateRelationDefinition, parent: any);
173
+ /**
174
+ * Check if relation is one-to-one
175
+ */
176
+ isOneToOne(): boolean;
177
+ /**
178
+ * Check if relation is one-to-many
179
+ */
180
+ isOneToMany(): boolean;
181
+ /**
182
+ * Check if relation is many-to-many
183
+ */
184
+ isManyToMany(): boolean;
185
+ /**
186
+ * Check if relation is association
187
+ */
188
+ isAssociation(): boolean;
189
+ /**
190
+ * Check if relation is composition
191
+ */
192
+ isComposition(): boolean;
193
+ /**
194
+ * Check if relation is aggregation
195
+ */
196
+ isAggregation(): boolean;
197
+ /**
198
+ * Get parent aggregate
199
+ */
200
+ getAggregate(): any;
201
+ /**
202
+ * Get parent module
203
+ */
204
+ getModule(): any;
205
+ /**
206
+ * Get full path (module.aggregate.relation)
207
+ */
208
+ getPath(): string;
209
+ /**
210
+ * Get relation description
211
+ */
212
+ getDescription(): string;
213
+ /**
214
+ * Get cardinality description
215
+ */
216
+ getCardinalityDescription(): string;
217
+ /**
218
+ * Get kind description
219
+ */
220
+ getKindDescription(): string;
221
+ /**
222
+ * Get relation summary
223
+ */
224
+ getSummary(): string;
225
+ /**
226
+ * Validate the relation structure
227
+ */
228
+ validate(): string[];
229
+ /**
230
+ * Get relation characteristics
231
+ */
232
+ getCharacteristics(): {
67
233
  type: string;
68
- options?: AXPOptionsData;
234
+ kind: string;
235
+ required: boolean;
236
+ isOwning: boolean;
237
+ isNavigable: boolean;
69
238
  };
239
+ /**
240
+ * Check if relation involves entity
241
+ */
242
+ involvesEntity(entityName: string): boolean;
243
+ /**
244
+ * Check if relation targets aggregate
245
+ */
246
+ targetsAggregate(aggregateName: string): boolean;
247
+ /**
248
+ * Get the other entity in the relation
249
+ */
250
+ getOtherEntity(entityName: string): string | null;
251
+ /**
252
+ * Convert back to interface definition
253
+ */
254
+ toDefinition(): AXPAggregateRelationDefinition;
70
255
  }
71
- declare enum AXPEntityCommandScope {
72
- TypeLevel = "typeLevel",
73
- Selected = "selected",
74
- Individual = "individual",
75
- Section = "section"
256
+
257
+ /**
258
+ * Simple runtime model for aggregate definitions with parent references and navigation helpers.
259
+ *
260
+ * This model is a pure data structure that provides:
261
+ * - Access to aggregate properties and metadata
262
+ * - Navigation helpers for finding relations and entity references
263
+ * - Parent module reference for hierarchy navigation
264
+ *
265
+ * All loading and resolution logic has been moved to AXPDomainRegistry.
266
+ */
267
+ declare class AXPAggregateModel {
268
+ readonly name: string;
269
+ readonly title: string;
270
+ readonly relations: AXPRelationModel[];
271
+ readonly validations: AXPValidationRules;
272
+ readonly actions: AXPDomainAction[];
273
+ readonly parent: any;
274
+ readonly entityReferences: Record<string, string>;
275
+ constructor(definition: AXPAggregateDefinition, parent: any);
276
+ /**
277
+ * Extract entity references from various entity definition formats
278
+ * and convert to simple string map
279
+ */
280
+ private extractEntityReferences;
281
+ /**
282
+ * Get entity reference by name
283
+ *
284
+ * @param entityName Name of the entity
285
+ * @returns Entity reference string or undefined if not found
286
+ */
287
+ getEntityReference(entityName: string): string | undefined;
288
+ /**
289
+ * Get full path for an entity in this aggregate
290
+ *
291
+ * @param entityName Name of the entity
292
+ * @returns Full entity path
293
+ */
294
+ getEntityPath(entityName: string): string;
295
+ /**
296
+ * Get all available entity names
297
+ *
298
+ * @returns Array of entity names
299
+ */
300
+ getEntityNames(): string[];
301
+ /**
302
+ * Check if entity exists in this aggregate
303
+ *
304
+ * @param entityName Name of the entity
305
+ * @returns True if entity exists
306
+ */
307
+ hasEntity(entityName: string): boolean;
308
+ /**
309
+ * Find relation by source and target entities
310
+ *
311
+ * @param sourceEntity Source entity name
312
+ * @param targetEntity Target entity name
313
+ * @returns Relation model or undefined if not found
314
+ */
315
+ findRelation(sourceEntity: string, targetEntity: string): AXPRelationModel | undefined;
316
+ /**
317
+ * Get all relations for a specific entity
318
+ *
319
+ * @param entityName Entity name
320
+ * @returns Array of relations involving the entity
321
+ */
322
+ getEntityRelations(entityName: string): AXPRelationModel[];
323
+ /**
324
+ * Get parent module
325
+ *
326
+ * @returns Parent module model
327
+ */
328
+ getModule(): any;
329
+ /**
330
+ * Get full aggregate path (module.aggregate)
331
+ *
332
+ * @returns Full path string
333
+ */
334
+ getPath(): string;
335
+ /**
336
+ * Get aggregate statistics
337
+ *
338
+ * @returns Statistics object
339
+ */
340
+ getStatistics(): {
341
+ entityCount: number;
342
+ relationCount: number;
343
+ actionCount: number;
344
+ validationCount: number;
345
+ };
346
+ /**
347
+ * Convert back to interface definition
348
+ *
349
+ * @returns Aggregate definition
350
+ */
351
+ toDefinition(): AXPAggregateDefinition;
352
+ /**
353
+ * Validate the aggregate structure (synchronous validation only)
354
+ *
355
+ * @returns Array of validation errors
356
+ */
357
+ validate(): string[];
358
+ }
359
+
360
+ /**
361
+ * Simple runtime model for module definitions with navigation helpers.
362
+ *
363
+ * This model is a pure data structure that provides:
364
+ * - Access to module properties and metadata
365
+ * - Navigation helpers for finding aggregates
366
+ * - Hierarchy navigation and path generation
367
+ *
368
+ * All loading and resolution logic has been moved to AXPDomainRegistry.
369
+ */
370
+ declare class AXPModuleModel {
371
+ readonly name: string;
372
+ readonly title: string;
373
+ readonly aggregates: AXPAggregateModel[];
374
+ constructor(definition: AXPModuleDefinition);
375
+ /**
376
+ * Find aggregate by name
377
+ *
378
+ * @param name Aggregate name
379
+ * @returns Aggregate model or undefined if not found
380
+ */
381
+ findAggregate(name: string): AXPAggregateModel | undefined;
382
+ /**
383
+ * Get all aggregates
384
+ *
385
+ * @returns Array of all aggregate models
386
+ */
387
+ getAllAggregates(): AXPAggregateModel[];
388
+ /**
389
+ * Check if aggregate exists in this module
390
+ *
391
+ * @param name Aggregate name
392
+ * @returns True if aggregate exists
393
+ */
394
+ hasAggregate(name: string): boolean;
395
+ /**
396
+ * Get all aggregate names
397
+ *
398
+ * @returns Array of aggregate names
399
+ */
400
+ getAggregateNames(): string[];
401
+ /**
402
+ * Find entity reference across all aggregates
403
+ *
404
+ * @param entityName Entity name to search for
405
+ * @returns Object with aggregate and entity reference, or undefined if not found
406
+ */
407
+ findEntityReference(entityName: string): {
408
+ aggregate: AXPAggregateModel;
409
+ entityReference: string;
410
+ } | undefined;
411
+ /**
412
+ * Get entity path for a specific entity in a specific aggregate
413
+ *
414
+ * @param aggregateName Aggregate name
415
+ * @param entityName Entity name
416
+ * @returns Full entity path
417
+ */
418
+ getEntityPath(aggregateName: string, entityName: string): string;
419
+ /**
420
+ * Get aggregate path
421
+ *
422
+ * @param aggregateName Aggregate name
423
+ * @returns Full aggregate path
424
+ */
425
+ getAggregatePath(aggregateName: string): string;
426
+ /**
427
+ * Get all entity references across all aggregates
428
+ *
429
+ * @returns Map of entity name to full path
430
+ */
431
+ getAllEntityReferences(): Record<string, string>;
432
+ /**
433
+ * Get all relations across all aggregates
434
+ *
435
+ * @returns Array of all relation models
436
+ */
437
+ getAllRelations(): Array<{
438
+ aggregate: AXPAggregateModel;
439
+ relation: any;
440
+ }>;
441
+ /**
442
+ * Validate the module structure (synchronous validation only)
443
+ *
444
+ * @returns Array of validation errors
445
+ */
446
+ validate(): string[];
447
+ /**
448
+ * Get module statistics
449
+ *
450
+ * @returns Statistics object
451
+ */
452
+ getStatistics(): {
453
+ aggregateCount: number;
454
+ entityCount: number;
455
+ relationCount: number;
456
+ actionCount: number;
457
+ validationCount: number;
458
+ };
459
+ /**
460
+ * Convert back to interface definition
461
+ *
462
+ * @returns Module definition
463
+ */
464
+ toDefinition(): AXPModuleDefinition;
76
465
  }
77
466
 
78
- export { AXPDomainModule, AXPEntityCommandScope, AXPEntityType, AXPRelationshipCardinality, AXPRelationshipKind, AXP_ENTITY_CRUD_SETUP, provideEntity };
79
- export type { AXPAggregateDefinition, AXPEntityDefinition, AXPEntityFieldDefinition, AXPModuleDefinition, AXPRelationshipDefinition };
467
+ /**
468
+ * Runtime model for schema definitions with helper methods
469
+ */
470
+ declare class AXPSchemaModel {
471
+ readonly name: string;
472
+ readonly dataType: AXPSchemaDataType;
473
+ readonly interface: AXPSchemaInterface;
474
+ readonly validations: AXPValidationRules;
475
+ readonly features: AXPSchemaFeatures;
476
+ readonly metadata?: AXPMetaData;
477
+ constructor(definition: AXPSchemaDefinition);
478
+ /**
479
+ * Check if schema is for string data
480
+ */
481
+ isString(): boolean;
482
+ /**
483
+ * Check if schema is for number data
484
+ */
485
+ isNumber(): boolean;
486
+ /**
487
+ * Check if schema is for boolean data
488
+ */
489
+ isBoolean(): boolean;
490
+ /**
491
+ * Check if schema is for date data
492
+ */
493
+ isDate(): boolean;
494
+ /**
495
+ * Check if schema is for object data
496
+ */
497
+ isObject(): boolean;
498
+ /**
499
+ * Check if schema is for array data
500
+ */
501
+ isArray(): boolean;
502
+ /**
503
+ * Check if schema is for blob data
504
+ */
505
+ isBlob(): boolean;
506
+ /**
507
+ * Get widget type
508
+ */
509
+ getWidgetType(): string;
510
+ /**
511
+ * Get widget options
512
+ */
513
+ getWidgetOptions(): AXPOptionsData | undefined;
514
+ /**
515
+ * Check if interface is disabled
516
+ */
517
+ isDisabled(): boolean;
518
+ /**
519
+ * Check if searchable
520
+ */
521
+ isSearchable(): boolean;
522
+ /**
523
+ * Check if full text searchable
524
+ */
525
+ isFullTextSearchable(): boolean;
526
+ /**
527
+ * Check if filterable
528
+ */
529
+ isFilterable(): boolean;
530
+ /**
531
+ * Check if inline filterable
532
+ */
533
+ isInlineFilterable(): boolean;
534
+ /**
535
+ * Check if sortable
536
+ */
537
+ isSortable(): boolean;
538
+ /**
539
+ * Check if auditable
540
+ */
541
+ isAuditable(): boolean;
542
+ /**
543
+ * Validate the schema structure
544
+ */
545
+ validate(): Promise<string[]>;
546
+ /**
547
+ * Get schema capabilities
548
+ */
549
+ getCapabilities(): {
550
+ searchable: boolean;
551
+ fullTextSearchable: boolean;
552
+ filterable: boolean;
553
+ inlineFilterable: boolean;
554
+ sortable: boolean;
555
+ auditable: boolean;
556
+ disabled: boolean;
557
+ };
558
+ /**
559
+ * Get schema summary
560
+ */
561
+ getSummary(): {
562
+ dataType: AXPSchemaDataType;
563
+ widget: string;
564
+ hasOptions: boolean;
565
+ hasMetadata: boolean;
566
+ hasValidations: boolean;
567
+ capabilityCount: number;
568
+ };
569
+ /**
570
+ * Convert back to interface definition
571
+ */
572
+ toDefinition(): AXPSchemaDefinition;
573
+ }
574
+
575
+ /**
576
+ * Interface for schema loaders that can provide schemas on-demand
577
+ */
578
+ interface AXPSchemaLoader {
579
+ /**
580
+ * Optional priority for loader ordering. Higher numbers = higher priority.
581
+ * If not specified, uses registration order.
582
+ */
583
+ readonly priority?: number;
584
+ /**
585
+ * Determines if this loader can handle the given schema name
586
+ * @param schemaName The name of the schema to load
587
+ * @returns true if this loader can load the schema
588
+ */
589
+ canLoad(schemaName: string): boolean;
590
+ /**
591
+ * Loads the schema definition for the given name
592
+ * @param schemaName The name of the schema to load
593
+ * @returns Promise that resolves to the schema definition or null if not found
594
+ */
595
+ load(schemaName: string): Promise<AXPSchemaDefinition | null>;
596
+ }
597
+
598
+ /**
599
+ * Context class for schema middleware operations providing a fluent API for schema manipulation.
600
+ *
601
+ * This class serves as the interface between middleware functions and schema definitions,
602
+ * offering methods to modify various aspects of a schema including:
603
+ * - Widget configuration and options
604
+ * - Validation rules
605
+ * - Feature flags (searchable, filterable, sortable)
606
+ * - Metadata and custom properties
607
+ * - UI behavior (visibility, readonly state)
608
+ *
609
+ * All methods return `this` to enable fluent method chaining.
610
+ *
611
+ * @example
612
+ * ```typescript
613
+ * // Example middleware using the context
614
+ * (context) => {
615
+ * context
616
+ * .addValidation({ rule: 'required' })
617
+ * .searchable(true)
618
+ * .withDefaultValue('default text')
619
+ * .readonly(false);
620
+ * }
621
+ * ```
622
+ */
623
+ declare class AXPSchemaMiddlewareContext {
624
+ private _schema;
625
+ constructor(schema: AXPSchemaDefinition);
626
+ /**
627
+ * Get the current schema definition (readonly access)
628
+ */
629
+ get schema(): Readonly<AXPSchemaDefinition>;
630
+ /**
631
+ * Get the schema name for conditional logic
632
+ */
633
+ get name(): string;
634
+ /**
635
+ * Set a default value for the widget
636
+ * @param defaultValue The default value to set
637
+ */
638
+ withDefaultValue(defaultValue: any): this;
639
+ /**
640
+ * Remove the default value from the widget
641
+ */
642
+ removeDefaultValue(): this;
643
+ /**
644
+ * Add multiple validation rules to the schema
645
+ * @param rules Array of validation rules to add
646
+ */
647
+ withValidation(rules: any[]): this;
648
+ /**
649
+ * Add a single validation rule to the schema
650
+ * @param rule The validation rule to add
651
+ */
652
+ addValidation(rule: any): this;
653
+ /**
654
+ * Add a single validation rule (alias for addValidation for backward compatibility)
655
+ * @param rule The validation rule to add
656
+ */
657
+ withValidationRule(rule: any): this;
658
+ /**
659
+ * Remove all validation rules from the schema
660
+ */
661
+ clearValidations(): this;
662
+ /**
663
+ * Remove a specific validation rule by its rule name
664
+ * @param ruleName The name of the rule to remove (e.g., 'required', 'email')
665
+ */
666
+ removeValidation(ruleName: string): this;
667
+ /**
668
+ * Set or merge widget options
669
+ * @param options Object containing widget-specific options to merge
670
+ */
671
+ withWidgetOptions(options: any): this;
672
+ /**
673
+ * Remove a specific widget option by key
674
+ * @param optionKey The key of the option to remove
675
+ */
676
+ removeWidgetOption(optionKey: string): this;
677
+ /**
678
+ * Change the widget type for this schema
679
+ * @param widgetType The new widget type identifier
680
+ */
681
+ withWidgetType(widgetType: string): this;
682
+ /**
683
+ * Configure general features using an object
684
+ * @param features Object containing feature configurations to merge
685
+ */
686
+ withFeatures(features: Partial<any>): this;
687
+ /**
688
+ * Configure searchable feature with fine-grained control
689
+ * @param enabled Whether searching is enabled
690
+ * @param fullText Whether full-text search is enabled
691
+ */
692
+ searchable(enabled?: boolean, fullText?: boolean): this;
693
+ /**
694
+ * Configure filterable feature with inline filter support
695
+ * @param enabled Whether filtering is enabled
696
+ * @param inline Whether inline filtering is supported
697
+ */
698
+ filterable(enabled?: boolean, inline?: boolean): this;
699
+ /**
700
+ * Configure sortable feature
701
+ * @param enabled Whether sorting is enabled
702
+ */
703
+ sortable(enabled?: boolean): this;
704
+ /**
705
+ * Add or merge metadata to the schema
706
+ * @param metadata Object containing metadata to merge
707
+ */
708
+ withMetadata(metadata: any): this;
709
+ /**
710
+ * Remove a specific metadata property by key
711
+ * @param key The metadata key to remove
712
+ */
713
+ removeMetadata(key: string): this;
714
+ /**
715
+ * Set the data type for this schema
716
+ * @param dataType The new data type (string, number, boolean, etc.)
717
+ */
718
+ withDataType(dataType: AXPSchemaDataType): this;
719
+ /**
720
+ * Set the disabled state of the widget
721
+ * @param isDisabled Whether the widget should be disabled
722
+ */
723
+ disabled(isDisabled?: boolean): this;
724
+ /**
725
+ * Set the visibility of the widget
726
+ * @param visible Whether the widget should be visible
727
+ */
728
+ withVisibility(visible: boolean): this;
729
+ /**
730
+ * Set the readonly state of the widget
731
+ * @param isReadonly Whether the widget should be readonly
732
+ */
733
+ readonly(isReadonly?: boolean): this;
734
+ }
735
+
736
+ /**
737
+ * Middleware function that can transform schema definitions
738
+ * @param context - Schema middleware context providing schema info and configuration methods
739
+ */
740
+ type AXPSchemaMiddleware = (context: AXPSchemaMiddlewareContext) => void | Promise<void>;
741
+
742
+ /**
743
+ * Options for registering a schema with additional metadata and middleware
744
+ */
745
+ interface AXPSchemaRegistrationOptions {
746
+ /** Optional description for documentation purposes */
747
+ description?: string;
748
+ /** Tags for categorizing and finding schemas */
749
+ tags?: string[];
750
+ /** Version information for schema evolution */
751
+ version?: string;
752
+ /** Schema-specific middleware that applies only to this schema */
753
+ middleware?: AXPSchemaMiddleware[];
754
+ }
755
+ /**
756
+ * Internal representation of a registered schema with metadata
757
+ */
758
+ interface AXPRegisteredSchema {
759
+ /** Unique identifier for the schema */
760
+ name: string;
761
+ /** The actual schema definition */
762
+ definition: AXPSchemaDefinition;
763
+ /** Registration options and metadata */
764
+ options: AXPSchemaRegistrationOptions;
765
+ /** Timestamp when the schema was registered */
766
+ registeredAt: Date;
767
+ }
768
+ /**
769
+ * Central registry for managing schema definitions, middleware, and dynamic loading.
770
+ *
771
+ * Provides:
772
+ * - Schema registration and retrieval
773
+ * - Middleware processing pipeline
774
+ * - On-demand schema loading
775
+ * - Caching and performance optimization
776
+ */
777
+ declare class AXPSchemaRegistry {
778
+ private readonly _schemas;
779
+ private readonly _globalMiddleware;
780
+ private readonly _modelCache;
781
+ private _loaders;
782
+ constructor();
783
+ /**
784
+ * Register a schema definition with optional metadata and middleware
785
+ */
786
+ register(definition: AXPSchemaDefinition, options?: AXPSchemaRegistrationOptions): void;
787
+ /**
788
+ * Register multiple schemas at once for batch operations
789
+ */
790
+ registerBatch(schemas: {
791
+ name: string;
792
+ definition: AXPSchemaDefinition;
793
+ options?: AXPSchemaRegistrationOptions;
794
+ }[]): void;
795
+ /**
796
+ * Remove a schema from the registry
797
+ */
798
+ unregister(name: string): boolean;
799
+ /**
800
+ * Check if a schema is currently registered
801
+ */
802
+ isRegistered(name: string): boolean;
803
+ /**
804
+ * Resolve a schema by name with full middleware processing and caching.
805
+ * Supports on-demand loading if schema is not registered.
806
+ */
807
+ resolve(name: string): Promise<AXPSchemaModel>;
808
+ /**
809
+ * Synchronous resolution without middleware processing.
810
+ * Use only when middleware is not needed for performance.
811
+ */
812
+ resolveSync(name: string): AXPSchemaModel;
813
+ /**
814
+ * Add global middleware that applies to all schema resolutions
815
+ */
816
+ addGlobalMiddleware(middleware: AXPSchemaMiddleware): void;
817
+ /**
818
+ * Remove specific global middleware
819
+ */
820
+ removeGlobalMiddleware(middleware: AXPSchemaMiddleware): boolean;
821
+ /**
822
+ * Clear all global middleware
823
+ */
824
+ clearGlobalMiddleware(): void;
825
+ /**
826
+ * Add a schema loader for on-demand loading
827
+ */
828
+ addLoader(loader: Type<AXPSchemaLoader>): void;
829
+ /**
830
+ * Get all registered schema names
831
+ */
832
+ getRegisteredNames(): string[];
833
+ /**
834
+ * Get detailed registration information for a schema
835
+ */
836
+ getSchemaInfo(name: string): AXPRegisteredSchema | undefined;
837
+ /**
838
+ * Get all registered schemas with their metadata
839
+ */
840
+ getAllSchemas(): AXPRegisteredSchema[];
841
+ /**
842
+ * Find schemas by tag for categorization
843
+ */
844
+ findByTag(tag: string): AXPRegisteredSchema[];
845
+ /**
846
+ * Find schemas by widget type for widget-specific operations
847
+ */
848
+ findByWidget(widgetType: string): AXPRegisteredSchema[];
849
+ /**
850
+ * Get comprehensive registry statistics
851
+ */
852
+ getStatistics(): {
853
+ schemaCount: number;
854
+ globalMiddlewareCount: number;
855
+ schemasByWidget: {
856
+ [widget: string]: number;
857
+ };
858
+ schemasByTag: {
859
+ [tag: string]: number;
860
+ };
861
+ };
862
+ /**
863
+ * Clear all cached models (useful when schemas need to be reloaded)
864
+ */
865
+ clearCache(): void;
866
+ /**
867
+ * Invalidate cache for a specific schema
868
+ */
869
+ invalidateCache(name: string): void;
870
+ /**
871
+ * Clear all registered schemas, middleware, and cached models
872
+ */
873
+ clear(): void;
874
+ /**
875
+ * Attempt to load schema from registered loaders
876
+ */
877
+ private loadFromLoaders;
878
+ /**
879
+ * Get loaders sorted by priority (lazy initialization)
880
+ */
881
+ private getLoaders;
882
+ /**
883
+ * Create a deep clone of a schema definition to prevent mutations
884
+ */
885
+ private cloneDefinition;
886
+ static ɵfac: i0.ɵɵFactoryDeclaration<AXPSchemaRegistry, never>;
887
+ static ɵprov: i0.ɵɵInjectableDeclaration<AXPSchemaRegistry>;
888
+ }
889
+
890
+ /**
891
+ * High-level facade service for schema operations.
892
+ *
893
+ * Provides a simplified interface to the schema registry with additional
894
+ * business logic and convenience methods for common operations.
895
+ */
896
+ declare class AXPSchemaService {
897
+ private readonly registry;
898
+ /**
899
+ * Register a schema with optional configuration
900
+ */
901
+ register(definition: AXPSchemaDefinition, options?: AXPSchemaRegistrationOptions): void;
902
+ /**
903
+ * Register multiple schemas at once
904
+ */
905
+ registerBatch(schemas: {
906
+ name: string;
907
+ definition: AXPSchemaDefinition;
908
+ options?: AXPSchemaRegistrationOptions;
909
+ }[]): void;
910
+ /**
911
+ * Remove a schema from the registry
912
+ */
913
+ unregister(name: string): boolean;
914
+ /**
915
+ * Check if a schema is registered
916
+ */
917
+ isRegistered(name: string): boolean;
918
+ /**
919
+ * Get all registered schema names
920
+ */
921
+ getRegisteredNames(): string[];
922
+ /**
923
+ * Clear all schemas and reset the registry
924
+ */
925
+ clear(): void;
926
+ /**
927
+ * Resolve a schema with full middleware processing
928
+ */
929
+ resolve(name: string): Promise<AXPSchemaModel>;
930
+ /**
931
+ * Resolve schema synchronously without middleware (for performance)
932
+ */
933
+ resolveSync(name: string): AXPSchemaModel;
934
+ /**
935
+ * Resolve multiple schemas for form building and batch operations
936
+ */
937
+ resolveMultiple(fieldConfigs: {
938
+ name: string;
939
+ schemaName: string;
940
+ }[]): Promise<{
941
+ name: string;
942
+ schema: AXPSchemaModel;
943
+ }[]>;
944
+ /**
945
+ * Add global middleware that applies to all schema resolutions
946
+ */
947
+ addGlobalMiddleware(middleware: AXPSchemaMiddleware): void;
948
+ /**
949
+ * Remove specific global middleware
950
+ */
951
+ removeGlobalMiddleware(middleware: AXPSchemaMiddleware): boolean;
952
+ /**
953
+ * Clear all global middleware
954
+ */
955
+ clearGlobalMiddleware(): void;
956
+ /**
957
+ * Get detailed information about a registered schema
958
+ */
959
+ getSchemaInfo(name: string): AXPRegisteredSchema | undefined;
960
+ /**
961
+ * Get all registered schemas with their metadata
962
+ */
963
+ getAllSchemas(): AXPRegisteredSchema[];
964
+ /**
965
+ * Find schemas by tag for categorization and grouping
966
+ */
967
+ findByTag(tag: string): AXPRegisteredSchema[];
968
+ /**
969
+ * Find schemas by widget type for widget-specific operations
970
+ */
971
+ findByWidget(widgetType: string): AXPRegisteredSchema[];
972
+ /**
973
+ * Get comprehensive registry statistics and analytics
974
+ */
975
+ getStatistics(): {
976
+ mostUsedWidgets: string[];
977
+ mostUsedTags: string[];
978
+ schemaCount: number;
979
+ globalMiddlewareCount: number;
980
+ schemasByWidget: {
981
+ [widget: string]: number;
982
+ };
983
+ schemasByTag: {
984
+ [tag: string]: number;
985
+ };
986
+ };
987
+ /**
988
+ * Validate that all referenced schemas exist in the registry
989
+ */
990
+ validateSchemaReferences(schemaNames: string[]): {
991
+ valid: boolean;
992
+ missingSchemas: string[];
993
+ };
994
+ static ɵfac: i0.ɵɵFactoryDeclaration<AXPSchemaService, never>;
995
+ static ɵprov: i0.ɵɵInjectableDeclaration<AXPSchemaService>;
996
+ }
997
+
998
+ /**
999
+ * Configuration for a schema loader with optional priority setting
1000
+ */
1001
+ interface AXPSchemaLoaderConfig {
1002
+ /** The loader class to instantiate */
1003
+ loader: Type<AXPSchemaLoader>;
1004
+ /** Optional priority for loader ordering (higher = higher priority) */
1005
+ priority?: number;
1006
+ }
1007
+ /**
1008
+ * Provide schema loaders for on-demand schema loading.
1009
+ *
1010
+ * Schema loaders enable the registry to load schemas that are not registered
1011
+ * at build time. This is useful for:
1012
+ * - Loading schemas from external APIs
1013
+ * - Dynamic schema generation
1014
+ * - Lazy loading of large schema sets
1015
+ * - Development-time schema hot-reloading
1016
+ *
1017
+ * @param loaders Array of loader classes or loader configurations
1018
+ * @returns Environment providers for dependency injection
1019
+ *
1020
+ * @example
1021
+ * ```typescript
1022
+ * // Simple loader registration
1023
+ * provideSchemaLoaders([
1024
+ * HttpSchemaLoader,
1025
+ * FileSystemSchemaLoader
1026
+ * ])
1027
+ *
1028
+ * // With priority configuration
1029
+ * provideSchemaLoaders([
1030
+ * { loader: HttpSchemaLoader, priority: 10 },
1031
+ * { loader: FileSystemSchemaLoader, priority: 5 }
1032
+ * ])
1033
+ * ```
1034
+ */
1035
+ declare function provideSchemaLoaders(loaders: Array<Type<AXPSchemaLoader> | AXPSchemaLoaderConfig>): EnvironmentProviders;
1036
+
1037
+ /**
1038
+ * Schema entry for registration containing definition and optional metadata
1039
+ */
1040
+ interface AXPSchemaEntry {
1041
+ /** The schema definition to register */
1042
+ definition: AXPSchemaDefinition;
1043
+ /** Optional registration options and metadata */
1044
+ options?: AXPSchemaRegistrationOptions;
1045
+ }
1046
+ /**
1047
+ * Provide schema setups for registration during application bootstrap.
1048
+ *
1049
+ * This is the primary way to register schemas that are known at build time.
1050
+ * Schemas registered this way are immediately available in the registry.
1051
+ *
1052
+ * @param schemas Array of schema entries to register
1053
+ * @returns Environment providers for dependency injection
1054
+ *
1055
+ * @example
1056
+ * ```typescript
1057
+ * provideSchemaSetups([
1058
+ * {
1059
+ * definition: emailSchema,
1060
+ * options: {
1061
+ * tags: ['user', 'contact'],
1062
+ * description: 'Email field schema'
1063
+ * }
1064
+ * },
1065
+ * {
1066
+ * definition: phoneSchema,
1067
+ * options: { tags: ['contact'] }
1068
+ * }
1069
+ * ])
1070
+ * ```
1071
+ */
1072
+ declare function provideSchemaSetups(schemas: AXPSchemaEntry[]): EnvironmentProviders;
1073
+ /**
1074
+ * Convenience function to provide a single schema setup.
1075
+ *
1076
+ * Useful when you need to register just one schema or want to keep
1077
+ * schema registrations separate for organizational purposes.
1078
+ *
1079
+ * @param definition The schema definition to register
1080
+ * @param options Optional registration options and metadata
1081
+ * @returns Environment providers for dependency injection
1082
+ *
1083
+ * @example
1084
+ * ```typescript
1085
+ * provideSchema(emailSchema, {
1086
+ * tags: ['user', 'contact'],
1087
+ * description: 'User email field'
1088
+ * })
1089
+ * ```
1090
+ */
1091
+ declare function provideSchema(definition: AXPSchemaDefinition, options?: AXPSchemaRegistrationOptions): EnvironmentProviders;
1092
+ /**
1093
+ * Provide schema setups from a factory function for dynamic registration.
1094
+ *
1095
+ * Useful when schemas need to be generated at runtime, loaded from external
1096
+ * sources, or depend on configuration that's not available at build time.
1097
+ *
1098
+ * @param schemaFactory Factory function that returns schema entries
1099
+ * @returns Environment providers for dependency injection
1100
+ *
1101
+ * @example
1102
+ * ```typescript
1103
+ * provideSchemasFromFactory(async () => {
1104
+ * const config = await loadConfiguration();
1105
+ * return config.schemas.map(schema => ({
1106
+ * definition: schema,
1107
+ * options: { tags: ['dynamic'] }
1108
+ * }));
1109
+ * })
1110
+ * ```
1111
+ */
1112
+ declare function provideSchemasFromFactory(schemaFactory: () => AXPSchemaEntry[] | Promise<AXPSchemaEntry[]>): EnvironmentProviders;
1113
+
1114
+ /**
1115
+ * Middleware entry for registration - can be either a simple function or targeted middleware
1116
+ */
1117
+ type AXPSchemaMiddlewareEntry = AXPSchemaMiddleware | {
1118
+ target: string | RegExp;
1119
+ middleware: AXPSchemaMiddleware;
1120
+ };
1121
+ /**
1122
+ * Provide schema middleware for registration in the application.
1123
+ *
1124
+ * Supports both global middleware (applies to all schemas) and targeted middleware
1125
+ * (applies only to schemas matching specific patterns).
1126
+ *
1127
+ * @param middleware Array of middleware entries to register
1128
+ * @returns Environment providers for dependency injection
1129
+ *
1130
+ * @example
1131
+ * ```typescript
1132
+ * // Global middleware
1133
+ * provideSchemaMiddleware([
1134
+ * (context) => {
1135
+ * if (context.schema.dataType === 'string') {
1136
+ * context.searchable(true);
1137
+ * }
1138
+ * }
1139
+ * ])
1140
+ *
1141
+ * // Targeted middleware
1142
+ * provideSchemaMiddleware([
1143
+ * {
1144
+ * target: /^user_/,
1145
+ * middleware: (context) => context.withMetadata({ category: 'user' })
1146
+ * }
1147
+ * ])
1148
+ * ```
1149
+ */
1150
+ declare function provideSchemaMiddleware(middleware: AXPSchemaMiddlewareEntry[]): EnvironmentProviders;
1151
+
1152
+ /**
1153
+ * Injection token for schema-specific middleware extensions.
1154
+ *
1155
+ * Used for targeted middleware that applies only to schemas matching
1156
+ * specific patterns (name or regex). This enables fine-grained control
1157
+ * over which schemas receive which middleware.
1158
+ */
1159
+ declare const AXP_SCHEMA_EXTENSION: InjectionToken<{
1160
+ target: string | RegExp;
1161
+ middleware: AXPSchemaMiddleware;
1162
+ }>;
1163
+ /**
1164
+ * Injection token for schema setup initialization.
1165
+ *
1166
+ * Used during application bootstrap to register schemas that are
1167
+ * known at build time. Multiple providers can use this token to
1168
+ * contribute schemas to the registry.
1169
+ */
1170
+ declare const AXP_SCHEMA_SETUP: InjectionToken<void>;
1171
+ /**
1172
+ * Injection token for schema middleware setup initialization.
1173
+ *
1174
+ * Used during application bootstrap to register global middleware
1175
+ * that applies to all schema resolutions. This enables centralized
1176
+ * schema processing logic.
1177
+ */
1178
+ declare const AXP_SCHEMA_MIDDLEWARE_SETUP: InjectionToken<void>;
1179
+ /**
1180
+ * Injection token for schema loader setup initialization.
1181
+ *
1182
+ * Used during application bootstrap to register schema loaders
1183
+ * that can provide schemas on-demand when they're not found in
1184
+ * the registry.
1185
+ */
1186
+ declare const AXP_SCHEMA_LOADER_SETUP: InjectionToken<void>;
1187
+
1188
+ /**
1189
+ * Runtime model for entity field definitions with parent references and helper methods
1190
+ */
1191
+ declare class AXPEntityFieldModel {
1192
+ readonly name: string;
1193
+ readonly title: string;
1194
+ readonly description?: string;
1195
+ readonly validations?: AXPValidationRules;
1196
+ readonly actions?: AXPDomainAction[];
1197
+ readonly features?: AXPEntityFieldFeatures;
1198
+ readonly defaultValue?: any;
1199
+ readonly schema: AXPSchemaModel;
1200
+ readonly schemaName: string;
1201
+ readonly parent: any;
1202
+ readonly schemaService: AXPSchemaService;
1203
+ constructor(definition: AXPEntityFieldDefinition, parent: any, schemaService: AXPSchemaService);
1204
+ /**
1205
+ * Check if field is nullable
1206
+ */
1207
+ isNullable(): boolean;
1208
+ /**
1209
+ * Check if field is readonly
1210
+ */
1211
+ isReadonly(): boolean;
1212
+ /**
1213
+ * Check if field is required (has required validation)
1214
+ */
1215
+ isRequired(): boolean;
1216
+ /**
1217
+ * Check if field is searchable
1218
+ */
1219
+ isSearchable(): boolean;
1220
+ /**
1221
+ * Check if field supports full text search
1222
+ */
1223
+ isFullTextSearchable(): boolean;
1224
+ /**
1225
+ * Check if field is filterable
1226
+ */
1227
+ isFilterable(): boolean;
1228
+ /**
1229
+ * Check if field has inline filtering
1230
+ */
1231
+ hasInlineFiltering(): boolean;
1232
+ /**
1233
+ * Check if field is sortable
1234
+ */
1235
+ isSortable(): boolean;
1236
+ /**
1237
+ * Check if field is auditable
1238
+ */
1239
+ isAuditable(): boolean;
1240
+ /**
1241
+ * Get the schema name
1242
+ */
1243
+ getSchemaName(): string;
1244
+ /**
1245
+ * Get schema info from registry
1246
+ */
1247
+ getSchemaInfo(): any;
1248
+ /**
1249
+ * Re-resolve schema from registry (useful after schema updates)
1250
+ */
1251
+ refreshSchema(): void;
1252
+ /**
1253
+ * Get parent entity
1254
+ */
1255
+ getEntity(): any;
1256
+ /**
1257
+ * Get parent aggregate
1258
+ */
1259
+ getAggregate(): any;
1260
+ /**
1261
+ * Get parent module
1262
+ */
1263
+ getModule(): any;
1264
+ /**
1265
+ * Get full path (module.aggregate.entity.field)
1266
+ */
1267
+ getPath(): string;
1268
+ /**
1269
+ * Validate the field structure
1270
+ */
1271
+ validate(): Promise<string[]>;
1272
+ /**
1273
+ * Get field statistics
1274
+ */
1275
+ getStatistics(): {
1276
+ hasValidations: boolean;
1277
+ hasActions: boolean;
1278
+ hasFeatures: boolean;
1279
+ hasDefaultValue: boolean;
1280
+ validationCount: number;
1281
+ actionCount: number;
1282
+ };
1283
+ /**
1284
+ * Get field capabilities
1285
+ */
1286
+ getCapabilities(): {
1287
+ searchable: boolean;
1288
+ filterable: boolean;
1289
+ sortable: boolean;
1290
+ auditable: boolean;
1291
+ nullable: boolean;
1292
+ readonly: boolean;
1293
+ required: boolean;
1294
+ };
1295
+ /**
1296
+ * Convert back to interface definition
1297
+ */
1298
+ toDefinition(): AXPEntityFieldDefinition;
1299
+ }
1300
+
1301
+ /**
1302
+ * Runtime model for entity definitions with parent references and helper methods
1303
+ */
1304
+ declare class AXPEntityModel {
1305
+ readonly name: string;
1306
+ readonly title: string;
1307
+ readonly fields: AXPEntityFieldModel[];
1308
+ readonly type: AXPEntityType;
1309
+ readonly parent: any;
1310
+ readonly schemaService: AXPSchemaService;
1311
+ constructor(definition: AXPEntityDefinition, parent: any, schemaService: AXPSchemaService);
1312
+ /**
1313
+ * Find field by name
1314
+ */
1315
+ findField(name: string): AXPEntityFieldModel | undefined;
1316
+ /**
1317
+ * Get all fields
1318
+ */
1319
+ getAllFields(): AXPEntityFieldModel[];
1320
+ /**
1321
+ * Get fields by data type
1322
+ */
1323
+ getFieldsByType(dataType: string): AXPEntityFieldModel[];
1324
+ /**
1325
+ * Get required fields
1326
+ */
1327
+ getRequiredFields(): AXPEntityFieldModel[];
1328
+ /**
1329
+ * Get readonly fields
1330
+ */
1331
+ getReadonlyFields(): AXPEntityFieldModel[];
1332
+ /**
1333
+ * Get searchable fields
1334
+ */
1335
+ getSearchableFields(): AXPEntityFieldModel[];
1336
+ /**
1337
+ * Get filterable fields
1338
+ */
1339
+ getFilterableFields(): AXPEntityFieldModel[];
1340
+ /**
1341
+ * Get sortable fields
1342
+ */
1343
+ getSortableFields(): AXPEntityFieldModel[];
1344
+ /**
1345
+ * Check if this entity is an aggregate root
1346
+ */
1347
+ isAggregateRoot(): boolean;
1348
+ /**
1349
+ * Check if this entity is a regular entity
1350
+ */
1351
+ isEntity(): boolean;
1352
+ /**
1353
+ * Check if this entity is a value object
1354
+ */
1355
+ isValueObject(): boolean;
1356
+ /**
1357
+ * Get parent aggregate
1358
+ */
1359
+ getAggregate(): any;
1360
+ /**
1361
+ * Get parent module
1362
+ */
1363
+ getModule(): any;
1364
+ /**
1365
+ * Get full path (module.aggregate.entity)
1366
+ */
1367
+ getPath(): string;
1368
+ /**
1369
+ * Validate the entity structure
1370
+ */
1371
+ validate(): Promise<string[]>;
1372
+ /**
1373
+ * Get entity statistics
1374
+ */
1375
+ getStatistics(): {
1376
+ fieldCount: number;
1377
+ requiredFieldCount: number;
1378
+ readonlyFieldCount: number;
1379
+ searchableFieldCount: number;
1380
+ filterableFieldCount: number;
1381
+ sortableFieldCount: number;
1382
+ };
1383
+ /**
1384
+ * Convert back to interface definition
1385
+ */
1386
+ toDefinition(): AXPEntityDefinition;
1387
+ }
1388
+
1389
+ /**
1390
+ * Helper utility class for working with module models
1391
+ *
1392
+ * @deprecated This helper class is deprecated and will be updated to work with the new domain registry system.
1393
+ * Use AXPDomainService for domain operations instead.
1394
+ *
1395
+ * TODO: Update this helper to work with the new simplified models and domain registry system.
1396
+ */
1397
+ declare class AXPModuleHelper {
1398
+ /**
1399
+ * @deprecated Use AXPDomainService.findEntitiesByName() instead
1400
+ */
1401
+ static findEntitiesByName(module: AXPModuleModel, name: string): AXPEntityModel[];
1402
+ /**
1403
+ * @deprecated Use AXPDomainService with entity field queries instead
1404
+ */
1405
+ static findFieldsByName(module: AXPModuleModel, fieldName: string): AXPEntityFieldModel[];
1406
+ /**
1407
+ * @deprecated Use AXPDomainService with entity type queries instead
1408
+ */
1409
+ static findEntitiesByType(module: AXPModuleModel, type: AXPEntityType): AXPEntityModel[];
1410
+ /**
1411
+ * @deprecated Use AXPDomainService with field validation queries instead
1412
+ */
1413
+ static findFieldsWithValidation(module: AXPModuleModel, validationRule: string): AXPEntityFieldModel[];
1414
+ /**
1415
+ * @deprecated Use AXPDomainService with field queries instead
1416
+ */
1417
+ static findFieldsByDataType(module: AXPModuleModel, dataType: string): AXPEntityFieldModel[];
1418
+ /**
1419
+ * @deprecated Use AXPDomainService with required field queries instead
1420
+ */
1421
+ static findRequiredFields(module: AXPModuleModel): AXPEntityFieldModel[];
1422
+ /**
1423
+ * @deprecated Use AXPDomainService with nullable field queries instead
1424
+ */
1425
+ static findNullableFields(module: AXPModuleModel): AXPEntityFieldModel[];
1426
+ /**
1427
+ * @deprecated Use AXPDomainService with default value queries instead
1428
+ */
1429
+ static findFieldsWithDefaultValues(module: AXPModuleModel): AXPEntityFieldModel[];
1430
+ /**
1431
+ * @deprecated Use AXPDomainService with field schema queries instead
1432
+ */
1433
+ static findFieldsBySchema(module: AXPModuleModel, schemaName: string): AXPEntityFieldModel[];
1434
+ /**
1435
+ * @deprecated Use module.validate() method instead
1436
+ */
1437
+ static validateModule(module: AXPModuleModel): string[];
1438
+ /**
1439
+ * @deprecated Use aggregate relation queries instead
1440
+ */
1441
+ static findRelationsByType(module: AXPModuleModel, relationType: string): any[];
1442
+ /**
1443
+ * @deprecated Use AXPDomainService with entity dependency queries instead
1444
+ */
1445
+ static findEntityDependencies(module: AXPModuleModel, entityName: string): any[];
1446
+ /**
1447
+ * @deprecated Use module.getStatistics() method instead
1448
+ */
1449
+ static getModuleStatistics(module: AXPModuleModel): any;
1450
+ /**
1451
+ * @deprecated Use AXPDomainService with entity queries instead
1452
+ */
1453
+ static getAllEntities(module: AXPModuleModel): AXPEntityModel[];
1454
+ /**
1455
+ * @deprecated Use AXPDomainService with field queries instead
1456
+ */
1457
+ static getAllFields(module: AXPModuleModel): AXPEntityFieldModel[];
1458
+ }
1459
+
1460
+ /**
1461
+ * Union type for all domain definition types
1462
+ */
1463
+ type AXPDomainDefinition = AXPModuleDefinition | AXPAggregateDefinition | AXPEntityDefinition;
1464
+ /**
1465
+ * Domain path information parsed from path string
1466
+ */
1467
+ interface AXPDomainPathInfo {
1468
+ module: string;
1469
+ aggregate?: string;
1470
+ entity?: string;
1471
+ type: 'module' | 'aggregate' | 'entity';
1472
+ fullPath: string;
1473
+ }
1474
+ /**
1475
+ * Interface for domain loaders that can provide domain definitions on-demand
1476
+ */
1477
+ interface AXPDomainLoader {
1478
+ /**
1479
+ * Optional priority for loader ordering. Higher numbers = higher priority.
1480
+ * If not specified, uses registration order.
1481
+ */
1482
+ readonly priority?: number;
1483
+ /**
1484
+ * Determines if this loader can handle the given domain path
1485
+ * @param path The domain path to load (e.g., "user-management.user-aggregate.user")
1486
+ * @param type The type of domain object being requested
1487
+ * @returns true if this loader can load the domain definition
1488
+ */
1489
+ canLoad(path: string, type: 'module' | 'aggregate' | 'entity'): boolean;
1490
+ /**
1491
+ * Loads the domain definition for the given path
1492
+ * @param path The domain path to load
1493
+ * @param type The type of domain object being requested
1494
+ * @returns Promise that resolves to the domain definition or null if not found
1495
+ */
1496
+ load(path: string, type: 'module' | 'aggregate' | 'entity'): Promise<AXPDomainDefinition | null>;
1497
+ }
1498
+
1499
+ /**
1500
+ * Context class for domain middleware operations providing a fluent API for domain definition manipulation.
1501
+ *
1502
+ * This class serves as the interface between middleware functions and domain definitions,
1503
+ * offering methods to modify various aspects of a domain definition including:
1504
+ * - Metadata and custom properties
1505
+ * - Validation rules
1506
+ * - Feature flags and configuration
1507
+ * - Transformations and augmentations
1508
+ *
1509
+ * All methods return `this` to enable fluent method chaining.
1510
+ */
1511
+ declare class AXPDomainMiddlewareContext {
1512
+ private _definition;
1513
+ private _type;
1514
+ constructor(definition: AXPDomainDefinition, type: 'module' | 'aggregate' | 'entity');
1515
+ /**
1516
+ * Get the current definition (read-only access)
1517
+ */
1518
+ get definition(): AXPDomainDefinition;
1519
+ /**
1520
+ * Get the type of domain object being processed
1521
+ */
1522
+ get type(): 'module' | 'aggregate' | 'entity';
1523
+ /**
1524
+ * Set metadata for the domain definition
1525
+ */
1526
+ setMetadata(key: string, value: any): this;
1527
+ /**
1528
+ * Get metadata value
1529
+ */
1530
+ getMetadata(key: string): any;
1531
+ /**
1532
+ * Add validation rule to the definition (for entities and aggregates)
1533
+ */
1534
+ addValidation(rule: any): this;
1535
+ /**
1536
+ * Transform fields (for entities)
1537
+ */
1538
+ transformFields(transformer: (field: any) => any): this;
1539
+ /**
1540
+ * Add field to entity definition
1541
+ */
1542
+ addField(field: any): this;
1543
+ /**
1544
+ * Set title with transformation
1545
+ */
1546
+ setTitle(title: string): this;
1547
+ /**
1548
+ * Apply conditional logic
1549
+ */
1550
+ when(condition: boolean, callback: (context: this) => void): this;
1551
+ /**
1552
+ * Replace the entire definition
1553
+ */
1554
+ replaceDefinition(newDefinition: AXPDomainDefinition): this;
1555
+ }
1556
+ /**
1557
+ * Middleware function that can transform domain definitions
1558
+ * @param context - Domain middleware context providing definition info and configuration methods
1559
+ */
1560
+ type AXPDomainMiddleware = (context: AXPDomainMiddlewareContext) => void | Promise<void>;
1561
+
1562
+ /**
1563
+ * Central registry for managing domain definitions, middleware, and dynamic loading.
1564
+ *
1565
+ * Provides:
1566
+ * - Path-based domain resolution (module.aggregate.entity)
1567
+ * - Definition-level caching with fresh model creation
1568
+ * - Type-specific middleware processing
1569
+ * - On-demand domain loading with first-wins strategy
1570
+ * - Model creation and dependency injection
1571
+ */
1572
+ declare class AXPDomainRegistry {
1573
+ private readonly _definitionCache;
1574
+ private readonly _moduleMiddleware;
1575
+ private readonly _aggregateMiddleware;
1576
+ private readonly _entityMiddleware;
1577
+ private _loaders;
1578
+ private readonly schemaService;
1579
+ /**
1580
+ * Resolve a domain object by path with full middleware processing.
1581
+ * Supports definition-level caching with fresh model creation.
1582
+ *
1583
+ * @param path Domain path (e.g., "user-management.user-aggregate.user")
1584
+ * @returns Promise that resolves to the domain model
1585
+ */
1586
+ resolve<T>(path: string): Promise<T>;
1587
+ /**
1588
+ * Parse domain path string into structured information
1589
+ *
1590
+ * @param path Domain path to parse
1591
+ * @returns Parsed path information
1592
+ */
1593
+ private parsePath;
1594
+ /**
1595
+ * Register a domain loader for on-demand loading
1596
+ *
1597
+ * @param loader The loader instance to register
1598
+ */
1599
+ addLoader(loader: AXPDomainLoader): void;
1600
+ /**
1601
+ * Load definition from registered loaders using first-wins strategy
1602
+ *
1603
+ * @param path Domain path to load
1604
+ * @param type Type of domain object
1605
+ * @returns Promise that resolves to definition or undefined
1606
+ */
1607
+ private loadFromLoaders;
1608
+ /**
1609
+ * Add middleware for module processing
1610
+ */
1611
+ addModuleMiddleware(middleware: AXPDomainMiddleware): void;
1612
+ /**
1613
+ * Add middleware for aggregate processing
1614
+ */
1615
+ addAggregateMiddleware(middleware: AXPDomainMiddleware): void;
1616
+ /**
1617
+ * Add middleware for entity processing
1618
+ */
1619
+ addEntityMiddleware(middleware: AXPDomainMiddleware): void;
1620
+ /**
1621
+ * Apply type-specific middleware to definition
1622
+ *
1623
+ * @param definition Raw definition from cache or loader
1624
+ * @param type Type of domain object
1625
+ * @param path Original path for context
1626
+ * @returns Processed definition
1627
+ */
1628
+ private applyTypeMiddleware;
1629
+ /**
1630
+ * Get middleware collection for specific type
1631
+ *
1632
+ * @param type Domain object type
1633
+ * @returns Array of middleware functions
1634
+ */
1635
+ private getMiddlewareForType;
1636
+ /**
1637
+ * Create domain model from processed definition
1638
+ *
1639
+ * @param definition Processed definition (after middleware)
1640
+ * @param pathInfo Parsed path information
1641
+ * @returns Created domain model
1642
+ */
1643
+ private createModel;
1644
+ /**
1645
+ * Clear definition cache for a specific path
1646
+ *
1647
+ * @param path Path to clear from cache
1648
+ */
1649
+ invalidateCache(path: string): void;
1650
+ /**
1651
+ * Clear all cached definitions
1652
+ */
1653
+ clearCache(): void;
1654
+ /**
1655
+ * Get cache statistics
1656
+ */
1657
+ getCacheStats(): {
1658
+ size: number;
1659
+ paths: string[];
1660
+ };
1661
+ static ɵfac: i0.ɵɵFactoryDeclaration<AXPDomainRegistry, never>;
1662
+ static ɵprov: i0.ɵɵInjectableDeclaration<AXPDomainRegistry>;
1663
+ }
1664
+
1665
+ /**
1666
+ * High-level facade service for domain operations.
1667
+ *
1668
+ * Provides simplified interfaces to the domain registry with additional
1669
+ * business logic and convenience methods for common operations.
1670
+ *
1671
+ * This service acts as the main entry point for domain model resolution
1672
+ * and provides a clean API for consuming applications.
1673
+ */
1674
+ declare class AXPDomainService {
1675
+ private readonly registry;
1676
+ /**
1677
+ * Get module by name
1678
+ *
1679
+ * @param name Module name
1680
+ * @returns Promise that resolves to module model
1681
+ */
1682
+ getModule(name: string): Promise<AXPModuleModel>;
1683
+ /**
1684
+ * Check if module exists
1685
+ *
1686
+ * @param name Module name
1687
+ * @returns Promise that resolves to boolean
1688
+ */
1689
+ moduleExists(name: string): Promise<boolean>;
1690
+ /**
1691
+ * Get aggregate by module and aggregate names
1692
+ *
1693
+ * @param moduleName Module name
1694
+ * @param aggregateName Aggregate name
1695
+ * @returns Promise that resolves to aggregate model
1696
+ */
1697
+ getAggregate(moduleName: string, aggregateName: string): Promise<AXPAggregateModel>;
1698
+ /**
1699
+ * Get aggregate by path
1700
+ *
1701
+ * @param path Aggregate path (module.aggregate)
1702
+ * @returns Promise that resolves to aggregate model
1703
+ */
1704
+ getAggregateByPath(path: string): Promise<AXPAggregateModel>;
1705
+ /**
1706
+ * Check if aggregate exists
1707
+ *
1708
+ * @param moduleName Module name
1709
+ * @param aggregateName Aggregate name
1710
+ * @returns Promise that resolves to boolean
1711
+ */
1712
+ aggregateExists(moduleName: string, aggregateName: string): Promise<boolean>;
1713
+ /**
1714
+ * Get entity by full path
1715
+ *
1716
+ * @param path Full entity path (module.aggregate.entity)
1717
+ * @returns Promise that resolves to entity model
1718
+ */
1719
+ getEntity(path: string): Promise<AXPEntityModel>;
1720
+ /**
1721
+ * Get entity by component parts
1722
+ *
1723
+ * @param moduleName Module name
1724
+ * @param aggregateName Aggregate name
1725
+ * @param entityName Entity name
1726
+ * @returns Promise that resolves to entity model
1727
+ */
1728
+ getEntityByParts(moduleName: string, aggregateName: string, entityName: string): Promise<AXPEntityModel>;
1729
+ /**
1730
+ * Check if entity exists
1731
+ *
1732
+ * @param path Full entity path
1733
+ * @returns Promise that resolves to boolean
1734
+ */
1735
+ entityExists(path: string): Promise<boolean>;
1736
+ /**
1737
+ * Get multiple modules in parallel
1738
+ *
1739
+ * @param moduleNames Array of module names
1740
+ * @returns Promise that resolves to array of module models
1741
+ */
1742
+ getModules(moduleNames: string[]): Promise<AXPModuleModel[]>;
1743
+ /**
1744
+ * Get multiple aggregates in parallel
1745
+ *
1746
+ * @param aggregatePaths Array of aggregate paths
1747
+ * @returns Promise that resolves to array of aggregate models
1748
+ */
1749
+ getAggregates(aggregatePaths: string[]): Promise<AXPAggregateModel[]>;
1750
+ /**
1751
+ * Get multiple entities in parallel
1752
+ *
1753
+ * @param entityPaths Array of entity paths
1754
+ * @returns Promise that resolves to array of entity models
1755
+ */
1756
+ getEntities(entityPaths: string[]): Promise<AXPEntityModel[]>;
1757
+ /**
1758
+ * Find entities by name across all loaded modules
1759
+ *
1760
+ * @param entityName Entity name to search for
1761
+ * @returns Promise that resolves to array of matching entity paths
1762
+ */
1763
+ findEntitiesByName(entityName: string): Promise<string[]>;
1764
+ /**
1765
+ * Get all aggregates for a module
1766
+ *
1767
+ * @param moduleName Module name
1768
+ * @returns Promise that resolves to array of aggregate models
1769
+ */
1770
+ getModuleAggregates(moduleName: string): Promise<AXPAggregateModel[]>;
1771
+ /**
1772
+ * Get all entity references for an aggregate
1773
+ *
1774
+ * @param moduleName Module name
1775
+ * @param aggregateName Aggregate name
1776
+ * @returns Promise that resolves to entity references map
1777
+ */
1778
+ getAggregateEntityReferences(moduleName: string, aggregateName: string): Promise<Record<string, string>>;
1779
+ /**
1780
+ * Validate module and all its components
1781
+ *
1782
+ * @param moduleName Module name
1783
+ * @returns Promise that resolves to validation errors array
1784
+ */
1785
+ validateModule(moduleName: string): Promise<string[]>;
1786
+ /**
1787
+ * Validate aggregate and its components
1788
+ *
1789
+ * @param moduleName Module name
1790
+ * @param aggregateName Aggregate name
1791
+ * @returns Promise that resolves to validation errors array
1792
+ */
1793
+ validateAggregate(moduleName: string, aggregateName: string): Promise<string[]>;
1794
+ /**
1795
+ * Get statistics for a module
1796
+ *
1797
+ * @param moduleName Module name
1798
+ * @returns Promise that resolves to module statistics
1799
+ */
1800
+ getModuleStatistics(moduleName: string): Promise<any>;
1801
+ /**
1802
+ * Get statistics for an aggregate
1803
+ *
1804
+ * @param moduleName Module name
1805
+ * @param aggregateName Aggregate name
1806
+ * @returns Promise that resolves to aggregate statistics
1807
+ */
1808
+ getAggregateStatistics(moduleName: string, aggregateName: string): Promise<any>;
1809
+ /**
1810
+ * Clear registry cache
1811
+ */
1812
+ clearCache(): void;
1813
+ /**
1814
+ * Get cache statistics
1815
+ *
1816
+ * @returns Cache statistics object
1817
+ */
1818
+ getCacheStatistics(): {
1819
+ size: number;
1820
+ paths: string[];
1821
+ };
1822
+ /**
1823
+ * Invalidate cache for specific path
1824
+ *
1825
+ * @param path Domain path to invalidate
1826
+ */
1827
+ invalidateCache(path: string): void;
1828
+ /**
1829
+ * Parse domain path into components
1830
+ *
1831
+ * @param path Domain path to parse
1832
+ * @returns Parsed path components
1833
+ */
1834
+ parsePath(path: string): {
1835
+ module: string;
1836
+ aggregate?: string;
1837
+ entity?: string;
1838
+ type: string;
1839
+ };
1840
+ /**
1841
+ * Build path from components
1842
+ *
1843
+ * @param module Module name
1844
+ * @param aggregate Aggregate name (optional)
1845
+ * @param entity Entity name (optional)
1846
+ * @returns Built path string
1847
+ */
1848
+ buildPath(module: string, aggregate?: string, entity?: string): string;
1849
+ static ɵfac: i0.ɵɵFactoryDeclaration<AXPDomainService, never>;
1850
+ static ɵprov: i0.ɵɵInjectableDeclaration<AXPDomainService>;
1851
+ }
1852
+
1853
+ /**
1854
+ * Configuration for a domain loader with optional priority setting
1855
+ */
1856
+ interface AXPDomainLoaderConfig {
1857
+ /** The loader class or instance to register */
1858
+ loader: Type<AXPDomainLoader> | AXPDomainLoader;
1859
+ /** Optional priority for loader ordering (higher = higher priority) */
1860
+ priority?: number;
1861
+ }
1862
+ /**
1863
+ * Provide domain loaders for on-demand domain loading.
1864
+ *
1865
+ * Domain loaders enable the registry to load domain definitions that are not registered
1866
+ * at build time. This is useful for:
1867
+ * - Loading domain definitions from external APIs
1868
+ * - Dynamic domain generation
1869
+ * - Lazy loading of large domain sets
1870
+ * - Development-time domain hot-reloading
1871
+ *
1872
+ * @param loaders Array of loader classes, instances, or loader configurations
1873
+ * @returns Environment providers for dependency injection
1874
+ *
1875
+ * @example
1876
+ * ```typescript
1877
+ * // Simple loader registration
1878
+ * provideDomainLoaders([
1879
+ * HttpDomainLoader,
1880
+ * FileSystemDomainLoader,
1881
+ * new MemoryDomainLoader()
1882
+ * ])
1883
+ *
1884
+ * // With priority configuration
1885
+ * provideDomainLoaders([
1886
+ * { loader: HttpDomainLoader, priority: 10 },
1887
+ * { loader: FileSystemDomainLoader, priority: 5 },
1888
+ * { loader: new MemoryDomainLoader(), priority: 15 }
1889
+ * ])
1890
+ * ```
1891
+ */
1892
+ declare function provideDomainLoaders(loaders: Array<Type<AXPDomainLoader> | AXPDomainLoader | AXPDomainLoaderConfig>): EnvironmentProviders;
1893
+ /**
1894
+ * Provide a single domain loader for convenience
1895
+ *
1896
+ * @param loader Loader class, instance, or configuration
1897
+ * @returns Environment providers for dependency injection
1898
+ */
1899
+ declare function provideDomainLoader(loader: Type<AXPDomainLoader> | AXPDomainLoader | AXPDomainLoaderConfig): EnvironmentProviders;
1900
+
1901
+ /**
1902
+ * Injection tokens for type-specific middleware setup
1903
+ */
1904
+ declare const AXP_MODULE_MIDDLEWARE_SETUP = "AXP_MODULE_MIDDLEWARE_SETUP";
1905
+ declare const AXP_AGGREGATE_MIDDLEWARE_SETUP = "AXP_AGGREGATE_MIDDLEWARE_SETUP";
1906
+ declare const AXP_ENTITY_MIDDLEWARE_SETUP = "AXP_ENTITY_MIDDLEWARE_SETUP";
1907
+ /**
1908
+ * Provide middleware for module processing.
1909
+ *
1910
+ * Module middleware is applied when resolving module definitions and can:
1911
+ * - Add metadata and custom properties
1912
+ * - Validate module structure
1913
+ * - Transform module definitions
1914
+ * - Add computed properties
1915
+ *
1916
+ * @param middleware Array of middleware functions to register
1917
+ * @returns Environment providers for dependency injection
1918
+ *
1919
+ * @example
1920
+ * ```typescript
1921
+ * provideModuleMiddleware([
1922
+ * (context) => {
1923
+ * // Add common module metadata
1924
+ * context.setMetadata('loadedAt', new Date());
1925
+ * context.setMetadata('version', '1.0.0');
1926
+ * },
1927
+ * (context) => {
1928
+ * // Add namespace prefix if not present
1929
+ * if (!context.definition.name.includes('.')) {
1930
+ * context.definition.name = `app.${context.definition.name}`;
1931
+ * }
1932
+ * }
1933
+ * ])
1934
+ * ```
1935
+ */
1936
+ declare function provideModuleMiddleware(middleware: AXPDomainMiddleware[]): EnvironmentProviders;
1937
+ /**
1938
+ * Provide middleware for aggregate processing.
1939
+ *
1940
+ * Aggregate middleware is applied when resolving aggregate definitions and can:
1941
+ * - Add metadata and custom properties
1942
+ * - Validate aggregate structure
1943
+ * - Transform entity references
1944
+ * - Add computed relations
1945
+ *
1946
+ * @param middleware Array of middleware functions to register
1947
+ * @returns Environment providers for dependency injection
1948
+ *
1949
+ * @example
1950
+ * ```typescript
1951
+ * provideAggregateMiddleware([
1952
+ * (context) => {
1953
+ * // Add aggregate metadata
1954
+ * context.setMetadata('type', 'business-aggregate');
1955
+ * },
1956
+ * (context) => {
1957
+ * // Validate entity references
1958
+ * const entities = context.definition.entities;
1959
+ * if (Object.keys(entities).length === 0) {
1960
+ * throw new Error('Aggregate must have at least one entity');
1961
+ * }
1962
+ * }
1963
+ * ])
1964
+ * ```
1965
+ */
1966
+ declare function provideAggregateMiddleware(middleware: AXPDomainMiddleware[]): EnvironmentProviders;
1967
+ /**
1968
+ * Provide middleware for entity processing.
1969
+ *
1970
+ * Entity middleware is applied when resolving entity definitions and can:
1971
+ * - Add auto-generated fields (id, timestamps)
1972
+ * - Apply field transformations
1973
+ * - Add validation rules
1974
+ * - Set default values
1975
+ *
1976
+ * @param middleware Array of middleware functions to register
1977
+ * @returns Environment providers for dependency injection
1978
+ *
1979
+ * @example
1980
+ * ```typescript
1981
+ * provideEntityMiddleware([
1982
+ * (context) => {
1983
+ * // Add auto-generated ID field if not present
1984
+ * if (!context.definition.fields.some(f => f.name === 'id')) {
1985
+ * context.addField({
1986
+ * name: 'id',
1987
+ * type: 'uuid',
1988
+ * required: true,
1989
+ * generated: true
1990
+ * });
1991
+ * }
1992
+ * },
1993
+ * (context) => {
1994
+ * // Add timestamp fields
1995
+ * context.addField({
1996
+ * name: 'createdAt',
1997
+ * type: 'datetime',
1998
+ * required: true,
1999
+ * generated: true
2000
+ * });
2001
+ * context.addField({
2002
+ * name: 'updatedAt',
2003
+ * type: 'datetime',
2004
+ * required: true,
2005
+ * generated: true
2006
+ * });
2007
+ * }
2008
+ * ])
2009
+ * ```
2010
+ */
2011
+ declare function provideEntityMiddleware(middleware: AXPDomainMiddleware[]): EnvironmentProviders;
2012
+ /**
2013
+ * Provide combined middleware for all domain types.
2014
+ *
2015
+ * This is a convenience function that allows registering middleware for multiple
2016
+ * domain types in a single call.
2017
+ *
2018
+ * @param config Configuration object with middleware for each type
2019
+ * @returns Environment providers for dependency injection
2020
+ *
2021
+ * @example
2022
+ * ```typescript
2023
+ * provideDomainMiddleware({
2024
+ * modules: [
2025
+ * (context) => context.setMetadata('loadedAt', new Date())
2026
+ * ],
2027
+ * aggregates: [
2028
+ * (context) => context.setMetadata('type', 'business-aggregate')
2029
+ * ],
2030
+ * entities: [
2031
+ * (context) => {
2032
+ * if (!context.definition.fields.some(f => f.name === 'id')) {
2033
+ * context.addField({ name: 'id', type: 'uuid', required: true });
2034
+ * }
2035
+ * }
2036
+ * ]
2037
+ * })
2038
+ * ```
2039
+ */
2040
+ declare function provideDomainMiddleware(config: {
2041
+ modules?: AXPDomainMiddleware[];
2042
+ aggregates?: AXPDomainMiddleware[];
2043
+ entities?: AXPDomainMiddleware[];
2044
+ }): EnvironmentProviders;
2045
+
2046
+ export { AXPAggregateModel, AXPDomainMiddlewareContext, AXPDomainModule, AXPDomainRegistry, AXPDomainService, AXPEntityCommandScope, AXPEntityFieldModel, AXPEntityModel, AXPEntityType, AXPModuleHelper, AXPModuleModel, AXPRelationModel, AXPRelationshipCardinality, AXPRelationshipKind, AXPSchemaMiddlewareContext, AXPSchemaModel, AXPSchemaRegistry, AXPSchemaService, AXP_AGGREGATE_MIDDLEWARE_SETUP, AXP_ENTITY_CRUD_SETUP, AXP_ENTITY_MIDDLEWARE_SETUP, AXP_MODULE_MIDDLEWARE_SETUP, AXP_SCHEMA_EXTENSION, AXP_SCHEMA_LOADER_SETUP, AXP_SCHEMA_MIDDLEWARE_SETUP, AXP_SCHEMA_SETUP, provideAggregateMiddleware, provideDomainLoader, provideDomainLoaders, provideDomainMiddleware, provideEntity, provideEntityMiddleware, provideModuleMiddleware, provideSchema, provideSchemaLoaders, provideSchemaMiddleware, provideSchemaSetups, provideSchemasFromFactory };
2047
+ export type { AXPAggregateDefinition, AXPAggregateEntityList, AXPAggregateRelationDefinition, AXPDomainAction, AXPDomainDefinition, AXPDomainLoader, AXPDomainLoaderConfig, AXPDomainMiddleware, AXPDomainPathInfo, AXPEntityDefinition, AXPEntityFieldDefinition, AXPEntityFieldFeatures, AXPModuleDefinition, AXPRegisteredSchema, AXPSchemaDataType, AXPSchemaDefinition, AXPSchemaEntry, AXPSchemaFeatures, AXPSchemaInterface, AXPSchemaLoader, AXPSchemaLoaderConfig, AXPSchemaMiddleware, AXPSchemaMiddlewareEntry, AXPSchemaRegistrationOptions };