@schemeless/event-store-types 2.2.0 → 2.3.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.
|
@@ -4,6 +4,7 @@ export interface BaseEventInput<Payload, META = undefined> {
|
|
|
4
4
|
identifier?: string;
|
|
5
5
|
correlationId?: string;
|
|
6
6
|
causationId?: string;
|
|
7
|
+
created?: Date;
|
|
7
8
|
}
|
|
8
9
|
export interface BaseEvent<Payload, META = undefined> extends BaseEventInput<Payload, META> {
|
|
9
10
|
id?: string;
|
|
@@ -13,6 +14,7 @@ export interface BaseEvent<Payload, META = undefined> extends BaseEventInput<Pay
|
|
|
13
14
|
identifier?: string;
|
|
14
15
|
correlationId?: string;
|
|
15
16
|
causationId?: string;
|
|
17
|
+
created?: Date;
|
|
16
18
|
}
|
|
17
19
|
export interface CreatedEvent<Payload, META = undefined> extends BaseEvent<Payload, META> {
|
|
18
20
|
id: string;
|
|
@@ -37,7 +39,7 @@ export interface EventFlow<PartialPayload = any, Payload extends PartialPayload
|
|
|
37
39
|
readonly validate?: (event: CreatedEvent<Payload>) => Promise<Error | void> | Error | void;
|
|
38
40
|
readonly preApply?: (event: CreatedEvent<PartialPayload>) => Promise<CreatedEvent<Payload> | void> | CreatedEvent<Payload> | void;
|
|
39
41
|
readonly apply?: (event: CreatedEvent<Payload>) => Promise<void> | void;
|
|
40
|
-
readonly sideEffect?: (event: CreatedEvent<Payload>) => Promise<void> | void;
|
|
42
|
+
readonly sideEffect?: (event: CreatedEvent<Payload>) => Promise<void | BaseEvent<any>[]> | void | BaseEvent<any>[];
|
|
41
43
|
readonly cancelApply?: (event: CreatedEvent<Payload>) => Promise<void> | void;
|
|
42
44
|
readonly createConsequentEvents?: (causalEvent: CreatedEvent<Payload>) => Promise<BaseEvent<any>[]> | BaseEvent<any>[];
|
|
43
45
|
}
|
package/dist/Repo.types.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ export interface IEventStoreEntity<PAYLOAD = any, META = any> {
|
|
|
12
12
|
}
|
|
13
13
|
export interface IEventStoreRepo<PAYLOAD = any, META = any> {
|
|
14
14
|
init: () => Promise<void>;
|
|
15
|
-
getAllEvents: (pageSize: number) => Promise<AsyncIterableIterator<Array<IEventStoreEntity<PAYLOAD, META>>>>;
|
|
15
|
+
getAllEvents: (pageSize: number, startFromId?: string) => Promise<AsyncIterableIterator<Array<IEventStoreEntity<PAYLOAD, META>>>>;
|
|
16
16
|
createEventEntity: (event: CreatedEvent<any>) => IEventStoreEntity<PAYLOAD, META>;
|
|
17
17
|
storeEvents: (events: CreatedEvent<any>[]) => Promise<void>;
|
|
18
18
|
resetStore: () => Promise<void>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@schemeless/event-store-types",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.0",
|
|
4
4
|
"typescript:main": "src/index.ts",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -32,5 +32,5 @@
|
|
|
32
32
|
"publishConfig": {
|
|
33
33
|
"access": "public"
|
|
34
34
|
},
|
|
35
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "0b9166b4dbfe2733f7a13817f5243ec5c9398050"
|
|
36
36
|
}
|