@toa.io/extensions.exposition 1.0.0-alpha.283 → 1.0.0-alpha.285
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/CHANGELOG.md +40 -0
- package/components/exposition.octets/types/index.d.ts +1 -1
- package/components/identity.bans/operations/transit.js +1 -1
- package/components/identity.bans/tsconfig.json +1 -1
- package/components/identity.bans/tsconfig.tsbuildinfo +1 -1
- package/components/identity.bans/types/index.d.ts +1 -1
- package/components/identity.basic/operations/add.js +1 -1
- package/components/identity.basic/operations/authenticate.js +1 -1
- package/components/identity.basic/operations/check.js +1 -1
- package/components/identity.basic/operations/delete.js +1 -1
- package/components/identity.basic/operations/incept.js +18 -2
- package/components/identity.basic/operations/info.js +1 -1
- package/components/identity.basic/operations/lib/credentials.js +1 -1
- package/components/identity.basic/operations/transit.js +1 -1
- package/components/identity.basic/source/incept.ts +29 -1
- package/components/identity.basic/tsconfig.json +1 -1
- package/components/identity.basic/tsconfig.tsbuildinfo +1 -1
- package/components/identity.basic/types/index.d.ts +3 -2
- package/components/identity.clients/operations/describe.js +1 -1
- package/components/identity.clients/operations/lib/Context.js +1 -1
- package/components/identity.clients/operations/lib/Entity.js +1 -1
- package/components/identity.clients/operations/lib/canonical.js +1 -1
- package/components/identity.clients/operations/lib/cimd.js +1 -1
- package/components/identity.clients/operations/lib/errors.js +1 -1
- package/components/identity.clients/operations/lib/index.js +1 -1
- package/components/identity.clients/operations/lib/redirect.js +1 -1
- package/components/identity.clients/operations/register.js +1 -1
- package/components/identity.clients/tsconfig.json +1 -1
- package/components/identity.clients/tsconfig.tsbuildinfo +1 -1
- package/components/identity.clients/types/index.d.ts +1 -1
- package/components/identity.credentials/operations/list.js +1 -1
- package/components/identity.credentials/tsconfig.json +4 -2
- package/components/identity.credentials/tsconfig.tsbuildinfo +1 -1
- package/components/identity.credentials/types/index.d.ts +1 -1
- package/components/identity.federation/operations/authenticate.js +7 -3
- package/components/identity.federation/operations/create.js +1 -1
- package/components/identity.federation/operations/decode.js +1 -1
- package/components/identity.federation/operations/delete.js +1 -1
- package/components/identity.federation/operations/incept.js +6 -2
- package/components/identity.federation/operations/lib/Configuration.js +1 -1
- package/components/identity.federation/operations/lib/Ctx.js +1 -1
- package/components/identity.federation/operations/lib/Payload.js +1 -1
- package/components/identity.federation/operations/lib/decode.js +1 -1
- package/components/identity.federation/operations/lib/discovery.js +1 -1
- package/components/identity.federation/operations/lib/errors.js +1 -1
- package/components/identity.federation/operations/lib/exchange.js +1 -1
- package/components/identity.federation/operations/lib/index.js +2 -1
- package/components/identity.federation/operations/lib/jose.js +1 -1
- package/components/identity.federation/operations/lib/principal.js +14 -0
- package/components/identity.federation/operations/lib/resolve.js +1 -1
- package/components/identity.federation/operations/list.js +1 -1
- package/components/identity.federation/operations/types/Scheme.js +1 -1
- package/components/identity.federation/operations/types/configuration.js +1 -1
- package/components/identity.federation/operations/types/context.js +1 -1
- package/components/identity.federation/operations/types/entity.js +1 -1
- package/components/identity.federation/operations/types/index.js +1 -1
- package/components/identity.federation/source/authenticate.ts +8 -2
- package/components/identity.federation/source/incept.ts +7 -1
- package/components/identity.federation/source/lib/index.ts +1 -0
- package/components/identity.federation/source/lib/principal.ts +17 -0
- package/components/identity.federation/source/types/context.ts +3 -0
- package/components/identity.federation/tsconfig.json +4 -2
- package/components/identity.federation/tsconfig.tsbuildinfo +1 -1
- package/components/identity.federation/types/index.d.ts +1 -1
- package/components/identity.grants/operations/authorize.js +1 -1
- package/components/identity.grants/operations/exchange.js +1 -1
- package/components/identity.grants/operations/lib/code.js +1 -1
- package/components/identity.grants/operations/lib/identify.js +1 -1
- package/components/identity.grants/operations/lib/index.js +1 -1
- package/components/identity.grants/operations/list.js +1 -1
- package/components/identity.grants/operations/revoke.js +1 -1
- package/components/identity.grants/tsconfig.json +1 -1
- package/components/identity.grants/tsconfig.tsbuildinfo +1 -1
- package/components/identity.grants/types/index.d.ts +1 -1
- package/components/identity.keys/operations/create.js +1 -1
- package/components/identity.keys/operations/disable.js +1 -1
- package/components/identity.keys/operations/revoke.js +1 -1
- package/components/identity.keys/tsconfig.json +1 -1
- package/components/identity.keys/tsconfig.tsbuildinfo +1 -1
- package/components/identity.keys/types/index.d.ts +1 -1
- package/components/identity.otp/operations/authenticate.js +1 -1
- package/components/identity.otp/operations/issue.js +1 -1
- package/components/identity.otp/operations/lib/Context.js +1 -1
- package/components/identity.otp/operations/lib/Entity.js +1 -1
- package/components/identity.otp/operations/lib/index.js +1 -1
- package/components/identity.otp/tsconfig.json +1 -1
- package/components/identity.otp/tsconfig.tsbuildinfo +1 -1
- package/components/identity.otp/types/index.d.ts +1 -1
- package/components/identity.passkeys/operations/authenticate.js +1 -1
- package/components/identity.passkeys/operations/challenge.js +1 -1
- package/components/identity.passkeys/operations/create.js +1 -1
- package/components/identity.passkeys/operations/delete.js +1 -1
- package/components/identity.passkeys/operations/lib/const.js +1 -1
- package/components/identity.passkeys/operations/list.js +1 -1
- package/components/identity.passkeys/operations/types/Configuration.js +1 -1
- package/components/identity.passkeys/operations/types/Context.js +1 -1
- package/components/identity.passkeys/operations/types/Passkey.js +1 -1
- package/components/identity.passkeys/operations/types/index.js +1 -1
- package/components/identity.passkeys/operations/use.js +1 -1
- package/components/identity.passkeys/tsconfig.json +1 -1
- package/components/identity.passkeys/tsconfig.tsbuildinfo +1 -1
- package/components/identity.passkeys/types/index.d.ts +1 -1
- package/components/identity.roles/operations/grant.js +1 -1
- package/components/identity.roles/operations/lib/Entity.js +1 -1
- package/components/identity.roles/operations/list.js +1 -1
- package/components/identity.roles/operations/principal.js +29 -5
- package/components/identity.roles/source/principal.ts +33 -5
- package/components/identity.roles/tsconfig.json +1 -1
- package/components/identity.roles/tsconfig.tsbuildinfo +1 -1
- package/components/identity.roles/types/index.d.ts +1 -1
- package/components/identity.tokens/operations/authenticate.js +1 -1
- package/components/identity.tokens/operations/decrypt.js +1 -1
- package/components/identity.tokens/operations/encrypt.js +1 -1
- package/components/identity.tokens/operations/issue.js +1 -1
- package/components/identity.tokens/operations/lib/form.js +1 -1
- package/components/identity.tokens/operations/lib/index.js +1 -1
- package/components/identity.tokens/operations/lib/jose.js +1 -1
- package/components/identity.tokens/operations/lib/key.js +1 -1
- package/components/identity.tokens/operations/lib/pad.js +1 -1
- package/components/identity.tokens/operations/revoke.js +1 -1
- package/components/identity.tokens/tsconfig.json +1 -1
- package/components/identity.tokens/tsconfig.tsbuildinfo +1 -1
- package/components/identity.tokens/types/index.d.ts +1 -1
- package/documentation/access.md +13 -0
- package/documentation/components.md +3 -0
- package/documentation/introspection.md +13 -5
- package/documentation/io.md +6 -0
- package/documentation/map.md +8 -0
- package/documentation/mcp.md +186 -0
- package/documentation/oauth.md +8 -7
- package/documentation/rpc.md +144 -0
- package/documentation/tree.md +3 -0
- package/features/identity.basic.feature +44 -0
- package/features/identity.federation.feature +2 -5
- package/features/introspection.feature +333 -0
- package/features/mcp.feature +691 -0
- package/features/oauth.discovery.feature +10 -11
- package/features/oauth.grants.feature +22 -9
- package/features/octets.cloudinary.feature +1 -0
- package/features/rpc.feature +429 -0
- package/features/steps/Cloudinary.ts +13 -0
- package/features/steps/Components.ts +0 -4
- package/features/steps/Gateway.ts +19 -2
- package/features/steps/Parameters.ts +18 -7
- package/features/steps/Realtime.ts +3 -0
- package/features/steps/components/echo/manifest.toa.yaml +1 -0
- package/features/steps/components/pots/manifest.toa.yaml +2 -0
- package/package.json +3 -3
- package/readme.md +3 -0
- package/schemas/annotation.cos.yaml +33 -0
- package/schemas/call.cos.yaml +18 -0
- package/source/Annotation.ts +31 -0
- package/source/Directive.test.ts +15 -15
- package/source/Directive.ts +77 -9
- package/source/Endpoint.test.ts +67 -0
- package/source/Endpoint.ts +31 -11
- package/source/Factory.ts +5 -1
- package/source/Gateway.ts +73 -11
- package/source/HTTP/Context.ts +7 -0
- package/source/HTTP/Server.ts +7 -1
- package/source/HTTP/exceptions.ts +2 -2
- package/source/HTTP/messages.ts +10 -1
- package/source/Introspection.ts +105 -0
- package/source/MCP/Server.ts +275 -0
- package/source/MCP/discover.ts +52 -0
- package/source/MCP/errors.ts +81 -0
- package/source/MCP/index.ts +1 -0
- package/source/MCP/schema.test.ts +85 -0
- package/source/MCP/schema.ts +87 -0
- package/source/MCP/tools.ts +157 -0
- package/source/MCP/types.ts +84 -0
- package/source/Query.ts +48 -8
- package/source/RPC/Context.ts +78 -0
- package/source/RPC/Dispatcher.ts +130 -0
- package/source/RPC/errors.test.ts +52 -0
- package/source/RPC/errors.ts +83 -0
- package/source/RPC/index.ts +1 -0
- package/source/RPC/names.test.ts +122 -0
- package/source/RPC/names.ts +183 -0
- package/source/RPC/types.ts +34 -0
- package/source/RTD/Directives.ts +52 -2
- package/source/RTD/Endpoint.ts +2 -1
- package/source/RTD/Method.ts +14 -11
- package/source/RTD/Node.ts +38 -7
- package/source/RTD/Route.ts +30 -3
- package/source/RTD/Tree.ts +37 -1
- package/source/RTD/expiration.test.ts +1 -1
- package/source/RTD/walk.test.ts +110 -0
- package/source/const.ts +15 -0
- package/source/deployment.ts +8 -1
- package/source/directives/auth/Anonymous.test.ts +38 -0
- package/source/directives/auth/Anonymous.ts +12 -0
- package/source/directives/auth/Anyone.ts +4 -0
- package/source/directives/auth/Authorization.ts +62 -3
- package/source/directives/auth/Delegate.test.ts +36 -0
- package/source/directives/auth/Delegate.ts +14 -0
- package/source/directives/auth/Echo.ts +5 -0
- package/source/directives/auth/Incept.ts +2 -1
- package/source/directives/auth/Role.ts +13 -0
- package/source/directives/auth/Rule.ts +29 -0
- package/source/directives/auth/Scheme.ts +5 -0
- package/source/directives/auth/types.ts +21 -0
- package/source/directives/cache/Cache.ts +1 -1
- package/source/directives/dev/Development.ts +1 -1
- package/source/directives/flow/Flow.ts +1 -1
- package/source/directives/index.ts +3 -1
- package/source/directives/io/Directive.ts +1 -1
- package/source/directives/io/IO.ts +32 -3
- package/source/directives/io/Input.ts +3 -2
- package/source/directives/io/Output.ts +6 -3
- package/source/directives/io/Status.test.ts +2 -2
- package/source/directives/io/Status.ts +1 -1
- package/source/directives/io/Throttle.ts +1 -1
- package/source/directives/io/lib/throttle/Quotas.ts +2 -2
- package/source/directives/map/Headers.ts +11 -0
- package/source/directives/map/Map.ts +10 -1
- package/source/directives/map/Mapping.ts +23 -0
- package/source/directives/map/Segments.ts +12 -0
- package/source/directives/mcp/MCP.ts +40 -0
- package/source/directives/mcp/Tool.test.ts +90 -0
- package/source/directives/mcp/Tool.ts +47 -0
- package/source/directives/mcp/index.ts +6 -0
- package/source/directives/oauth/Discovery.ts +10 -16
- package/source/directives/octets/Octets.ts +1 -1
- package/source/directives/require/Directive.ts +1 -1
- package/source/directives/require/Headers.ts +1 -1
- package/source/directives/require/Require.ts +2 -2
- package/source/schemas.ts +2 -0
- package/transpiled/Annotation.d.ts +24 -0
- package/transpiled/Directive.d.ts +18 -1
- package/transpiled/Directive.js +50 -6
- package/transpiled/Directive.js.map +1 -1
- package/transpiled/Endpoint.d.ts +9 -0
- package/transpiled/Endpoint.js +27 -11
- package/transpiled/Endpoint.js.map +1 -1
- package/transpiled/Factory.js +5 -1
- package/transpiled/Factory.js.map +1 -1
- package/transpiled/Gateway.d.ts +19 -2
- package/transpiled/Gateway.js +51 -9
- package/transpiled/Gateway.js.map +1 -1
- package/transpiled/HTTP/Context.d.ts +6 -0
- package/transpiled/HTTP/Context.js +6 -0
- package/transpiled/HTTP/Context.js.map +1 -1
- package/transpiled/HTTP/Server.d.ts +5 -1
- package/transpiled/HTTP/exceptions.d.ts +1 -1
- package/transpiled/HTTP/exceptions.js +2 -2
- package/transpiled/HTTP/exceptions.js.map +1 -1
- package/transpiled/HTTP/messages.d.ts +6 -0
- package/transpiled/HTTP/messages.js +9 -1
- package/transpiled/HTTP/messages.js.map +1 -1
- package/transpiled/Introspection.d.ts +42 -0
- package/transpiled/Introspection.js +50 -1
- package/transpiled/Introspection.js.map +1 -1
- package/transpiled/MCP/Server.d.ts +41 -0
- package/transpiled/MCP/Server.js +180 -0
- package/transpiled/MCP/Server.js.map +1 -0
- package/transpiled/MCP/discover.d.ts +13 -0
- package/transpiled/MCP/discover.js +29 -0
- package/transpiled/MCP/discover.js.map +1 -0
- package/transpiled/MCP/errors.d.ts +24 -0
- package/transpiled/MCP/errors.js +67 -0
- package/transpiled/MCP/errors.js.map +1 -0
- package/transpiled/MCP/index.d.ts +1 -0
- package/transpiled/MCP/index.js +2 -0
- package/transpiled/MCP/index.js.map +1 -0
- package/transpiled/MCP/schema.d.ts +18 -0
- package/transpiled/MCP/schema.js +64 -0
- package/transpiled/MCP/schema.js.map +1 -0
- package/transpiled/MCP/tools.d.ts +31 -0
- package/transpiled/MCP/tools.js +122 -0
- package/transpiled/MCP/tools.js.map +1 -0
- package/transpiled/MCP/types.d.ts +66 -0
- package/transpiled/MCP/types.js +13 -0
- package/transpiled/MCP/types.js.map +1 -0
- package/transpiled/Query.d.ts +7 -0
- package/transpiled/Query.js +38 -7
- package/transpiled/Query.js.map +1 -1
- package/transpiled/RPC/Context.d.ts +11 -0
- package/transpiled/RPC/Context.js +63 -0
- package/transpiled/RPC/Context.js.map +1 -0
- package/transpiled/RPC/Dispatcher.d.ts +19 -0
- package/transpiled/RPC/Dispatcher.js +100 -0
- package/transpiled/RPC/Dispatcher.js.map +1 -0
- package/transpiled/RPC/errors.d.ts +18 -0
- package/transpiled/RPC/errors.js +67 -0
- package/transpiled/RPC/errors.js.map +1 -0
- package/transpiled/RPC/index.d.ts +1 -0
- package/transpiled/RPC/index.js +2 -0
- package/transpiled/RPC/index.js.map +1 -0
- package/transpiled/RPC/names.d.ts +31 -0
- package/transpiled/RPC/names.js +121 -0
- package/transpiled/RPC/names.js.map +1 -0
- package/transpiled/RPC/types.d.ts +27 -0
- package/transpiled/RPC/types.js +8 -0
- package/transpiled/RPC/types.js.map +1 -0
- package/transpiled/RTD/Directives.d.ts +41 -2
- package/transpiled/RTD/Endpoint.d.ts +2 -1
- package/transpiled/RTD/Method.d.ts +8 -3
- package/transpiled/RTD/Method.js +12 -10
- package/transpiled/RTD/Method.js.map +1 -1
- package/transpiled/RTD/Node.d.ts +20 -2
- package/transpiled/RTD/Node.js +22 -4
- package/transpiled/RTD/Node.js.map +1 -1
- package/transpiled/RTD/Route.d.ts +2 -1
- package/transpiled/RTD/Route.js +27 -2
- package/transpiled/RTD/Route.js.map +1 -1
- package/transpiled/RTD/Tree.d.ts +3 -1
- package/transpiled/RTD/Tree.js +26 -0
- package/transpiled/RTD/Tree.js.map +1 -1
- package/transpiled/const.d.ts +12 -0
- package/transpiled/const.js +12 -0
- package/transpiled/const.js.map +1 -1
- package/transpiled/deployment.js +4 -0
- package/transpiled/deployment.js.map +1 -1
- package/transpiled/directives/auth/Anonymous.d.ts +6 -0
- package/transpiled/directives/auth/Anonymous.js +10 -0
- package/transpiled/directives/auth/Anonymous.js.map +1 -1
- package/transpiled/directives/auth/Anyone.d.ts +1 -0
- package/transpiled/directives/auth/Anyone.js +3 -0
- package/transpiled/directives/auth/Anyone.js.map +1 -1
- package/transpiled/directives/auth/Authorization.d.ts +27 -1
- package/transpiled/directives/auth/Authorization.js +49 -1
- package/transpiled/directives/auth/Authorization.js.map +1 -1
- package/transpiled/directives/auth/Delegate.d.ts +5 -0
- package/transpiled/directives/auth/Delegate.js +10 -0
- package/transpiled/directives/auth/Delegate.js.map +1 -1
- package/transpiled/directives/auth/Echo.d.ts +2 -0
- package/transpiled/directives/auth/Echo.js +4 -0
- package/transpiled/directives/auth/Echo.js.map +1 -1
- package/transpiled/directives/auth/Incept.js +2 -1
- package/transpiled/directives/auth/Incept.js.map +1 -1
- package/transpiled/directives/auth/Role.d.ts +2 -0
- package/transpiled/directives/auth/Role.js +9 -0
- package/transpiled/directives/auth/Role.js.map +1 -1
- package/transpiled/directives/auth/Rule.d.ts +5 -0
- package/transpiled/directives/auth/Rule.js +20 -0
- package/transpiled/directives/auth/Rule.js.map +1 -1
- package/transpiled/directives/auth/Scheme.d.ts +2 -0
- package/transpiled/directives/auth/Scheme.js +4 -0
- package/transpiled/directives/auth/Scheme.js.map +1 -1
- package/transpiled/directives/auth/types.d.ts +16 -0
- package/transpiled/directives/cache/Cache.d.ts +1 -1
- package/transpiled/directives/cache/Cache.js +1 -1
- package/transpiled/directives/cache/Cache.js.map +1 -1
- package/transpiled/directives/dev/Development.d.ts +1 -1
- package/transpiled/directives/dev/Development.js +1 -1
- package/transpiled/directives/dev/Development.js.map +1 -1
- package/transpiled/directives/flow/Flow.d.ts +1 -1
- package/transpiled/directives/flow/Flow.js +1 -1
- package/transpiled/directives/flow/Flow.js.map +1 -1
- package/transpiled/directives/index.js +2 -1
- package/transpiled/directives/index.js.map +1 -1
- package/transpiled/directives/io/Directive.d.ts +1 -1
- package/transpiled/directives/io/IO.d.ts +7 -1
- package/transpiled/directives/io/IO.js +23 -3
- package/transpiled/directives/io/IO.js.map +1 -1
- package/transpiled/directives/io/Input.d.ts +3 -2
- package/transpiled/directives/io/Input.js +2 -1
- package/transpiled/directives/io/Input.js.map +1 -1
- package/transpiled/directives/io/Output.d.ts +5 -3
- package/transpiled/directives/io/Output.js +4 -2
- package/transpiled/directives/io/Output.js.map +1 -1
- package/transpiled/directives/io/Status.d.ts +1 -1
- package/transpiled/directives/io/Status.js +1 -1
- package/transpiled/directives/io/Status.js.map +1 -1
- package/transpiled/directives/io/Throttle.d.ts +1 -1
- package/transpiled/directives/io/Throttle.js +1 -1
- package/transpiled/directives/io/Throttle.js.map +1 -1
- package/transpiled/directives/io/lib/throttle/Quotas.d.ts +1 -1
- package/transpiled/directives/io/lib/throttle/Quotas.js +2 -2
- package/transpiled/directives/io/lib/throttle/Quotas.js.map +1 -1
- package/transpiled/directives/map/Headers.d.ts +2 -0
- package/transpiled/directives/map/Headers.js +8 -0
- package/transpiled/directives/map/Headers.js.map +1 -1
- package/transpiled/directives/map/Map.d.ts +3 -1
- package/transpiled/directives/map/Map.js +7 -1
- package/transpiled/directives/map/Map.js.map +1 -1
- package/transpiled/directives/map/Mapping.d.ts +13 -0
- package/transpiled/directives/map/Mapping.js +20 -0
- package/transpiled/directives/map/Mapping.js.map +1 -1
- package/transpiled/directives/map/Segments.d.ts +3 -0
- package/transpiled/directives/map/Segments.js +9 -0
- package/transpiled/directives/map/Segments.js.map +1 -1
- package/transpiled/directives/mcp/MCP.d.ts +15 -0
- package/transpiled/directives/mcp/MCP.js +29 -0
- package/transpiled/directives/mcp/MCP.js.map +1 -0
- package/transpiled/directives/mcp/Tool.d.ts +18 -0
- package/transpiled/directives/mcp/Tool.js +34 -0
- package/transpiled/directives/mcp/Tool.js.map +1 -0
- package/transpiled/directives/mcp/index.d.ts +4 -0
- package/transpiled/directives/mcp/index.js +4 -0
- package/transpiled/directives/mcp/index.js.map +1 -0
- package/transpiled/directives/oauth/Discovery.js +10 -13
- package/transpiled/directives/oauth/Discovery.js.map +1 -1
- package/transpiled/directives/octets/Octets.d.ts +1 -1
- package/transpiled/directives/octets/Octets.js +1 -1
- package/transpiled/directives/octets/Octets.js.map +1 -1
- package/transpiled/directives/require/Directive.d.ts +1 -1
- package/transpiled/directives/require/Headers.d.ts +1 -1
- package/transpiled/directives/require/Headers.js +1 -1
- package/transpiled/directives/require/Headers.js.map +1 -1
- package/transpiled/directives/require/Require.d.ts +1 -1
- package/transpiled/directives/require/Require.js +2 -2
- package/transpiled/directives/require/Require.js.map +1 -1
- package/transpiled/schemas.d.ts +2 -0
- package/transpiled/schemas.js +1 -0
- package/transpiled/schemas.js.map +1 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/components/identity.bans/operations/transit.d.ts +0 -14
- package/components/identity.bans/operations/transit.js.map +0 -1
- package/components/identity.basic/operations/add.d.ts +0 -3
- package/components/identity.basic/operations/add.js.map +0 -1
- package/components/identity.basic/operations/authenticate.d.ts +0 -13
- package/components/identity.basic/operations/authenticate.js.map +0 -1
- package/components/identity.basic/operations/check.d.ts +0 -7
- package/components/identity.basic/operations/check.js.map +0 -1
- package/components/identity.basic/operations/delete.d.ts +0 -7
- package/components/identity.basic/operations/delete.js.map +0 -1
- package/components/identity.basic/operations/incept.d.ts +0 -12
- package/components/identity.basic/operations/incept.js.map +0 -1
- package/components/identity.basic/operations/info.d.ts +0 -10
- package/components/identity.basic/operations/info.js.map +0 -1
- package/components/identity.basic/operations/lib/credentials.d.ts +0 -5
- package/components/identity.basic/operations/lib/credentials.js.map +0 -1
- package/components/identity.basic/operations/transit.d.ts +0 -15
- package/components/identity.basic/operations/transit.js.map +0 -1
- package/components/identity.clients/operations/describe.d.ts +0 -27
- package/components/identity.clients/operations/describe.js.map +0 -1
- package/components/identity.clients/operations/lib/Context.d.ts +0 -29
- package/components/identity.clients/operations/lib/Context.js.map +0 -1
- package/components/identity.clients/operations/lib/Entity.d.ts +0 -29
- package/components/identity.clients/operations/lib/Entity.js.map +0 -1
- package/components/identity.clients/operations/lib/canonical.d.ts +0 -11
- package/components/identity.clients/operations/lib/canonical.js.map +0 -1
- package/components/identity.clients/operations/lib/cimd.d.ts +0 -8
- package/components/identity.clients/operations/lib/cimd.js.map +0 -1
- package/components/identity.clients/operations/lib/errors.d.ts +0 -7
- package/components/identity.clients/operations/lib/errors.js.map +0 -1
- package/components/identity.clients/operations/lib/index.d.ts +0 -6
- package/components/identity.clients/operations/lib/index.js.map +0 -1
- package/components/identity.clients/operations/lib/redirect.d.ts +0 -10
- package/components/identity.clients/operations/lib/redirect.js.map +0 -1
- package/components/identity.clients/operations/register.d.ts +0 -37
- package/components/identity.clients/operations/register.js.map +0 -1
- package/components/identity.credentials/operations/list.d.ts +0 -52
- package/components/identity.credentials/operations/list.js.map +0 -1
- package/components/identity.federation/operations/authenticate.d.ts +0 -16
- package/components/identity.federation/operations/authenticate.js.map +0 -1
- package/components/identity.federation/operations/create.d.ts +0 -8
- package/components/identity.federation/operations/create.js.map +0 -1
- package/components/identity.federation/operations/decode.d.ts +0 -3
- package/components/identity.federation/operations/decode.js.map +0 -1
- package/components/identity.federation/operations/delete.d.ts +0 -8
- package/components/identity.federation/operations/delete.js.map +0 -1
- package/components/identity.federation/operations/incept.d.ts +0 -11
- package/components/identity.federation/operations/incept.js.map +0 -1
- package/components/identity.federation/operations/lib/Configuration.d.ts +0 -39
- package/components/identity.federation/operations/lib/Configuration.js.map +0 -1
- package/components/identity.federation/operations/lib/Ctx.d.ts +0 -8
- package/components/identity.federation/operations/lib/Ctx.js.map +0 -1
- package/components/identity.federation/operations/lib/Payload.d.ts +0 -5
- package/components/identity.federation/operations/lib/Payload.js.map +0 -1
- package/components/identity.federation/operations/lib/decode.d.ts +0 -3
- package/components/identity.federation/operations/lib/decode.js.map +0 -1
- package/components/identity.federation/operations/lib/discovery.d.ts +0 -5
- package/components/identity.federation/operations/lib/discovery.js.map +0 -1
- package/components/identity.federation/operations/lib/errors.d.ts +0 -77
- package/components/identity.federation/operations/lib/errors.js.map +0 -1
- package/components/identity.federation/operations/lib/exchange.d.ts +0 -3
- package/components/identity.federation/operations/lib/exchange.js.map +0 -1
- package/components/identity.federation/operations/lib/index.d.ts +0 -4
- package/components/identity.federation/operations/lib/index.js.map +0 -1
- package/components/identity.federation/operations/lib/jose.d.ts +0 -1
- package/components/identity.federation/operations/lib/jose.js.map +0 -1
- package/components/identity.federation/operations/lib/resolve.d.ts +0 -3
- package/components/identity.federation/operations/lib/resolve.js.map +0 -1
- package/components/identity.federation/operations/list.d.ts +0 -7
- package/components/identity.federation/operations/list.js.map +0 -1
- package/components/identity.federation/operations/types/Scheme.d.ts +0 -1
- package/components/identity.federation/operations/types/Scheme.js.map +0 -1
- package/components/identity.federation/operations/types/configuration.d.ts +0 -22
- package/components/identity.federation/operations/types/configuration.js.map +0 -1
- package/components/identity.federation/operations/types/context.d.ts +0 -36
- package/components/identity.federation/operations/types/context.js.map +0 -1
- package/components/identity.federation/operations/types/entity.d.ts +0 -9
- package/components/identity.federation/operations/types/entity.js.map +0 -1
- package/components/identity.federation/operations/types/index.d.ts +0 -4
- package/components/identity.federation/operations/types/index.js.map +0 -1
- package/components/identity.grants/operations/authorize.d.ts +0 -35
- package/components/identity.grants/operations/authorize.js.map +0 -1
- package/components/identity.grants/operations/exchange.d.ts +0 -37
- package/components/identity.grants/operations/exchange.js.map +0 -1
- package/components/identity.grants/operations/lib/code.d.ts +0 -15
- package/components/identity.grants/operations/lib/code.js.map +0 -1
- package/components/identity.grants/operations/lib/identify.d.ts +0 -6
- package/components/identity.grants/operations/lib/identify.js.map +0 -1
- package/components/identity.grants/operations/lib/index.d.ts +0 -3
- package/components/identity.grants/operations/lib/index.js.map +0 -1
- package/components/identity.grants/operations/list.d.ts +0 -13
- package/components/identity.grants/operations/list.js.map +0 -1
- package/components/identity.grants/operations/revoke.d.ts +0 -18
- package/components/identity.grants/operations/revoke.js.map +0 -1
- package/components/identity.keys/operations/create.d.ts +0 -22
- package/components/identity.keys/operations/create.js.map +0 -1
- package/components/identity.keys/operations/disable.d.ts +0 -5
- package/components/identity.keys/operations/disable.js.map +0 -1
- package/components/identity.keys/operations/revoke.d.ts +0 -15
- package/components/identity.keys/operations/revoke.js.map +0 -1
- package/components/identity.otp/operations/authenticate.d.ts +0 -12
- package/components/identity.otp/operations/authenticate.js.map +0 -1
- package/components/identity.otp/operations/issue.d.ts +0 -12
- package/components/identity.otp/operations/issue.js.map +0 -1
- package/components/identity.otp/operations/lib/Context.d.ts +0 -16
- package/components/identity.otp/operations/lib/Context.js.map +0 -1
- package/components/identity.otp/operations/lib/Entity.d.ts +0 -6
- package/components/identity.otp/operations/lib/Entity.js.map +0 -1
- package/components/identity.otp/operations/lib/index.d.ts +0 -1
- package/components/identity.otp/operations/lib/index.js.map +0 -1
- package/components/identity.passkeys/operations/authenticate.d.ts +0 -16
- package/components/identity.passkeys/operations/authenticate.js.map +0 -1
- package/components/identity.passkeys/operations/challenge.d.ts +0 -35
- package/components/identity.passkeys/operations/challenge.js.map +0 -1
- package/components/identity.passkeys/operations/create.d.ts +0 -19
- package/components/identity.passkeys/operations/create.js.map +0 -1
- package/components/identity.passkeys/operations/delete.d.ts +0 -8
- package/components/identity.passkeys/operations/delete.js.map +0 -1
- package/components/identity.passkeys/operations/lib/const.d.ts +0 -1
- package/components/identity.passkeys/operations/lib/const.js.map +0 -1
- package/components/identity.passkeys/operations/list.d.ts +0 -7
- package/components/identity.passkeys/operations/list.js.map +0 -1
- package/components/identity.passkeys/operations/types/Configuration.d.ts +0 -6
- package/components/identity.passkeys/operations/types/Configuration.js.map +0 -1
- package/components/identity.passkeys/operations/types/Context.d.ts +0 -16
- package/components/identity.passkeys/operations/types/Context.js.map +0 -1
- package/components/identity.passkeys/operations/types/Passkey.d.ts +0 -12
- package/components/identity.passkeys/operations/types/Passkey.js.map +0 -1
- package/components/identity.passkeys/operations/types/index.d.ts +0 -2
- package/components/identity.passkeys/operations/types/index.js.map +0 -1
- package/components/identity.passkeys/operations/use.d.ts +0 -16
- package/components/identity.passkeys/operations/use.js.map +0 -1
- package/components/identity.roles/operations/grant.d.ts +0 -10
- package/components/identity.roles/operations/grant.js.map +0 -1
- package/components/identity.roles/operations/lib/Entity.d.ts +0 -5
- package/components/identity.roles/operations/lib/Entity.js.map +0 -1
- package/components/identity.roles/operations/list.d.ts +0 -2
- package/components/identity.roles/operations/list.js.map +0 -1
- package/components/identity.roles/operations/principal.d.ts +0 -13
- package/components/identity.roles/operations/principal.js.map +0 -1
- package/components/identity.tokens/operations/authenticate.d.ts +0 -10
- package/components/identity.tokens/operations/authenticate.js.map +0 -1
- package/components/identity.tokens/operations/decrypt.d.ts +0 -16
- package/components/identity.tokens/operations/decrypt.js.map +0 -1
- package/components/identity.tokens/operations/encrypt.d.ts +0 -9
- package/components/identity.tokens/operations/encrypt.js.map +0 -1
- package/components/identity.tokens/operations/issue.d.ts +0 -25
- package/components/identity.tokens/operations/issue.js.map +0 -1
- package/components/identity.tokens/operations/lib/form.d.ts +0 -8
- package/components/identity.tokens/operations/lib/form.js.map +0 -1
- package/components/identity.tokens/operations/lib/index.d.ts +0 -4
- package/components/identity.tokens/operations/lib/index.js.map +0 -1
- package/components/identity.tokens/operations/lib/jose.d.ts +0 -1
- package/components/identity.tokens/operations/lib/jose.js.map +0 -1
- package/components/identity.tokens/operations/lib/key.d.ts +0 -1
- package/components/identity.tokens/operations/lib/key.js.map +0 -1
- package/components/identity.tokens/operations/lib/pad.d.ts +0 -1
- package/components/identity.tokens/operations/lib/pad.js.map +0 -1
- package/components/identity.tokens/operations/revoke.d.ts +0 -2
- package/components/identity.tokens/operations/revoke.js.map +0 -1
package/transpiled/Gateway.js
CHANGED
|
@@ -3,39 +3,73 @@ import { setTimeout } from 'node:timers/promises';
|
|
|
3
3
|
import { console } from 'openspan';
|
|
4
4
|
import { Connector } from '@toa.io/core';
|
|
5
5
|
import * as http from './HTTP/index.js';
|
|
6
|
+
import { MCP, RPC } from './const.js';
|
|
6
7
|
import { rethrow } from './exceptions.js';
|
|
7
8
|
import { decide } from './Branch.js';
|
|
8
9
|
export class Gateway extends Connector {
|
|
9
10
|
broadcast;
|
|
10
11
|
tree;
|
|
11
12
|
interceptor;
|
|
13
|
+
directives;
|
|
14
|
+
/** JSON-RPC is served only where the annotation asked for it. */
|
|
15
|
+
dispatcher;
|
|
16
|
+
/** And the same of MCP. */
|
|
17
|
+
mcp;
|
|
12
18
|
branches = new Map();
|
|
13
19
|
lastMerge = 0;
|
|
14
20
|
widestGap = 0;
|
|
15
21
|
lastPing = 0;
|
|
16
22
|
stopped = false;
|
|
17
23
|
resolveFirstMerge = null;
|
|
18
|
-
|
|
24
|
+
// eslint-disable-next-line max-params
|
|
25
|
+
constructor(broadcast, tree, interception, directives, dispatcher, mcp) {
|
|
19
26
|
super();
|
|
20
27
|
this.broadcast = broadcast;
|
|
21
28
|
this.tree = tree;
|
|
22
29
|
this.interceptor = interception;
|
|
30
|
+
this.directives = directives;
|
|
31
|
+
this.dispatcher = dispatcher;
|
|
32
|
+
this.mcp = mcp;
|
|
23
33
|
this.depends(broadcast);
|
|
24
34
|
}
|
|
25
35
|
async process(context) {
|
|
26
36
|
const interception = await context.timing.capture('intercept', this.interceptor.intercept(context));
|
|
27
37
|
if (interception !== null)
|
|
28
38
|
return interception;
|
|
39
|
+
// request-scoped, before anything is routed: this is where a credential is read
|
|
40
|
+
await context.timing.capture('preflight', this.directives.preflight(context)).catch(rethrow);
|
|
41
|
+
const response = await this.endpoint(context);
|
|
42
|
+
// request-scoped, on whatever is going back: this is where a credential is re-issued
|
|
43
|
+
await context.timing.capture('depart', this.directives.depart(context, response)).catch(rethrow);
|
|
44
|
+
return response;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* What answers the request: a pinned endpoint that makes calls of its own, or the route
|
|
48
|
+
* the path names.
|
|
49
|
+
*/
|
|
50
|
+
async endpoint(context) {
|
|
51
|
+
const route = async (call) => await this.route(call);
|
|
52
|
+
if (this.dispatcher !== null && context.url.pathname === RPC)
|
|
53
|
+
return await context.timing.capture('rpc', this.dispatcher.dispatch(context, route));
|
|
54
|
+
if (this.mcp !== null && context.url.pathname === MCP)
|
|
55
|
+
return await context.timing.capture('mcp', this.mcp.process(context, route));
|
|
56
|
+
return await this.route(context);
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* One call: everything that needs a node. A request makes one of these, and a request
|
|
60
|
+
* that carries several calls makes one per call.
|
|
61
|
+
*/
|
|
62
|
+
async route(context) {
|
|
29
63
|
const { node, parameters } = this.match(context);
|
|
30
64
|
if (context.request.method === 'OPTIONS')
|
|
31
|
-
return await this.explain(node, parameters);
|
|
65
|
+
return await this.explain(context, node, parameters);
|
|
32
66
|
let verb = context.request.method;
|
|
33
67
|
if (!(verb in node.methods) && verb === 'HEAD' && 'GET' in node.methods)
|
|
34
68
|
verb = 'GET';
|
|
35
69
|
if (!(verb in node.methods))
|
|
36
70
|
throw new http.MethodNotAllowed();
|
|
37
71
|
const method = node.methods[verb];
|
|
38
|
-
const interruption = await context.timing.capture('
|
|
72
|
+
const interruption = await context.timing.capture('precall', method.directives.precall(context, parameters)).catch(rethrow);
|
|
39
73
|
const response = interruption ??
|
|
40
74
|
await context.timing.capture('call', this.call(method, context, parameters));
|
|
41
75
|
await context.timing.capture('settle', method.directives.settle(context, response)).catch(rethrow);
|
|
@@ -43,7 +77,13 @@ export class Gateway extends Connector {
|
|
|
43
77
|
}
|
|
44
78
|
async open() {
|
|
45
79
|
await this.discover();
|
|
46
|
-
|
|
80
|
+
// what is served besides the tree, so that turning one on can be seen to have worked
|
|
81
|
+
const pinned = [];
|
|
82
|
+
if (this.dispatcher !== null)
|
|
83
|
+
pinned.push(RPC);
|
|
84
|
+
if (this.mcp !== null)
|
|
85
|
+
pinned.push(MCP);
|
|
86
|
+
console.info('Gateway started', { endpoints: pinned.length === 0 ? 'none' : pinned.join(' ') });
|
|
47
87
|
}
|
|
48
88
|
/**
|
|
49
89
|
* Both of these reach into components, and a dependency is torn down only once this has
|
|
@@ -87,11 +127,13 @@ export class Gateway extends Connector {
|
|
|
87
127
|
.call(context, parameters)
|
|
88
128
|
.catch(rethrow);
|
|
89
129
|
}
|
|
90
|
-
async explain(node, parameters) {
|
|
91
|
-
const body = await node.explain(parameters);
|
|
92
|
-
const
|
|
93
|
-
|
|
94
|
-
|
|
130
|
+
async explain(context, node, parameters) {
|
|
131
|
+
const body = await node.explain(context, parameters);
|
|
132
|
+
const verbs = Object.keys(body);
|
|
133
|
+
// what a caller may not use is not a resource to them, and describing it would be the leak
|
|
134
|
+
if (verbs.length === 0 && Object.keys(node.methods).length > 0)
|
|
135
|
+
throw new http.Forbidden();
|
|
136
|
+
return { body, headers: new Headers({ allow: verbs.join(', ') }) };
|
|
95
137
|
}
|
|
96
138
|
async discover() {
|
|
97
139
|
const first = new Promise((resolve) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Gateway.js","sourceRoot":"","sources":["../source/Gateway.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,aAAa,CAAA;AAChC,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAA;AAClC,OAAO,EAAiB,SAAS,EAAE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;AAC7B,MAAM,WAAW,GAAG,EAAE,CAAA;AACtB,MAAM,YAAY,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA;AACzC,MAAM,aAAa,GAAG,KAAK,CAAA"}
|
|
@@ -13,6 +13,12 @@ export declare class Context {
|
|
|
13
13
|
readonly encoder: Format | null;
|
|
14
14
|
readonly timing: Timing;
|
|
15
15
|
readonly debug: boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Whether this is a procedure a request made, rather than the request. What forks one
|
|
18
|
+
* says so, and a directive that answers differently to a procedure than to a request
|
|
19
|
+
* reads it here.
|
|
20
|
+
*/
|
|
21
|
+
readonly procedural: boolean;
|
|
16
22
|
readonly pipelines: Pipelines;
|
|
17
23
|
private consumed;
|
|
18
24
|
constructor(authority: string, request: IncomingMessage, properties: Properties, url: URL);
|
|
@@ -17,6 +17,12 @@ export class Context {
|
|
|
17
17
|
encoder = null;
|
|
18
18
|
timing;
|
|
19
19
|
debug;
|
|
20
|
+
/**
|
|
21
|
+
* Whether this is a procedure a request made, rather than the request. What forks one
|
|
22
|
+
* says so, and a directive that answers differently to a procedure than to a request
|
|
23
|
+
* reads it here.
|
|
24
|
+
*/
|
|
25
|
+
procedural = false;
|
|
20
26
|
pipelines = {
|
|
21
27
|
body: [],
|
|
22
28
|
response: []
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Context.js","sourceRoot":"","sources":["../../source/HTTP/Context.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,aAAa,CAAA;AAChC,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAA;AAC9C,OAAO,UAAU,MAAM,YAAY,CAAA;AACnC,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAA;AAClC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC,OAAO,EAAe,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAA;AAChE,OAAO,EAAE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S,CAAC,CAAA;IAExE,IAAI,UAAU,CAAC,IAAI,IAAI,gBAAgB;QACrC,UAAU,CAAC,KAAK,EAAE,CAAA;IAEpB,UAAU,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,IAAI,IAAI,CAAC,CAAA;IAEvC,OAAO,OAAO,CAAA;AAChB,CAAC;AAED,sEAAsE;AACtE,MAAM,IAAI,GAAG,MAAM,CAAC,gBAAgB,CAAsB,CAAA;AAC1D,MAAM,UAAU,GAAG,IAAI,GAAG,EAAkB,CAAA;AAC5C,MAAM,gBAAgB,GAAG,IAAI,CAAA;AAE7B,MAAM,OAAO,GAAG,4EAA4E,CAAA"}
|
|
@@ -2,7 +2,7 @@ import { Connector } from '@toa.io/core';
|
|
|
2
2
|
import { type OutgoingMessage } from './messages.js';
|
|
3
3
|
import { Context } from './Context.js';
|
|
4
4
|
import type { Protocol } from './types.js';
|
|
5
|
-
import type { Bouncer, OAuth } from '../Annotation.js';
|
|
5
|
+
import type { Bouncer, MCP, OAuth, RPC } from '../Annotation.js';
|
|
6
6
|
export declare class Server extends Connector {
|
|
7
7
|
private readonly server;
|
|
8
8
|
private readonly properties;
|
|
@@ -43,6 +43,10 @@ interface Properties {
|
|
|
43
43
|
bouncer?: Bouncer;
|
|
44
44
|
/** The authorization server this context exposes; none is exposed without it. */
|
|
45
45
|
oauth?: OAuth;
|
|
46
|
+
/** JSON-RPC at `/.rpc`; none is served without it. */
|
|
47
|
+
rpc?: RPC;
|
|
48
|
+
/** MCP at `/.mcp`; none is served without it. */
|
|
49
|
+
mcp?: MCP;
|
|
46
50
|
}
|
|
47
51
|
export type Options = {
|
|
48
52
|
authorities: Properties['authorities'];
|
|
@@ -20,7 +20,7 @@ export declare class NotFound extends ClientError {
|
|
|
20
20
|
constructor(body?: any);
|
|
21
21
|
}
|
|
22
22
|
export declare class MethodNotAllowed extends ClientError {
|
|
23
|
-
constructor();
|
|
23
|
+
constructor(headers?: Headers);
|
|
24
24
|
}
|
|
25
25
|
export declare class NotAcceptable extends ClientError {
|
|
26
26
|
constructor();
|
|
@@ -33,8 +33,8 @@ export class NotFound extends ClientError {
|
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
export class MethodNotAllowed extends ClientError {
|
|
36
|
-
constructor() {
|
|
37
|
-
super(405);
|
|
36
|
+
constructor(headers) {
|
|
37
|
+
super(405, undefined, headers);
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
export class NotAcceptable extends ClientError {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exceptions.js","sourceRoot":"","sources":["../../source/HTTP/exceptions.ts"],"names":[],"mappings":"AAAA,MAAM,OAAO,SAAU,SAAQ,KAAK;IAClB,MAAM,CAAQ;IACd,IAAI,CAAM;IAE1B,+EAA+E;IAC/D,OAAO,CAAU;IAEjC,YAAuB,MAAc,EAAE,IAAU,EAAE,OAAiB;QAClE,KAAK,EAAE,CAAA;QACP,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;QACpB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;QAChB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;IACxB,CAAC;CACF;AAED,MAAM,OAAO,WAAY,SAAQ,SAAS;CACzC;AAED,MAAM,OAAO,UAAW,SAAQ,WAAW;IACzC,YAAoB,IAAU;QAC5B,KAAK,CAAC,GAAG,EAAE,IAAI,CAAC,CAAA;IAClB,CAAC;CACF;AAED,MAAM,OAAO,YAAa,SAAQ,WAAW;IAC3C,YAAoB,IAAU;QAC5B,KAAK,CAAC,GAAG,EAAE,IAAI,CAAC,CAAA;IAClB,CAAC;CACF;AAED,MAAM,OAAO,SAAU,SAAQ,WAAW;IACxC,YAAoB,IAAU;QAC5B,KAAK,CAAC,GAAG,EAAE,IAAI,CAAC,CAAA;IAClB,CAAC;CACF;AAED,MAAM,OAAO,QAAS,SAAQ,WAAW;IACvC,YAAoB,IAAU;QAC5B,KAAK,CAAC,GAAG,EAAE,IAAI,CAAC,CAAA;IA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AAM,OAAO,QAAS,SAAQ,WAAW;IACvC,YAAoB,IAAU;QAC5B,KAAK,CAAC,GAAG,EAAE,IAAI,CAAC,CAAA;IAClB,CAAC;CACF;AAED,MAAM,OAAO,kBAAmB,SAAQ,WAAW;IACjD;QACE,KAAK,CAAC,GAAG,CAAC,CAAA;IACZ,CAAC;CACF;AAED,MAAM,OAAO,qBAAsB,SAAQ,WAAW;IACpD,YAAoB,IAAU;QAC5B,KAAK,CAAC,GAAG,EAAE,IAAI,CAAC,CAAA;IAClB,CAAC;CACF;AAED,MAAM,OAAO,oBAAqB,SAAQ,WAAW;IACnD;QACE,KAAK,CAAC,GAAG,CAAC,CAAA;IACZ,CAAC;CACF;AAED,MAAM,OAAO,mBAAoB,SAAQ,WAAW;IAClD,YAAoB,IAAU;QAC5B,KAAK,CAAC,GAAG,EAAE,IAAI,CAAC,CAAA;IAClB,CAAC;CACF;AAED,MAAM,OAAO,eAAgB,SAAQ,WAAW;IAC9C,gEAAgE;IAChE,YAAoB,KAAc;QAChC,KAAK,CAAC,GAAG,EAAE,SAAS,EAClB,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,OAAO,CAAC,EAAE,aAAa,EAAE,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAA;IACpF,CAAC;CACF;AAED,MAAM,OAAO,kBAAmB,SAAQ,SAAS;IAC/C,YAAoB,IAAU;QAC5B,KAAK,CAAC,GAAG,EAAE,IAAI,CAAC,CAAA;IAClB,CAAC;CACF"}
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { Readable } from 'node:stream';
|
|
2
2
|
import type { Context } from './Context.js';
|
|
3
3
|
import type { ServerResponse } from './types.js';
|
|
4
|
+
/**
|
|
5
|
+
* Applies what the request accumulated in `pipelines.response` — an `io:output` restriction,
|
|
6
|
+
* a `vary` a `map` directive owes. Separate from `write` because a message is not always
|
|
7
|
+
* written: one call of several produces a value the reply is assembled from.
|
|
8
|
+
*/
|
|
9
|
+
export declare function shape(context: Context, message: OutgoingMessage): Promise<void>;
|
|
4
10
|
export declare function write(context: Context, response: ServerResponse, message: OutgoingMessage): Promise<void>;
|
|
5
11
|
export declare function read(context: Context): Promise<any>;
|
|
6
12
|
/**
|
|
@@ -10,9 +10,17 @@ const server = `Exposition/${JSON.parse(readFileSync(new URL('../../package.json
|
|
|
10
10
|
((process.env.TOA_CONTEXT === undefined ? '' : ` ${process.env.TOA_CONTEXT}`) +
|
|
11
11
|
(process.env.TOA_ENV === undefined ? '' : `/${process.env.TOA_ENV}`));
|
|
12
12
|
const pending = new Map();
|
|
13
|
-
|
|
13
|
+
/**
|
|
14
|
+
* Applies what the request accumulated in `pipelines.response` — an `io:output` restriction,
|
|
15
|
+
* a `vary` a `map` directive owes. Separate from `write` because a message is not always
|
|
16
|
+
* written: one call of several produces a value the reply is assembled from.
|
|
17
|
+
*/
|
|
18
|
+
export async function shape(context, message) {
|
|
14
19
|
for (const transform of context.pipelines.response)
|
|
15
20
|
await transform(message);
|
|
21
|
+
}
|
|
22
|
+
export async function write(context, response, message) {
|
|
23
|
+
await shape(context, message);
|
|
16
24
|
if (message?.status !== undefined)
|
|
17
25
|
response.statusCode = message.status;
|
|
18
26
|
response.setHeader('server', server);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../source/HTTP/messages.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACxC,OAAO,KAAK,WAAW,MAAM,cAAc,CAAA;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAA;AAClC,OAAO,EAAe,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AA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,MAAM,GAAG,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,OAAO,CAAC,MAAM,EAAE,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAA;IAE1E,OAAO,CAAC,KAAK,CAAC,eAAe,EAAE,GAAG,CAAC,CAAA;IACnC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,EAAE,GAAG,CAAC,CAAA;IAE5B,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE;QACxB,OAAO,CAAC,KAAK,CAAC,eAAe,EAAE,GAAG,CAAC,CAAA;QACnC,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,CAAA;QAE1B,IAAI,OAAO,CAAC,IAAI,KAAK,CAAC,EAAE,CAAC;YACvB,IAAI,eAAe,KAAK,IAAI;gBAC1B,aAAa,CAAC,eAAe,CAAC,CAAA;YAEhC,eAAe,GAAG,IAAI,CAAA;QACxB,CAAC;IACH,CAAC,CAAC,CAAA;IAEF,IAAI,eAAe,KAAK,IAAI;QAC1B,eAAe,GAAG,WAAW,CAAC,GAAG,EAAE,CACjC,OAAO,CAAC,KAAK,CAAC,iBAAiB,EAAE,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC,EAC1D,sBAAsB,CAAC,CAAA;AAC3B,CAAC"}
|
|
@@ -1,9 +1,51 @@
|
|
|
1
1
|
import type { Remote } from '@toa.io/core';
|
|
2
2
|
export interface Introspection {
|
|
3
|
+
/**
|
|
4
|
+
* What the route states this method is. The operation states what it is too, and that is
|
|
5
|
+
* not this: an operation is written without knowledge of any route, and a method is an
|
|
6
|
+
* operation and a route together — the same operation mounted twice is two methods, and
|
|
7
|
+
* one sentence cannot be true of both. The operation's own is for the Introspection.
|
|
8
|
+
*/
|
|
9
|
+
description?: string;
|
|
10
|
+
/** what a person is shown where a client lists this method, which a name is not */
|
|
11
|
+
title?: string;
|
|
3
12
|
route?: Record<string, Schema>;
|
|
4
13
|
query?: Record<string, Schema>;
|
|
14
|
+
/** what a request header carries, which is therefore not the body's to send */
|
|
15
|
+
headers?: Record<string, Sourced>;
|
|
5
16
|
input?: Schema;
|
|
6
17
|
output?: Schema;
|
|
7
18
|
errors?: string[];
|
|
8
19
|
}
|
|
20
|
+
/** A property the gateway reads from somewhere else, and the schema it was declared with. */
|
|
21
|
+
export interface Sourced {
|
|
22
|
+
header: string;
|
|
23
|
+
[keyword: string]: unknown;
|
|
24
|
+
}
|
|
9
25
|
export type Schema = Awaited<ReturnType<Remote['explain']>>['input'];
|
|
26
|
+
/**
|
|
27
|
+
* The same, in the order the shape states — whatever order the families that filled it ran
|
|
28
|
+
* in. What a resource says about itself is read, so it is written the way it is documented.
|
|
29
|
+
*/
|
|
30
|
+
export declare function order(introspection: Introspection): Introspection;
|
|
31
|
+
/**
|
|
32
|
+
* The schema of one input property, taken out of it: a property another family fills is
|
|
33
|
+
* not the caller's to send, and what took it says where it comes from instead.
|
|
34
|
+
*/
|
|
35
|
+
export declare function take(carrier: Carrier, property: string): Schema | undefined;
|
|
36
|
+
/**
|
|
37
|
+
* A schema restricted to the properties a whitelist admits, and an array's items where it
|
|
38
|
+
* describes an array. What is not an object of properties is left alone: a whitelist has
|
|
39
|
+
* nothing to say about a string.
|
|
40
|
+
*/
|
|
41
|
+
export declare function restrict(schema: Schema | undefined, allowed: Set<string>): Schema | undefined;
|
|
42
|
+
/**
|
|
43
|
+
* What a schema is read as here: the keywords these narrow, and whatever else it carries.
|
|
44
|
+
* `Schema` as core declares it requires `properties`, which a schema of a string has not,
|
|
45
|
+
* so the two are cast through rather than assigned.
|
|
46
|
+
*/
|
|
47
|
+
/** Whatever states an input: an explanation as the operation gave it, or as a route left it. */
|
|
48
|
+
interface Carrier {
|
|
49
|
+
input?: Schema;
|
|
50
|
+
}
|
|
51
|
+
export {};
|
|
@@ -1,2 +1,51 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* The same, in the order the shape states — whatever order the families that filled it ran
|
|
3
|
+
* in. What a resource says about itself is read, so it is written the way it is documented.
|
|
4
|
+
*/
|
|
5
|
+
export function order(introspection) {
|
|
6
|
+
const ordered = {};
|
|
7
|
+
for (const key of KEYS)
|
|
8
|
+
if (introspection[key] !== undefined)
|
|
9
|
+
ordered[key] = introspection[key];
|
|
10
|
+
return ordered;
|
|
11
|
+
}
|
|
12
|
+
const KEYS = ['title', 'description', 'route', 'query', 'headers', 'input', 'output', 'errors'];
|
|
13
|
+
/**
|
|
14
|
+
* The schema of one input property, taken out of it: a property another family fills is
|
|
15
|
+
* not the caller's to send, and what took it says where it comes from instead.
|
|
16
|
+
*/
|
|
17
|
+
export function take(carrier, property) {
|
|
18
|
+
const input = carrier.input;
|
|
19
|
+
const properties = input?.properties;
|
|
20
|
+
if (input === undefined || input === null || properties === undefined ||
|
|
21
|
+
!(property in properties))
|
|
22
|
+
return undefined;
|
|
23
|
+
const schema = properties[property];
|
|
24
|
+
delete properties[property];
|
|
25
|
+
if (input.required !== undefined)
|
|
26
|
+
input.required = input.required.filter((name) => name !== property);
|
|
27
|
+
return schema;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* A schema restricted to the properties a whitelist admits, and an array's items where it
|
|
31
|
+
* describes an array. What is not an object of properties is left alone: a whitelist has
|
|
32
|
+
* nothing to say about a string.
|
|
33
|
+
*/
|
|
34
|
+
export function restrict(schema, allowed) {
|
|
35
|
+
const shape = schema;
|
|
36
|
+
if (shape === undefined || shape === null)
|
|
37
|
+
return schema;
|
|
38
|
+
if (shape.items !== undefined)
|
|
39
|
+
return { ...shape, items: restrict(shape.items, allowed) };
|
|
40
|
+
if (shape.properties === undefined)
|
|
41
|
+
return schema;
|
|
42
|
+
const properties = {};
|
|
43
|
+
for (const [name, property] of Object.entries(shape.properties))
|
|
44
|
+
if (allowed.has(name))
|
|
45
|
+
properties[name] = property;
|
|
46
|
+
const restricted = { ...shape, properties };
|
|
47
|
+
if (shape.required !== undefined)
|
|
48
|
+
restricted.required = shape.required.filter((name) => allowed.has(name));
|
|
49
|
+
return restricted;
|
|
50
|
+
}
|
|
2
51
|
//# sourceMappingURL=Introspection.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Introspection.js","sourceRoot":"","sources":["../source/Introspection.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"Introspection.js","sourceRoot":"","sources":["../source/Introspection.ts"],"names":[],"mappings":"AA+BA;;;GAGG;AACH,MAAM,UAAU,KAAK,CAAE,aAA4B;IACjD,MAAM,OAAO,GAAkB,EAAE,CAAA;IAEjC,KAAK,MAAM,GAAG,IAAI,IAAI;QACpB,IAAI,aAAa,CAAC,GAAG,CAAC,KAAK,SAAS;YACjC,OAAO,CAAC,GAAG,CAAa,GAAG,aAAa,CAAC,GAAG,CAAC,CAAA;IAElD,OAAO,OAAO,CAAA;AAChB,CAAC;AAED,MAAM,IAAI,GAAG,CAAC,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,CAAU,CAAA;AAExG;;;GAGG;AACH,MAAM,UAAU,IAAI,CAAE,OAAgB,EAAE,QAAgB;IACtD,MAAM,KAAK,GAAG,OAAO,CAAC,KAAiC,CAAA;IACvD,MAAM,UAAU,GAAG,KAAK,EAAE,UAAU,CAAA;IAEpC,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,IAAI,UAAU,KAAK,SAAS;QACnE,CAAC,CAAC,QAAQ,IAAI,UAAU,CAAC;QACzB,OAAO,SAAS,CAAA;IAElB,MAAM,MAAM,GAAG,UAAU,CAAC,QAAQ,CAAC,CAAA;IAEnC,OAAO,UAAU,CAAC,QAAQ,CAAC,CAAA;IAE3B,IAAI,KAAK,CAAC,QAAQ,KAAK,SAAS;QAC9B,KAAK,CAAC,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAA;IAErE,OAAO,MAAM,CAAA;AACf,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,QAAQ,CAAE,MAA0B,EAAE,OAAoB;IACxE,MAAM,KAAK,GAAG,MAAkC,CAAA;IAEhD,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI;QACvC,OAAO,MAAM,CAAA;IAEf,IAAI,KAAK,CAAC,KAAK,KAAK,SAAS;QAC3B,OAAO,EAAE,GAAG,KAAK,EAAE,KAAK,EAAE,QAAQ,CAAC,KAAK,CAAC,KAAK,EAAE,OAAO,CAAC,EAAuB,CAAA;IAEjF,IAAI,KAAK,CAAC,UAAU,KAAK,SAAS;QAChC,OAAO,MAAM,CAAA;IAEf,MAAM,UAAU,GAA2B,EAAE,CAAA;IAE7C,KAAK,MAAM,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC;QAC7D,IAAI,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC;YACnB,UAAU,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAA;IAE/B,MAAM,UAAU,GAAU,EAAE,GAAG,KAAK,EAAE,UAAU,EAAE,CAAA;IAElD,IAAI,KAAK,CAAC,QAAQ,KAAK,SAAS;QAC9B,UAAU,CAAC,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAA;IAE1E,OAAO,UAA+B,CAAA;AACxC,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import * as http from '../HTTP/index.js';
|
|
2
|
+
import type { Tree } from '../RTD/index.js';
|
|
3
|
+
import type { MCP } from '../Annotation.js';
|
|
4
|
+
/**
|
|
5
|
+
* The Model Context Protocol, as one endpoint that remembers nothing between requests.
|
|
6
|
+
*
|
|
7
|
+
* Two revisions are answered from it. The modern one carries the version and the client's
|
|
8
|
+
* capabilities in every request; the one before it opens with `initialize`, which is what
|
|
9
|
+
* most clients still send. Neither needs a session, and neither needs a stream: every method
|
|
10
|
+
* here answers one object, which is why this can exist in a package that serves no SSE.
|
|
11
|
+
*/
|
|
12
|
+
export declare class Server {
|
|
13
|
+
private readonly options;
|
|
14
|
+
private readonly tree;
|
|
15
|
+
private readonly discovery;
|
|
16
|
+
private readonly origins;
|
|
17
|
+
constructor(options: MCP, tree: Tree);
|
|
18
|
+
process(context: http.Context, route: http.Processor): Promise<http.OutgoingMessage>;
|
|
19
|
+
/** Who may reach the endpoint at all, before anything it carries is read. */
|
|
20
|
+
private admit;
|
|
21
|
+
private answer;
|
|
22
|
+
private tool;
|
|
23
|
+
/**
|
|
24
|
+
* Every result of the modern revision says what kind it is, and who answered it. Where the
|
|
25
|
+
* revision names the operation as one whose result may be held, it says that too, and must.
|
|
26
|
+
*/
|
|
27
|
+
private complete;
|
|
28
|
+
private serverInfo;
|
|
29
|
+
/**
|
|
30
|
+
* Which revision this request is of. `initialize` is one by itself; otherwise the header
|
|
31
|
+
* says, and a request that names none is of a revision that did not send one.
|
|
32
|
+
*/
|
|
33
|
+
private version;
|
|
34
|
+
/**
|
|
35
|
+
* What the modern revision mirrors into headers, so that what routes a request and what
|
|
36
|
+
* answers it cannot be told two different things.
|
|
37
|
+
*/
|
|
38
|
+
private mirrored;
|
|
39
|
+
/** A body the decoder refuses is a parse error; a media type it does not know is not. */
|
|
40
|
+
private read;
|
|
41
|
+
}
|