@spine-event-engine/server 2.0.0-snapshot.2 → 2.0.0-snapshot.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +225 -518
- package/REFERENCE.md +498 -49
- package/dist/browser/browser-server.d.ts +95 -0
- package/dist/browser/browser-server.d.ts.map +1 -0
- package/dist/{server → browser}/browser-server.js +93 -7
- package/dist/browser/browser-server.js.map +1 -0
- package/dist/browser/durable-subscription-bindings.d.ts.map +1 -0
- package/dist/browser/durable-subscription-bindings.js.map +1 -0
- package/dist/browser/index.d.ts +12 -0
- package/dist/browser/index.d.ts.map +1 -0
- package/dist/browser/index.js +24 -0
- package/dist/browser/index.js.map +1 -0
- package/dist/browser/options.d.ts +183 -0
- package/dist/browser/options.d.ts.map +1 -0
- package/dist/browser/options.js +15 -0
- package/dist/browser/options.js.map +1 -0
- package/dist/bus/command-bus.d.ts +2 -0
- package/dist/bus/command-bus.d.ts.map +1 -1
- package/dist/bus/command-bus.js +36 -1
- package/dist/bus/command-bus.js.map +1 -1
- package/dist/bus/event-dispatcher-registry.d.ts +2 -2
- package/dist/bus/event-dispatcher-registry.js +3 -3
- package/dist/bus/event-dispatcher-registry.js.map +1 -1
- package/dist/context/bounded-context.d.ts +238 -83
- package/dist/context/bounded-context.d.ts.map +1 -1
- package/dist/context/bounded-context.js +1083 -286
- package/dist/context/bounded-context.js.map +1 -1
- package/dist/context/effective-tenant.d.ts +9 -0
- package/dist/context/effective-tenant.d.ts.map +1 -0
- package/dist/context/effective-tenant.js +58 -0
- package/dist/context/effective-tenant.js.map +1 -0
- package/dist/context/entity-inbox.d.ts.map +1 -1
- package/dist/context/entity-inbox.js +24 -17
- package/dist/context/entity-inbox.js.map +1 -1
- package/dist/context/local-inbox-handoff.d.ts +7 -3
- package/dist/context/local-inbox-handoff.d.ts.map +1 -1
- package/dist/context/local-inbox-handoff.js +32 -26
- package/dist/context/local-inbox-handoff.js.map +1 -1
- package/dist/context/projection-handoff.d.ts.map +1 -1
- package/dist/context/projection-handoff.js +36 -31
- package/dist/context/projection-handoff.js.map +1 -1
- package/dist/context/tenant-index.d.ts.map +1 -1
- package/dist/context/tenant-index.js +72 -2
- package/dist/context/tenant-index.js.map +1 -1
- package/dist/delivery/delivery-ports.d.ts +14 -4
- package/dist/delivery/delivery-ports.d.ts.map +1 -1
- package/dist/delivery/delivery.d.ts +19 -21
- package/dist/delivery/delivery.d.ts.map +1 -1
- package/dist/delivery/delivery.js +541 -158
- package/dist/delivery/delivery.js.map +1 -1
- package/dist/delivery/inbox-storage.d.ts +12 -3
- package/dist/delivery/inbox-storage.d.ts.map +1 -1
- package/dist/delivery/inbox-storage.js +160 -67
- package/dist/delivery/inbox-storage.js.map +1 -1
- package/dist/delivery/inbox.d.ts +9 -0
- package/dist/delivery/inbox.d.ts.map +1 -1
- package/dist/delivery/inbox.js +11 -0
- package/dist/delivery/inbox.js.map +1 -1
- package/dist/delivery/sharded-work-registry.d.ts.map +1 -1
- package/dist/delivery/sharded-work-registry.js +2 -1
- package/dist/delivery/sharded-work-registry.js.map +1 -1
- package/dist/entity/entity-metadata.d.ts +14 -5
- package/dist/entity/entity-metadata.d.ts.map +1 -1
- package/dist/entity/entity-metadata.js +38 -2
- package/dist/entity/entity-metadata.js.map +1 -1
- package/dist/entity/entity-storage-descriptor.d.ts +25 -5
- package/dist/entity/entity-storage-descriptor.d.ts.map +1 -1
- package/dist/entity/entity-storage-descriptor.js +69 -23
- package/dist/entity/entity-storage-descriptor.js.map +1 -1
- package/dist/entity/entity-transaction.d.ts +46 -42
- package/dist/entity/entity-transaction.d.ts.map +1 -1
- package/dist/entity/entity-transaction.js +130 -35
- package/dist/entity/entity-transaction.js.map +1 -1
- package/dist/entity/entity.d.ts +243 -98
- package/dist/entity/entity.d.ts.map +1 -1
- package/dist/entity/entity.js +405 -226
- package/dist/entity/entity.js.map +1 -1
- package/dist/entity/spec-scanner.d.ts +13 -1
- package/dist/entity/spec-scanner.d.ts.map +1 -1
- package/dist/entity/spec-scanner.js +20 -3
- package/dist/entity/spec-scanner.js.map +1 -1
- package/dist/handler/command-registration-readiness.d.ts +6 -6
- package/dist/handler/command-registration-readiness.d.ts.map +1 -1
- package/dist/handler/command-registration-readiness.js +4 -2
- package/dist/handler/command-registration-readiness.js.map +1 -1
- package/dist/handler/declared-rejections.d.ts +11 -0
- package/dist/handler/declared-rejections.d.ts.map +1 -0
- package/dist/handler/declared-rejections.js +34 -0
- package/dist/handler/declared-rejections.js.map +1 -0
- package/dist/handler/event-registration-readiness.d.ts +13 -56
- package/dist/handler/event-registration-readiness.d.ts.map +1 -1
- package/dist/handler/event-registration-readiness.js +23 -43
- package/dist/handler/event-registration-readiness.js.map +1 -1
- package/dist/handler/generated-handler-registry.d.ts +72 -33
- package/dist/handler/generated-handler-registry.d.ts.map +1 -1
- package/dist/handler/generated-handler-registry.js +421 -43
- package/dist/handler/generated-handler-registry.js.map +1 -1
- package/dist/handler/generated-registry-discovery.d.ts.map +1 -1
- package/dist/handler/generated-registry-discovery.js +2 -4
- package/dist/handler/generated-registry-discovery.js.map +1 -1
- package/dist/handler/handler-decorators.d.ts +91 -37
- package/dist/handler/handler-decorators.d.ts.map +1 -1
- package/dist/handler/handler-decorators.js +124 -31
- package/dist/handler/handler-decorators.js.map +1 -1
- package/dist/handler/handler-metadata.d.ts +105 -60
- package/dist/handler/handler-metadata.d.ts.map +1 -1
- package/dist/handler/handler-metadata.js +275 -57
- package/dist/handler/handler-metadata.js.map +1 -1
- package/dist/handler/registration-readiness-metadata.d.ts +4 -0
- package/dist/handler/registration-readiness-metadata.d.ts.map +1 -1
- package/dist/handler/registration-readiness-metadata.js +84 -2
- package/dist/handler/registration-readiness-metadata.js.map +1 -1
- package/dist/handler/standalone.d.ts +25 -0
- package/dist/handler/standalone.d.ts.map +1 -0
- package/dist/handler/standalone.js +38 -0
- package/dist/handler/standalone.js.map +1 -0
- package/dist/index.d.ts +9 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/repository/command-routing.d.ts +63 -10
- package/dist/repository/command-routing.d.ts.map +1 -1
- package/dist/repository/command-routing.js +41 -8
- package/dist/repository/command-routing.js.map +1 -1
- package/dist/repository/event-routing.d.ts +64 -9
- package/dist/repository/event-routing.d.ts.map +1 -1
- package/dist/repository/event-routing.js +42 -7
- package/dist/repository/event-routing.js.map +1 -1
- package/dist/repository/primitive-id.d.ts +12 -23
- package/dist/repository/primitive-id.d.ts.map +1 -1
- package/dist/repository/primitive-id.js +2 -27
- package/dist/repository/primitive-id.js.map +1 -1
- package/dist/repository/repository.d.ts +317 -87
- package/dist/repository/repository.d.ts.map +1 -1
- package/dist/repository/repository.js +3746 -856
- package/dist/repository/repository.js.map +1 -1
- package/dist/repository/state-update-routing.d.ts +67 -8
- package/dist/repository/state-update-routing.d.ts.map +1 -1
- package/dist/repository/state-update-routing.js +45 -6
- package/dist/repository/state-update-routing.js.map +1 -1
- package/dist/runtime/runtime.js +1 -1
- package/dist/runtime/runtime.js.map +1 -1
- package/dist/runtime/signal-metadata.d.ts +22 -47
- package/dist/runtime/signal-metadata.d.ts.map +1 -1
- package/dist/runtime/signal-metadata.js +34 -69
- package/dist/runtime/signal-metadata.js.map +1 -1
- package/dist/runtime/signal-publisher.d.ts +144 -0
- package/dist/runtime/signal-publisher.d.ts.map +1 -0
- package/dist/runtime/signal-publisher.js +248 -0
- package/dist/runtime/signal-publisher.js.map +1 -0
- package/dist/runtime/standalone-handler-runtime.d.ts +130 -0
- package/dist/runtime/standalone-handler-runtime.d.ts.map +1 -0
- package/dist/runtime/standalone-handler-runtime.js +382 -0
- package/dist/runtime/standalone-handler-runtime.js.map +1 -0
- package/dist/server/environment-attachment.d.ts.map +1 -1
- package/dist/server/environment-attachment.js +2 -1
- package/dist/server/environment-attachment.js.map +1 -1
- package/dist/server/environment-delivery-worker.d.ts.map +1 -1
- package/dist/server/environment-delivery-worker.js +21 -12
- package/dist/server/environment-delivery-worker.js.map +1 -1
- package/dist/server/managed-server-application.d.ts +4 -1
- package/dist/server/managed-server-application.d.ts.map +1 -1
- package/dist/server/managed-server-application.js +2 -2
- package/dist/server/managed-server-application.js.map +1 -1
- package/dist/server/node-coordinator.js +2 -2
- package/dist/server/node-coordinator.js.map +1 -1
- package/dist/server/server-log.d.ts.map +1 -1
- package/dist/server/server-log.js +4 -0
- package/dist/server/server-log.js.map +1 -1
- package/dist/server/server.d.ts +9 -177
- package/dist/server/server.d.ts.map +1 -1
- package/dist/server/server.js +428 -178
- package/dist/server/server.js.map +1 -1
- package/dist/services/query-reader.d.ts +19 -0
- package/dist/services/query-reader.d.ts.map +1 -0
- package/dist/services/query-reader.js +43 -0
- package/dist/services/query-reader.js.map +1 -0
- package/dist/services/registered-targets.d.ts +73 -0
- package/dist/services/registered-targets.d.ts.map +1 -0
- package/dist/services/registered-targets.js +127 -0
- package/dist/services/registered-targets.js.map +1 -0
- package/dist/services/spine-services.d.ts +26 -12
- package/dist/services/spine-services.d.ts.map +1 -1
- package/dist/services/spine-services.js +1047 -969
- package/dist/services/spine-services.js.map +1 -1
- package/dist/spi/delivery.d.ts +5 -0
- package/dist/spi/delivery.d.ts.map +1 -0
- package/dist/spi/delivery.js +18 -0
- package/dist/spi/delivery.js.map +1 -0
- package/dist/spi/handler-registry.d.ts +8 -0
- package/dist/spi/handler-registry.d.ts.map +1 -0
- package/dist/spi/handler-registry.js +15 -0
- package/dist/spi/handler-registry.js.map +1 -0
- package/dist/stand/stand.d.ts +73 -1
- package/dist/stand/stand.d.ts.map +1 -1
- package/dist/stand/stand.js +221 -48
- package/dist/stand/stand.js.map +1 -1
- package/dist/stand/subscription-observer.d.ts.map +1 -1
- package/dist/stand/subscription-observer.js +5 -12
- package/dist/stand/subscription-observer.js.map +1 -1
- package/dist/stand/subscription-registry.js +1 -1
- package/dist/stand/subscription-registry.js.map +1 -1
- package/dist/testing/index.d.ts +25 -3
- package/dist/testing/index.d.ts.map +1 -1
- package/dist/testing/index.js +23 -3
- package/dist/testing/index.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +33 -23
- package/dist/handler/build-time-handler-analyzer.d.ts +0 -150
- package/dist/handler/build-time-handler-analyzer.d.ts.map +0 -1
- package/dist/handler/build-time-handler-analyzer.js +0 -1101
- package/dist/handler/build-time-handler-analyzer.js.map +0 -1
- package/dist/handler/generated-registry-writer.d.ts +0 -58
- package/dist/handler/generated-registry-writer.d.ts.map +0 -1
- package/dist/handler/generated-registry-writer.js +0 -458
- package/dist/handler/generated-registry-writer.js.map +0 -1
- package/dist/handler/handler-codegen.d.ts +0 -48
- package/dist/handler/handler-codegen.d.ts.map +0 -1
- package/dist/handler/handler-codegen.js +0 -214
- package/dist/handler/handler-codegen.js.map +0 -1
- package/dist/server/browser-server.d.ts +0 -49
- package/dist/server/browser-server.d.ts.map +0 -1
- package/dist/server/browser-server.js.map +0 -1
- package/dist/server/durable-subscription-bindings.d.ts.map +0 -1
- package/dist/server/durable-subscription-bindings.js.map +0 -1
- /package/dist/{server → browser}/durable-subscription-bindings.d.ts +0 -0
- /package/dist/{server → browser}/durable-subscription-bindings.js +0 -0
|
@@ -38,6 +38,7 @@ class ReadinessMetadataOwner {
|
|
|
38
38
|
*
|
|
39
39
|
* @param registeredHandler Registered handler to clone.
|
|
40
40
|
* @returns Frozen fields with cloned metadata.
|
|
41
|
+
* @typeParam Handler Handler metadata type.
|
|
41
42
|
*/
|
|
42
43
|
create(registeredHandler) {
|
|
43
44
|
return this.#fields(this.#cloneRegistered(registeredHandler));
|
|
@@ -47,6 +48,7 @@ class ReadinessMetadataOwner {
|
|
|
47
48
|
*
|
|
48
49
|
* @param registeredHandler Registered handler to retain.
|
|
49
50
|
* @returns Frozen fields sharing the registered metadata.
|
|
51
|
+
* @typeParam Handler Handler metadata type.
|
|
50
52
|
*/
|
|
51
53
|
copy(registeredHandler) {
|
|
52
54
|
return this.#fields(this.#copyRegistered(registeredHandler));
|
|
@@ -56,6 +58,7 @@ class ReadinessMetadataOwner {
|
|
|
56
58
|
*
|
|
57
59
|
* @param map Metadata arrays to copy.
|
|
58
60
|
* @returns A map containing fresh frozen arrays.
|
|
61
|
+
* @typeParam Value Value stored in each metadata array.
|
|
59
62
|
*/
|
|
60
63
|
copyMap(map) {
|
|
61
64
|
const copy = new Map();
|
|
@@ -64,6 +67,13 @@ class ReadinessMetadataOwner {
|
|
|
64
67
|
}
|
|
65
68
|
return copy;
|
|
66
69
|
}
|
|
70
|
+
/**
|
|
71
|
+
* Groups one registration with its Entity and handler metadata for readiness checks.
|
|
72
|
+
*
|
|
73
|
+
* @typeParam Handler Registered handler subtype.
|
|
74
|
+
* @param registeredHandler Registration supplying Entity and handler records.
|
|
75
|
+
* @returns Frozen fields used by readiness cloning or copying.
|
|
76
|
+
*/
|
|
67
77
|
#fields(registeredHandler) {
|
|
68
78
|
return Object.freeze({
|
|
69
79
|
entityHandlers: registeredHandler.entityHandlers,
|
|
@@ -73,6 +83,13 @@ class ReadinessMetadataOwner {
|
|
|
73
83
|
registeredHandler,
|
|
74
84
|
});
|
|
75
85
|
}
|
|
86
|
+
/**
|
|
87
|
+
* Copies registration, Entity, and handler descriptors while reusing shared clones.
|
|
88
|
+
*
|
|
89
|
+
* @typeParam Handler Registered handler subtype.
|
|
90
|
+
* @param registeredHandler Registration whose mutable descriptors are isolated.
|
|
91
|
+
* @returns Frozen registration referring to cloned metadata.
|
|
92
|
+
*/
|
|
76
93
|
#cloneRegistered(registeredHandler) {
|
|
77
94
|
const handlers = new Map();
|
|
78
95
|
const schemas = new WeakMap();
|
|
@@ -87,6 +104,13 @@ class ReadinessMetadataOwner {
|
|
|
87
104
|
handler,
|
|
88
105
|
});
|
|
89
106
|
}
|
|
107
|
+
/**
|
|
108
|
+
* Copies the registration shell without cloning its already immutable metadata.
|
|
109
|
+
*
|
|
110
|
+
* @typeParam Handler Registered handler subtype.
|
|
111
|
+
* @param registeredHandler Registration containing immutable metadata references.
|
|
112
|
+
* @returns Frozen registration with the same nested references.
|
|
113
|
+
*/
|
|
90
114
|
#copyRegistered(registeredHandler) {
|
|
91
115
|
return Object.freeze({
|
|
92
116
|
entityHandlers: registeredHandler.entityHandlers,
|
|
@@ -95,22 +119,49 @@ class ReadinessMetadataOwner {
|
|
|
95
119
|
handler: registeredHandler.handler,
|
|
96
120
|
});
|
|
97
121
|
}
|
|
122
|
+
/**
|
|
123
|
+
* Builds every handler-kind list with shared cloned handler identities.
|
|
124
|
+
*
|
|
125
|
+
* @param entityHandlers Original grouped handler metadata.
|
|
126
|
+
* @param clonedHandlers Cache preserving identity across grouped lists.
|
|
127
|
+
* @param clonedSchemas Cache preserving shared descriptor identity.
|
|
128
|
+
* @param entity Cloned Entity metadata reused by the registration.
|
|
129
|
+
* @returns Frozen grouping with cloned handlers and Entity metadata.
|
|
130
|
+
*/
|
|
98
131
|
#cloneEntityHandlers(entityHandlers, clonedHandlers, clonedSchemas, entity) {
|
|
99
132
|
return Object.freeze({
|
|
100
133
|
entityType: entityHandlers.entityType,
|
|
101
134
|
entity,
|
|
102
135
|
handlers: this.#cloneHandlers(entityHandlers.handlers, clonedHandlers, clonedSchemas),
|
|
103
136
|
commandAssignments: this.#cloneHandlers(entityHandlers.commandAssignments, clonedHandlers, clonedSchemas),
|
|
137
|
+
commandSubstitutions: this.#cloneHandlers(entityHandlers.commandSubstitutions, clonedHandlers, clonedSchemas),
|
|
104
138
|
commandReactions: this.#cloneHandlers(entityHandlers.commandReactions, clonedHandlers, clonedSchemas),
|
|
105
139
|
eventSubscriptions: this.#cloneHandlers(entityHandlers.eventSubscriptions, clonedHandlers, clonedSchemas),
|
|
106
140
|
stateSubscriptions: this.#cloneHandlers(entityHandlers.stateSubscriptions, clonedHandlers, clonedSchemas),
|
|
107
141
|
eventReactions: this.#cloneHandlers(entityHandlers.eventReactions, clonedHandlers, clonedSchemas),
|
|
108
|
-
eventApplications: this.#cloneHandlers(entityHandlers.eventApplications, clonedHandlers, clonedSchemas),
|
|
109
142
|
});
|
|
110
143
|
}
|
|
144
|
+
/**
|
|
145
|
+
* Copies a handler-kind list using the shared registration caches.
|
|
146
|
+
*
|
|
147
|
+
* @typeParam Handler Handler subtype retained in the list.
|
|
148
|
+
* @param handlers Original handler-kind list.
|
|
149
|
+
* @param clonedHandlers Cache for handlers repeated in grouped lists.
|
|
150
|
+
* @param clonedSchemas Cache for descriptors shared by handlers.
|
|
151
|
+
* @returns Frozen list of cloned handler records.
|
|
152
|
+
*/
|
|
111
153
|
#cloneHandlers(handlers, clonedHandlers, clonedSchemas) {
|
|
112
154
|
return Object.freeze(handlers.map((handler) => this.#cloneHandler(handler, clonedHandlers, clonedSchemas)));
|
|
113
155
|
}
|
|
156
|
+
/**
|
|
157
|
+
* Copies one handler once and transfers its generated outcome schemas.
|
|
158
|
+
*
|
|
159
|
+
* @typeParam Handler Handler subtype preserved by the clone.
|
|
160
|
+
* @param handler Original handler registration.
|
|
161
|
+
* @param clonedHandlers Cache preventing duplicate clones of one record.
|
|
162
|
+
* @param clonedSchemas Cache for shared input descriptors.
|
|
163
|
+
* @returns Frozen clone with its outcome schemas copied.
|
|
164
|
+
*/
|
|
114
165
|
#cloneHandler(handler, clonedHandlers, clonedSchemas) {
|
|
115
166
|
const existing = clonedHandlers.get(handler);
|
|
116
167
|
if (existing !== undefined) {
|
|
@@ -122,9 +173,17 @@ class ReadinessMetadataOwner {
|
|
|
122
173
|
descriptor: this.#cloneSchema(handler.descriptor, clonedSchemas),
|
|
123
174
|
});
|
|
124
175
|
clonedHandlers.set(handler, clone);
|
|
125
|
-
HandlerMetadataValues.
|
|
176
|
+
HandlerMetadataValues.copyOutcomes(handler, clone);
|
|
126
177
|
return clone;
|
|
127
178
|
}
|
|
179
|
+
/**
|
|
180
|
+
* Copies Entity descriptors and routing fields while retaining shared identities.
|
|
181
|
+
*
|
|
182
|
+
* @param entity Original Entity schema and field metadata.
|
|
183
|
+
* @param clonedSchemas Cache for repeated schema descriptors.
|
|
184
|
+
* @param clonedFields Cache for fields repeated in routing and column metadata.
|
|
185
|
+
* @returns Frozen Entity metadata with isolated descriptors and fields.
|
|
186
|
+
*/
|
|
128
187
|
#cloneEntity(entity, clonedSchemas, clonedFields) {
|
|
129
188
|
return Object.freeze({
|
|
130
189
|
...entity,
|
|
@@ -139,6 +198,14 @@ class ReadinessMetadataOwner {
|
|
|
139
198
|
setOnceFields: Object.freeze(entity.setOnceFields.map((field) => this.#cloneField(field, clonedFields))),
|
|
140
199
|
});
|
|
141
200
|
}
|
|
201
|
+
/**
|
|
202
|
+
* Copies a schema descriptor once per registration.
|
|
203
|
+
*
|
|
204
|
+
* @typeParam Schema Generated schema descriptor type.
|
|
205
|
+
* @param schema Descriptor to isolate.
|
|
206
|
+
* @param clonedSchemas Cache preserving repeated descriptor identity.
|
|
207
|
+
* @returns Frozen descriptor clone.
|
|
208
|
+
*/
|
|
142
209
|
#cloneSchema(schema, clonedSchemas) {
|
|
143
210
|
const existing = clonedSchemas.get(schema);
|
|
144
211
|
if (existing !== undefined) {
|
|
@@ -148,6 +215,14 @@ class ReadinessMetadataOwner {
|
|
|
148
215
|
clonedSchemas.set(schema, clone);
|
|
149
216
|
return clone;
|
|
150
217
|
}
|
|
218
|
+
/**
|
|
219
|
+
* Copies a field descriptor once per registration.
|
|
220
|
+
*
|
|
221
|
+
* @typeParam Field Field descriptor type.
|
|
222
|
+
* @param field Descriptor to isolate.
|
|
223
|
+
* @param clonedFields Cache preserving fields reused across Entity metadata.
|
|
224
|
+
* @returns Frozen field descriptor clone.
|
|
225
|
+
*/
|
|
151
226
|
#cloneField(field, clonedFields) {
|
|
152
227
|
const existing = clonedFields.get(field);
|
|
153
228
|
if (existing !== undefined) {
|
|
@@ -157,6 +232,13 @@ class ReadinessMetadataOwner {
|
|
|
157
232
|
clonedFields.set(field, clone);
|
|
158
233
|
return clone;
|
|
159
234
|
}
|
|
235
|
+
/**
|
|
236
|
+
* Copies an object's own descriptors without changing its prototype.
|
|
237
|
+
*
|
|
238
|
+
* @typeParam ObjectType Descriptor object type preserved by the clone.
|
|
239
|
+
* @param value Descriptor whose prototype and own properties are copied.
|
|
240
|
+
* @returns Frozen copy retaining the source prototype.
|
|
241
|
+
*/
|
|
160
242
|
#cloneFrozen(value) {
|
|
161
243
|
const clone = Object.create(Reflect.getPrototypeOf(value));
|
|
162
244
|
Object.defineProperties(clone, Object.getOwnPropertyDescriptors(value));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registration-readiness-metadata.js","sourceRoot":"","sources":["../../src/handler/registration-readiness-metadata.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAaH,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"registration-readiness-metadata.js","sourceRoot":"","sources":["../../src/handler/registration-readiness-metadata.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAaH,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAmC9D;;GAEG;AACH,MAAM,sBAAsB;IAC1B,kBAAkB;IAElB;;;;;;OAMG;IACH,gBAAgB,CAAC,IAAY,EAAE,KAAa;QAC1C,IAAI,IAAI,GAAG,KAAK,EAAE,CAAC;YACjB,OAAO,CAAC,CAAC,CAAC;QACZ,CAAC;QACD,IAAI,IAAI,GAAG,KAAK,EAAE,CAAC;YACjB,OAAO,CAAC,CAAC;QACX,CAAC;QACD,OAAO,CAAC,CAAC;IACX,CAAC;IAED;;;;;;OAMG;IACH,MAAM,CACJ,iBAAqD;QAErD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,gBAAgB,CAAC,iBAAiB,CAAC,CAAC,CAAC;IAChE,CAAC;IAED;;;;;;OAMG;IACH,IAAI,CACF,iBAAqD;QAErD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,eAAe,CAAC,iBAAiB,CAAC,CAAC,CAAC;IAC/D,CAAC;IAED;;;;;;OAMG;IACH,OAAO,CACL,GAA0C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CAAC,OAAO,CAAC,cAAc,CAAC,KAAK,CAAC,CAAe,CAAC;QACzE,MAAM,CAAC,gBAAgB,CAAC,KAAK,EAAE,MAAM,CAAC,yBAAyB,CAAC,KAAK,CAAC,CAAC,CAAC;QACxE,OAAO,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAC9B,CAAC;CACF;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAqC,MAAM,CAAC,MAAM,CAC9E,IAAI,sBAAsB,EAAE,CAC7B,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Nominal base class for a decorated standalone Command assignee.
|
|
3
|
+
*/
|
|
4
|
+
export declare abstract class AbstractAssignee {
|
|
5
|
+
private readonly assigneeBrand;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Nominal base class for a decorated standalone Command commander.
|
|
9
|
+
*/
|
|
10
|
+
export declare abstract class AbstractCommander {
|
|
11
|
+
private readonly commanderBrand;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Nominal base class for a decorated standalone Event reactor.
|
|
15
|
+
*/
|
|
16
|
+
export declare abstract class AbstractEventReactor {
|
|
17
|
+
private readonly eventReactorBrand;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Nominal base class for a decorated standalone Event subscriber.
|
|
21
|
+
*/
|
|
22
|
+
export declare abstract class AbstractEventSubscriber {
|
|
23
|
+
private readonly eventSubscriberBrand;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=standalone.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"standalone.d.ts","sourceRoot":"","sources":["../../src/handler/standalone.ts"],"names":[],"mappings":"AAcA;;GAEG;AACH,8BAAsB,gBAAgB;IACpC,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAS;CACxC;AAED;;GAEG;AACH,8BAAsB,iBAAiB;IACrC,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAS;CACzC;AAED;;GAEG;AACH,8BAAsB,oBAAoB;IACxC,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAS;CAC5C;AAED;;GAEG;AACH,8BAAsB,uBAAuB;IAC3C,OAAO,CAAC,QAAQ,CAAC,oBAAoB,CAAS;CAC/C"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2026, CodeMatters. All rights reserved.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
|
|
5
|
+
* in compliance with the License. You may obtain a copy of the License at
|
|
6
|
+
*
|
|
7
|
+
* https://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
*
|
|
9
|
+
* Unless required by applicable law or agreed to in writing, software distributed under the License
|
|
10
|
+
* is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
|
|
11
|
+
* or implied. See the License for the specific language governing permissions and limitations under
|
|
12
|
+
* the License.
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* Nominal base class for a decorated standalone Command assignee.
|
|
16
|
+
*/
|
|
17
|
+
export class AbstractAssignee {
|
|
18
|
+
assigneeBrand;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Nominal base class for a decorated standalone Command commander.
|
|
22
|
+
*/
|
|
23
|
+
export class AbstractCommander {
|
|
24
|
+
commanderBrand;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Nominal base class for a decorated standalone Event reactor.
|
|
28
|
+
*/
|
|
29
|
+
export class AbstractEventReactor {
|
|
30
|
+
eventReactorBrand;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Nominal base class for a decorated standalone Event subscriber.
|
|
34
|
+
*/
|
|
35
|
+
export class AbstractEventSubscriber {
|
|
36
|
+
eventSubscriberBrand;
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=standalone.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"standalone.js","sourceRoot":"","sources":["../../src/handler/standalone.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH;;GAEG;AACH,MAAM,OAAgB,gBAAgB;IACnB,aAAa,CAAS;CACxC;AAED;;GAEG;AACH,MAAM,OAAgB,iBAAiB;IACpB,cAAc,CAAS;CACzC;AAED;;GAEG;AACH,MAAM,OAAgB,oBAAoB;IACvB,iBAAiB,CAAS;CAC5C;AAED;;GAEG;AACH,MAAM,OAAgB,uBAAuB;IAC1B,oBAAoB,CAAS;CAC/C"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
export { BoundedContext, BoundedContextBuilder, type BoundedContextName, BoundedContextNameError, type BoundedContextSnapshot, type CommandEndpoint, ContextSpec, type ContextSpecSnapshot, type ReadCatchUpOptions, type ReadCatchUpResult, type EventEndpoint, type GeneratedRepositoryOptions, type
|
|
1
|
+
export { BoundedContext, BoundedContextBuilder, type BoundedContextName, BoundedContextNameError, type BoundedContextSnapshot, type CommandEndpoint, ContextSpec, type ContextSpecSnapshot, type ReadCatchUpOptions, type ReadCatchUpResult, type EventEndpoint, type GeneratedRepositoryOptions, type TenantMode, } from "./context/bounded-context.js";
|
|
2
2
|
export { ThirdPartyContext } from "./integration/third-party-context.js";
|
|
3
3
|
export { Stand, type StandOptions, type StandReadOptions, type StandReadResult, type StandRegisterOptions, type StandSubscribeOptions, type StandSubscription, StandStateTypeError, type StandUpdate, type StandUpdateOptions, } from "./stand/stand.js";
|
|
4
4
|
export { InMemorySubscriptionRegistry, StorageSubscriptionRegistry, StandConflictError, type StandActivateResult, type StandCleanupResult, type StandCreateResult, type StandDeleteResult, type StandSubscriptionEntry, type StandSubscriptionRegistry, } from "./stand/subscription-registry.js";
|
|
5
5
|
export { SpineServices, type SpineServicesOptions } from "./services/spine-services.js";
|
|
6
|
-
export { Server, type
|
|
6
|
+
export { Server, type ListenerLifecycle, type RunningServer, type ServerOptions, } from "./server/server.js";
|
|
7
7
|
export { ManagedServerApplication, type ManagedServerApplicationHandle, type ManagedServerApplicationOptions, type ManagedServerRestartOptions, } from "./server/managed-server-application.js";
|
|
8
|
-
export { DurableSubscriptionBindings, isDurableSubscriptionBindings, type DurableSubscriptionBindingsOptions, } from "./server/durable-subscription-bindings.js";
|
|
9
8
|
export { Environment, EnvironmentType } from "./server/environment.js";
|
|
10
9
|
export { ServerEnvironment, type ServerEnvironmentCloseable, type ServerEnvironmentDelivery, type ServerEnvironmentSettings, } from "./server/server-environment.js";
|
|
11
10
|
export { CommandBus } from "./bus/command-bus.js";
|
|
@@ -22,25 +21,26 @@ export { Inbox, type DeliveryLabel, type DeliveryStatus, type InboxId, InboxMess
|
|
|
22
21
|
export { InboxStorage, type InboxStorageOptions } from "./delivery/inbox-storage.js";
|
|
23
22
|
export { ShardIndex } from "./delivery/shard-index.js";
|
|
24
23
|
export { ShardedWorkRegistry, ShardSession, type ShardedWorkRegistryOptions, } from "./delivery/sharded-work-registry.js";
|
|
25
|
-
export { Aggregate, Entity, type EntityFamily, type EntityLifecycleFlags, type EntityOptions, type EntityScopeReason,
|
|
24
|
+
export { Aggregate, Entity, type EntityFamily, type EntityLifecycleFlags, type EntityOptions, type EntityScopeReason, ProcessManager, Projection, TransactionalEntity, TransactionalEntityScopeError, type TransactionalEntityScopeOperation, } from "./entity/entity.js";
|
|
26
25
|
export { type DeclaredEntityVisibility, type DescriptorFieldMetadata, DescriptorMetadataError, type DescriptorMetadataErrorCode, type DescriptorMessageSchema, describeEntityMetadata, type EntityKind, type EntityMetadata, type EntityVisibility, type FirstFieldRoutingHint, isEntitySchema, } from "./entity/entity-metadata.js";
|
|
27
26
|
export { SpecScanner } from "./entity/spec-scanner.js";
|
|
28
27
|
export { createEntityTransaction, EntityTransaction, DraftStateError, EntityTransactionStateError, type EntityTransactionAcceptedCommit, type EntityTransactionCommitResult, type CommittedVersionMetadata, type DraftStateReason, type EntityTransactionLifecycleFlags, type EntityTransactionOperation, type EntityTransactionOptions, type EntityTransactionRejectedCommit, type EntityTransactionRollbackResult, type EntityTransactionStatus, type EntityTransactionMutator, type EntityTransactionVersionMetadata, } from "./entity/entity-transaction.js";
|
|
29
28
|
export { type StateTransitionRequest, type StateTransitionResult, validateEntityStateTransition, } from "./entity/entity-transition-validation.js";
|
|
30
|
-
export { type ActorContextInput, type Clock, type CommandContextInput, FixedClock, type EventContextInput,
|
|
29
|
+
export { type ActorContextInput, type Clock, type CommandContextInput, FixedClock, type EventContextInput, SignalMetadata, type SignalMetadataOptions, SystemClock, } from "./runtime/signal-metadata.js";
|
|
31
30
|
export { type ServerRuntimeLifecycle, type ServerRuntimeRejectedState, type ServerRuntimeState, ServerRuntimeStateError, type ServerRuntimeStateOperation, type ServerRuntimeWork, type RuntimeStateErrorCode, SingleProcessServerRuntime, } from "./runtime/runtime.js";
|
|
32
31
|
export { acceptSignalIntake, failSignalIntake, type SignalIntakeAccepted, type SignalIntakeAcceptedFor, type SignalIntakeFailure, type SignalIntakeFailureCode, type SignalIntakeFailureDetails, type SignalIntakeFailureDiagnostics, type SignalIntakeResult, type SignalKind, } from "./runtime/signal-intake.js";
|
|
33
32
|
export { CommandRegistrationReadiness, type CommandRegistrationAssigneeMetadata, type CommandRegistrationReadinessLookup, } from "./handler/command-registration-readiness.js";
|
|
34
|
-
export { EventRegistrationReadiness, type
|
|
33
|
+
export { EventRegistrationReadiness, type EventRegistrationReadinessLookup, type EventRegistrationReactorMetadata, type EventRegistrationSubscriberMetadata, } from "./handler/event-registration-readiness.js";
|
|
35
34
|
export { type MessageId, type PrimitiveId } from "./repository/primitive-id.js";
|
|
36
35
|
export { CommandRouting, type CommandRoute } from "./repository/command-routing.js";
|
|
37
36
|
export type { InterfaceRouteMessage } from "./repository/routing-declarations.js";
|
|
38
37
|
export { EventRouting, type EventRoute } from "./repository/event-routing.js";
|
|
39
38
|
export { StateUpdateRouting, type StateUpdateRoute } from "./repository/state-update-routing.js";
|
|
40
|
-
export { type ConcreteRepositoryEntityType, Repository, type RepositoryCommandRoute, type RepositoryEntityType, type RepositoryEventRoute, RepositoryIdentityError, type RepositoryIdentityErrorCode, type RepositoryIdentitySnapshot, type RepositoryOptions, type RepositoryRouteInvocation, type RepositoryStateSchema, type RepositoryView, } from "./repository/repository.js";
|
|
41
|
-
export {
|
|
39
|
+
export { type ConcreteRepositoryEntityType, Repository, type RepositoryCommandRoute, type RepositoryEntityType, type RepositoryEventRoute, RepositoryIdentityError, type RepositoryIdentityErrorCode, type RepositoryIdentitySnapshot, type RepositoryOptions, type RepositoryReadQueries, type RepositoryRouteInvocation, type RepositoryStateSchema, type RepositoryView, } from "./repository/repository.js";
|
|
40
|
+
export { Assign, Command, type HandlerMethodDecorator, type HandlerMethodValue, React, Subscribe, Throws, Where, type RejectionDeclaration, type WhereOptions, materializeDecoratedEntityHandlers, } from "./handler/handler-decorators.js";
|
|
42
41
|
export type { External } from "./handler/external.js";
|
|
42
|
+
export { AbstractAssignee, AbstractCommander, AbstractEventReactor, AbstractEventSubscriber, } from "./handler/standalone.js";
|
|
43
43
|
export { GeneratedRegistryDiscovery, GeneratedRegistryDiscoveryError, type GeneratedRegistryDiscoveryOptions, type RegistryDiscoveryErrorCode, } from "./handler/generated-registry-discovery.js";
|
|
44
44
|
export { HandlerRegistryIngestionError, HandlerRegistryIngestor, type RegistryIngestionErrorCode, } from "./handler/generated-handler-registry.js";
|
|
45
|
-
export { type BaseHandlerMetadata, type CommandAssignmentHandlerMetadata, type
|
|
45
|
+
export { type BaseHandlerMetadata, type CommandAssignmentHandlerMetadata, type CommandSubstitutionHandlerMetadata, type CommandReactionHandlerMetadata, type EntityClass, type EntityHandlersMetadata, type EventReactionHandlerMetadata, type EventSubscriptionHandlerMetadata, type StateSubscriptionHandlerMetadata, type HandlerKind, type HandlerOrigin, type HandlerMetadata, EntityHandlers, HandlerMetadataError, type HandlerMetadataErrorCode, HandlerMetadataRegistry, HandlerMetadataRegistryError, type HandlerRegistryErrorCode, type HandlerMetadataRegistryLookup, type HandlerMethodName, type HandlerParameterCount, type HandlerRegistrationBuilder, type RegisteredHandlerMetadata, } from "./handler/handler-metadata.js";
|
|
46
46
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAcA,OAAO,EACL,cAAc,EACd,qBAAqB,EACrB,KAAK,kBAAkB,EACvB,uBAAuB,EACvB,KAAK,sBAAsB,EAC3B,KAAK,eAAe,EACpB,WAAW,EACX,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,aAAa,EAClB,KAAK,0BAA0B,EAC/B,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAcA,OAAO,EACL,cAAc,EACd,qBAAqB,EACrB,KAAK,kBAAkB,EACvB,uBAAuB,EACvB,KAAK,sBAAsB,EAC3B,KAAK,eAAe,EACpB,WAAW,EACX,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,aAAa,EAClB,KAAK,0BAA0B,EAC/B,KAAK,UAAU,GAChB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AAEzE,OAAO,EACL,KAAK,EACL,KAAK,YAAY,EACjB,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,oBAAoB,EACzB,KAAK,qBAAqB,EAC1B,KAAK,iBAAiB,EACtB,mBAAmB,EACnB,KAAK,WAAW,EAChB,KAAK,kBAAkB,GACxB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,4BAA4B,EAC5B,2BAA2B,EAC3B,kBAAkB,EAClB,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACvB,KAAK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B,EACnC,KAAK,WAAW,EAChB,KAAK,sBAAsB,EAC3B,KAAK,4BAA4B,EACjC,KAAK,gCAAgC,EACrC,KAAK,gCAAgC,EACrC,KAAK,WAAW,EAChB,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,cAAc,EACd,oBAAoB,EACpB,KAAK,wBAAwB,EAC7B,uBAAuB,EACvB,4BAA4B,EAC5B,KAAK,wBAAwB,EAC7B,KAAK,6BAA6B,EAClC,KAAK,iBAAiB,EACtB,KAAK,qBAAqB,EAC1B,KAAK,0BAA0B,EAC/B,KAAK,yBAAyB,GAC/B,MAAM,+BAA+B,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -18,7 +18,6 @@ export { InMemorySubscriptionRegistry, StorageSubscriptionRegistry, StandConflic
|
|
|
18
18
|
export { SpineServices } from "./services/spine-services.js";
|
|
19
19
|
export { Server, } from "./server/server.js";
|
|
20
20
|
export { ManagedServerApplication, } from "./server/managed-server-application.js";
|
|
21
|
-
export { DurableSubscriptionBindings, isDurableSubscriptionBindings, } from "./server/durable-subscription-bindings.js";
|
|
22
21
|
export { Environment, EnvironmentType } from "./server/environment.js";
|
|
23
22
|
export { ServerEnvironment, } from "./server/server-environment.js";
|
|
24
23
|
export { CommandBus } from "./bus/command-bus.js";
|
|
@@ -37,7 +36,7 @@ export { DescriptorMetadataError, describeEntityMetadata, isEntitySchema, } from
|
|
|
37
36
|
export { SpecScanner } from "./entity/spec-scanner.js";
|
|
38
37
|
export { createEntityTransaction, EntityTransaction, DraftStateError, EntityTransactionStateError, } from "./entity/entity-transaction.js";
|
|
39
38
|
export { validateEntityStateTransition, } from "./entity/entity-transition-validation.js";
|
|
40
|
-
export { FixedClock,
|
|
39
|
+
export { FixedClock, SignalMetadata, SystemClock, } from "./runtime/signal-metadata.js";
|
|
41
40
|
export { ServerRuntimeStateError, SingleProcessServerRuntime, } from "./runtime/runtime.js";
|
|
42
41
|
export { acceptSignalIntake, failSignalIntake, } from "./runtime/signal-intake.js";
|
|
43
42
|
export { CommandRegistrationReadiness, } from "./handler/command-registration-readiness.js";
|
|
@@ -47,7 +46,8 @@ export { CommandRouting } from "./repository/command-routing.js";
|
|
|
47
46
|
export { EventRouting } from "./repository/event-routing.js";
|
|
48
47
|
export { StateUpdateRouting } from "./repository/state-update-routing.js";
|
|
49
48
|
export { Repository, RepositoryIdentityError, } from "./repository/repository.js";
|
|
50
|
-
export {
|
|
49
|
+
export { Assign, Command, React, Subscribe, Throws, Where, materializeDecoratedEntityHandlers, } from "./handler/handler-decorators.js";
|
|
50
|
+
export { AbstractAssignee, AbstractCommander, AbstractEventReactor, AbstractEventSubscriber, } from "./handler/standalone.js";
|
|
51
51
|
export { GeneratedRegistryDiscovery, GeneratedRegistryDiscoveryError, } from "./handler/generated-registry-discovery.js";
|
|
52
52
|
export { HandlerRegistryIngestionError, HandlerRegistryIngestor, } from "./handler/generated-handler-registry.js";
|
|
53
53
|
export { EntityHandlers, HandlerMetadataError, HandlerMetadataRegistry, HandlerMetadataRegistryError, } from "./handler/handler-metadata.js";
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EACL,cAAc,EACd,qBAAqB,EAErB,uBAAuB,EAGvB,WAAW,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EACL,cAAc,EACd,qBAAqB,EAErB,uBAAuB,EAGvB,WAAW,GAOZ,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AAEzE,OAAO,EACL,KAAK,EAOL,mBAAmB,GAGpB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,4BAA4B,EAC5B,2BAA2B,EAC3B,kBAAkB,GAOnB,MAAM,kCAAkC,CA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-event-engine/core";
|
|
3
3
|
import type { CommandContext } from "@spine-event-engine/proto";
|
|
4
|
+
import type { RepositoryEntityType, RepositoryReadQueries, RepositoryEntityId } from "./repository.js";
|
|
4
5
|
import { type InterfaceRouteSchemas, type InterfaceRouteMessage, type RoutingDeclarationSnapshot, type RoutingDeclarationState } from "./routing-declarations.js";
|
|
5
6
|
/**
|
|
6
7
|
* Calculates one Entity ID for a Command message.
|
|
7
8
|
*
|
|
8
|
-
* @typeParam Id Entity ID type
|
|
9
|
+
* @typeParam Id Entity ID type used by the receiving repository.
|
|
9
10
|
* @typeParam Schema Generated Command message schema.
|
|
11
|
+
* @typeParam EntityType Registered application Entity class for repository reads.
|
|
10
12
|
* @param message Unpacked Command message.
|
|
11
13
|
* @param context Normalized Command context. When the signal omits its context,
|
|
12
14
|
* the framework supplies the default generated `CommandContext` value.
|
|
15
|
+
* @param repository Invocation-scoped read-only access to the receiving repository.
|
|
13
16
|
* The route must be deterministic and side-effect-free. The framework invokes
|
|
14
17
|
* it once for each accepted admission, and durable replay uses the stored
|
|
15
18
|
* target instead of invoking it again.
|
|
16
19
|
*
|
|
17
20
|
* @returns Target Entity ID.
|
|
18
21
|
*/
|
|
19
|
-
export type CommandRoute<Id, Schema extends MessageSchema = MessageSchema> = (message: MessageShape<Schema>, context: CommandContext) => Id
|
|
22
|
+
export type CommandRoute<Id, Schema extends MessageSchema = MessageSchema, EntityType extends RepositoryEntityType = RepositoryEntityType> = (message: MessageShape<Schema>, context: CommandContext, repository: RepositoryReadQueries<EntityType>) => Id | Promise<Id>;
|
|
23
|
+
/**
|
|
24
|
+
* Stores mutable Command declarations before repository construction.
|
|
25
|
+
*
|
|
26
|
+
* @typeParam Id Target Entity ID type.
|
|
27
|
+
*/
|
|
20
28
|
type CommandRoutingState<Id> = RoutingDeclarationState<CommandRoute<Id>>;
|
|
21
29
|
/**
|
|
22
30
|
* Mutable Command route declarations that repositories snapshot at construction.
|
|
23
31
|
*
|
|
24
|
-
* @typeParam Id Entity ID type
|
|
32
|
+
* @typeParam Id Entity ID type used by the receiving repository.
|
|
33
|
+
* @typeParam EntityType Registered application Entity class for repository reads.
|
|
25
34
|
*/
|
|
26
|
-
export declare class CommandRouting<Id> {
|
|
35
|
+
export declare class CommandRouting<Id, EntityType extends RepositoryEntityType = RepositoryEntityType> {
|
|
36
|
+
/**
|
|
37
|
+
* Records the selected Entity class in emitted declarations so a different
|
|
38
|
+
* repository class fails type checking. This adds no runtime field.
|
|
39
|
+
*
|
|
40
|
+
* @param entity Entity class type checked at assignment.
|
|
41
|
+
* @returns The same Entity class type for the assignment check.
|
|
42
|
+
*/
|
|
43
|
+
protected readonly entityClassType: (entity: EntityType) => EntityType;
|
|
27
44
|
/**
|
|
28
45
|
* Creates empty mutable Command route declarations.
|
|
46
|
+
*
|
|
47
|
+
* @param entityType Application Entity constructor, when class-aware.
|
|
29
48
|
*/
|
|
30
49
|
private constructor();
|
|
31
50
|
/**
|
|
32
51
|
* Creates empty Command route declarations.
|
|
33
52
|
*
|
|
34
|
-
* @typeParam
|
|
53
|
+
* @typeParam EntityType Registered application Entity class inferred from the supplied constructor.
|
|
54
|
+
* @param entityType Application Entity constructor for typed repository reads.
|
|
35
55
|
* @returns Mutable Command route declarations.
|
|
36
56
|
*/
|
|
57
|
+
static create<EntityType extends RepositoryEntityType>(entityType: EntityType): CommandRouting<RepositoryEntityId<EntityType>, EntityType>;
|
|
58
|
+
/**
|
|
59
|
+
* Creates ID-only Command route declarations.
|
|
60
|
+
*
|
|
61
|
+
* @typeParam Id Target Entity ID type.
|
|
62
|
+
* @returns Mutable route declarations.
|
|
63
|
+
*/
|
|
37
64
|
static create<Id>(): CommandRouting<Id>;
|
|
38
65
|
/**
|
|
39
66
|
* Registers a route for one exact generated Command schema.
|
|
40
67
|
*
|
|
68
|
+
* @typeParam Schema Generated Command schema.
|
|
41
69
|
* @param schemaOrToken Generated Command schema.
|
|
42
70
|
* @param via Route that calculates the target Entity ID.
|
|
43
71
|
* @returns These mutable route declarations.
|
|
44
72
|
*/
|
|
45
|
-
route<Schema extends MessageSchema>(schemaOrToken: Schema, via: CommandRoute<Id, Schema>): this;
|
|
73
|
+
route<Schema extends MessageSchema>(schemaOrToken: Schema, via: CommandRoute<Id, Schema, EntityType>): this;
|
|
46
74
|
/**
|
|
47
75
|
* Registers a route for a nominal Command message-interface token.
|
|
48
76
|
*
|
|
77
|
+
* @typeParam TInterface Declared Command interface.
|
|
78
|
+
* @typeParam Schemas Schemas implementing the interface.
|
|
49
79
|
* @param schemaOrToken Generated Command message-interface token.
|
|
50
80
|
* @param via Route that calculates the target Entity ID.
|
|
51
81
|
* @returns These mutable route declarations.
|
|
52
82
|
*/
|
|
53
|
-
route<TInterface extends object, Schemas extends InterfaceRouteSchemas>(schemaOrToken: MessageInterface<TInterface, Schemas>, via: (message: InterfaceRouteMessage<TInterface, Schemas>, context: CommandContext) => Id): this;
|
|
83
|
+
route<TInterface extends object, Schemas extends InterfaceRouteSchemas>(schemaOrToken: MessageInterface<TInterface, Schemas>, via: (message: InterfaceRouteMessage<TInterface, Schemas>, context: CommandContext, repository: RepositoryReadQueries<EntityType>) => Id | Promise<Id>): this;
|
|
54
84
|
/**
|
|
55
85
|
* Replaces the declaration-first default Command route.
|
|
56
86
|
*
|
|
57
87
|
* @param via Route that calculates the target Entity ID.
|
|
58
88
|
* @returns These mutable route declarations.
|
|
59
89
|
*/
|
|
60
|
-
replaceDefault(via: CommandRoute<Id>): this;
|
|
90
|
+
replaceDefault(via: CommandRoute<Id, MessageSchema, EntityType>): this;
|
|
61
91
|
}
|
|
62
92
|
/**
|
|
63
93
|
* Internal access to Command-routing declaration state.
|
|
@@ -65,8 +95,31 @@ export declare class CommandRouting<Id> {
|
|
|
65
95
|
* @internal
|
|
66
96
|
*/
|
|
67
97
|
export declare const CommandRoutingInternals: Readonly<{
|
|
68
|
-
|
|
69
|
-
|
|
98
|
+
/**
|
|
99
|
+
* Returns the Entity constructor selected for class-aware declarations, if any.
|
|
100
|
+
*
|
|
101
|
+
* @param routing Route declarations, when configured.
|
|
102
|
+
* @returns Selected Entity constructor, if any.
|
|
103
|
+
*/
|
|
104
|
+
entityType(routing: object | undefined): RepositoryEntityType | undefined;
|
|
105
|
+
/**
|
|
106
|
+
* Finds mutable Command declaration state.
|
|
107
|
+
*
|
|
108
|
+
* @typeParam Id Target Entity ID type.
|
|
109
|
+
* @typeParam EntityType Selected application Entity class.
|
|
110
|
+
* @param routing Route declarations.
|
|
111
|
+
* @returns Mutable declaration state.
|
|
112
|
+
*/
|
|
113
|
+
state<Id, EntityType extends RepositoryEntityType>(routing: CommandRouting<Id, EntityType>): CommandRoutingState<Id>;
|
|
114
|
+
/**
|
|
115
|
+
* Copies declarations for repository construction.
|
|
116
|
+
*
|
|
117
|
+
* @typeParam Id Target Entity ID type.
|
|
118
|
+
* @typeParam EntityType Selected application Entity class.
|
|
119
|
+
* @param routing Route declarations, when configured.
|
|
120
|
+
* @returns Immutable declaration snapshot.
|
|
121
|
+
*/
|
|
122
|
+
snapshot<Id, EntityType extends RepositoryEntityType>(routing: CommandRouting<Id, EntityType> | CommandRouting<Id> | undefined): RoutingDeclarationSnapshot<CommandRoute<Id>>;
|
|
70
123
|
}>;
|
|
71
124
|
export {};
|
|
72
125
|
//# sourceMappingURL=command-routing.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command-routing.d.ts","sourceRoot":"","sources":["../../src/repository/command-routing.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,KAAK,gBAAgB,EAAE,KAAK,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACrF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,EAEL,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,EAC1B,KAAK,0BAA0B,EAC/B,KAAK,uBAAuB,EAC7B,MAAM,2BAA2B,CAAC;AAEnC
|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AC,EAAE,CAAC,CAAC,CAAC;CACjD,CAyCC,CAAC"}
|
|
@@ -14,27 +14,35 @@
|
|
|
14
14
|
import {} from "@spine-event-engine/core";
|
|
15
15
|
import { RoutingDeclarations, } from "./routing-declarations.js";
|
|
16
16
|
const routingStates = new WeakMap();
|
|
17
|
+
const routingEntityTypes = new WeakMap();
|
|
17
18
|
/**
|
|
18
19
|
* Mutable Command route declarations that repositories snapshot at construction.
|
|
19
20
|
*
|
|
20
|
-
* @typeParam Id Entity ID type
|
|
21
|
+
* @typeParam Id Entity ID type used by the receiving repository.
|
|
22
|
+
* @typeParam EntityType Registered application Entity class for repository reads.
|
|
21
23
|
*/
|
|
22
24
|
export class CommandRouting {
|
|
23
25
|
// prettier-ignore
|
|
24
26
|
/**
|
|
25
27
|
* Creates empty mutable Command route declarations.
|
|
28
|
+
*
|
|
29
|
+
* @param entityType Application Entity constructor, when class-aware.
|
|
26
30
|
*/
|
|
27
|
-
constructor() {
|
|
31
|
+
constructor(entityType) {
|
|
28
32
|
routingStates.set(this, RoutingDeclarations.create());
|
|
33
|
+
if (entityType !== undefined)
|
|
34
|
+
routingEntityTypes.set(this, entityType);
|
|
29
35
|
}
|
|
30
36
|
/**
|
|
31
|
-
* Creates
|
|
37
|
+
* Creates mutable Command route declarations for either factory overload.
|
|
32
38
|
*
|
|
33
|
-
* @typeParam Id Entity ID type
|
|
34
|
-
* @
|
|
39
|
+
* @typeParam Id Target Entity ID type.
|
|
40
|
+
* @typeParam EntityType Selected application Entity class.
|
|
41
|
+
* @param entityType Application Entity constructor, when class-aware.
|
|
42
|
+
* @returns Mutable route declarations.
|
|
35
43
|
*/
|
|
36
|
-
static create() {
|
|
37
|
-
return new CommandRouting();
|
|
44
|
+
static create(entityType) {
|
|
45
|
+
return new CommandRouting(entityType);
|
|
38
46
|
}
|
|
39
47
|
/**
|
|
40
48
|
* Registers an exact generated Command-schema route or a nominal message-interface route.
|
|
@@ -85,14 +93,39 @@ export class CommandRouting {
|
|
|
85
93
|
* @internal
|
|
86
94
|
*/
|
|
87
95
|
export const CommandRoutingInternals = Object.freeze({
|
|
96
|
+
/**
|
|
97
|
+
* Returns the Entity constructor selected for class-aware declarations, if any.
|
|
98
|
+
*
|
|
99
|
+
* @param routing Route declarations, when configured.
|
|
100
|
+
* @returns Selected Entity constructor, if any.
|
|
101
|
+
*/
|
|
102
|
+
entityType(routing) {
|
|
103
|
+
return routing === undefined ? undefined : routingEntityTypes.get(routing);
|
|
104
|
+
},
|
|
105
|
+
/**
|
|
106
|
+
* Finds mutable Command declaration state.
|
|
107
|
+
*
|
|
108
|
+
* @typeParam Id Target Entity ID type.
|
|
109
|
+
* @typeParam EntityType Selected application Entity class.
|
|
110
|
+
* @param routing Route declarations.
|
|
111
|
+
* @returns Mutable declaration state.
|
|
112
|
+
*/
|
|
88
113
|
state(routing) {
|
|
89
114
|
return routingStates.get(routing);
|
|
90
115
|
},
|
|
116
|
+
/**
|
|
117
|
+
* Copies declarations for repository construction.
|
|
118
|
+
*
|
|
119
|
+
* @typeParam Id Target Entity ID type.
|
|
120
|
+
* @typeParam EntityType Selected application Entity class.
|
|
121
|
+
* @param routing Route declarations, when configured.
|
|
122
|
+
* @returns Immutable declaration snapshot.
|
|
123
|
+
*/
|
|
91
124
|
snapshot(routing) {
|
|
92
125
|
if (routing === undefined) {
|
|
93
126
|
return RoutingDeclarations.snapshot(RoutingDeclarations.create());
|
|
94
127
|
}
|
|
95
|
-
return RoutingDeclarations.snapshot(
|
|
128
|
+
return RoutingDeclarations.snapshot(routingStates.get(routing));
|
|
96
129
|
},
|
|
97
130
|
});
|
|
98
131
|
//# sourceMappingURL=command-routing.js.map
|