@astrale-os/sdk 0.6.0-beta.2 → 0.6.0-beta.21
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 +74 -14
- 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 +17 -8
- package/dist/application/action/define.d.ts +3 -3
- package/dist/application/action/index.d.ts +1 -1
- package/dist/application/define.d.ts +5 -5
- package/dist/application/define.js +13 -13
- package/dist/application/dependency/index.d.ts +1 -1
- package/dist/application/dependency/invoker.d.ts +11 -6
- package/dist/application/domain.d.ts +28 -0
- package/dist/application/index.d.ts +3 -3
- package/dist/application/index.js +1 -1
- 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/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 +2 -0
- package/dist/application/runtime/workflows.js +5 -0
- 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 +3 -3
- package/dist/application/workflow/define.js +19 -3
- package/dist/application/workflow/durable.d.ts +83 -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 +12 -0
- package/dist/deployment/adapter/adapter.d.ts +59 -11
- 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 +25 -3
- package/dist/deployment/adapter/define.js +101 -24
- package/dist/deployment/adapter/index.d.ts +6 -3
- package/dist/deployment/adapter/index.js +1 -0
- package/dist/deployment/adapter/legacy/adapter.d.ts +40 -0
- package/dist/deployment/adapter/{deploy → legacy/deploy}/context.d.ts +6 -2
- package/dist/deployment/adapter/legacy/deploy/index.d.ts +2 -0
- package/dist/deployment/adapter/legacy/deploy/index.js +1 -0
- package/dist/deployment/adapter/legacy/deploy/result.d.ts +89 -0
- package/dist/deployment/adapter/legacy/deploy/result.js +1 -0
- package/dist/deployment/adapter/legacy/index.d.ts +24 -0
- package/dist/deployment/adapter/legacy/index.js +1 -0
- package/dist/deployment/adapter/legacy/prepare/artifact.d.ts +43 -0
- package/dist/deployment/adapter/legacy/prepare/artifact.js +1 -0
- package/dist/deployment/adapter/legacy/prepare/context.d.ts +33 -0
- package/dist/deployment/adapter/legacy/prepare/context.js +1 -0
- package/dist/deployment/adapter/legacy/prepare/index.d.ts +2 -0
- package/dist/deployment/adapter/legacy/prepare/index.js +1 -0
- package/dist/deployment/adapter/release/context.d.ts +95 -0
- package/dist/deployment/adapter/release/context.js +1 -0
- package/dist/deployment/adapter/release/index.d.ts +3 -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 +83 -0
- package/dist/deployment/address/configuration.js +262 -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 +5 -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 +52 -0
- package/dist/deployment/address/record.js +104 -0
- package/dist/deployment/address/summary.d.ts +57 -0
- package/dist/deployment/address/summary.js +117 -0
- package/dist/deployment/address/vectors.d.ts +60 -0
- package/dist/deployment/address/vectors.js +517 -0
- package/dist/deployment/build/build.d.ts +2 -2
- package/dist/deployment/build/compile.d.ts +4 -4
- package/dist/deployment/build/compile.js +17 -17
- 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.js +2 -2
- package/dist/deployment/build/schema.d.ts +2 -2
- package/dist/deployment/deploy.d.ts +10 -10
- package/dist/deployment/deploy.js +3 -3
- package/dist/deployment/deployment.d.ts +9 -4
- package/dist/deployment/environment.d.ts +6 -0
- package/dist/deployment/environment.js +6 -0
- package/dist/deployment/index.d.ts +4 -4
- package/dist/deployment/index.js +1 -1
- package/dist/deployment/release/addressing.d.ts +9 -1
- package/dist/deployment/release/assemble.d.ts +6 -3
- package/dist/deployment/release/assemble.js +12 -10
- package/dist/deployment/release/index.d.ts +2 -0
- package/dist/deployment/release/index.js +2 -0
- package/dist/deployment/release/legacy/admission.d.ts +3 -0
- package/dist/deployment/release/legacy/admission.js +8 -0
- package/dist/deployment/release/legacy/assemble.d.ts +5 -0
- package/dist/deployment/release/legacy/assemble.js +20 -0
- package/dist/deployment/release/legacy/index.d.ts +35 -0
- package/dist/deployment/release/legacy/index.js +34 -0
- package/dist/deployment/release/legacy/release.d.ts +12 -0
- package/dist/deployment/release/legacy/release.js +1 -0
- package/dist/deployment/release/{publication → legacy}/seal.d.ts +3 -3
- package/dist/deployment/release/legacy/seal.js +17 -0
- package/dist/deployment/release/release.d.ts +16 -5
- package/dist/deployment/release/runtime.d.ts +2 -0
- package/dist/deployment/release/runtime.js +2 -0
- 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 +12 -0
- package/dist/deployment/release/served/index.js +22 -0
- package/dist/deployment/release/{publication → served}/views.d.ts +2 -2
- package/dist/deployment/runtime/admission.d.ts +2 -2
- package/dist/deployment/runtime/admission.js +5 -5
- package/dist/deployment/verify/index.d.ts +2 -1
- package/dist/deployment/verify/index.js +1 -0
- package/dist/deployment/verify/preflight/artifact.d.ts +1 -1
- 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 +2 -1
- package/dist/deployment/verify/preflight/index.js +1 -0
- package/dist/deployment/verify/preflight/publication.d.ts +2 -2
- package/dist/deployment/verify/preflight/publication.js +4 -3
- package/dist/deployment/verify/readiness/deployment.js +7 -15
- 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 +11 -7
- package/dist/deployment/verify/readiness/index.js +15 -4
- package/dist/deployment/verify/readiness/legacy/index.d.ts +2 -0
- package/dist/deployment/verify/readiness/legacy/index.js +2 -0
- package/dist/deployment/verify/readiness/legacy/publication.d.ts +12 -0
- package/dist/deployment/verify/readiness/legacy/publication.js +23 -0
- package/dist/deployment/verify/readiness/release.d.ts +8 -0
- package/dist/deployment/verify/readiness/release.js +22 -0
- package/dist/execution/identity/authentication.d.ts +23 -2
- package/dist/execution/identity/authentication.js +64 -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 +11 -4
- package/dist/execution/identity/delivery.js +47 -20
- package/dist/execution/identity/identity.d.ts +18 -3
- package/dist/execution/identity/identity.js +8 -4
- package/dist/execution/identity/jwks.js +57 -12
- package/dist/execution/index.d.ts +4 -2
- package/dist/execution/index.js +2 -1
- package/dist/execution/invocation/admission/authentication.d.ts +3 -8
- package/dist/execution/invocation/admission/authentication.js +10 -24
- package/dist/execution/invocation/admission/authority.d.ts +15 -8
- package/dist/execution/invocation/admission/authority.js +5 -0
- 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 +1 -1
- package/dist/execution/invocation/dependency/bind.js +35 -14
- package/dist/execution/invocation/dispatch/context.d.ts +2 -1
- package/dist/execution/invocation/dispatch/context.js +1 -1
- package/dist/execution/invocation/invocation.js +58 -16
- 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 +22 -0
- package/dist/execution/runtime/release.js +14 -0
- package/dist/execution/serve.d.ts +10 -4
- package/dist/execution/serve.js +3 -0
- package/dist/execution/service/create.js +39 -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 +15 -5
- package/dist/execution/service/serving/delivery.d.ts +6 -0
- package/dist/execution/service/{publication → serving}/delivery.js +5 -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/legacy/index.d.ts +15 -0
- package/dist/execution/service/serving/legacy/index.js +19 -0
- package/dist/execution/service/serving/source.d.ts +18 -0
- package/dist/execution/service/serving/source.js +19 -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 +40 -0
- package/dist/execution/workflows/options.js +83 -0
- package/dist/execution/workflows/receiver.d.ts +22 -0
- package/dist/execution/workflows/receiver.js +99 -0
- package/dist/execution/workflows/route.d.ts +14 -0
- package/dist/execution/workflows/route.js +40 -0
- package/dist/execution/workflows/run.d.ts +22 -0
- package/dist/execution/workflows/run.js +211 -0
- package/dist/index.d.ts +3 -3
- package/dist/index.js +1 -1
- package/dist/platform/release/index.d.ts +27 -0
- package/dist/platform/release/index.js +27 -0
- package/dist/platform/schema/index.d.ts +2 -1
- package/dist/platform/schema/property-input.d.ts +15 -0
- package/dist/platform/schema/property-input.js +1 -0
- package/dist/platform/schema/property.d.ts +5 -0
- 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 +2 -2
- 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 +10 -0
- package/dist/project/install-command.js +13 -0
- package/dist/project/project.d.ts +10 -8
- package/dist/testing/dataset/builder.d.ts +3 -3
- package/dist/testing/dataset/define.d.ts +1 -1
- package/dist/testing/load.js +1 -1
- package/dist/tooling/cli/arguments.d.ts +10 -5
- package/dist/tooling/cli/arguments.js +123 -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 +82 -0
- package/dist/tooling/cli/deploy-mode.js +135 -0
- package/dist/tooling/cli/deploy-result.d.ts +85 -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 +176 -59
- 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 +10 -4
- package/dist/tooling/cli/index.js +5 -3
- package/dist/tooling/cli/installed-on.d.ts +83 -0
- package/dist/tooling/cli/installed-on.js +156 -0
- package/dist/tooling/cli/legacy/deploy-result.d.ts +28 -0
- package/dist/tooling/cli/legacy/deploy-result.js +37 -0
- package/dist/tooling/cli/legacy/stable-target-adapter.d.ts +21 -0
- package/dist/tooling/cli/legacy/stable-target-adapter.js +14 -0
- package/dist/tooling/cli/legacy/stable-target-deploy.d.ts +40 -0
- package/dist/tooling/cli/legacy/stable-target-deploy.js +102 -0
- package/dist/tooling/cli/legacy/uploaded-build.d.ts +11 -0
- package/dist/tooling/cli/legacy/uploaded-build.js +22 -0
- package/dist/tooling/cli/list.d.ts +154 -0
- package/dist/tooling/cli/list.js +381 -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 +236 -88
- package/dist/tooling/cli/project.d.ts +3 -3
- package/dist/tooling/cli/publish/index.d.ts +73 -0
- package/dist/tooling/cli/publish/index.js +346 -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 +114 -0
- package/dist/tooling/cli/registry/client.js +346 -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 +29 -0
- package/dist/tooling/cli/registry/executable.js +90 -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 -1
- 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/views.js +2 -2
- package/dist/tooling/linter/policy/generated.js +16 -16
- 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 +32 -11
- package/dist/application/application.d.ts +0 -28
- 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/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.js +0 -39
- package/dist/deployment/verify/readiness/publication.d.ts +0 -11
- package/dist/deployment/verify/readiness/publication.js +0 -41
- 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/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/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 → legacy/adapter.js} +0 -0
- /package/dist/deployment/adapter/{prepare → legacy/deploy}/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/deployment/release/{publication → served}/views.js +0 -0
- /package/dist/execution/service/{publication → serving}/index.js +0 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Canonical `DomainRelease` v4 wire contract and admission owned by the Astrale platform: the
|
|
3
|
+
* document a deployment serves at `release.json`, its release digest and `ReleaseRef`.
|
|
4
|
+
*/
|
|
5
|
+
export * from '@astrale-os/kernel-protocol/release';
|
|
6
|
+
/**
|
|
7
|
+
* The Kernel's Publication v2/v3 codec (`@astrale-os/kernel-protocol/release/legacy`): `accept`,
|
|
8
|
+
* `seal`, `encode`, `url`/`PATH`, the bundle helpers, `PublicationError` and Delivery v1, which
|
|
9
|
+
* stable targets and pre-v4 Kernels still serve and read.
|
|
10
|
+
*
|
|
11
|
+
* @deprecated Read and seal `DomainRelease` v4 with this module's root exports.
|
|
12
|
+
*
|
|
13
|
+
* Short-term consumers, which took it from the removed `@astrale-os/sdk/publication`:
|
|
14
|
+
* - cli `src/lib/domain-publication.ts` and its test (C1a: `accept`, `PATH`, `PublicationError`);
|
|
15
|
+
* - admin `domain/providers/http-publication/resolver.ts`,
|
|
16
|
+
* `domain/providers/remote-kernel/instance-gateway.ts`,
|
|
17
|
+
* `domain/providers/scaleway/machine-provider.ts`, `domain/scripts/admin-bootstrap/cli.ts`,
|
|
18
|
+
* `domain/scripts/e2e/install-domain-set.ts`, their tests and two `worker/src` tests, which also
|
|
19
|
+
* seal v2/v3 fixtures (A10a);
|
|
20
|
+
* - domains issues `tests/deployment/archived-errors.test.ts` (SV16).
|
|
21
|
+
*
|
|
22
|
+
* Removal, in a breaking SDK release: once those consumers no longer import it (the CLI and Admin
|
|
23
|
+
* read `release.json`), at the latest with the Kernel folder it re-exports, which the Kernel
|
|
24
|
+
* removes once no supported Kernel predates v4, no installation pins a v2/v3 document and no
|
|
25
|
+
* stable Worker serves one (D10).
|
|
26
|
+
*/
|
|
27
|
+
export { legacy } from '@astrale-os/kernel-protocol/release';
|
|
@@ -13,9 +13,10 @@ export { error } from './error.js';
|
|
|
13
13
|
export type { DeclaredErrorDefinition, DeclaredErrorFamily } from './error.js';
|
|
14
14
|
export { classIcon } from './class-icon.js';
|
|
15
15
|
export type { ClassIcon } from './class-icon.js';
|
|
16
|
+
export type { StoredPropertyInputOf } from './property-input.js';
|
|
16
17
|
export type { CallablePolicyBuilder, CallablePolicyContext, CallableProjection, AuthoredMethodProjection, AuthoredPropertyProjection, ClassIdentityProjection, ClassOwnerProjection, CoreEdge, CoreEndpoint, CoreNode, DefinedSchema, DirectedEdgeClass, ClassReferenceProjection, ClassProjection, FunctionProjection, EdgeClass, Function, Method, MethodProjection, Lazy, NodeClass, Policy, PolicyExistsContext, PolicyNodeBinder, PolicyPatternContext, Property, PropertyProjection, ResolvedDomainOfInput, View, } from '@astrale-os/kernel-dsl/v1/builder';
|
|
17
18
|
export type { Array, Object, Value } from '@astrale-os/kernel-dsl/value';
|
|
18
|
-
export type { ClassKind, DirectedEdgeContract, EdgeClassPolicies, NodeClassDefinition, PolicyCheckObject, PolicyObjectRef, PropertyFacet, StateTopology, UndirectedEdgeContract, } from '@astrale-os/kernel-dsl/v1/language';
|
|
19
|
+
export type { CallableExecution, ClassKind, DirectedEdgeContract, EdgeClassPolicies, NodeClassDefinition, PolicyCheckObject, PolicyObjectRef, PropertyFacet, StateTopology, UndirectedEdgeContract, } from '@astrale-os/kernel-dsl/v1/language';
|
|
19
20
|
export type { DomainSchema } from '@astrale-os/kernel-dsl/v1/schema';
|
|
20
21
|
/** Kernel-owned Schema values used by authored product Schemas and graph operations. */
|
|
21
22
|
export { AuthorityOperationOrder, AuthorityOperations, AuthorityRelations, KernelRootFunctions, OperationCore, operationOf, } from '@astrale-os/kernel-core/schema';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ResolvedPropertyCollection } from '@astrale-os/kernel-dsl/v1/language';
|
|
2
|
+
type StoredValueOf<Property> = Property extends {
|
|
3
|
+
readonly __value?: infer Value;
|
|
4
|
+
} ? Value : never;
|
|
5
|
+
/** Values already held by graph Properties, including a blob's Ref rather than its write receipt. */
|
|
6
|
+
export type StoredPropertyInputOf<Class> = Class extends {
|
|
7
|
+
readonly properties: infer Collection;
|
|
8
|
+
} ? Collection extends {
|
|
9
|
+
readonly byKey: infer ByKey;
|
|
10
|
+
} ? Readonly<{
|
|
11
|
+
[Key in keyof ByKey]?: StoredValueOf<ByKey[Key]>;
|
|
12
|
+
} & {
|
|
13
|
+
[Name in Exclude<keyof Collection, keyof ResolvedPropertyCollection>]?: StoredValueOf<Collection[Name]>;
|
|
14
|
+
}> : never : never;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -3,6 +3,11 @@ import { type Property as CanonicalProperty, type ValueSchemaInput } from '@astr
|
|
|
3
3
|
export interface PropertyOptions {
|
|
4
4
|
readonly required?: boolean;
|
|
5
5
|
readonly description?: string;
|
|
6
|
+
/**
|
|
7
|
+
* `create` freezes the value when its node or edge is created. `once` admits one write while the
|
|
8
|
+
* value is absent; neither can be changed or unset afterwards, only removed with the element.
|
|
9
|
+
*/
|
|
10
|
+
readonly immutable?: 'create' | 'once';
|
|
6
11
|
}
|
|
7
12
|
/** Keep canonical generic inference: ordinary properties carry no state machine. */
|
|
8
13
|
export type AuthoredProperty<Schema extends ValueSchemaInput, Options extends PropertyOptions = Record<never, never>> = CanonicalProperty<Schema, Options, never>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { Revision } from '@astrale-os/kernel-dsl/v1/addressing';
|
|
2
|
+
import { type Version } from './version.js';
|
|
3
|
+
/**
|
|
4
|
+
* The highest stable, non-yanked version of a dependent Domain whose dependencies contain the target
|
|
5
|
+
* exactly, by origin and revision: the version to install beside that dependency. Semver is never a
|
|
6
|
+
* compatibility rule; only the exact revision a release was built against is.
|
|
7
|
+
*/
|
|
8
|
+
export declare function compatibleDependentVersion(index: readonly {
|
|
9
|
+
readonly version: Version;
|
|
10
|
+
readonly yanked: boolean;
|
|
11
|
+
readonly dependencies: readonly {
|
|
12
|
+
readonly origin: string;
|
|
13
|
+
readonly revision: Revision;
|
|
14
|
+
}[];
|
|
15
|
+
}[], target: {
|
|
16
|
+
readonly origin: string;
|
|
17
|
+
readonly revision: Revision;
|
|
18
|
+
}): Version | undefined;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import semver from 'semver';
|
|
2
|
+
import { isStable } from './version.js';
|
|
3
|
+
/**
|
|
4
|
+
* The highest stable, non-yanked version of a dependent Domain whose dependencies contain the target
|
|
5
|
+
* exactly, by origin and revision: the version to install beside that dependency. Semver is never a
|
|
6
|
+
* compatibility rule; only the exact revision a release was built against is.
|
|
7
|
+
*/
|
|
8
|
+
export function compatibleDependentVersion(index, target) {
|
|
9
|
+
const compatible = index
|
|
10
|
+
.filter(({ version, yanked, dependencies }) => !yanked &&
|
|
11
|
+
isStable(version) &&
|
|
12
|
+
dependencies.some(({ origin, revision }) => origin === target.origin && revision === target.revision))
|
|
13
|
+
.map(({ version }) => version);
|
|
14
|
+
return semver.rsort(compatible)[0];
|
|
15
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** Semver policy of Domain versions, shared by `diff`, `publish` and install resolution. */
|
|
2
|
+
export { compatibleDependentVersion } from './dependents.js';
|
|
3
|
+
export { deploymentName } from './name.js';
|
|
4
|
+
export { parseReference, resolveVersion, type Reference } from './reference.js';
|
|
5
|
+
export { acceptVersion, baselineVersion, effectiveLevel, judgeVersion, minimumVersion, type BumpLevel, type PublishedVersion, type Version, type VersionVerdict, } from './version.js';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** Semver policy of Domain versions, shared by `diff`, `publish` and install resolution. */
|
|
2
|
+
export { compatibleDependentVersion } from './dependents.js';
|
|
3
|
+
export { deploymentName } from './name.js';
|
|
4
|
+
export { parseReference, resolveVersion } from './reference.js';
|
|
5
|
+
export { acceptVersion, baselineVersion, effectiveLevel, judgeVersion, minimumVersion, } from './version.js';
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { Digest } from '@astrale-os/kernel-protocol/artifact';
|
|
2
|
+
/**
|
|
3
|
+
* The computed, never stored, name of one deployment. A version naming its release names it
|
|
4
|
+
* (`1.5.0`); a version naming its build elsewhere names it in its environment (`1.5.0 · staging`).
|
|
5
|
+
* Otherwise its recorded commit describes it from the last release tag, like `git describe` and Go
|
|
6
|
+
* pseudo-versions (`1.4.2 + 7 commits · a1b2c3d · staging`). A modified tree suffixes the commit
|
|
7
|
+
* token with `-dirty` and keeps the base and the environment (`a1b2c3d-dirty · staging`), as
|
|
8
|
+
* `git describe --dirty` does. When several published versions name one release or build, the
|
|
9
|
+
* highest that is not yanked names it, else the highest yanked one. Every name but a release's
|
|
10
|
+
* carries its environment, and listings print the name as returned, never shortened.
|
|
11
|
+
*
|
|
12
|
+
* The deployer declares the record and anyone may read it, so only the `DeploymentCommitV1` shape
|
|
13
|
+
* enters the name. A base enters only as a canonical version, the release tag without its `v` or
|
|
14
|
+
* `<component>-v` prefix, with a non-negative integer distance. A commit whose SHA is not 40
|
|
15
|
+
* hexadecimal digits names a plain preview, and the commit token is always printed in lower case,
|
|
16
|
+
* like `git describe`. An environment outside the `defineProject` grammar is rendered as `?`, so no
|
|
17
|
+
* record can put control characters or a ` · ` of its own in the name. Likewise only canonical
|
|
18
|
+
* published versions name a deployment. A deployment named without its digests (one whose record
|
|
19
|
+
* is not admitted) is never named by a published version.
|
|
20
|
+
*/
|
|
21
|
+
export declare function deploymentName(deployment: {
|
|
22
|
+
readonly environment: string;
|
|
23
|
+
readonly releaseDigest?: Digest;
|
|
24
|
+
readonly buildDigest?: Digest;
|
|
25
|
+
readonly commit: {
|
|
26
|
+
readonly sha: string;
|
|
27
|
+
readonly dirty: boolean;
|
|
28
|
+
readonly base?: {
|
|
29
|
+
readonly version: string;
|
|
30
|
+
readonly distance: number;
|
|
31
|
+
};
|
|
32
|
+
} | null;
|
|
33
|
+
}, publications: readonly {
|
|
34
|
+
readonly version: string;
|
|
35
|
+
readonly releaseDigest: Digest;
|
|
36
|
+
readonly buildDigest: Digest;
|
|
37
|
+
readonly yanked: boolean;
|
|
38
|
+
}[]): string;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import semver from 'semver';
|
|
2
|
+
import { ENVIRONMENT_NAME } from '../../deployment/environment.js';
|
|
3
|
+
import { isVersion } from './version.js';
|
|
4
|
+
/** A commit as `DeploymentCommitV1` records it: the full hexadecimal SHA-1, in either case. */
|
|
5
|
+
const SHA = /^[0-9a-f]{40}$/iu;
|
|
6
|
+
/** Stands for an environment outside the project environment-name grammar. */
|
|
7
|
+
const UNKNOWN_ENVIRONMENT = '?';
|
|
8
|
+
/**
|
|
9
|
+
* The computed, never stored, name of one deployment. A version naming its release names it
|
|
10
|
+
* (`1.5.0`); a version naming its build elsewhere names it in its environment (`1.5.0 · staging`).
|
|
11
|
+
* Otherwise its recorded commit describes it from the last release tag, like `git describe` and Go
|
|
12
|
+
* pseudo-versions (`1.4.2 + 7 commits · a1b2c3d · staging`). A modified tree suffixes the commit
|
|
13
|
+
* token with `-dirty` and keeps the base and the environment (`a1b2c3d-dirty · staging`), as
|
|
14
|
+
* `git describe --dirty` does. When several published versions name one release or build, the
|
|
15
|
+
* highest that is not yanked names it, else the highest yanked one. Every name but a release's
|
|
16
|
+
* carries its environment, and listings print the name as returned, never shortened.
|
|
17
|
+
*
|
|
18
|
+
* The deployer declares the record and anyone may read it, so only the `DeploymentCommitV1` shape
|
|
19
|
+
* enters the name. A base enters only as a canonical version, the release tag without its `v` or
|
|
20
|
+
* `<component>-v` prefix, with a non-negative integer distance. A commit whose SHA is not 40
|
|
21
|
+
* hexadecimal digits names a plain preview, and the commit token is always printed in lower case,
|
|
22
|
+
* like `git describe`. An environment outside the `defineProject` grammar is rendered as `?`, so no
|
|
23
|
+
* record can put control characters or a ` · ` of its own in the name. Likewise only canonical
|
|
24
|
+
* published versions name a deployment. A deployment named without its digests (one whose record
|
|
25
|
+
* is not admitted) is never named by a published version.
|
|
26
|
+
*/
|
|
27
|
+
export function deploymentName(deployment, publications) {
|
|
28
|
+
const { commit } = deployment;
|
|
29
|
+
const environment = typeof deployment.environment === 'string' && ENVIRONMENT_NAME.test(deployment.environment)
|
|
30
|
+
? deployment.environment
|
|
31
|
+
: UNKNOWN_ENVIRONMENT;
|
|
32
|
+
const release = highest(publications.filter(({ releaseDigest }) => deployment.releaseDigest !== undefined && releaseDigest === deployment.releaseDigest));
|
|
33
|
+
if (release !== undefined)
|
|
34
|
+
return release;
|
|
35
|
+
const build = highest(publications.filter(({ buildDigest }) => deployment.buildDigest !== undefined && buildDigest === deployment.buildDigest));
|
|
36
|
+
if (build !== undefined)
|
|
37
|
+
return `${build} · ${environment}`;
|
|
38
|
+
if (commit === null || typeof commit.sha !== 'string' || !SHA.test(commit.sha)) {
|
|
39
|
+
return `preview · ${environment}`;
|
|
40
|
+
}
|
|
41
|
+
const sha = `${commit.sha.slice(0, 7).toLowerCase()}${commit.dirty === true ? '-dirty' : ''}`;
|
|
42
|
+
const base = describeBase(commit.base);
|
|
43
|
+
return base === undefined ? `${sha} · ${environment}` : `${base} · ${sha} · ${environment}`;
|
|
44
|
+
}
|
|
45
|
+
function describeBase(base) {
|
|
46
|
+
if (base === undefined || !isVersion(base.version))
|
|
47
|
+
return undefined;
|
|
48
|
+
const { version, distance } = base;
|
|
49
|
+
if (!Number.isSafeInteger(distance) || distance < 0)
|
|
50
|
+
return undefined;
|
|
51
|
+
return distance === 0 ? version : `${version} + ${distance} commit${distance === 1 ? '' : 's'}`;
|
|
52
|
+
}
|
|
53
|
+
function highest(publications) {
|
|
54
|
+
const versions = (yanked) => publications
|
|
55
|
+
.filter((publication) => publication.yanked === yanked && isVersion(publication.version))
|
|
56
|
+
.map(({ version }) => version);
|
|
57
|
+
return semver.rsort(versions(false))[0] ?? semver.rsort(versions(true))[0];
|
|
58
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { type PublishedVersion, type Version } from './version.js';
|
|
2
|
+
/**
|
|
3
|
+
* One install reference. The syntax decides: a version goes to the registry, a deployment URL is
|
|
4
|
+
* installed as is, without any lookup.
|
|
5
|
+
*/
|
|
6
|
+
export type Reference = {
|
|
7
|
+
readonly kind: 'url';
|
|
8
|
+
readonly url: string;
|
|
9
|
+
} | {
|
|
10
|
+
readonly kind: 'exact';
|
|
11
|
+
readonly origin: string;
|
|
12
|
+
readonly version: Version;
|
|
13
|
+
} | {
|
|
14
|
+
readonly kind: 'line';
|
|
15
|
+
readonly origin: string;
|
|
16
|
+
readonly line: `${number}.${number}`;
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Parse `<origin>@<major>.<minor>.<patch>[-<pre>]`, `<origin>@<major>.<minor>` or a deployment URL.
|
|
20
|
+
* Ranges are not references: `@1`, `^1.5` and `1.5.x` are refused, since only the exact version and
|
|
21
|
+
* the highest stable version of one minor line are ever resolved. A URL with credentials is refused:
|
|
22
|
+
* `https://issues.astrale.ai@1.5.0` would otherwise name the host `1.5.0`, not a version.
|
|
23
|
+
*
|
|
24
|
+
* A deployment URL is returned as written, so it must already be the URL the Kernel fetches: one the
|
|
25
|
+
* URL parser keeps as is, up to the `/` of an empty path. Whitespace and control characters (which
|
|
26
|
+
* the parser strips), an upper-case host, a default port or a missing `//` host are refused, as are a
|
|
27
|
+
* query and a fragment, which no deployment URL carries.
|
|
28
|
+
*/
|
|
29
|
+
export declare function parseReference(input: string): Reference;
|
|
30
|
+
/**
|
|
31
|
+
* Translate a version reference into one published version. An exact reference names any published
|
|
32
|
+
* version, a pre-release or a yanked one included (the caller warns on yanked). A line resolves to
|
|
33
|
+
* its highest stable version that is not yanked.
|
|
34
|
+
*
|
|
35
|
+
* A reference built from data rather than by `parseReference` is checked the same way: an exact
|
|
36
|
+
* version must be canonical and a line must be `<major>.<minor>`, so `1` never resolves as a major
|
|
37
|
+
* range and `1.5.3` never as an exact pin. Anything else throws a `TypeError`.
|
|
38
|
+
*/
|
|
39
|
+
export declare function resolveVersion(published: readonly PublishedVersion[], reference: Exclude<Reference, {
|
|
40
|
+
kind: 'url';
|
|
41
|
+
}>): {
|
|
42
|
+
readonly kind: 'resolved';
|
|
43
|
+
readonly version: Version;
|
|
44
|
+
readonly yanked: boolean;
|
|
45
|
+
} | {
|
|
46
|
+
readonly kind: 'unresolved';
|
|
47
|
+
readonly reason: 'unknown-version' | 'no-stable-match' | 'yanked-only';
|
|
48
|
+
};
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { patterns } from '@astrale-os/kernel-dsl/v1/addressing';
|
|
2
|
+
import semver from 'semver';
|
|
3
|
+
import { acceptVersion, isStable } from './version.js';
|
|
4
|
+
const URL_SCHEMES = ['https://', 'http://'];
|
|
5
|
+
const MAJOR = /^(?:0|[1-9]\d*)$/u;
|
|
6
|
+
const LINE = /^(?:0|[1-9]\d*)\.(?:0|[1-9]\d*)$/u;
|
|
7
|
+
/**
|
|
8
|
+
* Parse `<origin>@<major>.<minor>.<patch>[-<pre>]`, `<origin>@<major>.<minor>` or a deployment URL.
|
|
9
|
+
* Ranges are not references: `@1`, `^1.5` and `1.5.x` are refused, since only the exact version and
|
|
10
|
+
* the highest stable version of one minor line are ever resolved. A URL with credentials is refused:
|
|
11
|
+
* `https://issues.astrale.ai@1.5.0` would otherwise name the host `1.5.0`, not a version.
|
|
12
|
+
*
|
|
13
|
+
* A deployment URL is returned as written, so it must already be the URL the Kernel fetches: one the
|
|
14
|
+
* URL parser keeps as is, up to the `/` of an empty path. Whitespace and control characters (which
|
|
15
|
+
* the parser strips), an upper-case host, a default port or a missing `//` host are refused, as are a
|
|
16
|
+
* query and a fragment, which no deployment URL carries.
|
|
17
|
+
*/
|
|
18
|
+
export function parseReference(input) {
|
|
19
|
+
if (URL_SCHEMES.some((scheme) => input.startsWith(scheme))) {
|
|
20
|
+
if (!URL.canParse(input))
|
|
21
|
+
throw invalid(input);
|
|
22
|
+
const url = new URL(input);
|
|
23
|
+
if (url.username !== '' || url.password !== '') {
|
|
24
|
+
throw new TypeError(`Reference ${JSON.stringify(input)} is not admitted: a deployment URL carries no credentials, and a version reference has no scheme (<origin>@<version>).`);
|
|
25
|
+
}
|
|
26
|
+
if (!isWrittenAsParsed(input, url)) {
|
|
27
|
+
throw new TypeError(`Reference ${JSON.stringify(input)} is not admitted: a deployment URL is written as the Kernel reads it, without whitespace, control characters, a query or a fragment, with a lower-case host and no default port.`);
|
|
28
|
+
}
|
|
29
|
+
return Object.freeze({ kind: 'url', url: input });
|
|
30
|
+
}
|
|
31
|
+
const at = input.indexOf('@');
|
|
32
|
+
if (at === -1)
|
|
33
|
+
throw invalid(input);
|
|
34
|
+
const origin = input.slice(0, at);
|
|
35
|
+
const selector = input.slice(at + 1);
|
|
36
|
+
if (!patterns.origin.test(origin))
|
|
37
|
+
throw invalid(input);
|
|
38
|
+
if (MAJOR.test(selector)) {
|
|
39
|
+
throw new TypeError(`Reference ${JSON.stringify(input)} names a major version only: name a minor line (${origin}@${selector}.<minor>) or an exact version (${origin}@${selector}.<minor>.<patch>).`);
|
|
40
|
+
}
|
|
41
|
+
if (isLine(selector))
|
|
42
|
+
return Object.freeze({ kind: 'line', origin, line: selector });
|
|
43
|
+
try {
|
|
44
|
+
return Object.freeze({ kind: 'exact', origin, version: acceptVersion(selector) });
|
|
45
|
+
}
|
|
46
|
+
catch (cause) {
|
|
47
|
+
throw invalid(input, cause);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Translate a version reference into one published version. An exact reference names any published
|
|
52
|
+
* version, a pre-release or a yanked one included (the caller warns on yanked). A line resolves to
|
|
53
|
+
* its highest stable version that is not yanked.
|
|
54
|
+
*
|
|
55
|
+
* A reference built from data rather than by `parseReference` is checked the same way: an exact
|
|
56
|
+
* version must be canonical and a line must be `<major>.<minor>`, so `1` never resolves as a major
|
|
57
|
+
* range and `1.5.3` never as an exact pin. Anything else throws a `TypeError`.
|
|
58
|
+
*/
|
|
59
|
+
export function resolveVersion(published, reference) {
|
|
60
|
+
if (reference.kind === 'exact') {
|
|
61
|
+
const exact = acceptVersion(reference.version);
|
|
62
|
+
const match = published.find(({ version }) => version === exact);
|
|
63
|
+
if (match === undefined)
|
|
64
|
+
return Object.freeze({ kind: 'unresolved', reason: 'unknown-version' });
|
|
65
|
+
return Object.freeze({ kind: 'resolved', version: match.version, yanked: match.yanked });
|
|
66
|
+
}
|
|
67
|
+
const { kind, line: selector } = reference;
|
|
68
|
+
if (kind !== 'line') {
|
|
69
|
+
throw new TypeError(`Reference kind ${String(kind)} is not resolved: only an exact version or a minor line resolves.`);
|
|
70
|
+
}
|
|
71
|
+
if (!isLine(selector)) {
|
|
72
|
+
throw new TypeError(`Line ${typeof selector === 'string' ? JSON.stringify(selector) : typeof selector} is not admitted: expected <major>.<minor>, such as 1.5; a major version or an exact version is not a line.`);
|
|
73
|
+
}
|
|
74
|
+
const line = published.filter(({ version }) => isStable(version) && semver.satisfies(version, selector));
|
|
75
|
+
const version = semver.maxSatisfying(line.filter(({ yanked }) => !yanked).map(({ version }) => version), selector);
|
|
76
|
+
if (version !== null)
|
|
77
|
+
return Object.freeze({ kind: 'resolved', version, yanked: false });
|
|
78
|
+
return Object.freeze({
|
|
79
|
+
kind: 'unresolved',
|
|
80
|
+
reason: line.length === 0 ? 'no-stable-match' : 'yanked-only',
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
/** Whether a selector is one minor line, `<major>.<minor>`, whose versions semver can represent. */
|
|
84
|
+
function isLine(selector) {
|
|
85
|
+
return (typeof selector === 'string' && LINE.test(selector) && semver.valid(`${selector}.0`) !== null);
|
|
86
|
+
}
|
|
87
|
+
/** Whether the URL parser keeps `input` as written, the `/` of an empty path aside. */
|
|
88
|
+
function isWrittenAsParsed(input, url) {
|
|
89
|
+
if (/[?#]/u.test(input))
|
|
90
|
+
return false;
|
|
91
|
+
return url.href === input || (url.pathname === '/' && url.href === `${input}/`);
|
|
92
|
+
}
|
|
93
|
+
function invalid(input, cause) {
|
|
94
|
+
return new TypeError(`Reference ${JSON.stringify(input)} is not admitted: expected <origin>@<major>.<minor>.<patch>[-<pre>], <origin>@<major>.<minor> or a deployment URL.`, cause === undefined ? undefined : { cause });
|
|
95
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/** One SemVer 2.0.0 version as an author declares it: no leading `v`, no build metadata. */
|
|
2
|
+
export type Version = string & {
|
|
3
|
+
readonly __version: unique symbol;
|
|
4
|
+
};
|
|
5
|
+
/** Semver level a change requires. */
|
|
6
|
+
export type BumpLevel = 'major' | 'minor' | 'patch';
|
|
7
|
+
/** One version of a Domain's registry index. Yanked versions stay in the index. */
|
|
8
|
+
export interface PublishedVersion {
|
|
9
|
+
readonly version: Version;
|
|
10
|
+
readonly yanked: boolean;
|
|
11
|
+
}
|
|
12
|
+
/** Outcome of checking a declared version against the stable version before it. */
|
|
13
|
+
export interface VersionVerdict {
|
|
14
|
+
readonly declared: Version;
|
|
15
|
+
/** Absent: no stable version before the declared one, nothing to check. */
|
|
16
|
+
readonly previous?: Version;
|
|
17
|
+
/** Level the change requires, before the 0.x rule. */
|
|
18
|
+
readonly level?: BumpLevel;
|
|
19
|
+
/** Level after the 0.x rule. */
|
|
20
|
+
readonly effective?: BumpLevel;
|
|
21
|
+
/** First pre-release of the required version, such as `2.0.0-0`. */
|
|
22
|
+
readonly minimum?: Version;
|
|
23
|
+
/** Stable form of the required version, such as `2.0.0`. */
|
|
24
|
+
readonly next?: Version;
|
|
25
|
+
/** For a refused pre-release, the first pre-release of the required version on its channel. */
|
|
26
|
+
readonly suggestion?: Version;
|
|
27
|
+
readonly accepted: boolean;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Admit one declared version. Build metadata is refused because it takes no part in precedence
|
|
31
|
+
* (`1.5.0+x` equals `1.5.0`), so it could not name a distinct version of the registry.
|
|
32
|
+
*/
|
|
33
|
+
export declare function acceptVersion(input: unknown): Version;
|
|
34
|
+
/**
|
|
35
|
+
* The highest published stable version below (`<`, publish) or up to (`<=`, diff) the declared one.
|
|
36
|
+
* Yanked versions count, since their installations keep running. Pre-releases never do: a
|
|
37
|
+
* pre-release is a draft of its version and is compared with the last stable one. An index entry
|
|
38
|
+
* that is not a canonical version (`v1.4.2`, `1.4.3+b`) is no version and never a baseline; a
|
|
39
|
+
* declared version that is not canonical is refused, so the check never passes for want of one.
|
|
40
|
+
*/
|
|
41
|
+
export declare function baselineVersion(published: readonly PublishedVersion[], declared: Version, bound: '<' | '<='): Version | undefined;
|
|
42
|
+
/**
|
|
43
|
+
* Below 1.0.0 a breaking change raises the minor and an addition raises the patch, as
|
|
44
|
+
* release-please `bump-minor-pre-major` and `bump-patch-for-minor-pre-major` do.
|
|
45
|
+
*/
|
|
46
|
+
export declare function effectiveLevel(level: BumpLevel, previous: Version): BumpLevel;
|
|
47
|
+
/**
|
|
48
|
+
* The smallest version a change of `level` admits after `previous`, the first pre-release of the
|
|
49
|
+
* required version: `inc(previous, 'pre' + effective)`.
|
|
50
|
+
*/
|
|
51
|
+
export declare function minimumVersion(previous: Version, level: BumpLevel): Version;
|
|
52
|
+
/**
|
|
53
|
+
* Check a declared version against the stable version before it and the level its change requires.
|
|
54
|
+
* Without a previous stable version there is nothing to check. Otherwise the declared version must
|
|
55
|
+
* reach the minimum, so `2.0.0-rc.1` passes where `1.5.0-beta.1` does not. The check never guesses:
|
|
56
|
+
* a previous version comes with the level its change requires, which the input type enforces, and a
|
|
57
|
+
* call that still omits it throws a `TypeError`, as do a declared version that is not canonical and
|
|
58
|
+
* a previous version that is not stable.
|
|
59
|
+
*/
|
|
60
|
+
export declare function judgeVersion(input: {
|
|
61
|
+
readonly declared: Version;
|
|
62
|
+
readonly previous?: undefined;
|
|
63
|
+
readonly level?: BumpLevel;
|
|
64
|
+
} | {
|
|
65
|
+
readonly declared: Version;
|
|
66
|
+
readonly previous: Version | undefined;
|
|
67
|
+
readonly level: BumpLevel;
|
|
68
|
+
}): VersionVerdict;
|
|
69
|
+
/** Whether a value is a version `acceptVersion` admits: canonical, without `v` or build metadata. */
|
|
70
|
+
export declare function isVersion(input: unknown): input is Version;
|
|
71
|
+
/** Whether a value is a canonical version (`isVersion`) that is not a pre-release. */
|
|
72
|
+
export declare function isStable(version: string): boolean;
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import semver from 'semver';
|
|
2
|
+
const PRERELEASE = { major: 'premajor', minor: 'preminor', patch: 'prepatch' };
|
|
3
|
+
/**
|
|
4
|
+
* Admit one declared version. Build metadata is refused because it takes no part in precedence
|
|
5
|
+
* (`1.5.0+x` equals `1.5.0`), so it could not name a distinct version of the registry.
|
|
6
|
+
*/
|
|
7
|
+
export function acceptVersion(input) {
|
|
8
|
+
if (isVersion(input))
|
|
9
|
+
return input;
|
|
10
|
+
throw new TypeError(`Version ${typeof input === 'string' ? JSON.stringify(input) : typeof input} is not admitted: expected SemVer 2.0.0 such as 1.5.0 or 2.0.0-rc.1, without a leading "v" or build metadata.`);
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* The highest published stable version below (`<`, publish) or up to (`<=`, diff) the declared one.
|
|
14
|
+
* Yanked versions count, since their installations keep running. Pre-releases never do: a
|
|
15
|
+
* pre-release is a draft of its version and is compared with the last stable one. An index entry
|
|
16
|
+
* that is not a canonical version (`v1.4.2`, `1.4.3+b`) is no version and never a baseline; a
|
|
17
|
+
* declared version that is not canonical is refused, so the check never passes for want of one.
|
|
18
|
+
*/
|
|
19
|
+
export function baselineVersion(published, declared, bound) {
|
|
20
|
+
acceptVersion(declared);
|
|
21
|
+
const stables = published.filter(({ version }) => isStable(version)).map(({ version }) => version);
|
|
22
|
+
return semver.maxSatisfying(stables, `${bound}${declared}`) ?? undefined;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Below 1.0.0 a breaking change raises the minor and an addition raises the patch, as
|
|
26
|
+
* release-please `bump-minor-pre-major` and `bump-patch-for-minor-pre-major` do.
|
|
27
|
+
*/
|
|
28
|
+
export function effectiveLevel(level, previous) {
|
|
29
|
+
if (!Object.hasOwn(PRERELEASE, level)) {
|
|
30
|
+
throw new TypeError(`Bump level ${JSON.stringify(level)} is not admitted: expected major, minor or patch.`);
|
|
31
|
+
}
|
|
32
|
+
if (semver.major(acceptVersion(previous)) !== 0)
|
|
33
|
+
return level;
|
|
34
|
+
return level === 'major' ? 'minor' : 'patch';
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* The smallest version a change of `level` admits after `previous`, the first pre-release of the
|
|
38
|
+
* required version: `inc(previous, 'pre' + effective)`.
|
|
39
|
+
*/
|
|
40
|
+
export function minimumVersion(previous, level) {
|
|
41
|
+
assertBaseline(previous);
|
|
42
|
+
return increment(previous, PRERELEASE[effectiveLevel(level, previous)]);
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Check a declared version against the stable version before it and the level its change requires.
|
|
46
|
+
* Without a previous stable version there is nothing to check. Otherwise the declared version must
|
|
47
|
+
* reach the minimum, so `2.0.0-rc.1` passes where `1.5.0-beta.1` does not. The check never guesses:
|
|
48
|
+
* a previous version comes with the level its change requires, which the input type enforces, and a
|
|
49
|
+
* call that still omits it throws a `TypeError`, as do a declared version that is not canonical and
|
|
50
|
+
* a previous version that is not stable.
|
|
51
|
+
*/
|
|
52
|
+
export function judgeVersion(input) {
|
|
53
|
+
const { declared, previous, level } = input;
|
|
54
|
+
acceptVersion(declared);
|
|
55
|
+
if (previous === undefined)
|
|
56
|
+
return Object.freeze({ declared, accepted: true });
|
|
57
|
+
if (level === undefined) {
|
|
58
|
+
throw new TypeError(`Version ${JSON.stringify(declared)} cannot be checked against ${JSON.stringify(previous)} without the level its change requires.`);
|
|
59
|
+
}
|
|
60
|
+
assertBaseline(previous);
|
|
61
|
+
const effective = effectiveLevel(level, previous);
|
|
62
|
+
const minimum = minimumVersion(previous, level);
|
|
63
|
+
const accepted = semver.gte(declared, minimum);
|
|
64
|
+
const channel = semver.prerelease(declared)?.[0];
|
|
65
|
+
const suggestion = accepted || channel === undefined
|
|
66
|
+
? undefined
|
|
67
|
+
: increment(previous, PRERELEASE[effective], typeof channel === 'string' ? channel : undefined);
|
|
68
|
+
return Object.freeze({
|
|
69
|
+
declared,
|
|
70
|
+
previous,
|
|
71
|
+
level,
|
|
72
|
+
effective,
|
|
73
|
+
minimum,
|
|
74
|
+
next: increment(previous, effective),
|
|
75
|
+
...(suggestion === undefined ? {} : { suggestion }),
|
|
76
|
+
accepted,
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
/** Whether a value is a version `acceptVersion` admits: canonical, without `v` or build metadata. */
|
|
80
|
+
export function isVersion(input) {
|
|
81
|
+
return typeof input === 'string' && semver.valid(input) === input;
|
|
82
|
+
}
|
|
83
|
+
/** Whether a value is a canonical version (`isVersion`) that is not a pre-release. */
|
|
84
|
+
export function isStable(version) {
|
|
85
|
+
return isVersion(version) && semver.prerelease(version) === null;
|
|
86
|
+
}
|
|
87
|
+
/** The version before a declared one is the highest stable version that `baselineVersion` finds. */
|
|
88
|
+
function assertBaseline(previous) {
|
|
89
|
+
if (isStable(previous))
|
|
90
|
+
return;
|
|
91
|
+
throw new TypeError(`Previous version ${JSON.stringify(previous)} is not admitted: it must be a stable version, the highest stable version before the declared one.`);
|
|
92
|
+
}
|
|
93
|
+
function increment(version, release, channel) {
|
|
94
|
+
const next = semver.inc(version, release, undefined, channel);
|
|
95
|
+
if (next === null)
|
|
96
|
+
throw new TypeError(`Version ${JSON.stringify(version)} is not admitted.`);
|
|
97
|
+
return next;
|
|
98
|
+
}
|
package/dist/project/admit.js
CHANGED
|
@@ -2,7 +2,7 @@ import { isLegacyDeployment } from '../deployment/deploy.js';
|
|
|
2
2
|
import { isProject } from './define.js';
|
|
3
3
|
export const PROJECT_EXPORT_HINT = 'astrale.config.ts must export exactly one default Project:\n' +
|
|
4
4
|
" import { defineProject } from '@astrale-os/sdk/project'\n" +
|
|
5
|
-
' export default defineProject({
|
|
5
|
+
' export default defineProject({ domain, environments: { development: { deployment: adapter() } } })\n';
|
|
6
6
|
/** Admit the module namespace of one loaded `astrale.config.ts`: exactly one default Project. */
|
|
7
7
|
export function admitProjectModule(loaded) {
|
|
8
8
|
if (loaded === null ||
|
|
@@ -16,7 +16,7 @@ export function admitProjectModule(loaded) {
|
|
|
16
16
|
if (isProject(value))
|
|
17
17
|
return value;
|
|
18
18
|
if (isLegacyDeployment(value)) {
|
|
19
|
-
throw new TypeError(`astrale.config.ts exports the legacy deploy() aggregate; migrate
|
|
19
|
+
throw new TypeError(`astrale.config.ts exports the legacy deploy() aggregate; migrate the Domain and Environments into defineProject().\n${PROJECT_EXPORT_HINT}`);
|
|
20
20
|
}
|
|
21
21
|
throw new TypeError(`Default export must be created by defineProject().\n${PROJECT_EXPORT_HINT}`);
|
|
22
22
|
}
|
package/dist/project/define.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { DomainDefinitionIdentity } from '../application/index.js';
|
|
2
2
|
import type { Tests } from '../testing/index.js';
|
|
3
3
|
import type { Project, ProjectEnvironment, ProjectEntrypoints } from './project.js';
|
|
4
|
-
export interface ProjectInput<
|
|
5
|
-
readonly
|
|
4
|
+
export interface ProjectInput<DomainDefinitionValue extends DomainDefinitionIdentity, EnvironmentsValue extends Readonly<Record<string, ProjectEnvironment>>, TestsValue extends Tests | undefined> {
|
|
5
|
+
readonly domain: DomainDefinitionValue;
|
|
6
6
|
readonly environments: EnvironmentsValue;
|
|
7
7
|
readonly entrypoints?: ProjectEntrypoints;
|
|
8
8
|
readonly tests?: TestsValue;
|
|
9
9
|
}
|
|
10
10
|
/** Capture one inert Project definition without loading entrypoints or performing effects. */
|
|
11
|
-
export declare function defineProject<const
|
|
11
|
+
export declare function defineProject<const DomainDefinitionValue extends DomainDefinitionIdentity, const EnvironmentsValue extends Readonly<Record<string, ProjectEnvironment>>, const TestsValue extends Tests | undefined = undefined>(input: ProjectInput<DomainDefinitionValue, EnvironmentsValue, TestsValue>): Project<DomainDefinitionValue, EnvironmentsValue, TestsValue>;
|
|
12
12
|
export declare function isProject(input: unknown): input is Project;
|