@reventlessdev/reventless-gwt 1.0.0-alpha.186 → 1.0.0-alpha.187
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/CHANGELOG.md +12 -0
- package/package.json +7 -7
- package/src/Automation_GWT.res +0 -1
- package/src/Automation_GWT.res.mjs +1 -3
- package/src/Behavior_GWT.res +0 -2
- package/src/Behavior_GWT.res.mjs +1 -4
- package/src/Delegate_GWT.res +0 -1
- package/src/Delegate_GWT.res.mjs +1 -7
- package/src/Flow_GWT.res +0 -1
- package/src/Flow_GWT.res.mjs +1 -4
- package/src/InboundTranslation_GWT.res +0 -1
- package/src/InboundTranslation_GWT.res.mjs +1 -3
- package/src/Mapping_GWT.res +0 -1
- package/src/Mapping_GWT.res.mjs +1 -3
- package/src/MultiSourceProjection_GWT.res +0 -1
- package/src/MultiSourceProjection_GWT.res.mjs +1 -3
- package/src/OutboundTranslation_GWT.res +0 -1
- package/src/OutboundTranslation_GWT.res.mjs +1 -3
- package/src/Projection_GWT.res +0 -1
- package/src/Projection_GWT.res.mjs +1 -3
- package/src/Query_GWT.res +4 -6
- package/src/Query_GWT.res.mjs +10 -12
- package/src/SideEffect_GWT.res +0 -1
- package/src/SideEffect_GWT.res.mjs +1 -3
- package/src/StateChange/ExternalAddCategorySlice.res.mjs +9 -9
- package/src/StateChange/WithFixtures.res.mjs +7 -7
- package/src/StateChange/WithManualOpen.res.mjs +7 -7
- package/tests/AutomationGwtTest.res.mjs +13 -13
- package/tests/DelegateGwtTest.res +0 -1
- package/tests/DelegateGwtTest.res.mjs +77 -79
- package/tests/FlowAggregateGwtTest.res +0 -1
- package/tests/FlowAggregateGwtTest.res.mjs +22 -24
- package/tests/FlowCrossPluginGwtTest.res +0 -1
- package/tests/FlowCrossPluginGwtTest.res.mjs +58 -60
- package/tests/FlowGwtTest.res +0 -1
- package/tests/FlowGwtTest.res.mjs +40 -40
- package/tests/InboundTranslationGwtTest.res.mjs +8 -8
- package/tests/MappingGwtTest.res +0 -1
- package/tests/MappingGwtTest.res.mjs +30 -32
- package/tests/OutboundTranslationGwtTest.res.mjs +8 -8
- package/tests/QueryGwtTest.res +0 -1
- package/tests/QueryGwtTest.res.mjs +14 -16
- package/tests/QueryResolverGwtTest.res +0 -1
- package/tests/QueryResolverGwtTest.res.mjs +10 -12
- package/tests/SideEffect/FakeOrderNotification.res.mjs +5 -5
- package/tests/SideEffect/MockEmail.res +1 -1
- package/tests/SideEffect/MockEmail.res.mjs +6 -5
- package/tests/StateChangeSliceGwtTest.res.mjs +15 -15
- package/tests/StateViewSliceGwtTest.res.mjs +14 -14
package/tests/FlowGwtTest.res
CHANGED
|
@@ -1,28 +1,26 @@
|
|
|
1
1
|
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
2
|
|
|
3
|
-
import * as
|
|
3
|
+
import * as Sury from "sury";
|
|
4
4
|
import * as DcbTag$Reventless from "@reventlessdev/reventless-spec/src/components/DcbTag.res.mjs";
|
|
5
5
|
import * as Flow_GWT$ReventlessGwt from "../src/Flow_GWT.res.mjs";
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
let consumedEventSchema = S.schema(s => ({
|
|
7
|
+
let consumedEventSchema = Sury.$schema(s => ({
|
|
10
8
|
TAG: "OrderPlaced",
|
|
11
9
|
orderId: s.m(DcbTag$Reventless.string)
|
|
12
10
|
}));
|
|
13
11
|
|
|
14
|
-
let commandSchema =
|
|
12
|
+
let commandSchema = Sury.$schema(s => ({
|
|
15
13
|
TAG: "PlaceOrder",
|
|
16
14
|
orderId: s.m(DcbTag$Reventless.string),
|
|
17
|
-
item: s.m(
|
|
15
|
+
item: s.m(Sury.string)
|
|
18
16
|
}));
|
|
19
17
|
|
|
20
|
-
let errorSchema =
|
|
18
|
+
let errorSchema = Sury.literal("AlreadyPlaced");
|
|
21
19
|
|
|
22
|
-
let eventSchema =
|
|
20
|
+
let eventSchema = Sury.$schema(s => ({
|
|
23
21
|
TAG: "OrderPlaced",
|
|
24
22
|
orderId: s.m(DcbTag$Reventless.string),
|
|
25
|
-
item: s.m(
|
|
23
|
+
item: s.m(Sury.string)
|
|
26
24
|
}));
|
|
27
25
|
|
|
28
26
|
function commandAuthorization(param) {
|
|
@@ -74,24 +72,24 @@ let PlaceOrderBehavior = {
|
|
|
74
72
|
decide: decide
|
|
75
73
|
};
|
|
76
74
|
|
|
77
|
-
let consumedEventSchema$1 =
|
|
78
|
-
|
|
75
|
+
let consumedEventSchema$1 = Sury.union([
|
|
76
|
+
Sury.$schema(s => ({
|
|
79
77
|
TAG: "OrderPlaced",
|
|
80
|
-
orderId: s.m(
|
|
78
|
+
orderId: s.m(Sury.string)
|
|
81
79
|
})),
|
|
82
|
-
|
|
80
|
+
Sury.$schema(s => ({
|
|
83
81
|
TAG: "OrderShipped",
|
|
84
|
-
orderId: s.m(
|
|
82
|
+
orderId: s.m(Sury.string)
|
|
85
83
|
}))
|
|
86
84
|
]);
|
|
87
85
|
|
|
88
|
-
let todoItemSchema =
|
|
89
|
-
orderId: s.m(
|
|
86
|
+
let todoItemSchema = Sury.$schema(s => ({
|
|
87
|
+
orderId: s.m(Sury.string)
|
|
90
88
|
}));
|
|
91
89
|
|
|
92
|
-
let commandSchema$1 =
|
|
90
|
+
let commandSchema$1 = Sury.$schema(s => ({
|
|
93
91
|
TAG: "ShipOrder",
|
|
94
|
-
orderId: s.m(
|
|
92
|
+
orderId: s.m(Sury.string)
|
|
95
93
|
}));
|
|
96
94
|
|
|
97
95
|
function collect(event) {
|
|
@@ -140,25 +138,25 @@ let AutoShipSlice = {
|
|
|
140
138
|
commandAuthorization: commandAuthorization$1
|
|
141
139
|
};
|
|
142
140
|
|
|
143
|
-
let consumedEventSchema$2 =
|
|
144
|
-
|
|
141
|
+
let consumedEventSchema$2 = Sury.union([
|
|
142
|
+
Sury.$schema(s => ({
|
|
145
143
|
TAG: "OrderPlaced",
|
|
146
144
|
orderId: s.m(DcbTag$Reventless.string)
|
|
147
145
|
})),
|
|
148
|
-
|
|
146
|
+
Sury.$schema(s => ({
|
|
149
147
|
TAG: "OrderShipped",
|
|
150
148
|
orderId: s.m(DcbTag$Reventless.string)
|
|
151
149
|
}))
|
|
152
150
|
]);
|
|
153
151
|
|
|
154
|
-
let commandSchema$2 =
|
|
152
|
+
let commandSchema$2 = Sury.$schema(s => ({
|
|
155
153
|
TAG: "ShipOrder",
|
|
156
154
|
orderId: s.m(DcbTag$Reventless.string)
|
|
157
155
|
}));
|
|
158
156
|
|
|
159
|
-
let errorSchema$1 =
|
|
157
|
+
let errorSchema$1 = Sury.literal("NotPlaced");
|
|
160
158
|
|
|
161
|
-
let eventSchema$1 =
|
|
159
|
+
let eventSchema$1 = Sury.$schema(s => ({
|
|
162
160
|
TAG: "OrderShipped",
|
|
163
161
|
orderId: s.m(DcbTag$Reventless.string)
|
|
164
162
|
}));
|
|
@@ -227,21 +225,21 @@ let ShipOrderBehavior = {
|
|
|
227
225
|
decide: decide$1
|
|
228
226
|
};
|
|
229
227
|
|
|
230
|
-
let stateSchema =
|
|
231
|
-
orderId: s.m(
|
|
232
|
-
item: s.m(
|
|
233
|
-
status: s.m(
|
|
228
|
+
let stateSchema = Sury.$schema(s => ({
|
|
229
|
+
orderId: s.m(Sury.string),
|
|
230
|
+
item: s.m(Sury.string),
|
|
231
|
+
status: s.m(Sury.string)
|
|
234
232
|
}));
|
|
235
233
|
|
|
236
|
-
let consumedEventSchema$3 =
|
|
237
|
-
|
|
234
|
+
let consumedEventSchema$3 = Sury.union([
|
|
235
|
+
Sury.$schema(s => ({
|
|
238
236
|
TAG: "OrderPlaced",
|
|
239
|
-
orderId: s.m(
|
|
240
|
-
item: s.m(
|
|
237
|
+
orderId: s.m(Sury.string),
|
|
238
|
+
item: s.m(Sury.string)
|
|
241
239
|
})),
|
|
242
|
-
|
|
240
|
+
Sury.$schema(s => ({
|
|
243
241
|
TAG: "OrderShipped",
|
|
244
|
-
orderId: s.m(
|
|
242
|
+
orderId: s.m(Sury.string)
|
|
245
243
|
}))
|
|
246
244
|
]);
|
|
247
245
|
|
|
@@ -284,15 +282,17 @@ let OrdersViewProjection = {
|
|
|
284
282
|
project: project
|
|
285
283
|
};
|
|
286
284
|
|
|
287
|
-
let consumedEventSchema$4 =
|
|
285
|
+
let consumedEventSchema$4 = Sury.$schema(s => ({
|
|
288
286
|
TAG: "OrderPlaced",
|
|
289
|
-
orderId: s.m(
|
|
287
|
+
orderId: s.m(Sury.string)
|
|
290
288
|
}));
|
|
291
289
|
|
|
292
|
-
let outboundItemSchema =
|
|
293
|
-
orderId: s.m(
|
|
290
|
+
let outboundItemSchema = Sury.$schema(s => ({
|
|
291
|
+
orderId: s.m(Sury.string)
|
|
294
292
|
}));
|
|
295
293
|
|
|
294
|
+
let inboundCommandSchema = Sury.$unit;
|
|
295
|
+
|
|
296
296
|
function collect$1(event, param) {
|
|
297
297
|
let orderId = event.orderId;
|
|
298
298
|
return [[
|
|
@@ -307,7 +307,7 @@ let ConfirmSlice = {
|
|
|
307
307
|
name: "Confirm",
|
|
308
308
|
consumedEventSchema: consumedEventSchema$4,
|
|
309
309
|
outboundItemSchema: outboundItemSchema,
|
|
310
|
-
inboundCommandSchema:
|
|
310
|
+
inboundCommandSchema: inboundCommandSchema,
|
|
311
311
|
collect: collect$1,
|
|
312
312
|
externalSystem: undefined
|
|
313
313
|
};
|
|
@@ -431,4 +431,4 @@ export {
|
|
|
431
431
|
View,
|
|
432
432
|
Confirm,
|
|
433
433
|
}
|
|
434
|
-
/*
|
|
434
|
+
/* consumedEventSchema Not a pure module */
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
2
|
|
|
3
|
-
import * as
|
|
3
|
+
import * as Sury from "sury";
|
|
4
4
|
import * as InboundTranslation_GWT$ReventlessGwt from "../src/InboundTranslation_GWT.res.mjs";
|
|
5
5
|
|
|
6
|
-
let externalInputSchema =
|
|
7
|
-
paymentId: s.m(
|
|
8
|
-
orderId: s.m(
|
|
9
|
-
status: s.m(
|
|
6
|
+
let externalInputSchema = Sury.$schema(s => ({
|
|
7
|
+
paymentId: s.m(Sury.string),
|
|
8
|
+
orderId: s.m(Sury.string),
|
|
9
|
+
status: s.m(Sury.string)
|
|
10
10
|
}));
|
|
11
11
|
|
|
12
|
-
let commandSchema =
|
|
12
|
+
let commandSchema = Sury.$schema(s => ({
|
|
13
13
|
TAG: "ConfirmPayment",
|
|
14
|
-
orderId: s.m(
|
|
15
|
-
paymentId: s.m(
|
|
14
|
+
orderId: s.m(Sury.string),
|
|
15
|
+
paymentId: s.m(Sury.string)
|
|
16
16
|
}));
|
|
17
17
|
|
|
18
18
|
function translate(input) {
|
package/tests/MappingGwtTest.res
CHANGED
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
// target-decide pipeline end-to-end against the unified `GwtSource`/`GwtTarget`
|
|
7
7
|
// module types.
|
|
8
8
|
|
|
9
|
-
S.enableJson()
|
|
10
9
|
|
|
11
10
|
// ---------------------------------------------------------------------------
|
|
12
11
|
// Shared Aggregate specs + behaviours used by the Aggr→* cases below.
|
|
@@ -1,27 +1,25 @@
|
|
|
1
1
|
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
2
|
|
|
3
|
-
import * as
|
|
3
|
+
import * as Sury from "sury";
|
|
4
4
|
import * as Id$Reventless from "@reventlessdev/reventless-spec/src/types/Id.res.mjs";
|
|
5
5
|
import * as DcbTag$Reventless from "@reventlessdev/reventless-spec/src/components/DcbTag.res.mjs";
|
|
6
6
|
import * as Mapping_GWT$ReventlessGwt from "../src/Mapping_GWT.res.mjs";
|
|
7
7
|
|
|
8
|
-
S.enableJson();
|
|
9
|
-
|
|
10
8
|
let name = "Category";
|
|
11
9
|
|
|
12
|
-
let commandSchema =
|
|
10
|
+
let commandSchema = Sury.$schema(s => ({
|
|
13
11
|
TAG: "AddCategory",
|
|
14
|
-
categoryId: s.m(
|
|
15
|
-
name: s.m(
|
|
12
|
+
categoryId: s.m(Sury.string),
|
|
13
|
+
name: s.m(Sury.string)
|
|
16
14
|
}));
|
|
17
15
|
|
|
18
|
-
let eventSchema =
|
|
16
|
+
let eventSchema = Sury.$schema(s => ({
|
|
19
17
|
TAG: "CategoryAdded",
|
|
20
|
-
categoryId: s.m(
|
|
21
|
-
name: s.m(
|
|
18
|
+
categoryId: s.m(Sury.string),
|
|
19
|
+
name: s.m(Sury.string)
|
|
22
20
|
}));
|
|
23
21
|
|
|
24
|
-
let errorSchema =
|
|
22
|
+
let errorSchema = Sury.literal("CategoryAlreadyExists");
|
|
25
23
|
|
|
26
24
|
let moduleUrl = "";
|
|
27
25
|
|
|
@@ -74,21 +72,21 @@ let CategoryBehavior = {
|
|
|
74
72
|
|
|
75
73
|
let name$1 = "Product";
|
|
76
74
|
|
|
77
|
-
let commandSchema$1 =
|
|
75
|
+
let commandSchema$1 = Sury.$schema(s => ({
|
|
78
76
|
TAG: "MirrorCategory",
|
|
79
|
-
productId: s.m(
|
|
80
|
-
categoryId: s.m(
|
|
81
|
-
name: s.m(
|
|
77
|
+
productId: s.m(Sury.string),
|
|
78
|
+
categoryId: s.m(Sury.string),
|
|
79
|
+
name: s.m(Sury.string)
|
|
82
80
|
}));
|
|
83
81
|
|
|
84
|
-
let eventSchema$1 =
|
|
82
|
+
let eventSchema$1 = Sury.$schema(s => ({
|
|
85
83
|
TAG: "ProductCategoryMirrored",
|
|
86
|
-
productId: s.m(
|
|
87
|
-
categoryId: s.m(
|
|
88
|
-
name: s.m(
|
|
84
|
+
productId: s.m(Sury.string),
|
|
85
|
+
categoryId: s.m(Sury.string),
|
|
86
|
+
name: s.m(Sury.string)
|
|
89
87
|
}));
|
|
90
88
|
|
|
91
|
-
let errorSchema$1 =
|
|
89
|
+
let errorSchema$1 = Sury.literal("ProductAlreadyMirrored");
|
|
92
90
|
|
|
93
91
|
let moduleUrl$2 = "";
|
|
94
92
|
|
|
@@ -140,7 +138,7 @@ let ProductBehavior = {
|
|
|
140
138
|
moduleUrl: moduleUrl$3
|
|
141
139
|
};
|
|
142
140
|
|
|
143
|
-
let consumedEventSchema =
|
|
141
|
+
let consumedEventSchema = Sury.$schema(s => ({
|
|
144
142
|
TAG: "NotificationSent",
|
|
145
143
|
notificationId: s.m(DcbTag$Reventless.string)
|
|
146
144
|
}));
|
|
@@ -151,18 +149,18 @@ function evolve$2(_state, event) {
|
|
|
151
149
|
};
|
|
152
150
|
}
|
|
153
151
|
|
|
154
|
-
let commandSchema$2 =
|
|
152
|
+
let commandSchema$2 = Sury.$schema(s => ({
|
|
155
153
|
TAG: "SendNotification",
|
|
156
154
|
notificationId: s.m(DcbTag$Reventless.string),
|
|
157
|
-
message: s.m(
|
|
155
|
+
message: s.m(Sury.string)
|
|
158
156
|
}));
|
|
159
157
|
|
|
160
|
-
let errorSchema$2 =
|
|
158
|
+
let errorSchema$2 = Sury.literal("NotificationAlreadySent");
|
|
161
159
|
|
|
162
|
-
let eventSchema$2 =
|
|
160
|
+
let eventSchema$2 = Sury.$schema(s => ({
|
|
163
161
|
TAG: "NotificationSent",
|
|
164
162
|
notificationId: s.m(DcbTag$Reventless.string),
|
|
165
|
-
message: s.m(
|
|
163
|
+
message: s.m(Sury.string)
|
|
166
164
|
}));
|
|
167
165
|
|
|
168
166
|
function decide$2(state, command) {
|
|
@@ -204,7 +202,7 @@ let NotificationSlice = {
|
|
|
204
202
|
readConsistency: "EscalateOnRetry"
|
|
205
203
|
};
|
|
206
204
|
|
|
207
|
-
let consumedEventSchema$1 =
|
|
205
|
+
let consumedEventSchema$1 = Sury.$schema(s => ({
|
|
208
206
|
TAG: "StockReserved",
|
|
209
207
|
itemId: s.m(DcbTag$Reventless.string)
|
|
210
208
|
}));
|
|
@@ -215,18 +213,18 @@ function evolve$3(_state, event) {
|
|
|
215
213
|
};
|
|
216
214
|
}
|
|
217
215
|
|
|
218
|
-
let commandSchema$3 =
|
|
216
|
+
let commandSchema$3 = Sury.$schema(s => ({
|
|
219
217
|
TAG: "ReserveStock",
|
|
220
218
|
itemId: s.m(DcbTag$Reventless.string),
|
|
221
|
-
quantity: s.m(
|
|
219
|
+
quantity: s.m(Sury.int)
|
|
222
220
|
}));
|
|
223
221
|
|
|
224
|
-
let errorSchema$3 =
|
|
222
|
+
let errorSchema$3 = Sury.literal("OutOfStock");
|
|
225
223
|
|
|
226
|
-
let eventSchema$3 =
|
|
224
|
+
let eventSchema$3 = Sury.$schema(s => ({
|
|
227
225
|
TAG: "StockReserved",
|
|
228
226
|
itemId: s.m(DcbTag$Reventless.string),
|
|
229
|
-
quantity: s.m(
|
|
227
|
+
quantity: s.m(Sury.int)
|
|
230
228
|
}));
|
|
231
229
|
|
|
232
230
|
function decide$3(state, command) {
|
|
@@ -593,4 +591,4 @@ export {
|
|
|
593
591
|
DcbToDcbMapping,
|
|
594
592
|
DcbToDcbGwt,
|
|
595
593
|
}
|
|
596
|
-
/*
|
|
594
|
+
/* commandSchema Not a pure module */
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
2
|
|
|
3
|
-
import * as
|
|
3
|
+
import * as Sury from "sury";
|
|
4
4
|
import * as OutboundTranslation_GWT$ReventlessGwt from "../src/OutboundTranslation_GWT.res.mjs";
|
|
5
5
|
|
|
6
|
-
let consumedEventSchema =
|
|
6
|
+
let consumedEventSchema = Sury.$schema(s => ({
|
|
7
7
|
TAG: "OrderShipped",
|
|
8
|
-
orderId: s.m(
|
|
9
|
-
email: s.m(
|
|
8
|
+
orderId: s.m(Sury.string),
|
|
9
|
+
email: s.m(Sury.string)
|
|
10
10
|
}));
|
|
11
11
|
|
|
12
|
-
let outboundItemSchema =
|
|
13
|
-
orderId: s.m(
|
|
14
|
-
email: s.m(
|
|
12
|
+
let outboundItemSchema = Sury.$schema(s => ({
|
|
13
|
+
orderId: s.m(Sury.string),
|
|
14
|
+
email: s.m(Sury.string)
|
|
15
15
|
}));
|
|
16
16
|
|
|
17
|
-
let inboundCommandSchema =
|
|
17
|
+
let inboundCommandSchema = Sury.literal("NoOp");
|
|
18
18
|
|
|
19
19
|
function collect(event, param) {
|
|
20
20
|
let orderId = event.orderId;
|
package/tests/QueryGwtTest.res
CHANGED
|
@@ -1,22 +1,20 @@
|
|
|
1
1
|
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
2
|
|
|
3
|
-
import * as
|
|
3
|
+
import * as Sury from "sury";
|
|
4
4
|
import * as Stdlib_Array from "@rescript/runtime/lib/es6/Stdlib_Array.js";
|
|
5
5
|
import * as Id$Reventless from "@reventlessdev/reventless-spec/src/types/Id.res.mjs";
|
|
6
6
|
import * as ReadModel$Reventless from "@reventlessdev/reventless-spec/src/components/ReadModel.res.mjs";
|
|
7
7
|
import * as Outcome$ReventlessGwt from "../src/Outcome.res.mjs";
|
|
8
8
|
import * as Query_GWT$ReventlessGwt from "../src/Query_GWT.res.mjs";
|
|
9
9
|
|
|
10
|
-
S.enableJson();
|
|
11
|
-
|
|
12
10
|
let name = "Categories";
|
|
13
11
|
|
|
14
12
|
let moduleUrl = "";
|
|
15
13
|
|
|
16
|
-
let stateSchema =
|
|
17
|
-
categoryId: s.m(
|
|
18
|
-
name: s.m(
|
|
19
|
-
archived: s.m(
|
|
14
|
+
let stateSchema = Sury.$schema(s => ({
|
|
15
|
+
categoryId: s.m(Sury.string),
|
|
16
|
+
name: s.m(Sury.string),
|
|
17
|
+
archived: s.m(Sury.bool)
|
|
20
18
|
}));
|
|
21
19
|
|
|
22
20
|
let config = ReadModel$Reventless.config(undefined, undefined, [{
|
|
@@ -207,17 +205,17 @@ let name$1 = "OrdersView";
|
|
|
207
205
|
|
|
208
206
|
let moduleUrl$1 = "";
|
|
209
207
|
|
|
210
|
-
let stateSchema$1 =
|
|
211
|
-
orderId: s.m(
|
|
212
|
-
customerId: s.m(
|
|
213
|
-
total: s.m(
|
|
208
|
+
let stateSchema$1 = Sury.$schema(s => ({
|
|
209
|
+
orderId: s.m(Sury.string),
|
|
210
|
+
customerId: s.m(Sury.string),
|
|
211
|
+
total: s.m(Sury.int)
|
|
214
212
|
}));
|
|
215
213
|
|
|
216
|
-
let consumedEventSchema =
|
|
214
|
+
let consumedEventSchema = Sury.$schema(s => ({
|
|
217
215
|
TAG: "OrderPlaced",
|
|
218
|
-
orderId: s.m(
|
|
219
|
-
customerId: s.m(
|
|
220
|
-
total: s.m(
|
|
216
|
+
orderId: s.m(Sury.string),
|
|
217
|
+
customerId: s.m(Sury.string),
|
|
218
|
+
total: s.m(Sury.int)
|
|
221
219
|
}));
|
|
222
220
|
|
|
223
221
|
function project(param) {
|
|
@@ -312,4 +310,4 @@ export {
|
|
|
312
310
|
OrdersView,
|
|
313
311
|
OrdersQuery,
|
|
314
312
|
}
|
|
315
|
-
/*
|
|
313
|
+
/* stateSchema Not a pure module */
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
2
|
|
|
3
|
-
import * as
|
|
3
|
+
import * as Sury from "sury";
|
|
4
4
|
import * as ReadModel$Reventless from "@reventlessdev/reventless-spec/src/components/ReadModel.res.mjs";
|
|
5
5
|
import * as Query_GWT$ReventlessGwt from "../src/Query_GWT.res.mjs";
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
name: s.m(S.string),
|
|
12
|
-
price: s.m(S.float)
|
|
7
|
+
let stateSchema = Sury.$schema(s => ({
|
|
8
|
+
productId: s.m(Sury.string),
|
|
9
|
+
name: s.m(Sury.string),
|
|
10
|
+
price: s.m(Sury.float)
|
|
13
11
|
}));
|
|
14
12
|
|
|
15
13
|
let config = ReadModel$Reventless.config(undefined, undefined, undefined);
|
|
@@ -23,10 +21,10 @@ let ProductRow = {
|
|
|
23
21
|
visibility: "Public"
|
|
24
22
|
};
|
|
25
23
|
|
|
26
|
-
let stateSchema$1 =
|
|
27
|
-
orderId: s.m(
|
|
28
|
-
productId: s.m(
|
|
29
|
-
productIds: s.m(
|
|
24
|
+
let stateSchema$1 = Sury.$schema(s => ({
|
|
25
|
+
orderId: s.m(Sury.string),
|
|
26
|
+
productId: s.m(Sury.string),
|
|
27
|
+
productIds: s.m(Sury.array(Sury.string))
|
|
30
28
|
}));
|
|
31
29
|
|
|
32
30
|
let config$1 = ReadModel$Reventless.config([{
|
|
@@ -133,4 +131,4 @@ export {
|
|
|
133
131
|
order,
|
|
134
132
|
stores,
|
|
135
133
|
}
|
|
136
|
-
/*
|
|
134
|
+
/* stateSchema Not a pure module */
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
2
|
|
|
3
|
-
import * as
|
|
3
|
+
import * as Sury from "sury";
|
|
4
4
|
import * as Id$Reventless from "@reventlessdev/reventless-spec/src/types/Id.res.mjs";
|
|
5
5
|
import * as MockEmail$ReventlessGwt from "./MockEmail.res.mjs";
|
|
6
6
|
|
|
7
|
-
let eventSchema =
|
|
8
|
-
|
|
7
|
+
let eventSchema = Sury.union([
|
|
8
|
+
Sury.$schema(s => ({
|
|
9
9
|
TAG: "Placed",
|
|
10
|
-
email: s.m(
|
|
10
|
+
email: s.m(Sury.string)
|
|
11
11
|
})),
|
|
12
|
-
|
|
12
|
+
Sury.literal("Shipped")
|
|
13
13
|
]);
|
|
14
14
|
|
|
15
15
|
let Source = {
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
2
|
|
|
3
|
-
import * as
|
|
3
|
+
import * as Sury from "sury";
|
|
4
|
+
import * as Util_Sury$Reventless from "@reventlessdev/reventless-spec/src/util/Util_Sury.res.mjs";
|
|
4
5
|
|
|
5
|
-
let callSchema =
|
|
6
|
+
let callSchema = Sury.$schema(s => ({
|
|
6
7
|
TAG: "SendConfirmation",
|
|
7
|
-
email: s.m(
|
|
8
|
-
orderId: s.m(
|
|
8
|
+
email: s.m(Sury.string),
|
|
9
|
+
orderId: s.m(Sury.string)
|
|
9
10
|
}));
|
|
10
11
|
|
|
11
12
|
let calls = {
|
|
@@ -29,7 +30,7 @@ function mock_snapshot() {
|
|
|
29
30
|
}
|
|
30
31
|
|
|
31
32
|
function mock_encode(c) {
|
|
32
|
-
return
|
|
33
|
+
return Util_Sury$Reventless.toJson(c, callSchema);
|
|
33
34
|
}
|
|
34
35
|
|
|
35
36
|
let mock = {
|
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
2
|
|
|
3
|
-
import * as
|
|
3
|
+
import * as Sury from "sury";
|
|
4
4
|
import * as DcbTag$Reventless from "@reventlessdev/reventless-spec/src/components/DcbTag.res.mjs";
|
|
5
5
|
import * as Outcome$ReventlessGwt from "../src/Outcome.res.mjs";
|
|
6
6
|
import * as Behavior_GWT$ReventlessGwt from "../src/Behavior_GWT.res.mjs";
|
|
7
7
|
|
|
8
|
-
let consumedEventSchema =
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
let consumedEventSchema = Sury.union([
|
|
9
|
+
Sury.literal("CategoryAdded"),
|
|
10
|
+
Sury.literal("CategoryArchived")
|
|
11
11
|
]);
|
|
12
12
|
|
|
13
|
-
let commandSchema =
|
|
13
|
+
let commandSchema = Sury.$schema(s => ({
|
|
14
14
|
TAG: "AddCategory",
|
|
15
15
|
categoryId: s.m(DcbTag$Reventless.string),
|
|
16
|
-
name: s.m(
|
|
16
|
+
name: s.m(Sury.string)
|
|
17
17
|
}));
|
|
18
18
|
|
|
19
|
-
let errorSchema =
|
|
19
|
+
let errorSchema = Sury.literal("CategoryAlreadyExists");
|
|
20
20
|
|
|
21
|
-
let eventSchema =
|
|
21
|
+
let eventSchema = Sury.$schema(s => ({
|
|
22
22
|
TAG: "CategoryAdded",
|
|
23
23
|
categoryId: s.m(DcbTag$Reventless.string),
|
|
24
|
-
name: s.m(
|
|
24
|
+
name: s.m(Sury.string)
|
|
25
25
|
}));
|
|
26
26
|
|
|
27
27
|
function commandAuthorization(param) {
|
|
@@ -151,18 +151,18 @@ describe("AddCategory StateChangeSlice", () => {
|
|
|
151
151
|
}));
|
|
152
152
|
});
|
|
153
153
|
|
|
154
|
-
let consumedEventSchema$1 =
|
|
154
|
+
let consumedEventSchema$1 = Sury.literal("Noop");
|
|
155
155
|
|
|
156
|
-
let commandSchema$1 =
|
|
156
|
+
let commandSchema$1 = Sury.$schema(s => ({
|
|
157
157
|
TAG: "Do",
|
|
158
|
-
id: s.m(
|
|
158
|
+
id: s.m(Sury.string)
|
|
159
159
|
}));
|
|
160
160
|
|
|
161
|
-
let errorSchema$1 =
|
|
161
|
+
let errorSchema$1 = Sury.literal("Rejected");
|
|
162
162
|
|
|
163
|
-
let eventSchema$1 =
|
|
163
|
+
let eventSchema$1 = Sury.$schema(s => ({
|
|
164
164
|
TAG: "Done",
|
|
165
|
-
id: s.m(
|
|
165
|
+
id: s.m(Sury.string)
|
|
166
166
|
}));
|
|
167
167
|
|
|
168
168
|
function commandAuthorization$1(param) {
|
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
2
|
|
|
3
|
-
import * as
|
|
3
|
+
import * as Sury from "sury";
|
|
4
4
|
import * as Projection_GWT$ReventlessGwt from "../src/Projection_GWT.res.mjs";
|
|
5
5
|
|
|
6
|
-
let stateSchema =
|
|
7
|
-
categoryId: s.m(
|
|
8
|
-
name: s.m(
|
|
9
|
-
archived: s.m(
|
|
6
|
+
let stateSchema = Sury.$schema(s => ({
|
|
7
|
+
categoryId: s.m(Sury.string),
|
|
8
|
+
name: s.m(Sury.string),
|
|
9
|
+
archived: s.m(Sury.bool)
|
|
10
10
|
}));
|
|
11
11
|
|
|
12
|
-
let consumedEventSchema =
|
|
13
|
-
|
|
12
|
+
let consumedEventSchema = Sury.union([
|
|
13
|
+
Sury.$schema(s => ({
|
|
14
14
|
TAG: "CategoryAdded",
|
|
15
|
-
categoryId: s.m(
|
|
16
|
-
name: s.m(
|
|
15
|
+
categoryId: s.m(Sury.string),
|
|
16
|
+
name: s.m(Sury.string)
|
|
17
17
|
})),
|
|
18
|
-
|
|
18
|
+
Sury.$schema(s => ({
|
|
19
19
|
TAG: "CategoryRenamed",
|
|
20
|
-
categoryId: s.m(
|
|
21
|
-
name: s.m(
|
|
20
|
+
categoryId: s.m(Sury.string),
|
|
21
|
+
name: s.m(Sury.string)
|
|
22
22
|
})),
|
|
23
|
-
|
|
23
|
+
Sury.$schema(s => ({
|
|
24
24
|
TAG: "CategoryArchived",
|
|
25
|
-
categoryId: s.m(
|
|
25
|
+
categoryId: s.m(Sury.string)
|
|
26
26
|
}))
|
|
27
27
|
]);
|
|
28
28
|
|