@supatype/cli 0.3.6 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +432 -0
- package/bin/supatype.js +25 -4
- package/deno.d.ts +11 -0
- package/dist/admin-prompt-state.d.ts +13 -0
- package/dist/admin-prompt-state.d.ts.map +1 -0
- package/dist/admin-prompt-state.js +30 -0
- package/dist/admin-prompt-state.js.map +1 -0
- package/dist/adopt-columns.d.ts +157 -0
- package/dist/adopt-columns.d.ts.map +1 -0
- package/dist/adopt-columns.js +785 -0
- package/dist/adopt-columns.js.map +1 -0
- package/dist/adopt-walkthrough.d.ts +50 -15
- package/dist/adopt-walkthrough.d.ts.map +1 -1
- package/dist/adopt-walkthrough.js +93 -61
- package/dist/adopt-walkthrough.js.map +1 -1
- package/dist/api-config-cache.d.ts +3 -3
- package/dist/api-config-cache.d.ts.map +1 -1
- package/dist/api-config-cache.js +14 -20
- package/dist/api-config-cache.js.map +1 -1
- package/dist/app/framework.d.ts.map +1 -1
- package/dist/app/framework.js +5 -5
- package/dist/app/framework.js.map +1 -1
- package/dist/app/proxy-dev-app.d.ts.map +1 -1
- package/dist/app/proxy-dev-app.js +3 -2
- package/dist/app/proxy-dev-app.js.map +1 -1
- package/dist/app-config.d.ts +1 -1
- package/dist/app-config.d.ts.map +1 -1
- package/dist/app-config.js +103 -144
- package/dist/app-config.js.map +1 -1
- package/dist/applied-ast-artifacts.d.ts +16 -0
- package/dist/applied-ast-artifacts.d.ts.map +1 -0
- package/dist/applied-ast-artifacts.js +37 -0
- package/dist/applied-ast-artifacts.js.map +1 -0
- package/dist/archive-extract.d.ts +3 -0
- package/dist/archive-extract.d.ts.map +1 -0
- package/dist/archive-extract.js +19 -0
- package/dist/archive-extract.js.map +1 -0
- package/dist/ast-read.d.ts +17 -0
- package/dist/ast-read.d.ts.map +1 -0
- package/dist/ast-read.js +32 -0
- package/dist/ast-read.js.map +1 -0
- package/dist/augmentation-generator.d.ts +14 -2
- package/dist/augmentation-generator.d.ts.map +1 -1
- package/dist/augmentation-generator.js +194 -61
- package/dist/augmentation-generator.js.map +1 -1
- package/dist/augmentation-relationships.d.ts +32 -0
- package/dist/augmentation-relationships.d.ts.map +1 -0
- package/dist/augmentation-relationships.js +122 -0
- package/dist/augmentation-relationships.js.map +1 -0
- package/dist/auth-answer.d.ts +16 -0
- package/dist/auth-answer.d.ts.map +1 -0
- package/dist/auth-answer.js +21 -0
- package/dist/auth-answer.js.map +1 -0
- package/dist/auth-providers.d.ts +89 -0
- package/dist/auth-providers.d.ts.map +1 -0
- package/dist/auth-providers.js +243 -0
- package/dist/auth-providers.js.map +1 -0
- package/dist/binary-cache.d.ts +34 -8
- package/dist/binary-cache.d.ts.map +1 -1
- package/dist/binary-cache.js +253 -115
- package/dist/binary-cache.js.map +1 -1
- package/dist/binary-download-lock.d.ts.map +1 -1
- package/dist/binary-download-lock.js +14 -13
- package/dist/binary-download-lock.js.map +1 -1
- package/dist/byo-preflight.d.ts +26 -0
- package/dist/byo-preflight.d.ts.map +1 -0
- package/dist/byo-preflight.js +61 -0
- package/dist/byo-preflight.js.map +1 -0
- package/dist/cache-identity-scope.d.ts +7 -3
- package/dist/cache-identity-scope.d.ts.map +1 -1
- package/dist/cache-identity-scope.js +20 -10
- package/dist/cache-identity-scope.js.map +1 -1
- package/dist/cache-pins.d.ts.map +1 -1
- package/dist/cache-pins.js +2 -2
- package/dist/cache-pins.js.map +1 -1
- package/dist/cache-provider.d.ts +17 -18
- package/dist/cache-provider.d.ts.map +1 -1
- package/dist/cache-provider.js +27 -25
- package/dist/cache-provider.js.map +1 -1
- package/dist/cli-package-version.d.ts.map +1 -1
- package/dist/cli-package-version.js +2 -2
- package/dist/cli-package-version.js.map +1 -1
- package/dist/cli-standalone.d.ts.map +1 -1
- package/dist/cli-standalone.js +2 -6
- package/dist/cli-standalone.js.map +1 -1
- package/dist/cli-version-embedded.js +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +4 -0
- package/dist/cli.js.map +1 -1
- package/dist/client-generator.d.ts +5 -2
- package/dist/client-generator.d.ts.map +1 -1
- package/dist/client-generator.js +32 -22
- package/dist/client-generator.js.map +1 -1
- package/dist/cloud-credentials.d.ts +6 -0
- package/dist/cloud-credentials.d.ts.map +1 -1
- package/dist/cloud-credentials.js +45 -26
- package/dist/cloud-credentials.js.map +1 -1
- package/dist/commands/add.d.ts.map +1 -1
- package/dist/commands/add.js +3 -2
- package/dist/commands/add.js.map +1 -1
- package/dist/commands/admin.d.ts +51 -16
- package/dist/commands/admin.d.ts.map +1 -1
- package/dist/commands/admin.js +174 -148
- package/dist/commands/admin.js.map +1 -1
- package/dist/commands/adopt.d.ts +23 -0
- package/dist/commands/adopt.d.ts.map +1 -1
- package/dist/commands/adopt.js +205 -42
- package/dist/commands/adopt.js.map +1 -1
- package/dist/commands/app.d.ts.map +1 -1
- package/dist/commands/app.js +31 -11
- package/dist/commands/app.js.map +1 -1
- package/dist/commands/cache.d.ts.map +1 -1
- package/dist/commands/cache.js +7 -5
- package/dist/commands/cache.js.map +1 -1
- package/dist/commands/cloud.d.ts +4 -1
- package/dist/commands/cloud.d.ts.map +1 -1
- package/dist/commands/cloud.js +49 -27
- package/dist/commands/cloud.js.map +1 -1
- package/dist/commands/db.d.ts.map +1 -1
- package/dist/commands/db.js +122 -110
- package/dist/commands/db.js.map +1 -1
- package/dist/commands/deploy.d.ts +6 -0
- package/dist/commands/deploy.d.ts.map +1 -1
- package/dist/commands/deploy.js +67 -19
- package/dist/commands/deploy.js.map +1 -1
- package/dist/commands/dev.d.ts +54 -2
- package/dist/commands/dev.d.ts.map +1 -1
- package/dist/commands/dev.js +582 -469
- package/dist/commands/dev.js.map +1 -1
- package/dist/commands/doctor.d.ts +56 -8
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +180 -61
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/engine.d.ts +1 -1
- package/dist/commands/engine.d.ts.map +1 -1
- package/dist/commands/engine.js +14 -13
- package/dist/commands/engine.js.map +1 -1
- package/dist/commands/functions.d.ts +30 -0
- package/dist/commands/functions.d.ts.map +1 -1
- package/dist/commands/functions.js +530 -545
- package/dist/commands/functions.js.map +1 -1
- package/dist/commands/generate.d.ts +6 -0
- package/dist/commands/generate.d.ts.map +1 -1
- package/dist/commands/generate.js +25 -22
- package/dist/commands/generate.js.map +1 -1
- package/dist/commands/hooks.js +26 -11
- package/dist/commands/hooks.js.map +1 -1
- package/dist/commands/init.d.ts +33 -0
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +330 -213
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/internal.d.ts.map +1 -1
- package/dist/commands/internal.js +5 -3
- package/dist/commands/internal.js.map +1 -1
- package/dist/commands/keys.d.ts +36 -10
- package/dist/commands/keys.d.ts.map +1 -1
- package/dist/commands/keys.js +168 -128
- package/dist/commands/keys.js.map +1 -1
- package/dist/commands/link-helpers.d.ts.map +1 -1
- package/dist/commands/link-helpers.js +46 -17
- package/dist/commands/link-helpers.js.map +1 -1
- package/dist/commands/login.d.ts.map +1 -1
- package/dist/commands/login.js +2 -1
- package/dist/commands/login.js.map +1 -1
- package/dist/commands/logs.d.ts.map +1 -1
- package/dist/commands/logs.js +5 -4
- package/dist/commands/logs.js.map +1 -1
- package/dist/commands/migrate.d.ts +43 -0
- package/dist/commands/migrate.d.ts.map +1 -1
- package/dist/commands/migrate.js +99 -48
- package/dist/commands/migrate.js.map +1 -1
- package/dist/commands/pg.d.ts.map +1 -1
- package/dist/commands/pg.js +26 -23
- package/dist/commands/pg.js.map +1 -1
- package/dist/commands/plugins.d.ts.map +1 -1
- package/dist/commands/plugins.js +53 -34
- package/dist/commands/plugins.js.map +1 -1
- package/dist/commands/pull.d.ts.map +1 -1
- package/dist/commands/pull.js +6 -5
- package/dist/commands/pull.js.map +1 -1
- package/dist/commands/push.d.ts +60 -0
- package/dist/commands/push.d.ts.map +1 -1
- package/dist/commands/push.js +411 -131
- package/dist/commands/push.js.map +1 -1
- package/dist/commands/rename.d.ts +20 -0
- package/dist/commands/rename.d.ts.map +1 -0
- package/dist/commands/rename.js +74 -0
- package/dist/commands/rename.js.map +1 -0
- package/dist/commands/seed.d.ts +47 -0
- package/dist/commands/seed.d.ts.map +1 -1
- package/dist/commands/seed.js +123 -36
- package/dist/commands/seed.js.map +1 -1
- package/dist/commands/self-host.d.ts.map +1 -1
- package/dist/commands/self-host.js +136 -38
- package/dist/commands/self-host.js.map +1 -1
- package/dist/commands/self-update.d.ts.map +1 -1
- package/dist/commands/self-update.js +2 -1
- package/dist/commands/self-update.js.map +1 -1
- package/dist/commands/status.d.ts.map +1 -1
- package/dist/commands/status.js +21 -17
- package/dist/commands/status.js.map +1 -1
- package/dist/commands/types.d.ts.map +1 -1
- package/dist/commands/types.js +10 -11
- package/dist/commands/types.js.map +1 -1
- package/dist/commands/update.d.ts.map +1 -1
- package/dist/commands/update.js +213 -98
- package/dist/commands/update.js.map +1 -1
- package/dist/component-launch.d.ts +11 -0
- package/dist/component-launch.d.ts.map +1 -0
- package/dist/component-launch.js +35 -0
- package/dist/component-launch.js.map +1 -0
- package/dist/components.d.ts +7 -2
- package/dist/components.d.ts.map +1 -1
- package/dist/components.js +7 -2
- package/dist/components.js.map +1 -1
- package/dist/compose-db-psql.d.ts +20 -0
- package/dist/compose-db-psql.d.ts.map +1 -0
- package/dist/compose-db-psql.js +30 -0
- package/dist/compose-db-psql.js.map +1 -0
- package/dist/compose-db-roles.d.ts +41 -0
- package/dist/compose-db-roles.d.ts.map +1 -0
- package/dist/compose-db-roles.js +109 -0
- package/dist/compose-db-roles.js.map +1 -0
- package/dist/compose-engine-run.d.ts +28 -0
- package/dist/compose-engine-run.d.ts.map +1 -0
- package/dist/compose-engine-run.js +68 -0
- package/dist/compose-engine-run.js.map +1 -0
- package/dist/compose-engine-service.d.ts +10 -0
- package/dist/compose-engine-service.d.ts.map +1 -0
- package/dist/compose-engine-service.js +16 -0
- package/dist/compose-engine-service.js.map +1 -0
- package/dist/compose-host-path.d.ts +14 -0
- package/dist/compose-host-path.d.ts.map +1 -0
- package/dist/compose-host-path.js +18 -0
- package/dist/compose-host-path.js.map +1 -0
- package/dist/compose-image-pull.d.ts +43 -0
- package/dist/compose-image-pull.d.ts.map +1 -0
- package/dist/compose-image-pull.js +27 -0
- package/dist/compose-image-pull.js.map +1 -0
- package/dist/compose-kong.d.ts +31 -0
- package/dist/compose-kong.d.ts.map +1 -0
- package/dist/compose-kong.js +149 -0
- package/dist/compose-kong.js.map +1 -0
- package/dist/compose-local-server-image.d.ts.map +1 -1
- package/dist/compose-local-server-image.js +7 -3
- package/dist/compose-local-server-image.js.map +1 -1
- package/dist/compose-rename.d.ts.map +1 -1
- package/dist/compose-rename.js +2 -2
- package/dist/compose-rename.js.map +1 -1
- package/dist/compose-render-mode.d.ts +41 -0
- package/dist/compose-render-mode.d.ts.map +1 -0
- package/dist/compose-render-mode.js +73 -0
- package/dist/compose-render-mode.js.map +1 -0
- package/dist/compose-services.d.ts +12 -2
- package/dist/compose-services.d.ts.map +1 -1
- package/dist/compose-services.js +29 -13
- package/dist/compose-services.js.map +1 -1
- package/dist/config-snapshot.d.ts +6 -0
- package/dist/config-snapshot.d.ts.map +1 -0
- package/dist/config-snapshot.js +23 -0
- package/dist/config-snapshot.js.map +1 -0
- package/dist/config.d.ts +20 -2
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +52 -13
- package/dist/config.js.map +1 -1
- package/dist/database-url-owner.d.ts +57 -0
- package/dist/database-url-owner.d.ts.map +1 -0
- package/dist/database-url-owner.js +130 -0
- package/dist/database-url-owner.js.map +1 -0
- package/dist/db-port-offer.d.ts +18 -0
- package/dist/db-port-offer.d.ts.map +1 -0
- package/dist/db-port-offer.js +68 -0
- package/dist/db-port-offer.js.map +1 -0
- package/dist/db-port.d.ts +87 -21
- package/dist/db-port.d.ts.map +1 -1
- package/dist/db-port.js +90 -48
- package/dist/db-port.js.map +1 -1
- package/dist/db-preflight.d.ts +30 -8
- package/dist/db-preflight.d.ts.map +1 -1
- package/dist/db-preflight.js +103 -46
- package/dist/db-preflight.js.map +1 -1
- package/dist/db-rows.d.ts +31 -0
- package/dist/db-rows.d.ts.map +1 -0
- package/dist/db-rows.js +47 -0
- package/dist/db-rows.js.map +1 -0
- package/dist/debounce.d.ts +11 -0
- package/dist/debounce.d.ts.map +1 -0
- package/dist/debounce.js +23 -0
- package/dist/debounce.js.map +1 -0
- package/dist/destructive-consent.d.ts +88 -0
- package/dist/destructive-consent.d.ts.map +1 -0
- package/dist/destructive-consent.js +184 -0
- package/dist/destructive-consent.js.map +1 -0
- package/dist/dev-api-keys.d.ts +36 -0
- package/dist/dev-api-keys.d.ts.map +1 -0
- package/dist/dev-api-keys.js +68 -0
- package/dist/dev-api-keys.js.map +1 -0
- package/dist/dev-compose.d.ts +96 -26
- package/dist/dev-compose.d.ts.map +1 -1
- package/dist/dev-compose.js +739 -620
- package/dist/dev-compose.js.map +1 -1
- package/dist/dev-db-ready.d.ts +20 -0
- package/dist/dev-db-ready.d.ts.map +1 -0
- package/dist/dev-db-ready.js +22 -0
- package/dist/dev-db-ready.js.map +1 -0
- package/dist/dev-db-reset.d.ts.map +1 -1
- package/dist/dev-db-reset.js +5 -4
- package/dist/dev-db-reset.js.map +1 -1
- package/dist/dev-functions-watch.d.ts +24 -0
- package/dist/dev-functions-watch.d.ts.map +1 -0
- package/dist/dev-functions-watch.js +71 -0
- package/dist/dev-functions-watch.js.map +1 -0
- package/dist/dev-initial-push.d.ts +41 -6
- package/dist/dev-initial-push.d.ts.map +1 -1
- package/dist/dev-initial-push.js +84 -31
- package/dist/dev-initial-push.js.map +1 -1
- package/dist/dev-ports.d.ts +73 -6
- package/dist/dev-ports.d.ts.map +1 -1
- package/dist/dev-ports.js +185 -54
- package/dist/dev-ports.js.map +1 -1
- package/dist/dev-ready-panel.d.ts +5 -0
- package/dist/dev-ready-panel.d.ts.map +1 -1
- package/dist/dev-ready-panel.js +13 -0
- package/dist/dev-ready-panel.js.map +1 -1
- package/dist/dev-schema-watch.d.ts +19 -0
- package/dist/dev-schema-watch.d.ts.map +1 -0
- package/dist/dev-schema-watch.js +44 -0
- package/dist/dev-schema-watch.js.map +1 -0
- package/dist/dev-session-lock.d.ts +30 -1
- package/dist/dev-session-lock.d.ts.map +1 -1
- package/dist/dev-session-lock.js +87 -13
- package/dist/dev-session-lock.js.map +1 -1
- package/dist/dev-session.d.ts.map +1 -1
- package/dist/dev-session.js +3 -0
- package/dist/dev-session.js.map +1 -1
- package/dist/dev-shutdown.d.ts +62 -3
- package/dist/dev-shutdown.d.ts.map +1 -1
- package/dist/dev-shutdown.js +251 -32
- package/dist/dev-shutdown.js.map +1 -1
- package/dist/diff-output.d.ts +71 -3
- package/dist/diff-output.d.ts.map +1 -1
- package/dist/diff-output.js +173 -18
- package/dist/diff-output.js.map +1 -1
- package/dist/docker-address-pool.d.ts +23 -0
- package/dist/docker-address-pool.d.ts.map +1 -0
- package/dist/docker-address-pool.js +56 -0
- package/dist/docker-address-pool.js.map +1 -0
- package/dist/docker-env.d.ts +16 -0
- package/dist/docker-env.d.ts.map +1 -0
- package/dist/docker-env.js +16 -0
- package/dist/docker-env.js.map +1 -0
- package/dist/docker-exec.d.ts +92 -0
- package/dist/docker-exec.d.ts.map +1 -0
- package/dist/docker-exec.js +139 -0
- package/dist/docker-exec.js.map +1 -0
- package/dist/docker-postgres.d.ts +1 -6
- package/dist/docker-postgres.d.ts.map +1 -1
- package/dist/docker-postgres.js +75 -88
- package/dist/docker-postgres.js.map +1 -1
- package/dist/docker-runtime.d.ts +12 -1
- package/dist/docker-runtime.d.ts.map +1 -1
- package/dist/docker-runtime.js +48 -23
- package/dist/docker-runtime.js.map +1 -1
- package/dist/dotenv-parse.d.ts +22 -0
- package/dist/dotenv-parse.d.ts.map +1 -0
- package/dist/dotenv-parse.js +63 -0
- package/dist/dotenv-parse.js.map +1 -0
- package/dist/drift-consent.d.ts +36 -0
- package/dist/drift-consent.d.ts.map +1 -0
- package/dist/drift-consent.js +78 -0
- package/dist/drift-consent.js.map +1 -0
- package/dist/engine-answers.d.ts +49 -0
- package/dist/engine-answers.d.ts.map +1 -0
- package/dist/engine-answers.js +184 -0
- package/dist/engine-answers.js.map +1 -0
- package/dist/engine-client.d.ts +156 -9
- package/dist/engine-client.d.ts.map +1 -1
- package/dist/engine-client.js +313 -129
- package/dist/engine-client.js.map +1 -1
- package/dist/engine-floor.d.ts +39 -0
- package/dist/engine-floor.d.ts.map +1 -1
- package/dist/engine-floor.js +84 -0
- package/dist/engine-floor.js.map +1 -1
- package/dist/engine-json-line.d.ts +9 -0
- package/dist/engine-json-line.d.ts.map +1 -0
- package/dist/engine-json-line.js +23 -0
- package/dist/engine-json-line.js.map +1 -0
- package/dist/engine-ownership-gate.d.ts +89 -0
- package/dist/engine-ownership-gate.d.ts.map +1 -0
- package/dist/engine-ownership-gate.js +238 -0
- package/dist/engine-ownership-gate.js.map +1 -0
- package/dist/engine-push-output.d.ts +23 -2
- package/dist/engine-push-output.d.ts.map +1 -1
- package/dist/engine-push-output.js +22 -15
- package/dist/engine-push-output.js.map +1 -1
- package/dist/ensure-binary.d.ts +9 -0
- package/dist/ensure-binary.d.ts.map +1 -1
- package/dist/ensure-binary.js +38 -5
- package/dist/ensure-binary.js.map +1 -1
- package/dist/ensure-component-binaries.d.ts.map +1 -1
- package/dist/ensure-component-binaries.js +2 -1
- package/dist/ensure-component-binaries.js.map +1 -1
- package/dist/env-file.d.ts +41 -8
- package/dist/env-file.d.ts.map +1 -1
- package/dist/env-file.js +123 -57
- package/dist/env-file.js.map +1 -1
- package/dist/env-lines.d.ts +11 -0
- package/dist/env-lines.d.ts.map +1 -0
- package/dist/env-lines.js +36 -0
- package/dist/env-lines.js.map +1 -0
- package/dist/error-message.d.ts +38 -0
- package/dist/error-message.d.ts.map +1 -0
- package/dist/error-message.js +111 -0
- package/dist/error-message.js.map +1 -0
- package/dist/fetch-within.d.ts +10 -0
- package/dist/fetch-within.d.ts.map +1 -0
- package/dist/fetch-within.js +12 -0
- package/dist/fetch-within.js.map +1 -0
- package/dist/field-bounds.d.ts +8 -2
- package/dist/field-bounds.d.ts.map +1 -1
- package/dist/field-bounds.js +9 -15
- package/dist/field-bounds.js.map +1 -1
- package/dist/field-masking-tier.d.ts +4 -3
- package/dist/field-masking-tier.d.ts.map +1 -1
- package/dist/field-masking-tier.js +38 -13
- package/dist/field-masking-tier.js.map +1 -1
- package/dist/functions-context-refresh.d.ts +6 -2
- package/dist/functions-context-refresh.d.ts.map +1 -1
- package/dist/functions-context-refresh.js +11 -3
- package/dist/functions-context-refresh.js.map +1 -1
- package/dist/functions-deno-types.d.ts +8 -8
- package/dist/functions-deno-types.d.ts.map +1 -1
- package/dist/functions-deno-types.js +61 -26
- package/dist/functions-deno-types.js.map +1 -1
- package/dist/functions-discovery.d.ts +31 -0
- package/dist/functions-discovery.d.ts.map +1 -0
- package/dist/functions-discovery.js +87 -0
- package/dist/functions-discovery.js.map +1 -0
- package/dist/functions-template.d.ts +10 -0
- package/dist/functions-template.d.ts.map +1 -0
- package/dist/functions-template.js +47 -0
- package/dist/functions-template.js.map +1 -0
- package/dist/functions-worker-files.d.ts +55 -0
- package/dist/functions-worker-files.d.ts.map +1 -0
- package/dist/functions-worker-files.js +149 -0
- package/dist/functions-worker-files.js.map +1 -0
- package/dist/generated/functions-worker-source.d.ts +2 -0
- package/dist/generated/functions-worker-source.d.ts.map +1 -0
- package/dist/generated/functions-worker-source.js +12 -0
- package/dist/generated/functions-worker-source.js.map +1 -0
- package/dist/generated/release-images.d.ts +18 -0
- package/dist/generated/release-images.d.ts.map +1 -0
- package/dist/generated/release-images.js +8 -0
- package/dist/generated/release-images.js.map +1 -0
- package/dist/generated-files-engine.d.ts +33 -0
- package/dist/generated-files-engine.d.ts.map +1 -0
- package/dist/generated-files-engine.js +45 -0
- package/dist/generated-files-engine.js.map +1 -0
- package/dist/hook-upload.d.ts +29 -15
- package/dist/hook-upload.d.ts.map +1 -1
- package/dist/hook-upload.js +88 -59
- package/dist/hook-upload.js.map +1 -1
- package/dist/hooks-generator.d.ts +5 -0
- package/dist/hooks-generator.d.ts.map +1 -1
- package/dist/hooks-generator.js +117 -85
- package/dist/hooks-generator.js.map +1 -1
- package/dist/host-database.d.ts +46 -5
- package/dist/host-database.d.ts.map +1 -1
- package/dist/host-database.js +102 -18
- package/dist/host-database.js.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/init-dependency-versions.d.ts +3 -1
- package/dist/init-dependency-versions.d.ts.map +1 -1
- package/dist/init-dependency-versions.js +30 -7
- package/dist/init-dependency-versions.js.map +1 -1
- package/dist/init-example.d.ts +48 -0
- package/dist/init-example.d.ts.map +1 -0
- package/dist/init-example.js +110 -0
- package/dist/init-example.js.map +1 -0
- package/dist/init-package-json.d.ts.map +1 -1
- package/dist/init-package-json.js +2 -0
- package/dist/init-package-json.js.map +1 -1
- package/dist/init-project-detect.d.ts.map +1 -1
- package/dist/init-project-detect.js +3 -2
- package/dist/init-project-detect.js.map +1 -1
- package/dist/init-setup-steps.d.ts +37 -0
- package/dist/init-setup-steps.d.ts.map +1 -0
- package/dist/init-setup-steps.js +118 -0
- package/dist/init-setup-steps.js.map +1 -0
- package/dist/json-file.d.ts +15 -0
- package/dist/json-file.d.ts.map +1 -0
- package/dist/json-file.js +38 -0
- package/dist/json-file.js.map +1 -0
- package/dist/json-type-text.d.ts +18 -0
- package/dist/json-type-text.d.ts.map +1 -0
- package/dist/json-type-text.js +112 -0
- package/dist/json-type-text.js.map +1 -0
- package/dist/jwt-secret-length.d.ts +14 -0
- package/dist/jwt-secret-length.d.ts.map +1 -0
- package/dist/jwt-secret-length.js +21 -0
- package/dist/jwt-secret-length.js.map +1 -0
- package/dist/jwt-secret-rules.d.ts +24 -0
- package/dist/jwt-secret-rules.d.ts.map +1 -0
- package/dist/jwt-secret-rules.js +46 -0
- package/dist/jwt-secret-rules.js.map +1 -0
- package/dist/jwt.d.ts +5 -0
- package/dist/jwt.d.ts.map +1 -1
- package/dist/jwt.js +25 -1
- package/dist/jwt.js.map +1 -1
- package/dist/link.d.ts +5 -1
- package/dist/link.d.ts.map +1 -1
- package/dist/link.js +47 -5
- package/dist/link.js.map +1 -1
- package/dist/local-gateway.d.ts +10 -4
- package/dist/local-gateway.d.ts.map +1 -1
- package/dist/local-gateway.js +19 -5
- package/dist/local-gateway.js.map +1 -1
- package/dist/local-secrets.d.ts +176 -10
- package/dist/local-secrets.d.ts.map +1 -1
- package/dist/local-secrets.js +261 -16
- package/dist/local-secrets.js.map +1 -1
- package/dist/local-stack.d.ts +30 -0
- package/dist/local-stack.d.ts.map +1 -0
- package/dist/local-stack.js +76 -0
- package/dist/local-stack.js.map +1 -0
- package/dist/local-storage.d.ts +7 -2
- package/dist/local-storage.d.ts.map +1 -1
- package/dist/local-storage.js +11 -3
- package/dist/local-storage.js.map +1 -1
- package/dist/mailer-autoconfirm.d.ts +37 -0
- package/dist/mailer-autoconfirm.d.ts.map +1 -0
- package/dist/mailer-autoconfirm.js +69 -0
- package/dist/mailer-autoconfirm.js.map +1 -0
- package/dist/mailer-env.d.ts +37 -0
- package/dist/mailer-env.d.ts.map +1 -0
- package/dist/mailer-env.js +98 -0
- package/dist/mailer-env.js.map +1 -0
- package/dist/model-cache.d.ts +10 -10
- package/dist/model-cache.d.ts.map +1 -1
- package/dist/model-cache.js +33 -27
- package/dist/model-cache.js.map +1 -1
- package/dist/model-hooks.d.ts +24 -13
- package/dist/model-hooks.d.ts.map +1 -1
- package/dist/model-hooks.js +133 -175
- package/dist/model-hooks.js.map +1 -1
- package/dist/model-versioning.d.ts +7 -1
- package/dist/model-versioning.d.ts.map +1 -1
- package/dist/model-versioning.js +24 -27
- package/dist/model-versioning.js.map +1 -1
- package/dist/native-dev-env.d.ts +75 -0
- package/dist/native-dev-env.d.ts.map +1 -0
- package/dist/native-dev-env.js +112 -0
- package/dist/native-dev-env.js.map +1 -0
- package/dist/native-functions-watch.d.ts +62 -0
- package/dist/native-functions-watch.d.ts.map +1 -0
- package/dist/native-functions-watch.js +140 -0
- package/dist/native-functions-watch.js.map +1 -0
- package/dist/native-keyspace.d.ts +23 -0
- package/dist/native-keyspace.d.ts.map +1 -0
- package/dist/native-keyspace.js +53 -0
- package/dist/native-keyspace.js.map +1 -0
- package/dist/native-pg-auth.d.ts +46 -0
- package/dist/native-pg-auth.d.ts.map +1 -0
- package/dist/native-pg-auth.js +107 -0
- package/dist/native-pg-auth.js.map +1 -0
- package/dist/native-realtime.d.ts +34 -0
- package/dist/native-realtime.d.ts.map +1 -0
- package/dist/native-realtime.js +195 -0
- package/dist/native-realtime.js.map +1 -0
- package/dist/native-roles-sql.d.ts +41 -0
- package/dist/native-roles-sql.d.ts.map +1 -0
- package/dist/native-roles-sql.js +154 -0
- package/dist/native-roles-sql.js.map +1 -0
- package/dist/native-storage-import.d.ts +19 -0
- package/dist/native-storage-import.d.ts.map +1 -0
- package/dist/native-storage-import.js +327 -0
- package/dist/native-storage-import.js.map +1 -0
- package/dist/native-storage.d.ts +45 -0
- package/dist/native-storage.d.ts.map +1 -0
- package/dist/native-storage.js +140 -0
- package/dist/native-storage.js.map +1 -0
- package/dist/native-worker.d.ts +26 -0
- package/dist/native-worker.d.ts.map +1 -0
- package/dist/native-worker.js +63 -0
- package/dist/native-worker.js.map +1 -0
- package/dist/owner-default.d.ts +27 -0
- package/dist/owner-default.d.ts.map +1 -0
- package/dist/owner-default.js +55 -0
- package/dist/owner-default.js.map +1 -0
- package/dist/package-json.d.ts +20 -0
- package/dist/package-json.d.ts.map +1 -0
- package/dist/package-json.js +29 -0
- package/dist/package-json.js.map +1 -0
- package/dist/parent-watch.d.ts +40 -0
- package/dist/parent-watch.d.ts.map +1 -0
- package/dist/parent-watch.js +75 -0
- package/dist/parent-watch.js.map +1 -0
- package/dist/post-apply.d.ts +3 -0
- package/dist/post-apply.d.ts.map +1 -0
- package/dist/post-apply.js +17 -0
- package/dist/post-apply.js.map +1 -0
- package/dist/postgres-ctl.d.ts +125 -11
- package/dist/postgres-ctl.d.ts.map +1 -1
- package/dist/postgres-ctl.js +336 -53
- package/dist/postgres-ctl.js.map +1 -1
- package/dist/postgres-image.d.ts +47 -0
- package/dist/postgres-image.d.ts.map +1 -0
- package/dist/postgres-image.js +130 -0
- package/dist/postgres-image.js.map +1 -0
- package/dist/postgrest-release.d.ts +34 -0
- package/dist/postgrest-release.d.ts.map +1 -0
- package/dist/postgrest-release.js +58 -0
- package/dist/postgrest-release.js.map +1 -0
- package/dist/process-manager.d.ts.map +1 -1
- package/dist/process-manager.js +3 -1
- package/dist/process-manager.js.map +1 -1
- package/dist/project-config.d.ts +185 -24
- package/dist/project-config.d.ts.map +1 -1
- package/dist/project-config.js +310 -116
- package/dist/project-config.js.map +1 -1
- package/dist/project-name-override.d.ts +25 -0
- package/dist/project-name-override.d.ts.map +1 -0
- package/dist/project-name-override.js +52 -0
- package/dist/project-name-override.js.map +1 -0
- package/dist/pull-utils.d.ts +41 -3
- package/dist/pull-utils.d.ts.map +1 -1
- package/dist/pull-utils.js +182 -17
- package/dist/pull-utils.js.map +1 -1
- package/dist/push-audit.d.ts +39 -0
- package/dist/push-audit.d.ts.map +1 -0
- package/dist/push-audit.js +116 -0
- package/dist/push-audit.js.map +1 -0
- package/dist/push-refusal.d.ts +94 -0
- package/dist/push-refusal.d.ts.map +1 -0
- package/dist/push-refusal.js +276 -0
- package/dist/push-refusal.js.map +1 -0
- package/dist/realtime-launch.d.ts +2 -5
- package/dist/realtime-launch.d.ts.map +1 -1
- package/dist/realtime-launch.js +6 -23
- package/dist/realtime-launch.js.map +1 -1
- package/dist/recorded-field-masking-tier.d.ts +43 -0
- package/dist/recorded-field-masking-tier.d.ts.map +1 -0
- package/dist/recorded-field-masking-tier.js +89 -0
- package/dist/recorded-field-masking-tier.js.map +1 -0
- package/dist/release-images.d.ts +31 -0
- package/dist/release-images.d.ts.map +1 -0
- package/dist/release-images.js +90 -0
- package/dist/release-images.js.map +1 -0
- package/dist/rename-journal.d.ts +54 -0
- package/dist/rename-journal.d.ts.map +1 -0
- package/dist/rename-journal.js +150 -0
- package/dist/rename-journal.js.map +1 -0
- package/dist/required-host-components.d.ts.map +1 -1
- package/dist/required-host-components.js +4 -0
- package/dist/required-host-components.js.map +1 -1
- package/dist/resolve-api-url.d.ts +17 -3
- package/dist/resolve-api-url.d.ts.map +1 -1
- package/dist/resolve-api-url.js +72 -30
- package/dist/resolve-api-url.js.map +1 -1
- package/dist/resolve-target.d.ts +147 -26
- package/dist/resolve-target.d.ts.map +1 -1
- package/dist/resolve-target.js +279 -82
- package/dist/resolve-target.js.map +1 -1
- package/dist/rest-cache-admin.d.ts +9 -8
- package/dist/rest-cache-admin.d.ts.map +1 -1
- package/dist/rest-cache-admin.js +32 -9
- package/dist/rest-cache-admin.js.map +1 -1
- package/dist/rest-ready.d.ts +28 -0
- package/dist/rest-ready.d.ts.map +1 -0
- package/dist/rest-ready.js +54 -0
- package/dist/rest-ready.js.map +1 -0
- package/dist/restore-system-relation-targets.d.ts.map +1 -1
- package/dist/restore-system-relation-targets.js +49 -31
- package/dist/restore-system-relation-targets.js.map +1 -1
- package/dist/route-manifest.d.ts +25 -2
- package/dist/route-manifest.d.ts.map +1 -1
- package/dist/route-manifest.js +51 -13
- package/dist/route-manifest.js.map +1 -1
- package/dist/run-until-stopped.d.ts +12 -0
- package/dist/run-until-stopped.d.ts.map +1 -0
- package/dist/run-until-stopped.js +42 -0
- package/dist/run-until-stopped.js.map +1 -0
- package/dist/runtime-routes.d.ts.map +1 -1
- package/dist/runtime-routes.js +23 -28
- package/dist/runtime-routes.js.map +1 -1
- package/dist/schema-ast-v2.d.ts +37 -2
- package/dist/schema-ast-v2.d.ts.map +1 -1
- package/dist/schema-ast-v2.js +22 -7
- package/dist/schema-ast-v2.js.map +1 -1
- package/dist/schema-push-lock.d.ts.map +1 -1
- package/dist/schema-push-lock.js +70 -80
- package/dist/schema-push-lock.js.map +1 -1
- package/dist/schema-sources.d.ts +26 -5
- package/dist/schema-sources.d.ts.map +1 -1
- package/dist/schema-sources.js +73 -41
- package/dist/schema-sources.js.map +1 -1
- package/dist/seed-auth-connect.d.ts +14 -0
- package/dist/seed-auth-connect.d.ts.map +1 -0
- package/dist/seed-auth-connect.js +97 -0
- package/dist/seed-auth-connect.js.map +1 -0
- package/dist/seed-ir.d.ts.map +1 -1
- package/dist/seed-ir.js +30 -9
- package/dist/seed-ir.js.map +1 -1
- package/dist/seed-runner.d.ts.map +1 -1
- package/dist/seed-runner.js +47 -3
- package/dist/seed-runner.js.map +1 -1
- package/dist/seed.d.ts +37 -7
- package/dist/seed.d.ts.map +1 -1
- package/dist/seed.js +3 -1
- package/dist/seed.js.map +1 -1
- package/dist/self-host-compose.d.ts +83 -19
- package/dist/self-host-compose.d.ts.map +1 -1
- package/dist/self-host-compose.js +541 -217
- package/dist/self-host-compose.js.map +1 -1
- package/dist/service-role-key-file.d.ts +32 -0
- package/dist/service-role-key-file.d.ts.map +1 -0
- package/dist/service-role-key-file.js +90 -0
- package/dist/service-role-key-file.js.map +1 -0
- package/dist/shell-ports.d.ts +37 -0
- package/dist/shell-ports.d.ts.map +1 -0
- package/dist/shell-ports.js +67 -0
- package/dist/shell-ports.js.map +1 -0
- package/dist/stop-signals.d.ts +7 -0
- package/dist/stop-signals.d.ts.map +1 -0
- package/dist/stop-signals.js +12 -0
- package/dist/stop-signals.js.map +1 -0
- package/dist/storage-launch.d.ts +11 -0
- package/dist/storage-launch.d.ts.map +1 -0
- package/dist/storage-launch.js +41 -0
- package/dist/storage-launch.js.map +1 -0
- package/dist/storage-provision.d.ts +69 -7
- package/dist/storage-provision.d.ts.map +1 -1
- package/dist/storage-provision.js +112 -32
- package/dist/storage-provision.js.map +1 -1
- package/dist/studio-admin-roles.d.ts.map +1 -1
- package/dist/studio-admin-roles.js +2 -1
- package/dist/studio-admin-roles.js.map +1 -1
- package/dist/studio-auth-config.d.ts +22 -0
- package/dist/studio-auth-config.d.ts.map +1 -0
- package/dist/studio-auth-config.js +45 -0
- package/dist/studio-auth-config.js.map +1 -0
- package/dist/studio-roles.d.ts +13 -0
- package/dist/studio-roles.d.ts.map +1 -0
- package/dist/studio-roles.js +12 -0
- package/dist/studio-roles.js.map +1 -0
- package/dist/systemd.d.ts +1 -1
- package/dist/systemd.d.ts.map +1 -1
- package/dist/systemd.js +26 -11
- package/dist/systemd.js.map +1 -1
- package/dist/tar-reader.d.ts +29 -0
- package/dist/tar-reader.d.ts.map +1 -0
- package/dist/tar-reader.js +99 -0
- package/dist/tar-reader.js.map +1 -0
- package/dist/target-client.d.ts +27 -3
- package/dist/target-client.d.ts.map +1 -1
- package/dist/target-client.js +173 -46
- package/dist/target-client.js.map +1 -1
- package/dist/target-request.d.ts +25 -0
- package/dist/target-request.d.ts.map +1 -0
- package/dist/target-request.js +33 -0
- package/dist/target-request.js.map +1 -0
- package/dist/target-warning.d.ts +7 -0
- package/dist/target-warning.d.ts.map +1 -0
- package/dist/target-warning.js +12 -0
- package/dist/target-warning.js.map +1 -0
- package/dist/tsx-runner.d.ts +13 -0
- package/dist/tsx-runner.d.ts.map +1 -1
- package/dist/tsx-runner.js +36 -19
- package/dist/tsx-runner.js.map +1 -1
- package/dist/type-extractor.d.ts +8 -0
- package/dist/type-extractor.d.ts.map +1 -1
- package/dist/type-extractor.js +518 -155
- package/dist/type-extractor.js.map +1 -1
- package/dist/type-generation.d.ts +35 -5
- package/dist/type-generation.d.ts.map +1 -1
- package/dist/type-generation.js +57 -27
- package/dist/type-generation.js.map +1 -1
- package/dist/type-resolver.d.ts.map +1 -1
- package/dist/type-resolver.js +8 -1
- package/dist/type-resolver.js.map +1 -1
- package/dist/ui/clack-api.d.ts +3 -0
- package/dist/ui/clack-api.d.ts.map +1 -1
- package/dist/ui/clack-api.js +14 -7
- package/dist/ui/clack-api.js.map +1 -1
- package/dist/ui/clack.d.ts.map +1 -1
- package/dist/ui/clack.js +19 -7
- package/dist/ui/clack.js.map +1 -1
- package/dist/ui/components/PromptPanel.d.ts +1 -0
- package/dist/ui/components/PromptPanel.d.ts.map +1 -1
- package/dist/ui/components/PromptPanel.js +2 -1
- package/dist/ui/components/PromptPanel.js.map +1 -1
- package/dist/ui/confirm.d.ts +8 -0
- package/dist/ui/confirm.d.ts.map +1 -1
- package/dist/ui/confirm.js +12 -0
- package/dist/ui/confirm.js.map +1 -1
- package/dist/ui/dev/DevDashboard.d.ts.map +1 -1
- package/dist/ui/dev/DevDashboard.js +23 -6
- package/dist/ui/dev/DevDashboard.js.map +1 -1
- package/dist/ui/fatal.d.ts.map +1 -1
- package/dist/ui/fatal.js +6 -7
- package/dist/ui/fatal.js.map +1 -1
- package/dist/ui/flows/FlowApp.d.ts.map +1 -1
- package/dist/ui/flows/FlowApp.js +32 -1
- package/dist/ui/flows/FlowApp.js.map +1 -1
- package/dist/ui/flows/prompt-fields.d.ts +18 -0
- package/dist/ui/flows/prompt-fields.d.ts.map +1 -1
- package/dist/ui/flows/prompt-fields.js +25 -5
- package/dist/ui/flows/prompt-fields.js.map +1 -1
- package/dist/ui/flows/types.d.ts +2 -1
- package/dist/ui/flows/types.d.ts.map +1 -1
- package/dist/ui/messages.d.ts +6 -0
- package/dist/ui/messages.d.ts.map +1 -1
- package/dist/ui/messages.js +17 -0
- package/dist/ui/messages.js.map +1 -1
- package/dist/ui/progress.d.ts +7 -0
- package/dist/ui/progress.d.ts.map +1 -1
- package/dist/ui/progress.js +22 -8
- package/dist/ui/progress.js.map +1 -1
- package/dist/ui/runtime/cancel.d.ts +5 -0
- package/dist/ui/runtime/cancel.d.ts.map +1 -1
- package/dist/ui/runtime/cancel.js +7 -0
- package/dist/ui/runtime/cancel.js.map +1 -1
- package/dist/ui/runtime/command-chrome.d.ts.map +1 -1
- package/dist/ui/runtime/command-chrome.js +2 -0
- package/dist/ui/runtime/command-chrome.js.map +1 -1
- package/dist/ui/runtime/dev-prompt-queue.d.ts +5 -4
- package/dist/ui/runtime/dev-prompt-queue.d.ts.map +1 -1
- package/dist/ui/runtime/dev-prompt-queue.js +2 -5
- package/dist/ui/runtime/dev-prompt-queue.js.map +1 -1
- package/dist/ui/runtime/prompt-interrupt.d.ts +10 -0
- package/dist/ui/runtime/prompt-interrupt.d.ts.map +1 -0
- package/dist/ui/runtime/prompt-interrupt.js +24 -0
- package/dist/ui/runtime/prompt-interrupt.js.map +1 -0
- package/dist/ui/runtime/run-clack-flow.d.ts.map +1 -1
- package/dist/ui/runtime/run-clack-flow.js +5 -2
- package/dist/ui/runtime/run-clack-flow.js.map +1 -1
- package/dist/ui/runtime/stdin-after-ink.d.ts +14 -1
- package/dist/ui/runtime/stdin-after-ink.d.ts.map +1 -1
- package/dist/ui/runtime/stdin-after-ink.js +44 -3
- package/dist/ui/runtime/stdin-after-ink.js.map +1 -1
- package/dist/unique-file-token.d.ts +10 -0
- package/dist/unique-file-token.d.ts.map +1 -0
- package/dist/unique-file-token.js +13 -0
- package/dist/unique-file-token.js.map +1 -0
- package/dist/url-safe-passwords.d.ts +25 -0
- package/dist/url-safe-passwords.d.ts.map +1 -0
- package/dist/url-safe-passwords.js +70 -0
- package/dist/url-safe-passwords.js.map +1 -0
- package/dist/valkey-sidecar.d.ts +33 -6
- package/dist/valkey-sidecar.d.ts.map +1 -1
- package/dist/valkey-sidecar.js +90 -61
- package/dist/valkey-sidecar.js.map +1 -1
- package/dist/worker-module-files.d.ts +3 -0
- package/dist/worker-module-files.d.ts.map +1 -0
- package/dist/worker-module-files.js +18 -0
- package/dist/worker-module-files.js.map +1 -0
- package/package.json +20 -7
- package/.turbo/turbo-build.log +0 -4
- package/.turbo/turbo-test.log +0 -583
- package/.turbo/turbo-typecheck.log +0 -4
- package/assets/supatype-logo-wordmark.ascii.txt +0 -6
- package/bin/dev-entry.ts +0 -3
- package/dist/functions-router-gen.d.ts +0 -14
- package/dist/functions-router-gen.d.ts.map +0 -1
- package/dist/functions-router-gen.js +0 -231
- package/dist/functions-router-gen.js.map +0 -1
- package/dist/supatype-eval-1781522769253.d.mts +0 -2
- package/dist/supatype-eval-1781522769253.d.mts.map +0 -1
- package/dist/supatype-eval-1781522769253.mjs +0 -3
- package/dist/supatype-eval-1781522769253.mjs.map +0 -1
- package/scripts/build-release-artifacts.sh +0 -112
- package/scripts/generate-homebrew-formula.mjs +0 -123
- package/scripts/mirror-deno-release.sh +0 -76
- package/src/TYPE-RESOLUTION.md +0 -294
- package/src/adopt-walkthrough.ts +0 -142
- package/src/api-config-cache.ts +0 -172
- package/src/app/framework.ts +0 -247
- package/src/app/proxy-dev-app.ts +0 -175
- package/src/app-config.ts +0 -208
- package/src/app-vite-env.ts +0 -27
- package/src/augmentation-generator.ts +0 -279
- package/src/binary-cache.ts +0 -998
- package/src/binary-download-lock.ts +0 -124
- package/src/cache-clean.ts +0 -81
- package/src/cache-identity-scope.ts +0 -92
- package/src/cache-pins.ts +0 -243
- package/src/cache-provider.ts +0 -61
- package/src/cli-artifacts.ts +0 -65
- package/src/cli-install-method.ts +0 -98
- package/src/cli-package-version.ts +0 -19
- package/src/cli-standalone.ts +0 -144
- package/src/cli-version-embedded.ts +0 -12
- package/src/cli.ts +0 -87
- package/src/client-generator.ts +0 -122
- package/src/cloud-credentials.ts +0 -183
- package/src/commands/add.ts +0 -105
- package/src/commands/admin.ts +0 -819
- package/src/commands/adopt.ts +0 -81
- package/src/commands/app.ts +0 -100
- package/src/commands/cache.ts +0 -233
- package/src/commands/cloud.ts +0 -299
- package/src/commands/db.ts +0 -301
- package/src/commands/deploy-types.ts +0 -49
- package/src/commands/deploy.ts +0 -464
- package/src/commands/dev.ts +0 -1217
- package/src/commands/diff.ts +0 -73
- package/src/commands/doctor.ts +0 -197
- package/src/commands/engine.ts +0 -31
- package/src/commands/functions.ts +0 -1010
- package/src/commands/generate.ts +0 -45
- package/src/commands/hooks.ts +0 -138
- package/src/commands/init.ts +0 -1537
- package/src/commands/internal.ts +0 -60
- package/src/commands/introspect.ts +0 -48
- package/src/commands/keys.ts +0 -269
- package/src/commands/link-helpers.ts +0 -281
- package/src/commands/login.ts +0 -127
- package/src/commands/logs.ts +0 -56
- package/src/commands/migrate-from-v1.ts +0 -132
- package/src/commands/migrate.ts +0 -231
- package/src/commands/pg.ts +0 -128
- package/src/commands/plugins.ts +0 -517
- package/src/commands/pull.ts +0 -46
- package/src/commands/push.ts +0 -427
- package/src/commands/seed.ts +0 -319
- package/src/commands/self-host.ts +0 -404
- package/src/commands/self-update.ts +0 -89
- package/src/commands/status.ts +0 -117
- package/src/commands/types.ts +0 -77
- package/src/commands/update.ts +0 -172
- package/src/components.ts +0 -6
- package/src/compose-local-server-image.ts +0 -85
- package/src/compose-rename.ts +0 -73
- package/src/compose-services.ts +0 -175
- package/src/config.ts +0 -276
- package/src/db-port.ts +0 -99
- package/src/db-preflight.ts +0 -663
- package/src/dev-compose.ts +0 -1650
- package/src/dev-db-reset.ts +0 -95
- package/src/dev-initial-push.ts +0 -134
- package/src/dev-log-bus.ts +0 -121
- package/src/dev-log-filter.ts +0 -74
- package/src/dev-logo.ts +0 -61
- package/src/dev-ports.ts +0 -271
- package/src/dev-ready-panel.ts +0 -80
- package/src/dev-session-lock.ts +0 -98
- package/src/dev-session.ts +0 -210
- package/src/dev-shutdown.ts +0 -159
- package/src/dev-task-colors.ts +0 -66
- package/src/diff-output.ts +0 -90
- package/src/docker-postgres.ts +0 -295
- package/src/docker-runtime.ts +0 -151
- package/src/engine-client.ts +0 -350
- package/src/engine-floor.ts +0 -261
- package/src/engine-push-output.ts +0 -98
- package/src/ensure-binary.ts +0 -68
- package/src/ensure-component-binaries.ts +0 -71
- package/src/ensure-dev-api-config.ts +0 -18
- package/src/env-file.ts +0 -183
- package/src/field-bounds.ts +0 -359
- package/src/field-masking-tier.ts +0 -107
- package/src/functions-context-refresh.ts +0 -25
- package/src/functions-deno-types.ts +0 -258
- package/src/functions-router-gen.ts +0 -256
- package/src/gitignore.ts +0 -76
- package/src/hook-upload.ts +0 -107
- package/src/hooks-generator.ts +0 -444
- package/src/host-database.ts +0 -176
- package/src/index.ts +0 -11
- package/src/init-dependency-versions.ts +0 -69
- package/src/init-package-json.ts +0 -63
- package/src/init-project-detect.ts +0 -99
- package/src/jwt.ts +0 -14
- package/src/kong-config.ts +0 -116
- package/src/link.ts +0 -250
- package/src/local-gateway.ts +0 -9
- package/src/local-secrets.ts +0 -104
- package/src/local-storage.ts +0 -14
- package/src/main.ts +0 -20
- package/src/model-cache.ts +0 -122
- package/src/model-hooks.ts +0 -430
- package/src/model-versioning.ts +0 -167
- package/src/pgbouncer-userlist.ts +0 -15
- package/src/postgres-ctl.ts +0 -333
- package/src/preview-config-check.ts +0 -52
- package/src/process-manager.ts +0 -224
- package/src/project-config.ts +0 -939
- package/src/prompts.ts +0 -2
- package/src/pull-utils.ts +0 -275
- package/src/realtime-launch.ts +0 -52
- package/src/release-pins.ts +0 -31
- package/src/release-public-key.ts +0 -12
- package/src/required-host-components.ts +0 -37
- package/src/resolve-api-url.ts +0 -44
- package/src/resolve-target.ts +0 -480
- package/src/rest-cache-admin.ts +0 -141
- package/src/restore-system-relation-targets.ts +0 -45
- package/src/retired-no-cache.ts +0 -27
- package/src/route-manifest.ts +0 -17
- package/src/runtime-routes.ts +0 -298
- package/src/schema-ast-v2.ts +0 -488
- package/src/schema-push-lock.ts +0 -170
- package/src/schema-sources.ts +0 -248
- package/src/scripts/postinstall.ts +0 -20
- package/src/seed-ir.ts +0 -311
- package/src/seed-runner.ts +0 -109
- package/src/seed.ts +0 -451
- package/src/self-host-compose.ts +0 -1246
- package/src/service-role-check.ts +0 -111
- package/src/storage-provision.ts +0 -90
- package/src/strict.ts +0 -40
- package/src/studio-admin-roles.ts +0 -30
- package/src/studio-dev-server.ts +0 -70
- package/src/supatype-eval-1781522769253.mts +0 -1
- package/src/systemd.ts +0 -137
- package/src/target-client.ts +0 -127
- package/src/tsx-runner.ts +0 -128
- package/src/type-extractor.ts +0 -3365
- package/src/type-generation.ts +0 -169
- package/src/type-resolver.ts +0 -457
- package/src/ui/README.md +0 -21
- package/src/ui/brand.ts +0 -6
- package/src/ui/clack-api.ts +0 -123
- package/src/ui/clack.ts +0 -153
- package/src/ui/components/FlowSpinner.tsx +0 -15
- package/src/ui/components/LogoWordmark.tsx +0 -36
- package/src/ui/components/PromptPanel.tsx +0 -17
- package/src/ui/components/SelectField.tsx +0 -58
- package/src/ui/confirm.ts +0 -39
- package/src/ui/dev/DevDashboard.tsx +0 -223
- package/src/ui/dev/DevReadyPanelView.tsx +0 -134
- package/src/ui/fatal.ts +0 -38
- package/src/ui/flows/FlowApp.tsx +0 -69
- package/src/ui/flows/prompt-fields.tsx +0 -198
- package/src/ui/flows/types.ts +0 -50
- package/src/ui/index.ts +0 -8
- package/src/ui/interactive.ts +0 -4
- package/src/ui/messages.ts +0 -85
- package/src/ui/next-steps.ts +0 -10
- package/src/ui/progress.ts +0 -39
- package/src/ui/prompts.ts +0 -48
- package/src/ui/runtime/cancel.ts +0 -6
- package/src/ui/runtime/command-chrome.ts +0 -147
- package/src/ui/runtime/dev-prompt-queue.ts +0 -84
- package/src/ui/runtime/flow-session.ts +0 -11
- package/src/ui/runtime/run-clack-flow.tsx +0 -65
- package/src/ui/runtime/stdin-after-ink.ts +0 -20
- package/src/ui/theme.ts +0 -41
- package/src/valkey-sidecar.ts +0 -126
- package/tests/access-composition.test.ts +0 -790
- package/tests/admin-ensure.test.ts +0 -139
- package/tests/admin-studio-membership.test.ts +0 -121
- package/tests/adopt-result.test.ts +0 -27
- package/tests/adopt-walkthrough.test.ts +0 -129
- package/tests/api-config-cache-seed.test.ts +0 -180
- package/tests/api-schemas.test.ts +0 -83
- package/tests/app-command.test.ts +0 -64
- package/tests/archive-name-alias.test.ts +0 -42
- package/tests/ast-derived-outputs.test.ts +0 -92
- package/tests/augmentation-generator.test.ts +0 -393
- package/tests/binary-cache-cloud-overrides.test.ts +0 -123
- package/tests/binary-download-lock.test.ts +0 -41
- package/tests/cache-clean.test.ts +0 -206
- package/tests/cache-identity-scope.test.ts +0 -61
- package/tests/cache-provider-config.test.ts +0 -132
- package/tests/cached-artifact-format.test.ts +0 -84
- package/tests/cli-help.test.ts +0 -170
- package/tests/cli-install-method.test.ts +0 -66
- package/tests/cli-package-version.test.ts +0 -15
- package/tests/client-generator.test.ts +0 -103
- package/tests/command-chrome-coverage.test.ts +0 -154
- package/tests/command-chrome-wrap.test.ts +0 -52
- package/tests/compose-parsable-defaults.test.ts +0 -60
- package/tests/compose-services.test.ts +0 -144
- package/tests/config-load-failure.test.ts +0 -44
- package/tests/config.test.ts +0 -301
- package/tests/db-port.test.ts +0 -128
- package/tests/db-preflight.test.ts +0 -152
- package/tests/db-published-and-addressable.test.ts +0 -69
- package/tests/dev-db-reset.test.ts +0 -162
- package/tests/dev-initial-push.test.ts +0 -142
- package/tests/dev-ports-owner.test.ts +0 -40
- package/tests/dev-ports.test.ts +0 -41
- package/tests/dev-ready-panel.test.ts +0 -37
- package/tests/dev-session-lock.test.ts +0 -54
- package/tests/dev-ui.test.ts +0 -202
- package/tests/docker-postgres.test.ts +0 -39
- package/tests/docker-runtime.test.ts +0 -225
- package/tests/doctor-render.test.ts +0 -62
- package/tests/doctor-service-role.test.ts +0 -55
- package/tests/engine-floor.test.ts +0 -238
- package/tests/engine-push-output.test.ts +0 -96
- package/tests/ensure-binary.test.ts +0 -59
- package/tests/ensure-dev-api-config.test.ts +0 -22
- package/tests/env-file.test.ts +0 -121
- package/tests/external-database-compose.test.ts +0 -262
- package/tests/external-database-config.test.ts +0 -154
- package/tests/field-bounds-matrix.test.ts +0 -163
- package/tests/field-bounds.test.ts +0 -139
- package/tests/field-masking-tier.test.ts +0 -184
- package/tests/field-validators.test.ts +0 -139
- package/tests/fixtures/identity-scope-corpus.json +0 -42
- package/tests/fixtures/seed_golden_ir.json +0 -186
- package/tests/functions-concurrency.test.ts +0 -71
- package/tests/functions-context-refresh.test.ts +0 -86
- package/tests/functions-deno-types.test.ts +0 -197
- package/tests/gitignore-secrets.test.ts +0 -90
- package/tests/homebrew-formula.test.ts +0 -100
- package/tests/hook-upload.test.ts +0 -125
- package/tests/hooks-generator.test.ts +0 -298
- package/tests/host-connection-targets.test.ts +0 -84
- package/tests/host-database.test.ts +0 -176
- package/tests/init-dependency-versions.test.ts +0 -62
- package/tests/init-package-json.test.ts +0 -18
- package/tests/init-project-detect.test.ts +0 -53
- package/tests/init.test.ts +0 -369
- package/tests/keys-write.test.ts +0 -148
- package/tests/keys.test.ts +0 -166
- package/tests/link.test.ts +0 -148
- package/tests/local-secrets.test.ts +0 -92
- package/tests/local-server-image-env.test.ts +0 -93
- package/tests/migrate-from-v1.test.ts +0 -29
- package/tests/minisign.test.ts +0 -102
- package/tests/model-cache-declaration.test.ts +0 -229
- package/tests/model-cache-manifest.test.ts +0 -99
- package/tests/model-constraints.test.ts +0 -293
- package/tests/model-hooks.test.ts +0 -433
- package/tests/model-versions.test.ts +0 -229
- package/tests/native-keyspace.test.ts +0 -130
- package/tests/normalize-admin-config.test.ts +0 -48
- package/tests/pg-spawn-env.test.ts +0 -18
- package/tests/port-in-use.test.ts +0 -58
- package/tests/postgres-archive-tag.test.ts +0 -9
- package/tests/preview-config-check.test.ts +0 -104
- package/tests/proxy-dev-app.test.ts +0 -77
- package/tests/pull-utils.test.ts +0 -151
- package/tests/readiness-poll.test.ts +0 -84
- package/tests/realtime-launch.test.ts +0 -25
- package/tests/release-pins.test.ts +0 -28
- package/tests/required-host-components.test.ts +0 -53
- package/tests/resolve-api-url.test.ts +0 -23
- package/tests/rest-cache-admin.test.ts +0 -64
- package/tests/retired-no-cache.test.ts +0 -46
- package/tests/route-manifest.test.ts +0 -29
- package/tests/runtime-contract.test.ts +0 -948
- package/tests/schema-sources.test.ts +0 -119
- package/tests/seed-discover.test.ts +0 -31
- package/tests/seed-ir.test.ts +0 -436
- package/tests/self-host-keys.test.ts +0 -92
- package/tests/service-role-check.test.ts +0 -109
- package/tests/service-role-routes.test.ts +0 -51
- package/tests/stdin-after-ink.test.ts +0 -8
- package/tests/storage-provision.test.ts +0 -100
- package/tests/strict.test.ts +0 -78
- package/tests/studio-admin-roles.test.ts +0 -59
- package/tests/target-client-refresh.test.ts +0 -94
- package/tests/tsconfig.json +0 -15
- package/tests/tsx-runner.test.ts +0 -66
- package/tests/type-extractor.test.ts +0 -1601
- package/tests/type-resolver.test.ts +0 -59
- package/tests/ui-confirm.test.ts +0 -45
- package/tests/ui-messages.test.ts +0 -52
- package/tsconfig.json +0 -11
- package/tsconfig.tsbuildinfo +0 -1
- package/vitest.config.ts +0 -21
package/dist/binary-cache.js
CHANGED
|
@@ -15,13 +15,19 @@
|
|
|
15
15
|
* the download errors out rather than silently degrading to SHA256-only.
|
|
16
16
|
* The only escape hatch is the explicit SUPATYPE_ALLOW_UNVERIFIED_DOWNLOADS=1.
|
|
17
17
|
*/
|
|
18
|
+
import { setTimeout as sleep } from "node:timers/promises";
|
|
18
19
|
import { createHash, createPublicKey, verify as cryptoVerify } from "node:crypto";
|
|
19
|
-
import {
|
|
20
|
+
import { isJsonObject } from "@supatype/shared";
|
|
21
|
+
import { errorMessage } from "./error-message.js";
|
|
22
|
+
import { readJsonObjectFile } from "./json-file.js";
|
|
23
|
+
import { progress } from "./ui/messages.js";
|
|
24
|
+
import { closeSync, copyFileSync, createWriteStream, existsSync, mkdirSync, openSync, readdirSync, readFileSync, readSync, rmdirSync, statSync, unlinkSync, writeFileSync, } from "node:fs";
|
|
20
25
|
import { chmod } from "node:fs/promises";
|
|
21
26
|
import { homedir } from "node:os";
|
|
22
|
-
import { basename, join, resolve, isAbsolute } from "node:path";
|
|
27
|
+
import { basename, dirname, join, resolve, isAbsolute } from "node:path";
|
|
23
28
|
import { loadProjectLink, migrateLegacyLinkFiles } from "./link.js";
|
|
24
29
|
import { releasePublicKey } from "./release-public-key.js";
|
|
30
|
+
import { defaultComponentVersion } from "./release-images.js";
|
|
25
31
|
import { isDownloadInProgress, releaseDownloadLock, tryAcquireDownloadLock, waitForComponentDownload, } from "./binary-download-lock.js";
|
|
26
32
|
/**
|
|
27
33
|
* Set `versions.{engine|server|postgres|deno}: VERSION_PIN_LOCAL` to mean “use `overrides.*` only”
|
|
@@ -64,6 +70,7 @@ export function describeActiveOverrides(config) {
|
|
|
64
70
|
add("postgres_dir", o.postgres_dir);
|
|
65
71
|
add("deno", o.deno);
|
|
66
72
|
add("realtime", o.realtime);
|
|
73
|
+
add("storage", o.storage);
|
|
67
74
|
add("studio", o.studio);
|
|
68
75
|
add("postgrest", o.postgrest);
|
|
69
76
|
return lines;
|
|
@@ -82,21 +89,15 @@ export function isLinkedToCloudProject(cwd, config) {
|
|
|
82
89
|
return true;
|
|
83
90
|
const linkedPath = join(cwd, ".supatype", "linked.json");
|
|
84
91
|
if (existsSync(linkedPath)) {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
return true;
|
|
89
|
-
}
|
|
90
|
-
catch { /* ignore */ }
|
|
92
|
+
const ref = readJsonObjectFile(linkedPath)?.["ref"];
|
|
93
|
+
if (typeof ref === "string" && ref.trim() !== "")
|
|
94
|
+
return true;
|
|
91
95
|
}
|
|
92
96
|
const cloudPath = join(cwd, ".supatype", "cloud.json");
|
|
93
97
|
if (existsSync(cloudPath)) {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
return true;
|
|
98
|
-
}
|
|
99
|
-
catch { /* ignore */ }
|
|
98
|
+
const slug = readJsonObjectFile(cloudPath)?.["projectSlug"];
|
|
99
|
+
if (typeof slug === "string" && slug.trim() !== "")
|
|
100
|
+
return true;
|
|
100
101
|
}
|
|
101
102
|
return false;
|
|
102
103
|
}
|
|
@@ -110,14 +111,6 @@ const CDN_BASE = "https://releases.supatype.com";
|
|
|
110
111
|
export function postgresArchiveTag(version) {
|
|
111
112
|
return version.split(".")[0];
|
|
112
113
|
}
|
|
113
|
-
// CDN path templates per component.
|
|
114
|
-
const CDN_PATHS = {
|
|
115
|
-
engine: (v, p) => `/engine/v${v}/supatype-engine-${p.os}-${p.arch}${p.os === "windows" ? ".exe" : ""}`,
|
|
116
|
-
server: (v, p) => `/server/v${v}/supatype-server-${p.os}-${p.arch}${p.os === "windows" ? ".exe" : ""}`,
|
|
117
|
-
postgres: (v, p) => `/postgres/v${v}/supatype-pg-${postgresArchiveTag(v)}-${p.os}-${p.arch}${p.os === "windows" ? ".zip" : ".tar.gz"}`,
|
|
118
|
-
deno: (v, p) => `/deno/v${v}/deno-${p.os}-${p.arch}${p.os === "windows" ? ".exe" : ""}`,
|
|
119
|
-
realtime: (v, p) => `/realtime/v${v}/supatype-realtime-${p.os}-${p.arch}${p.os === "windows" ? ".exe" : ""}`,
|
|
120
|
-
};
|
|
121
114
|
// Checksums file path (one per version directory, covers all platform binaries).
|
|
122
115
|
const checksumsDirPath = (component, version) => `/${component}/v${version}/checksums.sha256`;
|
|
123
116
|
// ---------------------------------------------------------------------------
|
|
@@ -132,6 +125,14 @@ export function cachePath(component, version) {
|
|
|
132
125
|
export function cachedBinaryPath(component, version, platform) {
|
|
133
126
|
return join(cachePath(component, version), binaryName(component, version, platform));
|
|
134
127
|
}
|
|
128
|
+
/**
|
|
129
|
+
* The version of a binary in the cache, read from its path (`<cache>/<component>/<version>/<file>`),
|
|
130
|
+
* or undefined for one elsewhere, such as an override. No lookup: the binary in hand is what runs.
|
|
131
|
+
*/
|
|
132
|
+
export function cachedVersionOf(component, binPath) {
|
|
133
|
+
const versionDir = dirname(binPath);
|
|
134
|
+
return dirname(versionDir) === join(cacheRoot(), component) ? basename(versionDir) : undefined;
|
|
135
|
+
}
|
|
135
136
|
/** True when the platform binary for `version` is present and passes format checks. */
|
|
136
137
|
export function isCachedBinaryReady(component, version, platform = currentPlatform()) {
|
|
137
138
|
const destPath = cachedBinaryPath(component, version, platform);
|
|
@@ -145,6 +146,7 @@ function binaryName(component, version, platform) {
|
|
|
145
146
|
case "postgres": return `supatype-pg-${postgresArchiveTag(version)}-${platform.os}-${platform.arch}${win ? ".zip" : ".tar.gz"}`;
|
|
146
147
|
case "deno": return `deno-${platform.os}-${platform.arch}${win ? ".exe" : ""}`;
|
|
147
148
|
case "realtime": return `supatype-realtime-${platform.os}-${platform.arch}${win ? ".exe" : ""}`;
|
|
149
|
+
case "storage": return `supatype-storage-${platform.os}-${platform.arch}${win ? ".zip" : ".tar.gz"}`;
|
|
148
150
|
}
|
|
149
151
|
}
|
|
150
152
|
/**
|
|
@@ -190,8 +192,11 @@ export function currentPlatform() {
|
|
|
190
192
|
* Resolve the binary path for a component.
|
|
191
193
|
*
|
|
192
194
|
* Resolution order:
|
|
193
|
-
* 1. config.overrides?.[component]: local build path (must exist)
|
|
194
|
-
*
|
|
195
|
+
* 1. config.overrides?.[component]: local build path (must exist). Looked at before any version is
|
|
196
|
+
* resolved, so an override never needs the CDN: offline, an unpinned project with an override
|
|
197
|
+
* used to fail looking up `latest`, and the engine client then fell back to whatever was cached.
|
|
198
|
+
* 2. Cached binary at ~/.supatype/cache/{component}/{version}/. Unpinned and offline, the newest
|
|
199
|
+
* cached version, since `latest` cannot be looked up.
|
|
195
200
|
* 3. Throws, so the caller should call download() first.
|
|
196
201
|
*
|
|
197
202
|
* Hard error if any meaningful `overrides` entry is set while the project is linked to cloud
|
|
@@ -205,8 +210,7 @@ export async function resolveBinary(component, config) {
|
|
|
205
210
|
"Remove overrides from supatype.config.ts / supatype.local.config.ts, or remove the cloud link files / clear project.ref.");
|
|
206
211
|
}
|
|
207
212
|
const overridePath = config.overrides?.[component === "postgres" ? "postgres_dir" : component];
|
|
208
|
-
|
|
209
|
-
if (version === VERSION_PIN_LOCAL && !overridePath) {
|
|
213
|
+
if (pinnedVersion(component, config) === VERSION_PIN_LOCAL && !overridePath) {
|
|
210
214
|
const key = component === "postgres" ? "postgres_dir" : component;
|
|
211
215
|
throw new Error(`[versions] versions.${component} is "${VERSION_PIN_LOCAL}" but overrides.${key} is not set. ` +
|
|
212
216
|
`Set overrides.${key} to your local build path, or pin a semver in versions.${component}.`);
|
|
@@ -243,11 +247,47 @@ export async function resolveBinary(component, config) {
|
|
|
243
247
|
return resolvedOverride;
|
|
244
248
|
}
|
|
245
249
|
const platform = currentPlatform();
|
|
250
|
+
let version;
|
|
251
|
+
try {
|
|
252
|
+
version = await resolveVersionFor(component, config);
|
|
253
|
+
}
|
|
254
|
+
catch (err) {
|
|
255
|
+
// Only an unpinned project looks anything up, so this is `latest` being unreachable.
|
|
256
|
+
const cached = newestCachedVersion(component, platform);
|
|
257
|
+
if (cached !== undefined)
|
|
258
|
+
return cachedBinaryPath(component, cached, platform);
|
|
259
|
+
const reason = errorMessage(err);
|
|
260
|
+
const key = component === "postgres" ? "postgres_dir" : component;
|
|
261
|
+
throw new Error(`Could not look up the latest ${component} release (${reason}), and no ${component} binary is cached. ` +
|
|
262
|
+
`Connect to the internet and run \`supatype update\`, or pin versions.${component} to a cached ` +
|
|
263
|
+
`release, or set overrides.${key} to a local build.`);
|
|
264
|
+
}
|
|
246
265
|
const binPath = cachedBinaryPath(component, version, platform);
|
|
247
266
|
if (existsSync(binPath))
|
|
248
267
|
return binPath;
|
|
249
268
|
throw new Error(`${component} v${version} not found in cache. Run: supatype update`);
|
|
250
269
|
}
|
|
270
|
+
/** The highest version of `component` with a binary for `platform` in the cache, if any. */
|
|
271
|
+
export function newestCachedVersion(component, platform) {
|
|
272
|
+
let versions;
|
|
273
|
+
try {
|
|
274
|
+
versions = readdirSync(join(cacheRoot(), component));
|
|
275
|
+
}
|
|
276
|
+
catch {
|
|
277
|
+
return undefined;
|
|
278
|
+
}
|
|
279
|
+
const numeric = (v) => v.replace(/^v/, "").split("-")[0].split(".").map((n) => Number.parseInt(n, 10) || 0);
|
|
280
|
+
const newestFirst = versions.sort((a, b) => {
|
|
281
|
+
const [x, y] = [numeric(a), numeric(b)];
|
|
282
|
+
for (let i = 0; i < Math.max(x.length, y.length); i += 1) {
|
|
283
|
+
const d = (y[i] ?? 0) - (x[i] ?? 0);
|
|
284
|
+
if (d !== 0)
|
|
285
|
+
return d;
|
|
286
|
+
}
|
|
287
|
+
return 0;
|
|
288
|
+
});
|
|
289
|
+
return newestFirst.find((v) => existsSync(cachedBinaryPath(component, v, platform)));
|
|
290
|
+
}
|
|
251
291
|
// ---------------------------------------------------------------------------
|
|
252
292
|
// Download + verify
|
|
253
293
|
// ---------------------------------------------------------------------------
|
|
@@ -261,7 +301,7 @@ export async function resolveBinary(component, config) {
|
|
|
261
301
|
*/
|
|
262
302
|
/** Download if missing or invalid; return cached path for the given platform. */
|
|
263
303
|
export async function ensureCachedBinary(component, version, platform) {
|
|
264
|
-
return download(component, version, platform);
|
|
304
|
+
return (await download(component, version, platform)).path;
|
|
265
305
|
}
|
|
266
306
|
async function acquireDownloadSlot(component, version, platform) {
|
|
267
307
|
const isReady = () => isCachedBinaryReady(component, version, platform);
|
|
@@ -271,9 +311,9 @@ async function acquireDownloadSlot(component, version, platform) {
|
|
|
271
311
|
if (tryAcquireDownloadLock(component, version))
|
|
272
312
|
return;
|
|
273
313
|
if (isDownloadInProgress(component, version)) {
|
|
274
|
-
|
|
314
|
+
progress(`${component} v${version} is downloading in another process, waiting...`);
|
|
275
315
|
const outcome = await waitForComponentDownload(component, version, isReady, (c) => {
|
|
276
|
-
|
|
316
|
+
progress(`Still waiting for ${c} download...`);
|
|
277
317
|
});
|
|
278
318
|
if (outcome === "ready")
|
|
279
319
|
return;
|
|
@@ -289,59 +329,74 @@ async function acquireDownloadSlot(component, version, platform) {
|
|
|
289
329
|
throw new Error(`Could not acquire download lock for ${component} v${version}. Run: supatype update`);
|
|
290
330
|
}
|
|
291
331
|
export async function download(component, version, platform) {
|
|
292
|
-
|
|
293
|
-
throw new Error(`cannot download CDN binary when version is "${VERSION_PIN_LOCAL}": set overrides.${component === "postgres" ? "postgres_dir" : component} or pin a semver`);
|
|
294
|
-
}
|
|
332
|
+
assertDownloadableVersion(component, version);
|
|
295
333
|
const dir = cachePath(component, version);
|
|
296
334
|
mkdirSync(dir, { recursive: true });
|
|
297
|
-
const
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
335
|
+
const destPath = join(dir, binaryName(component, version, platform));
|
|
336
|
+
if (keepCachedArtifact(component, version, destPath))
|
|
337
|
+
return { path: destPath, fetched: false };
|
|
338
|
+
await acquireDownloadSlot(component, version, platform);
|
|
339
|
+
// Another process fetched it while this one waited for the lock.
|
|
340
|
+
if (isCachedBinaryReady(component, version, platform))
|
|
341
|
+
return { path: destPath, fetched: false };
|
|
342
|
+
progress(`Downloading ${component} v${version} (${platform.os}/${platform.arch})...`);
|
|
343
|
+
const manifest = await fetchLeavingNoEmptyDir(component, version, platform, { dir, destPath });
|
|
344
|
+
if (component === "engine")
|
|
345
|
+
await saveEngineLicense(manifest, releaseDirUrl(component, version), dir);
|
|
346
|
+
return { path: destPath, fetched: true };
|
|
347
|
+
}
|
|
348
|
+
/** Refuse `local`, which names an override rather than a release the CDN has. */
|
|
349
|
+
function assertDownloadableVersion(component, version) {
|
|
350
|
+
if (version !== VERSION_PIN_LOCAL)
|
|
351
|
+
return;
|
|
352
|
+
throw new Error(`cannot download CDN binary when version is "${VERSION_PIN_LOCAL}": set overrides.${component === "postgres" ? "postgres_dir" : component} or pin a semver`);
|
|
353
|
+
}
|
|
354
|
+
/** {@link fetchIntoCache}, removing the version directory again when the fetch fails. */
|
|
355
|
+
async function fetchLeavingNoEmptyDir(component, version, platform, where) {
|
|
356
|
+
try {
|
|
357
|
+
return await fetchIntoCache(component, version, platform, where.destPath);
|
|
358
|
+
}
|
|
359
|
+
catch (err) {
|
|
360
|
+
// Never leave an empty version directory behind: a stale empty dir makes the next resolve
|
|
361
|
+
// look fine while silently lacking a binary. Only now, with the lock released: its file is in
|
|
362
|
+
// this directory, and removing the directory before it was gone failed every time.
|
|
363
|
+
try {
|
|
364
|
+
rmdirSync(where.dir);
|
|
303
365
|
}
|
|
304
|
-
|
|
305
|
-
|
|
366
|
+
catch { /* not empty, or already removed */ }
|
|
367
|
+
throw err;
|
|
306
368
|
}
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
369
|
+
}
|
|
370
|
+
/** True when `destPath` is a valid cached artifact; an invalid one is deleted for the download to replace. */
|
|
371
|
+
function keepCachedArtifact(component, version, destPath) {
|
|
372
|
+
if (!existsSync(destPath))
|
|
373
|
+
return false;
|
|
374
|
+
if (cachedArtifactLooksValid(component, destPath)) {
|
|
375
|
+
progress(`${component} v${version} already cached.`);
|
|
376
|
+
return true;
|
|
310
377
|
}
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
378
|
+
progress(`${component} v${version} cache invalid, re-downloading (${destPath}).`, "warn");
|
|
379
|
+
unlinkSync(destPath);
|
|
380
|
+
return false;
|
|
381
|
+
}
|
|
382
|
+
/**
|
|
383
|
+
* Fetch and verify `destPath`, holding the download lock, and release it whatever happens. On
|
|
384
|
+
* failure no partial binary is left, and the error keeps the one it wraps as its `cause`, so a
|
|
385
|
+
* caller can tell a release it cannot verify ({@link ReleaseVerificationError}) from a CDN it
|
|
386
|
+
* could not reach.
|
|
387
|
+
*/
|
|
388
|
+
async function fetchIntoCache(component, version, platform, destPath) {
|
|
314
389
|
const tmpPath = destPath + ".tmp";
|
|
315
390
|
try {
|
|
316
|
-
|
|
317
|
-
const match = await withRetry(() => fetchChecksums(checksumsUrl, minisigUrl, archiveNameCandidates(component, version, platform)));
|
|
318
|
-
// The directory from the path template, the filename from the manifest: a release published under
|
|
319
|
-
// a legacy name is fetched under that name rather than one the CLI assumed.
|
|
320
|
-
const cdnDir = CDN_PATHS[component](version, platform).replace(/\/[^/]+$/, "");
|
|
321
|
-
const binaryUrl = `${CDN_BASE}${cdnDir}/${match.filename}`;
|
|
322
|
-
// ── Stream-download binary with progress (retried on transient failures) ─
|
|
323
|
-
await withRetry(() => streamToFileWithProgress(binaryUrl, tmpPath));
|
|
324
|
-
// ── Verify SHA256 ────────────────────────────────────────────────────────
|
|
325
|
-
await verifyChecksum(tmpPath, match.checksum, component);
|
|
326
|
-
writeFileSync(destPath, readFileSync(tmpPath));
|
|
327
|
-
assertArtifactFormat(component, destPath, platform);
|
|
328
|
-
if (process.platform !== "win32" && EXECUTABLE_COMPONENTS.has(component)) {
|
|
329
|
-
await chmod(destPath, 0o755);
|
|
330
|
-
}
|
|
391
|
+
return await fetchVerifiedArtifact(component, version, platform, destPath, tmpPath);
|
|
331
392
|
}
|
|
332
393
|
catch (err) {
|
|
333
|
-
// Never leave a partial binary or an empty version directory behind: a stale
|
|
334
|
-
// empty dir makes the next resolve look fine while silently lacking a binary.
|
|
335
394
|
try {
|
|
336
395
|
if (existsSync(destPath))
|
|
337
396
|
unlinkSync(destPath);
|
|
338
397
|
}
|
|
339
398
|
catch { /* ignore */ }
|
|
340
|
-
|
|
341
|
-
rmdirSync(dir);
|
|
342
|
-
}
|
|
343
|
-
catch { /* dir not empty or already removed */ }
|
|
344
|
-
throw new Error(`Failed to download ${component} v${version} from ${CDN_BASE}: ${err.message}`);
|
|
399
|
+
throw new Error(`Failed to download ${component} v${version} from ${CDN_BASE}: ${errorMessage(err)}`, { cause: err });
|
|
345
400
|
}
|
|
346
401
|
finally {
|
|
347
402
|
releaseDownloadLock(component, version);
|
|
@@ -352,12 +407,77 @@ export async function download(component, version, platform) {
|
|
|
352
407
|
catch { /* ignore */ }
|
|
353
408
|
}
|
|
354
409
|
}
|
|
355
|
-
return destPath;
|
|
356
410
|
}
|
|
357
411
|
/**
|
|
358
|
-
*
|
|
359
|
-
*
|
|
412
|
+
* The release directory on the CDN, `<component>/v<version>`: a file is fetched there under the name
|
|
413
|
+
* the manifest gives it, so a release published under a legacy name is found under that name.
|
|
414
|
+
*/
|
|
415
|
+
function releaseDirUrl(component, version) {
|
|
416
|
+
return `${CDN_BASE}/${component}/v${version}`;
|
|
417
|
+
}
|
|
418
|
+
/**
|
|
419
|
+
* Fetch the signed manifest, then the artifact it names, verify both and install the artifact at
|
|
420
|
+
* `destPath`. Returns the manifest, which lists the release's other files too.
|
|
421
|
+
*
|
|
422
|
+
* The manifest fetch and the download are retried on transient failures; a manifest without this
|
|
423
|
+
* artifact is not, since asking again will not add it.
|
|
360
424
|
*/
|
|
425
|
+
async function fetchVerifiedArtifact(component, version, platform, destPath, tmpPath) {
|
|
426
|
+
const checksumsUrl = `${CDN_BASE}${checksumsDirPath(component, version)}`;
|
|
427
|
+
const manifest = await withRetry(() => fetchVerifiedChecksums(checksumsUrl, `${checksumsUrl}.minisig`));
|
|
428
|
+
const match = extractChecksum(manifest, archiveNameCandidates(component, version, platform));
|
|
429
|
+
const binaryUrl = `${releaseDirUrl(component, version)}/${match.filename}`;
|
|
430
|
+
await withRetry(() => streamToFileWithProgress(binaryUrl, tmpPath));
|
|
431
|
+
await verifyChecksum(tmpPath, match.checksum, component);
|
|
432
|
+
writeFileSync(destPath, readFileSync(tmpPath));
|
|
433
|
+
assertArtifactFormat(component, destPath, platform);
|
|
434
|
+
if (process.platform !== "win32" && EXECUTABLE_COMPONENTS.has(component)) {
|
|
435
|
+
await chmod(destPath, 0o755);
|
|
436
|
+
}
|
|
437
|
+
return manifest;
|
|
438
|
+
}
|
|
439
|
+
/** The engine's licence file, as its release publishes it and as it is kept beside the binary. */
|
|
440
|
+
const ENGINE_LICENSE_FILE = "LICENSE";
|
|
441
|
+
/**
|
|
442
|
+
* Save the engine's LICENSE beside the binary just downloaded, and say once what it is.
|
|
443
|
+
*
|
|
444
|
+
* The engine is BUSL-1.1 and its release publishes the licence in the same signed manifest as the
|
|
445
|
+
* binaries, so it is checked the same way. Never fatal: a release from before the licence was
|
|
446
|
+
* published has none, and the engine it ships is still the engine asked for. That case warns
|
|
447
|
+
* instead, and so does a licence that fails its checksum, which is not saved.
|
|
448
|
+
*/
|
|
449
|
+
async function saveEngineLicense(manifest, releaseUrl, dir) {
|
|
450
|
+
const target = join(dir, ENGINE_LICENSE_FILE);
|
|
451
|
+
const problem = await fetchEngineLicense(manifest, releaseUrl, target);
|
|
452
|
+
if (problem !== undefined) {
|
|
453
|
+
console.warn(`[supatype] The engine's ${ENGINE_LICENSE_FILE} was not saved: ${problem}. The engine is licensed under BUSL-1.1.`);
|
|
454
|
+
return;
|
|
455
|
+
}
|
|
456
|
+
progress(`Supatype engine is licensed under BUSL-1.1; see ${target}`);
|
|
457
|
+
}
|
|
458
|
+
/** Download and verify the LICENSE into `target`; the reason it could not be, or undefined. */
|
|
459
|
+
async function fetchEngineLicense(manifest, releaseUrl, target) {
|
|
460
|
+
let expected;
|
|
461
|
+
try {
|
|
462
|
+
expected = extractChecksum(manifest, ENGINE_LICENSE_FILE).checksum;
|
|
463
|
+
}
|
|
464
|
+
catch {
|
|
465
|
+
return "this release does not publish one";
|
|
466
|
+
}
|
|
467
|
+
try {
|
|
468
|
+
const resp = await fetch(`${releaseUrl}/${ENGINE_LICENSE_FILE}`);
|
|
469
|
+
if (!resp.ok)
|
|
470
|
+
return `HTTP ${resp.status} from ${releaseUrl}/${ENGINE_LICENSE_FILE}`;
|
|
471
|
+
const body = Buffer.from(await resp.arrayBuffer());
|
|
472
|
+
if (createHash("sha256").update(body).digest("hex") !== expected)
|
|
473
|
+
return "it does not match the signed checksum";
|
|
474
|
+
writeFileSync(target, body);
|
|
475
|
+
return undefined;
|
|
476
|
+
}
|
|
477
|
+
catch (err) {
|
|
478
|
+
return errorMessage(err);
|
|
479
|
+
}
|
|
480
|
+
}
|
|
361
481
|
/**
|
|
362
482
|
* Fetch a checksums manifest and verify its minisign signature, returning the entry for one of
|
|
363
483
|
* `binaryFilenames`.
|
|
@@ -367,6 +487,25 @@ export async function download(component, version, platform) {
|
|
|
367
487
|
* than about overwriting its own executable.
|
|
368
488
|
*/
|
|
369
489
|
export async function fetchChecksums(checksumsUrl, minisigUrl, binaryFilenames) {
|
|
490
|
+
return extractChecksum(await fetchVerifiedChecksums(checksumsUrl, minisigUrl), binaryFilenames);
|
|
491
|
+
}
|
|
492
|
+
/**
|
|
493
|
+
* A release this CLI cannot verify, for a reason no retry changes: retried, it cost four seconds
|
|
494
|
+
* and three identical messages. `advice` is what to do instead of waiting for the CDN.
|
|
495
|
+
*/
|
|
496
|
+
export class ReleaseVerificationError extends Error {
|
|
497
|
+
advice;
|
|
498
|
+
constructor(message, advice) {
|
|
499
|
+
super(message);
|
|
500
|
+
this.advice = advice;
|
|
501
|
+
this.name = "ReleaseVerificationError";
|
|
502
|
+
}
|
|
503
|
+
}
|
|
504
|
+
/**
|
|
505
|
+
* The checksums manifest, its signature verified, as text. One release's manifest covers every file
|
|
506
|
+
* in it, the engine's LICENSE included, so a caller that needs two entries fetches it once.
|
|
507
|
+
*/
|
|
508
|
+
async function fetchVerifiedChecksums(checksumsUrl, minisigUrl) {
|
|
370
509
|
const csResp = await fetch(checksumsUrl);
|
|
371
510
|
if (!csResp.ok) {
|
|
372
511
|
throw new Error(`Failed to fetch checksums from ${checksumsUrl}: HTTP ${csResp.status}`);
|
|
@@ -380,12 +519,12 @@ export async function fetchChecksums(checksumsUrl, minisigUrl, binaryFilenames)
|
|
|
380
519
|
if (process.env["SUPATYPE_ALLOW_UNVERIFIED_DOWNLOADS"] === "1") {
|
|
381
520
|
console.warn("[supatype] \u26a0 SUPATYPE_ALLOW_UNVERIFIED_DOWNLOADS=1: no minisign public " +
|
|
382
521
|
"key configured; verifying SHA256 only (authenticity NOT checked).");
|
|
383
|
-
return
|
|
522
|
+
return checksumsText;
|
|
384
523
|
}
|
|
385
|
-
throw new
|
|
524
|
+
throw new ReleaseVerificationError("No minisign public key configured, so cannot verify release authenticity.\n" +
|
|
386
525
|
"Published @supatype/cli builds embed the key automatically; if you are building " +
|
|
387
526
|
"from source, set SUPATYPE_RELEASE_PUBLIC_KEY to the release public key, or set " +
|
|
388
|
-
"SUPATYPE_ALLOW_UNVERIFIED_DOWNLOADS=1 to download with SHA256-only verification (unsafe).");
|
|
527
|
+
"SUPATYPE_ALLOW_UNVERIFIED_DOWNLOADS=1 to download with SHA256-only verification (unsafe).", "Set SUPATYPE_RELEASE_PUBLIC_KEY to the release public key, then run `supatype update` again.");
|
|
389
528
|
}
|
|
390
529
|
// Minisign signature is mandatory when a public key is configured.
|
|
391
530
|
const sigResp = await fetch(minisigUrl);
|
|
@@ -395,7 +534,7 @@ export async function fetchChecksums(checksumsUrl, minisigUrl, binaryFilenames)
|
|
|
395
534
|
}
|
|
396
535
|
const sigText = await sigResp.text();
|
|
397
536
|
verifyMinisign(Buffer.from(checksumsText, "utf8"), sigText, pubKey);
|
|
398
|
-
return
|
|
537
|
+
return checksumsText;
|
|
399
538
|
}
|
|
400
539
|
// ---------------------------------------------------------------------------
|
|
401
540
|
// Minisign signature verification (pure Node.js, no external deps)
|
|
@@ -503,9 +642,13 @@ async function streamToFileWithProgress(url, destPath) {
|
|
|
503
642
|
const reader = resp.body.getReader();
|
|
504
643
|
try {
|
|
505
644
|
while (true) {
|
|
506
|
-
|
|
507
|
-
|
|
645
|
+
// Node types a fetch body's chunks as `any`; a byte stream yields `Uint8Array`, so check it.
|
|
646
|
+
const chunk = await reader.read();
|
|
647
|
+
if (chunk.done)
|
|
508
648
|
break;
|
|
649
|
+
const value = chunk.value;
|
|
650
|
+
if (!(value instanceof Uint8Array))
|
|
651
|
+
throw new Error(`Download of ${url} yielded a chunk that is not bytes`);
|
|
509
652
|
await new Promise((res, rej) => {
|
|
510
653
|
file.write(value, (err) => (err ? rej(err) : res()));
|
|
511
654
|
});
|
|
@@ -552,15 +695,12 @@ export function validateArtifactFormat(component, filePath, platform) {
|
|
|
552
695
|
/**
|
|
553
696
|
* Per-component CDN artifact shapes:
|
|
554
697
|
* engine, server, deno, realtime: native executable (ELF / Mach-O / PE)
|
|
555
|
-
* postgres (unix) .tar.gz (gzip)
|
|
556
|
-
* postgres (windows) .zip
|
|
698
|
+
* postgres, storage (unix) .tar.gz (gzip)
|
|
699
|
+
* postgres, storage (windows) .zip
|
|
557
700
|
*/
|
|
558
701
|
function assertArtifactFormat(component, filePath, platform) {
|
|
559
|
-
if (component === "postgres") {
|
|
560
|
-
|
|
561
|
-
assertZipArchive(filePath);
|
|
562
|
-
else
|
|
563
|
-
assertGzipArchive(filePath);
|
|
702
|
+
if (component === "postgres" || component === "storage") {
|
|
703
|
+
assertArchive(filePath, component, platform.os === "windows" ? "zip" : "gzip");
|
|
564
704
|
return;
|
|
565
705
|
}
|
|
566
706
|
if (EXECUTABLE_COMPONENTS.has(component)) {
|
|
@@ -568,29 +708,17 @@ function assertArtifactFormat(component, filePath, platform) {
|
|
|
568
708
|
return;
|
|
569
709
|
}
|
|
570
710
|
}
|
|
571
|
-
/**
|
|
572
|
-
|
|
711
|
+
/** The first bytes of each archive format a component ships in. */
|
|
712
|
+
const ARCHIVE_MAGIC = { gzip: [0x1f, 0x8b], zip: [0x50, 0x4b] };
|
|
713
|
+
/** Reject HTML/error pages or a corrupt archive on CDN: a .tar.gz, or a .zip for Windows. */
|
|
714
|
+
function assertArchive(filePath, component, kind) {
|
|
715
|
+
const expected = ARCHIVE_MAGIC[kind];
|
|
573
716
|
const fd = openSync(filePath, "r");
|
|
574
717
|
try {
|
|
575
|
-
const magic = Buffer.alloc(
|
|
576
|
-
readSync(fd, magic, 0,
|
|
577
|
-
if (
|
|
578
|
-
throw new Error(
|
|
579
|
-
"The CDN object may be corrupt or cached HTML, so delete ~/.supatype/cache and retry.");
|
|
580
|
-
}
|
|
581
|
-
}
|
|
582
|
-
finally {
|
|
583
|
-
closeSync(fd);
|
|
584
|
-
}
|
|
585
|
-
}
|
|
586
|
-
/** Reject corrupt postgres .zip on CDN (Windows bundles). */
|
|
587
|
-
function assertZipArchive(filePath) {
|
|
588
|
-
const fd = openSync(filePath, "r");
|
|
589
|
-
try {
|
|
590
|
-
const magic = Buffer.alloc(4);
|
|
591
|
-
readSync(fd, magic, 0, 4, 0);
|
|
592
|
-
if (magic[0] !== 0x50 || magic[1] !== 0x4b) {
|
|
593
|
-
throw new Error("Downloaded postgres file is not a zip archive (bad magic bytes). " +
|
|
718
|
+
const magic = Buffer.alloc(expected.length);
|
|
719
|
+
readSync(fd, magic, 0, expected.length, 0);
|
|
720
|
+
if (expected.some((byte, i) => magic[i] !== byte)) {
|
|
721
|
+
throw new Error(`Downloaded ${component} file is not a ${kind} archive (bad magic bytes). ` +
|
|
594
722
|
"The CDN object may be corrupt or cached HTML, so delete ~/.supatype/cache and retry.");
|
|
595
723
|
}
|
|
596
724
|
}
|
|
@@ -656,12 +784,12 @@ async function withRetry(fn, attempts = 3) {
|
|
|
656
784
|
return await fn();
|
|
657
785
|
}
|
|
658
786
|
catch (err) {
|
|
659
|
-
if (i === attempts)
|
|
787
|
+
if (i === attempts || err instanceof ReleaseVerificationError)
|
|
660
788
|
throw err;
|
|
661
789
|
const delay = Math.pow(3, i - 1) * 1_000; // 1 s, 3 s, 9 s
|
|
662
|
-
console.error(`[supatype] Download attempt ${i}/${attempts} failed: ${err
|
|
790
|
+
console.error(`[supatype] Download attempt ${i}/${attempts} failed: ${errorMessage(err)}. ` +
|
|
663
791
|
`Retrying in ${delay / 1_000}s...`);
|
|
664
|
-
await
|
|
792
|
+
await sleep(delay);
|
|
665
793
|
}
|
|
666
794
|
}
|
|
667
795
|
throw new Error("unreachable");
|
|
@@ -693,12 +821,17 @@ export function pinnedVersion(component, config) {
|
|
|
693
821
|
const trimmed = version.trim();
|
|
694
822
|
return trimmed === "" ? undefined : trimmed;
|
|
695
823
|
}
|
|
696
|
-
/**
|
|
824
|
+
/**
|
|
825
|
+
* Pinned version from config; else the version this CLI release was tested with (the engine, server
|
|
826
|
+
* and Postgres it pins, and a release's own realtime); else, for Deno and a non-release realtime,
|
|
827
|
+
* the CDN's latest. The engine used to come from the CDN's latest too, so a host binary moved under
|
|
828
|
+
* an unchanged CLI and disagreed with the engine image the compose push ran.
|
|
829
|
+
*/
|
|
697
830
|
export async function resolveVersionFor(component, config) {
|
|
698
831
|
const pinned = pinnedVersion(component, config);
|
|
699
832
|
if (pinned)
|
|
700
833
|
return pinned;
|
|
701
|
-
return fetchLatestVersion(component);
|
|
834
|
+
return defaultComponentVersion(component) ?? fetchLatestVersion(component);
|
|
702
835
|
}
|
|
703
836
|
/** @deprecated Prefer {@link pinnedVersion} or {@link resolveVersionFor}. */
|
|
704
837
|
export function versionFor(component, config) {
|
|
@@ -721,11 +854,16 @@ export async function fetchLatestVersion(component) {
|
|
|
721
854
|
if (!resp.ok) {
|
|
722
855
|
throw new Error(`Failed to fetch latest version for ${component} from ${url}: HTTP ${resp.status}`);
|
|
723
856
|
}
|
|
857
|
+
return readLatestVersion(resp, `latest.json for ${component}`);
|
|
858
|
+
}
|
|
859
|
+
/** The version a CDN `latest.json` (`{"version":"x.y.z"}`) names, or a throw naming the file. */
|
|
860
|
+
export async function readLatestVersion(resp, what) {
|
|
724
861
|
const data = await resp.json();
|
|
725
|
-
|
|
726
|
-
|
|
862
|
+
const version = isJsonObject(data) ? data["version"] : undefined;
|
|
863
|
+
if (typeof version !== "string" || version.trim() === "") {
|
|
864
|
+
throw new Error(`Invalid ${what}: missing "version" field`);
|
|
727
865
|
}
|
|
728
|
-
return
|
|
866
|
+
return version.trim();
|
|
729
867
|
}
|
|
730
868
|
/** Fetch the latest version for all components concurrently. Missing CDN entries are omitted. */
|
|
731
869
|
export async function fetchAllLatestVersions() {
|
|
@@ -781,14 +919,14 @@ export async function downloadAll(versions, graceful = false) {
|
|
|
781
919
|
const components = [...BINARY_COMPONENTS];
|
|
782
920
|
const latest = await fetchAllLatestVersions();
|
|
783
921
|
for (const component of components) {
|
|
784
|
-
const version = versions?.[component] ?? latest[component];
|
|
922
|
+
const version = versions?.[component] ?? defaultComponentVersion(component) ?? latest[component];
|
|
785
923
|
if (!version || version === VERSION_PIN_LOCAL)
|
|
786
924
|
continue;
|
|
787
925
|
try {
|
|
788
926
|
await download(component, version, platform);
|
|
789
927
|
}
|
|
790
928
|
catch (err) {
|
|
791
|
-
const msg = `[supatype] Failed to download ${component}: ${err
|
|
929
|
+
const msg = `[supatype] Failed to download ${component}: ${errorMessage(err)}`;
|
|
792
930
|
if (graceful) {
|
|
793
931
|
console.error(msg);
|
|
794
932
|
}
|