@reventlessdev/online-shop-hybrid-catalog 1.0.0-alpha.270 → 1.0.0-alpha.271
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
CHANGED
|
@@ -3,6 +3,16 @@
|
|
|
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.271 (2026-10-10)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* an inbound translation is gated alike on every door, and encodes its commands by schema ([6ec3ce6](https://github.com/ReventlessDev/reventless-core/commit/6ec3ce672e53e2c162c64a90d103be691391be5e))
|
|
11
|
+
### Features
|
|
12
|
+
|
|
13
|
+
* **gwt:** automation and translation tests take the slice as written, and the sidecars read them ([93a0919](https://github.com/ReventlessDev/reventless-core/commit/93a0919a0d66730cf9bf89144ad8fba3cb025332))
|
|
14
|
+
|
|
15
|
+
|
|
6
16
|
# 1.0.0-alpha.270 (2026-10-08)
|
|
7
17
|
|
|
8
18
|
**Note:** Version bump only for package @reventlessdev/online-shop-hybrid-catalog
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reventlessdev/online-shop-hybrid-catalog",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.271",
|
|
4
4
|
"description": "Online Shop Hybrid example — Catalog plugin (Category + Product/ProductDemand DCB slices)",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"jest": {
|
|
@@ -21,14 +21,14 @@
|
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"sury": "11.0.0",
|
|
24
|
-
"@reventlessdev/online-shop-hybrid-
|
|
24
|
+
"@reventlessdev/online-shop-hybrid-ordering-spec": "1.0.0-alpha.157",
|
|
25
|
+
"@reventlessdev/online-shop-hybrid-catalog-spec": "1.0.0-alpha.158",
|
|
25
26
|
"@reventlessdev/rescript-pulumi-pulumi": "2.3.0-alpha.23",
|
|
26
|
-
"@reventlessdev/
|
|
27
|
-
"@reventlessdev/reventless-gwt": "1.0.0-alpha.
|
|
28
|
-
"@reventlessdev/reventless-
|
|
29
|
-
"@reventlessdev/
|
|
30
|
-
"@reventlessdev/reventless-
|
|
31
|
-
"@reventlessdev/trait-attachments": "1.0.0-alpha.40"
|
|
27
|
+
"@reventlessdev/reventless-infra": "3.0.0-alpha.189",
|
|
28
|
+
"@reventlessdev/reventless-gwt": "1.0.0-alpha.239",
|
|
29
|
+
"@reventlessdev/reventless-spec": "3.0.0-alpha.161",
|
|
30
|
+
"@reventlessdev/trait-attachments": "1.0.0-alpha.41",
|
|
31
|
+
"@reventlessdev/reventless-local": "3.0.0-alpha.282"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"rescript": "12.3.1",
|
package/src/Plugin.res.mjs
CHANGED
|
@@ -436,8 +436,7 @@ function Make(Platform) {
|
|
|
436
436
|
commandSchema: ImportProduct$CatalogPlugin.commandSchema,
|
|
437
437
|
targetName: ImportProduct$CatalogPlugin.targetName,
|
|
438
438
|
externalSystem: ImportProduct$CatalogPlugin.externalSystem,
|
|
439
|
-
commandAuthorization: ImportProduct$CatalogPlugin.commandAuthorization
|
|
440
|
-
commandTransition: ImportProduct$CatalogPlugin.commandTransition
|
|
439
|
+
commandAuthorization: ImportProduct$CatalogPlugin.commandAuthorization
|
|
441
440
|
})({
|
|
442
441
|
translate: ImportProduct_Translation$CatalogPlugin.translate,
|
|
443
442
|
moduleUrl: ImportProduct_Translation$CatalogPlugin.moduleUrl
|
|
@@ -34,10 +34,6 @@ function commandAuthorization(command) {
|
|
|
34
34
|
};
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
function commandTransition(param) {
|
|
38
|
-
return "Undeclared";
|
|
39
|
-
}
|
|
40
|
-
|
|
41
37
|
let traits = [];
|
|
42
38
|
|
|
43
39
|
let name = "ImportProduct";
|
|
@@ -59,7 +55,6 @@ export {
|
|
|
59
55
|
externalSystem,
|
|
60
56
|
moduleUrl,
|
|
61
57
|
commandAuthorization,
|
|
62
|
-
commandTransition,
|
|
63
58
|
traits,
|
|
64
59
|
}
|
|
65
60
|
/* externalInputSchema Not a pure module */
|
|
@@ -1,12 +1,3 @@
|
|
|
1
|
-
// `InboundTranslation_GWT.Make` expects a single SliceSpec carrying both the
|
|
2
|
-
// types (from the spec file) and the `translate` function (from the body
|
|
3
|
-
// file). Compose them locally before handing the result to the DSL.
|
|
4
|
-
|
|
5
|
-
module ImportProductSlice = {
|
|
6
|
-
include ImportProduct
|
|
7
|
-
let translate = ImportProduct_Translation.translate
|
|
8
|
-
}
|
|
9
|
-
|
|
10
1
|
@@reventless.gwt
|
|
11
2
|
|
|
12
3
|
open Catalog_Examples
|
|
@@ -139,4 +130,9 @@ describe("ImportProduct InboundTranslationSlice", () => {
|
|
|
139
130
|
category: "",
|
|
140
131
|
})->thenTranslateError("Category is required")
|
|
141
132
|
)
|
|
133
|
+
|
|
134
|
+
// A payload the feed's contract does not describe never reaches `translate`.
|
|
135
|
+
test("a payload missing its title is refused before translation", () =>
|
|
136
|
+
whenReceived(JSON.parseOrThrow(`{"sku": "SKU-1"}`))->thenRefusedInput("title")
|
|
137
|
+
)
|
|
142
138
|
})
|
|
@@ -7,25 +7,17 @@ import * as Catalog_Examples$CatalogPlugin from "../../Catalog_Examples.res.mjs"
|
|
|
7
7
|
import * as InboundTranslation_GWT$ReventlessGwt from "@reventlessdev/reventless-gwt/src/InboundTranslation_GWT.res.mjs";
|
|
8
8
|
import * as ImportProduct_Translation$CatalogPlugin from "../../../src/Product/InboundTranslation/ImportProduct_Translation.res.mjs";
|
|
9
9
|
|
|
10
|
-
let
|
|
10
|
+
let include = InboundTranslation_GWT$ReventlessGwt.FromSlice({
|
|
11
11
|
name: ImportProduct$CatalogPlugin.name,
|
|
12
|
-
|
|
12
|
+
moduleUrl: ImportProduct$CatalogPlugin.moduleUrl,
|
|
13
13
|
externalInputSchema: ImportProduct$CatalogPlugin.externalInputSchema,
|
|
14
14
|
commandSchema: ImportProduct$CatalogPlugin.commandSchema,
|
|
15
15
|
targetName: ImportProduct$CatalogPlugin.targetName,
|
|
16
16
|
externalSystem: ImportProduct$CatalogPlugin.externalSystem,
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
translate: ImportProduct_Translation$CatalogPlugin.translate
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
let include = InboundTranslation_GWT$ReventlessGwt.Make({
|
|
25
|
-
name: ImportProduct$CatalogPlugin.name,
|
|
26
|
-
externalInputSchema: ImportProduct$CatalogPlugin.externalInputSchema,
|
|
27
|
-
commandSchema: ImportProduct$CatalogPlugin.commandSchema,
|
|
28
|
-
translate: ImportProduct_Translation$CatalogPlugin.translate
|
|
17
|
+
commandAuthorization: ImportProduct$CatalogPlugin.commandAuthorization
|
|
18
|
+
})({
|
|
19
|
+
translate: ImportProduct_Translation$CatalogPlugin.translate,
|
|
20
|
+
moduleUrl: ImportProduct_Translation$CatalogPlugin.moduleUrl
|
|
29
21
|
});
|
|
30
22
|
|
|
31
23
|
let describe = include.describe;
|
|
@@ -34,10 +26,14 @@ let test = include.test;
|
|
|
34
26
|
|
|
35
27
|
let whenInput = include.whenInput;
|
|
36
28
|
|
|
29
|
+
let whenReceived = include.whenReceived;
|
|
30
|
+
|
|
37
31
|
let thenCommand = include.thenCommand;
|
|
38
32
|
|
|
39
33
|
let thenTranslateError = include.thenTranslateError;
|
|
40
34
|
|
|
35
|
+
let thenRefusedInput = include.thenRefusedInput;
|
|
36
|
+
|
|
41
37
|
describe("ImportProduct InboundTranslationSlice", () => {
|
|
42
38
|
test("USD payload translates to AddProduct command", () => thenCommand(whenInput({
|
|
43
39
|
sku: Catalog_Examples$CatalogPlugin.sku,
|
|
@@ -116,26 +112,37 @@ describe("ImportProduct InboundTranslationSlice", () => {
|
|
|
116
112
|
currency: Catalog_Examples$CatalogPlugin.usd,
|
|
117
113
|
category: ""
|
|
118
114
|
}), "Category is required"));
|
|
115
|
+
test("a payload missing its title is refused before translation", () => thenRefusedInput(whenReceived(JSON.parse(`{"sku": "SKU-1"}`)), "title"));
|
|
119
116
|
});
|
|
120
117
|
|
|
121
|
-
let
|
|
118
|
+
let encPairs = include.encPairs;
|
|
119
|
+
|
|
120
|
+
let describeOther = include.describeOther;
|
|
121
|
+
|
|
122
|
+
let roundTrips = include.roundTrips;
|
|
122
123
|
|
|
123
124
|
let thenCommands = include.thenCommands;
|
|
124
125
|
|
|
125
126
|
let thenNoCommand = include.thenNoCommand;
|
|
126
127
|
|
|
128
|
+
let thenNotUnderstood = include.thenNotUnderstood;
|
|
129
|
+
|
|
127
130
|
let pid = ProductId$CatalogSpec.make;
|
|
128
131
|
|
|
129
132
|
export {
|
|
130
|
-
ImportProductSlice,
|
|
131
|
-
Spec,
|
|
132
133
|
describe,
|
|
133
134
|
test,
|
|
135
|
+
encPairs,
|
|
134
136
|
whenInput,
|
|
137
|
+
whenReceived,
|
|
138
|
+
describeOther,
|
|
139
|
+
roundTrips,
|
|
135
140
|
thenCommands,
|
|
136
141
|
thenCommand,
|
|
137
142
|
thenNoCommand,
|
|
143
|
+
thenNotUnderstood,
|
|
138
144
|
thenTranslateError,
|
|
145
|
+
thenRefusedInput,
|
|
139
146
|
pid,
|
|
140
147
|
}
|
|
141
148
|
/* include Not a pure module */
|