@toa.io/extensions.configuration 1.0.0-alpha.28 → 1.0.0-alpha.281

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 (152) hide show
  1. package/CHANGELOG.md +340 -0
  2. package/components/configuration.values/manifest.toa.yaml +158 -0
  3. package/components/configuration.values/operations/create.d.ts +16 -0
  4. package/components/configuration.values/operations/create.js +31 -0
  5. package/components/configuration.values/operations/create.js.map +1 -0
  6. package/components/configuration.values/operations/fetch.d.ts +11 -0
  7. package/components/configuration.values/operations/fetch.js +13 -0
  8. package/components/configuration.values/operations/fetch.js.map +1 -0
  9. package/components/configuration.values/operations/get.d.ts +17 -0
  10. package/components/configuration.values/operations/get.js +19 -0
  11. package/components/configuration.values/operations/get.js.map +1 -0
  12. package/components/configuration.values/operations/lib/map.d.ts +11 -0
  13. package/components/configuration.values/operations/lib/map.js +21 -0
  14. package/components/configuration.values/operations/lib/map.js.map +1 -0
  15. package/components/configuration.values/operations/lib/map.test.d.ts +1 -0
  16. package/components/configuration.values/operations/lib/map.test.js +26 -0
  17. package/components/configuration.values/operations/lib/map.test.js.map +1 -0
  18. package/components/configuration.values/operations/lib/resolve.d.ts +27 -0
  19. package/components/configuration.values/operations/lib/resolve.js +24 -0
  20. package/components/configuration.values/operations/lib/resolve.js.map +1 -0
  21. package/components/configuration.values/operations/list.d.ts +10 -0
  22. package/components/configuration.values/operations/list.js +11 -0
  23. package/components/configuration.values/operations/list.js.map +1 -0
  24. package/components/configuration.values/source/create.ts +56 -0
  25. package/components/configuration.values/source/fetch.ts +24 -0
  26. package/components/configuration.values/source/get.ts +33 -0
  27. package/components/configuration.values/source/lib/map.test.ts +37 -0
  28. package/components/configuration.values/source/lib/map.ts +34 -0
  29. package/components/configuration.values/source/lib/resolve.ts +54 -0
  30. package/components/configuration.values/source/list.ts +19 -0
  31. package/components/configuration.values/tsconfig.json +10 -0
  32. package/components/configuration.values/tsconfig.tsbuildinfo +1 -0
  33. package/cucumber.mjs +5 -0
  34. package/features/site/_app/immutable/asset.js +1 -0
  35. package/features/site/favicon.ico +0 -0
  36. package/features/site/index.html +6 -0
  37. package/features/steps/UI.ts +91 -0
  38. package/features/steps/tsconfig.json +9 -0
  39. package/features/ui.feature +93 -0
  40. package/package.json +11 -10
  41. package/readme.md +160 -47
  42. package/schemas/annotation.cos.yaml +29 -1
  43. package/schemas/manifest.cos.yaml +9 -2
  44. package/source/Aspect.test.ts +89 -9
  45. package/source/Aspect.ts +64 -5
  46. package/source/Client.test.ts +108 -0
  47. package/source/Client.ts +258 -0
  48. package/source/Composition.ts +57 -0
  49. package/source/Factory.ts +29 -6
  50. package/source/Secret.test.ts +32 -0
  51. package/source/Secret.ts +29 -0
  52. package/source/UI.ts +212 -0
  53. package/source/configuration.test.ts +96 -40
  54. package/source/configuration.ts +30 -11
  55. package/source/const.ts +17 -0
  56. package/source/deployment.test.ts +78 -12
  57. package/source/deployment.ts +75 -27
  58. package/source/epoch.test.ts +29 -0
  59. package/source/epoch.ts +21 -0
  60. package/source/index.ts +4 -3
  61. package/source/manifest.test.ts +8 -5
  62. package/source/manifest.ts +2 -4
  63. package/source/schemas.ts +1 -1
  64. package/transpiled/Aspect.d.ts +18 -4
  65. package/transpiled/Aspect.js +50 -9
  66. package/transpiled/Aspect.js.map +1 -1
  67. package/transpiled/Aspect.test.js +63 -12
  68. package/transpiled/Aspect.test.js.map +1 -1
  69. package/transpiled/Client.d.ts +61 -0
  70. package/transpiled/Client.js +169 -0
  71. package/transpiled/Client.js.map +1 -0
  72. package/transpiled/Client.test.d.ts +1 -0
  73. package/transpiled/Client.test.js +78 -0
  74. package/transpiled/Client.test.js.map +1 -0
  75. package/transpiled/Composition.d.ts +14 -0
  76. package/transpiled/Composition.js +38 -0
  77. package/transpiled/Composition.js.map +1 -0
  78. package/transpiled/Factory.d.ts +8 -2
  79. package/transpiled/Factory.js +20 -9
  80. package/transpiled/Factory.js.map +1 -1
  81. package/transpiled/Secret.d.ts +12 -0
  82. package/transpiled/Secret.js +22 -0
  83. package/transpiled/Secret.js.map +1 -0
  84. package/transpiled/Secret.test.d.ts +1 -0
  85. package/transpiled/Secret.test.js +26 -0
  86. package/transpiled/Secret.test.js.map +1 -0
  87. package/transpiled/UI.d.ts +25 -0
  88. package/transpiled/UI.js +172 -0
  89. package/transpiled/UI.js.map +1 -0
  90. package/transpiled/configuration.d.ts +7 -2
  91. package/transpiled/configuration.js +30 -41
  92. package/transpiled/configuration.js.map +1 -1
  93. package/transpiled/configuration.test.js +90 -43
  94. package/transpiled/configuration.test.js.map +1 -1
  95. package/transpiled/const.d.ts +11 -0
  96. package/transpiled/const.js +11 -0
  97. package/transpiled/const.js.map +1 -0
  98. package/transpiled/deployment.d.ts +9 -3
  99. package/transpiled/deployment.js +62 -57
  100. package/transpiled/deployment.js.map +1 -1
  101. package/transpiled/deployment.test.js +61 -13
  102. package/transpiled/deployment.test.js.map +1 -1
  103. package/transpiled/epoch.d.ts +2 -0
  104. package/transpiled/epoch.js +17 -0
  105. package/transpiled/epoch.js.map +1 -0
  106. package/transpiled/epoch.test.d.ts +1 -0
  107. package/transpiled/epoch.test.js +22 -0
  108. package/transpiled/epoch.test.js.map +1 -0
  109. package/transpiled/index.d.ts +4 -3
  110. package/transpiled/index.js +4 -9
  111. package/transpiled/index.js.map +1 -1
  112. package/transpiled/manifest.d.ts +1 -1
  113. package/transpiled/manifest.js +2 -31
  114. package/transpiled/manifest.js.map +1 -1
  115. package/transpiled/manifest.test.js +9 -9
  116. package/transpiled/manifest.test.js.map +1 -1
  117. package/transpiled/schemas.js +5 -31
  118. package/transpiled/schemas.js.map +1 -1
  119. package/tsconfig.json +2 -1
  120. package/tsconfig.tsbuildinfo +1 -0
  121. package/ui/dist/_app/env.js +1 -0
  122. package/ui/dist/_app/immutable/assets/0.CNS8Cqhc.css +2 -0
  123. package/ui/dist/_app/immutable/assets/inter-cyrillic-ext-wght-normal.BOeWTOD4.woff2 +0 -0
  124. package/ui/dist/_app/immutable/assets/inter-cyrillic-wght-normal.DqGufNeO.woff2 +0 -0
  125. package/ui/dist/_app/immutable/assets/inter-greek-ext-wght-normal.DlzME5K_.woff2 +0 -0
  126. package/ui/dist/_app/immutable/assets/inter-greek-wght-normal.CkhJZR-_.woff2 +0 -0
  127. package/ui/dist/_app/immutable/assets/inter-latin-ext-wght-normal.DO1Apj_S.woff2 +0 -0
  128. package/ui/dist/_app/immutable/assets/inter-latin-wght-normal.Dx4kXJAl.woff2 +0 -0
  129. package/ui/dist/_app/immutable/assets/inter-vietnamese-wght-normal.CBcvBZtf.woff2 +0 -0
  130. package/ui/dist/_app/immutable/assets/ui.BghF56l_.css +1 -0
  131. package/ui/dist/_app/immutable/chunks/BBRsRBKl.js +6 -0
  132. package/ui/dist/_app/immutable/chunks/BBjoSbGn.js +8 -0
  133. package/ui/dist/_app/immutable/chunks/Bjy-W4x2.js +81 -0
  134. package/ui/dist/_app/immutable/chunks/Bzfl3Xp_.js +1 -0
  135. package/ui/dist/_app/immutable/chunks/C6nSKt5F.js +50 -0
  136. package/ui/dist/_app/immutable/chunks/CcD_ISxM.js +3 -0
  137. package/ui/dist/_app/immutable/chunks/DWNBcI-9.js +1 -0
  138. package/ui/dist/_app/immutable/chunks/xihTtKlq.js +1 -0
  139. package/ui/dist/_app/immutable/entry/app.Dr8IgX3r.js +2 -0
  140. package/ui/dist/_app/immutable/entry/start.Dy9qIspC.js +1 -0
  141. package/ui/dist/_app/immutable/nodes/0.zxJ_VvIF.js +1 -0
  142. package/ui/dist/_app/immutable/nodes/1.DasPjSN2.js +1 -0
  143. package/ui/dist/_app/immutable/nodes/2.9VqQT6jB.js +1 -0
  144. package/ui/dist/_app/immutable/nodes/3.D8a8RCsW.js +1 -0
  145. package/ui/dist/_app/immutable/nodes/4.y19mXraP.js +1 -0
  146. package/ui/dist/_app/version.json +1 -0
  147. package/ui/dist/apple-touch-icon.png +0 -0
  148. package/ui/dist/favicon-96x96.png +0 -0
  149. package/ui/dist/favicon.ico +0 -0
  150. package/ui/dist/index.html +52 -0
  151. package/ui/dist/robots.txt +3 -0
  152. package/transpiled/tsconfig.tsbuildinfo +0 -1
