@toa.io/extensions.exposition 0.24.0-alpha.9 → 1.0.0-alpha.10
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/components/context.toa.yaml +12 -0
- package/components/identity.bans/manifest.toa.yaml +2 -1
- package/components/identity.basic/manifest.toa.yaml +5 -1
- package/components/identity.basic/operations/authenticate.js +1 -2
- package/components/identity.basic/operations/authenticate.js.map +1 -1
- package/components/identity.basic/operations/transit.js.map +1 -1
- package/components/identity.basic/operations/tsconfig.tsbuildinfo +1 -1
- package/components/identity.basic/source/authenticate.ts +0 -1
- package/components/identity.federation/events/principal.js +22 -0
- package/components/identity.federation/manifest.toa.yaml +94 -0
- package/components/identity.federation/operations/authenticate.d.ts +3 -0
- package/components/identity.federation/operations/authenticate.js +20 -0
- package/components/identity.federation/operations/authenticate.js.map +1 -0
- package/components/identity.federation/operations/create.d.ts +10 -0
- package/components/identity.federation/operations/create.js +15 -0
- package/components/identity.federation/operations/create.js.map +1 -0
- package/components/identity.federation/operations/lib/assertions-as-values.d.ts +4 -0
- package/components/identity.federation/operations/lib/assertions-as-values.js +45 -0
- package/components/identity.federation/operations/lib/assertions-as-values.js.map +1 -0
- package/components/identity.federation/operations/lib/jwt.d.ts +20 -0
- package/components/identity.federation/operations/lib/jwt.js +136 -0
- package/components/identity.federation/operations/lib/jwt.js.map +1 -0
- package/components/identity.federation/operations/schemas.d.ts +59 -0
- package/components/identity.federation/operations/schemas.js +9 -0
- package/components/identity.federation/operations/schemas.js.map +1 -0
- package/components/identity.federation/operations/tsconfig.tsbuildinfo +1 -0
- package/components/identity.federation/operations/types.d.ts +51 -0
- package/components/identity.federation/operations/types.js +3 -0
- package/components/identity.federation/operations/types.js.map +1 -0
- package/components/identity.federation/source/authenticate.ts +28 -0
- package/components/identity.federation/source/create.ts +26 -0
- package/components/identity.federation/source/lib/assertions-as-values.ts +19 -0
- package/components/identity.federation/source/lib/jwt.test.ts +56 -0
- package/components/identity.federation/source/lib/jwt.ts +171 -0
- package/components/identity.federation/source/schemas.ts +61 -0
- package/components/identity.federation/source/types.ts +56 -0
- package/components/identity.federation/tsconfig.json +9 -0
- package/components/identity.roles/manifest.toa.yaml +17 -5
- package/components/identity.roles/operations/grant.d.ts +10 -0
- package/components/identity.roles/operations/grant.js +20 -0
- package/components/identity.roles/operations/grant.js.map +1 -0
- package/components/identity.roles/operations/lib/Entity.d.ts +5 -0
- package/components/identity.roles/operations/lib/Entity.js +3 -0
- package/components/identity.roles/operations/lib/Entity.js.map +1 -0
- package/components/identity.roles/operations/list.d.ts +1 -4
- package/components/identity.roles/operations/list.js.map +1 -1
- package/components/identity.roles/operations/principal.d.ts +4 -6
- package/components/identity.roles/operations/principal.js +6 -1
- package/components/identity.roles/operations/principal.js.map +1 -1
- package/components/identity.roles/operations/tsconfig.tsbuildinfo +1 -1
- package/components/identity.roles/source/grant.ts +31 -0
- package/components/identity.roles/source/lib/Entity.ts +5 -0
- package/components/identity.roles/source/list.ts +2 -4
- package/components/identity.roles/source/principal.ts +10 -8
- package/components/identity.tokens/manifest.toa.yaml +1 -1
- package/components/identity.tokens/operations/authenticate.js.map +1 -1
- package/components/identity.tokens/operations/decrypt.js.map +1 -1
- package/components/identity.tokens/operations/tsconfig.tsbuildinfo +1 -1
- package/components/octets.storage/manifest.toa.yaml +1 -0
- package/components/octets.storage/operations/store.js +3 -3
- package/cucumber.js +0 -1
- package/documentation/access.md +11 -11
- package/documentation/components.md +48 -12
- package/documentation/identity.md +14 -7
- package/documentation/io.md +56 -0
- package/documentation/octets.md +102 -37
- package/documentation/protocol.md +21 -1
- package/documentation/query.md +51 -6
- package/documentation/tree.md +22 -4
- package/documentation/vary.md +69 -0
- package/features/access.feature +13 -2
- package/features/annotation.feature +1 -0
- package/features/body.feature +3 -1
- package/features/cache.feature +3 -0
- package/features/cors.feature +72 -0
- package/features/directives.feature +2 -0
- package/features/dynamic.feature +14 -7
- package/features/errors.feature +4 -3
- package/features/etag.feature +97 -0
- package/features/identity.basic.feature +68 -0
- package/features/identity.feature +19 -3
- package/features/identity.federation.feature +153 -0
- package/features/identity.roles.feature +151 -0
- package/features/identity.tokens.feature +3 -0
- package/features/io.feature +167 -0
- package/features/octets.entries.feature +123 -0
- package/features/octets.feature +4 -28
- package/features/octets.meta.feature +66 -0
- package/features/octets.workflows.feature +177 -4
- package/features/queries.feature +9 -1
- package/features/response.feature +68 -0
- package/features/routes.feature +54 -10
- package/features/steps/Captures.ts +6 -0
- package/features/steps/Components.ts +18 -6
- package/features/steps/Database.ts +1 -1
- package/features/steps/Gateway.ts +4 -2
- package/features/steps/HTTP.ts +34 -6
- package/features/steps/IdP.ts +149 -0
- package/features/steps/Parameters.ts +8 -2
- package/features/steps/Workspace.ts +5 -7
- package/features/steps/components/echo/manifest.toa.yaml +1 -0
- package/features/steps/components/echo/operations/error.js +11 -0
- package/features/steps/components/greeter/manifest.toa.yaml +1 -0
- package/features/steps/components/octets.tester/manifest.toa.yaml +4 -0
- package/features/steps/components/octets.tester/operations/concat.js +7 -0
- package/features/steps/components/octets.tester/operations/echo.js +7 -0
- package/features/steps/components/pots/manifest.toa.yaml +12 -3
- package/features/steps/components/sequences/manifest.toa.yaml +1 -0
- package/features/steps/components/users/manifest.toa.yaml +4 -0
- package/features/steps/components/users.properties/manifest.toa.yaml +14 -0
- package/features/steps/tsconfig.json +1 -1
- package/features/timing.feature +66 -0
- package/features/vary.feature +180 -0
- package/package.json +16 -20
- package/readme.md +7 -6
- package/schemas/annotation.cos.yaml +1 -0
- package/schemas/io/input.cos.yaml +3 -0
- package/schemas/io/message.cos.yaml +5 -0
- package/schemas/io/output.cos.yaml +5 -0
- package/schemas/octets/delete.cos.yaml +2 -1
- package/schemas/octets/list.cos.yaml +2 -1
- package/schemas/octets/workflow.cos.yaml +12 -0
- package/schemas/querystring.cos.yaml +1 -0
- package/source/Annotation.ts +1 -0
- package/source/Context.ts +6 -4
- package/source/Directive.test.ts +14 -8
- package/source/Directive.ts +26 -49
- package/source/Endpoint.ts +53 -6
- package/source/Factory.ts +23 -12
- package/source/Gateway.ts +45 -42
- package/source/HTTP/Context.ts +67 -0
- package/source/HTTP/Server.test.ts +61 -134
- package/source/HTTP/Server.ts +83 -87
- package/source/HTTP/Timing.ts +40 -0
- package/source/HTTP/formats/msgpack.ts +9 -6
- package/source/HTTP/formats/text.ts +1 -1
- package/source/HTTP/formats/yaml.ts +1 -1
- package/source/HTTP/index.ts +1 -0
- package/source/HTTP/messages.test.ts +27 -8
- package/source/HTTP/messages.ts +38 -42
- package/source/Interception.ts +24 -0
- package/source/Mapping.ts +7 -8
- package/source/RTD/Context.ts +7 -10
- package/source/RTD/Directives.ts +28 -4
- package/source/RTD/Endpoint.ts +6 -4
- package/source/RTD/Match.ts +2 -7
- package/source/RTD/Method.ts +7 -13
- package/source/RTD/Node.ts +13 -14
- package/source/RTD/Tree.ts +19 -15
- package/source/RTD/factory.ts +2 -5
- package/source/RTD/syntax/parse.ts +6 -6
- package/source/RTD/syntax/types.ts +1 -1
- package/source/deployment.ts +7 -2
- package/source/directives/auth/Anonymous.ts +3 -2
- package/source/directives/auth/{Family.ts → Authorization.ts} +39 -40
- package/source/directives/auth/Delegate.ts +32 -0
- package/source/directives/auth/Incept.ts +11 -6
- package/source/directives/auth/Role.ts +5 -3
- package/source/directives/auth/Rule.ts +2 -2
- package/source/directives/auth/Scheme.ts +2 -2
- package/source/directives/auth/index.ts +2 -2
- package/source/directives/auth/schemes.ts +2 -1
- package/source/directives/auth/types.ts +9 -6
- package/source/directives/cache/{Family.ts → Cache.ts} +6 -7
- package/source/directives/cache/Control.ts +5 -5
- package/source/directives/cache/index.ts +2 -2
- package/source/directives/cache/types.ts +2 -2
- package/source/directives/cors/CORS.ts +62 -0
- package/source/directives/cors/index.ts +3 -0
- package/source/directives/dev/{Family.ts → Development.ts} +4 -5
- package/source/directives/dev/Stub.ts +4 -4
- package/source/directives/dev/Throw.ts +4 -4
- package/source/directives/dev/index.ts +2 -2
- package/source/directives/dev/types.ts +1 -1
- package/source/directives/index.ts +11 -6
- package/source/directives/io/Directive.ts +11 -0
- package/source/directives/io/IO.ts +43 -0
- package/source/directives/io/Input.ts +50 -0
- package/source/directives/io/Message.ts +1 -0
- package/source/directives/io/Output.ts +69 -0
- package/source/directives/io/index.ts +3 -0
- package/source/directives/io/schemas.ts +12 -0
- package/source/directives/octets/Context.ts +6 -5
- package/source/directives/octets/Delete.ts +64 -11
- package/source/directives/octets/Directive.ts +10 -0
- package/source/directives/octets/Fetch.ts +44 -29
- package/source/directives/octets/List.ts +50 -10
- package/source/directives/octets/{Family.ts → Octets.ts} +14 -9
- package/source/directives/octets/Permute.ts +18 -11
- package/source/directives/octets/Store.ts +70 -102
- package/source/directives/octets/Workflow.ts +48 -0
- package/source/directives/octets/index.ts +2 -2
- package/source/directives/octets/schemas.test.ts +21 -0
- package/source/directives/octets/schemas.ts +13 -6
- package/source/directives/octets/types.ts +2 -8
- package/source/directives/octets/workflows/Execution.ts +76 -0
- package/source/directives/octets/workflows/Workflow.ts +37 -0
- package/source/directives/octets/workflows/index.ts +1 -0
- package/source/directives/vary/Directive.ts +6 -0
- package/source/directives/vary/Embed.ts +62 -0
- package/source/directives/vary/Properties.ts +17 -0
- package/source/directives/vary/Vary.ts +48 -0
- package/source/directives/vary/embeddings/Embedding.ts +6 -0
- package/source/directives/vary/embeddings/Header.ts +32 -0
- package/source/directives/vary/embeddings/Language.ts +31 -0
- package/source/directives/vary/embeddings/index.ts +11 -0
- package/source/directives/vary/index.ts +3 -0
- package/source/exceptions.ts +13 -9
- package/source/io.ts +4 -0
- package/source/manifest.test.ts +6 -14
- package/source/manifest.ts +9 -6
- package/source/root.ts +5 -0
- package/source/schemas.ts +7 -3
- package/transpiled/Annotation.d.ts +1 -0
- package/transpiled/Composition.js.map +1 -1
- package/transpiled/Context.d.ts +6 -4
- package/transpiled/Directive.d.ts +11 -25
- package/transpiled/Directive.js +17 -18
- package/transpiled/Directive.js.map +1 -1
- package/transpiled/Endpoint.d.ts +7 -5
- package/transpiled/Endpoint.js +58 -2
- package/transpiled/Endpoint.js.map +1 -1
- package/transpiled/Factory.d.ts +0 -1
- package/transpiled/Factory.js +14 -7
- package/transpiled/Factory.js.map +1 -1
- package/transpiled/Gateway.d.ts +7 -8
- package/transpiled/Gateway.js +25 -25
- package/transpiled/Gateway.js.map +1 -1
- package/transpiled/HTTP/Context.d.ts +24 -0
- package/transpiled/HTTP/Context.js +47 -0
- package/transpiled/HTTP/Context.js.map +1 -0
- package/transpiled/HTTP/Server.d.ts +10 -7
- package/transpiled/HTTP/Server.js +80 -70
- package/transpiled/HTTP/Server.js.map +1 -1
- package/transpiled/HTTP/Timing.d.ts +10 -0
- package/transpiled/HTTP/Timing.js +29 -0
- package/transpiled/HTTP/Timing.js.map +1 -0
- package/transpiled/HTTP/formats/msgpack.d.ts +2 -2
- package/transpiled/HTTP/formats/msgpack.js +8 -29
- package/transpiled/HTTP/formats/msgpack.js.map +1 -1
- package/transpiled/HTTP/formats/text.d.ts +3 -1
- package/transpiled/HTTP/formats/text.js.map +1 -1
- package/transpiled/HTTP/formats/yaml.js +1 -1
- package/transpiled/HTTP/formats/yaml.js.map +1 -1
- package/transpiled/HTTP/index.d.ts +1 -0
- package/transpiled/HTTP/index.js +1 -0
- package/transpiled/HTTP/index.js.map +1 -1
- package/transpiled/HTTP/messages.d.ts +7 -16
- package/transpiled/HTTP/messages.js +28 -25
- package/transpiled/HTTP/messages.js.map +1 -1
- package/transpiled/Interception.d.ts +9 -0
- package/transpiled/Interception.js +19 -0
- package/transpiled/Interception.js.map +1 -0
- package/transpiled/Mapping.js +7 -7
- package/transpiled/Mapping.js.map +1 -1
- package/transpiled/Query.js.map +1 -1
- package/transpiled/RTD/Context.d.ts +7 -6
- package/transpiled/RTD/Directives.d.ts +19 -4
- package/transpiled/RTD/Endpoint.d.ts +6 -4
- package/transpiled/RTD/Match.d.ts +2 -4
- package/transpiled/RTD/Method.d.ts +7 -7
- package/transpiled/RTD/Method.js.map +1 -1
- package/transpiled/RTD/Node.d.ts +4 -6
- package/transpiled/RTD/Node.js +2 -1
- package/transpiled/RTD/Node.js.map +1 -1
- package/transpiled/RTD/Route.js.map +1 -1
- package/transpiled/RTD/Tree.d.ts +6 -6
- package/transpiled/RTD/Tree.js +5 -0
- package/transpiled/RTD/Tree.js.map +1 -1
- package/transpiled/RTD/factory.d.ts +2 -4
- package/transpiled/RTD/factory.js.map +1 -1
- package/transpiled/RTD/syntax/parse.js +1 -1
- package/transpiled/RTD/syntax/parse.js.map +1 -1
- package/transpiled/RTD/syntax/types.js +1 -1
- package/transpiled/RTD/syntax/types.js.map +1 -1
- package/transpiled/deployment.js +6 -2
- package/transpiled/deployment.js.map +1 -1
- package/transpiled/directives/auth/Anonymous.js +3 -4
- package/transpiled/directives/auth/Anonymous.js.map +1 -1
- package/transpiled/directives/auth/{Family.d.ts → Authorization.d.ts} +4 -5
- package/transpiled/directives/auth/{Family.js → Authorization.js} +22 -13
- package/transpiled/directives/auth/Authorization.js.map +1 -0
- package/transpiled/directives/auth/Delegate.d.ts +8 -0
- package/transpiled/directives/auth/Delegate.js +27 -0
- package/transpiled/directives/auth/Delegate.js.map +1 -0
- package/transpiled/directives/auth/Incept.d.ts +1 -1
- package/transpiled/directives/auth/Incept.js +11 -6
- package/transpiled/directives/auth/Incept.js.map +1 -1
- package/transpiled/directives/auth/Role.js +5 -3
- package/transpiled/directives/auth/Role.js.map +1 -1
- package/transpiled/directives/auth/Rule.d.ts +2 -2
- package/transpiled/directives/auth/Rule.js.map +1 -1
- package/transpiled/directives/auth/Scheme.js +2 -2
- package/transpiled/directives/auth/Scheme.js.map +1 -1
- package/transpiled/directives/auth/index.d.ts +2 -2
- package/transpiled/directives/auth/index.js +4 -5
- package/transpiled/directives/auth/index.js.map +1 -1
- package/transpiled/directives/auth/schemes.js +2 -1
- package/transpiled/directives/auth/schemes.js.map +1 -1
- package/transpiled/directives/auth/types.d.ts +4 -4
- package/transpiled/directives/cache/Cache.d.ts +11 -0
- package/transpiled/directives/cache/{Family.js → Cache.js} +6 -4
- package/transpiled/directives/cache/Cache.js.map +1 -0
- package/transpiled/directives/cache/Control.d.ts +3 -3
- package/transpiled/directives/cache/Control.js +3 -3
- package/transpiled/directives/cache/Control.js.map +1 -1
- package/transpiled/directives/cache/index.d.ts +2 -2
- package/transpiled/directives/cache/index.js +4 -5
- package/transpiled/directives/cache/index.js.map +1 -1
- package/transpiled/directives/cache/types.d.ts +2 -2
- package/transpiled/directives/cors/CORS.d.ts +10 -0
- package/transpiled/directives/cors/CORS.js +51 -0
- package/transpiled/directives/cors/CORS.js.map +1 -0
- package/transpiled/directives/cors/index.d.ts +2 -0
- package/transpiled/directives/cors/index.js +6 -0
- package/transpiled/directives/cors/index.js.map +1 -0
- package/transpiled/directives/dev/Development.d.ts +9 -0
- package/transpiled/directives/dev/{Family.js → Development.js} +4 -2
- package/transpiled/directives/dev/Development.js.map +1 -0
- package/transpiled/directives/dev/Stub.d.ts +3 -3
- package/transpiled/directives/dev/Stub.js.map +1 -1
- package/transpiled/directives/dev/Throw.d.ts +3 -3
- package/transpiled/directives/dev/Throw.js.map +1 -1
- package/transpiled/directives/dev/index.d.ts +2 -2
- package/transpiled/directives/dev/index.js +4 -5
- package/transpiled/directives/dev/index.js.map +1 -1
- package/transpiled/directives/dev/types.d.ts +1 -1
- package/transpiled/directives/index.d.ts +4 -2
- package/transpiled/directives/index.js +10 -9
- package/transpiled/directives/index.js.map +1 -1
- package/transpiled/directives/io/Directive.d.ts +8 -0
- package/transpiled/directives/io/Directive.js +3 -0
- package/transpiled/directives/io/Directive.js.map +1 -0
- package/transpiled/directives/io/IO.d.ts +9 -0
- package/transpiled/directives/io/IO.js +33 -0
- package/transpiled/directives/io/IO.js.map +1 -0
- package/transpiled/directives/io/Input.d.ts +11 -0
- package/transpiled/directives/io/Input.js +63 -0
- package/transpiled/directives/io/Input.js.map +1 -0
- package/transpiled/directives/io/Message.d.ts +1 -0
- package/transpiled/directives/io/Message.js +3 -0
- package/transpiled/directives/io/Message.js.map +1 -0
- package/transpiled/directives/io/Output.d.ts +13 -0
- package/transpiled/directives/io/Output.js +76 -0
- package/transpiled/directives/io/Output.js.map +1 -0
- package/transpiled/directives/io/index.d.ts +2 -0
- package/transpiled/directives/io/index.js +6 -0
- package/transpiled/directives/io/index.js.map +1 -0
- package/transpiled/directives/io/schemas.d.ts +7 -0
- package/transpiled/directives/io/schemas.js +14 -0
- package/transpiled/directives/io/schemas.js.map +1 -0
- package/transpiled/directives/octets/Context.d.ts +5 -5
- package/transpiled/directives/octets/Context.js +4 -2
- package/transpiled/directives/octets/Context.js.map +1 -1
- package/transpiled/directives/octets/Delete.d.ts +15 -5
- package/transpiled/directives/octets/Delete.js +45 -8
- package/transpiled/directives/octets/Delete.js.map +1 -1
- package/transpiled/directives/octets/Directive.d.ts +8 -0
- package/transpiled/directives/octets/Directive.js +8 -0
- package/transpiled/directives/octets/Directive.js.map +1 -0
- package/transpiled/directives/octets/Fetch.d.ts +9 -9
- package/transpiled/directives/octets/Fetch.js +36 -21
- package/transpiled/directives/octets/Fetch.js.map +1 -1
- package/transpiled/directives/octets/List.d.ts +11 -5
- package/transpiled/directives/octets/List.js +34 -7
- package/transpiled/directives/octets/List.js.map +1 -1
- package/transpiled/directives/octets/Octets.d.ts +12 -0
- package/transpiled/directives/octets/{Family.js → Octets.js} +12 -6
- package/transpiled/directives/octets/Octets.js.map +1 -0
- package/transpiled/directives/octets/Permute.d.ts +5 -4
- package/transpiled/directives/octets/Permute.js +15 -8
- package/transpiled/directives/octets/Permute.js.map +1 -1
- package/transpiled/directives/octets/Store.d.ts +14 -23
- package/transpiled/directives/octets/Store.js +41 -70
- package/transpiled/directives/octets/Store.js.map +1 -1
- package/transpiled/directives/octets/Workflow.d.ts +15 -0
- package/transpiled/directives/octets/Workflow.js +59 -0
- package/transpiled/directives/octets/Workflow.js.map +1 -0
- package/transpiled/directives/octets/index.d.ts +2 -2
- package/transpiled/directives/octets/index.js +4 -5
- package/transpiled/directives/octets/index.js.map +1 -1
- package/transpiled/directives/octets/schemas.d.ts +13 -6
- package/transpiled/directives/octets/schemas.js +2 -1
- package/transpiled/directives/octets/schemas.js.map +1 -1
- package/transpiled/directives/octets/types.d.ts +2 -6
- package/transpiled/directives/octets/workflows/Execution.d.ts +25 -0
- package/transpiled/directives/octets/workflows/Execution.js +54 -0
- package/transpiled/directives/octets/workflows/Execution.js.map +1 -0
- package/transpiled/directives/octets/workflows/Workflow.d.ts +12 -0
- package/transpiled/directives/octets/workflows/Workflow.js +25 -0
- package/transpiled/directives/octets/workflows/Workflow.js.map +1 -0
- package/transpiled/directives/octets/workflows/index.d.ts +1 -0
- package/transpiled/directives/octets/workflows/index.js +6 -0
- package/transpiled/directives/octets/workflows/index.js.map +1 -0
- package/transpiled/directives/vary/Directive.d.ts +5 -0
- package/transpiled/directives/vary/Directive.js +3 -0
- package/transpiled/directives/vary/Directive.js.map +1 -0
- package/transpiled/directives/vary/Embed.d.ts +10 -0
- package/transpiled/directives/vary/Embed.js +49 -0
- package/transpiled/directives/vary/Embed.js.map +1 -0
- package/transpiled/directives/vary/Properties.d.ts +9 -0
- package/transpiled/directives/vary/Properties.js +16 -0
- package/transpiled/directives/vary/Properties.js.map +1 -0
- package/transpiled/directives/vary/Vary.d.ts +10 -0
- package/transpiled/directives/vary/Vary.js +36 -0
- package/transpiled/directives/vary/Vary.js.map +1 -0
- package/transpiled/directives/vary/embeddings/Embedding.d.ts +5 -0
- package/transpiled/directives/vary/embeddings/Embedding.js +3 -0
- package/transpiled/directives/vary/embeddings/Embedding.js.map +1 -0
- package/transpiled/directives/vary/embeddings/Header.d.ts +7 -0
- package/transpiled/directives/vary/embeddings/Header.js +28 -0
- package/transpiled/directives/vary/embeddings/Header.js.map +1 -0
- package/transpiled/directives/vary/embeddings/Language.d.ts +7 -0
- package/transpiled/directives/vary/embeddings/Language.js +28 -0
- package/transpiled/directives/vary/embeddings/Language.js.map +1 -0
- package/transpiled/directives/vary/embeddings/index.d.ts +5 -0
- package/transpiled/directives/vary/embeddings/index.js +10 -0
- package/transpiled/directives/vary/embeddings/index.js.map +1 -0
- package/transpiled/directives/vary/index.d.ts +2 -0
- package/transpiled/directives/vary/index.js +6 -0
- package/transpiled/directives/vary/index.js.map +1 -0
- package/transpiled/exceptions.js +7 -7
- package/transpiled/exceptions.js.map +1 -1
- package/transpiled/io.d.ts +3 -0
- package/transpiled/io.js +3 -0
- package/transpiled/io.js.map +1 -0
- package/transpiled/manifest.js +10 -5
- package/transpiled/manifest.js.map +1 -1
- package/transpiled/root.js +5 -0
- package/transpiled/root.js.map +1 -1
- package/transpiled/schemas.d.ts +7 -3
- package/transpiled/schemas.js.map +1 -1
- package/transpiled/tsconfig.tsbuildinfo +1 -1
- package/source/HTTP/Server.fixtures.ts +0 -41
- package/transpiled/HTTP/Server.fixtures.d.ts +0 -11
- package/transpiled/HTTP/Server.fixtures.js +0 -32
- package/transpiled/HTTP/Server.fixtures.js.map +0 -1
- package/transpiled/directives/auth/Family.js.map +0 -1
- package/transpiled/directives/cache/Family.d.ts +0 -12
- package/transpiled/directives/cache/Family.js.map +0 -1
- package/transpiled/directives/dev/Family.d.ts +0 -10
- package/transpiled/directives/dev/Family.js.map +0 -1
- package/transpiled/directives/octets/Family.d.ts +0 -12
- package/transpiled/directives/octets/Family.js.map +0 -1
|
@@ -25,99 +25,70 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
26
|
exports.Store = void 0;
|
|
27
27
|
const node_stream_1 = require("node:stream");
|
|
28
|
-
const node_path_1 = require("node:path");
|
|
29
28
|
const matchacho_1 = require("matchacho");
|
|
30
|
-
const generic_1 = require("@toa.io/generic");
|
|
31
29
|
const HTTP_1 = require("../../HTTP");
|
|
30
|
+
const cors_1 = require("../cors");
|
|
32
31
|
const schemas = __importStar(require("./schemas"));
|
|
33
|
-
|
|
32
|
+
const workflows_1 = require("./workflows");
|
|
33
|
+
const Directive_1 = require("./Directive");
|
|
34
|
+
class Store extends Directive_1.Directive {
|
|
34
35
|
targeted = false;
|
|
35
36
|
accept;
|
|
36
37
|
workflow;
|
|
37
38
|
discovery = {};
|
|
38
|
-
remotes;
|
|
39
|
-
components = {};
|
|
40
39
|
storage = null;
|
|
41
40
|
constructor(options, discovery, remotes) {
|
|
41
|
+
super();
|
|
42
42
|
schemas.store.validate(options);
|
|
43
43
|
this.accept = (0, matchacho_1.match)(options?.accept, String, (value) => value, Array, (types) => types.join(','), undefined);
|
|
44
|
-
|
|
44
|
+
if (options?.workflow !== undefined)
|
|
45
|
+
this.workflow = new workflows_1.Workflow(options.workflow, remotes);
|
|
45
46
|
this.discovery.storage = discovery;
|
|
46
|
-
|
|
47
|
+
cors_1.cors.allow('content-meta');
|
|
47
48
|
}
|
|
48
|
-
async apply(storage,
|
|
49
|
+
async apply(storage, input, parameters) {
|
|
49
50
|
this.storage ??= await this.discovery.storage;
|
|
50
|
-
const
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
const request = {
|
|
52
|
+
input: {
|
|
53
|
+
storage,
|
|
54
|
+
request: input.request
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
const meta = input.request.headers['content-meta'];
|
|
58
|
+
if (this.accept !== undefined)
|
|
59
|
+
request.input.accept = this.accept;
|
|
60
|
+
if (meta !== undefined)
|
|
61
|
+
request.input.meta = this.parseMeta(meta);
|
|
62
|
+
const entry = await this.storage.invoke('store', request);
|
|
63
|
+
return (0, matchacho_1.match)(entry, Error, (error) => this.throw(error), () => this.reply(input, storage, entry, parameters));
|
|
53
64
|
}
|
|
54
|
-
|
|
65
|
+
// eslint-disable-next-line max-params
|
|
66
|
+
reply(input, storage, entry, parameters) {
|
|
55
67
|
const body = this.workflow === undefined
|
|
56
68
|
? entry
|
|
57
|
-
:
|
|
69
|
+
: this.execute(input, storage, entry, parameters);
|
|
58
70
|
return { body };
|
|
59
71
|
}
|
|
72
|
+
// eslint-disable-next-line max-params
|
|
73
|
+
execute(input, storage, entry, parameters) {
|
|
74
|
+
const stream = new node_stream_1.PassThrough({ objectMode: true });
|
|
75
|
+
stream.push(entry);
|
|
76
|
+
this.workflow.execute(input, storage, entry, parameters).pipe(stream);
|
|
77
|
+
return stream;
|
|
78
|
+
}
|
|
60
79
|
throw(error) {
|
|
61
80
|
throw (0, matchacho_1.match)(error.code, 'NOT_ACCEPTABLE', () => new HTTP_1.UnsupportedMediaType(), 'TYPE_MISMATCH', () => new HTTP_1.BadRequest(), error);
|
|
62
81
|
}
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
yield entry;
|
|
72
|
-
const path = node_path_1.posix.join(request.path, entry.id);
|
|
73
|
-
let interrupted = false;
|
|
74
|
-
for (const unit of this.workflow) {
|
|
75
|
-
if (interrupted)
|
|
76
|
-
break;
|
|
77
|
-
const steps = Object.keys(unit);
|
|
78
|
-
// unit result promises queue
|
|
79
|
-
const results = Array.from(steps, (generic_1.promex));
|
|
80
|
-
let next = 0;
|
|
81
|
-
// execute steps in parallel
|
|
82
|
-
for (const step of steps)
|
|
83
|
-
// these promises are indirectly awaited in the yield loop
|
|
84
|
-
void (async () => {
|
|
85
|
-
const endpoint = unit[step];
|
|
86
|
-
const context = { storage, path, entry };
|
|
87
|
-
const result = await this.call(endpoint, context);
|
|
88
|
-
if (interrupted)
|
|
89
|
-
return;
|
|
90
|
-
// as a result is received, resolve the next promise from the queue
|
|
91
|
-
const promise = results[next++];
|
|
92
|
-
if (result instanceof Error) {
|
|
93
|
-
interrupted = true;
|
|
94
|
-
promise.resolve({ error: { step, ...result } });
|
|
95
|
-
// cancel pending promises
|
|
96
|
-
results[next].resolve(null);
|
|
97
|
-
}
|
|
98
|
-
else
|
|
99
|
-
promise.resolve({ [step]: result ?? null });
|
|
100
|
-
})().catch((e) => results[next].reject(e));
|
|
101
|
-
// yield results from the queue as they come
|
|
102
|
-
for (const promise of results) {
|
|
103
|
-
const result = await promise;
|
|
104
|
-
if (result === null) // canceled promise
|
|
105
|
-
break;
|
|
106
|
-
else
|
|
107
|
-
yield result;
|
|
108
|
-
}
|
|
82
|
+
parseMeta(value) {
|
|
83
|
+
if (Array.isArray(value))
|
|
84
|
+
value = value.join(',');
|
|
85
|
+
const meta = {};
|
|
86
|
+
for (const pair of value.split(',')) {
|
|
87
|
+
const eq = pair.indexOf('=');
|
|
88
|
+
const key = (eq === -1 ? pair : pair.slice(0, eq)).trim();
|
|
89
|
+
meta[key] = eq === -1 ? 'true' : pair.slice(eq + 1).trim();
|
|
109
90
|
}
|
|
110
|
-
|
|
111
|
-
async call(endpoint, context) {
|
|
112
|
-
const [operation, component, namespace = 'default'] = endpoint.split('.').reverse();
|
|
113
|
-
const key = `${namespace}.${component}`;
|
|
114
|
-
this.components[key] ??= await this.discover(key, namespace, component);
|
|
115
|
-
return await this.components[key].invoke(operation, { input: context });
|
|
116
|
-
}
|
|
117
|
-
async discover(key, namespace, component) {
|
|
118
|
-
if (this.discovery[key] === undefined)
|
|
119
|
-
this.discovery[key] = this.remotes.discover(namespace, component);
|
|
120
|
-
return await this.discovery[key];
|
|
91
|
+
return meta;
|
|
121
92
|
}
|
|
122
93
|
}
|
|
123
94
|
exports.Store = Store;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Store.js","sourceRoot":"","sources":["../../../source/directives/octets/Store.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"Store.js","sourceRoot":"","sources":["../../../source/directives/octets/Store.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAAyC;AACzC,yCAAiC;AACjC,qCAA6D;AAC7D,kCAA8B;AAC9B,mDAAoC;AACpC,2CAAsC;AACtC,2CAAuC;AAWvC,MAAa,KAAM,SAAQ,qBAAS;IAClB,QAAQ,GAAG,KAAK,CAAA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EAAE,EACvC,KAAK,CAAC,CAAA;IACV,CAAC;IAEO,SAAS,CAAE,KAAwB;QACzC,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;YACtB,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;QAEzB,MAAM,IAAI,GAA2B,EAAE,CAAA;QAEvC,KAAK,MAAM,IAAI,IAAI,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC;YACpC,MAAM,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;YAC5B,MAAM,GAAG,GAAG,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAA;YAEzD,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,CAAA;QAC5D,CAAC;QAED,OAAO,IAAI,CAAA;IACb,CAAC;CACF;AA9FD,sBA8FC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Directive } from './Directive';
|
|
2
|
+
import type { Unit } from './workflows';
|
|
3
|
+
import type { Input } from './types';
|
|
4
|
+
import type { Component } from '@toa.io/core';
|
|
5
|
+
import type { Output } from '../../io';
|
|
6
|
+
import type { Remotes } from '../../Remotes';
|
|
7
|
+
import type { Parameter } from '../../RTD';
|
|
8
|
+
export declare class WorkflowDirective extends Directive {
|
|
9
|
+
readonly targeted = true;
|
|
10
|
+
private readonly workflow;
|
|
11
|
+
private readonly discovery;
|
|
12
|
+
private storage;
|
|
13
|
+
constructor(units: Unit[] | Unit, discovery: Promise<Component>, remotes: Remotes);
|
|
14
|
+
apply(storage: string, input: Input, parameters: Parameter[]): Promise<Output>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.WorkflowDirective = void 0;
|
|
27
|
+
const HTTP_1 = require("../../HTTP");
|
|
28
|
+
const schemas = __importStar(require("./schemas"));
|
|
29
|
+
const workflows_1 = require("./workflows");
|
|
30
|
+
const Directive_1 = require("./Directive");
|
|
31
|
+
class WorkflowDirective extends Directive_1.Directive {
|
|
32
|
+
targeted = true;
|
|
33
|
+
workflow;
|
|
34
|
+
discovery;
|
|
35
|
+
storage = null;
|
|
36
|
+
constructor(units, discovery, remotes) {
|
|
37
|
+
super();
|
|
38
|
+
schemas.workflow.validate(units);
|
|
39
|
+
this.workflow = new workflows_1.Workflow(units, remotes);
|
|
40
|
+
this.discovery = discovery;
|
|
41
|
+
}
|
|
42
|
+
async apply(storage, input, parameters) {
|
|
43
|
+
this.storage ??= await this.discovery;
|
|
44
|
+
const entry = await this.storage.invoke('get', {
|
|
45
|
+
input: {
|
|
46
|
+
storage,
|
|
47
|
+
path: input.request.url
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
if (entry instanceof Error)
|
|
51
|
+
throw new HTTP_1.NotFound();
|
|
52
|
+
return {
|
|
53
|
+
status: 202,
|
|
54
|
+
body: this.workflow.execute(input, storage, entry, parameters)
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
exports.WorkflowDirective = WorkflowDirective;
|
|
59
|
+
//# sourceMappingURL=Workflow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Workflow.js","sourceRoot":"","sources":["../../../source/directives/octets/Workflow.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qCAAqC;AACrC,mDAAoC;AACpC,2CAAsC;AACtC,2CAAuC;AAUvC,MAAa,iBAAkB,SAAQ,qBAAS;IAC9B,QAAQ,GAAG,IAAI,CAAA;IAEd,QAAQ,CAAU;IAClB,SAAS,CAAoB;IACtC,OAAO,GAAqB,IAAI,CAAA;IAExC,YAAoB,KAAoB,EAAE,SAA6B,EAAE,OAAgB;QACvF,KAAK,EAAE,CAAA;QACP,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAA;QAEhC,IAAI,CAAC,QAAQ,GAAG,IAAI,oBAAQ,CAAC,KAAK,EAAE,OAAO,CAAC,CAAA;QAC5C,IAAI,CAAC,SAAS,GAAG,SAAS,CAAA;IAC5B,CAAC;IAEM,KAAK,CAAC,KAAK,CAAE,OAAe,EAAE,KAAY,EAAE,UAAuB;QACxE,IAAI,CAAC,OAAO,KAAK,MAAM,IAAI,CAAC,SAAS,CAAA;QAErC,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,MAAM,CAAe,KAAK,EACzD;YACE,KAAK,EAAE;gBACL,OAAO;gBACP,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,GAAG;aACxB;SACF,CAAC,CAAA;QAEJ,IAAI,KAAK,YAAY,KAAK;YACxB,MAAM,IAAI,eAAQ,EAAE,CAAA;QAEtB,OAAO;YACL,MAAM,EAAE,GAAG;YACX,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,UAAU,CAAC;SAC/D,CAAA;IACH,CAAC;CACF;AAlCD,8CAkCC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
export
|
|
1
|
+
import { Octets } from './Octets';
|
|
2
|
+
export declare const octets: Octets;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
module.exports = Family_1.default;
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.octets = void 0;
|
|
4
|
+
const Octets_1 = require("./Octets");
|
|
5
|
+
exports.octets = new Octets_1.Octets();
|
|
7
6
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../source/directives/octets/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../source/directives/octets/index.ts"],"names":[],"mappings":";;;AAAA,qCAAiC;AAEpB,QAAA,MAAM,GAAG,IAAI,eAAM,EAAE,CAAA"}
|
|
@@ -1,6 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import type { Permissions as FetchPermissions } from './Fetch';
|
|
2
|
+
import type { Permissions as ListPermissions } from './List';
|
|
3
|
+
import type { Options as StoreOptions } from './Store';
|
|
4
|
+
import type { Options as DeleteOptions } from './Delete';
|
|
5
|
+
import type { Schema } from '@toa.io/schemas';
|
|
6
|
+
import type { Unit } from './workflows';
|
|
7
|
+
export declare const context: Schema<string>;
|
|
8
|
+
export declare const store: Schema<StoreOptions | null>;
|
|
9
|
+
export declare const fetch: Schema<FetchPermissions | null>;
|
|
10
|
+
export declare const remove: Schema<DeleteOptions | null>;
|
|
11
|
+
export declare const list: Schema<ListPermissions | null>;
|
|
12
|
+
export declare const permute: Schema<null>;
|
|
13
|
+
export declare const workflow: Schema<Unit[] | Unit>;
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.permute = exports.list = exports.remove = exports.fetch = exports.store = exports.context = void 0;
|
|
6
|
+
exports.workflow = exports.permute = exports.list = exports.remove = exports.fetch = exports.store = exports.context = void 0;
|
|
7
7
|
const node_path_1 = require("node:path");
|
|
8
8
|
const schemas_1 = __importDefault(require("@toa.io/schemas"));
|
|
9
9
|
const path = (0, node_path_1.resolve)(__dirname, '../../../schemas/octets');
|
|
@@ -14,4 +14,5 @@ exports.fetch = namespace.schema('fetch');
|
|
|
14
14
|
exports.remove = namespace.schema('delete');
|
|
15
15
|
exports.list = namespace.schema('list');
|
|
16
16
|
exports.permute = namespace.schema('permute');
|
|
17
|
+
exports.workflow = namespace.schema('workflow');
|
|
17
18
|
//# sourceMappingURL=schemas.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.js","sourceRoot":"","sources":["../../../source/directives/octets/schemas.ts"],"names":[],"mappings":";;;;;;AAAA,yCAAmC;AACnC,8DAAqC;
|
|
1
|
+
{"version":3,"file":"schemas.js","sourceRoot":"","sources":["../../../source/directives/octets/schemas.ts"],"names":[],"mappings":";;;;;;AAAA,yCAAmC;AACnC,8DAAqC;AAQrC,MAAM,IAAI,GAAG,IAAA,mBAAO,EAAC,SAAS,EAAE,yBAAyB,CAAC,CAAA;AAC1D,MAAM,SAAS,GAAG,iBAAO,CAAC,SAAS,CAAC,IAAI,CAAC,CAAA;AAE5B,QAAA,OAAO,GAAmB,SAAS,CAAC,MAAM,CAAC,SAAS,CAAC,CAAA;AACrD,QAAA,KAAK,GAAgC,SAAS,CAAC,MAAM,CAAC,OAAO,CAAC,CAAA;AAC9D,QAAA,KAAK,GAAoC,SAAS,CAAC,MAAM,CAAC,OAAO,CAAC,CAAA;AAClE,QAAA,MAAM,GAAiC,SAAS,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAA;AACjE,QAAA,IAAI,GAAmC,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC,CAAA;AAC/D,QAAA,OAAO,GAAiB,SAAS,CAAC,MAAM,CAAC,SAAS,CAAC,CAAA;AACnD,QAAA,QAAQ,GAA0B,SAAS,CAAC,MAAM,CAAC,UAAU,CAAC,CAAA"}
|
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
import type * as
|
|
2
|
-
export interface Directive {
|
|
3
|
-
readonly targeted: boolean;
|
|
4
|
-
apply: (storage: string, input: Input) => directive.Output | Promise<directive.Output>;
|
|
5
|
-
}
|
|
1
|
+
import type * as io from '../../io';
|
|
6
2
|
export interface Extension {
|
|
7
3
|
octets?: string;
|
|
8
4
|
}
|
|
9
|
-
export type Input =
|
|
5
|
+
export type Input = io.Input & Extension;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { Readable } from 'stream';
|
|
3
|
+
import type { Unit } from './Workflow';
|
|
4
|
+
import type { Remotes } from '../../../Remotes';
|
|
5
|
+
import type { Entry } from '@toa.io/extensions.storages';
|
|
6
|
+
export declare class Execution extends Readable {
|
|
7
|
+
private readonly units;
|
|
8
|
+
private readonly remotes;
|
|
9
|
+
private readonly context;
|
|
10
|
+
private readonly components;
|
|
11
|
+
private readonly discovery;
|
|
12
|
+
private interrupted;
|
|
13
|
+
constructor(context: Context, units: Unit[], remotes: Remotes);
|
|
14
|
+
_read(): void;
|
|
15
|
+
private run;
|
|
16
|
+
private execute;
|
|
17
|
+
private call;
|
|
18
|
+
private discover;
|
|
19
|
+
}
|
|
20
|
+
export interface Context {
|
|
21
|
+
storage: string;
|
|
22
|
+
path: string;
|
|
23
|
+
entry: Entry;
|
|
24
|
+
parameters: Record<string, string>;
|
|
25
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Execution = void 0;
|
|
4
|
+
const stream_1 = require("stream");
|
|
5
|
+
class Execution extends stream_1.Readable {
|
|
6
|
+
units;
|
|
7
|
+
remotes;
|
|
8
|
+
context;
|
|
9
|
+
components = {};
|
|
10
|
+
discovery = {};
|
|
11
|
+
interrupted = false;
|
|
12
|
+
constructor(context, units, remotes) {
|
|
13
|
+
super({ objectMode: true });
|
|
14
|
+
this.context = context;
|
|
15
|
+
this.units = units;
|
|
16
|
+
this.remotes = remotes;
|
|
17
|
+
void this.run();
|
|
18
|
+
}
|
|
19
|
+
_read() {
|
|
20
|
+
}
|
|
21
|
+
async run() {
|
|
22
|
+
for (const unit of this.units) {
|
|
23
|
+
await this.execute(unit);
|
|
24
|
+
if (this.interrupted)
|
|
25
|
+
break;
|
|
26
|
+
}
|
|
27
|
+
this.push(null);
|
|
28
|
+
}
|
|
29
|
+
async execute(unit) {
|
|
30
|
+
const promises = Object.entries(unit).map(async ([step, endpoint]) => {
|
|
31
|
+
const result = await this.call(endpoint).catch((error) => console.error(error));
|
|
32
|
+
if (result instanceof Error) {
|
|
33
|
+
this.push({ error: { step, ...result } });
|
|
34
|
+
this.interrupted = true;
|
|
35
|
+
}
|
|
36
|
+
else
|
|
37
|
+
this.push({ [step]: result ?? null });
|
|
38
|
+
});
|
|
39
|
+
await Promise.all(promises);
|
|
40
|
+
}
|
|
41
|
+
async call(endpoint) {
|
|
42
|
+
const [operation, component, namespace = 'default'] = endpoint.split('.').reverse();
|
|
43
|
+
const key = `${namespace}.${component}`;
|
|
44
|
+
this.components[key] ??= await this.discover(key, namespace, component);
|
|
45
|
+
return await this.components[key].invoke(operation, { input: this.context });
|
|
46
|
+
}
|
|
47
|
+
async discover(key, namespace, component) {
|
|
48
|
+
if (this.discovery[key] === undefined)
|
|
49
|
+
this.discovery[key] = this.remotes.discover(namespace, component);
|
|
50
|
+
return await this.discovery[key];
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
exports.Execution = Execution;
|
|
54
|
+
//# sourceMappingURL=Execution.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Execution.js","sourceRoot":"","sources":["../../../../source/directives/octets/workflows/Execution.ts"],"names":[],"mappings":";;;AAAA,mCAAiC;AAOjC,MAAa,SAAU,SAAQ,iBAAQ;IACpB,KAAK,CAAQ;IACb,OAAO,CAAS;IAChB,OAAO,CAAS;IAChB,UAAU,GAA8B,EAAE,CAAA;IAC1C,SAAS,GAAuC,EAAE,CAAA;IAC3D,WAAW,GAAG,KAAK,CAAA;IAE3B,YAAoB,OAAgB,EAAE,KAAa,EAAE,OAAgB;QACnE,KAAK,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAA;QAE3B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;QACtB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;QAClB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;QAEtB,KAAK,IAAI,CAAC,GAAG,EAAE,CAAA;IACjB,CAAC;IAEe,KAAK;IACrB,CAAC;IAEO,KAAK,CAAC,GAAG;QACf,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,KAAK,EAAE,C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EAAE,SAAS,CAAC,CAAA;QAEvE,OAAO,MAAM,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,SAAS,EAAE,EAAE,KAAK,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC,CAAA;IAC9E,CAAC;IAEO,KAAK,CAAC,QAAQ,CAAE,GAAW,EAAE,SAAiB,EAAE,SAAiB;QACvE,IAAI,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,KAAK,SAAS;YACnC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC,CAAA;QAEnE,OAAO,MAAM,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAA;IAClC,CAAC;CACF;AA7DD,8BA6DC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Execution } from './Execution';
|
|
2
|
+
import type { Parameter } from '../../../RTD';
|
|
3
|
+
import type { Input } from '../types';
|
|
4
|
+
import type { Entry } from '@toa.io/extensions.storages';
|
|
5
|
+
import type { Remotes } from '../../../Remotes';
|
|
6
|
+
export declare class Workflow {
|
|
7
|
+
private readonly units;
|
|
8
|
+
private readonly remotes;
|
|
9
|
+
constructor(units: Unit[] | Unit, remotes: Remotes);
|
|
10
|
+
execute(input: Input, storage: string, entry: Entry, params: Parameter[]): Execution;
|
|
11
|
+
}
|
|
12
|
+
export type Unit = Record<string, string>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Workflow = void 0;
|
|
4
|
+
const node_path_1 = require("node:path");
|
|
5
|
+
const matchacho_1 = require("matchacho");
|
|
6
|
+
const Execution_1 = require("./Execution");
|
|
7
|
+
class Workflow {
|
|
8
|
+
units;
|
|
9
|
+
remotes;
|
|
10
|
+
constructor(units, remotes) {
|
|
11
|
+
this.units = (0, matchacho_1.match)(units, Array, (units) => units, Object, (unit) => [unit]);
|
|
12
|
+
this.remotes = remotes;
|
|
13
|
+
}
|
|
14
|
+
// eslint-disable-next-line max-params
|
|
15
|
+
execute(input, storage, entry, params) {
|
|
16
|
+
const path = node_path_1.posix.join(input.request.url, entry.id);
|
|
17
|
+
const parameters = {};
|
|
18
|
+
for (const { name, value } of params)
|
|
19
|
+
parameters[name] = value;
|
|
20
|
+
const context = { storage, path, entry, parameters };
|
|
21
|
+
return new Execution_1.Execution(context, this.units, this.remotes);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
exports.Workflow = Workflow;
|
|
25
|
+
//# sourceMappingURL=Workflow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Workflow.js","sourceRoot":"","sources":["../../../../source/directives/octets/workflows/Workflow.ts"],"names":[],"mappings":";;;AAAA,yCAAiC;AACjC,yCAAiC;AACjC,2CAAuC;AAOvC,MAAa,QAAQ;IACF,KAAK,CAAQ;IACb,OAAO,CAAS;IAEjC,YAAoB,KAAoB,EAAE,OAAgB;QACxD,IAAI,CAAC,KAAK,GAAG,IAAA,iBAAK,EAAS,KAAK,EAC9B,KAAK,EAAE,CAAC,KAAa,EAAE,EAAE,CAAC,KAAK,EAC/B,MAAM,EAAE,CAAC,IAAU,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAA;QAEjC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;IACxB,CAAC;IAED,sCAAsC;IAC/B,OAAO,CACb,KAAY,EAAE,OAAe,EAAE,KAAY,EAAE,MAAmB;QAC/D,MAAM,IAAI,GAAG,iBAAK,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,CAAC,CAAA;QACpD,MAAM,UAAU,GAA2B,EAAE,CAAA;QAE7C,KAAK,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,MAAM;YAClC,UAAU,CAAC,IAAI,CAAC,GAAG,KAAK,CAAA;QAE1B,MAAM,OAAO,GAAY,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,UAAU,EAAE,CAAA;QAE7D,OAAO,IAAI,qBAAS,CAAC,OAAO,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,CAAA;IACzD,CAAC;CACF;AAzBD,4BAyBC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Workflow, type Unit } from './Workflow';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Workflow = void 0;
|
|
4
|
+
var Workflow_1 = require("./Workflow");
|
|
5
|
+
Object.defineProperty(exports, "Workflow", { enumerable: true, get: function () { return Workflow_1.Workflow; } });
|
|
6
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../source/directives/octets/workflows/index.ts"],"names":[],"mappings":";;;AAAA,uCAAgD;AAAvC,oGAAA,QAAQ,OAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Directive.js","sourceRoot":"","sources":["../../../source/directives/vary/Directive.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Input } from '../../io';
|
|
2
|
+
import type { Directive } from './Directive';
|
|
3
|
+
import type { Properties } from './Properties';
|
|
4
|
+
export declare class Embed implements Directive {
|
|
5
|
+
private readonly embeddings;
|
|
6
|
+
constructor(map: Record<string, string | string[]>);
|
|
7
|
+
preflight(input: Input, properties: Properties): void;
|
|
8
|
+
private resolve;
|
|
9
|
+
private embedding;
|
|
10
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.Embed = void 0;
|
|
7
|
+
const node_assert_1 = __importDefault(require("node:assert"));
|
|
8
|
+
const embeddings_1 = require("./embeddings");
|
|
9
|
+
class Embed {
|
|
10
|
+
embeddings = [];
|
|
11
|
+
constructor(map) {
|
|
12
|
+
for (const [key, values] of Object.entries(map)) {
|
|
13
|
+
const names = Array.isArray(values) ? values : [values];
|
|
14
|
+
const instances = names.map((name) => {
|
|
15
|
+
if (name[0] === ':')
|
|
16
|
+
return new embeddings_1.Header(name.slice(1));
|
|
17
|
+
node_assert_1.default.ok(name in embeddings_1.embeddings, `Unknown embedding: ${name}`);
|
|
18
|
+
return new embeddings_1.embeddings[name]();
|
|
19
|
+
});
|
|
20
|
+
this.embeddings.push([key, instances]);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
preflight(input, properties) {
|
|
24
|
+
const values = {};
|
|
25
|
+
for (const [key, instances] of this.embeddings)
|
|
26
|
+
values[key] = this.resolve(instances, input, properties);
|
|
27
|
+
input.pipelines.body.push(this.embedding(values));
|
|
28
|
+
}
|
|
29
|
+
resolve(instances, input, properties) {
|
|
30
|
+
let value;
|
|
31
|
+
for (const instance of instances) {
|
|
32
|
+
value = instance.resolve(input, properties);
|
|
33
|
+
if (value !== undefined)
|
|
34
|
+
break;
|
|
35
|
+
}
|
|
36
|
+
node_assert_1.default.ok(value !== undefined, 'Neither embedding resolved a value.');
|
|
37
|
+
return value;
|
|
38
|
+
}
|
|
39
|
+
embedding(values) {
|
|
40
|
+
return (body) => {
|
|
41
|
+
if (body === undefined || body === null || typeof body !== 'object')
|
|
42
|
+
return values;
|
|
43
|
+
Object.assign(body, values);
|
|
44
|
+
return body;
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
exports.Embed = Embed;
|
|
49
|
+
//# sourceMappingURL=Embed.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
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C,CAAC,CAAA;IACnD,CAAC;IAEO,OAAO,CAAE,SAAsB,EAAE,KAAY,EAAE,UAAsB;QAC3E,IAAI,KAAK,CAAA;QAET,KAAK,MAAM,QAAQ,IAAI,SAAS,EAAE,CAAC;YACjC,KAAK,GAAG,QAAQ,CAAC,OAAO,CAAC,KAAK,EAAE,UAAU,CAAC,CAAA;YAE3C,IAAI,KAAK,KAAK,SAAS;gBACrB,MAAK;QACT,CAAC;QAED,qBAAM,CAAC,EAAE,CAAC,KAAK,KAAK,SAAS,EAAE,qCAAqC,CAAC,CAAA;QAErE,OAAO,KAAK,CAAA;IACd,CAAC;IAEO,SAAS,CAAE,MAA+B;QAChD,OAAO,CAAC,IAAa,EAAU,EAAE;YAC/B,IAAI,IAAI,KAAK,SAAS,IAAI,IAAI,KAAK,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ;gBACjE,OAAO,MAAM,CAAA;YAEf,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,CAAA;YAE3B,OAAO,IAAI,CAAA;QACb,CAAC,CAAA;IACH,CAAC;CACF;AAtDD,sBAsDC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export interface Properties {
|
|
2
|
+
languages?: string[];
|
|
3
|
+
}
|
|
4
|
+
export declare class Property<K extends keyof Properties = keyof Properties> {
|
|
5
|
+
readonly name: K;
|
|
6
|
+
readonly value: Properties[K];
|
|
7
|
+
constructor(name: K, value: Properties[K]);
|
|
8
|
+
}
|
|
9
|
+
export declare const properties: Properties;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.properties = exports.Property = void 0;
|
|
4
|
+
class Property {
|
|
5
|
+
name;
|
|
6
|
+
value;
|
|
7
|
+
constructor(name, value) {
|
|
8
|
+
this.name = name;
|
|
9
|
+
this.value = value;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
exports.Property = Property;
|
|
13
|
+
exports.properties = {
|
|
14
|
+
languages: []
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=Properties.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Properties.js","sourceRoot":"","sources":["../../../source/directives/vary/Properties.ts"],"names":[],"mappings":";;;AAIA,MAAa,QAAQ;IACH,IAAI,CAAG;IACP,KAAK,CAAe;IAEpC,YAAoB,IAAO,EAAE,KAAoB;QAC/C,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;QAChB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;IACpB,CAAC;CACF;AARD,4BAQC;AAEY,QAAA,UAAU,GAAe;IACpC,SAAS,EAAE,EAAE;CACd,CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Property } from './Properties';
|
|
2
|
+
import type { Directive } from './Directive';
|
|
3
|
+
import type { DirectiveFamily } from '../../RTD';
|
|
4
|
+
import type { Input, Output } from '../../io';
|
|
5
|
+
export declare class Vary implements DirectiveFamily {
|
|
6
|
+
readonly name = "vary";
|
|
7
|
+
readonly mandatory = false;
|
|
8
|
+
create(name: string, value: unknown): Property | Directive;
|
|
9
|
+
preflight(instances: Array<Directive | Property>, request: Input): Output;
|
|
10
|
+
}
|