@reventlessdev/reventless-gwt 1.0.0-alpha.282 → 1.0.0-alpha.284
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 +20 -0
- package/package.json +5 -5
- package/src/Automation_GWT.res +1 -1
- package/src/Automation_GWT.res.mjs +1 -1
- package/tests/AutomationDeadlineGwtTest.res +1 -1
- package/tests/AutomationDeadlineGwtTest.res.mjs +1 -1
- package/tests/AutomationFromSliceGwtTest.res +4 -1
- package/tests/AutomationFromSliceGwtTest.res.mjs +2 -2
- package/tests/AutomationGwtTest.res +1 -1
- package/tests/AutomationGwtTest.res.mjs +1 -1
- package/tests/AutomationRescheduleGwtTest.res +2 -2
- package/tests/AutomationRescheduleGwtTest.res.mjs +2 -2
- package/tests/AutomationScheduleGwtTest.res +1 -1
- package/tests/AutomationScheduleGwtTest.res.mjs +1 -1
- package/tests/FlowGwtTest.res +1 -1
- package/tests/FlowGwtTest.res.mjs +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,26 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# 1.0.0-alpha.284 (2026-11-08)
|
|
7
|
+
|
|
8
|
+
* feat(core)!: an automation or outbound translation hears that its command was refused ([8c9b4b6](https://github.com/ReventlessDev/reventless-core/commit/8c9b4b6c643a5a9e95c85f823fbc333638224346))
|
|
9
|
+
|
|
10
|
+
### BREAKING CHANGES
|
|
11
|
+
|
|
12
|
+
* an AutomationSlice Automation module written outside an
|
|
13
|
+
@@reventless.automation file must declare onExhausted with ~lastError. External
|
|
14
|
+
consumers need the republished reventless-ppx for the injection.
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
# 1.0.0-alpha.283 (2026-11-08)
|
|
19
|
+
|
|
20
|
+
**Note:** Version bump only for package @reventlessdev/reventless-gwt
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
6
26
|
# 1.0.0-alpha.282 (2026-11-07)
|
|
7
27
|
|
|
8
28
|
**Note:** Version bump only for package @reventlessdev/reventless-gwt
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reventlessdev/reventless-gwt",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.284",
|
|
4
4
|
"description": "Given-When-Then DSLs and test harness for Reventless slice testing",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"jest": {
|
|
@@ -14,12 +14,12 @@
|
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"sury": "11.1.0",
|
|
17
|
+
"@reventlessdev/rescript-effect": "1.0.0-alpha.3",
|
|
17
18
|
"@reventlessdev/rescript-jest": "1.0.0-alpha.13",
|
|
18
19
|
"@reventlessdev/rescript-node": "2.0.0-alpha.26",
|
|
19
|
-
"@reventlessdev/reventless-
|
|
20
|
-
"@reventlessdev/
|
|
21
|
-
"@reventlessdev/reventless-infra": "3.0.0-alpha.
|
|
22
|
-
"@reventlessdev/reventless-spec": "3.0.0-alpha.195"
|
|
20
|
+
"@reventlessdev/reventless-spec": "3.0.0-alpha.197",
|
|
21
|
+
"@reventlessdev/reventless-core": "3.0.0-alpha.335",
|
|
22
|
+
"@reventlessdev/reventless-infra": "3.0.0-alpha.228"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"rescript": "12.3.1",
|
package/src/Automation_GWT.res
CHANGED
|
@@ -278,7 +278,7 @@ module FromSlice = (
|
|
|
278
278
|
// Unit: process and abandonment
|
|
279
279
|
let givenTodo = (id: string, item: Spec.todoItem) => (id, item)
|
|
280
280
|
let whenProcess = ((id, item), ~now=?) => Automation.process(id, item, ~now=nowOr(now))
|
|
281
|
-
let whenExhausted = ((id, item)) => Automation.onExhausted(id, item)
|
|
281
|
+
let whenExhausted = ((id, item), ~lastError=?) => Automation.onExhausted(id, item, ~lastError)
|
|
282
282
|
let thenCommand = (actual, expectedId, expectedCmd) =>
|
|
283
283
|
switch actual {
|
|
284
284
|
| Some((id, cmd)) if id == expectedId && cmd == expectedCmd => Outcome.pass
|
|
@@ -253,7 +253,7 @@ function FromSlice(Spec) {
|
|
|
253
253
|
item
|
|
254
254
|
];
|
|
255
255
|
let whenProcess = (param, now) => Automation.process(param[0], param[1], nowOr(now));
|
|
256
|
-
let whenExhausted = param => Automation.onExhausted(param[0], param[1]);
|
|
256
|
+
let whenExhausted = (param, lastError) => Automation.onExhausted(param[0], param[1], lastError);
|
|
257
257
|
let thenCommand = (actual, expectedId, expectedCmd) => {
|
|
258
258
|
if (actual !== undefined && actual[0] === expectedId && Primitive_object.equal(actual[1], expectedCmd)) {
|
|
259
259
|
return Outcome$ReventlessGwt.pass;
|
|
@@ -59,7 +59,7 @@ module CancelUnshipped_Automation = {
|
|
|
59
59
|
|
|
60
60
|
let process = (id, item: CancelUnshipped.todoItem, ~now) =>
|
|
61
61
|
now >= item.dueAt ? Some((id, CancelUnshipped.CancelOrder({orderId: item.orderId}))) : None
|
|
62
|
-
let onExhausted = (_id, _item: CancelUnshipped.todoItem) => None
|
|
62
|
+
let onExhausted = (_id, _item: CancelUnshipped.todoItem, ~lastError as _) => None
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
open CancelUnshipped
|
|
@@ -85,7 +85,10 @@ module ShipPaid_Automation = {
|
|
|
85
85
|
id,
|
|
86
86
|
ShipPaid.Ship({orderId: id}),
|
|
87
87
|
))
|
|
88
|
-
let onExhausted = (id, _item: ShipPaid.todoItem) => Some((
|
|
88
|
+
let onExhausted = (id, _item: ShipPaid.todoItem, ~lastError as _) => Some((
|
|
89
|
+
id,
|
|
90
|
+
ShipPaid.GiveUp({orderId: id}),
|
|
91
|
+
))
|
|
89
92
|
}
|
|
90
93
|
|
|
91
94
|
open ShipPaid
|
|
@@ -166,7 +166,7 @@ function process(id, _item, param) {
|
|
|
166
166
|
];
|
|
167
167
|
}
|
|
168
168
|
|
|
169
|
-
function onExhausted(id, _item) {
|
|
169
|
+
function onExhausted(id, _item, param) {
|
|
170
170
|
return [
|
|
171
171
|
id,
|
|
172
172
|
{
|
|
@@ -258,7 +258,7 @@ describe("Automation_GWT.FromSlice", () => {
|
|
|
258
258
|
}));
|
|
259
259
|
test("exhausted: onExhausted is what the domain hears", () => thenCommand(whenExhausted(givenTodo("o1", {
|
|
260
260
|
orderId: "o1"
|
|
261
|
-
})), "o1", {
|
|
261
|
+
}), undefined), "o1", {
|
|
262
262
|
TAG: "GiveUp",
|
|
263
263
|
orderId: "o1"
|
|
264
264
|
}));
|
|
@@ -35,7 +35,7 @@ module ShipOrderSlice = {
|
|
|
35
35
|
item.orderId,
|
|
36
36
|
CreateShipment({orderId: item.orderId, address: item.shippingAddress}),
|
|
37
37
|
))
|
|
38
|
-
let onExhausted = (_id, _item) => None
|
|
38
|
+
let onExhausted = (_id, _item, ~lastError as _) => None
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
describe("ShipOrder AutomationSlice", () => {
|
|
@@ -80,7 +80,7 @@ module MarketingDigest_Automation = {
|
|
|
80
80
|
item.recipientId,
|
|
81
81
|
MarketingDigest.RequestNotification({recipientId: item.recipientId, reference: id}),
|
|
82
82
|
))
|
|
83
|
-
let onExhausted = (_id, _item: MarketingDigest.todoItem) => None
|
|
83
|
+
let onExhausted = (_id, _item: MarketingDigest.todoItem, ~lastError as _) => None
|
|
84
84
|
}
|
|
85
85
|
|
|
86
86
|
module Digest = {
|
|
@@ -216,7 +216,7 @@ module Reminder_Automation = {
|
|
|
216
216
|
item.orderId,
|
|
217
217
|
Reminder.RemindOrder({orderId: item.orderId}),
|
|
218
218
|
))
|
|
219
|
-
let onExhausted = (_id, _item: Reminder.todoItem) => None
|
|
219
|
+
let onExhausted = (_id, _item: Reminder.todoItem, ~lastError as _) => None
|
|
220
220
|
}
|
|
221
221
|
|
|
222
222
|
module ReminderGwt = {
|
|
@@ -167,7 +167,7 @@ function process(id, item, param) {
|
|
|
167
167
|
];
|
|
168
168
|
}
|
|
169
169
|
|
|
170
|
-
function onExhausted(_id, _item) {
|
|
170
|
+
function onExhausted(_id, _item, param) {
|
|
171
171
|
|
|
172
172
|
}
|
|
173
173
|
|
|
@@ -533,7 +533,7 @@ function process$1(_id, item, param) {
|
|
|
533
533
|
];
|
|
534
534
|
}
|
|
535
535
|
|
|
536
|
-
function onExhausted$1(_id, _item) {
|
|
536
|
+
function onExhausted$1(_id, _item, param) {
|
|
537
537
|
|
|
538
538
|
}
|
|
539
539
|
|
|
@@ -74,7 +74,7 @@ module DemandReport_Automation = {
|
|
|
74
74
|
id,
|
|
75
75
|
DemandReport.RequestDemandReport({day: item.day}),
|
|
76
76
|
))
|
|
77
|
-
let onExhausted = (_id, _item: DemandReport.todoItem) => None
|
|
77
|
+
let onExhausted = (_id, _item: DemandReport.todoItem, ~lastError as _) => None
|
|
78
78
|
}
|
|
79
79
|
|
|
80
80
|
open DemandReport
|
package/tests/FlowGwtTest.res
CHANGED