@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
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Role fixes applied inside the project's `db` container on every start, as the bundled superuser.
|
|
3
|
+
*/
|
|
4
|
+
import { dirname } from "node:path";
|
|
5
|
+
import { askDockerSync, DOCKER_EXEC_TIMEOUT_MS } from "./docker-exec.js";
|
|
6
|
+
import { spawnFailureText } from "./error-message.js";
|
|
7
|
+
import { SQL_EDITOR_PASSWORD_ENV, devAuthenticatorPassword, devDatabaseIdentity, devSqlEditorPassword, } from "./local-secrets.js";
|
|
8
|
+
import { degraded } from "./strict.js";
|
|
9
|
+
import { dockerEnv } from "./docker-env.js";
|
|
10
|
+
import { PRIVATE_TABLE_DEFAULTS_SQL } from "./native-roles-sql.js";
|
|
11
|
+
const RECONCILE_AUTHENTICATOR_SQL = [
|
|
12
|
+
"\\getenv pw SUPATYPE_AUTHENTICATOR_PASSWORD",
|
|
13
|
+
"ALTER ROLE authenticator WITH LOGIN PASSWORD :'pw';",
|
|
14
|
+
"",
|
|
15
|
+
].join("\n");
|
|
16
|
+
// `\gexec` rather than a DO block: psql does not interpolate `:'pw'` inside a dollar-quoted body.
|
|
17
|
+
// The WHERE clause yields no statement at all on a volume whose image predates the role.
|
|
18
|
+
const RECONCILE_SQL_EDITOR_SQL = [
|
|
19
|
+
`\\getenv pw ${SQL_EDITOR_PASSWORD_ENV}`,
|
|
20
|
+
"SELECT format('ALTER ROLE supatype_sql_editor WITH LOGIN PASSWORD %L', :'pw')",
|
|
21
|
+
"WHERE EXISTS (SELECT FROM pg_roles WHERE rolname = 'supatype_sql_editor')",
|
|
22
|
+
"\\gexec",
|
|
23
|
+
"",
|
|
24
|
+
].join("\n");
|
|
25
|
+
const GRANT_AUTH_SCHEMA_SQL = [
|
|
26
|
+
"GRANT USAGE ON SCHEMA auth TO service_role;",
|
|
27
|
+
"GRANT SELECT ON auth.users TO service_role;",
|
|
28
|
+
"",
|
|
29
|
+
].join("\n");
|
|
30
|
+
/**
|
|
31
|
+
* Run `sql` through `psql` in the `db` container, as the bundled superuser, against the project's
|
|
32
|
+
* database.
|
|
33
|
+
*
|
|
34
|
+
* The password and `env` reach the container as bare `-e NAME` flags with the values in docker's
|
|
35
|
+
* own environment, so a script can read a secret with `\getenv` and neither it nor the password is
|
|
36
|
+
* on docker's command line, where any local user could read it from the process list.
|
|
37
|
+
*/
|
|
38
|
+
function runOwnerPsql(paths, cwd, composeProject, sql, env = {}) {
|
|
39
|
+
const { user, password, database } = devDatabaseIdentity(cwd);
|
|
40
|
+
const secrets = dockerEnv({ PGPASSWORD: password, ...env });
|
|
41
|
+
return askDockerSync([
|
|
42
|
+
"compose", "-p", composeProject, "-f", paths.composePath,
|
|
43
|
+
"exec", "-T", ...secrets.args,
|
|
44
|
+
"db", "psql", "-v", "ON_ERROR_STOP=1", "-U", user, "-d", database,
|
|
45
|
+
], { cwd: dirname(paths.composePath), timeoutMs: DOCKER_EXEC_TIMEOUT_MS, input: sql, env: secrets.env });
|
|
46
|
+
}
|
|
47
|
+
/** Why a `docker` call failed, from whatever it said. */
|
|
48
|
+
function failureDetail(result) {
|
|
49
|
+
return spawnFailureText({ ...result, stdout: "" });
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Set `authenticator`'s password to the one `.env` holds, every time the stack starts.
|
|
53
|
+
*
|
|
54
|
+
* The Postgres image passwords that role from `AUTHENTICATOR_PASSWORD` in its init scripts, which
|
|
55
|
+
* run once, on an empty data directory. So the value the role actually has is whatever `.env` said
|
|
56
|
+
* the day the volume was created, and `.env` can move afterwards. When the two diverge PostgREST
|
|
57
|
+
* cannot log in, exits, and every REST request answers 502 with the real reason visible only in a
|
|
58
|
+
* container log the developer has no reason to read.
|
|
59
|
+
*
|
|
60
|
+
* Reconciling here makes `.env` the answer to what the password is, rather than the volume's
|
|
61
|
+
* birthday. It is idempotent, and it runs before the schema push so the API is already reachable by
|
|
62
|
+
* the time the stack reports ready.
|
|
63
|
+
*/
|
|
64
|
+
export function reconcileAuthenticatorPassword(paths, cwd, composeProject) {
|
|
65
|
+
const result = runOwnerPsql(paths, cwd, composeProject, RECONCILE_AUTHENTICATOR_SQL, {
|
|
66
|
+
SUPATYPE_AUTHENTICATOR_PASSWORD: devAuthenticatorPassword(cwd),
|
|
67
|
+
});
|
|
68
|
+
if (result.status !== 0) {
|
|
69
|
+
degraded("Could not set the authenticator password, so the REST API will answer 502", failureDetail(result));
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Set `supatype_sql_editor`'s password to the one `.env` holds, every time the stack starts.
|
|
74
|
+
*
|
|
75
|
+
* The image passwords that role once, at bootstrap, so the same drift as
|
|
76
|
+
* {@link reconcileAuthenticatorPassword} applies: a `.env` that moved after the volume was made
|
|
77
|
+
* leaves Studio's SQL editor unable to log in. Skipped when the role does not exist yet.
|
|
78
|
+
*/
|
|
79
|
+
export function reconcileSqlEditorPassword(paths, cwd, composeProject) {
|
|
80
|
+
const result = runOwnerPsql(paths, cwd, composeProject, RECONCILE_SQL_EDITOR_SQL, {
|
|
81
|
+
[SQL_EDITOR_PASSWORD_ENV]: devSqlEditorPassword(cwd),
|
|
82
|
+
});
|
|
83
|
+
if (result.status !== 0) {
|
|
84
|
+
degraded("Could not set the SQL editor password, so Studio's SQL editor cannot connect", failureDetail(result));
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Let `service_role` read `auth.users`, which Studio's relation preview resolves a user relation
|
|
89
|
+
* through.
|
|
90
|
+
*/
|
|
91
|
+
export function grantAuthSchemaAccess(paths, cwd, composeProject) {
|
|
92
|
+
const result = runOwnerPsql(paths, cwd, composeProject, GRANT_AUTH_SCHEMA_SQL);
|
|
93
|
+
if (result.status !== 0) {
|
|
94
|
+
degraded("Could not grant service_role access to auth.users, so Studio's relation preview cannot read users", failureDetail(result));
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Give tables in `public` to `service_role` only by default (CL-N2). The Postgres image grants
|
|
99
|
+
* every privilege on new tables to `anon` and `authenticated`, so a table made by hand in dev was
|
|
100
|
+
* open to anyone holding the anon key; a model table's grants come from the engine instead.
|
|
101
|
+
* Idempotent, and run on every start, so a database created before this changes too.
|
|
102
|
+
*/
|
|
103
|
+
export function privatizeTableDefaults(paths, cwd, composeProject) {
|
|
104
|
+
const result = runOwnerPsql(paths, cwd, composeProject, PRIVATE_TABLE_DEFAULTS_SQL);
|
|
105
|
+
if (result.status !== 0) {
|
|
106
|
+
degraded("Could not take anon and authenticated out of the default table privileges, so a table made by hand is readable with the anon key", failureDetail(result));
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
//# sourceMappingURL=compose-db-roles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compose-db-roles.js","sourceRoot":"","sources":["../src/compose-db-roles.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,aAAa,EAAE,sBAAsB,EAAqB,MAAM,kBAAkB,CAAA;AAC3F,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AACrD,OAAO,EACL,uBAAuB,EACvB,wBAAwB,EACxB,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,oBAAoB,CAAA;AAE3B,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AACtC,OA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AAED;;;;;GAKG;AACH,MAAM,UAAU,sBAAsB,CAAC,KAAoB,EAAE,GAAW,EAAE,cAAsB;IAC9F,MAAM,MAAM,GAAG,YAAY,CAAC,KAAK,EAAE,GAAG,EAAE,cAAc,EAAE,0BAA0B,CAAC,CAAA;IACnF,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACxB,QAAQ,CACN,kIAAkI,EAClI,aAAa,CAAC,MAAM,CAAC,CACtB,CAAA;IACH,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The schema engine run once in a stack's compose `tools` profile, or, for a run that needs no
|
|
3
|
+
* database, its image alone.
|
|
4
|
+
*/
|
|
5
|
+
import { type DockerAnswer } from "./docker-exec.js";
|
|
6
|
+
/** Which stack, and the engine image to run in it (none: the compose file's default). */
|
|
7
|
+
export interface ComposeEngineTarget {
|
|
8
|
+
cwd: string;
|
|
9
|
+
project: string;
|
|
10
|
+
composePath: string;
|
|
11
|
+
engineImage: string | undefined;
|
|
12
|
+
}
|
|
13
|
+
/** How one run is started, beyond the engine's own arguments. */
|
|
14
|
+
export interface ComposeEngineSpawn {
|
|
15
|
+
/** Flags for `docker compose run` before the service name, such as `-T` or `--no-deps`. */
|
|
16
|
+
runFlags?: readonly string[];
|
|
17
|
+
/** Variables for the engine, each a bare `-e NAME` with its value in docker's environment. */
|
|
18
|
+
secrets?: Record<string, string>;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* `docker compose run --rm schema-engine ...engineArgs` in `target`'s `tools` profile. A `--no-deps`
|
|
22
|
+
* run needs nothing else the stack runs, so it runs the image alone (`runEngineImageAlone`).
|
|
23
|
+
*
|
|
24
|
+
* A value in `spawn.secrets`, such as the database URL with its password, never reaches docker's
|
|
25
|
+
* command line, where any local user could read it from the process list.
|
|
26
|
+
*/
|
|
27
|
+
export declare function spawnComposeEngine(target: ComposeEngineTarget, engineArgs: readonly string[], spawn?: ComposeEngineSpawn): DockerAnswer;
|
|
28
|
+
//# sourceMappingURL=compose-engine-run.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compose-engine-run.d.ts","sourceRoot":"","sources":["../src/compose-engine-run.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAOH,OAAO,EAAkC,KAAK,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAGpF,yFAAyF;AACzF,MAAM,WAAW,mBAAmB;IAClC,GAAG,EAAE,MAAM,CAAA;IACX,OAAO,EAAE,MAAM,CAAA;IACf,WAAW,EAAE,MAAM,CAAA;IACnB,WAAW,EAAE,MAAM,GAAG,SAAS,CAAA;CAChC;AAED,iEAAiE;AACjE,MAAM,WAAW,kBAAkB;IACjC,2FAA2F;IAC3F,QAAQ,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;IAC5B,8FAA8F;IAC9F,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CACjC;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,mBAAmB,EAC3B,UAAU,EAAE,SAAS,MAAM,EAAE,EAC7B,KAAK,GAAE,kBAAuB,GAC7B,YAAY,CAed"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The schema engine run once in a stack's compose `tools` profile, or, for a run that needs no
|
|
3
|
+
* database, its image alone.
|
|
4
|
+
*/
|
|
5
|
+
import { existsSync } from "node:fs";
|
|
6
|
+
import { resolve } from "node:path";
|
|
7
|
+
import { ENGINE_SERVICE } from "./compose-engine-service.js";
|
|
8
|
+
import { composeHostPath } from "./compose-host-path.js";
|
|
9
|
+
import { dockerEnv } from "./docker-env.js";
|
|
10
|
+
import { askDockerSync, NO_DOCKER_LIMIT } from "./docker-exec.js";
|
|
11
|
+
import { readEnvFile } from "./env-file.js";
|
|
12
|
+
/**
|
|
13
|
+
* `docker compose run --rm schema-engine ...engineArgs` in `target`'s `tools` profile. A `--no-deps`
|
|
14
|
+
* run needs nothing else the stack runs, so it runs the image alone (`runEngineImageAlone`).
|
|
15
|
+
*
|
|
16
|
+
* A value in `spawn.secrets`, such as the database URL with its password, never reaches docker's
|
|
17
|
+
* command line, where any local user could read it from the process list.
|
|
18
|
+
*/
|
|
19
|
+
export function spawnComposeEngine(target, engineArgs, spawn = {}) {
|
|
20
|
+
const { cwd, project, composePath, engineImage } = target;
|
|
21
|
+
const runFlags = spawn.runFlags ?? [];
|
|
22
|
+
if (runFlags.includes("--no-deps"))
|
|
23
|
+
return runEngineImageAlone(target, engineArgs, spawn.secrets ?? {});
|
|
24
|
+
const envFile = resolve(cwd, ".env");
|
|
25
|
+
const args = ["compose", "--progress", "quiet"];
|
|
26
|
+
if (project)
|
|
27
|
+
args.push("-p", project);
|
|
28
|
+
args.push("--project-directory", cwd, "-f", composePath);
|
|
29
|
+
if (existsSync(envFile))
|
|
30
|
+
args.push("--env-file", envFile);
|
|
31
|
+
const secrets = dockerEnv(spawn.secrets ?? {}, { ...process.env, COMPOSE_PROGRESS: "quiet" });
|
|
32
|
+
if (engineImage)
|
|
33
|
+
secrets.env[ENGINE_SERVICE.imageVariable] = engineImage;
|
|
34
|
+
args.push("--profile", "tools", "run", "--rm", ...runFlags, ...secrets.args, "schema-engine");
|
|
35
|
+
// No limit: a push applies a schema the person is waiting on, and abandoning the client would
|
|
36
|
+
// leave the `compose run` container applying it anyway. The callers are synchronous (engineRequest).
|
|
37
|
+
return askDockerSync([...args, ...engineArgs], { cwd, env: secrets.env, timeoutMs: NO_DOCKER_LIMIT });
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* The image `compose run` would use: the target's, else the one the shell or `.env` names, else the
|
|
41
|
+
* compose file's default.
|
|
42
|
+
*/
|
|
43
|
+
function engineImageOf(target) {
|
|
44
|
+
const named = (value) => (value?.trim() ? value.trim() : undefined);
|
|
45
|
+
return (named(target.engineImage) ??
|
|
46
|
+
named(process.env[ENGINE_SERVICE.imageVariable]) ??
|
|
47
|
+
named(readEnvFile(target.cwd)[ENGINE_SERVICE.imageVariable]) ??
|
|
48
|
+
ENGINE_SERVICE.defaultImage);
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* `docker run --rm` of the engine image as the compose service runs it (ENGINE_SERVICE), with no
|
|
52
|
+
* network. `compose run --no-deps` still created the project's network and every volume the file
|
|
53
|
+
* declares, and `generate` on a project whose stack had never run left them behind (local test round
|
|
54
|
+
* 3c). It never reads the compose file, so the secrets a fresh clone's `.env` lacks do not matter.
|
|
55
|
+
* The source is quoted, so a comma in the path is kept.
|
|
56
|
+
*/
|
|
57
|
+
function runEngineImageAlone(target, engineArgs, vars) {
|
|
58
|
+
const { projectDir, entrypoint } = ENGINE_SERVICE;
|
|
59
|
+
const secrets = dockerEnv(vars);
|
|
60
|
+
const mount = `type=bind,"source=${composeHostPath(target.cwd).replace(/"/g, '""')}",target=${projectDir}`;
|
|
61
|
+
const args = ["run", "--rm", "--network", "none", "--mount", mount, "--workdir", projectDir, "--entrypoint", entrypoint];
|
|
62
|
+
return askDockerSync([...args, ...secrets.args, engineImageOf(target), ...engineArgs], {
|
|
63
|
+
cwd: target.cwd,
|
|
64
|
+
env: secrets.env,
|
|
65
|
+
timeoutMs: NO_DOCKER_LIMIT,
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=compose-engine-run.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compose-engine-run.js","sourceRoot":"","sources":["../src/compose-engine-run.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AACnC,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAA;AAC5D,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM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xH,OAAO,aAAa,CAAC,CAAC,GAAG,IAAI,EAAE,GAAG,OAAO,CAAC,IAAI,EAAE,aAAa,CAAC,MAAM,CAAC,EAAE,GAAG,UAAU,CAAC,EAAE;QACrF,GAAG,EAAE,MAAM,CAAC,GAAG;QACf,GAAG,EAAE,OAAO,CAAC,GAAG;QAChB,SAAS,EAAE,eAAe;KAC3B,CAAC,CAAA;AACJ,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const ENGINE_SERVICE: {
|
|
2
|
+
/** The variable naming the image, read from the shell, then `.env`. */
|
|
3
|
+
readonly imageVariable: "SUPATYPE_ENGINE_IMAGE";
|
|
4
|
+
/** The image when none is named: the one this CLI release was tested with. */
|
|
5
|
+
readonly defaultImage: string;
|
|
6
|
+
readonly entrypoint: "supatype-engine";
|
|
7
|
+
/** Where the project is mounted, writable, and where the engine runs. */
|
|
8
|
+
readonly projectDir: "/project";
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=compose-engine-service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compose-engine-service.d.ts","sourceRoot":"","sources":["../src/compose-engine-service.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,cAAc;IACzB,uEAAuE;;IAEvE,8EAA8E;;;IAG9E,yEAAyE;;CAEjE,CAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The schema engine's service, as the generated compose file describes it and as a run of its image
|
|
3
|
+
* alone repeats it (compose-engine-run.ts). Both read it from here, so the two cannot drift. The
|
|
4
|
+
* environment is the caller's in either: each passes its variables as bare `-e NAME`.
|
|
5
|
+
*/
|
|
6
|
+
import { RELEASE_IMAGES } from "./release-images.js";
|
|
7
|
+
export const ENGINE_SERVICE = {
|
|
8
|
+
/** The variable naming the image, read from the shell, then `.env`. */
|
|
9
|
+
imageVariable: "SUPATYPE_ENGINE_IMAGE",
|
|
10
|
+
/** The image when none is named: the one this CLI release was tested with. */
|
|
11
|
+
defaultImage: RELEASE_IMAGES.engine,
|
|
12
|
+
entrypoint: "supatype-engine",
|
|
13
|
+
/** Where the project is mounted, writable, and where the engine runs. */
|
|
14
|
+
projectDir: "/project",
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=compose-engine-service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compose-engine-service.js","sourceRoot":"","sources":["../src/compose-engine-service.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAEpD,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,uEAAuE;IACvE,aAAa,EAAE,uBAAuB;IACtC,8EAA8E;IAC9E,YAAY,EAAE,cAAc,CAAC,MAAM;IACnC,UAAU,EAAE,iBAAiB;IAC7B,yEAAyE;IACzE,UAAU,EAAE,UAAU;CACd,CAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A host path as the generated compose file names it: absolute, with forward slashes.
|
|
3
|
+
*
|
|
4
|
+
* Absolute because compose resolves a relative bind source against `--project-directory`, and
|
|
5
|
+
* without that flag against the compose file's own folder, `.supatype/self-host`. The CLI always
|
|
6
|
+
* passes the flag. Someone running `docker compose -f .supatype/self-host/docker-compose.yml` by
|
|
7
|
+
* hand does not, and the server came up with that folder as its project: no admin config, manifest,
|
|
8
|
+
* API config, functions or hooks, and an empty `.supatype/self-host/.supatype` left on the host
|
|
9
|
+
* (SA3). Every compose command renders the file again on this machine, so a project that moved is
|
|
10
|
+
* named at its new place the next time one runs. Forward slashes because Docker Desktop on Windows
|
|
11
|
+
* reads `C:/...` as a host path and YAML needs no escaping for them.
|
|
12
|
+
*/
|
|
13
|
+
export declare function composeHostPath(path: string): string;
|
|
14
|
+
//# sourceMappingURL=compose-host-path.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compose-host-path.d.ts","sourceRoot":"","sources":["../src/compose-host-path.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;GAWG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAGpD"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { resolve, sep } from "node:path";
|
|
2
|
+
/**
|
|
3
|
+
* A host path as the generated compose file names it: absolute, with forward slashes.
|
|
4
|
+
*
|
|
5
|
+
* Absolute because compose resolves a relative bind source against `--project-directory`, and
|
|
6
|
+
* without that flag against the compose file's own folder, `.supatype/self-host`. The CLI always
|
|
7
|
+
* passes the flag. Someone running `docker compose -f .supatype/self-host/docker-compose.yml` by
|
|
8
|
+
* hand does not, and the server came up with that folder as its project: no admin config, manifest,
|
|
9
|
+
* API config, functions or hooks, and an empty `.supatype/self-host/.supatype` left on the host
|
|
10
|
+
* (SA3). Every compose command renders the file again on this machine, so a project that moved is
|
|
11
|
+
* named at its new place the next time one runs. Forward slashes because Docker Desktop on Windows
|
|
12
|
+
* reads `C:/...` as a host path and YAML needs no escaping for them.
|
|
13
|
+
*/
|
|
14
|
+
export function composeHostPath(path) {
|
|
15
|
+
const absolute = resolve(path);
|
|
16
|
+
return sep === "\\" ? absolute.replace(/\\/g, "/") : absolute;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=compose-host-path.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compose-host-path.js","sourceRoot":"","sources":["../src/compose-host-path.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAA;AAExC;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,eAAe,CAAC,IAAY;IAC1C,MAAM,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IAC9B,OAAO,GAAG,KAAK,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAA;AAC/D,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pulling a compose stack's images for `supatype update`, and saying which could not be pulled.
|
|
3
|
+
*
|
|
4
|
+
* `update` used to pull with `--ignore-pull-failures` whenever the project might use an image built
|
|
5
|
+
* on this machine. Compose then exits 0 whatever failed, so pulls ending "not found" were followed
|
|
6
|
+
* by "Compose images updated." and exit 0 (local test N6). The pull now runs without it, and when
|
|
7
|
+
* it fails each service is pulled again on its own to learn which did.
|
|
8
|
+
*
|
|
9
|
+
* Only then: the services and their images come from `docker compose config`, a second pass over
|
|
10
|
+
* the whole file, which a pull that worked has no use for. The services pulled again are pulled side
|
|
11
|
+
* by side, since each waits on a registry.
|
|
12
|
+
*/
|
|
13
|
+
import type { ServiceImage } from "./compose-services.js";
|
|
14
|
+
/** What {@link pullServiceImages} asks of Docker. */
|
|
15
|
+
export interface ImagePullSteps {
|
|
16
|
+
/** `docker compose pull` for every service, shown as it runs; its exit status. */
|
|
17
|
+
pullAll: () => Promise<number>;
|
|
18
|
+
/** Each service and the image it runs, as compose resolves the file. */
|
|
19
|
+
images: () => Promise<ServiceImage[]>;
|
|
20
|
+
/** `docker compose pull` for one service, quietly: whether it worked, and what it said when not. */
|
|
21
|
+
pullOne: (service: string) => Promise<{
|
|
22
|
+
ok: boolean;
|
|
23
|
+
said: string;
|
|
24
|
+
}>;
|
|
25
|
+
/** Whether Docker has `image` on this machine. */
|
|
26
|
+
hasLocal: (image: string) => boolean;
|
|
27
|
+
}
|
|
28
|
+
/** A service whose image was not pulled, and what Docker said about it. */
|
|
29
|
+
export interface FailedPull extends ServiceImage {
|
|
30
|
+
said: string;
|
|
31
|
+
}
|
|
32
|
+
/** The services whose images were not pulled, by what that means. */
|
|
33
|
+
export interface ImagePulls {
|
|
34
|
+
/** Not pulled, and nothing this machine has stands in for it. */
|
|
35
|
+
failed: FailedPull[];
|
|
36
|
+
/** A tag no registry has and this machine does: an image built here, used as it is. */
|
|
37
|
+
keptLocal: ServiceImage[];
|
|
38
|
+
}
|
|
39
|
+
/** Pull every image; those that could not be pulled. */
|
|
40
|
+
export declare function pullServiceImages(steps: ImagePullSteps): Promise<ImagePulls>;
|
|
41
|
+
/** What to do about an image that could not be pulled. */
|
|
42
|
+
export declare function imagePullAdvice(one: ServiceImage): string;
|
|
43
|
+
//# sourceMappingURL=compose-image-pull.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compose-image-pull.d.ts","sourceRoot":"","sources":["../src/compose-image-pull.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAA;AAGzD,qDAAqD;AACrD,MAAM,WAAW,cAAc;IAC7B,kFAAkF;IAClF,OAAO,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAA;IAC9B,wEAAwE;IACxE,MAAM,EAAE,MAAM,OAAO,CAAC,YAAY,EAAE,CAAC,CAAA;IACrC,oGAAoG;IACpG,OAAO,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC;QAAE,EAAE,EAAE,OAAO,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;IACpE,kDAAkD;IAClD,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAAA;CACrC;AAED,2EAA2E;AAC3E,MAAM,WAAW,UAAW,SAAQ,YAAY;IAC9C,IAAI,EAAE,MAAM,CAAA;CACb;AAED,qEAAqE;AACrE,MAAM,WAAW,UAAU;IACzB,iEAAiE;IACjE,MAAM,EAAE,UAAU,EAAE,CAAA;IACpB,uFAAuF;IACvF,SAAS,EAAE,YAAY,EAAE,CAAA;CAC1B;AAED,wDAAwD;AACxD,wBAAsB,iBAAiB,CAAC,KAAK,EAAE,cAAc,GAAG,OAAO,CAAC,UAAU,CAAC,CAalF;AAED,0DAA0D;AAC1D,wBAAgB,eAAe,CAAC,GAAG,EAAE,YAAY,GAAG,MAAM,CAIzD"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { isRegistryPullableImageRef } from "./self-host-compose.js";
|
|
2
|
+
/** Pull every image; those that could not be pulled. */
|
|
3
|
+
export async function pullServiceImages(steps) {
|
|
4
|
+
const pulls = { failed: [], keptLocal: [] };
|
|
5
|
+
if ((await steps.pullAll()) === 0)
|
|
6
|
+
return pulls;
|
|
7
|
+
// Compose gives one exit status for the lot, so each is asked again on its own. What did pull
|
|
8
|
+
// the first time is current now, and pulling it again costs a manifest check.
|
|
9
|
+
const images = await steps.images();
|
|
10
|
+
const again = await Promise.all(images.map(async (one) => ({ one, ...(await steps.pullOne(one.service)) })));
|
|
11
|
+
for (const { one, ok, said } of again) {
|
|
12
|
+
if (ok)
|
|
13
|
+
continue;
|
|
14
|
+
if (!isRegistryPullableImageRef(one.image) && steps.hasLocal(one.image))
|
|
15
|
+
pulls.keptLocal.push(one);
|
|
16
|
+
else
|
|
17
|
+
pulls.failed.push({ ...one, said });
|
|
18
|
+
}
|
|
19
|
+
return pulls;
|
|
20
|
+
}
|
|
21
|
+
/** What to do about an image that could not be pulled. */
|
|
22
|
+
export function imagePullAdvice(one) {
|
|
23
|
+
return isRegistryPullableImageRef(one.image)
|
|
24
|
+
? "Check that each image named exists on its registry and that Docker can reach it, then run `supatype update` again."
|
|
25
|
+
: `${one.image} is on no registry and not on this machine: build it, or remove its tag from .env to use the published image.`;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=compose-image-pull.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compose-image-pull.js","sourceRoot":"","sources":["../src/compose-image-pull.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAA;AA2BnE,wDAAwD;AACxD,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,KAAqB;IAC3D,MAAM,KAAK,GAAe,EAAE,MAAM,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,CAAA;IACvD,IAAI,CAAC,MAAM,KAAK,CAAC,OAAO,EAAE,CAAC,KAAK,CAAC;QAAE,OAAO,KAAK,CAAA;IAC/C,8FAA8F;IAC9F,8EAA8E;IAC9E,MAAM,MAAM,GAAG,MAAM,KAAK,CAAC,MAAM,EAAE,CAAA;IACnC,MAAM,KAAK,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,MAAM,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAA;IAC5G,KAAK,MAAM,EAAE,GAAG,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,KAAK,EAAE,CAAC;QACtC,IAAI,EAAE;YAAE,SAAQ;QAChB,IAAI,CAAC,0BAA0B,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC;YAAE,KAAK,CAAC,SAAS,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;;YAC7F,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,GAAG,GAAG,EAAE,IAAI,EAAE,CAAC,CAAA;IAC1C,CAAC;IACD,OAAO,KAAK,CAAA;AACd,CAAC;AAED,0DAA0D;AAC1D,MAAM,UAAU,eAAe,CAAC,GAAiB;IAC/C,OAAO,0BAA0B,CAAC,GAAG,CAAC,KAAK,CAAC;QAC1C,CAAC,CAAC,oHAAoH;QACtH,CAAC,CAAC,GAAG,GAAG,CAAC,KAAK,+GAA+G,CAAA;AACjI,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { type ComposeStack } from "./compose-db-psql.js";
|
|
2
|
+
/** One running container: its id, and the addresses it has on the stack's networks. */
|
|
3
|
+
export interface RunningContainer {
|
|
4
|
+
id: string;
|
|
5
|
+
addresses: string;
|
|
6
|
+
}
|
|
7
|
+
/** True when the named compose service has a running container. */
|
|
8
|
+
export declare function composeServiceIsRunning(cwd: string, stack: ComposeStack, service: string): boolean;
|
|
9
|
+
/**
|
|
10
|
+
* Whether an `up` that turned `before` into `after` left a running Kong holding a stale address:
|
|
11
|
+
* Kong was running before it and is the same container after it, and one of its `upstreams` is now
|
|
12
|
+
* on an address it was not on before (recreated elsewhere, or newly running). A container recreated
|
|
13
|
+
* on the address it had is still where Kong's cache says. Any service counts when the upstreams are
|
|
14
|
+
* unknown, and a Kong known to be running is reloaded when either listing is: a needless reload
|
|
15
|
+
* costs less than a stale address.
|
|
16
|
+
*/
|
|
17
|
+
export declare function kongNeedsReload(before: ReadonlyMap<string, RunningContainer> | undefined, after: ReadonlyMap<string, RunningContainer> | undefined, upstreams?: ReadonlySet<string>): boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Have a running Kong resolve its upstreams again with `kong reload`. A Kong still starting cannot
|
|
20
|
+
* take one, so a failed reload waits for Kong to be ready and tries once more. Never a restart:
|
|
21
|
+
* that would drop the requests in flight. True when Kong reloaded.
|
|
22
|
+
*/
|
|
23
|
+
export declare function reloadKong(cwd: string, stack: ComposeStack, readyWithinMs?: number): boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Run `up`, a `docker compose up` in `stack`, and reload Kong after it when it moved a container
|
|
26
|
+
* out from under a Kong that was already running (see `kongNeedsReload`). Returns `up`'s answer.
|
|
27
|
+
*/
|
|
28
|
+
export declare function upKeepingKongCurrent<T extends {
|
|
29
|
+
status: number | null;
|
|
30
|
+
}>(cwd: string, stack: ComposeStack, up: () => T): T;
|
|
31
|
+
//# sourceMappingURL=compose-kong.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compose-kong.d.ts","sourceRoot":"","sources":["../src/compose-kong.ts"],"names":[],"mappings":"AAwBA,OAAO,EAAmB,KAAK,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAMzE,uFAAuF;AACvF,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAA;IACV,SAAS,EAAE,MAAM,CAAA;CAClB;AAcD,mEAAmE;AACnE,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAGlG;AAwCD;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAC7B,MAAM,EAAE,WAAW,CAAC,MAAM,EAAE,gBAAgB,CAAC,GAAG,SAAS,EACzD,KAAK,EAAE,WAAW,CAAC,MAAM,EAAE,gBAAgB,CAAC,GAAG,SAAS,EACxD,SAAS,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,GAC9B,OAAO,CAQT;AAwBD;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,EAAE,aAAa,SAAuB,GAAG,OAAO,CAQ1G;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,SAAS;IAAE,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,EACtE,GAAG,EAAE,MAAM,EACX,KAAK,EAAE,YAAY,EACnB,EAAE,EAAE,MAAM,CAAC,GACV,CAAC,CAOH"}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Kong and the containers it sends requests to.
|
|
3
|
+
*
|
|
4
|
+
* Kong reaches its upstreams (server, PostgREST, Studio) by service name, and resolves a name once
|
|
5
|
+
* and keeps the answer: Docker's DNS gives it a 600 s TTL, and Kong serves a stale record while it
|
|
6
|
+
* refreshes. A recreated container can come back on a new address, so after the CLI recreated the
|
|
7
|
+
* server, sign-in through Kong answered 502 until Kong was restarted by hand (EXT-N1).
|
|
8
|
+
*
|
|
9
|
+
* Shortening Kong's DNS TTLs instead broke Studio from its dev server: `host.docker.internal` is a
|
|
10
|
+
* hosts-file entry (`extra_hosts`), and with a 5 s TTL Kong dropped it and asked Docker's DNS,
|
|
11
|
+
* which does not know it (CE1). So the TTLs are Kong's defaults, and a `docker compose up` the CLI
|
|
12
|
+
* runs (`runDockerCompose`) is followed by `kong reload` when, and only when, it moved one of
|
|
13
|
+
* Kong's upstreams to a new address under a Kong that was already running. A reload starts workers
|
|
14
|
+
* with empty DNS caches and lets the old ones finish the requests they hold, but it also closes
|
|
15
|
+
* their idle keep-alive connections, and a client that reuses one at that instant without retrying
|
|
16
|
+
* sees it fail. So a reload is run only when an address Kong holds is actually stale.
|
|
17
|
+
*
|
|
18
|
+
* Kong is never restarted for this. A restart drops every request in flight, and the reload used to
|
|
19
|
+
* fall back to one while Kong was still starting, which is every dev start (KONG-N1). A Kong the
|
|
20
|
+
* `up` started or recreated resolves afresh on its own, so it is left alone.
|
|
21
|
+
*/
|
|
22
|
+
import { askDockerSync, DOCKER_QUERY_TIMEOUT_MS } from "./docker-exec.js";
|
|
23
|
+
import { readFileSync } from "node:fs";
|
|
24
|
+
import { dirname, resolve } from "node:path";
|
|
25
|
+
import { composeBaseArgs } from "./compose-db-psql.js";
|
|
26
|
+
/** How long a reload waits for a Kong that is still starting. */
|
|
27
|
+
const KONG_READY_WITHIN_MS = 60_000;
|
|
28
|
+
const KONG_READY_POLL_MS = 500;
|
|
29
|
+
/** `docker inspect` line per container: its compose service, its id, then each network address. */
|
|
30
|
+
const INSPECT_FORMAT = '{{index .Config.Labels "com.docker.compose.service"}} {{.Id}}{{range .NetworkSettings.Networks}} {{.IPAddress}}{{end}}';
|
|
31
|
+
/**
|
|
32
|
+
* Synchronous: these run around `runDockerCompose`'s `up`, which is synchronous for its callers.
|
|
33
|
+
* Each is a question about running containers, or a reload, so a query's limit.
|
|
34
|
+
*/
|
|
35
|
+
function compose(cwd, stack, args) {
|
|
36
|
+
return askDockerSync([...composeBaseArgs(cwd, stack), ...args], { cwd, timeoutMs: DOCKER_QUERY_TIMEOUT_MS });
|
|
37
|
+
}
|
|
38
|
+
/** True when the named compose service has a running container. */
|
|
39
|
+
export function composeServiceIsRunning(cwd, stack, service) {
|
|
40
|
+
const result = compose(cwd, stack, ["ps", "-q", "--status", "running", service]);
|
|
41
|
+
return result.status === 0 && typeof result.stdout === "string" && result.stdout.trim() !== "";
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* The running containers of `stack` by compose service, or undefined when docker could not say
|
|
45
|
+
* (one gone between the listing and the inspect included). Listed by the compose project's label,
|
|
46
|
+
* which needs no compose file parsed.
|
|
47
|
+
*/
|
|
48
|
+
function runningContainers(cwd, stack) {
|
|
49
|
+
const filter = `label=com.docker.compose.project=${stack.project}`;
|
|
50
|
+
const listed = askDockerSync(["ps", "-q", "--filter", filter], { cwd, timeoutMs: DOCKER_QUERY_TIMEOUT_MS });
|
|
51
|
+
if (listed.status !== 0)
|
|
52
|
+
return undefined;
|
|
53
|
+
const ids = listed.stdout.split(/\s+/).filter((id) => id !== "");
|
|
54
|
+
const containers = new Map();
|
|
55
|
+
if (ids.length === 0)
|
|
56
|
+
return containers;
|
|
57
|
+
const inspected = askDockerSync(["inspect", "-f", INSPECT_FORMAT, ...ids], { cwd, timeoutMs: DOCKER_QUERY_TIMEOUT_MS });
|
|
58
|
+
if (inspected.status !== 0)
|
|
59
|
+
return undefined;
|
|
60
|
+
for (const line of inspected.stdout.split(/\r?\n/)) {
|
|
61
|
+
const [service, id, ...addresses] = line.trim().split(/\s+/);
|
|
62
|
+
if (service && id)
|
|
63
|
+
containers.set(service, { id, addresses: addresses.sort().join(" ") });
|
|
64
|
+
}
|
|
65
|
+
return containers;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* The compose services Kong sends requests to, from the `url:` of each service in the `kong.yml`
|
|
69
|
+
* rendered beside the compose file, or undefined when it cannot be read or names none (a format
|
|
70
|
+
* this does not read is unknown, not "no upstreams"). Most routes go to the server; GraphQL goes to
|
|
71
|
+
* PostgREST directly; Studio's dev server is on the host, not a service.
|
|
72
|
+
*/
|
|
73
|
+
function kongUpstreams(cwd, stack) {
|
|
74
|
+
let config;
|
|
75
|
+
try {
|
|
76
|
+
config = readFileSync(resolve(cwd, dirname(stack.composePath), "kong.yml"), "utf8");
|
|
77
|
+
}
|
|
78
|
+
catch {
|
|
79
|
+
return undefined;
|
|
80
|
+
}
|
|
81
|
+
const hosts = new Set([...config.matchAll(/^\s*url:\s*["']?https?:\/\/([^:/"'\s]+)/gm)].map((m) => m[1]));
|
|
82
|
+
return hosts.size === 0 ? undefined : hosts;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Whether an `up` that turned `before` into `after` left a running Kong holding a stale address:
|
|
86
|
+
* Kong was running before it and is the same container after it, and one of its `upstreams` is now
|
|
87
|
+
* on an address it was not on before (recreated elsewhere, or newly running). A container recreated
|
|
88
|
+
* on the address it had is still where Kong's cache says. Any service counts when the upstreams are
|
|
89
|
+
* unknown, and a Kong known to be running is reloaded when either listing is: a needless reload
|
|
90
|
+
* costs less than a stale address.
|
|
91
|
+
*/
|
|
92
|
+
export function kongNeedsReload(before, after, upstreams) {
|
|
93
|
+
if (before === undefined || after === undefined)
|
|
94
|
+
return (after ?? before)?.has("kong") ?? false;
|
|
95
|
+
const kong = before.get("kong");
|
|
96
|
+
if (kong === undefined || after.get("kong")?.id !== kong.id)
|
|
97
|
+
return false;
|
|
98
|
+
const behindKong = (service) => service !== "kong" && (upstreams?.has(service) ?? true);
|
|
99
|
+
return [...after].some(([service, now]) => behindKong(service) && before.get(service)?.addresses !== now.addresses);
|
|
100
|
+
}
|
|
101
|
+
function pause(ms) {
|
|
102
|
+
Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, ms);
|
|
103
|
+
}
|
|
104
|
+
/** Wait until Kong answers `kong health`, for at most `withinMs`. True once it does. */
|
|
105
|
+
function waitKongHealthy(cwd, stack, withinMs) {
|
|
106
|
+
const deadline = Date.now() + withinMs;
|
|
107
|
+
for (;;) {
|
|
108
|
+
if (compose(cwd, stack, ["exec", "-T", "kong", "kong", "health"]).status === 0)
|
|
109
|
+
return true;
|
|
110
|
+
if (Date.now() >= deadline)
|
|
111
|
+
return false;
|
|
112
|
+
pause(KONG_READY_POLL_MS);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
function warnNotReloaded(stack, why) {
|
|
116
|
+
console.warn("[supatype] Kong could not be reloaded after a container behind it was recreated; requests through it may " +
|
|
117
|
+
`fail until it is reloaded (docker compose -p ${stack.project} exec kong kong reload): ${why}`);
|
|
118
|
+
return false;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Have a running Kong resolve its upstreams again with `kong reload`. A Kong still starting cannot
|
|
122
|
+
* take one, so a failed reload waits for Kong to be ready and tries once more. Never a restart:
|
|
123
|
+
* that would drop the requests in flight. True when Kong reloaded.
|
|
124
|
+
*/
|
|
125
|
+
export function reloadKong(cwd, stack, readyWithinMs = KONG_READY_WITHIN_MS) {
|
|
126
|
+
const reload = () => compose(cwd, stack, ["exec", "-T", "kong", "kong", "reload"]);
|
|
127
|
+
if (reload().status === 0)
|
|
128
|
+
return true;
|
|
129
|
+
if (!waitKongHealthy(cwd, stack, readyWithinMs)) {
|
|
130
|
+
return warnNotReloaded(stack, `it was not ready within ${readyWithinMs / 1000}s`);
|
|
131
|
+
}
|
|
132
|
+
const retried = reload();
|
|
133
|
+
return retried.status === 0 || warnNotReloaded(stack, (retried.stderr ?? "").trim());
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Run `up`, a `docker compose up` in `stack`, and reload Kong after it when it moved a container
|
|
137
|
+
* out from under a Kong that was already running (see `kongNeedsReload`). Returns `up`'s answer.
|
|
138
|
+
*/
|
|
139
|
+
export function upKeepingKongCurrent(cwd, stack, up) {
|
|
140
|
+
const before = runningContainers(cwd, stack);
|
|
141
|
+
const result = up();
|
|
142
|
+
// A Kong the `up` started resolves afresh: nothing to look at after it.
|
|
143
|
+
if (result.status !== 0 || (before !== undefined && !before.has("kong")))
|
|
144
|
+
return result;
|
|
145
|
+
if (kongNeedsReload(before, runningContainers(cwd, stack), kongUpstreams(cwd, stack)))
|
|
146
|
+
reloadKong(cwd, stack);
|
|
147
|
+
return result;
|
|
148
|
+
}
|
|
149
|
+
//# sourceMappingURL=compose-kong.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compose-kong.js","sourceRoot":"","sources":["../src/compose-kong.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,EAAE,aAAa,EAAE,uBAAuB,EAAqB,MAAM,kBAAkB,CAAA;AAC5F,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AACtC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAC5C,OAAO,EAAE,eAAe,EAAqB,MAAM,sBAAsB,CAAA;AAEzE,iEAAiE;AACjE,MAAM,oBAAoB,GAAG,MAAM,CAAA;AACnC,MAAM,kBAAkB,GAAG,GAAG,CAAA;AAQ9B,mGAAmG;AACnG,MAAM,cAAc,GAClB,wHAAwH,CAAA;AAE1H;;;GAGG;AACH,SAAS,OAAO,CAAC,GAAW,EAAE,KAAmB,EAAE,IAAc;IAC/D,OAAO,aAAa,CAAC,CAAC,GAAG,eAAe,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,GAAG,IAAI,CAAC,EAAE,EAAE,GAAG,EAAE,SAAS,EAAE,uBAAuB,EAAE,CAAC,CAAA;AAC9G,CAAC;AAED,mEAAmE;AACnE,MAAM,UAAU,uBAAuB,CAAC,GAAW,EAAE,KAAmB,EAAE,OAAe;IACvF,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,EAAE,KAAK,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC,CAAA;IAChF,OAAO,MAAM,CAAC,MAAM,KAAK,CAAC,IAAI,OAAO,MAAM,CAAC,MAAM,KAAK,QA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":"AAMA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"compose-local-server-image.d.ts","sourceRoot":"","sources":["../src/compose-local-server-image.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAA;AAGhE,oEAAoE;AACpE,eAAO,MAAM,yBAAyB,8BAA8B,CAAA;AAEpE,0GAA0G;AAC1G,wBAAgB,uBAAuB,CAAC,cAAc,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAU1F;AAED;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,qBAAqB,GAAG,OAAO,CAKxF;AAED;;;GAGG;AACH,wBAAsB,4BAA4B,CAChD,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,qBAAqB,EAC7B,KAAK,CAAC,EAAE;IAAE,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,GACzB,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAkC7B"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { existsSync } from "node:fs";
|
|
2
2
|
import { dirname, isAbsolute, join, resolve } from "node:path";
|
|
3
|
-
import {
|
|
3
|
+
import { askDockerSync, NO_DOCKER_LIMIT } from "./docker-exec.js";
|
|
4
4
|
import { VERSION_PIN_LOCAL } from "./binary-cache.js";
|
|
5
5
|
import { appendStackOutput, getActiveDevSession } from "./dev-session.js";
|
|
6
6
|
import { requireDockerDaemon } from "./docker-runtime.js";
|
|
7
|
+
import { RELEASE_IMAGES } from "./release-images.js";
|
|
7
8
|
/** Docker tag for compose dev when `versions.server` is `local`. */
|
|
8
9
|
export const LOCAL_SERVER_DOCKER_IMAGE = "supatype/server:local-dev";
|
|
9
10
|
/** Find the server repo root (directory containing `Dockerfile`) from an overrides.server binary path. */
|
|
@@ -51,13 +52,16 @@ export async function ensureLocalServerDockerImage(cwd, config, brand) {
|
|
|
51
52
|
const root = resolveServerSourceRoot(override, cwd);
|
|
52
53
|
if (!root) {
|
|
53
54
|
console.warn(`[supatype] ⚠ versions.server is "local" but no Dockerfile found near ${override}. ` +
|
|
54
|
-
|
|
55
|
+
`Compose will use this release's server image, ${RELEASE_IMAGES.server}.`);
|
|
55
56
|
return undefined;
|
|
56
57
|
}
|
|
57
58
|
requireDockerDaemon(brand?.intro ? { brand: { intro: brand.intro } } : undefined);
|
|
58
59
|
const dockerfile = join(root, "Dockerfile");
|
|
59
60
|
console.log(`[supatype] Building local server Docker image from ${root}…`);
|
|
60
|
-
|
|
61
|
+
// No limit: a build the person started and watches, as long as the Dockerfile makes it.
|
|
62
|
+
const result = askDockerSync(["build", "--progress=plain", "-t", LOCAL_SERVER_DOCKER_IMAGE, "-f", dockerfile, root], {
|
|
63
|
+
timeoutMs: NO_DOCKER_LIMIT,
|
|
64
|
+
});
|
|
61
65
|
const tui = getActiveDevSession()?.isTui() ?? false;
|
|
62
66
|
if (!tui) {
|
|
63
67
|
appendStackOutput(result.stdout, "log");
|