@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.
Files changed (74) hide show
  1. package/dist/eventSequences/EventSequence.d.ts.map +1 -1
  2. package/dist/eventSequences/EventSequence.js +8 -109
  3. package/dist/eventSequences/EventSequence.js.map +1 -1
  4. package/dist/eventSequences/createAppendNotification.d.ts +15 -0
  5. package/dist/eventSequences/createAppendNotification.d.ts.map +1 -0
  6. package/dist/eventSequences/createAppendNotification.js +25 -0
  7. package/dist/eventSequences/createAppendNotification.js.map +1 -0
  8. package/dist/eventSequences/prepareBatchAppend.d.ts +31 -0
  9. package/dist/eventSequences/prepareBatchAppend.d.ts.map +1 -0
  10. package/dist/eventSequences/prepareBatchAppend.js +54 -0
  11. package/dist/eventSequences/prepareBatchAppend.js.map +1 -0
  12. package/dist/eventSequences/prepareSingleAppend.d.ts +12 -0
  13. package/dist/eventSequences/prepareSingleAppend.d.ts.map +1 -0
  14. package/dist/eventSequences/prepareSingleAppend.js +22 -0
  15. package/dist/eventSequences/prepareSingleAppend.js.map +1 -0
  16. package/dist/testing/EventScenario.d.ts +29 -0
  17. package/dist/testing/EventScenario.d.ts.map +1 -0
  18. package/dist/testing/EventScenario.js +63 -0
  19. package/dist/testing/EventScenario.js.map +1 -0
  20. package/dist/testing/EventScenarioGiven.d.ts +9 -0
  21. package/dist/testing/EventScenarioGiven.d.ts.map +1 -0
  22. package/dist/testing/EventScenarioGiven.js +16 -0
  23. package/dist/testing/EventScenarioGiven.js.map +1 -0
  24. package/dist/testing/EventScenarioGivenBuilder.d.ts +9 -0
  25. package/dist/testing/EventScenarioGivenBuilder.d.ts.map +1 -0
  26. package/dist/testing/EventScenarioGivenBuilder.js +12 -0
  27. package/dist/testing/EventScenarioGivenBuilder.js.map +1 -0
  28. package/dist/testing/EventScenarioOptions.d.ts +21 -0
  29. package/dist/testing/EventScenarioOptions.d.ts.map +1 -0
  30. package/dist/testing/EventScenarioOptions.js +4 -0
  31. package/dist/testing/EventScenarioOptions.js.map +1 -0
  32. package/dist/testing/EventScenarioSeed.d.ts +5 -0
  33. package/dist/testing/EventScenarioSeed.d.ts.map +1 -0
  34. package/dist/testing/EventScenarioSeed.js +14 -0
  35. package/dist/testing/EventScenarioSeed.js.map +1 -0
  36. package/dist/testing/EventScenarioWhen.d.ts +11 -0
  37. package/dist/testing/EventScenarioWhen.d.ts.map +1 -0
  38. package/dist/testing/EventScenarioWhen.js +16 -0
  39. package/dist/testing/EventScenarioWhen.js.map +1 -0
  40. package/dist/testing/EventScenarioWhenBuilder.d.ts +9 -0
  41. package/dist/testing/EventScenarioWhenBuilder.d.ts.map +1 -0
  42. package/dist/testing/EventScenarioWhenBuilder.js +12 -0
  43. package/dist/testing/EventScenarioWhenBuilder.js.map +1 -0
  44. package/dist/testing/InProcessEventSequence.d.ts +60 -0
  45. package/dist/testing/InProcessEventSequence.d.ts.map +1 -0
  46. package/dist/testing/InProcessEventSequence.js +462 -0
  47. package/dist/testing/InProcessEventSequence.js.map +1 -0
  48. package/dist/testing/UnsupportedEventSequenceOperation.d.ts +5 -0
  49. package/dist/testing/UnsupportedEventSequenceOperation.d.ts.map +1 -0
  50. package/dist/testing/UnsupportedEventSequenceOperation.js +10 -0
  51. package/dist/testing/UnsupportedEventSequenceOperation.js.map +1 -0
  52. package/dist/testing/index.d.ts +7 -0
  53. package/dist/testing/index.d.ts.map +1 -1
  54. package/dist/testing/index.js +6 -0
  55. package/dist/testing/index.js.map +1 -1
  56. package/dist/tsconfig.tsbuildinfo +1 -1
  57. package/eventSequences/EventSequence.ts +12 -119
  58. package/eventSequences/createAppendNotification.ts +35 -0
  59. package/eventSequences/prepareBatchAppend.ts +63 -0
  60. package/eventSequences/prepareSingleAppend.ts +25 -0
  61. package/package.json +1 -1
  62. package/testing/EventScenario.batches.spec.ts +537 -0
  63. package/testing/EventScenario.fixtures.spec.ts +260 -0
  64. package/testing/EventScenario.rejections.spec.ts +273 -0
  65. package/testing/EventScenario.ts +79 -0
  66. package/testing/EventScenarioGiven.ts +13 -0
  67. package/testing/EventScenarioGivenBuilder.ts +11 -0
  68. package/testing/EventScenarioOptions.ts +20 -0
  69. package/testing/EventScenarioSeed.ts +17 -0
  70. package/testing/EventScenarioWhen.ts +14 -0
  71. package/testing/EventScenarioWhenBuilder.ts +11 -0
  72. package/testing/InProcessEventSequence.ts +460 -0
  73. package/testing/UnsupportedEventSequenceOperation.ts +10 -0
  74. package/testing/index.ts +7 -0