package/CHANGELOG.md ADDED
@@ -0,0 +1,340 @@
1
+ # Change Log
2
+
3
+ All notable changes to this project will be documented in this file.
4
+ See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
+
6
+ # [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)
7
+
8
+ ### Bug Fixes
9
+
10
+ * **deps:** state the cookie bump where npm can resolve it ([11fcdf8](https://github.com/toa-io/toa/commit/11fcdf874ee33107901b5c06435ab10fba64870f))
11
+
12
+
13
+ # [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)
14
+
15
+ ### Bug Fixes
16
+
17
+ * **deps:** update cookie in UI lockfiles ([d32106b](https://github.com/toa-io/toa/commit/d32106be40728156e82858f37b4d04163d1e1652))
18
+
19
+
20
+ # [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)
21
+
22
+ **Note:** Version bump only for package @toa.io/extensions.configuration
23
+
24
+
25
+
26
+
27
+
28
+ # [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)
29
+
30
+ ### Bug Fixes
31
+
32
+ * drop the build output that landed beside the sources ([a724f69](https://github.com/toa-io/toa/commit/a724f6921190e5c9d945e33c6035bb12d832e5c8))
33
+
34
+
35
+ # [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)
36
+
37
+
38
+ ### Features
39
+
40
+ * **configuration:** log the epoch a value was resolved under ([ff51ff6](https://github.com/toa-io/toa/commit/ff51ff629592159eeac562059ceb944f193ad7e8))
41
+
42
+
43
+
44
+
45
+
46
+ # [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)
47
+
48
+
49
+ ### Bug Fixes
50
+
51
+ * **configuration:** ship the component's code and the built page ([6ffe988](https://github.com/toa-io/toa/commit/6ffe988a9e67025c114e74ba94665b28a2cafaa1))
52
+ * **introspection:** keep a sideways scroll off the browser's back gesture ([419e012](https://github.com/toa-io/toa/commit/419e012ce093bcd0429dc93fe457bbd964cfc11c))
53
+
54
+
55
+ ### Features
56
+
57
+ * **ui:** give both consoles a favicon ([27d3881](https://github.com/toa-io/toa/commit/27d3881eda10e59dc4c9c5ef38c2a58b71e1448d))
58
+ * **ui:** leave signing out to its icon ([a82fbab](https://github.com/toa-io/toa/commit/a82fbab513706436254348a5e35115dc3721873f))
59
+
60
+
61
+
62
+
63
+
64
+ # [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)
65
+
66
+
67
+ * 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)
68
+
69
+
70
+ ### Features
71
+
72
+ * **configuration:** drop the label from the epoch ([4baaff5](https://github.com/toa-io/toa/commit/4baaff5b22d00719142a65d56b50a1b100b29fbd))
73
+
74
+
75
+ ### BREAKING CHANGES
76
+
77
+ * a secret configuration value is an object, not a string;
78
+ read it with `unwrap()`.
79
+
80
+ Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
81
+
82
+ * test(configuration): wait for the second round rather than assume it
83
+
84
+ Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
85
+
86
+ * refactor(configuration)!: read a secret with its own unwrap
87
+
88
+ Component code depends on no Toa package, so a secret is read as
89
+ `context.configuration.apiKey.unwrap()` and the helper in `@toa.io/generic`
90
+ goes. A value a component reads as a secret is therefore given as a reference:
91
+ `identity.basic` no longer defaults `pepper` to `''`, the development context
92
+ and the feature harness give the token keys, the federation client secret and
93
+ the signing key as references, and the harness has a step for the secrets a
94
+ scenario refers to. CONTRIBUTING states the rule.
95
+ * `identity.basic` `pepper` has no default; a value read as a
96
+ secret must be given as a `$NAME` reference.
97
+
98
+ Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
99
+
100
+ * feat(configuration): list the configurations
101
+
102
+ `configuration.values.list` returns every component's configuration for its
103
+ deployed epoch, by component name, and `GET /configuration/values/` serves it
104
+ behind `system:configuration:get`.
105
+
106
+ Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
107
+
108
+ * fix(exposition): write a value in YAML the way its toJSON says
109
+
110
+ A redacted secret in a reply was dumped as an empty object; it is written as
111
+ `<REDACTED>`, as JSON and msgpack already write it.
112
+
113
+ Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
114
+
115
+ * test(configuration): a secret is an object, and stays redacted in a reply
116
+
117
+ A component with `{ a: 1, b: $SECRET_B }` returns its configuration as
118
+ `{ a: 1, b: '<REDACTED>' }` and the secret itself through `unwrap()`. The reply
119
+ step also accepts a reply as a caller across a process boundary receives it,
120
+ since a call within the process hands the object over as it is.
121
+
122
+ Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
123
+
124
+ * chore(schemas): bump the dependencies
125
+
126
+ ajv 8.18.0 to 8.20.0, ajv-formats 2.1.1 to 3.0.1, better-ajv-errors 1.2.0
127
+ 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
128
+ exposition already uses. The three majors keep the CommonJS entry points this
129
+ library calls: ajv-formats as a function, better-ajv-errors as .default, and
130
+ js-yaml's load.
131
+
132
+ Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
133
+
134
+ * feat(configuration)!: serve the schema with the value
135
+
136
+ GET /configuration/values/:component/ answers { configuration, schema, epoch }
137
+ where it answered with the configuration alone, and list carries the schema of
138
+ every component. Nothing reads a configuration without needing to know what it
139
+ is checked against, and the schema was only ever on the values service.
140
+
141
+ An epoch the deployment does not know has no schema; the value stored for it
142
+ is still returned.
143
+
144
+ Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
145
+
146
+ * feat(configuration): publish a configuration UI
147
+
148
+ The values service serves a page at /.configuration on port 8003, out of the
149
+ directory ui builds: the configured components, a screen per component showing
150
+ what it holds now, and a dialog creating the next one. Reading needs
151
+ system:configuration:get and creating needs system:configuration:create.
152
+
153
+ A configuration is immutable, so the dialog opens on the current value and what
154
+ is left out of it is left out of the component. The editor takes YAML, the
155
+ schema is applied before anything is sent, and a secret is a reference the page
156
+ never shows.
157
+
158
+ The page is always published: the annotation is the per-component values map
159
+ and has nowhere to carry a switch.
160
+
161
+ Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
162
+
163
+ * feat(introspection): link a component to its configuration
164
+
165
+ A card carrying @toa.io/extensions.configuration reads that extension as a link
166
+ to the configuration UI rather than as a name, and configuration joins the
167
+ namespaces the runtime provides, so its components band under System.
168
+
169
+ Deployed, both pages sit behind the same ingress and the path alone is right;
170
+ locally each console has its own port.
171
+
172
+ Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
173
+
174
+ * feat(introspection): scroll the map, zoom with a modifier
175
+
176
+ The map was grabbed to move and zoomed with a bare wheel, which is neither what
177
+ a page does nor what the wheel does anywhere else. A plain scroll now pans on
178
+ both axes and the wheel scales only with the modifier held — a trackpad pinch
179
+ arrives as one of those on every platform.
180
+
181
+ A card's own scrollable box keeps its wheel, in both paths.
182
+
183
+ Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
184
+
185
+ * refactor(introspection): centre the filter in the header
186
+
187
+ The sides take equal space, which is what leaves the filter between them.
188
+ Neither side may shrink under what it holds, or the tabs run out from under
189
+ their side and across the filter, and the filter across the sign-out button;
190
+ the title gives way instead.
191
+
192
+ Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
193
+
194
+ * fix(configuration): connect the UI to the values service
195
+
196
+ The page was declared as a dependency from inside `open`, and a connector connects
197
+ what it depends on before `open` runs — so the server was constructed and never
198
+ listened. Nothing caught it: the UI feature builds the server itself.
199
+
200
+ Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
201
+
202
+ * feat(configuration)!: reserve resources in the annotation
203
+
204
+ The values service deploys like any other and must state what it may take, but the
205
+ annotation is a map of component ids and had nowhere to put it — so `toa env` failed
206
+ for every context using configuration unless it declared a context-wide `resources`.
207
+
208
+ `resources` is now the service's own, read the way `introspection` and `realtime` read
209
+ theirs. A component actually named `resources` is written `default.resources`, which is
210
+ what its id is anyway.
211
+
212
+ Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
213
+
214
+ * feat(configuration): follow the system colour scheme
215
+
216
+ The dark tokens were behind a `.dark` class nothing sets, and the `dark:` variant was
217
+ pointed at that class too — so a component's own dark styling never applied either.
218
+ Both now key off `prefers-color-scheme`, and `color-scheme` hands the native chrome
219
+ the same answer.
220
+
221
+ Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
222
+
223
+ * feat(introspection): follow the system colour scheme
224
+
225
+ The dark tokens were behind a `.dark` class nothing sets, and the `dark:` variant was
226
+ pointed at that class too — so a component's own dark styling never applied either.
227
+ Both now key off `prefers-color-scheme`, and `color-scheme` hands the native chrome
228
+ the same answer.
229
+
230
+ Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
231
+
232
+ * feat(configuration): present a change as an edit of what is there
233
+
234
+ A configuration is immutable and creating one replaces the whole of it, but the dialog
235
+ opens on the current value and the page never shows an older one — so what the reader
236
+ does is edit. The words follow: Edit rather than New, Update rather than Create, and
237
+ the paragraph explaining the model goes, along with the field's label, which the title
238
+ above it already said.
239
+
240
+ The editor also stayed as wide as its longest line — `field-sizing: content` sizes to
241
+ content, and no `max-width` clamps that — so a long value painted outside the dialog.
242
+ It is fixed now, the dialog takes the width the screen has rather than a fixed step,
243
+ and the band held for errors no longer leaves a gap when there are none.
244
+
245
+ Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
246
+
247
+ * feat(configuration): mark a component that keeps a secret
248
+
249
+ A key after the name on the row, wherever the configuration holds a reference, however
250
+ deep. The predicate reads the same lines the value screen renders, so the two cannot
251
+ disagree about what counts as a secret.
252
+
253
+ Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
254
+
255
+ * feat(configuration): lead back to the list from the title
256
+
257
+ Every address ends in a slash, so the way up is the address itself on the list and one
258
+ level above it on a component's screen — which holds wherever the page is mounted.
259
+
260
+ Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
261
+
262
+
263
+
264
+
265
+
266
+ # [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)
267
+
268
+ **Note:** Version bump only for package @toa.io/extensions.configuration
269
+
270
+
271
+
272
+
273
+
274
+ # [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)
275
+
276
+ **Note:** Version bump only for package @toa.io/extensions.configuration
277
+
278
+
279
+
280
+
281
+
282
+ # [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)
283
+
284
+ **Note:** Version bump only for package @toa.io/extensions.configuration
285
+
286
+
287
+
288
+
289
+
290
+ # [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)
291
+
292
+ **Note:** Version bump only for package @toa.io/extensions.configuration
293
+
294
+
295
+
296
+
297
+
298
+ # [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)
299
+
300
+ **Note:** Version bump only for package @toa.io/extensions.configuration
301
+
302
+
303
+
304
+
305
+
306
+ # [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)
307
+
308
+ **Note:** Version bump only for package @toa.io/extensions.configuration
309
+
310
+
311
+
312
+
313
+
314
+ # [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)
315
+
316
+ **Note:** Version bump only for package @toa.io/extensions.configuration
317
+
318
+
319
+
320
+
321
+
322
+ # [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)
323
+
324
+ **Note:** Version bump only for package @toa.io/extensions.configuration
325
+
326
+
327
+
328
+
329
+
330
+ # [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)
331
+
332
+ **Note:** Version bump only for package @toa.io/extensions.configuration
333
+
334
+
335
+
336
+
337
+
338
+ # [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)
339
+
340
+ **Note:** Version bump only for package @toa.io/extensions.configuration
@@ -0,0 +1,158 @@
1
+ namespace: configuration
2
+ name: values
3
+
4
+ # One document per configuration created. Documents are immutable: a change is a new
5
+ # document, and the latest one for a component and an epoch is the last created.
6
+ # What every component's epoch, schema and defaults are, the service is told on
7
+ # deployment (`TOA_CONFIGURATION_VALUES`). A created object is published as the
8
+ # prototype's `created` event.
9
+
10
+ entity:
11
+ schema:
12
+ type: object
13
+ properties:
14
+ component:
15
+ type: string
16
+ epoch:
17
+ type: string
18
+ configuration:
19
+ type: object
20
+ originator:
21
+ type: string
22
+ required:
23
+ - component
24
+ - epoch
25
+ - configuration
26
+ - originator
27
+ index:
28
+ lookup:
29
+ component: asc
30
+ epoch: asc
31
+ _created: desc
32
+
33
+ operations:
34
+ # the latest configuration of a component: created, else deployed defaults, else none
35
+ get:
36
+ query: false
37
+ input:
38
+ type: object
39
+ properties:
40
+ component:
41
+ type: string
42
+ epoch:
43
+ type: string
44
+ required:
45
+ - component
46
+ # the value and the schema it is checked against, so a caller can show and check it
47
+ output:
48
+ type: object
49
+ nullable: true
50
+ properties:
51
+ configuration:
52
+ type: object
53
+ schema:
54
+ type: object
55
+ epoch:
56
+ type: string
57
+ required:
58
+ - configuration
59
+ - epoch
60
+ # the same for many at once, as the aspects of one process ask
61
+ fetch:
62
+ query: false
63
+ input:
64
+ type: array
65
+ items:
66
+ type: object
67
+ properties:
68
+ component:
69
+ type: string
70
+ epoch:
71
+ type: string
72
+ required:
73
+ - component
74
+ - epoch
75
+ output:
76
+ type: array
77
+ items:
78
+ type: object
79
+ properties:
80
+ component:
81
+ type: string
82
+ epoch:
83
+ type: string
84
+ configuration:
85
+ type: object
86
+ nullable: true
87
+ created:
88
+ type: integer
89
+ required:
90
+ - component
91
+ - epoch
92
+ - configuration
93
+ - created
94
+ # every component's configuration for its deployed epoch, by component name
95
+ list:
96
+ query: false
97
+ output:
98
+ type: array
99
+ items:
100
+ type: object
101
+ properties:
102
+ component:
103
+ type: string
104
+ epoch:
105
+ type: string
106
+ schema:
107
+ type: object
108
+ configuration:
109
+ type: object
110
+ required:
111
+ - component
112
+ - epoch
113
+ - schema
114
+ - configuration
115
+ create:
116
+ query: false
117
+ input:
118
+ type: object
119
+ properties:
120
+ component:
121
+ type: string
122
+ configuration:
123
+ type: object
124
+ originator:
125
+ type: object
126
+ properties:
127
+ id:
128
+ type: string
129
+ required:
130
+ - id
131
+ required:
132
+ - component
133
+ - configuration
134
+ - originator
135
+ errors:
136
+ - UNKNOWN_COMPONENT
137
+ - INVALID_CONFIGURATION
138
+
139
+ exposition:
140
+ isolated: true
141
+ /:
142
+ GET:
143
+ io:output: true
144
+ auth:role: system:configuration:get
145
+ endpoint: list
146
+ /:component:
147
+ map:segments:
148
+ component: component
149
+ GET:
150
+ io:output: true
151
+ auth:role: system:configuration:get
152
+ endpoint: get
153
+ POST:
154
+ io:output: [id, epoch]
155
+ auth:rule:
156
+ role: system:configuration:create
157
+ delegate: originator
158
+ endpoint: create
@@ -0,0 +1,16 @@
1
+ export declare function transition(input: Input, object: Entity): Promise<Entity | Error>;
2
+ interface Input {
3
+ component: string;
4
+ configuration: object;
5
+ originator: {
6
+ id: string;
7
+ };
8
+ }
9
+ interface Entity {
10
+ id: string;
11
+ component: string;
12
+ epoch: string;
13
+ configuration: object;
14
+ originator: string;
15
+ }
16
+ export {};
@@ -0,0 +1,31 @@
1
+ import * as schemas from '@toa.io/schemas';
2
+ import { entry } from './lib/map.js';
3
+ export async function transition(input, object) {
4
+ const known = entry(input.component);
5
+ if (known === undefined)
6
+ return new UnknownComponentError(input.component);
7
+ // the schema fills its defaults, so what is stored is whole
8
+ const configuration = structuredClone(input.configuration);
9
+ const schema = schemas.schema(known.schema);
10
+ try {
11
+ schema.validate(configuration);
12
+ }
13
+ catch (error) {
14
+ return new InvalidConfigurationError(error.message);
15
+ }
16
+ object.component = input.component;
17
+ object.epoch = known.epoch;
18
+ object.configuration = configuration;
19
+ object.originator = input.originator.id;
20
+ return object;
21
+ }
22
+ class UnknownComponentError extends Error {
23
+ code = 'UNKNOWN_COMPONENT';
24
+ constructor(component) {
25
+ super(`Component '${component}' is not configured`);
26
+ }
27
+ }
28
+ class InvalidConfigurationError extends Error {
29
+ code = 'INVALID_CONFIGURATION';
30
+ }
31
+ //# sourceMappingURL=create.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create.js","sourceRoot":"","sources":["../source/create.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,iBAAiB,CAAA;AAC1C,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAA;AAGpC,MAAM,CAAC,KAAK,UAAU,UAAU,CAAE,KAAY,EAAE,MAAc;IAC5D,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,SAAS,CAAC,CAAA;IAEpC,IAAI,KAAK,KAAK,SAAS;QACrB,OAAO,IAAI,qBAAqB,CAAC,KAAK,CAAC,SAAS,CAAC,CAAA;IAEnD,4DAA4D;IAC5D,MAAM,aAAa,GAAG,eAAe,CAAC,KAAK,CAAC,aAAa,CAAC,CAAA;IAE1D,MAAM,MAAM,GAAgB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAA;IAExD,IAAI,CAAC;QACH,MAAM,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAA;IAChC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,IAAI,yBAAyB,CAAE,KAAe,CAAC,OAAO,CAAC,CAAA;IAChE,CAAC;IAED,MAAM,CAAC,SAAS,GAAG,KAAK,CAAC,SAAS,CAAA;IAClC,MAAM,CAAC,KAAK,GAAG,KAAK,CAAC,KAAK,CAAA;IAC1B,MAAM,CAAC,aAAa,GAAG,aAAa,CAAA;IACpC,MAAM,CAAC,UAAU,GAAG,KAAK,CAAC,UAAU,CAAC,EAAE,CAAA;IAEvC,OAAO,MAAM,CAAA;AACf,CAAC;AAED,MAAM,qBAAsB,SAAQ,KAAK;IACvB,IAAI,GAAG,mBAAmB,CAAA;IAE1C,YAAoB,SAAiB;QACnC,KAAK,CAAC,cAAc,SAAS,qBAAqB,CAAC,CAAA;IACrD,CAAC;CACF;AAED,MAAM,yBAA0B,SAAQ,KAAK;IAC3B,IAAI,GAAG,uBAAuB,CAAA;CAC/C"}
@@ -0,0 +1,11 @@
1
+ import { type Context } from './lib/resolve.js';
2
+ export declare function computation(input: Pair[], context: Context): Promise<Fetched[]>;
3
+ interface Pair {
4
+ component: string;
5
+ epoch: string;
6
+ }
7
+ interface Fetched extends Pair {
8
+ configuration: object | null;
9
+ created: number;
10
+ }
11
+ export {};
@@ -0,0 +1,13 @@
1
+ import { resolve } from './lib/resolve.js';
2
+ export async function computation(input, context) {
3
+ return await Promise.all(input.map(async ({ component, epoch }) => {
4
+ const value = await resolve(context, component, epoch);
5
+ return {
6
+ component,
7
+ epoch,
8
+ configuration: value === null ? null : value.configuration,
9
+ created: value === null ? 0 : value.created
10
+ };
11
+ }));
12
+ }
13
+ //# sourceMappingURL=fetch.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fetch.js","sourceRoot":"","sources":["../source/fetch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAgB,MAAM,kBAAkB,CAAA;AAExD,MAAM,CAAC,KAAK,UAAU,WAAW,CAAE,KAAa,EAAE,OAAgB;IAChE,OAAO,MAAM,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,EAAE;QAChE,MAAM,KAAK,GAAG,MAAM,OAAO,CAAC,OAAO,EAAE,SAAS,EAAE,KAAK,CAAC,CAAA;QAEtD,OAAO;YACL,SAAS;YACT,KAAK;YACL,aAAa,EAAE,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,aAAa;YAC1D,OAAO,EAAE,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO;SAC5C,CAAA;IACH,CAAC,CAAC,CAAC,CAAA;AACL,CAAC"}
@@ -0,0 +1,17 @@
1
+ import { type Context } from './lib/resolve.js';
2
+ /**
3
+ * The latest configuration of a component, with the schema it is checked against. The
4
+ * schema is the deployment's, so an epoch the deployment does not know has none — the
5
+ * value is still what was stored for it.
6
+ */
7
+ export declare function computation(input: Input, context: Context): Promise<Item | null>;
8
+ interface Input {
9
+ component: string;
10
+ epoch?: string;
11
+ }
12
+ interface Item {
13
+ configuration: object;
14
+ schema?: object;
15
+ epoch: string;
16
+ }
17
+ export {};
@@ -0,0 +1,19 @@
1
+ import { entry } from './lib/map.js';
2
+ import { resolve } from './lib/resolve.js';
3
+ /**
4
+ * The latest configuration of a component, with the schema it is checked against. The
5
+ * schema is the deployment's, so an epoch the deployment does not know has none — the
6
+ * value is still what was stored for it.
7
+ */
8
+ export async function computation(input, context) {
9
+ const value = await resolve(context, input.component, input.epoch);
10
+ if (value === null)
11
+ return null;
12
+ const known = entry(input.component);
13
+ return {
14
+ configuration: value.configuration,
15
+ schema: known?.schema,
16
+ epoch: input.epoch ?? known.epoch
17
+ };
18
+ }
19
+ //# sourceMappingURL=get.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get.js","sourceRoot":"","sources":["../source/get.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAA;AACpC,OAAO,EAAE,OAAO,EAAgB,MAAM,kBAAkB,CAAA;AAExD;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAAE,KAAY,EAAE,OAAgB;IAC/D,MAAM,KAAK,GAAG,MAAM,OAAO,CAAC,OAAO,EAAE,KAAK,CAAC,SAAS,EAAE,KAAK,CAAC,KAAK,CAAC,CAAA;IAElE,IAAI,KAAK,KAAK,IAAI;QAChB,OAAO,IAAI,CAAA;IAEb,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,SAAS,CAAC,CAAA;IAEpC,OAAO;QACL,aAAa,EAAE,KAAK,CAAC,aAAa;QAClC,MAAM,EAAE,KAAK,EAAE,MAAM;QACrB,KAAK,EAAE,KAAK,CAAC,KAAK,IAAI,KAAM,CAAC,KAAK;KACnC,CAAA;AACH,CAAC"}
@@ -0,0 +1,11 @@
1
+ /** What the deployment told the service about every configured component. */
2
+ export declare function entry(component: string): Entry | undefined;
3
+ /** The configured components, by name. */
4
+ export declare function components(): string[];
5
+ export declare const VARIABLE = "TOA_CONFIGURATION_VALUES";
6
+ export interface Entry {
7
+ epoch: string;
8
+ schema: object;
9
+ defaults?: object;
10
+ }
11
+ export type Values = Record<string, Entry>;
@@ -0,0 +1,21 @@
1
+ /** What the deployment told the service about every configured component. */
2
+ export function entry(component) {
3
+ return read()[component];
4
+ }
5
+ /** The configured components, by name. */
6
+ export function components() {
7
+ return Object.keys(read()).sort();
8
+ }
9
+ function read() {
10
+ const source = process.env[VARIABLE] ?? '{}';
11
+ // read again once the variable changes, as it does between scenarios of one process
12
+ if (source !== parsed) {
13
+ values = JSON.parse(source);
14
+ parsed = source;
15
+ }
16
+ return values;
17
+ }
18
+ let parsed = null;
19
+ let values = {};
20
+ export const VARIABLE = 'TOA_CONFIGURATION_VALUES';
21
+ //# sourceMappingURL=map.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"map.js","sourceRoot":"","sources":["../../source/lib/map.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,MAAM,UAAU,KAAK,CAAE,SAAiB;IACtC,OAAO,IAAI,EAAE,CAAC,SAAS,CAAC,CAAA;AAC1B,CAAC;AAED,0CAA0C;AAC1C,MAAM,UAAU,UAAU;IACxB,OAAO,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAA;AACnC,CAAC;AAED,SAAS,IAAI;IACX,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,IAAI,IAAI,CAAA;IAE5C,oFAAoF;IACpF,IAAI,MAAM,KAAK,MAAM,EAAE,CAAC;QACtB,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAW,CAAA;QACrC,MAAM,GAAG,MAAM,CAAA;IACjB,CAAC;IAED,OAAO,MAAM,CAAA;AACf,CAAC;AAED,IAAI,MAAM,GAAkB,IAAI,CAAA;AAChC,IAAI,MAAM,GAAW,EAAE,CAAA;AAEvB,MAAM,CAAC,MAAM,QAAQ,GAAG,0BAA0B,CAAA"}