@toa.io/extensions.configuration 1.0.0-alpha.284 → 1.0.0-alpha.287
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 +1 -365
- package/components/configuration.values/manifest.toa.yaml +14 -21
- package/components/configuration.values/migrations/0001-system-properties.yaml +14 -0
- package/components/configuration.values/migrations/0002-indexes.yaml +7 -0
- package/components/configuration.values/operations/create.js +1 -2
- package/components/configuration.values/operations/fetch.js +1 -1
- package/components/configuration.values/operations/get.js +1 -1
- package/components/configuration.values/operations/lib/map.js +1 -1
- package/components/configuration.values/operations/lib/resolve.js +3 -3
- package/components/configuration.values/operations/list.js +1 -1
- package/components/configuration.values/source/create.ts +3 -5
- package/components/configuration.values/source/fetch.ts +12 -10
- package/components/configuration.values/source/get.ts +2 -3
- package/components/configuration.values/source/lib/map.test.ts +7 -2
- package/components/configuration.values/source/lib/map.ts +3 -3
- package/components/configuration.values/source/lib/resolve.ts +9 -6
- package/components/configuration.values/source/list.ts +8 -6
- package/components/configuration.values/tsconfig.tsbuildinfo +1 -1
- package/components/configuration.values/types/toa.d.ts +5 -5
- package/cucumber.mjs +3 -0
- package/features/site/index.html +6 -2
- package/features/steps/UI.ts +20 -13
- package/notes/consistency.md +10 -9
- package/package.json +6 -6
- package/readme.md +15 -14
- package/schemas/annotation.cos.yaml +1 -1
- package/source/Aspect.test.ts +32 -8
- package/source/Aspect.ts +28 -19
- package/source/Client.test.ts +31 -14
- package/source/Client.ts +41 -48
- package/source/Composition.ts +6 -6
- package/source/Factory.ts +7 -7
- package/source/Secret.test.ts +1 -1
- package/source/Secret.ts +5 -5
- package/source/UI.ts +33 -32
- package/source/configuration.test.ts +14 -8
- package/source/configuration.ts +11 -15
- package/source/const.ts +13 -1
- package/source/context.ts +2 -2
- package/source/deployment.test.ts +37 -12
- package/source/deployment.ts +45 -19
- package/source/epoch.test.ts +8 -2
- package/source/epoch.ts +6 -5
- package/source/index.ts +1 -1
- package/source/manifest.test.ts +12 -6
- package/source/manifest.ts +1 -1
- package/transpiled/Aspect.d.ts +2 -1
- package/transpiled/Aspect.js +15 -3
- package/transpiled/Aspect.js.map +1 -1
- package/transpiled/Client.d.ts +1 -1
- package/transpiled/Client.js +8 -2
- package/transpiled/Client.js.map +1 -1
- package/transpiled/Composition.js +2 -2
- package/transpiled/Composition.js.map +1 -1
- package/transpiled/Factory.d.ts +2 -1
- package/transpiled/Factory.js.map +1 -1
- package/transpiled/Secret.js.map +1 -1
- package/transpiled/UI.js +2 -1
- package/transpiled/UI.js.map +1 -1
- package/transpiled/configuration.js.map +1 -1
- package/transpiled/const.d.ts +8 -1
- package/transpiled/const.js +10 -0
- package/transpiled/const.js.map +1 -1
- package/transpiled/context.d.ts +1 -1
- package/transpiled/context.js.map +1 -1
- package/transpiled/deployment.d.ts +3 -0
- package/transpiled/deployment.js +19 -5
- package/transpiled/deployment.js.map +1 -1
- package/transpiled/epoch.js +3 -1
- package/transpiled/epoch.js.map +1 -1
- package/transpiled/index.d.ts +1 -1
- package/transpiled/index.js +1 -1
- package/transpiled/index.js.map +1 -1
- package/transpiled/manifest.js.map +1 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/ui/dist/_app/immutable/chunks/{BzG-gka8.js → BW57cOwz.js} +1 -1
- package/ui/dist/_app/immutable/chunks/{_I_MUoRn.js → Bhnl1Avs.js} +1 -1
- package/ui/dist/_app/immutable/chunks/{Bxde3uE_.js → BxOvOexd.js} +1 -1
- package/ui/dist/_app/immutable/chunks/{mvspXr3J.js → CkX_FNYa.js} +2 -2
- package/ui/dist/_app/immutable/chunks/{p9RyiXQ-.js → Dmv4yvb8.js} +1 -1
- package/ui/dist/_app/immutable/entry/{app.C1VIepN7.js → app.Cr7od9uH.js} +2 -2
- package/ui/dist/_app/immutable/entry/start.DWf-Tl0X.js +1 -0
- package/ui/dist/_app/immutable/nodes/{0.D_0dtFej.js → 0.CcGZUFKo.js} +1 -1
- package/ui/dist/_app/immutable/nodes/{1.DFlgHh-H.js → 1.CR6En12y.js} +1 -1
- package/ui/dist/_app/immutable/nodes/{2.BIHgAxXR.js → 2.BhyO8bGT.js} +1 -1
- package/ui/dist/_app/immutable/nodes/3.DcbMtJtb.js +1 -0
- package/ui/dist/_app/immutable/nodes/{4.BZMuJGfA.js → 4.qVnVQBNq.js} +1 -1
- package/ui/dist/_app/version.json +1 -1
- package/ui/dist/index.html +28 -23
- package/ui/dist/_app/immutable/entry/start.BQWCs_Pq.js +0 -1
- package/ui/dist/_app/immutable/nodes/3.R-_yCt5X.js +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,370 +3,6 @@
|
|
|
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
|
-
|
|
8
|
-
### Bug Fixes
|
|
9
|
-
|
|
10
|
-
* **build:** an operations directory holds modules and nothing else ([21a8ca1](https://github.com/toa-io/toa/commit/21a8ca19f1c45aef6cbb443ada0a909d325e76e8))
|
|
11
|
-
|
|
12
|
-
### Features
|
|
13
|
-
|
|
14
|
-
* **cadence:** calls a component makes to itself, and calls it puts off ([8bbde5f](https://github.com/toa-io/toa/commit/8bbde5fc89e8e5549d5aa2bfcddb1beec0871565))
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
# [1.0.0-alpha.283](https://github.com/toa-io/toa/compare/v1.0.0-alpha.282...v1.0.0-alpha.283) (2026-09-04)
|
|
18
|
-
|
|
19
|
-
### Bug Fixes
|
|
20
|
-
|
|
21
|
-
* **cli:** an assignment hands back the new state, not nothing ([91304e9](https://github.com/toa-io/toa/commit/91304e9e9a3bba5933b7421b7a0ffff0c2e47795))
|
|
22
|
-
* **storages:** take `Maybe` from core, not from the deprecated package ([bcaeeb3](https://github.com/toa-io/toa/commit/bcaeeb3c76c89af34e94ff569a210d21b7e87f64))
|
|
23
|
-
|
|
24
|
-
### Features
|
|
25
|
-
|
|
26
|
-
* **cli:** a type module is declarations, so it sits beside a component's source ([ca755d9](https://github.com/toa-io/toa/commit/ca755d93d1a04b7697dd0dd12eb59e5b6e2a71d1))
|
|
27
|
-
* **cli:** the built-in components ship types generated from their manifests ([bd7db9e](https://github.com/toa-io/toa/commit/bd7db9e88e46c1060223761898932239127f389a))
|
|
28
|
-
* **extensions:** an extension declares what it puts on a component's context ([133bc2a](https://github.com/toa-io/toa/commit/133bc2aad1e45a2d4aa68a08a5e44ca48d3b7414))
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
# [1.0.0-alpha.282](https://github.com/toa-io/toa/compare/v1.0.0-alpha.281...v1.0.0-alpha.282) (2026-09-03)
|
|
32
|
-
|
|
33
|
-
### Features
|
|
34
|
-
|
|
35
|
-
* **core:** a Host for extensions ([6315eac](https://github.com/toa-io/toa/commit/6315eac1e9fb05be472272de06385c54ad5934ce))
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
# [1.0.0-alpha.281](https://github.com/toa-io/toa/compare/v1.0.0-alpha.280...v1.0.0-alpha.281) (2026-09-03)
|
|
39
|
-
|
|
40
|
-
### Bug Fixes
|
|
41
|
-
|
|
42
|
-
* **deps:** state the cookie bump where npm can resolve it ([11fcdf8](https://github.com/toa-io/toa/commit/11fcdf874ee33107901b5c06435ab10fba64870f))
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
# [1.0.0-alpha.280](https://github.com/toa-io/toa/compare/v1.0.0-alpha.279...v1.0.0-alpha.280) (2026-09-03)
|
|
46
|
-
|
|
47
|
-
### Bug Fixes
|
|
48
|
-
|
|
49
|
-
* **deps:** update cookie in UI lockfiles ([d32106b](https://github.com/toa-io/toa/commit/d32106be40728156e82858f37b4d04163d1e1652))
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
# [1.0.0-alpha.278](https://github.com/toa-io/toa/compare/v1.0.0-alpha.277...v1.0.0-alpha.278) (2026-09-03)
|
|
53
|
-
|
|
54
|
-
**Note:** Version bump only for package @toa.io/extensions.configuration
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
# [1.0.0-alpha.277](https://github.com/toa-io/toa/compare/v1.0.0-alpha.276...v1.0.0-alpha.277) (2026-09-03)
|
|
61
|
-
|
|
62
|
-
### Bug Fixes
|
|
63
|
-
|
|
64
|
-
* drop the build output that landed beside the sources ([a724f69](https://github.com/toa-io/toa/commit/a724f6921190e5c9d945e33c6035bb12d832e5c8))
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
# [1.0.0-alpha.276](https://github.com/toa-io/toa/compare/v1.0.0-alpha.275...v1.0.0-alpha.276) (2026-09-03)
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
### Features
|
|
71
|
-
|
|
72
|
-
* **configuration:** log the epoch a value was resolved under ([ff51ff6](https://github.com/toa-io/toa/commit/ff51ff629592159eeac562059ceb944f193ad7e8))
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
# [1.0.0-alpha.275](https://github.com/toa-io/toa/compare/v1.0.0-alpha.274...v1.0.0-alpha.275) (2026-09-02)
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
### Bug Fixes
|
|
82
|
-
|
|
83
|
-
* **configuration:** ship the component's code and the built page ([6ffe988](https://github.com/toa-io/toa/commit/6ffe988a9e67025c114e74ba94665b28a2cafaa1))
|
|
84
|
-
* **introspection:** keep a sideways scroll off the browser's back gesture ([419e012](https://github.com/toa-io/toa/commit/419e012ce093bcd0429dc93fe457bbd964cfc11c))
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
### Features
|
|
88
|
-
|
|
89
|
-
* **ui:** give both consoles a favicon ([27d3881](https://github.com/toa-io/toa/commit/27d3881eda10e59dc4c9c5ef38c2a58b71e1448d))
|
|
90
|
-
* **ui:** leave signing out to its icon ([a82fbab](https://github.com/toa-io/toa/commit/a82fbab513706436254348a5e35115dc3721873f))
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
# [1.0.0-alpha.274](https://github.com/toa-io/toa/compare/v1.0.0-alpha.273...v1.0.0-alpha.274) (2026-09-02)
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
* Configuration is served by a component, followed live, and kept per epoch (#1017) ([b05997d](https://github.com/toa-io/toa/commit/b05997d3adb784f238a222cb46878b23859339a2)), closes [#1017](https://github.com/toa-io/toa/issues/1017)
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
### Features
|
|
103
|
-
|
|
104
|
-
* **configuration:** drop the label from the epoch ([4baaff5](https://github.com/toa-io/toa/commit/4baaff5b22d00719142a65d56b50a1b100b29fbd))
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
### BREAKING CHANGES
|
|
108
|
-
|
|
109
|
-
* a secret configuration value is an object, not a string;
|
|
110
|
-
read it with `unwrap()`.
|
|
111
|
-
|
|
112
|
-
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
|
113
|
-
|
|
114
|
-
* test(configuration): wait for the second round rather than assume it
|
|
115
|
-
|
|
116
|
-
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
|
117
|
-
|
|
118
|
-
* refactor(configuration)!: read a secret with its own unwrap
|
|
119
|
-
|
|
120
|
-
Component code depends on no Toa package, so a secret is read as
|
|
121
|
-
`context.configuration.apiKey.unwrap()` and the helper in `@toa.io/generic`
|
|
122
|
-
goes. A value a component reads as a secret is therefore given as a reference:
|
|
123
|
-
`identity.basic` no longer defaults `pepper` to `''`, the development context
|
|
124
|
-
and the feature harness give the token keys, the federation client secret and
|
|
125
|
-
the signing key as references, and the harness has a step for the secrets a
|
|
126
|
-
scenario refers to. CONTRIBUTING states the rule.
|
|
127
|
-
* `identity.basic` `pepper` has no default; a value read as a
|
|
128
|
-
secret must be given as a `$NAME` reference.
|
|
129
|
-
|
|
130
|
-
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
|
131
|
-
|
|
132
|
-
* feat(configuration): list the configurations
|
|
133
|
-
|
|
134
|
-
`configuration.values.list` returns every component's configuration for its
|
|
135
|
-
deployed epoch, by component name, and `GET /configuration/values/` serves it
|
|
136
|
-
behind `system:configuration:get`.
|
|
137
|
-
|
|
138
|
-
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
|
139
|
-
|
|
140
|
-
* fix(exposition): write a value in YAML the way its toJSON says
|
|
141
|
-
|
|
142
|
-
A redacted secret in a reply was dumped as an empty object; it is written as
|
|
143
|
-
`<REDACTED>`, as JSON and msgpack already write it.
|
|
144
|
-
|
|
145
|
-
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
|
146
|
-
|
|
147
|
-
* test(configuration): a secret is an object, and stays redacted in a reply
|
|
148
|
-
|
|
149
|
-
A component with `{ a: 1, b: $SECRET_B }` returns its configuration as
|
|
150
|
-
`{ a: 1, b: '<REDACTED>' }` and the secret itself through `unwrap()`. The reply
|
|
151
|
-
step also accepts a reply as a caller across a process boundary receives it,
|
|
152
|
-
since a call within the process hands the object over as it is.
|
|
153
|
-
|
|
154
|
-
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
|
155
|
-
|
|
156
|
-
* chore(schemas): bump the dependencies
|
|
157
|
-
|
|
158
|
-
ajv 8.18.0 to 8.20.0, ajv-formats 2.1.1 to 3.0.1, better-ajv-errors 1.2.0
|
|
159
|
-
to 2.0.3, fast-glob 3.2.12 to 3.3.3 and js-yaml 4.3.1 to 5.4.1 — the version
|
|
160
|
-
exposition already uses. The three majors keep the CommonJS entry points this
|
|
161
|
-
library calls: ajv-formats as a function, better-ajv-errors as .default, and
|
|
162
|
-
js-yaml's load.
|
|
163
|
-
|
|
164
|
-
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
|
165
|
-
|
|
166
|
-
* feat(configuration)!: serve the schema with the value
|
|
167
|
-
|
|
168
|
-
GET /configuration/values/:component/ answers { configuration, schema, epoch }
|
|
169
|
-
where it answered with the configuration alone, and list carries the schema of
|
|
170
|
-
every component. Nothing reads a configuration without needing to know what it
|
|
171
|
-
is checked against, and the schema was only ever on the values service.
|
|
172
|
-
|
|
173
|
-
An epoch the deployment does not know has no schema; the value stored for it
|
|
174
|
-
is still returned.
|
|
175
|
-
|
|
176
|
-
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
|
177
|
-
|
|
178
|
-
* feat(configuration): publish a configuration UI
|
|
179
|
-
|
|
180
|
-
The values service serves a page at /.configuration on port 8003, out of the
|
|
181
|
-
directory ui builds: the configured components, a screen per component showing
|
|
182
|
-
what it holds now, and a dialog creating the next one. Reading needs
|
|
183
|
-
system:configuration:get and creating needs system:configuration:create.
|
|
184
|
-
|
|
185
|
-
A configuration is immutable, so the dialog opens on the current value and what
|
|
186
|
-
is left out of it is left out of the component. The editor takes YAML, the
|
|
187
|
-
schema is applied before anything is sent, and a secret is a reference the page
|
|
188
|
-
never shows.
|
|
189
|
-
|
|
190
|
-
The page is always published: the annotation is the per-component values map
|
|
191
|
-
and has nowhere to carry a switch.
|
|
192
|
-
|
|
193
|
-
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
|
194
|
-
|
|
195
|
-
* feat(introspection): link a component to its configuration
|
|
196
|
-
|
|
197
|
-
A card carrying @toa.io/extensions.configuration reads that extension as a link
|
|
198
|
-
to the configuration UI rather than as a name, and configuration joins the
|
|
199
|
-
namespaces the runtime provides, so its components band under System.
|
|
200
|
-
|
|
201
|
-
Deployed, both pages sit behind the same ingress and the path alone is right;
|
|
202
|
-
locally each console has its own port.
|
|
203
|
-
|
|
204
|
-
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
|
205
|
-
|
|
206
|
-
* feat(introspection): scroll the map, zoom with a modifier
|
|
207
|
-
|
|
208
|
-
The map was grabbed to move and zoomed with a bare wheel, which is neither what
|
|
209
|
-
a page does nor what the wheel does anywhere else. A plain scroll now pans on
|
|
210
|
-
both axes and the wheel scales only with the modifier held — a trackpad pinch
|
|
211
|
-
arrives as one of those on every platform.
|
|
212
|
-
|
|
213
|
-
A card's own scrollable box keeps its wheel, in both paths.
|
|
214
|
-
|
|
215
|
-
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
|
216
|
-
|
|
217
|
-
* refactor(introspection): centre the filter in the header
|
|
218
|
-
|
|
219
|
-
The sides take equal space, which is what leaves the filter between them.
|
|
220
|
-
Neither side may shrink under what it holds, or the tabs run out from under
|
|
221
|
-
their side and across the filter, and the filter across the sign-out button;
|
|
222
|
-
the title gives way instead.
|
|
223
|
-
|
|
224
|
-
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
|
225
|
-
|
|
226
|
-
* fix(configuration): connect the UI to the values service
|
|
227
|
-
|
|
228
|
-
The page was declared as a dependency from inside `open`, and a connector connects
|
|
229
|
-
what it depends on before `open` runs — so the server was constructed and never
|
|
230
|
-
listened. Nothing caught it: the UI feature builds the server itself.
|
|
231
|
-
|
|
232
|
-
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
|
233
|
-
|
|
234
|
-
* feat(configuration)!: reserve resources in the annotation
|
|
235
|
-
|
|
236
|
-
The values service deploys like any other and must state what it may take, but the
|
|
237
|
-
annotation is a map of component ids and had nowhere to put it — so `toa env` failed
|
|
238
|
-
for every context using configuration unless it declared a context-wide `resources`.
|
|
239
|
-
|
|
240
|
-
`resources` is now the service's own, read the way `introspection` and `realtime` read
|
|
241
|
-
theirs. A component actually named `resources` is written `default.resources`, which is
|
|
242
|
-
what its id is anyway.
|
|
243
|
-
|
|
244
|
-
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
|
245
|
-
|
|
246
|
-
* feat(configuration): follow the system colour scheme
|
|
247
|
-
|
|
248
|
-
The dark tokens were behind a `.dark` class nothing sets, and the `dark:` variant was
|
|
249
|
-
pointed at that class too — so a component's own dark styling never applied either.
|
|
250
|
-
Both now key off `prefers-color-scheme`, and `color-scheme` hands the native chrome
|
|
251
|
-
the same answer.
|
|
252
|
-
|
|
253
|
-
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
|
254
|
-
|
|
255
|
-
* feat(introspection): follow the system colour scheme
|
|
256
|
-
|
|
257
|
-
The dark tokens were behind a `.dark` class nothing sets, and the `dark:` variant was
|
|
258
|
-
pointed at that class too — so a component's own dark styling never applied either.
|
|
259
|
-
Both now key off `prefers-color-scheme`, and `color-scheme` hands the native chrome
|
|
260
|
-
the same answer.
|
|
261
|
-
|
|
262
|
-
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
|
263
|
-
|
|
264
|
-
* feat(configuration): present a change as an edit of what is there
|
|
265
|
-
|
|
266
|
-
A configuration is immutable and creating one replaces the whole of it, but the dialog
|
|
267
|
-
opens on the current value and the page never shows an older one — so what the reader
|
|
268
|
-
does is edit. The words follow: Edit rather than New, Update rather than Create, and
|
|
269
|
-
the paragraph explaining the model goes, along with the field's label, which the title
|
|
270
|
-
above it already said.
|
|
271
|
-
|
|
272
|
-
The editor also stayed as wide as its longest line — `field-sizing: content` sizes to
|
|
273
|
-
content, and no `max-width` clamps that — so a long value painted outside the dialog.
|
|
274
|
-
It is fixed now, the dialog takes the width the screen has rather than a fixed step,
|
|
275
|
-
and the band held for errors no longer leaves a gap when there are none.
|
|
276
|
-
|
|
277
|
-
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
|
278
|
-
|
|
279
|
-
* feat(configuration): mark a component that keeps a secret
|
|
280
|
-
|
|
281
|
-
A key after the name on the row, wherever the configuration holds a reference, however
|
|
282
|
-
deep. The predicate reads the same lines the value screen renders, so the two cannot
|
|
283
|
-
disagree about what counts as a secret.
|
|
284
|
-
|
|
285
|
-
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
|
286
|
-
|
|
287
|
-
* feat(configuration): lead back to the list from the title
|
|
288
|
-
|
|
289
|
-
Every address ends in a slash, so the way up is the address itself on the list and one
|
|
290
|
-
level above it on a component's screen — which holds wherever the page is mounted.
|
|
291
|
-
|
|
292
|
-
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
# [1.0.0-alpha.273](https://github.com/toa-io/toa/compare/v1.0.0-alpha.272...v1.0.0-alpha.273) (2026-09-02)
|
|
299
|
-
|
|
300
|
-
**Note:** Version bump only for package @toa.io/extensions.configuration
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
# [1.0.0-alpha.272](https://github.com/toa-io/toa/compare/v1.0.0-alpha.271...v1.0.0-alpha.272) (2026-09-01)
|
|
307
|
-
|
|
308
|
-
**Note:** Version bump only for package @toa.io/extensions.configuration
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
# [1.0.0-alpha.270](https://github.com/toa-io/toa/compare/v1.0.0-alpha.269...v1.0.0-alpha.270) (2026-08-31)
|
|
315
|
-
|
|
316
|
-
**Note:** Version bump only for package @toa.io/extensions.configuration
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
# [1.0.0-alpha.266](https://github.com/toa-io/toa/compare/v1.0.0-alpha.265...v1.0.0-alpha.266) (2026-08-29)
|
|
323
|
-
|
|
324
|
-
**Note:** Version bump only for package @toa.io/extensions.configuration
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
# [1.0.0-alpha.265](https://github.com/toa-io/toa/compare/v1.0.0-alpha.264...v1.0.0-alpha.265) (2026-08-29)
|
|
331
|
-
|
|
332
|
-
**Note:** Version bump only for package @toa.io/extensions.configuration
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
# [1.0.0-alpha.264](https://github.com/toa-io/toa/compare/v1.0.0-alpha.263...v1.0.0-alpha.264) (2026-08-29)
|
|
339
|
-
|
|
340
|
-
**Note:** Version bump only for package @toa.io/extensions.configuration
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
# [1.0.0-alpha.263](https://github.com/toa-io/toa/compare/v1.0.0-alpha.262...v1.0.0-alpha.263) (2026-08-29)
|
|
347
|
-
|
|
348
|
-
**Note:** Version bump only for package @toa.io/extensions.configuration
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
# [1.0.0-alpha.262](https://github.com/toa-io/toa/compare/v1.0.0-alpha.261...v1.0.0-alpha.262) (2026-08-28)
|
|
355
|
-
|
|
356
|
-
**Note:** Version bump only for package @toa.io/extensions.configuration
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
# [1.0.0-alpha.259](https://github.com/toa-io/toa/compare/v1.0.0-alpha.258...v1.0.0-alpha.259) (2026-08-24)
|
|
363
|
-
|
|
364
|
-
**Note:** Version bump only for package @toa.io/extensions.configuration
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
# [1.0.0-alpha.257](https://github.com/toa-io/toa/compare/v1.0.0-alpha.256...v1.0.0-alpha.257) (2026-08-24)
|
|
6
|
+
# [1.0.0-alpha.287](https://github.com/toa-io/toa/compare/v1.0.0-alpha.286...v1.0.0-alpha.287) (2026-09-06)
|
|
371
7
|
|
|
372
8
|
**Note:** Version bump only for package @toa.io/extensions.configuration
|
|
@@ -8,27 +8,20 @@ name: values
|
|
|
8
8
|
# prototype's `created` event.
|
|
9
9
|
|
|
10
10
|
entity:
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
- configuration
|
|
26
|
-
- originator
|
|
27
|
-
index:
|
|
28
|
-
lookup:
|
|
29
|
-
component: asc
|
|
30
|
-
epoch: asc
|
|
31
|
-
_created: desc
|
|
11
|
+
properties:
|
|
12
|
+
component:
|
|
13
|
+
type: string
|
|
14
|
+
epoch:
|
|
15
|
+
type: string
|
|
16
|
+
configuration:
|
|
17
|
+
type: object
|
|
18
|
+
originator:
|
|
19
|
+
type: string
|
|
20
|
+
required:
|
|
21
|
+
- component
|
|
22
|
+
- epoch
|
|
23
|
+
- configuration
|
|
24
|
+
- originator
|
|
32
25
|
|
|
33
26
|
operations:
|
|
34
27
|
# the latest configuration of a component: created, else deployed defaults, else none
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# 1.0.0-alpha.286 renamed the four system properties of a record. A database written before it
|
|
2
|
+
# holds them under the old names, where nothing reads them: such a record is never created,
|
|
3
|
+
# never updated, never deleted, and at version zero.
|
|
4
|
+
#
|
|
5
|
+
# `$rename` leaves a record that has none of them alone, so this is a no-op for a component
|
|
6
|
+
# that has only ever run this release.
|
|
7
|
+
- update:
|
|
8
|
+
filter: {}
|
|
9
|
+
update:
|
|
10
|
+
$rename:
|
|
11
|
+
_version: VERSION
|
|
12
|
+
_created: CREATED
|
|
13
|
+
_updated: UPDATED
|
|
14
|
+
_deleted: DELETED
|
|
@@ -4,7 +4,6 @@ export async function transition(input, object) {
|
|
|
4
4
|
const known = entry(input.component);
|
|
5
5
|
if (known === undefined)
|
|
6
6
|
return new UnknownComponentError(input.component);
|
|
7
|
-
// the schema fills its defaults, so what is stored is whole
|
|
8
7
|
const configuration = structuredClone(input.configuration);
|
|
9
8
|
const schema = schemas.schema(known.schema);
|
|
10
9
|
try {
|
|
@@ -28,4 +27,4 @@ class UnknownComponentError extends Error {
|
|
|
28
27
|
class InvalidConfigurationError extends Error {
|
|
29
28
|
code = 'INVALID_CONFIGURATION';
|
|
30
29
|
}
|
|
31
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
30
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY3JlYXRlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vc291cmNlL2NyZWF0ZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssT0FBTyxNQUFNLGlCQUFpQixDQUFBO0FBQzFDLE9BQU8sRUFBRSxLQUFLLEVBQUUsTUFBTSxjQUFjLENBQUE7QUFHcEMsTUFBTSxDQUFDLEtBQUssVUFBVSxVQUFVLENBQUMsS0FBWSxFQUFFLE1BQWM7SUFDM0QsTUFBTSxLQUFLLEdBQUcsS0FBSyxDQUFDLEtBQUssQ0FBQyxTQUFTLENBQUMsQ0FBQTtJQUVwQyxJQUFJLEtBQUssS0FBSyxTQUFTO1FBQUUsT0FBTyxJQUFJLHFCQUFxQixDQUFDLEtBQUssQ0FBQyxTQUFTLENBQUMsQ0FBQTtJQUUxRSxNQUFNLGFBQWEsR0FBRyxlQUFlLENBQUMsS0FBSyxDQUFDLGFBQWEsQ0FBQyxDQUFBO0lBRTFELE1BQU0sTUFBTSxHQUFnQixPQUFPLENBQUMsTUFBTSxDQUFDLEtBQUssQ0FBQyxNQUFNLENBQUMsQ0FBQTtJQUV4RCxJQUFJLENBQUM7UUFDSCxNQUFNLENBQUMsUUFBUSxDQUFDLGFBQWEsQ0FBQyxDQUFBO0lBQ2hDLENBQUM7SUFBQyxPQUFPLEtBQUssRUFBRSxDQUFDO1FBQ2YsT0FBTyxJQUFJLHlCQUF5QixDQUFFLEtBQWUsQ0FBQyxPQUFPLENBQUMsQ0FBQTtJQUNoRSxDQUFDO0lBRUQsTUFBTSxDQUFDLFNBQVMsR0FBRyxLQUFLLENBQUMsU0FBUyxDQUFBO0lBQ2xDLE1BQU0sQ0FBQyxLQUFLLEdBQUcsS0FBSyxDQUFDLEtBQUssQ0FBQTtJQUMxQixNQUFNLENBQUMsYUFBYSxHQUFHLGFBQWEsQ0FBQTtJQUNwQyxNQUFNLENBQUMsVUFBVSxHQUFHLEtBQUssQ0FBQyxVQUFVLENBQUMsRUFBRSxDQUFBO0lBRXZDLE9BQU8sTUFBTSxDQUFBO0FBQ2YsQ0FBQztBQUVELE1BQU0scUJBQXNCLFNBQVEsS0FBSztJQUN2QixJQUFJLEdBQUcsbUJBQW1CLENBQUE7SUFFMUMsWUFBbUIsU0FBaUI7UUFDbEMsS0FBSyxDQUFDLGNBQWMsU0FBUyxxQkFBcUIsQ0FBQyxDQUFBO0lBQ3JELENBQUM7Q0FDRjtBQUVELE1BQU0seUJBQTBCLFNBQVEsS0FBSztJQUMzQixJQUFJLEdBQUcsdUJBQXVCLENBQUE7Q0FDL0MifQ==
|
|
@@ -10,4 +10,4 @@ export async function computation(input, context) {
|
|
|
10
10
|
};
|
|
11
11
|
}));
|
|
12
12
|
}
|
|
13
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
13
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmV0Y2guanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zb3VyY2UvZmV0Y2gudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLE9BQU8sRUFBZ0IsTUFBTSxrQkFBa0IsQ0FBQTtBQUV4RCxNQUFNLENBQUMsS0FBSyxVQUFVLFdBQVcsQ0FBQyxLQUFhLEVBQUUsT0FBZ0I7SUFDL0QsT0FBTyxNQUFNLE9BQU8sQ0FBQyxHQUFHLENBQ3RCLEtBQUssQ0FBQyxHQUFHLENBQUMsS0FBSyxFQUFFLEVBQUUsU0FBUyxFQUFFLEtBQUssRUFBRSxFQUFFLEVBQUU7UUFDdkMsTUFBTSxLQUFLLEdBQUcsTUFBTSxPQUFPLENBQUMsT0FBTyxFQUFFLFNBQVMsRUFBRSxLQUFLLENBQUMsQ0FBQTtRQUV0RCxPQUFPO1lBQ0wsU0FBUztZQUNULEtBQUs7WUFDTCxhQUFhLEVBQUUsS0FBSyxLQUFLLElBQUksQ0FBQyxDQUFDLENBQUMsSUFBSSxDQUFDLENBQUMsQ0FBQyxLQUFLLENBQUMsYUFBYTtZQUMxRCxPQUFPLEVBQUUsS0FBSyxLQUFLLElBQUksQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxLQUFLLENBQUMsT0FBTztTQUM1QyxDQUFBO0lBQ0gsQ0FBQyxDQUFDLENBQ0gsQ0FBQTtBQUNILENBQUMifQ==
|
|
@@ -16,4 +16,4 @@ export async function computation(input, context) {
|
|
|
16
16
|
epoch: input.epoch ?? known.epoch
|
|
17
17
|
};
|
|
18
18
|
}
|
|
19
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
19
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ2V0LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vc291cmNlL2dldC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsS0FBSyxFQUFFLE1BQU0sY0FBYyxDQUFBO0FBQ3BDLE9BQU8sRUFBRSxPQUFPLEVBQWdCLE1BQU0sa0JBQWtCLENBQUE7QUFFeEQ7Ozs7R0FJRztBQUNILE1BQU0sQ0FBQyxLQUFLLFVBQVUsV0FBVyxDQUFDLEtBQVksRUFBRSxPQUFnQjtJQUM5RCxNQUFNLEtBQUssR0FBRyxNQUFNLE9BQU8sQ0FBQyxPQUFPLEVBQUUsS0FBSyxDQUFDLFNBQVMsRUFBRSxLQUFLLENBQUMsS0FBSyxDQUFDLENBQUE7SUFFbEUsSUFBSSxLQUFLLEtBQUssSUFBSTtRQUFFLE9BQU8sSUFBSSxDQUFBO0lBRS9CLE1BQU0sS0FBSyxHQUFHLEtBQUssQ0FBQyxLQUFLLENBQUMsU0FBUyxDQUFDLENBQUE7SUFFcEMsT0FBTztRQUNMLGFBQWEsRUFBRSxLQUFLLENBQUMsYUFBYTtRQUNsQyxNQUFNLEVBQUUsS0FBSyxFQUFFLE1BQU07UUFDckIsS0FBSyxFQUFFLEtBQUssQ0FBQyxLQUFLLElBQUksS0FBTSxDQUFDLEtBQUs7S0FDbkMsQ0FBQTtBQUNILENBQUMifQ==
|
|
@@ -18,4 +18,4 @@ function read() {
|
|
|
18
18
|
let parsed = null;
|
|
19
19
|
let values = {};
|
|
20
20
|
export const VARIABLE = 'TOA_CONFIGURATION_VALUES';
|
|
21
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
21
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWFwLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc291cmNlL2xpYi9tYXAudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsNkVBQTZFO0FBQzdFLE1BQU0sVUFBVSxLQUFLLENBQUMsU0FBaUI7SUFDckMsT0FBTyxJQUFJLEVBQUUsQ0FBQyxTQUFTLENBQUMsQ0FBQTtBQUMxQixDQUFDO0FBRUQsMENBQTBDO0FBQzFDLE1BQU0sVUFBVSxVQUFVO0lBQ3hCLE9BQU8sTUFBTSxDQUFDLElBQUksQ0FBQyxJQUFJLEVBQUUsQ0FBQyxDQUFDLElBQUksRUFBRSxDQUFBO0FBQ25DLENBQUM7QUFFRCxTQUFTLElBQUk7SUFDWCxNQUFNLE1BQU0sR0FBRyxPQUFPLENBQUMsR0FBRyxDQUFDLFFBQVEsQ0FBQyxJQUFJLElBQUksQ0FBQTtJQUU1QyxvRkFBb0Y7SUFDcEYsSUFBSSxNQUFNLEtBQUssTUFBTSxFQUFFLENBQUM7UUFDdEIsTUFBTSxHQUFHLElBQUksQ0FBQyxLQUFLLENBQUMsTUFBTSxDQUFXLENBQUE7UUFDckMsTUFBTSxHQUFHLE1BQU0sQ0FBQTtJQUNqQixDQUFDO0lBRUQsT0FBTyxNQUFNLENBQUE7QUFDZixDQUFDO0FBRUQsSUFBSSxNQUFNLEdBQWtCLElBQUksQ0FBQTtBQUNoQyxJQUFJLE1BQU0sR0FBVyxFQUFFLENBQUE7QUFFdkIsTUFBTSxDQUFDLE1BQU0sUUFBUSxHQUFHLDBCQUEwQixDQUFBIn0=
|
|
@@ -11,14 +11,14 @@ export async function resolve(context, component, epoch) {
|
|
|
11
11
|
// one query per pair, so that a component's latest is never behind another's newer ones
|
|
12
12
|
const query = {
|
|
13
13
|
criteria: `component=="${component}";epoch=="${epoch}"`,
|
|
14
|
-
sort: ['
|
|
14
|
+
sort: ['CREATED:desc'],
|
|
15
15
|
limit: 1
|
|
16
16
|
};
|
|
17
17
|
const objects = await context.local.enumerate({ query });
|
|
18
18
|
if (objects.length > 0)
|
|
19
|
-
return { configuration: objects[0].configuration, created: objects[0].
|
|
19
|
+
return { configuration: objects[0].configuration, created: objects[0].CREATED };
|
|
20
20
|
if (known !== undefined && known.epoch === epoch)
|
|
21
21
|
return { configuration: known.defaults ?? {}, created: 0 };
|
|
22
22
|
return null;
|
|
23
23
|
}
|
|
24
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
24
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmVzb2x2ZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NvdXJjZS9saWIvcmVzb2x2ZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsS0FBSyxFQUFFLE1BQU0sVUFBVSxDQUFBO0FBRWhDOzs7R0FHRztBQUNILE1BQU0sQ0FBQyxLQUFLLFVBQVUsT0FBTyxDQUMzQixPQUFnQixFQUNoQixTQUFpQixFQUNqQixLQUFjO0lBRWQsTUFBTSxLQUFLLEdBQUcsS0FBSyxDQUFDLFNBQVMsQ0FBQyxDQUFBO0lBRTlCLEtBQUssS0FBSyxLQUFLLEVBQUUsS0FBSyxDQUFBO0lBRXRCLElBQUksS0FBSyxLQUFLLFNBQVM7UUFBRSxPQUFPLElBQUksQ0FBQTtJQUVwQyx3RkFBd0Y7SUFDeEYsTUFBTSxLQUFLLEdBQVU7UUFDbkIsUUFBUSxFQUFFLGVBQWUsU0FBUyxhQUFhLEtBQUssR0FBRztRQUN2RCxJQUFJLEVBQUUsQ0FBQyxjQUFjLENBQUM7UUFDdEIsS0FBSyxFQUFFLENBQUM7S0FDVCxDQUFBO0lBRUQsTUFBTSxPQUFPLEdBQUcsTUFBTSxPQUFPLENBQUMsS0FBSyxDQUFDLFNBQVMsQ0FBQyxFQUFFLEtBQUssRUFBRSxDQUFDLENBQUE7SUFFeEQsSUFBSSxPQUFPLENBQUMsTUFBTSxHQUFHLENBQUM7UUFDcEIsT0FBTyxFQUFFLGFBQWEsRUFBRSxPQUFPLENBQUMsQ0FBQyxDQUFDLENBQUMsYUFBYSxFQUFFLE9BQU8sRUFBRSxPQUFPLENBQUMsQ0FBQyxDQUFDLENBQUMsT0FBTyxFQUFFLENBQUE7SUFFakYsSUFBSSxLQUFLLEtBQUssU0FBUyxJQUFJLEtBQUssQ0FBQyxLQUFLLEtBQUssS0FBSztRQUM5QyxPQUFPLEVBQUUsYUFBYSxFQUFFLEtBQUssQ0FBQyxRQUFRLElBQUksRUFBRSxFQUFFLE9BQU8sRUFBRSxDQUFDLEVBQUUsQ0FBQTtJQUU1RCxPQUFPLElBQUksQ0FBQTtBQUNiLENBQUMifQ==
|
|
@@ -8,4 +8,4 @@ export async function computation(_, context) {
|
|
|
8
8
|
return { component, epoch, schema, configuration: value.configuration };
|
|
9
9
|
}));
|
|
10
10
|
}
|
|
11
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
11
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibGlzdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3NvdXJjZS9saXN0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxVQUFVLEVBQUUsS0FBSyxFQUFFLE1BQU0sY0FBYyxDQUFBO0FBQ2hELE9BQU8sRUFBRSxPQUFPLEVBQWdCLE1BQU0sa0JBQWtCLENBQUE7QUFFeEQsc0ZBQXNGO0FBQ3RGLE1BQU0sQ0FBQyxLQUFLLFVBQVUsV0FBVyxDQUFDLENBQU8sRUFBRSxPQUFnQjtJQUN6RCxPQUFPLE1BQU0sT0FBTyxDQUFDLEdBQUcsQ0FDdEIsVUFBVSxFQUFFLENBQUMsR0FBRyxDQUFDLEtBQUssRUFBRSxTQUFTLEVBQUUsRUFBRTtRQUNuQyxNQUFNLEVBQUUsS0FBSyxFQUFFLE1BQU0sRUFBRSxHQUFHLEtBQUssQ0FBQyxTQUFTLENBQUUsQ0FBQTtRQUMzQyxNQUFNLEtBQUssR0FBRyxNQUFNLE9BQU8sQ0FBQyxPQUFPLEVBQUUsU0FBUyxFQUFFLEtBQUssQ0FBQyxDQUFBO1FBRXRELE9BQU8sRUFBRSxTQUFTLEVBQUUsS0FBSyxFQUFFLE1BQU0sRUFBRSxhQUFhLEVBQUUsS0FBTSxDQUFDLGFBQWEsRUFBRSxDQUFBO0lBQzFFLENBQUMsQ0FBQyxDQUNILENBQUE7QUFDSCxDQUFDIn0=
|
|
@@ -2,13 +2,11 @@ import * as schemas from '@toa.io/schemas'
|
|
|
2
2
|
import { entry } from './lib/map.js'
|
|
3
3
|
import type { Schema } from '@toa.io/schemas'
|
|
4
4
|
|
|
5
|
-
export async function transition
|
|
5
|
+
export async function transition(input: Input, object: Entity): Promise<Entity | Error> {
|
|
6
6
|
const known = entry(input.component)
|
|
7
7
|
|
|
8
|
-
if (known === undefined)
|
|
9
|
-
return new UnknownComponentError(input.component)
|
|
8
|
+
if (known === undefined) return new UnknownComponentError(input.component)
|
|
10
9
|
|
|
11
|
-
// the schema fills its defaults, so what is stored is whole
|
|
12
10
|
const configuration = structuredClone(input.configuration)
|
|
13
11
|
|
|
14
12
|
const schema: Schema<any> = schemas.schema(known.schema)
|
|
@@ -30,7 +28,7 @@ export async function transition (input: Input, object: Entity): Promise<Entity
|
|
|
30
28
|
class UnknownComponentError extends Error {
|
|
31
29
|
public readonly code = 'UNKNOWN_COMPONENT'
|
|
32
30
|
|
|
33
|
-
public constructor
|
|
31
|
+
public constructor(component: string) {
|
|
34
32
|
super(`Component '${component}' is not configured`)
|
|
35
33
|
}
|
|
36
34
|
}
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import { resolve, type Context } from './lib/resolve.js'
|
|
2
2
|
|
|
3
|
-
export async function computation
|
|
4
|
-
return await Promise.all(
|
|
5
|
-
|
|
3
|
+
export async function computation(input: Pair[], context: Context): Promise<Fetched[]> {
|
|
4
|
+
return await Promise.all(
|
|
5
|
+
input.map(async ({ component, epoch }) => {
|
|
6
|
+
const value = await resolve(context, component, epoch)
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
return {
|
|
9
|
+
component,
|
|
10
|
+
epoch,
|
|
11
|
+
configuration: value === null ? null : value.configuration,
|
|
12
|
+
created: value === null ? 0 : value.created
|
|
13
|
+
}
|
|
14
|
+
})
|
|
15
|
+
)
|
|
14
16
|
}
|
|
15
17
|
|
|
16
18
|
interface Pair {
|
|
@@ -6,11 +6,10 @@ import { resolve, type Context } from './lib/resolve.js'
|
|
|
6
6
|
* schema is the deployment's, so an epoch the deployment does not know has none — the
|
|
7
7
|
* value is still what was stored for it.
|
|
8
8
|
*/
|
|
9
|
-
export async function computation
|
|
9
|
+
export async function computation(input: Input, context: Context): Promise<Item | null> {
|
|
10
10
|
const value = await resolve(context, input.component, input.epoch)
|
|
11
11
|
|
|
12
|
-
if (value === null)
|
|
13
|
-
return null
|
|
12
|
+
if (value === null) return null
|
|
14
13
|
|
|
15
14
|
const known = entry(input.component)
|
|
16
15
|
|
|
@@ -12,7 +12,9 @@ it('should be empty without the variable', () => {
|
|
|
12
12
|
})
|
|
13
13
|
|
|
14
14
|
it('should read the variable', () => {
|
|
15
|
-
const values = {
|
|
15
|
+
const values = {
|
|
16
|
+
'a.b': { epoch: 'e', schema: { type: 'object' }, defaults: { foo: 1 } }
|
|
17
|
+
}
|
|
16
18
|
|
|
17
19
|
process.env[VARIABLE] = JSON.stringify(values)
|
|
18
20
|
|
|
@@ -31,7 +33,10 @@ it('should follow the variable', () => {
|
|
|
31
33
|
})
|
|
32
34
|
|
|
33
35
|
it('should list the components by name', () => {
|
|
34
|
-
process.env[VARIABLE] = JSON.stringify({
|
|
36
|
+
process.env[VARIABLE] = JSON.stringify({
|
|
37
|
+
'b.two': { epoch: 'e', schema: {} },
|
|
38
|
+
'a.one': { epoch: 'e', schema: {} }
|
|
39
|
+
})
|
|
35
40
|
|
|
36
41
|
assert.deepStrictEqual(components(), ['a.one', 'b.two'])
|
|
37
42
|
})
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/** What the deployment told the service about every configured component. */
|
|
2
|
-
export function entry
|
|
2
|
+
export function entry(component: string): Entry | undefined {
|
|
3
3
|
return read()[component]
|
|
4
4
|
}
|
|
5
5
|
|
|
6
6
|
/** The configured components, by name. */
|
|
7
|
-
export function components
|
|
7
|
+
export function components(): string[] {
|
|
8
8
|
return Object.keys(read()).sort()
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
function read
|
|
11
|
+
function read(): Values {
|
|
12
12
|
const source = process.env[VARIABLE] ?? '{}'
|
|
13
13
|
|
|
14
14
|
// read again once the variable changes, as it does between scenarios of one process
|