@cratis/chronicle 6.19.0 → 6.21.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/eventSequences/EventSequence.d.ts.map +1 -1
- package/dist/eventSequences/EventSequence.js +8 -109
- package/dist/eventSequences/EventSequence.js.map +1 -1
- package/dist/eventSequences/createAppendNotification.d.ts +15 -0
- package/dist/eventSequences/createAppendNotification.d.ts.map +1 -0
- package/dist/eventSequences/createAppendNotification.js +25 -0
- package/dist/eventSequences/createAppendNotification.js.map +1 -0
- package/dist/eventSequences/prepareBatchAppend.d.ts +31 -0
- package/dist/eventSequences/prepareBatchAppend.d.ts.map +1 -0
- package/dist/eventSequences/prepareBatchAppend.js +54 -0
- package/dist/eventSequences/prepareBatchAppend.js.map +1 -0
- package/dist/eventSequences/prepareSingleAppend.d.ts +12 -0
- package/dist/eventSequences/prepareSingleAppend.d.ts.map +1 -0
- package/dist/eventSequences/prepareSingleAppend.js +22 -0
- package/dist/eventSequences/prepareSingleAppend.js.map +1 -0
- package/dist/testing/EventScenario.d.ts +29 -0
- package/dist/testing/EventScenario.d.ts.map +1 -0
- package/dist/testing/EventScenario.js +63 -0
- package/dist/testing/EventScenario.js.map +1 -0
- package/dist/testing/EventScenarioGiven.d.ts +9 -0
- package/dist/testing/EventScenarioGiven.d.ts.map +1 -0
- package/dist/testing/EventScenarioGiven.js +16 -0
- package/dist/testing/EventScenarioGiven.js.map +1 -0
- package/dist/testing/EventScenarioGivenBuilder.d.ts +9 -0
- package/dist/testing/EventScenarioGivenBuilder.d.ts.map +1 -0
- package/dist/testing/EventScenarioGivenBuilder.js +12 -0
- package/dist/testing/EventScenarioGivenBuilder.js.map +1 -0
- package/dist/testing/EventScenarioOptions.d.ts +21 -0
- package/dist/testing/EventScenarioOptions.d.ts.map +1 -0
- package/dist/testing/EventScenarioOptions.js +4 -0
- package/dist/testing/EventScenarioOptions.js.map +1 -0
- package/dist/testing/EventScenarioSeed.d.ts +5 -0
- package/dist/testing/EventScenarioSeed.d.ts.map +1 -0
- package/dist/testing/EventScenarioSeed.js +14 -0
- package/dist/testing/EventScenarioSeed.js.map +1 -0
- package/dist/testing/EventScenarioWhen.d.ts +11 -0
- package/dist/testing/EventScenarioWhen.d.ts.map +1 -0
- package/dist/testing/EventScenarioWhen.js +16 -0
- package/dist/testing/EventScenarioWhen.js.map +1 -0
- package/dist/testing/EventScenarioWhenBuilder.d.ts +9 -0
- package/dist/testing/EventScenarioWhenBuilder.d.ts.map +1 -0
- package/dist/testing/EventScenarioWhenBuilder.js +12 -0
- package/dist/testing/EventScenarioWhenBuilder.js.map +1 -0
- package/dist/testing/InProcessEventSequence.d.ts +60 -0
- package/dist/testing/InProcessEventSequence.d.ts.map +1 -0
- package/dist/testing/InProcessEventSequence.js +462 -0
- package/dist/testing/InProcessEventSequence.js.map +1 -0
- package/dist/testing/UnsupportedEventSequenceOperation.d.ts +5 -0
- package/dist/testing/UnsupportedEventSequenceOperation.d.ts.map +1 -0
- package/dist/testing/UnsupportedEventSequenceOperation.js +10 -0
- package/dist/testing/UnsupportedEventSequenceOperation.js.map +1 -0
- package/dist/testing/index.d.ts +7 -0
- package/dist/testing/index.d.ts.map +1 -1
- package/dist/testing/index.js +6 -0
- package/dist/testing/index.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/eventSequences/EventSequence.ts +12 -119
- package/eventSequences/createAppendNotification.ts +35 -0
- package/eventSequences/prepareBatchAppend.ts +63 -0
- package/eventSequences/prepareSingleAppend.ts +25 -0
- package/package.json +1 -1
- package/testing/EventScenario.batches.spec.ts +537 -0
- package/testing/EventScenario.fixtures.spec.ts +260 -0
- package/testing/EventScenario.rejections.spec.ts +273 -0
- package/testing/EventScenario.ts +79 -0
- package/testing/EventScenarioGiven.ts +13 -0
- package/testing/EventScenarioGivenBuilder.ts +11 -0
- package/testing/EventScenarioOptions.ts +20 -0
- package/testing/EventScenarioSeed.ts +17 -0
- package/testing/EventScenarioWhen.ts +14 -0
- package/testing/EventScenarioWhenBuilder.ts +11 -0
- package/testing/InProcessEventSequence.ts +460 -0
- package/testing/UnsupportedEventSequenceOperation.ts +10 -0
- package/testing/index.ts +7 -0
|
@@ -0,0 +1,462 @@
|
|
|
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 { createHash } from 'node:crypto';
|
|
4
|
+
import { EventObservationState } from '@cratis/chronicle.contracts';
|
|
5
|
+
import { AppendOperationsBroadcaster } from '../eventSequences/AppendOperationsBroadcaster.js';
|
|
6
|
+
import { prepareBatchAppend } from '../eventSequences/prepareBatchAppend.js';
|
|
7
|
+
import { createAppendNotification, mapAppendNotificationCausation } from '../eventSequences/createAppendNotification.js';
|
|
8
|
+
import { Guid } from '@cratis/fundamentals';
|
|
9
|
+
import { getEventTypeMetadata, getEventTypeFor } from '../events/eventTypeDecorator.js';
|
|
10
|
+
import { getTagsFor } from '../events/tagDecorator.js';
|
|
11
|
+
import { Tag } from '../events/Tag.js';
|
|
12
|
+
import { EventType } from '../events/EventType.js';
|
|
13
|
+
import { EventTypeId } from '../events/EventTypeId.js';
|
|
14
|
+
import { EventTypeGeneration } from '../events/EventTypeGeneration.js';
|
|
15
|
+
import { Identity } from '../identity/Identity.js';
|
|
16
|
+
import { EventSequenceId } from '../eventSequences/EventSequenceId.js';
|
|
17
|
+
import { EventSequenceNumber } from '../eventSequences/EventSequenceNumber.js';
|
|
18
|
+
import { prepareSingleAppend } from '../eventSequences/prepareSingleAppend.js';
|
|
19
|
+
import { toContractsGuid } from '../connection/Guid.js';
|
|
20
|
+
import { getUniqueEventMetadata, getUniquePropertyMetadata } from '../events/constraints/unique.js';
|
|
21
|
+
import { getRemovedConstraintNames } from '../events/constraints/removeConstraint.js';
|
|
22
|
+
import { UnsupportedEventSequenceOperation } from './UnsupportedEventSequenceOperation.js';
|
|
23
|
+
// JS trim() omits U+0085, which the kernel trims. Reject unproven non-ASCII whitespace and controls.
|
|
24
|
+
const unprovenFilterCharacters = /[\u007f-\u009f]|(?=[^\x00-\x7f])\p{White_Space}/u;
|
|
25
|
+
/** Fixture-backed, scenario-local append sequence; no kernel or observer scheduler is started. */
|
|
26
|
+
export class InProcessEventSequence {
|
|
27
|
+
id;
|
|
28
|
+
_catalog = new Map();
|
|
29
|
+
_history = [];
|
|
30
|
+
_store;
|
|
31
|
+
_namespace;
|
|
32
|
+
_clock;
|
|
33
|
+
_correlationId;
|
|
34
|
+
_setup = false;
|
|
35
|
+
_allowSeedAppend = false;
|
|
36
|
+
_stagedSeeds;
|
|
37
|
+
_stagedNotifications;
|
|
38
|
+
_busy = false;
|
|
39
|
+
_results = [];
|
|
40
|
+
appendOperations = new AppendOperationsBroadcaster();
|
|
41
|
+
constructor(options, eventTypes) {
|
|
42
|
+
if (options.eventSequenceId && options.eventSequenceId.value !== EventSequenceId.eventLog.value) {
|
|
43
|
+
throw this.unsupported('options.eventSequenceId', options.eventSequenceId.value, 'Custom sequences are not fixture-backed.');
|
|
44
|
+
}
|
|
45
|
+
this.id = options.eventSequenceId ?? EventSequenceId.eventLog;
|
|
46
|
+
if (options.eventStore !== undefined && options.eventStore !== 'test-event-store') {
|
|
47
|
+
throw this.unsupported('options.eventStore', options.eventStore, 'Custom event stores are not fixture-backed.');
|
|
48
|
+
}
|
|
49
|
+
if (options.namespace !== undefined && options.namespace !== 'default') {
|
|
50
|
+
throw this.unsupported('options.namespace', options.namespace, 'Custom namespaces are not fixture-backed.');
|
|
51
|
+
}
|
|
52
|
+
this._store = options.eventStore ?? 'test-event-store';
|
|
53
|
+
this._namespace = options.namespace ?? 'default';
|
|
54
|
+
this._clock = options.clock ?? (() => new Date());
|
|
55
|
+
this._correlationId = options.correlationId;
|
|
56
|
+
const ids = new Set();
|
|
57
|
+
for (const type of eventTypes) {
|
|
58
|
+
const metadata = getEventTypeMetadata(type);
|
|
59
|
+
if (!metadata)
|
|
60
|
+
throw this.unsupported('artifacts.eventTypes', type.name, 'Event type has no @eventType metadata.');
|
|
61
|
+
const eventType = metadata.eventType;
|
|
62
|
+
if (!eventType.id.value.trim() || eventType.id.value !== eventType.id.value.trim() ||
|
|
63
|
+
unprovenFilterCharacters.test(eventType.id.value) || eventType.id.value.includes(',')) {
|
|
64
|
+
throw this.unsupported('artifacts.eventTypes.id', eventType.id.value, 'Comma-separated or padded event IDs have unproven filter behavior.');
|
|
65
|
+
}
|
|
66
|
+
if (ids.has(eventType.id.value))
|
|
67
|
+
throw this.unsupported('artifacts.eventTypes', type.name, 'Duplicate event ID or generation history.');
|
|
68
|
+
ids.add(eventType.id.value);
|
|
69
|
+
if (eventType.generation.value !== 1 || eventType.tombstone) {
|
|
70
|
+
throw this.unsupported('artifacts.eventTypes', type.name, 'Only generation 1, non-tombstone events are proven.');
|
|
71
|
+
}
|
|
72
|
+
if (options.constraints !== 'disabled' && (getUniqueEventMetadata(type) || getRemovedConstraintNames(type).length ||
|
|
73
|
+
[...metadata.members.keys()].some(key => getUniquePropertyMetadata(type, key)))) {
|
|
74
|
+
throw this.unsupported('artifacts.eventTypes.constraints', type.name, 'Constraint metadata is not supported in this increment.');
|
|
75
|
+
}
|
|
76
|
+
if (getTagsFor(type).length)
|
|
77
|
+
throw this.unsupported('artifacts.eventTypes.tags', type.name, 'Tagged events are not fixture-backed.');
|
|
78
|
+
// Validate the complete schema, not only properties present on a particular event.
|
|
79
|
+
const schema = metadata.schema;
|
|
80
|
+
if (schema.type !== 'object' || schema.compliance?.length || schema.security?.length ||
|
|
81
|
+
schema.enum !== undefined || schema.items !== undefined || schema.format !== undefined ||
|
|
82
|
+
schema.additionalProperties !== false ||
|
|
83
|
+
schema.required?.length !== Object.keys(schema.properties ?? {}).length ||
|
|
84
|
+
!schema.properties || Object.keys(schema.properties).length === 0 ||
|
|
85
|
+
Object.entries(schema.properties).some(([key, property]) => !/^[a-z][a-zA-Z0-9]*$/.test(key) || !['string', 'boolean'].includes(property.type ?? '') ||
|
|
86
|
+
property.format !== undefined || property.compliance?.length || property.security?.length ||
|
|
87
|
+
property.items !== undefined || property.properties !== undefined || property.enum !== undefined ||
|
|
88
|
+
property.additionalProperties !== undefined)) {
|
|
89
|
+
throw this.unsupported('artifacts.eventTypes.schema', type.name, 'Only flat, unclassified string/boolean fields are fixture-backed.');
|
|
90
|
+
}
|
|
91
|
+
this._catalog.set(type, metadata);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
get results() { return Object.freeze([...this._results]); }
|
|
95
|
+
get appendedEvents() { return Object.freeze(this._history.map(event => this.snapshot(event))); }
|
|
96
|
+
/** Validate and stage all setup appends, then commit and notify in single-append order. */
|
|
97
|
+
async seed(source, events) {
|
|
98
|
+
if (this._setup || this._busy)
|
|
99
|
+
throw this.unsupported('given.events', this.id.value, 'Overlapping setup calls are not fixture-backed.');
|
|
100
|
+
this._setup = true;
|
|
101
|
+
this._stagedSeeds = [];
|
|
102
|
+
this._stagedNotifications = [];
|
|
103
|
+
try {
|
|
104
|
+
for (const event of events) {
|
|
105
|
+
this._allowSeedAppend = true;
|
|
106
|
+
let pending;
|
|
107
|
+
try {
|
|
108
|
+
pending = this.append(source, event);
|
|
109
|
+
}
|
|
110
|
+
finally {
|
|
111
|
+
this._allowSeedAppend = false;
|
|
112
|
+
}
|
|
113
|
+
const result = await pending;
|
|
114
|
+
if (!result.isSuccess)
|
|
115
|
+
throw new Error(`EventScenario given setup failed: ${JSON.stringify(result)}`);
|
|
116
|
+
}
|
|
117
|
+
for (const [index, stored] of this._stagedSeeds.entries()) {
|
|
118
|
+
this._history.push(stored);
|
|
119
|
+
this.appendOperations.publish(this._stagedNotifications[index]);
|
|
120
|
+
// Let an async subscriber observe this append before the next enters history.
|
|
121
|
+
await Promise.resolve();
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
finally {
|
|
125
|
+
this._stagedSeeds = undefined;
|
|
126
|
+
this._stagedNotifications = undefined;
|
|
127
|
+
this._setup = false;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
get transactional() { throw this.unsupported('transactional', this.id.value, 'Transactions require a kernel.'); }
|
|
131
|
+
async append(eventSourceId, event, options) {
|
|
132
|
+
if (this._busy || (this._setup && !this._allowSeedAppend)) {
|
|
133
|
+
throw this.unsupported('append', this.id.value, 'Overlapping calls do not have proven ordering.');
|
|
134
|
+
}
|
|
135
|
+
this._busy = true;
|
|
136
|
+
try {
|
|
137
|
+
if (!event || typeof event !== 'object')
|
|
138
|
+
throw this.unsupported('append.event', this.id.value, 'Only registered event instances are supported.');
|
|
139
|
+
if (!/^[A-Za-z0-9_-]+$/.test(eventSourceId))
|
|
140
|
+
throw this.unsupported('append.source', eventSourceId, 'Only simple source identifiers are fixture-backed.');
|
|
141
|
+
if (options && (Reflect.ownKeys(options).length || options.correlationId !== undefined || options.sourceType !== undefined ||
|
|
142
|
+
options.streamType !== undefined || options.streamId !== undefined || options.subject !== undefined ||
|
|
143
|
+
options.occurred !== undefined || options.eventSourceId !== undefined || options.concurrencyScope !== undefined ||
|
|
144
|
+
options.tags !== undefined || options.concurrencyScopes !== undefined)) {
|
|
145
|
+
throw this.unsupported('append.options', event.constructor.name, 'Append metadata, routing and concurrency are not fixture-backed.');
|
|
146
|
+
}
|
|
147
|
+
const metadata = this._catalog.get(event.constructor);
|
|
148
|
+
if (!metadata)
|
|
149
|
+
throw this.unsupported('append.event', event.constructor.name, 'Event is not in the selected, validated catalog.');
|
|
150
|
+
let prepared;
|
|
151
|
+
let content;
|
|
152
|
+
try {
|
|
153
|
+
prepared = prepareSingleAppend(event, this._correlationId ? { correlationId: this._correlationId() } : undefined);
|
|
154
|
+
content = JSON.parse(prepared.content);
|
|
155
|
+
}
|
|
156
|
+
catch (error) {
|
|
157
|
+
throw this.unsupported('append.serialization', event.constructor.name, `Payload or metadata could not be serialized: ${String(error)}.`);
|
|
158
|
+
}
|
|
159
|
+
try {
|
|
160
|
+
toContractsGuid(prepared.correlationId);
|
|
161
|
+
if (!/^[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i.test(prepared.correlationId.toString()))
|
|
162
|
+
throw new Error('Invalid correlation ID.');
|
|
163
|
+
}
|
|
164
|
+
catch {
|
|
165
|
+
throw this.unsupported('append.correlationId', event.constructor.name, 'Correlation ID must be a valid GUID.');
|
|
166
|
+
}
|
|
167
|
+
if (prepared.identity !== Identity.system || prepared.causationChain.length !== 2 ||
|
|
168
|
+
Object.keys(prepared.causationChain[0].properties).length !== 0) {
|
|
169
|
+
throw this.unsupported('append.context', event.constructor.name, 'Ambient identity or causation metadata is not fixture-backed.');
|
|
170
|
+
}
|
|
171
|
+
const properties = metadata.schema.properties;
|
|
172
|
+
if (!content || typeof content !== 'object' || Array.isArray(content) ||
|
|
173
|
+
Object.keys(content).length !== Object.keys(properties).length ||
|
|
174
|
+
Object.entries(properties).some(([key, property]) => typeof content[key] !== property.type ||
|
|
175
|
+
(property.type === 'string' && !/^[\x20-\x21\x23-\x5b\x5d-\x7e\u00e9]*$/.test(content[key])))) {
|
|
176
|
+
throw this.unsupported('append.content', event.constructor.name, 'Content differs from the flat scalar schema; null, missing and extra values are not proven.');
|
|
177
|
+
}
|
|
178
|
+
const occurred = this._clock();
|
|
179
|
+
// Date has millisecond precision; only the UTC year range representable by DateTimeOffset is supported.
|
|
180
|
+
if (!(occurred instanceof Date) || Number.isNaN(occurred.getTime()) ||
|
|
181
|
+
occurred.getUTCFullYear() < 1 || occurred.getUTCFullYear() > 9999) {
|
|
182
|
+
throw this.unsupported('append.clock', event.constructor.name, 'Clock must return a valid Date within UTC years 1–9999 (millisecond precision).');
|
|
183
|
+
}
|
|
184
|
+
const canonical = Object.fromEntries(Object.entries(content).sort(([a], [b]) => a < b ? -1 : a > b ? 1 : 0));
|
|
185
|
+
const hash = createHash('sha256').update(`${prepared.eventType.id.value}|${eventSourceId}|${JSON.stringify(canonical)}`).digest('base64');
|
|
186
|
+
const sequenceNumber = new EventSequenceNumber(BigInt(this._history.length + (this._stagedSeeds?.length ?? 0)));
|
|
187
|
+
const stored = {
|
|
188
|
+
eventType: prepared.eventType,
|
|
189
|
+
content,
|
|
190
|
+
context: {
|
|
191
|
+
eventStore: this._store, namespace: this._namespace,
|
|
192
|
+
sequenceNumber: sequenceNumber.value, eventSourceId,
|
|
193
|
+
eventSourceType: 'Default', eventStreamType: 'All', eventStreamId: 'Default',
|
|
194
|
+
subject: eventSourceId, hash, causedBy: prepared.identity, observationState: EventObservationState.Initial,
|
|
195
|
+
eventType: prepared.eventType, occurred, correlationId: prepared.correlationId.toString(),
|
|
196
|
+
causation: prepared.causationChain.map(item => ({ type: item.type.name, occurred: item.occurred, properties: { ...item.properties } })),
|
|
197
|
+
tags: prepared.tags.map(tag => new Tag(tag))
|
|
198
|
+
}
|
|
199
|
+
};
|
|
200
|
+
if (this._stagedSeeds)
|
|
201
|
+
this._stagedSeeds.push(this.snapshot(stored));
|
|
202
|
+
else
|
|
203
|
+
this._history.push(this.snapshot(stored));
|
|
204
|
+
const result = this.success(sequenceNumber, event.constructor.name);
|
|
205
|
+
if (!this._setup)
|
|
206
|
+
this._results.push(result);
|
|
207
|
+
if (this._stagedNotifications || this.appendOperations.hasSubscribers) {
|
|
208
|
+
const notification = [createAppendNotification(eventSourceId, event, result, prepared.correlationId.toString(), mapAppendNotificationCausation(prepared.causationChain), prepared.tags)];
|
|
209
|
+
if (this._stagedNotifications)
|
|
210
|
+
this._stagedNotifications.push(notification);
|
|
211
|
+
else
|
|
212
|
+
this.appendOperations.publish(notification);
|
|
213
|
+
}
|
|
214
|
+
return result;
|
|
215
|
+
}
|
|
216
|
+
finally {
|
|
217
|
+
// Keep the append in flight until its promise crosses an async boundary.
|
|
218
|
+
await Promise.resolve();
|
|
219
|
+
this._busy = false;
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
async appendMany(sourceOrEvents, eventsOrOptions, options) {
|
|
223
|
+
if (this._busy || this._setup)
|
|
224
|
+
throw this.unsupported('appendMany', this.id.value, 'Overlapping calls do not have proven ordering.');
|
|
225
|
+
this._busy = true;
|
|
226
|
+
try {
|
|
227
|
+
const entries = typeof sourceOrEvents === 'string' ? eventsOrOptions : sourceOrEvents;
|
|
228
|
+
const shared = typeof sourceOrEvents === 'string' ? options : eventsOrOptions;
|
|
229
|
+
if (!Array.isArray(entries))
|
|
230
|
+
throw this.unsupported('appendMany.arguments', this.id.value, 'Events must be an array.');
|
|
231
|
+
if (!entries.length)
|
|
232
|
+
throw this.unsupported('appendMany.empty', this.id.value, 'The kernel rejects an empty batch.');
|
|
233
|
+
this.validateBatchOptions(shared);
|
|
234
|
+
if (shared?.occurred !== undefined)
|
|
235
|
+
this.checkedDate(shared.occurred, 'appendMany.occurred');
|
|
236
|
+
for (const entry of entries) {
|
|
237
|
+
if (typeof sourceOrEvents === 'string')
|
|
238
|
+
break;
|
|
239
|
+
if (!entry || typeof entry !== 'object' || Reflect.ownKeys(entry).some(key => !['eventSourceId', 'event', 'eventSourceType', 'eventStreamType', 'eventStreamId', 'subject', 'occurred', 'tags'].includes(String(key)))) {
|
|
240
|
+
throw this.unsupported('appendMany.entry', this.id.value, 'Unrecognized per-entry metadata.');
|
|
241
|
+
}
|
|
242
|
+
const individual = entry;
|
|
243
|
+
if (individual.occurred !== undefined)
|
|
244
|
+
this.checkedDate(individual.occurred, 'appendMany.occurred');
|
|
245
|
+
const tags = individual.tags;
|
|
246
|
+
if (tags && (!Array.isArray(tags) || tags.some(tag => typeof tag !== 'string'))) {
|
|
247
|
+
throw this.unsupported('appendMany.tags', this.id.value, 'Only plain string tags are fixture-backed.');
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
let prepared;
|
|
251
|
+
try {
|
|
252
|
+
const batchOptions = shared?.correlationId === undefined && this._correlationId
|
|
253
|
+
? { correlationId: this._correlationId(), sourceType: shared?.sourceType, streamType: shared?.streamType,
|
|
254
|
+
streamId: shared?.streamId, subject: shared?.subject, occurred: shared?.occurred, tags: shared?.tags }
|
|
255
|
+
: shared;
|
|
256
|
+
if (batchOptions?.correlationId !== undefined)
|
|
257
|
+
this.validateGuid(batchOptions.correlationId, 'appendMany.correlationId');
|
|
258
|
+
prepared = typeof sourceOrEvents === 'string'
|
|
259
|
+
? prepareBatchAppend(sourceOrEvents, entries, batchOptions)
|
|
260
|
+
: prepareBatchAppend(sourceOrEvents, batchOptions);
|
|
261
|
+
}
|
|
262
|
+
catch (error) {
|
|
263
|
+
if (error instanceof UnsupportedEventSequenceOperation)
|
|
264
|
+
throw error;
|
|
265
|
+
throw this.unsupported('appendMany.serialization', this.id.value, `Batch preparation failed: ${String(error)}.`);
|
|
266
|
+
}
|
|
267
|
+
const { eventsForEventSourceIds, eventsToAppend, correlationId, batchCausationChain, identity } = prepared;
|
|
268
|
+
this.validateGuid(correlationId, 'appendMany.correlationId');
|
|
269
|
+
if (identity !== Identity.system || batchCausationChain.length !== 2 ||
|
|
270
|
+
Object.keys(batchCausationChain[0].properties).length !== 0 ||
|
|
271
|
+
batchCausationChain[1].type.name !== 'TypeScriptClient.AppendMany' ||
|
|
272
|
+
batchCausationChain[1].properties.count !== String(entries.length)) {
|
|
273
|
+
throw this.unsupported('appendMany.context', this.id.value, 'Ambient identity or causation metadata is not fixture-backed.');
|
|
274
|
+
}
|
|
275
|
+
const staged = eventsForEventSourceIds.map(({ eventSourceId, event }, index) => {
|
|
276
|
+
if (!event || typeof event !== 'object' || !this._catalog.has(event.constructor)) {
|
|
277
|
+
throw this.unsupported('appendMany.event', event?.constructor?.name ?? this.id.value, 'Event is not in the selected catalog.');
|
|
278
|
+
}
|
|
279
|
+
this.validateSource(eventSourceId, 'appendMany.source');
|
|
280
|
+
const wire = eventsToAppend[index];
|
|
281
|
+
for (const [name, value] of Object.entries({ sourceType: wire.EventSourceType, streamType: wire.EventStreamType,
|
|
282
|
+
streamId: wire.EventStreamId, subject: wire.Subject })) {
|
|
283
|
+
if (value !== undefined && (typeof value !== 'string' || !/^[A-Za-z0-9_-]+$/.test(value))) {
|
|
284
|
+
throw this.unsupported(`appendMany.${name}`, String(value), 'Only simple metadata identifiers are fixture-backed.');
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
if (wire.Tags.some(tag => !/^[A-Za-z0-9_-]+$/.test(tag))) {
|
|
288
|
+
throw this.unsupported('appendMany.tags', event.constructor.name, 'Only simple string tags are fixture-backed.');
|
|
289
|
+
}
|
|
290
|
+
const occurred = wire.Occurred ? this.checkedDate(new Date(wire.Occurred.Value), 'appendMany.occurred')
|
|
291
|
+
: this.checkedDate(this._clock(), 'appendMany.clock');
|
|
292
|
+
const content = this.checkedContent(event, wire.Content, 'appendMany.content');
|
|
293
|
+
const canonical = Object.fromEntries(Object.entries(content).sort(([a], [b]) => a < b ? -1 : a > b ? 1 : 0));
|
|
294
|
+
const hash = createHash('sha256').update(`${wire.EventType.Id}|${eventSourceId}|${JSON.stringify(canonical)}`).digest('base64');
|
|
295
|
+
const sequenceNumber = new EventSequenceNumber(BigInt(this._history.length + index));
|
|
296
|
+
const eventType = getEventTypeFor(event.constructor);
|
|
297
|
+
const stored = { eventType, content, context: {
|
|
298
|
+
eventStore: this._store, namespace: this._namespace, sequenceNumber: sequenceNumber.value, eventSourceId,
|
|
299
|
+
eventSourceType: wire.EventSourceType || 'Default', eventStreamType: wire.EventStreamType || 'All',
|
|
300
|
+
eventStreamId: wire.EventStreamId || 'Default', subject: wire.Subject, hash, causedBy: identity,
|
|
301
|
+
observationState: EventObservationState.Initial, eventType, occurred, correlationId: correlationId.toString(),
|
|
302
|
+
causation: batchCausationChain.map(item => ({ type: item.type.name, occurred: item.occurred, properties: { ...item.properties } })),
|
|
303
|
+
tags: wire.Tags.map(tag => new Tag(tag))
|
|
304
|
+
} };
|
|
305
|
+
return { stored, result: this.success(sequenceNumber, event.constructor.name) };
|
|
306
|
+
});
|
|
307
|
+
// Stage and validate every entry before committing any event or result.
|
|
308
|
+
this._history.push(...staged.map(item => this.snapshot(item.stored)));
|
|
309
|
+
const results = staged.map(item => item.result);
|
|
310
|
+
this._results.push(...results);
|
|
311
|
+
if (this.appendOperations.hasSubscribers) {
|
|
312
|
+
const occurredAt = new Date();
|
|
313
|
+
const causationEntries = mapAppendNotificationCausation(batchCausationChain);
|
|
314
|
+
this.appendOperations.publish(staged.map(({ result }, index) => createAppendNotification(eventsForEventSourceIds[index].eventSourceId, eventsForEventSourceIds[index].event, result, correlationId.toString(), causationEntries, eventsToAppend[index].Tags, occurredAt)));
|
|
315
|
+
}
|
|
316
|
+
return results;
|
|
317
|
+
}
|
|
318
|
+
finally {
|
|
319
|
+
await Promise.resolve();
|
|
320
|
+
this._busy = false;
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
async getNextSequenceNumber() { return new EventSequenceNumber(BigInt(this._history.length)); }
|
|
324
|
+
async getTailSequenceNumber(source, sourceType, streamType, streamId, types) {
|
|
325
|
+
if (source !== undefined)
|
|
326
|
+
this.validateReadSource('getTailSequenceNumber.source', source);
|
|
327
|
+
this.validateRouteFilters('getTailSequenceNumber.filters', sourceType, streamType, streamId);
|
|
328
|
+
const ids = this.filterIds(types);
|
|
329
|
+
const last = [...this._history].reverse().find(event => (source === undefined || event.context.eventSourceId === source) &&
|
|
330
|
+
(sourceType === undefined || sourceType === 'Default' || event.context.eventSourceType === sourceType) &&
|
|
331
|
+
(streamType === undefined || streamType === 'All' || event.context.eventStreamType === streamType) &&
|
|
332
|
+
(streamId === undefined || streamId === 'Default' || event.context.eventStreamId === streamId) &&
|
|
333
|
+
(!ids.length || ids.includes(event.eventType.id.value)));
|
|
334
|
+
return last ? new EventSequenceNumber(last.context.sequenceNumber) : EventSequenceNumber.unset;
|
|
335
|
+
}
|
|
336
|
+
async getTailSequenceNumberForObserver(observer) {
|
|
337
|
+
throw this.unsupported('getTailSequenceNumberForObserver', observer.name, 'Observer discovery is not fixture-backed.');
|
|
338
|
+
}
|
|
339
|
+
async hasEventsFor(source) {
|
|
340
|
+
this.validateReadSource('hasEventsFor.source', source);
|
|
341
|
+
return this._history.some(event => event.context.eventSourceId === source);
|
|
342
|
+
}
|
|
343
|
+
async getForEventSourceIdAndEventTypes(source, types, streamType, streamId, sourceType) {
|
|
344
|
+
if (!types.length)
|
|
345
|
+
throw this.unsupported('getForEventSourceIdAndEventTypes.filters', source, 'Explicit event types are required.');
|
|
346
|
+
this.validateReadSource('getForEventSourceIdAndEventTypes.source', source);
|
|
347
|
+
this.validateRouteFilters('getForEventSourceIdAndEventTypes.filters', sourceType, streamType, streamId);
|
|
348
|
+
const ids = this.filterIds(types);
|
|
349
|
+
return this._history.filter(event => event.context.eventSourceId === source && ids.includes(event.eventType.id.value) &&
|
|
350
|
+
(sourceType === undefined || sourceType === 'Default' || event.context.eventSourceType === sourceType) &&
|
|
351
|
+
(streamType === undefined || streamType === 'All' || event.context.eventStreamType === streamType) &&
|
|
352
|
+
(streamId === undefined || streamId === 'Default' || event.context.eventStreamId === streamId)).map(event => this.snapshot(event));
|
|
353
|
+
}
|
|
354
|
+
async getFromSequenceNumber(sequence, source, types) {
|
|
355
|
+
if (sequence.value < 0n || sequence.value > EventSequenceNumber.unset.value) {
|
|
356
|
+
throw this.unsupported('getFromSequenceNumber.sequenceNumber', sequence.value.toString(), 'Sequence numbers must fit unsigned 64-bit wire values.');
|
|
357
|
+
}
|
|
358
|
+
if (source !== undefined)
|
|
359
|
+
this.validateReadSource('getFromSequenceNumber.source', source);
|
|
360
|
+
const ids = this.filterIds(types);
|
|
361
|
+
return this._history.filter(event => event.context.sequenceNumber >= sequence.value &&
|
|
362
|
+
(source === undefined || event.context.eventSourceId === source) &&
|
|
363
|
+
(!ids.length || ids.includes(event.eventType.id.value))).map(event => this.snapshot(event));
|
|
364
|
+
}
|
|
365
|
+
async redact() { throw this.unsupported('redact', this.id.value, 'Redaction requires kernel storage.'); }
|
|
366
|
+
async redactForEventSource() { throw this.unsupported('redactForEventSource', this.id.value, 'Redaction requires kernel storage.'); }
|
|
367
|
+
async completeStream() { throw this.unsupported('completeStream', this.id.value, 'Stream completion requires a kernel.'); }
|
|
368
|
+
filterIds(types) {
|
|
369
|
+
return (types ?? []).map(type => {
|
|
370
|
+
const metadata = this._catalog.get(type);
|
|
371
|
+
if (!metadata)
|
|
372
|
+
throw this.unsupported('read.eventTypes', type.name, 'Event type is not in the selected catalog.');
|
|
373
|
+
return metadata.eventType.id.value;
|
|
374
|
+
});
|
|
375
|
+
}
|
|
376
|
+
validateRouteFilters(operation, ...filters) {
|
|
377
|
+
for (const filter of filters) {
|
|
378
|
+
if (filter !== undefined && (typeof filter !== 'string' || !/^[A-Za-z0-9_-]+$/.test(filter))) {
|
|
379
|
+
throw this.unsupported(operation, String(filter), 'Only simple, nonblank route filters are fixture-backed.');
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
}
|
|
383
|
+
validateBatchOptions(options) {
|
|
384
|
+
if (options === undefined)
|
|
385
|
+
return;
|
|
386
|
+
if (!options || typeof options !== 'object' || Array.isArray(options)) {
|
|
387
|
+
throw this.unsupported('appendMany.options', this.id.value, 'Append options must be an object.');
|
|
388
|
+
}
|
|
389
|
+
const allowed = ['correlationId', 'sourceType', 'streamType', 'streamId', 'subject', 'occurred', 'tags'];
|
|
390
|
+
if (Reflect.ownKeys(options).some(key => !allowed.includes(String(key))) ||
|
|
391
|
+
options.concurrencyScope !== undefined || options.concurrencyScopes !== undefined || options.eventSourceId !== undefined) {
|
|
392
|
+
throw this.unsupported('appendMany.options', this.id.value, 'Concurrency and unrecognized metadata are not fixture-backed.');
|
|
393
|
+
}
|
|
394
|
+
if (options.tags && (!Array.isArray(options.tags) || options.tags.some(tag => typeof tag !== 'string'))) {
|
|
395
|
+
throw this.unsupported('appendMany.tags', this.id.value, 'Only plain string tags are fixture-backed.');
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
validateGuid(value, operation) {
|
|
399
|
+
try {
|
|
400
|
+
toContractsGuid(Guid.as(value));
|
|
401
|
+
if (!/^[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i.test(value.toString()))
|
|
402
|
+
throw new Error('Invalid GUID.');
|
|
403
|
+
}
|
|
404
|
+
catch {
|
|
405
|
+
throw this.unsupported(operation, this.id.value, 'Correlation ID must be a valid GUID.');
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
checkedDate(value, operation) {
|
|
409
|
+
if (!(value instanceof Date) || Number.isNaN(value.getTime()) || value.getUTCFullYear() < 1 || value.getUTCFullYear() > 9999) {
|
|
410
|
+
throw this.unsupported(operation, this.id.value, 'Occurrence must be within UTC years 1–9999 at millisecond precision.');
|
|
411
|
+
}
|
|
412
|
+
return new Date(value);
|
|
413
|
+
}
|
|
414
|
+
validateSource(source, operation) {
|
|
415
|
+
if (typeof source !== 'string' || !/^[A-Za-z0-9_-]+$/.test(source)) {
|
|
416
|
+
throw this.unsupported(operation, String(source), 'Only simple source identifiers are fixture-backed.');
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
checkedContent(event, serialized, operation) {
|
|
420
|
+
let content;
|
|
421
|
+
try {
|
|
422
|
+
content = JSON.parse(serialized);
|
|
423
|
+
}
|
|
424
|
+
catch {
|
|
425
|
+
throw this.unsupported(operation, event.constructor.name, 'Content must be valid JSON.');
|
|
426
|
+
}
|
|
427
|
+
const properties = this._catalog.get(event.constructor).schema.properties;
|
|
428
|
+
if (!content || typeof content !== 'object' || Array.isArray(content) ||
|
|
429
|
+
Object.keys(content).length !== Object.keys(properties).length ||
|
|
430
|
+
Object.entries(properties).some(([key, property]) => typeof content[key] !== property.type ||
|
|
431
|
+
(property.type === 'string' && !/^[\x20-\x21\x23-\x5b\x5d-\x7e\u00e9]*$/.test(content[key])))) {
|
|
432
|
+
throw this.unsupported(operation, event.constructor.name, 'Content differs from the fixture-backed scalar schema.');
|
|
433
|
+
}
|
|
434
|
+
return content;
|
|
435
|
+
}
|
|
436
|
+
success(sequenceNumber, artifact) {
|
|
437
|
+
return Object.freeze({ sequenceNumber: Object.freeze(sequenceNumber), constraintViolations: Object.freeze([]),
|
|
438
|
+
errors: Object.freeze([]), isSuccess: true,
|
|
439
|
+
waitForCompletion: async () => { throw this.unsupported('waitForCompletion', artifact, 'No observers run in process.'); } });
|
|
440
|
+
}
|
|
441
|
+
snapshot(event) {
|
|
442
|
+
const eventType = new EventType(new EventTypeId(event.eventType.id.value), new EventTypeGeneration(event.eventType.generation.value), event.eventType.tombstone);
|
|
443
|
+
const causedBy = event.context.causedBy;
|
|
444
|
+
return {
|
|
445
|
+
eventType,
|
|
446
|
+
content: JSON.parse(JSON.stringify(event.content)),
|
|
447
|
+
context: { ...event.context, eventType, occurred: new Date(event.context.occurred),
|
|
448
|
+
causedBy: causedBy && new Identity(causedBy.subject, causedBy.name, causedBy.userName, causedBy.onBehalfOf),
|
|
449
|
+
causation: event.context.causation.map(item => ({ ...item, occurred: item.occurred && new Date(item.occurred), properties: { ...item.properties } })),
|
|
450
|
+
tags: event.context.tags.map(item => new Tag(item.value)) }
|
|
451
|
+
};
|
|
452
|
+
}
|
|
453
|
+
validateReadSource(operation, source) {
|
|
454
|
+
if (!source.trim() || source !== source.trim() || unprovenFilterCharacters.test(source)) {
|
|
455
|
+
throw this.unsupported(operation, source, 'Blank and padded source filters have unproven kernel normalization.');
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
unsupported(operation, artifact, reason) {
|
|
459
|
+
return new UnsupportedEventSequenceOperation(operation, artifact, reason);
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
//# sourceMappingURL=InProcessEventSequence.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InProcessEventSequence.js","sourceRoot":"","sources":["../../testing/InProcessEventSequence.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG;AAErG,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACpE,OAAO,EAAE,2BAA2B,EAAE,MAAM,kDAAkD,CAAC;AAC/F,OAAO,EAAE,k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AAW,CAAC,SAAiB,EAAE,QAAgB,EAAE,MAAc;QACnE,OAAO,IAAI,iCAAiC,CAAC,SAAS,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC;IAC9E,CAAC;CACJ"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** A kernel operation or definition outside the fixture-backed in-process boundary. */
|
|
2
|
+
export declare class UnsupportedEventSequenceOperation extends Error {
|
|
3
|
+
constructor(operation: string, artifact: string, reason: string);
|
|
4
|
+
}
|
|
5
|
+
//# sourceMappingURL=UnsupportedEventSequenceOperation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UnsupportedEventSequenceOperation.d.ts","sourceRoot":"","sources":["../../testing/UnsupportedEventSequenceOperation.ts"],"names":[],"mappings":"AAGA,uFAAuF;AACvF,qBAAa,iCAAkC,SAAQ,KAAK;IACxD,YAAY,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAG9D;CACJ"}
|
|
@@ -0,0 +1,10 @@
|
|
|
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
|
+
/** A kernel operation or definition outside the fixture-backed in-process boundary. */
|
|
4
|
+
export class UnsupportedEventSequenceOperation extends Error {
|
|
5
|
+
constructor(operation, artifact, reason) {
|
|
6
|
+
super(`UnsupportedEventSequenceOperation: ${operation} (${artifact}): ${reason} Use a kernel-backed test.`);
|
|
7
|
+
this.name = 'UnsupportedEventSequenceOperation';
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=UnsupportedEventSequenceOperation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UnsupportedEventSequenceOperation.js","sourceRoot":"","sources":["../../testing/UnsupportedEventSequenceOperation.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG;AAErG,uFAAuF;AACvF,MAAM,OAAO,iCAAkC,SAAQ,KAAK;IACxD,YAAY,SAAiB,EAAE,QAAgB,EAAE,MAAc;QAC3D,KAAK,CAAC,sCAAsC,SAAS,KAAK,QAAQ,MAAM,MAAM,4BAA4B,CAAC,CAAC;QAC5G,IAAI,CAAC,IAAI,GAAG,mCAAmC,CAAC;IACpD,CAAC;CACJ"}
|
package/dist/testing/index.d.ts
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
export { EventScenario } from './EventScenario.js';
|
|
2
|
+
export type { EventScenarioOptions } from './EventScenarioOptions.js';
|
|
3
|
+
export { EventScenarioGivenBuilder } from './EventScenarioGivenBuilder.js';
|
|
4
|
+
export { EventScenarioGiven } from './EventScenarioGiven.js';
|
|
5
|
+
export { EventScenarioWhenBuilder } from './EventScenarioWhenBuilder.js';
|
|
6
|
+
export { EventScenarioWhen } from './EventScenarioWhen.js';
|
|
7
|
+
export { UnsupportedEventSequenceOperation } from './UnsupportedEventSequenceOperation.js';
|
|
1
8
|
export { ReadModelScenario } from './ReadModelScenario.js';
|
|
2
9
|
export { ReadModelScenarioGiven } from './ReadModelScenarioGiven.js';
|
|
3
10
|
export { ReadModelScenarioGivenBuilder } from './ReadModelScenarioGivenBuilder.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../testing/index.ts"],"names":[],"mappings":"AAGA,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,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,5 +1,11 @@
|
|
|
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
|
+
export { EventScenario } from './EventScenario.js';
|
|
4
|
+
export { EventScenarioGivenBuilder } from './EventScenarioGivenBuilder.js';
|
|
5
|
+
export { EventScenarioGiven } from './EventScenarioGiven.js';
|
|
6
|
+
export { EventScenarioWhenBuilder } from './EventScenarioWhenBuilder.js';
|
|
7
|
+
export { EventScenarioWhen } from './EventScenarioWhen.js';
|
|
8
|
+
export { UnsupportedEventSequenceOperation } from './UnsupportedEventSequenceOperation.js';
|
|
3
9
|
export { ReadModelScenario } from './ReadModelScenario.js';
|
|
4
10
|
export { ReadModelScenarioGiven } from './ReadModelScenarioGiven.js';
|
|
5
11
|
export { ReadModelScenarioGivenBuilder } from './ReadModelScenarioGivenBuilder.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../testing/index.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG;AAErG,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.js","sourceRoot":"","sources":["../../testing/index.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG;AAErG,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEnD,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"}
|