@defai.digital/config-domain 13.0.3

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/LICENSE ADDED
@@ -0,0 +1,214 @@
1
+ AutomatosX Open Source Edition - Apache License 2.0
2
+
3
+ This license applies ONLY to the AutomatosX Open Source Edition code
4
+ published on GitHub at https://github.com/defai-digital/automatosx
5
+
6
+ This license does NOT apply to:
7
+ - AutomatosX Pro Edition (proprietary software - separate EULA)
8
+ - AutomatosX Enterprise Edition (proprietary software - separate agreement)
9
+
10
+ For commercial editions, see COMMERCIAL-LICENSE.md
11
+
12
+ ===============================================================================
13
+
14
+ Apache License
15
+ Version 2.0, January 2004
16
+ http://www.apache.org/licenses/
17
+
18
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
19
+
20
+ 1. Definitions.
21
+
22
+ "License" shall mean the terms and conditions for use, reproduction,
23
+ and distribution as defined by Sections 1 through 9 of this document.
24
+
25
+ "Licensor" shall mean the copyright owner or entity authorized by
26
+ the copyright owner that is granting the License.
27
+
28
+ "Legal Entity" shall mean the union of the acting entity and all
29
+ other entities that control, are controlled by, or are under common
30
+ control with that entity. For the purposes of this definition,
31
+ "control" means (i) the power, direct or indirect, to cause the
32
+ direction or management of such entity, whether by contract or
33
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
34
+ outstanding shares, or (iii) beneficial ownership of such entity.
35
+
36
+ "You" (or "Your") shall mean an individual or Legal Entity
37
+ exercising permissions granted by this License.
38
+
39
+ "Source" form shall mean the preferred form for making modifications,
40
+ including but not limited to software source code, documentation
41
+ source, and configuration files.
42
+
43
+ "Object" form shall mean any form resulting from mechanical
44
+ transformation or translation of a Source form, including but
45
+ not limited to compiled object code, generated documentation,
46
+ and conversions to other media types.
47
+
48
+ "Work" shall mean the work of authorship, whether in Source or
49
+ Object form, made available under the License, as indicated by a
50
+ copyright notice that is included in or attached to the work
51
+ (an example is provided in the Appendix below).
52
+
53
+ "Derivative Works" shall mean any work, whether in Source or Object
54
+ form, that is based on (or derived from) the Work and for which the
55
+ editorial revisions, annotations, elaborations, or other modifications
56
+ represent, as a whole, an original work of authorship. For the purposes
57
+ of this License, Derivative Works shall not include works that remain
58
+ separable from, or merely link (or bind by name) to the interfaces of,
59
+ the Work and Derivative Works thereof.
60
+
61
+ "Contribution" shall mean any work of authorship, including
62
+ the original version of the Work and any modifications or additions
63
+ to that Work or Derivative Works thereof, that is intentionally
64
+ submitted to Licensor for inclusion in the Work by the copyright owner
65
+ or by an individual or Legal Entity authorized to submit on behalf of
66
+ the copyright owner. For the purposes of this definition, "submitted"
67
+ means any form of electronic, verbal, or written communication sent
68
+ to the Licensor or its representatives, including but not limited to
69
+ communication on electronic mailing lists, source code control systems,
70
+ and issue tracking systems that are managed by, or on behalf of, the
71
+ Licensor for the purpose of discussing and improving the Work, but
72
+ excluding communication that is conspicuously marked or otherwise
73
+ designated in writing by the copyright owner as "Not a Contribution."
74
+
75
+ "Contributor" shall mean Licensor and any individual or Legal Entity
76
+ on behalf of whom a Contribution has been received by Licensor and
77
+ subsequently incorporated within the Work.
78
+
79
+ 2. Grant of Copyright License. Subject to the terms and conditions of
80
+ this License, each Contributor hereby grants to You a perpetual,
81
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
82
+ copyright license to reproduce, prepare Derivative Works of,
83
+ publicly display, publicly perform, sublicense, and distribute the
84
+ Work and such Derivative Works in Source or Object form.
85
+
86
+ 3. Grant of Patent License. Subject to the terms and conditions of
87
+ this License, each Contributor hereby grants to You a perpetual,
88
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
89
+ (except as stated in this section) patent license to make, have made,
90
+ use, offer to sell, sell, import, and otherwise transfer the Work,
91
+ where such license applies only to those patent claims licensable
92
+ by such Contributor that are necessarily infringed by their
93
+ Contribution(s) alone or by combination of their Contribution(s)
94
+ with the Work to which such Contribution(s) was submitted. If You
95
+ institute patent litigation against any entity (including a
96
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
97
+ or a Contribution incorporated within the Work constitutes direct
98
+ or contributory patent infringement, then any patent licenses
99
+ granted to You under this License for that Work shall terminate
100
+ as of the date such litigation is filed.
101
+
102
+ 4. Redistribution. You may reproduce and distribute copies of the
103
+ Work or Derivative Works thereof in any medium, with or without
104
+ modifications, and in Source or Object form, provided that You
105
+ meet the following conditions:
106
+
107
+ (a) You must give any other recipients of the Work or
108
+ Derivative Works a copy of this License; and
109
+
110
+ (b) You must cause any modified files to carry prominent notices
111
+ stating that You changed the files; and
112
+
113
+ (c) You must retain, in the Source form of any Derivative Works
114
+ that You distribute, all copyright, patent, trademark, and
115
+ attribution notices from the Source form of the Work,
116
+ excluding those notices that do not pertain to any part of
117
+ the Derivative Works; and
118
+
119
+ (d) If the Work includes a "NOTICE" text file as part of its
120
+ distribution, then any Derivative Works that You distribute must
121
+ include a readable copy of the attribution notices contained
122
+ within such NOTICE file, excluding those notices that do not
123
+ pertain to any part of the Derivative Works, in at least one
124
+ of the following places: within a NOTICE text file distributed
125
+ as part of the Derivative Works; within the Source form or
126
+ documentation, if provided along with the Derivative Works; or,
127
+ within a display generated by the Derivative Works, if and
128
+ wherever such third-party notices normally appear. The contents
129
+ of the NOTICE file are for informational purposes only and
130
+ do not modify the License. You may add Your own attribution
131
+ notices within Derivative Works that You distribute, alongside
132
+ or as an addendum to the NOTICE text from the Work, provided
133
+ that such additional attribution notices cannot be construed
134
+ as modifying the License.
135
+
136
+ You may add Your own copyright statement to Your modifications and
137
+ may provide additional or different license terms and conditions
138
+ for use, reproduction, or distribution of Your modifications, or
139
+ for any such Derivative Works as a whole, provided Your use,
140
+ reproduction, and distribution of the Work otherwise complies with
141
+ the conditions stated in this License.
142
+
143
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
144
+ any Contribution intentionally submitted for inclusion in the Work
145
+ by You to the Licensor shall be under the terms and conditions of
146
+ this License, without any additional terms or conditions.
147
+ Notwithstanding the above, nothing herein shall supersede or modify
148
+ the terms of any separate license agreement you may have executed
149
+ with Licensor regarding such Contributions.
150
+
151
+ 6. Trademarks. This License does not grant permission to use the trade
152
+ names, trademarks, service marks, or product names of the Licensor,
153
+ except as required for reasonable and customary use in describing the
154
+ origin of the Work and reproducing the content of the NOTICE file.
155
+
156
+ 7. Disclaimer of Warranty. Unless required by applicable law or
157
+ agreed to in writing, Licensor provides the Work (and each
158
+ Contributor provides its Contributions) on an "AS IS" BASIS,
159
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
160
+ implied, including, without limitation, any warranties or conditions
161
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
162
+ PARTICULAR PURPOSE. You are solely responsible for determining the
163
+ appropriateness of using or redistributing the Work and assume any
164
+ risks associated with Your exercise of permissions under this License.
165
+
166
+ 8. Limitation of Liability. In no event and under no legal theory,
167
+ whether in tort (including negligence), contract, or otherwise,
168
+ unless required by applicable law (such as deliberate and grossly
169
+ negligent acts) or agreed to in writing, shall any Contributor be
170
+ liable to You for damages, including any direct, indirect, special,
171
+ incidental, or consequential damages of any character arising as a
172
+ result of this License or out of the use or inability to use the
173
+ Work (including but not limited to damages for loss of goodwill,
174
+ work stoppage, computer failure or malfunction, or any and all
175
+ other commercial damages or losses), even if such Contributor
176
+ has been advised of the possibility of such damages.
177
+
178
+ 9. Accepting Warranty or Additional Liability. While redistributing
179
+ the Work or Derivative Works thereof, You may choose to offer,
180
+ and charge a fee for, acceptance of support, warranty, indemnity,
181
+ or other liability obligations and/or rights consistent with this
182
+ License. However, in accepting such obligations, You may act only
183
+ on Your own behalf and on Your sole responsibility, not on behalf
184
+ of any other Contributor, and only if You agree to indemnify,
185
+ defend, and hold each Contributor harmless for any liability
186
+ incurred by, or claims asserted against, such Contributor by reason
187
+ of your accepting any such warranty or additional liability.
188
+
189
+ END OF TERMS AND CONDITIONS
190
+
191
+ APPENDIX: How to apply the Apache License to your work.
192
+
193
+ To apply the Apache License to your work, attach the following
194
+ boilerplate notice, with the fields enclosed by brackets "[]"
195
+ replaced with your own identifying information. (Don't include
196
+ the brackets!) The text should be enclosed in the appropriate
197
+ comment syntax for the file format. We also recommend that a
198
+ file or class name and description of purpose be included on the
199
+ same "printed page" as the copyright notice for easier
200
+ identification within third-party archives.
201
+
202
+ Copyright 2024-2025 DEFAI Private Limited
203
+
204
+ Licensed under the Apache License, Version 2.0 (the "License");
205
+ you may not use this file except in compliance with the License.
206
+ You may obtain a copy of the License at
207
+
208
+ http://www.apache.org/licenses/LICENSE-2.0
209
+
210
+ Unless required by applicable law or agreed to in writing, software
211
+ distributed under the License is distributed on an "AS IS" BASIS,
212
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
213
+ See the License for the specific language governing permissions and
214
+ limitations under the License.
@@ -0,0 +1,110 @@
1
+ /**
2
+ * Configuration Aggregate
3
+ *
4
+ * Aggregate root for configuration with event sourcing.
5
+ *
6
+ * Invariants:
7
+ * - INV-CFG-AGG-001: State transitions follow CONFIG_TRANSITIONS
8
+ * - INV-CFG-AGG-002: Version increments on every event
9
+ * - INV-CFG-AGG-003: Events are immutable once committed
10
+ */
11
+ import { type AutomatosXConfig, type ConfigEvent, type ConfigStatus } from '@defai.digital/contracts';
12
+ /**
13
+ * Config aggregate state
14
+ */
15
+ export interface ConfigAggregateState {
16
+ status: ConfigStatus;
17
+ config: AutomatosXConfig | undefined;
18
+ scope: 'global' | 'local';
19
+ version: number;
20
+ lastUpdatedAt: string | undefined;
21
+ pendingEvents: ConfigEvent[];
22
+ }
23
+ /**
24
+ * Config aggregate - the aggregate root for configuration
25
+ */
26
+ export declare class ConfigAggregate {
27
+ private state;
28
+ /**
29
+ * Creates a new aggregate or rehydrates from events
30
+ */
31
+ constructor(scope: 'global' | 'local', events?: ConfigEvent[]);
32
+ /**
33
+ * Gets current state (readonly)
34
+ */
35
+ getState(): Readonly<ConfigAggregateState>;
36
+ /**
37
+ * Gets current status
38
+ */
39
+ getStatus(): ConfigStatus;
40
+ /**
41
+ * Gets current config (if valid)
42
+ */
43
+ getConfig(): AutomatosXConfig | undefined;
44
+ /**
45
+ * Gets current version
46
+ */
47
+ getVersion(): number;
48
+ /**
49
+ * Gets uncommitted events
50
+ */
51
+ getUncommittedEvents(): ConfigEvent[];
52
+ /**
53
+ * Checks if there are uncommitted events
54
+ */
55
+ hasUncommittedEvents(): boolean;
56
+ /**
57
+ * Creates config (only from uninitialized state)
58
+ */
59
+ create(config: AutomatosXConfig, correlationId: string): ConfigEvent;
60
+ /**
61
+ * Updates a config value
62
+ */
63
+ update(path: string, value: unknown, correlationId: string): ConfigEvent;
64
+ /**
65
+ * Resets config to defaults
66
+ */
67
+ reset(correlationId: string): ConfigEvent;
68
+ /**
69
+ * Deletes config
70
+ */
71
+ delete(correlationId: string): ConfigEvent;
72
+ /**
73
+ * Migrates config to new version
74
+ */
75
+ migrate(fromVersion: string, toVersion: string, migratedConfig: AutomatosXConfig, correlationId: string): ConfigEvent;
76
+ /**
77
+ * Marks events as committed (clears pending events)
78
+ */
79
+ markEventsCommitted(): void;
80
+ /**
81
+ * Asserts current state is expected
82
+ */
83
+ private assertState;
84
+ /**
85
+ * Asserts transition is valid
86
+ * INV-CFG-AGG-001: State transitions follow CONFIG_TRANSITIONS
87
+ */
88
+ private assertTransition;
89
+ /**
90
+ * Applies an event to state
91
+ */
92
+ private applyEvent;
93
+ /**
94
+ * Applies event to state (mutates state)
95
+ */
96
+ private applyToState;
97
+ /**
98
+ * Rehydrates state from events
99
+ */
100
+ private rehydrate;
101
+ }
102
+ /**
103
+ * Creates a new config aggregate
104
+ */
105
+ export declare function createConfigAggregate(scope: 'global' | 'local', events?: ConfigEvent[]): ConfigAggregate;
106
+ /**
107
+ * Creates an aggregate from existing config (for migration from file-based)
108
+ */
109
+ export declare function createAggregateFromConfig(scope: 'global' | 'local', config: AutomatosXConfig, correlationId: string): ConfigAggregate;
110
+ //# sourceMappingURL=aggregate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"aggregate.d.ts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SAAS,EAAE,MAAM,EACjB,cAAc,EAAE,gBAAgB,EAChC,aAAa,EAAE,MAAM,GACpB,WAAW;IAqCd;;OAEG;IACH,mBAAmB,IAAI,IAAI;IAQ3B;;OAEG;IACH,OAAO,CAAC,WAAW;IASnB;;;OAGG;IACH,OAAO,CAAC,gBAAgB;IAaxB;;OAEG;IACH,OAAO,CAAC,UAAU;IAKlB;;OAEG;IACH,OAAO,CAAC,YAAY;IAuCpB;;OAEG;IACH,OAAO,CAAC,SAAS;CA+ClB;AAMD;;GAEG;AACH,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,QAAQ,GAAG,OAAO,EACzB,MAAM,CAAC,EAAE,WAAW,EAAE,GACrB,eAAe,CAEjB;AAED;;GAEG;AACH,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,QAAQ,GAAG,OAAO,EACzB,MAAM,EAAE,gBAAgB,EACxB,aAAa,EAAE,MAAM,GACpB,eAAe,CAIjB"}
@@ -0,0 +1,297 @@
1
+ /**
2
+ * Configuration Aggregate
3
+ *
4
+ * Aggregate root for configuration with event sourcing.
5
+ *
6
+ * Invariants:
7
+ * - INV-CFG-AGG-001: State transitions follow CONFIG_TRANSITIONS
8
+ * - INV-CFG-AGG-002: Version increments on every event
9
+ * - INV-CFG-AGG-003: Events are immutable once committed
10
+ */
11
+ import { isValidConfigTransition, createConfigCreatedEvent, createConfigUpdatedEvent, createConfigResetEvent, createConfigMigratedEvent, createConfigDeletedEvent, createConfigValidationFailedEvent, ConfigErrorCode, ConfigError, safeValidateConfig, } from '@defai.digital/contracts';
12
+ import { getValue, setValue } from './operations.js';
13
+ /**
14
+ * Initial state for a new aggregate
15
+ */
16
+ function createInitialState(scope) {
17
+ return {
18
+ status: 'uninitialized',
19
+ config: undefined,
20
+ scope,
21
+ version: 0,
22
+ lastUpdatedAt: undefined,
23
+ pendingEvents: [],
24
+ };
25
+ }
26
+ // ============================================================================
27
+ // Config Aggregate
28
+ // ============================================================================
29
+ /**
30
+ * Config aggregate - the aggregate root for configuration
31
+ */
32
+ export class ConfigAggregate {
33
+ state;
34
+ /**
35
+ * Creates a new aggregate or rehydrates from events
36
+ */
37
+ constructor(scope, events = []) {
38
+ this.state = this.rehydrate(scope, events);
39
+ }
40
+ // ==========================================================================
41
+ // Query Methods
42
+ // ==========================================================================
43
+ /**
44
+ * Gets current state (readonly)
45
+ */
46
+ getState() {
47
+ return this.state;
48
+ }
49
+ /**
50
+ * Gets current status
51
+ */
52
+ getStatus() {
53
+ return this.state.status;
54
+ }
55
+ /**
56
+ * Gets current config (if valid)
57
+ */
58
+ getConfig() {
59
+ return this.state.config;
60
+ }
61
+ /**
62
+ * Gets current version
63
+ */
64
+ getVersion() {
65
+ return this.state.version;
66
+ }
67
+ /**
68
+ * Gets uncommitted events
69
+ */
70
+ getUncommittedEvents() {
71
+ return [...this.state.pendingEvents];
72
+ }
73
+ /**
74
+ * Checks if there are uncommitted events
75
+ */
76
+ hasUncommittedEvents() {
77
+ return this.state.pendingEvents.length > 0;
78
+ }
79
+ // ==========================================================================
80
+ // Command Methods
81
+ // ==========================================================================
82
+ /**
83
+ * Creates config (only from uninitialized state)
84
+ */
85
+ create(config, correlationId) {
86
+ this.assertTransition('valid');
87
+ // Validate config
88
+ const validation = safeValidateConfig(config);
89
+ if (!validation.success) {
90
+ throw new ConfigError(ConfigErrorCode.CONFIG_VALIDATION_ERROR, 'Invalid config provided', {
91
+ errors: validation.error.errors.map((e) => `${e.path.join('.')}: ${e.message}`),
92
+ });
93
+ }
94
+ const event = createConfigCreatedEvent(this.state.scope, config, correlationId, this.state.version + 1);
95
+ this.applyEvent(event);
96
+ return event;
97
+ }
98
+ /**
99
+ * Updates a config value
100
+ */
101
+ update(path, value, correlationId) {
102
+ this.assertState('valid');
103
+ this.assertTransition('valid');
104
+ if (this.state.config === undefined) {
105
+ throw new ConfigError(ConfigErrorCode.CONFIG_NOT_FOUND, 'No config to update');
106
+ }
107
+ const oldValue = getValue(this.state.config, path);
108
+ const newConfig = setValue(this.state.config, path, value);
109
+ // Validate new config
110
+ const validation = safeValidateConfig(newConfig);
111
+ if (!validation.success) {
112
+ // Emit validation failed event
113
+ const failEvent = createConfigValidationFailedEvent(validation.error.errors.map((e) => `${e.path.join('.')}: ${e.message}`), correlationId, this.state.version + 1);
114
+ this.applyEvent(failEvent);
115
+ throw new ConfigError(ConfigErrorCode.CONFIG_VALIDATION_ERROR, `Invalid value for path '${path}'`, {
116
+ errors: validation.error.errors.map((e) => `${e.path.join('.')}: ${e.message}`),
117
+ });
118
+ }
119
+ const event = createConfigUpdatedEvent(this.state.scope, path, oldValue, value, correlationId, this.state.version + 1);
120
+ this.applyEvent(event);
121
+ return event;
122
+ }
123
+ /**
124
+ * Resets config to defaults
125
+ */
126
+ reset(correlationId) {
127
+ // Can reset from any state except migrating
128
+ if (this.state.status === 'migrating') {
129
+ throw new ConfigError(ConfigErrorCode.CONFIG_INVALID_TRANSITION, 'Cannot reset while migration is in progress');
130
+ }
131
+ const event = createConfigResetEvent(this.state.scope, correlationId, this.state.version + 1);
132
+ this.applyEvent(event);
133
+ return event;
134
+ }
135
+ /**
136
+ * Deletes config
137
+ */
138
+ delete(correlationId) {
139
+ if (this.state.status === 'uninitialized') {
140
+ throw new ConfigError(ConfigErrorCode.CONFIG_NOT_FOUND, 'No config to delete');
141
+ }
142
+ const event = createConfigDeletedEvent(this.state.scope, correlationId, this.state.version + 1);
143
+ this.applyEvent(event);
144
+ return event;
145
+ }
146
+ /**
147
+ * Migrates config to new version
148
+ */
149
+ migrate(fromVersion, toVersion, migratedConfig, correlationId) {
150
+ this.assertState('valid');
151
+ // First transition to migrating state
152
+ this.state.status = 'migrating';
153
+ // Validate migrated config
154
+ const validation = safeValidateConfig(migratedConfig);
155
+ if (!validation.success) {
156
+ // Transition to invalid
157
+ this.state.status = 'invalid';
158
+ throw new ConfigError(ConfigErrorCode.CONFIG_MIGRATION_FAILED, 'Migration produced invalid config', {
159
+ errors: validation.error.errors.map((e) => `${e.path.join('.')}: ${e.message}`),
160
+ });
161
+ }
162
+ const event = createConfigMigratedEvent(fromVersion, toVersion, correlationId, this.state.version + 1);
163
+ // Apply migration - update config
164
+ this.state.config = validation.data;
165
+ this.state.version += 1;
166
+ this.state.status = 'valid';
167
+ this.state.lastUpdatedAt = event.timestamp;
168
+ this.state.pendingEvents.push(event);
169
+ return event;
170
+ }
171
+ /**
172
+ * Marks events as committed (clears pending events)
173
+ */
174
+ markEventsCommitted() {
175
+ this.state.pendingEvents = [];
176
+ }
177
+ // ==========================================================================
178
+ // State Machine Methods
179
+ // ==========================================================================
180
+ /**
181
+ * Asserts current state is expected
182
+ */
183
+ assertState(expected) {
184
+ if (this.state.status !== expected) {
185
+ throw new ConfigError(ConfigErrorCode.CONFIG_INVALID_TRANSITION, `Expected status '${expected}' but was '${this.state.status}'`);
186
+ }
187
+ }
188
+ /**
189
+ * Asserts transition is valid
190
+ * INV-CFG-AGG-001: State transitions follow CONFIG_TRANSITIONS
191
+ */
192
+ assertTransition(to) {
193
+ if (!isValidConfigTransition(this.state.status, to)) {
194
+ throw new ConfigError(ConfigErrorCode.CONFIG_INVALID_TRANSITION, `Cannot transition from '${this.state.status}' to '${to}'`);
195
+ }
196
+ }
197
+ // ==========================================================================
198
+ // Event Sourcing Methods
199
+ // ==========================================================================
200
+ /**
201
+ * Applies an event to state
202
+ */
203
+ applyEvent(event) {
204
+ this.applyToState(event);
205
+ this.state.pendingEvents.push(event);
206
+ }
207
+ /**
208
+ * Applies event to state (mutates state)
209
+ */
210
+ applyToState(event) {
211
+ const payload = event.payload;
212
+ switch (payload.type) {
213
+ case 'created':
214
+ this.state.status = 'valid';
215
+ this.state.config = payload.config;
216
+ break;
217
+ case 'updated':
218
+ if (this.state.config !== undefined) {
219
+ this.state.config = setValue(this.state.config, payload.path, payload.newValue);
220
+ }
221
+ break;
222
+ case 'reset':
223
+ this.state.status = 'uninitialized';
224
+ this.state.config = undefined;
225
+ break;
226
+ case 'deleted':
227
+ this.state.status = 'uninitialized';
228
+ this.state.config = undefined;
229
+ break;
230
+ case 'validationFailed':
231
+ this.state.status = 'invalid';
232
+ break;
233
+ case 'migrated':
234
+ // Config is updated separately in migrate()
235
+ this.state.status = 'valid';
236
+ break;
237
+ }
238
+ this.state.version = event.version;
239
+ this.state.lastUpdatedAt = event.timestamp;
240
+ }
241
+ /**
242
+ * Rehydrates state from events
243
+ */
244
+ rehydrate(scope, events) {
245
+ const state = createInitialState(scope);
246
+ for (const event of events) {
247
+ // Apply without adding to pending
248
+ const payload = event.payload;
249
+ switch (payload.type) {
250
+ case 'created':
251
+ state.status = 'valid';
252
+ state.config = payload.config;
253
+ break;
254
+ case 'updated':
255
+ if (state.config !== undefined) {
256
+ state.config = setValue(state.config, payload.path, payload.newValue);
257
+ }
258
+ break;
259
+ case 'reset':
260
+ state.status = 'uninitialized';
261
+ state.config = undefined;
262
+ break;
263
+ case 'deleted':
264
+ state.status = 'uninitialized';
265
+ state.config = undefined;
266
+ break;
267
+ case 'validationFailed':
268
+ state.status = 'invalid';
269
+ break;
270
+ case 'migrated':
271
+ state.status = 'valid';
272
+ break;
273
+ }
274
+ state.version = event.version;
275
+ state.lastUpdatedAt = event.timestamp;
276
+ }
277
+ return state;
278
+ }
279
+ }
280
+ // ============================================================================
281
+ // Factory Functions
282
+ // ============================================================================
283
+ /**
284
+ * Creates a new config aggregate
285
+ */
286
+ export function createConfigAggregate(scope, events) {
287
+ return new ConfigAggregate(scope, events);
288
+ }
289
+ /**
290
+ * Creates an aggregate from existing config (for migration from file-based)
291
+ */
292
+ export function createAggregateFromConfig(scope, config, correlationId) {
293
+ const aggregate = new ConfigAggregate(scope, []);
294
+ aggregate.create(config, correlationId);
295
+ return aggregate;
296
+ }
297
+ //# sourceMappingURL=aggregate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"aggregate.js","sourceRoot":"","sources":["../src/aggregate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAIL,uBAAuB,EACvB,wBAAwB,E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YACV,CAAC;YAED,KAAK,CAAC,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC;YAC9B,KAAK,CAAC,aAAa,GAAG,KAAK,CAAC,SAAS,CAAC;QACxC,CAAC;QAED,OAAO,KAAK,CAAC;IACf,CAAC;CACF;AAED,+EAA+E;AAC/E,oBAAoB;AACpB,+EAA+E;AAE/E;;GAEG;AACH,MAAM,UAAU,qBAAqB,CACnC,KAAyB,EACzB,MAAsB;IAEtB,OAAO,IAAI,eAAe,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;AAC5C,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,yBAAyB,CACvC,KAAyB,EACzB,MAAwB,EACxB,aAAqB;IAErB,MAAM,SAAS,GAAG,IAAI,eAAe,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IACjD,SAAS,CAAC,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;IACxC,OAAO,SAAS,CAAC;AACnB,CAAC"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * @defai.digital/config-domain
3
+ *
4
+ * Configuration domain - config management following contract invariants.
5
+ */
6
+ export { CONFIG_PATHS, DATA_PATHS, CONFIG_SUBDIRS, type ConfigStore, expandPath, getConfigPath, createConfigStore, initConfigDirectory, isSetupComplete, } from './store.js';
7
+ export { parsePath, getValue, setValue, removeValue, mergeConfigs, diffConfigs, hasPath, getAllPaths, } from './operations.js';
8
+ export { type ConfigAggregateState, ConfigAggregate, createConfigAggregate, createAggregateFromConfig, } from './aggregate.js';
9
+ export { type ConfigEventStore, type ConfigRepository, type ConfigRepositoryOptions, InMemoryConfigEventStore, createConfigRepository, getConfigRepository, setConfigRepository, resetConfigRepository, } from './repository.js';
10
+ export { type ConfigMigration, type MigrationInfo, CURRENT_VERSION, MIN_SUPPORTED_VERSION, VERSION_ORDER, MIGRATIONS, getConfigVersion, compareVersions, isVersionSupported, getMigrationPath, needsMigration, migrateConfig, safeMigrateConfig, getMigrationInfo, } from './migrator.js';
11
+ export { type ProviderDetectionPort, type DetectionOptions, nullDetectionAdapter, setDetectionAdapter, getDetectionAdapter, resetDetectionAdapter, } from './ports/detection.js';
12
+ export { type ConfigResolutionResult, type IConfigResolver, ConfigResolver, createConfigResolver, resolveConfig, resolveConfigFull, } from './resolver.js';
13
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EACL,YAAY,EACZ,UAAU,EACV,cAAc,EACd,KAAK,WAAW,EAChB,UAAU,EACV,aAAa,EACb,iBAAiB,EACjB,mBAAmB,EACnB,eAAe,GAChB,MAAM,YAAY,CAAC;AAGpB,OAAO,EACL,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,WAAW,EACX,YAAY,EACZ,WAAW,EACX,OAAO,EACP,WAAW,GACZ,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EACL,KAAK,oBAAoB,EACzB,eAAe,EACf,qBAAqB,EACrB,yBAAyB,GAC1B,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,uBAAuB,EAC5B,wBAAwB,EACxB,sBAAsB,EACtB,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,GACtB,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,eAAe,EACf,qBAAqB,EACrB,aAAa,EACb,UAAU,EACV,gBAAgB,EAChB,eAAe,EACf,kBAAkB,EAClB,gBAAgB,EAChB,cAAc,EACd,aAAa,EACb,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,eAAe,CAAC;AAGvB,OAAO,EACL,KAAK,qBAAqB,EAC1B,KAAK,gBAAgB,EACrB,oBAAoB,EACpB,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,GACtB,MAAM,sBAAsB,CAAC;AAG9B,OAAO,EACL,KAAK,sBAAsB,EAC3B,KAAK,eAAe,EACpB,cAAc,EACd,oBAAoB,EACpB,aAAa,EACb,iBAAiB,GAClB,MAAM,eAAe,CAAC"}