@reventlessdev/reventless-aws 3.0.0-alpha.389 → 3.0.0-alpha.390

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,19 @@
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.390 (2026-10-21)
7
+
8
+ * feat!: a rejected command says whether the model, the access check or the platform said no ([6a8a6b0](https://github.com/ReventlessDev/reventless-core/commit/6a8a6b0f2f31e766ae26a944c23b0904e51a5865))
9
+
10
+ ### BREAKING CHANGES
11
+
12
+ * a type error variant with one of those names fails to
13
+ compile; rename it for what the model means, such as AlreadyBooked. On
14
+ AWS, rebuild every plugin against this release before a client selects
15
+ cause: a plugin built earlier answers it with a non-null error.
16
+
17
+
18
+
6
19
  # 3.0.0-alpha.389 (2026-10-21)
7
20
 
8
21
  * feat!: a state view's row key is module Id ([08c9726](https://github.com/ReventlessDev/reventless-core/commit/08c972659a3d689a39fd5e2f2026597155e92210))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reventlessdev/reventless-aws",
3
- "version": "3.0.0-alpha.389",
3
+ "version": "3.0.0-alpha.390",
4
4
  "description": "AWS adapters for Reventless",
5
5
  "license": "Apache-2.0",
6
6
  "bin": {
@@ -24,17 +24,17 @@
24
24
  "yaml": "^2.8.3",
25
25
  "@reventlessdev/rescript-aws-sdk": "3.0.0-alpha.33",
26
26
  "@reventlessdev/rescript-effect": "1.0.0-alpha.1",
27
- "@reventlessdev/rescript-node": "2.0.0-alpha.23",
28
27
  "@reventlessdev/rescript-jest": "1.0.0-alpha.13",
28
+ "@reventlessdev/rescript-node": "2.0.0-alpha.23",
29
29
  "@reventlessdev/rescript-pulumi-aws": "3.0.0-alpha.31",
30
30
  "@reventlessdev/rescript-pulumi-pulumi": "3.0.0-alpha.0",
31
- "@reventlessdev/rescript-uuid": "2.0.0-alpha.1",
32
31
  "@reventlessdev/rescript-web": "1.0.0-alpha.8",
33
- "@reventlessdev/reventless-infra": "3.0.0-alpha.199",
32
+ "@reventlessdev/rescript-uuid": "2.0.0-alpha.1",
34
33
  "@reventlessdev/reventless-interop": "3.0.0-alpha.42",
35
- "@reventlessdev/reventless-postgres": "3.0.0-alpha.166",
36
- "@reventlessdev/reventless-spec": "3.0.0-alpha.171",
37
- "@reventlessdev/reventless-core": "3.0.0-alpha.302"
34
+ "@reventlessdev/reventless-core": "3.0.0-alpha.303",
35
+ "@reventlessdev/reventless-infra": "3.0.0-alpha.200",
36
+ "@reventlessdev/reventless-postgres": "3.0.0-alpha.167",
37
+ "@reventlessdev/reventless-spec": "3.0.0-alpha.172"
38
38
  },
39
39
  "devDependencies": {
40
40
  "rescript": "12.3.1",
@@ -84,12 +84,14 @@ function extractFieldName(event) {
84
84
  return dot >= 0 ? info.slice(dot + 1) : info;
85
85
  }
86
86
 
87
+ // The plugin, not the model, said no: cause INFRASTRUCTURE.
87
88
  function pluginRejection(msgId, errorCode, detail) {
88
89
  return {
89
90
  __typename: "CommandRejected",
90
91
  msgId,
91
92
  errorCode,
92
93
  errorDetail: detail,
94
+ cause: "INFRASTRUCTURE",
93
95
  };
94
96
  }
95
97
 
@@ -524,6 +524,10 @@ let assertGateable = (sdl: string): string => {
524
524
  // Object types the admin source owns canonically. `interface Node` and
525
525
  // `union CommandResult` are handled structurally below (their def lines don't
526
526
  // start with `type `).
527
+ //
528
+ // `enum CommandRejectionCause` is left unstamped, like `SortOrder`: every source
529
+ // emits a byte-identical copy, which the merge unions. Only object types,
530
+ // interfaces and unions were spike-validated with `@canonical`.
527
531
  let canonicalTypeNames = ["PageInfo", "CommandAccepted", "CommandRejected", "CommandPending"]
528
532
 
529
533
  let stampCanonicalTypes = (sdl: string): string =>
@@ -151,6 +151,20 @@ describe("AppSync_SdlDecorate.stampCanonicalTypes", () => {
151
151
  expect(sdl->String.includes("type Product @canonical"))->toBe(false)
152
152
  })
153
153
 
154
+ testSync("leaves the rejection-cause enum identical in every source", () => {
155
+ let types = ReventlessCore.GraphQL_FragmentGenerator.commandResultSdlTypes->Array.join("\n\n")
156
+ let stamped =
157
+ types
158
+ ->AppSync_SdlDecorate.stampSharedIamTypes
159
+ ->AppSync_SdlDecorate.stampAllTypesCognito
160
+ ->AppSync_SdlDecorate.stampCanonicalTypes
161
+ expect(stamped)->toContain(
162
+ "enum CommandRejectionCause {\n DOMAIN\n ACCESS\n INFRASTRUCTURE\n}",
163
+ )
164
+ expect(stamped)->toContain("type CommandRejected @aws_cognito_user_pools @aws_iam @canonical {")
165
+ expect(stamped)->toContain(" cause: CommandRejectionCause!")
166
+ })
167
+
154
168
  testSync("is idempotent", () => {
155
169
  let once = AppSync_SdlDecorate.stampCanonicalTypes("type PageInfo {\n x: Int\n}")
156
170
  expect(AppSync_SdlDecorate.stampCanonicalTypes(once))->toBe(once)
@@ -5,6 +5,7 @@ import * as AppSync_Adapter$ReventlessAws from "../src/components/Api/AppSync_Ad
5
5
  import * as GraphQL_Stitcher$ReventlessCore from "@reventlessdev/reventless-core/src/components/Api/GraphQL_Stitcher.res.mjs";
6
6
  import * as Platform_AdminApi$ReventlessCore from "@reventlessdev/reventless-core/src/admin/Platform_AdminApi.res.mjs";
7
7
  import * as AppSync_SdlDecorate$ReventlessAws from "../src/components/Api/AppSync_SdlDecorate.res.mjs";
8
+ import * as GraphQL_FragmentGenerator$ReventlessCore from "@reventlessdev/reventless-core/src/components/Api/GraphQL_FragmentGenerator.res.mjs";
8
9
 
9
10
  let sources = [
10
11
  {
@@ -127,6 +128,13 @@ globalThis.describe("AppSync_SdlDecorate.stampCanonicalTypes", () => {
127
128
  globalThis.expect(sdl).toContain("type Product {");
128
129
  globalThis.expect(sdl.includes("type Product @canonical")).toBe(false);
129
130
  });
131
+ globalThis.test("leaves the rejection-cause enum identical in every source", () => {
132
+ let types = GraphQL_FragmentGenerator$ReventlessCore.commandResultSdlTypes.join("\n\n");
133
+ let stamped = AppSync_SdlDecorate$ReventlessAws.stampCanonicalTypes(AppSync_SdlDecorate$ReventlessAws.stampAllTypesCognito(AppSync_SdlDecorate$ReventlessAws.stampSharedIamTypes(types)));
134
+ globalThis.expect(stamped).toContain("enum CommandRejectionCause {\n DOMAIN\n ACCESS\n INFRASTRUCTURE\n}");
135
+ globalThis.expect(stamped).toContain("type CommandRejected @aws_cognito_user_pools @aws_iam @canonical {");
136
+ globalThis.expect(stamped).toContain(" cause: CommandRejectionCause!");
137
+ });
130
138
  globalThis.test("is idempotent", () => {
131
139
  let once = AppSync_SdlDecorate$ReventlessAws.stampCanonicalTypes("type PageInfo {\n x: Int\n}");
132
140
  globalThis.expect(AppSync_SdlDecorate$ReventlessAws.stampCanonicalTypes(once)).toBe(once);