@reventlessdev/reventless-seed-aws 1.0.0-alpha.2 → 1.0.0-alpha.21
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 +146 -0
- package/lib/bs/.compiler.log +2 -2
- package/lib/bs/.sourcedirs.json +1 -0
- package/lib/bs/compiler-info.json +2 -2
- 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 +87 -75
- package/lib/bs/src/ReventlessSeedAws.res.mjs +34 -30
- package/lib/bs/src/ReventlessSeedAws_Quiesce.ast +0 -0
- package/lib/bs/src/ReventlessSeedAws_Quiesce.cmi +0 -0
- package/lib/bs/src/ReventlessSeedAws_Quiesce.cmj +0 -0
- package/lib/bs/src/ReventlessSeedAws_Quiesce.cmt +0 -0
- package/lib/bs/src/ReventlessSeedAws_Quiesce.res +287 -0
- package/lib/bs/src/ReventlessSeedAws_Quiesce.res.mjs +205 -0
- package/lib/bs/src/ReventlessSeedAws_Reconcile.ast +0 -0
- package/lib/bs/src/ReventlessSeedAws_Reconcile.cmi +0 -0
- package/lib/bs/src/ReventlessSeedAws_Reconcile.cmj +0 -0
- package/lib/bs/src/ReventlessSeedAws_Reconcile.cmt +0 -0
- package/lib/bs/src/ReventlessSeedAws_Reconcile.res +385 -0
- package/lib/bs/src/ReventlessSeedAws_Reconcile.res.mjs +318 -0
- package/lib/bs/src/ReventlessSeedAws_Reset.ast +0 -0
- package/lib/bs/src/ReventlessSeedAws_Reset.cmi +0 -0
- package/lib/bs/src/ReventlessSeedAws_Reset.cmj +0 -0
- package/lib/bs/src/ReventlessSeedAws_Reset.cmt +0 -0
- package/lib/bs/src/ReventlessSeedAws_Reset.res +1098 -0
- package/lib/bs/src/ReventlessSeedAws_Reset.res.mjs +991 -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 +83 -0
- package/lib/bs/tests/EndpointResolutionTest.res.mjs +115 -0
- package/lib/bs/tests/ObjectStoreReconcileTest.ast +0 -0
- package/lib/bs/tests/ObjectStoreReconcileTest.cmi +0 -0
- package/lib/bs/tests/ObjectStoreReconcileTest.cmj +0 -0
- package/lib/bs/tests/ObjectStoreReconcileTest.cmt +0 -0
- package/lib/bs/tests/ObjectStoreReconcileTest.res +84 -0
- package/lib/bs/tests/ObjectStoreReconcileTest.res.mjs +102 -0
- package/lib/bs/tests/ObjectStoreResetTest.ast +0 -0
- package/lib/bs/tests/ObjectStoreResetTest.cmi +0 -0
- package/lib/bs/tests/ObjectStoreResetTest.cmj +0 -0
- package/lib/bs/tests/ObjectStoreResetTest.cmt +0 -0
- package/lib/bs/tests/ObjectStoreResetTest.res +170 -0
- package/lib/bs/tests/ObjectStoreResetTest.res.mjs +211 -0
- package/lib/bs/tests/QuiesceResetTest.ast +0 -0
- package/lib/bs/tests/QuiesceResetTest.cmi +0 -0
- package/lib/bs/tests/QuiesceResetTest.cmj +0 -0
- package/lib/bs/tests/QuiesceResetTest.cmt +0 -0
- package/lib/bs/tests/QuiesceResetTest.res +133 -0
- package/lib/bs/tests/QuiesceResetTest.res.mjs +141 -0
- 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 +83 -0
- package/lib/ocaml/ObjectStoreReconcileTest.ast +0 -0
- package/lib/ocaml/ObjectStoreReconcileTest.cmi +0 -0
- package/lib/ocaml/ObjectStoreReconcileTest.cmj +0 -0
- package/lib/ocaml/ObjectStoreReconcileTest.cmt +0 -0
- package/lib/ocaml/ObjectStoreReconcileTest.res +84 -0
- package/lib/ocaml/ObjectStoreResetTest.ast +0 -0
- package/lib/ocaml/ObjectStoreResetTest.cmi +0 -0
- package/lib/ocaml/ObjectStoreResetTest.cmj +0 -0
- package/lib/ocaml/ObjectStoreResetTest.cmt +0 -0
- package/lib/ocaml/ObjectStoreResetTest.res +170 -0
- package/lib/ocaml/QuiesceResetTest.ast +0 -0
- package/lib/ocaml/QuiesceResetTest.cmi +0 -0
- package/lib/ocaml/QuiesceResetTest.cmj +0 -0
- package/lib/ocaml/QuiesceResetTest.cmt +0 -0
- package/lib/ocaml/QuiesceResetTest.res +133 -0
- 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 +87 -75
- package/lib/ocaml/ReventlessSeedAws_Quiesce.ast +0 -0
- package/lib/ocaml/ReventlessSeedAws_Quiesce.cmi +0 -0
- package/lib/ocaml/ReventlessSeedAws_Quiesce.cmj +0 -0
- package/lib/ocaml/ReventlessSeedAws_Quiesce.cmt +0 -0
- package/lib/ocaml/ReventlessSeedAws_Quiesce.res +287 -0
- package/lib/ocaml/ReventlessSeedAws_Reconcile.ast +0 -0
- package/lib/ocaml/ReventlessSeedAws_Reconcile.cmi +0 -0
- package/lib/ocaml/ReventlessSeedAws_Reconcile.cmj +0 -0
- package/lib/ocaml/ReventlessSeedAws_Reconcile.cmt +0 -0
- package/lib/ocaml/ReventlessSeedAws_Reconcile.res +385 -0
- package/lib/ocaml/ReventlessSeedAws_Reset.ast +0 -0
- package/lib/ocaml/ReventlessSeedAws_Reset.cmi +0 -0
- package/lib/ocaml/ReventlessSeedAws_Reset.cmj +0 -0
- package/lib/ocaml/ReventlessSeedAws_Reset.cmt +0 -0
- package/lib/ocaml/ReventlessSeedAws_Reset.res +1098 -0
- package/package.json +7 -4
- package/rescript.json +9 -1
- package/src/ReventlessSeedAws.res +87 -75
- package/src/ReventlessSeedAws.res.mjs +34 -30
- package/src/ReventlessSeedAws_Quiesce.res +287 -0
- package/src/ReventlessSeedAws_Quiesce.res.mjs +205 -0
- package/src/ReventlessSeedAws_Reconcile.res +385 -0
- package/src/ReventlessSeedAws_Reconcile.res.mjs +318 -0
- package/src/ReventlessSeedAws_Reset.res +1098 -0
- package/src/ReventlessSeedAws_Reset.res.mjs +991 -0
- package/tests/EndpointResolutionTest.res +83 -0
- package/tests/EndpointResolutionTest.res.mjs +115 -0
- package/tests/ObjectStoreReconcileTest.res +84 -0
- package/tests/ObjectStoreReconcileTest.res.mjs +102 -0
- package/tests/ObjectStoreResetTest.res +170 -0
- package/tests/ObjectStoreResetTest.res.mjs +211 -0
- package/tests/QuiesceResetTest.res +133 -0
- package/tests/QuiesceResetTest.res.mjs +141 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,152 @@
|
|
|
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.21 (2026-08-16)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @reventlessdev/reventless-seed-aws
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# 1.0.0-alpha.20 (2026-08-16)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @reventlessdev/reventless-seed-aws
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
# 1.0.0-alpha.19 (2026-08-15)
|
|
23
|
+
|
|
24
|
+
**Note:** Version bump only for package @reventlessdev/reventless-seed-aws
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
# 1.0.0-alpha.18 (2026-08-14)
|
|
31
|
+
|
|
32
|
+
**Note:** Version bump only for package @reventlessdev/reventless-seed-aws
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
# 1.0.0-alpha.17 (2026-08-13)
|
|
39
|
+
|
|
40
|
+
**Note:** Version bump only for package @reventlessdev/reventless-seed-aws
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
# 1.0.0-alpha.16 (2026-08-13)
|
|
47
|
+
|
|
48
|
+
**Note:** Version bump only for package @reventlessdev/reventless-seed-aws
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
# 1.0.0-alpha.15 (2026-08-11)
|
|
55
|
+
|
|
56
|
+
**Note:** Version bump only for package @reventlessdev/reventless-seed-aws
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
# 1.0.0-alpha.14 (2026-08-09)
|
|
63
|
+
|
|
64
|
+
**Note:** Version bump only for package @reventlessdev/reventless-seed-aws
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
# 1.0.0-alpha.13 (2026-08-09)
|
|
71
|
+
|
|
72
|
+
### Bug Fixes
|
|
73
|
+
|
|
74
|
+
* **seed-aws:** hold and recycle a stack's runtimes so a reset stays empty ([4baaa38](https://github.com/ReventlessDev/reventless-core/commit/4baaa3827ef30a0adccdef5d2bccc688e7b6686f))
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
# 1.0.0-alpha.12 (2026-08-05)
|
|
78
|
+
|
|
79
|
+
**Note:** Version bump only for package @reventlessdev/reventless-seed-aws
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
# 1.0.0-alpha.11 (2026-08-03)
|
|
86
|
+
|
|
87
|
+
**Note:** Version bump only for package @reventlessdev/reventless-seed-aws
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
# 1.0.0-alpha.10 (2026-08-02)
|
|
94
|
+
|
|
95
|
+
**Note:** Version bump only for package @reventlessdev/reventless-seed-aws
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
# 1.0.0-alpha.9 (2026-08-02)
|
|
102
|
+
|
|
103
|
+
### Features
|
|
104
|
+
|
|
105
|
+
* **aws,core,spec,seed-aws:** expire uploads nobody committed a reference to ([f63e84c](https://github.com/ReventlessDev/reventless-core/commit/f63e84c1a11cc350b799a6f69a2e7427cf1ea6e9))
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
# 1.0.0-alpha.8 (2026-08-01)
|
|
109
|
+
|
|
110
|
+
### Features
|
|
111
|
+
|
|
112
|
+
* **seed-aws:** wipe a plugin's declared object stores in seed:reset ([2280c5f](https://github.com/ReventlessDev/reventless-core/commit/2280c5f14755d13fff0fe1ac11eb440cd0617f1d))
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
# 1.0.0-alpha.7 (2026-08-01)
|
|
116
|
+
|
|
117
|
+
### Features
|
|
118
|
+
|
|
119
|
+
* **upload:** add the release half of the upload contract via the domain API ([448f887](https://github.com/ReventlessDev/reventless-core/commit/448f88714a5875be420f794a08d482fcf4ba8404))
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
# 1.0.0-alpha.6 (2026-07-31)
|
|
123
|
+
|
|
124
|
+
**Note:** Version bump only for package @reventlessdev/reventless-seed-aws
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
# 1.0.0-alpha.5 (2026-07-31)
|
|
131
|
+
|
|
132
|
+
### Bug Fixes
|
|
133
|
+
|
|
134
|
+
* **seed:** address a deployment's per-store upload endpoints ([45b226e](https://github.com/ReventlessDev/reventless-core/commit/45b226e00604af9fd28b6fb0b75ba7d3414791f2))
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
# 1.0.0-alpha.4 (2026-07-27)
|
|
138
|
+
|
|
139
|
+
### Features
|
|
140
|
+
|
|
141
|
+
* **seed:** guarded AWS store reset (seed:reset) with per-project scope selection ([8446172](https://github.com/ReventlessDev/reventless-core/commit/8446172cbb53776a58f53220d19e96d96ce94508))
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
# 1.0.0-alpha.3 (2026-07-27)
|
|
145
|
+
|
|
146
|
+
**Note:** Version bump only for package @reventlessdev/reventless-seed-aws
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
|
|
6
152
|
# 1.0.0-alpha.2 (2026-07-26)
|
|
7
153
|
|
|
8
154
|
### Features
|
package/lib/bs/.compiler.log
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
#Start(
|
|
2
|
-
#Done(
|
|
1
|
+
#Start(1786902417155)
|
|
2
|
+
#Done(1786902417196)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"cmt_scan":[{"also_scan_build_root":true,"build_root":"lib/bs","scan_dirs":["src","tests"]}],"dirs":["src","tests"],"generated":[],"pkgs":[["@reventlessdev/rescript-aws-sdk","/home/runner/work/reventless-core/reventless-core/rescript/aws-sdk"],["@reventlessdev/rescript-jest","/home/runner/work/reventless-core/reventless-core/rescript/jest"],["@reventlessdev/rescript-node","/home/runner/work/reventless-core/reventless-core/rescript/node"],["@reventlessdev/reventless-seed","/home/runner/work/reventless-core/reventless-core/reventless/seed"]],"version":2}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"version": "12.3.0",
|
|
3
3
|
"bsc_path": "/home/runner/work/reventless-core/reventless-core/node_modules/@rescript/linux-x64/bin/bsc.exe",
|
|
4
4
|
"bsc_hash": "75e3a59c95cc953608fd3dd6ea6ed68141bba4414a20a52f114261b8a48385fa",
|
|
5
|
-
"rescript_config_hash": "
|
|
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": "1786902417201"
|
|
8
8
|
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -14,11 +14,6 @@ open ReventlessSeed
|
|
|
14
14
|
|
|
15
15
|
// ── Node bindings ─────────────────────────────────────────────────────────────
|
|
16
16
|
|
|
17
|
-
@val @scope("process") external processEnv: dict<string> = "env"
|
|
18
|
-
|
|
19
|
-
type execOptions = {cwd: string, encoding: string, env?: dict<string>}
|
|
20
|
-
@module("node:child_process")
|
|
21
|
-
external execFileSync: (string, array<string>, execOptions) => string = "execFileSync"
|
|
22
17
|
|
|
23
18
|
type fetchInit = {method: string, headers: dict<string>, body?: string}
|
|
24
19
|
type response
|
|
@@ -53,13 +48,17 @@ let envForBackend = (backend: option<string>): option<dict<string>> =>
|
|
|
53
48
|
switch backend {
|
|
54
49
|
| None => None
|
|
55
50
|
| Some(url) =>
|
|
56
|
-
let copy =
|
|
51
|
+
let copy = NodeProcess.env->Dict.toArray->Dict.fromArray
|
|
57
52
|
copy->Dict.set("PULUMI_BACKEND_URL", url)
|
|
58
53
|
Some(copy)
|
|
59
54
|
}
|
|
60
55
|
|
|
61
56
|
let pulumi = (~projectDir: string, ~backend: option<string>, args: array<string>): string =>
|
|
62
|
-
execFileSync(
|
|
57
|
+
NodeChildProcess.execFileSync(
|
|
58
|
+
"pulumi",
|
|
59
|
+
args,
|
|
60
|
+
{cwd: projectDir, encoding: "utf8", env: ?envForBackend(backend)},
|
|
61
|
+
)
|
|
63
62
|
|
|
64
63
|
// Stacks that actually exist in the Pulumi backend for this project — the names
|
|
65
64
|
// `pulumi stack output --stack <name>` accepts. A `Pulumi.<stack>.yaml` config
|
|
@@ -147,70 +146,88 @@ let resolveField = (~envKey: string, ~fromSource: option<string>, ~human: string
|
|
|
147
146
|
}
|
|
148
147
|
}
|
|
149
148
|
|
|
150
|
-
//
|
|
151
|
-
//
|
|
152
|
-
//
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
149
|
+
// Which document publishes the deployment's endpoints. A stack that serves a
|
|
150
|
+
// host shell publishes them in the shell's `config.json` under the client's key
|
|
151
|
+
// names; one that does not publishes them as stack outputs under Pulumi's. The
|
|
152
|
+
// two arms name different keys for the same values, which is why this is a
|
|
153
|
+
// variant and not a merged lookup.
|
|
154
|
+
type source = HostShellConfig(JSON.t) | StackOutputs(JSON.t)
|
|
155
|
+
|
|
156
|
+
type endpoints = {
|
|
157
|
+
graphql: string,
|
|
158
|
+
cognitoRegion: string,
|
|
159
|
+
cognitoClientId: string,
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* The endpoints a source document publishes — pure, so the branch selection and
|
|
164
|
+
* every key it reads can be exercised with synthetic documents.
|
|
165
|
+
*
|
|
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.
|
|
169
|
+
*/
|
|
170
|
+
let endpointsFrom = (~stack: string, source: source): endpoints =>
|
|
171
|
+
switch source {
|
|
172
|
+
| HostShellConfig(cfg) =>
|
|
163
173
|
let fromCfg = key => cfg->field(key)->Option.flatMap(asString)
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
~human="cognitoClientId",
|
|
183
|
-
)
|
|
184
|
-
(endpoint, uploadEndpoint, region, clientId)
|
|
185
|
-
| None =>
|
|
174
|
+
{
|
|
175
|
+
graphql: resolveField(
|
|
176
|
+
~envKey="REVENTLESS_GRAPHQL_ENDPOINT",
|
|
177
|
+
~fromSource=fromCfg("apiEndpoint"),
|
|
178
|
+
~human="apiEndpoint",
|
|
179
|
+
),
|
|
180
|
+
cognitoRegion: resolveField(
|
|
181
|
+
~envKey="AWS_REGION",
|
|
182
|
+
~fromSource=fromCfg("region"),
|
|
183
|
+
~human="region",
|
|
184
|
+
),
|
|
185
|
+
cognitoClientId: resolveField(
|
|
186
|
+
~envKey="COGNITO_CLIENT_ID",
|
|
187
|
+
~fromSource=fromCfg("cognitoClientId"),
|
|
188
|
+
~human="cognitoClientId",
|
|
189
|
+
),
|
|
190
|
+
}
|
|
191
|
+
| StackOutputs(outputs) =>
|
|
186
192
|
let out = key => outputs->field(key)->Option.flatMap(asString)
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
193
|
+
{
|
|
194
|
+
graphql: switch (
|
|
195
|
+
Seed.Prompt.envValue("REVENTLESS_GRAPHQL_ENDPOINT"),
|
|
196
|
+
out("domainMergedApiEndpoint"),
|
|
197
|
+
out("domainApiEndpoint"),
|
|
198
|
+
) {
|
|
199
|
+
| (Some(v), _, _) | (_, Some(v), _) | (_, _, Some(v)) => v
|
|
200
|
+
| _ =>
|
|
201
|
+
throw(
|
|
202
|
+
Seed.Failed(
|
|
203
|
+
`stack "${stack}" exports neither domainMergedApiEndpoint nor domainApiEndpoint`,
|
|
204
|
+
),
|
|
205
|
+
)
|
|
206
|
+
},
|
|
207
|
+
cognitoRegion: resolveField(
|
|
208
|
+
~envKey="AWS_REGION",
|
|
209
|
+
~fromSource=out("cognitoRegion"),
|
|
210
|
+
~human="cognitoRegion",
|
|
211
|
+
),
|
|
212
|
+
cognitoClientId: resolveField(
|
|
213
|
+
~envKey="COGNITO_CLIENT_ID",
|
|
214
|
+
~fromSource=out("cognitoUserPoolClientId"),
|
|
215
|
+
~human="cognitoUserPoolClientId",
|
|
216
|
+
),
|
|
199
217
|
}
|
|
200
|
-
let region = resolveField(
|
|
201
|
-
~envKey="AWS_REGION",
|
|
202
|
-
~fromSource=out("cognitoRegion"),
|
|
203
|
-
~human="cognitoRegion",
|
|
204
|
-
)
|
|
205
|
-
let clientId = resolveField(
|
|
206
|
-
~envKey="COGNITO_CLIENT_ID",
|
|
207
|
-
~fromSource=out("cognitoUserPoolClientId"),
|
|
208
|
-
~human="cognitoUserPoolClientId",
|
|
209
|
-
)
|
|
210
|
-
// Absent → "" → the data set skips its upload phase.
|
|
211
|
-
let uploadEndpoint = Seed.Prompt.envValue("REVENTLESS_UPLOAD_ENDPOINT")->Option.getOr("")
|
|
212
|
-
(endpoint, uploadEndpoint, region, clientId)
|
|
213
218
|
}
|
|
219
|
+
|
|
220
|
+
let resolveEndpoints = async (
|
|
221
|
+
~projectDir: string,
|
|
222
|
+
~backend: option<string>,
|
|
223
|
+
~stack: string,
|
|
224
|
+
): endpoints => {
|
|
225
|
+
let outputs = stackOutputs(~projectDir, ~backend, stack)
|
|
226
|
+
let source = switch outputs->field("hostShellUrl")->Option.flatMap(asString) {
|
|
227
|
+
| Some(hostShellUrl) => HostShellConfig(await fetchConfig(hostShellUrl))
|
|
228
|
+
| None => StackOutputs(outputs)
|
|
229
|
+
}
|
|
230
|
+
endpointsFrom(~stack, source)
|
|
214
231
|
}
|
|
215
232
|
|
|
216
233
|
// ── Cognito login ─────────────────────────────────────────────────────────────
|
|
@@ -302,15 +319,10 @@ let connect = (~projectDir: string=".", ~stack=?, ~backend=?, ()): (
|
|
|
302
319
|
| None => backend
|
|
303
320
|
}
|
|
304
321
|
let stackName = await resolveStack(~projectDir, ~backend, ~stack)
|
|
305
|
-
let
|
|
306
|
-
~projectDir,
|
|
307
|
-
~backend,
|
|
308
|
-
~stack=stackName,
|
|
309
|
-
)
|
|
322
|
+
let eps = await resolveEndpoints(~projectDir, ~backend, ~stack=stackName)
|
|
310
323
|
await Seed.Connect.make(
|
|
311
324
|
~label=stackName,
|
|
312
|
-
~endpoint,
|
|
313
|
-
~
|
|
314
|
-
~login=cognito(~region, ~clientId),
|
|
325
|
+
~endpoint=eps.graphql,
|
|
326
|
+
~login=cognito(~region=eps.cognitoRegion, ~clientId=eps.cognitoClientId),
|
|
315
327
|
)
|
|
316
328
|
}
|
|
@@ -152,34 +152,28 @@ function resolveField(envKey, fromSource, human) {
|
|
|
152
152
|
};
|
|
153
153
|
}
|
|
154
154
|
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
if (hostShellUrl !== undefined) {
|
|
159
|
-
let cfg = await fetchConfig(hostShellUrl);
|
|
155
|
+
function endpointsFrom(stack, source) {
|
|
156
|
+
if (source.TAG === "HostShellConfig") {
|
|
157
|
+
let cfg = source._0;
|
|
160
158
|
let fromCfg = key => Stdlib_Option.flatMap(field(cfg, key), asString);
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
endpoint,
|
|
167
|
-
uploadEndpoint,
|
|
168
|
-
region,
|
|
169
|
-
clientId
|
|
170
|
-
];
|
|
159
|
+
return {
|
|
160
|
+
graphql: resolveField("REVENTLESS_GRAPHQL_ENDPOINT", fromCfg("apiEndpoint"), "apiEndpoint"),
|
|
161
|
+
cognitoRegion: resolveField("AWS_REGION", fromCfg("region"), "region"),
|
|
162
|
+
cognitoClientId: resolveField("COGNITO_CLIENT_ID", fromCfg("cognitoClientId"), "cognitoClientId")
|
|
163
|
+
};
|
|
171
164
|
}
|
|
165
|
+
let outputs = source._0;
|
|
172
166
|
let out = key => Stdlib_Option.flatMap(field(outputs, key), asString);
|
|
173
167
|
let match = Seed_Prompt$ReventlessSeed.envValue("REVENTLESS_GRAPHQL_ENDPOINT");
|
|
174
168
|
let match$1 = out("domainMergedApiEndpoint");
|
|
175
169
|
let match$2 = out("domainApiEndpoint");
|
|
176
|
-
let
|
|
170
|
+
let tmp;
|
|
177
171
|
if (match !== undefined) {
|
|
178
|
-
|
|
172
|
+
tmp = match;
|
|
179
173
|
} else if (match$1 !== undefined) {
|
|
180
|
-
|
|
174
|
+
tmp = match$1;
|
|
181
175
|
} else if (match$2 !== undefined) {
|
|
182
|
-
|
|
176
|
+
tmp = match$2;
|
|
183
177
|
} else {
|
|
184
178
|
throw {
|
|
185
179
|
RE_EXN_ID: Seed$ReventlessSeed.Failed,
|
|
@@ -187,15 +181,24 @@ async function resolveEndpoints(projectDir, backend, stack) {
|
|
|
187
181
|
Error: new Error()
|
|
188
182
|
};
|
|
189
183
|
}
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
184
|
+
return {
|
|
185
|
+
graphql: tmp,
|
|
186
|
+
cognitoRegion: resolveField("AWS_REGION", out("cognitoRegion"), "cognitoRegion"),
|
|
187
|
+
cognitoClientId: resolveField("COGNITO_CLIENT_ID", out("cognitoUserPoolClientId"), "cognitoUserPoolClientId")
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
async function resolveEndpoints(projectDir, backend, stack) {
|
|
192
|
+
let outputs = stackOutputs(projectDir, backend, stack);
|
|
193
|
+
let hostShellUrl = Stdlib_Option.flatMap(field(outputs, "hostShellUrl"), asString);
|
|
194
|
+
let source = hostShellUrl !== undefined ? ({
|
|
195
|
+
TAG: "HostShellConfig",
|
|
196
|
+
_0: await fetchConfig(hostShellUrl)
|
|
197
|
+
}) : ({
|
|
198
|
+
TAG: "StackOutputs",
|
|
199
|
+
_0: outputs
|
|
200
|
+
});
|
|
201
|
+
return endpointsFrom(stack, source);
|
|
199
202
|
}
|
|
200
203
|
|
|
201
204
|
function cognito(region, clientId) {
|
|
@@ -282,8 +285,8 @@ function connect($staropt$star, stack, backend, param) {
|
|
|
282
285
|
let url = Seed_Prompt$ReventlessSeed.envValue("SEED_PULUMI_BACKEND");
|
|
283
286
|
let backend$1 = url !== undefined ? url : backend;
|
|
284
287
|
let stackName = await resolveStack(projectDir, backend$1, stack);
|
|
285
|
-
let
|
|
286
|
-
return await Seed_Connect$ReventlessSeed.make(stackName,
|
|
288
|
+
let eps = await resolveEndpoints(projectDir, backend$1, stackName);
|
|
289
|
+
return await Seed_Connect$ReventlessSeed.make(stackName, eps.graphql, cognito(eps.cognitoRegion, eps.cognitoClientId), undefined);
|
|
287
290
|
};
|
|
288
291
|
}
|
|
289
292
|
|
|
@@ -298,6 +301,7 @@ export {
|
|
|
298
301
|
resolveStack,
|
|
299
302
|
fetchConfig,
|
|
300
303
|
resolveField,
|
|
304
|
+
endpointsFrom,
|
|
301
305
|
resolveEndpoints,
|
|
302
306
|
cognito,
|
|
303
307
|
connect,
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|