@astrale-os/sdk 0.6.0-beta.3 → 0.6.0-beta.30
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/README.md +179 -58
- package/dist/application/action/action.d.ts +6 -0
- package/dist/application/action/authoring.d.ts +1 -1
- package/dist/application/action/context.d.ts +44 -31
- package/dist/application/action/define.d.ts +3 -3
- package/dist/application/action/index.d.ts +1 -1
- package/dist/application/define.d.ts +8 -6
- package/dist/application/define.js +28 -14
- package/dist/application/dependency/index.d.ts +1 -1
- package/dist/application/dependency/invoker.d.ts +14 -9
- package/dist/application/domain.d.ts +30 -0
- package/dist/application/index.d.ts +4 -4
- package/dist/application/index.js +1 -1
- package/dist/application/integration/operation.d.ts +2 -2
- package/dist/application/mutation/authoring/properties.d.ts +5 -3
- package/dist/application/mutation/authoring/properties.js +35 -2
- package/dist/application/mutation/authoring/transition.js +4 -1
- package/dist/application/mutation/index.d.ts +1 -1
- package/dist/application/query/composite/plan.d.ts +0 -4
- package/dist/application/query/composite/plan.js +0 -2
- package/dist/application/routes/admission.d.ts +2 -2
- package/dist/application/routes/admission.js +1 -1
- package/dist/application/routes/route.d.ts +2 -2
- package/dist/application/runtime/actions.js +3 -0
- package/dist/application/runtime/workflows.d.ts +3 -1
- package/dist/application/runtime/workflows.js +6 -4
- package/dist/application/view/define.js +4 -6
- package/dist/application/view/frontend.d.ts +2 -2
- package/dist/application/view/index.d.ts +1 -1
- package/dist/application/view/route.d.ts +0 -14
- package/dist/application/view/route.js +1 -64
- package/dist/application/workflow/authoring.d.ts +3 -2
- package/dist/application/workflow/context.d.ts +8 -2
- package/dist/application/workflow/define.d.ts +4 -4
- package/dist/application/workflow/define.js +20 -4
- package/dist/application/workflow/durable.d.ts +87 -0
- package/dist/application/workflow/index.d.ts +3 -2
- package/dist/application/workflow/runner/inline.js +3 -4
- package/dist/application/workflow/runner/runner.d.ts +2 -2
- package/dist/application/workflow/step/output.d.ts +2 -0
- package/dist/application/workflow/step/output.js +73 -0
- package/dist/application/workflow/workflow.d.ts +13 -3
- package/dist/deployment/adapter/adapter.d.ts +55 -13
- package/dist/deployment/adapter/bundle/bundle.d.ts +36 -0
- package/dist/deployment/adapter/bundle/file.d.ts +10 -0
- package/dist/deployment/adapter/bundle/index.d.ts +2 -0
- package/dist/deployment/adapter/define.d.ts +4 -3
- package/dist/deployment/adapter/define.js +107 -23
- package/dist/deployment/adapter/index.d.ts +4 -3
- package/dist/deployment/adapter/index.js +1 -0
- package/dist/deployment/adapter/release/command.d.ts +33 -0
- package/dist/deployment/adapter/release/context.d.ts +94 -0
- package/dist/deployment/adapter/release/index.d.ts +4 -0
- package/dist/deployment/adapter/release/index.js +1 -0
- package/dist/deployment/adapter/release/list.d.ts +53 -0
- package/dist/deployment/adapter/release/list.js +1 -0
- package/dist/deployment/adapter/release/refusal.d.ts +10 -0
- package/dist/deployment/adapter/release/refusal.js +14 -0
- package/dist/deployment/adapter/release/result.d.ts +56 -0
- package/dist/deployment/adapter/release/result.js +1 -0
- package/dist/deployment/address/configuration.d.ts +95 -0
- package/dist/deployment/address/configuration.js +273 -0
- package/dist/deployment/address/fingerprint.d.ts +5 -0
- package/dist/deployment/address/fingerprint.js +27 -0
- package/dist/deployment/address/index.d.ts +5 -0
- package/dist/deployment/address/index.js +4 -0
- package/dist/deployment/address/label.d.ts +42 -0
- package/dist/deployment/address/label.js +80 -0
- package/dist/deployment/address/line.d.ts +29 -0
- package/dist/deployment/address/line.js +53 -0
- package/dist/deployment/address/record.d.ts +73 -0
- package/dist/deployment/address/record.js +138 -0
- package/dist/deployment/address/summary.d.ts +30 -0
- package/dist/deployment/address/summary.js +1 -0
- package/dist/deployment/address/vectors.d.ts +60 -0
- package/dist/deployment/address/vectors.js +517 -0
- package/dist/deployment/authoring.d.ts +0 -2
- package/dist/deployment/authoring.js +0 -1
- package/dist/deployment/build/build.d.ts +8 -2
- package/dist/deployment/build/compile.d.ts +4 -4
- package/dist/deployment/build/compile.js +19 -17
- package/dist/deployment/build/frontend/compilation.d.ts +2 -4
- package/dist/deployment/build/frontend/compilation.js +0 -5
- package/dist/deployment/build/frontend/digest.js +1 -5
- package/dist/deployment/build/index.d.ts +1 -0
- package/dist/deployment/build/index.js +1 -0
- package/dist/deployment/build/manifest.d.ts +59 -0
- package/dist/deployment/build/manifest.js +118 -0
- package/dist/deployment/build/material.d.ts +2 -2
- package/dist/deployment/build/material.js +28 -13
- package/dist/deployment/build/schema.d.ts +2 -2
- package/dist/deployment/deployment.d.ts +3 -2
- package/dist/deployment/environment.d.ts +6 -0
- package/dist/deployment/environment.js +6 -0
- package/dist/deployment/index.d.ts +4 -6
- package/dist/deployment/index.js +1 -2
- package/dist/deployment/release/addressing.d.ts +6 -5
- package/dist/deployment/release/addressing.js +2 -3
- package/dist/deployment/release/assemble.d.ts +6 -3
- package/dist/deployment/release/assemble.js +12 -10
- package/dist/deployment/release/release.d.ts +16 -5
- package/dist/deployment/release/seal.d.ts +14 -0
- package/dist/deployment/release/seal.js +22 -0
- package/dist/deployment/release/{publication → served}/callables.d.ts +2 -2
- package/dist/deployment/release/{publication → served}/callables.js +2 -2
- package/dist/deployment/release/served/index.d.ts +11 -0
- package/dist/deployment/release/served/index.js +26 -0
- package/dist/deployment/release/{publication → served}/views.d.ts +2 -2
- package/dist/deployment/release/{publication → served}/views.js +0 -1
- package/dist/deployment/runtime/admission.d.ts +2 -2
- package/dist/deployment/runtime/admission.js +5 -5
- package/dist/deployment/verify/index.d.ts +3 -4
- package/dist/deployment/verify/index.js +2 -3
- package/dist/deployment/verify/preflight/bundle.d.ts +18 -0
- package/dist/deployment/verify/preflight/bundle.js +71 -0
- package/dist/deployment/verify/preflight/index.d.ts +1 -12
- package/dist/deployment/verify/preflight/index.js +1 -12
- package/dist/deployment/verify/readiness/fetch.d.ts +13 -0
- package/dist/deployment/verify/readiness/fetch.js +26 -0
- package/dist/deployment/verify/readiness/identity.d.ts +3 -6
- package/dist/deployment/verify/readiness/identity.js +3 -3
- package/dist/deployment/verify/readiness/index.d.ts +15 -8
- package/dist/deployment/verify/readiness/index.js +25 -6
- package/dist/deployment/verify/readiness/release.d.ts +8 -0
- package/dist/deployment/verify/readiness/release.js +22 -0
- package/dist/deployment/worker/address.d.ts +26 -0
- package/dist/deployment/worker/address.js +43 -0
- package/dist/deployment/worker/build.d.ts +60 -0
- package/dist/deployment/worker/build.js +172 -0
- package/dist/deployment/worker/configuration.d.ts +73 -0
- package/dist/deployment/worker/configuration.js +165 -0
- package/dist/deployment/worker/content.d.ts +38 -0
- package/dist/deployment/worker/content.js +169 -0
- package/dist/deployment/worker/index.d.ts +29 -0
- package/dist/deployment/worker/index.js +29 -0
- package/dist/deployment/worker/limits.d.ts +30 -0
- package/dist/deployment/worker/limits.js +30 -0
- package/dist/deployment/worker/record.d.ts +29 -0
- package/dist/deployment/worker/record.js +69 -0
- package/dist/deployment/worker/request.d.ts +118 -0
- package/dist/deployment/worker/request.js +280 -0
- package/dist/deployment/worker/response.d.ts +101 -0
- package/dist/deployment/worker/response.js +207 -0
- package/dist/execution/identity/authentication.d.ts +33 -3
- package/dist/execution/identity/authentication.js +85 -40
- package/dist/execution/identity/callback.d.ts +16 -15
- package/dist/execution/identity/callback.js +21 -16
- package/dist/execution/identity/delivery.d.ts +6 -4
- package/dist/execution/identity/delivery.js +25 -20
- package/dist/execution/identity/identity.d.ts +17 -3
- package/dist/execution/identity/identity.js +12 -4
- package/dist/execution/identity/jwks.d.ts +5 -0
- package/dist/execution/identity/jwks.js +92 -102
- package/dist/execution/index.d.ts +4 -4
- package/dist/execution/index.js +2 -2
- package/dist/execution/invocation/admission/authentication.d.ts +11 -13
- package/dist/execution/invocation/admission/authentication.js +48 -44
- package/dist/execution/invocation/admission/authority.d.ts +28 -6
- package/dist/execution/invocation/admission/authority.js +9 -2
- package/dist/execution/invocation/admission/index.d.ts +2 -2
- package/dist/execution/invocation/admission/index.js +1 -1
- package/dist/execution/invocation/admission/input.d.ts +2 -2
- package/dist/execution/invocation/admission/input.js +16 -2
- package/dist/execution/invocation/dependency/bind.d.ts +3 -1
- package/dist/execution/invocation/dependency/bind.js +36 -16
- package/dist/execution/invocation/dispatch/context.d.ts +7 -6
- package/dist/execution/invocation/dispatch/context.js +17 -31
- package/dist/execution/invocation/dispatch/workflow.js +0 -4
- package/dist/execution/invocation/index.d.ts +2 -2
- package/dist/execution/invocation/index.js +1 -1
- package/dist/execution/invocation/integration/call.d.ts +2 -1
- package/dist/execution/invocation/integration/call.js +1 -1
- package/dist/execution/invocation/integration/clients.d.ts +1 -1
- package/dist/execution/invocation/invocation.js +49 -16
- package/dist/execution/invocation/result/errors.d.ts +0 -10
- package/dist/execution/invocation/result/errors.js +0 -17
- package/dist/execution/invocation/result/index.d.ts +2 -2
- package/dist/execution/invocation/result/index.js +1 -1
- package/dist/execution/invocation/result/project.js +41 -1
- package/dist/execution/node/serve.d.ts +2 -2
- package/dist/execution/node/serve.js +1 -1
- package/dist/execution/runtime/index.d.ts +1 -0
- package/dist/execution/runtime/index.js +1 -0
- package/dist/execution/runtime/load.d.ts +3 -3
- package/dist/execution/runtime/load.js +3 -2
- package/dist/execution/runtime/release.d.ts +17 -0
- package/dist/execution/runtime/release.js +7 -0
- package/dist/execution/serve.d.ts +10 -4
- package/dist/execution/serve.js +3 -0
- package/dist/execution/service/create.js +41 -7
- package/dist/execution/service/initialization.d.ts +4 -4
- package/dist/execution/service/initialization.js +23 -14
- package/dist/execution/service/release.d.ts +2 -2
- package/dist/execution/service/release.js +3 -2
- package/dist/execution/service/service.d.ts +14 -5
- package/dist/execution/service/serving/delivery.d.ts +5 -0
- package/dist/execution/service/{publication → serving}/delivery.js +4 -1
- package/dist/execution/service/{publication → serving}/index.d.ts +1 -1
- package/dist/execution/service/serving/installation.d.ts +4 -0
- package/dist/execution/service/serving/installation.js +9 -0
- package/dist/execution/service/serving/source.d.ts +11 -0
- package/dist/execution/service/serving/source.js +15 -0
- package/dist/execution/workflows/discovery.d.ts +14 -0
- package/dist/execution/workflows/discovery.js +151 -0
- package/dist/execution/workflows/engine.d.ts +52 -0
- package/dist/execution/workflows/engine.js +1 -0
- package/dist/execution/workflows/envelope.d.ts +12 -0
- package/dist/execution/workflows/envelope.js +46 -0
- package/dist/execution/workflows/failure.d.ts +11 -0
- package/dist/execution/workflows/failure.js +43 -0
- package/dist/execution/workflows/index.d.ts +4 -0
- package/dist/execution/workflows/index.js +3 -0
- package/dist/execution/workflows/options.d.ts +34 -0
- package/dist/execution/workflows/options.js +65 -0
- package/dist/execution/workflows/receiver.d.ts +21 -0
- package/dist/execution/workflows/receiver.js +92 -0
- package/dist/execution/workflows/route.d.ts +12 -0
- package/dist/execution/workflows/route.js +35 -0
- package/dist/execution/workflows/run.d.ts +22 -0
- package/dist/execution/workflows/run.js +223 -0
- package/dist/index.d.ts +4 -4
- package/dist/index.js +2 -2
- package/dist/platform/graph/alias.d.ts +1 -5
- package/dist/platform/graph/alias.js +1 -5
- package/dist/platform/graph/document/index.d.ts +1 -1
- package/dist/platform/graph/document/index.js +1 -1
- package/dist/platform/graph/index.d.ts +1 -1
- package/dist/platform/graph/index.js +1 -1
- package/dist/platform/release/index.d.ts +2 -0
- package/dist/platform/release/index.js +2 -0
- package/dist/platform/schema/callable-authoring.d.ts +21 -0
- package/dist/platform/schema/callable-authoring.js +27 -0
- package/dist/platform/schema/class-authoring.d.ts +61 -11
- package/dist/platform/schema/class-authoring.js +37 -4
- package/dist/platform/schema/class-icon-svg.d.ts +9 -0
- package/dist/platform/schema/class-icon-svg.js +29 -0
- package/dist/platform/schema/class-icon.d.ts +3 -8
- package/dist/platform/schema/class-icon.js +2 -29
- package/dist/platform/schema/index.d.ts +6 -4
- package/dist/platform/schema/index.js +2 -1
- package/dist/platform/schema/property.d.ts +5 -0
- package/dist/platform/schema/schema-authoring.d.ts +14 -7
- package/dist/platform/schema/schema-authoring.js +5 -1
- package/dist/platform/versioning/dependents.d.ts +18 -0
- package/dist/platform/versioning/dependents.js +15 -0
- package/dist/platform/versioning/index.d.ts +5 -0
- package/dist/platform/versioning/index.js +5 -0
- package/dist/platform/versioning/name.d.ts +38 -0
- package/dist/platform/versioning/name.js +58 -0
- package/dist/platform/versioning/reference.d.ts +48 -0
- package/dist/platform/versioning/reference.js +95 -0
- package/dist/platform/versioning/version.d.ts +72 -0
- package/dist/platform/versioning/version.js +98 -0
- package/dist/project/admit.js +1 -5
- package/dist/project/define.d.ts +4 -4
- package/dist/project/define.js +55 -35
- package/dist/project/index.d.ts +1 -1
- package/dist/project/install-command.d.ts +6 -0
- package/dist/project/install-command.js +9 -0
- package/dist/project/project.d.ts +10 -8
- package/dist/testing/dataset/define.d.ts +1 -1
- package/dist/testing/load.js +1 -1
- package/dist/tooling/cli/adapter-command.d.ts +35 -0
- package/dist/tooling/cli/adapter-command.js +66 -0
- package/dist/tooling/cli/arguments.d.ts +17 -6
- package/dist/tooling/cli/arguments.js +175 -52
- package/dist/tooling/cli/build.d.ts +55 -0
- package/dist/tooling/cli/build.js +77 -0
- package/dist/tooling/cli/bun.d.ts +0 -1
- package/dist/tooling/cli/bun.js +0 -7
- package/dist/tooling/cli/commit.d.ts +35 -0
- package/dist/tooling/cli/commit.js +235 -0
- package/dist/tooling/cli/deploy-mode.d.ts +26 -0
- package/dist/tooling/cli/deploy-mode.js +59 -0
- package/dist/tooling/cli/deploy-result.d.ts +80 -0
- package/dist/tooling/cli/deploy-result.js +64 -0
- package/dist/tooling/cli/diff/declared.d.ts +7 -0
- package/dist/tooling/cli/diff/declared.js +27 -0
- package/dist/tooling/cli/diff/index.d.ts +30 -0
- package/dist/tooling/cli/diff/index.js +58 -0
- package/dist/tooling/cli/diff/render.d.ts +15 -0
- package/dist/tooling/cli/diff/render.js +131 -0
- package/dist/tooling/cli/diff/report.d.ts +88 -0
- package/dist/tooling/cli/diff/report.js +154 -0
- package/dist/tooling/cli/dotenv.d.ts +2 -2
- package/dist/tooling/cli/dotenv.js +3 -33
- package/dist/tooling/cli/help.js +173 -60
- package/dist/tooling/cli/immutable-deployment.d.ts +83 -0
- package/dist/tooling/cli/immutable-deployment.js +135 -0
- package/dist/tooling/cli/index.d.ts +12 -4
- package/dist/tooling/cli/index.js +6 -3
- package/dist/tooling/cli/installed-on.d.ts +83 -0
- package/dist/tooling/cli/installed-on.js +156 -0
- package/dist/tooling/cli/list.d.ts +152 -0
- package/dist/tooling/cli/list.js +331 -0
- package/dist/tooling/cli/log.d.ts +5 -0
- package/dist/tooling/cli/log.js +9 -0
- package/dist/tooling/cli/orchestrate.d.ts +0 -6
- package/dist/tooling/cli/orchestrate.js +246 -90
- package/dist/tooling/cli/project.d.ts +3 -3
- package/dist/tooling/cli/publish/index.d.ts +81 -0
- package/dist/tooling/cli/publish/index.js +383 -0
- package/dist/tooling/cli/publish/report.d.ts +49 -0
- package/dist/tooling/cli/publish/report.js +15 -0
- package/dist/tooling/cli/registry/client.d.ts +121 -0
- package/dist/tooling/cli/registry/client.js +354 -0
- package/dist/tooling/cli/registry/error.d.ts +11 -0
- package/dist/tooling/cli/registry/error.js +17 -0
- package/dist/tooling/cli/registry/executable.d.ts +35 -0
- package/dist/tooling/cli/registry/executable.js +96 -0
- package/dist/tooling/cli/registry/index.d.ts +9 -0
- package/dist/tooling/cli/registry/index.js +8 -0
- package/dist/tooling/cli/registry/installations.d.ts +67 -0
- package/dist/tooling/cli/registry/installations.js +108 -0
- package/dist/tooling/cli/registry/process.d.ts +36 -0
- package/dist/tooling/cli/registry/process.js +119 -0
- package/dist/tooling/cli/secrets.d.ts +9 -0
- package/dist/tooling/cli/secrets.js +19 -0
- package/dist/tooling/cli/yank.d.ts +34 -0
- package/dist/tooling/cli/yank.js +32 -0
- package/dist/tooling/linter/implementations/source/callable-requirements.d.ts +1 -1
- package/dist/tooling/linter/implementations/source/callable-requirements.js +10 -10
- package/dist/tooling/linter/implementations/source/dependencies.js +12 -10
- package/dist/tooling/linter/implementations/source/global.js +1 -2
- package/dist/tooling/linter/implementations/source/mutations.js +17 -17
- package/dist/tooling/linter/implementations/source/providers.js +5 -5
- package/dist/tooling/linter/implementations/source/verifiers.js +0 -2
- package/dist/tooling/linter/implementations/source/views.js +2 -2
- package/dist/tooling/linter/policy/generated.js +14 -63
- package/dist/tooling/linter/requirements/registry.js +1 -6
- package/dist/tooling/packaging/declarations/ownership.js +1 -1
- package/dist/tooling/packaging/finalize.d.ts +1 -1
- package/dist/tooling/packaging/finalize.js +1 -1
- package/package.json +39 -13
- package/dist/application/application.d.ts +0 -28
- package/dist/application/query/execution/projection.d.ts +0 -3
- package/dist/application/query/execution/projection.js +0 -3
- package/dist/deployment/adapter/deploy/context.d.ts +0 -15
- package/dist/deployment/adapter/deploy/index.d.ts +0 -2
- package/dist/deployment/adapter/deploy/result.d.ts +0 -50
- package/dist/deployment/adapter/prepare/artifact.d.ts +0 -33
- package/dist/deployment/adapter/prepare/context.d.ts +0 -23
- package/dist/deployment/adapter/prepare/index.d.ts +0 -2
- package/dist/deployment/deploy.d.ts +0 -20
- package/dist/deployment/deploy.js +0 -31
- package/dist/deployment/release/publication/index.d.ts +0 -6
- package/dist/deployment/release/publication/index.js +0 -6
- package/dist/deployment/release/publication/manifest.d.ts +0 -3
- package/dist/deployment/release/publication/manifest.js +0 -5
- package/dist/deployment/release/publication/requirements.d.ts +0 -3
- package/dist/deployment/release/publication/requirements.js +0 -3
- package/dist/deployment/release/publication/seal.d.ts +0 -10
- package/dist/deployment/release/publication/seal.js +0 -39
- package/dist/deployment/verify/preflight/artifact.d.ts +0 -6
- package/dist/deployment/verify/preflight/artifact.js +0 -122
- package/dist/deployment/verify/preflight/publication.d.ts +0 -4
- package/dist/deployment/verify/preflight/publication.js +0 -14
- package/dist/deployment/verify/readiness/deployment.d.ts +0 -3
- package/dist/deployment/verify/readiness/deployment.js +0 -151
- package/dist/deployment/verify/readiness/publication.d.ts +0 -11
- package/dist/deployment/verify/readiness/publication.js +0 -41
- package/dist/execution/service/errors.d.ts +0 -3
- package/dist/execution/service/errors.js +0 -3
- package/dist/execution/service/publication/delivery.d.ts +0 -2
- package/dist/execution/service/publication/installation.d.ts +0 -3
- package/dist/execution/service/publication/installation.js +0 -8
- package/dist/execution/service/publication/source.d.ts +0 -3
- package/dist/execution/service/publication/source.js +0 -11
- package/dist/platform/publication/index.d.ts +0 -2
- package/dist/platform/publication/index.js +0 -2
- package/dist/tooling/cli/astrale/authority.d.ts +0 -5
- package/dist/tooling/cli/astrale/authority.js +0 -11
- package/dist/tooling/cli/astrale/executable.d.ts +0 -2
- package/dist/tooling/cli/astrale/executable.js +0 -47
- package/dist/tooling/cli/astrale/failure.d.ts +0 -6
- package/dist/tooling/cli/astrale/failure.js +0 -48
- package/dist/tooling/cli/astrale/instance.d.ts +0 -11
- package/dist/tooling/cli/astrale/instance.js +0 -52
- package/dist/tooling/cli/astrale/process.d.ts +0 -13
- package/dist/tooling/cli/astrale/process.js +0 -94
- package/dist/tooling/cli/astrale/version.d.ts +0 -18
- package/dist/tooling/cli/astrale/version.js +0 -55
- package/dist/tooling/cli/credential.d.ts +0 -2
- package/dist/tooling/cli/credential.js +0 -57
- package/dist/tooling/cli/deprecations.d.ts +0 -9
- package/dist/tooling/cli/deprecations.js +0 -15
- package/dist/tooling/cli/development/candidate.d.ts +0 -25
- package/dist/tooling/cli/development/candidate.js +0 -176
- package/dist/tooling/cli/development/deployment.d.ts +0 -16
- package/dist/tooling/cli/development/deployment.js +0 -39
- package/dist/tooling/cli/development/develop.d.ts +0 -11
- package/dist/tooling/cli/development/develop.js +0 -243
- package/dist/tooling/cli/development/lease.d.ts +0 -18
- package/dist/tooling/cli/development/lease.js +0 -163
- package/dist/tooling/cli/development/lifecycle.d.ts +0 -9
- package/dist/tooling/cli/development/lifecycle.js +0 -43
- package/dist/tooling/cli/development/project-imports.d.ts +0 -22
- package/dist/tooling/cli/development/project-imports.js +0 -39
- package/dist/tooling/cli/development/project-lock.d.ts +0 -16
- package/dist/tooling/cli/development/project-lock.js +0 -41
- package/dist/tooling/cli/development/rebuild.d.ts +0 -13
- package/dist/tooling/cli/development/rebuild.js +0 -58
- package/dist/tooling/cli/development/release-evidence.d.ts +0 -4
- package/dist/tooling/cli/development/release-evidence.js +0 -10
- package/dist/tooling/cli/development/report.d.ts +0 -6
- package/dist/tooling/cli/development/report.js +0 -14
- package/dist/tooling/cli/development/session-file.d.ts +0 -53
- package/dist/tooling/cli/development/session-file.js +0 -337
- package/dist/tooling/cli/development/source-watch.d.ts +0 -14
- package/dist/tooling/cli/development/source-watch.js +0 -140
- package/dist/tooling/cli/development/sources.d.ts +0 -7
- package/dist/tooling/cli/development/sources.js +0 -48
- package/dist/tooling/cli/development/target-lock.d.ts +0 -16
- package/dist/tooling/cli/development/target-lock.js +0 -68
- package/dist/tooling/cli/development/view.d.ts +0 -28
- package/dist/tooling/cli/development/view.js +0 -151
- package/dist/tooling/cli/environment-release.d.ts +0 -21
- package/dist/tooling/cli/environment-release.js +0 -46
- package/dist/tooling/cli/evidence.d.ts +0 -11
- package/dist/tooling/cli/evidence.js +0 -53
- package/dist/tooling/cli/installation/index.d.ts +0 -2
- package/dist/tooling/cli/installation/index.js +0 -1
- package/dist/tooling/cli/installation/observation.d.ts +0 -10
- package/dist/tooling/cli/installation/observation.js +0 -44
- package/dist/tooling/cli/installation/reconcile.d.ts +0 -32
- package/dist/tooling/cli/installation/reconcile.js +0 -122
- package/dist/tooling/linter/implementations/source/migrations.d.ts +0 -2
- package/dist/tooling/linter/implementations/source/migrations.js +0 -113
- package/dist/tooling/linter/qualification/index.d.ts +0 -10
- package/dist/tooling/linter/qualification/index.js +0 -2
- package/dist/tooling/linter/qualification/query-fixtures.d.ts +0 -2
- package/dist/tooling/linter/qualification/query-fixtures.js +0 -68
- package/dist/tooling/linter/qualification/runner.d.ts +0 -3
- package/dist/tooling/linter/qualification/runner.js +0 -6
- /package/dist/application/{application.js → domain.js} +0 -0
- /package/dist/{deployment/adapter/deploy/context.js → application/workflow/durable.js} +0 -0
- /package/dist/deployment/adapter/{deploy/index.js → bundle/bundle.js} +0 -0
- /package/dist/deployment/adapter/{deploy/result.js → bundle/file.js} +0 -0
- /package/dist/deployment/adapter/{prepare → bundle}/index.js +0 -0
- /package/dist/deployment/adapter/{prepare/artifact.js → release/command.js} +0 -0
- /package/dist/deployment/adapter/{prepare → release}/context.js +0 -0
- /package/dist/deployment/release/{publication → served}/routes.d.ts +0 -0
- /package/dist/deployment/release/{publication → served}/routes.js +0 -0
- /package/dist/execution/service/{publication → serving}/index.js +0 -0
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { Digest } from '@astrale-os/kernel-protocol/artifact';
|
|
2
|
+
import type { BuildDigest } from '../build/manifest.js';
|
|
3
|
+
import type { DeploymentConfiguration } from './configuration.js';
|
|
4
|
+
/**
|
|
5
|
+
* Every deployment label: an optional readable part, the 16-character line fingerprint and the
|
|
6
|
+
* 16-character content, both lower-case base32. A legacy provider name (a UUID, a stable Worker
|
|
7
|
+
* name) never matches, so one dispatcher tells the two apart by the label alone. The pattern
|
|
8
|
+
* bounds no length; `parseDeploymentLabel` also refuses a label longer than the 57 characters
|
|
9
|
+
* `deploymentLabel` can produce.
|
|
10
|
+
*/
|
|
11
|
+
export declare const DEPLOYMENT_LABEL: RegExp;
|
|
12
|
+
export interface DeploymentLabelParts {
|
|
13
|
+
readonly line: string;
|
|
14
|
+
readonly fingerprint: string;
|
|
15
|
+
readonly content: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* The 16-character content of one deployment: the first 80 bits of
|
|
19
|
+
* `sha256(utf8(buildDigest) ‖ 0x00 ‖ utf8(deploymentConfigurationDigest(configuration)))` in
|
|
20
|
+
* lower-case base32. It covers the build and the frozen configuration, never a secret: one address
|
|
21
|
+
* serves one release, and a changed variable gives another address.
|
|
22
|
+
*/
|
|
23
|
+
export declare function deploymentContent(build: BuildDigest, configuration: DeploymentConfiguration): string;
|
|
24
|
+
/** The content of a build and a full configuration digest, as a deployment record holds them. */
|
|
25
|
+
export declare function contentOf(build: BuildDigest, configuration: Digest): string;
|
|
26
|
+
/**
|
|
27
|
+
* The DNS label of one deployment, `<line>-<content>`: at most 57 characters, below the 63 of a
|
|
28
|
+
* DNS label.
|
|
29
|
+
*/
|
|
30
|
+
export declare function deploymentLabel(line: string, content: string): string;
|
|
31
|
+
/**
|
|
32
|
+
* The URL of one deployment under the host's routing domain. It is the issuer of the release the
|
|
33
|
+
* deployment serves, and no other deployment ever answers at it. The label is admitted as
|
|
34
|
+
* `parseDeploymentLabel` admits it, so its host never holds a label longer than 57 characters.
|
|
35
|
+
*/
|
|
36
|
+
export declare function deploymentUrl(label: string, routingDomain: string): string;
|
|
37
|
+
/**
|
|
38
|
+
* Split a deployment label into its line, the line fingerprint and its content. It admits exactly
|
|
39
|
+
* the labels `deploymentLabel` produces: `DEPLOYMENT_LABEL`, and at most 57 characters, so a line
|
|
40
|
+
* of at most 40.
|
|
41
|
+
*/
|
|
42
|
+
export declare function parseDeploymentLabel(label: string): DeploymentLabelParts;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { deploymentConfigurationDigest } from './configuration.js';
|
|
2
|
+
import { first80 } from './fingerprint.js';
|
|
3
|
+
/**
|
|
4
|
+
* Every deployment label: an optional readable part, the 16-character line fingerprint and the
|
|
5
|
+
* 16-character content, both lower-case base32. A legacy provider name (a UUID, a stable Worker
|
|
6
|
+
* name) never matches, so one dispatcher tells the two apart by the label alone. The pattern
|
|
7
|
+
* bounds no length; `parseDeploymentLabel` also refuses a label longer than the 57 characters
|
|
8
|
+
* `deploymentLabel` can produce.
|
|
9
|
+
*/
|
|
10
|
+
export const DEPLOYMENT_LABEL = /^(?:[a-z0-9]+(?:-[a-z0-9]+)*-)?[a-z2-7]{16}-[a-z2-7]{16}$/u;
|
|
11
|
+
const LINE = /^(?:[a-z0-9]+(?:-[a-z0-9]+)*-)?[a-z2-7]{16}$/u;
|
|
12
|
+
const CONTENT = /^[a-z2-7]{16}$/u;
|
|
13
|
+
const DIGEST = /^sha256:[0-9a-f]{64}$/u;
|
|
14
|
+
const DNS_NAME = /^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/u;
|
|
15
|
+
const MAXIMUM_LINE_LENGTH = 40;
|
|
16
|
+
/** A line, a dash and the content: below the 63 characters of a DNS label. */
|
|
17
|
+
const MAXIMUM_LABEL_LENGTH = MAXIMUM_LINE_LENGTH + 17;
|
|
18
|
+
const MAXIMUM_HOST_LENGTH = 253;
|
|
19
|
+
/**
|
|
20
|
+
* The 16-character content of one deployment: the first 80 bits of
|
|
21
|
+
* `sha256(utf8(buildDigest) ‖ 0x00 ‖ utf8(deploymentConfigurationDigest(configuration)))` in
|
|
22
|
+
* lower-case base32. It covers the build and the frozen configuration, never a secret: one address
|
|
23
|
+
* serves one release, and a changed variable gives another address.
|
|
24
|
+
*/
|
|
25
|
+
export function deploymentContent(build, configuration) {
|
|
26
|
+
return contentOf(build, deploymentConfigurationDigest(configuration));
|
|
27
|
+
}
|
|
28
|
+
/** The content of a build and a full configuration digest, as a deployment record holds them. */
|
|
29
|
+
export function contentOf(build, configuration) {
|
|
30
|
+
return first80(digest(build, 'Build digest'), digest(configuration, 'Configuration digest'));
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* The DNS label of one deployment, `<line>-<content>`: at most 57 characters, below the 63 of a
|
|
34
|
+
* DNS label.
|
|
35
|
+
*/
|
|
36
|
+
export function deploymentLabel(line, content) {
|
|
37
|
+
if (typeof line !== 'string' || line.length > MAXIMUM_LINE_LENGTH || !LINE.test(line)) {
|
|
38
|
+
throw new TypeError('Deployment line is invalid.');
|
|
39
|
+
}
|
|
40
|
+
if (typeof content !== 'string' || !CONTENT.test(content)) {
|
|
41
|
+
throw new TypeError('Deployment content is invalid.');
|
|
42
|
+
}
|
|
43
|
+
return `${line}-${content}`;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* The URL of one deployment under the host's routing domain. It is the issuer of the release the
|
|
47
|
+
* deployment serves, and no other deployment ever answers at it. The label is admitted as
|
|
48
|
+
* `parseDeploymentLabel` admits it, so its host never holds a label longer than 57 characters.
|
|
49
|
+
*/
|
|
50
|
+
export function deploymentUrl(label, routingDomain) {
|
|
51
|
+
parseDeploymentLabel(label);
|
|
52
|
+
if (typeof routingDomain !== 'string' || !DNS_NAME.test(routingDomain)) {
|
|
53
|
+
throw new TypeError('Deployment routing domain must be a lower-case DNS name.');
|
|
54
|
+
}
|
|
55
|
+
const host = `${label}.${routingDomain}`;
|
|
56
|
+
if (host.length > MAXIMUM_HOST_LENGTH) {
|
|
57
|
+
throw new TypeError('Deployment host exceeds the length of a DNS name.');
|
|
58
|
+
}
|
|
59
|
+
return `https://${host}`;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Split a deployment label into its line, the line fingerprint and its content. It admits exactly
|
|
63
|
+
* the labels `deploymentLabel` produces: `DEPLOYMENT_LABEL`, and at most 57 characters, so a line
|
|
64
|
+
* of at most 40.
|
|
65
|
+
*/
|
|
66
|
+
export function parseDeploymentLabel(label) {
|
|
67
|
+
if (typeof label !== 'string' ||
|
|
68
|
+
label.length > MAXIMUM_LABEL_LENGTH ||
|
|
69
|
+
!DEPLOYMENT_LABEL.test(label)) {
|
|
70
|
+
throw new TypeError('Deployment label is invalid.');
|
|
71
|
+
}
|
|
72
|
+
const line = label.slice(0, -17);
|
|
73
|
+
return Object.freeze({ line, fingerprint: line.slice(-16), content: label.slice(-16) });
|
|
74
|
+
}
|
|
75
|
+
function digest(input, label) {
|
|
76
|
+
if (typeof input !== 'string' || !DIGEST.test(input)) {
|
|
77
|
+
throw new TypeError(`${label} is invalid.`);
|
|
78
|
+
}
|
|
79
|
+
return input;
|
|
80
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How a line reads. Platform lines are `readable` (`agencies-staging-354iwg4avm6wdmrs`); tenant
|
|
3
|
+
* lines are `opaque`, their fingerprint alone, so a hosted address says nothing of whose code it
|
|
4
|
+
* serves. Both derive from the same inputs, never from stored state.
|
|
5
|
+
*/
|
|
6
|
+
export type LineAddressing = 'readable' | 'opaque';
|
|
7
|
+
export interface DeploymentLineInput {
|
|
8
|
+
readonly origin: string;
|
|
9
|
+
readonly environment: string;
|
|
10
|
+
readonly addressing: LineAddressing;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* The 16-character fingerprint of the line of `(origin, environment)`: the first 80 bits of
|
|
14
|
+
* `sha256(utf8(origin) ‖ 0x00 ‖ utf8(environment))` in lower-case base32. It alone makes a line
|
|
15
|
+
* unique; the readable part in front of it is cosmetic.
|
|
16
|
+
*/
|
|
17
|
+
export declare function lineFingerprint(origin: string, environment: string): string;
|
|
18
|
+
/**
|
|
19
|
+
* The cosmetic part of a readable line: the first label of the origin (12 characters at most) and
|
|
20
|
+
* the environment (10 at most), lower case, each run of characters outside `[a-z0-9]` replaced by
|
|
21
|
+
* one dash and dashes removed at both edges. Neither part is ever empty: an origin label and an
|
|
22
|
+
* environment name both start with a letter or a digit.
|
|
23
|
+
*/
|
|
24
|
+
export declare function readablePart(origin: string, environment: string): string;
|
|
25
|
+
/**
|
|
26
|
+
* The line every deployment of one origin in one environment shares: `<readable>-<fingerprint>`
|
|
27
|
+
* when readable, the fingerprint alone when opaque. At most 40 characters.
|
|
28
|
+
*/
|
|
29
|
+
export declare function deploymentLine(input: DeploymentLineInput): string;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { patterns } from '@astrale-os/kernel-dsl/v1/addressing';
|
|
2
|
+
import { ENVIRONMENT_NAME } from '../environment.js';
|
|
3
|
+
import { first80 } from './fingerprint.js';
|
|
4
|
+
/**
|
|
5
|
+
* The 16-character fingerprint of the line of `(origin, environment)`: the first 80 bits of
|
|
6
|
+
* `sha256(utf8(origin) ‖ 0x00 ‖ utf8(environment))` in lower-case base32. It alone makes a line
|
|
7
|
+
* unique; the readable part in front of it is cosmetic.
|
|
8
|
+
*/
|
|
9
|
+
export function lineFingerprint(origin, environment) {
|
|
10
|
+
admitLine(origin, environment);
|
|
11
|
+
return first80(origin, environment);
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* The cosmetic part of a readable line: the first label of the origin (12 characters at most) and
|
|
15
|
+
* the environment (10 at most), lower case, each run of characters outside `[a-z0-9]` replaced by
|
|
16
|
+
* one dash and dashes removed at both edges. Neither part is ever empty: an origin label and an
|
|
17
|
+
* environment name both start with a letter or a digit.
|
|
18
|
+
*/
|
|
19
|
+
export function readablePart(origin, environment) {
|
|
20
|
+
admitLine(origin, environment);
|
|
21
|
+
return `${normalize(origin.split('.')[0], 12)}-${normalize(environment, 10)}`;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* The line every deployment of one origin in one environment shares: `<readable>-<fingerprint>`
|
|
25
|
+
* when readable, the fingerprint alone when opaque. At most 40 characters.
|
|
26
|
+
*/
|
|
27
|
+
export function deploymentLine(input) {
|
|
28
|
+
if (input === null || typeof input !== 'object') {
|
|
29
|
+
throw new TypeError('Deployment line input is invalid.');
|
|
30
|
+
}
|
|
31
|
+
const fingerprint = lineFingerprint(input.origin, input.environment);
|
|
32
|
+
if (input.addressing === 'opaque')
|
|
33
|
+
return fingerprint;
|
|
34
|
+
if (input.addressing !== 'readable') {
|
|
35
|
+
throw new TypeError('Deployment line addressing must be readable or opaque.');
|
|
36
|
+
}
|
|
37
|
+
return `${readablePart(input.origin, input.environment)}-${fingerprint}`;
|
|
38
|
+
}
|
|
39
|
+
function admitLine(origin, environment) {
|
|
40
|
+
if (typeof origin !== 'string' || !patterns.origin.test(origin)) {
|
|
41
|
+
throw new TypeError('Deployment origin must be a Domain origin.');
|
|
42
|
+
}
|
|
43
|
+
if (typeof environment !== 'string' || !ENVIRONMENT_NAME.test(environment)) {
|
|
44
|
+
throw new TypeError('Deployment environment must be a project environment name.');
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
function normalize(input, length) {
|
|
48
|
+
return input
|
|
49
|
+
.toLowerCase()
|
|
50
|
+
.replace(/[^a-z0-9]+/gu, '-')
|
|
51
|
+
.slice(0, length)
|
|
52
|
+
.replace(/^-+|-+$/gu, '');
|
|
53
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import type { Revision } from '@astrale-os/kernel-dsl/v1/addressing';
|
|
2
|
+
import type { Digest } from '@astrale-os/kernel-protocol/artifact';
|
|
3
|
+
import type { ReleaseDigest } from '@astrale-os/kernel-protocol/release';
|
|
4
|
+
import type { BuildDigest } from '../build/manifest.js';
|
|
5
|
+
export declare const DEPLOYMENT_RECORD_FORMAT = "astrale.deployment-record";
|
|
6
|
+
export declare const DEPLOYMENT_RECORD_VERSION = 1;
|
|
7
|
+
/**
|
|
8
|
+
* The media type of a `DeploymentRecordV1` document: what a Domain deployer publishes it with, and
|
|
9
|
+
* what a host serves it with at `/.well-known/astrale/deployment.json`.
|
|
10
|
+
*/
|
|
11
|
+
export declare const DEPLOYMENT_RECORD_MEDIA_TYPE = "application/vnd.astrale.deployment-record+json;v=1";
|
|
12
|
+
/** The commit a deployment was built from, as the deployer declared it. */
|
|
13
|
+
export interface DeploymentCommitV1 {
|
|
14
|
+
/** The full commit SHA, 40 hexadecimal digits in either case; git prints it in lower case. */
|
|
15
|
+
readonly sha: string;
|
|
16
|
+
/** Whether the tree had changes the commit does not hold. */
|
|
17
|
+
readonly dirty: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* The last release tag before the commit, as `git describe` finds it: its canonical version (the
|
|
20
|
+
* `v` or `<component>-v` prefix of the tag removed) and the number of commits since.
|
|
21
|
+
*/
|
|
22
|
+
readonly base?: {
|
|
23
|
+
readonly version: string;
|
|
24
|
+
readonly distance: number;
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* What one deploy declares about the deployment it made. The host stores it as declared, beside
|
|
29
|
+
* what it knows itself, and anyone holding the deployment URL may read it: it is the inventory a
|
|
30
|
+
* listing and the cleanup read, never something to install from. Any extension is a new record
|
|
31
|
+
* version.
|
|
32
|
+
*/
|
|
33
|
+
export interface DeploymentRecordV1 {
|
|
34
|
+
readonly format: typeof DEPLOYMENT_RECORD_FORMAT;
|
|
35
|
+
readonly version: typeof DEPLOYMENT_RECORD_VERSION;
|
|
36
|
+
readonly origin: string;
|
|
37
|
+
readonly environment: string;
|
|
38
|
+
readonly releaseDigest: ReleaseDigest;
|
|
39
|
+
readonly buildDigest: BuildDigest;
|
|
40
|
+
readonly schemaRevision: Revision;
|
|
41
|
+
/** The full digest of the frozen configuration. */
|
|
42
|
+
readonly configuration: Digest;
|
|
43
|
+
/** The provider script, named by the deployment label. */
|
|
44
|
+
readonly providerScript: string;
|
|
45
|
+
readonly commit: DeploymentCommitV1 | null;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Admit one deployment record exactly. Its provider script must be the label its own fields
|
|
49
|
+
* derive: the line of its origin and environment, readable or opaque, and the content of its build
|
|
50
|
+
* and configuration digests. A record that claims another deployment's code is refused.
|
|
51
|
+
*
|
|
52
|
+
* A host admits the record a deploy declares with this function before it stores it, so every
|
|
53
|
+
* stored record decodes. A reader that still meets a record this function refuses lists that
|
|
54
|
+
* deployment from what the host knows, leaving out what is not canonical as a deployment name
|
|
55
|
+
* does, and never fails the whole listing over it.
|
|
56
|
+
*/
|
|
57
|
+
export declare function acceptDeploymentRecord(input: unknown): DeploymentRecordV1;
|
|
58
|
+
/** The document of one record: what a Domain deployer publishes and a host serves verbatim. */
|
|
59
|
+
export interface DeploymentRecordDocument {
|
|
60
|
+
readonly contentType: string;
|
|
61
|
+
readonly bytes: Uint8Array;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* The document of one record, as a Domain deployer publishes it: the record admitted, as the
|
|
65
|
+
* UTF-8 bytes of its RFC 8785 canonical JSON, with `DEPLOYMENT_RECORD_MEDIA_TYPE`. One record has
|
|
66
|
+
* one document, byte for byte, whoever writes it.
|
|
67
|
+
*/
|
|
68
|
+
export declare function encodeDeploymentRecord(record: DeploymentRecordV1): DeploymentRecordDocument;
|
|
69
|
+
/**
|
|
70
|
+
* Admit the document of one record: `DEPLOYMENT_RECORD_MEDIA_TYPE`, and UTF-8 JSON whose value
|
|
71
|
+
* `acceptDeploymentRecord` admits. Anything else throws.
|
|
72
|
+
*/
|
|
73
|
+
export declare function decodeDeploymentRecord(document: DeploymentRecordDocument): DeploymentRecordV1;
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { patterns } from '@astrale-os/kernel-dsl/v1/addressing';
|
|
2
|
+
import { json } from '@astrale-os/kernel-dsl/value';
|
|
3
|
+
import { isVersion } from '../../platform/versioning/version.js';
|
|
4
|
+
import { ENVIRONMENT_NAME } from '../environment.js';
|
|
5
|
+
import { contentOf, parseDeploymentLabel } from './label.js';
|
|
6
|
+
import { deploymentLine } from './line.js';
|
|
7
|
+
export const DEPLOYMENT_RECORD_FORMAT = 'astrale.deployment-record';
|
|
8
|
+
export const DEPLOYMENT_RECORD_VERSION = 1;
|
|
9
|
+
/**
|
|
10
|
+
* The media type of a `DeploymentRecordV1` document: what a Domain deployer publishes it with, and
|
|
11
|
+
* what a host serves it with at `/.well-known/astrale/deployment.json`.
|
|
12
|
+
*/
|
|
13
|
+
export const DEPLOYMENT_RECORD_MEDIA_TYPE = 'application/vnd.astrale.deployment-record+json;v=1';
|
|
14
|
+
const DIGEST = /^sha256:[0-9a-f]{64}$/u;
|
|
15
|
+
/** The full hexadecimal SHA-1 of a commit, in either case, as a deployment name reads it. */
|
|
16
|
+
const SHA = /^[0-9a-f]{40}$/iu;
|
|
17
|
+
const ADDRESSINGS = ['readable', 'opaque'];
|
|
18
|
+
/**
|
|
19
|
+
* Admit one deployment record exactly. Its provider script must be the label its own fields
|
|
20
|
+
* derive: the line of its origin and environment, readable or opaque, and the content of its build
|
|
21
|
+
* and configuration digests. A record that claims another deployment's code is refused.
|
|
22
|
+
*
|
|
23
|
+
* A host admits the record a deploy declares with this function before it stores it, so every
|
|
24
|
+
* stored record decodes. A reader that still meets a record this function refuses lists that
|
|
25
|
+
* deployment from what the host knows, leaving out what is not canonical as a deployment name
|
|
26
|
+
* does, and never fails the whole listing over it.
|
|
27
|
+
*/
|
|
28
|
+
export function acceptDeploymentRecord(input) {
|
|
29
|
+
const record = exact(input, [
|
|
30
|
+
'format',
|
|
31
|
+
'version',
|
|
32
|
+
'origin',
|
|
33
|
+
'environment',
|
|
34
|
+
'releaseDigest',
|
|
35
|
+
'buildDigest',
|
|
36
|
+
'schemaRevision',
|
|
37
|
+
'configuration',
|
|
38
|
+
'providerScript',
|
|
39
|
+
'commit',
|
|
40
|
+
]);
|
|
41
|
+
if (record.format !== DEPLOYMENT_RECORD_FORMAT || record.version !== DEPLOYMENT_RECORD_VERSION) {
|
|
42
|
+
invalid('format');
|
|
43
|
+
}
|
|
44
|
+
if (typeof record.origin !== 'string' || !patterns.origin.test(record.origin))
|
|
45
|
+
invalid('origin');
|
|
46
|
+
if (typeof record.environment !== 'string' || !ENVIRONMENT_NAME.test(record.environment)) {
|
|
47
|
+
invalid('environment');
|
|
48
|
+
}
|
|
49
|
+
const origin = record.origin;
|
|
50
|
+
const environment = record.environment;
|
|
51
|
+
const buildDigest = digest(record.buildDigest, 'buildDigest');
|
|
52
|
+
const configuration = digest(record.configuration, 'configuration');
|
|
53
|
+
if (typeof record.providerScript !== 'string')
|
|
54
|
+
invalid('providerScript');
|
|
55
|
+
const label = parseDeploymentLabel(record.providerScript);
|
|
56
|
+
const lines = ADDRESSINGS.map((addressing) => deploymentLine({ origin, environment, addressing }));
|
|
57
|
+
if (!lines.includes(label.line) || label.content !== contentOf(buildDigest, configuration)) {
|
|
58
|
+
throw new TypeError('Deployment record provider script is not the label its fields derive.');
|
|
59
|
+
}
|
|
60
|
+
return Object.freeze({
|
|
61
|
+
format: DEPLOYMENT_RECORD_FORMAT,
|
|
62
|
+
version: DEPLOYMENT_RECORD_VERSION,
|
|
63
|
+
origin,
|
|
64
|
+
environment,
|
|
65
|
+
releaseDigest: digest(record.releaseDigest, 'releaseDigest'),
|
|
66
|
+
buildDigest,
|
|
67
|
+
schemaRevision: digest(record.schemaRevision, 'schemaRevision'),
|
|
68
|
+
configuration,
|
|
69
|
+
providerScript: record.providerScript,
|
|
70
|
+
commit: record.commit === null ? null : commit(record.commit),
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* The document of one record, as a Domain deployer publishes it: the record admitted, as the
|
|
75
|
+
* UTF-8 bytes of its RFC 8785 canonical JSON, with `DEPLOYMENT_RECORD_MEDIA_TYPE`. One record has
|
|
76
|
+
* one document, byte for byte, whoever writes it.
|
|
77
|
+
*/
|
|
78
|
+
export function encodeDeploymentRecord(record) {
|
|
79
|
+
return Object.freeze({
|
|
80
|
+
contentType: DEPLOYMENT_RECORD_MEDIA_TYPE,
|
|
81
|
+
bytes: new TextEncoder().encode(json.serialize(acceptDeploymentRecord(record))),
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Admit the document of one record: `DEPLOYMENT_RECORD_MEDIA_TYPE`, and UTF-8 JSON whose value
|
|
86
|
+
* `acceptDeploymentRecord` admits. Anything else throws.
|
|
87
|
+
*/
|
|
88
|
+
export function decodeDeploymentRecord(document) {
|
|
89
|
+
if (document?.contentType !== DEPLOYMENT_RECORD_MEDIA_TYPE) {
|
|
90
|
+
throw new TypeError('Deployment record document has another media type.');
|
|
91
|
+
}
|
|
92
|
+
let value;
|
|
93
|
+
try {
|
|
94
|
+
value = JSON.parse(new TextDecoder('utf-8', { fatal: true, ignoreBOM: false }).decode(document.bytes));
|
|
95
|
+
}
|
|
96
|
+
catch (cause) {
|
|
97
|
+
throw new TypeError('Deployment record document is not UTF-8 JSON.', { cause });
|
|
98
|
+
}
|
|
99
|
+
return acceptDeploymentRecord(value);
|
|
100
|
+
}
|
|
101
|
+
function commit(input) {
|
|
102
|
+
const based = input !== null && typeof input === 'object' && Object.hasOwn(input, 'base');
|
|
103
|
+
const value = exact(input, based ? ['sha', 'dirty', 'base'] : ['sha', 'dirty'], 'commit');
|
|
104
|
+
if (typeof value.sha !== 'string' || !SHA.test(value.sha))
|
|
105
|
+
invalid('commit');
|
|
106
|
+
if (typeof value.dirty !== 'boolean')
|
|
107
|
+
invalid('commit');
|
|
108
|
+
if (!based)
|
|
109
|
+
return Object.freeze({ sha: value.sha, dirty: value.dirty });
|
|
110
|
+
const base = exact(value.base, ['version', 'distance'], 'commit');
|
|
111
|
+
if (!isVersion(base.version))
|
|
112
|
+
invalid('commit');
|
|
113
|
+
if (!Number.isSafeInteger(base.distance) || base.distance < 0)
|
|
114
|
+
invalid('commit');
|
|
115
|
+
return Object.freeze({
|
|
116
|
+
sha: value.sha,
|
|
117
|
+
dirty: value.dirty,
|
|
118
|
+
base: Object.freeze({ version: base.version, distance: base.distance }),
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
function exact(input, keys, member = 'members') {
|
|
122
|
+
if (input === null ||
|
|
123
|
+
typeof input !== 'object' ||
|
|
124
|
+
Array.isArray(input) ||
|
|
125
|
+
Reflect.ownKeys(input).length !== keys.length ||
|
|
126
|
+
keys.some((key) => !Object.hasOwn(input, key))) {
|
|
127
|
+
invalid(member);
|
|
128
|
+
}
|
|
129
|
+
return input;
|
|
130
|
+
}
|
|
131
|
+
function digest(input, member) {
|
|
132
|
+
if (typeof input !== 'string' || !DIGEST.test(input))
|
|
133
|
+
invalid(member);
|
|
134
|
+
return input;
|
|
135
|
+
}
|
|
136
|
+
function invalid(member) {
|
|
137
|
+
throw new TypeError(`Deployment record has invalid ${member}.`);
|
|
138
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { DeploymentRecordV1 } from './record.js';
|
|
2
|
+
/**
|
|
3
|
+
* What a host knows of one immutable deployment beside the record its deployer declared: where it
|
|
4
|
+
* answers, who owns its line and its lifecycle. It names a deployment by its label and URL, never
|
|
5
|
+
* by a provider version id. An adapter's `list` returns these; the host owns every field but
|
|
6
|
+
* `record`, which it stores as declared.
|
|
7
|
+
*/
|
|
8
|
+
export interface DeploymentSummaryV1 {
|
|
9
|
+
/** The host's own identifier of the deployment (a graph node id on Admin's Services, the label on a dispatch namespace). */
|
|
10
|
+
readonly id: string;
|
|
11
|
+
readonly url: string;
|
|
12
|
+
readonly label: string;
|
|
13
|
+
readonly line: string;
|
|
14
|
+
/** Who owns the line: a node path on Admin's Services, the dispatch namespace's name on Cloudflare. */
|
|
15
|
+
readonly owner: string;
|
|
16
|
+
readonly state: 'deploying' | 'active' | 'retiring' | 'retired' | 'failed';
|
|
17
|
+
/**
|
|
18
|
+
* `published` on Admin's Services, which keeps every deployment until it is retired. Absent on a
|
|
19
|
+
* dispatch namespace, which keeps no retention.
|
|
20
|
+
*/
|
|
21
|
+
readonly retention?: 'published';
|
|
22
|
+
/** When the host created it; absent when the host no longer knows (its script is gone). */
|
|
23
|
+
readonly createdAt?: string;
|
|
24
|
+
readonly retiredAt?: string;
|
|
25
|
+
/** `withdrawn` once its owner retired it. */
|
|
26
|
+
readonly retirement?: 'withdrawn';
|
|
27
|
+
/** The RFC 7638 thumbprint of its key; absent when the host no longer knows (its script is gone). */
|
|
28
|
+
readonly signingKeyId?: string;
|
|
29
|
+
readonly record: DeploymentRecordV1;
|
|
30
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type { Digest } from '@astrale-os/kernel-protocol/artifact';
|
|
2
|
+
import type { BuildManifestV1 } from '../build/manifest.js';
|
|
3
|
+
import type { FrozenConfigurationV1 } from './configuration.js';
|
|
4
|
+
import type { LineAddressing } from './line.js';
|
|
5
|
+
/** One line: what an origin and an environment give, readable and opaque. */
|
|
6
|
+
export interface LineVectorV1 {
|
|
7
|
+
readonly name: string;
|
|
8
|
+
readonly origin: string;
|
|
9
|
+
readonly environment: string;
|
|
10
|
+
readonly readable: string;
|
|
11
|
+
readonly fingerprint: string;
|
|
12
|
+
readonly lines: {
|
|
13
|
+
readonly readable: string;
|
|
14
|
+
readonly opaque: string;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* One portable Worker upload as a host receives it. Module and asset bytes are the UTF-8 encoding
|
|
19
|
+
* of their `text`.
|
|
20
|
+
*/
|
|
21
|
+
export interface UploadVectorV1 {
|
|
22
|
+
readonly origin: string;
|
|
23
|
+
readonly revision: Digest;
|
|
24
|
+
readonly bundle: Digest;
|
|
25
|
+
readonly entry: string;
|
|
26
|
+
readonly modules: readonly {
|
|
27
|
+
readonly name: string;
|
|
28
|
+
readonly text: string;
|
|
29
|
+
}[];
|
|
30
|
+
readonly assets?: readonly {
|
|
31
|
+
readonly path: string;
|
|
32
|
+
readonly text: string;
|
|
33
|
+
}[];
|
|
34
|
+
}
|
|
35
|
+
/** One deployment: an upload and a configuration on a line, and everything they derive. */
|
|
36
|
+
export interface DeploymentVectorV1 {
|
|
37
|
+
readonly name: string;
|
|
38
|
+
readonly origin: string;
|
|
39
|
+
readonly environment: string;
|
|
40
|
+
readonly addressing: LineAddressing;
|
|
41
|
+
readonly routingDomain: string;
|
|
42
|
+
readonly upload: UploadVectorV1;
|
|
43
|
+
readonly configuration: FrozenConfigurationV1;
|
|
44
|
+
readonly expected: {
|
|
45
|
+
readonly manifest: BuildManifestV1;
|
|
46
|
+
readonly buildDigest: Digest;
|
|
47
|
+
readonly configurationDigest: Digest;
|
|
48
|
+
readonly line: string;
|
|
49
|
+
readonly content: string;
|
|
50
|
+
readonly label: string;
|
|
51
|
+
readonly url: string;
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
export interface DeploymentAddressVectorsV1 {
|
|
55
|
+
readonly format: 'astrale.deployment.address-vectors';
|
|
56
|
+
readonly version: 1;
|
|
57
|
+
readonly lines: readonly LineVectorV1[];
|
|
58
|
+
readonly deployments: readonly DeploymentVectorV1[];
|
|
59
|
+
}
|
|
60
|
+
export declare const DEPLOYMENT_ADDRESS_VECTORS: DeploymentAddressVectorsV1;
|