@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.
Files changed (62) hide show
  1. package/digest/extensions.configuration.json +1 -1
  2. package/digest/extensions.exposition.json +1 -1
  3. package/package.json +20 -5
  4. package/schemas/extensions.cadence/declaration.cos.yaml +5 -0
  5. package/schemas/extensions.exposition/annotation.cos.yaml +8 -0
  6. package/schemas/extensions.exposition/realtime.cos.yaml +19 -0
  7. package/schemas/extensions.exposition/routes.cos.yaml +27 -0
  8. package/transpiled/definition.js +9 -3
  9. package/transpiled/definition.js.map +1 -1
  10. package/transpiled/digest/generate.js +1 -2
  11. package/transpiled/digest/generate.js.map +1 -1
  12. package/transpiled/extensions.cadence/index.d.ts +1 -1
  13. package/transpiled/extensions.cadence/manifest.d.ts +2 -2
  14. package/transpiled/extensions.cadence/manifest.js +2 -0
  15. package/transpiled/extensions.cadence/manifest.js.map +1 -1
  16. package/transpiled/extensions.cadence/types.d.ts +13 -0
  17. package/transpiled/extensions.exposition/Annotation.d.ts +6 -1
  18. package/transpiled/extensions.exposition/deployment.js +14 -1
  19. package/transpiled/extensions.exposition/deployment.js.map +1 -1
  20. package/transpiled/extensions.exposition/index.d.ts +1 -0
  21. package/transpiled/extensions.exposition/index.js +1 -0
  22. package/transpiled/extensions.exposition/index.js.map +1 -1
  23. package/transpiled/extensions.exposition/keys.d.ts +2 -0
  24. package/transpiled/extensions.exposition/keys.js +3 -0
  25. package/transpiled/extensions.exposition/keys.js.map +1 -0
  26. package/transpiled/extensions.exposition/realtime/const.d.ts +4 -0
  27. package/transpiled/extensions.exposition/realtime/const.js +5 -0
  28. package/transpiled/extensions.exposition/realtime/const.js.map +1 -0
  29. package/transpiled/extensions.exposition/realtime/deployment.d.ts +11 -0
  30. package/transpiled/extensions.exposition/realtime/deployment.js +17 -0
  31. package/transpiled/extensions.exposition/realtime/deployment.js.map +1 -0
  32. package/transpiled/extensions.exposition/realtime/index.d.ts +6 -0
  33. package/transpiled/extensions.exposition/realtime/index.js +5 -0
  34. package/transpiled/extensions.exposition/realtime/index.js.map +1 -0
  35. package/transpiled/extensions.exposition/realtime/manifest.d.ts +7 -0
  36. package/transpiled/extensions.exposition/realtime/manifest.js +10 -0
  37. package/transpiled/extensions.exposition/realtime/manifest.js.map +1 -0
  38. package/transpiled/extensions.exposition/realtime/routes.d.ts +18 -0
  39. package/transpiled/extensions.exposition/realtime/routes.js +8 -0
  40. package/transpiled/extensions.exposition/realtime/routes.js.map +1 -0
  41. package/transpiled/extensions.exposition/schemas.d.ts +2 -0
  42. package/transpiled/extensions.exposition/schemas.js +2 -0
  43. package/transpiled/extensions.exposition/schemas.js.map +1 -1
  44. package/transpiled/extensions.storages/packages.d.ts +2 -1
  45. package/transpiled/extensions.storages/packages.js +14 -4
  46. package/transpiled/extensions.storages/packages.js.map +1 -1
  47. package/transpiled/index.d.ts +1 -1
  48. package/transpiled/index.js +1 -1
  49. package/transpiled/index.js.map +1 -1
  50. package/transpiled/map.d.ts +10 -1
  51. package/transpiled/map.js +10 -1
  52. package/transpiled/map.js.map +1 -1
  53. package/digest/extensions.realtime.json +0 -1
  54. package/transpiled/extensions.realtime/components.d.ts +0 -2
  55. package/transpiled/extensions.realtime/components.js +0 -5
  56. package/transpiled/extensions.realtime/components.js.map +0 -1
  57. package/transpiled/extensions.realtime/deployment.d.ts +0 -22
  58. package/transpiled/extensions.realtime/deployment.js +0 -53
  59. package/transpiled/extensions.realtime/deployment.js.map +0 -1
  60. package/transpiled/extensions.realtime/index.d.ts +0 -3
  61. package/transpiled/extensions.realtime/index.js +0 -3
  62. package/transpiled/extensions.realtime/index.js.map +0 -1
