@reventlessdev/reventless-seed-aws 1.0.0-alpha.6 → 1.0.0-alpha.7

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.
Files changed (35) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/lib/bs/.compiler.log +2 -2
  3. package/lib/bs/compiler-info.json +1 -1
  4. package/lib/bs/src/ReventlessSeedAws.ast +0 -0
  5. package/lib/bs/src/ReventlessSeedAws.cmi +0 -0
  6. package/lib/bs/src/ReventlessSeedAws.cmj +0 -0
  7. package/lib/bs/src/ReventlessSeedAws.cmt +0 -0
  8. package/lib/bs/src/ReventlessSeedAws.res +3 -47
  9. package/lib/bs/src/ReventlessSeedAws.res.mjs +1 -30
  10. package/lib/bs/src/ReventlessSeedAws_Reset.cmi +0 -0
  11. package/lib/bs/src/ReventlessSeedAws_Reset.cmt +0 -0
  12. package/lib/bs/tests/EndpointResolutionTest.ast +0 -0
  13. package/lib/bs/tests/EndpointResolutionTest.cmi +0 -0
  14. package/lib/bs/tests/EndpointResolutionTest.cmj +0 -0
  15. package/lib/bs/tests/EndpointResolutionTest.cmt +0 -0
  16. package/lib/bs/tests/EndpointResolutionTest.res +12 -109
  17. package/lib/bs/tests/EndpointResolutionTest.res.mjs +4 -97
  18. package/lib/ocaml/.compiler.log +2 -2
  19. package/lib/ocaml/EndpointResolutionTest.ast +0 -0
  20. package/lib/ocaml/EndpointResolutionTest.cmi +0 -0
  21. package/lib/ocaml/EndpointResolutionTest.cmj +0 -0
  22. package/lib/ocaml/EndpointResolutionTest.cmt +0 -0
  23. package/lib/ocaml/EndpointResolutionTest.res +12 -109
  24. package/lib/ocaml/ReventlessSeedAws.ast +0 -0
  25. package/lib/ocaml/ReventlessSeedAws.cmi +0 -0
  26. package/lib/ocaml/ReventlessSeedAws.cmj +0 -0
  27. package/lib/ocaml/ReventlessSeedAws.cmt +0 -0
  28. package/lib/ocaml/ReventlessSeedAws.res +3 -47
  29. package/lib/ocaml/ReventlessSeedAws_Reset.cmi +0 -0
  30. package/lib/ocaml/ReventlessSeedAws_Reset.cmt +0 -0
  31. package/package.json +2 -2
  32. package/src/ReventlessSeedAws.res +3 -47
  33. package/src/ReventlessSeedAws.res.mjs +1 -30
  34. package/tests/EndpointResolutionTest.res +12 -109
  35. package/tests/EndpointResolutionTest.res.mjs +4 -97
@@ -8,7 +8,6 @@ import * as Primitive_exceptions from "@rescript/runtime/lib/es6/Primitive_excep
8
8
  function clearOverrides() {
9
9
  [
10
10
  "REVENTLESS_GRAPHQL_ENDPOINT",
11
- "REVENTLESS_UPLOAD_ENDPOINT",
12
11
  "AWS_REGION",
13
12
  "COGNITO_CLIENT_ID",
14
13
  "SEED_SKIP_UPLOADS"
@@ -59,87 +58,19 @@ function outputs(extra) {
59
58
  ].concat(extra));
60
59
  }
61
60
 
