@toa.io/extensions.configuration 1.0.0-alpha.281 → 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 +21 -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/Client.test.ts +5 -5
- package/source/Client.ts +6 -6
- package/source/Composition.ts +5 -5
- package/source/Factory.ts +6 -7
- package/source/Secret.ts +6 -3
- package/source/context.ts +13 -0
- package/source/index.ts +6 -0
- package/transpiled/Client.d.ts +3 -3
- package/transpiled/Client.js +5 -5
- package/transpiled/Client.js.map +1 -1
- package/transpiled/Client.test.js +3 -3
- package/transpiled/Client.test.js.map +1 -1
- package/transpiled/Composition.d.ts +3 -3
- package/transpiled/Composition.js +4 -4
- package/transpiled/Composition.js.map +1 -1
- package/transpiled/Factory.d.ts +3 -3
- package/transpiled/Factory.js +5 -5
- package/transpiled/Factory.js.map +1 -1
- 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/{BBRsRBKl.js → 4P-VMHlb.js} +2 -2
- package/ui/dist/_app/immutable/chunks/{BBjoSbGn.js → BR0r7ehv.js} +1 -1
- package/ui/dist/_app/immutable/chunks/{Bzfl3Xp_.js → C6SvLx74.js} +1 -1
- package/ui/dist/_app/immutable/chunks/{C6nSKt5F.js → D4R3sAUA.js} +1 -1
- package/ui/dist/_app/immutable/chunks/{DWNBcI-9.js → pcT5puVp.js} +1 -1
- package/ui/dist/_app/immutable/entry/{app.Dr8IgX3r.js → app.iFQBmOia.js} +2 -2
- package/ui/dist/_app/immutable/entry/start.BJ8wH2bz.js +1 -0
- package/ui/dist/_app/immutable/nodes/{0.zxJ_VvIF.js → 0.COfWb7Uk.js} +1 -1
- package/ui/dist/_app/immutable/nodes/{1.DasPjSN2.js → 1.Do_XXsj8.js} +1 -1
- package/ui/dist/_app/immutable/nodes/{2.9VqQT6jB.js → 2.YNbZtxbt.js} +1 -1
- package/ui/dist/_app/immutable/nodes/3.DPdUtAMe.js +1 -0
- package/ui/dist/_app/immutable/nodes/{4.y19mXraP.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/entry/start.Dy9qIspC.js +0 -1
- package/ui/dist/_app/immutable/nodes/3.D8a8RCsW.js +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,27 @@
|
|
|
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
|
+
|
|
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)
|
|
21
|
+
|
|
22
|
+
### Features
|
|
23
|
+
|
|
24
|
+
* **core:** a Host for extensions ([6315eac](https://github.com/toa-io/toa/commit/6315eac1e9fb05be472272de06385c54ad5934ce))
|
|
25
|
+
|
|
26
|
+
|
|
6
27
|
# [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
28
|
|
|
8
29
|
### Bug Fixes
|
|
@@ -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/Client.test.ts
CHANGED
|
@@ -6,7 +6,7 @@ import { Connector, type Locator, type Message, type Receiver } from '@toa.io/co
|
|
|
6
6
|
import { timeout } from '@toa.io/generic'
|
|
7
7
|
import { Client, type Fetched } from './Client.js'
|
|
8
8
|
import { EVENT } from './const.js'
|
|
9
|
-
import type {
|
|
9
|
+
import type { Host } from './Factory.js'
|
|
10
10
|
|
|
11
11
|
class Remote extends Connector {
|
|
12
12
|
public readonly invoke = mock.fn(async (_endpoint: string, request: { input: Array<{ component: string, epoch: string }> }) =>
|
|
@@ -21,14 +21,14 @@ class Remote extends Connector {
|
|
|
21
21
|
|
|
22
22
|
let remote: Remote
|
|
23
23
|
let receiver: Receiver | null
|
|
24
|
-
let
|
|
24
|
+
let host: Host
|
|
25
25
|
let client: Client
|
|
26
26
|
|
|
27
27
|
beforeEach(() => {
|
|
28
28
|
remote = new Remote()
|
|
29
29
|
receiver = null
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
host = {
|
|
32
32
|
remote: mock.fn(async (locator: Locator) => {
|
|
33
33
|
assert.deepStrictEqual(locator.id, 'configuration.values')
|
|
34
34
|
|
|
@@ -41,9 +41,9 @@ beforeEach(() => {
|
|
|
41
41
|
|
|
42
42
|
return new Connector()
|
|
43
43
|
})
|
|
44
|
-
} as unknown as
|
|
44
|
+
} as unknown as Host
|
|
45
45
|
|
|
46
|
-
client = new Client(
|
|
46
|
+
client = new Client(host, { base: 10, max: 20, warn: 2 })
|
|
47
47
|
})
|
|
48
48
|
|
|
49
49
|
afterEach(async () => {
|
package/source/Client.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { console } from 'openspan'
|
|
|
2
2
|
import { Connector, Locator } from '@toa.io/core'
|
|
3
3
|
import { EVENT, SOURCE } from './const.js'
|
|
4
4
|
import type { Message, Remote } from '@toa.io/core'
|
|
5
|
-
import type {
|
|
5
|
+
import type { Host } from './Factory.js'
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* One per process: one remote to the values service and one subscription to its events,
|
|
@@ -13,7 +13,7 @@ export class Client extends Connector {
|
|
|
13
13
|
/** Disconnected once, a connector keeps what it depended on, so a gone client is not reused. */
|
|
14
14
|
public disposed = false
|
|
15
15
|
|
|
16
|
-
private readonly
|
|
16
|
+
private readonly host: Host
|
|
17
17
|
private readonly options: Options
|
|
18
18
|
private readonly pending = new Map<string, Pending>()
|
|
19
19
|
private readonly listeners = new Map<string, Set<Listener>>()
|
|
@@ -23,10 +23,10 @@ export class Client extends Connector {
|
|
|
23
23
|
private fresh = false
|
|
24
24
|
private round = 0
|
|
25
25
|
|
|
26
|
-
public constructor (
|
|
26
|
+
public constructor (host: Host, options: Partial<Options> = {}) {
|
|
27
27
|
super()
|
|
28
28
|
|
|
29
|
-
this.
|
|
29
|
+
this.host = host
|
|
30
30
|
this.options = { ...DEFAULTS, ...options }
|
|
31
31
|
}
|
|
32
32
|
|
|
@@ -67,13 +67,13 @@ export class Client extends Connector {
|
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
protected override async open (): Promise<void> {
|
|
70
|
-
this.remote = await this.
|
|
70
|
+
this.remote = await this.host.remote(LOCATOR, SOURCE)
|
|
71
71
|
|
|
72
72
|
this.depends(this.remote)
|
|
73
73
|
await this.remote.connect()
|
|
74
74
|
|
|
75
75
|
const subscription = new Subscription(this.deliver.bind(this))
|
|
76
|
-
const consumer = await this.
|
|
76
|
+
const consumer = await this.host.receive(EVENT, subscription)
|
|
77
77
|
|
|
78
78
|
this.depends(consumer)
|
|
79
79
|
await consumer.connect()
|
package/source/Composition.ts
CHANGED
|
@@ -3,19 +3,19 @@ import { resolve } from 'node:path'
|
|
|
3
3
|
import { Connector } from '@toa.io/core'
|
|
4
4
|
import { UI_PORT } from './const.js'
|
|
5
5
|
import { UI } from './UI.js'
|
|
6
|
-
import type {
|
|
6
|
+
import type { Host } from './Factory.js'
|
|
7
7
|
|
|
8
8
|
/** Hosts the values component in the service process. */
|
|
9
9
|
export class Composition extends Connector {
|
|
10
|
-
private readonly
|
|
10
|
+
private readonly host: Host
|
|
11
11
|
|
|
12
|
-
public constructor (
|
|
12
|
+
public constructor (host: Host) {
|
|
13
13
|
super()
|
|
14
|
-
this.
|
|
14
|
+
this.host = host
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
protected override async open (): Promise<void> {
|
|
18
|
-
const composition = await this.
|
|
18
|
+
const composition = await this.host.composition(components().paths)
|
|
19
19
|
|
|
20
20
|
await composition.connect()
|
|
21
21
|
|
package/source/Factory.ts
CHANGED
|
@@ -6,11 +6,11 @@ import { overridden } from './configuration.js'
|
|
|
6
6
|
import type { Manifest } from './manifest.js'
|
|
7
7
|
|
|
8
8
|
export class Factory implements extensions.Factory {
|
|
9
|
-
private readonly
|
|
9
|
+
private readonly host: Host
|
|
10
10
|
private client: Client | null = null
|
|
11
11
|
|
|
12
|
-
public constructor (
|
|
13
|
-
this.
|
|
12
|
+
public constructor (host: Host) {
|
|
13
|
+
this.host = host
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
public aspect (locator: Locator, manifest: Manifest): extensions.Aspect {
|
|
@@ -20,16 +20,15 @@ export class Factory implements extensions.Factory {
|
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
public service (): Connector {
|
|
23
|
-
return new Composition(this.
|
|
23
|
+
return new Composition(this.host)
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
private shared (): Client {
|
|
27
27
|
if (this.client === null || this.client.disposed)
|
|
28
|
-
this.client = new Client(this.
|
|
28
|
+
this.client = new Client(this.host)
|
|
29
29
|
|
|
30
30
|
return this.client
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
|
|
35
|
-
export type Bootloader = typeof import('@toa.io/boot')
|
|
34
|
+
export type Host = extensions.Host
|
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/Client.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Connector } from '@toa.io/core';
|
|
2
|
-
import type {
|
|
2
|
+
import type { Host } from './Factory.js';
|
|
3
3
|
/**
|
|
4
4
|
* One per process: one remote to the values service and one subscription to its events,
|
|
5
5
|
* shared by every Aspect. What the Aspects ask for is collected and sent as one call;
|
|
@@ -8,7 +8,7 @@ import type { Bootloader } from './Factory.js';
|
|
|
8
8
|
export declare class Client extends Connector {
|
|
9
9
|
/** Disconnected once, a connector keeps what it depended on, so a gone client is not reused. */
|
|
10
10
|
disposed: boolean;
|
|
11
|
-
private readonly
|
|
11
|
+
private readonly host;
|
|
12
12
|
private readonly options;
|
|
13
13
|
private readonly pending;
|
|
14
14
|
private readonly listeners;
|
|
@@ -17,7 +17,7 @@ export declare class Client extends Connector {
|
|
|
17
17
|
private flushing;
|
|
18
18
|
private fresh;
|
|
19
19
|
private round;
|
|
20
|
-
constructor(
|
|
20
|
+
constructor(host: Host, options?: Partial<Options>);
|
|
21
21
|
/** The configuration of a component for an epoch, once the service has one. */
|
|
22
22
|
fetch(component: string, epoch: string): Promise<Value>;
|
|
23
23
|
subscribe(component: string, epoch: string, listener: Listener): void;
|
package/transpiled/Client.js
CHANGED
|
@@ -9,7 +9,7 @@ import { EVENT, SOURCE } from './const.js';
|
|
|
9
9
|
export class Client extends Connector {
|
|
10
10
|
/** Disconnected once, a connector keeps what it depended on, so a gone client is not reused. */
|
|
11
11
|
disposed = false;
|
|
12
|
-
|
|
12
|
+
host;
|
|
13
13
|
options;
|
|
14
14
|
pending = new Map();
|
|
15
15
|
listeners = new Map();
|
|
@@ -18,9 +18,9 @@ export class Client extends Connector {
|
|
|
18
18
|
flushing = false;
|
|
19
19
|
fresh = false;
|
|
20
20
|
round = 0;
|
|
21
|
-
constructor(
|
|
21
|
+
constructor(host, options = {}) {
|
|
22
22
|
super();
|
|
23
|
-
this.
|
|
23
|
+
this.host = host;
|
|
24
24
|
this.options = { ...DEFAULTS, ...options };
|
|
25
25
|
}
|
|
26
26
|
/** The configuration of a component for an epoch, once the service has one. */
|
|
@@ -50,11 +50,11 @@ export class Client extends Connector {
|
|
|
50
50
|
this.listeners.get(id(component, epoch))?.delete(listener);
|
|
51
51
|
}
|
|
52
52
|
async open() {
|
|
53
|
-
this.remote = await this.
|
|
53
|
+
this.remote = await this.host.remote(LOCATOR, SOURCE);
|
|
54
54
|
this.depends(this.remote);
|
|
55
55
|
await this.remote.connect();
|
|
56
56
|
const subscription = new Subscription(this.deliver.bind(this));
|
|
57
|
-
const consumer = await this.
|
|
57
|
+
const consumer = await this.host.receive(EVENT, subscription);
|
|
58
58
|
this.depends(consumer);
|
|
59
59
|
await consumer.connect();
|
|
60
60
|
}
|
package/transpiled/Client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Client.js","sourceRoot":"","sources":["../source/Client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAA;AAClC,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACjD,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AAI1C;;;;GAIG;AACH,MAAM,OAAO,MAAO,SAAQ,SAAS;IACnC,gGAAgG;IACzF,QAAQ,GAAG,KAAK,CAAA;IAEN,IAA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AAE,CAAA;QAExF,KAAK,MAAM,QAAQ,IAAI,SAAS;YAC9B,QAAQ,CAAC,KAAK,CAAC,CAAA;IACnB,CAAC;CACF;AAED,mDAAmD;AACnD,MAAM,YAAa,SAAQ,SAAS;IACjB,OAAO,CAA4B;IAEpD,YAAoB,OAAmC;QACrD,KAAK,EAAE,CAAA;QAEP,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;IACxB,CAAC;IAEM,KAAK,CAAC,OAAO,CAAE,OAAyB;QAC7C,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAA;IAC/B,CAAC;CACF;AAED,SAAS,EAAE,CAAE,SAAiB,EAAE,KAAa;IAC3C,OAAO,SAAS,GAAG,IAAI,GAAG,KAAK,CAAA;AACjC,CAAC;AAED,MAAM,OAAO,GAAG,IAAI,OAAO,CAAC,QAAQ,EAAE,eAAe,CAAC,CAAA;AACtD,MAAM,MAAM,GAAG,GAAG,CAAA;AAElB,MAAM,QAAQ,GAAY;IACxB,IAAI,EAAE,IAAI;IACV,GAAG,EAAE,KAAK;IACV,IAAI,EAAE,CAAC;CACR,CAAA"}
|
|
@@ -15,12 +15,12 @@ class Remote extends Connector {
|
|
|
15
15
|
}
|
|
16
16
|
let remote;
|
|
17
17
|
let receiver;
|
|
18
|
-
let
|
|
18
|
+
let host;
|
|
19
19
|
let client;
|
|
20
20
|
beforeEach(() => {
|
|
21
21
|
remote = new Remote();
|
|
22
22
|
receiver = null;
|
|
23
|
-
|
|
23
|
+
host = {
|
|
24
24
|
remote: mock.fn(async (locator) => {
|
|
25
25
|
assert.deepStrictEqual(locator.id, 'configuration.values');
|
|
26
26
|
return remote;
|
|
@@ -31,7 +31,7 @@ beforeEach(() => {
|
|
|
31
31
|
return new Connector();
|
|
32
32
|
})
|
|
33
33
|
};
|
|
34
|
-
client = new Client(
|
|
34
|
+
client = new Client(host, { base: 10, max: 20, warn: 2 });
|
|
35
35
|
});
|
|
36
36
|
afterEach(async () => {
|
|
37
37
|
await client.disconnect();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Client.test.js","sourceRoot":"","sources":["../source/Client.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAC3D,OAAO,MAAM,MAAM,oBAAoB,CAAA;AACvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAA;AAE7C,OAAO,EAAE,SAAS,EAA6C,MAAM,cAAc,CAAA;AACnF,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAA;AACzC,OAAO,EAAE,MAAM,EAAgB,MAAM,aAAa,CAAA;AAClD,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAGlC,MAAM,MAAO,SAAQ,SAAS;IACZ,MAAM,GAAG,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE,SAAiB,EAAE,OAA+D,EAAE,EAAE,CAC5H,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAW,EAAE,CAAC,CAAC;QACpC,GAAG,IAAI;QACP,aAAa,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,IAAI;QAClD,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;KAC3D,CAAC,CAAC,CAAC,CAAA;IAEC,MAAM,GAAkC,EAAE,CAAA;CAClD;AAED,IAAI,MAAc,CAAA;AAClB,IAAI,QAAyB,CAAA;AAC7B,IAAI,
|
|
1
|
+
{"version":3,"file":"Client.test.js","sourceRoot":"","sources":["../source/Client.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAC3D,OAAO,MAAM,MAAM,oBAAoB,C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AS,EAAE,EAAE,CAAC,CAAC,CAAA;AAClD,CAAC,CAAC,CAAA"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Connector } from '@toa.io/core';
|
|
2
|
-
import type {
|
|
2
|
+
import type { Host } from './Factory.js';
|
|
3
3
|
/** Hosts the values component in the service process. */
|
|
4
4
|
export declare class Composition extends Connector {
|
|
5
|
-
private readonly
|
|
6
|
-
constructor(
|
|
5
|
+
private readonly host;
|
|
6
|
+
constructor(host: Host);
|
|
7
7
|
protected open(): Promise<void>;
|
|
8
8
|
}
|
|
9
9
|
export declare function components(): Components;
|
|
@@ -5,13 +5,13 @@ import { UI_PORT } from './const.js';
|
|
|
5
5
|
import { UI } from './UI.js';
|
|
6
6
|
/** Hosts the values component in the service process. */
|
|
7
7
|
export class Composition extends Connector {
|
|
8
|
-
|
|
9
|
-
constructor(
|
|
8
|
+
host;
|
|
9
|
+
constructor(host) {
|
|
10
10
|
super();
|
|
11
|
-
this.
|
|
11
|
+
this.host = host;
|
|
12
12
|
}
|
|
13
13
|
async open() {
|
|
14
|
-
const composition = await this.
|
|
14
|
+
const composition = await this.host.composition(components().paths);
|
|
15
15
|
await composition.connect();
|
|
16
16
|
this.depends(composition);
|
|
17
17
|
// connected here rather than declared as a dependency: dependencies are connected
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Composition.js","sourceRoot":"","sources":["../source/Composition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAe,MAAM,SAAS,CAAA;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AACpC,OAAO,EAAE,EAAE,EAAE,MAAM,SAAS,CAAA;AAG5B,yDAAyD;AACzD,MAAM,OAAO,WAAY,SAAQ,SAAS;IACvB,IAAI,
|
|
1
|
+
{"version":3,"file":"Composition.js","sour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OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,CAAA;AAC1B,CAAC;AAED,SAAS,OAAO;IACd,MAAM,OAAO,GAAG,WAAW,CAAC,IAAI,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAA;IAE1D,OAAO,OAAO,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,CAAA;AACvD,CAAC;AAOD,MAAM,IAAI,GAAG,OAAO,CAAC,OAAO,IAAI,CAAC,OAAO,EAAE,gBAAgB,CAAC,CAAA"}
|
package/transpiled/Factory.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { type Connector, type Locator, type extensions } from '@toa.io/core';
|
|
2
2
|
import type { Manifest } from './manifest.js';
|
|
3
3
|
export declare class Factory implements extensions.Factory {
|
|
4
|
-
private readonly
|
|
4
|
+
private readonly host;
|
|
5
5
|
private client;
|
|
6
|
-
constructor(
|
|
6
|
+
constructor(host: Host);
|
|
7
7
|
aspect(locator: Locator, manifest: Manifest): extensions.Aspect;
|
|
8
8
|
service(): Connector;
|
|
9
9
|
private shared;
|
|
10
10
|
}
|
|
11
|
-
export type
|
|
11
|
+
export type Host = extensions.Host;
|
package/transpiled/Factory.js
CHANGED
|
@@ -3,21 +3,21 @@ import { Client } from './Client.js';
|
|
|
3
3
|
import { Composition } from './Composition.js';
|
|
4
4
|
import { overridden } from './configuration.js';
|
|
5
5
|
export class Factory {
|
|
6
|
-
|
|
6
|
+
host;
|
|
7
7
|
client = null;
|
|
8
|
-
constructor(
|
|
9
|
-
this.
|
|
8
|
+
constructor(host) {
|
|
9
|
+
this.host = host;
|
|
10
10
|
}
|
|
11
11
|
aspect(locator, manifest) {
|
|
12
12
|
const client = overridden(locator) ? null : this.shared();
|
|
13
13
|
return new Aspect(locator, manifest, client);
|
|
14
14
|
}
|
|
15
15
|
service() {
|
|
16
|
-
return new Composition(this.
|
|
16
|
+
return new Composition(this.host);
|
|
17
17
|
}
|
|
18
18
|
shared() {
|
|
19
19
|
if (this.client === null || this.client.disposed)
|
|
20
|
-
this.client = new Client(this.
|
|
20
|
+
this.client = new Client(this.host);
|
|
21
21
|
return this.client;
|
|
22
22
|
}
|
|
23
23
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Factory.js","sourceRoot":"","sources":["../source/Factory.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAG/C,MAAM,OAAO,OAAO;IACD,IAAI,
|
|
1
|
+
{"version":3,"file":"Factory.js","sourceRoot":"","sources":["../source/Factory.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAG/C,MAAM,OAAO,OAAO;IACD,IAAI,CAAM;IACnB,MAAM,GAAkB,IAAI,CAAA;IAEpC,YAAoB,IAAU;QAC5B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;IAClB,CAAC;IAEM,MAAM,CAAE,OAAgB,EAAE,QAAkB;QACjD,MAAM,MAAM,GAAG,UAAU,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,EAAE,CAAA;QAEzD,OAAO,IAAI,MAAM,CAAC,OAAO,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAA;IAC9C,CAAC;IAEM,OAAO;QACZ,OAAO,IAAI,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IACnC,CAAC;IAEO,MAAM;QACZ,IAAI,IAAI,CAAC,MAAM,KAAK,IAAI,IAAI,IAAI,CAAC,MAAM,CAAC,QAAQ;YAC9C,IAAI,CAAC,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAErC,OAAO,IAAI,CAAC,MAAM,CAAA;IACpB,CAAC;CACF"}
|
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"}
|