@shirudo/ddd-kit 3.0.0-rc.14 → 3.0.0-rc.15
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/dist/chunks/read-stream-pages.js.map +1 -1
- package/dist/chunks/snapshot-store.d.ts +6 -5
- package/dist/chunks/value-object.js +1 -1
- package/dist/chunks/value-object.js.map +1 -1
- package/dist/http.d.ts +1 -1
- package/dist/http.js +1 -1
- package/dist/http.js.map +1 -1
- package/dist/index.d.ts +33 -53
- package/dist/index.js +6 -5
- package/dist/index.js.map +1 -1
- package/dist/testing.d.ts +5 -5
- package/dist/testing.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,33 +1,18 @@
|
|
|
1
1
|
import { $ as PendingEventLimitExceededErrorOptions, A as IdempotencyInFlightErrorOptions, B as InvalidEventStreamPageErrorOptions, C as FoldReturnedNoStateError, Ct as UnreplayableAggregateError, D as IdempotencyClaimLostErrorOptions, Dt as isWiringErrorLike, E as IdempotencyClaimLostError, Et as isInfrastructureErrorLike, F as InMemoryCapacityExceededError, G as KitWiringError, H as InvalidVersionError, I as InMemoryCapacityExceededErrorOptions, J as MissingFoldError, K as MisattributedEventError, L as InfrastructureError, M as IdempotencyKeyReuseErrorOptions, N as IdempotencyReconciliationRequiredError, O as IdempotencyCompletionWithoutClaimError, P as IdempotencyReconciliationRequiredErrorOptions, Q as PendingEventLimitExceededError, R as InvalidCommandMessageError, S as EventStreamPageReason, St as UnregisteredHandlerErrorOptions, T as HandBuiltEventError, Tt as isDomainErrorLike, U as KitErrorCode, V as InvalidIntegrationMessageError, W as KitErrorOptions, X as PendingEventBatchMismatchError, Y as MissingHandlerError, Z as PendingEventBatchMismatchErrorOptions, _ as DuplicateHandlerRegistrationError, _t as UnmanagedInstanceError, a as AggregateNotFoundErrorOptions, at as ReentrantEventRecordingError, b as ErrorMapperFailedErrorOptions, bt as UnregisteredChangesErrorOptions, c as ConcurrencyConflictErrorOptions, ct as ReplayRejectedErrorOptions, d as DirectStateMutationErrorOptions, dt as ReplayTargetMismatchReason, et as ProjectionGapError, f as DomainError, ft as SnapshotCorruptedError, g as DuplicateEventIdErrorOptions, gt as SnapshotVersionNotRestoredErrorOptions, h as DuplicateEventIdError, ht as SnapshotVersionNotRestoredError, i as AggregateNotFoundError, it as PrototypePollutionError, j as IdempotencyKeyReuseError, k as IdempotencyInFlightError, l as ConcurrencyConflictReason, lt as ReplayTargetMismatchError, m as DuplicateAggregateErrorOptions, mt as SnapshotSchemaMismatchErrorOptions, n as AggregateDeletedErrorOptions, nt as ProjectionOrderViolationError, o as CapabilityRegistryConflictError, ot as ReentrantEventRecordingErrorOptions, p as DuplicateAggregateError, pt as SnapshotSchemaMismatchError, q as MissingEntityIdError, r as AggregateIdentityMismatchOptions, rt as ProjectionReceiptViolationError, s as ConcurrencyConflictError, st as ReplayRejectedError, t as AggregateDeletedError, tt as ProjectionIdentityViolationError, u as DirectStateMutationError, ut as ReplayTargetMismatchErrorOptions, v as DuplicateHandlerRegistrationErrorOptions, vt as UnprojectableEventError, w as ForeignEventError, wt as UnreplayableAggregateErrorOptions, x as EventCollectionError, xt as UnregisteredHandlerError, y as ErrorMapperFailedError, yt as UnregisteredChangesError, z as InvalidEventStreamPageError } from "./chunks/kit-errors.js";
|
|
2
|
-
import { $ as PublishOptions, $t as JsonPrimitive, A as IdempotentCommitRequest, At as
|
|
2
|
+
import { $ as PublishOptions, $t as JsonPrimitive, A as IdempotentCommitRequest, At as CreateEventOptions, B as CommitRegistrationOptions, Bt as UnstampedDomainEventOf, C as IdempotencyClaim, Ct as CommittedDomainEvent, D as IdempotencyReconciliation, Dt as AnyUnstampedDomainEvent, E as IdempotencyOperationErrorContext, Et as AnyDomainEvent, F as DeadLetterDeadline, Ft as DomainEventStamp, G as DomainEventStampProvider, Gt as defaultDomainEventFactory, H as WithCommitWorkResult, Ht as createDomainEvent, I as DeadlineStore, It as EventIdFactory, J as TransactionScope, Jt as AggregateIdentity, K as SharedDomainEventStampOptions, Kt as mergeMetadata, L as DueDeadline, Lt as EventMetadata, M as IdempotentExecution, Mt as DomainEvent, N as WithIdempotentCommitDeps, Nt as DomainEventFactory, O as IdempotencyReconciliationDecision, Ot as CreateDomainEventOptions, P as withIdempotentCommit, Pt as DomainEventFactoryOptions, Q as OnceOptions, Qt as JsonObject, R as AggregateCommitToken, Rt as PendingDomainEvent, S as isPositionAfter, St as CommitPosition, T as IdempotencyLease, Tt as EventCommitCandidatePosition, U as withCommit, Ut as createDomainEventFactory, V as WithCommitDeps, Vt as copyMetadata, W as DomainEventStampFactory, Wt as createStampedDomainEvent, X as EventBus, Xt as CommandHandler, Y as TransactionalOptions, Yt as Command, Z as EventHandler, Zt as PublishedCommand, _ as IdentityMap, _t as DispatchTrackingOutbox, a as EventStoreAppendOptions, at as toVersion, b as ProjectionCheckpointStore, bt as OutboxWriter, c as StreamReadResult, ct as CommandCommitOriginCandidate, d as RepositoryTracking, dt as CommandOutboxCommitCandidate, en as JsonValue, et as Aggregate, f as UnitOfWorkIdentityMap, ft as CommandOutboxMapper, g as AggregateClass, gt as DeadLetterRecord, h as PersistenceModel, ht as routeEventsToCommandOutbox, i as EventStore, it as sameVersion, j as IdempotentCommitResult, jt as CreateStampedDomainEventOptions, k as IdempotencyStore, kt as CreateDomainEventStampOptions, l as AggregatePersistenceWrite, lt as CommandMessageContent, m as PersistenceLifecycle, mt as DurableCommandMessage, n as ReplayableStreamPages, nt as ReplayableAggregate, o as EventStreamReader, ot as Id, p as PersistenceChanges, pt as CommandOutboxWriter, q as stampPendingEvents, qt as ClockFactory, r as reconstituteAggregateFromStreamPages, rt as Version, s as ReadStreamOptions, st as IdGenerator, t as SnapshotStore, tt as AggregateSnapshot, u as AggregateWriteIntent, ut as CommandMessageRelationships, v as Projection, vt as Outbox, w as IdempotencyClaimHandle, wt as EventCommitCandidate, x as ProjectionPosition, xt as ExecutionContext, y as ProjectionCheckpoint, yt as OutboxRecord, z as CommitRegistration, zt as UnstampedDomainEvent } from "./chunks/snapshot-store.js";
|
|
3
3
|
import { Result } from "@shirudo/result";
|
|
4
4
|
import { ValidationError } from "@shirudo/base-error";
|
|
5
5
|
//#region src/application/cqrs/internal/bus-internals.d.ts
|
|
6
6
|
/**
|
|
7
7
|
* Keeps manual result typing available only for the deliberately untyped
|
|
8
8
|
* default map. Concrete maps, typed or refined index maps, and `any` keep their
|
|
9
|
-
* mapped result contract authoritative.
|
|
9
|
+
* mapped result contract authoritative. Under the `object` bound, only `any`
|
|
10
|
+
* satisfies `unknown extends TMap`; the usual `0 extends 1 & TMap` probe
|
|
11
|
+
* reduces to `never` there and misses `any`.
|
|
10
12
|
*/
|
|
11
|
-
type UntypedMapDispatch<TMap extends
|
|
13
|
+
type UntypedMapDispatch<TMap extends object, TMessage> = unknown extends TMap ? never : string extends keyof TMap ? Record<string, unknown> extends TMap ? TMessage : never : never;
|
|
12
14
|
//#endregion
|
|
13
15
|
//#region src/application/cqrs/command/command-bus.d.ts
|
|
14
|
-
/**
|
|
15
|
-
* Type map for command types to their return types.
|
|
16
|
-
* Used to improve type inference in CommandBus.
|
|
17
|
-
*
|
|
18
|
-
* @example
|
|
19
|
-
* ```typescript
|
|
20
|
-
* type MyCommandMap = {
|
|
21
|
-
* CreateOrder: OrderId;
|
|
22
|
-
* CancelOrder: void;
|
|
23
|
-
* };
|
|
24
|
-
*
|
|
25
|
-
* const bus = new CommandBus<MyCommandMap>();
|
|
26
|
-
* const result = await bus.execute({ type: "CreateOrder", ... });
|
|
27
|
-
* // result: Result<OrderId, string> ← automatically inferred
|
|
28
|
-
* ```
|
|
29
|
-
*/
|
|
30
|
-
type CommandTypeMap = Record<string, unknown>;
|
|
31
16
|
/**
|
|
32
17
|
* Construction options for {@link CommandBus}.
|
|
33
18
|
*
|
|
@@ -71,7 +56,7 @@ interface CommandBusOptions<E = string> {
|
|
|
71
56
|
* // result: Result<unknown, string>
|
|
72
57
|
* ```
|
|
73
58
|
*/
|
|
74
|
-
interface ICommandBus<TMap extends
|
|
59
|
+
interface ICommandBus<TMap extends object = Record<string, unknown>, E = string> {
|
|
75
60
|
/**
|
|
76
61
|
* Executes a command by dispatching it to the registered handler.
|
|
77
62
|
* When a type map is provided, the return type is inferred from the command type.
|
|
@@ -143,7 +128,7 @@ interface ICommandBus<TMap extends CommandTypeMap = CommandTypeMap, E = string>
|
|
|
143
128
|
* const result = await bus.execute({ type: "CreateOrder", ... });
|
|
144
129
|
* ```
|
|
145
130
|
*/
|
|
146
|
-
declare class CommandBus<TMap extends
|
|
131
|
+
declare class CommandBus<TMap extends object = Record<string, unknown>, E = string> implements ICommandBus<TMap, E> {
|
|
147
132
|
private readonly handlers;
|
|
148
133
|
private readonly mapExpectedError;
|
|
149
134
|
constructor(options?: CommandBusOptions<E>);
|
|
@@ -248,23 +233,6 @@ interface Query {
|
|
|
248
233
|
type QueryHandler<Q extends Query, R> = (query: Q) => Promise<R>;
|
|
249
234
|
//#endregion
|
|
250
235
|
//#region src/application/cqrs/query/query-bus.d.ts
|
|
251
|
-
/**
|
|
252
|
-
* Type map for query types to their return types.
|
|
253
|
-
* Used to improve type inference in QueryBus.
|
|
254
|
-
*
|
|
255
|
-
* @example
|
|
256
|
-
* ```typescript
|
|
257
|
-
* type MyQueryMap = {
|
|
258
|
-
* GetOrder: Order | null;
|
|
259
|
-
* ListOrders: Order[];
|
|
260
|
-
* };
|
|
261
|
-
*
|
|
262
|
-
* const bus = new QueryBus<MyQueryMap>();
|
|
263
|
-
* const result = await bus.execute({ type: "GetOrder", orderId: "123" });
|
|
264
|
-
* // result: Result<Order | null, string> ← automatically inferred
|
|
265
|
-
* ```
|
|
266
|
-
*/
|
|
267
|
-
type QueryTypeMap = Record<string, unknown>;
|
|
268
236
|
/**
|
|
269
237
|
* Construction options for {@link QueryBus}.
|
|
270
238
|
*
|
|
@@ -307,7 +275,7 @@ interface QueryBusOptions<E = string> {
|
|
|
307
275
|
* // result: Result<unknown, string>
|
|
308
276
|
* ```
|
|
309
277
|
*/
|
|
310
|
-
interface IQueryBus<TMap extends
|
|
278
|
+
interface IQueryBus<TMap extends object = Record<string, unknown>, E = string> {
|
|
311
279
|
/**
|
|
312
280
|
* Executes a query by dispatching it to the registered handler.
|
|
313
281
|
* When a type map is provided, the return type is inferred from the query type.
|
|
@@ -391,7 +359,7 @@ interface IQueryBus<TMap extends QueryTypeMap = QueryTypeMap, E = string> {
|
|
|
391
359
|
* const result = await bus.execute({ type: "GetOrder", orderId: "123" });
|
|
392
360
|
* ```
|
|
393
361
|
*/
|
|
394
|
-
declare class QueryBus<TMap extends
|
|
362
|
+
declare class QueryBus<TMap extends object = Record<string, unknown>, E = string> implements IQueryBus<TMap, E> {
|
|
395
363
|
private readonly handlers;
|
|
396
364
|
private readonly mapExpectedError;
|
|
397
365
|
constructor(options?: QueryBusOptions<E>);
|
|
@@ -737,8 +705,8 @@ declare class DeadlineProcessor<TPayload = unknown> extends PollLoop {
|
|
|
737
705
|
private readonly classifyFailure?;
|
|
738
706
|
constructor(options: DeadlineProcessorOptions<TPayload>);
|
|
739
707
|
/**
|
|
740
|
-
* One full delivery pass (the `run`/`drainOnce` shell lives on
|
|
741
|
-
*
|
|
708
|
+
* One full delivery pass (the `run`/`drainOnce` shell lives on the
|
|
709
|
+
* shared poll loop): delivers due deadlines batch by batch until
|
|
742
710
|
* nothing is due or a cycle contained a failure.
|
|
743
711
|
*/
|
|
744
712
|
protected pass(signal?: AbortSignal): Promise<"drained" | "stopped">;
|
|
@@ -1212,8 +1180,8 @@ declare class OutboxDispatcher<Evt extends AnyDomainEvent> extends PollLoop {
|
|
|
1212
1180
|
private readonly trackingOutbox?;
|
|
1213
1181
|
constructor(options: OutboxDispatcherOptions<Evt>);
|
|
1214
1182
|
/**
|
|
1215
|
-
* One full dispatch pass (the `run`/`drainOnce` shell lives on
|
|
1216
|
-
*
|
|
1183
|
+
* One full dispatch pass (the `run`/`drainOnce` shell lives on the
|
|
1184
|
+
* shared poll loop): dispatches pending records batch by batch until
|
|
1217
1185
|
* the backlog is empty or a failure stops progress. A `"stopped"`
|
|
1218
1186
|
* pass leaves the failed record pending (or dead-lettered by a
|
|
1219
1187
|
* tracking outbox); the next cycle retries it.
|
|
@@ -2583,11 +2551,18 @@ declare abstract class BaseAggregate<TState, TId extends Id<string>, TEvent exte
|
|
|
2583
2551
|
* before persistence. Payload schema version stays here, next to the
|
|
2584
2552
|
* concrete event producer, rather than in shell-owned stamp data.
|
|
2585
2553
|
*/
|
|
2586
|
-
protected createEvent<E extends TEvent>(type: E["type"], payload: E["payload"], options?:
|
|
2554
|
+
protected createEvent<E extends TEvent>(type: E["type"], payload: E["payload"], options?: CreateEventOptions): UnstampedDomainEventOf<E>;
|
|
2587
2555
|
}
|
|
2588
2556
|
//#endregion
|
|
2589
2557
|
//#region src/domain/aggregate/event-sourced-aggregate.d.ts
|
|
2590
|
-
|
|
2558
|
+
/**
|
|
2559
|
+
* Folds one event of type `TEvent` into the state of an event-sourced
|
|
2560
|
+
* aggregate and returns the next state. Each entry of
|
|
2561
|
+
* `EventSourcedAggregate.folds` is a fold. The fold receives the event
|
|
2562
|
+
* without its stamp: a live `apply` folds the event before the commit stamps
|
|
2563
|
+
* it.
|
|
2564
|
+
*/
|
|
2565
|
+
type Fold<TState, TEvent extends AnyDomainEvent> = (state: TState, event: UnstampedDomainEventOf<TEvent>) => TState;
|
|
2591
2566
|
/**
|
|
2592
2567
|
* Base class for Event-Sourced Aggregate Roots (Vernon, IDDD Chapter 8).
|
|
2593
2568
|
*
|
|
@@ -2777,9 +2752,9 @@ declare abstract class EventSourcedAggregate<TState, TId extends Id<string>, TEv
|
|
|
2777
2752
|
* producing silently divergent state. When a time or identity changes a
|
|
2778
2753
|
* business decision, pass it in the payload.
|
|
2779
2754
|
*/
|
|
2780
|
-
protected abstract readonly folds: { [K in TEvent["type"]]: Fold<TState,
|
|
2755
|
+
protected abstract readonly folds: { [K in TEvent["type"]]: Fold<TState, Extract<TEvent, {
|
|
2781
2756
|
type: K;
|
|
2782
|
-
}
|
|
2757
|
+
}>>; };
|
|
2783
2758
|
}
|
|
2784
2759
|
/**
|
|
2785
2760
|
* Reconstitutes an event-sourced aggregate from one page of history and
|
|
@@ -2984,7 +2959,7 @@ interface DeepOmitOptions {
|
|
|
2984
2959
|
* path, so memoising the first path's result would be wrong. This is
|
|
2985
2960
|
* inherently exponential for diamond-shaped sharing (a node reachable
|
|
2986
2961
|
* via 2^n paths is cloned 2^n times); the walk aborts with a descriptive
|
|
2987
|
-
* error after
|
|
2962
|
+
* error after a fixed budget of node visits instead of
|
|
2988
2963
|
* hanging the process.
|
|
2989
2964
|
*
|
|
2990
2965
|
* **Prototype-pollution safety.** `__proto__` and `constructor` keys
|
|
@@ -3238,7 +3213,8 @@ declare abstract class ValueObject<T extends object> implements IValueObject<T>
|
|
|
3238
3213
|
//#region src/domain/value-object/value-object-or-issues.d.ts
|
|
3239
3214
|
/**
|
|
3240
3215
|
* Builds an immutable value object while collecting **all** validation
|
|
3241
|
-
* violations into a single
|
|
3216
|
+
* violations into a single `ValidationError` of `@shirudo/base-error`,
|
|
3217
|
+
* instead of failing on the
|
|
3242
3218
|
* first one. This is the Result-first, multi-error counterpart to
|
|
3243
3219
|
* `valueObjectOrError` (which returns a single string message).
|
|
3244
3220
|
*
|
|
@@ -4190,7 +4166,7 @@ interface RetryPolicy {
|
|
|
4190
4166
|
maxDelayMs?: number;
|
|
4191
4167
|
/**
|
|
4192
4168
|
* Classifier deciding whether an error is worth retrying. Default
|
|
4193
|
-
*
|
|
4169
|
+
* `someChainRetryable` of `@shirudo/base-error` (walks the cause chain for the loose
|
|
4194
4170
|
* `retryable === true` marker, so a `ConcurrencyConflictError` matches
|
|
4195
4171
|
* even when an adapter wraps it, unless its reason is
|
|
4196
4172
|
* `version_unchanged`, which names a defect a retry repeats). Override
|
|
@@ -4313,6 +4289,10 @@ declare class InMemorySnapshotStore<TState = unknown> implements SnapshotStore<T
|
|
|
4313
4289
|
}
|
|
4314
4290
|
//#endregion
|
|
4315
4291
|
//#region src/persistence/snapshot-store/snapshot-model.d.ts
|
|
4292
|
+
/**
|
|
4293
|
+
* The fields of an aggregate that a snapshot model reads.
|
|
4294
|
+
* @inline
|
|
4295
|
+
*/
|
|
4316
4296
|
interface SnapshotAggregate {
|
|
4317
4297
|
readonly id: Id<string>;
|
|
4318
4298
|
readonly version: Version;
|
|
@@ -4380,5 +4360,5 @@ declare function captureAggregateSnapshot<TAggregate extends SnapshotAggregate,
|
|
|
4380
4360
|
*/
|
|
4381
4361
|
declare function reconstituteAggregateFromSnapshot<TAggregate extends SnapshotAggregate, TSnapshotState>(model: SnapshotModel<TAggregate, TSnapshotState>, id: TAggregate["id"], snapshot: AggregateSnapshot<unknown>): TAggregate;
|
|
4382
4362
|
//#endregion
|
|
4383
|
-
export { type AbsentStreamPages, type Aggregate, type AggregateClass, type AggregateCommitToken, type AggregateConfig, AggregateDeletedError, type AggregateDeletedErrorOptions, type AggregateIdentity, type AggregateIdentityMismatchOptions, AggregateNotFoundError, type AggregateNotFoundErrorOptions, type AggregatePersistence, type AggregatePersistenceWrite, type AggregateSnapshot, AggregateTrackingError, type AggregateTrackingErrorOptions, type AggregateTrackingReason, type AggregateWriteIntent, type AggregateWriteRegistration, type AnyDomainEvent, type AnyUnstampedDomainEvent, type AppendOnlyWriteRegistration, CapabilityRegistryConflictError, type ClassifyConcurrencyConflictOptions, type ClockFactory, type Command, CommandBus, type CommandBusOptions, type CommandCommitOriginCandidate, type CommandHandler, type CommandMessageContent, type CommandMessageRelationships, type CommandOutboxCommitCandidate, type CommandOutboxMapper, type CommandOutboxWriter, CommitError, type CommitPosition, type CommitRegistration, type CommitRegistrationOptions, type CommittedDomainEvent, type CompatibleRepositoryDefinitions, ConcurrencyConflictError, type ConcurrencyConflictErrorOptions, type ConcurrencyConflictReason, type CreateDomainEventOptions, type CreateDomainEventStampOptions, type CreateStampedDomainEventOptions, type DeadLetterDeadline, type DeadLetterRecord, DeadlineProcessor, type DeadlineProcessorObservers, type DeadlineProcessorOptions, type DeadlineStore, type DeepOmitKey, type DeepOmitOptions, type DeepOmitPathSegment, type DeliveryFailureAssessment, type DeliveryFailureClassifier, type DeliveryFailureKind, DirectStateMutationError, type DirectStateMutationErrorOptions, type DispatchTrackingOutbox, DomainError, type DomainErrorClass, type DomainEvent, type DomainEventFactory, type DomainEventFactoryOptions, type DomainEventStamp, type DomainEventStampFactory, type DomainEventStampProvider, type DomainEventValidationCode, DomainEventValidationError, type DomainEventValidationField, type DueDeadline, DuplicateAggregateError, type DuplicateAggregateErrorOptions, DuplicateEventIdError, type DuplicateEventIdErrorOptions, DuplicateHandlerRegistrationError, type DuplicateHandlerRegistrationErrorOptions, type DurableCommandMessage, Entity, type EntityConfig, ErrorMapperFailedError, type ErrorMapperFailedErrorOptions, type EventBus, EventBusClosedError, type EventBusObservers, type EventBusOptions, EventCollectionError, type EventCommitCandidate, type EventCommitCandidatePosition, type EventHandler, type EventIdFactory, type EventMetadata, EventSourcedAggregate, type EventStore, type EventStoreAppendOptions, type EventStreamPageReason, type EventStreamReader, type ExecutionContext, type FlushStatementReason, FoldReturnedNoStateError, ForeignEventError, HandBuiltEventError, type HandlerFailureReport, type ICommandBus, type IEntity, type IQueryBus, type Id, type IdGenerator, type IdempotencyClaim, type IdempotencyClaimHandle, IdempotencyClaimLostError, type IdempotencyClaimLostErrorOptions, IdempotencyCompletionWithoutClaimError, IdempotencyInFlightError, type IdempotencyInFlightErrorOptions, IdempotencyKeyReuseError, type IdempotencyKeyReuseErrorOptions, type IdempotencyLease, type IdempotencyOperationErrorContext, type IdempotencyReconciliation, type IdempotencyReconciliationDecision, IdempotencyReconciliationRequiredError, type IdempotencyReconciliationRequiredErrorOptions, type IdempotencyStore, type IdempotentCommitRequest, type IdempotentCommitResult, type IdempotentExecution, type Identifiable, IdentityMap, InMemoryCapacityExceededError, type InMemoryCapacityExceededErrorOptions, InMemoryDeadlineStore, type InMemoryDeadlineStoreOptions, InMemoryEventStore, type InMemoryEventStoreOptions, InMemoryIdempotencyStore, type InMemoryIdempotencyStoreOptions, InMemoryOutbox, type InMemoryOutboxOptions, InMemoryProjectionCheckpointStore, type InMemoryProjectionCheckpointStoreOptions, InMemorySnapshotStore, type InMemorySnapshotStoreOptions, type InMemoryTransaction, type InMemoryTransactionParticipant, InMemoryTransactionScope, InProcessEventBus, InfrastructureError, type IntegrationMessage, type IntegrationMessageContent, type IntegrationMessageMapper, type IntegrationMessageRelationships, InvalidCommandMessageError, InvalidEventStreamPageError, type InvalidEventStreamPageErrorOptions, InvalidFlushStatementError, type InvalidFlushStatementErrorOptions, InvalidIntegrationMessageError, InvalidRepositoryAdapterError, type InvalidRepositoryAdapterErrorOptions, type InvalidRepositoryAdapterReason, InvalidRepositoryDefinitionError, InvalidVersionError, type JsonObject, type JsonPrimitive, type JsonValue, type KitErrorCode, type KitErrorOptions, type MatchedRows, MisattributedEventError, MissingEntityIdError, MissingFoldError, MissingHandlerError, NestedUnitOfWorkError, type OnceOptions, type Outbox, OutboxDispatcher, type OutboxDispatcherObservers, type OutboxDispatcherOptions, type OutboxRecord, type OutboxSink, type OutboxWriter, type PendingDomainEvent, PendingEventBatchMismatchError, type PendingEventBatchMismatchErrorOptions, PendingEventLimitExceededError, type PendingEventLimitExceededErrorOptions, type PersistenceChanges, type PersistenceLifecycle, type PersistenceModel, type PhysicalRemovalRegistration, type PinTargetVersionOptions, type PinnedTargetVersion, type ProjectOptions, type Projection, type ProjectionBatchResult, type ProjectionCheckpoint, type ProjectionCheckpointStore, type ProjectionEventHandler, type ProjectionFromHandlersOptions, ProjectionGapError, type ProjectionHandlers, ProjectionIdentityViolationError, ProjectionOrderViolationError, type ProjectionPosition, ProjectionReceiptViolationError, Projector, type ProjectorOptions, PrototypePollutionError, type PublishAbortedReport, type PublishChainState, type PublishChainStore, PublishDepthExceededError, type PublishOptions, type PublishedCommand, type Query, QueryBus, type QueryBusOptions, type QueryHandler, type ReachableStreamPages, type ReadStreamOptions, type ReadStreamPagesOptions, ReentrantEventRecordingError, type ReentrantEventRecordingErrorOptions, ReplayRejectedError, type ReplayRejectedErrorOptions, ReplayTargetMismatchError, type ReplayTargetMismatchErrorOptions, type ReplayTargetMismatchReason, type ReplayableAggregate, type ReplayableStreamPages, type RepositoriesOf, type Repository, type RepositoryDefinition, type RepositoryDefinitionOptions, RepositoryErrorMappingFailedError, type RepositoryErrorMappingFailedErrorOptions, type RepositoryTracking, type RetryPolicy, RetryingTransactionScope, RollbackError, type RunOptions, type SharedDomainEventStampOptions, SnapshotCorruptedError, type SnapshotModel, SnapshotSchemaMismatchError, type SnapshotSchemaMismatchErrorOptions, type SnapshotStore, SnapshotTimeValidationError, SnapshotVersionNotRestoredError, type SnapshotVersionNotRestoredErrorOptions, Specification, type SpecificationComposite, StateStoredAggregate, type StateValidator, type StreamPages, type StreamReadResult, type SubscriptionThresholdReport, TransactionClosedError, type TransactionScope, type TransactionalOptions, UnitOfWork, type UnitOfWorkContext, type UnitOfWorkDeps, type UnitOfWorkIdentityMap, UnmanagedInstanceError, UnprojectableEventError, type UnreachableStreamPages, UnregisteredChangesError, type UnregisteredChangesErrorOptions, UnregisteredHandlerError, type UnregisteredHandlerErrorOptions, UnreplayableAggregateError, type UnreplayableAggregateErrorOptions, type UnstampedDomainEvent, type UnstampedDomainEventOf, ValueObject, type ValueObjectOf, type Version, type VersionedFlushStatements, type VersionedWrite, type WithCommitDeps, type WithCommitWorkResult, type WithIdempotentCommitDeps, captureAggregateSnapshot, classifyConcurrencyConflict, copyMetadata, copyPlainState, createDomainEvent, createDomainEventFactory, createIntegrationMessage, createStampedDomainEvent, decodeIntegrationMessage, deepEqual, deepFreeze, deepOmit, defaultDomainEventFactory, defineRepository, defineSnapshotModel, domainErrorToResult, encodeIntegrationMessage, entityIds, eventBusSink, findEntityById, hasEntityId, ignoreProjectionEvent, integrationMessageToCommittedEvent, isDomainErrorLike, isInfrastructureErrorLike, isPositionAfter, isWiringErrorLike, mergeMetadata, outboxWriterAcceptingEventLoss, pinTargetVersion, projectionFromHandlers, readStreamPages, reconstituteAggregateFromHistory, reconstituteAggregateFromSnapshot, reconstituteAggregateFromStreamPages, removeEntityById, replaceEntityById, routeEventsToCommandOutbox, sameEntity, sameVersion, specification, stampPendingEvents, toVersion, updateEntityById, valueObject, valueObjectEquals, valueObjectEqualsExcept, valueObjectOrError, valueObjectOrIssues, versionedFlush, withCommit, withIdempotentCommit };
|
|
4363
|
+
export { type AbsentStreamPages, type Aggregate, type AggregateClass, type AggregateCommitToken, type AggregateConfig, AggregateDeletedError, type AggregateDeletedErrorOptions, type AggregateIdentity, type AggregateIdentityMismatchOptions, AggregateNotFoundError, type AggregateNotFoundErrorOptions, type AggregatePersistence, type AggregatePersistenceWrite, type AggregateSnapshot, AggregateTrackingError, type AggregateTrackingErrorOptions, type AggregateTrackingReason, type AggregateWriteIntent, type AggregateWriteRegistration, type AnyDomainEvent, type AnyUnstampedDomainEvent, type AppendOnlyWriteRegistration, CapabilityRegistryConflictError, type ClassifyConcurrencyConflictOptions, type ClockFactory, type Command, CommandBus, type CommandBusOptions, type CommandCommitOriginCandidate, type CommandHandler, type CommandMessageContent, type CommandMessageRelationships, type CommandOutboxCommitCandidate, type CommandOutboxMapper, type CommandOutboxWriter, CommitError, type CommitPosition, type CommitRegistration, type CommitRegistrationOptions, type CommittedDomainEvent, type CompatibleRepositoryDefinitions, ConcurrencyConflictError, type ConcurrencyConflictErrorOptions, type ConcurrencyConflictReason, type CreateDomainEventOptions, type CreateDomainEventStampOptions, type CreateEventOptions, type CreateStampedDomainEventOptions, type DeadLetterDeadline, type DeadLetterRecord, DeadlineProcessor, type DeadlineProcessorObservers, type DeadlineProcessorOptions, type DeadlineStore, type DeepOmitKey, type DeepOmitOptions, type DeepOmitPathSegment, type DeliveryFailureAssessment, type DeliveryFailureClassifier, type DeliveryFailureKind, DirectStateMutationError, type DirectStateMutationErrorOptions, type DispatchTrackingOutbox, DomainError, type DomainErrorClass, type DomainEvent, type DomainEventFactory, type DomainEventFactoryOptions, type DomainEventStamp, type DomainEventStampFactory, type DomainEventStampProvider, type DomainEventValidationCode, DomainEventValidationError, type DomainEventValidationField, type DueDeadline, DuplicateAggregateError, type DuplicateAggregateErrorOptions, DuplicateEventIdError, type DuplicateEventIdErrorOptions, DuplicateHandlerRegistrationError, type DuplicateHandlerRegistrationErrorOptions, type DurableCommandMessage, Entity, type EntityConfig, ErrorMapperFailedError, type ErrorMapperFailedErrorOptions, type EventBus, EventBusClosedError, type EventBusObservers, type EventBusOptions, EventCollectionError, type EventCommitCandidate, type EventCommitCandidatePosition, type EventHandler, type EventIdFactory, type EventMetadata, EventSourcedAggregate, type EventStore, type EventStoreAppendOptions, type EventStreamPageReason, type EventStreamReader, type ExecutionContext, type FlushStatementReason, type Fold, FoldReturnedNoStateError, ForeignEventError, HandBuiltEventError, type HandlerFailureReport, type ICommandBus, type IEntity, type IQueryBus, type Id, type IdGenerator, type IdempotencyClaim, type IdempotencyClaimHandle, IdempotencyClaimLostError, type IdempotencyClaimLostErrorOptions, IdempotencyCompletionWithoutClaimError, IdempotencyInFlightError, type IdempotencyInFlightErrorOptions, IdempotencyKeyReuseError, type IdempotencyKeyReuseErrorOptions, type IdempotencyLease, type IdempotencyOperationErrorContext, type IdempotencyReconciliation, type IdempotencyReconciliationDecision, IdempotencyReconciliationRequiredError, type IdempotencyReconciliationRequiredErrorOptions, type IdempotencyStore, type IdempotentCommitRequest, type IdempotentCommitResult, type IdempotentExecution, type Identifiable, IdentityMap, InMemoryCapacityExceededError, type InMemoryCapacityExceededErrorOptions, InMemoryDeadlineStore, type InMemoryDeadlineStoreOptions, InMemoryEventStore, type InMemoryEventStoreOptions, InMemoryIdempotencyStore, type InMemoryIdempotencyStoreOptions, InMemoryOutbox, type InMemoryOutboxOptions, InMemoryProjectionCheckpointStore, type InMemoryProjectionCheckpointStoreOptions, InMemorySnapshotStore, type InMemorySnapshotStoreOptions, type InMemoryTransaction, type InMemoryTransactionParticipant, InMemoryTransactionScope, InProcessEventBus, InfrastructureError, type IntegrationMessage, type IntegrationMessageContent, type IntegrationMessageMapper, type IntegrationMessageRelationships, InvalidCommandMessageError, InvalidEventStreamPageError, type InvalidEventStreamPageErrorOptions, InvalidFlushStatementError, type InvalidFlushStatementErrorOptions, InvalidIntegrationMessageError, InvalidRepositoryAdapterError, type InvalidRepositoryAdapterErrorOptions, type InvalidRepositoryAdapterReason, InvalidRepositoryDefinitionError, InvalidVersionError, type JsonObject, type JsonPrimitive, type JsonValue, type KitErrorCode, type KitErrorOptions, type MatchedRows, MisattributedEventError, MissingEntityIdError, MissingFoldError, MissingHandlerError, NestedUnitOfWorkError, type OnceOptions, type Outbox, OutboxDispatcher, type OutboxDispatcherObservers, type OutboxDispatcherOptions, type OutboxRecord, type OutboxSink, type OutboxWriter, type PendingDomainEvent, PendingEventBatchMismatchError, type PendingEventBatchMismatchErrorOptions, PendingEventLimitExceededError, type PendingEventLimitExceededErrorOptions, type PersistenceChanges, type PersistenceLifecycle, type PersistenceModel, type PhysicalRemovalRegistration, type PinTargetVersionOptions, type PinnedTargetVersion, type ProjectOptions, type Projection, type ProjectionBatchResult, type ProjectionCheckpoint, type ProjectionCheckpointStore, type ProjectionEventHandler, type ProjectionFromHandlersOptions, ProjectionGapError, type ProjectionHandlers, ProjectionIdentityViolationError, ProjectionOrderViolationError, type ProjectionPosition, ProjectionReceiptViolationError, Projector, type ProjectorOptions, PrototypePollutionError, type PublishAbortedReport, type PublishChainState, type PublishChainStore, PublishDepthExceededError, type PublishOptions, type PublishedCommand, type Query, QueryBus, type QueryBusOptions, type QueryHandler, type ReachableStreamPages, type ReadStreamOptions, type ReadStreamPagesOptions, ReentrantEventRecordingError, type ReentrantEventRecordingErrorOptions, ReplayRejectedError, type ReplayRejectedErrorOptions, ReplayTargetMismatchError, type ReplayTargetMismatchErrorOptions, type ReplayTargetMismatchReason, type ReplayableAggregate, type ReplayableStreamPages, type RepositoriesOf, type Repository, type RepositoryDefinition, type RepositoryDefinitionOptions, RepositoryErrorMappingFailedError, type RepositoryErrorMappingFailedErrorOptions, type RepositoryTracking, type RetryPolicy, RetryingTransactionScope, RollbackError, type RunOptions, type SharedDomainEventStampOptions, SnapshotCorruptedError, type SnapshotModel, SnapshotSchemaMismatchError, type SnapshotSchemaMismatchErrorOptions, type SnapshotStore, SnapshotTimeValidationError, SnapshotVersionNotRestoredError, type SnapshotVersionNotRestoredErrorOptions, Specification, type SpecificationComposite, StateStoredAggregate, type StateValidator, type StreamPages, type StreamReadResult, type SubscriptionThresholdReport, TransactionClosedError, type TransactionScope, type TransactionalOptions, UnitOfWork, type UnitOfWorkContext, type UnitOfWorkDeps, type UnitOfWorkIdentityMap, UnmanagedInstanceError, UnprojectableEventError, type UnreachableStreamPages, UnregisteredChangesError, type UnregisteredChangesErrorOptions, UnregisteredHandlerError, type UnregisteredHandlerErrorOptions, UnreplayableAggregateError, type UnreplayableAggregateErrorOptions, type UnstampedDomainEvent, type UnstampedDomainEventOf, ValueObject, type ValueObjectOf, type Version, type VersionedFlushStatements, type VersionedWrite, type WithCommitDeps, type WithCommitWorkResult, type WithIdempotentCommitDeps, captureAggregateSnapshot, classifyConcurrencyConflict, copyMetadata, copyPlainState, createDomainEvent, createDomainEventFactory, createIntegrationMessage, createStampedDomainEvent, decodeIntegrationMessage, deepEqual, deepFreeze, deepOmit, defaultDomainEventFactory, defineRepository, defineSnapshotModel, domainErrorToResult, encodeIntegrationMessage, entityIds, eventBusSink, findEntityById, hasEntityId, ignoreProjectionEvent, integrationMessageToCommittedEvent, isDomainErrorLike, isInfrastructureErrorLike, isPositionAfter, isWiringErrorLike, mergeMetadata, outboxWriterAcceptingEventLoss, pinTargetVersion, projectionFromHandlers, readStreamPages, reconstituteAggregateFromHistory, reconstituteAggregateFromSnapshot, reconstituteAggregateFromStreamPages, removeEntityById, replaceEntityById, routeEventsToCommandOutbox, sameEntity, sameVersion, specification, stampPendingEvents, toVersion, updateEntityById, valueObject, valueObjectEquals, valueObjectEqualsExcept, valueObjectOrError, valueObjectOrIssues, versionedFlush, withCommit, withIdempotentCommit };
|
|
4384
4364
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -1318,8 +1318,8 @@ var DeadlineProcessor = class extends PollLoop {
|
|
|
1318
1318
|
assertTimerDelay("DeadlineProcessor", "storageTimeoutMs", this.storageTimeoutMs);
|
|
1319
1319
|
}
|
|
1320
1320
|
/**
|
|
1321
|
-
* One full delivery pass (the `run`/`drainOnce` shell lives on
|
|
1322
|
-
*
|
|
1321
|
+
* One full delivery pass (the `run`/`drainOnce` shell lives on the
|
|
1322
|
+
* shared poll loop): delivers due deadlines batch by batch until
|
|
1323
1323
|
* nothing is due or a cycle contained a failure.
|
|
1324
1324
|
*/
|
|
1325
1325
|
async pass(signal) {
|
|
@@ -5252,7 +5252,8 @@ var NotSpecification = class extends Specification {
|
|
|
5252
5252
|
//#region src/domain/value-object/value-object-or-issues.ts
|
|
5253
5253
|
/**
|
|
5254
5254
|
* Builds an immutable value object while collecting **all** validation
|
|
5255
|
-
* violations into a single
|
|
5255
|
+
* violations into a single `ValidationError` of `@shirudo/base-error`,
|
|
5256
|
+
* instead of failing on the
|
|
5256
5257
|
* first one. This is the Result-first, multi-error counterpart to
|
|
5257
5258
|
* `valueObjectOrError` (which returns a single string message).
|
|
5258
5259
|
*
|
|
@@ -6683,8 +6684,8 @@ var OutboxDispatcher = class extends PollLoop {
|
|
|
6683
6684
|
assertTimerDelay("OutboxDispatcher", "storageTimeoutMs", this.storageTimeoutMs);
|
|
6684
6685
|
}
|
|
6685
6686
|
/**
|
|
6686
|
-
* One full dispatch pass (the `run`/`drainOnce` shell lives on
|
|
6687
|
-
*
|
|
6687
|
+
* One full dispatch pass (the `run`/`drainOnce` shell lives on the
|
|
6688
|
+
* shared poll loop): dispatches pending records batch by batch until
|
|
6688
6689
|
* the backlog is empty or a failure stops progress. A `"stopped"`
|
|
6689
6690
|
* pass leaves the failed record pending (or dead-lettered by a
|
|
6690
6691
|
* tracking outbox); the next cycle retries it.
|