@reventlessdev/reventless-aws 3.0.0-alpha.325 → 3.0.0-alpha.327

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,21 @@
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.327 (2026-08-25)
7
+
8
+ **Note:** Version bump only for package @reventlessdev/reventless-aws
9
+
10
+
11
+
12
+
13
+
14
+ # 3.0.0-alpha.326 (2026-08-25)
15
+
16
+ ### Bug Fixes
17
+
18
+ * **aws:** open the subscription socket on the host AppSync serves it from ([426d932](https://github.com/ReventlessDev/reventless-core/commit/426d9322d6aff694e3c82c64ea1483760457b8e4))
19
+
20
+
6
21
  # 3.0.0-alpha.325 (2026-08-24)
7
22
 
8
23
  **Note:** Version bump only for package @reventlessdev/reventless-aws
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reventlessdev/reventless-aws",
3
- "version": "3.0.0-alpha.325",
3
+ "version": "3.0.0-alpha.327",
4
4
  "description": "AWS adapters for Reventless",
5
5
  "license": "Apache-2.0",
6
6
  "bin": {
@@ -17,16 +17,16 @@
17
17
  "uuid": "^13.0.0",
18
18
  "@reventlessdev/rescript-aws-sdk": "3.0.0-alpha.13",
19
19
  "@reventlessdev/rescript-jest": "1.0.0-alpha.10",
20
- "@reventlessdev/rescript-effect": "0.1.0-alpha.32",
21
20
  "@reventlessdev/rescript-node": "2.0.0-alpha.8",
22
21
  "@reventlessdev/rescript-pulumi-aws": "3.0.0-alpha.6",
22
+ "@reventlessdev/rescript-effect": "0.1.0-alpha.32",
23
23
  "@reventlessdev/rescript-pulumi-pulumi": "2.3.0-alpha.19",
24
24
  "@reventlessdev/rescript-uuid": "2.0.0-alpha.0",
25
+ "@reventlessdev/reventless-infra": "3.0.0-alpha.151",
25
26
  "@reventlessdev/reventless-core": "3.0.0-alpha.250",
26
- "@reventlessdev/reventless-interop": "3.0.0-alpha.33",
27
27
  "@reventlessdev/reventless-postgres": "3.0.0-alpha.114",
28
28
  "@reventlessdev/reventless-spec": "3.0.0-alpha.123",
29
- "@reventlessdev/reventless-infra": "3.0.0-alpha.151"
29
+ "@reventlessdev/reventless-interop": "3.0.0-alpha.33"
30
30
  },
31
31
  "devDependencies": {
32
32
  "rescript": "12.3.0",
package/src/Platform.res CHANGED
@@ -2165,6 +2165,10 @@ module MakeWithConfig = (
2165
2165
  [
2166
2166
  ("apiEndpoint", JSON.Encode.string(domainEp)),
2167
2167
  ("platformApiEndpoint", JSON.Encode.string(platformEp)),
2168
+ (
2169
+ "platformApiSubscriptionEndpoint",
2170
+ JSON.Encode.string(Util_ShellConfig.subscriptionEndpoint(platformEp)),
2171
+ ),
2168
2172
  ("region", JSON.Encode.string(regionStr)),
2169
2173
  ("authMode", JSON.Encode.string("cognito")),
2170
2174
  ]
@@ -1156,6 +1156,7 @@ function MakeWithConfig(Config) {
1156
1156
  ]).apply(param => {
1157
1157
  let eventsEpOpt = param[1];
1158
1158
  let match = param[0];
1159
+ let platformEp = match[1];
1159
1160
  let computed = [
1160
1161
  [
1161
1162
  "apiEndpoint",
@@ -1163,7 +1164,11 @@ function MakeWithConfig(Config) {
1163
1164
  ],
1164
1165
  [
1165
1166
  "platformApiEndpoint",
1166
- match[1]
1167
+ platformEp
1168
+ ],
1169
+ [
1170
+ "platformApiSubscriptionEndpoint",
1171
+ Util_ShellConfig$ReventlessAws.subscriptionEndpoint(platformEp)
1167
1172
  ],
1168
1173
  [
1169
1174
  "region",
@@ -2447,6 +2452,7 @@ function Make($star) {
2447
2452
  ]).apply(param => {
2448
2453
  let eventsEpOpt = param[1];
2449
2454
  let match = param[0];
2455
+ let platformEp = match[1];
2450
2456
  let computed = [
2451
2457
  [
2452
2458
  "apiEndpoint",
@@ -2454,7 +2460,11 @@ function Make($star) {
2454
2460
  ],
2455
2461
  [
2456
2462
  "platformApiEndpoint",
2457
- match[1]
2463
+ platformEp
2464
+ ],
2465
+ [
2466
+ "platformApiSubscriptionEndpoint",
2467
+ Util_ShellConfig$ReventlessAws.subscriptionEndpoint(platformEp)
2458
2468
  ],
2459
2469
  [
2460
2470
  "region",
@@ -59,6 +59,25 @@ let identityFields = (~providerId: string, ~clientId: string): array<(string, JS
59
59
  ("cognitoClientId", JSON.Encode.string(clientId)),
60
60
  ]
61
61
 
62
+ /**
63
+ The websocket endpoint graphql-ws subscriptions open against.
64
+
65
+ AppSync serves realtime on a **different host** from queries — `appsync-realtime-api`
66
+ rather than `appsync-api` — so a scheme swap alone produces a URL the service will
67
+ not upgrade. The shell derives one when this key is absent, and its derivation is
68
+ the generic scheme swap, correct for a same-host server and wrong here. Absent, an
69
+ operator's menu therefore stops following Activate / Deactivate: the socket never
70
+ opens, and nothing on the page says so.
71
+
72
+ Written for every deployment rather than left to a passthrough because it is a
73
+ function of an endpoint the deploy already resolves, and a shell config that
74
+ restated it would be one more copy of a rule with a silent failure mode.
75
+ */
76
+ let subscriptionEndpoint = (httpsEndpoint: string): string =>
77
+ httpsEndpoint
78
+ ->String.replace("https://", "wss://")
79
+ ->String.replace(".appsync-api.", ".appsync-realtime-api.")
80
+
62
81
  /**
63
82
  The config.json field set.
64
83
 
@@ -52,6 +52,10 @@ function identityFields(providerId, clientId) {
52
52
  ];
53
53
  }
54
54
 
55
+ function subscriptionEndpoint(httpsEndpoint) {
56
+ return httpsEndpoint.replace("https://", "wss://").replace(".appsync-api.", ".appsync-realtime-api.");
57
+ }
58
+
55
59
  function fields(computed, viewModes, bakedManifest, shellConfig) {
56
60
  let out = Object.fromEntries(computed);
57
61
  Stdlib_Option.forEach(bakedManifest, bake => {
@@ -92,6 +96,7 @@ export {
92
96
  journeyManifestsKey,
93
97
  modeOptions,
94
98
  identityFields,
99
+ subscriptionEndpoint,
95
100
  fields,
96
101
  }
97
102
  /* No side effect */
@@ -275,3 +275,24 @@ describe("Util_ShellConfig.identityFields", () => {
275
275
  ])
276
276
  )
277
277
  })
278
+
279
+ describe("the subscription endpoint", () => {
280
+ // The one that matters: AppSync serves realtime on its own host, so a scheme
281
+ // swap alone yields a URL the service refuses to upgrade — and the shell's own
282
+ // fallback is exactly that scheme swap.
283
+ testSync("moves an AppSync endpoint onto the realtime host", () =>
284
+ expect(
285
+ Util_ShellConfig.subscriptionEndpoint(
286
+ "https://abc123.appsync-api.eu-west-1.amazonaws.com/graphql",
287
+ ),
288
+ )->toEqual("wss://abc123.appsync-realtime-api.eu-west-1.amazonaws.com/graphql")
289
+ )
290
+
291
+ // A server that speaks websockets on the host it serves queries from is left
292
+ // alone rather than rewritten toward a host that does not exist.
293
+ testSync("leaves a same-host endpoint on its own host", () =>
294
+ expect(Util_ShellConfig.subscriptionEndpoint("https://api.example.test/graphql"))->toEqual(
295
+ "wss://api.example.test/graphql",
296
+ )
297
+ )
298
+ })
@@ -294,6 +294,15 @@ globalThis.describe("Util_ShellConfig.identityFields", () => {
294
294
  });
295
295
  });
296
296
 
297
+ globalThis.describe("the subscription endpoint", () => {
298
+ globalThis.test("moves an AppSync endpoint onto the realtime host", () => {
299
+ globalThis.expect(Util_ShellConfig$ReventlessAws.subscriptionEndpoint("https://abc123.appsync-api.eu-west-1.amazonaws.com/graphql")).toEqual("wss://abc123.appsync-realtime-api.eu-west-1.amazonaws.com/graphql");
300
+ });
301
+ globalThis.test("leaves a same-host endpoint on its own host", () => {
302
+ globalThis.expect(Util_ShellConfig$ReventlessAws.subscriptionEndpoint("https://api.example.test/graphql")).toEqual("wss://api.example.test/graphql");
303
+ });
304
+ });
305
+
297
306
  export {
298
307
  computed,
299
308
  get,