@reventlessdev/online-shop-dcb-catalog 1.0.0-alpha.281 → 1.0.0-alpha.282
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/lib/bs/.compiler.log +2 -2
- package/lib/bs/compiler-info.json +1 -1
- package/lib/bs/src/Plugin-CatalogPlugin.cmi +0 -0
- package/lib/bs/src/Plugin-CatalogPlugin.cmt +0 -0
- package/lib/bs/src/Plugin.res.mjs +2 -1
- package/lib/bs/src/Product/InboundTranslation/ImportProduct-CatalogPlugin.cmi +0 -0
- package/lib/bs/src/Product/InboundTranslation/ImportProduct-CatalogPlugin.cmt +0 -0
- package/lib/bs/src/Product/InboundTranslation/ImportProduct.ast +0 -0
- package/lib/bs/src/Product/InboundTranslation/ImportProduct.res +17 -0
- package/lib/bs/src/Product/InboundTranslation/ImportProduct.res.mjs +19 -1
- package/lib/bs/src/Product/InboundTranslation/ImportProduct_Translation-CatalogPlugin.cmi +0 -0
- package/lib/bs/src/Product/InboundTranslation/ImportProduct_Translation-CatalogPlugin.cmt +0 -0
- package/lib/bs/src/Task/ImportProducts-CatalogPlugin.cmi +0 -0
- package/lib/bs/src/Task/ImportProducts-CatalogPlugin.cmt +0 -0
- package/lib/bs/tests/Category/StateChange/AddCategory_GWT-CatalogPlugin.cmi +0 -0
- package/lib/bs/tests/Category/StateChange/AddCategory_GWT-CatalogPlugin.cmt +0 -0
- package/lib/bs/tests/Category/StateChange/ArchiveCategory_GWT-CatalogPlugin.cmi +0 -0
- package/lib/bs/tests/Category/StateChange/ArchiveCategory_GWT-CatalogPlugin.cmt +0 -0
- package/lib/bs/tests/Category/StateChange/RenameCategory_GWT-CatalogPlugin.cmi +0 -0
- package/lib/bs/tests/Category/StateChange/RenameCategory_GWT-CatalogPlugin.cmt +0 -0
- package/lib/bs/tests/Category/StateView/Categories_GWT-CatalogPlugin.cmi +0 -0
- package/lib/bs/tests/Category/StateView/Categories_GWT-CatalogPlugin.cmt +0 -0
- package/lib/bs/tests/CategoryActivity/ReadModel/CategoryActivity_GWT-CatalogPlugin.cmi +0 -0
- package/lib/bs/tests/CategoryActivity/ReadModel/CategoryActivity_GWT-CatalogPlugin.cmt +0 -0
- package/lib/bs/tests/Extension/Orders_Extension_GWT-CatalogPlugin.cmi +0 -0
- package/lib/bs/tests/Extension/Orders_Extension_GWT-CatalogPlugin.cmt +0 -0
- package/lib/bs/tests/ExtensionPoint/Products_ExtensionPointMapping_GWT-CatalogPlugin.cmi +0 -0
- package/lib/bs/tests/ExtensionPoint/Products_ExtensionPointMapping_GWT-CatalogPlugin.cmt +0 -0
- package/lib/bs/tests/Product/InboundTranslation/ImportProduct_GWT-CatalogPlugin.cmi +0 -0
- package/lib/bs/tests/Product/InboundTranslation/ImportProduct_GWT-CatalogPlugin.cmt +0 -0
- package/lib/bs/tests/Product/InboundTranslation/ImportProduct_GWT.res.mjs +2 -1
- package/lib/bs/tests/Product/StateChange/AddProduct_GWT-CatalogPlugin.cmi +0 -0
- package/lib/bs/tests/Product/StateChange/AddProduct_GWT-CatalogPlugin.cmt +0 -0
- package/lib/bs/tests/Product/StateChange/ChangeProductDescription_GWT-CatalogPlugin.cmi +0 -0
- package/lib/bs/tests/Product/StateChange/ChangeProductDescription_GWT-CatalogPlugin.cmt +0 -0
- package/lib/bs/tests/Product/StateChange/ChangeProductName_GWT-CatalogPlugin.cmi +0 -0
- package/lib/bs/tests/Product/StateChange/ChangeProductName_GWT-CatalogPlugin.cmt +0 -0
- package/lib/bs/tests/Product/StateChange/ChangeProductPrice_GWT-CatalogPlugin.cmi +0 -0
- package/lib/bs/tests/Product/StateChange/ChangeProductPrice_GWT-CatalogPlugin.cmt +0 -0
- package/lib/bs/tests/Product/StateView/Products_GWT-CatalogPlugin.cmi +0 -0
- package/lib/bs/tests/Product/StateView/Products_GWT-CatalogPlugin.cmt +0 -0
- package/lib/bs/tests/ProductDemand/StateChange/RecordProductDemand_GWT-CatalogPlugin.cmi +0 -0
- package/lib/bs/tests/ProductDemand/StateChange/RecordProductDemand_GWT-CatalogPlugin.cmt +0 -0
- package/lib/bs/tests/ProductDemand/StateView/ProductDemand_GWT-CatalogPlugin.cmi +0 -0
- package/lib/bs/tests/ProductDemand/StateView/ProductDemand_GWT-CatalogPlugin.cmt +0 -0
- package/lib/ocaml/.compiler.log +2 -2
- package/lib/ocaml/AddCategory_GWT-CatalogPlugin.cmi +0 -0
- package/lib/ocaml/AddCategory_GWT-CatalogPlugin.cmt +0 -0
- package/lib/ocaml/AddProduct_GWT-CatalogPlugin.cmi +0 -0
- package/lib/ocaml/AddProduct_GWT-CatalogPlugin.cmt +0 -0
- package/lib/ocaml/ArchiveCategory_GWT-CatalogPlugin.cmi +0 -0
- package/lib/ocaml/ArchiveCategory_GWT-CatalogPlugin.cmt +0 -0
- package/lib/ocaml/Categories_GWT-CatalogPlugin.cmi +0 -0
- package/lib/ocaml/Categories_GWT-CatalogPlugin.cmt +0 -0
- package/lib/ocaml/CategoryActivity_GWT-CatalogPlugin.cmi +0 -0
- package/lib/ocaml/CategoryActivity_GWT-CatalogPlugin.cmt +0 -0
- package/lib/ocaml/ChangeProductDescription_GWT-CatalogPlugin.cmi +0 -0
- package/lib/ocaml/ChangeProductDescription_GWT-CatalogPlugin.cmt +0 -0
- package/lib/ocaml/ChangeProductName_GWT-CatalogPlugin.cmi +0 -0
- package/lib/ocaml/ChangeProductName_GWT-CatalogPlugin.cmt +0 -0
- package/lib/ocaml/ChangeProductPrice_GWT-CatalogPlugin.cmi +0 -0
- package/lib/ocaml/ChangeProductPrice_GWT-CatalogPlugin.cmt +0 -0
- package/lib/ocaml/ImportProduct-CatalogPlugin.cmi +0 -0
- package/lib/ocaml/ImportProduct-CatalogPlugin.cmt +0 -0
- package/lib/ocaml/ImportProduct.ast +0 -0
- package/lib/ocaml/ImportProduct.res +17 -0
- package/lib/ocaml/ImportProduct_GWT-CatalogPlugin.cmi +0 -0
- package/lib/ocaml/ImportProduct_GWT-CatalogPlugin.cmt +0 -0
- package/lib/ocaml/ImportProduct_Translation-CatalogPlugin.cmi +0 -0
- package/lib/ocaml/ImportProduct_Translation-CatalogPlugin.cmt +0 -0
- package/lib/ocaml/ImportProducts-CatalogPlugin.cmi +0 -0
- package/lib/ocaml/ImportProducts-CatalogPlugin.cmt +0 -0
- package/lib/ocaml/Orders_Extension_GWT-CatalogPlugin.cmi +0 -0
- package/lib/ocaml/Orders_Extension_GWT-CatalogPlugin.cmt +0 -0
- package/lib/ocaml/Plugin-CatalogPlugin.cmi +0 -0
- package/lib/ocaml/Plugin-CatalogPlugin.cmt +0 -0
- package/lib/ocaml/ProductDemand_GWT-CatalogPlugin.cmi +0 -0
- package/lib/ocaml/ProductDemand_GWT-CatalogPlugin.cmt +0 -0
- package/lib/ocaml/Products_ExtensionPointMapping_GWT-CatalogPlugin.cmi +0 -0
- package/lib/ocaml/Products_ExtensionPointMapping_GWT-CatalogPlugin.cmt +0 -0
- package/lib/ocaml/Products_GWT-CatalogPlugin.cmi +0 -0
- package/lib/ocaml/Products_GWT-CatalogPlugin.cmt +0 -0
- package/lib/ocaml/RecordProductDemand_GWT-CatalogPlugin.cmi +0 -0
- package/lib/ocaml/RecordProductDemand_GWT-CatalogPlugin.cmt +0 -0
- package/lib/ocaml/RenameCategory_GWT-CatalogPlugin.cmi +0 -0
- package/lib/ocaml/RenameCategory_GWT-CatalogPlugin.cmt +0 -0
- package/package.json +8 -8
- package/src/Plugin.res.mjs +2 -1
- package/src/Product/InboundTranslation/ImportProduct.res +17 -0
- package/src/Product/InboundTranslation/ImportProduct.res.mjs +19 -1
- package/tests/Product/InboundTranslation/ImportProduct_GWT.res.mjs +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,18 @@
|
|
|
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.282 (2026-10-16)
|
|
7
|
+
|
|
8
|
+
* feat!(inbound): a translation slice can declare a signed webhook URL ([0ad6994](https://github.com/ReventlessDev/reventless-core/commit/0ad69949fcc91c2756c60ca8cb120dd468841d8b))
|
|
9
|
+
|
|
10
|
+
### BREAKING CHANGES
|
|
11
|
+
|
|
12
|
+
* InboundTranslationSlice.Spec requires `endpoint`. Specs under
|
|
13
|
+
@@reventless.spec get it from the PPX (republish reventless-ppx with this
|
|
14
|
+
release); hand-written specs add `let endpoint = None`.
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
6
18
|
# 1.0.0-alpha.281 (2026-10-16)
|
|
7
19
|
|
|
8
20
|
**Note:** Version bump only for package @reventlessdev/online-shop-dcb-catalog
|
package/lib/bs/.compiler.log
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
#Start(
|
|
2
|
-
#Done(
|
|
1
|
+
#Start(1792162610379)
|
|
2
|
+
#Done(1792162613537)
|
|
@@ -4,5 +4,5 @@
|
|
|
4
4
|
"bsc_hash": "1006241435e8d5052329c523202a7fe6359a37e1e1688c023d37d6a7ebb5fb6d",
|
|
5
5
|
"rescript_config_hash": "ca6bf04caf4f6b27dbf31b935f934d99c6fe59248cc8b122f9cc48ff2675eb4a",
|
|
6
6
|
"runtime_path": "/home/runner/work/reventless-core/reventless-core/node_modules/@rescript/runtime",
|
|
7
|
-
"generated_at": "
|
|
7
|
+
"generated_at": "1792162613542"
|
|
8
8
|
}
|
|
Binary file
|
|
Binary file
|
|
@@ -282,7 +282,8 @@ function Make(Platform) {
|
|
|
282
282
|
commandSchema: ImportProduct$CatalogPlugin.commandSchema,
|
|
283
283
|
targetName: ImportProduct$CatalogPlugin.targetName,
|
|
284
284
|
externalSystem: ImportProduct$CatalogPlugin.externalSystem,
|
|
285
|
-
authorizationOf: ImportProduct$CatalogPlugin.authorizationOf
|
|
285
|
+
authorizationOf: ImportProduct$CatalogPlugin.authorizationOf,
|
|
286
|
+
endpoint: ImportProduct$CatalogPlugin.endpoint
|
|
286
287
|
})({
|
|
287
288
|
translate: ImportProduct_Translation$CatalogPlugin.translate,
|
|
288
289
|
moduleUrl: ImportProduct_Translation$CatalogPlugin.moduleUrl
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
// ImportProduct InboundTranslationSlice.
|
|
2
2
|
// Receives external supplier JSON, validates and translates to an AddProduct command.
|
|
3
|
+
// The supplier posts to a signed webhook; the mutation stays as an operator's
|
|
4
|
+
// replay door, which is why the command needs Admin rather than any signed-in user.
|
|
3
5
|
|
|
4
6
|
@@reventless.spec
|
|
7
|
+
@@reventless.authorize(AllowRoles([Admin]))
|
|
5
8
|
|
|
6
9
|
@schema
|
|
7
10
|
type externalInput = {
|
|
@@ -20,3 +23,17 @@ let targetName = "AddProduct"
|
|
|
20
23
|
// Foreign system this anti-corruption slice receives product data from — drawn as an
|
|
21
24
|
// external box outside the Catalog plugin in the Event Graph.
|
|
22
25
|
let externalSystem = Some("SupplierFeed")
|
|
26
|
+
|
|
27
|
+
// The supplier signs each post with the secret `supplierFeed`
|
|
28
|
+
// (`pulumi config set --secret webhook:supplierFeed …` on AWS,
|
|
29
|
+
// `REVENTLESS_WEBHOOK_SECRET_SUPPLIERFEED` locally); a signed post acts as Admin.
|
|
30
|
+
let endpoint = Some({
|
|
31
|
+
Reventless.InboundTranslationSlice.path: "supplier-feed",
|
|
32
|
+
auth: SignedBody({
|
|
33
|
+
header: "X-Signature-256",
|
|
34
|
+
prefix: "sha256=",
|
|
35
|
+
timestampHeader: "X-Signature-Timestamp",
|
|
36
|
+
secret: "supplierFeed",
|
|
37
|
+
}),
|
|
38
|
+
role: Roles.Admin,
|
|
39
|
+
})
|
|
@@ -21,7 +21,10 @@ let commandSchema = Sury.$schema(s => ({
|
|
|
21
21
|
}));
|
|
22
22
|
|
|
23
23
|
function authorizationOf(param) {
|
|
24
|
-
return
|
|
24
|
+
return {
|
|
25
|
+
TAG: "AllowRoles",
|
|
26
|
+
_0: ["Admin"]
|
|
27
|
+
};
|
|
25
28
|
}
|
|
26
29
|
|
|
27
30
|
let traits = [];
|
|
@@ -34,6 +37,20 @@ let targetName = "AddProduct";
|
|
|
34
37
|
|
|
35
38
|
let externalSystem = "SupplierFeed";
|
|
36
39
|
|
|
40
|
+
let endpoint = {
|
|
41
|
+
path: "supplier-feed",
|
|
42
|
+
auth: {
|
|
43
|
+
TAG: "SignedBody",
|
|
44
|
+
_0: {
|
|
45
|
+
header: "X-Signature-256",
|
|
46
|
+
prefix: "sha256=",
|
|
47
|
+
timestampHeader: "X-Signature-Timestamp",
|
|
48
|
+
secret: "supplierFeed"
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
role: "Admin"
|
|
52
|
+
};
|
|
53
|
+
|
|
37
54
|
let moduleUrl = "@reventlessdev/online-shop-dcb-catalog/src/Product/InboundTranslation/ImportProduct.res.mjs";
|
|
38
55
|
|
|
39
56
|
export {
|
|
@@ -43,6 +60,7 @@ export {
|
|
|
43
60
|
commandSchema,
|
|
44
61
|
targetName,
|
|
45
62
|
externalSystem,
|
|
63
|
+
endpoint,
|
|
46
64
|
moduleUrl,
|
|
47
65
|
authorizationOf,
|
|
48
66
|
traits,
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -13,7 +13,8 @@ let include = InboundTranslation_GWT$ReventlessGwt.FromSlice({
|
|
|
13
13
|
commandSchema: ImportProduct$CatalogPlugin.commandSchema,
|
|
14
14
|
targetName: ImportProduct$CatalogPlugin.targetName,
|
|
15
15
|
externalSystem: ImportProduct$CatalogPlugin.externalSystem,
|
|
16
|
-
authorizationOf: ImportProduct$CatalogPlugin.authorizationOf
|
|
16
|
+
authorizationOf: ImportProduct$CatalogPlugin.authorizationOf,
|
|
17
|
+
endpoint: ImportProduct$CatalogPlugin.endpoint
|
|
17
18
|
})({
|
|
18
19
|
translate: ImportProduct_Translation$CatalogPlugin.translate,
|
|
19
20
|
moduleUrl: ImportProduct_Translation$CatalogPlugin.moduleUrl
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/lib/ocaml/.compiler.log
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
#Start(
|
|
2
|
-
#Done(
|
|
1
|
+
#Start(1792162610379)
|
|
2
|
+
#Done(1792162613537)
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
// ImportProduct InboundTranslationSlice.
|
|
2
2
|
// Receives external supplier JSON, validates and translates to an AddProduct command.
|
|
3
|
+
// The supplier posts to a signed webhook; the mutation stays as an operator's
|
|
4
|
+
// replay door, which is why the command needs Admin rather than any signed-in user.
|
|
3
5
|
|
|
4
6
|
@@reventless.spec
|
|
7
|
+
@@reventless.authorize(AllowRoles([Admin]))
|
|
5
8
|
|
|
6
9
|
@schema
|
|
7
10
|
type externalInput = {
|
|
@@ -20,3 +23,17 @@ let targetName = "AddProduct"
|
|
|
20
23
|
// Foreign system this anti-corruption slice receives product data from — drawn as an
|
|
21
24
|
// external box outside the Catalog plugin in the Event Graph.
|
|
22
25
|
let externalSystem = Some("SupplierFeed")
|
|
26
|
+
|
|
27
|
+
// The supplier signs each post with the secret `supplierFeed`
|
|
28
|
+
// (`pulumi config set --secret webhook:supplierFeed …` on AWS,
|
|
29
|
+
// `REVENTLESS_WEBHOOK_SECRET_SUPPLIERFEED` locally); a signed post acts as Admin.
|
|
30
|
+
let endpoint = Some({
|
|
31
|
+
Reventless.InboundTranslationSlice.path: "supplier-feed",
|
|
32
|
+
auth: SignedBody({
|
|
33
|
+
header: "X-Signature-256",
|
|
34
|
+
prefix: "sha256=",
|
|
35
|
+
timestampHeader: "X-Signature-Timestamp",
|
|
36
|
+
secret: "supplierFeed",
|
|
37
|
+
}),
|
|
38
|
+
role: Roles.Admin,
|
|
39
|
+
})
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reventlessdev/online-shop-dcb-catalog",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.282",
|
|
4
4
|
"description": "Online Shop example — Catalog bounded context (Product & Category) using the DCB pattern",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"jest": {
|
|
@@ -21,13 +21,13 @@
|
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"sury": "11.0.0",
|
|
24
|
-
"@reventlessdev/online-shop-dcb-catalog-spec": "1.0.0-alpha.
|
|
25
|
-
"@reventlessdev/online-shop-dcb-ordering-spec": "1.0.0-alpha.
|
|
26
|
-
"@reventlessdev/
|
|
27
|
-
"@reventlessdev/reventless-
|
|
28
|
-
"@reventlessdev/
|
|
29
|
-
"@reventlessdev/reventless-local": "3.0.0-alpha.
|
|
30
|
-
"@reventlessdev/reventless-spec": "3.0.0-alpha.
|
|
24
|
+
"@reventlessdev/online-shop-dcb-catalog-spec": "1.0.0-alpha.167",
|
|
25
|
+
"@reventlessdev/online-shop-dcb-ordering-spec": "1.0.0-alpha.167",
|
|
26
|
+
"@reventlessdev/rescript-pulumi-pulumi": "3.0.0-alpha.0",
|
|
27
|
+
"@reventlessdev/reventless-infra": "3.0.0-alpha.195",
|
|
28
|
+
"@reventlessdev/reventless-gwt": "1.0.0-alpha.246",
|
|
29
|
+
"@reventlessdev/reventless-local": "3.0.0-alpha.289",
|
|
30
|
+
"@reventlessdev/reventless-spec": "3.0.0-alpha.167"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"rescript": "12.3.1",
|
package/src/Plugin.res.mjs
CHANGED
|
@@ -282,7 +282,8 @@ function Make(Platform) {
|
|
|
282
282
|
commandSchema: ImportProduct$CatalogPlugin.commandSchema,
|
|
283
283
|
targetName: ImportProduct$CatalogPlugin.targetName,
|
|
284
284
|
externalSystem: ImportProduct$CatalogPlugin.externalSystem,
|
|
285
|
-
authorizationOf: ImportProduct$CatalogPlugin.authorizationOf
|
|
285
|
+
authorizationOf: ImportProduct$CatalogPlugin.authorizationOf,
|
|
286
|
+
endpoint: ImportProduct$CatalogPlugin.endpoint
|
|
286
287
|
})({
|
|
287
288
|
translate: ImportProduct_Translation$CatalogPlugin.translate,
|
|
288
289
|
moduleUrl: ImportProduct_Translation$CatalogPlugin.moduleUrl
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
// ImportProduct InboundTranslationSlice.
|
|
2
2
|
// Receives external supplier JSON, validates and translates to an AddProduct command.
|
|
3
|
+
// The supplier posts to a signed webhook; the mutation stays as an operator's
|
|
4
|
+
// replay door, which is why the command needs Admin rather than any signed-in user.
|
|
3
5
|
|
|
4
6
|
@@reventless.spec
|
|
7
|
+
@@reventless.authorize(AllowRoles([Admin]))
|
|
5
8
|
|
|
6
9
|
@schema
|
|
7
10
|
type externalInput = {
|
|
@@ -20,3 +23,17 @@ let targetName = "AddProduct"
|
|
|
20
23
|
// Foreign system this anti-corruption slice receives product data from — drawn as an
|
|
21
24
|
// external box outside the Catalog plugin in the Event Graph.
|
|
22
25
|
let externalSystem = Some("SupplierFeed")
|
|
26
|
+
|
|
27
|
+
// The supplier signs each post with the secret `supplierFeed`
|
|
28
|
+
// (`pulumi config set --secret webhook:supplierFeed …` on AWS,
|
|
29
|
+
// `REVENTLESS_WEBHOOK_SECRET_SUPPLIERFEED` locally); a signed post acts as Admin.
|
|
30
|
+
let endpoint = Some({
|
|
31
|
+
Reventless.InboundTranslationSlice.path: "supplier-feed",
|
|
32
|
+
auth: SignedBody({
|
|
33
|
+
header: "X-Signature-256",
|
|
34
|
+
prefix: "sha256=",
|
|
35
|
+
timestampHeader: "X-Signature-Timestamp",
|
|
36
|
+
secret: "supplierFeed",
|
|
37
|
+
}),
|
|
38
|
+
role: Roles.Admin,
|
|
39
|
+
})
|
|
@@ -21,7 +21,10 @@ let commandSchema = Sury.$schema(s => ({
|
|
|
21
21
|
}));
|
|
22
22
|
|
|
23
23
|
function authorizationOf(param) {
|
|
24
|
-
return
|
|
24
|
+
return {
|
|
25
|
+
TAG: "AllowRoles",
|
|
26
|
+
_0: ["Admin"]
|
|
27
|
+
};
|
|
25
28
|
}
|
|
26
29
|
|
|
27
30
|
let traits = [];
|
|
@@ -34,6 +37,20 @@ let targetName = "AddProduct";
|
|
|
34
37
|
|
|
35
38
|
let externalSystem = "SupplierFeed";
|
|
36
39
|
|
|
40
|
+
let endpoint = {
|
|
41
|
+
path: "supplier-feed",
|
|
42
|
+
auth: {
|
|
43
|
+
TAG: "SignedBody",
|
|
44
|
+
_0: {
|
|
45
|
+
header: "X-Signature-256",
|
|
46
|
+
prefix: "sha256=",
|
|
47
|
+
timestampHeader: "X-Signature-Timestamp",
|
|
48
|
+
secret: "supplierFeed"
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
role: "Admin"
|
|
52
|
+
};
|
|
53
|
+
|
|
37
54
|
let moduleUrl = "@reventlessdev/online-shop-dcb-catalog/src/Product/InboundTranslation/ImportProduct.res.mjs";
|
|
38
55
|
|
|
39
56
|
export {
|
|
@@ -43,6 +60,7 @@ export {
|
|
|
43
60
|
commandSchema,
|
|
44
61
|
targetName,
|
|
45
62
|
externalSystem,
|
|
63
|
+
endpoint,
|
|
46
64
|
moduleUrl,
|
|
47
65
|
authorizationOf,
|
|
48
66
|
traits,
|
|
@@ -13,7 +13,8 @@ let include = InboundTranslation_GWT$ReventlessGwt.FromSlice({
|
|
|
13
13
|
commandSchema: ImportProduct$CatalogPlugin.commandSchema,
|
|
14
14
|
targetName: ImportProduct$CatalogPlugin.targetName,
|
|
15
15
|
externalSystem: ImportProduct$CatalogPlugin.externalSystem,
|
|
16
|
-
authorizationOf: ImportProduct$CatalogPlugin.authorizationOf
|
|
16
|
+
authorizationOf: ImportProduct$CatalogPlugin.authorizationOf,
|
|
17
|
+
endpoint: ImportProduct$CatalogPlugin.endpoint
|
|
17
18
|
})({
|
|
18
19
|
translate: ImportProduct_Translation$CatalogPlugin.translate,
|
|
19
20
|
moduleUrl: ImportProduct_Translation$CatalogPlugin.moduleUrl
|