@dudousxd/nestjs-durable-testing 0.6.0 → 0.7.1

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/index.d.ts CHANGED
@@ -1,4 +1,21 @@
1
- import { StateStore, RunStatus, WorkflowEngine, InMemoryStateStore, InMemoryTransport, RunResult, WorkflowRef, StartOptions, WorkflowRun, StepCheckpoint, Transport } from '@dudousxd/nestjs-durable-core';
1
+ import { AdmissionBackend, StateStore, RunStatus, WorkflowEngine, InMemoryStateStore, InMemoryTransport, RunResult, WorkflowRef, StartOptions, WorkflowRun, StepCheckpoint, Transport } from '@dudousxd/nestjs-durable-core';
2
+
3
+ /**
4
+ * Builds an {@link AdmissionBackend} bound to the given test clock. Implementations that hold their
5
+ * own resources (e.g. a Redis connection) should register the instance for teardown out-of-band.
6
+ */
7
+ type AdmissionBackendFactory = (clock: () => number) => AdmissionBackend;
8
+ /**
9
+ * The SHARED cross-backend behavioural contract for the flow-control admission gate. Both the
10
+ * in-process `InMemoryAdmissionBackend` and the Redis `RedisAdmissionBackend` run it, so their
11
+ * concurrency / rate-limit / ordering semantics can never silently drift apart — backend-specific
12
+ * concerns (leases, pub/sub, cross-pod globality) live in each adapter's own spec.
13
+ *
14
+ * The engine always passes a stable `waiterId`, so every gated call is order-tracked: ties with no
15
+ * priority/fairness fall back to arrival FIFO (or LIFO when configured). These cases assert exactly
16
+ * that, on ONE backend instance.
17
+ */
18
+ declare function runAdmissionBackendContract(name: string, makeBackend: AdmissionBackendFactory): void;
2
19
 
3
20
  declare function assertRunStatus(store: StateStore, runId: string, status: RunStatus): Promise<void>;
4
21
  declare function assertOutput(store: StateStore, runId: string, expected: unknown): Promise<void>;
@@ -215,4 +232,4 @@ type HandleableTransport = Transport & {
215
232
  */
216
233
  declare function assertTransportConformance(transport: HandleableTransport, idPrefix?: string): Promise<void>;
217
234
 
218
- export { DURABLE_CANONICAL_COLUMNS, type DurableColumnMap, type DurableColumnMismatch, type HandleableTransport, MutableClock, type RunHistory, type StateStoreContext, type StateStoreFactory, StateStoreUnavailableError, type TestEngine, assertDurableColumns, assertOutput, assertReplayable, assertRunStatus, assertStepAttempts, assertStepsRan, assertTransportConformance, createTestEngine, failOnce, failTimes, preserveColumnExpectation, recordedSteps, runStateStoreContract };
235
+ export { type AdmissionBackendFactory, DURABLE_CANONICAL_COLUMNS, type DurableColumnMap, type DurableColumnMismatch, type HandleableTransport, MutableClock, type RunHistory, type StateStoreContext, type StateStoreFactory, StateStoreUnavailableError, type TestEngine, assertDurableColumns, assertOutput, assertReplayable, assertRunStatus, assertStepAttempts, assertStepsRan, assertTransportConformance, createTestEngine, failOnce, failTimes, preserveColumnExpectation, recordedSteps, runAdmissionBackendContract, runStateStoreContract };