@astrale-os/kernel-client 0.6.0-beta.5 → 0.6.0-beta.51
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 +3 -4
- package/dist/auth/auth.js +0 -1
- package/dist/auth/authorization.d.ts +2 -3
- package/dist/auth/authorization.js +0 -1
- package/dist/auth/credential.d.ts +0 -1
- package/dist/auth/credential.js +0 -1
- package/dist/auth/identity.d.ts +6 -9
- package/dist/auth/identity.js +0 -1
- package/dist/auth/index.d.ts +0 -1
- package/dist/auth/index.js +0 -1
- package/dist/auth/provision.d.ts +0 -1
- package/dist/auth/provision.js +0 -1
- package/dist/client/admission.d.ts +0 -1
- package/dist/client/admission.js +0 -1
- package/dist/client/client.d.ts +0 -1
- package/dist/client/client.js +0 -1
- package/dist/client/credential.d.ts +0 -1
- package/dist/client/credential.js +0 -1
- package/dist/client/index.d.ts +0 -1
- package/dist/client/index.js +0 -1
- package/dist/client/request.d.ts +0 -1
- package/dist/client/request.js +0 -1
- package/dist/client/result.d.ts +3 -4
- package/dist/client/result.js +3 -1
- package/dist/client/routing-control.d.ts +0 -1
- package/dist/client/routing-control.js +0 -1
- package/dist/errors/client-error.d.ts +0 -1
- package/dist/errors/client-error.js +2 -1
- package/dist/errors/index.d.ts +7 -7
- package/dist/errors/index.js +7 -7
- package/dist/errors/miss-error.d.ts +0 -1
- package/dist/errors/miss-error.js +0 -1
- package/dist/errors/protocol-error.d.ts +0 -1
- package/dist/errors/protocol-error.js +0 -1
- package/dist/errors/response-error.d.ts +0 -1
- package/dist/errors/response-error.js +0 -1
- package/dist/errors/session-error.d.ts +9 -0
- package/dist/errors/session-error.js +9 -0
- package/dist/errors/stale-route-error.d.ts +0 -1
- package/dist/errors/stale-route-error.js +0 -1
- package/dist/errors/transport-error.d.ts +18 -6
- package/dist/errors/transport-error.js +11 -7
- package/dist/graph/domain/binding.d.ts +22 -0
- package/dist/graph/domain/binding.js +123 -0
- package/dist/graph/domain/domain.typecheck.d.ts +1 -0
- package/dist/graph/domain/domain.typecheck.js +146 -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 +2 -3
- package/dist/graph/errors.js +1 -2
- package/dist/graph/expectation.d.ts +3 -0
- package/dist/graph/expectation.js +6 -0
- package/dist/graph/graph.d.ts +12 -8
- package/dist/graph/graph.js +0 -1
- package/dist/graph/index.d.ts +2 -2
- package/dist/graph/index.js +1 -1
- package/dist/graph/mutation.d.ts +2 -4
- package/dist/graph/mutation.js +10 -2
- package/dist/graph/page/index.d.ts +0 -1
- package/dist/graph/page/index.js +0 -1
- package/dist/graph/page/neighbors.d.ts +4 -5
- package/dist/graph/page/neighbors.js +7 -7
- package/dist/graph/page/page.d.ts +5 -2
- package/dist/graph/page/page.js +0 -1
- package/dist/graph/page-contract.d.ts +1 -2
- package/dist/graph/page-contract.js +0 -1
- package/dist/graph/provenance.d.ts +14 -0
- package/dist/graph/provenance.js +42 -0
- package/dist/graph/query.d.ts +3 -1
- package/dist/graph/query.js +33 -13
- package/dist/graph/read.d.ts +3 -4
- package/dist/graph/read.js +6 -5
- package/dist/index.d.ts +1 -2
- package/dist/index.js +1 -2
- package/dist/pacer/batcher/batcher.d.ts +0 -1
- package/dist/pacer/batcher/batcher.js +0 -1
- package/dist/pacer/batcher/defaults.d.ts +0 -1
- package/dist/pacer/batcher/defaults.js +0 -1
- package/dist/pacer/batcher/index.d.ts +0 -1
- package/dist/pacer/batcher/index.js +0 -1
- package/dist/pacer/index.d.ts +0 -1
- package/dist/pacer/index.js +0 -1
- package/dist/pacer/limiter/defaults.d.ts +0 -1
- package/dist/pacer/limiter/defaults.js +0 -1
- package/dist/pacer/limiter/index.d.ts +0 -1
- package/dist/pacer/limiter/index.js +0 -1
- package/dist/pacer/limiter/limiter.d.ts +0 -1
- package/dist/pacer/limiter/limiter.js +0 -1
- package/dist/pacer/queue/defaults.d.ts +0 -1
- package/dist/pacer/queue/defaults.js +0 -1
- package/dist/pacer/queue/index.d.ts +0 -1
- package/dist/pacer/queue/index.js +0 -1
- package/dist/pacer/queue/queue.d.ts +0 -1
- package/dist/pacer/queue/queue.js +0 -1
- package/dist/pacer/retry/defaults.d.ts +0 -1
- package/dist/pacer/retry/defaults.js +0 -1
- package/dist/pacer/retry/index.d.ts +0 -1
- package/dist/pacer/retry/index.js +0 -1
- package/dist/pacer/retry/retry.d.ts +0 -1
- package/dist/pacer/retry/retry.js +0 -1
- package/dist/pool/index.d.ts +0 -1
- package/dist/pool/index.js +0 -1
- package/dist/pool/pool.d.ts +0 -1
- package/dist/pool/pool.js +0 -1
- package/dist/pool/target.d.ts +0 -1
- package/dist/pool/target.js +0 -1
- package/dist/schema/admission.d.ts +1 -2
- package/dist/schema/admission.js +0 -1
- package/dist/schema/contracts.d.ts +6 -16
- package/dist/schema/contracts.js +0 -1
- package/dist/schema/index.d.ts +2 -3
- package/dist/schema/index.js +1 -2
- package/dist/schema/introspection.d.ts +1 -2
- package/dist/schema/introspection.js +5 -2
- package/dist/schema/operation.d.ts +0 -1
- package/dist/schema/operation.js +2 -3
- package/dist/schema/schema.d.ts +11 -10
- package/dist/schema/schema.js +80 -11
- package/dist/session/bound.d.ts +45 -0
- package/dist/session/bound.js +89 -0
- package/dist/session/context/control.d.ts +0 -1
- package/dist/session/context/control.js +0 -1
- package/dist/session/context/index.d.ts +0 -1
- package/dist/session/context/index.js +0 -1
- package/dist/session/context/limits.d.ts +0 -1
- package/dist/session/context/limits.js +0 -1
- package/dist/session/context/operation.d.ts +0 -1
- package/dist/session/context/operation.js +19 -17
- package/dist/session/context/policy.d.ts +0 -1
- package/dist/session/context/policy.js +0 -1
- package/dist/session/discovery/bundle.d.ts +0 -1
- package/dist/session/discovery/bundle.js +4 -4
- package/dist/session/discovery/discovery.d.ts +0 -1
- package/dist/session/discovery/discovery.js +0 -1
- package/dist/session/discovery/index.d.ts +0 -1
- package/dist/session/discovery/index.js +0 -1
- package/dist/session/discovery/publication.d.ts +0 -1
- package/dist/session/discovery/publication.js +4 -4
- package/dist/session/discovery/snapshot.d.ts +0 -1
- package/dist/session/discovery/snapshot.js +0 -1
- package/dist/session/discovery/transport.d.ts +6 -0
- package/dist/session/discovery/transport.js +13 -0
- package/dist/session/index.d.ts +4 -3
- package/dist/session/index.js +2 -1
- package/dist/session/reference.d.ts +14 -5
- package/dist/session/reference.js +28 -8
- package/dist/session/routing/auth.d.ts +0 -1
- package/dist/session/routing/auth.js +0 -1
- package/dist/session/routing/cache.d.ts +26 -6
- package/dist/session/routing/cache.js +215 -16
- package/dist/session/routing/dispatch.d.ts +0 -4
- package/dist/session/routing/dispatch.js +28 -18
- package/dist/session/routing/envelope.d.ts +2 -1
- package/dist/session/routing/envelope.js +14 -10
- package/dist/session/routing/expectation.d.ts +2 -3
- package/dist/session/routing/expectation.js +0 -1
- package/dist/session/routing/index.d.ts +1 -2
- package/dist/session/routing/index.js +1 -2
- package/dist/session/routing/request.d.ts +0 -1
- package/dist/session/routing/request.js +0 -1
- package/dist/session/session.d.ts +12 -6
- package/dist/session/session.js +32 -25
- package/dist/session/session.typecheck.d.ts +0 -1
- package/dist/session/session.typecheck.js +23 -3
- package/dist/session/views/catalog.d.ts +0 -1
- package/dist/session/views/catalog.js +13 -5
- package/dist/session/views/index.d.ts +0 -1
- package/dist/session/views/index.js +0 -1
- package/dist/session/views/resolve.d.ts +0 -1
- package/dist/session/views/resolve.js +0 -1
- package/dist/store/entity-index.d.ts +0 -1
- package/dist/store/entity-index.js +0 -1
- package/dist/store/index.d.ts +0 -1
- package/dist/store/index.js +0 -1
- package/dist/store/memory.d.ts +2 -2
- package/dist/store/memory.js +24 -13
- package/dist/store/mutation.d.ts +0 -1
- package/dist/store/mutation.js +0 -1
- 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 +3 -2
- package/dist/store/shape.js +3 -2
- package/dist/store/store.d.ts +2 -4
- package/dist/store/store.js +5 -4
- package/dist/store/store.typecheck.d.ts +0 -1
- package/dist/store/store.typecheck.js +3 -9
- package/dist/transport/auto/decision.d.ts +0 -1
- package/dist/transport/auto/decision.js +0 -1
- package/dist/transport/auto/fallback.d.ts +0 -1
- package/dist/transport/auto/fallback.js +8 -10
- package/dist/transport/auto/index.d.ts +0 -1
- package/dist/transport/auto/index.js +0 -1
- package/dist/transport/auto/transport.d.ts +0 -1
- package/dist/transport/auto/transport.js +5 -6
- package/dist/transport/auto/warning.d.ts +0 -1
- package/dist/transport/auto/warning.js +5 -3
- package/dist/transport/deadline.d.ts +0 -1
- package/dist/transport/deadline.js +0 -1
- package/dist/transport/failure.d.ts +7 -0
- package/dist/transport/failure.js +9 -0
- package/dist/transport/http/byte-stream.d.ts +17 -0
- package/dist/transport/http/byte-stream.js +86 -0
- package/dist/transport/http/index.d.ts +0 -1
- package/dist/transport/http/index.js +0 -1
- package/dist/transport/http/response.d.ts +0 -1
- package/dist/transport/http/response.js +0 -1
- package/dist/transport/http/stream.d.ts +0 -1
- package/dist/transport/http/stream.js +7 -7
- package/dist/transport/http/transport.d.ts +0 -1
- package/dist/transport/http/transport.js +43 -19
- package/dist/transport/index.d.ts +0 -1
- package/dist/transport/index.js +0 -1
- package/dist/transport/transport.d.ts +0 -1
- package/dist/transport/transport.js +0 -1
- package/dist/transport/websocket/connection.d.ts +0 -1
- package/dist/transport/websocket/connection.js +16 -26
- package/dist/transport/websocket/exchange.d.ts +0 -1
- package/dist/transport/websocket/exchange.js +5 -9
- package/dist/transport/websocket/index.d.ts +0 -1
- package/dist/transport/websocket/index.js +0 -1
- package/dist/transport/websocket/transport.d.ts +0 -1
- package/dist/transport/websocket/transport.js +7 -20
- package/package.json +12 -14
- package/dist/auth/auth.d.ts.map +0 -1
- package/dist/auth/auth.js.map +0 -1
- package/dist/auth/authorization.d.ts.map +0 -1
- package/dist/auth/authorization.js.map +0 -1
- package/dist/auth/credential.d.ts.map +0 -1
- package/dist/auth/credential.js.map +0 -1
- package/dist/auth/identity.d.ts.map +0 -1
- package/dist/auth/identity.js.map +0 -1
- package/dist/auth/index.d.ts.map +0 -1
- package/dist/auth/index.js.map +0 -1
- package/dist/auth/provision.d.ts.map +0 -1
- package/dist/auth/provision.js.map +0 -1
- package/dist/client/admission.d.ts.map +0 -1
- package/dist/client/admission.js.map +0 -1
- package/dist/client/client.d.ts.map +0 -1
- package/dist/client/client.js.map +0 -1
- package/dist/client/credential.d.ts.map +0 -1
- package/dist/client/credential.js.map +0 -1
- package/dist/client/index.d.ts.map +0 -1
- package/dist/client/index.js.map +0 -1
- package/dist/client/request.d.ts.map +0 -1
- package/dist/client/request.js.map +0 -1
- package/dist/client/result.d.ts.map +0 -1
- package/dist/client/result.js.map +0 -1
- package/dist/client/routing-control.d.ts.map +0 -1
- package/dist/client/routing-control.js.map +0 -1
- package/dist/errors/client-error.d.ts.map +0 -1
- package/dist/errors/client-error.js.map +0 -1
- package/dist/errors/index.d.ts.map +0 -1
- package/dist/errors/index.js.map +0 -1
- package/dist/errors/miss-error.d.ts.map +0 -1
- package/dist/errors/miss-error.js.map +0 -1
- package/dist/errors/protocol-error.d.ts.map +0 -1
- package/dist/errors/protocol-error.js.map +0 -1
- package/dist/errors/response-error.d.ts.map +0 -1
- package/dist/errors/response-error.js.map +0 -1
- package/dist/errors/stale-route-error.d.ts.map +0 -1
- package/dist/errors/stale-route-error.js.map +0 -1
- package/dist/errors/transport-error.d.ts.map +0 -1
- package/dist/errors/transport-error.js.map +0 -1
- package/dist/graph/errors.d.ts.map +0 -1
- package/dist/graph/errors.js.map +0 -1
- package/dist/graph/graph.d.ts.map +0 -1
- package/dist/graph/graph.js.map +0 -1
- package/dist/graph/index.d.ts.map +0 -1
- package/dist/graph/index.js.map +0 -1
- package/dist/graph/mutation.d.ts.map +0 -1
- package/dist/graph/mutation.js.map +0 -1
- package/dist/graph/page/index.d.ts.map +0 -1
- package/dist/graph/page/index.js.map +0 -1
- package/dist/graph/page/neighbors.d.ts.map +0 -1
- package/dist/graph/page/neighbors.js.map +0 -1
- package/dist/graph/page/page.d.ts.map +0 -1
- package/dist/graph/page/page.js.map +0 -1
- package/dist/graph/page-contract.d.ts.map +0 -1
- package/dist/graph/page-contract.js.map +0 -1
- package/dist/graph/query.d.ts.map +0 -1
- package/dist/graph/query.js.map +0 -1
- package/dist/graph/read.d.ts.map +0 -1
- package/dist/graph/read.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/pacer/batcher/batcher.d.ts.map +0 -1
- package/dist/pacer/batcher/batcher.js.map +0 -1
- package/dist/pacer/batcher/defaults.d.ts.map +0 -1
- package/dist/pacer/batcher/defaults.js.map +0 -1
- package/dist/pacer/batcher/index.d.ts.map +0 -1
- package/dist/pacer/batcher/index.js.map +0 -1
- package/dist/pacer/index.d.ts.map +0 -1
- package/dist/pacer/index.js.map +0 -1
- package/dist/pacer/limiter/defaults.d.ts.map +0 -1
- package/dist/pacer/limiter/defaults.js.map +0 -1
- package/dist/pacer/limiter/index.d.ts.map +0 -1
- package/dist/pacer/limiter/index.js.map +0 -1
- package/dist/pacer/limiter/limiter.d.ts.map +0 -1
- package/dist/pacer/limiter/limiter.js.map +0 -1
- package/dist/pacer/queue/defaults.d.ts.map +0 -1
- package/dist/pacer/queue/defaults.js.map +0 -1
- package/dist/pacer/queue/index.d.ts.map +0 -1
- package/dist/pacer/queue/index.js.map +0 -1
- package/dist/pacer/queue/queue.d.ts.map +0 -1
- package/dist/pacer/queue/queue.js.map +0 -1
- package/dist/pacer/retry/defaults.d.ts.map +0 -1
- package/dist/pacer/retry/defaults.js.map +0 -1
- package/dist/pacer/retry/index.d.ts.map +0 -1
- package/dist/pacer/retry/index.js.map +0 -1
- package/dist/pacer/retry/retry.d.ts.map +0 -1
- package/dist/pacer/retry/retry.js.map +0 -1
- package/dist/pool/index.d.ts.map +0 -1
- package/dist/pool/index.js.map +0 -1
- package/dist/pool/pool.d.ts.map +0 -1
- package/dist/pool/pool.js.map +0 -1
- package/dist/pool/target.d.ts.map +0 -1
- package/dist/pool/target.js.map +0 -1
- package/dist/schema/admission.d.ts.map +0 -1
- package/dist/schema/admission.js.map +0 -1
- package/dist/schema/contracts.d.ts.map +0 -1
- package/dist/schema/contracts.js.map +0 -1
- package/dist/schema/index.d.ts.map +0 -1
- package/dist/schema/index.js.map +0 -1
- package/dist/schema/introspection.d.ts.map +0 -1
- package/dist/schema/introspection.js.map +0 -1
- package/dist/schema/operation.d.ts.map +0 -1
- package/dist/schema/operation.js.map +0 -1
- package/dist/schema/schema.d.ts.map +0 -1
- package/dist/schema/schema.js.map +0 -1
- package/dist/session/context/control.d.ts.map +0 -1
- package/dist/session/context/control.js.map +0 -1
- package/dist/session/context/index.d.ts.map +0 -1
- package/dist/session/context/index.js.map +0 -1
- package/dist/session/context/limits.d.ts.map +0 -1
- package/dist/session/context/limits.js.map +0 -1
- package/dist/session/context/operation.d.ts.map +0 -1
- package/dist/session/context/operation.js.map +0 -1
- package/dist/session/context/policy.d.ts.map +0 -1
- package/dist/session/context/policy.js.map +0 -1
- package/dist/session/discovery/bundle.d.ts.map +0 -1
- package/dist/session/discovery/bundle.js.map +0 -1
- package/dist/session/discovery/discovery.d.ts.map +0 -1
- package/dist/session/discovery/discovery.js.map +0 -1
- package/dist/session/discovery/index.d.ts.map +0 -1
- package/dist/session/discovery/index.js.map +0 -1
- package/dist/session/discovery/publication.d.ts.map +0 -1
- package/dist/session/discovery/publication.js.map +0 -1
- package/dist/session/discovery/snapshot.d.ts.map +0 -1
- package/dist/session/discovery/snapshot.js.map +0 -1
- package/dist/session/index.d.ts.map +0 -1
- package/dist/session/index.js.map +0 -1
- package/dist/session/reference.d.ts.map +0 -1
- package/dist/session/reference.js.map +0 -1
- package/dist/session/routing/auth.d.ts.map +0 -1
- package/dist/session/routing/auth.js.map +0 -1
- package/dist/session/routing/cache.d.ts.map +0 -1
- package/dist/session/routing/cache.js.map +0 -1
- package/dist/session/routing/dispatch.d.ts.map +0 -1
- package/dist/session/routing/dispatch.js.map +0 -1
- package/dist/session/routing/envelope.d.ts.map +0 -1
- package/dist/session/routing/envelope.js.map +0 -1
- package/dist/session/routing/expectation.d.ts.map +0 -1
- package/dist/session/routing/expectation.js.map +0 -1
- package/dist/session/routing/index.d.ts.map +0 -1
- package/dist/session/routing/index.js.map +0 -1
- package/dist/session/routing/request.d.ts.map +0 -1
- package/dist/session/routing/request.js.map +0 -1
- package/dist/session/session.d.ts.map +0 -1
- package/dist/session/session.js.map +0 -1
- package/dist/session/session.typecheck.d.ts.map +0 -1
- package/dist/session/session.typecheck.js.map +0 -1
- package/dist/session/views/catalog.d.ts.map +0 -1
- package/dist/session/views/catalog.js.map +0 -1
- package/dist/session/views/index.d.ts.map +0 -1
- package/dist/session/views/index.js.map +0 -1
- package/dist/session/views/resolve.d.ts.map +0 -1
- package/dist/session/views/resolve.js.map +0 -1
- package/dist/store/entity-index.d.ts.map +0 -1
- package/dist/store/entity-index.js.map +0 -1
- package/dist/store/index.d.ts.map +0 -1
- package/dist/store/index.js.map +0 -1
- package/dist/store/memory.d.ts.map +0 -1
- package/dist/store/memory.js.map +0 -1
- package/dist/store/mutation.d.ts.map +0 -1
- package/dist/store/mutation.js.map +0 -1
- package/dist/store/observe.d.ts.map +0 -1
- package/dist/store/observe.js.map +0 -1
- package/dist/store/optimistic.d.ts.map +0 -1
- package/dist/store/optimistic.js.map +0 -1
- package/dist/store/query-key.d.ts.map +0 -1
- package/dist/store/query-key.js.map +0 -1
- package/dist/store/shape.d.ts.map +0 -1
- package/dist/store/shape.js.map +0 -1
- package/dist/store/store.d.ts.map +0 -1
- package/dist/store/store.js.map +0 -1
- package/dist/store/store.typecheck.d.ts.map +0 -1
- package/dist/store/store.typecheck.js.map +0 -1
- package/dist/transport/auto/decision.d.ts.map +0 -1
- package/dist/transport/auto/decision.js.map +0 -1
- package/dist/transport/auto/fallback.d.ts.map +0 -1
- package/dist/transport/auto/fallback.js.map +0 -1
- package/dist/transport/auto/index.d.ts.map +0 -1
- package/dist/transport/auto/index.js.map +0 -1
- package/dist/transport/auto/transport.d.ts.map +0 -1
- package/dist/transport/auto/transport.js.map +0 -1
- package/dist/transport/auto/warning.d.ts.map +0 -1
- package/dist/transport/auto/warning.js.map +0 -1
- package/dist/transport/deadline.d.ts.map +0 -1
- package/dist/transport/deadline.js.map +0 -1
- package/dist/transport/http/index.d.ts.map +0 -1
- package/dist/transport/http/index.js.map +0 -1
- package/dist/transport/http/response.d.ts.map +0 -1
- package/dist/transport/http/response.js.map +0 -1
- package/dist/transport/http/stream.d.ts.map +0 -1
- package/dist/transport/http/stream.js.map +0 -1
- package/dist/transport/http/transport.d.ts.map +0 -1
- package/dist/transport/http/transport.js.map +0 -1
- package/dist/transport/index.d.ts.map +0 -1
- package/dist/transport/index.js.map +0 -1
- package/dist/transport/transport.d.ts.map +0 -1
- package/dist/transport/transport.js.map +0 -1
- package/dist/transport/websocket/connection.d.ts.map +0 -1
- package/dist/transport/websocket/connection.js.map +0 -1
- package/dist/transport/websocket/exchange.d.ts.map +0 -1
- package/dist/transport/websocket/exchange.js.map +0 -1
- package/dist/transport/websocket/index.d.ts.map +0 -1
- package/dist/transport/websocket/index.js.map +0 -1
- package/dist/transport/websocket/transport.d.ts.map +0 -1
- package/dist/transport/websocket/transport.js.map +0 -1
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import type { IssuerId } from '@astrale-os/kernel-core/auth/issuer';
|
|
2
2
|
import type { PathLike } from '@astrale-os/kernel-core/path';
|
|
3
|
-
import type {
|
|
3
|
+
import type { Domain } from '@astrale-os/kernel-dsl/v1/domain';
|
|
4
4
|
import type { Call, Input, Result } from '../client/index.js';
|
|
5
|
+
import type { DomainBinding, GraphApi } from '../graph/index.js';
|
|
5
6
|
import type { ClientFactory, ClientPool as ClientPoolType } from '../pool/index.js';
|
|
6
|
-
import type {
|
|
7
|
+
import type { SchemaApi } from '../schema/index.js';
|
|
7
8
|
import type { ClientWarning } from '../transport/auto/index.js';
|
|
8
9
|
import type { Fetch } from '../transport/http/index.js';
|
|
9
10
|
import type { WebSocketConstructor } from '../transport/websocket/index.js';
|
|
10
11
|
import type { SessionControlOptions, SessionPolicy } from './context/index.js';
|
|
11
12
|
import type { SessionSnapshot } from './discovery/index.js';
|
|
12
13
|
import type { CallableReference, InputOfReference, OutputOfReference } from './reference.js';
|
|
13
|
-
import type { SessionAuth, SessionEnvelopeTransport, SessionRequestOptions } from './routing/index.js';
|
|
14
|
+
import type { SessionRouteStore, SessionAuth, SessionEnvelopeTransport, SessionRequestOptions } from './routing/index.js';
|
|
14
15
|
import type { ViewCatalog } from './views/index.js';
|
|
15
16
|
export interface ClientSessionOptions {
|
|
16
17
|
/** Exact canonical source Kernel identity; its invocation and discovery endpoints are derived. */
|
|
@@ -20,6 +21,8 @@ export interface ClientSessionOptions {
|
|
|
20
21
|
readonly pool?: Pick<ClientPoolType, 'clientFor'>;
|
|
21
22
|
readonly websocket?: WebSocketConstructor;
|
|
22
23
|
readonly auth?: SessionAuth;
|
|
24
|
+
/** Optional caller-owned persistence for bounded confidential route artifacts. */
|
|
25
|
+
readonly routeStore?: SessionRouteStore;
|
|
23
26
|
readonly policy: SessionPolicy;
|
|
24
27
|
readonly envelopeTransport?: SessionEnvelopeTransport;
|
|
25
28
|
readonly onWarning?: (warning: ClientWarning) => void;
|
|
@@ -27,6 +30,7 @@ export interface ClientSessionOptions {
|
|
|
27
30
|
readonly maximumBundleBytes?: number;
|
|
28
31
|
readonly maximumResponseBytes?: number;
|
|
29
32
|
readonly timeoutMs?: number;
|
|
33
|
+
readonly schemaLifecycleTimeoutMs?: number;
|
|
30
34
|
}
|
|
31
35
|
export type ConnectOptions = Omit<ClientSessionOptions, 'kernel' | 'policy'> & {
|
|
32
36
|
readonly url: string;
|
|
@@ -36,6 +40,7 @@ export type ConnectOptions = Omit<ClientSessionOptions, 'kernel' | 'policy'> & {
|
|
|
36
40
|
export declare class ClientSession {
|
|
37
41
|
readonly kernel: IssuerId;
|
|
38
42
|
readonly schema: SchemaApi;
|
|
43
|
+
readonly graph: GraphApi;
|
|
39
44
|
private readonly ownedPool?;
|
|
40
45
|
private readonly discovery;
|
|
41
46
|
private readonly dispatcher;
|
|
@@ -45,18 +50,19 @@ export declare class ClientSession {
|
|
|
45
50
|
private readonly admitTargetViews;
|
|
46
51
|
private closed;
|
|
47
52
|
constructor(options: ClientSessionOptions);
|
|
53
|
+
/** Bind one admitted DSL Domain to authenticated graph projection and Method dispatch. */
|
|
54
|
+
bind<const DomainValue extends Domain>(domain: DomainValue): DomainBinding<DomainValue>;
|
|
48
55
|
snapshot(options?: SessionControlOptions): Promise<SessionSnapshot>;
|
|
49
56
|
viewsFor(target: PathLike, options?: SessionControlOptions): Promise<ViewCatalog>;
|
|
50
|
-
installation(origin: Key.Origin, options?: SessionControlOptions): Promise<ReadyInstallation>;
|
|
51
57
|
dispatch(call: Call, options?: SessionRequestOptions): Promise<Result>;
|
|
52
58
|
call(call: Call, options?: SessionRequestOptions): Promise<Input>;
|
|
53
59
|
invoke<const Reference extends CallableReference>(reference: Reference, input: InputOfReference<Reference>, options?: SessionRequestOptions): Promise<OutputOfReference<Reference>>;
|
|
54
60
|
stream(call: Call, options?: SessionRequestOptions): Promise<import("../client/result.js").Stream>;
|
|
55
|
-
binary(call: Call, options?: SessionRequestOptions): Promise<import("@astrale-os/kernel-core/
|
|
61
|
+
binary(call: Call, options?: SessionRequestOptions): Promise<import("@astrale-os/kernel-core/callable").BinaryOutput>;
|
|
56
62
|
close(): void;
|
|
57
63
|
private requireOpen;
|
|
64
|
+
private invokeDomainMethod;
|
|
58
65
|
private operation;
|
|
59
66
|
}
|
|
60
67
|
/** Open one caller-owned conversation with a Kernel using secure defaults. */
|
|
61
68
|
export declare function connect(options: ConnectOptions): ClientSession;
|
|
62
|
-
//# sourceMappingURL=session.d.ts.map
|
package/dist/session/session.js
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
import { Path } from '@astrale-os/kernel-core/path';
|
|
1
2
|
import { Client } from '../client/index.js';
|
|
2
|
-
import {
|
|
3
|
+
import { SessionError } from '../errors/index.js';
|
|
4
|
+
import { createDomainBinding } from '../graph/domain/binding.js';
|
|
5
|
+
import { createGraph } from '../graph/index.js';
|
|
3
6
|
import { ClientPool } from '../pool/index.js';
|
|
4
|
-
import { createSchema } from '../schema/index.js';
|
|
7
|
+
import { createSchema, DEFAULT_SCHEMA_LIFECYCLE_TIMEOUT_MS } from '../schema/index.js';
|
|
5
8
|
import { AutoTransport } from '../transport/auto/index.js';
|
|
6
9
|
import { HttpTransport } from '../transport/http/index.js';
|
|
7
10
|
import { WebSocketTransport } from '../transport/websocket/index.js';
|
|
@@ -15,6 +18,7 @@ const DEFAULT_SESSION_POLICY = Object.freeze({ maximumRouteAgeMs: 60_000 });
|
|
|
15
18
|
export class ClientSession {
|
|
16
19
|
kernel;
|
|
17
20
|
schema;
|
|
21
|
+
graph;
|
|
18
22
|
ownedPool;
|
|
19
23
|
discovery;
|
|
20
24
|
dispatcher;
|
|
@@ -42,11 +46,12 @@ export class ClientSession {
|
|
|
42
46
|
const maximumBundleBytes = positive(options.maximumBundleBytes ?? DEFAULT_MAXIMUM_BUNDLE_BYTES, 'maximumBundleBytes');
|
|
43
47
|
const maximumResponseBytes = positive(options.maximumResponseBytes ?? DEFAULT_MAXIMUM_RESPONSE_BYTES, 'maximumResponseBytes');
|
|
44
48
|
const timeoutMs = platformDuration(options.timeoutMs ?? DEFAULT_TIMEOUT_MS, 'timeoutMs');
|
|
49
|
+
const schemaLifecycleTimeoutMs = platformDuration(options.schemaLifecycleTimeoutMs ?? DEFAULT_SCHEMA_LIFECYCLE_TIMEOUT_MS, 'schemaLifecycleTimeoutMs');
|
|
45
50
|
this.timeoutMs = timeoutMs;
|
|
46
51
|
const websocketAvailable = options.client !== undefined ||
|
|
47
52
|
options.pool !== undefined ||
|
|
48
53
|
options.websocket !== undefined ||
|
|
49
|
-
typeof
|
|
54
|
+
typeof WebSocket === 'function';
|
|
50
55
|
const client = options.client ??
|
|
51
56
|
defaultClientFactory({
|
|
52
57
|
fetch: fetchImpl,
|
|
@@ -73,7 +78,7 @@ export class ClientSession {
|
|
|
73
78
|
requireOpen: () => this.requireOpen(),
|
|
74
79
|
acquisitionOperation: () => this.operation(undefined),
|
|
75
80
|
});
|
|
76
|
-
this.routes = new RouteCache(policy.maximumRouteAgeMs);
|
|
81
|
+
this.routes = new RouteCache(policy.maximumRouteAgeMs, undefined, options.routeStore);
|
|
77
82
|
this.dispatcher = new SessionDispatcher({
|
|
78
83
|
kernel: this.kernel,
|
|
79
84
|
sourceEndpoint,
|
|
@@ -83,13 +88,18 @@ export class ClientSession {
|
|
|
83
88
|
cache: this.routes,
|
|
84
89
|
policy,
|
|
85
90
|
envelopeTransport: admitEnvelopeTransport(options.envelopeTransport ?? 'http'),
|
|
86
|
-
discovery: this.discovery,
|
|
87
91
|
requireOpen: () => this.requireOpen(),
|
|
88
92
|
});
|
|
89
93
|
this.schema = createSchema((request, options) => this.dispatch(request, options), {
|
|
90
94
|
maximumPublicationBytes,
|
|
91
95
|
maximumBundleBytes,
|
|
96
|
+
lifecycleTimeoutMs: schemaLifecycleTimeoutMs,
|
|
92
97
|
});
|
|
98
|
+
this.graph = createGraph((call, options) => this.call(call, options));
|
|
99
|
+
}
|
|
100
|
+
/** Bind one admitted DSL Domain to authenticated graph projection and Method dispatch. */
|
|
101
|
+
bind(domain) {
|
|
102
|
+
return createDomainBinding(domain, this.graph, (node, method, input) => this.invokeDomainMethod(domain, node, method, input));
|
|
93
103
|
}
|
|
94
104
|
snapshot(options) {
|
|
95
105
|
return this.discovery.snapshot(this.operation(admitControlOptions(options)));
|
|
@@ -98,23 +108,6 @@ export class ClientSession {
|
|
|
98
108
|
this.requireOpen();
|
|
99
109
|
return resolveViewsFor(async (call, operation) => requireResultKind('value', await this.dispatcher.dispatch(call, {}, operation)).value, this.admitTargetViews, target, this.operation(admitControlOptions(options)));
|
|
100
110
|
}
|
|
101
|
-
async installation(origin, options) {
|
|
102
|
-
const result = await this.schema.introspect({
|
|
103
|
-
from: { kind: 'installation', origin },
|
|
104
|
-
select: {
|
|
105
|
-
state: true,
|
|
106
|
-
target: true,
|
|
107
|
-
source: true,
|
|
108
|
-
bundle: true,
|
|
109
|
-
readiness: true,
|
|
110
|
-
capabilities: true,
|
|
111
|
-
},
|
|
112
|
-
}, options);
|
|
113
|
-
if (result?.state !== 'ready' || result.readiness === null) {
|
|
114
|
-
throw new ClientError(`Domain ${origin} is not ready on this Kernel.`);
|
|
115
|
-
}
|
|
116
|
-
return result;
|
|
117
|
-
}
|
|
118
111
|
dispatch(call, options) {
|
|
119
112
|
const admitted = admitRequestOptions(options);
|
|
120
113
|
return this.dispatcher.dispatch(call, admitted, this.operation(admitted));
|
|
@@ -150,14 +143,29 @@ export class ClientSession {
|
|
|
150
143
|
if (this.closed)
|
|
151
144
|
return;
|
|
152
145
|
this.closed = true;
|
|
153
|
-
this.lifecycle.abort(new
|
|
146
|
+
this.lifecycle.abort(new SessionError('ClientSession is closed.', { failure: 'closed' }));
|
|
154
147
|
this.ownedPool?.close();
|
|
155
148
|
this.routes.clear();
|
|
156
149
|
this.discovery.clear();
|
|
157
150
|
}
|
|
158
151
|
requireOpen() {
|
|
159
152
|
if (this.closed)
|
|
160
|
-
throw new
|
|
153
|
+
throw new SessionError('ClientSession is closed.', { failure: 'closed' });
|
|
154
|
+
}
|
|
155
|
+
invokeDomainMethod(domain, node, method, input) {
|
|
156
|
+
const diagnostics = method.validateInput(input);
|
|
157
|
+
if (diagnostics.length > 0)
|
|
158
|
+
throw new TypeError(`Method ${method.key} input is invalid.`);
|
|
159
|
+
const owner = domain.closure.find(({ origin }) => origin === method.owner.ref.origin);
|
|
160
|
+
if (owner === undefined)
|
|
161
|
+
throw new TypeError(`Method owner ${method.owner.ref.origin} is absent.`);
|
|
162
|
+
return this.invoke({
|
|
163
|
+
origin: owner.origin,
|
|
164
|
+
revision: owner.revision,
|
|
165
|
+
callable: method.key,
|
|
166
|
+
target: Path.instanceMethod(Path.id(node.id), method.name),
|
|
167
|
+
outputMode: method.output.mode,
|
|
168
|
+
}, input);
|
|
161
169
|
}
|
|
162
170
|
operation(options) {
|
|
163
171
|
this.requireOpen();
|
|
@@ -231,4 +239,3 @@ function defaultClientFactory(options) {
|
|
|
231
239
|
}
|
|
232
240
|
};
|
|
233
241
|
}
|
|
234
|
-
//# sourceMappingURL=session.js.map
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { NodeId } from '@astrale-os/kernel-core/graph/node';
|
|
2
|
+
import { Path } from '@astrale-os/kernel-core/path';
|
|
3
|
+
import { defineSchema, method, nodeClass, schema } from '@astrale-os/kernel-dsl/v1';
|
|
4
|
+
import { ClientSession, reference } from './index.js';
|
|
2
5
|
void new ClientSession(options);
|
|
3
6
|
void auth;
|
|
4
7
|
void control;
|
|
@@ -6,5 +9,22 @@ void envelope;
|
|
|
6
9
|
void policy;
|
|
7
10
|
void request;
|
|
8
11
|
void snapshot;
|
|
9
|
-
|
|
10
|
-
|
|
12
|
+
const dynamicReference = reference(dynamicDomain, dynamicMethod)(Path.id(NodeId('dynamic-node')));
|
|
13
|
+
void session.invoke(dynamicReference, dynamicInput);
|
|
14
|
+
const dynamicInputIsClientInput = true;
|
|
15
|
+
const dynamicOutputIsUnknown = true;
|
|
16
|
+
void dynamicInputIsClientInput;
|
|
17
|
+
void dynamicOutputIsUnknown;
|
|
18
|
+
const abstractMethod = method({
|
|
19
|
+
auth: 'authenticated',
|
|
20
|
+
input: { type: 'null' },
|
|
21
|
+
output: { type: 'null' },
|
|
22
|
+
inheritance: 'abstract',
|
|
23
|
+
});
|
|
24
|
+
const abstractDomain = schema.resolve(defineSchema('client.reference.typecheck', {
|
|
25
|
+
classes: {
|
|
26
|
+
AbstractItem: nodeClass({ abstract: true, methods: { abstractMethod } }),
|
|
27
|
+
},
|
|
28
|
+
}));
|
|
29
|
+
// @ts-expect-error Abstract Methods are declarations and cannot become Client references.
|
|
30
|
+
reference(abstractDomain, abstractDomain.classes.AbstractItem.methods.abstractMethod);
|
|
@@ -13,4 +13,3 @@ export declare function rootViewCatalog(publication: publication.Publication, ar
|
|
|
13
13
|
export declare function catalogFromKeys(root: ViewCatalog, keys: readonly Key.View[]): ViewCatalog;
|
|
14
14
|
/** Re-admit one Runtime-resolved heterogeneous View catalog at the Client trust boundary. */
|
|
15
15
|
export declare function targetViewCatalog(input: unknown, policy: Readonly<SessionPolicy>): ViewCatalog;
|
|
16
|
-
//# sourceMappingURL=catalog.d.ts.map
|
|
@@ -1,20 +1,22 @@
|
|
|
1
1
|
import { acceptViewResolution, } from '@astrale-os/kernel-core/schema/kernel/syscalls/view-resolution';
|
|
2
|
-
import { Key as ViewKey
|
|
2
|
+
import { Key as ViewKey } from '@astrale-os/kernel-dsl/v1/addressing';
|
|
3
3
|
import { ClientError } from '../../errors/index.js';
|
|
4
4
|
import { allowEndpoint } from '../context/index.js';
|
|
5
5
|
export function rootViewCatalog(publication, artifact, policy) {
|
|
6
6
|
const views = publication.bindings.views
|
|
7
7
|
.map((binding) => {
|
|
8
8
|
allowEndpoint(binding.href, policy);
|
|
9
|
-
const declaration = artifact.root.views[
|
|
9
|
+
const declaration = artifact.root.views[viewName(binding.view)];
|
|
10
10
|
if (declaration === undefined) {
|
|
11
11
|
throw new ClientError('Published View has no verified root declaration.');
|
|
12
12
|
}
|
|
13
|
+
const { ref: _ref, ...viewDeclaration } = declaration;
|
|
13
14
|
return Object.freeze({
|
|
14
15
|
key: binding.view,
|
|
15
|
-
declaration,
|
|
16
|
+
declaration: Object.freeze(viewDeclaration),
|
|
16
17
|
href: binding.href,
|
|
17
18
|
handshake: binding.handshake,
|
|
19
|
+
...(binding.iframe === undefined ? {} : { iframe: binding.iframe }),
|
|
18
20
|
issuer: publication.identity.issuer,
|
|
19
21
|
etag: publication.etag,
|
|
20
22
|
revision: publication.schema.revision,
|
|
@@ -25,7 +27,7 @@ export function rootViewCatalog(publication, artifact, policy) {
|
|
|
25
27
|
const entrypointRef = publication.manifest?.entrypoint;
|
|
26
28
|
const entrypoint = entrypointRef === undefined
|
|
27
29
|
? undefined
|
|
28
|
-
: catalogViews.find(({ key }) => key === ViewKey.of(
|
|
30
|
+
: catalogViews.find(({ key }) => key === ViewKey.of(entrypointRef));
|
|
29
31
|
if (entrypointRef !== undefined && entrypoint === undefined) {
|
|
30
32
|
throw new ClientError('Published View entrypoint has no verified Publication binding.');
|
|
31
33
|
}
|
|
@@ -60,4 +62,10 @@ export function targetViewCatalog(input, policy) {
|
|
|
60
62
|
function compareKeys(left, right) {
|
|
61
63
|
return left < right ? -1 : left > right ? 1 : 0;
|
|
62
64
|
}
|
|
63
|
-
|
|
65
|
+
function viewName(input) {
|
|
66
|
+
const coordinate = input.slice(input.indexOf(':') + 1);
|
|
67
|
+
const match = /^view\.([A-Za-z][A-Za-z0-9_]*)$/u.exec(coordinate);
|
|
68
|
+
if (match === null)
|
|
69
|
+
throw new ClientError('Published View key is invalid.');
|
|
70
|
+
return match[1];
|
|
71
|
+
}
|
|
@@ -9,4 +9,3 @@ export type ViewCatalogAdmission = (input: unknown) => ViewCatalog;
|
|
|
9
9
|
* its heterogeneous installed-Publication projection.
|
|
10
10
|
*/
|
|
11
11
|
export declare function resolveViewsFor(invoke: ViewInvoker, admitCatalog: ViewCatalogAdmission, target: PathLike, operation: SessionOperation): Promise<ViewCatalog>;
|
|
12
|
-
//# sourceMappingURL=resolve.d.ts.map
|
|
@@ -11,4 +11,3 @@ export async function resolveViewsFor(invoke, admitCatalog, target, operation) {
|
|
|
11
11
|
const targetView = Path.staticMethod(owner, view.resolve.name);
|
|
12
12
|
return admitCatalog(await invoke(call(targetView, { target: path }), operation));
|
|
13
13
|
}
|
|
14
|
-
//# sourceMappingURL=resolve.js.map
|
package/dist/store/index.d.ts
CHANGED
package/dist/store/index.js
CHANGED
package/dist/store/memory.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { QueryAST } from '@astrale-os/kernel-core/graph/query';
|
|
2
|
+
import type { DomainDependency } from '@astrale-os/kernel-dsl/v1/schema';
|
|
2
3
|
import type { QueryPageRequest } from '../graph/index.js';
|
|
3
4
|
import type { GraphApi } from '../graph/index.js';
|
|
4
5
|
import type { StoreQueryResponse, StoreReadOptions, StoreSnapshot } from './store.js';
|
|
@@ -24,7 +25,7 @@ export declare class GraphMemory {
|
|
|
24
25
|
private readonly pending;
|
|
25
26
|
private active;
|
|
26
27
|
constructor(options: GraphMemoryOptions);
|
|
27
|
-
ensure(key: string, ast: QueryAST, page: QueryPageRequest): QueryShape;
|
|
28
|
+
ensure(key: string, ast: QueryAST, page: QueryPageRequest, expected: readonly DomainDependency[] | undefined): QueryShape;
|
|
28
29
|
get(key: string): QueryShape | undefined;
|
|
29
30
|
read(shape: QueryShape, options: StoreReadOptions): Promise<StoreQueryResponse>;
|
|
30
31
|
snapshot(shape: QueryShape | undefined): StoreSnapshot;
|
|
@@ -46,4 +47,3 @@ export declare class GraphMemory {
|
|
|
46
47
|
private drain;
|
|
47
48
|
private report;
|
|
48
49
|
}
|
|
49
|
-
//# sourceMappingURL=memory.d.ts.map
|
package/dist/store/memory.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { encodeEdgeKey } from '@astrale-os/kernel-core/graph/edge';
|
|
2
2
|
import { ClientError } from '../errors/index.js';
|
|
3
|
+
import { retainDerivedQueryProvenance } from '../graph/provenance.js';
|
|
3
4
|
import { edgeIdentity, EntityIndex } from './entity-index.js';
|
|
4
5
|
import { OptimisticOverlay } from './optimistic.js';
|
|
5
6
|
import { COLD_SNAPSHOT, QueryShape } from './shape.js';
|
|
@@ -13,7 +14,7 @@ export class GraphMemory {
|
|
|
13
14
|
constructor(options) {
|
|
14
15
|
this.options = options;
|
|
15
16
|
}
|
|
16
|
-
ensure(key, ast, page) {
|
|
17
|
+
ensure(key, ast, page, expected) {
|
|
17
18
|
const existing = this.shapes.get(key);
|
|
18
19
|
const now = this.options.now();
|
|
19
20
|
if (existing !== undefined) {
|
|
@@ -26,7 +27,7 @@ export class GraphMemory {
|
|
|
26
27
|
if (this.shapes.size >= this.options.maximumShapes) {
|
|
27
28
|
throw new ClientError('GraphStore shape capacity is exhausted by observed or in-flight queries.');
|
|
28
29
|
}
|
|
29
|
-
const shape = new QueryShape(key, ast, page, now);
|
|
30
|
+
const shape = new QueryShape(key, ast, page, expected, now);
|
|
30
31
|
shape.releasedAt = now;
|
|
31
32
|
this.shapes.set(key, shape);
|
|
32
33
|
return shape;
|
|
@@ -52,7 +53,7 @@ export class GraphMemory {
|
|
|
52
53
|
const prior = shape.response;
|
|
53
54
|
this.publish(shape, prior === undefined ? 'loading' : this.overlay.hasAny() ? 'optimistic' : 'refreshing');
|
|
54
55
|
const inflight = this.schedule(async () => {
|
|
55
|
-
const result = await this.options.graph.query(shape.ast, queryOptions(shape.page, this.options.lifecycle));
|
|
56
|
+
const result = await this.options.graph.query(shape.ast, queryOptions(shape.page, this.options.lifecycle, shape.expected));
|
|
56
57
|
this.options.requireOpen();
|
|
57
58
|
const integration = this.entities.integrate(result.result);
|
|
58
59
|
shape.references = integration.references;
|
|
@@ -182,10 +183,11 @@ export class GraphMemory {
|
|
|
182
183
|
this.pending.shift()?.reject(error);
|
|
183
184
|
}
|
|
184
185
|
materialize(template, references) {
|
|
185
|
-
|
|
186
|
+
const response = Object.freeze({
|
|
186
187
|
result: this.materializeResult(template.result, references),
|
|
187
188
|
page: template.page,
|
|
188
189
|
});
|
|
190
|
+
return retainDerivedQueryProvenance(template, response);
|
|
189
191
|
}
|
|
190
192
|
materializeResult(template, references) {
|
|
191
193
|
if (template.kind === 'nodes') {
|
|
@@ -196,8 +198,9 @@ export class GraphMemory {
|
|
|
196
198
|
continue;
|
|
197
199
|
}
|
|
198
200
|
const node = this.overlay.node(projection.value.id, this.entities);
|
|
199
|
-
if (node !== undefined)
|
|
200
|
-
nodes.push(Object.freeze({ kind: 'value', value: node }));
|
|
201
|
+
if (node !== undefined) {
|
|
202
|
+
nodes.push(Object.freeze({ kind: 'value', value: materializeNode(node) }));
|
|
203
|
+
}
|
|
201
204
|
}
|
|
202
205
|
return Object.freeze({
|
|
203
206
|
kind: 'nodes',
|
|
@@ -213,7 +216,7 @@ export class GraphMemory {
|
|
|
213
216
|
const value = this.entities.edge(edgeIdentity(item.edge.value));
|
|
214
217
|
return value === undefined
|
|
215
218
|
? undefined
|
|
216
|
-
: Object.freeze({ kind: 'value', value });
|
|
219
|
+
: Object.freeze({ kind: 'value', value: materializeEdge(value) });
|
|
217
220
|
})();
|
|
218
221
|
const source = item.source.kind === 'reference'
|
|
219
222
|
? item.source
|
|
@@ -221,7 +224,7 @@ export class GraphMemory {
|
|
|
221
224
|
const value = this.overlay.node(item.source.value.id, this.entities);
|
|
222
225
|
return value === undefined
|
|
223
226
|
? undefined
|
|
224
|
-
: Object.freeze({ kind: 'value', value });
|
|
227
|
+
: Object.freeze({ kind: 'value', value: materializeNode(value) });
|
|
225
228
|
})();
|
|
226
229
|
const target = item.target.kind === 'reference'
|
|
227
230
|
? item.target
|
|
@@ -229,7 +232,7 @@ export class GraphMemory {
|
|
|
229
232
|
const value = this.overlay.node(item.target.value.id, this.entities);
|
|
230
233
|
return value === undefined
|
|
231
234
|
? undefined
|
|
232
|
-
: Object.freeze({ kind: 'value', value });
|
|
235
|
+
: Object.freeze({ kind: 'value', value: materializeNode(value) });
|
|
233
236
|
})();
|
|
234
237
|
if (edge !== undefined && source !== undefined && target !== undefined) {
|
|
235
238
|
edges.push(Object.freeze({ edge, source, target }));
|
|
@@ -242,11 +245,13 @@ export class GraphMemory {
|
|
|
242
245
|
}
|
|
243
246
|
const nodes = references.nodes
|
|
244
247
|
.map((id) => this.overlay.node(id, this.entities))
|
|
245
|
-
.filter((node) => node !== undefined)
|
|
248
|
+
.filter((node) => node !== undefined)
|
|
249
|
+
.map(materializeNode);
|
|
246
250
|
const visibleNodeIds = new Set(nodes.map(({ id }) => id));
|
|
247
251
|
const edges = references.edges
|
|
248
252
|
.map((key) => this.entities.edge(key))
|
|
249
|
-
.filter((edge) => edge !== undefined && visibleNodeIds.has(edge.source) && visibleNodeIds.has(edge.target))
|
|
253
|
+
.filter((edge) => edge !== undefined && visibleNodeIds.has(edge.source) && visibleNodeIds.has(edge.target))
|
|
254
|
+
.map(materializeEdge);
|
|
250
255
|
const graph = Object.freeze({ nodes: Object.freeze(nodes), edges: Object.freeze(edges) });
|
|
251
256
|
const selection = materializeSelection(template.selection, visibleNodeIds, edges);
|
|
252
257
|
return selection.kind === 'node'
|
|
@@ -297,6 +302,12 @@ export class GraphMemory {
|
|
|
297
302
|
}
|
|
298
303
|
}
|
|
299
304
|
}
|
|
305
|
+
function materializeNode(value) {
|
|
306
|
+
return Object.freeze({ ...value });
|
|
307
|
+
}
|
|
308
|
+
function materializeEdge(value) {
|
|
309
|
+
return Object.freeze({ ...value });
|
|
310
|
+
}
|
|
300
311
|
function materializeSelection(selection, visibleNodes, visibleEdges) {
|
|
301
312
|
if (selection.kind === 'node') {
|
|
302
313
|
return Object.freeze({
|
|
@@ -310,10 +321,11 @@ function materializeSelection(selection, visibleNodes, visibleEdges) {
|
|
|
310
321
|
keys: Object.freeze(selection.keys.filter((key) => edges.has(encodeEdgeKey(key)))),
|
|
311
322
|
});
|
|
312
323
|
}
|
|
313
|
-
function queryOptions(page, lifecycle) {
|
|
324
|
+
function queryOptions(page, lifecycle, expected) {
|
|
314
325
|
return Object.freeze({
|
|
315
326
|
signal: lifecycle,
|
|
316
327
|
page,
|
|
328
|
+
...(expected === undefined ? {} : { expected }),
|
|
317
329
|
});
|
|
318
330
|
}
|
|
319
331
|
function observeRead(pending, options, lifecycle) {
|
|
@@ -394,4 +406,3 @@ function sameSnapshot(left, right) {
|
|
|
394
406
|
}
|
|
395
407
|
return left.state !== 'failed' || right.state !== 'failed' || left.error === right.error;
|
|
396
408
|
}
|
|
397
|
-
//# sourceMappingURL=memory.js.map
|
package/dist/store/mutation.d.ts
CHANGED
|
@@ -3,4 +3,3 @@ import type { GraphApi, MutationAuthor } from '../graph/index.js';
|
|
|
3
3
|
import type { GraphMemory } from './memory.js';
|
|
4
4
|
import type { StoreMutationOptions } from './store.js';
|
|
5
5
|
export declare function mutateStore(graph: GraphApi, memory: GraphMemory, input: MutationAuthor | MutationASTValue | MutationInput, options?: StoreMutationOptions): Promise<MutationResult>;
|
|
6
|
-
//# sourceMappingURL=mutation.d.ts.map
|
package/dist/store/mutation.js
CHANGED
package/dist/store/observe.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
import type { StoreQuery, StoreReadOptions, StoreSnapshot } from './store.js';
|
|
2
2
|
import type { GraphStore } from './store.js';
|
|
3
3
|
export declare function observeStore<Query extends StoreQuery>(store: GraphStore, query: Query, listener: (snapshot: StoreSnapshot<Query>) => void, options: StoreReadOptions): () => void;
|
|
4
|
-
//# sourceMappingURL=observe.d.ts.map
|
package/dist/store/observe.js
CHANGED
package/dist/store/optimistic.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { QueryAST as QueryASTValue } from '@astrale-os/kernel-core/graph/query';
|
|
2
|
+
import type { DomainDependency } from '@astrale-os/kernel-dsl/v1/schema';
|
|
2
3
|
import type { QueryPageRequest } from '../graph/index.js';
|
|
3
4
|
export declare function admitQuery(input: QueryASTValue): QueryASTValue;
|
|
4
5
|
export declare function admitPage(input: QueryPageRequest): QueryPageRequest;
|
|
5
|
-
export declare function queryKey(ast: QueryASTValue, page: QueryPageRequest): string;
|
|
6
|
-
//# sourceMappingURL=query-key.d.ts.map
|
|
6
|
+
export declare function queryKey(ast: QueryASTValue, page: QueryPageRequest, expected: readonly DomainDependency[] | undefined): string;
|
package/dist/store/query-key.js
CHANGED
|
@@ -17,7 +17,11 @@ export function admitPage(input) {
|
|
|
17
17
|
...(input.after === undefined ? {} : { after: input.after }),
|
|
18
18
|
});
|
|
19
19
|
}
|
|
20
|
-
export function queryKey(ast, page) {
|
|
21
|
-
return JSON.stringify([
|
|
20
|
+
export function queryKey(ast, page, expected) {
|
|
21
|
+
return JSON.stringify([
|
|
22
|
+
QueryAST.fingerprint(ast),
|
|
23
|
+
page.size,
|
|
24
|
+
page.after ?? null,
|
|
25
|
+
expected ?? null,
|
|
26
|
+
]);
|
|
22
27
|
}
|
|
23
|
-
//# sourceMappingURL=query-key.js.map
|
package/dist/store/shape.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { NodeId } from '@astrale-os/kernel-core/graph/node';
|
|
2
2
|
import type { QueryAST } from '@astrale-os/kernel-core/graph/query';
|
|
3
|
+
import type { DomainDependency } from '@astrale-os/kernel-dsl/v1/schema';
|
|
3
4
|
import type { QueryPageRequest } from '../graph/index.js';
|
|
4
5
|
import type { FactReferences } from './entity-index.js';
|
|
5
6
|
import type { StoreQueryResponse, StoreSnapshot } from './store.js';
|
|
@@ -8,6 +9,7 @@ export declare class QueryShape {
|
|
|
8
9
|
readonly key: string;
|
|
9
10
|
readonly ast: QueryAST;
|
|
10
11
|
readonly page: QueryPageRequest;
|
|
12
|
+
readonly expected: readonly DomainDependency[] | undefined;
|
|
11
13
|
readonly listeners: Set<() => void>;
|
|
12
14
|
state: ShapeState;
|
|
13
15
|
confirmed?: StoreQueryResponse;
|
|
@@ -18,9 +20,8 @@ export declare class QueryShape {
|
|
|
18
20
|
accessedAt: number;
|
|
19
21
|
refreshedAt?: number;
|
|
20
22
|
snapshot: StoreSnapshot;
|
|
21
|
-
constructor(key: string, ast: QueryAST, page: QueryPageRequest, now: number);
|
|
23
|
+
constructor(key: string, ast: QueryAST, page: QueryPageRequest, expected: readonly DomainDependency[] | undefined, now: number);
|
|
22
24
|
get observed(): boolean;
|
|
23
25
|
referencesAny(nodes: ReadonlySet<NodeId>, edges: ReadonlySet<string>): boolean;
|
|
24
26
|
}
|
|
25
27
|
export declare const COLD_SNAPSHOT: StoreSnapshot;
|
|
26
|
-
//# sourceMappingURL=shape.d.ts.map
|
package/dist/store/shape.js
CHANGED
|
@@ -2,6 +2,7 @@ export class QueryShape {
|
|
|
2
2
|
key;
|
|
3
3
|
ast;
|
|
4
4
|
page;
|
|
5
|
+
expected;
|
|
5
6
|
listeners = new Set();
|
|
6
7
|
state = 'cold';
|
|
7
8
|
confirmed;
|
|
@@ -12,10 +13,11 @@ export class QueryShape {
|
|
|
12
13
|
accessedAt;
|
|
13
14
|
refreshedAt;
|
|
14
15
|
snapshot = COLD_SNAPSHOT;
|
|
15
|
-
constructor(key, ast, page, now) {
|
|
16
|
+
constructor(key, ast, page, expected, now) {
|
|
16
17
|
this.key = key;
|
|
17
18
|
this.ast = ast;
|
|
18
19
|
this.page = page;
|
|
20
|
+
this.expected = expected;
|
|
19
21
|
this.accessedAt = now;
|
|
20
22
|
}
|
|
21
23
|
get observed() {
|
|
@@ -27,4 +29,3 @@ export class QueryShape {
|
|
|
27
29
|
}
|
|
28
30
|
}
|
|
29
31
|
export const COLD_SNAPSHOT = Object.freeze({ state: 'cold' });
|
|
30
|
-
//# sourceMappingURL=shape.js.map
|
package/dist/store/store.d.ts
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import type { MutationAST, MutationInput, MutationResult } from '@astrale-os/kernel-core/graph/mutate';
|
|
2
2
|
import type { QueryAST, QueryResultFor } from '@astrale-os/kernel-core/graph/query';
|
|
3
3
|
import type { QueryResponse } from '../graph/index.js';
|
|
4
|
-
import type { GraphApi, GraphQueryOptions, MutationAuthor } from '../graph/index.js';
|
|
5
|
-
import type { RequestOptions } from '../transport/index.js';
|
|
4
|
+
import type { GraphApi, GraphMutationOptions, GraphQueryOptions, MutationAuthor } from '../graph/index.js';
|
|
6
5
|
export type StoreQuery = QueryAST;
|
|
7
6
|
export type StoreQueryResponse<Query extends StoreQuery = StoreQuery> = QueryResponse<QueryResultFor<Query>>;
|
|
8
7
|
export interface StoreReadOptions extends GraphQueryOptions {
|
|
9
8
|
readonly freshness?: 'cached' | 'refresh';
|
|
10
9
|
}
|
|
11
|
-
export interface StoreMutationOptions extends
|
|
10
|
+
export interface StoreMutationOptions extends GraphMutationOptions {
|
|
12
11
|
readonly optimistic?: boolean;
|
|
13
12
|
}
|
|
14
13
|
export type StoreSnapshot<Query extends StoreQuery = StoreQuery> = {
|
|
@@ -66,4 +65,3 @@ export declare class GraphStore {
|
|
|
66
65
|
private identity;
|
|
67
66
|
private requireOpen;
|
|
68
67
|
}
|
|
69
|
-
//# sourceMappingURL=store.d.ts.map
|