@toa.io/definitions 1.0.0-alpha.323 → 1.0.0-alpha.325
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/package.json +2 -2
- package/schemas/extensions.exposition/annotation.cos.yaml +5 -0
- package/schemas/extensions.exposition/routes.cos.yaml +6 -3
- package/transpiled/extensions.exposition/Annotation.d.ts +5 -0
- package/transpiled/extensions.exposition/realtime/index.d.ts +1 -1
- package/transpiled/extensions.exposition/realtime/index.js +1 -1
- package/transpiled/extensions.exposition/realtime/index.js.map +1 -1
- package/transpiled/extensions.exposition/realtime/routes.d.ts +10 -1
- package/transpiled/extensions.exposition/realtime/routes.js +17 -5
- package/transpiled/extensions.exposition/realtime/routes.js.map +1 -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.325",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "What Toa packages declare, read without running them",
|
|
6
6
|
"author": "temich <tema.gurtovoy@gmail.com>",
|
|
@@ -71,5 +71,5 @@
|
|
|
71
71
|
"optional": true
|
|
72
72
|
}
|
|
73
73
|
},
|
|
74
|
-
"gitHead": "
|
|
74
|
+
"gitHead": "95bc03e65c65f02d536da6ed027cf4f78f5cec74"
|
|
75
75
|
}
|
|
@@ -134,6 +134,11 @@ properties:
|
|
|
134
134
|
type: string
|
|
135
135
|
minLength: 1
|
|
136
136
|
additionalProperties: false
|
|
137
|
+
manifest:
|
|
138
|
+
description: The web manifest whose icons the server shows itself by
|
|
139
|
+
type: string
|
|
140
|
+
maxLength: 2048
|
|
141
|
+
pattern: ^(https://[^/]|http://(localhost|127\.0\.0\.1|\[::1\])(:\d+)?/)
|
|
137
142
|
required:
|
|
138
143
|
- name
|
|
139
144
|
additionalProperties: false
|
|
@@ -5,14 +5,17 @@ additionalProperties:
|
|
|
5
5
|
type: object
|
|
6
6
|
properties:
|
|
7
7
|
key:
|
|
8
|
-
description:
|
|
8
|
+
description: >-
|
|
9
|
+
The properties of the event that are the keys of the streams it goes to, or literal keys:
|
|
10
|
+
`~` and the key
|
|
11
|
+
# a property, or `~` and at least one character of a literal
|
|
9
12
|
oneOf:
|
|
10
13
|
- type: string
|
|
11
|
-
|
|
14
|
+
pattern: ^(?:[^~]|~.)
|
|
12
15
|
- type: array
|
|
13
16
|
items:
|
|
14
17
|
type: string
|
|
15
|
-
|
|
18
|
+
pattern: ^(?:[^~]|~.)
|
|
16
19
|
minItems: 1
|
|
17
20
|
expose:
|
|
18
21
|
description: What of the event its streams are given; nothing is given that is not named
|
|
@@ -72,6 +72,11 @@ export interface MCP {
|
|
|
72
72
|
* else is. See `documentation/mcp.md`.
|
|
73
73
|
*/
|
|
74
74
|
hosts?: Record<string, string>;
|
|
75
|
+
/**
|
|
76
|
+
* The application's web manifest, whose icons the server shows itself by: `https`, or
|
|
77
|
+
* `http` on a loopback host. See `documentation/mcp.md`.
|
|
78
|
+
*/
|
|
79
|
+
manifest?: string;
|
|
75
80
|
}
|
|
76
81
|
export interface Bouncer {
|
|
77
82
|
/** what an address may fail at once, 20 by default */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { deployment } from './deployment.ts';
|
|
2
2
|
export { manifest } from './manifest.ts';
|
|
3
|
-
export { parse } from './routes.ts';
|
|
3
|
+
export { literal, parse } from './routes.ts';
|
|
4
4
|
export { EXPIRE, STREAMS } from './const.ts';
|
|
5
5
|
export type { Annotation } from './deployment.ts';
|
|
6
6
|
export type { Declaration, Route, RouteDeclaration } from './routes.ts';
|
|
@@ -1 +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;
|
|
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,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AAC5C,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA"}
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
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
|
|
3
|
+
* the streams it goes to, the literal keys it goes to whatever its payload, and what of it they
|
|
4
|
+
* are given.
|
|
4
5
|
*/
|
|
5
6
|
export interface Route {
|
|
6
7
|
/** the event's label within its component */
|
|
7
8
|
event: string;
|
|
8
9
|
properties: string[];
|
|
10
|
+
/** keys as they are, `~` included */
|
|
11
|
+
literals: string[];
|
|
9
12
|
expose: string[];
|
|
10
13
|
}
|
|
11
14
|
/** A component's `realtime` declaration, by event label. */
|
|
@@ -16,3 +19,9 @@ export interface RouteDeclaration {
|
|
|
16
19
|
expose: string[];
|
|
17
20
|
}
|
|
18
21
|
export declare function parse(declaration: Declaration): Route[];
|
|
22
|
+
/**
|
|
23
|
+
* A key that begins with `~` is the key itself. No property is named so, and no value of a
|
|
24
|
+
* property is taken for a key so, which keeps a literal's stream out of reach of whoever writes
|
|
25
|
+
* the values.
|
|
26
|
+
*/
|
|
27
|
+
export declare function literal(key: string): boolean;
|
|
@@ -1,8 +1,20 @@
|
|
|
1
1
|
export function parse(declaration) {
|
|
2
|
-
return Object.entries(declaration).map(([event, { key, expose }]) =>
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
return Object.entries(declaration).map(([event, { key, expose }]) => {
|
|
3
|
+
const keys = Array.isArray(key) ? key : [key];
|
|
4
|
+
return {
|
|
5
|
+
event,
|
|
6
|
+
properties: keys.filter((one) => !literal(one)),
|
|
7
|
+
literals: keys.filter(literal),
|
|
8
|
+
expose
|
|
9
|
+
};
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* A key that begins with `~` is the key itself. No property is named so, and no value of a
|
|
14
|
+
* property is taken for a key so, which keeps a literal's stream out of reach of whoever writes
|
|
15
|
+
* the values.
|
|
16
|
+
*/
|
|
17
|
+
export function literal(key) {
|
|
18
|
+
return key.startsWith('~');
|
|
7
19
|
}
|
|
8
20
|
//# sourceMappingURL=routes.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routes.js","sourceRoot":"","sources":["../../../source/extensions.exposition/realtime/routes.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"routes.js","sourceRoot":"","sources":["../../../source/extensions.exposition/realtime/routes.ts"],"names":[],"mappings":"AAyBA,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;QAClE,MAAM,IAAI,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAA;QAE7C,OAAO;YACL,KAAK;YACL,UAAU,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;YAC/C,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC;YAC9B,MAAM;SACP,CAAA;IACH,CAAC,CAAC,CAAA;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,OAAO,CAAC,GAAW;IACjC,OAAO,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,CAAA;AAC5B,CAAC"}
|