@toa.io/definitions 1.0.0-alpha.311 → 1.0.0-alpha.312
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/package.json +3 -3
- package/transpiled/bindings.http/annotation.d.ts +8 -0
- package/transpiled/bindings.http/annotation.js +7 -0
- package/transpiled/bindings.http/annotation.js.map +1 -0
- package/transpiled/bindings.http/const.d.ts +5 -0
- package/transpiled/bindings.http/const.js +6 -0
- package/transpiled/bindings.http/const.js.map +1 -0
- package/transpiled/bindings.http/deployment.d.ts +8 -0
- package/transpiled/bindings.http/deployment.js +12 -0
- package/transpiled/bindings.http/deployment.js.map +1 -0
- package/transpiled/bindings.http/index.d.ts +5 -0
- package/transpiled/bindings.http/index.js +4 -0
- package/transpiled/bindings.http/index.js.map +1 -0
- package/transpiled/bindings.loop/index.js +1 -1
- package/transpiled/bindings.loop/index.js.map +1 -1
- package/transpiled/definition.js +1 -0
- package/transpiled/definition.js.map +1 -1
- package/transpiled/extensions.configuration/const.d.ts +6 -0
- package/transpiled/extensions.configuration/const.js +6 -0
- package/transpiled/extensions.configuration/const.js.map +1 -1
- package/transpiled/extensions.configuration/deployment.js +13 -8
- package/transpiled/extensions.configuration/deployment.js.map +1 -1
- package/transpiled/extensions.configuration/epoch.d.ts +5 -0
- package/transpiled/extensions.configuration/epoch.js +11 -1
- package/transpiled/extensions.configuration/epoch.js.map +1 -1
- package/transpiled/extensions.configuration/index.d.ts +1 -1
- package/transpiled/extensions.configuration/index.js +1 -1
- package/transpiled/extensions.configuration/index.js.map +1 -1
- package/transpiled/extensions.exposition/manifest.js +16 -0
- package/transpiled/extensions.exposition/manifest.js.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"label":"configuration-values","manifest":{"namespace":"configuration","name":"values","entity":{"properties":{"component":{"type":"string"},"epoch":{"type":"string"},"configuration":{"type":"object"},"originator":{"type":"string"},"id":{"type":"string","pattern":"^[a-fA-F0-9]{32}$"},"VERSION":{"type":"integer","minimum":0},"CREATED":{"type":"integer","format":"epoch-millis"},"UPDATED":{"type":"integer","format":"epoch-millis"},"DELETED":{"type":"integer","format":"epoch-millis","nullable":true},"REGION":{"type":"integer","minimum":0}},"required":["component","epoch","configuration","originator","id","VERSION","CREATED","UPDATED","DELETED","REGION"],"storage":"@toa.io/storages.mongodb","migrations":[{"id":"system:0000-property-names","steps":[{"update":{"filter":{"_version":{"$exists":true}},"update":{"$rename":{"_version":"VERSION","_created":"CREATED","_updated":"UPDATED","_deleted":"DELETED"}}}}],"prototype":"system"},{"id":"system:0001-epoch-millis","steps":[{"update":{"filter":{"CREATED":{"$type":"number"}},"update":[{"$set":{"CREATED":{"$toDate":{"$toLong":"$CREATED"}},"UPDATED":{"$toDate":{"$toLong":"$UPDATED"}},"DELETED":{"$toDate":{"$toLong":"$DELETED"}}}}]}}],"prototype":"system"},{"id":"system:0002-region","steps":[{"update":{"filter":{"REGION":{"$exists":false}},"update":{"$set":{"REGION":0}}}}],"prototype":"system"},{"id":"0002-indexes","steps":[{"index":{"name":"index_lookup","keys":{"component":"asc","epoch":"asc","CREATED":"desc"},"sparse":true}}]}],"associated":false,"custom":false},"operations":{"get":{"query":false,"input":{"type":"object","properties":{"component":{"type":"string"},"epoch":{"type":"string"}},"required":["component"]},"output":{"type":"object","nullable":true,"properties":{"configuration":{"type":"object"},"schema":{"type":"object"},"epoch":{"type":"string"}},"required":["configuration","epoch"]},"type":"computation","scope":"none","bridge":"@toa.io/bridges.node","bindings":["@toa.io/bindings.amqp"]},"fetch":{"query":false,"input":{"type":"array","items":{"type":"object","properties":{"component":{"type":"string"},"epoch":{"type":"string"}},"required":["component","epoch"]}},"output":{"type":"array","items":{"type":"object","properties":{"component":{"type":"string"},"epoch":{"type":"string"},"configuration":{"type":"object","nullable":true},"created":{"type":"integer"}},"required":["component","epoch","configuration","created"]}},"type":"computation","scope":"none","bridge":"@toa.io/bridges.node","bindings":["@toa.io/bindings.amqp"]},"list":{"query":false,"output":{"type":"array","items":{"type":"object","properties":{"component":{"type":"string"},"epoch":{"type":"string"},"schema":{"type":"object"},"configuration":{"type":"object"}},"required":["component","epoch","schema","configuration"]}},"type":"computation","scope":"none","bridge":"@toa.io/bridges.node","bindings":["@toa.io/bindings.amqp"]},"create":{"query":false,"input":{"type":"object","properties":{"component":{"type":"string"},"configuration":{"type":"object"},"originator":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"]}},"required":["component","configuration","originator"]},"errors":["UNKNOWN_COMPONENT","INVALID_CONFIGURATION"],"type":"transition","scope":"object","bridge":"@toa.io/bridges.node","output":{},"bindings":["@toa.io/bindings.amqp"]},"assign":{"type":"assignment","scope":"changeset","output":{},"bindings":["@toa.io/bindings.amqp"]},"ensure":{"type":"effect","scope":"object","output":{},"bindings":["@toa.io/bindings.amqp"]},"enumerate":{"type":"observation","scope":"objects","output":{},"bindings":["@toa.io/bindings.amqp"]},"observe":{"type":"observation","scope":"object","output":{},"bindings":["@toa.io/bindings.amqp"]},"stream":{"type":"observation","scope":"stream","output":{},"bindings":["@toa.io/bindings.amqp"]},"terminate":{"type":"assignment","scope":"changeset","output":{},"bindings":["@toa.io/bindings.amqp"]}},"path":"@toa.io/extensions.configuration/components/configuration.values","bindings":["@toa.io/bindings.amqp"],"bridge":"@toa.io/bridges.node","extensions":{"@toa.io/extensions.telemetry":{},"@toa.io/extensions.fetch":null,"@toa.io/extensions.introspection":{},"@toa.io/extensions.exposition":{"routes":[{"path":"/configuration/values","node":{"routes":[{"path":"/","node":{"routes":[],"methods":[{"verb":"GET","mapping":{"endpoint":"list","query":null,"paged":false,"namespace":"configuration","component":"values"},"directives":[{"family":"io","name":"output","value":true},{"family":"auth","name":"role","value":"system:configuration:get"}]}],"directives":[]}},{"path":"/:component","node":{"routes":[],"methods":[{"verb":"GET","mapping":{"endpoint":"get","query":null,"paged":false,"namespace":"configuration","component":"values"},"directives":[{"family":"io","name":"output","value":true},{"family":"auth","name":"role","value":"system:configuration:get"}]},{"verb":"POST","mapping":{"endpoint":"create","query":null,"paged":false,"namespace":"configuration","component":"values"},"directives":[{"family":"io","name":"output","value":["id","epoch"]},{"family":"auth","name":"rule","value":{"role":"system:configuration:create","delegate":"originator"}}]}],"directives":[{"family":"map","name":"segments","value":{"component":"component"}}]}}],"methods":[],"directives":[],"isolated":true}}],"methods":[],"directives":[]}},"version":"
|
|
1
|
+
[{"label":"configuration-values","manifest":{"namespace":"configuration","name":"values","entity":{"properties":{"component":{"type":"string"},"epoch":{"type":"string"},"configuration":{"type":"object"},"originator":{"type":"string"},"id":{"type":"string","pattern":"^[a-fA-F0-9]{32}$"},"VERSION":{"type":"integer","minimum":0},"CREATED":{"type":"integer","format":"epoch-millis"},"UPDATED":{"type":"integer","format":"epoch-millis"},"DELETED":{"type":"integer","format":"epoch-millis","nullable":true},"REGION":{"type":"integer","minimum":0}},"required":["component","epoch","configuration","originator","id","VERSION","CREATED","UPDATED","DELETED","REGION"],"storage":"@toa.io/storages.mongodb","migrations":[{"id":"system:0000-property-names","steps":[{"update":{"filter":{"_version":{"$exists":true}},"update":{"$rename":{"_version":"VERSION","_created":"CREATED","_updated":"UPDATED","_deleted":"DELETED"}}}}],"prototype":"system"},{"id":"system:0001-epoch-millis","steps":[{"update":{"filter":{"CREATED":{"$type":"number"}},"update":[{"$set":{"CREATED":{"$toDate":{"$toLong":"$CREATED"}},"UPDATED":{"$toDate":{"$toLong":"$UPDATED"}},"DELETED":{"$toDate":{"$toLong":"$DELETED"}}}}]}}],"prototype":"system"},{"id":"system:0002-region","steps":[{"update":{"filter":{"REGION":{"$exists":false}},"update":{"$set":{"REGION":0}}}}],"prototype":"system"},{"id":"0002-indexes","steps":[{"index":{"name":"index_lookup","keys":{"component":"asc","epoch":"asc","CREATED":"desc"},"sparse":true}}]}],"associated":false,"custom":false},"operations":{"get":{"query":false,"input":{"type":"object","properties":{"component":{"type":"string"},"epoch":{"type":"string"}},"required":["component"]},"output":{"type":"object","nullable":true,"properties":{"configuration":{"type":"object"},"schema":{"type":"object"},"epoch":{"type":"string"}},"required":["configuration","epoch"]},"type":"computation","scope":"none","bridge":"@toa.io/bridges.node","bindings":["@toa.io/bindings.amqp"]},"fetch":{"query":false,"input":{"type":"array","items":{"type":"object","properties":{"component":{"type":"string"},"epoch":{"type":"string"}},"required":["component","epoch"]}},"output":{"type":"array","items":{"type":"object","properties":{"component":{"type":"string"},"epoch":{"type":"string"},"configuration":{"type":"object","nullable":true},"created":{"type":"integer"},"revision":{"type":"string","nullable":true}},"required":["component","epoch","configuration","created"]}},"type":"computation","scope":"none","bridge":"@toa.io/bridges.node","bindings":["@toa.io/bindings.amqp"]},"list":{"query":false,"output":{"type":"array","items":{"type":"object","properties":{"component":{"type":"string"},"epoch":{"type":"string"},"schema":{"type":"object"},"configuration":{"type":"object"}},"required":["component","epoch","schema","configuration"]}},"type":"computation","scope":"none","bridge":"@toa.io/bridges.node","bindings":["@toa.io/bindings.amqp"]},"create":{"query":false,"input":{"type":"object","properties":{"component":{"type":"string"},"configuration":{"type":"object"},"originator":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"]}},"required":["component","configuration","originator"]},"errors":["UNKNOWN_COMPONENT","INVALID_CONFIGURATION"],"type":"transition","scope":"object","bridge":"@toa.io/bridges.node","output":{},"bindings":["@toa.io/bindings.amqp"]},"assign":{"type":"assignment","scope":"changeset","output":{},"bindings":["@toa.io/bindings.amqp"]},"ensure":{"type":"effect","scope":"object","output":{},"bindings":["@toa.io/bindings.amqp"]},"enumerate":{"type":"observation","scope":"objects","output":{},"bindings":["@toa.io/bindings.amqp"]},"observe":{"type":"observation","scope":"object","output":{},"bindings":["@toa.io/bindings.amqp"]},"stream":{"type":"observation","scope":"stream","output":{},"bindings":["@toa.io/bindings.amqp"]},"terminate":{"type":"assignment","scope":"changeset","output":{},"bindings":["@toa.io/bindings.amqp"]}},"path":"@toa.io/extensions.configuration/components/configuration.values","bindings":["@toa.io/bindings.amqp"],"bridge":"@toa.io/bridges.node","extensions":{"@toa.io/extensions.telemetry":{},"@toa.io/extensions.fetch":null,"@toa.io/extensions.introspection":{},"@toa.io/extensions.exposition":{"routes":[{"path":"/configuration/values","node":{"routes":[{"path":"/","node":{"routes":[],"methods":[{"verb":"GET","mapping":{"endpoint":"list","query":null,"paged":false,"namespace":"configuration","component":"values"},"directives":[{"family":"io","name":"output","value":true},{"family":"auth","name":"role","value":"system:configuration:get"}]}],"directives":[]}},{"path":"/:component","node":{"routes":[],"methods":[{"verb":"GET","mapping":{"endpoint":"get","query":null,"paged":false,"namespace":"configuration","component":"values"},"directives":[{"family":"io","name":"output","value":true},{"family":"auth","name":"role","value":"system:configuration:get"}]},{"verb":"POST","mapping":{"endpoint":"create","query":null,"paged":false,"namespace":"configuration","component":"values"},"directives":[{"family":"io","name":"output","value":["id","epoch"]},{"family":"auth","name":"rule","value":{"role":"system:configuration:create","delegate":"originator"}}]}],"directives":[{"family":"map","name":"segments","value":{"component":"component"}}]}}],"methods":[],"directives":[],"isolated":true}}],"methods":[],"directives":[]}},"version":"6efd9545","prototype":{"prototype":null,"path":"@toa.io/prototype","operations":{"transit":{"bridge":"@toa.io/bridges.node"},"assign":{"bridge":"@toa.io/bridges.node"},"ensure":{"bridge":"@toa.io/bridges.node"},"enumerate":{"bridge":"@toa.io/bridges.node"},"observe":{"bridge":"@toa.io/bridges.node"},"stream":{"bridge":"@toa.io/bridges.node"},"terminate":{"bridge":"@toa.io/bridges.node"}}},"events":{"created":{"conditioned":true,"subjective":false,"path":"@toa.io/prototype","bridge":"@toa.io/bridges.node","binding":"@toa.io/bindings.amqp"},"deleted":{"conditioned":true,"subjective":false,"path":"@toa.io/prototype","bridge":"@toa.io/bridges.node","binding":"@toa.io/bindings.amqp"},"sync":{"conditioned":false,"subjective":false,"path":"@toa.io/prototype","bridge":"@toa.io/bridges.node","binding":"@toa.io/bindings.amqp"},"updated":{"conditioned":true,"subjective":false,"path":"@toa.io/prototype","bridge":"@toa.io/bridges.node","binding":"@toa.io/bindings.amqp"}}}}]
|
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.312",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "What Toa packages declare, read without running them",
|
|
6
6
|
"author": "temich <tema.gurtovoy@gmail.com>",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"./*": "./transpiled/*/index.js"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"@toa.io/core": "1.0.0-alpha.
|
|
47
|
+
"@toa.io/core": "1.0.0-alpha.312",
|
|
48
48
|
"openspan": "1.0.0-alpha.305",
|
|
49
49
|
"oxc-parser": "0.149.0"
|
|
50
50
|
},
|
|
@@ -56,5 +56,5 @@
|
|
|
56
56
|
"optional": true
|
|
57
57
|
}
|
|
58
58
|
},
|
|
59
|
-
"gitHead": "
|
|
59
|
+
"gitHead": "3cdff9b9779eeb6ae83913fefc0b502a10a0236a"
|
|
60
60
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where each component of the context answers a streamed call. A key states an address for the
|
|
3
|
+
* component it names and for the components under it; `.` states one for every component of the
|
|
4
|
+
* context, which a deployment normally leaves unsaid.
|
|
5
|
+
*/
|
|
6
|
+
export type Annotation = Record<string, string>;
|
|
7
|
+
export declare function normalize(declaration: Declaration): Annotation;
|
|
8
|
+
export type Declaration = string | Annotation;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"annotation.js","sourceRoot":"","sources":["../../source/bindings.http/annotation.ts"],"names":[],"mappings":"AAOA,MAAM,UAAU,SAAS,CAAC,WAAwB;IAChD,IAAI,OAAO,WAAW,KAAK,QAAQ;QAAE,OAAO,EAAE,GAAG,EAAE,WAAW,EAAE,CAAA;;QAC3D,OAAO,WAAW,CAAA;AACzB,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** What a component answers streamed calls on, where its address states no port of its own. */
|
|
2
|
+
export declare const PORT = 8005;
|
|
3
|
+
/** The address map of the context, as the deployment writes it into the environment. */
|
|
4
|
+
export declare const VARIABLE = "TOA_HTTP";
|
|
5
|
+
export declare const ID = "http";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** What a component answers streamed calls on, where its address states no port of its own. */
|
|
2
|
+
export const PORT = 8005;
|
|
3
|
+
/** The address map of the context, as the deployment writes it into the environment. */
|
|
4
|
+
export const VARIABLE = 'TOA_HTTP';
|
|
5
|
+
export const ID = 'http';
|
|
6
|
+
//# sourceMappingURL=const.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"const.js","sourceRoot":"","sources":["../../source/bindings.http/const.ts"],"names":[],"mappings":"AAAA,+FAA+F;AAC/F,MAAM,CAAC,MAAM,IAAI,GAAG,IAAI,CAAA;AAExB,wFAAwF;AACxF,MAAM,CAAC,MAAM,QAAQ,GAAG,UAAU,CAAA;AAElC,MAAM,CAAC,MAAM,EAAE,GAAG,MAAM,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type Dependency } from '@toa.io/operations';
|
|
2
|
+
import { type Declaration } from './annotation.ts';
|
|
3
|
+
/**
|
|
4
|
+
* The map every process reads, both to dial a component and to know the port it listens on for
|
|
5
|
+
* the components it serves. It deploys nothing: a component answers on the `Service` rendered
|
|
6
|
+
* for it, which is where an unstated address resolves to.
|
|
7
|
+
*/
|
|
8
|
+
export declare function deployment(_: unknown, declaration?: Declaration): Dependency;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { normalize } from './annotation.js';
|
|
2
|
+
import { VARIABLE } from './const.js';
|
|
3
|
+
/**
|
|
4
|
+
* The map every process reads, both to dial a component and to know the port it listens on for
|
|
5
|
+
* the components it serves. It deploys nothing: a component answers on the `Service` rendered
|
|
6
|
+
* for it, which is where an unstated address resolves to.
|
|
7
|
+
*/
|
|
8
|
+
export function deployment(_, declaration) {
|
|
9
|
+
const annotation = declaration === undefined ? {} : normalize(declaration);
|
|
10
|
+
return { variables: { global: [{ name: VARIABLE, value: JSON.stringify(annotation) }] } };
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=deployment.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deployment.js","sourceRoot":"","sources":["../../source/bindings.http/deployment.ts"],"names":[],"mappings":"AACA,OAAO,EAAoB,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAC7D,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAErC;;;;GAIG;AACH,MAAM,UAAU,UAAU,CAAC,CAAU,EAAE,WAAyB;IAC9D,MAAM,UAAU,GAAG,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,WAAW,CAAC,CAAA;IAE1E,OAAO,EAAE,SAAS,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,EAAE,CAAC,EAAE,EAAE,CAAA;AAC3F,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { bindings } from '@toa.io/core/types';
|
|
2
|
+
export declare const properties: bindings.Properties;
|
|
3
|
+
export { deployment } from './deployment.ts';
|
|
4
|
+
export { PORT, VARIABLE, ID } from './const.ts';
|
|
5
|
+
export type { Annotation, Declaration } from './annotation.ts';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../source/bindings.http/index.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,UAAU,GAAwB,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,CAAA;AAE9E,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC5C,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,YAAY,CAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const properties = { async: false, local: true };
|
|
1
|
+
export const properties = { async: false, local: true, streams: true };
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../source/bindings.loop/index.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,UAAU,GAAwB,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../source/bindings.loop/index.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,UAAU,GAAwB,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAA"}
|
package/transpiled/definition.js
CHANGED
|
@@ -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;IAE5C,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC;QAAE,OAAO,SAAS,CAAA;IAE1C,KAAK,CAAC,MAAM,CAAC,KAAK,MAAM,kCAAC,KAAK,MAAM,WAAW,EAAC,CAAA;IAEhD,OAAO,KAAK,CAAC,MAAM,CAAC,CAAA;AACtB,CAAC;AAED,MAAM,KAAK,GAAoC,EAAE,CAAA;AAEjD,MAAM,KAAK,GAAG,UAAU,CAAA;AAExB,wFAAwF;AACxF,MAAM,CAAC,MAAM,OAAO,GAAwB,IAAI,GAAG,CAAC;IAClD,eAAe;IACf,eAAe;IACf,cAAc;IACd,cAAc;IACd,oBAAoB;IACpB,0BAA0B;IAC1B,wBAAwB;IACxB,uBAAuB;IACvB,kBAAkB;IAClB,0BAA0B;IAC1B,qBAAqB;IACrB,kBAAkB;IAClB,kBAAkB;IAClB,qBAAqB;IACrB,sBAAsB;IACtB,kBAAkB;CACnB,CAAC,CAAA"}
|
|
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;IAE5C,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC;QAAE,OAAO,SAAS,CAAA;IAE1C,KAAK,CAAC,MAAM,CAAC,KAAK,MAAM,kCAAC,KAAK,MAAM,WAAW,EAAC,CAAA;IAEhD,OAAO,KAAK,CAAC,MAAM,CAAC,CAAA;AACtB,CAAC;AAED,MAAM,KAAK,GAAoC,EAAE,CAAA;AAEjD,MAAM,KAAK,GAAG,UAAU,CAAA;AAExB,wFAAwF;AACxF,MAAM,CAAC,MAAM,OAAO,GAAwB,IAAI,GAAG,CAAC;IAClD,eAAe;IACf,eAAe;IACf,eAAe;IACf,cAAc;IACd,cAAc;IACd,oBAAoB;IACpB,0BAA0B;IAC1B,wBAAwB;IACxB,uBAAuB;IACvB,kBAAkB;IAClB,0BAA0B;IAC1B,qBAAqB;IACrB,kBAAkB;IAClB,kBAAkB;IAClB,qBAAqB;IACrB,sBAAsB;IACtB,kBAAkB;CACnB,CAAC,CAAA"}
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import type { Source } from '@toa.io/core/types';
|
|
2
2
|
/** Per-component variables: the local override and the secrets. */
|
|
3
3
|
export declare const PREFIX = "TOA_CONFIGURATION_";
|
|
4
|
+
/**
|
|
5
|
+
* Followed by a component's uppercase locator: the revision of the defaults it is deployed
|
|
6
|
+
* with. A name and a namespace are alphanumeric, so this is never a local override, which is
|
|
7
|
+
* two segments past `PREFIX` where this is three, nor a secret, which begins with `__`.
|
|
8
|
+
*/
|
|
9
|
+
export declare const REVISION: string;
|
|
4
10
|
/** The map of every configured component, on the values service. */
|
|
5
11
|
export declare const VALUES = "TOA_CONFIGURATION_VALUES";
|
|
6
12
|
export declare const SECRET_RX: RegExp;
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { environment } from '@toa.io/generic';
|
|
2
2
|
/** Per-component variables: the local override and the secrets. */
|
|
3
3
|
export const PREFIX = 'TOA_CONFIGURATION_';
|
|
4
|
+
/**
|
|
5
|
+
* Followed by a component's uppercase locator: the revision of the defaults it is deployed
|
|
6
|
+
* with. A name and a namespace are alphanumeric, so this is never a local override, which is
|
|
7
|
+
* two segments past `PREFIX` where this is three, nor a secret, which begins with `__`.
|
|
8
|
+
*/
|
|
9
|
+
export const REVISION = PREFIX + 'REVISION_';
|
|
4
10
|
/** The map of every configured component, on the values service. */
|
|
5
11
|
export const VALUES = 'TOA_CONFIGURATION_VALUES';
|
|
6
12
|
export const SECRET_RX = /^\$(?<variable>[A-Z0-9_]{1,32})$/;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"const.js","sourceRoot":"","sources":["../../source/extensions.configuration/const.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAG7C,mEAAmE;AACnE,MAAM,CAAC,MAAM,MAAM,GAAG,oBAAoB,CAAA;AAE1C,oEAAoE;AACpE,MAAM,CAAC,MAAM,MAAM,GAAG,0BAA0B,CAAA;AAEhD,MAAM,CAAC,MAAM,SAAS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CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;AACtD,CAAC;AAED,MAAM,CAAC,MAAM,KAAK,GAAG,8BAA8B,CAAA;AAEnD,MAAM,CAAC,MAAM,MAAM,GAAW,EAAE,OAAO,EAAE,eAAe,EAAE,CAAA"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { add } from '@toa.io/generic';
|
|
2
2
|
import { components } from './components.js';
|
|
3
3
|
import { version } from '../version.js';
|
|
4
|
-
import { EVENT, PREFIX, SECRET_RX, UI_PATH, UI_PORT, VALUES } from './const.js';
|
|
5
|
-
import { epoch } from './epoch.js';
|
|
4
|
+
import { EVENT, PREFIX, REVISION, SECRET_RX, UI_PATH, UI_PORT, VALUES } from './const.js';
|
|
5
|
+
import { epoch, revision } from './epoch.js';
|
|
6
6
|
import { assertSecrets } from './secrets.js';
|
|
7
7
|
import * as validators from './schemas.js';
|
|
8
8
|
/** Where Toa's release publishes this service's image. An application takes it
|
|
@@ -17,14 +17,19 @@ export const image = 'ghcr.io/toa-io/extension-configuration-values';
|
|
|
17
17
|
export function deployment(managed, annotation = {}, instances = managed) {
|
|
18
18
|
const { resources, values } = split(annotation);
|
|
19
19
|
annotation = prepare(values, instances);
|
|
20
|
+
const described = describe(instances, annotation);
|
|
20
21
|
const variables = {};
|
|
21
22
|
for (const instance of managed) {
|
|
22
23
|
const values = annotation[instance.locator.id];
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
const secrets = values === undefined ? [] : createSecrets(values);
|
|
25
|
+
// a variable of the component's own, so a change of its defaults replaces its processes
|
|
26
|
+
variables[instance.locator.label] = [
|
|
27
|
+
...secrets,
|
|
28
|
+
{
|
|
29
|
+
name: REVISION + instance.locator.uppercase,
|
|
30
|
+
value: revision(described[instance.locator.id].defaults)
|
|
31
|
+
}
|
|
32
|
+
];
|
|
28
33
|
}
|
|
29
34
|
const service = {
|
|
30
35
|
group: 'configuration',
|
|
@@ -39,7 +44,7 @@ export function deployment(managed, annotation = {}, instances = managed) {
|
|
|
39
44
|
variables: [
|
|
40
45
|
{
|
|
41
46
|
name: VALUES,
|
|
42
|
-
value: JSON.stringify(
|
|
47
|
+
value: JSON.stringify(described)
|
|
43
48
|
}
|
|
44
49
|
]
|
|
45
50
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deployment.js","sourceRoot":"","sources":["../../source/extensions.configuration/deployment.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAA;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AACvC,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"deployment.js","sourceRoot":"","sources":["../../source/extensions.configuration/deployment.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAA;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AACvC,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AACzF,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAC5C,OAAO,KAAK,UAAU,MAAM,cAAc,CAAA;AAI1C;oFACoF;AACpF,MAAM,CAAC,MAAM,KAAK,GAAG,+CAA+C,CAAA;AAEpE;;;;;GAKG;AACH,MAAM,UAAU,UAAU,CACxB,OAAmB,EACnB,UAAU,GA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AC,QAAQ,CAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;QAE/C,UAAU,CAAC,EAAE,CAAC,GAAG,MAAM,CAAA;IACzB,CAAC;IAED,OAAO,UAAU,CAAA;AACnB,CAAC"}
|
|
@@ -1,2 +1,7 @@
|
|
|
1
1
|
/** The same for the same schema, whatever the key order it was written in. */
|
|
2
2
|
export declare function epoch(schema: object): string;
|
|
3
|
+
/**
|
|
4
|
+
* The same for the same deployed defaults. None hash as `{}`, which is what the values
|
|
5
|
+
* service serves for them, so the component and the service compute one value.
|
|
6
|
+
*/
|
|
7
|
+
export declare function revision(defaults: object | undefined): string;
|
|
@@ -1,7 +1,17 @@
|
|
|
1
1
|
import { createHash } from 'node:crypto';
|
|
2
2
|
/** The same for the same schema, whatever the key order it was written in. */
|
|
3
3
|
export function epoch(schema) {
|
|
4
|
-
return
|
|
4
|
+
return hash(schema);
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* The same for the same deployed defaults. None hash as `{}`, which is what the values
|
|
8
|
+
* service serves for them, so the component and the service compute one value.
|
|
9
|
+
*/
|
|
10
|
+
export function revision(defaults) {
|
|
11
|
+
return hash(defaults ?? {});
|
|
12
|
+
}
|
|
13
|
+
function hash(value) {
|
|
14
|
+
return createHash('sha256').update(canonical(value)).digest('hex');
|
|
5
15
|
}
|
|
6
16
|
function canonical(value) {
|
|
7
17
|
if (Array.isArray(value))
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"epoch.js","sourceRoot":"","sources":["../../source/extensions.configuration/epoch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAExC,8EAA8E;AAC9E,MAAM,UAAU,KAAK,CAAC,MAAc;IAClC,OAAO,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,
|
|
1
|
+
{"version":3,"file":"epoch.js","sourceRoot":"","sources":["../../source/extensions.configuration/epoch.ts"],"names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,KAAK,CAAC,IAAI,MAAM,CAAA;AACxC,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { manifest } from './manifest.ts';
|
|
2
2
|
export { components } from './components.ts';
|
|
3
3
|
export { deployment, describe, image } from './deployment.ts';
|
|
4
|
-
export { epoch } from './epoch.ts';
|
|
4
|
+
export { epoch, revision } from './epoch.ts';
|
|
5
5
|
export { context } from './context.ts';
|
|
6
6
|
export { assertSecrets } from './secrets.ts';
|
|
7
7
|
export * from './const.ts';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { manifest } from './manifest.js';
|
|
2
2
|
export { components } from './components.js';
|
|
3
3
|
export { deployment, describe, image } from './deployment.js';
|
|
4
|
-
export { epoch } from './epoch.js';
|
|
4
|
+
export { epoch, revision } from './epoch.js';
|
|
5
5
|
export { context } from './context.js';
|
|
6
6
|
export { assertSecrets } from './secrets.js';
|
|
7
7
|
export * from './const.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../source/extensions.configuration/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC5C,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AAC7D,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../source/extensions.configuration/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC5C,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AAC7D,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACtC,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAC5C,cAAc,YAAY,CAAA;AAC1B,OAAO,KAAK,OAAO,MAAM,cAAc,CAAA"}
|
|
@@ -35,9 +35,25 @@ function specifyMethod(method, manifest) {
|
|
|
35
35
|
// takes no `omit` and no `limit`, and refuses a request that carries them
|
|
36
36
|
method.mapping.paged = operation.type === 'observation' && operation.scope === 'objects';
|
|
37
37
|
projects(method, operation.type);
|
|
38
|
+
streams(method, operation);
|
|
38
39
|
method.mapping.namespace = manifest.namespace;
|
|
39
40
|
method.mapping.component = manifest.name;
|
|
40
41
|
}
|
|
42
|
+
/**
|
|
43
|
+
* A method that maps a stream maps it onto an operation that takes one, and takes the request
|
|
44
|
+
* once: `map:buffer` reads the same body this hands over.
|
|
45
|
+
*/
|
|
46
|
+
function streams(method, operation) {
|
|
47
|
+
const mapped = method.directives.find((directive) => directive.family === 'map' && directive.name === 'stream');
|
|
48
|
+
if (mapped === undefined)
|
|
49
|
+
return;
|
|
50
|
+
const endpoint = method.mapping?.endpoint;
|
|
51
|
+
if (operation.stream === undefined)
|
|
52
|
+
throw new Error(`Method of '${endpoint}' maps a stream, which the operation does not take`);
|
|
53
|
+
const buffered = method.directives.some((directive) => directive.family === 'map' && directive.name === 'buffer');
|
|
54
|
+
if (buffered)
|
|
55
|
+
throw new Error(`Method of '${endpoint}' maps both a stream and a buffer, and each takes the request`);
|
|
56
|
+
}
|
|
41
57
|
/**
|
|
42
58
|
* What a route projects is what its operation's storage reads, and a read that is written back
|
|
43
59
|
* reads the whole record.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest.js","sourceRoot":"","sources":["../../source/extensions.exposition/manifest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAsC,MAAM,mBAAmB,CAAA;AAC7E,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC1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