@astrale-os/kernel-client 0.5.1 → 0.6.0-beta.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/auth/auth.d.ts +18 -0
- package/dist/auth/auth.js +15 -0
- package/dist/auth/authorization.d.ts +13 -0
- package/dist/auth/authorization.js +17 -0
- package/dist/auth/credential.d.ts +19 -0
- package/dist/auth/credential.js +21 -0
- package/dist/auth/identity.d.ts +14 -0
- package/dist/auth/identity.js +15 -0
- package/dist/auth/index.d.ts +6 -16
- package/dist/auth/index.js +5 -10
- package/dist/auth/provision.d.ts +8 -0
- package/dist/auth/provision.js +10 -0
- package/dist/client/admission.d.ts +4 -0
- package/dist/client/admission.js +34 -0
- package/dist/client/client.d.ts +24 -109
- package/dist/client/client.js +80 -381
- package/dist/client/credential.d.ts +12 -0
- package/dist/client/credential.js +51 -0
- package/dist/client/index.d.ts +6 -0
- package/dist/client/index.js +4 -0
- package/dist/client/request.d.ts +26 -0
- package/dist/client/request.js +100 -0
- package/dist/client/result.d.ts +35 -0
- package/dist/client/result.js +28 -0
- package/dist/client/routing-control.d.ts +10 -0
- package/dist/client/routing-control.js +23 -0
- package/dist/errors/client-error.d.ts +3 -0
- package/dist/errors/client-error.js +8 -0
- package/dist/errors/index.d.ts +7 -6
- package/dist/errors/index.js +7 -4
- package/dist/errors/miss-error.d.ts +8 -0
- package/dist/errors/miss-error.js +10 -0
- package/dist/errors/protocol-error.d.ts +9 -0
- package/dist/errors/protocol-error.js +9 -0
- package/dist/errors/response-error.d.ts +11 -0
- package/dist/errors/response-error.js +16 -0
- package/dist/errors/session-error.d.ts +8 -20
- package/dist/errors/session-error.js +6 -22
- package/dist/errors/stale-route-error.d.ts +9 -0
- package/dist/errors/stale-route-error.js +12 -0
- package/dist/errors/transport-error.d.ts +30 -0
- package/dist/errors/transport-error.js +18 -0
- 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 +139 -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 +120 -0
- package/dist/graph/domain/provenance.d.ts +6 -0
- package/dist/graph/domain/provenance.js +11 -0
- package/dist/graph/errors.d.ts +8 -0
- package/dist/graph/errors.js +14 -0
- package/dist/graph/graph.d.ts +26 -0
- package/dist/graph/graph.js +18 -0
- package/dist/graph/index.d.ts +8 -26
- package/dist/graph/index.js +6 -21
- package/dist/graph/mutation.d.ts +5 -0
- package/dist/graph/mutation.js +17 -0
- package/dist/graph/page/index.d.ts +2 -0
- package/dist/graph/page/index.js +1 -0
- package/dist/graph/page/neighbors.d.ts +9 -0
- package/dist/graph/page/neighbors.js +34 -0
- package/dist/graph/page/page.d.ts +37 -0
- package/dist/graph/page/page.js +55 -0
- package/dist/graph/page-contract.d.ts +13 -0
- package/dist/graph/page-contract.js +1 -0
- package/dist/graph/provenance.d.ts +12 -0
- package/dist/graph/provenance.js +37 -0
- package/dist/graph/query.d.ts +4 -0
- package/dist/graph/query.js +69 -0
- package/dist/graph/read.d.ts +6 -0
- package/dist/graph/read.js +17 -0
- package/dist/index.d.ts +6 -25
- package/dist/index.js +6 -21
- package/dist/pacer/batcher/batcher.d.ts +7 -0
- package/dist/pacer/batcher/batcher.js +13 -0
- package/dist/pacer/batcher/defaults.d.ts +2 -0
- package/dist/pacer/batcher/defaults.js +2 -0
- package/dist/pacer/batcher/index.d.ts +1 -0
- package/dist/pacer/batcher/index.js +1 -0
- package/dist/pacer/index.d.ts +4 -10
- package/dist/pacer/index.js +4 -11
- package/dist/pacer/limiter/defaults.d.ts +2 -0
- package/dist/pacer/limiter/defaults.js +2 -0
- package/dist/pacer/limiter/index.d.ts +1 -0
- package/dist/pacer/limiter/index.js +1 -0
- package/dist/pacer/limiter/limiter.d.ts +7 -0
- package/dist/pacer/limiter/limiter.js +14 -0
- package/dist/pacer/queue/defaults.d.ts +1 -0
- package/dist/pacer/queue/defaults.js +1 -0
- package/dist/pacer/queue/index.d.ts +1 -0
- package/dist/pacer/queue/index.js +1 -0
- package/dist/pacer/queue/queue.d.ts +6 -0
- package/dist/pacer/queue/queue.js +12 -0
- package/dist/pacer/retry/defaults.d.ts +6 -0
- package/dist/pacer/retry/defaults.js +16 -0
- package/dist/pacer/retry/index.d.ts +1 -0
- package/dist/pacer/retry/index.js +1 -0
- package/dist/pacer/retry/retry.d.ts +9 -0
- package/dist/pacer/retry/retry.js +55 -0
- package/dist/pool/index.d.ts +2 -4
- package/dist/pool/index.js +0 -2
- package/dist/pool/pool.d.ts +19 -59
- package/dist/pool/pool.js +46 -64
- package/dist/pool/target.d.ts +15 -0
- package/dist/pool/target.js +49 -0
- package/dist/schema/admission.d.ts +12 -0
- package/dist/schema/admission.js +17 -0
- package/dist/schema/contracts.d.ts +12 -0
- package/dist/schema/contracts.js +1 -0
- package/dist/schema/index.d.ts +3 -16
- package/dist/schema/index.js +2 -12
- package/dist/schema/introspection.d.ts +5 -0
- package/dist/schema/introspection.js +15 -0
- package/dist/schema/operation.d.ts +5 -0
- package/dist/schema/operation.js +9 -0
- package/dist/schema/schema.d.ts +19 -0
- package/dist/schema/schema.js +43 -0
- package/dist/session/bound.d.ts +42 -9
- package/dist/session/bound.js +70 -37
- package/dist/session/context/control.d.ts +5 -0
- package/dist/session/context/control.js +17 -0
- package/dist/session/context/index.d.ts +4 -0
- package/dist/session/context/index.js +4 -0
- package/dist/session/context/limits.d.ts +7 -0
- package/dist/session/context/limits.js +18 -0
- package/dist/session/context/operation.d.ts +19 -0
- package/dist/session/context/operation.js +72 -0
- package/dist/session/context/policy.d.ts +11 -0
- package/dist/session/context/policy.js +69 -0
- package/dist/session/discovery/bundle.d.ts +17 -0
- package/dist/session/discovery/bundle.js +55 -0
- package/dist/session/discovery/discovery.d.ts +19 -0
- package/dist/session/discovery/discovery.js +55 -0
- package/dist/session/discovery/index.d.ts +20 -0
- package/dist/session/discovery/index.js +15 -0
- package/dist/session/discovery/publication.d.ts +23 -0
- package/dist/session/discovery/publication.js +123 -0
- package/dist/session/discovery/snapshot.d.ts +12 -0
- package/dist/session/discovery/snapshot.js +3 -0
- package/dist/session/discovery/transport.d.ts +6 -0
- package/dist/session/discovery/transport.js +13 -0
- package/dist/session/index.d.ts +10 -16
- package/dist/session/index.js +3 -9
- package/dist/session/reference.d.ts +36 -0
- package/dist/session/reference.js +74 -0
- package/dist/session/routing/auth.d.ts +18 -0
- package/dist/session/routing/auth.js +39 -0
- package/dist/session/routing/cache.d.ts +20 -0
- package/dist/session/routing/cache.js +115 -0
- package/dist/session/routing/dispatch.d.ts +34 -0
- package/dist/session/routing/dispatch.js +137 -0
- package/dist/session/routing/envelope.d.ts +13 -0
- package/dist/session/routing/envelope.js +35 -0
- package/dist/session/routing/expectation.d.ts +6 -0
- package/dist/session/routing/expectation.js +1 -0
- package/dist/session/routing/index.d.ts +6 -0
- package/dist/session/routing/index.js +5 -0
- package/dist/session/routing/request.d.ts +8 -0
- package/dist/session/routing/request.js +25 -0
- package/dist/session/session.d.ts +67 -0
- package/dist/session/session.js +257 -0
- package/dist/session/session.typecheck.d.ts +1 -0
- package/dist/session/session.typecheck.js +31 -0
- package/dist/session/views/catalog.d.ts +15 -0
- package/dist/session/views/catalog.js +70 -0
- package/dist/session/views/index.d.ts +2 -0
- package/dist/session/views/index.js +2 -0
- package/dist/session/views/resolve.d.ts +11 -0
- package/dist/session/views/resolve.js +13 -0
- package/dist/store/entity-index.d.ts +22 -0
- package/dist/store/entity-index.js +94 -0
- package/dist/store/index.d.ts +1 -26
- package/dist/store/index.js +1 -19
- package/dist/store/memory.d.ts +46 -97
- package/dist/store/memory.js +346 -763
- package/dist/store/mutation.d.ts +5 -0
- package/dist/store/mutation.js +34 -0
- package/dist/store/observe.d.ts +3 -0
- package/dist/store/observe.js +17 -0
- package/dist/store/optimistic.d.ts +12 -0
- package/dist/store/optimistic.js +43 -0
- package/dist/store/query-key.d.ts +5 -0
- package/dist/store/query-key.js +22 -0
- package/dist/store/shape.d.ts +25 -0
- package/dist/store/shape.js +29 -0
- package/dist/store/store.d.ts +68 -0
- package/dist/store/store.js +144 -0
- package/dist/store/store.typecheck.d.ts +1 -0
- package/dist/store/store.typecheck.js +40 -0
- package/dist/transport/auto/decision.d.ts +22 -0
- package/dist/transport/auto/decision.js +48 -0
- package/dist/transport/auto/fallback.d.ts +16 -0
- package/dist/transport/auto/fallback.js +75 -0
- package/dist/transport/auto/index.d.ts +2 -0
- package/dist/transport/auto/index.js +2 -0
- package/dist/transport/auto/transport.d.ts +37 -0
- package/dist/transport/auto/transport.js +140 -0
- package/dist/transport/auto/warning.d.ts +13 -0
- package/dist/transport/auto/warning.js +18 -0
- package/dist/transport/deadline.d.ts +11 -0
- package/dist/transport/deadline.js +39 -0
- package/dist/transport/failure.d.ts +7 -0
- package/dist/transport/failure.js +9 -0
- package/dist/transport/http/index.d.ts +1 -0
- package/dist/transport/http/index.js +1 -0
- package/dist/transport/http/response.d.ts +8 -0
- package/dist/transport/http/response.js +79 -0
- package/dist/transport/http/stream.d.ts +26 -0
- package/dist/transport/http/stream.js +214 -0
- package/dist/transport/http/transport.d.ts +32 -0
- package/dist/transport/http/transport.js +343 -0
- package/dist/transport/index.d.ts +2 -8
- package/dist/transport/index.js +1 -6
- package/dist/transport/transport.d.ts +34 -0
- package/dist/transport/transport.js +1 -0
- package/dist/transport/websocket/connection.d.ts +38 -0
- package/dist/transport/websocket/connection.js +284 -0
- package/dist/transport/websocket/exchange.d.ts +46 -0
- package/dist/transport/websocket/exchange.js +300 -0
- package/dist/transport/websocket/index.d.ts +1 -0
- package/dist/transport/websocket/index.js +1 -0
- package/dist/transport/websocket/transport.d.ts +46 -0
- package/dist/transport/websocket/transport.js +164 -0
- package/package.json +41 -35
- package/dist/auth/addressing.d.ts +0 -32
- package/dist/auth/addressing.d.ts.map +0 -1
- package/dist/auth/addressing.js +0 -36
- package/dist/auth/addressing.js.map +0 -1
- package/dist/auth/api.d.ts +0 -70
- package/dist/auth/api.d.ts.map +0 -1
- package/dist/auth/api.js +0 -36
- package/dist/auth/api.js.map +0 -1
- package/dist/auth/batch.d.ts +0 -18
- package/dist/auth/batch.d.ts.map +0 -1
- package/dist/auth/batch.js +0 -25
- package/dist/auth/batch.js.map +0 -1
- package/dist/auth/composition.d.ts +0 -27
- package/dist/auth/composition.d.ts.map +0 -1
- package/dist/auth/composition.js +0 -83
- package/dist/auth/composition.js.map +0 -1
- package/dist/auth/defaults.d.ts +0 -3
- package/dist/auth/defaults.d.ts.map +0 -1
- package/dist/auth/defaults.js +0 -3
- package/dist/auth/defaults.js.map +0 -1
- package/dist/auth/index.d.ts.map +0 -1
- package/dist/auth/index.js.map +0 -1
- package/dist/auth/minting.d.ts +0 -35
- package/dist/auth/minting.d.ts.map +0 -1
- package/dist/auth/minting.js +0 -31
- package/dist/auth/minting.js.map +0 -1
- package/dist/auth/permissions.d.ts +0 -55
- package/dist/auth/permissions.d.ts.map +0 -1
- package/dist/auth/permissions.js +0 -47
- package/dist/auth/permissions.js.map +0 -1
- package/dist/auth/principal.d.ts +0 -19
- package/dist/auth/principal.d.ts.map +0 -1
- package/dist/auth/principal.js +0 -46
- package/dist/auth/principal.js.map +0 -1
- package/dist/auth/shorthands.d.ts +0 -19
- package/dist/auth/shorthands.d.ts.map +0 -1
- package/dist/auth/shorthands.js +0 -27
- package/dist/auth/shorthands.js.map +0 -1
- package/dist/client/batch.d.ts +0 -26
- package/dist/client/batch.d.ts.map +0 -1
- package/dist/client/batch.js +0 -8
- package/dist/client/batch.js.map +0 -1
- package/dist/client/bound.d.ts +0 -27
- package/dist/client/bound.d.ts.map +0 -1
- package/dist/client/bound.js +0 -14
- package/dist/client/bound.js.map +0 -1
- package/dist/client/client.d.ts.map +0 -1
- package/dist/client/client.js.map +0 -1
- package/dist/client/config.d.ts +0 -112
- package/dist/client/config.d.ts.map +0 -1
- package/dist/client/config.js +0 -10
- package/dist/client/config.js.map +0 -1
- package/dist/client/fn-map.d.ts +0 -61
- package/dist/client/fn-map.d.ts.map +0 -1
- package/dist/client/fn-map.js +0 -2
- package/dist/client/fn-map.js.map +0 -1
- package/dist/client/freeze.d.ts +0 -32
- package/dist/client/freeze.d.ts.map +0 -1
- package/dist/client/freeze.js +0 -42
- package/dist/client/freeze.js.map +0 -1
- package/dist/client/hooks.d.ts +0 -49
- package/dist/client/hooks.d.ts.map +0 -1
- package/dist/client/hooks.js +0 -2
- package/dist/client/hooks.js.map +0 -1
- package/dist/errors/errors.d.ts +0 -156
- package/dist/errors/errors.d.ts.map +0 -1
- package/dist/errors/errors.js +0 -238
- package/dist/errors/errors.js.map +0 -1
- package/dist/errors/guards.d.ts +0 -39
- package/dist/errors/guards.d.ts.map +0 -1
- package/dist/errors/guards.js +0 -127
- package/dist/errors/guards.js.map +0 -1
- package/dist/errors/index.d.ts.map +0 -1
- package/dist/errors/index.js.map +0 -1
- package/dist/errors/session-error.d.ts.map +0 -1
- package/dist/errors/session-error.js.map +0 -1
- package/dist/graph/api.d.ts +0 -85
- package/dist/graph/api.d.ts.map +0 -1
- package/dist/graph/api.js +0 -66
- package/dist/graph/api.js.map +0 -1
- package/dist/graph/index.d.ts.map +0 -1
- package/dist/graph/index.js.map +0 -1
- package/dist/graph/mutate/builder.d.ts +0 -108
- package/dist/graph/mutate/builder.d.ts.map +0 -1
- package/dist/graph/mutate/builder.js +0 -127
- package/dist/graph/mutate/builder.js.map +0 -1
- package/dist/graph/mutate/index.d.ts +0 -5
- package/dist/graph/mutate/index.d.ts.map +0 -1
- package/dist/graph/mutate/index.js +0 -3
- package/dist/graph/mutate/index.js.map +0 -1
- package/dist/graph/mutate/shorthands.d.ts +0 -42
- package/dist/graph/mutate/shorthands.d.ts.map +0 -1
- package/dist/graph/mutate/shorthands.js +0 -65
- package/dist/graph/mutate/shorthands.js.map +0 -1
- package/dist/graph/named.d.ts +0 -38
- package/dist/graph/named.d.ts.map +0 -1
- package/dist/graph/named.js +0 -47
- package/dist/graph/named.js.map +0 -1
- package/dist/graph/query/builder.d.ts +0 -116
- package/dist/graph/query/builder.d.ts.map +0 -1
- package/dist/graph/query/builder.js +0 -136
- package/dist/graph/query/builder.js.map +0 -1
- package/dist/graph/query/edge-ref.d.ts +0 -13
- package/dist/graph/query/edge-ref.d.ts.map +0 -1
- package/dist/graph/query/edge-ref.js +0 -56
- package/dist/graph/query/edge-ref.js.map +0 -1
- package/dist/graph/query/edges.d.ts +0 -10
- package/dist/graph/query/edges.d.ts.map +0 -1
- package/dist/graph/query/edges.js +0 -11
- package/dist/graph/query/edges.js.map +0 -1
- package/dist/graph/query/errors.d.ts +0 -31
- package/dist/graph/query/errors.d.ts.map +0 -1
- package/dist/graph/query/errors.js +0 -28
- package/dist/graph/query/errors.js.map +0 -1
- package/dist/graph/query/filter.d.ts +0 -50
- package/dist/graph/query/filter.d.ts.map +0 -1
- package/dist/graph/query/filter.js +0 -32
- package/dist/graph/query/filter.js.map +0 -1
- package/dist/graph/query/index.d.ts +0 -12
- package/dist/graph/query/index.d.ts.map +0 -1
- package/dist/graph/query/index.js +0 -7
- package/dist/graph/query/index.js.map +0 -1
- package/dist/graph/query/lower.d.ts +0 -30
- package/dist/graph/query/lower.d.ts.map +0 -1
- package/dist/graph/query/lower.js +0 -171
- package/dist/graph/query/lower.js.map +0 -1
- package/dist/graph/query/shorthands.d.ts +0 -34
- package/dist/graph/query/shorthands.d.ts.map +0 -1
- package/dist/graph/query/shorthands.js +0 -71
- package/dist/graph/query/shorthands.js.map +0 -1
- package/dist/graph/query/traverse.d.ts +0 -59
- package/dist/graph/query/traverse.d.ts.map +0 -1
- package/dist/graph/query/traverse.js +0 -144
- package/dist/graph/query/traverse.js.map +0 -1
- package/dist/graph/reconcile/execute.d.ts +0 -8
- package/dist/graph/reconcile/execute.d.ts.map +0 -1
- package/dist/graph/reconcile/execute.js +0 -56
- package/dist/graph/reconcile/execute.js.map +0 -1
- package/dist/graph/reconcile/index.d.ts +0 -5
- package/dist/graph/reconcile/index.d.ts.map +0 -1
- package/dist/graph/reconcile/index.js +0 -3
- package/dist/graph/reconcile/index.js.map +0 -1
- package/dist/graph/reconcile/input.d.ts +0 -80
- package/dist/graph/reconcile/input.d.ts.map +0 -1
- package/dist/graph/reconcile/input.js +0 -5
- package/dist/graph/reconcile/input.js.map +0 -1
- package/dist/graph/reconcile/normalize.d.ts +0 -3
- package/dist/graph/reconcile/normalize.d.ts.map +0 -1
- package/dist/graph/reconcile/normalize.js +0 -144
- package/dist/graph/reconcile/normalize.js.map +0 -1
- package/dist/graph/reconcile/result.d.ts +0 -19
- package/dist/graph/reconcile/result.d.ts.map +0 -1
- package/dist/graph/reconcile/result.js +0 -95
- package/dist/graph/reconcile/result.js.map +0 -1
- package/dist/graph/reconcile/scope.d.ts +0 -6
- package/dist/graph/reconcile/scope.d.ts.map +0 -1
- package/dist/graph/reconcile/scope.js +0 -69
- package/dist/graph/reconcile/scope.js.map +0 -1
- package/dist/graph/result/envelope.d.ts +0 -37
- package/dist/graph/result/envelope.d.ts.map +0 -1
- package/dist/graph/result/envelope.js +0 -59
- package/dist/graph/result/envelope.js.map +0 -1
- package/dist/graph/result/index.d.ts +0 -6
- package/dist/graph/result/index.d.ts.map +0 -1
- package/dist/graph/result/index.js +0 -4
- package/dist/graph/result/index.js.map +0 -1
- package/dist/graph/result/next.d.ts +0 -16
- package/dist/graph/result/next.d.ts.map +0 -1
- package/dist/graph/result/next.js +0 -77
- package/dist/graph/result/next.js.map +0 -1
- package/dist/graph/result/paged.d.ts +0 -30
- package/dist/graph/result/paged.d.ts.map +0 -1
- package/dist/graph/result/paged.js +0 -41
- package/dist/graph/result/paged.js.map +0 -1
- package/dist/graph/wire.d.ts +0 -33
- package/dist/graph/wire.d.ts.map +0 -1
- package/dist/graph/wire.js +0 -16
- package/dist/graph/wire.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/pacer/batcher.d.ts +0 -11
- package/dist/pacer/batcher.d.ts.map +0 -1
- package/dist/pacer/batcher.js +0 -15
- package/dist/pacer/batcher.js.map +0 -1
- package/dist/pacer/defaults.d.ts +0 -18
- package/dist/pacer/defaults.d.ts.map +0 -1
- package/dist/pacer/defaults.js +0 -18
- package/dist/pacer/defaults.js.map +0 -1
- package/dist/pacer/index.d.ts.map +0 -1
- package/dist/pacer/index.js.map +0 -1
- package/dist/pacer/queue.d.ts +0 -11
- package/dist/pacer/queue.d.ts.map +0 -1
- package/dist/pacer/queue.js +0 -15
- package/dist/pacer/queue.js.map +0 -1
- package/dist/pacer/rate-limiter.d.ts +0 -11
- package/dist/pacer/rate-limiter.d.ts.map +0 -1
- package/dist/pacer/rate-limiter.js +0 -15
- package/dist/pacer/rate-limiter.js.map +0 -1
- package/dist/pacer/retry.d.ts +0 -14
- package/dist/pacer/retry.d.ts.map +0 -1
- package/dist/pacer/retry.js +0 -50
- package/dist/pacer/retry.js.map +0 -1
- package/dist/pool/errors.d.ts +0 -13
- package/dist/pool/errors.d.ts.map +0 -1
- package/dist/pool/errors.js +0 -16
- package/dist/pool/errors.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/schema/bound/binder.d.ts +0 -49
- package/dist/schema/bound/binder.d.ts.map +0 -1
- package/dist/schema/bound/binder.js +0 -195
- package/dist/schema/bound/binder.js.map +0 -1
- package/dist/schema/bound/bound-node.d.ts +0 -105
- package/dist/schema/bound/bound-node.d.ts.map +0 -1
- package/dist/schema/bound/bound-node.js +0 -128
- package/dist/schema/bound/bound-node.js.map +0 -1
- package/dist/schema/bound/index.d.ts +0 -10
- package/dist/schema/bound/index.d.ts.map +0 -1
- package/dist/schema/bound/index.js +0 -5
- package/dist/schema/bound/index.js.map +0 -1
- package/dist/schema/bound/view.d.ts +0 -44
- package/dist/schema/bound/view.d.ts.map +0 -1
- package/dist/schema/bound/view.js +0 -117
- package/dist/schema/bound/view.js.map +0 -1
- package/dist/schema/bound/write-props.d.ts +0 -38
- package/dist/schema/bound/write-props.d.ts.map +0 -1
- package/dist/schema/bound/write-props.js +0 -2
- package/dist/schema/bound/write-props.js.map +0 -1
- package/dist/schema/call-args.d.ts +0 -6
- package/dist/schema/call-args.d.ts.map +0 -1
- package/dist/schema/call-args.js +0 -21
- package/dist/schema/call-args.js.map +0 -1
- package/dist/schema/class-proxy.d.ts +0 -11
- package/dist/schema/class-proxy.d.ts.map +0 -1
- package/dist/schema/class-proxy.js +0 -46
- package/dist/schema/class-proxy.js.map +0 -1
- package/dist/schema/extract.d.ts +0 -24
- package/dist/schema/extract.d.ts.map +0 -1
- package/dist/schema/extract.js +0 -45
- package/dist/schema/extract.js.map +0 -1
- package/dist/schema/from-entries.d.ts +0 -12
- package/dist/schema/from-entries.d.ts.map +0 -1
- package/dist/schema/from-entries.js +0 -39
- package/dist/schema/from-entries.js.map +0 -1
- package/dist/schema/index.d.ts.map +0 -1
- package/dist/schema/index.js.map +0 -1
- package/dist/schema/known-dispatch.d.ts +0 -6
- package/dist/schema/known-dispatch.d.ts.map +0 -1
- package/dist/schema/known-dispatch.js +0 -39
- package/dist/schema/known-dispatch.js.map +0 -1
- package/dist/schema/node-proxy.d.ts +0 -21
- package/dist/schema/node-proxy.d.ts.map +0 -1
- package/dist/schema/node-proxy.js +0 -75
- package/dist/schema/node-proxy.js.map +0 -1
- package/dist/schema/persistence.d.ts +0 -31
- package/dist/schema/persistence.d.ts.map +0 -1
- package/dist/schema/persistence.js +0 -2
- package/dist/schema/persistence.js.map +0 -1
- package/dist/schema/proxy-types.d.ts +0 -131
- package/dist/schema/proxy-types.d.ts.map +0 -1
- package/dist/schema/proxy-types.js +0 -2
- package/dist/schema/proxy-types.js.map +0 -1
- package/dist/schema/registry.d.ts +0 -50
- package/dist/schema/registry.d.ts.map +0 -1
- package/dist/schema/registry.js +0 -110
- package/dist/schema/registry.js.map +0 -1
- package/dist/schema/resolve.d.ts +0 -26
- package/dist/schema/resolve.d.ts.map +0 -1
- package/dist/schema/resolve.js +0 -27
- package/dist/schema/resolve.js.map +0 -1
- package/dist/schema/typed-client.d.ts +0 -10
- package/dist/schema/typed-client.d.ts.map +0 -1
- package/dist/schema/typed-client.js +0 -26
- package/dist/schema/typed-client.js.map +0 -1
- package/dist/schema/types.d.ts +0 -9
- package/dist/schema/types.d.ts.map +0 -1
- package/dist/schema/types.js +0 -2
- package/dist/schema/types.js.map +0 -1
- package/dist/session/bound.d.ts.map +0 -1
- package/dist/session/bound.js.map +0 -1
- package/dist/session/client-session.d.ts +0 -72
- package/dist/session/client-session.d.ts.map +0 -1
- package/dist/session/client-session.js +0 -673
- package/dist/session/client-session.js.map +0 -1
- package/dist/session/config.d.ts +0 -168
- package/dist/session/config.d.ts.map +0 -1
- package/dist/session/config.js +0 -2
- package/dist/session/config.js.map +0 -1
- package/dist/session/delegation/cache.d.ts +0 -139
- package/dist/session/delegation/cache.d.ts.map +0 -1
- package/dist/session/delegation/cache.js +0 -256
- package/dist/session/delegation/cache.js.map +0 -1
- package/dist/session/delegation/errors.d.ts +0 -44
- package/dist/session/delegation/errors.d.ts.map +0 -1
- package/dist/session/delegation/errors.js +0 -62
- package/dist/session/delegation/errors.js.map +0 -1
- package/dist/session/delegation/policy.d.ts +0 -183
- package/dist/session/delegation/policy.d.ts.map +0 -1
- package/dist/session/delegation/policy.js +0 -114
- package/dist/session/delegation/policy.js.map +0 -1
- package/dist/session/delegation/utils.d.ts +0 -4
- package/dist/session/delegation/utils.d.ts.map +0 -1
- package/dist/session/delegation/utils.js +0 -12
- package/dist/session/delegation/utils.js.map +0 -1
- package/dist/session/delegation-mint.d.ts +0 -13
- package/dist/session/delegation-mint.d.ts.map +0 -1
- package/dist/session/delegation-mint.js +0 -39
- package/dist/session/delegation-mint.js.map +0 -1
- package/dist/session/dispatch-routes.d.ts +0 -27
- package/dist/session/dispatch-routes.d.ts.map +0 -1
- package/dist/session/dispatch-routes.js +0 -77
- package/dist/session/dispatch-routes.js.map +0 -1
- package/dist/session/errors/index.d.ts +0 -6
- package/dist/session/errors/index.d.ts.map +0 -1
- package/dist/session/errors/index.js +0 -8
- package/dist/session/errors/index.js.map +0 -1
- package/dist/session/errors/session-errors.d.ts +0 -52
- package/dist/session/errors/session-errors.d.ts.map +0 -1
- package/dist/session/errors/session-errors.js +0 -70
- package/dist/session/errors/session-errors.js.map +0 -1
- package/dist/session/forward.d.ts +0 -15
- package/dist/session/forward.d.ts.map +0 -1
- package/dist/session/forward.js +0 -40
- package/dist/session/forward.js.map +0 -1
- package/dist/session/helpers.d.ts +0 -23
- package/dist/session/helpers.d.ts.map +0 -1
- package/dist/session/helpers.js +0 -56
- package/dist/session/helpers.js.map +0 -1
- package/dist/session/hooks.d.ts +0 -140
- package/dist/session/hooks.d.ts.map +0 -1
- package/dist/session/hooks.js +0 -2
- package/dist/session/hooks.js.map +0 -1
- package/dist/session/index.d.ts.map +0 -1
- package/dist/session/index.js.map +0 -1
- package/dist/session/redirect/errors.d.ts +0 -45
- package/dist/session/redirect/errors.d.ts.map +0 -1
- package/dist/session/redirect/errors.js +0 -52
- package/dist/session/redirect/errors.js.map +0 -1
- package/dist/session/redirect/policy.d.ts +0 -79
- package/dist/session/redirect/policy.d.ts.map +0 -1
- package/dist/session/redirect/policy.js +0 -69
- package/dist/session/redirect/policy.js.map +0 -1
- package/dist/session/types.d.ts +0 -54
- package/dist/session/types.d.ts.map +0 -1
- package/dist/session/types.js +0 -2
- package/dist/session/types.js.map +0 -1
- package/dist/store/canonicalize.d.ts +0 -44
- package/dist/store/canonicalize.d.ts.map +0 -1
- package/dist/store/canonicalize.js +0 -0
- package/dist/store/canonicalize.js.map +0 -1
- package/dist/store/entities.d.ts +0 -81
- package/dist/store/entities.d.ts.map +0 -1
- package/dist/store/entities.js +0 -202
- package/dist/store/entities.js.map +0 -1
- package/dist/store/index.d.ts.map +0 -1
- package/dist/store/index.js.map +0 -1
- package/dist/store/invalidate.d.ts +0 -66
- package/dist/store/invalidate.d.ts.map +0 -1
- package/dist/store/invalidate.js +0 -117
- package/dist/store/invalidate.js.map +0 -1
- package/dist/store/memory.d.ts.map +0 -1
- package/dist/store/memory.js.map +0 -1
- package/dist/store/overlay.d.ts +0 -118
- package/dist/store/overlay.d.ts.map +0 -1
- package/dist/store/overlay.js +0 -237
- package/dist/store/overlay.js.map +0 -1
- package/dist/store/schedule.d.ts +0 -31
- package/dist/store/schedule.d.ts.map +0 -1
- package/dist/store/schedule.js +0 -76
- package/dist/store/schedule.js.map +0 -1
- package/dist/store/shapes.d.ts +0 -92
- package/dist/store/shapes.d.ts.map +0 -1
- package/dist/store/shapes.js +0 -369
- package/dist/store/shapes.js.map +0 -1
- package/dist/store/types.d.ts +0 -168
- package/dist/store/types.d.ts.map +0 -1
- package/dist/store/types.js +0 -7
- package/dist/store/types.js.map +0 -1
- package/dist/transport/binary.d.ts +0 -15
- package/dist/transport/binary.d.ts.map +0 -1
- package/dist/transport/binary.js +0 -2
- package/dist/transport/binary.js.map +0 -1
- package/dist/transport/contract.d.ts +0 -58
- package/dist/transport/contract.d.ts.map +0 -1
- package/dist/transport/contract.js +0 -11
- package/dist/transport/contract.js.map +0 -1
- package/dist/transport/fetch.d.ts +0 -31
- package/dist/transport/fetch.d.ts.map +0 -1
- package/dist/transport/fetch.js +0 -78
- package/dist/transport/fetch.js.map +0 -1
- package/dist/transport/http-envelope.d.ts +0 -49
- package/dist/transport/http-envelope.d.ts.map +0 -1
- package/dist/transport/http-envelope.js +0 -418
- package/dist/transport/http-envelope.js.map +0 -1
- package/dist/transport/http-routed.d.ts +0 -61
- package/dist/transport/http-routed.d.ts.map +0 -1
- package/dist/transport/http-routed.js +0 -409
- package/dist/transport/http-routed.js.map +0 -1
- package/dist/transport/index.d.ts.map +0 -1
- package/dist/transport/index.js.map +0 -1
- package/dist/transport/request-id.d.ts +0 -9
- package/dist/transport/request-id.d.ts.map +0 -1
- package/dist/transport/request-id.js +0 -12
- package/dist/transport/request-id.js.map +0 -1
- package/dist/transport/ws-envelope.d.ts +0 -74
- package/dist/transport/ws-envelope.d.ts.map +0 -1
- package/dist/transport/ws-envelope.js +0 -567
- package/dist/transport/ws-envelope.js.map +0 -1
- package/dist/util/race-signal.d.ts +0 -12
- package/dist/util/race-signal.d.ts.map +0 -1
- package/dist/util/race-signal.js +0 -34
- package/dist/util/race-signal.js.map +0 -1
- package/dist/wire/controller.d.ts +0 -38
- package/dist/wire/controller.d.ts.map +0 -1
- package/dist/wire/controller.js +0 -38
- package/dist/wire/controller.js.map +0 -1
- package/dist/wire/index.d.ts +0 -7
- package/dist/wire/index.d.ts.map +0 -1
- package/dist/wire/index.js +0 -4
- package/dist/wire/index.js.map +0 -1
- package/dist/wire/meta.d.ts +0 -81
- package/dist/wire/meta.d.ts.map +0 -1
- package/dist/wire/meta.js +0 -44
- package/dist/wire/meta.js.map +0 -1
- package/dist/wire/sse.d.ts +0 -67
- package/dist/wire/sse.d.ts.map +0 -1
- package/dist/wire/sse.js +0 -170
- package/dist/wire/sse.js.map +0 -1
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Identity, IdentityId, MintedCredential, ProvisionRequest, ProvisionResult } from '@astrale-os/kernel-core/auth';
|
|
2
|
+
import type { PathLike } from '@astrale-os/kernel-core/path';
|
|
3
|
+
import type { Input } from '../client/index.js';
|
|
4
|
+
import type { RequestOptions } from '../transport/index.js';
|
|
5
|
+
import type { PolicyDecisionInput } from './authorization.js';
|
|
6
|
+
import type { DelegateOptions, MintOptions } from './credential.js';
|
|
7
|
+
import type { WhoisInput } from './identity.js';
|
|
8
|
+
export type AuthCall = (target: PathLike, input: Input, options?: RequestOptions) => Promise<Input>;
|
|
9
|
+
export interface AuthApi {
|
|
10
|
+
provision(input: ProvisionRequest, options?: RequestOptions): Promise<ProvisionResult>;
|
|
11
|
+
whoami(options?: RequestOptions): Promise<Identity>;
|
|
12
|
+
whois(input: WhoisInput, options?: RequestOptions): Promise<Identity | null>;
|
|
13
|
+
can(input: PolicyDecisionInput, options?: RequestOptions): Promise<boolean>;
|
|
14
|
+
mint(input: MintOptions, options?: RequestOptions): Promise<MintedCredential>;
|
|
15
|
+
delegate(identity: IdentityId, input: DelegateOptions, options?: RequestOptions): Promise<MintedCredential>;
|
|
16
|
+
}
|
|
17
|
+
/** Bind the current Core identity syscalls without recreating legacy grant-edge verbs. */
|
|
18
|
+
export declare function createAuth(call: AuthCall): AuthApi;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { authorizationApi } from './authorization.js';
|
|
2
|
+
import { credentialApi } from './credential.js';
|
|
3
|
+
import { identityApi } from './identity.js';
|
|
4
|
+
import { provisionApi } from './provision.js';
|
|
5
|
+
/** Bind the current Core identity syscalls without recreating legacy grant-edge verbs. */
|
|
6
|
+
export function createAuth(call) {
|
|
7
|
+
if (typeof call !== 'function')
|
|
8
|
+
throw new TypeError('Auth call capability is invalid.');
|
|
9
|
+
return Object.freeze({
|
|
10
|
+
...provisionApi(call),
|
|
11
|
+
...identityApi(call),
|
|
12
|
+
...authorizationApi(call),
|
|
13
|
+
...credentialApi(call),
|
|
14
|
+
});
|
|
15
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { NodeId } from '@astrale-os/kernel-core/graph/node';
|
|
2
|
+
import type { NodePath, PathLike } from '@astrale-os/kernel-core/path';
|
|
3
|
+
import type { PolicyRef } from '@astrale-os/kernel-dsl/v1';
|
|
4
|
+
import type { RequestOptions } from '../transport/index.js';
|
|
5
|
+
import type { AuthCall } from './auth.js';
|
|
6
|
+
export interface PolicyDecisionInput {
|
|
7
|
+
readonly policy: PathLike | PolicyRef;
|
|
8
|
+
readonly object: NodeId;
|
|
9
|
+
}
|
|
10
|
+
export declare const IDENTITY_CAN_PATH: NodePath;
|
|
11
|
+
export declare function authorizationApi(call: AuthCall): Readonly<{
|
|
12
|
+
can(input: PolicyDecisionInput, options?: RequestOptions): Promise<boolean>;
|
|
13
|
+
}>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Path } from '@astrale-os/kernel-core/path';
|
|
2
|
+
import { identity } from '@astrale-os/kernel-core/schema/kernel/syscalls/references';
|
|
3
|
+
const identityOwner = Path.project(identity.whoami.owner);
|
|
4
|
+
export const IDENTITY_CAN_PATH = Path.staticMethod(identityOwner, identity.can.name).raw;
|
|
5
|
+
export function authorizationApi(call) {
|
|
6
|
+
return Object.freeze({
|
|
7
|
+
async can(input, options) {
|
|
8
|
+
const output = (await call(IDENTITY_CAN_PATH, Object.freeze({ policy: policyPath(input.policy), object: input.object }), options));
|
|
9
|
+
return output.allowed;
|
|
10
|
+
},
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
function policyPath(input) {
|
|
14
|
+
return input instanceof Path || typeof input === 'string'
|
|
15
|
+
? Path.from(input).raw
|
|
16
|
+
: Path.project(input).raw;
|
|
17
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { IdentityId, MintedCredential, UnresolvedGrant, UnresolvedIdentityExpr } 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 interface MintOptions {
|
|
6
|
+
readonly audience?: string;
|
|
7
|
+
readonly ttlSeconds: number;
|
|
8
|
+
readonly grant?: UnresolvedGrant;
|
|
9
|
+
}
|
|
10
|
+
export interface DelegateOptions {
|
|
11
|
+
readonly audience: string;
|
|
12
|
+
readonly ttlSeconds: number;
|
|
13
|
+
readonly attenuation: UnresolvedIdentityExpr;
|
|
14
|
+
}
|
|
15
|
+
export declare const IDENTITY_MINT_PATH: NodePath;
|
|
16
|
+
export declare function credentialApi(call: AuthCall): Readonly<{
|
|
17
|
+
mint(input: MintOptions, options?: RequestOptions): Promise<MintedCredential>;
|
|
18
|
+
delegate(principal: IdentityId, input: DelegateOptions, options?: RequestOptions): Promise<MintedCredential>;
|
|
19
|
+
}>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Path } from '@astrale-os/kernel-core/path';
|
|
2
|
+
import { identity } from '@astrale-os/kernel-core/schema/kernel/syscalls/references';
|
|
3
|
+
const identityOwner = Path.project(identity.whoami.owner);
|
|
4
|
+
export const IDENTITY_MINT_PATH = Path.staticMethod(identityOwner, identity.mint.name).raw;
|
|
5
|
+
export function credentialApi(call) {
|
|
6
|
+
return Object.freeze({
|
|
7
|
+
async mint(input, options) {
|
|
8
|
+
return credential(await call(IDENTITY_MINT_PATH, input, options));
|
|
9
|
+
},
|
|
10
|
+
async delegate(principal, input, options) {
|
|
11
|
+
const target = Path.instanceMethod(Path.id(principal), identity.delegate.name).raw;
|
|
12
|
+
return credential(await call(target, input, options));
|
|
13
|
+
},
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
function credential(input) {
|
|
17
|
+
if (typeof input !== 'string' || input.length === 0) {
|
|
18
|
+
throw new TypeError('Identity syscall returned an invalid credential.');
|
|
19
|
+
}
|
|
20
|
+
return input;
|
|
21
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Identity, IssuerId, Subject } 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 interface WhoisInput {
|
|
6
|
+
readonly issuer: IssuerId;
|
|
7
|
+
readonly subject: Subject;
|
|
8
|
+
}
|
|
9
|
+
export declare const IDENTITY_WHOAMI_PATH: NodePath;
|
|
10
|
+
export declare const IDENTITY_WHOIS_PATH: NodePath;
|
|
11
|
+
export declare function identityApi(call: AuthCall): Readonly<{
|
|
12
|
+
whoami(options?: RequestOptions): Promise<Identity>;
|
|
13
|
+
whois(input: WhoisInput, options?: RequestOptions): Promise<Identity | null>;
|
|
14
|
+
}>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Path } from '@astrale-os/kernel-core/path';
|
|
2
|
+
import { identity } from '@astrale-os/kernel-core/schema/kernel/syscalls/references';
|
|
3
|
+
const identityOwner = Path.project(identity.whoami.owner);
|
|
4
|
+
export const IDENTITY_WHOAMI_PATH = Path.staticMethod(identityOwner, identity.whoami.name).raw;
|
|
5
|
+
export const IDENTITY_WHOIS_PATH = Path.staticMethod(identityOwner, identity.whois.name).raw;
|
|
6
|
+
export function identityApi(call) {
|
|
7
|
+
return Object.freeze({
|
|
8
|
+
async whoami(options) {
|
|
9
|
+
return (await call(IDENTITY_WHOAMI_PATH, Object.freeze({}), options));
|
|
10
|
+
},
|
|
11
|
+
async whois(input, options) {
|
|
12
|
+
return (await call(IDENTITY_WHOIS_PATH, input, options));
|
|
13
|
+
},
|
|
14
|
+
});
|
|
15
|
+
}
|
package/dist/auth/index.d.ts
CHANGED
|
@@ -1,16 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export { createAuth } from './api.js';
|
|
8
|
-
export { makeAuthShorthands } from './shorthands.js';
|
|
9
|
-
export type { AuthApi } from './api.js';
|
|
10
|
-
export type { Composition } from './composition.js';
|
|
11
|
-
export type { DelegateOpts, MintOpts } from './minting.js';
|
|
12
|
-
export type { CheckInput, GrantInput, Perms, RevokeInput } from './permissions.js';
|
|
13
|
-
export type { AuthShorthands, RequireInput } from './shorthands.js';
|
|
14
|
-
export { cred, self } from '@astrale-os/kernel-core/expression';
|
|
15
|
-
export type { Expr } from '@astrale-os/kernel-core/expression';
|
|
16
|
-
//# sourceMappingURL=index.d.ts.map
|
|
1
|
+
export { createAuth, type AuthApi, type AuthCall } from './auth.js';
|
|
2
|
+
export { IDENTITY_CAN_PATH, type PolicyDecisionInput } from './authorization.js';
|
|
3
|
+
export { IDENTITY_MINT_PATH, type DelegateOptions, type MintOptions } from './credential.js';
|
|
4
|
+
export { IDENTITY_WHOAMI_PATH, IDENTITY_WHOIS_PATH, type WhoisInput } from './identity.js';
|
|
5
|
+
export { IDENTITY_PROVISION_PATH } from './provision.js';
|
|
6
|
+
export type { Identity, IdentityId, Subject, IssuerId, MintedCredential, ProvisionRequest, ProvisionResult, UnresolvedGrant, UnresolvedIdentityExpr, } from '@astrale-os/kernel-core/auth';
|
package/dist/auth/index.js
CHANGED
|
@@ -1,10 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
*/
|
|
7
|
-
export { createAuth } from './api.js';
|
|
8
|
-
export { makeAuthShorthands } from './shorthands.js';
|
|
9
|
-
export { cred, self } from '@astrale-os/kernel-core/expression';
|
|
10
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
export { createAuth } from './auth.js';
|
|
2
|
+
export { IDENTITY_CAN_PATH } from './authorization.js';
|
|
3
|
+
export { IDENTITY_MINT_PATH } from './credential.js';
|
|
4
|
+
export { IDENTITY_WHOAMI_PATH, IDENTITY_WHOIS_PATH } from './identity.js';
|
|
5
|
+
export { IDENTITY_PROVISION_PATH } from './provision.js';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ProvisionRequest, ProvisionResult } 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_PROVISION_PATH: NodePath;
|
|
6
|
+
export declare function provisionApi(call: AuthCall): Readonly<{
|
|
7
|
+
provision(input: ProvisionRequest, options?: RequestOptions): Promise<ProvisionResult>;
|
|
8
|
+
}>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Path } from '@astrale-os/kernel-core/path';
|
|
2
|
+
import { provision } from '@astrale-os/kernel-core/schema/kernel/syscalls/references';
|
|
3
|
+
export const IDENTITY_PROVISION_PATH = Path.project(provision).raw;
|
|
4
|
+
export function provisionApi(call) {
|
|
5
|
+
return Object.freeze({
|
|
6
|
+
async provision(input, options) {
|
|
7
|
+
return (await call(IDENTITY_PROVISION_PATH, input, options));
|
|
8
|
+
},
|
|
9
|
+
});
|
|
10
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Path } from '@astrale-os/kernel-core/path';
|
|
2
|
+
import * as portable from '@astrale-os/kernel-dsl/value';
|
|
3
|
+
/** Parent-private Call acceptance shared by Client and Client Session. */
|
|
4
|
+
export function acceptCall(input) {
|
|
5
|
+
if (input === null || typeof input !== 'object' || Array.isArray(input)) {
|
|
6
|
+
throw new TypeError('Client call must be an object.');
|
|
7
|
+
}
|
|
8
|
+
return Object.freeze({ target: admitPath(input.target), input: admitInput(input.input) });
|
|
9
|
+
}
|
|
10
|
+
function admitPath(input) {
|
|
11
|
+
try {
|
|
12
|
+
// Path is a pure value and may arrive through another package graph or JavaScript realm.
|
|
13
|
+
return Path.parse(typeof input === 'string' ? input : input.raw).raw;
|
|
14
|
+
}
|
|
15
|
+
catch (cause) {
|
|
16
|
+
throw new TypeError('Client call path must be a NodePath.', { cause });
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
function admitInput(input) {
|
|
20
|
+
try {
|
|
21
|
+
return freezeValue(portable.accept(input));
|
|
22
|
+
}
|
|
23
|
+
catch (cause) {
|
|
24
|
+
throw new TypeError('Client input must be a portable Value.', { cause });
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
function freezeValue(input) {
|
|
28
|
+
if (input !== null && typeof input === 'object' && !Object.isFrozen(input)) {
|
|
29
|
+
for (const value of Object.values(input))
|
|
30
|
+
freezeValue(value);
|
|
31
|
+
Object.freeze(input);
|
|
32
|
+
}
|
|
33
|
+
return input;
|
|
34
|
+
}
|
package/dist/client/client.d.ts
CHANGED
|
@@ -1,110 +1,25 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
4
|
-
import type {
|
|
5
|
-
import type {
|
|
6
|
-
import type
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
export declare class KernelClient<M extends FnMap = FnMap> {
|
|
26
|
-
readonly url: string;
|
|
27
|
-
private readonly defaultTimeout;
|
|
28
|
-
private readonly defaultTransport;
|
|
29
|
-
private readonly defaultProtocol;
|
|
30
|
-
private readonly hooks;
|
|
31
|
-
private readonly codec;
|
|
32
|
-
private readonly schema;
|
|
33
|
-
private readonly httpEnvelope;
|
|
34
|
-
private readonly httpRouted;
|
|
35
|
-
private readonly wsFactory;
|
|
36
|
-
private readonly logger;
|
|
37
|
-
private ws;
|
|
38
|
-
private wsState;
|
|
39
|
-
constructor(config: ClientConfig);
|
|
40
|
-
send<K extends CallFns<M>>(method: K, params: M[K]['params'], credential: CredentialInput, opts?: CallOptions): Promise<SendResult<M[K]['result']>>;
|
|
41
|
-
sendStream<K extends StreamFns<M>>(method: K, params: M[K]['params'], credential: CredentialInput, opts?: CallOptions): Promise<SendStreamResult<M[K]['result']>>;
|
|
42
|
-
sendBinary<K extends BinaryFns<M>>(method: K, params: M[K]['params'], credential: CredentialInput, opts?: CallOptions): Promise<SendBinaryResult>;
|
|
43
|
-
signal<K extends SignalFns<M>>(method: K, params: M[K]['params'], credential: CredentialInput, opts?: CallOptions): void;
|
|
44
|
-
batch<const Reqs extends readonly TypedBatchRequest<M>[]>(requests: [...Reqs], credential: CredentialInput, opts?: CallOptions): Promise<BatchResults<M, Reqs>>;
|
|
45
|
-
as(credential: CredentialInput | (() => CredentialInput)): BoundClientView<M>;
|
|
46
|
-
/**
|
|
47
|
-
* Return a schema-typed proxy. `defaultCredential` — used by
|
|
48
|
-
* `BoundClientView.withSchema` — supplies a credential when the
|
|
49
|
-
* per-call `ProxyCallOptions.credential` is absent. Unbound callers
|
|
50
|
-
* that provide neither send a no-auth request; the server decides
|
|
51
|
-
* whether that's valid (per §9.0.1 the client treats credentials as
|
|
52
|
-
* opaque and never pre-judges them).
|
|
53
|
-
*/
|
|
54
|
-
withSchema<S extends Schema>(schema: S, defaultCredential?: () => CredentialInput): SchemaTypedClient<S>;
|
|
55
|
-
describe(method: string): FunctionSchema | undefined;
|
|
56
|
-
/**
|
|
57
|
-
* Release any held resources (open WebSocket). Idempotent. The client
|
|
58
|
-
* stays reusable — a subsequent `send(...)` lazily re-opens a fresh
|
|
59
|
-
* WebSocket if the default or per-call transport selects `'ws'`. Resets
|
|
60
|
-
* the `'auto'` probe state so the next call re-probes.
|
|
61
|
-
*/
|
|
62
|
-
disconnect(): void;
|
|
63
|
-
private lookupSchema;
|
|
64
|
-
/**
|
|
65
|
-
* Resolve the transport instance + request shape for this call.
|
|
66
|
-
* `canFallback` signals to `dispatchUnary` that a WS `ConnectionError`
|
|
67
|
-
* on this attempt should retry on HTTP (auto-mode probe only).
|
|
68
|
-
*/
|
|
69
|
-
private selectTransport;
|
|
70
|
-
/**
|
|
71
|
-
* Resolve `CallTransport` to a concrete envelope pipe. Binary is always
|
|
72
|
-
* HTTP (server-side WS binary unimplemented). In `'auto'+unknown`, signal
|
|
73
|
-
* stays on HTTP — fire-and-forget can't communicate fallback.
|
|
74
|
-
*/
|
|
75
|
-
private resolveEnvelopePipe;
|
|
76
|
-
private envelopeWs;
|
|
77
|
-
private buildEnvelopeRequest;
|
|
78
|
-
private buildRoutedRequest;
|
|
79
|
-
/**
|
|
80
|
-
* Unary dispatch (call / stream / binary). Selects transport, fires
|
|
81
|
-
* `onBeforeSend`, awaits the transport, freezes the result (deeply,
|
|
82
|
-
* including `meta.wire`), wraps streams in the observability
|
|
83
|
-
* iterator, fires `onAfterReceive`, and decorates errors with
|
|
84
|
-
* `ClientErrorDetails` if the transport didn't already.
|
|
85
|
-
*/
|
|
86
|
-
private dispatchUnary;
|
|
87
|
-
/**
|
|
88
|
-
* One dispatch attempt: hooks + wire + freeze. `fireErrorHook = false`
|
|
89
|
-
* suppresses `onError` so a recovered auto-mode WS probe failure doesn't
|
|
90
|
-
* surface as a phantom error when the fallback HTTP call succeeds.
|
|
91
|
-
*/
|
|
92
|
-
private dispatchOnce;
|
|
93
|
-
private beforeCtx;
|
|
94
|
-
/**
|
|
95
|
-
* Wrap a stream iterable so each chunk fires `onStreamFrame`. Errors
|
|
96
|
-
* during hook evaluation are swallowed per the hook contract (pure
|
|
97
|
-
* observation); a hook that misbehaves never aborts the stream.
|
|
98
|
-
*/
|
|
99
|
-
private instrumentStream;
|
|
100
|
-
private runHooks;
|
|
101
|
-
/**
|
|
102
|
-
* Log a hook-layer failure. Only the error's name + message are
|
|
103
|
-
* surfaced — the error may chain a `cause` that captured a credential
|
|
104
|
-
* or other sensitive ref by closure, and the client never leaks those
|
|
105
|
-
* per §9.0.1. Consumers who need full diagnostics provide a
|
|
106
|
-
* `logger` with their own redaction policy.
|
|
107
|
-
*/
|
|
108
|
-
private logHookError;
|
|
1
|
+
import type { invocation as protocol } from '@astrale-os/kernel-protocol';
|
|
2
|
+
import type { Transport } from '../transport/index.js';
|
|
3
|
+
import type { AuthenticatedClient, RemoteCredential } from './credential.js';
|
|
4
|
+
import type { Call, ClientDispatchOptions } from './request.js';
|
|
5
|
+
import type { BinaryResponse, Result, StreamResult, ValueResult } from './result.js';
|
|
6
|
+
import { type HttpTransportOptions } from '../transport/http/index.js';
|
|
7
|
+
export type ClientOptions = HttpTransportOptions | {
|
|
8
|
+
readonly transport: Transport;
|
|
9
|
+
};
|
|
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>;
|
|
12
|
+
/** Pure client for the universal remote Function invocation boundary. */
|
|
13
|
+
export declare class Client implements AuthenticatedClient {
|
|
14
|
+
private readonly transport;
|
|
15
|
+
private readonly lifecycle;
|
|
16
|
+
private closed;
|
|
17
|
+
constructor(options: ClientOptions);
|
|
18
|
+
dispatch(call: Call, options?: ClientDispatchOptions): Promise<Result>;
|
|
19
|
+
call(call: Call, options?: ClientDispatchOptions): Promise<ValueResult>;
|
|
20
|
+
stream(call: Call, options?: ClientDispatchOptions): Promise<StreamResult>;
|
|
21
|
+
binary(call: Call, options?: ClientDispatchOptions): Promise<BinaryResponse>;
|
|
22
|
+
as(credential: RemoteCredential): AuthenticatedClient;
|
|
23
|
+
close(): void;
|
|
24
|
+
private dispatchWith;
|
|
109
25
|
}
|
|
110
|
-
//# sourceMappingURL=client.d.ts.map
|