@toa.io/definitions 1.0.0-alpha.297 → 1.0.0-alpha.299
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.cadence.json +1 -1
- package/digest/extensions.configuration.json +1 -1
- package/digest/extensions.exposition.json +1 -1
- package/digest/extensions.introspection.json +1 -1
- package/digest/extensions.realtime.json +1 -1
- package/package.json +15 -7
- package/readme.md +4 -0
- package/schemas/extensions.cadence/annotation.cos.yaml +12 -0
- package/transpiled/bridges.node/exports.d.ts +0 -5
- package/transpiled/bridges.node/exports.js +25 -7
- package/transpiled/bridges.node/exports.js.map +1 -1
- package/transpiled/definition.js +1 -0
- package/transpiled/definition.js.map +1 -1
- package/transpiled/extensions.cadence/const.d.ts +14 -0
- package/transpiled/extensions.cadence/const.js +20 -0
- package/transpiled/extensions.cadence/const.js.map +1 -1
- package/transpiled/extensions.cadence/deployment.js +5 -1
- package/transpiled/extensions.cadence/deployment.js.map +1 -1
- package/transpiled/extensions.cadence/types.d.ts +13 -0
- package/transpiled/extensions.configuration/deployment.js +5 -3
- package/transpiled/extensions.configuration/deployment.js.map +1 -1
- package/transpiled/extensions.configuration/secrets.js +2 -2
- package/transpiled/extensions.configuration/secrets.js.map +1 -1
- package/transpiled/extensions.convergence/const.d.ts +10 -0
- package/transpiled/extensions.convergence/const.js +11 -0
- package/transpiled/extensions.convergence/const.js.map +1 -0
- package/transpiled/extensions.convergence/declaration.d.ts +20 -0
- package/transpiled/extensions.convergence/declaration.js +2 -0
- package/transpiled/extensions.convergence/declaration.js.map +1 -0
- package/transpiled/extensions.convergence/deployment.d.ts +10 -0
- package/transpiled/extensions.convergence/deployment.js +37 -0
- package/transpiled/extensions.convergence/deployment.js.map +1 -0
- package/transpiled/extensions.convergence/index.d.ts +5 -0
- package/transpiled/extensions.convergence/index.js +4 -0
- package/transpiled/extensions.convergence/index.js.map +1 -0
- package/transpiled/extensions.convergence/topology.d.ts +34 -0
- package/transpiled/extensions.convergence/topology.js +76 -0
- package/transpiled/extensions.convergence/topology.js.map +1 -0
- package/transpiled/extensions.exposition/deployment.js +2 -2
- package/transpiled/extensions.exposition/deployment.js.map +1 -1
- package/transpiled/extensions.exposition/manifest.js +4 -3
- package/transpiled/extensions.exposition/manifest.js.map +1 -1
- package/transpiled/extensions.storages/Annotation.js +7 -5
- package/transpiled/extensions.storages/Annotation.js.map +1 -1
- package/transpiled/extensions.storages/deployment.js +3 -3
- package/transpiled/extensions.storages/deployment.js.map +1 -1
- package/transpiled/extensions.telemetry/deployment.js +6 -4
- package/transpiled/extensions.telemetry/deployment.js.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"label":"introspection-edges","manifest":{"namespace":"introspection","name":"edges","entity":{"associated":true,"properties":{"src":{"description":"What caused the call — another operation, an event, or a service","type":"object","properties":{"namespace":{"type":"string"},"component":{"type":"string"},"operation":{"type":"string"},"event":{"type":"string"},"service":{"type":"string"}}},"dst":{"description":"What was called","type":"object","required":["namespace","component","operation"],"properties":{"namespace":{"type":"string"},"component":{"type":"string"},"operation":{"type":"string"}}},"sample":{"description":"The last call observed on this edge","type":"object","required":["at","outcome"],"properties":{"at":{"type":"integer"},"input":{},"outcome":{"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}},"required":["src","dst","id"],"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"}],"custom":false},"operations":{"merge":{"concurrency":"retry","input":{"type":"object","properties":{"edges":{"description":"What each replica observed since its last flush, by edge id","type":"object","additionalProperties":{"type":"object","properties":{"src":{"description":"What caused the call — another operation, an event, or a service","type":"object","properties":{"namespace":{"type":"string"},"component":{"type":"string"},"operation":{"type":"string"},"event":{"type":"string"},"service":{"type":"string"}}},"dst":{"description":"What was called","type":"object","required":["namespace","component","operation"],"properties":{"namespace":{"type":"string"},"component":{"type":"string"},"operation":{"type":"string"}}},"sample":{"description":"The last call observed on this edge","type":"object","required":["at","outcome"],"properties":{"at":{"type":"integer"},"input":{},"outcome":{"type":"string"}}}},"required":["src","dst"]}}},"required":["edges"]},"type":"transition","scope":"objects","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.introspection/components/introspection.edges","bindings":["@toa.io/bindings.amqp"],"bridge":"@toa.io/bridges.node","extensions":{"@toa.io/extensions.telemetry":null,"@toa.io/extensions.fetch":null,"@toa.io/extensions.introspection":false,"@toa.io/extensions.exposition":{"routes":[{"path":"/introspection/edges","node":{"routes":[{"path":"/","node":{"routes":[{"path":"/:id","node":{"routes":[],"methods":[{"verb":"GET","mapping":{"endpoint":"observe","query":{},"paged":false,"namespace":"introspection","component":"edges"},"directives":[]}],"directives":[]}}],"methods":[{"verb":"GET","mapping":{"endpoint":"enumerate","query":{"limit":{"value":10000,"range":[1,10000]}},"paged":true,"namespace":"introspection","component":"edges"},"directives":[]}],"directives":[{"family":"auth","name":"role","value":"system:introspection"},{"family":"io","name":"output","value":true},{"family":"cache","name":"control","value":"max-age=60, public"}]}}],"methods":[],"directives":[],"isolated":true}}],"methods":[],"directives":[]}},"version":"dd4f7aaa","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"}}}},{"label":"introspection-nodes","manifest":{"namespace":"introspection","name":"nodes","entity":{"associated":true,"properties":{"version":{"type":"string"},"entity":{},"operations":{},"events":{},"receivers":{},"extensions":{},"namespace":{"type":"string"},"component":{"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}},"required":["namespace","component","id"],"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"}],"custom":false},"operations":{"merge":{"concurrency":"retry","input":{"type":"object","properties":{"nodes":{"description":"What each announced component describes of itself, by its id","type":"object","additionalProperties":{"type":"object","properties":{"version":{"type":"string"},"entity":{},"operations":{},"events":{},"receivers":{},"extensions":{},"namespace":{"type":"string"},"component":{"type":"string"}},"required":["namespace","component"]}}},"required":["nodes"]},"type":"transition","scope":"objects","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.introspection/components/introspection.nodes","bindings":["@toa.io/bindings.amqp"],"bridge":"@toa.io/bridges.node","extensions":{"@toa.io/extensions.telemetry":null,"@toa.io/extensions.fetch":null,"@toa.io/extensions.introspection":false,"@toa.io/extensions.exposition":{"routes":[{"path":"/introspection/nodes","node":{"routes":[{"path":"/","node":{"routes":[{"path":"/:id","node":{"routes":[],"methods":[{"verb":"GET","mapping":{"endpoint":"observe","query":{},"paged":false,"namespace":"introspection","component":"nodes"},"directives":[]}],"directives":[]}}],"methods":[{"verb":"GET","mapping":{"endpoint":"enumerate","query":{"limit":{"value":1000,"range":[1,1000]}},"paged":true,"namespace":"introspection","component":"nodes"},"directives":[]}],"directives":[{"family":"auth","name":"role","value":"system:introspection"},{"family":"io","name":"output","value":true},{"family":"cache","name":"control","value":"max-age=60, public"}]}}],"methods":[],"directives":[],"isolated":true}}],"methods":[],"directives":[]}},"version":"c1b78a37","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"}}}}]
|
|
1
|
+
[{"label":"introspection-edges","manifest":{"namespace":"introspection","name":"edges","entity":{"associated":true,"properties":{"src":{"description":"What caused the call — another operation, an event, or a service","type":"object","properties":{"namespace":{"type":"string"},"component":{"type":"string"},"operation":{"type":"string"},"event":{"type":"string"},"service":{"type":"string"}}},"dst":{"description":"What was called","type":"object","required":["namespace","component","operation"],"properties":{"namespace":{"type":"string"},"component":{"type":"string"},"operation":{"type":"string"}}},"sample":{"description":"The last call observed on this edge","type":"object","required":["at","outcome"],"properties":{"at":{"type":"integer"},"input":{},"outcome":{"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":["src","dst","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"}],"custom":false},"operations":{"merge":{"concurrency":"retry","input":{"type":"object","properties":{"edges":{"description":"What each replica observed since its last flush, by edge id","type":"object","additionalProperties":{"type":"object","properties":{"src":{"description":"What caused the call — another operation, an event, or a service","type":"object","properties":{"namespace":{"type":"string"},"component":{"type":"string"},"operation":{"type":"string"},"event":{"type":"string"},"service":{"type":"string"}}},"dst":{"description":"What was called","type":"object","required":["namespace","component","operation"],"properties":{"namespace":{"type":"string"},"component":{"type":"string"},"operation":{"type":"string"}}},"sample":{"description":"The last call observed on this edge","type":"object","required":["at","outcome"],"properties":{"at":{"type":"integer"},"input":{},"outcome":{"type":"string"}}}},"required":["src","dst"]}}},"required":["edges"]},"type":"transition","scope":"objects","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.introspection/components/introspection.edges","bindings":["@toa.io/bindings.amqp"],"bridge":"@toa.io/bridges.node","extensions":{"@toa.io/extensions.telemetry":null,"@toa.io/extensions.fetch":null,"@toa.io/extensions.introspection":false,"@toa.io/extensions.exposition":{"routes":[{"path":"/introspection/edges","node":{"routes":[{"path":"/","node":{"routes":[{"path":"/:id","node":{"routes":[],"methods":[{"verb":"GET","mapping":{"endpoint":"observe","query":{},"paged":false,"namespace":"introspection","component":"edges"},"directives":[]}],"directives":[]}}],"methods":[{"verb":"GET","mapping":{"endpoint":"enumerate","query":{"limit":{"value":10000,"range":[1,10000]}},"paged":true,"namespace":"introspection","component":"edges"},"directives":[]}],"directives":[{"family":"auth","name":"role","value":"system:introspection"},{"family":"io","name":"output","value":true},{"family":"cache","name":"control","value":"max-age=60, public"}]}}],"methods":[],"directives":[],"isolated":true}}],"methods":[],"directives":[]}},"version":"f24c5283","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"}}}},{"label":"introspection-nodes","manifest":{"namespace":"introspection","name":"nodes","entity":{"associated":true,"properties":{"version":{"type":"string"},"entity":{},"operations":{},"events":{},"receivers":{},"extensions":{},"namespace":{"type":"string"},"component":{"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":["namespace","component","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"}],"custom":false},"operations":{"merge":{"concurrency":"retry","input":{"type":"object","properties":{"nodes":{"description":"What each announced component describes of itself, by its id","type":"object","additionalProperties":{"type":"object","properties":{"version":{"type":"string"},"entity":{},"operations":{},"events":{},"receivers":{},"extensions":{},"namespace":{"type":"string"},"component":{"type":"string"}},"required":["namespace","component"]}}},"required":["nodes"]},"type":"transition","scope":"objects","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.introspection/components/introspection.nodes","bindings":["@toa.io/bindings.amqp"],"bridge":"@toa.io/bridges.node","extensions":{"@toa.io/extensions.telemetry":null,"@toa.io/extensions.fetch":null,"@toa.io/extensions.introspection":false,"@toa.io/extensions.exposition":{"routes":[{"path":"/introspection/nodes","node":{"routes":[{"path":"/","node":{"routes":[{"path":"/:id","node":{"routes":[],"methods":[{"verb":"GET","mapping":{"endpoint":"observe","query":{},"paged":false,"namespace":"introspection","component":"nodes"},"directives":[]}],"directives":[]}}],"methods":[{"verb":"GET","mapping":{"endpoint":"enumerate","query":{"limit":{"value":1000,"range":[1,1000]}},"paged":true,"namespace":"introspection","component":"nodes"},"directives":[]}],"directives":[{"family":"auth","name":"role","value":"system:introspection"},{"family":"io","name":"output","value":true},{"family":"cache","name":"control","value":"max-age=60, public"}]}}],"methods":[],"directives":[],"isolated":true}}],"methods":[],"directives":[]}},"version":"a291bd12","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"}}}}]
|
|
@@ -1 +1 @@
|
|
|
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":null,"@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":[]}],"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":"
|
|
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":null,"@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":[]}],"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":"0aa50dc4"}}]
|
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.299",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "What Toa packages declare, read without running them",
|
|
6
6
|
"author": "temich <tema.gurtovoy@gmail.com>",
|
|
@@ -31,9 +31,8 @@
|
|
|
31
31
|
],
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@toa.io/generic": "1.0.0-alpha.292",
|
|
34
|
-
"@toa.io/pointer": "1.0.0-alpha.
|
|
35
|
-
"@toa.io/schemas": "1.0.0-alpha.
|
|
36
|
-
"oxc-parser": "0.149.0"
|
|
34
|
+
"@toa.io/pointer": "1.0.0-alpha.299",
|
|
35
|
+
"@toa.io/schemas": "1.0.0-alpha.299"
|
|
37
36
|
},
|
|
38
37
|
"scripts": {
|
|
39
38
|
"transpile": "tsc",
|
|
@@ -45,8 +44,17 @@
|
|
|
45
44
|
"./*": "./transpiled/*/index.js"
|
|
46
45
|
},
|
|
47
46
|
"devDependencies": {
|
|
48
|
-
"@toa.io/core": "1.0.0-alpha.
|
|
49
|
-
"openspan": "1.0.0-alpha.293"
|
|
47
|
+
"@toa.io/core": "1.0.0-alpha.299",
|
|
48
|
+
"openspan": "1.0.0-alpha.293",
|
|
49
|
+
"oxc-parser": "0.149.0"
|
|
50
|
+
},
|
|
51
|
+
"peerDependencies": {
|
|
52
|
+
"oxc-parser": "0.149.0"
|
|
53
|
+
},
|
|
54
|
+
"peerDependenciesMeta": {
|
|
55
|
+
"oxc-parser": {
|
|
56
|
+
"optional": true
|
|
57
|
+
}
|
|
50
58
|
},
|
|
51
|
-
"gitHead": "
|
|
59
|
+
"gitHead": "2ba95b16f2cf06f82d6ff8d436761e843e5e4b43"
|
|
52
60
|
}
|
package/readme.md
CHANGED
|
@@ -59,6 +59,10 @@ workspace transpiles and written to `digest/`, which ships and is not committed.
|
|
|
59
59
|
components from the digest; the process that runs them reads them from the extension, where their
|
|
60
60
|
code is.
|
|
61
61
|
|
|
62
|
+
A running service reads it too. Its components are in the extension's package, published long
|
|
63
|
+
before any image was built, so nothing baked their manifests into one — the digest is what a
|
|
64
|
+
service and a composition that hosts one read instead of normalising them again at start.
|
|
65
|
+
|
|
62
66
|
The digest is generated from the workspace, after every extension it covers has transpiled, so a
|
|
63
67
|
change to a shipped component is in the next `npm run transpile`; a release packs it afresh. The
|
|
64
68
|
generator reaches the extensions and norm through the workspace, and does not declare them: each
|
|
@@ -6,4 +6,16 @@ properties:
|
|
|
6
6
|
description: Seconds between passes over the calls waiting to be made
|
|
7
7
|
type: integer
|
|
8
8
|
minimum: 1
|
|
9
|
+
regions:
|
|
10
|
+
description: >
|
|
11
|
+
The regions whose delayed calls this deployment makes, as their ranks. It makes its own
|
|
12
|
+
by default, so a call is made by the region that asked for it and by no other; naming
|
|
13
|
+
another region's rank is how a surviving region takes over the calls of one that is
|
|
14
|
+
gone. Two regions naming one rank make every call of it twice, and nothing can see that.
|
|
15
|
+
type: array
|
|
16
|
+
minItems: 1
|
|
17
|
+
uniqueItems: true
|
|
18
|
+
items:
|
|
19
|
+
type: integer
|
|
20
|
+
minimum: 0
|
|
9
21
|
additionalProperties: false
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* What a module exports, read from its source: the name, and what the value is declared as.
|
|
3
3
|
* Nothing is imported, so what a module depends on need not be installed to read it.
|
|
4
|
-
*
|
|
5
|
-
* The parser is a dependency and not an optional peer, though a composition carries the
|
|
6
|
-
* manifest its build normalised and reads no source: what an extension ships is normalised
|
|
7
|
-
* where it runs — in a service's own image, and in a composition that hosts one — and nothing
|
|
8
|
-
* bakes those. Make it optional again only once they read the digest instead.
|
|
9
4
|
*/
|
|
10
5
|
export declare function exports(path: string, text: string): Exports;
|
|
11
6
|
export type Exports = Map<string, Binding>;
|
|
@@ -1,15 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createRequire } from 'node:module';
|
|
2
2
|
/**
|
|
3
3
|
* What a module exports, read from its source: the name, and what the value is declared as.
|
|
4
4
|
* Nothing is imported, so what a module depends on need not be installed to read it.
|
|
5
|
-
*
|
|
6
|
-
* The parser is a dependency and not an optional peer, though a composition carries the
|
|
7
|
-
* manifest its build normalised and reads no source: what an extension ships is normalised
|
|
8
|
-
* where it runs — in a service's own image, and in a composition that hosts one — and nothing
|
|
9
|
-
* bakes those. Make it optional again only once they read the digest instead.
|
|
10
5
|
*/
|
|
11
6
|
export function exports(path, text) {
|
|
12
|
-
const { program, errors } =
|
|
7
|
+
const { program, errors } = parser()(path, text);
|
|
13
8
|
if (errors.length > 0)
|
|
14
9
|
throw new Error(`${path}: ${errors[0].message}`);
|
|
15
10
|
const locals = declarations(program.body);
|
|
@@ -37,6 +32,29 @@ function named(node, locals, exported) {
|
|
|
37
32
|
exported.set(name(specifier.exported), binding(specifier.local, locals));
|
|
38
33
|
}
|
|
39
34
|
}
|
|
35
|
+
/**
|
|
36
|
+
* The parser, loaded when a module is read and not before.
|
|
37
|
+
*
|
|
38
|
+
* It is an optional peer of this package rather than a dependency, because nothing that runs
|
|
39
|
+
* reads a source: a composition carries the manifest its build normalised, and a component an
|
|
40
|
+
* extension ships is read from the digest. What normalises is a workspace and a deploy, and
|
|
41
|
+
* both have it through `@toa.io/operations`.
|
|
42
|
+
*/
|
|
43
|
+
function parser() {
|
|
44
|
+
if (parse !== undefined)
|
|
45
|
+
return parse;
|
|
46
|
+
try {
|
|
47
|
+
parse = require('oxc-parser').parseSync;
|
|
48
|
+
}
|
|
49
|
+
catch (error) {
|
|
50
|
+
throw new Error('Reading what a module declares needs `oxc-parser`, which is not installed: it comes ' +
|
|
51
|
+
'with `@toa.io/operations`, which a workspace that composes or deploys has.', { cause: error });
|
|
52
|
+
}
|
|
53
|
+
return parse;
|
|
54
|
+
}
|
|
55
|
+
// what the parser is loaded by, which is a module of this machine and not of what it reads
|
|
56
|
+
const require = createRequire(import.meta.url);
|
|
57
|
+
let parse;
|
|
40
58
|
/** `module.exports = { … }`, `module.exports.x = …` and `exports.x = …` */
|
|
41
59
|
function assigned(expression, locals, exported) {
|
|
42
60
|
if (expression.type !== 'AssignmentExpression' || expression.operator !== '=')
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exports.js","sourceRoot":"","sources":["../../source/bridges.node/exports.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"exports.js","sourceRoot":"","sources":["../../source/bridges.node/exports.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAK3C;;;GAGG;AACH,MAAM,UAAU,OAAO,CAAC,IAAY,EAAE,IAAY;IAChD,MAAM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,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAA;QAEvE,OAAO,OAAO,CAAC,IAAI,KAAK,YAAY,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAA;IACjE,CAAC,CAAC,CAAA;AACJ,CAAC;AAED,SAAS,IAAI,CAAC,GAAQ;IACpB,OAAO,GAAG,CAAC,IAAI,KAAK,YAAY,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAA;AACjE,CAAC;AAID,MAAM,KAAK,GAAY,EAAE,IAAI,EAAE,OAAO,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,CAAC,KAAK,MAAM,WAAW,CAAC,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,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,CAAC,KAAK,MAAM,WAAW,CAAC,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"}
|
|
@@ -19,3 +19,17 @@ export declare const DISCRETENESS = 60;
|
|
|
19
19
|
export declare const BATCH = 200;
|
|
20
20
|
/** A number from the environment, where a deployment or a test suite states one. */
|
|
21
21
|
export declare function number(variable: string, fallback: number): number;
|
|
22
|
+
/** What a deployment is given of the regions whose calls it makes. */
|
|
23
|
+
export declare const REGIONS = "TOA_CADENCE_REGIONS";
|
|
24
|
+
/**
|
|
25
|
+
* The ranks whose delayed calls this deployment makes.
|
|
26
|
+
*
|
|
27
|
+
* Its own by default — a row carries the region that wrote it, so a call is made by the region
|
|
28
|
+
* that asked for it and by no other, however many hold the row. Naming another region's rank
|
|
29
|
+
* is how a surviving region takes over the calls of one that is gone; two deployments naming
|
|
30
|
+
* one rank make every call of it twice, and nothing detects that.
|
|
31
|
+
*
|
|
32
|
+
* A deployment that is no region at all reads the same as region zero, which is what its rows
|
|
33
|
+
* carry.
|
|
34
|
+
*/
|
|
35
|
+
export declare function regions(): number[];
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { environment } from '@toa.io/generic';
|
|
2
|
+
import { REGION } from '../extensions.convergence/const.js';
|
|
2
3
|
/** The component the extension ships to hold delayed calls. */
|
|
3
4
|
export const NAMESPACE = 'cadence';
|
|
4
5
|
export const COMPONENT = 'metronome';
|
|
@@ -23,4 +24,23 @@ export function number(variable, fallback) {
|
|
|
23
24
|
const value = Number(environment.get(variable));
|
|
24
25
|
return Number.isNaN(value) || value <= 0 ? fallback : value;
|
|
25
26
|
}
|
|
27
|
+
/** What a deployment is given of the regions whose calls it makes. */
|
|
28
|
+
export const REGIONS = 'TOA_CADENCE_REGIONS';
|
|
29
|
+
/**
|
|
30
|
+
* The ranks whose delayed calls this deployment makes.
|
|
31
|
+
*
|
|
32
|
+
* Its own by default — a row carries the region that wrote it, so a call is made by the region
|
|
33
|
+
* that asked for it and by no other, however many hold the row. Naming another region's rank
|
|
34
|
+
* is how a surviving region takes over the calls of one that is gone; two deployments naming
|
|
35
|
+
* one rank make every call of it twice, and nothing detects that.
|
|
36
|
+
*
|
|
37
|
+
* A deployment that is no region at all reads the same as region zero, which is what its rows
|
|
38
|
+
* carry.
|
|
39
|
+
*/
|
|
40
|
+
export function regions() {
|
|
41
|
+
const declared = environment.get(REGIONS);
|
|
42
|
+
if (declared === undefined)
|
|
43
|
+
return [Number(environment.get(REGION) ?? 0)];
|
|
44
|
+
return declared.split(' ').map(Number);
|
|
45
|
+
}
|
|
26
46
|
//# sourceMappingURL=const.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"const.js","sourceRoot":"","sources":["../../source/extensions.cadence/const.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;
|
|
1
|
+
{"version":3,"file":"const.js","sourceRoot":"","sources":["../../source/extensions.cadence/const.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,oCAAoC,CAAA;AAE3D,+DAA+D;AAC/D,MAAM,CAAC,MAAM,SAAS,GAAG,SAAS,CAAA;AAClC,MAAM,CAAC,MAAM,SAAS,GAAG,WAAW,CAAA;AAEpC;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,GAAG,CAAA;AAExB,+FAA+F;AAC/F,MAAM,CAAC,MAAM,YAAY,GAAG,EAAE,CAAA;AAE9B,gCAAgC;AAChC,MAAM,CAAC,MAAM,KAAK,GAAG,GAAG,CAAA;AAExB,oFAAoF;AACpF,MAAM,UAAU,MAAM,CAAC,QAAgB,EAAE,QAAgB;IACvD,MAAM,KAAK,GAAG,MAAM,CAAC,WAAW,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAA;IAE/C,OAAO,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAA;AAC7D,CAAC;AAED,sEAAsE;AACtE,MAAM,CAAC,MAAM,OAAO,GAAG,qBAAqB,CAAA;AAE5C;;;;;;;;;;GAUG;AACH,MAAM,UAAU,OAAO;IACrB,MAAM,QAAQ,GAAG,WAAW,CAAC,GAAG,CAAC,OAAO,CAAC,CAAA;IAEzC,IAAI,QAAQ,KAAK,SAAS;QAAE,OAAO,CAAC,MAAM,CAAC,WAAW,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IAEzE,OAAO,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;AACxC,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { components } from './components.js';
|
|
2
2
|
import { version } from '../version.js';
|
|
3
|
-
import { DISCRETENESS, NAMESPACE } from './const.js';
|
|
3
|
+
import { DISCRETENESS, NAMESPACE, REGIONS } from './const.js';
|
|
4
4
|
import * as schemas from './schemas.js';
|
|
5
5
|
/**
|
|
6
6
|
* The component that keeps delayed calls runs in a service of its own, the way the identity
|
|
@@ -14,6 +14,10 @@ export function deployment(_, annotation) {
|
|
|
14
14
|
const variables = [
|
|
15
15
|
{ name: 'TOA_CADENCE_DISCRETENESS', value: String(discreteness) }
|
|
16
16
|
];
|
|
17
|
+
// absent, the metronome makes the calls of the region it is deployed as, which is what a
|
|
18
|
+
// deployment that has never heard of regions does anyway
|
|
19
|
+
if (annotation?.regions !== undefined)
|
|
20
|
+
variables.push({ name: REGIONS, value: annotation.regions.join(' ') });
|
|
17
21
|
const service = {
|
|
18
22
|
group: NAMESPACE,
|
|
19
23
|
name: 'metronome',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deployment.js","sourceRoot":"","sources":["../../source/extensions.cadence/deployment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AACvC,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"deployment.js","sourceRoot":"","sources":["../../source/extensions.cadence/deployment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AACvC,OAAO,EAAE,YAAY,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AAC7D,OAAO,KAAK,OAAO,MAAM,cAAc,CAAA;AAIvC;;;GAGG;AACH,MAAM,UAAU,UAAU,CAAC,CAAU,EAAE,UAA8B;IACnE,OAAO,CAAC,UAAU,CAAC,QAAQ,CACzB,UAAU,IAAI,IAAI,EAClB,4BAA4B,CAC7B,CAAA;IAED,4FAA4F;IAC5F,uCAAuC;IACvC,MAAM,YAAY,GAAG,CAAC,UAAU,EAAE,YAAY,IAAI,YAAY,CAAC,GAAG,IAAI,CAAA;IACtE,MAAM,SAAS,GAAe;QAC5B,EAAE,IAAI,EAAE,0BAA0B,EAAE,KAAK,EAAE,MAAM,CAAC,YAAY,CAAC,EAAE;KAClE,CAAA;IAED,yFAAyF;IACzF,yDAAyD;IACzD,IAAI,UAAU,EAAE,OAAO,KAAK,SAAS;QACnC,SAAS,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,UAAU,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAA;IAExE,MAAM,OAAO,GAAY;QACvB,KAAK,EAAE,SAAS;QAChB,IAAI,EAAE,WAAW;QACjB,OAAO;QACP,UAAU,EAAE,UAAU,EAAE,CAAC,MAAM;QAC/B,SAAS;KACV,CAAA;IAED,OAAO,EAAE,QAAQ,EAAE,CAAC,OAAO,CAAC,EAAE,CAAA;AAChC,CAAC;AAED,8FAA8F;AAC9F,MAAM,CAAC,MAAM,UAAU,GAAG,IAAI,CAAA"}
|
|
@@ -26,9 +26,22 @@ export interface Options {
|
|
|
26
26
|
* a dispatcher scans, so a bound shorter than that is one nothing can honour.
|
|
27
27
|
*/
|
|
28
28
|
overdue: number | null;
|
|
29
|
+
/**
|
|
30
|
+
* Whether this call begins a chain of its own rather than continuing the one arming it.
|
|
31
|
+
*
|
|
32
|
+
* A delay is a hop like any other, so an operation that arms a call to its own endpoint is
|
|
33
|
+
* going round in a circle and is refused on the third round. That is right where it has gone
|
|
34
|
+
* round by mistake and wrong where the recurrence is meant, which only the caller knows.
|
|
35
|
+
*
|
|
36
|
+
* It does not make the call repeat: a delayed call is made once either way. What repeats is
|
|
37
|
+
* the operation arming the next one as it runs, and this is what keeps that from counting.
|
|
38
|
+
*/
|
|
39
|
+
detached?: boolean;
|
|
29
40
|
}
|
|
30
41
|
/** What an application states under `cadence:` in its context. */
|
|
31
42
|
export interface Annotation {
|
|
32
43
|
/** seconds between passes over the calls waiting to be made */
|
|
33
44
|
discreteness?: number;
|
|
45
|
+
/** the ranks of the regions whose delayed calls this deployment makes; its own by default */
|
|
46
|
+
regions?: number[];
|
|
34
47
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import assert from 'node:assert';
|
|
2
1
|
import { add } from '@toa.io/generic';
|
|
3
2
|
import { components } from './components.js';
|
|
4
3
|
import { version } from '../version.js';
|
|
@@ -69,7 +68,9 @@ function createSecrets(values) {
|
|
|
69
68
|
if (match === null)
|
|
70
69
|
continue;
|
|
71
70
|
const name = match.groups?.variable;
|
|
72
|
-
|
|
71
|
+
// the pattern that matched has the group, so this is a change to one of the two
|
|
72
|
+
if (name === undefined)
|
|
73
|
+
throw new Error(`Secret reference '${value}' names no variable`);
|
|
73
74
|
secrets.push({
|
|
74
75
|
name: PREFIX + '_' + name,
|
|
75
76
|
secret: {
|
|
@@ -99,7 +100,8 @@ function prepare(annotation, instances) {
|
|
|
99
100
|
for (const [key, values] of Object.entries(annotation)) {
|
|
100
101
|
const id = key.includes('.') ? key : 'default.' + key;
|
|
101
102
|
const instance = instances.find((instance) => instance.locator.id === id);
|
|
102
|
-
|
|
103
|
+
if (instance === undefined)
|
|
104
|
+
throw new Error(`Component '${id}' does not request configuration or does not exist.`);
|
|
103
105
|
assertSecrets(instance.manifest.schema, values);
|
|
104
106
|
normalized[id] = values;
|
|
105
107
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deployment.js","sourceRoot":"","sources":["../../source/extensions.configuration/deployment.ts"],"names":[],"mappings":"
|
|
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;AAC/E,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAClC,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,MAAM,UAAU,UAAU,CACxB,SAAqB,EACrB,UAAU,GAAe,EAAE;IAE3B,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC,UAAU,CAAC,CAAA;IAE/C,UAAU,GAAG,OAAO,CAAC,MAAM,EAAE,SAAS,CAAC,CAAA;IAEvC,MAAM,SAAS,GAAc,EAAE,CAAA;IAE/B,KAAK,MAAM,QAAQ,IAAI,SAAS,EAAE,CAAC;QACjC,MAAM,MAAM,GAAG,UAAU,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC,CAAA;QAE9C,IAAI,MAAM,KAAK,SAAS;YAAE,SAAQ;QAElC,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,CAAA;QAErC,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC;YAAE,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,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AEjC,KAAK,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC;QACvD,MAAM,EAAE,GAAG,GAAG,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,UAAU,GAAG,GAAG,CAAA;QACrD,MAAM,QAAQ,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,CAAC,CAAA;QAEzE,IAAI,QAAQ,KAAK,SAAS;YACxB,MAAM,IAAI,KAAK,CACb,cAAc,EAAE,qDAAqD,CACtE,CAAA;QAEH,aAAa,CAAC,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,4 +1,3 @@
|
|
|
1
|
-
import assert from 'node:assert';
|
|
2
1
|
import { SECRET_RX } from './const.js';
|
|
3
2
|
/**
|
|
4
3
|
* A property declared `format: secret` is a `$NAME` reference, not a string.
|
|
@@ -7,7 +6,8 @@ export function assertSecrets(schema, value, path = '') {
|
|
|
7
6
|
if (format(schema) === 'secret') {
|
|
8
7
|
if (value === undefined)
|
|
9
8
|
return;
|
|
10
|
-
|
|
9
|
+
if (!(typeof value === 'string' && SECRET_RX.test(value)))
|
|
10
|
+
throw new Error(`'${path || '.'}' is a secret and must be given as a $NAME reference.`);
|
|
11
11
|
return;
|
|
12
12
|
}
|
|
13
13
|
if (typeof value !== 'object' || value === null)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"secrets.js","sourceRoot":"","sources":["../../source/extensions.configuration/secrets.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"secrets.js","sourceRoot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AAgC,CAAC,EAAE,CAAC;QAC5E,MAAM,IAAI,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAA;QAC9B,MAAM,MAAM,GACV,UAAU,EAAE,CAAC,IAAI,CAAC;YAClB,CAAC,OAAO,UAAU,KAAK,QAAQ,IAAI,UAAU,KAAK,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC,CAAA;QAElF,IAAI,MAAM,KAAK,SAAS;YAAE,SAAQ;QAElC,aAAa,CAAC,MAAM,EAAE,KAAK,EAAE,IAAI,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,CAAA;IAC/C,CAAC;AACH,CAAC;AAED,SAAS,MAAM,CAAC,MAAc;IAC5B,OAAQ,MAA8B,CAAC,MAAM,CAAA;AAC/C,CAAC;AAED,SAAS,IAAI,CAAC,IAAY,EAAE,GAAW;IACrC,OAAO,IAAI,KAAK,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,GAAG,GAAG,GAAG,GAAG,CAAA;AAC7C,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** What the pointer to this region's brokers is deployed and resolved under. */
|
|
2
|
+
export declare const ID = "convergence";
|
|
3
|
+
/** The one selector of that pointer: a region has one set of brokers. */
|
|
4
|
+
export declare const BROKERS = "brokers";
|
|
5
|
+
/** The rank of this region, which is what the runtime stamps on a record it writes. */
|
|
6
|
+
export declare const REGION = "TOA_REGION";
|
|
7
|
+
/** The binding that carries the channel. */
|
|
8
|
+
export declare const BINDING = "TOA_CONVERGENCE_BINDING";
|
|
9
|
+
/** What the channel is called, and so what its exchanges and queues are named after. */
|
|
10
|
+
export declare const CHANNEL = "convergence";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** What the pointer to this region's brokers is deployed and resolved under. */
|
|
2
|
+
export const ID = 'convergence';
|
|
3
|
+
/** The one selector of that pointer: a region has one set of brokers. */
|
|
4
|
+
export const BROKERS = 'brokers';
|
|
5
|
+
/** The rank of this region, which is what the runtime stamps on a record it writes. */
|
|
6
|
+
export const REGION = 'TOA_REGION';
|
|
7
|
+
/** The binding that carries the channel. */
|
|
8
|
+
export const BINDING = 'TOA_CONVERGENCE_BINDING';
|
|
9
|
+
/** What the channel is called, and so what its exchanges and queues are named after. */
|
|
10
|
+
export const CHANNEL = 'convergence';
|
|
11
|
+
//# sourceMappingURL=const.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"const.js","sourceRoot":"","sources":["../../source/extensions.convergence/const.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,MAAM,CAAC,MAAM,EAAE,GAAG,aAAa,CAAA;AAE/B,yEAAyE;AACzE,MAAM,CAAC,MAAM,OAAO,GAAG,SAAS,CAAA;AAEhC,uFAAuF;AACvF,MAAM,CAAC,MAAM,MAAM,GAAG,YAAY,CAAA;AAElC,4CAA4C;AAC5C,MAAM,CAAC,MAAM,OAAO,GAAG,yBAAyB,CAAA;AAEhD,wFAAwF;AACxF,MAAM,CAAC,MAAM,OAAO,GAAG,aAAa,CAAA"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What a context declares of the region it is deployed as. The environment names the region,
|
|
3
|
+
* so a context declares one of these per region and shares nothing between them:
|
|
4
|
+
*
|
|
5
|
+
* ```yaml
|
|
6
|
+
* convergence@eu:
|
|
7
|
+
* priority: 0
|
|
8
|
+
* binding: { provider: amqp, pointer: amqp://cnv-eu.example.com }
|
|
9
|
+
* ```
|
|
10
|
+
*/
|
|
11
|
+
export interface Declaration {
|
|
12
|
+
/** a rank: zero outranks one, and it is read only where two regions wrote one version */
|
|
13
|
+
priority: number;
|
|
14
|
+
binding: {
|
|
15
|
+
/** the binding that carries the channel; `amqp`, which is the only one */
|
|
16
|
+
provider?: string;
|
|
17
|
+
/** the brokers of this region, as a URL or a list of them */
|
|
18
|
+
pointer: string | string[];
|
|
19
|
+
};
|
|
20
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"declaration.js","sourceRoot":"","sources":["../../source/extensions.convergence/declaration.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Declaration } from './declaration.js';
|
|
2
|
+
import type { context } from '@toa.io/norm';
|
|
3
|
+
import type { Dependency } from '@toa.io/operations';
|
|
4
|
+
/**
|
|
5
|
+
* A deployment is one region, and the environment is which one: what a context declares under
|
|
6
|
+
* `convergence@eu` is what deploying `eu` reads, and the regions share nothing. So there is
|
|
7
|
+
* no table here and none reaches the runtime — the rank to stamp, the binding, and this
|
|
8
|
+
* region's brokers do, and a record says for itself which region wrote it.
|
|
9
|
+
*/
|
|
10
|
+
export declare function deployment(_: context.Dependency[], annotation: Declaration): Dependency;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { createVariables, normalize } from '@toa.io/pointer';
|
|
2
|
+
import { BINDING, BROKERS, ID, REGION } from './const.js';
|
|
3
|
+
/**
|
|
4
|
+
* A deployment is one region, and the environment is which one: what a context declares under
|
|
5
|
+
* `convergence@eu` is what deploying `eu` reads, and the regions share nothing. So there is
|
|
6
|
+
* no table here and none reaches the runtime — the rank to stamp, the binding, and this
|
|
7
|
+
* region's brokers do, and a record says for itself which region wrote it.
|
|
8
|
+
*/
|
|
9
|
+
export function deployment(_, annotation) {
|
|
10
|
+
const region = read(annotation);
|
|
11
|
+
const global = [
|
|
12
|
+
{ name: REGION, value: String(region.priority) },
|
|
13
|
+
{ name: BINDING, value: provider(region) }
|
|
14
|
+
];
|
|
15
|
+
const variables = createVariables(ID, normalize({ [BROKERS]: region.binding.pointer }), [
|
|
16
|
+
{ group: GLOBAL, selectors: [BROKERS] }
|
|
17
|
+
]);
|
|
18
|
+
variables[GLOBAL] = (variables[GLOBAL] ?? []).concat(global);
|
|
19
|
+
return { variables };
|
|
20
|
+
}
|
|
21
|
+
function read(annotation) {
|
|
22
|
+
if (!Number.isInteger(annotation?.priority) || annotation.priority < 0)
|
|
23
|
+
throw new Error('Convergence declares a priority, which is this region\'s rank: a whole number where ' +
|
|
24
|
+
'zero outranks one, and the same in every region.');
|
|
25
|
+
if (annotation.binding?.pointer === undefined)
|
|
26
|
+
throw new Error('Convergence declares the brokers this region converges over.');
|
|
27
|
+
return annotation;
|
|
28
|
+
}
|
|
29
|
+
function provider(region) {
|
|
30
|
+
const declared = region.binding.provider ?? AMQP;
|
|
31
|
+
return PROVIDERS[declared] ?? declared;
|
|
32
|
+
}
|
|
33
|
+
const GLOBAL = 'global';
|
|
34
|
+
const AMQP = 'amqp';
|
|
35
|
+
/** RabbitMQ is the only binding that carries a channel. */
|
|
36
|
+
const PROVIDERS = { [AMQP]: '@toa.io/bindings.amqp' };
|
|
37
|
+
//# sourceMappingURL=deployment.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deployment.js","sourceRoot":"","sources":["../../source/extensions.convergence/deployment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAC5D,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AAKzD;;;;;GAKG;AACH,MAAM,UAAU,UAAU,CAAC,CAAuB,EAAE,UAAuB;IACzE,MAAM,MAAM,GAAG,IAAI,CAAC,UAAU,CAAC,CAAA;IAE/B,MAAM,MAAM,GAAe;QACzB,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,EAAE;QAChD,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,EAAE;KAC3C,CAAA;IAED,MAAM,SAAS,GAAG,eAAe,CAAC,EAAE,EAAE,SAAS,CAAC,EAAE,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,EAAE;QACtF,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,OAAO,CAAC,EAAE;KACxC,CAAC,CAAA;IAEF,SAAS,CAAC,MAAM,CAAC,GAAG,CAAC,SAAS,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;IAE5D,OAAO,EAAE,SAAS,EAAE,CAAA;AACtB,CAAC;AAED,SAAS,IAAI,CAAC,UAAuB;IACnC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,UAAU,EAAE,QAAQ,CAAC,IAAI,UAAU,CAAC,QAAQ,GAAG,CAAC;QACpE,MAAM,IAAI,KAAK,CACb,sFAAsF;YACpF,kDAAkD,CACrD,CAAA;IAEH,IAAI,UAAU,CAAC,OAAO,EAAE,OAAO,KAAK,SAAS;QAC3C,MAAM,IAAI,KAAK,CAAC,8DAA8D,CAAC,CAAA;IAEjF,OAAO,UAAU,CAAA;AACnB,CAAC;AAED,SAAS,QAAQ,CAAC,MAAmB;IACnC,MAAM,QAAQ,GAAG,MAAM,CAAC,OAAO,CAAC,QAAQ,IAAI,IAAI,CAAA;IAEhD,OAAO,SAAS,CAAC,QAAQ,CAAC,IAAI,QAAQ,CAAA;AACxC,CAAC;AAED,MAAM,MAAM,GAAG,QAAQ,CAAA;AACvB,MAAM,IAAI,GAAG,MAAM,CAAA;AAEnB,2DAA2D;AAC3D,MAAM,SAAS,GAA2B,EAAE,CAAC,IAAI,CAAC,EAAE,uBAAuB,EAAE,CAAA"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { deployment } from './deployment.js';
|
|
2
|
+
export { BINDING, BROKERS, CHANNEL, ID, REGION } from './const.js';
|
|
3
|
+
export { commands, queue, topology, vhost, INBOUND, OUTBOUND } from './topology.js';
|
|
4
|
+
export type { Declaration } from './declaration.js';
|
|
5
|
+
export type { Topology } from './topology.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../source/extensions.convergence/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC5C,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AAClE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA"}
|