@reventlessdev/reventless-local 3.0.0-alpha.192 → 3.0.0-alpha.194
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 +16 -0
- package/package.json +9 -9
- package/src/Platform.res +5 -0
- package/tests/components/outboundtranslationslice/OutboundTranslationSliceCallbackTest.res +12 -12
- package/tests/components/outboundtranslationslice/OutboundTranslationSliceCallbackTest.res.mjs +98 -60
- package/tests/components/outboundtranslationslice/OutboundTranslationSliceFixtures.res +4 -2
- package/tests/components/outboundtranslationslice/OutboundTranslationSliceFixtures.res.mjs +8 -2
- package/tests/components/outboundtranslationslice/OutboundTranslationSlicePlatformFixtures.res +2 -1
- package/tests/components/outboundtranslationslice/OutboundTranslationSlicePlatformFixtures.res.mjs +5 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,22 @@
|
|
|
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
|
+
# 3.0.0-alpha.194 (2026-08-03)
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* **outbound:** let an outbound slice read an aggregate, and geocode addresses with it ([867e63e](https://github.com/ReventlessDev/reventless-core/commit/867e63e774ebc8b78b2b19c78645c8a12a8d06f6))
|
|
11
|
+
* **platform:** let a deployment choose what the host shell does ([ae0aec3](https://github.com/ReventlessDev/reventless-core/commit/ae0aec33dcf641f02187e8d6a3f3594c506820b6))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# 3.0.0-alpha.193 (2026-08-02)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @reventlessdev/reventless-local
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
6
22
|
# 3.0.0-alpha.192 (2026-08-02)
|
|
7
23
|
|
|
8
24
|
**Note:** Version bump only for package @reventlessdev/reventless-local
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reventlessdev/reventless-local",
|
|
3
|
-
"version": "3.0.0-alpha.
|
|
3
|
+
"version": "3.0.0-alpha.194",
|
|
4
4
|
"description": "Local platform for Reventless (in-memory or SQLite backend, for development and testing without AWS)",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"bin": {
|
|
@@ -37,20 +37,20 @@
|
|
|
37
37
|
"@reventlessdev/rescript-effect": "0.1.0-alpha.32",
|
|
38
38
|
"@reventlessdev/rescript-graphql-yoga": "1.0.0-alpha.26",
|
|
39
39
|
"@reventlessdev/rescript-jest": "1.0.0-alpha.10",
|
|
40
|
-
"@reventlessdev/rescript-mcp-sdk": "1.0.0-alpha.21",
|
|
41
40
|
"@reventlessdev/rescript-node": "2.0.0-alpha.1",
|
|
41
|
+
"@reventlessdev/rescript-mcp-sdk": "1.0.0-alpha.21",
|
|
42
42
|
"@reventlessdev/rescript-pulumi-pulumi": "2.3.0-alpha.18",
|
|
43
|
-
"@reventlessdev/reventless-core": "3.0.0-alpha.
|
|
44
|
-
"@reventlessdev/reventless-graphql-server": "1.0.0-alpha.
|
|
45
|
-
"@reventlessdev/reventless-
|
|
46
|
-
"@reventlessdev/reventless-
|
|
47
|
-
"@reventlessdev/reventless-
|
|
48
|
-
"@reventlessdev/reventless-spec": "3.0.0-alpha.
|
|
43
|
+
"@reventlessdev/reventless-core": "3.0.0-alpha.206",
|
|
44
|
+
"@reventlessdev/reventless-graphql-server": "1.0.0-alpha.54",
|
|
45
|
+
"@reventlessdev/reventless-infra": "3.0.0-alpha.123",
|
|
46
|
+
"@reventlessdev/reventless-postgres": "3.0.0-alpha.70",
|
|
47
|
+
"@reventlessdev/reventless-gwt": "1.0.0-alpha.153",
|
|
48
|
+
"@reventlessdev/reventless-spec": "3.0.0-alpha.98"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"rescript": "12.3.0",
|
|
52
52
|
"sury-ppx": "11.0.0-alpha.2",
|
|
53
|
-
"@reventlessdev/reventless-ppx": "1.0.0-alpha.
|
|
53
|
+
"@reventlessdev/reventless-ppx": "1.0.0-alpha.62"
|
|
54
54
|
},
|
|
55
55
|
"peerDependencies": {
|
|
56
56
|
"rescript": "12.3.0"
|
package/src/Platform.res
CHANGED
|
@@ -1972,6 +1972,11 @@ module MakeWithConfig = (
|
|
|
1972
1972
|
// ignores them.
|
|
1973
1973
|
geocoderPlaceIndex?: ReventlessInfra.Platform.geocoderIndex,
|
|
1974
1974
|
uploadBucket?: ReventlessInfra.Platform.objectStore,
|
|
1975
|
+
// Same terms: the AWS deploy writes these into the config.json it hosts, and
|
|
1976
|
+
// local dev has no config.json of its own to write — the host-shell package
|
|
1977
|
+
// serves `public/config.json`, which is where local turns a view mode on.
|
|
1978
|
+
viewModes?: array<ReventlessInfra.Platform.viewMode>,
|
|
1979
|
+
shellConfig?: dict<JSON.t>,
|
|
1975
1980
|
}
|
|
1976
1981
|
let deployPlatform = (
|
|
1977
1982
|
~version,
|
|
@@ -35,7 +35,7 @@ describe("OutboundTranslationSlice Callback", () => {
|
|
|
35
35
|
|
|
36
36
|
describe("Phase 1 — collect", () => {
|
|
37
37
|
testPromise("OrderShipped event creates a pending outbound item", async () => {
|
|
38
|
-
FireForgetCallback.phase1([OrderShipped({orderId: "ord-1", email: "test@example.com"})])
|
|
38
|
+
FireForgetCallback.phase1([("evt", OrderShipped({orderId: "ord-1", email: "test@example.com"}))])
|
|
39
39
|
let items = FireForgetCallback.todoItems
|
|
40
40
|
expect(items->Dict.toArray->Array.length)->toBe(1)
|
|
41
41
|
let row = items->Dict.get("ord-1")
|
|
@@ -46,16 +46,16 @@ describe("OutboundTranslationSlice Callback", () => {
|
|
|
46
46
|
})
|
|
47
47
|
|
|
48
48
|
testPromise("duplicate event does not create a second item (idempotent)", async () => {
|
|
49
|
-
FireForgetCallback.phase1([OrderShipped({orderId: "ord-1", email: "test@example.com"})])
|
|
50
|
-
FireForgetCallback.phase1([OrderShipped({orderId: "ord-1", email: "other@example.com"})])
|
|
49
|
+
FireForgetCallback.phase1([("evt", OrderShipped({orderId: "ord-1", email: "test@example.com"}))])
|
|
50
|
+
FireForgetCallback.phase1([("evt", OrderShipped({orderId: "ord-1", email: "other@example.com"}))])
|
|
51
51
|
let items = FireForgetCallback.todoItems
|
|
52
52
|
expect(items->Dict.toArray->Array.length)->toBe(1)
|
|
53
53
|
})
|
|
54
54
|
|
|
55
55
|
testPromise("multiple different events create multiple items", async () => {
|
|
56
56
|
FireForgetCallback.phase1([
|
|
57
|
-
OrderShipped({orderId: "ord-1", email: "a@example.com"}),
|
|
58
|
-
OrderShipped({orderId: "ord-2", email: "b@example.com"}),
|
|
57
|
+
("evt", OrderShipped({orderId: "ord-1", email: "a@example.com"})),
|
|
58
|
+
("evt", OrderShipped({orderId: "ord-2", email: "b@example.com"})),
|
|
59
59
|
])
|
|
60
60
|
let items = FireForgetCallback.todoItems
|
|
61
61
|
expect(items->Dict.toArray->Array.length)->toBe(2)
|
|
@@ -65,7 +65,7 @@ describe("OutboundTranslationSlice Callback", () => {
|
|
|
65
65
|
|
|
66
66
|
describe("Phase 2 — translate (fire-and-forget)", () => {
|
|
67
67
|
testPromise("Ok(None) marks item as Completed, no command published", async () => {
|
|
68
|
-
FireForgetCallback.phase1([OrderShipped({orderId: "ord-1", email: "test@example.com"})])
|
|
68
|
+
FireForgetCallback.phase1([("evt", OrderShipped({orderId: "ord-1", email: "test@example.com"}))])
|
|
69
69
|
let publishedCommands = ref([])
|
|
70
70
|
let mockPublish: ReventlessInfra.CommandTopic.publishJsons = async cmds => {
|
|
71
71
|
publishedCommands := cmds
|
|
@@ -88,7 +88,7 @@ describe("OutboundTranslationSlice Callback", () => {
|
|
|
88
88
|
|
|
89
89
|
describe("Phase 2 — translate (command-back)", () => {
|
|
90
90
|
testPromise("Ok(Some(...)) marks item as Completed and publishes command", async () => {
|
|
91
|
-
CommandBackCallback.phase1([PaymentReceived({orderId: "ord-1", amount: 50.0})])
|
|
91
|
+
CommandBackCallback.phase1([("evt", PaymentReceived({orderId: "ord-1", amount: 50.0}))])
|
|
92
92
|
let publishedCommands = ref([])
|
|
93
93
|
let mockPublish: ReventlessInfra.CommandTopic.publishJsons = async cmds => {
|
|
94
94
|
publishedCommands := Array.concat(publishedCommands.contents, cmds)
|
|
@@ -104,7 +104,7 @@ describe("OutboundTranslationSlice Callback", () => {
|
|
|
104
104
|
testPromise("Error marks item as Failed with incremented retryCount", async () => {
|
|
105
105
|
ProcessPaymentSpec.translateFn := (async (_id, _item) => Error("gateway timeout"))
|
|
106
106
|
|
|
107
|
-
CommandBackCallback.phase1([PaymentReceived({orderId: "ord-1", amount: 50.0})])
|
|
107
|
+
CommandBackCallback.phase1([("evt", PaymentReceived({orderId: "ord-1", amount: 50.0}))])
|
|
108
108
|
let mockPublish: ReventlessInfra.CommandTopic.publishJsons = async _cmds => ()
|
|
109
109
|
await CommandBackCallback.phase2(mockPublish)
|
|
110
110
|
|
|
@@ -116,7 +116,7 @@ describe("OutboundTranslationSlice Callback", () => {
|
|
|
116
116
|
testPromise("failed items with retryCount < maxRetries are retried", async () => {
|
|
117
117
|
// First attempt fails
|
|
118
118
|
ProcessPaymentSpec.translateFn := (async (_id, _item) => Error("timeout"))
|
|
119
|
-
CommandBackCallback.phase1([PaymentReceived({orderId: "ord-1", amount: 50.0})])
|
|
119
|
+
CommandBackCallback.phase1([("evt", PaymentReceived({orderId: "ord-1", amount: 50.0}))])
|
|
120
120
|
let mockPublish: ReventlessInfra.CommandTopic.publishJsons = async _cmds => ()
|
|
121
121
|
await CommandBackCallback.phase2(mockPublish)
|
|
122
122
|
let row1 = CommandBackCallback.todoItems->Dict.get("ord-1")->Option.getOrThrow
|
|
@@ -138,7 +138,7 @@ describe("OutboundTranslationSlice Callback", () => {
|
|
|
138
138
|
testPromise("failed items beyond maxRetries are not retried", async () => {
|
|
139
139
|
// ProcessPaymentSpec.maxRetries = 2, so after 2 failures it should stop
|
|
140
140
|
ProcessPaymentSpec.translateFn := (async (_id, _item) => Error("timeout"))
|
|
141
|
-
CommandBackCallback.phase1([PaymentReceived({orderId: "ord-1", amount: 50.0})])
|
|
141
|
+
CommandBackCallback.phase1([("evt", PaymentReceived({orderId: "ord-1", amount: 50.0}))])
|
|
142
142
|
let mockPublish: ReventlessInfra.CommandTopic.publishJsons = async _cmds => ()
|
|
143
143
|
|
|
144
144
|
// Fail twice
|
|
@@ -171,8 +171,8 @@ describe("OutboundTranslationSlice Callback", () => {
|
|
|
171
171
|
})
|
|
172
172
|
|
|
173
173
|
CommandBackCallback.phase1([
|
|
174
|
-
PaymentReceived({orderId: "ord-1", amount: 50.0}),
|
|
175
|
-
PaymentReceived({orderId: "ord-2", amount: 75.0}),
|
|
174
|
+
("evt", PaymentReceived({orderId: "ord-1", amount: 50.0})),
|
|
175
|
+
("evt", PaymentReceived({orderId: "ord-2", amount: 75.0})),
|
|
176
176
|
])
|
|
177
177
|
let publishedCommands = ref([])
|
|
178
178
|
let mockPublish: ReventlessInfra.CommandTopic.publishJsons = async cmds => {
|
package/tests/components/outboundtranslationslice/OutboundTranslationSliceCallbackTest.res.mjs
CHANGED
|
@@ -38,6 +38,7 @@ let FireForgetCallback = OutboundTranslationSlice_Callback$ReventlessCore.Make({
|
|
|
38
38
|
maxRetries: OutboundTranslationSliceFixtures$ReventlessLocal.SendTrackingEmailSpec.maxRetries,
|
|
39
39
|
heartbeatInterval: OutboundTranslationSliceFixtures$ReventlessLocal.SendTrackingEmailSpec.heartbeatInterval,
|
|
40
40
|
targetName: OutboundTranslationSliceFixtures$ReventlessLocal.SendTrackingEmailSpec.targetName,
|
|
41
|
+
sourceNames: OutboundTranslationSliceFixtures$ReventlessLocal.SendTrackingEmailSpec.sourceNames,
|
|
41
42
|
externalSystem: OutboundTranslationSliceFixtures$ReventlessLocal.SendTrackingEmailSpec.externalSystem
|
|
42
43
|
})(SendTrackingEmailTranslation);
|
|
43
44
|
|
|
@@ -50,6 +51,7 @@ let CommandBackCallback = OutboundTranslationSlice_Callback$ReventlessCore.Make(
|
|
|
50
51
|
maxRetries: OutboundTranslationSliceFixtures$ReventlessLocal.ProcessPaymentSpec.maxRetries,
|
|
51
52
|
heartbeatInterval: OutboundTranslationSliceFixtures$ReventlessLocal.ProcessPaymentSpec.heartbeatInterval,
|
|
52
53
|
targetName: OutboundTranslationSliceFixtures$ReventlessLocal.ProcessPaymentSpec.targetName,
|
|
54
|
+
sourceNames: OutboundTranslationSliceFixtures$ReventlessLocal.ProcessPaymentSpec.sourceNames,
|
|
53
55
|
externalSystem: OutboundTranslationSliceFixtures$ReventlessLocal.ProcessPaymentSpec.externalSystem
|
|
54
56
|
})(ProcessPaymentTranslation);
|
|
55
57
|
|
|
@@ -70,11 +72,14 @@ globalThis.describe("OutboundTranslationSlice Callback", () => {
|
|
|
70
72
|
});
|
|
71
73
|
globalThis.describe("Phase 1 — collect", () => {
|
|
72
74
|
globalThis.test("OrderShipped event creates a pending outbound item", async () => {
|
|
73
|
-
FireForgetCallback.phase1([
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
75
|
+
FireForgetCallback.phase1([[
|
|
76
|
+
"evt",
|
|
77
|
+
{
|
|
78
|
+
TAG: "OrderShipped",
|
|
79
|
+
orderId: "ord-1",
|
|
80
|
+
email: "test@example.com"
|
|
81
|
+
}
|
|
82
|
+
]]);
|
|
78
83
|
let items = FireForgetCallback.todoItems;
|
|
79
84
|
globalThis.expect(Object.entries(items).length).toBe(1);
|
|
80
85
|
let row = items["ord-1"];
|
|
@@ -84,41 +89,56 @@ globalThis.describe("OutboundTranslationSlice Callback", () => {
|
|
|
84
89
|
globalThis.expect(r.retryCount).toBe(0);
|
|
85
90
|
});
|
|
86
91
|
globalThis.test("duplicate event does not create a second item (idempotent)", async () => {
|
|
87
|
-
FireForgetCallback.phase1([
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
92
|
+
FireForgetCallback.phase1([[
|
|
93
|
+
"evt",
|
|
94
|
+
{
|
|
95
|
+
TAG: "OrderShipped",
|
|
96
|
+
orderId: "ord-1",
|
|
97
|
+
email: "test@example.com"
|
|
98
|
+
}
|
|
99
|
+
]]);
|
|
100
|
+
FireForgetCallback.phase1([[
|
|
101
|
+
"evt",
|
|
102
|
+
{
|
|
103
|
+
TAG: "OrderShipped",
|
|
104
|
+
orderId: "ord-1",
|
|
105
|
+
email: "other@example.com"
|
|
106
|
+
}
|
|
107
|
+
]]);
|
|
97
108
|
globalThis.expect(Object.entries(FireForgetCallback.todoItems).length).toBe(1);
|
|
98
109
|
});
|
|
99
110
|
globalThis.test("multiple different events create multiple items", async () => {
|
|
100
111
|
FireForgetCallback.phase1([
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
112
|
+
[
|
|
113
|
+
"evt",
|
|
114
|
+
{
|
|
115
|
+
TAG: "OrderShipped",
|
|
116
|
+
orderId: "ord-1",
|
|
117
|
+
email: "a@example.com"
|
|
118
|
+
}
|
|
119
|
+
],
|
|
120
|
+
[
|
|
121
|
+
"evt",
|
|
122
|
+
{
|
|
123
|
+
TAG: "OrderShipped",
|
|
124
|
+
orderId: "ord-2",
|
|
125
|
+
email: "b@example.com"
|
|
126
|
+
}
|
|
127
|
+
]
|
|
111
128
|
]);
|
|
112
129
|
globalThis.expect(Object.entries(FireForgetCallback.todoItems).length).toBe(2);
|
|
113
130
|
});
|
|
114
131
|
});
|
|
115
132
|
globalThis.describe("Phase 2 — translate (fire-and-forget)", () => {
|
|
116
133
|
globalThis.test("Ok(None) marks item as Completed, no command published", async () => {
|
|
117
|
-
FireForgetCallback.phase1([
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
134
|
+
FireForgetCallback.phase1([[
|
|
135
|
+
"evt",
|
|
136
|
+
{
|
|
137
|
+
TAG: "OrderShipped",
|
|
138
|
+
orderId: "ord-1",
|
|
139
|
+
email: "test@example.com"
|
|
140
|
+
}
|
|
141
|
+
]]);
|
|
122
142
|
let publishedCommands = {
|
|
123
143
|
contents: []
|
|
124
144
|
};
|
|
@@ -143,11 +163,14 @@ globalThis.describe("OutboundTranslationSlice Callback", () => {
|
|
|
143
163
|
});
|
|
144
164
|
globalThis.describe("Phase 2 — translate (command-back)", () => {
|
|
145
165
|
globalThis.test("Ok(Some(...)) marks item as Completed and publishes command", async () => {
|
|
146
|
-
CommandBackCallback.phase1([
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
166
|
+
CommandBackCallback.phase1([[
|
|
167
|
+
"evt",
|
|
168
|
+
{
|
|
169
|
+
TAG: "PaymentReceived",
|
|
170
|
+
orderId: "ord-1",
|
|
171
|
+
amount: 50.0
|
|
172
|
+
}
|
|
173
|
+
]]);
|
|
151
174
|
let publishedCommands = {
|
|
152
175
|
contents: []
|
|
153
176
|
};
|
|
@@ -166,11 +189,14 @@ globalThis.describe("OutboundTranslationSlice Callback", () => {
|
|
|
166
189
|
TAG: "Error",
|
|
167
190
|
_0: "gateway timeout"
|
|
168
191
|
});
|
|
169
|
-
CommandBackCallback.phase1([
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
192
|
+
CommandBackCallback.phase1([[
|
|
193
|
+
"evt",
|
|
194
|
+
{
|
|
195
|
+
TAG: "PaymentReceived",
|
|
196
|
+
orderId: "ord-1",
|
|
197
|
+
amount: 50.0
|
|
198
|
+
}
|
|
199
|
+
]]);
|
|
174
200
|
let mockPublish = async _cmds => {};
|
|
175
201
|
await CommandBackCallback.phase2(mockPublish);
|
|
176
202
|
let row = Stdlib_Option.getOrThrow(CommandBackCallback.todoItems["ord-1"], undefined);
|
|
@@ -182,11 +208,14 @@ globalThis.describe("OutboundTranslationSlice Callback", () => {
|
|
|
182
208
|
TAG: "Error",
|
|
183
209
|
_0: "timeout"
|
|
184
210
|
});
|
|
185
|
-
CommandBackCallback.phase1([
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
211
|
+
CommandBackCallback.phase1([[
|
|
212
|
+
"evt",
|
|
213
|
+
{
|
|
214
|
+
TAG: "PaymentReceived",
|
|
215
|
+
orderId: "ord-1",
|
|
216
|
+
amount: 50.0
|
|
217
|
+
}
|
|
218
|
+
]]);
|
|
190
219
|
let mockPublish = async _cmds => {};
|
|
191
220
|
await CommandBackCallback.phase2(mockPublish);
|
|
192
221
|
let row1 = Stdlib_Option.getOrThrow(CommandBackCallback.todoItems["ord-1"], undefined);
|
|
@@ -217,11 +246,14 @@ globalThis.describe("OutboundTranslationSlice Callback", () => {
|
|
|
217
246
|
TAG: "Error",
|
|
218
247
|
_0: "timeout"
|
|
219
248
|
});
|
|
220
|
-
CommandBackCallback.phase1([
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
249
|
+
CommandBackCallback.phase1([[
|
|
250
|
+
"evt",
|
|
251
|
+
{
|
|
252
|
+
TAG: "PaymentReceived",
|
|
253
|
+
orderId: "ord-1",
|
|
254
|
+
amount: 50.0
|
|
255
|
+
}
|
|
256
|
+
]]);
|
|
225
257
|
let mockPublish = async _cmds => {};
|
|
226
258
|
await CommandBackCallback.phase2(mockPublish);
|
|
227
259
|
await CommandBackCallback.phase2(mockPublish);
|
|
@@ -263,16 +295,22 @@ globalThis.describe("OutboundTranslationSlice Callback", () => {
|
|
|
263
295
|
}
|
|
264
296
|
};
|
|
265
297
|
CommandBackCallback.phase1([
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
298
|
+
[
|
|
299
|
+
"evt",
|
|
300
|
+
{
|
|
301
|
+
TAG: "PaymentReceived",
|
|
302
|
+
orderId: "ord-1",
|
|
303
|
+
amount: 50.0
|
|
304
|
+
}
|
|
305
|
+
],
|
|
306
|
+
[
|
|
307
|
+
"evt",
|
|
308
|
+
{
|
|
309
|
+
TAG: "PaymentReceived",
|
|
310
|
+
orderId: "ord-2",
|
|
311
|
+
amount: 75.0
|
|
312
|
+
}
|
|
313
|
+
]
|
|
276
314
|
]);
|
|
277
315
|
let publishedCommands = {
|
|
278
316
|
contents: []
|
|
@@ -30,7 +30,7 @@ module SendTrackingEmailSpec = {
|
|
|
30
30
|
@schema
|
|
31
31
|
type inboundCommand = unit
|
|
32
32
|
|
|
33
|
-
let collect = event =>
|
|
33
|
+
let collect = (event, ~sourceId as _) =>
|
|
34
34
|
switch event {
|
|
35
35
|
| OrderShipped({orderId, email}) => [(orderId, {orderId, email})]
|
|
36
36
|
}
|
|
@@ -40,6 +40,7 @@ module SendTrackingEmailSpec = {
|
|
|
40
40
|
let maxRetries = 3
|
|
41
41
|
let heartbeatInterval = 60
|
|
42
42
|
let targetName = None
|
|
43
|
+
let sourceNames: array<string> = []
|
|
43
44
|
let externalSystem = None
|
|
44
45
|
}
|
|
45
46
|
|
|
@@ -61,7 +62,7 @@ module ProcessPaymentSpec = {
|
|
|
61
62
|
@schema
|
|
62
63
|
type inboundCommand = ConfirmPayment({orderId: @s.matches(Reventless.DcbTag.string) string})
|
|
63
64
|
|
|
64
|
-
let collect = event =>
|
|
65
|
+
let collect = (event, ~sourceId as _) =>
|
|
65
66
|
switch event {
|
|
66
67
|
| PaymentReceived({orderId, amount}) => [(orderId, {orderId, amount})]
|
|
67
68
|
}
|
|
@@ -76,5 +77,6 @@ module ProcessPaymentSpec = {
|
|
|
76
77
|
let maxRetries = 2
|
|
77
78
|
let heartbeatInterval = 30
|
|
78
79
|
let targetName = Some("ConfirmPayment")
|
|
80
|
+
let sourceNames: array<string> = []
|
|
79
81
|
let externalSystem = None
|
|
80
82
|
}
|
|
@@ -36,7 +36,7 @@ let outboundItemSchema = S.schema(s => ({
|
|
|
36
36
|
email: s.m(S.string)
|
|
37
37
|
}));
|
|
38
38
|
|
|
39
|
-
function collect(event) {
|
|
39
|
+
function collect(event, param) {
|
|
40
40
|
let orderId = event.orderId;
|
|
41
41
|
return [[
|
|
42
42
|
orderId,
|
|
@@ -54,6 +54,8 @@ async function translate(_id, _item) {
|
|
|
54
54
|
};
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
+
let sourceNames = [];
|
|
58
|
+
|
|
57
59
|
let SendTrackingEmailSpec = {
|
|
58
60
|
name: "SendTrackingEmail",
|
|
59
61
|
moduleUrl: moduleUrl$1,
|
|
@@ -65,6 +67,7 @@ let SendTrackingEmailSpec = {
|
|
|
65
67
|
maxRetries: 3,
|
|
66
68
|
heartbeatInterval: 60,
|
|
67
69
|
targetName: undefined,
|
|
70
|
+
sourceNames: sourceNames,
|
|
68
71
|
externalSystem: undefined
|
|
69
72
|
};
|
|
70
73
|
|
|
@@ -86,7 +89,7 @@ let inboundCommandSchema = S.schema(s => ({
|
|
|
86
89
|
orderId: s.m(DcbTag$Reventless.string)
|
|
87
90
|
}));
|
|
88
91
|
|
|
89
|
-
function collect$1(event) {
|
|
92
|
+
function collect$1(event, param) {
|
|
90
93
|
let orderId = event.orderId;
|
|
91
94
|
return [[
|
|
92
95
|
orderId,
|
|
@@ -114,6 +117,8 @@ function translate$1(id, item) {
|
|
|
114
117
|
return translateFn.contents(id, item);
|
|
115
118
|
}
|
|
116
119
|
|
|
120
|
+
let sourceNames$1 = [];
|
|
121
|
+
|
|
117
122
|
let ProcessPaymentSpec_targetName = "ConfirmPayment";
|
|
118
123
|
|
|
119
124
|
let ProcessPaymentSpec = {
|
|
@@ -128,6 +133,7 @@ let ProcessPaymentSpec = {
|
|
|
128
133
|
maxRetries: 2,
|
|
129
134
|
heartbeatInterval: 30,
|
|
130
135
|
targetName: ProcessPaymentSpec_targetName,
|
|
136
|
+
sourceNames: sourceNames$1,
|
|
131
137
|
externalSystem: undefined
|
|
132
138
|
};
|
|
133
139
|
|
package/tests/components/outboundtranslationslice/OutboundTranslationSlicePlatformFixtures.res
CHANGED
|
@@ -86,6 +86,7 @@ module SendConfirmSpec = {
|
|
|
86
86
|
let maxRetries = 3
|
|
87
87
|
let heartbeatInterval = 60
|
|
88
88
|
let targetName = None
|
|
89
|
+
let sourceNames: array<string> = []
|
|
89
90
|
let externalSystem = Some("EmailService")
|
|
90
91
|
}
|
|
91
92
|
|
|
@@ -99,7 +100,7 @@ module SendConfirmTranslation: OutboundTranslationSlice.Translation
|
|
|
99
100
|
with module Spec := SendConfirmSpec = {
|
|
100
101
|
let moduleUrl: string = %raw(`import.meta.url`)
|
|
101
102
|
|
|
102
|
-
let collect = (event: SendConfirmSpec.consumedEvent) =>
|
|
103
|
+
let collect = (event: SendConfirmSpec.consumedEvent, ~sourceId as _) =>
|
|
103
104
|
switch event {
|
|
104
105
|
| Placed({orderId}) =>
|
|
105
106
|
collectCalls->Array.push(orderId)
|
package/tests/components/outboundtranslationslice/OutboundTranslationSlicePlatformFixtures.res.mjs
CHANGED
|
@@ -96,6 +96,8 @@ let outboundItemSchema = S.schema(s => ({
|
|
|
96
96
|
orderId: s.m(S.string)
|
|
97
97
|
}));
|
|
98
98
|
|
|
99
|
+
let sourceNames = [];
|
|
100
|
+
|
|
99
101
|
let SendConfirmSpec_externalSystem = "EmailService";
|
|
100
102
|
|
|
101
103
|
let SendConfirmSpec = {
|
|
@@ -107,6 +109,7 @@ let SendConfirmSpec = {
|
|
|
107
109
|
maxRetries: 3,
|
|
108
110
|
heartbeatInterval: 60,
|
|
109
111
|
targetName: undefined,
|
|
112
|
+
sourceNames: sourceNames,
|
|
110
113
|
externalSystem: SendConfirmSpec_externalSystem
|
|
111
114
|
};
|
|
112
115
|
|
|
@@ -116,7 +119,7 @@ let externalCalls = [];
|
|
|
116
119
|
|
|
117
120
|
let moduleUrl$3 = import.meta.url;
|
|
118
121
|
|
|
119
|
-
function collect(event) {
|
|
122
|
+
function collect(event, param) {
|
|
120
123
|
let orderId = event.orderId;
|
|
121
124
|
collectCalls.push(orderId);
|
|
122
125
|
return [[
|
|
@@ -216,7 +219,7 @@ let OutboundMaker = OutboundTranslationSlice_Builder$ReventlessLocal.Make(Bus);
|
|
|
216
219
|
|
|
217
220
|
let SendConfirm = OutboundMaker.Make(SendConfirmSpec)(SendConfirmTranslation);
|
|
218
221
|
|
|
219
|
-
let sendConfirmSlice = SendConfirm.make(dcbEventLog, publishJsonsOutput, undefined, undefined);
|
|
222
|
+
let sendConfirmSlice = SendConfirm.make(dcbEventLog, undefined, publishJsonsOutput, undefined, undefined);
|
|
220
223
|
|
|
221
224
|
function placeCmdJson(orderId) {
|
|
222
225
|
return {
|