@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
package/dist/artifact/index.d.ts
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export { accept, identify, type Digest, type Ref } from './ref.js';
|
|
2
|
-
//# sourceMappingURL=index.d.ts.map
|
|
1
|
+
export { accept, canonicalMediaType, identify, type Digest, type Ref } from './ref.js';
|
package/dist/artifact/index.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export { accept, identify } from './ref.js';
|
|
2
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
export { accept, canonicalMediaType, identify } from './ref.js';
|
package/dist/artifact/ref.d.ts
CHANGED
|
@@ -8,4 +8,5 @@ export interface Ref {
|
|
|
8
8
|
export declare function accept(input: unknown): Ref;
|
|
9
9
|
/** Identify exact bytes under one canonical media type. */
|
|
10
10
|
export declare function identify(bytes: Uint8Array, mediaType: string): Ref;
|
|
11
|
-
|
|
11
|
+
/** Canonicalize one portable artifact media type, retaining token parameters and their values. */
|
|
12
|
+
export declare function canonicalMediaType(input: string): string;
|
package/dist/artifact/ref.js
CHANGED
|
@@ -18,7 +18,7 @@ export function accept(input) {
|
|
|
18
18
|
}
|
|
19
19
|
return Object.freeze({
|
|
20
20
|
digest: value.digest,
|
|
21
|
-
mediaType:
|
|
21
|
+
mediaType: canonicalMediaType(value.mediaType),
|
|
22
22
|
size: value.size,
|
|
23
23
|
});
|
|
24
24
|
}
|
|
@@ -31,11 +31,12 @@ export function identify(bytes, mediaType) {
|
|
|
31
31
|
hexadecimal += byte.toString(16).padStart(2, '0');
|
|
32
32
|
return Object.freeze({
|
|
33
33
|
digest: `sha256:${hexadecimal}`,
|
|
34
|
-
mediaType:
|
|
34
|
+
mediaType: canonicalMediaType(mediaType),
|
|
35
35
|
size: bytes.byteLength,
|
|
36
36
|
});
|
|
37
37
|
}
|
|
38
|
-
|
|
38
|
+
/** Canonicalize one portable artifact media type, retaining token parameters and their values. */
|
|
39
|
+
export function canonicalMediaType(input) {
|
|
39
40
|
const [essence, ...parametersInput] = input.split(';');
|
|
40
41
|
const [rawType, rawSubtype, ...extra] = essence.trim().split('/');
|
|
41
42
|
if (rawType === undefined ||
|
|
@@ -68,4 +69,3 @@ function compare(left, right) {
|
|
|
68
69
|
function invalid(subject) {
|
|
69
70
|
throw new TypeError(`Artifact Ref has invalid ${subject}.`);
|
|
70
71
|
}
|
|
71
|
-
//# sourceMappingURL=ref.js.map
|
package/dist/codecs/codec.d.ts
CHANGED
package/dist/codecs/codec.js
CHANGED
package/dist/codecs/index.d.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
1
|
export { DecodeError, type Codec, type EncodedEnvelope } from './codec.js';
|
|
2
2
|
export { json } from './json.js';
|
|
3
|
-
export { CONTENT_TYPE_JSON
|
|
4
|
-
export { loadMsgpack } from './msgpack.js';
|
|
5
|
-
//# sourceMappingURL=index.d.ts.map
|
|
3
|
+
export { CONTENT_TYPE_JSON } from './media-types.js';
|
package/dist/codecs/index.js
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
1
|
export { DecodeError } from './codec.js';
|
|
2
2
|
export { json } from './json.js';
|
|
3
|
-
export { CONTENT_TYPE_JSON
|
|
4
|
-
export { loadMsgpack } from './msgpack.js';
|
|
5
|
-
//# sourceMappingURL=index.js.map
|
|
3
|
+
export { CONTENT_TYPE_JSON } from './media-types.js';
|
package/dist/codecs/json.d.ts
CHANGED
package/dist/codecs/json.js
CHANGED
package/dist/errors/codes.d.ts
CHANGED
package/dist/errors/codes.js
CHANGED
package/dist/errors/index.d.ts
CHANGED
|
@@ -3,4 +3,4 @@ export { httpStatusOf } from './http-status.js';
|
|
|
3
3
|
export { acceptPayload, type ErrorPayload } from './payload.js';
|
|
4
4
|
export { ProtocolError } from './protocol-error.js';
|
|
5
5
|
export { acceptReason, reasonOf, type ErrorReason } from './reason.js';
|
|
6
|
-
|
|
6
|
+
export { MAXIMUM_RETRY_AFTER_MS, RETRY_REASONS, retryAfterField, retryAfterOf, retryReason, type RetryReason, type RetryReasonCode, } from './retry.js';
|
package/dist/errors/index.js
CHANGED
|
@@ -3,4 +3,4 @@ export { httpStatusOf } from './http-status.js';
|
|
|
3
3
|
export { acceptPayload } from './payload.js';
|
|
4
4
|
export { ProtocolError } from './protocol-error.js';
|
|
5
5
|
export { acceptReason, reasonOf } from './reason.js';
|
|
6
|
-
|
|
6
|
+
export { MAXIMUM_RETRY_AFTER_MS, RETRY_REASONS, retryAfterField, retryAfterOf, retryReason, } from './retry.js';
|
package/dist/errors/payload.d.ts
CHANGED
package/dist/errors/payload.js
CHANGED
package/dist/errors/reason.d.ts
CHANGED
|
@@ -5,4 +5,3 @@ export type ErrorReason<Code extends string = string, Details extends ValueObjec
|
|
|
5
5
|
};
|
|
6
6
|
export declare function acceptReason(input: unknown, label?: string): ErrorReason;
|
|
7
7
|
export declare function reasonOf(input: unknown): ErrorReason | undefined;
|
|
8
|
-
//# sourceMappingURL=reason.d.ts.map
|
package/dist/errors/reason.js
CHANGED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { ErrorPayload } from './payload.js';
|
|
2
|
+
import type { ErrorReason } from './reason.js';
|
|
3
|
+
/**
|
|
4
|
+
* Reasons for a request refused before any work was admitted. The same request may be sent again
|
|
5
|
+
* once `retryAfterMs` has elapsed; every other public error keeps its own retry meaning.
|
|
6
|
+
*/
|
|
7
|
+
export declare const RETRY_REASONS: Readonly<{
|
|
8
|
+
/** A bounded Kernel resource is exhausted. */
|
|
9
|
+
readonly CAPACITY_EXHAUSTED: 'CAPACITY_EXHAUSTED';
|
|
10
|
+
/** The server stopped admitting work before it shuts down. */
|
|
11
|
+
readonly SERVER_DRAINING: 'SERVER_DRAINING';
|
|
12
|
+
}>;
|
|
13
|
+
export type RetryReasonCode = (typeof RETRY_REASONS)[keyof typeof RETRY_REASONS];
|
|
14
|
+
export type RetryReason<Code extends RetryReasonCode = RetryReasonCode> = ErrorReason<Code, {
|
|
15
|
+
readonly retryAfterMs: number;
|
|
16
|
+
}>;
|
|
17
|
+
/** One hour bounds a hint that only schedules the next attempt. */
|
|
18
|
+
export declare const MAXIMUM_RETRY_AFTER_MS = 3600000;
|
|
19
|
+
export declare function retryReason<Code extends RetryReasonCode>(code: Code, retryAfterMs: number): RetryReason<Code>;
|
|
20
|
+
/** Return the retry delay of a back-pressure or draining refusal, and nothing for other errors. */
|
|
21
|
+
export declare function retryAfterOf(error: ErrorPayload): number | undefined;
|
|
22
|
+
/** Present a retry delay as an HTTP `Retry-After` delta in whole seconds, rounded up. */
|
|
23
|
+
export declare function retryAfterField(retryAfterMs: number): string;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { CODES } from './codes.js';
|
|
2
|
+
import { reasonOf } from './reason.js';
|
|
3
|
+
/**
|
|
4
|
+
* Reasons for a request refused before any work was admitted. The same request may be sent again
|
|
5
|
+
* once `retryAfterMs` has elapsed; every other public error keeps its own retry meaning.
|
|
6
|
+
*/
|
|
7
|
+
export const RETRY_REASONS = Object.freeze({
|
|
8
|
+
/** A bounded Kernel resource is exhausted. */
|
|
9
|
+
CAPACITY_EXHAUSTED: 'CAPACITY_EXHAUSTED',
|
|
10
|
+
/** The server stopped admitting work before it shuts down. */
|
|
11
|
+
SERVER_DRAINING: 'SERVER_DRAINING',
|
|
12
|
+
});
|
|
13
|
+
/** One hour bounds a hint that only schedules the next attempt. */
|
|
14
|
+
export const MAXIMUM_RETRY_AFTER_MS = 3_600_000;
|
|
15
|
+
const CODES_SET = new Set(Object.values(RETRY_REASONS));
|
|
16
|
+
export function retryReason(code, retryAfterMs) {
|
|
17
|
+
if (!CODES_SET.has(code))
|
|
18
|
+
throw new TypeError('Retry reason code is invalid.');
|
|
19
|
+
if (!isRetryAfter(retryAfterMs))
|
|
20
|
+
throw new TypeError('Retry reason retryAfterMs is invalid.');
|
|
21
|
+
return Object.freeze({ code, details: Object.freeze({ retryAfterMs }) });
|
|
22
|
+
}
|
|
23
|
+
/** Return the retry delay of a back-pressure or draining refusal, and nothing for other errors. */
|
|
24
|
+
export function retryAfterOf(error) {
|
|
25
|
+
if (error.code !== CODES.BACKEND_UNAVAILABLE)
|
|
26
|
+
return undefined;
|
|
27
|
+
const reason = reasonOf(error.data);
|
|
28
|
+
if (reason === undefined || !CODES_SET.has(reason.code))
|
|
29
|
+
return undefined;
|
|
30
|
+
const retryAfterMs = reason.details.retryAfterMs;
|
|
31
|
+
return isRetryAfter(retryAfterMs) ? retryAfterMs : undefined;
|
|
32
|
+
}
|
|
33
|
+
/** Present a retry delay as an HTTP `Retry-After` delta in whole seconds, rounded up. */
|
|
34
|
+
export function retryAfterField(retryAfterMs) {
|
|
35
|
+
if (!isRetryAfter(retryAfterMs))
|
|
36
|
+
throw new TypeError('Retry-After delay is invalid.');
|
|
37
|
+
return String(Math.ceil(retryAfterMs / 1_000));
|
|
38
|
+
}
|
|
39
|
+
function isRetryAfter(input) {
|
|
40
|
+
return (typeof input === 'number' &&
|
|
41
|
+
Number.isSafeInteger(input) &&
|
|
42
|
+
input >= 0 &&
|
|
43
|
+
input <= MAXIMUM_RETRY_AFTER_MS);
|
|
44
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -2,8 +2,7 @@ export * as artifact from './artifact/index.js';
|
|
|
2
2
|
export * as invocation from './invocation/index.js';
|
|
3
3
|
export * as codecs from './codecs/index.js';
|
|
4
4
|
export * as errors from './errors/index.js';
|
|
5
|
-
export * as
|
|
5
|
+
export * as release from './release/index.js';
|
|
6
6
|
export * as schema from './schema/index.js';
|
|
7
7
|
export * as routes from './routes/index.js';
|
|
8
8
|
export * as issuer from './issuer/index.js';
|
|
9
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -2,8 +2,7 @@ export * as artifact from './artifact/index.js';
|
|
|
2
2
|
export * as invocation from './invocation/index.js';
|
|
3
3
|
export * as codecs from './codecs/index.js';
|
|
4
4
|
export * as errors from './errors/index.js';
|
|
5
|
-
export * as
|
|
5
|
+
export * as release from './release/index.js';
|
|
6
6
|
export * as schema from './schema/index.js';
|
|
7
7
|
export * as routes from './routes/index.js';
|
|
8
8
|
export * as issuer from './issuer/index.js';
|
|
9
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -3,7 +3,7 @@ import { NodePath } from '@astrale-os/kernel-core/path';
|
|
|
3
3
|
import { Key } from '@astrale-os/kernel-dsl/v1/addressing';
|
|
4
4
|
import { type Object as ValueObject } from '@astrale-os/kernel-dsl/value';
|
|
5
5
|
import type { ErrorPayload } from '../errors/index.js';
|
|
6
|
-
import type {
|
|
6
|
+
import type { Sha256Digest } from '../release/digest.js';
|
|
7
7
|
import { type RequestId } from './correlation.js';
|
|
8
8
|
import { type InvocationId } from './identity.js';
|
|
9
9
|
export declare function portableObject(input: unknown, label: string): ValueObject;
|
|
@@ -16,9 +16,8 @@ export declare function nodePath(input: unknown, label: string): NodePath;
|
|
|
16
16
|
export declare function issuerId(input: unknown, label: string): IssuerId;
|
|
17
17
|
export declare function string(input: unknown, label: string): string;
|
|
18
18
|
export declare function count(input: unknown, label: string): number;
|
|
19
|
-
export declare function digest(input: unknown, label: string):
|
|
19
|
+
export declare function digest(input: unknown, label: string): Sha256Digest;
|
|
20
20
|
export declare function callableKey(input: unknown, label: string): Key.Callable;
|
|
21
21
|
export declare function errorPayload(input: unknown, label: string): ErrorPayload;
|
|
22
22
|
export declare function acceptHeaders(input: unknown): Readonly<Record<string, string>>;
|
|
23
23
|
export declare function invalid(message: string): never;
|
|
24
|
-
//# sourceMappingURL=admission.d.ts.map
|
|
@@ -2,14 +2,14 @@ import { AuthValueError } from '@astrale-os/kernel-core/auth/error';
|
|
|
2
2
|
import { accept as acceptIssuer } from '@astrale-os/kernel-core/auth/issuer';
|
|
3
3
|
import { NodePath, PathError } from '@astrale-os/kernel-core/path';
|
|
4
4
|
import { callableAddress, Key } from '@astrale-os/kernel-dsl/v1/addressing';
|
|
5
|
-
import {
|
|
5
|
+
import { acceptForRead, BoundaryError, } from '@astrale-os/kernel-dsl/value';
|
|
6
6
|
import { CODES, acceptPayload, ProtocolError } from '../errors/index.js';
|
|
7
7
|
import { acceptRequestId } from './correlation.js';
|
|
8
8
|
import { acceptInvocationId, InvocationError } from './identity.js';
|
|
9
9
|
export function portableObject(input, label) {
|
|
10
|
-
let
|
|
10
|
+
let snapshot;
|
|
11
11
|
try {
|
|
12
|
-
|
|
12
|
+
snapshot = acceptForRead(input);
|
|
13
13
|
}
|
|
14
14
|
catch (cause) {
|
|
15
15
|
if (cause instanceof BoundaryError) {
|
|
@@ -17,9 +17,9 @@ export function portableObject(input, label) {
|
|
|
17
17
|
}
|
|
18
18
|
throw cause;
|
|
19
19
|
}
|
|
20
|
-
if (!isValueObject(
|
|
20
|
+
if (!isValueObject(snapshot))
|
|
21
21
|
invalid(`${label} must be an object`);
|
|
22
|
-
return
|
|
22
|
+
return snapshot;
|
|
23
23
|
}
|
|
24
24
|
export function exactDataObject(input, label) {
|
|
25
25
|
if (input === null || typeof input !== 'object' || Array.isArray(input)) {
|
|
@@ -175,4 +175,3 @@ function hasControlCharacter(input) {
|
|
|
175
175
|
}
|
|
176
176
|
return false;
|
|
177
177
|
}
|
|
178
|
-
//# sourceMappingURL=admission.js.map
|
|
@@ -6,7 +6,7 @@ export interface BinaryResponse {
|
|
|
6
6
|
readonly invocation: InvocationId;
|
|
7
7
|
readonly body: Uint8Array;
|
|
8
8
|
readonly mediaType: string;
|
|
9
|
+
readonly status: number;
|
|
9
10
|
readonly headers?: Readonly<Record<string, string>>;
|
|
10
11
|
}
|
|
11
12
|
export declare function decodeBinaryResponse(input: unknown): BinaryResponse;
|
|
12
|
-
//# sourceMappingURL=binary.d.ts.map
|
|
@@ -1,6 +1,14 @@
|
|
|
1
|
+
import { canonicalMediaType } from '../artifact/index.js';
|
|
1
2
|
import { acceptHeaders, exactDataObject, exactFields, invalid, invocation, requestId, required, string, } from './admission.js';
|
|
2
|
-
const FIELDS = new Set([
|
|
3
|
-
|
|
3
|
+
const FIELDS = new Set([
|
|
4
|
+
'kind',
|
|
5
|
+
'requestId',
|
|
6
|
+
'invocation',
|
|
7
|
+
'body',
|
|
8
|
+
'mediaType',
|
|
9
|
+
'status',
|
|
10
|
+
'headers',
|
|
11
|
+
]);
|
|
4
12
|
export function decodeBinaryResponse(input) {
|
|
5
13
|
const object = exactDataObject(input, 'binary response');
|
|
6
14
|
exactFields(object, FIELDS, 'binary response');
|
|
@@ -9,9 +17,17 @@ export function decodeBinaryResponse(input) {
|
|
|
9
17
|
invalid('binary response.kind must be "binary"');
|
|
10
18
|
if (!(object.body instanceof Uint8Array))
|
|
11
19
|
invalid('binary response.body must be a Uint8Array');
|
|
12
|
-
|
|
13
|
-
|
|
20
|
+
let mediaType;
|
|
21
|
+
try {
|
|
22
|
+
mediaType = canonicalMediaType(string(object.mediaType, 'binary response.mediaType'));
|
|
23
|
+
}
|
|
24
|
+
catch {
|
|
14
25
|
invalid('binary response.mediaType is invalid');
|
|
26
|
+
}
|
|
27
|
+
const status = object.status ?? 200;
|
|
28
|
+
if (!Number.isInteger(status) || status < 200 || status > 599) {
|
|
29
|
+
invalid('binary response.status is invalid');
|
|
30
|
+
}
|
|
15
31
|
const headers = object.headers === undefined ? undefined : acceptHeaders(object.headers);
|
|
16
32
|
return Object.freeze({
|
|
17
33
|
kind: 'binary',
|
|
@@ -19,7 +35,7 @@ export function decodeBinaryResponse(input) {
|
|
|
19
35
|
invocation: invocation(object.invocation, 'binary response.invocation'),
|
|
20
36
|
body: new Uint8Array(object.body),
|
|
21
37
|
mediaType,
|
|
38
|
+
status: status,
|
|
22
39
|
...(headers === undefined ? {} : { headers }),
|
|
23
40
|
});
|
|
24
41
|
}
|
|
25
|
-
//# sourceMappingURL=binary.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { Codec } from '../codecs/codec.js';
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
type CodecProfile = 'json';
|
|
3
|
+
interface SupportedCodec {
|
|
4
4
|
readonly codec: Codec;
|
|
5
5
|
readonly profile: CodecProfile;
|
|
6
6
|
}
|
|
7
7
|
export declare function codecProfile(codec: Codec): CodecProfile | undefined;
|
|
8
8
|
export declare function admitSupportedCodecs(supported: readonly Codec[]): readonly SupportedCodec[];
|
|
9
|
-
|
|
9
|
+
export {};
|
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
import { json } from '../codecs/json.js';
|
|
2
|
-
import { isMsgpackCodec } from '../codecs/msgpack.js';
|
|
3
2
|
export function codecProfile(codec) {
|
|
4
|
-
|
|
5
|
-
return 'json';
|
|
6
|
-
if (isMsgpackCodec(codec))
|
|
7
|
-
return 'msgpack';
|
|
8
|
-
return undefined;
|
|
3
|
+
return codec === json ? 'json' : undefined;
|
|
9
4
|
}
|
|
10
5
|
export function admitSupportedCodecs(supported) {
|
|
11
6
|
if (!Array.isArray(supported))
|
|
@@ -25,4 +20,3 @@ export function admitSupportedCodecs(supported) {
|
|
|
25
20
|
throw new TypeError('supported must contain the canonical JSON codec.');
|
|
26
21
|
return Object.freeze(admitted);
|
|
27
22
|
}
|
|
28
|
-
//# sourceMappingURL=binding-codecs.js.map
|
|
@@ -1,25 +1,4 @@
|
|
|
1
|
-
export declare namespace Delegate {
|
|
2
|
-
type Expr = {
|
|
3
|
-
readonly kind: 'identity';
|
|
4
|
-
readonly self: true;
|
|
5
|
-
} | {
|
|
6
|
-
readonly kind: 'identity';
|
|
7
|
-
readonly credential: string;
|
|
8
|
-
} | {
|
|
9
|
-
readonly kind: 'union';
|
|
10
|
-
readonly operands: readonly Expr[];
|
|
11
|
-
} | {
|
|
12
|
-
readonly kind: 'intersect';
|
|
13
|
-
readonly operands: readonly Expr[];
|
|
14
|
-
} | {
|
|
15
|
-
readonly kind: 'exclude';
|
|
16
|
-
readonly base: Expr;
|
|
17
|
-
readonly excluded: readonly Expr[];
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
1
|
export interface Delegate {
|
|
21
2
|
readonly ttlSeconds: number;
|
|
22
|
-
readonly attenuation?: Delegate.Expr;
|
|
23
3
|
}
|
|
24
4
|
export declare function acceptDelegate(input: unknown): Delegate;
|
|
25
|
-
//# sourceMappingURL=delegate.d.ts.map
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { AuthValueError, grant } from '@astrale-os/kernel-core/auth';
|
|
2
1
|
import { exactDataObject, exactFields, invalid, required } from './admission.js';
|
|
3
|
-
const FIELDS = new Set(['ttlSeconds'
|
|
2
|
+
const FIELDS = new Set(['ttlSeconds']);
|
|
4
3
|
export function acceptDelegate(input) {
|
|
5
4
|
const object = exactDataObject(input, 'delegate');
|
|
6
5
|
exactFields(object, FIELDS, 'delegate');
|
|
@@ -8,37 +7,5 @@ export function acceptDelegate(input) {
|
|
|
8
7
|
if (!Number.isSafeInteger(object.ttlSeconds) || object.ttlSeconds < 1) {
|
|
9
8
|
invalid('delegate.ttlSeconds must be a positive safe integer');
|
|
10
9
|
}
|
|
11
|
-
|
|
12
|
-
if (object.attenuation !== undefined) {
|
|
13
|
-
try {
|
|
14
|
-
attenuation = grant.acceptUnresolved({ v: 1, expr: object.attenuation }).expr;
|
|
15
|
-
}
|
|
16
|
-
catch (cause) {
|
|
17
|
-
if (cause instanceof AuthValueError)
|
|
18
|
-
invalid('delegate.attenuation must be a valid expression');
|
|
19
|
-
throw cause;
|
|
20
|
-
}
|
|
21
|
-
requireTextCredentials(attenuation);
|
|
22
|
-
}
|
|
23
|
-
return Object.freeze({
|
|
24
|
-
ttlSeconds: object.ttlSeconds,
|
|
25
|
-
...(attenuation === undefined ? {} : { attenuation: attenuation }),
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
function requireTextCredentials(input) {
|
|
29
|
-
if (input.kind === 'identity') {
|
|
30
|
-
if ('credential' in input && typeof input.credential !== 'string') {
|
|
31
|
-
invalid('delegate.attenuation credentials must be non-empty text');
|
|
32
|
-
}
|
|
33
|
-
return;
|
|
34
|
-
}
|
|
35
|
-
if (input.kind === 'exclude') {
|
|
36
|
-
requireTextCredentials(input.base);
|
|
37
|
-
for (const operand of input.excluded)
|
|
38
|
-
requireTextCredentials(operand);
|
|
39
|
-
return;
|
|
40
|
-
}
|
|
41
|
-
for (const operand of input.operands)
|
|
42
|
-
requireTextCredentials(operand);
|
|
10
|
+
return Object.freeze({ ttlSeconds: object.ttlSeconds });
|
|
43
11
|
}
|
|
44
|
-
//# sourceMappingURL=delegate.js.map
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { type InvocationId } from '../identity.js';
|
|
2
2
|
export declare const BINARY_HEADERS_FIELD: 'x-astrale-binary-headers';
|
|
3
|
+
export declare const BINARY_DELIVERY_FIELD: 'x-astrale-binary-delivery';
|
|
4
|
+
export declare const STREAMING_BINARY_DELIVERY: 'streaming';
|
|
3
5
|
export declare const REQUEST_ID_FIELD: 'x-astrale-request-id';
|
|
4
6
|
export declare const INVOCATION_FIELD: 'x-astrale-invocation';
|
|
5
7
|
export declare const MAXIMUM_INVOCATION_FIELD_BYTES = 8192;
|
|
6
8
|
/** Encode one admitted InvocationId as percent-encoded source plus opaque ID. */
|
|
7
9
|
export declare function encodeInvocationId(input: InvocationId): string;
|
|
8
|
-
/** Decode one complete
|
|
10
|
+
/** Decode one complete binary InvocationId field. */
|
|
9
11
|
export declare function decodeInvocationId(input: string | null): InvocationId;
|
|
10
12
|
export declare function isApplicationBinaryHeader(name: string): boolean;
|
|
11
13
|
export declare function encodeBinaryHeaderNames(headers: Readonly<Record<string, string>> | undefined): string;
|
|
12
14
|
export declare function decodeBinaryHeaderNames(input: string | null): readonly string[];
|
|
13
|
-
//# sourceMappingURL=binary.d.ts.map
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { CODES, ProtocolError } from '../../errors/index.js';
|
|
2
2
|
import { acceptInvocationId } from '../identity.js';
|
|
3
|
+
import { BINARY_LENGTH_FIELD } from './request.js';
|
|
3
4
|
export const BINARY_HEADERS_FIELD = 'x-astrale-binary-headers';
|
|
5
|
+
export const BINARY_DELIVERY_FIELD = 'x-astrale-binary-delivery';
|
|
6
|
+
export const STREAMING_BINARY_DELIVERY = 'streaming';
|
|
4
7
|
export const REQUEST_ID_FIELD = 'x-astrale-request-id';
|
|
5
8
|
export const INVOCATION_FIELD = 'x-astrale-invocation';
|
|
6
9
|
export const MAXIMUM_INVOCATION_FIELD_BYTES = 8_192;
|
|
@@ -33,6 +36,8 @@ const RESERVED = new Set([
|
|
|
33
36
|
'www-authenticate',
|
|
34
37
|
EMPTY_MANIFEST,
|
|
35
38
|
BINARY_HEADERS_FIELD,
|
|
39
|
+
BINARY_DELIVERY_FIELD,
|
|
40
|
+
BINARY_LENGTH_FIELD,
|
|
36
41
|
INVOCATION_FIELD,
|
|
37
42
|
REQUEST_ID_FIELD,
|
|
38
43
|
'x-astrale-stream-framing',
|
|
@@ -52,7 +57,7 @@ export function encodeInvocationId(input) {
|
|
|
52
57
|
}
|
|
53
58
|
return encoded;
|
|
54
59
|
}
|
|
55
|
-
/** Decode one complete
|
|
60
|
+
/** Decode one complete binary InvocationId field. */
|
|
56
61
|
export function decodeInvocationId(input) {
|
|
57
62
|
if (input === null ||
|
|
58
63
|
input.length === 0 ||
|
|
@@ -130,4 +135,3 @@ function invalid(message = 'HTTP binary application-header manifest is invalid.'
|
|
|
130
135
|
message,
|
|
131
136
|
});
|
|
132
137
|
}
|
|
133
|
-
//# sourceMappingURL=binary.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { BINARY_HEADERS_FIELD, decodeBinaryHeaderNames, decodeInvocationId, encodeBinaryHeaderNames, encodeInvocationId, isApplicationBinaryHeader, MAXIMUM_INVOCATION_FIELD_BYTES, INVOCATION_FIELD, REQUEST_ID_FIELD, } from './binary.js';
|
|
1
|
+
export { BINARY_DELIVERY_FIELD, BINARY_HEADERS_FIELD, decodeBinaryHeaderNames, decodeInvocationId, encodeBinaryHeaderNames, encodeInvocationId, isApplicationBinaryHeader, MAXIMUM_INVOCATION_FIELD_BYTES, INVOCATION_FIELD, REQUEST_ID_FIELD, STREAMING_BINARY_DELIVERY, } from './binary.js';
|
|
2
2
|
export { codecForContentType, negotiateResponseCodec } from './negotiation.js';
|
|
3
|
+
export { BINARY_LENGTH_FIELD, BINARY_REQUEST_CONTENT_TYPE, decodeBinaryLength, decodeBinaryRequestEnvelope, encodeBinaryRequestEnvelope, MAXIMUM_REQUEST_ENVELOPE_BYTES, REQUEST_ENVELOPE_FIELD, } from './request.js';
|
|
3
4
|
export { encodeStreamFrame, LENGTH_PREFIX_V1, STREAM_FRAMING_FIELD } from './stream.js';
|
|
4
5
|
export { BAGGAGE_FIELD, decodeTraceHeaders, encodeTraceHeaders, TRACEPARENT_FIELD, TRACESTATE_FIELD, } from './trace.js';
|
|
5
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { BINARY_HEADERS_FIELD, decodeBinaryHeaderNames, decodeInvocationId, encodeBinaryHeaderNames, encodeInvocationId, isApplicationBinaryHeader, MAXIMUM_INVOCATION_FIELD_BYTES, INVOCATION_FIELD, REQUEST_ID_FIELD, } from './binary.js';
|
|
1
|
+
export { BINARY_DELIVERY_FIELD, BINARY_HEADERS_FIELD, decodeBinaryHeaderNames, decodeInvocationId, encodeBinaryHeaderNames, encodeInvocationId, isApplicationBinaryHeader, MAXIMUM_INVOCATION_FIELD_BYTES, INVOCATION_FIELD, REQUEST_ID_FIELD, STREAMING_BINARY_DELIVERY, } from './binary.js';
|
|
2
2
|
export { codecForContentType, negotiateResponseCodec } from './negotiation.js';
|
|
3
|
+
export { BINARY_LENGTH_FIELD, BINARY_REQUEST_CONTENT_TYPE, decodeBinaryLength, decodeBinaryRequestEnvelope, encodeBinaryRequestEnvelope, MAXIMUM_REQUEST_ENVELOPE_BYTES, REQUEST_ENVELOPE_FIELD, } from './request.js';
|
|
3
4
|
export { encodeStreamFrame, LENGTH_PREFIX_V1, STREAM_FRAMING_FIELD } from './stream.js';
|
|
4
5
|
export { BAGGAGE_FIELD, decodeTraceHeaders, encodeTraceHeaders, TRACEPARENT_FIELD, TRACESTATE_FIELD, } from './trace.js';
|
|
5
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
import type { Codec } from '../../codecs/index.js';
|
|
2
2
|
export declare function codecForContentType(contentType: string | null, supported: readonly Codec[]): Codec | undefined;
|
|
3
3
|
export declare function negotiateResponseCodec(accept: string | null, requestCodec: Codec, supported: readonly Codec[]): Codec | undefined;
|
|
4
|
-
//# sourceMappingURL=negotiation.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CONTENT_TYPE_JSON
|
|
1
|
+
import { CONTENT_TYPE_JSON } from '../../codecs/index.js';
|
|
2
2
|
import { admitSupportedCodecs } from '../binding-codecs.js';
|
|
3
3
|
const TOKEN = /^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/u;
|
|
4
4
|
const QVALUE = /^(?:0(?:\.\d{0,3})?|1(?:\.0{0,3})?)$/u;
|
|
@@ -9,11 +9,7 @@ export function codecForContentType(contentType, supported) {
|
|
|
9
9
|
const mediaType = parseContentType(contentType);
|
|
10
10
|
if (mediaType === undefined)
|
|
11
11
|
return undefined;
|
|
12
|
-
const profile = mediaType === CONTENT_TYPE_JSON
|
|
13
|
-
? 'json'
|
|
14
|
-
: mediaType === CONTENT_TYPE_MSGPACK
|
|
15
|
-
? 'msgpack'
|
|
16
|
-
: undefined;
|
|
12
|
+
const profile = mediaType === CONTENT_TYPE_JSON ? 'json' : undefined;
|
|
17
13
|
return admitted.find((entry) => entry.profile === profile)?.codec;
|
|
18
14
|
}
|
|
19
15
|
export function negotiateResponseCodec(accept, requestCodec, supported) {
|
|
@@ -27,7 +23,7 @@ export function negotiateResponseCodec(accept, requestCodec, supported) {
|
|
|
27
23
|
if (ranges.length === 0)
|
|
28
24
|
return undefined;
|
|
29
25
|
const candidates = admitted.flatMap((entry) => {
|
|
30
|
-
const [type, subtype] =
|
|
26
|
+
const [type, subtype] = CONTENT_TYPE_JSON.split('/');
|
|
31
27
|
const governing = ranges
|
|
32
28
|
.filter((range) => range.mediaParameters === 0 &&
|
|
33
29
|
(range.type === '*' || range.type === type) &&
|
|
@@ -56,9 +52,6 @@ export function negotiateResponseCodec(accept, requestCodec, supported) {
|
|
|
56
52
|
});
|
|
57
53
|
return candidates[0]?.codec;
|
|
58
54
|
}
|
|
59
|
-
function contentTypeOf(profile) {
|
|
60
|
-
return profile === 'json' ? CONTENT_TYPE_JSON : CONTENT_TYPE_MSGPACK;
|
|
61
|
-
}
|
|
62
55
|
function parseContentType(input) {
|
|
63
56
|
if (splitOutsideQuotes(input, ',')?.length !== 1)
|
|
64
57
|
return undefined;
|
|
@@ -205,4 +198,3 @@ function splitOutsideQuotes(input, separator) {
|
|
|
205
198
|
parts.push(input.slice(start));
|
|
206
199
|
return parts;
|
|
207
200
|
}
|
|
208
|
-
//# sourceMappingURL=negotiation.js.map
|