@astrale-os/kernel-protocol 0.5.0-beta.8 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/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 +25 -0
- package/dist/errors/retry.js +46 -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 +5 -5
- package/dist/invocation/index.js +4 -4
- package/dist/invocation/maintenance.d.ts +14 -0
- package/dist/invocation/maintenance.js +18 -0
- 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 +3 -1
- package/dist/invocation/request.js +9 -3
- package/dist/invocation/response.d.ts +6 -2
- package/dist/invocation/response.js +26 -16
- 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 +9 -0
- package/dist/schema/installation/codec.js +82 -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 +319 -194
- 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 +84 -26
- package/dist/schema/installation/introspection/result.js +0 -1
- package/dist/schema/installation/result.d.ts +15 -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
|
@@ -1,227 +1,366 @@
|
|
|
1
|
+
import { is as isIssuer } from '@astrale-os/kernel-core/auth/issuer';
|
|
2
|
+
import { patterns } from '@astrale-os/kernel-dsl/v1/addressing';
|
|
1
3
|
import * as bundle from '@astrale-os/kernel-dsl/v1/bundle/transport';
|
|
2
|
-
import
|
|
3
|
-
import { json } from '
|
|
4
|
-
import
|
|
5
|
-
import * as
|
|
6
|
-
export const MEDIA_TYPE = 'application/vnd.astrale.schema-introspection.
|
|
4
|
+
import { revision as schemaRevision } from '@astrale-os/kernel-dsl/v1/schema/revision';
|
|
5
|
+
import { json } from '@astrale-os/kernel-dsl/value';
|
|
6
|
+
import { admitCallableBinding, admitViewBinding } from '../../../release/bindings/index.js';
|
|
7
|
+
import * as release from '../../../release/index.js';
|
|
8
|
+
export const MEDIA_TYPE = 'application/vnd.astrale.schema-introspection.v4+json';
|
|
9
|
+
const encoder = new TextEncoder();
|
|
10
|
+
const serializedBundles = new WeakMap();
|
|
11
|
+
const admittedBundles = new Map();
|
|
12
|
+
const MAXIMUM_ADMITTED_BUNDLES = 128;
|
|
13
|
+
// The Bundle travels as its JSON text inside the evidence; string escaping at most doubles it.
|
|
14
|
+
const BUNDLE_ESCAPE_FACTOR = 2;
|
|
15
|
+
// Encoding is bounded by the Server response policy, not by the default portable-value limits.
|
|
16
|
+
const ENCODE_LIMITS = Object.freeze({
|
|
17
|
+
maxBytes: Number.MAX_SAFE_INTEGER,
|
|
18
|
+
maxStringBytes: Number.MAX_SAFE_INTEGER,
|
|
19
|
+
});
|
|
7
20
|
export async function encode(input, result) {
|
|
8
|
-
const
|
|
9
|
-
const wire =
|
|
10
|
-
|
|
11
|
-
|
|
21
|
+
const request = admitRequest(input);
|
|
22
|
+
const wire = request.kind === 'installed'
|
|
23
|
+
? acceptInstalledReleases(result)
|
|
24
|
+
: request.kind === 'bundle'
|
|
25
|
+
? encodeDomainBundle(result)
|
|
26
|
+
: request.kind === 'dependencies'
|
|
27
|
+
? encodeDomainDependencies(result)
|
|
28
|
+
: encodeDomainInfo(result);
|
|
29
|
+
if (request.kind !== 'installed') {
|
|
30
|
+
proveRequestedOrigin(request, result);
|
|
31
|
+
}
|
|
32
|
+
return encoder.encode(json.serialize(wire, { limits: ENCODE_LIMITS }));
|
|
12
33
|
}
|
|
13
34
|
export async function decode(input, bytes, limits) {
|
|
35
|
+
const request = admitRequest(input);
|
|
14
36
|
if (!(bytes instanceof Uint8Array))
|
|
15
37
|
invalid('Schema introspection evidence must be binary.');
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
38
|
+
admitLimits(request, limits);
|
|
39
|
+
const maximumEvidenceBytes = limits.maximumReleaseBytes +
|
|
40
|
+
(request.kind === 'bundle' ? BUNDLE_ESCAPE_FACTOR * limits.maximumBundleBytes : 0) +
|
|
41
|
+
4_096;
|
|
42
|
+
if (bytes.byteLength > maximumEvidenceBytes) {
|
|
19
43
|
invalid('Schema introspection evidence exceeds its declared bounds.');
|
|
20
44
|
}
|
|
21
|
-
const { unpack } = await import('msgpackr/unpack');
|
|
22
45
|
let decoded;
|
|
23
46
|
try {
|
|
24
|
-
decoded =
|
|
47
|
+
decoded = json.decode(bytes, {
|
|
48
|
+
limits: {
|
|
49
|
+
maxBytes: maximumEvidenceBytes,
|
|
50
|
+
...(request.kind === 'bundle' ? { maxStringBytes: limits.maximumBundleBytes } : {}),
|
|
51
|
+
},
|
|
52
|
+
});
|
|
25
53
|
}
|
|
26
54
|
catch (cause) {
|
|
27
55
|
throw new TypeError('Schema introspection evidence is malformed.', { cause });
|
|
28
56
|
}
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
57
|
+
return acceptEvidence(request, decoded, limits);
|
|
58
|
+
}
|
|
59
|
+
function acceptEvidence(request, decoded, limits) {
|
|
60
|
+
if (request.kind === 'installed')
|
|
61
|
+
return acceptInstalledReleases(decoded);
|
|
62
|
+
const result = request.kind === 'bundle'
|
|
63
|
+
? decodeDomainBundle(decoded, limits.maximumBundleBytes)
|
|
64
|
+
: request.kind === 'dependencies'
|
|
65
|
+
? acceptDomainDependencies(decoded)
|
|
66
|
+
: acceptDomainInfo(decoded);
|
|
67
|
+
proveRequestedOrigin(request, result);
|
|
68
|
+
return result;
|
|
69
|
+
}
|
|
70
|
+
/** Admit the evidence bounds a request declares. */
|
|
71
|
+
function admitLimits(request, limits) {
|
|
72
|
+
admitLimit(limits.maximumReleaseBytes, 'Release');
|
|
73
|
+
if (request.kind === 'bundle')
|
|
74
|
+
admitLimit(limits.maximumBundleBytes, 'Bundle');
|
|
36
75
|
}
|
|
37
|
-
function
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
76
|
+
function proveRequestedOrigin(request, result) {
|
|
77
|
+
const origin = request.kind === 'inspect'
|
|
78
|
+
? result.origin
|
|
79
|
+
: result.domain.origin;
|
|
80
|
+
if (origin !== request.origin)
|
|
81
|
+
invalid('Schema introspection evidence does not match the requested origin.');
|
|
82
|
+
}
|
|
83
|
+
function encodeDomainDependencies(input) {
|
|
84
|
+
const admitted = acceptDomainDependencies(input);
|
|
85
|
+
return Object.freeze({
|
|
86
|
+
domain: encodeDomainInfo(admitted.domain),
|
|
87
|
+
dependencies: admitted.dependencies.map((binding) => ({ ...binding })),
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
/** Admit dependency bindings: origin-ordered, one per origin, each label agreeing with its revisions. */
|
|
91
|
+
export function acceptDomainDependencies(input) {
|
|
92
|
+
const value = record(input, 'Domain dependencies result');
|
|
93
|
+
exact(value, ['dependencies', 'domain'], 'Domain dependencies result');
|
|
94
|
+
const domain = acceptDomainInfo(value.domain);
|
|
95
|
+
if (!Array.isArray(value.dependencies))
|
|
96
|
+
invalid('Domain dependency bindings are invalid.');
|
|
97
|
+
const dependencies = value.dependencies.map(acceptDependencyBinding);
|
|
98
|
+
for (const [index, binding] of dependencies.entries()) {
|
|
99
|
+
const previous = dependencies[index - 1];
|
|
100
|
+
if (previous !== undefined && previous.origin >= binding.origin) {
|
|
101
|
+
invalid('Domain dependency bindings must be origin-ordered and unique.');
|
|
62
102
|
}
|
|
103
|
+
if (binding.origin === domain.origin)
|
|
104
|
+
invalid('Domain dependency bindings cannot name the Domain.');
|
|
63
105
|
}
|
|
64
|
-
return Object.freeze(
|
|
106
|
+
return Object.freeze({ domain, dependencies: Object.freeze(dependencies) });
|
|
65
107
|
}
|
|
66
|
-
function
|
|
67
|
-
const
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
108
|
+
function acceptDependencyBinding(input) {
|
|
109
|
+
const value = record(input, 'Domain dependency binding');
|
|
110
|
+
exact(value, ['active', 'binding', 'origin', 'pinned'], 'Domain dependency binding');
|
|
111
|
+
if (typeof value.origin !== 'string' || !patterns.origin.test(value.origin)) {
|
|
112
|
+
invalid('Domain dependency binding origin is invalid.');
|
|
113
|
+
}
|
|
114
|
+
if (typeof value.pinned !== 'string' || !patterns.revision.test(value.pinned)) {
|
|
115
|
+
invalid('Domain dependency binding pinned revision is invalid.');
|
|
116
|
+
}
|
|
117
|
+
if (typeof value.active !== 'string' || !patterns.revision.test(value.active)) {
|
|
118
|
+
invalid('Domain dependency binding active revision is invalid.');
|
|
119
|
+
}
|
|
120
|
+
const expected = value.pinned === value.active ? 'exact' : 'retained';
|
|
121
|
+
if (value.binding !== expected)
|
|
122
|
+
invalid('Domain dependency binding label is invalid.');
|
|
123
|
+
return Object.freeze({
|
|
124
|
+
origin: value.origin,
|
|
125
|
+
pinned: value.pinned,
|
|
126
|
+
active: value.active,
|
|
127
|
+
binding: expected,
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Admit the installed listing: origin-ordered, one installation per origin, each pin of one kind,
|
|
132
|
+
* with a deployment URL exactly for a release pin.
|
|
133
|
+
*/
|
|
134
|
+
function acceptInstalledReleases(input) {
|
|
135
|
+
if (!Array.isArray(input))
|
|
136
|
+
invalid('Installed releases are invalid.');
|
|
137
|
+
const releases = input.map(acceptInstalledRelease);
|
|
138
|
+
for (const [index, installed] of releases.entries()) {
|
|
139
|
+
const previous = releases[index - 1];
|
|
140
|
+
if (previous !== undefined && previous.origin >= installed.origin) {
|
|
141
|
+
invalid('Installed releases must be origin-ordered and unique.');
|
|
90
142
|
}
|
|
91
143
|
}
|
|
92
|
-
|
|
93
|
-
|
|
144
|
+
return Object.freeze(releases);
|
|
145
|
+
}
|
|
146
|
+
function acceptInstalledRelease(input) {
|
|
147
|
+
const value = record(input, 'Installed release');
|
|
148
|
+
const pin = installedPin(value.pin);
|
|
149
|
+
// Only a release pin names a deployment: an artifact pin carries no URL.
|
|
150
|
+
exact(value, pin.kind === 'release'
|
|
151
|
+
? ['inFlight', 'issuer', 'origin', 'pin', 'revision', 'url']
|
|
152
|
+
: ['inFlight', 'issuer', 'origin', 'pin', 'revision'], 'Installed release');
|
|
153
|
+
if (typeof value.origin !== 'string' || !patterns.origin.test(value.origin)) {
|
|
154
|
+
invalid('Installed release origin is invalid.');
|
|
155
|
+
}
|
|
156
|
+
if (typeof value.revision !== 'string' || !patterns.revision.test(value.revision)) {
|
|
157
|
+
invalid('Installed release revision is invalid.');
|
|
94
158
|
}
|
|
95
|
-
|
|
159
|
+
const issuer = issuerId(value.issuer, 'Installed release issuer');
|
|
160
|
+
return Object.freeze({
|
|
161
|
+
origin: value.origin,
|
|
162
|
+
revision: value.revision,
|
|
163
|
+
issuer,
|
|
164
|
+
...(pin.kind === 'release' ? { url: deploymentUrl(value.url) } : {}),
|
|
165
|
+
pin,
|
|
166
|
+
inFlight: inFlightIssuers(value.inFlight, issuer),
|
|
167
|
+
});
|
|
96
168
|
}
|
|
97
|
-
function
|
|
98
|
-
|
|
169
|
+
function installedPin(input) {
|
|
170
|
+
const value = record(input, 'Installed pin');
|
|
171
|
+
if (value.kind === 'release') {
|
|
172
|
+
exact(value, ['build', 'kind', 'release'], 'Installed release pin');
|
|
99
173
|
return Object.freeze({
|
|
100
|
-
kind: '
|
|
101
|
-
|
|
174
|
+
kind: 'release',
|
|
175
|
+
release: digest(value.release, 'Installed release'),
|
|
176
|
+
build: digest(value.build, 'Installed build'),
|
|
102
177
|
});
|
|
103
178
|
}
|
|
104
|
-
if (
|
|
179
|
+
if (value.kind === 'artifact') {
|
|
180
|
+
exact(value, ['artifact', 'kind'], 'Installed artifact pin');
|
|
105
181
|
return Object.freeze({
|
|
106
|
-
kind: '
|
|
107
|
-
artifact:
|
|
108
|
-
bundle: ref(input.bundle, publication.BUNDLE_MEDIA_TYPE, 'Local schema Bundle'),
|
|
182
|
+
kind: 'artifact',
|
|
183
|
+
artifact: digest(value.artifact, 'Installed artifact'),
|
|
109
184
|
});
|
|
110
185
|
}
|
|
111
|
-
|
|
186
|
+
return invalid('Installed pin kind is invalid.');
|
|
187
|
+
}
|
|
188
|
+
function inFlightIssuers(input, current) {
|
|
189
|
+
if (!Array.isArray(input))
|
|
190
|
+
invalid('Installed release in-flight issuers are invalid.');
|
|
191
|
+
const entries = input.map((entry) => {
|
|
192
|
+
const value = record(entry, 'In-flight issuer');
|
|
193
|
+
exact(value, ['issuer', 'release', 'replacedAt'], 'In-flight issuer');
|
|
194
|
+
if (typeof value.replacedAt !== 'string' || !isInstant(value.replacedAt)) {
|
|
195
|
+
invalid('In-flight issuer replacement instant is invalid.');
|
|
196
|
+
}
|
|
112
197
|
return Object.freeze({
|
|
113
|
-
|
|
114
|
-
|
|
198
|
+
issuer: issuerId(value.issuer, 'In-flight issuer'),
|
|
199
|
+
release: digest(value.release, 'In-flight release'),
|
|
200
|
+
replacedAt: value.replacedAt,
|
|
115
201
|
});
|
|
202
|
+
});
|
|
203
|
+
for (const [index, entry] of entries.entries()) {
|
|
204
|
+
if (entry.issuer === current)
|
|
205
|
+
invalid('An in-flight issuer cannot be the current issuer.');
|
|
206
|
+
const previous = entries[index - 1];
|
|
207
|
+
if (previous !== undefined && previous.issuer >= entry.issuer) {
|
|
208
|
+
invalid('In-flight issuers must be issuer-ordered and unique.');
|
|
209
|
+
}
|
|
116
210
|
}
|
|
117
|
-
return
|
|
211
|
+
return Object.freeze(entries);
|
|
118
212
|
}
|
|
119
|
-
function
|
|
120
|
-
if (!
|
|
121
|
-
invalid(
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
213
|
+
function issuerId(input, label) {
|
|
214
|
+
if (!isIssuer(input))
|
|
215
|
+
invalid(`${label} is invalid.`);
|
|
216
|
+
return input;
|
|
217
|
+
}
|
|
218
|
+
/** An HTTP(S) origin, spelled exactly as `URL.origin` spells it. */
|
|
219
|
+
function deploymentUrl(input) {
|
|
220
|
+
let url;
|
|
221
|
+
try {
|
|
222
|
+
url = typeof input === 'string' ? new URL(input) : undefined;
|
|
128
223
|
}
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
return Object.freeze({
|
|
132
|
-
kind: 'local',
|
|
133
|
-
artifact: ref(input.artifact, runtime.MEDIA_TYPE, 'Local Runtime Artifact'),
|
|
134
|
-
bundle: ref(input.bundle, publication.BUNDLE_MEDIA_TYPE, 'Local schema Bundle'),
|
|
135
|
-
});
|
|
224
|
+
catch {
|
|
225
|
+
url = undefined;
|
|
136
226
|
}
|
|
137
|
-
if (
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
227
|
+
if (url === undefined || (url.protocol !== 'https:' && url.protocol !== 'http:')) {
|
|
228
|
+
invalid('Installed release URL is invalid.');
|
|
229
|
+
}
|
|
230
|
+
if (url.origin !== input)
|
|
231
|
+
invalid('Installed release URL must be an origin.');
|
|
232
|
+
return url.origin;
|
|
233
|
+
}
|
|
234
|
+
/** A UTC millisecond instant, spelled exactly as `Date.prototype.toISOString` spells it. */
|
|
235
|
+
function isInstant(input) {
|
|
236
|
+
const time = Date.parse(input);
|
|
237
|
+
return Number.isFinite(time) && new Date(time).toISOString() === input;
|
|
238
|
+
}
|
|
239
|
+
function encodeDomainBundle(input) {
|
|
240
|
+
exact(input, ['bundle', 'domain'], 'Domain Bundle result');
|
|
241
|
+
const admittedDomain = acceptDomainInfo(input.domain);
|
|
242
|
+
const domain = encodeDomainInfo(admittedDomain);
|
|
243
|
+
proveBundle(input.bundle, admittedDomain);
|
|
244
|
+
const text = serializedBundles.get(input.bundle) ?? bundle.serialize(input.bundle);
|
|
245
|
+
if (!serializedBundles.has(input.bundle))
|
|
246
|
+
serializedBundles.set(input.bundle, text);
|
|
247
|
+
return Object.freeze({ domain, bundle: text });
|
|
248
|
+
}
|
|
249
|
+
function decodeDomainBundle(input, maximum) {
|
|
250
|
+
const value = record(input, 'Domain Bundle result');
|
|
251
|
+
exact(value, ['bundle', 'domain'], 'Domain Bundle result');
|
|
252
|
+
const domain = acceptDomainInfo(value.domain);
|
|
253
|
+
const text = boundedText(value.bundle, maximum, 'Bundle');
|
|
254
|
+
const cached = admittedBundles.get(domain.generation);
|
|
255
|
+
if (cached !== undefined && cached.text === text) {
|
|
256
|
+
return Object.freeze({ domain, bundle: cached.bundle });
|
|
257
|
+
}
|
|
258
|
+
let admitted;
|
|
259
|
+
try {
|
|
260
|
+
admitted = bundle.decode(text);
|
|
151
261
|
}
|
|
152
|
-
|
|
262
|
+
catch (cause) {
|
|
263
|
+
throw new TypeError('Installed Domain Bundle is invalid.', { cause });
|
|
264
|
+
}
|
|
265
|
+
proveBundle(admitted, domain);
|
|
266
|
+
admittedBundles.delete(domain.generation);
|
|
267
|
+
admittedBundles.set(domain.generation, Object.freeze({ text, bundle: admitted }));
|
|
268
|
+
if (admittedBundles.size > MAXIMUM_ADMITTED_BUNDLES) {
|
|
269
|
+
admittedBundles.delete(admittedBundles.keys().next().value);
|
|
270
|
+
}
|
|
271
|
+
return Object.freeze({ domain, bundle: admitted });
|
|
153
272
|
}
|
|
154
|
-
function
|
|
155
|
-
|
|
156
|
-
invalid('Bundle source evidence is missing.');
|
|
157
|
-
const admitted = source.kind === 'remote'
|
|
158
|
-
? publication.acceptBundle(source.publication, input)
|
|
159
|
-
: bundle.accept(input);
|
|
160
|
-
const encoded = bundle.encode(admitted);
|
|
161
|
-
if (source.kind !== 'remote' &&
|
|
162
|
-
!same(artifact.identify(encoded, publication.BUNDLE_MEDIA_TYPE), source.bundle)) {
|
|
163
|
-
invalid('Local schema Bundle does not match its source Ref.');
|
|
164
|
-
}
|
|
165
|
-
return encoded;
|
|
273
|
+
function encodeDomainInfo(input) {
|
|
274
|
+
return acceptDomainInfo(input);
|
|
166
275
|
}
|
|
167
|
-
function
|
|
168
|
-
const
|
|
276
|
+
export function acceptDomainInfo(input) {
|
|
277
|
+
const value = record(input, 'Domain info');
|
|
278
|
+
exact(value, ['bindings', 'capabilities', 'generation', 'origin', 'release', 'readiness', 'revision'], 'Domain info');
|
|
279
|
+
if (typeof value.origin !== 'string' || !patterns.origin.test(value.origin)) {
|
|
280
|
+
invalid('Domain info origin is invalid.');
|
|
281
|
+
}
|
|
282
|
+
if (typeof value.revision !== 'string' || !patterns.revision.test(value.revision)) {
|
|
283
|
+
invalid('Domain info revision is invalid.');
|
|
284
|
+
}
|
|
285
|
+
const origin = value.origin;
|
|
286
|
+
const revision = value.revision;
|
|
287
|
+
const published = releaseReference(value.release, origin, revision);
|
|
288
|
+
return Object.freeze({
|
|
289
|
+
origin,
|
|
290
|
+
revision,
|
|
291
|
+
generation: digest(value.generation, 'Domain generation'),
|
|
292
|
+
release: published,
|
|
293
|
+
readiness: digest(value.readiness, 'Domain readiness'),
|
|
294
|
+
capabilities: capabilities(value.capabilities),
|
|
295
|
+
bindings: bindings(value.bindings, origin),
|
|
296
|
+
});
|
|
297
|
+
}
|
|
298
|
+
function releaseReference(input, origin, revision) {
|
|
299
|
+
if (input === null)
|
|
300
|
+
return null;
|
|
169
301
|
let admitted;
|
|
170
302
|
try {
|
|
171
|
-
admitted =
|
|
172
|
-
source.kind === 'remote'
|
|
173
|
-
? publication.decodeBundle(source.publication, encoded)
|
|
174
|
-
: bundle.decode(encoded);
|
|
303
|
+
admitted = release.acceptReference(input);
|
|
175
304
|
}
|
|
176
305
|
catch (cause) {
|
|
177
|
-
throw new TypeError('
|
|
306
|
+
throw new TypeError('Domain Release metadata is invalid.', { cause });
|
|
178
307
|
}
|
|
179
|
-
if (
|
|
180
|
-
invalid('
|
|
181
|
-
if (source.kind !== 'remote' &&
|
|
182
|
-
!same(artifact.identify(encoded, publication.BUNDLE_MEDIA_TYPE), source.bundle)) {
|
|
183
|
-
invalid('Local schema Bundle does not match its source Ref.');
|
|
308
|
+
if (admitted.origin !== origin || admitted.revision !== revision) {
|
|
309
|
+
invalid('Domain Release metadata does not match its Schema coordinate.');
|
|
184
310
|
}
|
|
185
311
|
return admitted;
|
|
186
312
|
}
|
|
187
|
-
function
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
}
|
|
203
|
-
|
|
313
|
+
function bindings(input, origin) {
|
|
314
|
+
const value = record(input, 'Domain bindings');
|
|
315
|
+
exact(value, ['callables', 'views'], 'Domain bindings');
|
|
316
|
+
const { callables, views } = value;
|
|
317
|
+
if (!Array.isArray(callables) || !Array.isArray(views)) {
|
|
318
|
+
invalid('Domain bindings are invalid.');
|
|
319
|
+
}
|
|
320
|
+
try {
|
|
321
|
+
return Object.freeze({
|
|
322
|
+
callables: Object.freeze(callables.map((entry) => admitCallableBinding(entry, origin))),
|
|
323
|
+
views: Object.freeze(views.map((entry) => admitViewBinding(entry, origin))),
|
|
324
|
+
});
|
|
325
|
+
}
|
|
326
|
+
catch (cause) {
|
|
327
|
+
throw new TypeError('Domain bindings are invalid.', { cause });
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
function proveBundle(input, domain) {
|
|
331
|
+
if (input.root.origin !== domain.origin || schemaRevision(input.root) !== domain.revision) {
|
|
332
|
+
invalid('Installed Bundle root does not match the ready Domain coordinate.');
|
|
333
|
+
}
|
|
204
334
|
}
|
|
205
335
|
function capabilities(input) {
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
exact(input, ['materialized', 'requested'], 'Installation capabilities');
|
|
336
|
+
const value = record(input, 'Domain capabilities');
|
|
337
|
+
exact(value, ['materialized', 'requested'], 'Domain capabilities');
|
|
209
338
|
try {
|
|
210
|
-
const requested =
|
|
211
|
-
const materialized =
|
|
212
|
-
capabilities:
|
|
339
|
+
const requested = release.admitRequirements({ capabilities: value.requested }).capabilities;
|
|
340
|
+
const materialized = release.admitRequirements({
|
|
341
|
+
capabilities: value.materialized,
|
|
213
342
|
}).capabilities;
|
|
214
343
|
return Object.freeze({ requested, materialized });
|
|
215
344
|
}
|
|
216
345
|
catch (cause) {
|
|
217
|
-
throw new TypeError('
|
|
346
|
+
throw new TypeError('Domain capabilities are invalid.', { cause });
|
|
218
347
|
}
|
|
219
348
|
}
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
349
|
+
/** Admit one introspection request. */
|
|
350
|
+
function admitRequest(input) {
|
|
351
|
+
const value = record(input, 'Schema introspection request');
|
|
352
|
+
if (value.kind === 'installed') {
|
|
353
|
+
exact(value, ['kind'], 'Schema introspection request');
|
|
354
|
+
return Object.freeze({ kind: 'installed' });
|
|
223
355
|
}
|
|
224
|
-
|
|
356
|
+
exact(value, ['kind', 'origin'], 'Schema introspection request');
|
|
357
|
+
if (value.kind !== 'inspect' && value.kind !== 'bundle' && value.kind !== 'dependencies') {
|
|
358
|
+
invalid('Schema introspection kind is invalid.');
|
|
359
|
+
}
|
|
360
|
+
if (typeof value.origin !== 'string' || !patterns.origin.test(value.origin)) {
|
|
361
|
+
invalid('Schema introspection origin is invalid.');
|
|
362
|
+
}
|
|
363
|
+
return Object.freeze({ kind: value.kind, origin: value.origin });
|
|
225
364
|
}
|
|
226
365
|
function digest(input, label) {
|
|
227
366
|
if (typeof input !== 'string' || !/^sha256:[0-9a-f]{64}$/u.test(input)) {
|
|
@@ -229,31 +368,24 @@ function digest(input, label) {
|
|
|
229
368
|
}
|
|
230
369
|
return input;
|
|
231
370
|
}
|
|
232
|
-
function
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
}
|
|
237
|
-
catch (cause) {
|
|
238
|
-
throw new TypeError(`${label} Ref is invalid.`, { cause });
|
|
239
|
-
}
|
|
240
|
-
if (admitted.mediaType !== mediaType)
|
|
241
|
-
invalid(`${label} media type is invalid.`);
|
|
242
|
-
return admitted;
|
|
243
|
-
}
|
|
244
|
-
function same(left, right) {
|
|
245
|
-
return (left.digest === right.digest && left.mediaType === right.mediaType && left.size === right.size);
|
|
246
|
-
}
|
|
247
|
-
function boundedBytes(input, maximum, label) {
|
|
248
|
-
if (!(input instanceof Uint8Array) || input.byteLength === 0 || input.byteLength > maximum) {
|
|
371
|
+
function boundedText(input, maximum, label) {
|
|
372
|
+
if (typeof input !== 'string' ||
|
|
373
|
+
input.length === 0 ||
|
|
374
|
+
encoder.encode(input).byteLength > maximum) {
|
|
249
375
|
invalid(`${label} evidence is invalid or exceeds its bound.`);
|
|
250
376
|
}
|
|
251
|
-
return
|
|
377
|
+
return input;
|
|
252
378
|
}
|
|
253
379
|
function admitLimit(input, label) {
|
|
254
380
|
if (!Number.isSafeInteger(input) || input < 1)
|
|
255
381
|
invalid(`${label} evidence bound is invalid.`);
|
|
256
382
|
}
|
|
383
|
+
function record(input, label) {
|
|
384
|
+
if (input === null || typeof input !== 'object' || Array.isArray(input)) {
|
|
385
|
+
invalid(`${label} is invalid.`);
|
|
386
|
+
}
|
|
387
|
+
return input;
|
|
388
|
+
}
|
|
257
389
|
function exact(input, expected, label) {
|
|
258
390
|
const keys = Object.keys(input).sort();
|
|
259
391
|
const wanted = [...expected].sort();
|
|
@@ -261,13 +393,6 @@ function exact(input, expected, label) {
|
|
|
261
393
|
invalid(`${label} fields are invalid.`);
|
|
262
394
|
}
|
|
263
395
|
}
|
|
264
|
-
function equal(left, right) {
|
|
265
|
-
return left.byteLength === right.byteLength && left.every((byte, index) => byte === right[index]);
|
|
266
|
-
}
|
|
267
|
-
function isRecord(input) {
|
|
268
|
-
return input !== null && typeof input === 'object' && !Array.isArray(input);
|
|
269
|
-
}
|
|
270
396
|
function invalid(message) {
|
|
271
397
|
throw new TypeError(message);
|
|
272
398
|
}
|
|
273
|
-
//# sourceMappingURL=codec.js.map
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
export { MEDIA_TYPE, decode, encode } from './codec.js';
|
|
2
|
-
export type { Digest,
|
|
3
|
-
//# sourceMappingURL=index.d.ts.map
|
|
1
|
+
export { MEDIA_TYPE, acceptDomainDependencies, acceptDomainInfo, decode, encode } from './codec.js';
|
|
2
|
+
export type { DependencyBinding, Digest, DomainBundle, DomainDependencies, DomainInfo, InFlightIssuer, InstalledPin, InstalledRelease, Limits, ResultFor, } from './result.js';
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export { MEDIA_TYPE, decode, encode } from './codec.js';
|
|
2
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
export { MEDIA_TYPE, acceptDomainDependencies, acceptDomainInfo, decode, encode } from './codec.js';
|