@astrale-os/kernel-client 0.6.0-beta.8 → 0.6.0-beta.81
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/dist/auth/auth.d.ts +25 -10
- package/dist/auth/auth.js +5 -7
- package/dist/auth/authorization.d.ts +6 -4
- package/dist/auth/authorization.js +25 -6
- package/dist/auth/credential.d.ts +11 -2
- package/dist/auth/credential.js +6 -3
- package/dist/auth/identity.d.ts +6 -9
- package/dist/auth/identity.js +0 -1
- package/dist/auth/index.d.ts +4 -5
- package/dist/auth/index.js +2 -4
- package/dist/auth/register.d.ts +24 -0
- package/dist/auth/register.js +10 -0
- package/dist/client/admission.d.ts +4 -2
- package/dist/client/admission.js +8 -2
- package/dist/client/client.d.ts +4 -3
- package/dist/client/client.js +13 -3
- package/dist/client/credential.d.ts +4 -3
- package/dist/client/credential.js +7 -3
- package/dist/client/index.d.ts +1 -2
- package/dist/client/index.js +1 -2
- package/dist/client/request.d.ts +10 -4
- package/dist/client/request.js +33 -6
- package/dist/client/result.d.ts +3 -4
- package/dist/client/result.js +3 -1
- package/dist/client/routing-control.d.ts +0 -1
- package/dist/client/routing-control.js +0 -1
- package/dist/errors/client-error.d.ts +0 -1
- package/dist/errors/client-error.js +2 -1
- package/dist/errors/exchange-error.d.ts +19 -0
- package/dist/errors/exchange-error.js +9 -0
- package/dist/errors/index.d.ts +8 -7
- package/dist/errors/index.js +8 -7
- package/dist/errors/miss-error.d.ts +0 -1
- package/dist/errors/miss-error.js +0 -1
- package/dist/errors/protocol-error.d.ts +0 -1
- package/dist/errors/protocol-error.js +0 -1
- package/dist/errors/response-error.d.ts +0 -1
- package/dist/errors/response-error.js +0 -1
- package/dist/errors/session-error.d.ts +9 -0
- package/dist/errors/session-error.js +9 -0
- package/dist/errors/stale-route-error.d.ts +0 -1
- package/dist/errors/stale-route-error.js +0 -1
- package/dist/errors/transport-error.d.ts +18 -6
- package/dist/errors/transport-error.js +11 -7
- package/dist/graph/domain/binding.d.ts +22 -0
- package/dist/graph/domain/binding.js +123 -0
- package/dist/graph/domain/domain.typecheck.d.ts +1 -0
- package/dist/graph/domain/domain.typecheck.js +147 -0
- package/dist/graph/domain/index.d.ts +3 -0
- package/dist/graph/domain/index.js +1 -0
- package/dist/graph/domain/model.d.ts +18 -0
- package/dist/graph/domain/model.js +1 -0
- package/dist/graph/domain/page.d.ts +23 -0
- package/dist/graph/domain/page.js +42 -0
- package/dist/graph/domain/project.d.ts +8 -0
- package/dist/graph/domain/project.js +124 -0
- package/dist/graph/domain/provenance.d.ts +6 -0
- package/dist/graph/domain/provenance.js +11 -0
- package/dist/graph/errors.d.ts +2 -3
- package/dist/graph/errors.js +1 -2
- package/dist/graph/expectation.d.ts +3 -0
- package/dist/graph/expectation.js +6 -0
- package/dist/graph/graph.d.ts +12 -8
- package/dist/graph/graph.js +0 -1
- package/dist/graph/index.d.ts +2 -2
- package/dist/graph/index.js +1 -1
- package/dist/graph/mutation.d.ts +2 -4
- package/dist/graph/mutation.js +10 -2
- package/dist/graph/page/index.d.ts +0 -1
- package/dist/graph/page/index.js +0 -1
- package/dist/graph/page/neighbors.d.ts +4 -5
- package/dist/graph/page/neighbors.js +7 -7
- package/dist/graph/page/page.d.ts +5 -2
- package/dist/graph/page/page.js +0 -1
- package/dist/graph/page-contract.d.ts +1 -2
- package/dist/graph/page-contract.js +0 -1
- package/dist/graph/provenance.d.ts +14 -0
- package/dist/graph/provenance.js +42 -0
- package/dist/graph/query.d.ts +3 -1
- package/dist/graph/query.js +33 -13
- package/dist/graph/read.d.ts +3 -4
- package/dist/graph/read.js +6 -5
- package/dist/index.d.ts +3 -3
- package/dist/index.js +2 -2
- package/dist/pacer/batcher/batcher.d.ts +0 -1
- package/dist/pacer/batcher/batcher.js +0 -1
- package/dist/pacer/batcher/defaults.d.ts +0 -1
- package/dist/pacer/batcher/defaults.js +0 -1
- package/dist/pacer/batcher/index.d.ts +0 -1
- package/dist/pacer/batcher/index.js +0 -1
- package/dist/pacer/index.d.ts +0 -1
- package/dist/pacer/index.js +0 -1
- package/dist/pacer/limiter/defaults.d.ts +0 -1
- package/dist/pacer/limiter/defaults.js +0 -1
- package/dist/pacer/limiter/index.d.ts +0 -1
- package/dist/pacer/limiter/index.js +0 -1
- package/dist/pacer/limiter/limiter.d.ts +0 -1
- package/dist/pacer/limiter/limiter.js +0 -1
- package/dist/pacer/queue/defaults.d.ts +0 -1
- package/dist/pacer/queue/defaults.js +0 -1
- package/dist/pacer/queue/index.d.ts +0 -1
- package/dist/pacer/queue/index.js +0 -1
- package/dist/pacer/queue/queue.d.ts +0 -1
- package/dist/pacer/queue/queue.js +0 -1
- package/dist/pacer/retry/defaults.d.ts +0 -1
- package/dist/pacer/retry/defaults.js +0 -1
- package/dist/pacer/retry/index.d.ts +0 -1
- package/dist/pacer/retry/index.js +0 -1
- package/dist/pacer/retry/retry.d.ts +0 -1
- package/dist/pacer/retry/retry.js +0 -1
- package/dist/pool/index.d.ts +0 -1
- package/dist/pool/index.js +0 -1
- package/dist/pool/pool.d.ts +0 -1
- package/dist/pool/pool.js +0 -1
- package/dist/pool/target.d.ts +0 -1
- package/dist/pool/target.js +0 -1
- package/dist/schema/admission.d.ts +1 -2
- package/dist/schema/admission.js +0 -1
- package/dist/schema/contracts.d.ts +6 -16
- package/dist/schema/contracts.js +0 -1
- package/dist/schema/index.d.ts +2 -3
- package/dist/schema/index.js +1 -2
- package/dist/schema/introspection.d.ts +1 -2
- package/dist/schema/introspection.js +9 -2
- package/dist/schema/operation.d.ts +0 -1
- package/dist/schema/operation.js +2 -3
- package/dist/schema/schema.d.ts +13 -10
- package/dist/schema/schema.js +83 -11
- package/dist/session/admission.d.ts +6 -0
- package/dist/session/admission.js +59 -0
- package/dist/session/bound.d.ts +48 -0
- package/dist/session/bound.js +110 -0
- package/dist/session/content.d.ts +27 -0
- package/dist/session/content.js +158 -0
- package/dist/session/context/control.d.ts +0 -1
- package/dist/session/context/control.js +0 -1
- package/dist/session/context/index.d.ts +0 -1
- package/dist/session/context/index.js +0 -1
- package/dist/session/context/limits.d.ts +0 -1
- package/dist/session/context/limits.js +0 -1
- package/dist/session/context/operation.d.ts +5 -2
- package/dist/session/context/operation.js +19 -17
- package/dist/session/context/policy.d.ts +0 -1
- package/dist/session/context/policy.js +0 -1
- package/dist/session/credential/index.d.ts +1 -0
- package/dist/session/credential/index.js +1 -0
- package/dist/session/credential/limits.d.ts +12 -0
- package/dist/session/credential/limits.js +12 -0
- package/dist/session/credential/provider.d.ts +56 -0
- package/dist/session/credential/provider.js +236 -0
- package/dist/session/discovery/bundle.d.ts +5 -2
- package/dist/session/discovery/bundle.js +34 -15
- package/dist/session/discovery/discovery.d.ts +4 -2
- package/dist/session/discovery/discovery.js +34 -6
- package/dist/session/discovery/index.d.ts +3 -1
- package/dist/session/discovery/index.js +1 -1
- package/dist/session/discovery/publication.d.ts +0 -1
- package/dist/session/discovery/publication.js +4 -4
- package/dist/session/discovery/snapshot.d.ts +0 -1
- package/dist/session/discovery/snapshot.js +0 -1
- package/dist/session/discovery/transport.d.ts +6 -0
- package/dist/session/discovery/transport.js +13 -0
- package/dist/session/exchange/domain.d.ts +27 -0
- package/dist/session/exchange/domain.js +63 -0
- package/dist/session/exchange/exchange.d.ts +54 -0
- package/dist/session/exchange/exchange.js +58 -0
- package/dist/session/exchange/index.d.ts +5 -0
- package/dist/session/exchange/index.js +5 -0
- package/dist/session/exchange/issuer.d.ts +18 -0
- package/dist/session/exchange/issuer.js +149 -0
- package/dist/session/exchange/limits.d.ts +10 -0
- package/dist/session/exchange/limits.js +10 -0
- package/dist/session/exchange/options.d.ts +29 -0
- package/dist/session/exchange/options.js +57 -0
- package/dist/session/exchange/presentation.d.ts +18 -0
- package/dist/session/exchange/presentation.js +73 -0
- package/dist/session/exchange/source.d.ts +32 -0
- package/dist/session/exchange/source.js +78 -0
- package/dist/session/execution.d.ts +65 -0
- package/dist/session/execution.js +34 -0
- package/dist/session/index.d.ts +9 -4
- package/dist/session/index.js +4 -1
- package/dist/session/reference.d.ts +40 -12
- package/dist/session/reference.js +56 -14
- package/dist/session/routing/auth.d.ts +10 -1
- package/dist/session/routing/auth.js +8 -2
- package/dist/session/routing/cache.d.ts +27 -8
- package/dist/session/routing/cache.js +218 -25
- package/dist/session/routing/dispatch.d.ts +15 -8
- package/dist/session/routing/dispatch.js +121 -48
- package/dist/session/routing/envelope.d.ts +2 -1
- package/dist/session/routing/envelope.js +14 -10
- package/dist/session/routing/index.d.ts +3 -5
- package/dist/session/routing/index.js +2 -3
- package/dist/session/routing/request.d.ts +9 -1
- package/dist/session/routing/request.js +17 -1
- package/dist/session/session.d.ts +41 -8
- package/dist/session/session.js +129 -41
- package/dist/session/session.typecheck.d.ts +0 -1
- package/dist/session/session.typecheck.js +172 -3
- package/dist/session/views/catalog.d.ts +0 -1
- package/dist/session/views/catalog.js +14 -5
- package/dist/session/views/index.d.ts +0 -1
- package/dist/session/views/index.js +0 -1
- package/dist/session/views/resolve.d.ts +0 -1
- package/dist/session/views/resolve.js +0 -1
- package/dist/store/entity-index.d.ts +0 -1
- package/dist/store/entity-index.js +0 -1
- package/dist/store/index.d.ts +0 -1
- package/dist/store/index.js +0 -1
- package/dist/store/memory.d.ts +2 -2
- package/dist/store/memory.js +38 -15
- package/dist/store/mutation.d.ts +1 -2
- package/dist/store/mutation.js +6 -4
- package/dist/store/observe.d.ts +0 -1
- package/dist/store/observe.js +0 -1
- package/dist/store/optimistic.d.ts +0 -1
- package/dist/store/optimistic.js +0 -1
- package/dist/store/query-key.d.ts +2 -2
- package/dist/store/query-key.js +7 -3
- package/dist/store/shape.d.ts +4 -2
- package/dist/store/shape.js +4 -2
- package/dist/store/store.d.ts +2 -4
- package/dist/store/store.js +6 -5
- package/dist/store/store.typecheck.d.ts +0 -1
- package/dist/store/store.typecheck.js +3 -9
- package/dist/transport/auto/decision.d.ts +0 -1
- package/dist/transport/auto/decision.js +0 -1
- package/dist/transport/auto/fallback.d.ts +2 -2
- package/dist/transport/auto/fallback.js +10 -11
- package/dist/transport/auto/index.d.ts +0 -1
- package/dist/transport/auto/index.js +0 -1
- package/dist/transport/auto/transport.d.ts +0 -1
- package/dist/transport/auto/transport.js +5 -6
- package/dist/transport/auto/warning.d.ts +0 -1
- package/dist/transport/auto/warning.js +5 -3
- package/dist/transport/deadline.d.ts +0 -1
- package/dist/transport/deadline.js +0 -1
- package/dist/transport/failure.d.ts +7 -0
- package/dist/transport/failure.js +9 -0
- package/dist/transport/http/byte-stream.d.ts +18 -0
- package/dist/transport/http/byte-stream.js +94 -0
- package/dist/transport/http/index.d.ts +0 -1
- package/dist/transport/http/index.js +0 -1
- package/dist/transport/http/response.d.ts +0 -1
- package/dist/transport/http/response.js +0 -1
- package/dist/transport/http/stream.d.ts +0 -1
- package/dist/transport/http/stream.js +7 -7
- package/dist/transport/http/transport.d.ts +3 -1
- package/dist/transport/http/transport.js +87 -30
- package/dist/transport/index.d.ts +0 -1
- package/dist/transport/index.js +0 -1
- package/dist/transport/transport.d.ts +0 -1
- package/dist/transport/transport.js +0 -1
- package/dist/transport/websocket/connection.d.ts +0 -1
- package/dist/transport/websocket/connection.js +16 -26
- package/dist/transport/websocket/exchange.d.ts +0 -1
- package/dist/transport/websocket/exchange.js +5 -9
- package/dist/transport/websocket/index.d.ts +0 -1
- package/dist/transport/websocket/index.js +0 -1
- package/dist/transport/websocket/transport.d.ts +0 -1
- package/dist/transport/websocket/transport.js +7 -20
- package/package.json +12 -14
- package/dist/auth/auth.d.ts.map +0 -1
- package/dist/auth/auth.js.map +0 -1
- package/dist/auth/authorization.d.ts.map +0 -1
- package/dist/auth/authorization.js.map +0 -1
- package/dist/auth/credential.d.ts.map +0 -1
- package/dist/auth/credential.js.map +0 -1
- package/dist/auth/identity.d.ts.map +0 -1
- package/dist/auth/identity.js.map +0 -1
- package/dist/auth/index.d.ts.map +0 -1
- package/dist/auth/index.js.map +0 -1
- package/dist/auth/provision.d.ts +0 -9
- package/dist/auth/provision.d.ts.map +0 -1
- package/dist/auth/provision.js +0 -11
- package/dist/auth/provision.js.map +0 -1
- package/dist/client/admission.d.ts.map +0 -1
- package/dist/client/admission.js.map +0 -1
- package/dist/client/client.d.ts.map +0 -1
- package/dist/client/client.js.map +0 -1
- package/dist/client/credential.d.ts.map +0 -1
- package/dist/client/credential.js.map +0 -1
- package/dist/client/index.d.ts.map +0 -1
- package/dist/client/index.js.map +0 -1
- package/dist/client/request.d.ts.map +0 -1
- package/dist/client/request.js.map +0 -1
- package/dist/client/result.d.ts.map +0 -1
- package/dist/client/result.js.map +0 -1
- package/dist/client/routing-control.d.ts.map +0 -1
- package/dist/client/routing-control.js.map +0 -1
- package/dist/errors/client-error.d.ts.map +0 -1
- package/dist/errors/client-error.js.map +0 -1
- package/dist/errors/index.d.ts.map +0 -1
- package/dist/errors/index.js.map +0 -1
- package/dist/errors/miss-error.d.ts.map +0 -1
- package/dist/errors/miss-error.js.map +0 -1
- package/dist/errors/protocol-error.d.ts.map +0 -1
- package/dist/errors/protocol-error.js.map +0 -1
- package/dist/errors/response-error.d.ts.map +0 -1
- package/dist/errors/response-error.js.map +0 -1
- package/dist/errors/stale-route-error.d.ts.map +0 -1
- package/dist/errors/stale-route-error.js.map +0 -1
- package/dist/errors/transport-error.d.ts.map +0 -1
- package/dist/errors/transport-error.js.map +0 -1
- package/dist/graph/errors.d.ts.map +0 -1
- package/dist/graph/errors.js.map +0 -1
- package/dist/graph/graph.d.ts.map +0 -1
- package/dist/graph/graph.js.map +0 -1
- package/dist/graph/index.d.ts.map +0 -1
- package/dist/graph/index.js.map +0 -1
- package/dist/graph/mutation.d.ts.map +0 -1
- package/dist/graph/mutation.js.map +0 -1
- package/dist/graph/page/index.d.ts.map +0 -1
- package/dist/graph/page/index.js.map +0 -1
- package/dist/graph/page/neighbors.d.ts.map +0 -1
- package/dist/graph/page/neighbors.js.map +0 -1
- package/dist/graph/page/page.d.ts.map +0 -1
- package/dist/graph/page/page.js.map +0 -1
- package/dist/graph/page-contract.d.ts.map +0 -1
- package/dist/graph/page-contract.js.map +0 -1
- package/dist/graph/query.d.ts.map +0 -1
- package/dist/graph/query.js.map +0 -1
- package/dist/graph/read.d.ts.map +0 -1
- package/dist/graph/read.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/pacer/batcher/batcher.d.ts.map +0 -1
- package/dist/pacer/batcher/batcher.js.map +0 -1
- package/dist/pacer/batcher/defaults.d.ts.map +0 -1
- package/dist/pacer/batcher/defaults.js.map +0 -1
- package/dist/pacer/batcher/index.d.ts.map +0 -1
- package/dist/pacer/batcher/index.js.map +0 -1
- package/dist/pacer/index.d.ts.map +0 -1
- package/dist/pacer/index.js.map +0 -1
- package/dist/pacer/limiter/defaults.d.ts.map +0 -1
- package/dist/pacer/limiter/defaults.js.map +0 -1
- package/dist/pacer/limiter/index.d.ts.map +0 -1
- package/dist/pacer/limiter/index.js.map +0 -1
- package/dist/pacer/limiter/limiter.d.ts.map +0 -1
- package/dist/pacer/limiter/limiter.js.map +0 -1
- package/dist/pacer/queue/defaults.d.ts.map +0 -1
- package/dist/pacer/queue/defaults.js.map +0 -1
- package/dist/pacer/queue/index.d.ts.map +0 -1
- package/dist/pacer/queue/index.js.map +0 -1
- package/dist/pacer/queue/queue.d.ts.map +0 -1
- package/dist/pacer/queue/queue.js.map +0 -1
- package/dist/pacer/retry/defaults.d.ts.map +0 -1
- package/dist/pacer/retry/defaults.js.map +0 -1
- package/dist/pacer/retry/index.d.ts.map +0 -1
- package/dist/pacer/retry/index.js.map +0 -1
- package/dist/pacer/retry/retry.d.ts.map +0 -1
- package/dist/pacer/retry/retry.js.map +0 -1
- package/dist/pool/index.d.ts.map +0 -1
- package/dist/pool/index.js.map +0 -1
- package/dist/pool/pool.d.ts.map +0 -1
- package/dist/pool/pool.js.map +0 -1
- package/dist/pool/target.d.ts.map +0 -1
- package/dist/pool/target.js.map +0 -1
- package/dist/schema/admission.d.ts.map +0 -1
- package/dist/schema/admission.js.map +0 -1
- package/dist/schema/contracts.d.ts.map +0 -1
- package/dist/schema/contracts.js.map +0 -1
- package/dist/schema/index.d.ts.map +0 -1
- package/dist/schema/index.js.map +0 -1
- package/dist/schema/introspection.d.ts.map +0 -1
- package/dist/schema/introspection.js.map +0 -1
- package/dist/schema/operation.d.ts.map +0 -1
- package/dist/schema/operation.js.map +0 -1
- package/dist/schema/schema.d.ts.map +0 -1
- package/dist/schema/schema.js.map +0 -1
- package/dist/session/context/control.d.ts.map +0 -1
- package/dist/session/context/control.js.map +0 -1
- package/dist/session/context/index.d.ts.map +0 -1
- package/dist/session/context/index.js.map +0 -1
- package/dist/session/context/limits.d.ts.map +0 -1
- package/dist/session/context/limits.js.map +0 -1
- package/dist/session/context/operation.d.ts.map +0 -1
- package/dist/session/context/operation.js.map +0 -1
- package/dist/session/context/policy.d.ts.map +0 -1
- package/dist/session/context/policy.js.map +0 -1
- package/dist/session/discovery/bundle.d.ts.map +0 -1
- package/dist/session/discovery/bundle.js.map +0 -1
- package/dist/session/discovery/discovery.d.ts.map +0 -1
- package/dist/session/discovery/discovery.js.map +0 -1
- package/dist/session/discovery/index.d.ts.map +0 -1
- package/dist/session/discovery/index.js.map +0 -1
- package/dist/session/discovery/publication.d.ts.map +0 -1
- package/dist/session/discovery/publication.js.map +0 -1
- package/dist/session/discovery/snapshot.d.ts.map +0 -1
- package/dist/session/discovery/snapshot.js.map +0 -1
- package/dist/session/index.d.ts.map +0 -1
- package/dist/session/index.js.map +0 -1
- package/dist/session/reference.d.ts.map +0 -1
- package/dist/session/reference.js.map +0 -1
- package/dist/session/routing/auth.d.ts.map +0 -1
- package/dist/session/routing/auth.js.map +0 -1
- package/dist/session/routing/cache.d.ts.map +0 -1
- package/dist/session/routing/cache.js.map +0 -1
- package/dist/session/routing/dispatch.d.ts.map +0 -1
- package/dist/session/routing/dispatch.js.map +0 -1
- package/dist/session/routing/envelope.d.ts.map +0 -1
- package/dist/session/routing/envelope.js.map +0 -1
- package/dist/session/routing/expectation.d.ts +0 -7
- package/dist/session/routing/expectation.d.ts.map +0 -1
- package/dist/session/routing/expectation.js +0 -2
- package/dist/session/routing/expectation.js.map +0 -1
- package/dist/session/routing/index.d.ts.map +0 -1
- package/dist/session/routing/index.js.map +0 -1
- package/dist/session/routing/request.d.ts.map +0 -1
- package/dist/session/routing/request.js.map +0 -1
- package/dist/session/session.d.ts.map +0 -1
- package/dist/session/session.js.map +0 -1
- package/dist/session/session.typecheck.d.ts.map +0 -1
- package/dist/session/session.typecheck.js.map +0 -1
- package/dist/session/views/catalog.d.ts.map +0 -1
- package/dist/session/views/catalog.js.map +0 -1
- package/dist/session/views/index.d.ts.map +0 -1
- package/dist/session/views/index.js.map +0 -1
- package/dist/session/views/resolve.d.ts.map +0 -1
- package/dist/session/views/resolve.js.map +0 -1
- package/dist/store/entity-index.d.ts.map +0 -1
- package/dist/store/entity-index.js.map +0 -1
- package/dist/store/index.d.ts.map +0 -1
- package/dist/store/index.js.map +0 -1
- package/dist/store/memory.d.ts.map +0 -1
- package/dist/store/memory.js.map +0 -1
- package/dist/store/mutation.d.ts.map +0 -1
- package/dist/store/mutation.js.map +0 -1
- package/dist/store/observe.d.ts.map +0 -1
- package/dist/store/observe.js.map +0 -1
- package/dist/store/optimistic.d.ts.map +0 -1
- package/dist/store/optimistic.js.map +0 -1
- package/dist/store/query-key.d.ts.map +0 -1
- package/dist/store/query-key.js.map +0 -1
- package/dist/store/shape.d.ts.map +0 -1
- package/dist/store/shape.js.map +0 -1
- package/dist/store/store.d.ts.map +0 -1
- package/dist/store/store.js.map +0 -1
- package/dist/store/store.typecheck.d.ts.map +0 -1
- package/dist/store/store.typecheck.js.map +0 -1
- package/dist/transport/auto/decision.d.ts.map +0 -1
- package/dist/transport/auto/decision.js.map +0 -1
- package/dist/transport/auto/fallback.d.ts.map +0 -1
- package/dist/transport/auto/fallback.js.map +0 -1
- package/dist/transport/auto/index.d.ts.map +0 -1
- package/dist/transport/auto/index.js.map +0 -1
- package/dist/transport/auto/transport.d.ts.map +0 -1
- package/dist/transport/auto/transport.js.map +0 -1
- package/dist/transport/auto/warning.d.ts.map +0 -1
- package/dist/transport/auto/warning.js.map +0 -1
- package/dist/transport/deadline.d.ts.map +0 -1
- package/dist/transport/deadline.js.map +0 -1
- package/dist/transport/http/index.d.ts.map +0 -1
- package/dist/transport/http/index.js.map +0 -1
- package/dist/transport/http/response.d.ts.map +0 -1
- package/dist/transport/http/response.js.map +0 -1
- package/dist/transport/http/stream.d.ts.map +0 -1
- package/dist/transport/http/stream.js.map +0 -1
- package/dist/transport/http/transport.d.ts.map +0 -1
- package/dist/transport/http/transport.js.map +0 -1
- package/dist/transport/index.d.ts.map +0 -1
- package/dist/transport/index.js.map +0 -1
- package/dist/transport/transport.d.ts.map +0 -1
- package/dist/transport/transport.js.map +0 -1
- package/dist/transport/websocket/connection.d.ts.map +0 -1
- package/dist/transport/websocket/connection.js.map +0 -1
- package/dist/transport/websocket/exchange.d.ts.map +0 -1
- package/dist/transport/websocket/exchange.js.map +0 -1
- package/dist/transport/websocket/index.d.ts.map +0 -1
- package/dist/transport/websocket/index.js.map +0 -1
- package/dist/transport/websocket/transport.d.ts.map +0 -1
- package/dist/transport/websocket/transport.js.map +0 -1
package/dist/auth/auth.d.ts
CHANGED
|
@@ -1,19 +1,34 @@
|
|
|
1
|
-
import type { Identity, IdentityId, MintedCredential,
|
|
2
|
-
import type { PathLike } from '@astrale-os/kernel-core/path';
|
|
3
|
-
import type {
|
|
1
|
+
import type { Identity, Authentication, IdentityId, MintedCredential, RegisterResult, UnresolvedIdentityExpr } from '@astrale-os/kernel-core/auth';
|
|
2
|
+
import type { NodePath, PathLike } from '@astrale-os/kernel-core/path';
|
|
3
|
+
import type { Key } from '@astrale-os/kernel-dsl/v1/addressing';
|
|
4
|
+
import type { Call, Input } from '../client/index.js';
|
|
4
5
|
import type { RequestOptions } from '../transport/index.js';
|
|
5
6
|
import type { PolicyDecisionInput } from './authorization.js';
|
|
6
|
-
import type { DelegateOptions, MintOptions } from './credential.js';
|
|
7
|
+
import type { DelegateOptions, MintOptions, ImpersonateOptions } from './credential.js';
|
|
7
8
|
import type { WhoisInput } from './identity.js';
|
|
9
|
+
import type { RegisterRequest } from './register.js';
|
|
8
10
|
export type AuthCall = (target: PathLike, input: Input, options?: RequestOptions) => Promise<Input>;
|
|
11
|
+
/** Current admission of one remote Call; the target has not been executed. */
|
|
12
|
+
export interface FunctionAdmission {
|
|
13
|
+
readonly callable: Key.Callable;
|
|
14
|
+
readonly receiver?: NodePath;
|
|
15
|
+
}
|
|
16
|
+
export interface AdmissionOptions extends RequestOptions {
|
|
17
|
+
/** Intersect the caller's Grant; defaults to explicit session attenuation, then self. */
|
|
18
|
+
readonly attenuation?: UnresolvedIdentityExpr;
|
|
19
|
+
}
|
|
9
20
|
export interface AuthApi {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
21
|
+
/** Check access and input without executing an installed remote callable. */
|
|
22
|
+
admit(call: Call, options?: AdmissionOptions): Promise<FunctionAdmission>;
|
|
23
|
+
register(input: RegisterRequest, options?: RequestOptions): Promise<RegisterResult>;
|
|
24
|
+
whoami(options?: RequestOptions): Promise<Identity & Authentication>;
|
|
25
|
+
whois(input: WhoisInput, options?: RequestOptions): Promise<(Identity & Authentication) | null>;
|
|
13
26
|
can(input: PolicyDecisionInput, options?: RequestOptions): Promise<boolean>;
|
|
27
|
+
/** One ordered decision per check; batches above the Kernel bound are split and rejoined. */
|
|
28
|
+
can(input: readonly PolicyDecisionInput[], options?: RequestOptions): Promise<readonly boolean[]>;
|
|
29
|
+
impersonate(input: ImpersonateOptions, options?: RequestOptions): Promise<MintedCredential>;
|
|
14
30
|
mint(input: MintOptions, options?: RequestOptions): Promise<MintedCredential>;
|
|
15
31
|
delegate(identity: IdentityId, input: DelegateOptions, options?: RequestOptions): Promise<MintedCredential>;
|
|
16
32
|
}
|
|
17
|
-
/**
|
|
18
|
-
export declare function createAuth(call: AuthCall): AuthApi;
|
|
19
|
-
//# sourceMappingURL=auth.d.ts.map
|
|
33
|
+
/** Internal composition over callbacks owned by the Session or its bound view. */
|
|
34
|
+
export declare function createAuth(call: AuthCall, admit: AuthApi['admit']): AuthApi;
|
package/dist/auth/auth.js
CHANGED
|
@@ -1,16 +1,14 @@
|
|
|
1
1
|
import { authorizationApi } from './authorization.js';
|
|
2
2
|
import { credentialApi } from './credential.js';
|
|
3
3
|
import { identityApi } from './identity.js';
|
|
4
|
-
import {
|
|
5
|
-
/**
|
|
6
|
-
export function createAuth(call) {
|
|
7
|
-
if (typeof call !== 'function')
|
|
8
|
-
throw new TypeError('Auth call capability is invalid.');
|
|
4
|
+
import { registerApi } from './register.js';
|
|
5
|
+
/** Internal composition over callbacks owned by the Session or its bound view. */
|
|
6
|
+
export function createAuth(call, admit) {
|
|
9
7
|
return Object.freeze({
|
|
10
|
-
|
|
8
|
+
admit,
|
|
9
|
+
...registerApi(call),
|
|
11
10
|
...identityApi(call),
|
|
12
11
|
...authorizationApi(call),
|
|
13
12
|
...credentialApi(call),
|
|
14
13
|
});
|
|
15
14
|
}
|
|
16
|
-
//# sourceMappingURL=auth.js.map
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import type { NodeId } from '@astrale-os/kernel-core/graph/node';
|
|
2
2
|
import type { NodePath, PathLike } from '@astrale-os/kernel-core/path';
|
|
3
|
-
import type {
|
|
3
|
+
import type { PolicyRef } from '@astrale-os/kernel-dsl/v1';
|
|
4
4
|
import type { RequestOptions } from '../transport/index.js';
|
|
5
5
|
import type { AuthCall } from './auth.js';
|
|
6
6
|
export interface PolicyDecisionInput {
|
|
7
|
-
readonly policy: PathLike |
|
|
7
|
+
readonly policy: PathLike | PolicyRef;
|
|
8
8
|
readonly object: NodeId;
|
|
9
9
|
}
|
|
10
10
|
export declare const IDENTITY_CAN_PATH: NodePath;
|
|
11
11
|
export declare function authorizationApi(call: AuthCall): Readonly<{
|
|
12
|
-
can
|
|
12
|
+
can: {
|
|
13
|
+
(input: PolicyDecisionInput, options?: RequestOptions): Promise<boolean>;
|
|
14
|
+
(input: readonly PolicyDecisionInput[], options?: RequestOptions): Promise<readonly boolean[]>;
|
|
15
|
+
};
|
|
13
16
|
}>;
|
|
14
|
-
//# sourceMappingURL=authorization.d.ts.map
|
|
@@ -1,18 +1,37 @@
|
|
|
1
1
|
import { Path } from '@astrale-os/kernel-core/path';
|
|
2
|
+
import { MAXIMUM_CHECKS } from '@astrale-os/kernel-core/schema/kernel/syscalls/contracts';
|
|
2
3
|
import { identity } from '@astrale-os/kernel-core/schema/kernel/syscalls/references';
|
|
3
4
|
const identityOwner = Path.project(identity.whoami.owner);
|
|
4
5
|
export const IDENTITY_CAN_PATH = Path.staticMethod(identityOwner, identity.can.name).raw;
|
|
5
6
|
export function authorizationApi(call) {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const output = (await call(IDENTITY_CAN_PATH,
|
|
7
|
+
async function can(input, options) {
|
|
8
|
+
if (!isBatch(input)) {
|
|
9
|
+
const output = (await call(IDENTITY_CAN_PATH, check(input), options));
|
|
9
10
|
return output.allowed;
|
|
10
|
-
}
|
|
11
|
-
|
|
11
|
+
}
|
|
12
|
+
const batches = [];
|
|
13
|
+
for (let offset = 0; offset < input.length; offset += MAXIMUM_CHECKS) {
|
|
14
|
+
batches.push(input.slice(offset, offset + MAXIMUM_CHECKS));
|
|
15
|
+
}
|
|
16
|
+
const decided = await Promise.all(batches.map(async (batch) => {
|
|
17
|
+
const output = (await call(IDENTITY_CAN_PATH, Object.freeze({ checks: batch.map(check) }), options));
|
|
18
|
+
if (output.decisions.length !== batch.length) {
|
|
19
|
+
throw new TypeError('Identity.can answered a different number of decisions.');
|
|
20
|
+
}
|
|
21
|
+
return output.decisions.map(({ allowed }) => allowed);
|
|
22
|
+
}));
|
|
23
|
+
return Object.freeze(decided.flat());
|
|
24
|
+
}
|
|
25
|
+
return Object.freeze({ can });
|
|
26
|
+
}
|
|
27
|
+
function isBatch(input) {
|
|
28
|
+
return Array.isArray(input);
|
|
29
|
+
}
|
|
30
|
+
function check(input) {
|
|
31
|
+
return Object.freeze({ policy: policyPath(input.policy), object: input.object });
|
|
12
32
|
}
|
|
13
33
|
function policyPath(input) {
|
|
14
34
|
return input instanceof Path || typeof input === 'string'
|
|
15
35
|
? Path.from(input).raw
|
|
16
36
|
: Path.project(input).raw;
|
|
17
37
|
}
|
|
18
|
-
//# sourceMappingURL=authorization.js.map
|
|
@@ -7,14 +7,23 @@ export interface MintOptions {
|
|
|
7
7
|
readonly ttlSeconds: number;
|
|
8
8
|
readonly grant?: UnresolvedGrant;
|
|
9
9
|
}
|
|
10
|
+
export interface ImpersonateOptions extends MintOptions {
|
|
11
|
+
readonly identity: IdentityId;
|
|
12
|
+
}
|
|
10
13
|
export interface DelegateOptions {
|
|
11
14
|
readonly audience: string;
|
|
12
15
|
readonly ttlSeconds: number;
|
|
13
|
-
|
|
16
|
+
/**
|
|
17
|
+
* Sent only when present; the Kernel reads absence as self. A Kernel whose `Identity.delegate`
|
|
18
|
+
* still requires it rejects the omission.
|
|
19
|
+
*/
|
|
20
|
+
readonly attenuation?: UnresolvedIdentityExpr;
|
|
14
21
|
}
|
|
22
|
+
export declare const IDENTITY_IMPERSONATE_PATH: NodePath;
|
|
15
23
|
export declare const IDENTITY_MINT_PATH: NodePath;
|
|
24
|
+
export declare const IDENTITY_DELEGATE_PATH: NodePath;
|
|
16
25
|
export declare function credentialApi(call: AuthCall): Readonly<{
|
|
26
|
+
impersonate(input: ImpersonateOptions, options?: RequestOptions): Promise<MintedCredential>;
|
|
17
27
|
mint(input: MintOptions, options?: RequestOptions): Promise<MintedCredential>;
|
|
18
28
|
delegate(principal: IdentityId, input: DelegateOptions, options?: RequestOptions): Promise<MintedCredential>;
|
|
19
29
|
}>;
|
|
20
|
-
//# sourceMappingURL=credential.d.ts.map
|
package/dist/auth/credential.js
CHANGED
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
import { Path } from '@astrale-os/kernel-core/path';
|
|
2
2
|
import { identity } from '@astrale-os/kernel-core/schema/kernel/syscalls/references';
|
|
3
3
|
const identityOwner = Path.project(identity.whoami.owner);
|
|
4
|
+
export const IDENTITY_IMPERSONATE_PATH = Path.staticMethod(identityOwner, identity.impersonate.name).raw;
|
|
4
5
|
export const IDENTITY_MINT_PATH = Path.staticMethod(identityOwner, identity.mint.name).raw;
|
|
6
|
+
export const IDENTITY_DELEGATE_PATH = Path.staticMethod(identityOwner, identity.delegate.name).raw;
|
|
5
7
|
export function credentialApi(call) {
|
|
6
8
|
return Object.freeze({
|
|
9
|
+
async impersonate(input, options) {
|
|
10
|
+
return credential(await call(IDENTITY_IMPERSONATE_PATH, input, options));
|
|
11
|
+
},
|
|
7
12
|
async mint(input, options) {
|
|
8
13
|
return credential(await call(IDENTITY_MINT_PATH, input, options));
|
|
9
14
|
},
|
|
10
15
|
async delegate(principal, input, options) {
|
|
11
|
-
|
|
12
|
-
return credential(await call(target, input, options));
|
|
16
|
+
return credential(await call(IDENTITY_DELEGATE_PATH, { ...input, principal }, options));
|
|
13
17
|
},
|
|
14
18
|
});
|
|
15
19
|
}
|
|
@@ -19,4 +23,3 @@ function credential(input) {
|
|
|
19
23
|
}
|
|
20
24
|
return input;
|
|
21
25
|
}
|
|
22
|
-
//# sourceMappingURL=credential.js.map
|
package/dist/auth/identity.d.ts
CHANGED
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Authentication, Identity } from '@astrale-os/kernel-core/auth';
|
|
2
2
|
import type { NodePath } from '@astrale-os/kernel-core/path';
|
|
3
3
|
import type { RequestOptions } from '../transport/index.js';
|
|
4
4
|
import type { AuthCall } from './auth.js';
|
|
5
|
-
export
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
export type WhoisInput = Authentication;
|
|
6
|
+
export interface IdentityApi {
|
|
7
|
+
whoami(options?: RequestOptions): Promise<Identity & Authentication>;
|
|
8
|
+
whois(input: WhoisInput, options?: RequestOptions): Promise<(Identity & Authentication) | null>;
|
|
8
9
|
}
|
|
9
10
|
export declare const IDENTITY_WHOAMI_PATH: NodePath;
|
|
10
11
|
export declare const IDENTITY_WHOIS_PATH: NodePath;
|
|
11
|
-
export declare function identityApi(call: AuthCall):
|
|
12
|
-
whoami(options?: RequestOptions): Promise<Identity>;
|
|
13
|
-
whois(input: WhoisInput, options?: RequestOptions): Promise<Identity | null>;
|
|
14
|
-
}>;
|
|
15
|
-
//# sourceMappingURL=identity.d.ts.map
|
|
12
|
+
export declare function identityApi(call: AuthCall): IdentityApi;
|
package/dist/auth/identity.js
CHANGED
package/dist/auth/index.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export type { AuthApi, AdmissionOptions, FunctionAdmission } from './auth.js';
|
|
2
2
|
export { IDENTITY_CAN_PATH, type PolicyDecisionInput } from './authorization.js';
|
|
3
|
-
export { IDENTITY_MINT_PATH, type DelegateOptions, type MintOptions } from './credential.js';
|
|
3
|
+
export { IDENTITY_MINT_PATH, IDENTITY_IMPERSONATE_PATH, type DelegateOptions, type MintOptions, type ImpersonateOptions, } from './credential.js';
|
|
4
4
|
export { IDENTITY_WHOAMI_PATH, IDENTITY_WHOIS_PATH, type WhoisInput } from './identity.js';
|
|
5
|
-
export {
|
|
6
|
-
export type { Identity, IdentityId, Subject, IssuerId, MintedCredential,
|
|
7
|
-
//# sourceMappingURL=index.d.ts.map
|
|
5
|
+
export { IDENTITY_REGISTER_PATH, type RegisterIdentity, type RegisterRequest } from './register.js';
|
|
6
|
+
export type { Identity, IdentityId, Subject, IssuerId, MintedCredential, RegisterResult, UnresolvedGrant, UnresolvedIdentityExpr, } from '@astrale-os/kernel-core/auth';
|
package/dist/auth/index.js
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
export { createAuth } from './auth.js';
|
|
2
1
|
export { IDENTITY_CAN_PATH } from './authorization.js';
|
|
3
|
-
export { IDENTITY_MINT_PATH } from './credential.js';
|
|
2
|
+
export { IDENTITY_MINT_PATH, IDENTITY_IMPERSONATE_PATH, } from './credential.js';
|
|
4
3
|
export { IDENTITY_WHOAMI_PATH, IDENTITY_WHOIS_PATH } from './identity.js';
|
|
5
|
-
export {
|
|
6
|
-
//# sourceMappingURL=index.js.map
|
|
4
|
+
export { IDENTITY_REGISTER_PATH } from './register.js';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { IdentityId, JsonWebKey, RegisterResult } from '@astrale-os/kernel-core/auth';
|
|
2
|
+
import type { NodePath } from '@astrale-os/kernel-core/path';
|
|
3
|
+
import type { RequestOptions } from '../transport/index.js';
|
|
4
|
+
import type { AuthCall } from './auth.js';
|
|
5
|
+
export declare const IDENTITY_REGISTER_PATH: NodePath;
|
|
6
|
+
export type RegisterIdentity = {
|
|
7
|
+
readonly id: IdentityId;
|
|
8
|
+
readonly mode: 'external';
|
|
9
|
+
readonly credential: string;
|
|
10
|
+
readonly publicKey?: never;
|
|
11
|
+
} | {
|
|
12
|
+
readonly id: IdentityId;
|
|
13
|
+
readonly mode: 'self';
|
|
14
|
+
readonly publicKey: JsonWebKey;
|
|
15
|
+
readonly credential: string;
|
|
16
|
+
};
|
|
17
|
+
/** JSON-safe client request; binary credential inputs remain Runtime-internal. */
|
|
18
|
+
export interface RegisterRequest {
|
|
19
|
+
readonly idempotencyKey: string;
|
|
20
|
+
readonly identities: readonly [RegisterIdentity, ...RegisterIdentity[]];
|
|
21
|
+
}
|
|
22
|
+
export declare function registerApi(call: AuthCall): Readonly<{
|
|
23
|
+
register(input: RegisterRequest, options?: RequestOptions): Promise<RegisterResult>;
|
|
24
|
+
}>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Path } from '@astrale-os/kernel-core/path';
|
|
2
|
+
import { register } from '@astrale-os/kernel-core/schema/kernel/syscalls/references';
|
|
3
|
+
export const IDENTITY_REGISTER_PATH = Path.project(register).raw;
|
|
4
|
+
export function registerApi(call) {
|
|
5
|
+
return Object.freeze({
|
|
6
|
+
async register(input, options) {
|
|
7
|
+
return (await call(IDENTITY_REGISTER_PATH, input, options));
|
|
8
|
+
},
|
|
9
|
+
});
|
|
10
|
+
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { invocation as protocol } from '@astrale-os/kernel-protocol';
|
|
2
2
|
import type { Call } from './request.js';
|
|
3
3
|
/** Parent-private Call acceptance shared by Client and Client Session. */
|
|
4
|
-
export declare function acceptCall(input:
|
|
5
|
-
|
|
4
|
+
export declare function acceptCall(input: {
|
|
5
|
+
readonly target: Call['target'];
|
|
6
|
+
readonly input: unknown;
|
|
7
|
+
}): protocol.Call;
|
package/dist/client/admission.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Target } from '@astrale-os/kernel-core/callable';
|
|
1
2
|
import { Path } from '@astrale-os/kernel-core/path';
|
|
2
3
|
import * as portable from '@astrale-os/kernel-dsl/value';
|
|
3
4
|
/** Parent-private Call acceptance shared by Client and Client Session. */
|
|
@@ -5,7 +6,13 @@ export function acceptCall(input) {
|
|
|
5
6
|
if (input === null || typeof input !== 'object' || Array.isArray(input)) {
|
|
6
7
|
throw new TypeError('Client call must be an object.');
|
|
7
8
|
}
|
|
8
|
-
|
|
9
|
+
const target = input.target;
|
|
10
|
+
return Object.freeze({
|
|
11
|
+
target: typeof target === 'object' && target !== null && 'callable' in target
|
|
12
|
+
? Target(target)
|
|
13
|
+
: admitPath(target),
|
|
14
|
+
input: admitInput(input.input),
|
|
15
|
+
});
|
|
9
16
|
}
|
|
10
17
|
function admitPath(input) {
|
|
11
18
|
try {
|
|
@@ -32,4 +39,3 @@ function freezeValue(input) {
|
|
|
32
39
|
}
|
|
33
40
|
return input;
|
|
34
41
|
}
|
|
35
|
-
//# sourceMappingURL=admission.js.map
|
package/dist/client/client.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import type { invocation as protocol } from '@astrale-os/kernel-protocol';
|
|
2
2
|
import type { Transport } from '../transport/index.js';
|
|
3
3
|
import type { AuthenticatedClient, RemoteCredential } from './credential.js';
|
|
4
|
-
import type { Call, ClientDispatchOptions } from './request.js';
|
|
4
|
+
import type { Call, ClientDispatchOptions, ClientDispatchOptionsWithBody } from './request.js';
|
|
5
5
|
import type { BinaryResponse, Result, StreamResult, ValueResult } from './result.js';
|
|
6
6
|
import { type HttpTransportOptions } from '../transport/http/index.js';
|
|
7
7
|
export type ClientOptions = HttpTransportOptions | {
|
|
8
8
|
readonly transport: Transport;
|
|
9
9
|
};
|
|
10
10
|
/** Package-private redirect continuation path; intentionally absent from the public Client facade. */
|
|
11
|
-
export declare function dispatchTrace(client: Client, credential: RemoteCredential | undefined, call: Call, options: ClientDispatchOptions | undefined, trace: protocol.Trace): Promise<Result>;
|
|
11
|
+
export declare function dispatchTrace(client: Client, credential: RemoteCredential | undefined, call: Call, options: ClientDispatchOptions | ClientDispatchOptionsWithBody | undefined, trace: protocol.Trace): Promise<Result>;
|
|
12
12
|
/** Pure client for the universal remote Function invocation boundary. */
|
|
13
13
|
export declare class Client implements AuthenticatedClient {
|
|
14
14
|
private readonly transport;
|
|
@@ -16,11 +16,12 @@ export declare class Client implements AuthenticatedClient {
|
|
|
16
16
|
private closed;
|
|
17
17
|
constructor(options: ClientOptions);
|
|
18
18
|
dispatch(call: Call, options?: ClientDispatchOptions): Promise<Result>;
|
|
19
|
+
dispatch(call: Call, options: ClientDispatchOptionsWithBody): Promise<Result>;
|
|
19
20
|
call(call: Call, options?: ClientDispatchOptions): Promise<ValueResult>;
|
|
21
|
+
call(call: Call, options: ClientDispatchOptionsWithBody): Promise<ValueResult>;
|
|
20
22
|
stream(call: Call, options?: ClientDispatchOptions): Promise<StreamResult>;
|
|
21
23
|
binary(call: Call, options?: ClientDispatchOptions): Promise<BinaryResponse>;
|
|
22
24
|
as(credential: RemoteCredential): AuthenticatedClient;
|
|
23
25
|
close(): void;
|
|
24
26
|
private dispatchWith;
|
|
25
27
|
}
|
|
26
|
-
//# sourceMappingURL=client.d.ts.map
|
package/dist/client/client.js
CHANGED
|
@@ -30,7 +30,7 @@ export class Client {
|
|
|
30
30
|
return this.dispatchWith(undefined, call, options);
|
|
31
31
|
}
|
|
32
32
|
call(call, options) {
|
|
33
|
-
return requireValue(this.
|
|
33
|
+
return requireValue(this.dispatchWith(undefined, call, options));
|
|
34
34
|
}
|
|
35
35
|
stream(call, options) {
|
|
36
36
|
return requireStream(this.dispatch(call, options));
|
|
@@ -57,7 +57,18 @@ export class Client {
|
|
|
57
57
|
? undefined
|
|
58
58
|
: await resolveCredential(credential, request.options.signal);
|
|
59
59
|
requireRequestLive(request.options.signal);
|
|
60
|
-
const
|
|
60
|
+
const envelope = invocation(request, resolved, trace);
|
|
61
|
+
let result;
|
|
62
|
+
if (request.body === undefined) {
|
|
63
|
+
result = await this.transport.dispatch(envelope, request.options);
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
const transport = this.transport;
|
|
67
|
+
if (!(transport instanceof HttpTransport)) {
|
|
68
|
+
throw new TypeError('Binary dispatch requires HTTP transport.');
|
|
69
|
+
}
|
|
70
|
+
result = await transport.dispatchBinary(envelope, request.body, request.options);
|
|
71
|
+
}
|
|
61
72
|
if (result.kind === 'stale')
|
|
62
73
|
throw admittedStaleRouteError(result.current, result.invocation);
|
|
63
74
|
if (result.kind === 'miss')
|
|
@@ -90,4 +101,3 @@ function admitTransport(input) {
|
|
|
90
101
|
...(close === undefined ? {} : { close: close.bind(input) }),
|
|
91
102
|
});
|
|
92
103
|
}
|
|
93
|
-
//# sourceMappingURL=client.js.map
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import type { Call, ClientDispatchOptions } from './request.js';
|
|
1
|
+
import type { Call, ClientDispatchOptions, ClientDispatchOptionsWithBody } from './request.js';
|
|
2
2
|
import type { BinaryResponse, Result, StreamResult, ValueResult } from './result.js';
|
|
3
3
|
export type RemoteCredential = string | (() => string | Promise<string>);
|
|
4
4
|
export interface AuthenticatedClient {
|
|
5
5
|
dispatch(call: Call, options?: ClientDispatchOptions): Promise<Result>;
|
|
6
|
+
dispatch(call: Call, options: ClientDispatchOptionsWithBody): Promise<Result>;
|
|
6
7
|
call(call: Call, options?: ClientDispatchOptions): Promise<ValueResult>;
|
|
8
|
+
call(call: Call, options: ClientDispatchOptionsWithBody): Promise<ValueResult>;
|
|
7
9
|
stream(call: Call, options?: ClientDispatchOptions): Promise<StreamResult>;
|
|
8
10
|
binary(call: Call, options?: ClientDispatchOptions): Promise<BinaryResponse>;
|
|
9
11
|
}
|
|
10
|
-
export type CredentialDispatch = (credential: RemoteCredential, call: Call, options?: ClientDispatchOptions) => Promise<Result>;
|
|
12
|
+
export type CredentialDispatch = (credential: RemoteCredential, call: Call, options?: ClientDispatchOptions | ClientDispatchOptionsWithBody) => Promise<Result>;
|
|
11
13
|
export declare function authenticated(dispatchWith: CredentialDispatch, credential: RemoteCredential): AuthenticatedClient;
|
|
12
14
|
export declare function resolveCredential(input: RemoteCredential, signal?: AbortSignal): Promise<string>;
|
|
13
|
-
//# sourceMappingURL=credential.d.ts.map
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
import { ClientError } from '../errors/index.js';
|
|
2
2
|
import { requireBinary, requireStream, requireValue } from './result.js';
|
|
3
3
|
export function authenticated(dispatchWith, credential) {
|
|
4
|
-
|
|
4
|
+
function dispatch(call, options) {
|
|
5
|
+
return dispatchWith(credential, call, options);
|
|
6
|
+
}
|
|
7
|
+
function call(request, options) {
|
|
8
|
+
return requireValue(dispatchWith(credential, request, options));
|
|
9
|
+
}
|
|
5
10
|
return Object.freeze({
|
|
6
11
|
dispatch,
|
|
7
|
-
call
|
|
12
|
+
call,
|
|
8
13
|
stream: (call, options) => requireStream(dispatch(call, options)),
|
|
9
14
|
binary: (call, options) => requireBinary(dispatch(call, options)),
|
|
10
15
|
});
|
|
@@ -49,4 +54,3 @@ function cancellation(reason) {
|
|
|
49
54
|
? reason
|
|
50
55
|
: new ClientError('Client request was cancelled.', { cause: reason });
|
|
51
56
|
}
|
|
52
|
-
//# sourceMappingURL=credential.js.map
|
package/dist/client/index.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export { Client, dispatchTrace, type ClientOptions } from './client.js';
|
|
2
2
|
export { acceptCall } from './admission.js';
|
|
3
3
|
export type { AuthenticatedClient, RemoteCredential } from './credential.js';
|
|
4
|
-
export { call, type Call, type ClientDispatchOptions } from './request.js';
|
|
4
|
+
export { call, type Call, type ClientDispatchOptions, type ClientDispatchOptionsWithBody, } from './request.js';
|
|
5
5
|
export type { Binary, BinaryResponse, Input, RedirectResult, Result, Stream, StreamResult, ValueResult, } from './result.js';
|
|
6
6
|
export { isAdmittedMissError, isAdmittedStaleRouteError } from './routing-control.js';
|
|
7
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/client/index.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
export { Client, dispatchTrace } from './client.js';
|
|
2
2
|
export { acceptCall } from './admission.js';
|
|
3
|
-
export { call } from './request.js';
|
|
3
|
+
export { call, } from './request.js';
|
|
4
4
|
export { isAdmittedMissError, isAdmittedStaleRouteError } from './routing-control.js';
|
|
5
|
-
//# sourceMappingURL=index.js.map
|
package/dist/client/request.d.ts
CHANGED
|
@@ -1,27 +1,33 @@
|
|
|
1
|
+
import type { Target } from '@astrale-os/kernel-core/callable';
|
|
1
2
|
import type { PathLike } from '@astrale-os/kernel-core/path';
|
|
2
3
|
import type * as protocol from '@astrale-os/kernel-protocol/invocation';
|
|
3
4
|
import type { RequestOptions, TransportRequest } from '../transport/index.js';
|
|
4
5
|
import type { Input } from './result.js';
|
|
5
6
|
/** One portable call before Path canonicalization, correlation, and credential binding. */
|
|
6
7
|
export interface Call {
|
|
7
|
-
readonly target: PathLike;
|
|
8
|
+
readonly target: PathLike | Target;
|
|
8
9
|
readonly input: Input;
|
|
9
10
|
}
|
|
10
11
|
export interface ClientDispatchOptions extends RequestOptions {
|
|
12
|
+
readonly body?: never;
|
|
11
13
|
/** Untrusted delivery context; it changes neither Call meaning nor authority. */
|
|
12
14
|
readonly delegate?: protocol.Delegate;
|
|
13
15
|
readonly routing?: protocol.Routing;
|
|
14
16
|
/** Package-owned local-target or remote-revision precondition for a bound invocation. */
|
|
15
17
|
readonly schema?: protocol.SchemaTarget;
|
|
16
18
|
}
|
|
19
|
+
export type ClientDispatchOptionsWithBody = Omit<ClientDispatchOptions, 'body' | 'idempotencyKey'> & {
|
|
20
|
+
readonly body: Blob;
|
|
21
|
+
readonly idempotencyKey?: never;
|
|
22
|
+
};
|
|
17
23
|
export interface AdmittedRequest {
|
|
18
24
|
readonly call: protocol.Call;
|
|
19
25
|
readonly delegate?: protocol.Delegate;
|
|
20
26
|
readonly routing?: protocol.Routing;
|
|
21
27
|
readonly schema?: protocol.SchemaTarget;
|
|
22
28
|
readonly options: RequestOptions;
|
|
29
|
+
readonly body?: Blob;
|
|
23
30
|
}
|
|
24
|
-
export declare function call(target: PathLike, input: Input): Call;
|
|
25
|
-
export declare function admitRequest(input: Call, options: ClientDispatchOptions | undefined, lifecycle: AbortSignal): AdmittedRequest;
|
|
31
|
+
export declare function call(target: PathLike | Target, input: Input): Call;
|
|
32
|
+
export declare function admitRequest(input: Call, options: ClientDispatchOptions | ClientDispatchOptionsWithBody | undefined, lifecycle: AbortSignal): AdmittedRequest;
|
|
26
33
|
export declare function invocation(request: AdmittedRequest, credential?: string, trace?: protocol.Trace): TransportRequest;
|
|
27
|
-
//# sourceMappingURL=request.d.ts.map
|
package/dist/client/request.js
CHANGED
|
@@ -5,7 +5,8 @@ export function call(target, input) {
|
|
|
5
5
|
}
|
|
6
6
|
export function admitRequest(input, options, lifecycle) {
|
|
7
7
|
const call = acceptCall(input);
|
|
8
|
-
const
|
|
8
|
+
const admitted = admitRequestOptions(options);
|
|
9
|
+
const admittedOptions = lifecycleOptions(admitted.options, lifecycle);
|
|
9
10
|
const delegate = admitDelegate(options?.delegate);
|
|
10
11
|
const routing = admitRouting(options?.routing);
|
|
11
12
|
const schema = admitSchemaTarget(options?.schema);
|
|
@@ -14,6 +15,7 @@ export function admitRequest(input, options, lifecycle) {
|
|
|
14
15
|
...(delegate === undefined ? {} : { delegate }),
|
|
15
16
|
...(routing === undefined ? {} : { routing }),
|
|
16
17
|
...(schema === undefined ? {} : { schema }),
|
|
18
|
+
...(admitted.body === undefined ? {} : { body: admitted.body }),
|
|
17
19
|
options: admittedOptions,
|
|
18
20
|
});
|
|
19
21
|
}
|
|
@@ -41,23 +43,49 @@ export function invocation(request, credential, trace) {
|
|
|
41
43
|
}
|
|
42
44
|
function admitRequestOptions(input) {
|
|
43
45
|
if (input === undefined)
|
|
44
|
-
return
|
|
46
|
+
return {};
|
|
45
47
|
if (input === null || typeof input !== 'object' || Array.isArray(input)) {
|
|
46
48
|
throw new TypeError('Client request options must be an object.');
|
|
47
49
|
}
|
|
50
|
+
if (Reflect.ownKeys(input).some((field) => ![
|
|
51
|
+
'signal',
|
|
52
|
+
'timeoutMs',
|
|
53
|
+
'idempotencyKey',
|
|
54
|
+
'delegate',
|
|
55
|
+
'routing',
|
|
56
|
+
'schema',
|
|
57
|
+
'body',
|
|
58
|
+
].includes(String(field)))) {
|
|
59
|
+
throw new TypeError('Client request options contain unsupported fields.');
|
|
60
|
+
}
|
|
48
61
|
if (input.timeoutMs !== undefined &&
|
|
49
62
|
(!Number.isSafeInteger(input.timeoutMs) ||
|
|
50
63
|
input.timeoutMs < 1 ||
|
|
51
64
|
input.timeoutMs > 2_147_483_647)) {
|
|
52
65
|
throw new TypeError('Client request timeoutMs must be a positive safe platform integer.');
|
|
53
66
|
}
|
|
67
|
+
const hasBody = Object.hasOwn(input, 'body');
|
|
68
|
+
let body;
|
|
69
|
+
if (hasBody) {
|
|
70
|
+
const candidate = input.body;
|
|
71
|
+
if (!(candidate instanceof Blob)) {
|
|
72
|
+
throw new TypeError('Binary input must be a Blob or File.');
|
|
73
|
+
}
|
|
74
|
+
body = candidate;
|
|
75
|
+
}
|
|
76
|
+
if (body !== undefined && input.idempotencyKey !== undefined) {
|
|
77
|
+
throw new TypeError('Binary requests cannot carry an idempotency key.');
|
|
78
|
+
}
|
|
54
79
|
const idempotencyKey = input.idempotencyKey === undefined
|
|
55
80
|
? undefined
|
|
56
81
|
: invocationProtocol.acceptIdempotencyKey(input.idempotencyKey, 'request.idempotencyKey');
|
|
57
82
|
return Object.freeze({
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
83
|
+
options: Object.freeze({
|
|
84
|
+
...(input.signal === undefined ? {} : { signal: input.signal }),
|
|
85
|
+
...(input.timeoutMs === undefined ? {} : { timeoutMs: input.timeoutMs }),
|
|
86
|
+
...(idempotencyKey === undefined ? {} : { idempotencyKey }),
|
|
87
|
+
}),
|
|
88
|
+
...(body === undefined ? {} : { body }),
|
|
61
89
|
});
|
|
62
90
|
}
|
|
63
91
|
function admitDelegate(input) {
|
|
@@ -98,4 +126,3 @@ function lifecycleOptions(input, lifecycle) {
|
|
|
98
126
|
...(input?.idempotencyKey === undefined ? {} : { idempotencyKey: input.idempotencyKey }),
|
|
99
127
|
});
|
|
100
128
|
}
|
|
101
|
-
//# sourceMappingURL=request.js.map
|
package/dist/client/result.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { BinaryOutput, CallableResult } from '@astrale-os/kernel-core/callable';
|
|
2
2
|
import type { Value } from '@astrale-os/kernel-dsl/value';
|
|
3
3
|
import type { invocation as protocol } from '@astrale-os/kernel-protocol';
|
|
4
4
|
/** Caller-visible value accepted from one admitted remote invocation. */
|
|
5
5
|
export type Input = Value;
|
|
6
|
-
/** Caller-visible
|
|
7
|
-
export type Binary =
|
|
6
|
+
/** Caller-visible buffered or streaming binary response. */
|
|
7
|
+
export type Binary = BinaryOutput;
|
|
8
8
|
/** Caller-owned remote stream. */
|
|
9
9
|
export interface Stream extends AsyncIterable<Value> {
|
|
10
10
|
cancel(reason?: string): Promise<void>;
|
|
@@ -33,4 +33,3 @@ export declare function requireValue(result: Promise<Result>): Promise<ValueResu
|
|
|
33
33
|
export declare function requireStream(result: Promise<Result>): Promise<StreamResult>;
|
|
34
34
|
export declare function requireBinary(result: Promise<Result>): Promise<BinaryResponse>;
|
|
35
35
|
export {};
|
|
36
|
-
//# sourceMappingURL=result.d.ts.map
|
package/dist/client/result.js
CHANGED
|
@@ -24,6 +24,8 @@ async function rejectMismatch(expected, result) {
|
|
|
24
24
|
if (result.kind === 'stream') {
|
|
25
25
|
await result.stream.cancel(`Expected ${expected} Function result.`).catch(() => undefined);
|
|
26
26
|
}
|
|
27
|
+
if (result.kind === 'binary' && !(result.value.body instanceof Uint8Array)) {
|
|
28
|
+
await result.value.body[Symbol.asyncIterator]().return?.();
|
|
29
|
+
}
|
|
27
30
|
mismatch(expected, result.kind);
|
|
28
31
|
}
|
|
29
|
-
//# sourceMappingURL=result.js.map
|
|
@@ -8,4 +8,3 @@ export declare function admittedStaleRouteError(currentEtag: publication.Etag, i
|
|
|
8
8
|
export declare function isAdmittedMissError(input: unknown): input is MissError;
|
|
9
9
|
/** Distinguish decoded routing control from public or caller-supplied lookalike errors. */
|
|
10
10
|
export declare function isAdmittedStaleRouteError(input: unknown): input is StaleRouteError;
|
|
11
|
-
//# sourceMappingURL=routing-control.d.ts.map
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
export class ClientError extends Error {
|
|
2
2
|
constructor(message, options) {
|
|
3
|
+
if (message.trim() === '')
|
|
4
|
+
throw new TypeError('Client error message must be non-blank.');
|
|
3
5
|
super(message, options);
|
|
4
6
|
this.name = 'ClientError';
|
|
5
7
|
}
|
|
6
8
|
}
|
|
7
|
-
//# sourceMappingURL=client-error.js.map
|