package/transpiled/map.js CHANGED
@@ -1,10 +1,19 @@
1
+ /** What `toa map` writes, and what a process is given by anything but a deployment. */
2
+ export 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 const MAP_DIRECTORY = '/etc/toa';
8
- export const MAP_FILE = '.map.json';
15
+ export const MAP_FILE = MAP_LOCAL_FILE + '.gz';
9
16
  export const MAP = MAP_DIRECTORY + '/' + MAP_FILE;
17
+ /** Where a container run from a checkout is given the map that checkout wrote. */
18
+ export const MAP_LOCAL = MAP_DIRECTORY + '/' + MAP_LOCAL_FILE;
10
19
  //# sourceMappingURL=map.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"map.js","sourceRoot":"","sources":["../source/map.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,UAAU,CAAA;AAEvC,MAAM,CAAC,MAAM,QAAQ,GAAG,WAAW,CAAA;AAEnC,MAAM,CAAC,MAAM,GAAG,GAAG,aAAa,GAAG,GAAG,GAAG,QAAQ,CAAA"}
1
+ {"version":3,"file":"map.js","sourceRoot":"","sources":["../source/map.ts"],"names":[],"mappings":"AAAA,uFAAuF;AACvF,MAAM,CAAC,MAAM,cAAc,GAAG,WAAW,CAAA;AAEzC;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,UAAU,CAAA;AAEvC,MAAM,CAAC,MAAM,QAAQ,GAAG,cAAc,GAAG,KAAK,CAAA;AAE9C,MAAM,CAAC,MAAM,GAAG,GAAG,aAAa,GAAG,GAAG,GAAG,QAAQ,CAAA;AAEjD,kFAAkF;AAClF,MAAM,CAAC,MAAM,SAAS,GAAG,aAAa,GAAG,GAAG,GAAG,cAAc,CAAA"}
@@ -1 +0,0 @@
1
- [{"label":"realtime-streams","manifest":{"namespace":"realtime","name":"streams","operations":{"create":{"input":{"properties":{"key":{"type":"string"},"token":{"type":"string"}},"type":"object"},"type":"effect","scope":"none","bridge":"@toa.io/bridges.node","query":false,"output":{},"bindings":["@toa.io/bindings.amqp"]},"push":{"output":{"type":"null"},"bindings":[],"input":{"properties":{"data":{},"key":{"type":"string"},"event":{"type":"string"}},"type":"object","required":["key","event"]},"type":"effect","scope":"none","bridge":"@toa.io/bridges.node","query":false}},"path":"@toa.io/extensions.realtime/components/realtime.streams","bindings":["@toa.io/bindings.amqp"],"bridge":"@toa.io/bridges.node","prototype":null,"extensions":{"@toa.io/extensions.telemetry":{},"@toa.io/extensions.fetch":null,"@toa.io/extensions.introspection":{},"@toa.io/extensions.exposition":{"routes":[{"path":"/realtime/streams","node":{"routes":[{"path":"/:key","node":{"routes":[],"methods":[{"verb":"GET","mapping":{"endpoint":"create","query":null,"paged":false,"namespace":"realtime","component":"streams"},"directives":[{"family":"io","name":"readonly","value":false}]}],"directives":[{"family":"auth","name":"id","value":"key"}]}}],"methods":[],"directives":[]}}],"methods":[],"directives":[]},"@toa.io/extensions.configuration":{"schema":{"properties":{"maxlen":{"type":"number"},"expire":{"type":"number"}},"type":"object","required":["maxlen","expire"]},"defaults":{"maxlen":1000,"expire":300}},"@toa.io/extensions.state":null,"@toa.io/extensions.stash":null},"version":"b6dd4c5d"}}]
@@ -1,2 +0,0 @@
1
- import { type Components } from '../digest/read.ts';
2
- export declare function components(): Components;
@@ -1,5 +0,0 @@
1
- import { components as digest } from '../digest/read.js';
2
- export function components() {
3
- return digest('extensions.realtime');
4
- }
5
- //# sourceMappingURL=components.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"components.js","sourceRoot":"","sources":["../../source/extensions.realtime/components.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,IAAI,MAAM,EAAmB,MAAM,mBAAmB,CAAA;AAEzE,MAAM,UAAU,UAAU;IACxB,OAAO,MAAM,CAAC,qBAAqB,CAAC,CAAA;AACtC,CAAC"}
@@ -1,22 +0,0 @@
1
- import type { Dependency, Instances, Resources } from '@toa.io/operations';
2
- /** Where Toa's release publishes this service's image. An application takes it
3
- * instead of building one when its context says `registry.services: published`. */
4
- export declare const image = "ghcr.io/toa-io/extension-realtime-streams";
5
- export declare const standalone = true;
6
- export declare function deployment(instances: Instances<Declaration>, annotation?: Declaration & Annotation): Dependency;
7
- export declare function parse(declaration: Declaration): Route[];
8
- export type Entry = string | string[] | RouteDeclaration;
9
- export type Declaration = Record<string, Entry>;
10
- export interface RouteDeclaration {
11
- key: string | string[];
12
- expose?: string[];
13
- }
14
- export interface Route {
15
- event: string;
16
- properties: string[];
17
- expose?: string[];
18
- }
19
- interface Annotation {
20
- resources?: Resources;
21
- }
22
- export {};
@@ -1,53 +0,0 @@
1
- import { components } from './components.js';
2
- import { version } from '../version.js';
3
- /** Where Toa's release publishes this service's image. An application takes it
4
- * instead of building one when its context says `registry.services: published`. */
5
- export const image = 'ghcr.io/toa-io/extension-realtime-streams';
6
- export const standalone = true;
7
- export function deployment(instances, annotation) {
8
- const routes = [];
9
- const { resources, ...annotatedRoutes } = annotation ?? {};
10
- const labels = components().labels;
11
- if (annotatedRoutes !== undefined)
12
- routes.push(...parse(annotatedRoutes));
13
- for (const instance of instances) {
14
- const completed = {};
15
- for (const [key, value] of Object.entries(instance.manifest)) {
16
- const event = instance.locator.id + '.' + key;
17
- completed[event] = value;
18
- }
19
- routes.push(...parse(completed));
20
- }
21
- const service = {
22
- group: 'realtime',
23
- name: 'streams',
24
- image,
25
- version,
26
- components: labels,
27
- resources,
28
- variables: [
29
- {
30
- name: 'TOA_REALTIME',
31
- value: JSON.stringify(routes)
32
- }
33
- ]
34
- };
35
- return { services: [service], events: routes.map((route) => route.event) };
36
- }
37
- export function parse(declaration) {
38
- const routes = [];
39
- for (const [event, value] of Object.entries(declaration))
40
- if (isObject(value)) {
41
- const properties = Array.isArray(value.key) ? value.key : [value.key];
42
- routes.push({ event, properties, expose: value.expose });
43
- }
44
- else {
45
- const properties = Array.isArray(value) ? value : [value];
46
- routes.push({ event, properties });
47
- }
48
- return routes;
49
- }
50
- function isObject(value) {
51
- return typeof value === 'object' && !Array.isArray(value);
52
- }
53
- //# sourceMappingURL=deployment.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"deployment.js","sourceRoot":"","sources":["../../source/extensions.realtime/deployment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAGvC;oFACoF;AACpF,MAAM,CAAC,MAAM,KAAK,GAAG,2CAA2C,CAAA;AAEhE,MAAM,CAAC,MAAM,UAAU,GAAG,IAAI,CAAA;AAE9B,MAAM,UAAU,UAAU,CACxB,SAAiC,EACjC,UAAqC;IAErC,MAAM,MAAM,GAAG,EAAE,CAAA;IACjB,MAAM,EAAE,SAAS,EAAE,GAAG,eAAe,EAAE,GAAG,UAAU,IAAI,EAAE,CAAA;IAC1D,MAAM,MAAM,GAAG,UAAU,EAAE,CAAC,MAAM,CAAA;IAElC,IAAI,eAAe,KAAK,SAAS;QAAE,MAAM,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,eAAe,CAAC,CAAC,CAAA;IAEzE,KAAK,MAAM,QAAQ,IAAI,SAAS,EAAE,CAAC;QACjC,MAAM,SAAS,GAAgB,EAAE,CAAA;QAEjC,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC;YAC7D,MAAM,KAAK,GAAG,QAAQ,CAAC,OAAO,CAAC,EAAE,GAAG,GAAG,GAAG,GAAG,CAAA;YAE7C,SAAS,CAAC,KAAK,CAAC,GAAG,KAAK,CAAA;QAC1B,CAAC;QAED,MAAM,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,SAAS,CAAC,CAAC,C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AAO,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;AAC3D,CAAC"}
@@ -1,3 +0,0 @@
1
- export { deployment, image, standalone, parse } from './deployment.ts';
2
- export { components } from './components.ts';
3
- export type { Declaration, Entry, Route, RouteDeclaration } from './deployment.ts';
@@ -1,3 +0,0 @@
1
- export { deployment, image, standalone, parse } from './deployment.js';
2
- export { components } from './components.js';
3
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../source/extensions.realtime/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AACtE,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA"}