@toa.io/extensions.configuration 1.0.0-alpha.282 → 1.0.0-alpha.283
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 +14 -0
- package/components/configuration.values/types/index.d.ts +3 -0
- package/components/configuration.values/types/toa.d.ts +68 -0
- package/package.json +5 -5
- package/source/Secret.ts +6 -3
- package/source/context.ts +13 -0
- package/source/index.ts +6 -0
- package/transpiled/Secret.d.ts +6 -3
- package/transpiled/Secret.js +5 -1
- package/transpiled/Secret.js.map +1 -1
- package/transpiled/context.d.ts +4 -0
- package/transpiled/context.js +9 -0
- package/transpiled/context.js.map +1 -0
- package/transpiled/index.d.ts +2 -0
- package/transpiled/index.js +4 -0
- package/transpiled/index.js.map +1 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/ui/dist/_app/immutable/chunks/{CcWYApmX.js → 4P-VMHlb.js} +2 -2
- package/ui/dist/_app/immutable/chunks/{DNNahQnI.js → BR0r7ehv.js} +1 -1
- package/ui/dist/_app/immutable/chunks/C6SvLx74.js +1 -0
- package/ui/dist/_app/immutable/chunks/{_OCUOSf_.js → D4R3sAUA.js} +1 -1
- package/ui/dist/_app/immutable/chunks/{XPGIBZyO.js → pcT5puVp.js} +1 -1
- package/ui/dist/_app/immutable/entry/{app.Dm0NVzuV.js → app.iFQBmOia.js} +2 -2
- package/ui/dist/_app/immutable/entry/start.BJ8wH2bz.js +1 -0
- package/ui/dist/_app/immutable/nodes/{0.C1zAG1m5.js → 0.COfWb7Uk.js} +1 -1
- package/ui/dist/_app/immutable/nodes/{1.QblBNjka.js → 1.Do_XXsj8.js} +1 -1
- package/ui/dist/_app/immutable/nodes/{2.CyVYZW9A.js → 2.YNbZtxbt.js} +1 -1
- package/ui/dist/_app/immutable/nodes/3.DPdUtAMe.js +1 -0
- package/ui/dist/_app/immutable/nodes/{4.CZA2PMJQ.js → 4.BDs6ujpw.js} +1 -1
- package/ui/dist/_app/version.json +1 -1
- package/ui/dist/index.html +10 -10
- package/ui/dist/_app/immutable/chunks/BI4iTnyC.js +0 -1
- package/ui/dist/_app/immutable/entry/start.DWjxVbPv.js +0 -1
- package/ui/dist/_app/immutable/nodes/3.DJ58VY-o.js +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,20 @@
|
|
|
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.283](https://github.com/toa-io/toa/compare/v1.0.0-alpha.282...v1.0.0-alpha.283) (2026-09-04)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* **cli:** an assignment hands back the new state, not nothing ([91304e9](https://github.com/toa-io/toa/commit/91304e9e9a3bba5933b7421b7a0ffff0c2e47795))
|
|
11
|
+
* **storages:** take `Maybe` from core, not from the deprecated package ([bcaeeb3](https://github.com/toa-io/toa/commit/bcaeeb3c76c89af34e94ff569a210d21b7e87f64))
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
* **cli:** a type module is declarations, so it sits beside a component's source ([ca755d9](https://github.com/toa-io/toa/commit/ca755d93d1a04b7697dd0dd12eb59e5b6e2a71d1))
|
|
16
|
+
* **cli:** the built-in components ship types generated from their manifests ([bd7db9e](https://github.com/toa-io/toa/commit/bd7db9e88e46c1060223761898932239127f389a))
|
|
17
|
+
* **extensions:** an extension declares what it puts on a component's context ([133bc2a](https://github.com/toa-io/toa/commit/133bc2aad1e45a2d4aa68a08a5e44ca48d3b7414))
|
|
18
|
+
|
|
19
|
+
|
|
6
20
|
# [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)
|
|
7
21
|
|
|
8
22
|
### Features
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
// Written by `toa types`. Every run rewrites it.
|
|
2
|
+
// What a manifest does not state belongs in a file of your own.
|
|
3
|
+
|
|
4
|
+
import type { Query, RemoteError } from '@toa.io/core'
|
|
5
|
+
import type { Readable } from 'node:stream'
|
|
6
|
+
|
|
7
|
+
export interface Entity {
|
|
8
|
+
component: string
|
|
9
|
+
epoch: string
|
|
10
|
+
configuration: Record<string, unknown>
|
|
11
|
+
originator: string
|
|
12
|
+
id: string
|
|
13
|
+
_version?: number
|
|
14
|
+
_created?: number
|
|
15
|
+
_updated?: number
|
|
16
|
+
_deleted?: number | null
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export type GetInput = {
|
|
20
|
+
component: string
|
|
21
|
+
epoch?: string
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export type GetOutput = {
|
|
25
|
+
configuration: Record<string, unknown>
|
|
26
|
+
schema?: Record<string, unknown>
|
|
27
|
+
epoch: string
|
|
28
|
+
} | null
|
|
29
|
+
|
|
30
|
+
export type FetchInput = Array<{
|
|
31
|
+
component: string
|
|
32
|
+
epoch: string
|
|
33
|
+
}>
|
|
34
|
+
|
|
35
|
+
export type FetchOutput = Array<{
|
|
36
|
+
component: string
|
|
37
|
+
epoch: string
|
|
38
|
+
configuration: Record<string, unknown> | null
|
|
39
|
+
created: number
|
|
40
|
+
}>
|
|
41
|
+
|
|
42
|
+
export type ListOutput = Array<{
|
|
43
|
+
component: string
|
|
44
|
+
epoch: string
|
|
45
|
+
schema: Record<string, unknown>
|
|
46
|
+
configuration: Record<string, unknown>
|
|
47
|
+
}>
|
|
48
|
+
|
|
49
|
+
export type CreateInput = {
|
|
50
|
+
component: string
|
|
51
|
+
configuration: Record<string, unknown>
|
|
52
|
+
originator: {
|
|
53
|
+
id: string
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export interface Component {
|
|
58
|
+
get: (request: { input: GetInput, task?: boolean }) => Promise<GetOutput>
|
|
59
|
+
fetch: (request: { input: FetchInput, task?: boolean }) => Promise<FetchOutput>
|
|
60
|
+
list: (request: { input?: null, task?: boolean }) => Promise<ListOutput>
|
|
61
|
+
create: (request: { input: CreateInput, task?: boolean }) => Promise<unknown | RemoteError<"UNKNOWN_COMPONENT" | "INVALID_CONFIGURATION">>
|
|
62
|
+
assign: (request: { input?: null, query?: Query<Entity>, task?: boolean }) => Promise<Entity>
|
|
63
|
+
ensure: (request: { input?: null, query?: Query<Entity>, task?: boolean }) => Promise<Entity>
|
|
64
|
+
enumerate: (request: { input?: null, query?: Query<Entity>, task?: boolean }) => Promise<Entity[]>
|
|
65
|
+
observe: (request: { input?: null, query?: Query<Entity>, task?: boolean }) => Promise<Entity | null>
|
|
66
|
+
stream: (request: { input?: null, query?: Query<Entity>, task?: boolean }) => Promise<Readable>
|
|
67
|
+
terminate: (request: { input?: null, query?: Query<Entity>, task?: boolean }) => Promise<Entity>
|
|
68
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@toa.io/extensions.configuration",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.283",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Toa Configuration",
|
|
6
6
|
"author": "temich <tema.gurtovoy@gmail.com>",
|
|
@@ -23,11 +23,11 @@
|
|
|
23
23
|
"prepack": "npm run build:ui",
|
|
24
24
|
"features": "TSX_TSCONFIG_PATH=features/steps/tsconfig.json NODE_OPTIONS=--import=tsx cucumber-js"
|
|
25
25
|
},
|
|
26
|
-
"gitHead": "
|
|
26
|
+
"gitHead": "2f52b023bed0ccb2ecdb2b82fe59fbe38bf282e1",
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@toa.io/core": "1.0.0-alpha.
|
|
29
|
-
"@toa.io/generic": "1.0.0-alpha.
|
|
30
|
-
"@toa.io/schemas": "1.0.0-alpha.
|
|
28
|
+
"@toa.io/core": "1.0.0-alpha.283",
|
|
29
|
+
"@toa.io/generic": "1.0.0-alpha.283",
|
|
30
|
+
"@toa.io/schemas": "1.0.0-alpha.283",
|
|
31
31
|
"openspan": "1.0.0-alpha.277"
|
|
32
32
|
}
|
|
33
33
|
}
|
package/source/Secret.ts
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { inspect } from 'node:util'
|
|
2
|
-
import type { Secret as Contract } from '@toa.io/types'
|
|
3
2
|
|
|
4
|
-
/**
|
|
5
|
-
|
|
3
|
+
/**
|
|
4
|
+
* A configuration value that must not leak: a string only to whoever asks for it.
|
|
5
|
+
*
|
|
6
|
+
* This is what a value declared `format: secret` is on a component's context.
|
|
7
|
+
*/
|
|
8
|
+
export class Secret {
|
|
6
9
|
readonly #value: string
|
|
7
10
|
|
|
8
11
|
public constructor (value: string) {
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Manifest } from './manifest.js'
|
|
2
|
+
import type { Contribution } from '@toa.io/core'
|
|
3
|
+
|
|
4
|
+
/** What this extension puts on the context of a component that declares it. */
|
|
5
|
+
export function context (declaration: Manifest): Contribution {
|
|
6
|
+
const contribution: Contribution = { name: 'configuration', schema: declaration.schema }
|
|
7
|
+
|
|
8
|
+
// a value the schema declares a secret is one on the context, not a string
|
|
9
|
+
if (JSON.stringify(declaration.schema).includes('"secret"'))
|
|
10
|
+
contribution.imports = { '@toa.io/extensions.configuration': ['Secret'] }
|
|
11
|
+
|
|
12
|
+
return contribution
|
|
13
|
+
}
|
package/source/index.ts
CHANGED
|
@@ -2,3 +2,9 @@ export { manifest } from './manifest.js'
|
|
|
2
2
|
export { deployment, describe } from './deployment.js'
|
|
3
3
|
export { components } from './Composition.js'
|
|
4
4
|
export { Factory } from './Factory.js'
|
|
5
|
+
|
|
6
|
+
// what a value declared `format: secret` is on a component's context
|
|
7
|
+
export { Secret } from './Secret.js'
|
|
8
|
+
|
|
9
|
+
// what this extension puts on a component's context
|
|
10
|
+
export { context } from './context.js'
|
package/transpiled/Secret.d.ts
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { inspect } from 'node:util';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
/**
|
|
3
|
+
* A configuration value that must not leak: a string only to whoever asks for it.
|
|
4
|
+
*
|
|
5
|
+
* This is what a value declared `format: secret` is on a component's context.
|
|
6
|
+
*/
|
|
7
|
+
export declare class Secret {
|
|
5
8
|
#private;
|
|
6
9
|
constructor(value: string);
|
|
7
10
|
unwrap(): string;
|
package/transpiled/Secret.js
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { inspect } from 'node:util';
|
|
2
|
-
/**
|
|
2
|
+
/**
|
|
3
|
+
* A configuration value that must not leak: a string only to whoever asks for it.
|
|
4
|
+
*
|
|
5
|
+
* This is what a value declared `format: secret` is on a component's context.
|
|
6
|
+
*/
|
|
3
7
|
export class Secret {
|
|
4
8
|
#value;
|
|
5
9
|
constructor(value) {
|
package/transpiled/Secret.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Secret.js","sourceRoot":"","sources":["../source/Secret.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;
|
|
1
|
+
{"version":3,"file":"Secret.js","sourceRoot":"","sources":["../source/Secret.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAEnC;;;;GAIG;AACH,MAAM,OAAO,MAAM;IACR,MAAM,CAAQ;IAEvB,YAAoB,KAAa;QAC/B,IAAI,CAAC,MAAM,GAAG,KAAK,CAAA;IACrB,CAAC;IAEM,MAAM;QACX,OAAO,IAAI,CAAC,MAAM,CAAA;IACpB,CAAC;IAEM,QAAQ;QACb,OAAO,QAAQ,CAAA;IACjB,CAAC;IAEM,MAAM;QACX,OAAO,QAAQ,CAAA;IACjB,CAAC;IAEM,CAAC,OAAO,CAAC,MAAM,CAAC;QACrB,OAAO,QAAQ,CAAA;IACjB,CAAC;CACF;AAED,MAAM,CAAC,MAAM,QAAQ,GAAG,YAAY,CAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** What this extension puts on the context of a component that declares it. */
|
|
2
|
+
export function context(declaration) {
|
|
3
|
+
const contribution = { name: 'configuration', schema: declaration.schema };
|
|
4
|
+
// a value the schema declares a secret is one on the context, not a string
|
|
5
|
+
if (JSON.stringify(declaration.schema).includes('"secret"'))
|
|
6
|
+
contribution.imports = { '@toa.io/extensions.configuration': ['Secret'] };
|
|
7
|
+
return contribution;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.js","sourceRoot":"","sources":["../source/context.ts"],"names":[],"mappings":"AAGA,+EAA+E;AAC/E,MAAM,UAAU,OAAO,CAAE,WAAqB;IAC5C,MAAM,YAAY,GAAiB,EAAE,IAAI,EAAE,eAAe,EAAE,MAAM,EAAE,WAAW,CAAC,MAAM,EAAE,CAAA;IAExF,2EAA2E;IAC3E,IAAI,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,UAAU,CAAC;QACzD,YAAY,CAAC,OAAO,GAAG,EAAE,kCAAkC,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAA;IAE3E,OAAO,YAAY,CAAA;AACrB,CAAC"}
|
package/transpiled/index.d.ts
CHANGED
package/transpiled/index.js
CHANGED
|
@@ -2,4 +2,8 @@ export { manifest } from './manifest.js';
|
|
|
2
2
|
export { deployment, describe } from './deployment.js';
|
|
3
3
|
export { components } from './Composition.js';
|
|
4
4
|
export { Factory } from './Factory.js';
|
|
5
|
+
// what a value declared `format: secret` is on a component's context
|
|
6
|
+
export { Secret } from './Secret.js';
|
|
7
|
+
// what this extension puts on a component's context
|
|
8
|
+
export { context } from './context.js';
|
|
5
9
|
//# sourceMappingURL=index.js.map
|
package/transpiled/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../source/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACxC,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../source/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACxC,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AAEtC,qEAAqE;AACrE,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAEpC,oDAAoD;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA"}
|