@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
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/** The revision this endpoint serves, where a request carries its own metadata. */
|
|
2
|
+
export declare const MODERN = "2026-07-28";
|
|
3
|
+
/** The newest revision reached by an `initialize` handshake, which is what clients still send. */
|
|
4
|
+
export declare const LEGACY = "2025-11-25";
|
|
5
|
+
export declare const VERSIONS: string[];
|
|
6
|
+
/** The version every JSON-RPC message states, which is not the protocol's. */
|
|
7
|
+
export declare const JSONRPC = "2.0";
|
|
8
|
+
/** The prefix the revision reserves for itself in `_meta`. */
|
|
9
|
+
export declare const RESERVED = "io.modelcontextprotocol/";
|
|
10
|
+
export declare const PROTOCOL_VERSION: string;
|
|
11
|
+
export declare const CLIENT_CAPABILITIES: string;
|
|
12
|
+
export declare const SERVER_INFO: string;
|
|
13
|
+
export type Params = Record<string, unknown>;
|
|
14
|
+
export interface Message {
|
|
15
|
+
jsonrpc: string;
|
|
16
|
+
method: string;
|
|
17
|
+
params?: Params;
|
|
18
|
+
/** Absent makes this a notification, which is answered by not answering. */
|
|
19
|
+
id?: string | number;
|
|
20
|
+
}
|
|
21
|
+
export interface Failure {
|
|
22
|
+
code: number;
|
|
23
|
+
message: string;
|
|
24
|
+
data?: unknown;
|
|
25
|
+
}
|
|
26
|
+
export interface Response {
|
|
27
|
+
jsonrpc: string;
|
|
28
|
+
id: string | number | null;
|
|
29
|
+
result?: unknown;
|
|
30
|
+
error?: Failure;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* How long a complete result may be held, and by whom. `private` is a result that is the
|
|
34
|
+
* caller's alone — a list `auth` filtered for their identity is not another caller's list.
|
|
35
|
+
*/
|
|
36
|
+
export interface Cache {
|
|
37
|
+
ttlMs: number;
|
|
38
|
+
cacheScope: 'public' | 'private';
|
|
39
|
+
}
|
|
40
|
+
/** What a tool answers with: what a model reads, and the reply itself. */
|
|
41
|
+
export interface Result {
|
|
42
|
+
content: Content[];
|
|
43
|
+
structuredContent?: unknown;
|
|
44
|
+
/** The operation refused, which is something a model can read and correct. */
|
|
45
|
+
isError?: boolean;
|
|
46
|
+
}
|
|
47
|
+
export interface Content {
|
|
48
|
+
type: 'text';
|
|
49
|
+
text: string;
|
|
50
|
+
}
|
|
51
|
+
export interface Tool {
|
|
52
|
+
name: string;
|
|
53
|
+
/** what a person is shown where a client lists this tool; a name is an address */
|
|
54
|
+
title?: string;
|
|
55
|
+
/** what the route states this method is */
|
|
56
|
+
description?: string;
|
|
57
|
+
inputSchema: object;
|
|
58
|
+
outputSchema?: object;
|
|
59
|
+
annotations?: Annotations;
|
|
60
|
+
}
|
|
61
|
+
/** What the verb says about the call, which the revision asks a client to treat as a hint. */
|
|
62
|
+
export interface Annotations {
|
|
63
|
+
readOnlyHint?: boolean;
|
|
64
|
+
destructiveHint?: boolean;
|
|
65
|
+
idempotentHint?: boolean;
|
|
66
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** The revision this endpoint serves, where a request carries its own metadata. */
|
|
2
|
+
export const MODERN = '2026-07-28';
|
|
3
|
+
/** The newest revision reached by an `initialize` handshake, which is what clients still send. */
|
|
4
|
+
export const LEGACY = '2025-11-25';
|
|
5
|
+
export const VERSIONS = [MODERN, LEGACY];
|
|
6
|
+
/** The version every JSON-RPC message states, which is not the protocol's. */
|
|
7
|
+
export const JSONRPC = '2.0';
|
|
8
|
+
/** The prefix the revision reserves for itself in `_meta`. */
|
|
9
|
+
export const RESERVED = 'io.modelcontextprotocol/';
|
|
10
|
+
export const PROTOCOL_VERSION = RESERVED + 'protocolVersion';
|
|
11
|
+
export const CLIENT_CAPABILITIES = RESERVED + 'clientCapabilities';
|
|
12
|
+
export const SERVER_INFO = RESERVED + 'serverInfo';
|
|
13
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../source/MCP/types.ts"],"names":[],"mappings":"AAAA,mFAAmF;AACnF,MAAM,CAAC,MAAM,MAAM,GAAG,YAAY,CAAA;AAElC,kGAAkG;AAClG,MAAM,CAAC,MAAM,MAAM,GAAG,YAAY,CAAA;AAElC,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;AAExC,8EAA8E;AAC9E,MAAM,CAAC,MAAM,OAAO,GAAG,KAAK,CAAA;AAE5B,8DAA8D;AAC9D,MAAM,CAAC,MAAM,QAAQ,GAAG,0BAA0B,CAAA;AAElD,MAAM,CAAC,MAAM,gBAAgB,GAAG,QAAQ,GAAG,iBAAiB,CAAA;AAC5D,MAAM,CAAC,MAAM,mBAAmB,GAAG,QAAQ,GAAG,oBAAoB,CAAA;AAClE,MAAM,CAAC,MAAM,WAAW,GAAG,QAAQ,GAAG,YAAY,CAAA"}
|
package/transpiled/Query.d.ts
CHANGED
|
@@ -12,6 +12,13 @@ export declare class Query {
|
|
|
12
12
|
private readonly searchable;
|
|
13
13
|
constructor(query: syntax.Query);
|
|
14
14
|
fit(query: http.Query, parameters: Parameter[]): QueryString;
|
|
15
|
+
/**
|
|
16
|
+
* What the querystring carries: the parameters this method declares, taken out of the
|
|
17
|
+
* input because they are not the body's, and what a queryable method accepts besides.
|
|
18
|
+
*
|
|
19
|
+
* Only what it actually accepts — a criteria the declaration closes is refused, and so is
|
|
20
|
+
* a search where none was asked for.
|
|
21
|
+
*/
|
|
15
22
|
explain(introspection: Introspection): Record<string, Schema> | null;
|
|
16
23
|
private split;
|
|
17
24
|
private fitCriteria;
|
package/transpiled/Query.js
CHANGED
|
@@ -3,6 +3,7 @@ import { quote } from '@toa.io/generic';
|
|
|
3
3
|
import * as http from './HTTP/index.js';
|
|
4
4
|
import * as schemas from './schemas.js';
|
|
5
5
|
import { queryable } from './Mapping.js';
|
|
6
|
+
import { take } from './Introspection.js';
|
|
6
7
|
export class Query {
|
|
7
8
|
parameterized;
|
|
8
9
|
query;
|
|
@@ -49,18 +50,34 @@ export class Query {
|
|
|
49
50
|
parameters: qs.parameters
|
|
50
51
|
};
|
|
51
52
|
}
|
|
53
|
+
/**
|
|
54
|
+
* What the querystring carries: the parameters this method declares, taken out of the
|
|
55
|
+
* input because they are not the body's, and what a queryable method accepts besides.
|
|
56
|
+
*
|
|
57
|
+
* Only what it actually accepts — a criteria the declaration closes is refused, and so is
|
|
58
|
+
* a search where none was asked for.
|
|
59
|
+
*/
|
|
52
60
|
explain(introspection) {
|
|
53
|
-
if (this.query?.parameters === undefined || introspection.input?.type !== 'object')
|
|
54
|
-
return null;
|
|
55
61
|
let query = null;
|
|
56
|
-
|
|
57
|
-
const
|
|
58
|
-
|
|
62
|
+
if (this.query?.parameters !== undefined)
|
|
63
|
+
for (const parameter of this.query.parameters) {
|
|
64
|
+
const schema = take(introspection, parameter);
|
|
65
|
+
// eslint-disable-next-line max-depth
|
|
66
|
+
if (schema === undefined)
|
|
67
|
+
continue;
|
|
59
68
|
query ??= {};
|
|
60
69
|
query[parameter] = schema;
|
|
61
70
|
}
|
|
62
|
-
|
|
63
|
-
|
|
71
|
+
if (!this.queryable)
|
|
72
|
+
return query;
|
|
73
|
+
query ??= {};
|
|
74
|
+
if (!this.closed)
|
|
75
|
+
query.criteria = keyword('string', 'What to match, in RSQL: `state==hot`, `rank=gt=5;name==*tea*`.');
|
|
76
|
+
query.sort = keyword('string', 'What to order by: `rank:desc`, or `rank` for ascending.');
|
|
77
|
+
query.limit = bounded('How many at once.', this.query.limit);
|
|
78
|
+
query.omit = bounded('How many to skip.', this.query.omit);
|
|
79
|
+
if (this.searchable)
|
|
80
|
+
query.search = keyword('string', 'What to search the text index for.');
|
|
64
81
|
return query;
|
|
65
82
|
}
|
|
66
83
|
split(query) {
|
|
@@ -141,4 +158,18 @@ function fit(string, range, name) {
|
|
|
141
158
|
return number;
|
|
142
159
|
}
|
|
143
160
|
const WHATEVER = ';';
|
|
161
|
+
function keyword(type, description) {
|
|
162
|
+
return { type, description };
|
|
163
|
+
}
|
|
164
|
+
function bounded(description, bounds) {
|
|
165
|
+
const schema = {
|
|
166
|
+
type: 'integer',
|
|
167
|
+
description,
|
|
168
|
+
minimum: bounds.range[0],
|
|
169
|
+
maximum: bounds.range[1]
|
|
170
|
+
};
|
|
171
|
+
if (bounds.value !== undefined)
|
|
172
|
+
schema.default = bounds.value;
|
|
173
|
+
return schema;
|
|
174
|
+
}
|
|
144
175
|
//# sourceMappingURL=Query.js.map
|
package/transpiled/Query.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Query.js","sourceRoot":"","sources":["../source/Query.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,aAAa,CAAA;AAChC,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AACvC,OAAO,KAAK,IAAI,MAAM,iBAAiB,CAAA;AAEvC,OAAO,KAAK,OAAO,MAAM,cAAc,CAAA;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;
|
|
1
|
+
{"version":3,"file":"Query.js","sourceRoot":"","sources":["../source/Query.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,aAAa,CAAA;AAChC,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AACvC,OAAO,KAAK,IAAI,MAAM,iBAAiB,CAAA;AAEvC,OAAO,KAAK,OAAO,MAAM,cAAc,CAAA;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AACxC,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAA;AAKzC,MAAM,OAAO,KAAK;IACA,aAAa,CAAS;IAErB,KAAK,CAAc;IACnB,MAAM,GAAY,KAAK,CAAA;IACvB,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AAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;KACzB,CAAA;IAED,IAAI,MAAM,CAAC,KAAK,KAAK,SAAS;QAC5B,MAAM,CAAC,OAAO,GAAG,MAAM,CAAC,KAAK,CAAA;IAE/B,OAAO,MAA2B,CAAA;AACpC,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as http from '../HTTP/index.js';
|
|
2
|
+
import type { Params } from './types.js';
|
|
3
|
+
/**
|
|
4
|
+
* One call, as a request the rest of the gateway can serve.
|
|
5
|
+
*
|
|
6
|
+
* The clone is the transport context except for what the call decides, so nothing
|
|
7
|
+
* downstream — the router, the directives, the endpoint, the mapping — knows it is one.
|
|
8
|
+
* It is derived from the context rather than built beside it, so everything not named
|
|
9
|
+
* here, `identity` included, is read through.
|
|
10
|
+
*/
|
|
11
|
+
export declare function fork(context: http.Context, path: string, verb: string, query: Params | undefined, input: unknown): http.Context;
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import * as http from '../HTTP/index.js';
|
|
2
|
+
import { Timing } from '../HTTP/Timing.js';
|
|
3
|
+
/**
|
|
4
|
+
* One call, as a request the rest of the gateway can serve.
|
|
5
|
+
*
|
|
6
|
+
* The clone is the transport context except for what the call decides, so nothing
|
|
7
|
+
* downstream — the router, the directives, the endpoint, the mapping — knows it is one.
|
|
8
|
+
* It is derived from the context rather than built beside it, so everything not named
|
|
9
|
+
* here, `identity` included, is read through.
|
|
10
|
+
*/
|
|
11
|
+
// eslint-disable-next-line max-params
|
|
12
|
+
export function fork(context, path, verb, query, input) {
|
|
13
|
+
const url = new URL(path, context.url);
|
|
14
|
+
if (query !== undefined)
|
|
15
|
+
for (const [name, value] of Object.entries(query))
|
|
16
|
+
url.searchParams.set(name, String(value));
|
|
17
|
+
const headers = { ...context.request.headers };
|
|
18
|
+
// a conditional is the envelope's, and a call would answer 304 to a question nobody asked
|
|
19
|
+
delete headers['if-match'];
|
|
20
|
+
delete headers['if-none-match'];
|
|
21
|
+
const request = Object.create(context.request, {
|
|
22
|
+
method: { value: verb, enumerable: true },
|
|
23
|
+
headers: { value: headers, enumerable: true }
|
|
24
|
+
});
|
|
25
|
+
// its own, so an `io:output` restriction shapes this call's reply and no other
|
|
26
|
+
const pipelines = { body: [], response: [] };
|
|
27
|
+
return Object.create(context, {
|
|
28
|
+
/*
|
|
29
|
+
* A credential refuses an `anonymous` route because it would make the reply
|
|
30
|
+
* uncacheable. What a procedure answers is not a reply: it is a value in an envelope
|
|
31
|
+
* this gateway answers `no-store`, and the procedure's own headers are discarded.
|
|
32
|
+
*/
|
|
33
|
+
procedural: { value: true, enumerable: true },
|
|
34
|
+
url: { value: url, enumerable: true },
|
|
35
|
+
request: { value: request, enumerable: true },
|
|
36
|
+
pipelines: { value: pipelines, enumerable: true },
|
|
37
|
+
/*
|
|
38
|
+
* Its own, so that what the stages of a call take is measured per call and stays there.
|
|
39
|
+
* `server-timing` is a header, and a request carrying thirty-two calls would otherwise
|
|
40
|
+
* write ninety-six values into one — where a trace says the same thing, per call.
|
|
41
|
+
*/
|
|
42
|
+
timing: { value: new Timing(), enumerable: true },
|
|
43
|
+
body: {
|
|
44
|
+
value: async () => {
|
|
45
|
+
let value = input;
|
|
46
|
+
for (const transform of pipelines.body)
|
|
47
|
+
value = await transform(value);
|
|
48
|
+
return value;
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
/*
|
|
52
|
+
* The raw request is the envelope, and it has been read. `map:buffer` is the one
|
|
53
|
+
* directive that asks for it, and answering with a spent stream would hand the
|
|
54
|
+
* operation an empty string; refusing says what is actually the matter.
|
|
55
|
+
*/
|
|
56
|
+
buffer: {
|
|
57
|
+
value: () => {
|
|
58
|
+
throw new http.BadRequest('`map:buffer` reads the request, which a call is not');
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=Context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Context.js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EAAE,EAAE,KAAK,EAAE,GAAG,EAAE,UAAU,EAAE,IAAI,EAAE;QACrC,OAAO,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE;QAC7C,SAAS,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,IAAI,EAAE;QACjD;;;;WAIG;QACH,MAAM,EAAE,EAAE,KAAK,EAAE,IAAI,MAAM,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE;QACjD,IAAI,EAAE;YACJ,KAAK,EAAE,KAAK,IAAI,EAAE;gBAChB,IAAI,KAAK,GAAG,KAAK,CAAA;gBAEjB,KAAK,MAAM,SAAS,IAAI,SAAS,CAAC,IAAI;oBACpC,KAAK,GAAG,MAAM,SAAS,CAAC,KAAK,CAAC,CAAA;gBAEhC,OAAO,KAAK,CAAA;YACd,CAAC;SACF;QACD;;;;WAIG;QACH,MAAM,EAAE;YACN,KAAK,EAAE,GAAG,EAAE;gBACV,MAAM,IAAI,IAAI,CAAC,UAAU,CAAC,qDAAqD,CAAC,CAAA;YAClF,CAAC;SACF;KACF,CAAiB,CAAA;AACpB,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as http from '../HTTP/index.js';
|
|
2
|
+
import type { RPC } from '../Annotation.js';
|
|
3
|
+
/**
|
|
4
|
+
* JSON-RPC, as the calls a request carries.
|
|
5
|
+
*
|
|
6
|
+
* It clones the context per call and hands each clone back to the gateway: it holds no
|
|
7
|
+
* tree, no index and no knowledge of routing. Whether a name resolves, what it resolves
|
|
8
|
+
* to, and what the directives of that route do are answered by the same `route` an
|
|
9
|
+
* ordinary request goes through.
|
|
10
|
+
*/
|
|
11
|
+
export declare class Dispatcher {
|
|
12
|
+
private readonly batch;
|
|
13
|
+
constructor(options: RPC);
|
|
14
|
+
dispatch(context: http.Context, route: http.Processor): Promise<http.OutgoingMessage>;
|
|
15
|
+
private answer;
|
|
16
|
+
private call;
|
|
17
|
+
/** A body the decoder refuses is a parse error; a media type it does not know is not. */
|
|
18
|
+
private read;
|
|
19
|
+
}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { console } from 'openspan';
|
|
2
|
+
import * as http from '../HTTP/index.js';
|
|
3
|
+
import * as schemas from '../schemas.js';
|
|
4
|
+
import { BATCH } from '../const.js';
|
|
5
|
+
import { address, split } from './names.js';
|
|
6
|
+
import { fork } from './Context.js';
|
|
7
|
+
import { BATCH_TOO_LARGE, INVALID_REQUEST, PARSE, failure, of, response } from './errors.js';
|
|
8
|
+
import { VERSION } from './types.js';
|
|
9
|
+
/**
|
|
10
|
+
* JSON-RPC, as the calls a request carries.
|
|
11
|
+
*
|
|
12
|
+
* It clones the context per call and hands each clone back to the gateway: it holds no
|
|
13
|
+
* tree, no index and no knowledge of routing. Whether a name resolves, what it resolves
|
|
14
|
+
* to, and what the directives of that route do are answered by the same `route` an
|
|
15
|
+
* ordinary request goes through.
|
|
16
|
+
*/
|
|
17
|
+
export class Dispatcher {
|
|
18
|
+
batch;
|
|
19
|
+
constructor(options) {
|
|
20
|
+
this.batch = options.batch ?? BATCH;
|
|
21
|
+
}
|
|
22
|
+
async dispatch(context, route) {
|
|
23
|
+
if (context.request.method !== 'POST')
|
|
24
|
+
throw new http.MethodNotAllowed(new Headers({ allow: 'POST' }));
|
|
25
|
+
const envelope = await this.read(context);
|
|
26
|
+
const batched = Array.isArray(envelope);
|
|
27
|
+
const calls = batched ? envelope : [envelope];
|
|
28
|
+
if (calls.length === 0)
|
|
29
|
+
throw new http.BadRequest(response(null, failure(INVALID_REQUEST, 'A request carries at least one call')));
|
|
30
|
+
if (calls.length > this.batch)
|
|
31
|
+
throw new http.BadRequest(response(null, failure(BATCH_TOO_LARGE, `A request carries at most ${this.batch} calls`)));
|
|
32
|
+
const answers = [];
|
|
33
|
+
// one after another: a request the caller writes should not become a fan-out they own
|
|
34
|
+
for (const call of calls) {
|
|
35
|
+
const answer = await this.answer(call, context, route);
|
|
36
|
+
if (answer !== null)
|
|
37
|
+
answers.push(answer);
|
|
38
|
+
}
|
|
39
|
+
// every call was a notification, and a notification is answered by not answering
|
|
40
|
+
if (answers.length === 0)
|
|
41
|
+
return { status: NO_CONTENT };
|
|
42
|
+
// a reply assembled from several is not one of them, and is not stored as if it were
|
|
43
|
+
return {
|
|
44
|
+
status: OK,
|
|
45
|
+
body: batched ? answers : answers[0],
|
|
46
|
+
headers: new Headers({ 'cache-control': 'no-store' })
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
async answer(input, context, route) {
|
|
50
|
+
const invalid = schemas.call.fit(input);
|
|
51
|
+
// it may have carried an id, but nothing about it is trustworthy enough to answer to
|
|
52
|
+
if (invalid !== null)
|
|
53
|
+
return response(null, failure(INVALID_REQUEST, invalid.message));
|
|
54
|
+
return await this.call(input, context, route);
|
|
55
|
+
}
|
|
56
|
+
async call(call, context, route) {
|
|
57
|
+
const notification = call.id === undefined;
|
|
58
|
+
try {
|
|
59
|
+
const params = call.params ?? {};
|
|
60
|
+
const { path, verb, variables } = address(call.method, params);
|
|
61
|
+
const { query, input } = split(params, variables);
|
|
62
|
+
const clone = fork(context, path, verb, query, input);
|
|
63
|
+
// one span per call, so what the directives of that call open has somewhere to hang
|
|
64
|
+
const message = await console.span({ name: call.method, attributes: { id: call.id } }, async () => await route(clone));
|
|
65
|
+
// what `io:output` restricts, over this call's reply rather than the envelope
|
|
66
|
+
await http.shape(clone, message);
|
|
67
|
+
if (notification)
|
|
68
|
+
return null;
|
|
69
|
+
return { jsonrpc: VERSION, id: call.id, result: message.body ?? null };
|
|
70
|
+
}
|
|
71
|
+
catch (exception) {
|
|
72
|
+
/*
|
|
73
|
+
* A credential belongs to the request. Refusing one call for it would leave the
|
|
74
|
+
* reply a 200, and the challenge that tells a client where to authenticate is
|
|
75
|
+
* attached to a 401 — so the whole envelope is refused instead.
|
|
76
|
+
*/
|
|
77
|
+
if (exception instanceof http.Unauthorized)
|
|
78
|
+
throw exception;
|
|
79
|
+
if (notification) {
|
|
80
|
+
console.debug('Notification failed', { method: call.method, error: of(exception) });
|
|
81
|
+
return null;
|
|
82
|
+
}
|
|
83
|
+
return { jsonrpc: VERSION, id: call.id, error: of(exception) };
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
/** A body the decoder refuses is a parse error; a media type it does not know is not. */
|
|
87
|
+
async read(context) {
|
|
88
|
+
try {
|
|
89
|
+
return await context.body();
|
|
90
|
+
}
|
|
91
|
+
catch (exception) {
|
|
92
|
+
if (exception instanceof http.BadRequest)
|
|
93
|
+
throw new http.BadRequest(response(null, failure(PARSE, 'Parse error')));
|
|
94
|
+
throw exception;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
const OK = 200;
|
|
99
|
+
const NO_CONTENT = 204;
|
|
100
|
+
//# sourceMappingURL=Dispatcher.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Dispatcher.js","sourceRoot":"","sources":["../../source/RPC/Dispatcher.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAA;AAClC,OAAO,KAAK,IAAI,MAAM,kBAAkB,CAAA;AACxC,OAAO,KAAK,OAAO,MAAM,eAAe,CAAA;AACxC,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAA;AACnC,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAC3C,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAA;AACnC,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAC5F,OAAO,EAAE,OAAO,EAA4B,MAAM,YAAY,CAAA;AAG9D;;;;;;;GAOG;AACH,MAAM,OAAO,UAAU;IACJ,KAAK,CAAQ;IAE9B,YAAoB,OAAY;QAC9B,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,IAAI,KA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CAAA;QACjB,CAAC;IACH,CAAC;CACF;AAED,MAAM,EAAE,GAAG,GAAG,CAAA;AACd,MAAM,UAAU,GAAG,GAAG,CAAA"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type Failure, type Response } from './types.js';
|
|
2
|
+
export declare const PARSE = -32700;
|
|
3
|
+
export declare const INVALID_REQUEST = -32600;
|
|
4
|
+
export declare const METHOD_NOT_FOUND = -32601;
|
|
5
|
+
export declare const INVALID_PARAMS = -32602;
|
|
6
|
+
export declare const INTERNAL = -32603;
|
|
7
|
+
export declare const FORBIDDEN = -32000;
|
|
8
|
+
export declare const REFUSED = -32001;
|
|
9
|
+
export declare const BATCH_TOO_LARGE = -32002;
|
|
10
|
+
export declare function failure(code: number, message: string, data?: unknown): Failure;
|
|
11
|
+
export declare function response(id: string | number | null, error: Failure): Response;
|
|
12
|
+
/**
|
|
13
|
+
* What an exception says as a JSON-RPC error.
|
|
14
|
+
*
|
|
15
|
+
* The readable text is `body`, never `message`: `http.Exception` calls `super()` with no
|
|
16
|
+
* argument, so every one of them carries an empty `message`.
|
|
17
|
+
*/
|
|
18
|
+
export declare function of(exception: unknown): Failure;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import * as http from '../HTTP/index.js';
|
|
2
|
+
import { VERSION } from './types.js';
|
|
3
|
+
/*
|
|
4
|
+
* The five the specification fixes (JSON-RPC 2.0 §5.1). A client reads these the same
|
|
5
|
+
* whoever answers.
|
|
6
|
+
*/
|
|
7
|
+
export const PARSE = -32700;
|
|
8
|
+
export const INVALID_REQUEST = -32600;
|
|
9
|
+
export const METHOD_NOT_FOUND = -32601;
|
|
10
|
+
export const INVALID_PARAMS = -32602;
|
|
11
|
+
export const INTERNAL = -32603;
|
|
12
|
+
/*
|
|
13
|
+
* Ours. The specification reserves -32000 to -32099 for implementation-defined server
|
|
14
|
+
* errors and defines nothing in it, so these mean nothing outside Toa — which is why
|
|
15
|
+
* `REFUSED` carries the operation's own code in `data`.
|
|
16
|
+
*/
|
|
17
|
+
export const FORBIDDEN = -32000;
|
|
18
|
+
export const REFUSED = -32001;
|
|
19
|
+
export const BATCH_TOO_LARGE = -32002;
|
|
20
|
+
export function failure(code, message, data) {
|
|
21
|
+
const value = { code, message };
|
|
22
|
+
if (data !== undefined)
|
|
23
|
+
value.data = data;
|
|
24
|
+
return value;
|
|
25
|
+
}
|
|
26
|
+
export function response(id, error) {
|
|
27
|
+
return { jsonrpc: VERSION, id, error };
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* What an exception says as a JSON-RPC error.
|
|
31
|
+
*
|
|
32
|
+
* The readable text is `body`, never `message`: `http.Exception` calls `super()` with no
|
|
33
|
+
* argument, so every one of them carries an empty `message`.
|
|
34
|
+
*/
|
|
35
|
+
export function of(exception) {
|
|
36
|
+
if (exception instanceof http.UnprocessableEntity)
|
|
37
|
+
return refusal(exception);
|
|
38
|
+
if (exception instanceof http.NotFound || exception instanceof http.MethodNotAllowed)
|
|
39
|
+
return failure(METHOD_NOT_FOUND, text(exception, 'Method not found'));
|
|
40
|
+
if (exception instanceof http.Forbidden)
|
|
41
|
+
return failure(FORBIDDEN, text(exception, 'Forbidden'));
|
|
42
|
+
if (exception instanceof http.BadRequest)
|
|
43
|
+
return failure(INVALID_PARAMS, text(exception, 'Invalid params'));
|
|
44
|
+
// a conflict, a precondition, a throttle: the call was refused, and by what is worth saying
|
|
45
|
+
if (exception instanceof http.ClientError)
|
|
46
|
+
return failure(REFUSED, text(exception, 'Refused'), { status: exception.status });
|
|
47
|
+
return failure(INTERNAL, 'Internal error');
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* An operation that declares its errors answers with one rather than throwing, and the
|
|
51
|
+
* reply contract states `{ code, message? }` — the message optional. The number says the
|
|
52
|
+
* operation refused; `data.code` says what it refused with, and is what a caller branches on.
|
|
53
|
+
*/
|
|
54
|
+
function refusal(exception) {
|
|
55
|
+
const body = exception.body;
|
|
56
|
+
if (typeof body !== 'object' || body === null || typeof body.code !== 'string')
|
|
57
|
+
return failure(REFUSED, text(exception, 'Refused'));
|
|
58
|
+
const code = body.code;
|
|
59
|
+
const message = typeof body.message === 'string' && body.message !== '' ? body.message : code;
|
|
60
|
+
return failure(REFUSED, message, { code });
|
|
61
|
+
}
|
|
62
|
+
function text(exception, fallback) {
|
|
63
|
+
return typeof exception.body === 'string' && exception.body !== ''
|
|
64
|
+
? exception.body
|
|
65
|
+
: fallback;
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../source/RPC/errors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,kBAAkB,CAAA;AACxC,OAAO,EAAE,OAAO,EAA+B,MAAM,YAAY,CAAA;AAEjE;;;GAGG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,KAAK,CAAA;AAC3B,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,KAAK,CAAA;AACrC,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,KAAK,CAAA;AACtC,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,KAAK,CAAA;AACpC,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,KAAK,CAAA;AAE9B;;;;GAIG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,KAAK,CAAA;AAC/B,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,KAAK,CAAA;AAC7B,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,KAAK,CAAA;AAErC,MAAM,UAAU,OAAO,CAAE,IAAY,EAAE,OAAe,EAAE,IAAc;IACpE,MAAM,KAAK,GAAY,EAAE,IAAI,EAAE,OAAO,EAAE,CAAA;IAExC,IAAI,IAAI,KAAK,SAAS;QACpB,KAAK,CAAC,IAAI,GAAG,IAAI,CAAA;IAEnB,OAAO,KAAK,CAAA;AACd,CAAC;AAED,MAA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AC,CAAA;IAErD,MAAM,IAAI,GAAG,IAAI,CAAC,IAAc,CAAA;IAChC,MAAM,OAAO,GAAG,OAAO,IAAI,CAAC,OAAO,KAAK,QAAQ,IAAI,IAAI,CAAC,OAAO,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAA;IAE7F,OAAO,OAAO,CAAC,OAAO,EAAE,OAAO,EAAE,EAAE,IAAI,EAAE,CAAC,CAAA;AAC5C,CAAC;AAED,SAAS,IAAI,CAAE,SAAyB,EAAE,QAAgB;IACxD,OAAO,OAAO,SAAS,CAAC,IAAI,KAAK,QAAQ,IAAI,SAAS,CAAC,IAAI,KAAK,EAAE;QAChE,CAAC,CAAC,SAAS,CAAC,IAAI;QAChB,CAAC,CAAC,QAAQ,CAAA;AACd,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Dispatcher } from './Dispatcher.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../source/RPC/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { Segment } from '../RTD/segment.js';
|
|
2
|
+
import { type Params } from './types.js';
|
|
3
|
+
/**
|
|
4
|
+
* What a name resolves to: the path the call is made at, and the verb it is made with.
|
|
5
|
+
*
|
|
6
|
+
* A name is the route template with its variables marked and the verb appended as a segment
|
|
7
|
+
* of its own — `pots._id.GET`. The revision names the characters a tool's name may hold, and
|
|
8
|
+
* `/` is not among them, so segments are joined by `.` — which a segment cannot hold either,
|
|
9
|
+
* so nothing in a name can be mistaken for anything else, and the verb is always last.
|
|
10
|
+
*/
|
|
11
|
+
export interface Address {
|
|
12
|
+
path: string;
|
|
13
|
+
verb: string;
|
|
14
|
+
/** the `params` the path took, which are therefore not the operation's input */
|
|
15
|
+
variables: string[];
|
|
16
|
+
}
|
|
17
|
+
export declare function address(method: string, params: Params): Address;
|
|
18
|
+
/**
|
|
19
|
+
* What the call carries, as a request carries it: the path took its variables, `query` is
|
|
20
|
+
* the querystring, and the rest is the body.
|
|
21
|
+
*/
|
|
22
|
+
export declare function split(params: Params, variables: string[]): {
|
|
23
|
+
query?: Params;
|
|
24
|
+
input?: Params;
|
|
25
|
+
};
|
|
26
|
+
/** The name of a method on this route, or nothing where the route has none. */
|
|
27
|
+
export declare function name(segments: Segment[], verb: string): string | null;
|
|
28
|
+
/** The segment that leaves a route unnameable, as it was declared, or nothing where none does. */
|
|
29
|
+
export declare function refusal(segments: Segment[]): string | null;
|
|
30
|
+
/** The route as it was declared, which is how a message about it should read. */
|
|
31
|
+
export declare function template(segments: Segment[]): string;
|