@cratis/event-models 0.170.0 → 0.171.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/Messages/SpecificationValueMessages.d.ts +1 -0
- package/dist/Model/SliceSpecification.d.ts +3 -0
- package/dist/Model/SpecificationWhenEvent.d.ts +8 -0
- package/dist/Model/index.d.ts +1 -0
- package/dist/Specifications/formatSpecificationValues.d.ts +2 -1
- package/dist/event-model-document.schema.json +34 -0
- package/dist/index.js +2666 -2635
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
|
@@ -7,15 +7,18 @@ import type { SpecificationGivenEvent } from './SpecificationGivenEvent';
|
|
|
7
7
|
import type { SpecificationReadModel } from './SpecificationReadModel';
|
|
8
8
|
import type { SpecificationRunOutcome } from './SpecificationRunOutcome';
|
|
9
9
|
import type { SpecificationThenEvent } from './SpecificationThenEvent';
|
|
10
|
+
import type { SpecificationWhenEvent } from './SpecificationWhenEvent';
|
|
10
11
|
export interface SliceSpecification {
|
|
11
12
|
id: Guid;
|
|
12
13
|
name: string;
|
|
13
14
|
given: SpecificationGivenEvent[];
|
|
14
15
|
givenContexts?: SpecificationGivenContext[];
|
|
15
16
|
when?: SpecificationCommand;
|
|
17
|
+
whenEvent?: SpecificationWhenEvent;
|
|
16
18
|
caller?: SpecificationCaller;
|
|
17
19
|
givenReadModel?: SpecificationReadModel;
|
|
18
20
|
thenEvents: SpecificationThenEvent[];
|
|
21
|
+
thenReadModel?: SpecificationReadModel;
|
|
19
22
|
thenErrors: SpecificationError[];
|
|
20
23
|
collapsed: boolean;
|
|
21
24
|
lastRunOutcome?: SpecificationRunOutcome;
|
package/dist/Model/index.d.ts
CHANGED
|
@@ -46,6 +46,7 @@ export * from './SpecificationGivenContext';
|
|
|
46
46
|
export * from './SpecificationReadModel';
|
|
47
47
|
export * from './SpecificationRunOutcome';
|
|
48
48
|
export * from './SpecificationThenEvent';
|
|
49
|
+
export * from './SpecificationWhenEvent';
|
|
49
50
|
export * from './StickyNote';
|
|
50
51
|
export * from './TranslationDirection';
|
|
51
52
|
export * from './UserExperienceActor';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { SpecificationCaller } from '../Model';
|
|
2
|
-
import type
|
|
2
|
+
import { type SpecificationValueMessages } from '../Messages';
|
|
3
3
|
export declare const formatSpecificationValue: (value: unknown) => string;
|
|
4
|
+
export declare const eventSourceSummary: (eventSourceId: string, words: SpecificationValueMessages) => string;
|
|
4
5
|
export declare const callerSummary: (caller: SpecificationCaller, words: SpecificationValueMessages) => string | undefined;
|
|
@@ -763,6 +763,10 @@
|
|
|
763
763
|
"when": {
|
|
764
764
|
"$ref": "#/$defs/SpecificationCommand"
|
|
765
765
|
},
|
|
766
|
+
"whenEvent": {
|
|
767
|
+
"$ref": "#/$defs/SpecificationWhenEvent",
|
|
768
|
+
"description": "The one event the specification appends as its action. When present, the When shows only this event."
|
|
769
|
+
},
|
|
766
770
|
"givenReadModel": {
|
|
767
771
|
"$ref": "#/$defs/SpecificationReadModel"
|
|
768
772
|
},
|
|
@@ -784,6 +788,10 @@
|
|
|
784
788
|
"$ref": "#/$defs/SpecificationError"
|
|
785
789
|
}
|
|
786
790
|
},
|
|
791
|
+
"thenReadModel": {
|
|
792
|
+
"$ref": "#/$defs/SpecificationReadModel",
|
|
793
|
+
"description": "The read model, and the values in it, the specification expects afterwards."
|
|
794
|
+
},
|
|
787
795
|
"caller": {
|
|
788
796
|
"$ref": "#/$defs/SpecificationCaller"
|
|
789
797
|
},
|
|
@@ -863,6 +871,32 @@
|
|
|
863
871
|
}
|
|
864
872
|
}
|
|
865
873
|
},
|
|
874
|
+
"SpecificationWhenEvent": {
|
|
875
|
+
"type": "object",
|
|
876
|
+
"required": [
|
|
877
|
+
"id",
|
|
878
|
+
"eventId"
|
|
879
|
+
],
|
|
880
|
+
"properties": {
|
|
881
|
+
"id": {
|
|
882
|
+
"$ref": "#/$defs/Guid"
|
|
883
|
+
},
|
|
884
|
+
"name": {
|
|
885
|
+
"type": "string"
|
|
886
|
+
},
|
|
887
|
+
"eventId": {
|
|
888
|
+
"$ref": "#/$defs/Guid"
|
|
889
|
+
},
|
|
890
|
+
"eventSourceId": {
|
|
891
|
+
"type": "string",
|
|
892
|
+
"description": "The event source the event is appended to; absent when the specification does not state one."
|
|
893
|
+
},
|
|
894
|
+
"values": {
|
|
895
|
+
"type": "object",
|
|
896
|
+
"additionalProperties": true
|
|
897
|
+
}
|
|
898
|
+
}
|
|
899
|
+
},
|
|
866
900
|
"SpecificationCommand": {
|
|
867
901
|
"type": "object",
|
|
868
902
|
"required": [
|