@astrale-os/kernel-protocol 0.5.0-beta.8 → 1.0.0-beta.1
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/artifact/index.d.ts +1 -2
- package/dist/artifact/index.js +1 -2
- package/dist/artifact/ref.d.ts +2 -1
- package/dist/artifact/ref.js +4 -4
- package/dist/codecs/codec.d.ts +0 -1
- package/dist/codecs/codec.js +0 -1
- package/dist/codecs/index.d.ts +1 -3
- package/dist/codecs/index.js +1 -3
- package/dist/codecs/json.d.ts +0 -1
- package/dist/codecs/json.js +0 -1
- package/dist/codecs/media-types.d.ts +0 -2
- package/dist/codecs/media-types.js +0 -2
- package/dist/errors/codes.d.ts +0 -1
- package/dist/errors/codes.js +0 -1
- package/dist/errors/http-status.d.ts +0 -1
- package/dist/errors/http-status.js +0 -1
- package/dist/errors/index.d.ts +1 -1
- package/dist/errors/index.js +1 -1
- package/dist/errors/payload.d.ts +0 -1
- package/dist/errors/payload.js +0 -1
- package/dist/errors/protocol-error.d.ts +0 -1
- package/dist/errors/protocol-error.js +0 -1
- package/dist/errors/reason.d.ts +0 -1
- package/dist/errors/reason.js +0 -1
- package/dist/errors/retry.d.ts +23 -0
- package/dist/errors/retry.js +44 -0
- package/dist/index.d.ts +1 -2
- package/dist/index.js +1 -2
- package/dist/invocation/admission.d.ts +2 -3
- package/dist/invocation/admission.js +5 -6
- package/dist/invocation/binary.d.ts +1 -1
- package/dist/invocation/binary.js +21 -5
- package/dist/invocation/binding-codecs.d.ts +3 -3
- package/dist/invocation/binding-codecs.js +1 -7
- package/dist/invocation/cancellation.d.ts +0 -1
- package/dist/invocation/cancellation.js +0 -1
- package/dist/invocation/correlation.d.ts +0 -1
- package/dist/invocation/correlation.js +0 -1
- package/dist/invocation/delegate.d.ts +0 -21
- package/dist/invocation/delegate.js +2 -35
- package/dist/invocation/http/binary.d.ts +3 -2
- package/dist/invocation/http/binary.js +6 -2
- package/dist/invocation/http/index.d.ts +2 -2
- package/dist/invocation/http/index.js +2 -2
- package/dist/invocation/http/negotiation.d.ts +0 -1
- package/dist/invocation/http/negotiation.js +3 -11
- package/dist/invocation/http/request.d.ts +11 -0
- package/dist/invocation/http/request.js +69 -0
- package/dist/invocation/http/stream.d.ts +0 -1
- package/dist/invocation/http/stream.js +0 -1
- package/dist/invocation/http/trace.d.ts +0 -1
- package/dist/invocation/http/trace.js +0 -1
- package/dist/invocation/idempotency.d.ts +0 -1
- package/dist/invocation/idempotency.js +0 -1
- package/dist/invocation/identity.d.ts +0 -1
- package/dist/invocation/identity.js +0 -1
- package/dist/invocation/index.d.ts +3 -4
- package/dist/invocation/index.js +3 -4
- package/dist/invocation/miss.d.ts +0 -1
- package/dist/invocation/miss.js +0 -1
- package/dist/invocation/redirect.d.ts +10 -13
- package/dist/invocation/redirect.js +10 -23
- package/dist/invocation/request.d.ts +0 -1
- package/dist/invocation/request.js +2 -3
- package/dist/invocation/response.d.ts +0 -1
- package/dist/invocation/response.js +0 -1
- package/dist/invocation/routing.d.ts +14 -5
- package/dist/invocation/routing.js +35 -21
- package/dist/invocation/schema.d.ts +6 -5
- package/dist/invocation/schema.js +5 -12
- package/dist/invocation/service-reason.d.ts +20 -16
- package/dist/invocation/service-reason.js +27 -20
- package/dist/invocation/stale-route.d.ts +3 -4
- package/dist/invocation/stale-route.js +0 -1
- package/dist/invocation/stream.d.ts +0 -1
- package/dist/invocation/stream.js +0 -1
- package/dist/invocation/target.d.ts +5 -3
- package/dist/invocation/target.js +25 -4
- package/dist/invocation/trace.d.ts +0 -1
- package/dist/invocation/trace.js +0 -1
- package/dist/invocation/version.d.ts +0 -1
- package/dist/invocation/version.js +0 -1
- package/dist/invocation/websocket/binary.d.ts +0 -1
- package/dist/invocation/websocket/binary.js +1 -1
- package/dist/invocation/websocket/index.d.ts +1 -2
- package/dist/invocation/websocket/index.js +1 -2
- package/dist/invocation/websocket/subprotocol.d.ts +1 -3
- package/dist/invocation/websocket/subprotocol.js +3 -5
- package/dist/issuer/claims.d.ts +7 -0
- package/dist/issuer/claims.js +7 -0
- package/dist/issuer/configuration.d.ts +0 -1
- package/dist/issuer/configuration.js +0 -1
- package/dist/issuer/error.d.ts +0 -1
- package/dist/issuer/error.js +0 -1
- package/dist/issuer/exchange.d.ts +0 -1
- package/dist/issuer/exchange.js +0 -1
- package/dist/issuer/hosted.d.ts +0 -1
- package/dist/issuer/hosted.js +0 -1
- package/dist/issuer/index.d.ts +2 -1
- package/dist/issuer/index.js +2 -1
- package/dist/issuer/key-set.d.ts +0 -1
- package/dist/issuer/key-set.js +0 -1
- package/dist/issuer/paths.d.ts +2 -1
- package/dist/issuer/paths.js +1 -1
- package/dist/issuer/url.d.ts +0 -1
- package/dist/issuer/url.js +0 -1
- package/dist/issuer/workflow-engine.d.ts +18 -0
- package/dist/issuer/workflow-engine.js +59 -0
- package/dist/{publication → release}/bindings/callable.d.ts +0 -1
- package/dist/{publication → release}/bindings/callable.js +6 -7
- package/dist/{publication → release}/bindings/index.d.ts +0 -1
- package/dist/{publication → release}/bindings/index.js +0 -1
- package/dist/{publication → release}/bindings/invocation.d.ts +0 -1
- package/dist/release/bindings/invocation.js +13 -0
- package/dist/release/bindings/view.d.ts +11 -0
- package/dist/release/bindings/view.js +54 -0
- package/dist/release/build.d.ts +6 -0
- package/dist/release/build.js +7 -0
- package/dist/release/bundle-admission.d.ts +21 -0
- package/dist/{publication → release}/bundle-admission.js +15 -21
- package/dist/{publication → release}/bundle-descriptor.d.ts +0 -1
- package/dist/release/bundle-descriptor.js +19 -0
- package/dist/release/bundle-evidence.d.ts +3 -0
- package/dist/release/bundle-evidence.js +13 -0
- package/dist/{publication → release}/bundle.d.ts +5 -3
- package/dist/{publication → release}/bundle.js +13 -8
- package/dist/{publication → release}/declaration.d.ts +0 -1
- package/dist/release/declaration.js +1 -0
- package/dist/{publication → release}/delivery/attestation.d.ts +1 -1
- package/dist/{publication → release}/delivery/attestation.js +0 -1
- package/dist/{publication → release}/delivery/claims.d.ts +7 -3
- package/dist/{publication → release}/delivery/claims.js +20 -14
- package/dist/release/delivery/delivery.d.ts +11 -0
- package/dist/{publication → release}/delivery/delivery.js +7 -13
- package/dist/{publication → release}/delivery/error.d.ts +2 -1
- package/dist/{publication → release}/delivery/error.js +1 -1
- package/dist/{publication → release}/delivery/index.d.ts +5 -2
- package/dist/{publication → release}/delivery/index.js +4 -1
- package/dist/{publication → release}/delivery/limits.d.ts +2 -2
- package/dist/release/delivery/limits.js +5 -0
- package/dist/{publication → release}/delivery/request.d.ts +10 -10
- package/dist/{publication → release}/delivery/request.js +9 -11
- package/dist/{publication → release}/delivery-declaration.d.ts +0 -1
- package/dist/{publication → release}/delivery-declaration.js +4 -5
- package/dist/{publication → release}/delivery-endpoint.d.ts +0 -1
- package/dist/release/delivery-endpoint.js +22 -0
- package/dist/release/digest.d.ts +13 -0
- package/dist/{publication/etag.js → release/digest.js} +1 -7
- package/dist/release/error.d.ts +7 -0
- package/dist/release/error.js +11 -0
- package/dist/release/index.d.ts +17 -0
- package/dist/release/index.js +10 -0
- package/dist/release/issuer.d.ts +5 -0
- package/dist/release/issuer.js +34 -0
- package/dist/release/manifest.d.ts +6 -0
- package/dist/release/manifest.js +22 -0
- package/dist/release/reference.d.ts +26 -0
- package/dist/release/reference.js +70 -0
- package/dist/release/release.d.ts +60 -0
- package/dist/release/release.js +125 -0
- package/dist/release/requirements.d.ts +41 -0
- package/dist/release/requirements.js +306 -0
- package/dist/{publication → release}/route.d.ts +0 -1
- package/dist/{publication → release}/route.js +24 -25
- package/dist/{publication → release}/schema.d.ts +0 -1
- package/dist/{publication → release}/schema.js +4 -5
- package/dist/release/served.d.ts +27 -0
- package/dist/release/served.js +56 -0
- package/dist/release/shape.d.ts +8 -0
- package/dist/{publication/content.js → release/shape.js} +0 -1
- package/dist/routes/admission.d.ts +1 -2
- package/dist/routes/admission.js +7 -86
- package/dist/routes/binding.d.ts +3 -4
- package/dist/routes/binding.js +11 -22
- package/dist/routes/collision.d.ts +0 -1
- package/dist/routes/collision.js +0 -1
- package/dist/routes/compiler.d.ts +2 -3
- package/dist/routes/compiler.js +7 -4
- package/dist/routes/credential.d.ts +12 -3
- package/dist/routes/credential.js +9 -5
- package/dist/routes/decode.d.ts +5 -3
- package/dist/routes/decode.js +24 -18
- package/dist/routes/deployment-retired.d.ts +30 -0
- package/dist/routes/deployment-retired.js +96 -0
- package/dist/routes/encode.d.ts +0 -1
- package/dist/routes/encode.js +12 -6
- package/dist/routes/entries.d.ts +23 -0
- package/dist/routes/entries.js +150 -0
- package/dist/routes/error-response.d.ts +0 -1
- package/dist/routes/error-response.js +0 -1
- package/dist/routes/error.d.ts +0 -1
- package/dist/routes/error.js +0 -1
- package/dist/routes/evidence.d.ts +3 -4
- package/dist/routes/evidence.js +7 -34
- package/dist/routes/header.d.ts +9 -0
- package/dist/routes/header.js +34 -0
- package/dist/routes/index.d.ts +2 -3
- package/dist/routes/index.js +2 -3
- package/dist/routes/mapping.d.ts +1 -2
- package/dist/routes/mapping.js +4 -5
- package/dist/routes/match.d.ts +1 -2
- package/dist/routes/match.js +0 -1
- package/dist/routes/placement.d.ts +2 -3
- package/dist/routes/placement.js +0 -1
- package/dist/routes/plan.d.ts +1 -2
- package/dist/routes/plan.js +0 -1
- package/dist/routes/request.d.ts +3 -2
- package/dist/routes/request.js +0 -1
- package/dist/routes/reservation.d.ts +4 -3
- package/dist/routes/reservation.js +14 -9
- package/dist/routes/routing.d.ts +18 -7
- package/dist/routes/routing.js +28 -50
- package/dist/routes/scalar.d.ts +0 -1
- package/dist/routes/scalar.js +0 -1
- package/dist/routes/select.d.ts +1 -2
- package/dist/routes/select.js +0 -1
- package/dist/routes/stream.d.ts +0 -1
- package/dist/routes/stream.js +0 -1
- package/dist/routes/table.d.ts +3 -3
- package/dist/routes/table.js +0 -1
- package/dist/routes/target.d.ts +5 -1
- package/dist/routes/target.js +16 -1
- package/dist/routes/template.d.ts +0 -2
- package/dist/routes/template.js +0 -4
- package/dist/runtime/artifact.d.ts +5 -5
- package/dist/runtime/artifact.js +7 -5
- package/dist/runtime/index.d.ts +1 -2
- package/dist/runtime/index.js +1 -2
- package/dist/schema/index.d.ts +0 -1
- package/dist/schema/index.js +0 -1
- package/dist/schema/installation/codec.d.ts +4 -0
- package/dist/schema/installation/codec.js +70 -0
- package/dist/schema/installation/index.d.ts +2 -1
- package/dist/schema/installation/index.js +1 -1
- package/dist/schema/installation/introspection/codec.d.ts +5 -3
- package/dist/schema/installation/introspection/codec.js +307 -196
- package/dist/schema/installation/introspection/index.d.ts +2 -3
- package/dist/schema/installation/introspection/index.js +1 -2
- package/dist/schema/installation/introspection/result.d.ts +72 -26
- package/dist/schema/installation/introspection/result.js +0 -1
- package/dist/schema/installation/result.d.ts +9 -0
- package/dist/schema/installation/result.js +1 -0
- package/package.json +23 -78
- package/dist/artifact/index.d.ts.map +0 -1
- package/dist/artifact/index.js.map +0 -1
- package/dist/artifact/ref.d.ts.map +0 -1
- package/dist/artifact/ref.js.map +0 -1
- package/dist/codecs/codec.d.ts.map +0 -1
- package/dist/codecs/codec.js.map +0 -1
- package/dist/codecs/index.d.ts.map +0 -1
- package/dist/codecs/index.js.map +0 -1
- package/dist/codecs/json.d.ts.map +0 -1
- package/dist/codecs/json.js.map +0 -1
- package/dist/codecs/media-types.d.ts.map +0 -1
- package/dist/codecs/media-types.js.map +0 -1
- package/dist/codecs/msgpack.d.ts +0 -5
- package/dist/codecs/msgpack.d.ts.map +0 -1
- package/dist/codecs/msgpack.js +0 -51
- package/dist/codecs/msgpack.js.map +0 -1
- package/dist/errors/codes.d.ts.map +0 -1
- package/dist/errors/codes.js.map +0 -1
- package/dist/errors/http-status.d.ts.map +0 -1
- package/dist/errors/http-status.js.map +0 -1
- package/dist/errors/index.d.ts.map +0 -1
- package/dist/errors/index.js.map +0 -1
- package/dist/errors/payload.d.ts.map +0 -1
- package/dist/errors/payload.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/reason.d.ts.map +0 -1
- package/dist/errors/reason.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/invocation/admission.d.ts.map +0 -1
- package/dist/invocation/admission.js.map +0 -1
- package/dist/invocation/binary.d.ts.map +0 -1
- package/dist/invocation/binary.js.map +0 -1
- package/dist/invocation/binding-codecs.d.ts.map +0 -1
- package/dist/invocation/binding-codecs.js.map +0 -1
- package/dist/invocation/cancellation.d.ts.map +0 -1
- package/dist/invocation/cancellation.js.map +0 -1
- package/dist/invocation/correlation.d.ts.map +0 -1
- package/dist/invocation/correlation.js.map +0 -1
- package/dist/invocation/delegate.d.ts.map +0 -1
- package/dist/invocation/delegate.js.map +0 -1
- package/dist/invocation/http/binary.d.ts.map +0 -1
- package/dist/invocation/http/binary.js.map +0 -1
- package/dist/invocation/http/index.d.ts.map +0 -1
- package/dist/invocation/http/index.js.map +0 -1
- package/dist/invocation/http/negotiation.d.ts.map +0 -1
- package/dist/invocation/http/negotiation.js.map +0 -1
- package/dist/invocation/http/stream.d.ts.map +0 -1
- package/dist/invocation/http/stream.js.map +0 -1
- package/dist/invocation/http/trace.d.ts.map +0 -1
- package/dist/invocation/http/trace.js.map +0 -1
- package/dist/invocation/idempotency.d.ts.map +0 -1
- package/dist/invocation/idempotency.js.map +0 -1
- package/dist/invocation/identity.d.ts.map +0 -1
- package/dist/invocation/identity.js.map +0 -1
- package/dist/invocation/index.d.ts.map +0 -1
- package/dist/invocation/index.js.map +0 -1
- package/dist/invocation/miss.d.ts.map +0 -1
- package/dist/invocation/miss.js.map +0 -1
- package/dist/invocation/redirect.d.ts.map +0 -1
- package/dist/invocation/redirect.js.map +0 -1
- package/dist/invocation/request.d.ts.map +0 -1
- package/dist/invocation/request.js.map +0 -1
- package/dist/invocation/response.d.ts.map +0 -1
- package/dist/invocation/response.js.map +0 -1
- package/dist/invocation/routing.d.ts.map +0 -1
- package/dist/invocation/routing.js.map +0 -1
- package/dist/invocation/schema.d.ts.map +0 -1
- package/dist/invocation/schema.js.map +0 -1
- package/dist/invocation/service-reason.d.ts.map +0 -1
- package/dist/invocation/service-reason.js.map +0 -1
- package/dist/invocation/stale-route.d.ts.map +0 -1
- package/dist/invocation/stale-route.js.map +0 -1
- package/dist/invocation/stream.d.ts.map +0 -1
- package/dist/invocation/stream.js.map +0 -1
- package/dist/invocation/target.d.ts.map +0 -1
- package/dist/invocation/target.js.map +0 -1
- package/dist/invocation/trace.d.ts.map +0 -1
- package/dist/invocation/trace.js.map +0 -1
- package/dist/invocation/version.d.ts.map +0 -1
- package/dist/invocation/version.js.map +0 -1
- package/dist/invocation/websocket/binary.d.ts.map +0 -1
- package/dist/invocation/websocket/binary.js.map +0 -1
- package/dist/invocation/websocket/index.d.ts.map +0 -1
- package/dist/invocation/websocket/index.js.map +0 -1
- package/dist/invocation/websocket/subprotocol.d.ts.map +0 -1
- package/dist/invocation/websocket/subprotocol.js.map +0 -1
- package/dist/issuer/configuration.d.ts.map +0 -1
- package/dist/issuer/configuration.js.map +0 -1
- package/dist/issuer/error.d.ts.map +0 -1
- package/dist/issuer/error.js.map +0 -1
- package/dist/issuer/exchange.d.ts.map +0 -1
- package/dist/issuer/exchange.js.map +0 -1
- package/dist/issuer/hosted.d.ts.map +0 -1
- package/dist/issuer/hosted.js.map +0 -1
- package/dist/issuer/index.d.ts.map +0 -1
- package/dist/issuer/index.js.map +0 -1
- package/dist/issuer/key-set.d.ts.map +0 -1
- package/dist/issuer/key-set.js.map +0 -1
- package/dist/issuer/paths.d.ts.map +0 -1
- package/dist/issuer/paths.js.map +0 -1
- package/dist/issuer/url.d.ts.map +0 -1
- package/dist/issuer/url.js.map +0 -1
- package/dist/publication/bindings/callable.d.ts.map +0 -1
- package/dist/publication/bindings/callable.js.map +0 -1
- package/dist/publication/bindings/index.d.ts.map +0 -1
- package/dist/publication/bindings/index.js.map +0 -1
- package/dist/publication/bindings/invocation.d.ts.map +0 -1
- package/dist/publication/bindings/invocation.js +0 -14
- package/dist/publication/bindings/invocation.js.map +0 -1
- package/dist/publication/bindings/view.d.ts +0 -8
- package/dist/publication/bindings/view.d.ts.map +0 -1
- package/dist/publication/bindings/view.js +0 -29
- package/dist/publication/bindings/view.js.map +0 -1
- package/dist/publication/bundle-admission.d.ts +0 -5
- package/dist/publication/bundle-admission.d.ts.map +0 -1
- package/dist/publication/bundle-admission.js.map +0 -1
- package/dist/publication/bundle-descriptor.d.ts.map +0 -1
- package/dist/publication/bundle-descriptor.js +0 -20
- package/dist/publication/bundle-descriptor.js.map +0 -1
- package/dist/publication/bundle-evidence.d.ts +0 -4
- package/dist/publication/bundle-evidence.d.ts.map +0 -1
- package/dist/publication/bundle-evidence.js +0 -14
- package/dist/publication/bundle-evidence.js.map +0 -1
- package/dist/publication/bundle.d.ts.map +0 -1
- package/dist/publication/bundle.js.map +0 -1
- package/dist/publication/content.d.ts +0 -11
- package/dist/publication/content.d.ts.map +0 -1
- package/dist/publication/content.js.map +0 -1
- package/dist/publication/declaration.d.ts.map +0 -1
- package/dist/publication/declaration.js +0 -2
- package/dist/publication/declaration.js.map +0 -1
- package/dist/publication/delivery/attestation.d.ts.map +0 -1
- package/dist/publication/delivery/attestation.js.map +0 -1
- package/dist/publication/delivery/claims.d.ts.map +0 -1
- package/dist/publication/delivery/claims.js.map +0 -1
- package/dist/publication/delivery/delivery.d.ts +0 -10
- package/dist/publication/delivery/delivery.d.ts.map +0 -1
- package/dist/publication/delivery/delivery.js.map +0 -1
- package/dist/publication/delivery/error.d.ts.map +0 -1
- package/dist/publication/delivery/error.js.map +0 -1
- package/dist/publication/delivery/index.d.ts.map +0 -1
- package/dist/publication/delivery/index.js.map +0 -1
- package/dist/publication/delivery/limits.d.ts.map +0 -1
- package/dist/publication/delivery/limits.js +0 -5
- package/dist/publication/delivery/limits.js.map +0 -1
- package/dist/publication/delivery/request.d.ts.map +0 -1
- package/dist/publication/delivery/request.js.map +0 -1
- package/dist/publication/delivery-declaration.d.ts.map +0 -1
- package/dist/publication/delivery-declaration.js.map +0 -1
- package/dist/publication/delivery-endpoint.d.ts.map +0 -1
- package/dist/publication/delivery-endpoint.js +0 -23
- package/dist/publication/delivery-endpoint.js.map +0 -1
- package/dist/publication/error.d.ts +0 -8
- package/dist/publication/error.d.ts.map +0 -1
- package/dist/publication/error.js +0 -12
- package/dist/publication/error.js.map +0 -1
- package/dist/publication/etag.d.ts +0 -7
- package/dist/publication/etag.d.ts.map +0 -1
- package/dist/publication/etag.js.map +0 -1
- package/dist/publication/index.d.ts +0 -18
- package/dist/publication/index.d.ts.map +0 -1
- package/dist/publication/index.js +0 -11
- package/dist/publication/index.js.map +0 -1
- package/dist/publication/manifest.d.ts +0 -7
- package/dist/publication/manifest.d.ts.map +0 -1
- package/dist/publication/manifest.js +0 -31
- package/dist/publication/manifest.js.map +0 -1
- package/dist/publication/publication.d.ts +0 -37
- package/dist/publication/publication.d.ts.map +0 -1
- package/dist/publication/publication.js +0 -134
- package/dist/publication/publication.js.map +0 -1
- package/dist/publication/reference.d.ts +0 -18
- package/dist/publication/reference.d.ts.map +0 -1
- package/dist/publication/reference.js +0 -69
- package/dist/publication/reference.js.map +0 -1
- package/dist/publication/requirements.d.ts +0 -27
- package/dist/publication/requirements.d.ts.map +0 -1
- package/dist/publication/requirements.js +0 -181
- package/dist/publication/requirements.js.map +0 -1
- package/dist/publication/route.d.ts.map +0 -1
- package/dist/publication/route.js.map +0 -1
- package/dist/publication/schema.d.ts.map +0 -1
- package/dist/publication/schema.js.map +0 -1
- package/dist/routes/admission.d.ts.map +0 -1
- package/dist/routes/admission.js.map +0 -1
- package/dist/routes/binding.d.ts.map +0 -1
- package/dist/routes/binding.js.map +0 -1
- package/dist/routes/collision.d.ts.map +0 -1
- package/dist/routes/collision.js.map +0 -1
- package/dist/routes/compiler.d.ts.map +0 -1
- package/dist/routes/compiler.js.map +0 -1
- package/dist/routes/credential.d.ts.map +0 -1
- package/dist/routes/credential.js.map +0 -1
- package/dist/routes/decode.d.ts.map +0 -1
- package/dist/routes/decode.js.map +0 -1
- package/dist/routes/encode.d.ts.map +0 -1
- package/dist/routes/encode.js.map +0 -1
- package/dist/routes/error-response.d.ts.map +0 -1
- package/dist/routes/error-response.js.map +0 -1
- package/dist/routes/error.d.ts.map +0 -1
- package/dist/routes/error.js.map +0 -1
- package/dist/routes/evidence.d.ts.map +0 -1
- package/dist/routes/evidence.js.map +0 -1
- package/dist/routes/index.d.ts.map +0 -1
- package/dist/routes/index.js.map +0 -1
- package/dist/routes/mapping.d.ts.map +0 -1
- package/dist/routes/mapping.js.map +0 -1
- package/dist/routes/match.d.ts.map +0 -1
- package/dist/routes/match.js.map +0 -1
- package/dist/routes/placement.d.ts.map +0 -1
- package/dist/routes/placement.js.map +0 -1
- package/dist/routes/plan.d.ts.map +0 -1
- package/dist/routes/plan.js.map +0 -1
- package/dist/routes/release-unavailable.d.ts +0 -9
- package/dist/routes/release-unavailable.d.ts.map +0 -1
- package/dist/routes/release-unavailable.js +0 -33
- package/dist/routes/release-unavailable.js.map +0 -1
- package/dist/routes/request.d.ts.map +0 -1
- package/dist/routes/request.js.map +0 -1
- package/dist/routes/reservation.d.ts.map +0 -1
- package/dist/routes/reservation.js.map +0 -1
- package/dist/routes/routing.d.ts.map +0 -1
- package/dist/routes/routing.js.map +0 -1
- package/dist/routes/scalar.d.ts.map +0 -1
- package/dist/routes/scalar.js.map +0 -1
- package/dist/routes/select.d.ts.map +0 -1
- package/dist/routes/select.js.map +0 -1
- package/dist/routes/stream.d.ts.map +0 -1
- package/dist/routes/stream.js.map +0 -1
- package/dist/routes/table.d.ts.map +0 -1
- package/dist/routes/table.js.map +0 -1
- package/dist/routes/target.d.ts.map +0 -1
- package/dist/routes/target.js.map +0 -1
- package/dist/routes/template.d.ts.map +0 -1
- package/dist/routes/template.js.map +0 -1
- package/dist/runtime/artifact.d.ts.map +0 -1
- package/dist/runtime/artifact.js.map +0 -1
- package/dist/runtime/index.d.ts.map +0 -1
- package/dist/runtime/index.js.map +0 -1
- package/dist/schema/index.d.ts.map +0 -1
- package/dist/schema/index.js.map +0 -1
- package/dist/schema/installation/index.d.ts.map +0 -1
- package/dist/schema/installation/index.js.map +0 -1
- package/dist/schema/installation/introspection/codec.d.ts.map +0 -1
- package/dist/schema/installation/introspection/codec.js.map +0 -1
- package/dist/schema/installation/introspection/index.d.ts.map +0 -1
- package/dist/schema/installation/introspection/index.js.map +0 -1
- package/dist/schema/installation/introspection/result.d.ts.map +0 -1
- package/dist/schema/installation/introspection/result.js.map +0 -1
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type Request } from '../request.js';
|
|
2
|
+
export declare const REQUEST_ENVELOPE_FIELD: 'x-astrale-request';
|
|
3
|
+
export declare const BINARY_LENGTH_FIELD: 'x-astrale-binary-length';
|
|
4
|
+
export declare const BINARY_REQUEST_CONTENT_TYPE: 'application/octet-stream';
|
|
5
|
+
export declare const MAXIMUM_REQUEST_ENVELOPE_BYTES = 8192;
|
|
6
|
+
/** Decode one declared byte count: a canonical unsigned decimal within the safe integer range. */
|
|
7
|
+
export declare function decodeBinaryLength(input: string): number | undefined;
|
|
8
|
+
/** Encode one canonical V2 Request into the binary-request HTTP field. */
|
|
9
|
+
export declare function encodeBinaryRequestEnvelope(input: Request): string;
|
|
10
|
+
/** Decode one bounded base64url JSON V2 Request from the binary-request HTTP field. */
|
|
11
|
+
export declare function decodeBinaryRequestEnvelope(input: string | null): Request;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { json } from '../../codecs/index.js';
|
|
2
|
+
import { CODES, ProtocolError } from '../../errors/index.js';
|
|
3
|
+
import { decodeRequest } from '../request.js';
|
|
4
|
+
export const REQUEST_ENVELOPE_FIELD = 'x-astrale-request';
|
|
5
|
+
export const BINARY_LENGTH_FIELD = 'x-astrale-binary-length';
|
|
6
|
+
export const BINARY_REQUEST_CONTENT_TYPE = 'application/octet-stream';
|
|
7
|
+
export const MAXIMUM_REQUEST_ENVELOPE_BYTES = 8_192;
|
|
8
|
+
const BASE64URL = /^[A-Za-z0-9_-]+$/u;
|
|
9
|
+
const MAXIMUM_ENCODED_BYTES = Math.ceil(MAXIMUM_REQUEST_ENVELOPE_BYTES / 3) * 4;
|
|
10
|
+
const DECIMAL = /^(?:0|[1-9][0-9]*)$/u;
|
|
11
|
+
/** Decode one declared byte count: a canonical unsigned decimal within the safe integer range. */
|
|
12
|
+
export function decodeBinaryLength(input) {
|
|
13
|
+
if (!DECIMAL.test(input))
|
|
14
|
+
return undefined;
|
|
15
|
+
const length = Number(input);
|
|
16
|
+
return Number.isSafeInteger(length) ? length : undefined;
|
|
17
|
+
}
|
|
18
|
+
/** Encode one canonical V2 Request into the binary-request HTTP field. */
|
|
19
|
+
export function encodeBinaryRequestEnvelope(input) {
|
|
20
|
+
const request = decodeRequest(input);
|
|
21
|
+
const encoded = json.encode(request);
|
|
22
|
+
if (typeof encoded !== 'string')
|
|
23
|
+
throw new TypeError('JSON Request codec returned non-text output.');
|
|
24
|
+
const bytes = new TextEncoder().encode(encoded);
|
|
25
|
+
if (bytes.byteLength > MAXIMUM_REQUEST_ENVELOPE_BYTES)
|
|
26
|
+
return invalid();
|
|
27
|
+
return btoa(String.fromCharCode(...bytes))
|
|
28
|
+
.replaceAll('+', '-')
|
|
29
|
+
.replaceAll('/', '_')
|
|
30
|
+
.replace(/=+$/u, '');
|
|
31
|
+
}
|
|
32
|
+
/** Decode one bounded base64url JSON V2 Request from the binary-request HTTP field. */
|
|
33
|
+
export function decodeBinaryRequestEnvelope(input) {
|
|
34
|
+
if (input === null ||
|
|
35
|
+
input.length === 0 ||
|
|
36
|
+
input.length > MAXIMUM_ENCODED_BYTES ||
|
|
37
|
+
!BASE64URL.test(input)) {
|
|
38
|
+
return invalid();
|
|
39
|
+
}
|
|
40
|
+
let bytes;
|
|
41
|
+
try {
|
|
42
|
+
const binary = atob(input.replaceAll('-', '+').replaceAll('_', '/') + '='.repeat((4 - (input.length % 4)) % 4));
|
|
43
|
+
bytes = Uint8Array.from(binary, (character) => character.charCodeAt(0));
|
|
44
|
+
}
|
|
45
|
+
catch {
|
|
46
|
+
return invalid();
|
|
47
|
+
}
|
|
48
|
+
if (bytes.byteLength > MAXIMUM_REQUEST_ENVELOPE_BYTES)
|
|
49
|
+
return invalid();
|
|
50
|
+
try {
|
|
51
|
+
// Require canonical base64url so alternate encodings cannot name the same envelope.
|
|
52
|
+
const canonical = btoa(String.fromCharCode(...bytes))
|
|
53
|
+
.replaceAll('+', '-')
|
|
54
|
+
.replaceAll('/', '_')
|
|
55
|
+
.replace(/=+$/u, '');
|
|
56
|
+
if (canonical !== input)
|
|
57
|
+
return invalid();
|
|
58
|
+
return decodeRequest(json.decode(bytes));
|
|
59
|
+
}
|
|
60
|
+
catch {
|
|
61
|
+
return invalid();
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
function invalid() {
|
|
65
|
+
throw new ProtocolError({
|
|
66
|
+
code: CODES.INVALID_REQUEST,
|
|
67
|
+
message: 'HTTP binary Request envelope is invalid.',
|
|
68
|
+
});
|
|
69
|
+
}
|
|
@@ -3,4 +3,3 @@ import type { StreamFrame } from '../stream.js';
|
|
|
3
3
|
export declare const STREAM_FRAMING_FIELD: 'x-astrale-stream-framing';
|
|
4
4
|
export declare const LENGTH_PREFIX_V1: 'length-prefix-v1';
|
|
5
5
|
export declare function encodeStreamFrame(codec: Codec, frame: StreamFrame): Uint8Array;
|
|
6
|
-
//# sourceMappingURL=stream.d.ts.map
|
|
@@ -4,4 +4,3 @@ export declare const TRACESTATE_FIELD = "tracestate";
|
|
|
4
4
|
export declare const BAGGAGE_FIELD = "baggage";
|
|
5
5
|
export declare function decodeTraceHeaders(traceparent: string | null, tracestate: string | null): Trace | undefined;
|
|
6
6
|
export declare function encodeTraceHeaders(carrier: Trace | undefined): Readonly<Record<string, string>>;
|
|
7
|
-
//# sourceMappingURL=trace.d.ts.map
|
|
@@ -8,4 +8,3 @@ export declare const MAXIMUM_IDEMPOTENCY_KEY_LENGTH = 128;
|
|
|
8
8
|
/** Admit an opaque URL-safe ASCII key without assigning it semantic structure. */
|
|
9
9
|
export declare function acceptIdempotencyKey(input: unknown, label?: string): IdempotencyKey;
|
|
10
10
|
export {};
|
|
11
|
-
//# sourceMappingURL=idempotency.d.ts.map
|
|
@@ -14,4 +14,3 @@ export declare class InvocationError extends TypeError {
|
|
|
14
14
|
export declare function acceptInvocationId(input: unknown): InvocationId;
|
|
15
15
|
/** Compare both canonical coordinate fields exactly. */
|
|
16
16
|
export declare function sameInvocationId(left: InvocationId, right: InvocationId): boolean;
|
|
17
|
-
//# sourceMappingURL=identity.d.ts.map
|
|
@@ -9,13 +9,12 @@ export { decodeMiss, miss, type Miss } from './miss.js';
|
|
|
9
9
|
export { acceptRoute, acceptRedirection, decodeRedirectResponse, remoteRoute, type RemoteBindingInput, type Redirection, type RedirectResponse, type Route, } from './redirect.js';
|
|
10
10
|
export { decodeRequest, type Request } from './request.js';
|
|
11
11
|
export { admitTrace, MAXIMUM_TRACEPARENT_BYTES, MAXIMUM_TRACESTATE_BYTES, MAXIMUM_TRACESTATE_MEMBERS, type Trace, } from './trace.js';
|
|
12
|
-
export { acceptRouting, type Refresh, type Routing, type Via } from './routing.js';
|
|
12
|
+
export { acceptRouting, routedDigest, routedRevision, type Refresh, type Routing, type Via, } from './routing.js';
|
|
13
13
|
export { acceptSchemaTarget, type SchemaTarget } from './schema.js';
|
|
14
14
|
export { decodeResponse, type ErrorResponse, type Response, type ResponseContext, type SuccessResponse, } from './response.js';
|
|
15
|
-
export {
|
|
15
|
+
export { CALLABLE_FINGERPRINT_MISMATCH, DEPLOYMENT_RETIRED, SERVICE_CANDIDATE_INVALID, SERVICE_TRUST_REQUIRED, SERVICE_UNAVAILABLE, serviceErrorOf, type CallableFingerprintMismatchDetails, type CallableFingerprintMismatchReason, type DeploymentRetiredDetails, type DeploymentRetiredReason, type ServiceCandidateInvalidDetails, type ServiceCandidateInvalidReason, type ServiceErrorPayload, type ServiceReason, type ServiceTrustRequiredDetails, type ServiceTrustRequiredReason, type ServiceUnavailableDetails, type ServiceUnavailableReason, } from './service-reason.js';
|
|
16
16
|
export { decodeStale, stale, type Stale } from './stale-route.js';
|
|
17
17
|
export { decodeStreamFrame, type StreamEndFrame, type StreamErrorFrame, type StreamFrame, type StreamItemFrame, type StreamStartFrame, } from './stream.js';
|
|
18
|
-
export { acceptCall, type Call } from './target.js';
|
|
18
|
+
export { Target, targetPath, acceptCall, type Call } from './target.js';
|
|
19
19
|
export { VERSION, type Version } from './version.js';
|
|
20
20
|
export * as websocket from './websocket/index.js';
|
|
21
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/invocation/index.js
CHANGED
|
@@ -9,13 +9,12 @@ export { decodeMiss, miss } from './miss.js';
|
|
|
9
9
|
export { acceptRoute, acceptRedirection, decodeRedirectResponse, remoteRoute, } from './redirect.js';
|
|
10
10
|
export { decodeRequest } from './request.js';
|
|
11
11
|
export { admitTrace, MAXIMUM_TRACEPARENT_BYTES, MAXIMUM_TRACESTATE_BYTES, MAXIMUM_TRACESTATE_MEMBERS, } from './trace.js';
|
|
12
|
-
export { acceptRouting } from './routing.js';
|
|
12
|
+
export { acceptRouting, routedDigest, routedRevision, } from './routing.js';
|
|
13
13
|
export { acceptSchemaTarget } from './schema.js';
|
|
14
14
|
export { decodeResponse, } from './response.js';
|
|
15
|
-
export {
|
|
15
|
+
export { CALLABLE_FINGERPRINT_MISMATCH, DEPLOYMENT_RETIRED, SERVICE_CANDIDATE_INVALID, SERVICE_TRUST_REQUIRED, SERVICE_UNAVAILABLE, serviceErrorOf, } from './service-reason.js';
|
|
16
16
|
export { decodeStale, stale } from './stale-route.js';
|
|
17
17
|
export { decodeStreamFrame, } from './stream.js';
|
|
18
|
-
export { acceptCall } from './target.js';
|
|
18
|
+
export { Target, targetPath, acceptCall } from './target.js';
|
|
19
19
|
export { VERSION } from './version.js';
|
|
20
20
|
export * as websocket from './websocket/index.js';
|
|
21
|
-
//# sourceMappingURL=index.js.map
|
package/dist/invocation/miss.js
CHANGED
|
@@ -1,18 +1,15 @@
|
|
|
1
1
|
import type { IssuerId } from '@astrale-os/kernel-core/auth/issuer';
|
|
2
|
-
import type { Key } from '@astrale-os/kernel-dsl/v1';
|
|
3
|
-
import type { InvocationEndpoints } from '../
|
|
4
|
-
import type {
|
|
5
|
-
import type { PublicationRef } from '../publication/reference.js';
|
|
2
|
+
import type { Key, Revision } from '@astrale-os/kernel-dsl/v1';
|
|
3
|
+
import type { InvocationEndpoints } from '../release/bindings/invocation.js';
|
|
4
|
+
import type { ReleaseDigest } from '../release/digest.js';
|
|
6
5
|
import type { RequestId } from './correlation.js';
|
|
7
6
|
import type { InvocationId } from './identity.js';
|
|
7
|
+
import type { Via } from './routing.js';
|
|
8
8
|
import type { Trace } from './trace.js';
|
|
9
9
|
export interface Route {
|
|
10
10
|
readonly endpoint: InvocationEndpoints;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
readonly publication: PublicationRef;
|
|
14
|
-
readonly issuer: IssuerId;
|
|
15
|
-
};
|
|
11
|
+
/** Routed witness of the exact installed release. */
|
|
12
|
+
readonly via: Via;
|
|
16
13
|
}
|
|
17
14
|
export interface Redirection {
|
|
18
15
|
readonly route: Route;
|
|
@@ -26,16 +23,16 @@ export interface RedirectResponse {
|
|
|
26
23
|
readonly invocation: InvocationId;
|
|
27
24
|
readonly redirect: Redirection;
|
|
28
25
|
}
|
|
26
|
+
/** Remote binding of one installed release: the endpoint and the release it routes to. */
|
|
29
27
|
export interface RemoteBindingInput {
|
|
30
28
|
readonly endpoint: InvocationEndpoints;
|
|
31
29
|
readonly issuer: IssuerId;
|
|
32
30
|
readonly subject: string;
|
|
33
|
-
readonly revision:
|
|
34
|
-
readonly
|
|
31
|
+
readonly revision: Revision;
|
|
32
|
+
readonly release: ReleaseDigest;
|
|
35
33
|
}
|
|
36
34
|
export declare function acceptRoute(input: unknown): Route;
|
|
37
|
-
/** Project one
|
|
35
|
+
/** Project one installed release binding into its routed witness. */
|
|
38
36
|
export declare function remoteRoute(origin: Key.Origin, binding: RemoteBindingInput, issuer: IssuerId): Route;
|
|
39
37
|
export declare function acceptRedirection(input: unknown): Redirection;
|
|
40
38
|
export declare function decodeRedirectResponse(input: unknown): RedirectResponse;
|
|
41
|
-
//# sourceMappingURL=redirect.d.ts.map
|
|
@@ -1,49 +1,37 @@
|
|
|
1
|
-
import { acceptInvocationEndpoints } from '../
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { acceptInvocationEndpoints } from '../release/bindings/index.js';
|
|
2
|
+
import { ReleaseError } from '../release/error.js';
|
|
3
|
+
import { exactFields, invalid, invocation, portableObject, requestId, required, string, } from './admission.js';
|
|
4
|
+
import { acceptVia } from './routing.js';
|
|
5
5
|
import { admitTrace } from './trace.js';
|
|
6
6
|
const ROUTE_FIELDS = new Set(['endpoint', 'via']);
|
|
7
|
-
const VIA_FIELDS = new Set(['kind', 'publication', 'issuer']);
|
|
8
7
|
const REDIRECTION_FIELDS = new Set(['route', 'credential', 'trace']);
|
|
9
8
|
const REDIRECT_RESPONSE_FIELDS = new Set(['kind', 'requestId', 'invocation', 'redirect']);
|
|
10
9
|
export function acceptRoute(input) {
|
|
11
10
|
const object = portableObject(input, 'route');
|
|
12
11
|
exactFields(object, ROUTE_FIELDS, 'route');
|
|
13
12
|
required(object, ['endpoint', 'via'], 'route');
|
|
13
|
+
const via = acceptVia(portableObject(object.via, 'route.via'), 'route.via');
|
|
14
14
|
try {
|
|
15
|
-
|
|
16
|
-
exactFields(via, VIA_FIELDS, 'route.via');
|
|
17
|
-
required(via, ['kind', 'publication', 'issuer'], 'route.via');
|
|
18
|
-
if (via.kind !== 'via')
|
|
19
|
-
invalid('route.via.kind must be "via"');
|
|
20
|
-
return Object.freeze({
|
|
21
|
-
endpoint: acceptInvocationEndpoints(object.endpoint),
|
|
22
|
-
via: Object.freeze({
|
|
23
|
-
kind: 'via',
|
|
24
|
-
publication: acceptReference(via.publication),
|
|
25
|
-
issuer: issuerId(via.issuer, 'route.via.issuer'),
|
|
26
|
-
}),
|
|
27
|
-
});
|
|
15
|
+
return Object.freeze({ endpoint: acceptInvocationEndpoints(object.endpoint), via });
|
|
28
16
|
}
|
|
29
17
|
catch (cause) {
|
|
30
|
-
if (cause instanceof
|
|
18
|
+
if (cause instanceof ReleaseError) {
|
|
31
19
|
return invalid(`route is invalid: ${cause.message}`);
|
|
32
20
|
}
|
|
33
21
|
throw cause;
|
|
34
22
|
}
|
|
35
23
|
}
|
|
36
|
-
/** Project one
|
|
24
|
+
/** Project one installed release binding into its routed witness. */
|
|
37
25
|
export function remoteRoute(origin, binding, issuer) {
|
|
38
26
|
return acceptRoute({
|
|
39
27
|
endpoint: binding.endpoint,
|
|
40
28
|
via: {
|
|
41
29
|
kind: 'via',
|
|
42
|
-
|
|
30
|
+
release: {
|
|
43
31
|
origin,
|
|
44
32
|
identity: { issuer: binding.issuer, subject: binding.subject },
|
|
45
33
|
revision: binding.revision,
|
|
46
|
-
|
|
34
|
+
digest: binding.release,
|
|
47
35
|
},
|
|
48
36
|
issuer,
|
|
49
37
|
},
|
|
@@ -79,4 +67,3 @@ export function decodeRedirectResponse(input) {
|
|
|
79
67
|
redirect: acceptRedirection(object.redirect),
|
|
80
68
|
});
|
|
81
69
|
}
|
|
82
|
-
//# sourceMappingURL=redirect.js.map
|
|
@@ -3,7 +3,7 @@ import { acceptDelegate } from './delegate.js';
|
|
|
3
3
|
import { acceptIdempotencyKey } from './idempotency.js';
|
|
4
4
|
import { acceptRouting } from './routing.js';
|
|
5
5
|
import { acceptSchemaTarget } from './schema.js';
|
|
6
|
-
import {
|
|
6
|
+
import { callFromSnapshot } from './target.js';
|
|
7
7
|
import { admitTrace } from './trace.js';
|
|
8
8
|
const REQUEST_FIELDS = new Set([
|
|
9
9
|
'version',
|
|
@@ -39,7 +39,7 @@ export function decodeRequest(input) {
|
|
|
39
39
|
return Object.freeze({
|
|
40
40
|
version: 2,
|
|
41
41
|
requestId: requestId(object.requestId, 'request.requestId'),
|
|
42
|
-
call:
|
|
42
|
+
call: callFromSnapshot(object.call),
|
|
43
43
|
...(credential === undefined ? {} : { credential }),
|
|
44
44
|
...(delegate === undefined ? {} : { delegate }),
|
|
45
45
|
...(routing === undefined ? {} : { routing }),
|
|
@@ -52,4 +52,3 @@ export function decodeRequest(input) {
|
|
|
52
52
|
...(trace === undefined ? {} : { trace }),
|
|
53
53
|
});
|
|
54
54
|
}
|
|
55
|
-
//# sourceMappingURL=request.js.map
|
|
@@ -17,4 +17,3 @@ export interface ErrorResponse extends ResponseContext {
|
|
|
17
17
|
}
|
|
18
18
|
export type Response<Result extends Value = Value> = SuccessResponse<Result> | ErrorResponse | RedirectResponse | Stale | Miss;
|
|
19
19
|
export declare function decodeResponse(input: unknown): Response;
|
|
20
|
-
//# sourceMappingURL=response.d.ts.map
|
|
@@ -1,15 +1,24 @@
|
|
|
1
1
|
import type { IssuerId } from '@astrale-os/kernel-core/auth/issuer';
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
2
|
+
import type { Revision } from '@astrale-os/kernel-dsl/v1/addressing';
|
|
3
|
+
import type { Object as ValueObject } from '@astrale-os/kernel-dsl/value';
|
|
4
|
+
import type { Sha256Digest } from '../release/digest.js';
|
|
5
|
+
import type { ReleaseRef } from '../release/reference.js';
|
|
6
|
+
/** Routed witness of one installed release: the Kernel routed this call to that exact release. */
|
|
4
7
|
export interface Via {
|
|
5
8
|
readonly kind: 'via';
|
|
6
|
-
readonly
|
|
9
|
+
readonly release: ReleaseRef;
|
|
7
10
|
readonly issuer: IssuerId;
|
|
8
11
|
}
|
|
9
12
|
export interface Refresh {
|
|
10
13
|
readonly kind: 'refresh';
|
|
11
|
-
readonly stale:
|
|
14
|
+
readonly stale: Sha256Digest;
|
|
12
15
|
}
|
|
16
|
+
/** A received `Via` names one exact `ReleaseRef`. */
|
|
13
17
|
export type Routing = Via | Refresh;
|
|
14
18
|
export declare function acceptRouting(input: unknown): Routing;
|
|
15
|
-
|
|
19
|
+
/** Admit one routed witness carrying one exact `release`. */
|
|
20
|
+
export declare function acceptVia(object: ValueObject, label: string): Via;
|
|
21
|
+
/** Schema revision of the release the witness routed the call to. */
|
|
22
|
+
export declare function routedRevision(via: Via): Revision;
|
|
23
|
+
/** Digest of the release the witness routed this call to. */
|
|
24
|
+
export declare function routedDigest(via: Via): Sha256Digest;
|
|
@@ -1,27 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { acceptReference } from '../
|
|
1
|
+
import { ReleaseError } from '../release/error.js';
|
|
2
|
+
import { acceptReference } from '../release/reference.js';
|
|
3
3
|
import { digest, exactFields, invalid, issuerId, portableObject, required } from './admission.js';
|
|
4
|
-
const VIA_FIELDS = new Set(['kind', '
|
|
4
|
+
const VIA_FIELDS = new Set(['kind', 'release', 'issuer']);
|
|
5
5
|
const REFRESH_FIELDS = new Set(['kind', 'stale']);
|
|
6
6
|
export function acceptRouting(input) {
|
|
7
7
|
const object = portableObject(input, 'routing');
|
|
8
|
-
if (object.kind === 'via')
|
|
9
|
-
|
|
10
|
-
required(object, ['kind', 'publication', 'issuer'], 'via routing');
|
|
11
|
-
try {
|
|
12
|
-
return Object.freeze({
|
|
13
|
-
kind: 'via',
|
|
14
|
-
publication: acceptReference(object.publication),
|
|
15
|
-
issuer: issuerId(object.issuer, 'via routing.issuer'),
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
catch (cause) {
|
|
19
|
-
if (cause instanceof PublicationError) {
|
|
20
|
-
return invalid(`via routing.publication is invalid: ${cause.message}`);
|
|
21
|
-
}
|
|
22
|
-
throw cause;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
8
|
+
if (object.kind === 'via')
|
|
9
|
+
return acceptVia(object, 'via routing');
|
|
25
10
|
if (object.kind === 'refresh') {
|
|
26
11
|
exactFields(object, REFRESH_FIELDS, 'refresh routing');
|
|
27
12
|
required(object, ['kind', 'stale'], 'refresh routing');
|
|
@@ -32,4 +17,33 @@ export function acceptRouting(input) {
|
|
|
32
17
|
}
|
|
33
18
|
return invalid('routing.kind must be "via" or "refresh"');
|
|
34
19
|
}
|
|
35
|
-
|
|
20
|
+
/** Admit one routed witness carrying one exact `release`. */
|
|
21
|
+
export function acceptVia(object, label) {
|
|
22
|
+
exactFields(object, VIA_FIELDS, label);
|
|
23
|
+
if (object.kind !== 'via')
|
|
24
|
+
invalid(`${label}.kind must be "via"`);
|
|
25
|
+
required(object, ['release', 'issuer'], label);
|
|
26
|
+
return Object.freeze({
|
|
27
|
+
kind: 'via',
|
|
28
|
+
release: acceptReleaseReference(object.release, `${label}.release`),
|
|
29
|
+
issuer: issuerId(object.issuer, `${label}.issuer`),
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
/** Schema revision of the release the witness routed the call to. */
|
|
33
|
+
export function routedRevision(via) {
|
|
34
|
+
return via.release.revision;
|
|
35
|
+
}
|
|
36
|
+
/** Digest of the release the witness routed this call to. */
|
|
37
|
+
export function routedDigest(via) {
|
|
38
|
+
return via.release.digest;
|
|
39
|
+
}
|
|
40
|
+
function acceptReleaseReference(input, label) {
|
|
41
|
+
try {
|
|
42
|
+
return acceptReference(input);
|
|
43
|
+
}
|
|
44
|
+
catch (cause) {
|
|
45
|
+
if (cause instanceof ReleaseError)
|
|
46
|
+
return invalid(`${label} is invalid: ${cause.message}`);
|
|
47
|
+
throw cause;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import type { Sha256Digest } from '../release/digest.js';
|
|
2
|
+
/**
|
|
3
|
+
* Source-Kernel precondition for one invocation: the exact installed artifact target, or the
|
|
4
|
+
* fingerprint of the callable meaning the static consumer compiled against.
|
|
5
|
+
*/
|
|
4
6
|
export type SchemaTarget = {
|
|
5
7
|
readonly target: Sha256Digest;
|
|
6
8
|
} | {
|
|
7
|
-
readonly
|
|
9
|
+
readonly fingerprint: Sha256Digest;
|
|
8
10
|
};
|
|
9
11
|
export declare function acceptSchemaTarget(input: unknown): SchemaTarget;
|
|
10
|
-
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -1,20 +1,13 @@
|
|
|
1
|
-
import { patterns } from '@astrale-os/kernel-dsl/v1/addressing';
|
|
2
1
|
import { digest, exactFields, invalid, portableObject } from './admission.js';
|
|
3
|
-
const FIELDS = new Set(['target', '
|
|
2
|
+
const FIELDS = new Set(['target', 'fingerprint']);
|
|
4
3
|
export function acceptSchemaTarget(input) {
|
|
5
4
|
const object = portableObject(input, 'schema target');
|
|
6
5
|
exactFields(object, FIELDS, 'schema target');
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
if (hasTarget === hasRevision) {
|
|
10
|
-
invalid('schema target must contain exactly one of target or revision');
|
|
6
|
+
if ([...FIELDS].filter((field) => Object.hasOwn(object, field)).length !== 1) {
|
|
7
|
+
invalid('schema target must contain exactly one of target or fingerprint');
|
|
11
8
|
}
|
|
12
|
-
if (
|
|
9
|
+
if (Object.hasOwn(object, 'target')) {
|
|
13
10
|
return Object.freeze({ target: digest(object.target, 'schema target.target') });
|
|
14
11
|
}
|
|
15
|
-
|
|
16
|
-
invalid('schema target.revision must be a Schema revision');
|
|
17
|
-
}
|
|
18
|
-
return Object.freeze({ revision: object.revision });
|
|
12
|
+
return Object.freeze({ fingerprint: digest(object.fingerprint, 'schema target.fingerprint') });
|
|
19
13
|
}
|
|
20
|
-
//# sourceMappingURL=schema.js.map
|
|
@@ -1,23 +1,21 @@
|
|
|
1
1
|
import type { IssuerId } from '@astrale-os/kernel-core/auth/issuer';
|
|
2
2
|
import type { Revision } from '@astrale-os/kernel-dsl/v1/addressing';
|
|
3
3
|
import type { Object as ValueObject } from '@astrale-os/kernel-dsl/value';
|
|
4
|
-
import {
|
|
4
|
+
import { Key } from '@astrale-os/kernel-dsl/v1/addressing';
|
|
5
5
|
import type { ErrorPayload, ErrorReason } from '../errors/index.js';
|
|
6
|
+
import type { ReleaseDigest, Sha256Digest } from '../release/digest.js';
|
|
6
7
|
import { CODES } from '../errors/index.js';
|
|
7
|
-
export declare const
|
|
8
|
-
export declare const SCHEMA_REVISION_MISMATCH: 'SCHEMA_REVISION_MISMATCH';
|
|
8
|
+
export declare const CALLABLE_FINGERPRINT_MISMATCH: 'CALLABLE_FINGERPRINT_MISMATCH';
|
|
9
9
|
export declare const SERVICE_TRUST_REQUIRED: 'SERVICE_TRUST_REQUIRED';
|
|
10
10
|
export declare const SERVICE_UNAVAILABLE: 'SERVICE_UNAVAILABLE';
|
|
11
11
|
export declare const SERVICE_CANDIDATE_INVALID: 'SERVICE_CANDIDATE_INVALID';
|
|
12
|
-
|
|
12
|
+
/** A deployment answers that it no longer serves: it runs no other code in its place. */
|
|
13
|
+
export declare const DEPLOYMENT_RETIRED: 'DEPLOYMENT_RETIRED';
|
|
14
|
+
export type CallableFingerprintMismatchDetails = ValueObject & {
|
|
13
15
|
readonly origin: Key.Origin;
|
|
14
|
-
readonly
|
|
15
|
-
readonly
|
|
16
|
-
|
|
17
|
-
export type SchemaRevisionMismatchDetails = ValueObject & {
|
|
18
|
-
readonly origin: Key.Origin;
|
|
19
|
-
readonly expectedRevision: Revision;
|
|
20
|
-
readonly installedRevision: Revision;
|
|
16
|
+
readonly callable: Key.Callable;
|
|
17
|
+
readonly expectedFingerprint: Sha256Digest;
|
|
18
|
+
readonly installedFingerprint: Sha256Digest;
|
|
21
19
|
};
|
|
22
20
|
export type ServiceTrustRequiredDetails = ValueObject & {
|
|
23
21
|
readonly origin: Key.Origin;
|
|
@@ -31,19 +29,25 @@ export type ServiceUnavailableDetails = ValueObject & {
|
|
|
31
29
|
export type ServiceCandidateInvalidDetails = ValueObject & {
|
|
32
30
|
readonly origin: Key.Origin;
|
|
33
31
|
};
|
|
34
|
-
export type
|
|
35
|
-
|
|
32
|
+
export type DeploymentRetiredDetails = ValueObject & {
|
|
33
|
+
readonly deployment: IssuerId;
|
|
34
|
+
readonly release?: ReleaseDigest;
|
|
35
|
+
};
|
|
36
|
+
export type CallableFingerprintMismatchReason = ErrorReason<typeof CALLABLE_FINGERPRINT_MISMATCH, CallableFingerprintMismatchDetails>;
|
|
36
37
|
export type ServiceTrustRequiredReason = ErrorReason<typeof SERVICE_TRUST_REQUIRED, ServiceTrustRequiredDetails>;
|
|
37
38
|
export type ServiceUnavailableReason = ErrorReason<typeof SERVICE_UNAVAILABLE, ServiceUnavailableDetails>;
|
|
38
39
|
export type ServiceCandidateInvalidReason = ErrorReason<typeof SERVICE_CANDIDATE_INVALID, ServiceCandidateInvalidDetails>;
|
|
39
|
-
export type
|
|
40
|
+
export type DeploymentRetiredReason = ErrorReason<typeof DEPLOYMENT_RETIRED, DeploymentRetiredDetails>;
|
|
41
|
+
export type ServiceReason = CallableFingerprintMismatchReason | ServiceTrustRequiredReason | ServiceUnavailableReason | ServiceCandidateInvalidReason | DeploymentRetiredReason;
|
|
40
42
|
export type ServiceErrorPayload = (Omit<ErrorPayload, 'code' | 'data'> & {
|
|
41
43
|
readonly code: typeof CODES.CONFLICT;
|
|
42
|
-
readonly data:
|
|
44
|
+
readonly data: CallableFingerprintMismatchReason | ServiceTrustRequiredReason;
|
|
43
45
|
}) | (Omit<ErrorPayload, 'code' | 'data'> & {
|
|
44
46
|
readonly code: typeof CODES.BACKEND_UNAVAILABLE;
|
|
45
47
|
readonly data: ServiceUnavailableReason | ServiceCandidateInvalidReason;
|
|
48
|
+
}) | (Omit<ErrorPayload, 'code' | 'data'> & {
|
|
49
|
+
readonly code: typeof CODES.NOT_FOUND;
|
|
50
|
+
readonly data: DeploymentRetiredReason;
|
|
46
51
|
});
|
|
47
52
|
/** Recognize only exact outer-code, reason-code, and detail-shape combinations. */
|
|
48
53
|
export declare function serviceErrorOf(input: ErrorPayload): ServiceErrorPayload | undefined;
|
|
49
|
-
//# sourceMappingURL=service-reason.d.ts.map
|