@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.
- package/CHANGELOG.md +7 -0
- package/lib/bs/.compiler.log +2 -2
- package/lib/bs/compiler-info.json +1 -1
- package/lib/bs/src/ReventlessSeedAws.ast +0 -0
- package/lib/bs/src/ReventlessSeedAws.cmi +0 -0
- package/lib/bs/src/ReventlessSeedAws.cmj +0 -0
- package/lib/bs/src/ReventlessSeedAws.cmt +0 -0
- package/lib/bs/src/ReventlessSeedAws.res +3 -47
- package/lib/bs/src/ReventlessSeedAws.res.mjs +1 -30
- package/lib/bs/src/ReventlessSeedAws_Reset.cmi +0 -0
- package/lib/bs/src/ReventlessSeedAws_Reset.cmt +0 -0
- package/lib/bs/tests/EndpointResolutionTest.ast +0 -0
- package/lib/bs/tests/EndpointResolutionTest.cmi +0 -0
- package/lib/bs/tests/EndpointResolutionTest.cmj +0 -0
- package/lib/bs/tests/EndpointResolutionTest.cmt +0 -0
- package/lib/bs/tests/EndpointResolutionTest.res +12 -109
- package/lib/bs/tests/EndpointResolutionTest.res.mjs +4 -97
- package/lib/ocaml/.compiler.log +2 -2
- package/lib/ocaml/EndpointResolutionTest.ast +0 -0
- package/lib/ocaml/EndpointResolutionTest.cmi +0 -0
- package/lib/ocaml/EndpointResolutionTest.cmj +0 -0
- package/lib/ocaml/EndpointResolutionTest.cmt +0 -0
- package/lib/ocaml/EndpointResolutionTest.res +12 -109
- package/lib/ocaml/ReventlessSeedAws.ast +0 -0
- package/lib/ocaml/ReventlessSeedAws.cmi +0 -0
- package/lib/ocaml/ReventlessSeedAws.cmj +0 -0
- package/lib/ocaml/ReventlessSeedAws.cmt +0 -0
- package/lib/ocaml/ReventlessSeedAws.res +3 -47
- package/lib/ocaml/ReventlessSeedAws_Reset.cmi +0 -0
- package/lib/ocaml/ReventlessSeedAws_Reset.cmt +0 -0
- package/package.json +2 -2
- package/src/ReventlessSeedAws.res +3 -47
- package/src/ReventlessSeedAws.res.mjs +1 -30
- package/tests/EndpointResolutionTest.res +12 -109
- package/tests/EndpointResolutionTest.res.mjs +4 -97
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,13 @@
|
|
|
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.7 (2026-08-01)
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* **upload:** add the release half of the upload contract via the domain API ([448f887](https://github.com/ReventlessDev/reventless-core/commit/448f88714a5875be420f794a08d482fcf4ba8404))
|
|
11
|
+
|
|
12
|
+
|
|
6
13
|
# 1.0.0-alpha.6 (2026-07-31)
|
|
7
14
|
|
|
8
15
|
**Note:** Version bump only for package @reventlessdev/reventless-seed-aws
|
package/lib/bs/.compiler.log
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
#Start(
|
|
2
|
-
#Done(
|
|
1
|
+
#Start(1785603404469)
|
|
2
|
+
#Done(1785603404495)
|
|
@@ -4,5 +4,5 @@
|
|
|
4
4
|
"bsc_hash": "75e3a59c95cc953608fd3dd6ea6ed68141bba4414a20a52f114261b8a48385fa",
|
|
5
5
|
"rescript_config_hash": "c18a0067c363fd1290f6e7f6fe6212d2e16e201c1702fac667962047f88ed468",
|
|
6
6
|
"runtime_path": "/home/runner/work/reventless-core/reventless-core/node_modules/@rescript/runtime",
|
|
7
|
-
"generated_at": "
|
|
7
|
+
"generated_at": "1785603404501"
|
|
8
8
|
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -36,18 +36,6 @@ let asString = (json: JSON.t): option<string> =>
|
|
|
36
36
|
| _ => None
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
// Non-string members are dropped rather than failing the whole map: one
|
|
40
|
-
// malformed entry should not cost a run every endpoint it could have used.
|
|
41
|
-
let asStringDict = (json: JSON.t): dict<string> =>
|
|
42
|
-
switch json {
|
|
43
|
-
| Object(obj) =>
|
|
44
|
-
obj
|
|
45
|
-
->Dict.toArray
|
|
46
|
-
->Array.filterMap(((k, v)) => v->asString->Option.map(s => (k, s)))
|
|
47
|
-
->Dict.fromArray
|
|
48
|
-
| _ => Dict.make()
|
|
49
|
-
}
|
|
50
|
-
|
|
51
39
|
// ── Stack discovery ───────────────────────────────────────────────────────────
|
|
52
40
|
|
|
53
41
|
// Which Pulumi backend the `pulumi` subprocess reads from. When `backend` is
|
|
@@ -158,16 +146,6 @@ let resolveField = (~envKey: string, ~fromSource: option<string>, ~human: string
|
|
|
158
146
|
}
|
|
159
147
|
}
|
|
160
148
|
|
|
161
|
-
// Same precedence, for a value whose absence is a legitimate answer rather than
|
|
162
|
-
// a broken deployment: a stack that declares no store publishes no upload
|
|
163
|
-
// endpoint, and that must stay a no-op at the data set instead of failing the
|
|
164
|
-
// run before a single command is sent.
|
|
165
|
-
let optionalField = (~envKey: string, ~fromSource: option<string>): string =>
|
|
166
|
-
switch Seed.Prompt.envValue(envKey) {
|
|
167
|
-
| Some(v) => v
|
|
168
|
-
| None => fromSource->Option.getOr("")
|
|
169
|
-
}
|
|
170
|
-
|
|
171
149
|
// Which document publishes the deployment's endpoints. A stack that serves a
|
|
172
150
|
// host shell publishes them in the shell's `config.json` under the client's key
|
|
173
151
|
// names; one that does not publishes them as stack outputs under Pulumi's. The
|
|
@@ -177,11 +155,6 @@ type source = HostShellConfig(JSON.t) | StackOutputs(JSON.t)
|
|
|
177
155
|
|
|
178
156
|
type endpoints = {
|
|
179
157
|
graphql: string,
|
|
180
|
-
// The legacy single presign service; "" when the deployment publishes none.
|
|
181
|
-
uploadEndpoint: string,
|
|
182
|
-
// Qualified `{plugin}.{store}` → that store's presign endpoint. Empty when the
|
|
183
|
-
// deployment declares no store.
|
|
184
|
-
uploadEndpoints: dict<string>,
|
|
185
158
|
cognitoRegion: string,
|
|
186
159
|
cognitoClientId: string,
|
|
187
160
|
}
|
|
@@ -190,15 +163,9 @@ type endpoints = {
|
|
|
190
163
|
* The endpoints a source document publishes — pure, so the branch selection and
|
|
191
164
|
* every key it reads can be exercised with synthetic documents.
|
|
192
165
|
*
|
|
193
|
-
*
|
|
194
|
-
*
|
|
195
|
-
*
|
|
196
|
-
* stores and no host shell resolved "" and reported itself as serving no
|
|
197
|
-
* uploads.
|
|
198
|
-
*
|
|
199
|
-
* `REVENTLESS_UPLOAD_ENDPOINT` still overrides the singular endpoint and does
|
|
200
|
-
* not touch the map: one string cannot express a map, so it could only ever
|
|
201
|
-
* override one store and would need a naming convention to say which.
|
|
166
|
+
* Upload endpoints are no longer resolved here: under route B the seed mints through
|
|
167
|
+
* the domain API's `Upload_Presign` mutation on `graphql`, passing the store per asset,
|
|
168
|
+
* so there is no per-store URL to discover.
|
|
202
169
|
*/
|
|
203
170
|
let endpointsFrom = (~stack: string, source: source): endpoints =>
|
|
204
171
|
switch source {
|
|
@@ -210,11 +177,6 @@ let endpointsFrom = (~stack: string, source: source): endpoints =>
|
|
|
210
177
|
~fromSource=fromCfg("apiEndpoint"),
|
|
211
178
|
~human="apiEndpoint",
|
|
212
179
|
),
|
|
213
|
-
uploadEndpoint: optionalField(
|
|
214
|
-
~envKey="REVENTLESS_UPLOAD_ENDPOINT",
|
|
215
|
-
~fromSource=fromCfg("uploadEndpoint"),
|
|
216
|
-
),
|
|
217
|
-
uploadEndpoints: cfg->field("uploadEndpoints")->Option.mapOr(Dict.make(), asStringDict),
|
|
218
180
|
cognitoRegion: resolveField(
|
|
219
181
|
~envKey="AWS_REGION",
|
|
220
182
|
~fromSource=fromCfg("region"),
|
|
@@ -242,10 +204,6 @@ let endpointsFrom = (~stack: string, source: source): endpoints =>
|
|
|
242
204
|
),
|
|
243
205
|
)
|
|
244
206
|
},
|
|
245
|
-
// No stack output carries the legacy single service — it exists only in a
|
|
246
|
-
// host shell's config.json — so here the env override is its only source.
|
|
247
|
-
uploadEndpoint: optionalField(~envKey="REVENTLESS_UPLOAD_ENDPOINT", ~fromSource=None),
|
|
248
|
-
uploadEndpoints: outputs->field("uploadEndpoints")->Option.mapOr(Dict.make(), asStringDict),
|
|
249
207
|
cognitoRegion: resolveField(
|
|
250
208
|
~envKey="AWS_REGION",
|
|
251
209
|
~fromSource=out("cognitoRegion"),
|
|
@@ -365,8 +323,6 @@ let connect = (~projectDir: string=".", ~stack=?, ~backend=?, ()): (
|
|
|
365
323
|
await Seed.Connect.make(
|
|
366
324
|
~label=stackName,
|
|
367
325
|
~endpoint=eps.graphql,
|
|
368
|
-
~uploadEndpoint=eps.uploadEndpoint,
|
|
369
|
-
~uploadEndpoints=eps.uploadEndpoints,
|
|
370
326
|
~login=cognito(~region=eps.cognitoRegion, ~clientId=eps.cognitoClientId),
|
|
371
327
|
)
|
|
372
328
|
}
|
|
@@ -19,20 +19,6 @@ function asString(json) {
|
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
function asStringDict(json) {
|
|
23
|
-
if (typeof json === "object" && json !== null && !Array.isArray(json)) {
|
|
24
|
-
return Object.fromEntries(Stdlib_Array.filterMap(Object.entries(json), param => {
|
|
25
|
-
let k = param[0];
|
|
26
|
-
return Stdlib_Option.map(asString(param[1]), s => [
|
|
27
|
-
k,
|
|
28
|
-
s
|
|
29
|
-
]);
|
|
30
|
-
}));
|
|
31
|
-
} else {
|
|
32
|
-
return {};
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
22
|
function envForBackend(backend) {
|
|
37
23
|
if (backend === undefined) {
|
|
38
24
|
return;
|
|
@@ -166,23 +152,12 @@ function resolveField(envKey, fromSource, human) {
|
|
|
166
152
|
};
|
|
167
153
|
}
|
|
168
154
|
|
|
169
|
-
function optionalField(envKey, fromSource) {
|
|
170
|
-
let v = Seed_Prompt$ReventlessSeed.envValue(envKey);
|
|
171
|
-
if (v !== undefined) {
|
|
172
|
-
return v;
|
|
173
|
-
} else {
|
|
174
|
-
return Stdlib_Option.getOr(fromSource, "");
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
|
|
178
155
|
function endpointsFrom(stack, source) {
|
|
179
156
|
if (source.TAG === "HostShellConfig") {
|
|
180
157
|
let cfg = source._0;
|
|
181
158
|
let fromCfg = key => Stdlib_Option.flatMap(field(cfg, key), asString);
|
|
182
159
|
return {
|
|
183
160
|
graphql: resolveField("REVENTLESS_GRAPHQL_ENDPOINT", fromCfg("apiEndpoint"), "apiEndpoint"),
|
|
184
|
-
uploadEndpoint: optionalField("REVENTLESS_UPLOAD_ENDPOINT", fromCfg("uploadEndpoint")),
|
|
185
|
-
uploadEndpoints: Stdlib_Option.mapOr(field(cfg, "uploadEndpoints"), {}, asStringDict),
|
|
186
161
|
cognitoRegion: resolveField("AWS_REGION", fromCfg("region"), "region"),
|
|
187
162
|
cognitoClientId: resolveField("COGNITO_CLIENT_ID", fromCfg("cognitoClientId"), "cognitoClientId")
|
|
188
163
|
};
|
|
@@ -208,8 +183,6 @@ function endpointsFrom(stack, source) {
|
|
|
208
183
|
}
|
|
209
184
|
return {
|
|
210
185
|
graphql: tmp,
|
|
211
|
-
uploadEndpoint: optionalField("REVENTLESS_UPLOAD_ENDPOINT", undefined),
|
|
212
|
-
uploadEndpoints: Stdlib_Option.mapOr(field(outputs, "uploadEndpoints"), {}, asStringDict),
|
|
213
186
|
cognitoRegion: resolveField("AWS_REGION", out("cognitoRegion"), "cognitoRegion"),
|
|
214
187
|
cognitoClientId: resolveField("COGNITO_CLIENT_ID", out("cognitoUserPoolClientId"), "cognitoUserPoolClientId")
|
|
215
188
|
};
|
|
@@ -313,14 +286,13 @@ function connect($staropt$star, stack, backend, param) {
|
|
|
313
286
|
let backend$1 = url !== undefined ? url : backend;
|
|
314
287
|
let stackName = await resolveStack(projectDir, backend$1, stack);
|
|
315
288
|
let eps = await resolveEndpoints(projectDir, backend$1, stackName);
|
|
316
|
-
return await Seed_Connect$ReventlessSeed.make(stackName, eps.graphql,
|
|
289
|
+
return await Seed_Connect$ReventlessSeed.make(stackName, eps.graphql, cognito(eps.cognitoRegion, eps.cognitoClientId), undefined);
|
|
317
290
|
};
|
|
318
291
|
}
|
|
319
292
|
|
|
320
293
|
export {
|
|
321
294
|
field,
|
|
322
295
|
asString,
|
|
323
|
-
asStringDict,
|
|
324
296
|
envForBackend,
|
|
325
297
|
pulumi,
|
|
326
298
|
deployedStacks,
|
|
@@ -329,7 +301,6 @@ export {
|
|
|
329
301
|
resolveStack,
|
|
330
302
|
fetchConfig,
|
|
331
303
|
resolveField,
|
|
332
|
-
optionalField,
|
|
333
304
|
endpointsFrom,
|
|
334
305
|
resolveEndpoints,
|
|
335
306
|
cognito,
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1,25 +1,22 @@
|
|
|
1
|
-
// Which document `resolveEndpoints` reads, and
|
|
1
|
+
// Which document `resolveEndpoints` reads, and which GraphQL endpoint each arm takes
|
|
2
|
+
// from it.
|
|
2
3
|
//
|
|
3
4
|
// `endpointsFrom` is the pure half of `resolveEndpoints`; the impure half is a
|
|
4
|
-
// `pulumi stack output` subprocess and a `config.json` fetch, and the decision
|
|
5
|
-
//
|
|
6
|
-
//
|
|
7
|
-
//
|
|
8
|
-
//
|
|
9
|
-
// shell publishes no `hostShellUrl` by construction, so it takes that arm, and
|
|
10
|
-
// the per-store endpoint is its only way to reach the store.
|
|
5
|
+
// `pulumi stack output` subprocess and a `config.json` fetch, and the decision these
|
|
6
|
+
// tests pin is in neither. Upload endpoints are no longer resolved here — under route B
|
|
7
|
+
// the seed mints through the domain API's `Upload_Presign` mutation on the GraphQL
|
|
8
|
+
// endpoint below — so the only decision left is which GraphQL endpoint each source
|
|
9
|
+
// publishes, and the merged-over-per-plugin precedence within the stack-outputs arm.
|
|
11
10
|
|
|
12
11
|
open JestGlobals
|
|
13
12
|
open ReventlessSeed
|
|
14
13
|
|
|
15
|
-
|
|
16
14
|
// Every value read here has an env override, and an ambient one in the runner's
|
|
17
|
-
// environment (AWS_REGION is routinely set) would silently stand in for the
|
|
18
|
-
//
|
|
15
|
+
// environment (AWS_REGION is routinely set) would silently stand in for the document
|
|
16
|
+
// under test. An empty string reads as unset.
|
|
19
17
|
let clearOverrides = () =>
|
|
20
18
|
[
|
|
21
19
|
"REVENTLESS_GRAPHQL_ENDPOINT",
|
|
22
|
-
"REVENTLESS_UPLOAD_ENDPOINT",
|
|
23
20
|
"AWS_REGION",
|
|
24
21
|
"COGNITO_CLIENT_ID",
|
|
25
22
|
"SEED_SKIP_UPLOADS",
|
|
@@ -28,9 +25,6 @@ let clearOverrides = () =>
|
|
|
28
25
|
let obj = entries => JSON.Encode.object(entries->Dict.fromArray)
|
|
29
26
|
let str = JSON.Encode.string
|
|
30
27
|
|
|
31
|
-
// A host shell's config.json and the stack outputs of a platform that serves no
|
|
32
|
-
// shell — the two documents the two arms read, minus the upload keys each test
|
|
33
|
-
// supplies.
|
|
34
28
|
let config = (~extra: array<(string, JSON.t)>) =>
|
|
35
29
|
obj(
|
|
36
30
|
Array.concat(
|
|
@@ -55,84 +49,18 @@ let outputs = (~extra: array<(string, JSON.t)>) =>
|
|
|
55
49
|
),
|
|
56
50
|
)
|
|
57
51
|
|
|
58
|
-
let storeEndpoints = obj([("Catalog.productImages", str("https://presign.example/"))])
|
|
59
|
-
|
|
60
52
|
describe("endpointsFrom — host shell arm", () => {
|
|
61
53
|
beforeEach(clearOverrides)
|
|
62
54
|
|
|
63
|
-
testSync("reads the
|
|
64
|
-
let eps = ReventlessSeedAws.endpointsFrom(
|
|
65
|
-
|
|
66
|
-
HostShellConfig(
|
|
67
|
-
config(
|
|
68
|
-
~extra=[
|
|
69
|
-
("uploadEndpoint", str("https://legacy.example/")),
|
|
70
|
-
("uploadEndpoints", storeEndpoints),
|
|
71
|
-
],
|
|
72
|
-
),
|
|
73
|
-
),
|
|
74
|
-
)
|
|
75
|
-
expect(eps.uploadEndpoint)->toBe("https://legacy.example/")
|
|
76
|
-
expect(eps.uploadEndpoints)->toEqual(
|
|
77
|
-
Dict.fromArray([("Catalog.productImages", "https://presign.example/")]),
|
|
78
|
-
)
|
|
79
|
-
})
|
|
80
|
-
|
|
81
|
-
// A shell fronting only declared stores writes no singular key. That used to
|
|
82
|
-
// fail the whole run before a command was sent ("deployment is missing
|
|
83
|
-
// uploadEndpoint"), which is a harder failure than the one this plan fixes.
|
|
84
|
-
testSync("a shell publishing only per-store endpoints resolves an empty legacy service", () => {
|
|
85
|
-
let eps = ReventlessSeedAws.endpointsFrom(
|
|
86
|
-
~stack="alpha",
|
|
87
|
-
HostShellConfig(config(~extra=[("uploadEndpoints", storeEndpoints)])),
|
|
88
|
-
)
|
|
89
|
-
expect(eps.uploadEndpoint)->toBe("")
|
|
90
|
-
expect(eps.uploadEndpoints->Dict.keysToArray)->toEqual(["Catalog.productImages"])
|
|
91
|
-
})
|
|
92
|
-
|
|
93
|
-
testSync("REVENTLESS_UPLOAD_ENDPOINT overrides the legacy service and leaves the map alone", () => {
|
|
94
|
-
NodeProcess.env->Dict.set("REVENTLESS_UPLOAD_ENDPOINT", "https://override.example/")
|
|
95
|
-
let eps = ReventlessSeedAws.endpointsFrom(
|
|
96
|
-
~stack="alpha",
|
|
97
|
-
HostShellConfig(
|
|
98
|
-
config(
|
|
99
|
-
~extra=[
|
|
100
|
-
("uploadEndpoint", str("https://legacy.example/")),
|
|
101
|
-
("uploadEndpoints", storeEndpoints),
|
|
102
|
-
],
|
|
103
|
-
),
|
|
104
|
-
),
|
|
105
|
-
)
|
|
106
|
-
expect(eps.uploadEndpoint)->toBe("https://override.example/")
|
|
107
|
-
expect(eps.uploadEndpoints->Dict.get("Catalog.productImages"))->toEqual(
|
|
108
|
-
Some("https://presign.example/"),
|
|
109
|
-
)
|
|
55
|
+
testSync("reads the GraphQL endpoint from the shell config", () => {
|
|
56
|
+
let eps = ReventlessSeedAws.endpointsFrom(~stack="alpha", HostShellConfig(config(~extra=[])))
|
|
57
|
+
expect(eps.graphql)->toBe("https://api.example/graphql")
|
|
110
58
|
})
|
|
111
59
|
})
|
|
112
60
|
|
|
113
61
|
describe("endpointsFrom — stack outputs arm", () => {
|
|
114
62
|
beforeEach(clearOverrides)
|
|
115
63
|
|
|
116
|
-
// The lookup that was missing entirely: this arm had no upload source but the
|
|
117
|
-
// env var, so a `PlatformOwned` deployment resolved "" whatever it published.
|
|
118
|
-
testSync("reads the uploadEndpoints stack output", () => {
|
|
119
|
-
let eps = ReventlessSeedAws.endpointsFrom(
|
|
120
|
-
~stack="pr-verify",
|
|
121
|
-
StackOutputs(outputs(~extra=[("uploadEndpoints", storeEndpoints)])),
|
|
122
|
-
)
|
|
123
|
-
expect(eps.uploadEndpoints)->toEqual(
|
|
124
|
-
Dict.fromArray([("Catalog.productImages", "https://presign.example/")]),
|
|
125
|
-
)
|
|
126
|
-
})
|
|
127
|
-
|
|
128
|
-
// Declaring no store is a legitimate deployment, not a broken one — it stays a
|
|
129
|
-
// no-op at the data set rather than failing the run.
|
|
130
|
-
testSync("a deployment declaring no store resolves an empty map without failing", () => {
|
|
131
|
-
let eps = ReventlessSeedAws.endpointsFrom(~stack="pr-verify", StackOutputs(outputs(~extra=[])))
|
|
132
|
-
expect(eps.uploadEndpoint)->toBe("")
|
|
133
|
-
expect(eps.uploadEndpoints->Dict.keysToArray)->toEqual([])
|
|
134
|
-
})
|
|
135
|
-
|
|
136
64
|
testSync("prefers the merged API endpoint over the per-plugin one", () => {
|
|
137
65
|
let eps = ReventlessSeedAws.endpointsFrom(
|
|
138
66
|
~stack="pr-verify",
|
|
@@ -153,28 +81,3 @@ describe("endpointsFrom — stack outputs arm", () => {
|
|
|
153
81
|
}
|
|
154
82
|
)
|
|
155
83
|
})
|
|
156
|
-
|
|
157
|
-
describe("endpointsFrom — malformed uploadEndpoints", () => {
|
|
158
|
-
beforeEach(clearOverrides)
|
|
159
|
-
|
|
160
|
-
// One bad member should not cost the run every endpoint it could have used.
|
|
161
|
-
testSync("drops a non-string member rather than the whole map", () => {
|
|
162
|
-
let eps = ReventlessSeedAws.endpointsFrom(
|
|
163
|
-
~stack="pr-verify",
|
|
164
|
-
StackOutputs(
|
|
165
|
-
outputs(
|
|
166
|
-
~extra=[
|
|
167
|
-
(
|
|
168
|
-
"uploadEndpoints",
|
|
169
|
-
obj([
|
|
170
|
-
("Catalog.productImages", str("https://presign.example/")),
|
|
171
|
-
("Catalog.broken", JSON.Encode.int(7)),
|
|
172
|
-
]),
|
|
173
|
-
),
|
|
174
|
-
],
|
|
175
|
-
),
|
|
176
|
-
),
|
|
177
|
-
)
|
|
178
|
-
expect(eps.uploadEndpoints->Dict.keysToArray)->toEqual(["Catalog.productImages"])
|
|
179
|
-
})
|
|
180
|
-
})
|
|
@@ -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
|
|
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.
|
|
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
|
-
/*
|
|
115
|
+
/* Not a pure module */
|
package/lib/ocaml/.compiler.log
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
#Start(
|
|
2
|
-
#Done(
|
|
1
|
+
#Start(1785603404469)
|
|
2
|
+
#Done(1785603404495)
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|