eventsourcingdb 1.2.0 → 1.2.1
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/README.md +4 -4
- package/dist/index.d.mts +3 -3
- package/dist/index.d.ts +3 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -94,17 +94,17 @@ const writtenEvents = await client.writeEvents([
|
|
|
94
94
|
|
|
95
95
|
*Note that according to the CloudEvents standard, event IDs must be of type string.*
|
|
96
96
|
|
|
97
|
-
#### Using the `
|
|
97
|
+
#### Using the `isEventQlQueryTrue` precondition
|
|
98
98
|
|
|
99
|
-
If you want to write events depending on an EventQL query, import the `
|
|
99
|
+
If you want to write events depending on an EventQL query, import the `isEventQlQueryTrue` function and pass it as an array of preconditions in the second argument:
|
|
100
100
|
|
|
101
101
|
```typescript
|
|
102
|
-
import {
|
|
102
|
+
import { isEventQlQueryTrue } from 'eventsourcingdb';
|
|
103
103
|
|
|
104
104
|
const writtenEvents = await client.writeEvents([
|
|
105
105
|
// events
|
|
106
106
|
], [
|
|
107
|
-
|
|
107
|
+
isEventQlQueryTrue(`FROM e IN events WHERE e.type == 'io.eventsourcingdb.library.book-borrowed' PROJECT INTO COUNT() < 10`)
|
|
108
108
|
]);
|
|
109
109
|
```
|
|
110
110
|
|
package/dist/index.d.mts
CHANGED
|
@@ -53,7 +53,7 @@ interface IsSubjectOnEventIdPrecondition {
|
|
|
53
53
|
subject: string;
|
|
54
54
|
eventId: string;
|
|
55
55
|
}
|
|
56
|
-
interface
|
|
56
|
+
interface IsEventQlQueryTruePrecondition {
|
|
57
57
|
query: string;
|
|
58
58
|
}
|
|
59
59
|
type Precondition = {
|
|
@@ -63,8 +63,8 @@ type Precondition = {
|
|
|
63
63
|
type: 'isSubjectOnEventId';
|
|
64
64
|
payload: IsSubjectOnEventIdPrecondition;
|
|
65
65
|
} | {
|
|
66
|
-
type: '
|
|
67
|
-
payload:
|
|
66
|
+
type: 'isEventQlQueryTrue';
|
|
67
|
+
payload: IsEventQlQueryTruePrecondition;
|
|
68
68
|
};
|
|
69
69
|
|
|
70
70
|
type Order = 'chronological' | 'antichronological';
|
package/dist/index.d.ts
CHANGED
|
@@ -53,7 +53,7 @@ interface IsSubjectOnEventIdPrecondition {
|
|
|
53
53
|
subject: string;
|
|
54
54
|
eventId: string;
|
|
55
55
|
}
|
|
56
|
-
interface
|
|
56
|
+
interface IsEventQlQueryTruePrecondition {
|
|
57
57
|
query: string;
|
|
58
58
|
}
|
|
59
59
|
type Precondition = {
|
|
@@ -63,8 +63,8 @@ type Precondition = {
|
|
|
63
63
|
type: 'isSubjectOnEventId';
|
|
64
64
|
payload: IsSubjectOnEventIdPrecondition;
|
|
65
65
|
} | {
|
|
66
|
-
type: '
|
|
67
|
-
payload:
|
|
66
|
+
type: 'isEventQlQueryTrue';
|
|
67
|
+
payload: IsEventQlQueryTruePrecondition;
|
|
68
68
|
};
|
|
69
69
|
|
|
70
70
|
type Order = 'chronological' | 'antichronological';
|