@reventlessdev/reventless-aws 3.0.0-alpha.378 → 3.0.0-alpha.379
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 +14 -0
- package/package.json +8 -8
- package/src/Platform.res.mjs +4 -4
- package/tests/AppSync_AdapterTest.res +6 -7
- package/tests/AppSync_AdapterTest.res.mjs +16 -13
- package/tests/EpInboundTestSlice.res +1 -1
- package/tests/EpInboundTestSlice.res.mjs +2 -2
- package/tests/QueryDbResolvers_AppSyncTest.res +2 -2
- package/tests/QueryDbResolvers_AppSyncTest.res.mjs +1 -1
- package/tests/integration/AggTestAggregate.res +2 -2
- package/tests/integration/AggTestAggregate.res.mjs +2 -2
- package/tests/integration/EpCompositeSlice.res +1 -1
- package/tests/integration/EpCompositeSlice.res.mjs +2 -2
- package/tests/integration/EpTestSlice.res +1 -1
- package/tests/integration/EpTestSlice.res.mjs +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,20 @@
|
|
|
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.379 (2026-10-10)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* **pulumi-aws:** a list's last page no longer promises another ([00b141f](https://github.com/ReventlessDev/reventless-core/commit/00b141fbfdbf44544fbea8ab979356831381f48a))
|
|
11
|
+
* feat!: a command's rule is looked up by its name, without a cast ([5f02c40](https://github.com/ReventlessDev/reventless-core/commit/5f02c4081d077bf4a6951d8c9b2b16553a8ca87b))
|
|
12
|
+
|
|
13
|
+
### BREAKING CHANGES
|
|
14
|
+
|
|
15
|
+
* a spec that writes `commandAuthorization` by hand writes
|
|
16
|
+
`authorizationOf = (name: string) => …` instead; the PPX refuses the old name.
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
6
20
|
# 3.0.0-alpha.378 (2026-10-10)
|
|
7
21
|
|
|
8
22
|
### Bug Fixes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reventlessdev/reventless-aws",
|
|
3
|
-
"version": "3.0.0-alpha.
|
|
3
|
+
"version": "3.0.0-alpha.379",
|
|
4
4
|
"description": "AWS adapters for Reventless",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"bin": {
|
|
@@ -23,18 +23,18 @@
|
|
|
23
23
|
"uuid": "^13.0.0",
|
|
24
24
|
"yaml": "^2.8.3",
|
|
25
25
|
"@reventlessdev/rescript-aws-sdk": "3.0.0-alpha.30",
|
|
26
|
-
"@reventlessdev/rescript-jest": "1.0.0-alpha.11",
|
|
27
26
|
"@reventlessdev/rescript-effect": "0.1.0-alpha.34",
|
|
27
|
+
"@reventlessdev/rescript-pulumi-aws": "3.0.0-alpha.27",
|
|
28
28
|
"@reventlessdev/rescript-node": "2.0.0-alpha.22",
|
|
29
|
-
"@reventlessdev/rescript-
|
|
29
|
+
"@reventlessdev/rescript-jest": "1.0.0-alpha.11",
|
|
30
30
|
"@reventlessdev/rescript-pulumi-pulumi": "2.3.0-alpha.23",
|
|
31
|
-
"@reventlessdev/rescript-web": "1.0.0-alpha.7",
|
|
32
31
|
"@reventlessdev/rescript-uuid": "2.0.0-alpha.1",
|
|
33
|
-
"@reventlessdev/
|
|
34
|
-
"@reventlessdev/reventless-
|
|
32
|
+
"@reventlessdev/rescript-web": "1.0.0-alpha.7",
|
|
33
|
+
"@reventlessdev/reventless-core": "3.0.0-alpha.293",
|
|
34
|
+
"@reventlessdev/reventless-infra": "3.0.0-alpha.190",
|
|
35
35
|
"@reventlessdev/reventless-interop": "3.0.0-alpha.39",
|
|
36
|
-
"@reventlessdev/reventless-
|
|
37
|
-
"@reventlessdev/reventless-spec": "3.0.0-alpha.
|
|
36
|
+
"@reventlessdev/reventless-postgres": "3.0.0-alpha.157",
|
|
37
|
+
"@reventlessdev/reventless-spec": "3.0.0-alpha.162"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"rescript": "12.3.1",
|
package/src/Platform.res.mjs
CHANGED
|
@@ -485,7 +485,7 @@ function MakeWithConfig(Config) {
|
|
|
485
485
|
errorSchema: UiFragmentRegistry$ReventlessCore.errorSchema,
|
|
486
486
|
eventSchema: UiFragmentRegistry$ReventlessCore.eventSchema,
|
|
487
487
|
commandSchema: UiFragmentRegistry$ReventlessCore.commandSchema,
|
|
488
|
-
|
|
488
|
+
authorizationOf: UiFragmentRegistry$ReventlessCore.authorizationOf,
|
|
489
489
|
commandTransition: UiFragmentRegistry$ReventlessCore.commandTransition,
|
|
490
490
|
traits: UiFragmentRegistry$ReventlessCore.traits,
|
|
491
491
|
readConsistency: UiFragmentRegistry$ReventlessCore.readConsistency
|
|
@@ -682,7 +682,7 @@ function MakeWithConfig(Config) {
|
|
|
682
682
|
errorSchema: PluginSpec$ReventlessCore.errorSchema,
|
|
683
683
|
commandSchema: PluginSpec$ReventlessCore.commandSchema,
|
|
684
684
|
moduleUrl: PluginSpec$ReventlessCore.moduleUrl,
|
|
685
|
-
|
|
685
|
+
authorizationOf: PluginSpec$ReventlessCore.authorizationOf,
|
|
686
686
|
commandTransition: PluginSpec$ReventlessCore.commandTransition,
|
|
687
687
|
traits: PluginSpec$ReventlessCore.traits
|
|
688
688
|
})({
|
|
@@ -1901,7 +1901,7 @@ function Make($star) {
|
|
|
1901
1901
|
errorSchema: UiFragmentRegistry$ReventlessCore.errorSchema,
|
|
1902
1902
|
eventSchema: UiFragmentRegistry$ReventlessCore.eventSchema,
|
|
1903
1903
|
commandSchema: UiFragmentRegistry$ReventlessCore.commandSchema,
|
|
1904
|
-
|
|
1904
|
+
authorizationOf: UiFragmentRegistry$ReventlessCore.authorizationOf,
|
|
1905
1905
|
commandTransition: UiFragmentRegistry$ReventlessCore.commandTransition,
|
|
1906
1906
|
traits: UiFragmentRegistry$ReventlessCore.traits,
|
|
1907
1907
|
readConsistency: UiFragmentRegistry$ReventlessCore.readConsistency
|
|
@@ -2098,7 +2098,7 @@ function Make($star) {
|
|
|
2098
2098
|
errorSchema: PluginSpec$ReventlessCore.errorSchema,
|
|
2099
2099
|
commandSchema: PluginSpec$ReventlessCore.commandSchema,
|
|
2100
2100
|
moduleUrl: PluginSpec$ReventlessCore.moduleUrl,
|
|
2101
|
-
|
|
2101
|
+
authorizationOf: PluginSpec$ReventlessCore.authorizationOf,
|
|
2102
2102
|
commandTransition: PluginSpec$ReventlessCore.commandTransition,
|
|
2103
2103
|
traits: PluginSpec$ReventlessCore.traits
|
|
2104
2104
|
})({
|
|
@@ -154,12 +154,11 @@ module TwoRuleFeed = {
|
|
|
154
154
|
@schema
|
|
155
155
|
type command = AddProduct({sku: string}) | AddCategory({sku: string})
|
|
156
156
|
|
|
157
|
-
let
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
|
162
|
-
| AddCategory(_) => AllowRoles([Reventless.Role.make("Admin")])
|
|
157
|
+
let authorizationOf = (name: string): Reventless.Authorization.rule<Reventless.Role.name> =>
|
|
158
|
+
switch name {
|
|
159
|
+
| "AddProduct" => AllowRoles([Reventless.Role.make("Merchandiser")])
|
|
160
|
+
| "AddCategory" => AllowRoles([Reventless.Role.make("Admin")])
|
|
161
|
+
| _ => DenyAll
|
|
163
162
|
}
|
|
164
163
|
}
|
|
165
164
|
|
|
@@ -244,7 +243,7 @@ describe("AppSync_Adapter.injectAwsAuth — Stage E2 permission lifting", () =>
|
|
|
244
243
|
testSync("an inbound slice's field carries every constructor's groups", () => {
|
|
245
244
|
let permission = ReventlessCore.Dcb_Builder.inboundDoorPermission(
|
|
246
245
|
TwoRuleFeed.commandSchema,
|
|
247
|
-
TwoRuleFeed.
|
|
246
|
+
TwoRuleFeed.authorizationOf,
|
|
248
247
|
)
|
|
249
248
|
let fp = Dict.fromArray(permission->Option.mapOr([], p => [("p_TwoRuleFeed", p)]))
|
|
250
249
|
let entry = mutationEntry(~fieldNames=["p_TwoRuleFeed"], ~fieldPermissions=fp)
|
|
@@ -121,23 +121,26 @@ let commandSchema = Sury.union([
|
|
|
121
121
|
}))
|
|
122
122
|
]);
|
|
123
123
|
|
|
124
|
-
function
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
124
|
+
function authorizationOf(name) {
|
|
125
|
+
switch (name) {
|
|
126
|
+
case "AddCategory" :
|
|
127
|
+
return {
|
|
128
|
+
TAG: "AllowRoles",
|
|
129
|
+
_0: ["Admin"]
|
|
130
|
+
};
|
|
131
|
+
case "AddProduct" :
|
|
132
|
+
return {
|
|
133
|
+
TAG: "AllowRoles",
|
|
134
|
+
_0: ["Merchandiser"]
|
|
135
|
+
};
|
|
136
|
+
default:
|
|
137
|
+
return "DenyAll";
|
|
135
138
|
}
|
|
136
139
|
}
|
|
137
140
|
|
|
138
141
|
let TwoRuleFeed = {
|
|
139
142
|
commandSchema: commandSchema,
|
|
140
|
-
|
|
143
|
+
authorizationOf: authorizationOf
|
|
141
144
|
};
|
|
142
145
|
|
|
143
146
|
globalThis.describe("AppSync_Adapter.injectAwsAuth — Stage E2 permission lifting", () => {
|
|
@@ -201,7 +204,7 @@ globalThis.describe("AppSync_Adapter.injectAwsAuth — Stage E2 permission lifti
|
|
|
201
204
|
globalThis.expect(GraphQL_Stitcher$ReventlessCore.decode(aug).mutations[0]).toContain(`@aws_cognito_user_pools(cognito_groups: ["Admin", "shop-merch-team"])`);
|
|
202
205
|
});
|
|
203
206
|
globalThis.test("an inbound slice's field carries every constructor's groups", () => {
|
|
204
|
-
let permission = Dcb_Builder$ReventlessCore.inboundDoorPermission(commandSchema,
|
|
207
|
+
let permission = Dcb_Builder$ReventlessCore.inboundDoorPermission(commandSchema, authorizationOf);
|
|
205
208
|
let fp = Object.fromEntries(Stdlib_Option.mapOr(permission, [], p => [[
|
|
206
209
|
"p_TwoRuleFeed",
|
|
207
210
|
p
|
|
@@ -17,6 +17,6 @@ let targetName = "AddThing"
|
|
|
17
17
|
let externalSystem: option<string> = Some("TestFeed")
|
|
18
18
|
|
|
19
19
|
type role = Reventless.Role.name
|
|
20
|
-
let
|
|
20
|
+
let authorizationOf = (_: string): Reventless.Authorization.rule<role> => AllowRoles([
|
|
21
21
|
Reventless.Role.make("Admin"),
|
|
22
22
|
])
|
|
@@ -12,7 +12,7 @@ let commandSchema = Sury.$schema(s => ({
|
|
|
12
12
|
thingId: s.m(Sury.string)
|
|
13
13
|
}));
|
|
14
14
|
|
|
15
|
-
function
|
|
15
|
+
function authorizationOf(param) {
|
|
16
16
|
return {
|
|
17
17
|
TAG: "AllowRoles",
|
|
18
18
|
_0: ["Admin"]
|
|
@@ -34,6 +34,6 @@ export {
|
|
|
34
34
|
commandSchema,
|
|
35
35
|
targetName,
|
|
36
36
|
externalSystem,
|
|
37
|
-
|
|
37
|
+
authorizationOf,
|
|
38
38
|
}
|
|
39
39
|
/* externalInputSchema Not a pure module */
|
|
@@ -58,9 +58,9 @@ describe("listAllItemsConnection — paging", () => {
|
|
|
58
58
|
|
|
59
59
|
testSync("a filtered read examines more rows than it serves", () => {
|
|
60
60
|
// The budget reads as deep as the page needs, which for a backward cut is
|
|
61
|
-
// `_upTo` rather than `_first + _from`.
|
|
61
|
+
// `_upTo` rather than one row past `_first + _from`.
|
|
62
62
|
expect(
|
|
63
|
-
code->String.includes("parts.length > 0 ? ((_backward ? _upTo : _first + _from) > 1000"),
|
|
63
|
+
code->String.includes("parts.length > 0 ? ((_backward ? _upTo : _first + _from + 1) > 1000"),
|
|
64
64
|
)->toBe(true)
|
|
65
65
|
expect(
|
|
66
66
|
code->String.includes("const _page = _backward ? _rest : _rest.slice(0, _first);"),
|
|
@@ -37,7 +37,7 @@ globalThis.describe("listAllItemsConnection — paging", () => {
|
|
|
37
37
|
globalThis.expect(code.includes("ctx.args.after + '_' + i")).toBe(false);
|
|
38
38
|
});
|
|
39
39
|
globalThis.test("a filtered read examines more rows than it serves", () => {
|
|
40
|
-
globalThis.expect(code.includes("parts.length > 0 ? ((_backward ? _upTo : _first + _from) > 1000")).toBe(true);
|
|
40
|
+
globalThis.expect(code.includes("parts.length > 0 ? ((_backward ? _upTo : _first + _from + 1) > 1000")).toBe(true);
|
|
41
41
|
globalThis.expect(code.includes("const _page = _backward ? _rest : _rest.slice(0, _first);")).toBe(true);
|
|
42
42
|
globalThis.expect(code.includes("hasNextPage: _more || !!_next,")).toBe(true);
|
|
43
43
|
});
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
// wired into reventless-core's rescript.json, not reventless-aws's), exposing
|
|
6
6
|
// exactly the fields the compiled `@@reventless.spec` output would: name, Id
|
|
7
7
|
// (patched in at runtime by patchSpecId), commandSchema/eventSchema/errorSchema
|
|
8
|
-
// (via sury-ppx), moduleUrl,
|
|
8
|
+
// (via sury-ppx), moduleUrl, authorizationOf.
|
|
9
9
|
|
|
10
10
|
@schema
|
|
11
11
|
type command = Add({name: string})
|
|
@@ -19,6 +19,6 @@ type error = AlreadyExists
|
|
|
19
19
|
let name = "AggTestAggregate"
|
|
20
20
|
let moduleUrl = "agg-test://AggTestAggregate"
|
|
21
21
|
type role = Reventless.Role.name
|
|
22
|
-
let
|
|
22
|
+
let authorizationOf = (_: string): Reventless.Authorization.rule<role> => AllowAnonymous
|
|
23
23
|
type lifecycleState = unit
|
|
24
24
|
let commandTransition = (_: command): Reventless.Transition.t<lifecycleState> => Unrestricted
|
|
@@ -14,7 +14,7 @@ let eventSchema = Sury.$schema(s => ({
|
|
|
14
14
|
|
|
15
15
|
let errorSchema = Sury.literal("AlreadyExists");
|
|
16
16
|
|
|
17
|
-
function
|
|
17
|
+
function authorizationOf(param) {
|
|
18
18
|
return "AllowAnonymous";
|
|
19
19
|
}
|
|
20
20
|
|
|
@@ -32,7 +32,7 @@ export {
|
|
|
32
32
|
errorSchema,
|
|
33
33
|
name,
|
|
34
34
|
moduleUrl,
|
|
35
|
-
|
|
35
|
+
authorizationOf,
|
|
36
36
|
commandTransition,
|
|
37
37
|
}
|
|
38
38
|
/* commandSchema Not a pure module */
|
|
@@ -64,7 +64,7 @@ type event =
|
|
|
64
64
|
let name = "EpCompositeSlice"
|
|
65
65
|
let moduleUrl = "ep-test://EpCompositeSlice"
|
|
66
66
|
type role = Reventless.Role.name
|
|
67
|
-
let
|
|
67
|
+
let authorizationOf = (_: string): Reventless.Authorization.rule<role> => AllowAnonymous
|
|
68
68
|
type lifecycleState = unit
|
|
69
69
|
let commandTransition = (_: command): Reventless.Transition.t<lifecycleState> => Unrestricted
|
|
70
70
|
let readConsistency = Reventless.ReadConsistency.EscalateOnRetry
|
|
@@ -47,7 +47,7 @@ let eventSchema = Sury.union([
|
|
|
47
47
|
}))
|
|
48
48
|
]);
|
|
49
49
|
|
|
50
|
-
function
|
|
50
|
+
function authorizationOf(param) {
|
|
51
51
|
return "AllowAnonymous";
|
|
52
52
|
}
|
|
53
53
|
|
|
@@ -68,7 +68,7 @@ export {
|
|
|
68
68
|
eventSchema,
|
|
69
69
|
name,
|
|
70
70
|
moduleUrl,
|
|
71
|
-
|
|
71
|
+
authorizationOf,
|
|
72
72
|
commandTransition,
|
|
73
73
|
readConsistency,
|
|
74
74
|
}
|
|
@@ -22,7 +22,7 @@ type event = WidgetAdded({widgetId: @s.matches(Reventless.DcbTag.partition) stri
|
|
|
22
22
|
let name = "EpTestSlice"
|
|
23
23
|
let moduleUrl = "ep-test://EpTestSlice"
|
|
24
24
|
type role = Reventless.Role.name
|
|
25
|
-
let
|
|
25
|
+
let authorizationOf = (_: string): Reventless.Authorization.rule<role> => AllowAnonymous
|
|
26
26
|
type lifecycleState = unit
|
|
27
27
|
let commandTransition = (_: command): Reventless.Transition.t<lifecycleState> => Unrestricted
|
|
28
28
|
let readConsistency = Reventless.ReadConsistency.EscalateOnRetry
|
|
@@ -20,7 +20,7 @@ let eventSchema = Sury.$schema(s => ({
|
|
|
20
20
|
widgetId: s.m(DcbTag$Reventless.partition)
|
|
21
21
|
}));
|
|
22
22
|
|
|
23
|
-
function
|
|
23
|
+
function authorizationOf(param) {
|
|
24
24
|
return "AllowAnonymous";
|
|
25
25
|
}
|
|
26
26
|
|
|
@@ -41,7 +41,7 @@ export {
|
|
|
41
41
|
eventSchema,
|
|
42
42
|
name,
|
|
43
43
|
moduleUrl,
|
|
44
|
-
|
|
44
|
+
authorizationOf,
|
|
45
45
|
commandTransition,
|
|
46
46
|
readConsistency,
|
|
47
47
|
}
|