@astrale-os/kernel-client 0.6.0-beta.9 → 0.6.0
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 +22 -10
- package/dist/auth/auth.js +5 -7
- package/dist/auth/authorization.d.ts +4 -2
- package/dist/auth/authorization.js +25 -6
- package/dist/auth/credential.d.ts +7 -4
- package/dist/auth/credential.js +6 -3
- package/dist/auth/identity.d.ts +7 -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 +9 -11
- package/dist/client/client.d.ts +4 -3
- package/dist/client/client.js +16 -4
- package/dist/client/credential.d.ts +5 -3
- package/dist/client/credential.js +7 -3
- package/dist/client/index.d.ts +3 -4
- package/dist/client/index.js +2 -3
- package/dist/client/request.d.ts +11 -4
- package/dist/client/request.js +50 -6
- package/dist/client/result.d.ts +7 -5
- package/dist/client/result.js +13 -5
- package/dist/client/routing-control.d.ts +11 -4
- package/dist/client/routing-control.js +18 -4
- package/dist/errors/client-error.d.ts +0 -1
- package/dist/errors/client-error.js +0 -1
- package/dist/errors/exchange-error.d.ts +19 -0
- package/dist/errors/exchange-error.js +9 -0
- package/dist/errors/index.d.ts +2 -1
- package/dist/errors/index.js +2 -1
- 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/refusal.d.ts +12 -0
- package/dist/errors/refusal.js +40 -0
- package/dist/errors/response-error.d.ts +0 -1
- package/dist/errors/response-error.js +0 -1
- package/dist/errors/session-error.d.ts +0 -1
- package/dist/errors/session-error.js +0 -1
- package/dist/errors/stale-route-error.d.ts +4 -4
- package/dist/errors/stale-route-error.js +5 -5
- package/dist/errors/transport-error.d.ts +3 -3
- package/dist/errors/transport-error.js +0 -1
- package/dist/graph/domain/binding.d.ts +0 -1
- package/dist/graph/domain/binding.js +4 -1
- package/dist/graph/domain/domain.typecheck.d.ts +0 -1
- package/dist/graph/domain/domain.typecheck.js +21 -1
- package/dist/graph/domain/index.d.ts +0 -1
- package/dist/graph/domain/index.js +0 -1
- package/dist/graph/domain/model.d.ts +0 -1
- package/dist/graph/domain/model.js +0 -1
- package/dist/graph/domain/page.d.ts +0 -1
- package/dist/graph/domain/page.js +0 -1
- package/dist/graph/domain/project.d.ts +0 -1
- package/dist/graph/domain/project.js +10 -7
- package/dist/graph/domain/provenance.d.ts +0 -1
- package/dist/graph/domain/provenance.js +0 -1
- package/dist/graph/errors.d.ts +0 -1
- package/dist/graph/errors.js +1 -3
- package/dist/graph/expectation.d.ts +3 -0
- package/dist/graph/expectation.js +6 -0
- package/dist/graph/graph.d.ts +6 -3
- package/dist/graph/graph.js +0 -1
- package/dist/graph/index.d.ts +2 -3
- package/dist/graph/index.js +1 -2
- package/dist/graph/mutation.d.ts +2 -4
- package/dist/graph/mutation.js +12 -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 +0 -1
- package/dist/graph/page/neighbors.js +2 -2
- package/dist/graph/page/page.d.ts +0 -1
- package/dist/graph/page/page.js +0 -1
- package/dist/graph/page-contract.d.ts +6 -1
- package/dist/graph/page-contract.js +0 -1
- package/dist/graph/provenance.d.ts +2 -1
- package/dist/graph/provenance.js +5 -1
- package/dist/graph/query.d.ts +3 -1
- package/dist/graph/query.js +25 -10
- package/dist/graph/read.d.ts +0 -1
- package/dist/graph/read.js +6 -5
- package/dist/index.d.ts +3 -3
- package/dist/index.js +1 -1
- 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 +1 -2
- package/dist/pacer/index.js +1 -2
- 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 +1 -1
- package/dist/pacer/retry/index.js +1 -1
- package/dist/pacer/retry/refusals.d.ts +7 -0
- package/dist/pacer/retry/refusals.js +10 -0
- package/dist/pacer/retry/retry.d.ts +2 -1
- package/dist/pacer/retry/retry.js +33 -2
- 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 +2 -3
- package/dist/schema/contracts.d.ts +97 -5
- package/dist/schema/contracts.js +0 -1
- package/dist/schema/index.d.ts +3 -3
- package/dist/schema/index.js +1 -2
- package/dist/schema/installation.d.ts +104 -0
- package/dist/schema/installation.js +144 -0
- package/dist/schema/introspection.d.ts +0 -1
- package/dist/schema/introspection.js +10 -3
- package/dist/schema/operation.d.ts +0 -1
- package/dist/schema/operation.js +1 -2
- package/dist/schema/schema.d.ts +32 -11
- package/dist/schema/schema.js +94 -19
- package/dist/session/admission.d.ts +6 -0
- package/dist/session/admission.js +52 -0
- package/dist/session/bound.d.ts +17 -14
- package/dist/session/bound.js +96 -10
- package/dist/session/content/api.d.ts +45 -0
- package/dist/session/content/api.js +28 -0
- package/dist/session/content/batch.d.ts +5 -0
- package/dist/session/content/batch.js +93 -0
- package/dist/session/content/index.d.ts +1 -0
- package/dist/session/content/index.js +1 -0
- package/dist/session/content/input.d.ts +9 -0
- package/dist/session/content/input.js +33 -0
- package/dist/session/content/parts.d.ts +36 -0
- package/dist/session/content/parts.js +154 -0
- package/dist/session/content/retry.d.ts +3 -0
- package/dist/session/content/retry.js +41 -0
- package/dist/session/content/wire.d.ts +12 -0
- package/dist/session/content/wire.js +60 -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 +2 -3
- package/dist/session/context/index.js +2 -3
- package/dist/session/context/limits.d.ts +1 -2
- package/dist/session/context/limits.js +1 -2
- package/dist/session/context/operation.d.ts +5 -3
- package/dist/session/context/operation.js +1 -2
- package/dist/session/context/policy.d.ts +0 -2
- package/dist/session/context/policy.js +0 -17
- package/dist/session/credential/credentials.d.ts +65 -0
- package/dist/session/credential/credentials.js +296 -0
- package/dist/session/credential/index.d.ts +1 -0
- package/dist/session/credential/index.js +1 -0
- package/dist/session/credential/limits.d.ts +14 -0
- package/dist/session/credential/limits.js +14 -0
- package/dist/session/discovery/bundle.d.ts +9 -5
- package/dist/session/discovery/bundle.js +43 -26
- package/dist/session/discovery/discovery.d.ts +12 -5
- package/dist/session/discovery/discovery.js +42 -13
- package/dist/session/discovery/index.d.ts +6 -2
- package/dist/session/discovery/index.js +4 -8
- package/dist/session/discovery/release.d.ts +30 -0
- package/dist/session/discovery/release.js +81 -0
- package/dist/session/discovery/response.d.ts +3 -0
- package/dist/session/discovery/response.js +59 -0
- package/dist/session/discovery/snapshot.d.ts +4 -5
- package/dist/session/discovery/snapshot.js +2 -3
- package/dist/session/discovery/transport.d.ts +1 -4
- package/dist/session/discovery/transport.js +0 -1
- package/dist/session/exchange/domain.d.ts +27 -0
- package/dist/session/exchange/domain.js +63 -0
- package/dist/session/exchange/exchange.d.ts +48 -0
- package/dist/session/exchange/exchange.js +54 -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 +37 -0
- package/dist/session/exchange/options.js +65 -0
- package/dist/session/exchange/presentation.d.ts +19 -0
- package/dist/session/exchange/presentation.js +72 -0
- package/dist/session/exchange/source.d.ts +33 -0
- package/dist/session/exchange/source.js +78 -0
- package/dist/session/execution.d.ts +88 -0
- package/dist/session/execution.js +34 -0
- package/dist/session/index.d.ts +9 -6
- package/dist/session/index.js +3 -2
- package/dist/session/options.d.ts +65 -0
- package/dist/session/options.js +132 -0
- package/dist/session/reference.d.ts +38 -19
- package/dist/session/reference.js +34 -12
- package/dist/session/routing/auth.d.ts +10 -1
- package/dist/session/routing/auth.js +8 -2
- package/dist/session/routing/cache.d.ts +21 -7
- package/dist/session/routing/cache.js +103 -73
- package/dist/session/routing/dispatch.d.ts +19 -11
- package/dist/session/routing/dispatch.js +115 -89
- package/dist/session/routing/envelope.d.ts +4 -3
- package/dist/session/routing/envelope.js +14 -10
- package/dist/session/routing/expiry.d.ts +4 -0
- package/dist/session/routing/expiry.js +32 -0
- package/dist/session/routing/index.d.ts +5 -5
- package/dist/session/routing/index.js +4 -3
- package/dist/session/routing/integrity.d.ts +7 -0
- package/dist/session/routing/integrity.js +44 -0
- package/dist/session/routing/recovery.d.ts +16 -0
- package/dist/session/routing/recovery.js +41 -0
- package/dist/session/routing/request.d.ts +13 -1
- package/dist/session/routing/request.js +28 -2
- package/dist/session/routing/result.d.ts +5 -0
- package/dist/session/routing/result.js +16 -0
- package/dist/session/routing/store.d.ts +23 -0
- package/dist/session/routing/store.js +99 -0
- package/dist/session/session.d.ts +37 -33
- package/dist/session/session.js +134 -157
- package/dist/session/session.typecheck.d.ts +0 -1
- package/dist/session/session.typecheck.js +183 -5
- package/dist/session/views/catalog.d.ts +9 -6
- package/dist/session/views/catalog.js +29 -23
- package/dist/session/views/index.d.ts +1 -2
- package/dist/session/views/index.js +1 -2
- package/dist/session/views/resolve.d.ts +6 -5
- package/dist/session/views/resolve.js +14 -7
- package/dist/store/entity-index.d.ts +1 -3
- package/dist/store/entity-index.js +0 -4
- 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 +60 -18
- 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 +6 -3
- 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 +0 -6
- package/dist/transport/auto/decision.d.ts +3 -3
- package/dist/transport/auto/decision.js +0 -1
- package/dist/transport/auto/fallback.d.ts +2 -2
- package/dist/transport/auto/fallback.js +2 -2
- 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 -2
- package/dist/transport/auto/transport.js +0 -3
- 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 +0 -1
- package/dist/transport/failure.js +0 -1
- package/dist/transport/http/admission.d.ts +5 -0
- package/dist/transport/http/admission.js +104 -0
- package/dist/transport/http/binary.d.ts +5 -0
- package/dist/transport/http/binary.js +70 -0
- package/dist/transport/http/byte-stream.d.ts +18 -0
- package/dist/transport/http/byte-stream.js +94 -0
- package/dist/transport/http/configuration.d.ts +24 -0
- package/dist/transport/http/configuration.js +116 -0
- package/dist/transport/http/index.d.ts +2 -2
- package/dist/transport/http/index.js +0 -1
- package/dist/transport/http/response.d.ts +8 -2
- package/dist/transport/http/response.js +11 -7
- package/dist/transport/http/retired.d.ts +8 -0
- package/dist/transport/http/retired.js +28 -0
- package/dist/transport/http/stream.d.ts +0 -1
- package/dist/transport/http/stream.js +0 -1
- package/dist/transport/http/transport.d.ts +4 -18
- package/dist/transport/http/transport.js +48 -252
- package/dist/transport/index.d.ts +1 -2
- package/dist/transport/index.js +0 -1
- package/dist/transport/transport.d.ts +20 -3
- package/dist/transport/transport.js +0 -1
- package/dist/transport/websocket/connection.d.ts +2 -2
- package/dist/transport/websocket/connection.js +5 -3
- package/dist/transport/websocket/exchange.d.ts +0 -1
- package/dist/transport/websocket/exchange.js +8 -1
- 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 -4
- package/dist/transport/websocket/transport.js +2 -18
- package/package.json +12 -15
- 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/session-error.d.ts.map +0 -1
- package/dist/errors/session-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/domain/binding.d.ts.map +0 -1
- package/dist/graph/domain/binding.js.map +0 -1
- package/dist/graph/domain/domain.typecheck.d.ts.map +0 -1
- package/dist/graph/domain/domain.typecheck.js.map +0 -1
- package/dist/graph/domain/index.d.ts.map +0 -1
- package/dist/graph/domain/index.js.map +0 -1
- package/dist/graph/domain/model.d.ts.map +0 -1
- package/dist/graph/domain/model.js.map +0 -1
- package/dist/graph/domain/page.d.ts.map +0 -1
- package/dist/graph/domain/page.js.map +0 -1
- package/dist/graph/domain/project.d.ts.map +0 -1
- package/dist/graph/domain/project.js.map +0 -1
- package/dist/graph/domain/provenance.d.ts.map +0 -1
- package/dist/graph/domain/provenance.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/provenance.d.ts.map +0 -1
- package/dist/graph/provenance.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/bound.d.ts.map +0 -1
- package/dist/session/bound.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 +0 -24
- package/dist/session/discovery/publication.d.ts.map +0 -1
- package/dist/session/discovery/publication.js +0 -124
- 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/discovery/transport.d.ts.map +0 -1
- package/dist/session/discovery/transport.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/failure.d.ts.map +0 -1
- package/dist/transport/failure.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/graph/index.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
export { createGraph, type GraphApi, type GraphCall, type GraphQueryOptions, type MutationAuthor, } from './graph.js';
|
|
1
|
+
export { createGraph, type GraphApi, type GraphCall, type GraphMutationOptions, type GraphQueryOptions, type MutationAuthor, } from './graph.js';
|
|
2
2
|
export type { QueryPageRequest, QueryResponse } from './page-contract.js';
|
|
3
3
|
export { type BoundEdge, type BoundEdgePage, type BoundGraphValue, type BoundNode, type BoundNodeFor, type BoundNodePage, type BoundQueryPage, type DomainBinding, type DomainQueryOptions, } from './domain/index.js';
|
|
4
4
|
export { NodeUnavailableError } from './errors.js';
|
|
5
5
|
export type { NeighborsOptions, NodePage } from './page/index.js';
|
|
6
|
-
export {
|
|
6
|
+
export { LocalAlias, type GraphSpec } from '@astrale-os/kernel-core/graph/graph';
|
|
7
7
|
export { MutationAST, MutationResult, type MutationBuilder, type MutationInput, } from '@astrale-os/kernel-core/graph/mutate';
|
|
8
8
|
export { Query, QueryAST, QueryResult } from '@astrale-os/kernel-core/graph/query';
|
|
9
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/graph/index.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export { createGraph, } from './graph.js';
|
|
2
2
|
export {} from './domain/index.js';
|
|
3
3
|
export { NodeUnavailableError } from './errors.js';
|
|
4
|
-
export {
|
|
4
|
+
export { LocalAlias } from '@astrale-os/kernel-core/graph/graph';
|
|
5
5
|
export { MutationAST, MutationResult, } from '@astrale-os/kernel-core/graph/mutate';
|
|
6
6
|
export { Query, QueryAST, QueryResult } from '@astrale-os/kernel-core/graph/query';
|
|
7
|
-
//# sourceMappingURL=index.js.map
|
package/dist/graph/mutation.d.ts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import type { GraphSpec } from '@astrale-os/kernel-core/graph/graph';
|
|
2
2
|
import type { MutationAST as MutationASTValue, MutationInput, MutationResult as MutationResultValue } from '@astrale-os/kernel-core/graph/mutate';
|
|
3
|
-
import type {
|
|
4
|
-
|
|
5
|
-
export declare function mutateGraph(call: GraphCall, input: MutationAuthor | MutationASTValue | MutationInput | GraphSpec, options?: RequestOptions): Promise<MutationResultValue>;
|
|
6
|
-
//# sourceMappingURL=mutation.d.ts.map
|
|
3
|
+
import type { GraphCall, GraphMutationOptions, MutationAuthor } from './graph.js';
|
|
4
|
+
export declare function mutateGraph(call: GraphCall, input: MutationAuthor | MutationASTValue | MutationInput | GraphSpec, options?: GraphMutationOptions): Promise<MutationResultValue>;
|
package/dist/graph/mutation.js
CHANGED
|
@@ -2,10 +2,21 @@ import { MutationAST, MutationResult } from '@astrale-os/kernel-core/graph/mutat
|
|
|
2
2
|
import { Path } from '@astrale-os/kernel-core/path';
|
|
3
3
|
import { mutate } from '@astrale-os/kernel-core/schema/kernel/syscalls/references';
|
|
4
4
|
import { call as invocation } from '../client/index.js';
|
|
5
|
+
import { captureExpected } from './expectation.js';
|
|
5
6
|
const KERNEL_MUTATE_PATH = Path.project(mutate).raw;
|
|
6
7
|
export async function mutateGraph(call, input, options) {
|
|
7
8
|
const ast = typeof input === 'function' ? MutationAST.build(input) : admitMutation(input);
|
|
8
|
-
const
|
|
9
|
+
const expected = options?.expected;
|
|
10
|
+
const idempotencyKey = options?.idempotencyKey;
|
|
11
|
+
const request = options === undefined
|
|
12
|
+
? undefined
|
|
13
|
+
: (({ expected: _expected, idempotencyKey: _key, ...rest }) => rest)(options);
|
|
14
|
+
const capturedExpected = captureExpected(expected);
|
|
15
|
+
const output = await call(invocation(KERNEL_MUTATE_PATH, Object.freeze({
|
|
16
|
+
ast,
|
|
17
|
+
...(capturedExpected === undefined ? {} : { expected: capturedExpected }),
|
|
18
|
+
...(idempotencyKey === undefined ? {} : { idempotencyKey }),
|
|
19
|
+
})), request);
|
|
9
20
|
return MutationResult.decode(output);
|
|
10
21
|
}
|
|
11
22
|
function admitMutation(input) {
|
|
@@ -15,4 +26,3 @@ function admitMutation(input) {
|
|
|
15
26
|
? MutationAST.create(input)
|
|
16
27
|
: MutationAST.fromGraph(input);
|
|
17
28
|
}
|
|
18
|
-
//# sourceMappingURL=mutation.js.map
|
package/dist/graph/page/index.js
CHANGED
|
@@ -7,4 +7,3 @@ export interface NeighborsOptions extends PageQueryOptions {
|
|
|
7
7
|
export type NeighborSource = NodeTarget;
|
|
8
8
|
export type NeighborVia = QueryEdgeClassInput | readonly [QueryEdgeClassInput, ...QueryEdgeClassInput[]];
|
|
9
9
|
export declare function readNeighbors(query: PageQuery, source: NeighborSource, via: NeighborVia, options: NeighborsOptions): Promise<NodePage>;
|
|
10
|
-
//# sourceMappingURL=neighbors.d.ts.map
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Query } from '@astrale-os/kernel-core/graph/query';
|
|
2
|
+
import { queryNodePath } from '../query.js';
|
|
2
3
|
import { createNodePage } from './page.js';
|
|
3
4
|
export async function readNeighbors(query, source, via, options) {
|
|
4
5
|
if (options === null || typeof options !== 'object') {
|
|
@@ -15,7 +16,7 @@ export async function readNeighbors(query, source, via, options) {
|
|
|
15
16
|
: options.direction === 'incident'
|
|
16
17
|
? options.direction
|
|
17
18
|
: invalidDirection(options.direction);
|
|
18
|
-
const ast = Query.from({ nodes: [source] })
|
|
19
|
+
const ast = Query.from({ nodes: [queryNodePath(source)] })
|
|
19
20
|
.expand({ via: [classInput, ...additionalClasses], direction })
|
|
20
21
|
.select({ kind: 'graph' });
|
|
21
22
|
const { direction: _, page, ...request } = options;
|
|
@@ -32,4 +33,3 @@ export async function readNeighbors(query, source, via, options) {
|
|
|
32
33
|
function invalidDirection(input) {
|
|
33
34
|
throw new TypeError(`Unsupported neighbor direction ${JSON.stringify(input)}.`);
|
|
34
35
|
}
|
|
35
|
-
//# sourceMappingURL=neighbors.js.map
|
|
@@ -35,4 +35,3 @@ export type PageQuery = <Query extends QueryAST>(ast: Query, options: PageQueryO
|
|
|
35
35
|
type NodeGraphQueryAST = QueryAST<QueryGraphSelect<NodeBinding>>;
|
|
36
36
|
export declare function createNodePage(query: PageQuery, ast: NodeGraphQueryAST, response: QueryResponse<QueryNodeGraphResult>, basis: PageBasis, size: number): NodePage;
|
|
37
37
|
export {};
|
|
38
|
-
//# sourceMappingURL=page.d.ts.map
|
package/dist/graph/page/page.js
CHANGED
|
@@ -10,5 +10,10 @@ export interface QueryResponse<Result extends QueryResult = QueryResult> {
|
|
|
10
10
|
readonly page: {
|
|
11
11
|
readonly next?: string;
|
|
12
12
|
};
|
|
13
|
+
/**
|
|
14
|
+
* Present only for a repair-session read made without conformance admission: its facts may
|
|
15
|
+
* violate the active schema, so it is raw Core data only. The Store keeps it out of its shared
|
|
16
|
+
* cache and a Domain binding refuses to type it.
|
|
17
|
+
*/
|
|
18
|
+
readonly certification?: 'uncertified';
|
|
13
19
|
}
|
|
14
|
-
//# sourceMappingURL=page-contract.d.ts.map
|
|
@@ -8,6 +8,7 @@ export interface QueryProvenance {
|
|
|
8
8
|
}
|
|
9
9
|
/** Retain authenticated query provenance without adding serialized response metadata. */
|
|
10
10
|
export declare function retainQueryProvenance(response: QueryResponse, closure: readonly DomainDependency[]): QueryResponse;
|
|
11
|
+
/** Reattach the exact authenticated closure when Store materialization replaces response objects. */
|
|
12
|
+
export declare function retainDerivedQueryProvenance(source: QueryResponse, derived: QueryResponse): QueryResponse;
|
|
11
13
|
export declare function provenanceOfGraphValue(value: Node | Edge): QueryProvenance | undefined;
|
|
12
14
|
export declare function provenanceOfResponse(value: QueryResponse): QueryProvenance | undefined;
|
|
13
|
-
//# sourceMappingURL=provenance.d.ts.map
|
package/dist/graph/provenance.js
CHANGED
|
@@ -29,10 +29,14 @@ export function retainQueryProvenance(response, closure) {
|
|
|
29
29
|
}
|
|
30
30
|
return response;
|
|
31
31
|
}
|
|
32
|
+
/** Reattach the exact authenticated closure when Store materialization replaces response objects. */
|
|
33
|
+
export function retainDerivedQueryProvenance(source, derived) {
|
|
34
|
+
const provenance = responses.get(source);
|
|
35
|
+
return provenance === undefined ? derived : retainQueryProvenance(derived, provenance.closure);
|
|
36
|
+
}
|
|
32
37
|
export function provenanceOfGraphValue(value) {
|
|
33
38
|
return graphValues.get(value);
|
|
34
39
|
}
|
|
35
40
|
export function provenanceOfResponse(value) {
|
|
36
41
|
return responses.get(value);
|
|
37
42
|
}
|
|
38
|
-
//# sourceMappingURL=provenance.js.map
|
package/dist/graph/query.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { QueryAST as QueryASTValue, QueryResultFor } from '@astrale-os/kernel-core/graph/query';
|
|
2
|
+
import { Path, type NodeTarget } from '@astrale-os/kernel-core/path';
|
|
2
3
|
import type { GraphCall, GraphQueryOptions } from './graph.js';
|
|
3
4
|
import type { QueryResponse } from './page-contract.js';
|
|
5
|
+
/** Point/neighbor reads are exact targets, unlike Query's overloaded Class sources. */
|
|
6
|
+
export declare function queryNodePath(target: NodeTarget): Path;
|
|
4
7
|
export declare function queryGraph<Query extends QueryASTValue>(call: GraphCall, input: Query, options: GraphQueryOptions): Promise<QueryResponse<QueryResultFor<Query>>>;
|
|
5
|
-
//# sourceMappingURL=query.d.ts.map
|
package/dist/graph/query.js
CHANGED
|
@@ -1,9 +1,22 @@
|
|
|
1
|
-
import { QueryAST, QueryResult } from '@astrale-os/kernel-core/graph/query';
|
|
2
|
-
import { Path } from '@astrale-os/kernel-core/path';
|
|
1
|
+
import { QueryAST, QueryASTDecodeError, QueryResult } from '@astrale-os/kernel-core/graph/query';
|
|
2
|
+
import { Path, PathError } from '@astrale-os/kernel-core/path';
|
|
3
3
|
import { query } from '@astrale-os/kernel-core/schema/kernel/syscalls/references';
|
|
4
4
|
import { call as invocation } from '../client/index.js';
|
|
5
|
+
import { captureExpected } from './expectation.js';
|
|
5
6
|
import { retainQueryProvenance } from './provenance.js';
|
|
6
7
|
const KERNEL_QUERY_PATH = Path.project(query).raw;
|
|
8
|
+
/** Point/neighbor reads are exact targets, unlike Query's overloaded Class sources. */
|
|
9
|
+
export function queryNodePath(target) {
|
|
10
|
+
try {
|
|
11
|
+
return Path.target(target);
|
|
12
|
+
}
|
|
13
|
+
catch (cause) {
|
|
14
|
+
// Preserve the graph-read Query error contract; do not relabel unexpected defects.
|
|
15
|
+
if (!(cause instanceof PathError))
|
|
16
|
+
throw cause;
|
|
17
|
+
throw new QueryASTDecodeError('/source/nodes/0', 'Invalid Node target', { cause });
|
|
18
|
+
}
|
|
19
|
+
}
|
|
7
20
|
export async function queryGraph(call, input, options) {
|
|
8
21
|
const ast = QueryAST.decode(input);
|
|
9
22
|
const { expected, page, ...request } = options;
|
|
@@ -19,11 +32,6 @@ export async function queryGraph(call, input, options) {
|
|
|
19
32
|
? response
|
|
20
33
|
: retainQueryProvenance(response, capturedExpected);
|
|
21
34
|
}
|
|
22
|
-
function captureExpected(input) {
|
|
23
|
-
if (input === undefined)
|
|
24
|
-
return undefined;
|
|
25
|
-
return Object.freeze(input.map(({ origin, revision }) => Object.freeze({ origin, revision })));
|
|
26
|
-
}
|
|
27
35
|
function admitPage(input) {
|
|
28
36
|
if (input === null || typeof input !== 'object' || Array.isArray(input)) {
|
|
29
37
|
throw new TypeError('Graph query page is invalid.');
|
|
@@ -44,9 +52,13 @@ function decodeResponse(input) {
|
|
|
44
52
|
throw new TypeError('Graph query response is invalid.');
|
|
45
53
|
}
|
|
46
54
|
const value = input;
|
|
47
|
-
|
|
55
|
+
const uncertified = value.certification !== undefined;
|
|
56
|
+
if (!hasExactKeys(value, uncertified ? ['result', 'page', 'certification'] : ['result', 'page'])) {
|
|
48
57
|
throw new TypeError('Graph query response is invalid.');
|
|
49
58
|
}
|
|
59
|
+
if (uncertified && value.certification !== 'uncertified') {
|
|
60
|
+
throw new TypeError('Graph query response certification is invalid.');
|
|
61
|
+
}
|
|
50
62
|
const pageInput = value.page;
|
|
51
63
|
if (pageInput === null || typeof pageInput !== 'object' || Array.isArray(pageInput)) {
|
|
52
64
|
throw new TypeError('Graph query response page is invalid.');
|
|
@@ -61,10 +73,13 @@ function decodeResponse(input) {
|
|
|
61
73
|
}
|
|
62
74
|
const result = QueryResult.decode(value.result);
|
|
63
75
|
const page = Object.freeze(pageValue.next === undefined ? {} : { next: pageValue.next });
|
|
64
|
-
return Object.freeze({
|
|
76
|
+
return Object.freeze({
|
|
77
|
+
result,
|
|
78
|
+
page,
|
|
79
|
+
...(uncertified ? { certification: 'uncertified' } : {}),
|
|
80
|
+
});
|
|
65
81
|
}
|
|
66
82
|
function hasExactKeys(input, expected) {
|
|
67
83
|
const keys = Object.keys(input);
|
|
68
84
|
return keys.length === expected.length && keys.every((key) => expected.includes(key));
|
|
69
85
|
}
|
|
70
|
-
//# sourceMappingURL=query.js.map
|
package/dist/graph/read.d.ts
CHANGED
|
@@ -4,4 +4,3 @@ import type { RequestOptions } from '../transport/index.js';
|
|
|
4
4
|
import type { GraphCall } from './graph.js';
|
|
5
5
|
export declare function getNode(call: GraphCall, path: NodeTarget, options?: RequestOptions): Promise<Node | null>;
|
|
6
6
|
export declare function requireNode(call: GraphCall, path: NodeTarget, options?: RequestOptions): Promise<Node>;
|
|
7
|
-
//# sourceMappingURL=read.d.ts.map
|
package/dist/graph/read.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Query } from '@astrale-os/kernel-core/graph/query';
|
|
2
2
|
import { NodeUnavailableError } from './errors.js';
|
|
3
|
-
import { queryGraph } from './query.js';
|
|
3
|
+
import { queryGraph, queryNodePath } from './query.js';
|
|
4
4
|
export async function getNode(call, path, options) {
|
|
5
|
-
const ast = Query.from({ nodes: [path] }).select({ kind: 'graph' });
|
|
5
|
+
const ast = Query.from({ nodes: [queryNodePath(path)] }).select({ kind: 'graph' });
|
|
6
6
|
const response = await queryGraph(call, ast, { ...options, page: { size: 1 } });
|
|
7
7
|
const { result } = response;
|
|
8
8
|
if (result.kind !== 'graph')
|
|
@@ -10,9 +10,10 @@ export async function getNode(call, path, options) {
|
|
|
10
10
|
return result.graph.nodes[0] ?? null;
|
|
11
11
|
}
|
|
12
12
|
export async function requireNode(call, path, options) {
|
|
13
|
-
|
|
13
|
+
// Retain one immutable target across I/O, including unavailable-error rendering.
|
|
14
|
+
const target = queryNodePath(path);
|
|
15
|
+
const node = await getNode(call, target, options);
|
|
14
16
|
if (node === null)
|
|
15
|
-
throw new NodeUnavailableError(
|
|
17
|
+
throw new NodeUnavailableError(target);
|
|
16
18
|
return node;
|
|
17
19
|
}
|
|
18
|
-
//# sourceMappingURL=read.js.map
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { Target, targetPath } from '@astrale-os/kernel-core/callable';
|
|
2
|
+
export { Client, call, type AuthenticatedClient, type Call, type ClientDispatchOptions, type ClientDispatchOptionsWithBody, type ClientOptions, type Binary, type BinaryResponse, type Input, type RemoteCredential, type Result, type Stream, type StreamResult, type ValueResult, } from './client/index.js';
|
|
2
3
|
export * from './errors/index.js';
|
|
3
|
-
export { type RequestOptions, type MissControl, type StaleControl, type Transport, type TransportRequest, type TransportResult, } from './transport/index.js';
|
|
4
|
+
export { type RequestOptions, type DeploymentRetired, type MissControl, type StaleControl, type Transport, type TransportRequest, type TransportResult, } from './transport/index.js';
|
|
4
5
|
export { HttpTransport, type Fetch, type HttpTransportOptions } from './transport/http/index.js';
|
|
5
6
|
export { WebSocketTransport, type WebSocketConstructor, type WebSocketTransportOptions, } from './transport/websocket/index.js';
|
|
6
7
|
export { AutoTransport, formatClientWarning, type AutoTransportOptions, type ClientWarning, } from './transport/auto/index.js';
|
|
7
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
export { Target, targetPath } from '@astrale-os/kernel-core/callable';
|
|
1
2
|
export { Client, call, } from './client/index.js';
|
|
2
3
|
export * from './errors/index.js';
|
|
3
4
|
export {} from './transport/index.js';
|
|
4
5
|
export { HttpTransport } from './transport/http/index.js';
|
|
5
6
|
export { WebSocketTransport, } from './transport/websocket/index.js';
|
|
6
7
|
export { AutoTransport, formatClientWarning, } from './transport/auto/index.js';
|
|
7
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -5,4 +5,3 @@ export type BatchOptions<Value> = Omit<AsyncBatcherOptions<Value>, 'maxSize' | '
|
|
|
5
5
|
readonly wait?: number;
|
|
6
6
|
};
|
|
7
7
|
export declare function createBatcher<Value>(consume: (values: Value[]) => Promise<unknown>, options?: BatchOptions<Value>): AsyncBatcher<Value>;
|
|
8
|
-
//# sourceMappingURL=batcher.d.ts.map
|
package/dist/pacer/index.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
export { retry, type RetryOptions } from './retry/index.js';
|
|
1
|
+
export { RETRY_REFUSALS, retry, type RetryOptions } from './retry/index.js';
|
|
2
2
|
export { createQueue, type QueueOptions } from './queue/index.js';
|
|
3
3
|
export { createBatcher, type BatchOptions } from './batcher/index.js';
|
|
4
4
|
export { createRateLimiter, type RateLimitOptions } from './limiter/index.js';
|
|
5
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/pacer/index.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
export { retry } from './retry/index.js';
|
|
1
|
+
export { RETRY_REFUSALS, retry } from './retry/index.js';
|
|
2
2
|
export { createQueue } from './queue/index.js';
|
|
3
3
|
export { createBatcher } from './batcher/index.js';
|
|
4
4
|
export { createRateLimiter } from './limiter/index.js';
|
|
5
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -5,4 +5,3 @@ export type RateLimitOptions<Operation extends AnyAsyncFunction> = Omit<AsyncRat
|
|
|
5
5
|
readonly window?: number;
|
|
6
6
|
};
|
|
7
7
|
export declare function createRateLimiter<Operation extends AnyAsyncFunction>(operation: Operation, options?: RateLimitOptions<Operation>): AsyncRateLimiter<Operation>;
|
|
8
|
-
//# sourceMappingURL=limiter.d.ts.map
|
|
@@ -4,4 +4,3 @@ export type QueueOptions<Value> = Omit<AsyncQueuerOptions<Value>, 'concurrency'>
|
|
|
4
4
|
readonly concurrency?: number;
|
|
5
5
|
};
|
|
6
6
|
export declare function createQueue<Value>(consume: (value: Value) => Promise<unknown>, options?: QueueOptions<Value>): AsyncQueuer<Value>;
|
|
7
|
-
//# sourceMappingURL=queue.d.ts.map
|
|
@@ -4,4 +4,3 @@ export declare const DEFAULT_RETRY_MAX_WAIT_MS = 5000;
|
|
|
4
4
|
export declare const DEFAULT_RETRY_JITTER = 0.2;
|
|
5
5
|
export declare function positive(input: number, label: string): number;
|
|
6
6
|
export declare function nonNegative(input: number, label: string): number;
|
|
7
|
-
//# sourceMappingURL=defaults.d.ts.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { RetryOptions } from './retry.js';
|
|
2
|
+
/**
|
|
3
|
+
* Opt-in policy for refusals proven to have run nothing. A back-pressure, draining or maintenance
|
|
4
|
+
* refusal is resent no earlier than its prescribed delay; a stale-snapshot conflict is resent after
|
|
5
|
+
* ordinary backoff. Every other failure ends the retry.
|
|
6
|
+
*/
|
|
7
|
+
export declare const RETRY_REFUSALS: Readonly<Required<Pick<RetryOptions, 'shouldRetry' | 'retryAfter'>>>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { isSnapshotStale, retryAfterOf } from '../../errors/index.js';
|
|
2
|
+
/**
|
|
3
|
+
* Opt-in policy for refusals proven to have run nothing. A back-pressure, draining or maintenance
|
|
4
|
+
* refusal is resent no earlier than its prescribed delay; a stale-snapshot conflict is resent after
|
|
5
|
+
* ordinary backoff. Every other failure ends the retry.
|
|
6
|
+
*/
|
|
7
|
+
export const RETRY_REFUSALS = Object.freeze({
|
|
8
|
+
shouldRetry: (error) => retryAfterOf(error) !== undefined || isSnapshotStale(error),
|
|
9
|
+
retryAfter: (error) => retryAfterOf(error),
|
|
10
|
+
});
|
|
@@ -4,7 +4,8 @@ export interface RetryOptions {
|
|
|
4
4
|
readonly maxWait?: number;
|
|
5
5
|
readonly jitter?: number;
|
|
6
6
|
readonly shouldRetry?: (error: Error, attempt: number) => boolean;
|
|
7
|
+
/** Least delay in milliseconds a failure prescribes before the next attempt; backoff still applies. */
|
|
8
|
+
readonly retryAfter?: (error: Error, attempt: number) => number | undefined;
|
|
7
9
|
}
|
|
8
10
|
/** Retry with bounded exponential backoff and never swallow the final failure. */
|
|
9
11
|
export declare function retry<Result>(operation: () => Promise<Result>, options?: RetryOptions): Promise<Result>;
|
|
10
|
-
//# sourceMappingURL=retry.d.ts.map
|
|
@@ -10,6 +10,9 @@ export async function retry(operation, options = {}) {
|
|
|
10
10
|
if (options.shouldRetry !== undefined && typeof options.shouldRetry !== 'function') {
|
|
11
11
|
throw new TypeError('Retry classifier is invalid.');
|
|
12
12
|
}
|
|
13
|
+
if (options.retryAfter !== undefined && typeof options.retryAfter !== 'function') {
|
|
14
|
+
throw new TypeError('Retry delay classifier is invalid.');
|
|
15
|
+
}
|
|
13
16
|
const attempts = positive(options.maxAttempts ?? DEFAULT_RETRY_ATTEMPTS, 'maxAttempts');
|
|
14
17
|
const baseWait = nonNegative(options.baseWait ?? DEFAULT_RETRY_BASE_WAIT_MS, 'baseWait');
|
|
15
18
|
const maxWait = nonNegative(options.maxWait ?? DEFAULT_RETRY_MAX_WAIT_MS, 'maxWait');
|
|
@@ -19,7 +22,11 @@ export async function retry(operation, options = {}) {
|
|
|
19
22
|
}
|
|
20
23
|
let succeeded = false;
|
|
21
24
|
let failure;
|
|
25
|
+
// Earliest instant the last failure allows the next attempt; backoff has already waited part of it.
|
|
26
|
+
let notBefore = 0;
|
|
27
|
+
let invalidDelay;
|
|
22
28
|
const retryer = new AsyncRetryer(async () => {
|
|
29
|
+
await waitUntil(notBefore);
|
|
23
30
|
try {
|
|
24
31
|
const result = await operation();
|
|
25
32
|
succeeded = true;
|
|
@@ -29,6 +36,15 @@ export async function retry(operation, options = {}) {
|
|
|
29
36
|
catch (error) {
|
|
30
37
|
succeeded = false;
|
|
31
38
|
failure = error;
|
|
39
|
+
if (error instanceof Error && options.retryAfter !== undefined) {
|
|
40
|
+
const delay = options.retryAfter(error, retryer.store.state.currentAttempt);
|
|
41
|
+
if (delay !== undefined && (!Number.isFinite(delay) || delay < 0)) {
|
|
42
|
+
invalidDelay = new TypeError('retryAfter must return a finite non-negative number.');
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
notBefore = delay === undefined ? 0 : Date.now() + delay;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
32
48
|
throw error;
|
|
33
49
|
}
|
|
34
50
|
}, {
|
|
@@ -39,13 +55,23 @@ export async function retry(operation, options = {}) {
|
|
|
39
55
|
maxAttempts: (current) => {
|
|
40
56
|
const error = current.store.state.lastError;
|
|
41
57
|
const attempt = current.store.state.currentAttempt;
|
|
58
|
+
if (invalidDelay !== undefined)
|
|
59
|
+
return attempt;
|
|
42
60
|
if (error !== undefined && options.shouldRetry?.(error, attempt) === false)
|
|
43
61
|
return attempt;
|
|
44
62
|
return attempts;
|
|
45
63
|
},
|
|
46
64
|
throwOnError: 'last',
|
|
47
65
|
});
|
|
48
|
-
|
|
66
|
+
let result;
|
|
67
|
+
try {
|
|
68
|
+
result = await retryer.execute();
|
|
69
|
+
}
|
|
70
|
+
catch (error) {
|
|
71
|
+
throw invalidDelay ?? error;
|
|
72
|
+
}
|
|
73
|
+
if (invalidDelay !== undefined)
|
|
74
|
+
throw invalidDelay;
|
|
49
75
|
if (!succeeded) {
|
|
50
76
|
if (failure !== undefined)
|
|
51
77
|
throw failure;
|
|
@@ -53,4 +79,9 @@ export async function retry(operation, options = {}) {
|
|
|
53
79
|
}
|
|
54
80
|
return result;
|
|
55
81
|
}
|
|
56
|
-
|
|
82
|
+
/** Timers may fire early against the wall clock, so wait again until the instant has passed. */
|
|
83
|
+
async function waitUntil(instant) {
|
|
84
|
+
for (let remaining = instant - Date.now(); remaining > 0; remaining = instant - Date.now()) {
|
|
85
|
+
await new Promise((resolve) => setTimeout(resolve, remaining));
|
|
86
|
+
}
|
|
87
|
+
}
|
package/dist/pool/index.d.ts
CHANGED
package/dist/pool/index.js
CHANGED
package/dist/pool/pool.d.ts
CHANGED
package/dist/pool/pool.js
CHANGED
package/dist/pool/target.d.ts
CHANGED
package/dist/pool/target.js
CHANGED
|
@@ -8,6 +8,5 @@ interface OutputContract {
|
|
|
8
8
|
};
|
|
9
9
|
}
|
|
10
10
|
/** Admit one value result through its Core-owned syscall contract. */
|
|
11
|
-
export declare function acceptOutput<T>(contract: OutputContract, input: unknown): T;
|
|
11
|
+
export declare function acceptOutput<T>(contract: OutputContract, input: unknown, what?: string): T;
|
|
12
12
|
export {};
|
|
13
|
-
//# sourceMappingURL=admission.d.ts.map
|
package/dist/schema/admission.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as portable from '@astrale-os/kernel-dsl/value';
|
|
2
2
|
/** Admit one value result through its Core-owned syscall contract. */
|
|
3
|
-
export function acceptOutput(contract, input) {
|
|
3
|
+
export function acceptOutput(contract, input, what = 'Schema result') {
|
|
4
4
|
const value = portable.accept(input);
|
|
5
5
|
const parsed = contract.safeParse(value);
|
|
6
6
|
if (!parsed.success)
|
|
7
|
-
throw new TypeError(
|
|
7
|
+
throw new TypeError(`Kernel returned an invalid ${what}.`);
|
|
8
8
|
return freeze(parsed.data);
|
|
9
9
|
}
|
|
10
10
|
function freeze(input) {
|
|
@@ -15,4 +15,3 @@ function freeze(input) {
|
|
|
15
15
|
}
|
|
16
16
|
return input;
|
|
17
17
|
}
|
|
18
|
-
//# sourceMappingURL=admission.js.map
|