@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,121 @@
|
|
|
1
|
+
import * as http from '../HTTP/index.js';
|
|
2
|
+
import { verbs } from '../RTD/syntax/index.js';
|
|
3
|
+
import { QUERY } from './types.js';
|
|
4
|
+
export function address(method, params) {
|
|
5
|
+
const parts = method.split(SEPARATOR);
|
|
6
|
+
const verb = parts.pop();
|
|
7
|
+
if (!verbs.has(verb))
|
|
8
|
+
throw new http.NotFound(`'${method}' names no method`);
|
|
9
|
+
const variables = [];
|
|
10
|
+
const fragments = [];
|
|
11
|
+
for (const part of parts) {
|
|
12
|
+
const key = parameter(part);
|
|
13
|
+
if (key === null) {
|
|
14
|
+
fragments.push(literal(part, method));
|
|
15
|
+
continue;
|
|
16
|
+
}
|
|
17
|
+
if (part !== TAIL && !NAMEABLE.test(key))
|
|
18
|
+
throw new http.NotFound(`'${method}' names no procedure`);
|
|
19
|
+
const value = params[key];
|
|
20
|
+
if (value === undefined || value === null)
|
|
21
|
+
throw new http.BadRequest(`'${method}' requires the parameter '${key}'`);
|
|
22
|
+
const fragment = String(value);
|
|
23
|
+
// `__` stands for the rest of the path and may carry separators; a variable is one segment
|
|
24
|
+
if (!(part === TAIL ? TAILED : OPAQUE).test(fragment))
|
|
25
|
+
throw new http.BadRequest(`The parameter '${key}' cannot be a path of its own`);
|
|
26
|
+
variables.push(key);
|
|
27
|
+
fragments.push(fragment);
|
|
28
|
+
}
|
|
29
|
+
// a route is matched with its trailing slash, and the trunk is the bare one
|
|
30
|
+
const path = fragments.length === 0 ? '/' : `/${fragments.join('/')}/`;
|
|
31
|
+
return { path, verb, variables };
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* What the call carries, as a request carries it: the path took its variables, `query` is
|
|
35
|
+
* the querystring, and the rest is the body.
|
|
36
|
+
*/
|
|
37
|
+
export function split(params, variables) {
|
|
38
|
+
const input = {};
|
|
39
|
+
let query;
|
|
40
|
+
for (const [key, value] of Object.entries(params)) {
|
|
41
|
+
if (variables.includes(key))
|
|
42
|
+
continue;
|
|
43
|
+
if (key !== QUERY) {
|
|
44
|
+
input[key] = value;
|
|
45
|
+
continue;
|
|
46
|
+
}
|
|
47
|
+
if (typeof value !== 'object' || value === null || Array.isArray(value))
|
|
48
|
+
throw new http.BadRequest(`'${QUERY}' must be an object`);
|
|
49
|
+
query = value;
|
|
50
|
+
}
|
|
51
|
+
// an absent body is what a request without one has, and the mapping fills it as it does
|
|
52
|
+
return { query, input: Object.keys(input).length === 0 ? undefined : input };
|
|
53
|
+
}
|
|
54
|
+
/** The parameter a part reads, or nothing where the part is a literal segment. */
|
|
55
|
+
function parameter(part) {
|
|
56
|
+
if (part === TAIL)
|
|
57
|
+
return WILDCARD;
|
|
58
|
+
return part[0] === VARIABLE ? part.slice(1) : null;
|
|
59
|
+
}
|
|
60
|
+
/** A segment a name cannot spell is a segment no name has, so this one names nothing. */
|
|
61
|
+
function literal(part, method) {
|
|
62
|
+
if (!NAMEABLE.test(part))
|
|
63
|
+
throw new http.NotFound(`'${method}' names no procedure`);
|
|
64
|
+
return part;
|
|
65
|
+
}
|
|
66
|
+
/** The name of a method on this route, or nothing where the route has none. */
|
|
67
|
+
export function name(segments, verb) {
|
|
68
|
+
const parts = [];
|
|
69
|
+
for (const segment of segments) {
|
|
70
|
+
const part = component(segment);
|
|
71
|
+
if (part === null)
|
|
72
|
+
return null;
|
|
73
|
+
parts.push(part);
|
|
74
|
+
}
|
|
75
|
+
parts.push(verb);
|
|
76
|
+
return parts.join(SEPARATOR);
|
|
77
|
+
}
|
|
78
|
+
/** The segment that leaves a route unnameable, as it was declared, or nothing where none does. */
|
|
79
|
+
export function refusal(segments) {
|
|
80
|
+
for (const segment of segments)
|
|
81
|
+
if (component(segment) === null)
|
|
82
|
+
return declared(segment);
|
|
83
|
+
return null;
|
|
84
|
+
}
|
|
85
|
+
function component(segment) {
|
|
86
|
+
if (segment.fragment !== null)
|
|
87
|
+
return NAMEABLE.test(segment.fragment) ? segment.fragment : null;
|
|
88
|
+
if (segment.wildcard === true)
|
|
89
|
+
return TAIL;
|
|
90
|
+
// it stands for a segment the caller cannot name, so there is nothing to substitute
|
|
91
|
+
if (segment.placeholder === null)
|
|
92
|
+
return null;
|
|
93
|
+
return NAMEABLE.test(segment.placeholder) ? VARIABLE + segment.placeholder : null;
|
|
94
|
+
}
|
|
95
|
+
/** The route as it was declared, which is how a message about it should read. */
|
|
96
|
+
export function template(segments) {
|
|
97
|
+
return '/' + segments.map(declared).join('/');
|
|
98
|
+
}
|
|
99
|
+
function declared(segment) {
|
|
100
|
+
if (segment.fragment !== null)
|
|
101
|
+
return segment.fragment;
|
|
102
|
+
if (segment.wildcard === true)
|
|
103
|
+
return '**';
|
|
104
|
+
return segment.placeholder === null ? '*' : ':' + segment.placeholder;
|
|
105
|
+
}
|
|
106
|
+
const SEPARATOR = '.';
|
|
107
|
+
const VARIABLE = '_';
|
|
108
|
+
const TAIL = '__';
|
|
109
|
+
/** How the RTD names the rest of a path, wherever a parameter of it is read. */
|
|
110
|
+
const WILDCARD = '**';
|
|
111
|
+
/**
|
|
112
|
+
* What a segment may hold to have a name. `_` is the convention's own, and every other
|
|
113
|
+
* character a client leaves alone is here: a client shows a model the name with the rest
|
|
114
|
+
* turned into `_`, and two names must not become one.
|
|
115
|
+
*/
|
|
116
|
+
const NAMEABLE = /^[A-Za-z0-9-]+$/;
|
|
117
|
+
/** A segment ends at what divides or ends a path. */
|
|
118
|
+
const OPAQUE = /^[^/?#]*$/;
|
|
119
|
+
/** A tail is several segments, so it keeps the divider and loses only what ends a path. */
|
|
120
|
+
const TAILED = /^[^?#]*$/;
|
|
121
|
+
//# sourceMappingURL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IAAI,CAAA;AAErB;;;;GAIG;AACH,MAAM,QAAQ,GAAG,iBAAiB,CAAA;AAElC,qDAAqD;AACrD,MAAM,MAAM,GAAG,WAAW,CAAA;AAE1B,2FAA2F;AAC3F,MAAM,MAAM,GAAG,UAAU,CAAA"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/** The version every call and every response states. */
|
|
2
|
+
export declare const VERSION = "2.0";
|
|
3
|
+
/**
|
|
4
|
+
* The member `params` reserves for what a querystring would carry. An operation's input is
|
|
5
|
+
* free to have an `id` or a `limit` of its own, so the two cannot share one object.
|
|
6
|
+
*/
|
|
7
|
+
export declare const QUERY = "query";
|
|
8
|
+
export type Params = Record<string, unknown>;
|
|
9
|
+
export interface Call {
|
|
10
|
+
jsonrpc: string;
|
|
11
|
+
method: string;
|
|
12
|
+
params?: Params;
|
|
13
|
+
/** Absent makes this a notification: it runs, and nothing is returned for it. */
|
|
14
|
+
id?: string | number;
|
|
15
|
+
}
|
|
16
|
+
export interface Response {
|
|
17
|
+
jsonrpc: string;
|
|
18
|
+
/** `null` where the request was not readable enough to carry one. */
|
|
19
|
+
id: string | number | null;
|
|
20
|
+
result?: unknown;
|
|
21
|
+
error?: Failure;
|
|
22
|
+
}
|
|
23
|
+
export interface Failure {
|
|
24
|
+
code: number;
|
|
25
|
+
message: string;
|
|
26
|
+
data?: unknown;
|
|
27
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** The version every call and every response states. */
|
|
2
|
+
export const VERSION = '2.0';
|
|
3
|
+
/**
|
|
4
|
+
* The member `params` reserves for what a querystring would carry. An operation's input is
|
|
5
|
+
* free to have an `id` or a `limit` of its own, so the two cannot share one object.
|
|
6
|
+
*/
|
|
7
|
+
export const QUERY = 'query';
|
|
8
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../source/RPC/types.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,MAAM,CAAC,MAAM,OAAO,GAAG,KAAK,CAAA;AAE5B;;;GAGG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,OAAO,CAAA"}
|
|
@@ -2,15 +2,28 @@ import type { Parameter } from './Match.js';
|
|
|
2
2
|
import type * as syntax from './syntax/index.js';
|
|
3
3
|
import type { Context, OutgoingMessage, Options } from '../HTTP/index.js';
|
|
4
4
|
import type { Output } from '../io.js';
|
|
5
|
+
import type { Introspection } from '../Introspection.js';
|
|
5
6
|
import type { extensions } from '@toa.io/core';
|
|
6
7
|
type Host = extensions.Host;
|
|
7
8
|
export interface Directives {
|
|
8
|
-
|
|
9
|
+
/**
|
|
10
|
+
* The directives of one family on this method, or nothing where it declares none of it.
|
|
11
|
+
* For a consumer of a declaration rather than of a stage: what a method is published as
|
|
12
|
+
* is stated on the route, and read where the publishing happens.
|
|
13
|
+
*/
|
|
14
|
+
declared: <T>(family: string) => T[] | undefined;
|
|
15
|
+
precall: (context: Context, parameters: Parameter[]) => Promise<Output>;
|
|
16
|
+
/** What this route's directives make of what its method says about itself. */
|
|
17
|
+
explain: (context: Context, introspection: Introspection) => Promise<Introspection | null>;
|
|
9
18
|
settle: (context: Context, response: OutgoingMessage) => Promise<void>;
|
|
10
19
|
dispose: () => void;
|
|
11
20
|
}
|
|
12
21
|
export interface DirectiveFactory {
|
|
13
22
|
create: (directives: syntax.Directive[], route: string) => Directives;
|
|
23
|
+
/** Runs every family's `preflight`, which is request-scoped and needs no node. */
|
|
24
|
+
preflight: (context: Context) => Promise<void>;
|
|
25
|
+
/** Runs every family's `depart`, the counterpart of `preflight`. */
|
|
26
|
+
depart: (context: Context, response: OutgoingMessage) => Promise<void>;
|
|
14
27
|
dispose: () => void;
|
|
15
28
|
}
|
|
16
29
|
export interface DirectiveSet {
|
|
@@ -33,8 +46,34 @@ export interface DirectiveFamily<TDirective = any, TExtension = any> {
|
|
|
33
46
|
* the set is built — the order cannot depend on the request.
|
|
34
47
|
*/
|
|
35
48
|
arrange?: (directives: TDirective[]) => void;
|
|
36
|
-
|
|
49
|
+
/**
|
|
50
|
+
* Request-scoped, before anything is routed. It takes no directives: no node is known
|
|
51
|
+
* yet, and a request that carries several calls has no single node at all. What a
|
|
52
|
+
* directive declares is call-scoped by definition, so only what a family does on its
|
|
53
|
+
* own behalf — authenticating a credential — belongs here. It answers nothing: a stage
|
|
54
|
+
* that runs before a route is known has no reply to make, and refuses by throwing.
|
|
55
|
+
*/
|
|
56
|
+
preflight?: (request: Context & TExtension) => void | Promise<void>;
|
|
57
|
+
/** Call-scoped, with what the node declares. Runs once per call. */
|
|
58
|
+
precall?: (directives: TDirective[], request: Context & TExtension, parameters: Parameter[]) => Output | Promise<Output>;
|
|
59
|
+
/**
|
|
60
|
+
* What this family's directives make of what the method says about itself, which is
|
|
61
|
+
* what `OPTIONS` answers and what a tool is described by. `null` refuses: the method
|
|
62
|
+
* is not reachable by this caller, and is not described at all.
|
|
63
|
+
*
|
|
64
|
+
* There is no request here — no route variable has a value and no body has arrived, which
|
|
65
|
+
* is why no parameters are passed — so a directive that can only tell from one hands back
|
|
66
|
+
* what it was given.
|
|
67
|
+
*/
|
|
68
|
+
explain?: (directives: TDirective[], request: Context & TExtension, introspection: Introspection) => Introspection | null | Promise<Introspection | null>;
|
|
69
|
+
/** Call-scoped, on the message that call produced. */
|
|
37
70
|
settle?: (directives: TDirective[], request: Context & TExtension, response: OutgoingMessage) => void | Promise<void>;
|
|
71
|
+
/**
|
|
72
|
+
* Request-scoped, on the message going back — the counterpart of `preflight`, and
|
|
73
|
+
* likewise without directives. A reply the whole request carries, such as a re-issued
|
|
74
|
+
* credential, is written here rather than by a call that would not own it.
|
|
75
|
+
*/
|
|
76
|
+
depart?: (request: Context & TExtension, response: OutgoingMessage) => void | Promise<void>;
|
|
38
77
|
dispose?: (directives: TDirective[]) => void;
|
|
39
78
|
}
|
|
40
79
|
export {};
|
|
@@ -2,9 +2,10 @@ import { type Context } from './Context.js';
|
|
|
2
2
|
import type * as http from '../HTTP/index.js';
|
|
3
3
|
import type * as syntax from './syntax/index.js';
|
|
4
4
|
import type * as RTD from './index.js';
|
|
5
|
+
import type { Introspection } from '../Introspection.js';
|
|
5
6
|
export interface Endpoint {
|
|
6
7
|
call: (context: http.Context, parameters: RTD.Parameter[]) => Promise<http.OutgoingMessage>;
|
|
7
|
-
explain: (parameters: RTD.Parameter[]) => Promise<
|
|
8
|
+
explain: (parameters: RTD.Parameter[]) => Promise<Introspection>;
|
|
8
9
|
close: () => Promise<void>;
|
|
9
10
|
}
|
|
10
11
|
export interface EndpointsFactory {
|
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
import type { Parameter } from './Match.js';
|
|
2
2
|
import type { Endpoint } from './Endpoint.js';
|
|
3
3
|
import type { Directives } from './Directives.js';
|
|
4
|
+
import type { Context } from '../HTTP/index.js';
|
|
5
|
+
import type { Introspection } from '../Introspection.js';
|
|
4
6
|
export declare class Method {
|
|
5
7
|
readonly endpoint: Endpoint | null;
|
|
6
8
|
readonly directives: Directives;
|
|
7
|
-
private introspection;
|
|
8
|
-
private introspecting;
|
|
9
9
|
constructor(endpoint: Endpoint | null, directives: Directives);
|
|
10
|
-
|
|
10
|
+
/**
|
|
11
|
+
* What this method says about itself, as its directives leave it, or nothing where they
|
|
12
|
+
* refuse this caller. A method of no endpoint — one a directive answers on its own —
|
|
13
|
+
* states nothing of its own, and its directives still have their say.
|
|
14
|
+
*/
|
|
15
|
+
explain(context: Context, parameters: Parameter[]): Promise<Introspection | null>;
|
|
11
16
|
close(): Promise<void>;
|
|
12
17
|
}
|
|
13
18
|
export type Methods = Record<string, Method>;
|
package/transpiled/RTD/Method.js
CHANGED
|
@@ -1,20 +1,22 @@
|
|
|
1
|
+
import { order } from '../Introspection.js';
|
|
1
2
|
export class Method {
|
|
2
3
|
endpoint;
|
|
3
4
|
directives;
|
|
4
|
-
introspection = null;
|
|
5
|
-
introspecting = null;
|
|
6
5
|
constructor(endpoint, directives) {
|
|
7
6
|
this.endpoint = endpoint;
|
|
8
7
|
this.directives = directives;
|
|
9
8
|
}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
9
|
+
/**
|
|
10
|
+
* What this method says about itself, as its directives leave it, or nothing where they
|
|
11
|
+
* refuse this caller. A method of no endpoint — one a directive answers on its own —
|
|
12
|
+
* states nothing of its own, and its directives still have their say.
|
|
13
|
+
*/
|
|
14
|
+
async explain(context, parameters) {
|
|
15
|
+
const introspection = this.endpoint === null
|
|
16
|
+
? {}
|
|
17
|
+
: await this.endpoint.explain(parameters);
|
|
18
|
+
const described = await this.directives.explain(context, introspection);
|
|
19
|
+
return described === null ? null : order(described);
|
|
18
20
|
}
|
|
19
21
|
async close() {
|
|
20
22
|
await this.endpoint?.close();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Method.js","sourceRoot":"","sources":["../../source/RTD/Method.ts"],"names":[],"mappings":"AAIA,MAAM,OAAO,MAAM;IACD,QAAQ,CAAiB;IACzB,UAAU,CAAY;
|
|
1
|
+
{"version":3,"file":"Method.js","sourceRoot":"","sources":["../../source/RTD/Method.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAA;AAG3C,MAAM,OAAO,MAAM;IACD,QAAQ,CAAiB;IACzB,UAAU,CAAY;IAEtC,YAAoB,QAAyB,EAAE,UAAsB;QACnE,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAA;QACxB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;IAC9B,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,OAAO,CAAE,OAAgB,EAAE,UAAuB;QAC7D,MAAM,aAAa,GAAG,IAAI,CAAC,QAAQ,KAAK,IAAI;YAC1C,CAAC,CAAC,EAAE;YACJ,CAAC,CAAC,MAAM,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,UAAU,CAAC,CAAA;QAE3C,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,OAAO,EAAE,aAAa,CAAC,CAAA;QAEvE,OAAO,SAAS,KAAK,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,CAAA;IACrD,CAAC;IAEM,KAAK,CAAC,KAAK;QAChB,MAAM,IAAI,CAAC,QAAQ,EAAE,KAAK,EAAE,CAAA;IAC9B,CAAC;CACF"}
|
package/transpiled/RTD/Node.d.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { type Route } from './Route.js';
|
|
2
|
-
import { type Methods } from './Method.js';
|
|
2
|
+
import { type Method, type Methods } from './Method.js';
|
|
3
3
|
import { type Match, type Parameter } from './Match.js';
|
|
4
|
+
import type { Segment } from './segment.js';
|
|
5
|
+
import type { Context } from '../HTTP/index.js';
|
|
6
|
+
import type { Introspection } from '../Introspection.js';
|
|
4
7
|
export declare class Node {
|
|
5
8
|
intermediate: boolean;
|
|
6
9
|
forward: string | null;
|
|
@@ -16,13 +19,28 @@ export declare class Node {
|
|
|
16
19
|
*/
|
|
17
20
|
merge(node: Node): Node[];
|
|
18
21
|
touch(expiration: number): void;
|
|
19
|
-
|
|
22
|
+
/**
|
|
23
|
+
* Every method under this node, with the template it answers at.
|
|
24
|
+
*
|
|
25
|
+
* An intermediate node is skipped: it is never what a path matches, because its `/` route
|
|
26
|
+
* answers at the same place and is reached instead. The trunk is the exception `match`
|
|
27
|
+
* makes for it — `'/'` answers the trunk itself, whatever it holds.
|
|
28
|
+
*/
|
|
29
|
+
walk(segments: Segment[], trunk?: boolean): Generator<Mount>;
|
|
30
|
+
/** Every method of this node that this caller may reach, in the order they were declared. */
|
|
31
|
+
explain(context: Context, parameters: Parameter[]): Promise<Record<string, Introspection>>;
|
|
20
32
|
private replace;
|
|
21
33
|
private append;
|
|
22
34
|
private route;
|
|
23
35
|
private nodes;
|
|
24
36
|
private sort;
|
|
25
37
|
}
|
|
38
|
+
/** A method, and the route template it is reached by. */
|
|
39
|
+
export interface Mount {
|
|
40
|
+
segments: Segment[];
|
|
41
|
+
verb: string;
|
|
42
|
+
method: Method;
|
|
43
|
+
}
|
|
26
44
|
export interface Properties {
|
|
27
45
|
protected: boolean;
|
|
28
46
|
forward?: string;
|
package/transpiled/RTD/Node.js
CHANGED
|
@@ -37,11 +37,29 @@ export class Node {
|
|
|
37
37
|
if (!this.protected)
|
|
38
38
|
this.expiration = expiration;
|
|
39
39
|
}
|
|
40
|
-
|
|
40
|
+
/**
|
|
41
|
+
* Every method under this node, with the template it answers at.
|
|
42
|
+
*
|
|
43
|
+
* An intermediate node is skipped: it is never what a path matches, because its `/` route
|
|
44
|
+
* answers at the same place and is reached instead. The trunk is the exception `match`
|
|
45
|
+
* makes for it — `'/'` answers the trunk itself, whatever it holds.
|
|
46
|
+
*/
|
|
47
|
+
*walk(segments, trunk = false) {
|
|
48
|
+
if (trunk || !this.intermediate)
|
|
49
|
+
for (const [verb, method] of Object.entries(this.methods))
|
|
50
|
+
yield { segments, verb, method };
|
|
51
|
+
for (const route of this.routes)
|
|
52
|
+
yield* route.walk(segments);
|
|
53
|
+
}
|
|
54
|
+
/** Every method of this node that this caller may reach, in the order they were declared. */
|
|
55
|
+
async explain(context, parameters) {
|
|
56
|
+
const entries = Object.entries(this.methods);
|
|
57
|
+
const explained = await Promise.all(entries
|
|
58
|
+
.map(async ([, method]) => await method.explain(context, parameters)));
|
|
41
59
|
const methods = {};
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
60
|
+
for (let i = 0; i < entries.length; i++)
|
|
61
|
+
if (explained[i] !== null)
|
|
62
|
+
methods[entries[i][0]] = explained[i];
|
|
45
63
|
return methods;
|
|
46
64
|
}
|
|
47
65
|
replace(node) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Node.js","sourceRoot":"","sources":["../../source/RTD/Node.ts"],"names":[],"mappings":"
|
|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,CAAC,IAAI,CAAC,KAAK,EAAE,CAAA;IAC/B,CAAC;IAEO,KAAK;QACX,MAAM,KAAK,GAAW,CAAC,IAAI,CAAC,CAAA;QAE5B,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,MAAM;YAC7B,KAAK,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,CAAA;QAEnC,OAAO,KAAK,CAAA;IACd,CAAC;IAEO,IAAI;QACV,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;YACxB,OAAO,CAAC,CAAC,SAAS,KAAK,CAAC,CAAC,SAAS;gBAChC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,oDAAoD;gBAC5F,CAAC,CAAC,CAAC,CAAC,SAAS,GAAG,CAAC,CAAC,SAAS,CAAA,CAAC,oDAAoD;QACpF,CAAC,CAAC,CAAA;IACJ,CAAC;CACF"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type Segment } from './segment.js';
|
|
2
2
|
import { type Match, type Parameter } from './Match.js';
|
|
3
|
-
import type { Node } from './Node.js';
|
|
3
|
+
import type { Mount, Node } from './Node.js';
|
|
4
4
|
export declare class Route {
|
|
5
5
|
readonly root: boolean;
|
|
6
6
|
readonly variables: number;
|
|
@@ -9,6 +9,7 @@ export declare class Route {
|
|
|
9
9
|
private readonly wildcard;
|
|
10
10
|
constructor(segments: Segment[], node: Node);
|
|
11
11
|
match(fragments: string[], parameters: Parameter[]): Match | null;
|
|
12
|
+
walk(prefix: Segment[]): Generator<Mount>;
|
|
12
13
|
equals(route: Route): boolean;
|
|
13
14
|
merge(route: Route): Node[];
|
|
14
15
|
private matchNested;
|
package/transpiled/RTD/Route.js
CHANGED
|
@@ -22,9 +22,12 @@ export class Route {
|
|
|
22
22
|
if (segment.fragment !== null && segment.fragment !== fragments[i])
|
|
23
23
|
return null;
|
|
24
24
|
if (segment.fragment === null && segment.placeholder !== null)
|
|
25
|
-
parameters.push({ name: segment.placeholder, value: fragments[i] });
|
|
25
|
+
parameters.push({ name: segment.placeholder, value: decode(fragments[i]) });
|
|
26
26
|
if (segment.fragment === null && segment.wildcard === true)
|
|
27
|
-
parameters.push({
|
|
27
|
+
parameters.push({
|
|
28
|
+
name: '**',
|
|
29
|
+
value: fragments.slice(this.segments.length - 1).map(decode).join('/')
|
|
30
|
+
});
|
|
28
31
|
}
|
|
29
32
|
const exact = this.segments.length === fragments.length;
|
|
30
33
|
if ((exact && !this.node.intermediate) || this.wildcard)
|
|
@@ -32,6 +35,12 @@ export class Route {
|
|
|
32
35
|
else
|
|
33
36
|
return this.matchNested(fragments, parameters);
|
|
34
37
|
}
|
|
38
|
+
*walk(prefix) {
|
|
39
|
+
// an expired branch is not matched, so nothing under it is reachable to name
|
|
40
|
+
if (Date.now() >= this.node.expiration)
|
|
41
|
+
return;
|
|
42
|
+
yield* this.node.walk(prefix.concat(this.segments));
|
|
43
|
+
}
|
|
35
44
|
equals(route) {
|
|
36
45
|
if (route.segments.length !== this.segments.length)
|
|
37
46
|
return false;
|
|
@@ -48,4 +57,20 @@ export class Route {
|
|
|
48
57
|
return this.node.match(fragments, parameters);
|
|
49
58
|
}
|
|
50
59
|
}
|
|
60
|
+
/**
|
|
61
|
+
* What the segment says, rather than how it was written: a value is percent-encoded to
|
|
62
|
+
* survive the path, and an operation reads what a caller meant — a `client_id` that is a
|
|
63
|
+
* URL arrives as one. A literal segment is matched as written, which is how it is declared.
|
|
64
|
+
*
|
|
65
|
+
* An escape that decodes to nothing valid is left as it stands; refusing the route over it
|
|
66
|
+
* would answer `404` to a request whose only fault is its spelling.
|
|
67
|
+
*/
|
|
68
|
+
function decode(fragment) {
|
|
69
|
+
try {
|
|
70
|
+
return decodeURIComponent(fragment);
|
|
71
|
+
}
|
|
72
|
+
catch {
|
|
73
|
+
return fragment;
|
|
74
|
+
}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AAA;QAEd,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE;YAC3C,IAAI,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ,KAAK,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,QAAQ;gBAC1D,OAAO,KAAK,CAAA;QAEhB,OAAO,IAAI,CAAA;IACb,CAAC;IAEM,KAAK,CAAE,KAAY;QACxB,OAAO,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;IACpC,CAAC;IAEO,WAAW,CAAE,SAAmB,EAAE,UAAuB;QAC/D,SAAS,GAAG,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAA;QAEjD,OAAO,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,EAAE,UAAU,CAAC,CAAA;IAC/C,CAAC;CACF;AAED;;;;;;;GAOG;AACH,SAAS,MAAM,CAAE,QAAgB;IAC/B,IAAI,CAAC;QACH,OAAO,kBAAkB,CAAC,QAAQ,CAAC,CAAA;IACrC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,QAAQ,CAAA;IACjB,CAAC;AACH,CAAC"}
|
package/transpiled/RTD/Tree.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Node } from './Node.js';
|
|
1
|
+
import type { Mount, Node } from './Node.js';
|
|
2
2
|
import type { Match } from './Match.js';
|
|
3
3
|
import type { DirectiveFactory } from './Directives.js';
|
|
4
4
|
import type { EndpointsFactory } from './Endpoint.js';
|
|
@@ -10,6 +10,8 @@ export declare class Tree {
|
|
|
10
10
|
private readonly directives;
|
|
11
11
|
constructor(node: syntax.Node, endpoints: EndpointsFactory, directives: DirectiveFactory);
|
|
12
12
|
match(path: string): Match | null;
|
|
13
|
+
/** Every method in the tree, with the template it answers at. */
|
|
14
|
+
walk(): Generator<Mount>;
|
|
13
15
|
merge(node: syntax.Node, extension: unknown): Node[];
|
|
14
16
|
/**
|
|
15
17
|
* Extends the expiration of an already merged branch, leaving its endpoints
|
package/transpiled/RTD/Tree.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { console } from 'openspan';
|
|
2
|
+
import { refusal, template } from '../RPC/names.js';
|
|
1
3
|
import { branchTTL, createNode } from './factory.js';
|
|
2
4
|
import { fragment } from './segment.js';
|
|
3
5
|
export class Tree {
|
|
@@ -10,6 +12,7 @@ export class Tree {
|
|
|
10
12
|
this.directives = directives;
|
|
11
13
|
this.root = node;
|
|
12
14
|
this.trunk = this.createNode(node, PROTECTED);
|
|
15
|
+
unnameable(this.trunk);
|
|
13
16
|
}
|
|
14
17
|
match(path) {
|
|
15
18
|
if (path === '/')
|
|
@@ -20,8 +23,13 @@ export class Tree {
|
|
|
20
23
|
const fragments = fragment(path);
|
|
21
24
|
return this.trunk.match(fragments);
|
|
22
25
|
}
|
|
26
|
+
/** Every method in the tree, with the template it answers at. */
|
|
27
|
+
walk() {
|
|
28
|
+
return this.trunk.walk([], TRUNK);
|
|
29
|
+
}
|
|
23
30
|
merge(node, extension) {
|
|
24
31
|
const branch = this.createNode(node, !PROTECTED, extension);
|
|
32
|
+
unnameable(branch);
|
|
25
33
|
return this.trunk.merge(branch);
|
|
26
34
|
}
|
|
27
35
|
/**
|
|
@@ -53,6 +61,23 @@ export class Tree {
|
|
|
53
61
|
return createNode(node, context);
|
|
54
62
|
}
|
|
55
63
|
}
|
|
64
|
+
/**
|
|
65
|
+
* What is served but cannot be called by name. Said once per route as it is built, because a
|
|
66
|
+
* procedure that is missing is otherwise noticed only by the caller who cannot find it.
|
|
67
|
+
*/
|
|
68
|
+
function unnameable(node) {
|
|
69
|
+
const said = new Set();
|
|
70
|
+
for (const { segments } of node.walk([], TRUNK)) {
|
|
71
|
+
const segment = refusal(segments);
|
|
72
|
+
if (segment === null)
|
|
73
|
+
continue;
|
|
74
|
+
const route = template(segments);
|
|
75
|
+
if (said.has(route))
|
|
76
|
+
continue;
|
|
77
|
+
said.add(route);
|
|
78
|
+
console.warn('Route cannot be addressed as a procedure', { route, segment });
|
|
79
|
+
}
|
|
80
|
+
}
|
|
56
81
|
/**
|
|
57
82
|
* A branch's routes are relative to wherever it is merged, and the mount point is not
|
|
58
83
|
* known while it is being built — so the component it came from is what keeps two
|
|
@@ -67,4 +92,5 @@ function label(extension) {
|
|
|
67
92
|
: '';
|
|
68
93
|
}
|
|
69
94
|
const PROTECTED = true;
|
|
95
|
+
const TRUNK = true;
|
|
70
96
|
//# sourceMappingURL=Tree.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tree.js","sourceRoot":"","sources":["../../source/RTD/Tree.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AAQvC,MAAM,OAAO,IAAI;IACE,IAAI,CAAa;IACjB,KAAK,CAAM;IACX,SAAS,CAAkB;IAC3B,UAAU,CAAkB;IAE7C,YAAoB,IAAiB,EAAE,SAA2B,EAAE,UAA4B;QAC9F,IAAI,CAAC,SAAS,GAAG,SAAS,CAAA;QAC1B,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;QAC5B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;QAChB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,SAAS,CAAC,CAAA;
|
|
1
|
+
{"version":3,"file":"Tree.js","sourceRoot":"","sources":["../../source/RTD/Tree.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAA;AAClC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAA;AACnD,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,cAAc,CAA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CAAC;AACH,CAAC;AAED;;;;GAIG;AACH,SAAS,KAAK,CAAE,SAAkB;IAChC,IAAI,SAAS,KAAK,IAAI,IAAI,OAAO,SAAS,KAAK,QAAQ;QACrD,OAAO,EAAE,CAAA;IAEX,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,GAAG,SAAoC,CAAA;IAErE,OAAO,OAAO,SAAS,KAAK,QAAQ,IAAI,OAAO,SAAS,KAAK,QAAQ;QACnE,CAAC,CAAC,GAAG,SAAS,IAAI,SAAS,EAAE;QAC7B,CAAC,CAAC,EAAE,CAAA;AACR,CAAC;AAED,MAAM,SAAS,GAAG,IAAI,CAAA;AACtB,MAAM,KAAK,GAAG,IAAI,CAAA"}
|
package/transpiled/const.d.ts
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
1
|
export declare const BRANCH_TTL = 1800000;
|
|
2
2
|
/** The replicas of the gateway decide together, whatever context they serve. */
|
|
3
3
|
export declare const ATOM_GROUP = "exposition";
|
|
4
|
+
/**
|
|
5
|
+
* Where JSON-RPC is served, for every procedure at once. Pinned rather than configured: a
|
|
6
|
+
* path an application could choose is a path it could collide with a route of its own.
|
|
7
|
+
*/
|
|
8
|
+
export declare const RPC = "/.rpc";
|
|
9
|
+
/** Calls one request may carry where the annotation does not say. */
|
|
10
|
+
export declare const BATCH = 32;
|
|
11
|
+
/**
|
|
12
|
+
* Where the Model Context Protocol is served. Pinned for the reason `/.rpc` is: a path an
|
|
13
|
+
* application could choose is a path it could collide with a route of its own.
|
|
14
|
+
*/
|
|
15
|
+
export declare const MCP = "/.mcp";
|
package/transpiled/const.js
CHANGED
|
@@ -1,4 +1,16 @@
|
|
|
1
1
|
export const BRANCH_TTL = 1_800_000;
|
|
2
2
|
/** The replicas of the gateway decide together, whatever context they serve. */
|
|
3
3
|
export const ATOM_GROUP = 'exposition';
|
|
4
|
+
/**
|
|
5
|
+
* Where JSON-RPC is served, for every procedure at once. Pinned rather than configured: a
|
|
6
|
+
* path an application could choose is a path it could collide with a route of its own.
|
|
7
|
+
*/
|
|
8
|
+
export const RPC = '/.rpc';
|
|
9
|
+
/** Calls one request may carry where the annotation does not say. */
|
|
10
|
+
export const BATCH = 32;
|
|
11
|
+
/**
|
|
12
|
+
* Where the Model Context Protocol is served. Pinned for the reason `/.rpc` is: a path an
|
|
13
|
+
* application could choose is a path it could collide with a route of its own.
|
|
14
|
+
*/
|
|
15
|
+
export const MCP = '/.mcp';
|
|
4
16
|
//# sourceMappingURL=const.js.map
|
package/transpiled/const.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"const.js","sourceRoot":"","sources":["../source/const.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,UAAU,GAAG,SAAS,CAAA;AAEnC,gFAAgF;AAChF,MAAM,CAAC,MAAM,UAAU,GAAG,YAAY,CAAA"}
|
|
1
|
+
{"version":3,"file":"const.js","sourceRoot":"","sources":["../source/const.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,UAAU,GAAG,SAAS,CAAA;AAEnC,gFAAgF;AAChF,MAAM,CAAC,MAAM,UAAU,GAAG,YAAY,CAAA;AAEtC;;;GAGG;AACH,MAAM,CAAC,MAAM,GAAG,GAAG,OAAO,CAAA;AAE1B,qEAAqE;AACrE,MAAM,CAAC,MAAM,KAAK,GAAG,EAAE,CAAA;AAEvB;;;GAGG;AACH,MAAM,CAAC,MAAM,GAAG,GAAG,OAAO,CAAA"}
|
package/transpiled/deployment.js
CHANGED
|
@@ -51,6 +51,10 @@ export function deployment(_, annotation) {
|
|
|
51
51
|
properties.bouncer = annotation.bouncer;
|
|
52
52
|
if (annotation.oauth !== undefined)
|
|
53
53
|
properties.oauth = annotation.oauth;
|
|
54
|
+
if (annotation.rpc !== undefined)
|
|
55
|
+
properties.rpc = annotation.rpc;
|
|
56
|
+
if (annotation.mcp !== undefined)
|
|
57
|
+
properties.mcp = annotation.mcp;
|
|
54
58
|
service.variables.push({
|
|
55
59
|
name: 'TOA_EXPOSITION_PROPERTIES',
|
|
56
60
|
value: JSON.stringify(properties)
|