@cratis/chronicle 6.21.0 → 6.22.0
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/reactors/ReactorDispatcher.d.ts +20 -0
- package/dist/reactors/ReactorDispatcher.d.ts.map +1 -0
- package/dist/reactors/ReactorDispatcher.js +76 -0
- package/dist/reactors/ReactorDispatcher.js.map +1 -0
- package/dist/reactors/ReactorSideEffects.d.ts +3 -0
- package/dist/reactors/ReactorSideEffects.d.ts.map +1 -1
- package/dist/reactors/ReactorSideEffects.js +16 -11
- package/dist/reactors/ReactorSideEffects.js.map +1 -1
- package/dist/reactors/Reactors.d.ts +0 -1
- package/dist/reactors/Reactors.d.ts.map +1 -1
- package/dist/reactors/Reactors.js +5 -71
- package/dist/reactors/Reactors.js.map +1 -1
- package/dist/testing/InProcessEventSequence.d.ts +8 -0
- package/dist/testing/InProcessEventSequence.d.ts.map +1 -1
- package/dist/testing/InProcessEventSequence.js +14 -1
- package/dist/testing/InProcessEventSequence.js.map +1 -1
- package/dist/testing/ReactorDeliveryResult.d.ts +10 -0
- package/dist/testing/ReactorDeliveryResult.d.ts.map +1 -0
- package/dist/testing/ReactorDeliveryResult.js +4 -0
- package/dist/testing/ReactorDeliveryResult.js.map +1 -0
- package/dist/testing/ReactorScenario.d.ts +55 -0
- package/dist/testing/ReactorScenario.d.ts.map +1 -0
- package/dist/testing/ReactorScenario.js +275 -0
- package/dist/testing/ReactorScenario.js.map +1 -0
- package/dist/testing/ReactorScenarioOptions.d.ts +17 -0
- package/dist/testing/ReactorScenarioOptions.d.ts.map +1 -0
- package/dist/testing/ReactorScenarioOptions.js +4 -0
- package/dist/testing/ReactorScenarioOptions.js.map +1 -0
- package/dist/testing/RecordedReactorSideEffect.d.ts +13 -0
- package/dist/testing/RecordedReactorSideEffect.d.ts.map +1 -0
- package/dist/testing/RecordedReactorSideEffect.js +4 -0
- package/dist/testing/RecordedReactorSideEffect.js.map +1 -0
- package/dist/testing/UnsupportedReactorOperation.d.ts +7 -0
- package/dist/testing/UnsupportedReactorOperation.d.ts.map +1 -0
- package/dist/testing/UnsupportedReactorOperation.js +14 -0
- package/dist/testing/UnsupportedReactorOperation.js.map +1 -0
- package/dist/testing/index.d.ts +5 -0
- package/dist/testing/index.d.ts.map +1 -1
- package/dist/testing/index.js +2 -0
- package/dist/testing/index.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/reactors/ReactorDispatcher.ts +95 -0
- package/reactors/ReactorSideEffects.ts +21 -13
- package/reactors/Reactors.ts +11 -83
- package/testing/InProcessEventSequence.ts +16 -1
- package/testing/ReactorDeliveryResult.ts +13 -0
- package/testing/ReactorScenario.rejections.spec.ts +100 -0
- package/testing/ReactorScenario.spec.ts +611 -0
- package/testing/ReactorScenario.ts +279 -0
- package/testing/ReactorScenarioOptions.ts +20 -0
- package/testing/RecordedReactorSideEffect.ts +16 -0
- package/testing/UnsupportedReactorOperation.ts +10 -0
- package/testing/index.ts +5 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { EventContext } from '../events/EventContext.js';
|
|
2
|
+
/** Observable outcome of one ordered source-partition delivery (not a kernel checkpoint). */
|
|
3
|
+
export interface ReactorDeliveryResult {
|
|
4
|
+
readonly sourceId: string;
|
|
5
|
+
readonly handled: readonly EventContext[];
|
|
6
|
+
readonly skipped: readonly EventContext[];
|
|
7
|
+
readonly completed: boolean;
|
|
8
|
+
readonly error?: unknown;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=ReactorDeliveryResult.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ReactorDeliveryResult.d.ts","sourceRoot":"","sources":["../../testing/ReactorDeliveryResult.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAE9D,6FAA6F;AAC7F,MAAM,WAAW,qBAAqB;IAClC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,OAAO,EAAE,SAAS,YAAY,EAAE,CAAC;IAC1C,QAAQ,CAAC,OAAO,EAAE,SAAS,YAAY,EAAE,CAAC;IAC1C,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,KAAK,CAAC,EAAE,OAAO,CAAC;CAC5B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ReactorDeliveryResult.js","sourceRoot":"","sources":["../../testing/ReactorDeliveryResult.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { Constructor } from '@cratis/fundamentals';
|
|
2
|
+
import type { ReactorDeliveryResult } from './ReactorDeliveryResult.js';
|
|
3
|
+
import type { ReactorScenarioOptions } from './ReactorScenarioOptions.js';
|
|
4
|
+
import type { RecordedReactorSideEffect } from './RecordedReactorSideEffect.js';
|
|
5
|
+
/** Live, ordered reactor deliveries over the fixture-proven EventScenario event boundary. */
|
|
6
|
+
export declare class ReactorScenario {
|
|
7
|
+
private readonly _reactor;
|
|
8
|
+
private readonly _options;
|
|
9
|
+
readonly given: {
|
|
10
|
+
forEventSource(id: string): {
|
|
11
|
+
events(...events: object[]): Promise<void>;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
readonly when: {
|
|
15
|
+
forEventSource(id: string): {
|
|
16
|
+
events(...events: object[]): Promise<void>;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
private readonly _events;
|
|
20
|
+
private readonly _entries;
|
|
21
|
+
private readonly _eventTypes;
|
|
22
|
+
private readonly _instance?;
|
|
23
|
+
private readonly _store;
|
|
24
|
+
private readonly _controller;
|
|
25
|
+
private readonly _effects;
|
|
26
|
+
private readonly _results;
|
|
27
|
+
private _busy;
|
|
28
|
+
private _failed;
|
|
29
|
+
private _delivery?;
|
|
30
|
+
private readonly _deliveryContext;
|
|
31
|
+
private _deliveryIndex;
|
|
32
|
+
constructor(_reactor: Constructor, _options?: ReactorScenarioOptions);
|
|
33
|
+
private scenarioStore;
|
|
34
|
+
get produced(): readonly unknown[];
|
|
35
|
+
get sideEffects(): readonly RecordedReactorSideEffect[];
|
|
36
|
+
get results(): readonly ReactorDeliveryResult[];
|
|
37
|
+
/** Assertion view, deliberately not a callable Promise-like `then`. */
|
|
38
|
+
get then(): {
|
|
39
|
+
readonly produced: readonly unknown[];
|
|
40
|
+
readonly sideEffects: readonly RecordedReactorSideEffect[];
|
|
41
|
+
readonly results: readonly ReactorDeliveryResult[];
|
|
42
|
+
};
|
|
43
|
+
shouldHaveProduced<T>(type: new (...args: never[]) => T, predicate?: (value: T) => boolean): void;
|
|
44
|
+
shouldNotHaveProduced(type: Function): void;
|
|
45
|
+
/** Replay, redelivery and scheduler semantics need a separate kernel-backed increment. */
|
|
46
|
+
replay(): Promise<never>;
|
|
47
|
+
redeliver(): Promise<never>;
|
|
48
|
+
private deliver;
|
|
49
|
+
private violation;
|
|
50
|
+
private latch;
|
|
51
|
+
private throwIfViolated;
|
|
52
|
+
private process;
|
|
53
|
+
private record;
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=ReactorScenario.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ReactorScenario.d.ts","sourceRoot":"","sources":["../../testing/ReactorScenario.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAuBxD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACxE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAC1E,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAKhF,6FAA6F;AAC7F,qBAAa,eAAe;IAkBZ,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAAe,OAAO,CAAC,QAAQ,CAAC,Q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EAAE,SAAS,OAAO,EAAE,CAAC;QAAC,QAAQ,CAAC,WAAW,EAAE,SAAS,yBAAyB,EAAE,CAAC;QAC5G,QAAQ,CAAC,OAAO,EAAE,SAAS,qBAAqB,EAAE,CAAA;KAAE,CAEvD;IACD,kBAAkB,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,GAAG,IAAI,EAAE,KAAK,EAAE,KAAK,CAAC,EAAE,SAAS,GAAE,CAAC,KAAK,EAAE,CAAC,KAAK,OAAoB,GAAG,IAAI,CAI5G;IACD,qBAAqB,CAAC,IAAI,EAAE,QAAQ,GAAG,IAAI,CAI1C;IAED,0FAA0F;IACpF,MAAM,IAAI,OAAO,CAAC,KAAK,CAAC,CAE7B;IACK,SAAS,IAAI,OAAO,CAAC,KAAK,CAAC,CAEhC;YAEa,OAAO;IAuBrB,OAAO,CAAC,SAAS;IAIjB,OAAO,CAAC,KAAK;IAUb,OAAO,CAAC,eAAe;YAIT,OAAO;YAuDP,MAAM;CAgBvB"}
|
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
2
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
3
|
+
import { AsyncLocalStorage } from 'node:async_hooks';
|
|
4
|
+
import { DefaultClientArtifactsProvider } from '../artifacts/DefaultClientArtifactsProvider.js';
|
|
5
|
+
import { TypeDiscoverer } from '../types/TypeDiscoverer.js';
|
|
6
|
+
import { ArtifactDelivery } from '../artifacts/ArtifactDelivery.js';
|
|
7
|
+
import { ArtifactKind } from '../artifacts/ArtifactKind.js';
|
|
8
|
+
import { withActivatedArtifact } from '../artifacts/withActivatedArtifact.js';
|
|
9
|
+
import { getEventTypeMetadata } from '../events/eventTypeDecorator.js';
|
|
10
|
+
import { getFilterTagsFor } from '../events/filterEventsByTagDecorator.js';
|
|
11
|
+
import { EventStoreName } from '../EventStoreName.js';
|
|
12
|
+
import { EventStoreNamespaceName } from '../EventStoreNamespaceName.js';
|
|
13
|
+
import { getReactorEventTypes, invokeReactorHandler, selectReactorHandler } from '../reactors/ReactorDispatcher.js';
|
|
14
|
+
import { getReactorMetadata } from '../reactors/reactor.js';
|
|
15
|
+
import { normalizeReactorSideEffects } from '../reactors/ReactorSideEffects.js';
|
|
16
|
+
import { EventScenario } from './EventScenario.js';
|
|
17
|
+
import { observeUnsupportedOperations } from './InProcessEventSequence.js';
|
|
18
|
+
import { UnsupportedEventSequenceOperation } from './UnsupportedEventSequenceOperation.js';
|
|
19
|
+
import { UnsupportedReactorOperation } from './UnsupportedReactorOperation.js';
|
|
20
|
+
/** Live, ordered reactor deliveries over the fixture-proven EventScenario event boundary. */
|
|
21
|
+
export class ReactorScenario {
|
|
22
|
+
_reactor;
|
|
23
|
+
_options;
|
|
24
|
+
given;
|
|
25
|
+
when;
|
|
26
|
+
_events;
|
|
27
|
+
_entries;
|
|
28
|
+
_eventTypes;
|
|
29
|
+
_instance;
|
|
30
|
+
_store;
|
|
31
|
+
_controller = new AbortController();
|
|
32
|
+
_effects = [];
|
|
33
|
+
_results = [];
|
|
34
|
+
_busy = false;
|
|
35
|
+
_failed = false;
|
|
36
|
+
// Unsupported calls are attributed only to the delivery that is running when they happen.
|
|
37
|
+
_delivery;
|
|
38
|
+
_deliveryContext = new AsyncLocalStorage();
|
|
39
|
+
_deliveryIndex = 0;
|
|
40
|
+
constructor(_reactor, _options = {}) {
|
|
41
|
+
this._reactor = _reactor;
|
|
42
|
+
this._options = _options;
|
|
43
|
+
const metadata = getReactorMetadata(_reactor);
|
|
44
|
+
if (!metadata)
|
|
45
|
+
throw new UnsupportedReactorOperation('reactor', _reactor.name, 'A registered @reactor is required.');
|
|
46
|
+
if ((metadata.eventSequenceId ?? 'event-log') !== 'event-log') {
|
|
47
|
+
throw new UnsupportedReactorOperation('reactor.eventSequenceId', _reactor.name, 'Only the default event log is fixture-backed.');
|
|
48
|
+
}
|
|
49
|
+
if (getFilterTagsFor(_reactor).length) {
|
|
50
|
+
throw new UnsupportedReactorOperation('reactor.filterEventsByTag', _reactor.name, 'Tag-filtered delivery is not fixture-backed.');
|
|
51
|
+
}
|
|
52
|
+
if (_options.commandTypes?.length) {
|
|
53
|
+
throw new UnsupportedReactorOperation('options.commandTypes', _reactor.name, 'Command classification belongs to the explicit-composition increment.');
|
|
54
|
+
}
|
|
55
|
+
// Resolve the selected or discovered catalog once; preserve getter-backed constraints and migrations.
|
|
56
|
+
const artifacts = _options.artifacts ?? new DefaultClientArtifactsProvider(TypeDiscoverer.default);
|
|
57
|
+
const constraints = artifacts.constraints;
|
|
58
|
+
// EventScenario rejects an explicitly selected empty catalog, but allows empty default discovery.
|
|
59
|
+
const selectedConstraints = !_options.artifacts && constraints?.length === 0 ? undefined : constraints;
|
|
60
|
+
const eventTypeMigrations = artifacts.eventTypeMigrations;
|
|
61
|
+
this._eventTypes = Object.freeze([...artifacts.eventTypes]);
|
|
62
|
+
this._events = new EventScenario({ ..._options, artifacts: {
|
|
63
|
+
eventTypes: [...this._eventTypes],
|
|
64
|
+
constraints: selectedConstraints === undefined ? undefined : [...selectedConstraints],
|
|
65
|
+
eventTypeMigrations: eventTypeMigrations === undefined ? undefined : [...eventTypeMigrations]
|
|
66
|
+
} });
|
|
67
|
+
this._entries = getReactorEventTypes(_reactor, this._eventTypes);
|
|
68
|
+
// Every unsupported event-sequence operation is latched at its source, whichever result or stream carries it.
|
|
69
|
+
observeUnsupportedOperations(this._events.eventSequence, error => { this.latch(error); });
|
|
70
|
+
this._instance = _options.artifactActivator ? undefined : new _reactor();
|
|
71
|
+
this._store = _options.servicesEventStore ?? this.scenarioStore();
|
|
72
|
+
this.given = { forEventSource: id => ({ events: (...events) => this.deliver(id, events, true) }) };
|
|
73
|
+
this.when = { forEventSource: id => ({ events: (...events) => this.deliver(id, events, false) }) };
|
|
74
|
+
}
|
|
75
|
+
scenarioStore() {
|
|
76
|
+
const unsupported = (operation) => {
|
|
77
|
+
throw this.violation(`services.${operation}`, 'Provide an explicit eventStore test double for this service.');
|
|
78
|
+
};
|
|
79
|
+
const readModelMethods = new Set(['register', 'getInstanceById', 'findInstanceById', 'getInstances',
|
|
80
|
+
'getSnapshotsById', 'dehydrateSession', 'release', 'releaseMany']);
|
|
81
|
+
const readModels = new Proxy({}, { get: (_, key) => {
|
|
82
|
+
if (key === 'watch')
|
|
83
|
+
return async function* () { unsupported('readModels.watch'); };
|
|
84
|
+
if (key === 'materialized')
|
|
85
|
+
return unsupported('readModels.materialized');
|
|
86
|
+
if (typeof key !== 'string' || !readModelMethods.has(key))
|
|
87
|
+
return undefined;
|
|
88
|
+
return async () => unsupported(`readModels.${key}`);
|
|
89
|
+
} });
|
|
90
|
+
const eventLog = this._events.eventLog;
|
|
91
|
+
const rejectSubscribed = (events) => {
|
|
92
|
+
if (events.some(event => {
|
|
93
|
+
const id = getEventTypeMetadata(event.constructor)?.eventType.id.value;
|
|
94
|
+
return this._entries.some(entry => entry.id === id);
|
|
95
|
+
})) {
|
|
96
|
+
throw this.violation('services.eventLog.append.subscribed', 'Delivery of a reactor\'s own appended events is not supported.');
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
const guardedLog = new Proxy(eventLog, { get: (target, key) => {
|
|
100
|
+
if (key === 'append')
|
|
101
|
+
return async (...args) => {
|
|
102
|
+
rejectSubscribed([args[1]]);
|
|
103
|
+
return target.append(...args);
|
|
104
|
+
};
|
|
105
|
+
if (key === 'appendMany')
|
|
106
|
+
return async (sourceOrEvents, eventsOrOptions, options) => {
|
|
107
|
+
if (typeof sourceOrEvents === 'string') {
|
|
108
|
+
rejectSubscribed(eventsOrOptions);
|
|
109
|
+
return target.appendMany(sourceOrEvents, eventsOrOptions, options);
|
|
110
|
+
}
|
|
111
|
+
rejectSubscribed(sourceOrEvents.map(entry => entry.event));
|
|
112
|
+
return target.appendMany(sourceOrEvents, eventsOrOptions);
|
|
113
|
+
};
|
|
114
|
+
const value = Reflect.get(target, key, target);
|
|
115
|
+
return typeof value === 'function' ? value.bind(target) : value;
|
|
116
|
+
} });
|
|
117
|
+
const store = { name: new EventStoreName(this._options.eventStore ?? 'test-event-store'),
|
|
118
|
+
namespace: new EventStoreNamespaceName(this._options.namespace ?? 'default'), eventLog: guardedLog, readModels };
|
|
119
|
+
const unsupportedStoreProperties = new Set(['eventTypes', 'constraints', 'projections', 'reactors', 'reducers',
|
|
120
|
+
'unitOfWorkManager', 'jobs', 'webhooks', 'subscriptions', 'seeding', 'externalServices', 'identities',
|
|
121
|
+
'pii', 'failedPartitions', 'observers']);
|
|
122
|
+
return new Proxy(store, { get: (target, key) => {
|
|
123
|
+
if (typeof key !== 'string')
|
|
124
|
+
return undefined;
|
|
125
|
+
if (Object.hasOwn(target, key))
|
|
126
|
+
return target[key];
|
|
127
|
+
if (key === 'getNamespaces')
|
|
128
|
+
return async () => unsupported('eventStore.getNamespaces');
|
|
129
|
+
if (key === 'getEventSequence')
|
|
130
|
+
return () => unsupported('eventStore.getEventSequence');
|
|
131
|
+
if (unsupportedStoreProperties.has(key))
|
|
132
|
+
return unsupported(`eventStore.${key}`);
|
|
133
|
+
return undefined;
|
|
134
|
+
} });
|
|
135
|
+
}
|
|
136
|
+
get produced() { return Object.freeze(this._effects.map(effect => effect.value)); }
|
|
137
|
+
get sideEffects() { return Object.freeze([...this._effects]); }
|
|
138
|
+
get results() { return Object.freeze([...this._results]); }
|
|
139
|
+
/** Assertion view, deliberately not a callable Promise-like `then`. */
|
|
140
|
+
get then() {
|
|
141
|
+
return { produced: this.produced, sideEffects: this.sideEffects, results: this.results };
|
|
142
|
+
}
|
|
143
|
+
shouldHaveProduced(type, predicate = () => true) {
|
|
144
|
+
if (!this.produced.some(value => value instanceof type && predicate(value))) {
|
|
145
|
+
throw new Error(`Expected reactor '${this._reactor.name}' to produce a matching '${type.name}'.`);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
shouldNotHaveProduced(type) {
|
|
149
|
+
if (this.produced.some(value => value instanceof type)) {
|
|
150
|
+
throw new Error(`Expected reactor '${this._reactor.name}' to produce no '${type.name}'.`);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
/** Replay, redelivery and scheduler semantics need a separate kernel-backed increment. */
|
|
154
|
+
async replay() {
|
|
155
|
+
throw new UnsupportedReactorOperation('replay', this._reactor.name, 'Replay scheduling and observation state are not supported.');
|
|
156
|
+
}
|
|
157
|
+
async redeliver() {
|
|
158
|
+
throw new UnsupportedReactorOperation('redeliver', this._reactor.name, 'Retry and checkpoint semantics are not supported.');
|
|
159
|
+
}
|
|
160
|
+
async deliver(sourceId, input, setup) {
|
|
161
|
+
if (this._failed)
|
|
162
|
+
throw new UnsupportedReactorOperation('delivery.afterFailure', this._reactor.name, 'A previous delivery failed; failed-partition retries are not supported.');
|
|
163
|
+
if (this._busy)
|
|
164
|
+
throw new UnsupportedReactorOperation('delivery.overlap', this._reactor.name, 'Concurrent deliveries have unproven ordering.');
|
|
165
|
+
this._busy = true;
|
|
166
|
+
try {
|
|
167
|
+
if (!setup && !input.length) {
|
|
168
|
+
throw new UnsupportedReactorOperation('when.events', this._reactor.name, 'Empty action batches are not fixture-backed.');
|
|
169
|
+
}
|
|
170
|
+
const before = this._events.appendedEvents.length;
|
|
171
|
+
if (setup) {
|
|
172
|
+
await this._events.given.forEventSource(sourceId).events(...input);
|
|
173
|
+
}
|
|
174
|
+
else {
|
|
175
|
+
const results = await this._events.when.forEventSource(sourceId).events(...input);
|
|
176
|
+
if (results.some(result => !result.isSuccess))
|
|
177
|
+
throw new Error('ReactorScenario action append failed.');
|
|
178
|
+
}
|
|
179
|
+
const events = this._events.appendedEvents.slice(before);
|
|
180
|
+
if (events.length)
|
|
181
|
+
await this.process(sourceId, events);
|
|
182
|
+
}
|
|
183
|
+
finally {
|
|
184
|
+
this._busy = false;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
violation(operation, reason) {
|
|
188
|
+
return this.latch(new UnsupportedReactorOperation(operation, this._reactor.name, reason));
|
|
189
|
+
}
|
|
190
|
+
latch(error) {
|
|
191
|
+
// Attribute the call to the delivery whose async context made it, and only while that delivery is running.
|
|
192
|
+
const delivery = this._deliveryContext.getStore();
|
|
193
|
+
if (delivery && delivery === this._delivery &&
|
|
194
|
+
(error instanceof UnsupportedReactorOperation || error instanceof UnsupportedEventSequenceOperation)) {
|
|
195
|
+
delivery.violation ??= error;
|
|
196
|
+
}
|
|
197
|
+
return error;
|
|
198
|
+
}
|
|
199
|
+
throwIfViolated(delivery) {
|
|
200
|
+
if (delivery.violation)
|
|
201
|
+
throw delivery.violation;
|
|
202
|
+
}
|
|
203
|
+
async process(sourceId, events) {
|
|
204
|
+
const delivery = {};
|
|
205
|
+
this._delivery = delivery;
|
|
206
|
+
const deliveryIndex = this._deliveryIndex++;
|
|
207
|
+
const handled = [];
|
|
208
|
+
const skipped = [];
|
|
209
|
+
const outcome = { sourceId, handled, skipped, completed: false };
|
|
210
|
+
const services = { eventStore: this._store, readModels: this._store.readModels, signal: this._controller.signal };
|
|
211
|
+
const first = events.find(event => !!selectReactorHandler(this._entries, this._reactor, this._instance, event.eventType.id.value, event.context.observationState ?? 0)?.methodName);
|
|
212
|
+
const process = async (artifact) => {
|
|
213
|
+
for (const event of events) {
|
|
214
|
+
// EventScenario's serialized history is the committed boundary, not the original input instance.
|
|
215
|
+
if (event.context.observationState !== 1) {
|
|
216
|
+
throw new UnsupportedReactorOperation('delivery.observationState', this._reactor.name, 'Only initial live delivery is fixture-backed.');
|
|
217
|
+
}
|
|
218
|
+
const selection = selectReactorHandler(this._entries, this._reactor, artifact.instance, event.eventType.id.value, event.context.observationState);
|
|
219
|
+
if (!selection?.methodName || selection.skipReplay) {
|
|
220
|
+
skipped.push(event.context);
|
|
221
|
+
continue;
|
|
222
|
+
}
|
|
223
|
+
await invokeReactorHandler(artifact, selection.methodName, event.content, event.context, services, result => {
|
|
224
|
+
// A swallowed unsupported call fails this event like a throwing handler: nothing is recorded.
|
|
225
|
+
this.throwIfViolated(delivery);
|
|
226
|
+
return this.record(result, event.context, selection.methodName, deliveryIndex);
|
|
227
|
+
});
|
|
228
|
+
this.throwIfViolated(delivery);
|
|
229
|
+
handled.push(event.context);
|
|
230
|
+
}
|
|
231
|
+
};
|
|
232
|
+
try {
|
|
233
|
+
await this._deliveryContext.run(delivery, async () => {
|
|
234
|
+
if (first && this._options.artifactActivator) {
|
|
235
|
+
await withActivatedArtifact(this._reactor, { kind: ArtifactKind.Reactor,
|
|
236
|
+
artifactId: getReactorMetadata(this._reactor).id.value, eventStore: this._store,
|
|
237
|
+
readModels: services.readModels, eventSequenceId: 'event-log', partition: sourceId,
|
|
238
|
+
signal: services.signal, delivery: ArtifactDelivery.Events, eventContext: first.context }, this._options.artifactActivator, process);
|
|
239
|
+
}
|
|
240
|
+
else {
|
|
241
|
+
await process({ instance: this._instance ?? {} });
|
|
242
|
+
}
|
|
243
|
+
});
|
|
244
|
+
// A handler that catches an unsupported-service rejection must not turn it into a successful delivery.
|
|
245
|
+
this.throwIfViolated(delivery);
|
|
246
|
+
outcome.completed = true;
|
|
247
|
+
}
|
|
248
|
+
catch (error) {
|
|
249
|
+
outcome.error = error;
|
|
250
|
+
this._failed = true;
|
|
251
|
+
throw error;
|
|
252
|
+
}
|
|
253
|
+
finally {
|
|
254
|
+
if (this._delivery === delivery)
|
|
255
|
+
this._delivery = undefined;
|
|
256
|
+
this._results.push(Object.freeze({ ...outcome, handled: Object.freeze([...handled]), skipped: Object.freeze([...skipped]) }));
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
async record(result, context, handler, deliveryIndex) {
|
|
260
|
+
if (await this._options.resultHandler?.(result, context, this._reactor, this._options.eventStore ?? 'test-event-store', this._options.namespace ?? 'default'))
|
|
261
|
+
return;
|
|
262
|
+
if (result == null)
|
|
263
|
+
return;
|
|
264
|
+
const items = Array.isArray(result) ? result : [result];
|
|
265
|
+
const events = normalizeReactorSideEffects(result, context.eventSourceId, context.eventStreamType ?? 'Default', context.eventStreamId ?? context.eventSourceId);
|
|
266
|
+
if (items.length !== events.length || events.some(entry => !this._eventTypes.includes(entry.event.constructor))) {
|
|
267
|
+
throw new UnsupportedReactorOperation('handler.return', this._reactor.name, 'Only registered events and production EventForEventSourceId wrappers may be recorded; commands and unknown values are unsupported.');
|
|
268
|
+
}
|
|
269
|
+
for (const target of events) {
|
|
270
|
+
this._effects.push(Object.freeze({ kind: 'event', value: target.event, target, triggeringContext: context,
|
|
271
|
+
handler, deliveryIndex }));
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
//# sourceMappingURL=ReactorScenario.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ReactorScenario.js","sourceRoot":"","sources":["../../testing/ReactorScenario.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG;AAErG,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAErD,OAAO,EAAE,8BAA8B,EAAE,MAAM,gDAAgD,CAAC;AAChG,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAC;AACpE,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAE5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,uCAAuC,CAAC;AAG9E,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,yCAAyC,CAAC;AAI3E,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AAGxE,OAAO,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AACpH,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,2BAA2B,EAAE,MAAM,mCAAmC,CAAC;AAEhF,OAAO,EAAE,aAAa,EAAE,MAAM,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CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,iBAAiB,EAAE,OAAO;gBACrG,OAAO,EAAE,aAAa,EAAE,CAAC,CAAC,CAAC;QACnC,CAAC;IACL,CAAC;CACJ"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Constructor } from '@cratis/fundamentals';
|
|
2
|
+
import type { ClientArtifactsActivator } from '../artifacts/ClientArtifactsActivator.js';
|
|
3
|
+
import type { IEventStore } from '../IEventStore.js';
|
|
4
|
+
import type { ReactorResultHandler } from '../reactors/ReactorResultHandler.js';
|
|
5
|
+
import type { EventScenarioOptions } from './EventScenarioOptions.js';
|
|
6
|
+
/** Reactor delivery over a fixture-bounded EventScenario catalog. */
|
|
7
|
+
export interface ReactorScenarioOptions extends EventScenarioOptions {
|
|
8
|
+
/** Production activation hook, including constructor injection and per-delivery completion. */
|
|
9
|
+
artifactActivator?: ClientArtifactsActivator;
|
|
10
|
+
/** Optional explicit test double; without one only the event log is available through services. */
|
|
11
|
+
servicesEventStore?: IEventStore;
|
|
12
|
+
/** Application result hook. A true result claims the entire return value; false uses event recording. */
|
|
13
|
+
resultHandler?: ReactorResultHandler;
|
|
14
|
+
/** Reserved for a later increment; commands cannot be classified in basic reactor scenarios. */
|
|
15
|
+
commandTypes?: Constructor[];
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=ReactorScenarioOptions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ReactorScenarioOptions.d.ts","sourceRoot":"","sources":["../../testing/ReactorScenarioOptions.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,0CAA0C,CAAC;AACzF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAChF,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEtE,qEAAqE;AACrE,MAAM,WAAW,sBAAuB,SAAQ,oBAAoB;IAChE,+FAA+F;IAC/F,iBAAiB,CAAC,EAAE,wBAAwB,CAAC;IAC7C,mGAAmG;IACnG,kBAAkB,CAAC,EAAE,WAAW,CAAC;IACjC,yGAAyG;IACzG,aAAa,CAAC,EAAE,oBAAoB,CAAC;IACrC,gGAAgG;IAChG,YAAY,CAAC,EAAE,WAAW,EAAE,CAAC;CAChC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ReactorScenarioOptions.js","sourceRoot":"","sources":["../../testing/ReactorScenarioOptions.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { EventContext } from '../events/EventContext.js';
|
|
2
|
+
import type { EventForEventSourceId } from '../eventSequences/EventForEventSourceId.js';
|
|
3
|
+
/** A returned event recorded without appending, executing or recursively delivering it. */
|
|
4
|
+
export interface RecordedReactorSideEffect {
|
|
5
|
+
readonly kind: 'event';
|
|
6
|
+
readonly value: object;
|
|
7
|
+
readonly target: EventForEventSourceId;
|
|
8
|
+
readonly triggeringContext: EventContext;
|
|
9
|
+
readonly handler: string;
|
|
10
|
+
/** Zero-based index of the source-partition delivery, shared by effects from that batch. */
|
|
11
|
+
readonly deliveryIndex: number;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=RecordedReactorSideEffect.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RecordedReactorSideEffect.d.ts","sourceRoot":"","sources":["../../testing/RecordedReactorSideEffect.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAC9D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,4CAA4C,CAAC;AAExF,2FAA2F;AAC3F,MAAM,WAAW,yBAAyB;IACtC,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,qBAAqB,CAAC;IACvC,QAAQ,CAAC,iBAAiB,EAAE,YAAY,CAAC;IACzC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,4FAA4F;IAC5F,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;CAClC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RecordedReactorSideEffect.js","sourceRoot":"","sources":["../../testing/RecordedReactorSideEffect.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** An operation whose kernel/observer semantics have not been established for this scenario. */
|
|
2
|
+
export declare class UnsupportedReactorOperation extends Error {
|
|
3
|
+
readonly operation: string;
|
|
4
|
+
readonly artifact: string;
|
|
5
|
+
constructor(operation: string, artifact: string, reason: string);
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=UnsupportedReactorOperation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UnsupportedReactorOperation.d.ts","sourceRoot":"","sources":["../../testing/UnsupportedReactorOperation.ts"],"names":[],"mappings":"AAGA,gGAAgG;AAChG,qBAAa,2BAA4B,SAAQ,KAAK;IACtC,QAAQ,CAAC,SAAS,EAAE,MAAM;IAAE,QAAQ,CAAC,QAAQ,EAAE,MAAM;IAAjE,YAAqB,SAAS,EAAE,MAAM,EAAW,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAGhF;CACJ"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
2
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
3
|
+
/** An operation whose kernel/observer semantics have not been established for this scenario. */
|
|
4
|
+
export class UnsupportedReactorOperation extends Error {
|
|
5
|
+
operation;
|
|
6
|
+
artifact;
|
|
7
|
+
constructor(operation, artifact, reason) {
|
|
8
|
+
super(`Unsupported reactor operation '${operation}' for '${artifact}': ${reason} Use a kernel-backed test.`);
|
|
9
|
+
this.operation = operation;
|
|
10
|
+
this.artifact = artifact;
|
|
11
|
+
this.name = 'UnsupportedReactorOperation';
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=UnsupportedReactorOperation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UnsupportedReactorOperation.js","sourceRoot":"","sources":["../../testing/UnsupportedReactorOperation.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG;AAErG,gGAAgG;AAChG,MAAM,OAAO,2BAA4B,SAAQ,KAAK;IAC7B,SAAS;IAAmB,QAAQ;IAAzD,YAAqB,SAAiB,EAAW,QAAgB,EAAE,MAAc;QAC7E,KAAK,CAAC,kCAAkC,SAAS,UAAU,QAAQ,MAAM,MAAM,4BAA4B,CAAC,CAAC;yBAD5F,SAAS;wBAAmB,QAAQ;QAErD,IAAI,CAAC,IAAI,GAAG,6BAA6B,CAAC;IAC9C,CAAC;CACJ"}
|
package/dist/testing/index.d.ts
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
export { EventScenario } from './EventScenario.js';
|
|
2
|
+
export { ReactorScenario } from './ReactorScenario.js';
|
|
3
|
+
export type { ReactorScenarioOptions } from './ReactorScenarioOptions.js';
|
|
4
|
+
export type { ReactorDeliveryResult } from './ReactorDeliveryResult.js';
|
|
5
|
+
export type { RecordedReactorSideEffect } from './RecordedReactorSideEffect.js';
|
|
6
|
+
export { UnsupportedReactorOperation } from './UnsupportedReactorOperation.js';
|
|
2
7
|
export type { EventScenarioOptions } from './EventScenarioOptions.js';
|
|
3
8
|
export { EventScenarioGivenBuilder } from './EventScenarioGivenBuilder.js';
|
|
4
9
|
export { EventScenarioGiven } from './EventScenarioGiven.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../testing/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,YAAY,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,iCAAiC,EAAE,MAAM,wCAAwC,CAAC;AAC3F,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,6BAA6B,EAAE,MAAM,oCAAoC,CAAC;AACnF,OAAO,EAAE,8BAA8B,EAAE,MAAM,iDAAiD,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../testing/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,YAAY,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAC1E,YAAY,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AACxE,YAAY,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAChF,OAAO,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAC;AAC/E,YAAY,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,iCAAiC,EAAE,MAAM,wCAAwC,CAAC;AAC3F,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,6BAA6B,EAAE,MAAM,oCAAoC,CAAC;AACnF,OAAO,EAAE,8BAA8B,EAAE,MAAM,iDAAiD,CAAC"}
|
package/dist/testing/index.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
// Copyright (c) Cratis. All rights reserved.
|
|
2
2
|
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
3
3
|
export { EventScenario } from './EventScenario.js';
|
|
4
|
+
export { ReactorScenario } from './ReactorScenario.js';
|
|
5
|
+
export { UnsupportedReactorOperation } from './UnsupportedReactorOperation.js';
|
|
4
6
|
export { EventScenarioGivenBuilder } from './EventScenarioGivenBuilder.js';
|
|
5
7
|
export { EventScenarioGiven } from './EventScenarioGiven.js';
|
|
6
8
|
export { EventScenarioWhenBuilder } from './EventScenarioWhenBuilder.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../testing/index.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG;AAErG,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../testing/index.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG;AAErG,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAIvD,OAAO,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAC;AAE/E,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,iCAAiC,EAAE,MAAM,wCAAwC,CAAC;AAC3F,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EAAE,6BAA6B,EAAE,MAAM,oCAAoC,CAAC;AACnF,OAAO,EAAE,8BAA8B,EAAE,MAAM,iDAAiD,CAAC"}
|