@toa.io/definitions 1.0.0-alpha.313 → 1.0.0-alpha.315
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/digest/extensions.configuration.json +1 -1
- package/digest/extensions.exposition.json +1 -1
- package/package.json +20 -5
- package/schemas/extensions.cadence/declaration.cos.yaml +5 -0
- package/schemas/extensions.exposition/annotation.cos.yaml +8 -0
- package/schemas/extensions.exposition/realtime.cos.yaml +19 -0
- package/schemas/extensions.exposition/routes.cos.yaml +27 -0
- package/transpiled/definition.js +9 -3
- package/transpiled/definition.js.map +1 -1
- package/transpiled/digest/generate.js +1 -2
- package/transpiled/digest/generate.js.map +1 -1
- package/transpiled/extensions.cadence/index.d.ts +1 -1
- package/transpiled/extensions.cadence/manifest.d.ts +2 -2
- package/transpiled/extensions.cadence/manifest.js +2 -0
- package/transpiled/extensions.cadence/manifest.js.map +1 -1
- package/transpiled/extensions.cadence/types.d.ts +13 -0
- package/transpiled/extensions.exposition/Annotation.d.ts +6 -1
- package/transpiled/extensions.exposition/deployment.js +14 -1
- package/transpiled/extensions.exposition/deployment.js.map +1 -1
- package/transpiled/extensions.exposition/index.d.ts +1 -0
- package/transpiled/extensions.exposition/index.js +1 -0
- package/transpiled/extensions.exposition/index.js.map +1 -1
- package/transpiled/extensions.exposition/keys.d.ts +2 -0
- package/transpiled/extensions.exposition/keys.js +3 -0
- package/transpiled/extensions.exposition/keys.js.map +1 -0
- package/transpiled/extensions.exposition/realtime/const.d.ts +4 -0
- package/transpiled/extensions.exposition/realtime/const.js +5 -0
- package/transpiled/extensions.exposition/realtime/const.js.map +1 -0
- package/transpiled/extensions.exposition/realtime/deployment.d.ts +11 -0
- package/transpiled/extensions.exposition/realtime/deployment.js +17 -0
- package/transpiled/extensions.exposition/realtime/deployment.js.map +1 -0
- package/transpiled/extensions.exposition/realtime/index.d.ts +6 -0
- package/transpiled/extensions.exposition/realtime/index.js +5 -0
- package/transpiled/extensions.exposition/realtime/index.js.map +1 -0
- package/transpiled/extensions.exposition/realtime/manifest.d.ts +7 -0
- package/transpiled/extensions.exposition/realtime/manifest.js +10 -0
- package/transpiled/extensions.exposition/realtime/manifest.js.map +1 -0
- package/transpiled/extensions.exposition/realtime/routes.d.ts +18 -0
- package/transpiled/extensions.exposition/realtime/routes.js +8 -0
- package/transpiled/extensions.exposition/realtime/routes.js.map +1 -0
- package/transpiled/extensions.exposition/schemas.d.ts +2 -0
- package/transpiled/extensions.exposition/schemas.js +2 -0
- package/transpiled/extensions.exposition/schemas.js.map +1 -1
- package/transpiled/extensions.storages/packages.d.ts +2 -1
- package/transpiled/extensions.storages/packages.js +14 -4
- package/transpiled/extensions.storages/packages.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/map.d.ts +10 -1
- package/transpiled/map.js +10 -1
- package/transpiled/map.js.map +1 -1
- package/digest/extensions.realtime.json +0 -1
- package/transpiled/extensions.realtime/components.d.ts +0 -2
- package/transpiled/extensions.realtime/components.js +0 -5
- package/transpiled/extensions.realtime/components.js.map +0 -1
- package/transpiled/extensions.realtime/deployment.d.ts +0 -22
- package/transpiled/extensions.realtime/deployment.js +0 -53
- package/transpiled/extensions.realtime/deployment.js.map +0 -1
- package/transpiled/extensions.realtime/index.d.ts +0 -3
- package/transpiled/extensions.realtime/index.js +0 -3
- package/transpiled/extensions.realtime/index.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@toa.io/definitions",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.315",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "What Toa packages declare, read without running them",
|
|
6
6
|
"author": "temich <tema.gurtovoy@gmail.com>",
|
|
@@ -44,17 +44,32 @@
|
|
|
44
44
|
"./*": "./transpiled/*/index.js"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"@
|
|
47
|
+
"@aws-sdk/client-s3": "3.1135.0",
|
|
48
|
+
"@aws-sdk/lib-storage": "3.1135.0",
|
|
49
|
+
"@toa.io/core": "1.0.0-alpha.315",
|
|
50
|
+
"cloudinary": "2.11.0",
|
|
48
51
|
"openspan": "1.0.0-alpha.305",
|
|
49
|
-
"oxc-parser": "0.
|
|
52
|
+
"oxc-parser": "0.150.0"
|
|
50
53
|
},
|
|
51
54
|
"peerDependencies": {
|
|
52
|
-
"
|
|
55
|
+
"@aws-sdk/client-s3": "3.1135.0",
|
|
56
|
+
"@aws-sdk/lib-storage": "3.1135.0",
|
|
57
|
+
"cloudinary": "2.11.0",
|
|
58
|
+
"oxc-parser": "0.150.0"
|
|
53
59
|
},
|
|
54
60
|
"peerDependenciesMeta": {
|
|
61
|
+
"@aws-sdk/client-s3": {
|
|
62
|
+
"optional": true
|
|
63
|
+
},
|
|
64
|
+
"@aws-sdk/lib-storage": {
|
|
65
|
+
"optional": true
|
|
66
|
+
},
|
|
67
|
+
"cloudinary": {
|
|
68
|
+
"optional": true
|
|
69
|
+
},
|
|
55
70
|
"oxc-parser": {
|
|
56
71
|
"optional": true
|
|
57
72
|
}
|
|
58
73
|
},
|
|
59
|
-
"gitHead": "
|
|
74
|
+
"gitHead": "d88ed286bf44bf95b5f3d9db6e7d4621261dbb99"
|
|
60
75
|
}
|
|
@@ -16,5 +16,10 @@ patternProperties:
|
|
|
16
16
|
and the operation is told which interval it is running for.
|
|
17
17
|
type: integer
|
|
18
18
|
minimum: 1
|
|
19
|
+
scope:
|
|
20
|
+
description: >
|
|
21
|
+
Whose work this is: the component's, which one replica makes each call of, or every
|
|
22
|
+
replica's, for what lives inside a process.
|
|
23
|
+
enum: [group, replica]
|
|
19
24
|
required: [cycle]
|
|
20
25
|
additionalProperties: false
|
|
@@ -126,6 +126,14 @@ properties:
|
|
|
126
126
|
anonymous:
|
|
127
127
|
description: Whether the endpoint answers without a credential
|
|
128
128
|
type: boolean
|
|
129
|
+
hosts:
|
|
130
|
+
description: A host of its own per authority, where the endpoint is the root
|
|
131
|
+
type: object
|
|
132
|
+
patternProperties:
|
|
133
|
+
^.+$:
|
|
134
|
+
type: string
|
|
135
|
+
minLength: 1
|
|
136
|
+
additionalProperties: false
|
|
129
137
|
required:
|
|
130
138
|
- name
|
|
131
139
|
additionalProperties: false
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
type: object
|
|
2
|
+
properties:
|
|
3
|
+
streams:
|
|
4
|
+
description: The Redis the streams are kept in; several are shards, a key kept by one of them
|
|
5
|
+
oneOf:
|
|
6
|
+
- type: string
|
|
7
|
+
minLength: 1
|
|
8
|
+
- type: array
|
|
9
|
+
items:
|
|
10
|
+
type: string
|
|
11
|
+
minLength: 1
|
|
12
|
+
minItems: 1
|
|
13
|
+
expire:
|
|
14
|
+
description: Seconds a stream outlives its last reader, the window a client reconnects in
|
|
15
|
+
type: integer
|
|
16
|
+
minimum: 1
|
|
17
|
+
required:
|
|
18
|
+
- streams
|
|
19
|
+
additionalProperties: false
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# a component's `realtime` declaration: its routes, by the label of the event
|
|
2
|
+
type: object
|
|
3
|
+
minProperties: 1
|
|
4
|
+
additionalProperties:
|
|
5
|
+
type: object
|
|
6
|
+
properties:
|
|
7
|
+
key:
|
|
8
|
+
description: The properties of the event that are the keys of the streams it goes to
|
|
9
|
+
oneOf:
|
|
10
|
+
- type: string
|
|
11
|
+
minLength: 1
|
|
12
|
+
- type: array
|
|
13
|
+
items:
|
|
14
|
+
type: string
|
|
15
|
+
minLength: 1
|
|
16
|
+
minItems: 1
|
|
17
|
+
expose:
|
|
18
|
+
description: What of the event its streams are given; nothing is given that is not named
|
|
19
|
+
type: array
|
|
20
|
+
items:
|
|
21
|
+
type: string
|
|
22
|
+
minLength: 1
|
|
23
|
+
minItems: 1
|
|
24
|
+
required:
|
|
25
|
+
- key
|
|
26
|
+
- expose
|
|
27
|
+
additionalProperties: false
|
package/transpiled/definition.js
CHANGED
|
@@ -13,11 +13,18 @@ var __rewriteRelativeImportExtension = (this && this.__rewriteRelativeImportExte
|
|
|
13
13
|
export async function definition(reference) {
|
|
14
14
|
if (!reference.startsWith(SCOPE))
|
|
15
15
|
return undefined;
|
|
16
|
-
|
|
16
|
+
// `package#key` is a declaration of its own that a package claims beside its main one
|
|
17
|
+
const [suffix, key] = reference.slice(SCOPE.length).split('#');
|
|
17
18
|
if (!DEFINED.has(suffix))
|
|
18
19
|
return undefined;
|
|
19
20
|
cache[suffix] ??= import(__rewriteRelativeImportExtension(`./${suffix}/index.ts`));
|
|
20
|
-
|
|
21
|
+
const module = await cache[suffix];
|
|
22
|
+
if (key === undefined)
|
|
23
|
+
return module;
|
|
24
|
+
const keyed = module.keys?.[key];
|
|
25
|
+
if (keyed === undefined)
|
|
26
|
+
throw new Error(`'${reference}' names a key that '${SCOPE}${suffix}' does not claim`);
|
|
27
|
+
return keyed;
|
|
21
28
|
}
|
|
22
29
|
const cache = {};
|
|
23
30
|
const SCOPE = '@toa.io/';
|
|
@@ -34,7 +41,6 @@ export const DEFINED = new Set([
|
|
|
34
41
|
'extensions.exposition',
|
|
35
42
|
'extensions.fetch',
|
|
36
43
|
'extensions.introspection',
|
|
37
|
-
'extensions.realtime',
|
|
38
44
|
'extensions.stash',
|
|
39
45
|
'extensions.state',
|
|
40
46
|
'extensions.storages',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definition.js","sourceRoot":"","sources":["../source/definition.ts"],"names":[],"mappings":";;;;;;;;AAAA;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,SAAiB;IAChD,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,KAAK,CAAC;QAAE,OAAO,SAAS,CAAA;IAElD,MAAM,MAAM,GAAG,SAAS,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CAAA;
|
|
1
|
+
{"version":3,"file":"definition.js","sourceR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+15,7 @@ const DIGESTED = [
|
|
|
15
15
|
'extensions.cadence',
|
|
16
16
|
'extensions.configuration',
|
|
17
17
|
'extensions.exposition',
|
|
18
|
-
'extensions.introspection'
|
|
19
|
-
'extensions.realtime'
|
|
18
|
+
'extensions.introspection'
|
|
20
19
|
];
|
|
21
20
|
const OUT = resolve(import.meta.dirname, '../../digest');
|
|
22
21
|
mkdirSync(OUT, { recursive: true });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate.js","sourceRoot":"","sources":["../../source/digest/generate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAC3C,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAA;AACjE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAGzF;;;;;;GAMG;AACH,MAAM,OAAO,GAAG,aAAa,CAAC,OAAO,IAAI,CAAC,GAAG,CAAC,CAAA;AAE9C,8CAA8C;AAC9C,MAAM,EAAE,SAAS,EAAE,GAAG,CAAC,MAAM,MAAM,CAAC,cAAc,CAAC,CAElD,CAAA;AAED,MAAM,QAAQ,GAAG;IACf,oBAAoB;IACpB,0BAA0B;IAC1B,uBAAuB;IACvB,0BAA0B;
|
|
1
|
+
{"version":3,"file":"generate.js","sourceRoot":"","sources":["../../source/digest/generate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAC3C,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAA;AACjE,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAGzF;;;;;;GAMG;AACH,MAAM,OAAO,GA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AA;QAE1C,KAAK,MAAM,CAAC,GAAG,EAAE,IAAI,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC;YAC7C,IAAI,GAAG,KAAK,SAAS;gBAAE,MAAM,CAAC,GAAG,CAAC,GAAG,UAAU,CAAC,IAAI,CAAC,CAAA;QAEvD,OAAO,MAAM,CAAA;IACf,CAAC;IAED,OAAO,KAAK,CAAA;AACd,CAAC;AAED,SAAS,SAAS,CAAC,KAAa;IAC9B,KAAK,MAAM,CAAC,SAAS,EAAE,IAAI,CAAC,IAAI,KAAK;QACnC,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,CAAC,UAAU,CAAC,SAAS,GAAG,GAAG,CAAC;YAC1D,OAAO,CAAC,IAAI,EAAE,GAAG,QAAQ,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;IAErF,OAAO,KAAK,CAAA;AACd,CAAC"}
|
|
@@ -4,4 +4,4 @@ export { deployment, standalone } from './deployment.ts';
|
|
|
4
4
|
export { context } from './context.ts';
|
|
5
5
|
export * from './const.ts';
|
|
6
6
|
export * as schemas from './schemas.ts';
|
|
7
|
-
export type { Annotation, Declaration, Delay, Options, Pulse } from './types.ts';
|
|
7
|
+
export type { Annotation, Declaration, Declared, Delay, Options, Pulse, Scope } from './types.ts';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Declaration } from './types.ts';
|
|
1
|
+
import type { Declaration, Declared } from './types.ts';
|
|
2
2
|
import type { Manifest } from '@toa.io/norm';
|
|
3
3
|
/**
|
|
4
4
|
* The `cadence:` block of a component manifest: the operations called on a cadence, by the
|
|
@@ -8,4 +8,4 @@ import type { Manifest } from '@toa.io/norm';
|
|
|
8
8
|
* A component that declares nothing still has a declaration. `cadence: ~` is how one that only
|
|
9
9
|
* delays calls says so, and it has to produce a value or norm rejects the extension.
|
|
10
10
|
*/
|
|
11
|
-
export declare function manifest(declaration:
|
|
11
|
+
export declare function manifest(declaration: Declared | null | undefined, component: Manifest): Declaration;
|
|
@@ -31,6 +31,8 @@ function expand(declaration) {
|
|
|
31
31
|
return Object.fromEntries(Object.entries(declaration).map(([endpoint, pulse]) => {
|
|
32
32
|
const declared = typeof pulse === 'number' ? { cycle: pulse } : { ...pulse };
|
|
33
33
|
declared.intervals ??= 1;
|
|
34
|
+
// a pulse that does not say whose work it is is the component's, as every pulse was
|
|
35
|
+
declared.scope ??= 'group';
|
|
34
36
|
return [endpoint, declared];
|
|
35
37
|
}));
|
|
36
38
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest.js","sourceRoot":"","sources":["../../source/extensions.cadence/manifest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,cAAc,CAAA;AAIvC;;;;;;;GAOG;AACH,MAAM,UAAU,QAAQ,CACtB,
|
|
1
|
+
{"version":3,"file":"manifest.js","sourceRoot":"","sources":["../../source/extensions.cadence/manifest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,cAAc,CAAA;AAIvC;;;;;;;GAOG;AACH,MAAM,UAAU,QAAQ,CACtB,WAAwC,EACxC,SAAmB;IAEnB,MAAM,UAAU,GAA4B,MAAM,CAAC,WAAW,CAAC,CAAA;IAE/D,OAAO,CAAC,WAAW,CAAC,QAAQ,CAAc,UAAU,EAAE,6BAA6B,CAAC,CAAA;IAEpF,KAAK,MAAM,CAAC,QAAQ,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC;QAC3D,MAAM,SAAS,GAAG,SAAS,CAAC,UAAU,EAAE,CAAC,QAAQ,CAAC,CAAA;QAElD,IAAI,SAAS,KAAK,SAAS;YACzB,MAAM,IAAI,KAAK,CAAC,wCAAwC,QAAQ,GAAG,CAAC,CAAA;QAEtE,IAAI,CAAC,KAAK,CA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record<string, Pulse>;
|
|
3
|
+
/**
|
|
4
|
+
* What a manifest may state: a whole pulse, one with what it leaves to the default left out,
|
|
5
|
+
* or the cycle alone.
|
|
6
|
+
*/
|
|
7
|
+
export type Declared = Record<string, number | (Partial<Pulse> & {
|
|
8
|
+
cycle: number;
|
|
9
|
+
})>;
|
|
3
10
|
export interface Pulse {
|
|
4
11
|
/** seconds one whole cycle takes */
|
|
5
12
|
cycle: number;
|
|
6
13
|
/** intervals the cycle is split into; the gap between calls is `cycle / intervals` */
|
|
7
14
|
intervals: number;
|
|
15
|
+
/**
|
|
16
|
+
* Whose work this is: `group` is the component's, and one replica makes each call; `replica`
|
|
17
|
+
* is every replica's own, for what lives inside a process.
|
|
18
|
+
*/
|
|
19
|
+
scope: Scope;
|
|
8
20
|
}
|
|
21
|
+
export type Scope = 'group' | 'replica';
|
|
9
22
|
/** `context.delay` — a call to be made later, answering the id that cancels it. */
|
|
10
23
|
export interface Delay {
|
|
11
24
|
(endpoint: string, request: object | null, options: Options): Promise<string>;
|
|
@@ -26,7 +26,7 @@ export interface Annotation {
|
|
|
26
26
|
oauth?: OAuth;
|
|
27
27
|
/** JSON-RPC at `/.rpc`; none is served without it. See `documentation/rpc.md`. */
|
|
28
28
|
rpc?: RPC;
|
|
29
|
-
/** MCP at `/.mcp
|
|
29
|
+
/** MCP at `/.mcp`, and on a host of its own where one is named; none without it. */
|
|
30
30
|
mcp?: MCP;
|
|
31
31
|
'/'?: object;
|
|
32
32
|
}
|
|
@@ -67,6 +67,11 @@ export interface MCP {
|
|
|
67
67
|
origins?: string[];
|
|
68
68
|
/** Whether the endpoint answers without a credential. It does not unless it says so. */
|
|
69
69
|
anonymous?: boolean;
|
|
70
|
+
/**
|
|
71
|
+
* A host of its own per authority, where the endpoint is served at the root and nothing
|
|
72
|
+
* else is. See `documentation/mcp.md`.
|
|
73
|
+
*/
|
|
74
|
+
hosts?: Record<string, string>;
|
|
70
75
|
}
|
|
71
76
|
export interface Bouncer {
|
|
72
77
|
/** what an address may fail at once, 20 by default */
|
|
@@ -36,7 +36,7 @@ export function deployment(_, annotation) {
|
|
|
36
36
|
});
|
|
37
37
|
}
|
|
38
38
|
const { debug, authorities } = annotation;
|
|
39
|
-
service.ingress.hosts = Object.values(authorities);
|
|
39
|
+
service.ingress.hosts = Object.values(authorities).concat(mcp(annotation));
|
|
40
40
|
// leaving these undefined lets the context's own ingress section supply them
|
|
41
41
|
if (annotation.class !== undefined)
|
|
42
42
|
service.ingress.class = annotation.class;
|
|
@@ -74,4 +74,17 @@ export function deployment(_, annotation) {
|
|
|
74
74
|
});
|
|
75
75
|
return { services: [service] };
|
|
76
76
|
}
|
|
77
|
+
/**
|
|
78
|
+
* The hosts MCP is served at the root of. Each is declared under the authority it belongs
|
|
79
|
+
* to, and one under a key naming no authority would be a host nothing resolves.
|
|
80
|
+
*/
|
|
81
|
+
function mcp(annotation) {
|
|
82
|
+
const hosts = annotation.mcp?.hosts;
|
|
83
|
+
if (hosts === undefined)
|
|
84
|
+
return [];
|
|
85
|
+
for (const authority of Object.keys(hosts))
|
|
86
|
+
if (!(authority in annotation.authorities))
|
|
87
|
+
throw new Error(`MCP host names an undeclared authority '${authority}'`);
|
|
88
|
+
return Object.values(hosts);
|
|
89
|
+
}
|
|
77
90
|
//# sourceMappingURL=deployment.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deployment.js","sourceRoot":"","sources":["../../source/extensions.exposition/deployment.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,OAAO,MAAM,cAAc,CAAA;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC5C,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AACzC,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAA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AK,CAAA;IAEvE,IAAI,UAAU,CAAC,GAAG,KAAK,SAAS;QAAE,UAAU,CAAC,GAAG,GAAG,UAAU,CAAC,GAAG,CAAA;IAEjE,IAAI,UAAU,CAAC,GAAG,KAAK,SAAS;QAAE,UAAU,CAAC,GAAG,GAAG,UAAU,CAAC,GAAG,CAAA;IAEjE,OAAO,CAAC,SAAU,CAAC,IAAI,CAAC;QACtB,IAAI,EAAE,2BAA2B;QACjC,KAAK,EAAE,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC;KAClC,CAAC,CAAA;IAEF,2FAA2F;IAC3F,uFAAuF;IACvF,8EAA8E;IAC9E,OAAO,CAAC,SAAU,CAAC,IAAI,CAAC;QACtB,IAAI,EAAE,qBAAqB;QAC3B,KAAK,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC;KAC7B,CAAC,CAAA;IAEF,OAAO,EAAE,QAAQ,EAAE,CAAC,OAAO,CAAC,EAAE,CAAA;AAChC,CAAC;AAED;;;GAGG;AACH,SAAS,GAAG,CAAC,UAAsB;IACjC,MAAM,KAAK,GAAG,UAAU,CAAC,GAAG,EAAE,KAAK,CAAA;IAEnC,IAAI,KAAK,KAAK,SAAS;QAAE,OAAO,EAAE,CAAA;IAElC,KAAK,MAAM,SAAS,IAAI,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC;QACxC,IAAI,CAAC,CAAC,SAAS,IAAI,UAAU,CAAC,WAAW,CAAC;YACxC,MAAM,IAAI,KAAK,CAAC,2CAA2C,SAAS,GAAG,CAAC,CAAA;IAE5E,OAAO,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;AAC7B,CAAC"}
|
|
@@ -3,6 +3,7 @@ export { components } from './components.ts';
|
|
|
3
3
|
export { installs } from './packages.ts';
|
|
4
4
|
export { deployment, image } from './deployment.ts';
|
|
5
5
|
export { shortcuts } from './shortcuts.ts';
|
|
6
|
+
export * as keys from './keys.ts';
|
|
6
7
|
export * from './const.ts';
|
|
7
8
|
export * as schemas from './schemas.ts';
|
|
8
9
|
export * as syntax from './syntax/index.ts';
|
|
@@ -3,6 +3,7 @@ export { components } from './components.js';
|
|
|
3
3
|
export { installs } from './packages.js';
|
|
4
4
|
export { deployment, image } from './deployment.js';
|
|
5
5
|
export { shortcuts } from './shortcuts.js';
|
|
6
|
+
export * as keys from './keys.js';
|
|
6
7
|
export * from './const.js';
|
|
7
8
|
export * as schemas from './schemas.js';
|
|
8
9
|
export * as syntax from './syntax/index.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../source/extensions.exposition/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACxC,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC1C,cAAc,YAAY,CAAA;AAC1B,OAAO,KAAK,OAAO,MAAM,cAAc,CAAA;AACvC,OAAO,KAAK,MAAM,MAAM,mBAAmB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../source/extensions.exposition/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACxC,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC1C,OAAO,KAAK,IAAI,MAAM,WAAW,CAAA;AACjC,cAAc,YAAY,CAAA;AAC1B,OAAO,KAAK,OAAO,MAAM,cAAc,CAAA;AACvC,OAAO,KAAK,MAAM,MAAM,mBAAmB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keys.js","sourceRoot":"","sources":["../../source/extensions.exposition/keys.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,OAAO,KAAK,QAAQ,MAAM,qBAAqB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"const.js","sourceRoot":"","sources":["../../../source/extensions.exposition/realtime/const.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,MAAM,CAAC,MAAM,OAAO,GAAG,sBAAsB,CAAA;AAE7C,iDAAiD;AACjD,MAAM,CAAC,MAAM,MAAM,GAAG,qBAAqB,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Dependency } from '@toa.io/operations';
|
|
2
|
+
/**
|
|
3
|
+
* Where the streams are kept, given to every process: the components that route events write them,
|
|
4
|
+
* and the gateway reads them. Asked for where a component declares routes, as any annotation is
|
|
5
|
+
* where its extension is declared.
|
|
6
|
+
*/
|
|
7
|
+
export declare function deployment(_: unknown, annotation?: Annotation): Dependency;
|
|
8
|
+
export interface Annotation {
|
|
9
|
+
streams: string | string[];
|
|
10
|
+
expire?: number;
|
|
11
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as schemas from '../schemas.js';
|
|
2
|
+
import { EXPIRE, STREAMS } from './const.js';
|
|
3
|
+
/**
|
|
4
|
+
* Where the streams are kept, given to every process: the components that route events write them,
|
|
5
|
+
* and the gateway reads them. Asked for where a component declares routes, as any annotation is
|
|
6
|
+
* where its extension is declared.
|
|
7
|
+
*/
|
|
8
|
+
export function deployment(_, annotation) {
|
|
9
|
+
schemas.realtime.validate(annotation ?? null, 'Invalid realtime annotation');
|
|
10
|
+
const { streams, expire } = annotation;
|
|
11
|
+
const addresses = Array.isArray(streams) ? streams : [streams];
|
|
12
|
+
const global = [{ name: STREAMS, value: addresses.join(' ') }];
|
|
13
|
+
if (expire !== undefined)
|
|
14
|
+
global.push({ name: EXPIRE, value: String(expire) });
|
|
15
|
+
return { variables: { global } };
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=deployment.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deployment.js","sourceRoot":"","sources":["../../../source/extensions.exposition/realtime/deployment.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,eAAe,CAAA;AACxC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AAG5C;;;;GAIG;AACH,MAAM,UAAU,UAAU,CAAC,CAAU,EAAE,UAAuB;IAC5D,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,UAAU,IAAI,IAAI,EAAE,6BAA6B,CAAC,CAAA;IAE5E,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,UAAW,CAAA;IACvC,MAAM,SAAS,GAAG,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAA;IAC9D,MAAM,MAAM,GAAG,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAA;IAE9D,IAAI,MAAM,KAAK,SAAS;QAAE,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAA;IAE9E,OAAO,EAAE,SAAS,EAAE,EAAE,MAAM,EAAE,EAAE,CAAA;AAClC,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { deployment } from './deployment.ts';
|
|
2
|
+
export { manifest } from './manifest.ts';
|
|
3
|
+
export { parse } from './routes.ts';
|
|
4
|
+
export { EXPIRE, STREAMS } from './const.ts';
|
|
5
|
+
export type { Annotation } from './deployment.ts';
|
|
6
|
+
export type { Declaration, Route, RouteDeclaration } from './routes.ts';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../source/extensions.exposition/realtime/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACxC,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AACnC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Declaration } from './routes.ts';
|
|
2
|
+
import type { Manifest } from '@toa.io/norm';
|
|
3
|
+
/**
|
|
4
|
+
* A component's routes, refused where one does not say what it exposes: an event is given to its
|
|
5
|
+
* streams only as far as its route names.
|
|
6
|
+
*/
|
|
7
|
+
export declare function manifest(declaration: unknown, manifest: Manifest): Declaration;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as schemas from '../schemas.js';
|
|
2
|
+
/**
|
|
3
|
+
* A component's routes, refused where one does not say what it exposes: an event is given to its
|
|
4
|
+
* streams only as far as its route names.
|
|
5
|
+
*/
|
|
6
|
+
export function manifest(declaration, manifest) {
|
|
7
|
+
schemas.routes.validate(declaration, `Realtime routes of '${manifest.namespace}.${manifest.name}' are invalid`);
|
|
8
|
+
return declaration;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=manifest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manifest.js","sourceRoot":"","sources":["../../../source/extensions.exposition/realtime/manifest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,eAAe,CAAA;AAIxC;;;GAGG;AACH,MAAM,UAAU,QAAQ,CAAC,WAAoB,EAAE,QAAkB;IAC/D,OAAO,CAAC,MAAM,CAAC,QAAQ,CACrB,WAAW,EACX,uBAAuB,QAAQ,CAAC,SAAS,IAAI,QAAQ,CAAC,IAAI,eAAe,CAC1E,CAAA;IAED,OAAO,WAA0B,CAAA;AACnC,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A realtime route: an event of a component, the properties of its payload that are the keys of
|
|
3
|
+
* the streams it goes to, and what of it they are given.
|
|
4
|
+
*/
|
|
5
|
+
export interface Route {
|
|
6
|
+
/** the event's label within its component */
|
|
7
|
+
event: string;
|
|
8
|
+
properties: string[];
|
|
9
|
+
expose: string[];
|
|
10
|
+
}
|
|
11
|
+
/** A component's `realtime` declaration, by event label. */
|
|
12
|
+
export type Declaration = Record<string, RouteDeclaration>;
|
|
13
|
+
export interface RouteDeclaration {
|
|
14
|
+
key: string | string[];
|
|
15
|
+
/** What the streams are given of the event. Required: nothing is given that is not named. */
|
|
16
|
+
expose: string[];
|
|
17
|
+
}
|
|
18
|
+
export declare function parse(declaration: Declaration): Route[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"routes.js","sourceRoot":"","sources":["../../../source/extensions.exposition/realtime/routes.ts"],"names":[],"mappings":"AAqBA,MAAM,UAAU,KAAK,CAAC,WAAwB;IAC5C,OAAO,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,EAAE,EAAE,GAAG,EAAE,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;QACpE,KAAK;QACL,UAAU,EAAE,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;QAC5C,MAAM;KACP,CAAC,CAAC,CAAA;AACL,CAAC"}
|
|
@@ -5,3 +5,5 @@ export declare const querystring: Schema<Record<string, unknown>>;
|
|
|
5
5
|
export declare const call: Schema<Record<string, unknown>>;
|
|
6
6
|
export declare const annotation: Schema<Annotation>;
|
|
7
7
|
export declare const node: Schema<Node>;
|
|
8
|
+
export declare const realtime: Schema<unknown>;
|
|
9
|
+
export declare const routes: Schema<unknown>;
|
|
@@ -7,4 +7,6 @@ export const querystring = namespace.schema('querystring');
|
|
|
7
7
|
export const call = namespace.schema('call');
|
|
8
8
|
export const annotation = namespace.schema('annotation');
|
|
9
9
|
export const node = namespace.schema('node');
|
|
10
|
+
export const realtime = namespace.schema('realtime');
|
|
11
|
+
export const routes = namespace.schema('routes');
|
|
10
12
|
//# sourceMappingURL=schemas.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.js","sourceRoot":"","sources":["../../source/extensions.exposition/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,KAAK,OAAO,MAAM,iBAAiB,CAAA;AAK1C,MAAM,IAAI,GAAG,OAAO,CAAC,OAAO,IAAI,CAAC,OAAO,EAAE,qCAAqC,CAAC,CAAA;AAChF,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,CAAA;AAEzC,uFAAuF;AACvF,MAAM,CAAC,MAAM,WAAW,GACtB,SAAS,CAAC,MAAM,CAAC,aAAa,CAAC,CAAA;AACjC,MAAM,CAAC,MAAM,IAAI,GAAoC,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;AAE7E,MAAM,CAAC,MAAM,UAAU,GAAuB,SAAS,CAAC,MAAM,CAAC,YAAY,CAAC,CAAA;AAC5E,MAAM,CAAC,MAAM,IAAI,GAAiB,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA"}
|
|
1
|
+
{"version":3,"file":"schemas.js","sourceRoot":"","sources":["../../source/extensions.exposition/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,KAAK,OAAO,MAAM,iBAAiB,CAAA;AAK1C,MAAM,IAAI,GAAG,OAAO,CAAC,OAAO,IAAI,CAAC,OAAO,EAAE,qCAAqC,CAAC,CAAA;AAChF,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,CAAA;AAEzC,uFAAuF;AACvF,MAAM,CAAC,MAAM,WAAW,GACtB,SAAS,CAAC,MAAM,CAAC,aAAa,CAAC,CAAA;AACjC,MAAM,CAAC,MAAM,IAAI,GAAoC,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;AAE7E,MAAM,CAAC,MAAM,UAAU,GAAuB,SAAS,CAAC,MAAM,CAAC,YAAY,CAAC,CAAA;AAC5E,MAAM,CAAC,MAAM,IAAI,GAAiB,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;AAC1D,MAAM,CAAC,MAAM,QAAQ,GAAoB,SAAS,CAAC,MAAM,CAAC,UAAU,CAAC,CAAA;AACrE,MAAM,CAAC,MAAM,MAAM,GAAoB,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAA"}
|
|
@@ -3,7 +3,8 @@ import type { Instance } from './deployment.ts';
|
|
|
3
3
|
/**
|
|
4
4
|
* What each provider is written against, stated apart from the provider for the reason its
|
|
5
5
|
* secrets are: so that a deploy installs the SDK without loading it, and an image carries no
|
|
6
|
-
* SDK a declaration does not name.
|
|
6
|
+
* SDK a declaration does not name. The versions are this package's optional peers, so a bump
|
|
7
|
+
* is a change to its manifest alone. They are the extension's optional peers at the versions it
|
|
7
8
|
* declares them — `packages.test.ts` is what keeps the two the same.
|
|
8
9
|
*/
|
|
9
10
|
export declare const packages: Record<Provider, Readonly<Record<string, string>>>;
|
|
@@ -1,13 +1,17 @@
|
|
|
1
|
+
import { readFileSync } from 'node:fs';
|
|
2
|
+
import { join } from 'node:path';
|
|
3
|
+
const peers = JSON.parse(readFileSync(join(import.meta.dirname, '../../package.json'), 'utf8')).peerDependencies;
|
|
1
4
|
/**
|
|
2
5
|
* What each provider is written against, stated apart from the provider for the reason its
|
|
3
6
|
* secrets are: so that a deploy installs the SDK without loading it, and an image carries no
|
|
4
|
-
* SDK a declaration does not name.
|
|
7
|
+
* SDK a declaration does not name. The versions are this package's optional peers, so a bump
|
|
8
|
+
* is a change to its manifest alone. They are the extension's optional peers at the versions it
|
|
5
9
|
* declares them — `packages.test.ts` is what keeps the two the same.
|
|
6
10
|
*/
|
|
7
11
|
export const packages = {
|
|
8
|
-
s3:
|
|
9
|
-
spaces:
|
|
10
|
-
cloudinary:
|
|
12
|
+
s3: pin('@aws-sdk/client-s3', '@aws-sdk/lib-storage'),
|
|
13
|
+
spaces: pin('@aws-sdk/client-s3', '@aws-sdk/lib-storage'),
|
|
14
|
+
cloudinary: pin('cloudinary'),
|
|
11
15
|
fs: {},
|
|
12
16
|
tmp: {},
|
|
13
17
|
test: {}
|
|
@@ -38,4 +42,10 @@ export function installs(instance, annotation) {
|
|
|
38
42
|
function isAnnotation(value) {
|
|
39
43
|
return typeof value === 'object' && value !== null;
|
|
40
44
|
}
|
|
45
|
+
function pin(...names) {
|
|
46
|
+
const pinned = {};
|
|
47
|
+
for (const name of names)
|
|
48
|
+
pinned[name] = peers[name];
|
|
49
|
+
return pinned;
|
|
50
|
+
}
|
|
41
51
|
//# sourceMappingURL=packages.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packages.js","sourceRoot":"","sources":["../../source/extensions.storages/packages.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"packages.js","sourceRoot":"","sources":["../../source/extensions.storages/packages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AACtC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAKhC,MAAM,KAAK,GAA2B,IAAI,CAAC,KAAK,CAC9C,YAAY,CAAC,IAAI,CAAC,OAAO,IAAI,CAAC,OAAO,EAAE,oBAAoB,CAAC,EAAE,MAAM,CAAC,CACtE,CAAC,gBAAgB,CAAA;AAElB;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,QA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,IAAI,CAAC,CAAA;IAEpD,OAAO,MAAM,CAAA;AACf,CAAC"}
|
package/transpiled/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { version } from './version.ts';
|
|
2
|
-
export { MAP, MAP_DIRECTORY, MAP_FILE } from './map.ts';
|
|
2
|
+
export { MAP, MAP_DIRECTORY, MAP_FILE, MAP_LOCAL, MAP_LOCAL_FILE } from './map.ts';
|
|
3
3
|
export { PREDEFINED } from './predefined.ts';
|
|
4
4
|
export { definition, DEFINED } from './definition.ts';
|
package/transpiled/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { version } from './version.js';
|
|
2
|
-
export { MAP, MAP_DIRECTORY, MAP_FILE } from './map.js';
|
|
2
|
+
export { MAP, MAP_DIRECTORY, MAP_FILE, MAP_LOCAL, MAP_LOCAL_FILE } from './map.js';
|
|
3
3
|
export { PREDEFINED } from './predefined.js';
|
|
4
4
|
export { definition, DEFINED } from './definition.js';
|
|
5
5
|
//# 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,OAAO,EAAE,MAAM,cAAc,CAAA;AACtC,OAAO,EAAE,GAAG,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../source/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACtC,OAAO,EAAE,GAAG,EAAE,aAAa,EAAE,QAAQ,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAClF,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC5C,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAA"}
|
package/transpiled/map.d.ts
CHANGED
|
@@ -1,9 +1,18 @@
|
|
|
1
|
+
/** What `toa map` writes, and what a process is given by anything but a deployment. */
|
|
2
|
+
export declare const MAP_LOCAL_FILE = ".map.json";
|
|
1
3
|
/**
|
|
2
4
|
* Where a deployed process reads the component map from: the directory a chart mounts it in, and
|
|
3
5
|
* the file a command is given. The image names the file, because a mounted ConfigMap is a
|
|
4
6
|
* directory and a file placed into an existing one with `subPath` is the one kind of mount
|
|
5
7
|
* Kubernetes does not update.
|
|
8
|
+
*
|
|
9
|
+
* Gzipped, because a ConfigMap is capped at a megabyte and nothing reads this copy by eye. Named
|
|
10
|
+
* for what it is: a gzip stream called `.json` is something someone opens once and reports as
|
|
11
|
+
* broken, and so is a plain one called `.gz`, which is why a map mounted from a checkout is
|
|
12
|
+
* mounted under its own name.
|
|
6
13
|
*/
|
|
7
14
|
export declare const MAP_DIRECTORY = "/etc/toa";
|
|
8
|
-
export declare const MAP_FILE
|
|
15
|
+
export declare const MAP_FILE: string;
|
|
9
16
|
export declare const MAP: string;
|
|
17
|
+
/** Where a container run from a checkout is given the map that checkout wrote. */
|
|
18
|
+
export declare const MAP_LOCAL: string;
|