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