@@ -0,0 +1,9 @@
1
+ import type { EventScenario } from './EventScenario.js';
2
+ /** Seeds events in order through individual single appends, as in the .NET given builder. */
3
+ export declare class EventScenarioGiven {
4
+ private readonly _scenario;
5
+ private readonly _id;
6
+ constructor(_scenario: EventScenario, _id: string);
7
+ events(...events: object[]): Promise<void>;
8
+ }
9
+ //# sourceMappingURL=EventScenarioGiven.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EventScenarioGiven.d.ts","sourceRoot":"","sources":["../../testing/EventScenarioGiven.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAGxD,6FAA6F;AAC7F,qBAAa,kBAAkB;IACf,OAAO,CAAC,QAAQ,CAAC,SAAS;IAAiB,OAAO,CAAC,QAAQ,CAAC,GAAG;IAA3E,YAA6B,SAAS,EAAE,aAAa,EAAmB,GAAG,EAAE,MAAM,EAAI;IACjF,MAAM,CAAC,GAAG,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAE/C;CACJ"}
@@ -0,0 +1,16 @@
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 { seedScenario } from './EventScenarioSeed.js';
4
+ /** Seeds events in order through individual single appends, as in the .NET given builder. */
5
+ export class EventScenarioGiven {
6
+ _scenario;
7
+ _id;
8
+ constructor(_scenario, _id) {
9
+ this._scenario = _scenario;
10
+ this._id = _id;
11
+ }
12
+ async events(...events) {
13
+ await seedScenario(this._scenario, this._id, events);
14
+ }
15
+ }
16
+ //# sourceMappingURL=EventScenarioGiven.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EventScenarioGiven.js","sourceRoot":"","sources":["../../testing/EventScenarioGiven.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG;AAGrG,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAEtD,6FAA6F;AAC7F,MAAM,OAAO,kBAAkB;IACE,SAAS;IAAkC,GAAG;IAA3E,YAA6B,SAAwB,EAAmB,GAAW;yBAAtD,SAAS;mBAAkC,GAAG;IAAW,CAAC;IACvF,KAAK,CAAC,MAAM,CAAC,GAAG,MAAgB;QAC5B,MAAM,YAAY,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;IACzD,CAAC;CACJ"}
@@ -0,0 +1,9 @@
1
+ import type { EventScenario } from './EventScenario.js';
2
+ import { EventScenarioGiven } from './EventScenarioGiven.js';
3
+ /** Selects the source for setup events. */
4
+ export declare class EventScenarioGivenBuilder {
5
+ private readonly _scenario;
6
+ constructor(_scenario: EventScenario);
7
+ forEventSource(id: string): EventScenarioGiven;
8
+ }
9
+ //# sourceMappingURL=EventScenarioGivenBuilder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EventScenarioGivenBuilder.d.ts","sourceRoot":"","sources":["../../testing/EventScenarioGivenBuilder.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAE7D,2CAA2C;AAC3C,qBAAa,yBAAyB;IACtB,OAAO,CAAC,QAAQ,CAAC,SAAS;IAAtC,YAA6B,SAAS,EAAE,aAAa,EAAI;IACzD,cAAc,CAAC,EAAE,EAAE,MAAM,GAAG,kBAAkB,CAAuD;CACxG"}
@@ -0,0 +1,12 @@
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 { EventScenarioGiven } from './EventScenarioGiven.js';
4
+ /** Selects the source for setup events. */
5
+ export class EventScenarioGivenBuilder {
6
+ _scenario;
7
+ constructor(_scenario) {
8
+ this._scenario = _scenario;
9
+ }
10
+ forEventSource(id) { return new EventScenarioGiven(this._scenario, id); }
11
+ }
12
+ //# sourceMappingURL=EventScenarioGivenBuilder.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EventScenarioGivenBuilder.js","sourceRoot":"","sources":["../../testing/EventScenarioGivenBuilder.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG;AAGrG,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAE7D,2CAA2C;AAC3C,MAAM,OAAO,yBAAyB;IACL,SAAS;IAAtC,YAA6B,SAAwB;yBAAxB,SAAS;IAAkB,CAAC;IACzD,cAAc,CAAC,EAAU,IAAwB,OAAO,IAAI,kBAAkB,CAAC,IAAI,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;CACxG"}
@@ -0,0 +1,21 @@
1
+ import type { Constructor } from '@cratis/fundamentals';
2
+ import type { EventSequenceId } from '../eventSequences/EventSequenceId.js';
3
+ /** Configuration captured once when constructing an event scenario. */
4
+ export interface EventScenarioOptions {
5
+ /** An isolated catalog; omitting it discovers process-wide event and constraint artifacts. */
6
+ artifacts?: {
7
+ eventTypes: Constructor[];
8
+ constraints?: Constructor[];
9
+ eventTypeMigrations?: Constructor[];
10
+ };
11
+ /** Constraint discovery is the default. Explicitly disable it only for tests without constraints. */
12
+ constraints?: 'disabled';
13
+ /** Scenario-local identifiers; only the fixture-backed defaults are supported in this increment. */
14
+ eventStore?: string;
15
+ namespace?: string;
16
+ eventSequenceId?: EventSequenceId;
17
+ /** Deterministic sources for metadata otherwise provided by the environment. */
18
+ clock?: () => Date;
19
+ correlationId?: () => string;
20
+ }
21
+ //# sourceMappingURL=EventScenarioOptions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EventScenarioOptions.d.ts","sourceRoot":"","sources":["../../testing/EventScenarioOptions.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AAE5E,uEAAuE;AACvE,MAAM,WAAW,oBAAoB;IACjC,8FAA8F;IAC9F,SAAS,CAAC,EAAE;QAAE,UAAU,EAAE,WAAW,EAAE,CAAC;QAAC,WAAW,CAAC,EAAE,WAAW,EAAE,CAAC;QAAC,mBAAmB,CAAC,EAAE,WAAW,EAAE,CAAA;KAAE,CAAC;IAC5G,qGAAqG;IACrG,WAAW,CAAC,EAAE,UAAU,CAAC;IACzB,oGAAoG;IACpG,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,eAAe,CAAC,EAAE,eAAe,CAAC;IAClC,gFAAgF;IAChF,KAAK,CAAC,EAAE,MAAM,IAAI,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,MAAM,CAAC;CAChC"}
@@ -0,0 +1,4 @@
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
+ export {};
4
+ //# sourceMappingURL=EventScenarioOptions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EventScenarioOptions.js","sourceRoot":"","sources":["../../testing/EventScenarioOptions.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG"}
@@ -0,0 +1,5 @@
1
+ import type { EventScenario } from './EventScenario.js';
2
+ /** Internal builder wiring; not exported by the testing package. */
3
+ export declare function registerScenarioSeed(scenario: EventScenario, seed: (source: string, events: object[]) => Promise<void>): void;
4
+ export declare function seedScenario(scenario: EventScenario, source: string, events: object[]): Promise<void>;
5
+ //# sourceMappingURL=EventScenarioSeed.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EventScenarioSeed.d.ts","sourceRoot":"","sources":["../../testing/EventScenarioSeed.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAIxD,oEAAoE;AACpE,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,CAE7H;AAED,wBAAgB,YAAY,CAAC,QAAQ,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAIrG"}
@@ -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
+ const seeders = new WeakMap();
4
+ /** Internal builder wiring; not exported by the testing package. */
5
+ export function registerScenarioSeed(scenario, seed) {
6
+ seeders.set(scenario, seed);
7
+ }
8
+ export function seedScenario(scenario, source, events) {
9
+ const seed = seeders.get(scenario);
10
+ if (!seed)
11
+ throw new Error('EventScenario setup requires a constructed scenario.');
12
+ return seed(source, events);
13
+ }
14
+ //# sourceMappingURL=EventScenarioSeed.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EventScenarioSeed.js","sourceRoot":"","sources":["../../testing/EventScenarioSeed.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG;AAIrG,MAAM,OAAO,GAAG,IAAI,OAAO,EAAsE,CAAC;AAElG,oEAAoE;AACpE,MAAM,UAAU,oBAAoB,CAAC,QAAuB,EAAE,IAAyD;IACnH,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;AAChC,CAAC;AAED,MAAM,UAAU,YAAY,CAAC,QAAuB,EAAE,MAAc,EAAE,MAAgB;IAClF,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;IACnC,IAAI,CAAC,IAAI;QAAE,MAAM,IAAI,KAAK,CAAC,sDAAsD,CAAC,CAAC;IACnF,OAAO,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAChC,CAAC"}
@@ -0,0 +1,11 @@
1
+ import type { AppendResult } from '../eventSequences/AppendResult.js';
2
+ import type { EventScenario } from './EventScenario.js';
3
+ /** A single act-phase append; the plural form is reserved for atomic batches. */
4
+ export declare class EventScenarioWhen {
5
+ private readonly _scenario;
6
+ private readonly _id;
7
+ constructor(_scenario: EventScenario, _id: string);
8
+ event(event: object): Promise<AppendResult>;
9
+ events(...events: object[]): Promise<readonly AppendResult[]>;
10
+ }
11
+ //# sourceMappingURL=EventScenarioWhen.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EventScenarioWhen.d.ts","sourceRoot":"","sources":["../../testing/EventScenarioWhen.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAExD,iFAAiF;AACjF,qBAAa,iBAAiB;IACd,OAAO,CAAC,QAAQ,CAAC,SAAS;IAAiB,OAAO,CAAC,QAAQ,CAAC,GAAG;IAA3E,YAA6B,SAAS,EAAE,aAAa,EAAmB,GAAG,EAAE,MAAM,EAAI;IACjF,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,CAAmD;IAC9F,MAAM,CAAC,GAAG,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,SAAS,YAAY,EAAE,CAAC,CAElE;CACJ"}
@@ -0,0 +1,16 @@
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 single act-phase append; the plural form is reserved for atomic batches. */
4
+ export class EventScenarioWhen {
5
+ _scenario;
6
+ _id;
7
+ constructor(_scenario, _id) {
8
+ this._scenario = _scenario;
9
+ this._id = _id;
10
+ }
11
+ async event(event) { return this._scenario.append(this._id, event); }
12
+ async events(...events) {
13
+ return this._scenario.appendMany(this._id, events);
14
+ }
15
+ }
16
+ //# sourceMappingURL=EventScenarioWhen.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EventScenarioWhen.js","sourceRoot":"","sources":["../../testing/EventScenarioWhen.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG;AAKrG,iFAAiF;AACjF,MAAM,OAAO,iBAAiB;IACG,SAAS;IAAkC,GAAG;IAA3E,YAA6B,SAAwB,EAAmB,GAAW;yBAAtD,SAAS;mBAAkC,GAAG;IAAW,CAAC;IACvF,KAAK,CAAC,KAAK,CAAC,KAAa,IAA2B,OAAO,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC;IACpG,KAAK,CAAC,MAAM,CAAC,GAAG,MAAgB;QAC5B,OAAO,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;IACvD,CAAC;CACJ"}
@@ -0,0 +1,9 @@
1
+ import type { EventScenario } from './EventScenario.js';
2
+ import { EventScenarioWhen } from './EventScenarioWhen.js';
3
+ /** Selects the source for an act-phase append. */
4
+ export declare class EventScenarioWhenBuilder {
5
+ private readonly _scenario;
6
+ constructor(_scenario: EventScenario);
7
+ forEventSource(id: string): EventScenarioWhen;
8
+ }
9
+ //# sourceMappingURL=EventScenarioWhenBuilder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EventScenarioWhenBuilder.d.ts","sourceRoot":"","sources":["../../testing/EventScenarioWhenBuilder.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAE3D,kDAAkD;AAClD,qBAAa,wBAAwB;IACrB,OAAO,CAAC,QAAQ,CAAC,SAAS;IAAtC,YAA6B,SAAS,EAAE,aAAa,EAAI;IACzD,cAAc,CAAC,EAAE,EAAE,MAAM,GAAG,iBAAiB,CAAsD;CACtG"}
@@ -0,0 +1,12 @@
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 { EventScenarioWhen } from './EventScenarioWhen.js';
4
+ /** Selects the source for an act-phase append. */
5
+ export class EventScenarioWhenBuilder {
6
+ _scenario;
7
+ constructor(_scenario) {
8
+ this._scenario = _scenario;
9
+ }
10
+ forEventSource(id) { return new EventScenarioWhen(this._scenario, id); }
11
+ }
12
+ //# sourceMappingURL=EventScenarioWhenBuilder.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EventScenarioWhenBuilder.js","sourceRoot":"","sources":["../../testing/EventScenarioWhenBuilder.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,qGAAqG;AAGrG,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAE3D,kDAAkD;AAClD,MAAM,OAAO,wBAAwB;IACJ,SAAS;IAAtC,YAA6B,SAAwB;yBAAxB,SAAS;IAAkB,CAAC;IACzD,cAAc,CAAC,EAAU,IAAuB,OAAO,IAAI,iBAAiB,CAAC,IAAI,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC;CACtG"}
@@ -0,0 +1,60 @@
1
+ import { AppendOperationsBroadcaster } from '../eventSequences/AppendOperationsBroadcaster.js';
2
+ import { type Constructor } from '@cratis/fundamentals';
3
+ import type { AppendedEvent } from '../events/AppendedEvent.js';
4
+ import type { AppendOptions } from '../eventSequences/AppendOptions.js';
5
+ import type { AppendResult } from '../eventSequences/AppendResult.js';
6
+ import type { AppendedEventWithResult } from '../eventSequences/AppendedEventWithResult.js';
7
+ import type { EventForEventSourceId } from '../eventSequences/EventForEventSourceId.js';
8
+ import { EventSequenceId } from '../eventSequences/EventSequenceId.js';
9
+ import { EventSequenceNumber } from '../eventSequences/EventSequenceNumber.js';
10
+ import type { IEventSequence } from '../eventSequences/IEventSequence.js';
11
+ import type { ITransactionalEventSequence } from '../eventSequences/ITransactionalEventSequence.js';
12
+ import type { CompleteStreamResult } from '../eventSequences/CompleteStreamResult.js';
13
+ import type { EventScenarioOptions } from './EventScenarioOptions.js';
14
+ /** Fixture-backed, scenario-local append sequence; no kernel or observer scheduler is started. */
15
+ export declare class InProcessEventSequence implements IEventSequence {
16
+ readonly id: EventSequenceId;
17
+ private readonly _catalog;
18
+ private readonly _history;
19
+ private readonly _store;
20
+ private readonly _namespace;
21
+ private readonly _clock;
22
+ private readonly _correlationId?;
23
+ private _setup;
24
+ private _allowSeedAppend;
25
+ private _stagedSeeds?;
26
+ private _stagedNotifications?;
27
+ private _busy;
28
+ private readonly _results;
29
+ readonly appendOperations: AppendOperationsBroadcaster<AppendedEventWithResult[]>;
30
+ constructor(options: EventScenarioOptions, eventTypes: Constructor[]);
31
+ get results(): readonly AppendResult[];
32
+ get appendedEvents(): readonly AppendedEvent[];
33
+ /** Validate and stage all setup appends, then commit and notify in single-append order. */
34
+ seed(source: string, events: object[]): Promise<void>;
35
+ get transactional(): ITransactionalEventSequence;
36
+ append(eventSourceId: string, event: object, options?: AppendOptions): Promise<AppendResult>;
37
+ appendMany(eventSourceId: string, events: object[], options?: AppendOptions): Promise<AppendResult[]>;
38
+ appendMany(events: EventForEventSourceId[], options?: AppendOptions): Promise<AppendResult[]>;
39
+ getNextSequenceNumber(): Promise<EventSequenceNumber>;
40
+ getTailSequenceNumber(source?: string, sourceType?: string, streamType?: string, streamId?: string, types?: Constructor[]): Promise<EventSequenceNumber>;
41
+ getTailSequenceNumberForObserver(observer: Constructor): Promise<EventSequenceNumber>;
42
+ hasEventsFor(source: string): Promise<boolean>;
43
+ getForEventSourceIdAndEventTypes(source: string, types: Constructor[], streamType?: string, streamId?: string, sourceType?: string): Promise<AppendedEvent[]>;
44
+ getFromSequenceNumber(sequence: EventSequenceNumber, source?: string, types?: Constructor[]): Promise<AppendedEvent[]>;
45
+ redact(): Promise<void>;
46
+ redactForEventSource(): Promise<void>;
47
+ completeStream(): Promise<CompleteStreamResult>;
48
+ private filterIds;
49
+ private validateRouteFilters;
50
+ private validateBatchOptions;
51
+ private validateGuid;
52
+ private checkedDate;
53
+ private validateSource;
54
+ private checkedContent;
55
+ private success;
56
+ private snapshot;
57
+ private validateReadSource;
58
+ private unsupported;
59
+ }
60
+ //# sourceMappingURL=InProcessEventSequence.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InProcessEventSequence.d.ts","sourceRoot":"","sources":["../../testing/InProcessEventSequence.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,2BAA2B,EAAE,MAAM,kDAAkD,CAAC;AAG/F,OAAO,EAAQ,KAAK,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAG9D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAMhE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AACxE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,8CAA8C,CAAC;AAC5F,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,4CAA4C,CAAC;AACxF,OAAO,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AACvE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AAC/E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AAC1E,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,kDAAkD,CAAC;AACpG,OAAO,KAAK,EAAE,oBAAoB,EA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