62
- let storeEndpoints = Object.fromEntries([[
63
- "Catalog.productImages",
64
- "https://presign.example/"
65
- ]]);
66
-
67
61
  globalThis.describe("endpointsFrom — host shell arm", () => {
68
62
  globalThis.beforeEach(clearOverrides);
69
- globalThis.test("reads the legacy single service and the per-store map together", () => {
70
- let eps = ReventlessSeedAws.endpointsFrom("alpha", {
71
- TAG: "HostShellConfig",
72
- _0: config([
73
- [
74
- "uploadEndpoint",
75
- "https://legacy.example/"
76
- ],
77
- [
78
- "uploadEndpoints",
79
- storeEndpoints
80
- ]
81
- ])
82
- });
83
- globalThis.expect(eps.uploadEndpoint).toBe("https://legacy.example/");
84
- globalThis.expect(eps.uploadEndpoints).toEqual(Object.fromEntries([[
85
- "Catalog.productImages",
86
- "https://presign.example/"
87
- ]]));
88
- });
89
- globalThis.test("a shell publishing only per-store endpoints resolves an empty legacy service", () => {
63
+ globalThis.test("reads the GraphQL endpoint from the shell config", () => {
90
64
  let eps = ReventlessSeedAws.endpointsFrom("alpha", {
91
65
  TAG: "HostShellConfig",
92
- _0: config([[
93
- "uploadEndpoints",
94
- storeEndpoints
95
- ]])
66
+ _0: config([])
96
67
  });
97
- globalThis.expect(eps.uploadEndpoint).toBe("");
98
- globalThis.expect(Object.keys(eps.uploadEndpoints)).toEqual(["Catalog.productImages"]);
99
- });
100
- globalThis.test("REVENTLESS_UPLOAD_ENDPOINT overrides the legacy service and leaves the map alone", () => {
101
- process.env["REVENTLESS_UPLOAD_ENDPOINT"] = "https://override.example/";
102
- let eps = ReventlessSeedAws.endpointsFrom("alpha", {
103
- TAG: "HostShellConfig",
104
- _0: config([
105
- [
106
- "uploadEndpoint",
107
- "https://legacy.example/"
108
- ],
109
- [
110
- "uploadEndpoints",
111
- storeEndpoints
112
- ]
113
- ])
114
- });
115
- globalThis.expect(eps.uploadEndpoint).toBe("https://override.example/");
116
- globalThis.expect(eps.uploadEndpoints["Catalog.productImages"]).toEqual("https://presign.example/");
68
+ globalThis.expect(eps.graphql).toBe("https://api.example/graphql");
117
69
  });
118
70
  });
119
71
 
120
72
  globalThis.describe("endpointsFrom — stack outputs arm", () => {
121
73
  globalThis.beforeEach(clearOverrides);
122
- globalThis.test("reads the uploadEndpoints stack output", () => {
123
- let eps = ReventlessSeedAws.endpointsFrom("pr-verify", {
124
- TAG: "StackOutputs",
125
- _0: outputs([[
126
- "uploadEndpoints",
127
- storeEndpoints
128
- ]])
129
- });
130
- globalThis.expect(eps.uploadEndpoints).toEqual(Object.fromEntries([[
131
- "Catalog.productImages",
132
- "https://presign.example/"
133
- ]]));
134
- });
135
- globalThis.test("a deployment declaring no store resolves an empty map without failing", () => {
136
- let eps = ReventlessSeedAws.endpointsFrom("pr-verify", {
137
- TAG: "StackOutputs",
138
- _0: outputs([])
139
- });
140
- globalThis.expect(eps.uploadEndpoint).toBe("");
141
- globalThis.expect(Object.keys(eps.uploadEndpoints)).toEqual([]);
142
- });
143
74
  globalThis.test("prefers the merged API endpoint over the per-plugin one", () => {
144
75
  let eps = ReventlessSeedAws.endpointsFrom("pr-verify", {
145
76
  TAG: "StackOutputs",
@@ -174,35 +105,11 @@ globalThis.describe("endpointsFrom — stack outputs arm", () => {
174
105
  });
175
106
  });
176
107
 
177
- globalThis.describe("endpointsFrom — malformed uploadEndpoints", () => {
178
- globalThis.beforeEach(clearOverrides);
179
- globalThis.test("drops a non-string member rather than the whole map", () => {
180
- let eps = ReventlessSeedAws.endpointsFrom("pr-verify", {
181
- TAG: "StackOutputs",
182
- _0: outputs([[
183
- "uploadEndpoints",
184
- Object.fromEntries([
185
- [
186
- "Catalog.productImages",
187
- "https://presign.example/"
188
- ],
189
- [
190
- "Catalog.broken",
191
- 7
192
- ]
193
- ])
194
- ]])
195
- });
196
- globalThis.expect(Object.keys(eps.uploadEndpoints)).toEqual(["Catalog.productImages"]);
197
- });
198
- });
199
-
200
108
  export {
201
109
  clearOverrides,
202
110
  obj,
203
111
  str,
204
112
  config,
205
113
  outputs,
206
- storeEndpoints,
207
114
  }
208
- /* storeEndpoints Not a pure module */
115
+ /* Not a pure module */