@marinoscar/platform-cli 0.1.0-next.3 → 0.1.0-next.31
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 +365 -0
- package/README.md +163 -31
- package/dist/android/build.d.ts +30 -0
- package/dist/android/build.d.ts.map +1 -0
- package/dist/android/build.js +126 -0
- package/dist/android/build.js.map +1 -0
- package/dist/android/command.d.ts +21 -0
- package/dist/android/command.d.ts.map +1 -0
- package/dist/android/command.js +355 -0
- package/dist/android/command.js.map +1 -0
- package/dist/android/deploy-step.d.ts +85 -0
- package/dist/android/deploy-step.d.ts.map +1 -0
- package/dist/android/deploy-step.js +268 -0
- package/dist/android/deploy-step.js.map +1 -0
- package/dist/android/doctor.d.ts +47 -0
- package/dist/android/doctor.d.ts.map +1 -0
- package/dist/android/doctor.js +219 -0
- package/dist/android/doctor.js.map +1 -0
- package/dist/android/exec.d.ts +42 -0
- package/dist/android/exec.d.ts.map +1 -0
- package/dist/android/exec.js +103 -0
- package/dist/android/exec.js.map +1 -0
- package/dist/android/fix-plan.d.ts +44 -0
- package/dist/android/fix-plan.d.ts.map +1 -0
- package/dist/android/fix-plan.js +86 -0
- package/dist/android/fix-plan.js.map +1 -0
- package/dist/android/git-freshness.d.ts +34 -0
- package/dist/android/git-freshness.d.ts.map +1 -0
- package/dist/android/git-freshness.js +120 -0
- package/dist/android/git-freshness.js.map +1 -0
- package/dist/android/gradle.d.ts +32 -0
- package/dist/android/gradle.d.ts.map +1 -0
- package/dist/android/gradle.js +55 -0
- package/dist/android/gradle.js.map +1 -0
- package/dist/android/identity.d.ts +27 -0
- package/dist/android/identity.d.ts.map +1 -0
- package/dist/android/identity.js +60 -0
- package/dist/android/identity.js.map +1 -0
- package/dist/android/index.d.ts +7 -0
- package/dist/android/index.d.ts.map +1 -0
- package/dist/android/index.js +8 -0
- package/dist/android/index.js.map +1 -0
- package/dist/android/installer.d.ts +28 -0
- package/dist/android/installer.d.ts.map +1 -0
- package/dist/android/installer.js +96 -0
- package/dist/android/installer.js.map +1 -0
- package/dist/android/java.d.ts +26 -0
- package/dist/android/java.d.ts.map +1 -0
- package/dist/android/java.js +65 -0
- package/dist/android/java.js.map +1 -0
- package/dist/android/keystore.d.ts +54 -0
- package/dist/android/keystore.d.ts.map +1 -0
- package/dist/android/keystore.js +159 -0
- package/dist/android/keystore.js.map +1 -0
- package/dist/android/metadata.d.ts +39 -0
- package/dist/android/metadata.d.ts.map +1 -0
- package/dist/android/metadata.js +61 -0
- package/dist/android/metadata.js.map +1 -0
- package/dist/android/operations.d.ts +42 -0
- package/dist/android/operations.d.ts.map +1 -0
- package/dist/android/operations.js +59 -0
- package/dist/android/operations.js.map +1 -0
- package/dist/android/paths.d.ts +29 -0
- package/dist/android/paths.d.ts.map +1 -0
- package/dist/android/paths.js +97 -0
- package/dist/android/paths.js.map +1 -0
- package/dist/android/publish.d.ts +37 -0
- package/dist/android/publish.d.ts.map +1 -0
- package/dist/android/publish.js +119 -0
- package/dist/android/publish.js.map +1 -0
- package/dist/android/registrations.d.ts +92 -0
- package/dist/android/registrations.d.ts.map +1 -0
- package/dist/android/registrations.js +112 -0
- package/dist/android/registrations.js.map +1 -0
- package/dist/android/release-status.d.ts +73 -0
- package/dist/android/release-status.d.ts.map +1 -0
- package/dist/android/release-status.js +161 -0
- package/dist/android/release-status.js.map +1 -0
- package/dist/android/release.d.ts +33 -0
- package/dist/android/release.d.ts.map +1 -0
- package/dist/android/release.js +59 -0
- package/dist/android/release.js.map +1 -0
- package/dist/android/screen-layout.d.ts +26 -0
- package/dist/android/screen-layout.d.ts.map +1 -0
- package/dist/android/screen-layout.js +24 -0
- package/dist/android/screen-layout.js.map +1 -0
- package/dist/android/screen-model.d.ts +56 -0
- package/dist/android/screen-model.d.ts.map +1 -0
- package/dist/android/screen-model.js +207 -0
- package/dist/android/screen-model.js.map +1 -0
- package/dist/android/screen.d.ts +8 -0
- package/dist/android/screen.d.ts.map +1 -0
- package/dist/android/screen.js +395 -0
- package/dist/android/screen.js.map +1 -0
- package/dist/android/sdk.d.ts +48 -0
- package/dist/android/sdk.d.ts.map +1 -0
- package/dist/android/sdk.js +82 -0
- package/dist/android/sdk.js.map +1 -0
- package/dist/android/server-url.d.ts +19 -0
- package/dist/android/server-url.d.ts.map +1 -0
- package/dist/android/server-url.js +36 -0
- package/dist/android/server-url.js.map +1 -0
- package/dist/android/upload-progress.d.ts +3 -0
- package/dist/android/upload-progress.d.ts.map +1 -0
- package/dist/android/upload-progress.js +47 -0
- package/dist/android/upload-progress.js.map +1 -0
- package/dist/android/version.d.ts +47 -0
- package/dist/android/version.d.ts.map +1 -0
- package/dist/android/version.js +136 -0
- package/dist/android/version.js.map +1 -0
- package/dist/api-client/index.d.ts +3 -0
- package/dist/api-client/index.d.ts.map +1 -0
- package/dist/api-client/index.js +5 -0
- package/dist/api-client/index.js.map +1 -0
- package/dist/commands/index.d.ts +52 -0
- package/dist/commands/index.d.ts.map +1 -0
- package/dist/commands/index.js +63 -0
- package/dist/commands/index.js.map +1 -0
- package/dist/core/cli-registry.d.ts +41 -0
- package/dist/core/cli-registry.d.ts.map +1 -0
- package/dist/core/cli-registry.js +49 -0
- package/dist/core/cli-registry.js.map +1 -0
- package/dist/core/command-registry.d.ts +10 -0
- package/dist/core/command-registry.d.ts.map +1 -1
- package/dist/core/command-registry.js +17 -0
- package/dist/core/command-registry.js.map +1 -1
- package/dist/core/env-annotation-registry.d.ts +58 -0
- package/dist/core/env-annotation-registry.d.ts.map +1 -0
- package/dist/core/env-annotation-registry.js +80 -0
- package/dist/core/env-annotation-registry.js.map +1 -0
- package/dist/core/env-generator-registry.d.ts +59 -0
- package/dist/core/env-generator-registry.d.ts.map +1 -0
- package/dist/core/env-generator-registry.js +102 -0
- package/dist/core/env-generator-registry.js.map +1 -0
- package/dist/core/env-group-registry.d.ts +65 -0
- package/dist/core/env-group-registry.d.ts.map +1 -0
- package/dist/core/env-group-registry.js +77 -0
- package/dist/core/env-group-registry.js.map +1 -0
- package/dist/core/env-spec-registry.d.ts +16 -2
- package/dist/core/env-spec-registry.d.ts.map +1 -1
- package/dist/core/env-spec-registry.js +15 -0
- package/dist/core/env-spec-registry.js.map +1 -1
- package/dist/core/env-values.d.ts +3 -2
- package/dist/core/env-values.d.ts.map +1 -1
- package/dist/core/env-values.js +5 -3
- package/dist/core/env-values.js.map +1 -1
- package/dist/core/index.d.ts +10 -2
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +6 -2
- package/dist/core/index.js.map +1 -1
- package/dist/deploy/index.d.ts +3 -0
- package/dist/deploy/index.d.ts.map +1 -0
- package/dist/deploy/index.js +5 -0
- package/dist/deploy/index.js.map +1 -0
- package/dist/engine/api-client.d.ts +211 -0
- package/dist/engine/api-client.d.ts.map +1 -0
- package/dist/engine/api-client.js +350 -0
- package/dist/engine/api-client.js.map +1 -0
- package/dist/engine/browser.d.ts +18 -0
- package/dist/engine/browser.d.ts.map +1 -0
- package/dist/engine/browser.js +115 -0
- package/dist/engine/browser.js.map +1 -0
- package/dist/engine/builtin-registrations.d.ts +20 -0
- package/dist/engine/builtin-registrations.d.ts.map +1 -0
- package/dist/engine/builtin-registrations.js +86 -0
- package/dist/engine/builtin-registrations.js.map +1 -0
- package/dist/engine/commands/api.d.ts +88 -0
- package/dist/engine/commands/api.d.ts.map +1 -0
- package/dist/engine/commands/api.js +398 -0
- package/dist/engine/commands/api.js.map +1 -0
- package/dist/engine/commands/config.d.ts +5 -0
- package/dist/engine/commands/config.d.ts.map +1 -0
- package/dist/engine/commands/config.js +83 -0
- package/dist/engine/commands/config.js.map +1 -0
- package/dist/engine/commands/deploy.d.ts +250 -0
- package/dist/engine/commands/deploy.d.ts.map +1 -0
- package/dist/engine/commands/deploy.js +1186 -0
- package/dist/engine/commands/deploy.js.map +1 -0
- package/dist/engine/commands/init.d.ts +18 -0
- package/dist/engine/commands/init.d.ts.map +1 -0
- package/dist/engine/commands/init.js +50 -0
- package/dist/engine/commands/init.js.map +1 -0
- package/dist/engine/commands/login.d.ts +4 -0
- package/dist/engine/commands/login.d.ts.map +1 -0
- package/dist/engine/commands/login.js +205 -0
- package/dist/engine/commands/login.js.map +1 -0
- package/dist/engine/commands/node.d.ts +21 -0
- package/dist/engine/commands/node.d.ts.map +1 -0
- package/dist/engine/commands/node.js +503 -0
- package/dist/engine/commands/node.js.map +1 -0
- package/dist/engine/config.d.ts +284 -0
- package/dist/engine/config.d.ts.map +1 -0
- package/dist/engine/config.js +469 -0
- package/dist/engine/config.js.map +1 -0
- package/dist/engine/conformance.d.ts +193 -0
- package/dist/engine/conformance.d.ts.map +1 -0
- package/dist/engine/conformance.js +243 -0
- package/dist/engine/conformance.js.map +1 -0
- package/dist/engine/create-cli.d.ts +181 -0
- package/dist/engine/create-cli.d.ts.map +1 -0
- package/dist/engine/create-cli.js +91 -0
- package/dist/engine/create-cli.js.map +1 -0
- package/dist/engine/deploy/about.d.ts +12 -0
- package/dist/engine/deploy/about.d.ts.map +1 -0
- package/dist/engine/deploy/about.js +110 -0
- package/dist/engine/deploy/about.js.map +1 -0
- package/dist/engine/deploy/adopt.d.ts +21 -0
- package/dist/engine/deploy/adopt.d.ts.map +1 -0
- package/dist/engine/deploy/adopt.js +78 -0
- package/dist/engine/deploy/adopt.js.map +1 -0
- package/dist/engine/deploy/answers-file.d.ts +7 -0
- package/dist/engine/deploy/answers-file.d.ts.map +1 -0
- package/dist/engine/deploy/answers-file.js +49 -0
- package/dist/engine/deploy/answers-file.js.map +1 -0
- package/dist/engine/deploy/app-role.d.ts +278 -0
- package/dist/engine/deploy/app-role.d.ts.map +1 -0
- package/dist/engine/deploy/app-role.js +826 -0
- package/dist/engine/deploy/app-role.js.map +1 -0
- package/dist/engine/deploy/app-version.d.ts +103 -0
- package/dist/engine/deploy/app-version.d.ts.map +1 -0
- package/dist/engine/deploy/app-version.js +344 -0
- package/dist/engine/deploy/app-version.js.map +1 -0
- package/dist/engine/deploy/checks/compose.d.ts +16 -0
- package/dist/engine/deploy/checks/compose.d.ts.map +1 -0
- package/dist/engine/deploy/checks/compose.js +149 -0
- package/dist/engine/deploy/checks/compose.js.map +1 -0
- package/dist/engine/deploy/checks/database.d.ts +83 -0
- package/dist/engine/deploy/checks/database.d.ts.map +1 -0
- package/dist/engine/deploy/checks/database.js +455 -0
- package/dist/engine/deploy/checks/database.js.map +1 -0
- package/dist/engine/deploy/checks/dns.d.ts +3 -0
- package/dist/engine/deploy/checks/dns.d.ts.map +1 -0
- package/dist/engine/deploy/checks/dns.js +85 -0
- package/dist/engine/deploy/checks/dns.js.map +1 -0
- package/dist/engine/deploy/checks/host.d.ts +19 -0
- package/dist/engine/deploy/checks/host.d.ts.map +1 -0
- package/dist/engine/deploy/checks/host.js +543 -0
- package/dist/engine/deploy/checks/host.js.map +1 -0
- package/dist/engine/deploy/checks/index.d.ts +35 -0
- package/dist/engine/deploy/checks/index.d.ts.map +1 -0
- package/dist/engine/deploy/checks/index.js +75 -0
- package/dist/engine/deploy/checks/index.js.map +1 -0
- package/dist/engine/deploy/checks/registry.d.ts +110 -0
- package/dist/engine/deploy/checks/registry.d.ts.map +1 -0
- package/dist/engine/deploy/checks/registry.js +104 -0
- package/dist/engine/deploy/checks/registry.js.map +1 -0
- package/dist/engine/deploy/checks/source.d.ts +45 -0
- package/dist/engine/deploy/checks/source.d.ts.map +1 -0
- package/dist/engine/deploy/checks/source.js +175 -0
- package/dist/engine/deploy/checks/source.js.map +1 -0
- package/dist/engine/deploy/checks/stack-ports.d.ts +4 -0
- package/dist/engine/deploy/checks/stack-ports.d.ts.map +1 -0
- package/dist/engine/deploy/checks/stack-ports.js +261 -0
- package/dist/engine/deploy/checks/stack-ports.js.map +1 -0
- package/dist/engine/deploy/checks/tls.d.ts +87 -0
- package/dist/engine/deploy/checks/tls.d.ts.map +1 -0
- package/dist/engine/deploy/checks/tls.js +552 -0
- package/dist/engine/deploy/checks/tls.js.map +1 -0
- package/dist/engine/deploy/checks/types.d.ts +202 -0
- package/dist/engine/deploy/checks/types.d.ts.map +1 -0
- package/dist/engine/deploy/checks/types.js +199 -0
- package/dist/engine/deploy/checks/types.js.map +1 -0
- package/dist/engine/deploy/compose-command.d.ts +16 -0
- package/dist/engine/deploy/compose-command.d.ts.map +1 -0
- package/dist/engine/deploy/compose-command.js +40 -0
- package/dist/engine/deploy/compose-command.js.map +1 -0
- package/dist/engine/deploy/compose-containers.d.ts +101 -0
- package/dist/engine/deploy/compose-containers.d.ts.map +1 -0
- package/dist/engine/deploy/compose-containers.js +191 -0
- package/dist/engine/deploy/compose-containers.js.map +1 -0
- package/dist/engine/deploy/compose-files.d.ts +29 -0
- package/dist/engine/deploy/compose-files.d.ts.map +1 -0
- package/dist/engine/deploy/compose-files.js +118 -0
- package/dist/engine/deploy/compose-files.js.map +1 -0
- package/dist/engine/deploy/compose-hints.d.ts +11 -0
- package/dist/engine/deploy/compose-hints.d.ts.map +1 -0
- package/dist/engine/deploy/compose-hints.js +70 -0
- package/dist/engine/deploy/compose-hints.js.map +1 -0
- package/dist/engine/deploy/compose-port-variables.d.ts +58 -0
- package/dist/engine/deploy/compose-port-variables.d.ts.map +1 -0
- package/dist/engine/deploy/compose-port-variables.js +184 -0
- package/dist/engine/deploy/compose-port-variables.js.map +1 -0
- package/dist/engine/deploy/compose-ports.d.ts +98 -0
- package/dist/engine/deploy/compose-ports.d.ts.map +1 -0
- package/dist/engine/deploy/compose-ports.js +204 -0
- package/dist/engine/deploy/compose-ports.js.map +1 -0
- package/dist/engine/deploy/compose-project.d.ts +113 -0
- package/dist/engine/deploy/compose-project.d.ts.map +1 -0
- package/dist/engine/deploy/compose-project.js +177 -0
- package/dist/engine/deploy/compose-project.js.map +1 -0
- package/dist/engine/deploy/consent.d.ts +29 -0
- package/dist/engine/deploy/consent.d.ts.map +1 -0
- package/dist/engine/deploy/consent.js +35 -0
- package/dist/engine/deploy/consent.js.map +1 -0
- package/dist/engine/deploy/database-drop.d.ts +22 -0
- package/dist/engine/deploy/database-drop.d.ts.map +1 -0
- package/dist/engine/deploy/database-drop.js +135 -0
- package/dist/engine/deploy/database-drop.js.map +1 -0
- package/dist/engine/deploy/database.d.ts +116 -0
- package/dist/engine/deploy/database.d.ts.map +1 -0
- package/dist/engine/deploy/database.js +252 -0
- package/dist/engine/deploy/database.js.map +1 -0
- package/dist/engine/deploy/deploy-info.d.ts +48 -0
- package/dist/engine/deploy/deploy-info.d.ts.map +1 -0
- package/dist/engine/deploy/deploy-info.js +163 -0
- package/dist/engine/deploy/deploy-info.js.map +1 -0
- package/dist/engine/deploy/deployment-evidence.d.ts +38 -0
- package/dist/engine/deploy/deployment-evidence.d.ts.map +1 -0
- package/dist/engine/deploy/deployment-evidence.js +92 -0
- package/dist/engine/deploy/deployment-evidence.js.map +1 -0
- package/dist/engine/deploy/edge-config.d.ts +103 -0
- package/dist/engine/deploy/edge-config.d.ts.map +1 -0
- package/dist/engine/deploy/edge-config.js +170 -0
- package/dist/engine/deploy/edge-config.js.map +1 -0
- package/dist/engine/deploy/env-absence.d.ts +61 -0
- package/dist/engine/deploy/env-absence.d.ts.map +1 -0
- package/dist/engine/deploy/env-absence.js +33 -0
- package/dist/engine/deploy/env-absence.js.map +1 -0
- package/dist/engine/deploy/env-file.d.ts +14 -0
- package/dist/engine/deploy/env-file.d.ts.map +1 -0
- package/dist/engine/deploy/env-file.js +58 -0
- package/dist/engine/deploy/env-file.js.map +1 -0
- package/dist/engine/deploy/env-fragments.d.ts +29 -0
- package/dist/engine/deploy/env-fragments.d.ts.map +1 -0
- package/dist/engine/deploy/env-fragments.js +73 -0
- package/dist/engine/deploy/env-fragments.js.map +1 -0
- package/dist/engine/deploy/env-metadata.d.ts +73 -0
- package/dist/engine/deploy/env-metadata.d.ts.map +1 -0
- package/dist/engine/deploy/env-metadata.js +227 -0
- package/dist/engine/deploy/env-metadata.js.map +1 -0
- package/dist/engine/deploy/env-spec.d.ts +75 -0
- package/dist/engine/deploy/env-spec.d.ts.map +1 -0
- package/dist/engine/deploy/env-spec.js +239 -0
- package/dist/engine/deploy/env-spec.js.map +1 -0
- package/dist/engine/deploy/env-wizard.d.ts +56 -0
- package/dist/engine/deploy/env-wizard.d.ts.map +1 -0
- package/dist/engine/deploy/env-wizard.js +235 -0
- package/dist/engine/deploy/env-wizard.js.map +1 -0
- package/dist/engine/deploy/executor.d.ts +81 -0
- package/dist/engine/deploy/executor.d.ts.map +1 -0
- package/dist/engine/deploy/executor.js +247 -0
- package/dist/engine/deploy/executor.js.map +1 -0
- package/dist/engine/deploy/free-ports.d.ts +145 -0
- package/dist/engine/deploy/free-ports.d.ts.map +1 -0
- package/dist/engine/deploy/free-ports.js +235 -0
- package/dist/engine/deploy/free-ports.js.map +1 -0
- package/dist/engine/deploy/health.d.ts +153 -0
- package/dist/engine/deploy/health.d.ts.map +1 -0
- package/dist/engine/deploy/health.js +335 -0
- package/dist/engine/deploy/health.js.map +1 -0
- package/dist/engine/deploy/hooks.d.ts +66 -0
- package/dist/engine/deploy/hooks.d.ts.map +1 -0
- package/dist/engine/deploy/hooks.js +19 -0
- package/dist/engine/deploy/hooks.js.map +1 -0
- package/dist/engine/deploy/host-facts.d.ts +23 -0
- package/dist/engine/deploy/host-facts.d.ts.map +1 -0
- package/dist/engine/deploy/host-facts.js +67 -0
- package/dist/engine/deploy/host-facts.js.map +1 -0
- package/dist/engine/deploy/install.d.ts +239 -0
- package/dist/engine/deploy/install.d.ts.map +1 -0
- package/dist/engine/deploy/install.js +1474 -0
- package/dist/engine/deploy/install.js.map +1 -0
- package/dist/engine/deploy/inventory.d.ts +30 -0
- package/dist/engine/deploy/inventory.d.ts.map +1 -0
- package/dist/engine/deploy/inventory.js +122 -0
- package/dist/engine/deploy/inventory.js.map +1 -0
- package/dist/engine/deploy/journal.d.ts +77 -0
- package/dist/engine/deploy/journal.d.ts.map +1 -0
- package/dist/engine/deploy/journal.js +221 -0
- package/dist/engine/deploy/journal.js.map +1 -0
- package/dist/engine/deploy/layout.d.ts +77 -0
- package/dist/engine/deploy/layout.d.ts.map +1 -0
- package/dist/engine/deploy/layout.js +191 -0
- package/dist/engine/deploy/layout.js.map +1 -0
- package/dist/engine/deploy/oauth-check.d.ts +58 -0
- package/dist/engine/deploy/oauth-check.d.ts.map +1 -0
- package/dist/engine/deploy/oauth-check.js +213 -0
- package/dist/engine/deploy/oauth-check.js.map +1 -0
- package/dist/engine/deploy/proxy-bootstrap.d.ts +149 -0
- package/dist/engine/deploy/proxy-bootstrap.d.ts.map +1 -0
- package/dist/engine/deploy/proxy-bootstrap.js +416 -0
- package/dist/engine/deploy/proxy-bootstrap.js.map +1 -0
- package/dist/engine/deploy/proxy-streams.d.ts +110 -0
- package/dist/engine/deploy/proxy-streams.d.ts.map +1 -0
- package/dist/engine/deploy/proxy-streams.js +208 -0
- package/dist/engine/deploy/proxy-streams.js.map +1 -0
- package/dist/engine/deploy/proxy.d.ts +375 -0
- package/dist/engine/deploy/proxy.d.ts.map +1 -0
- package/dist/engine/deploy/proxy.js +758 -0
- package/dist/engine/deploy/proxy.js.map +1 -0
- package/dist/engine/deploy/renewal.d.ts +54 -0
- package/dist/engine/deploy/renewal.d.ts.map +1 -0
- package/dist/engine/deploy/renewal.js +169 -0
- package/dist/engine/deploy/renewal.js.map +1 -0
- package/dist/engine/deploy/repo.d.ts +119 -0
- package/dist/engine/deploy/repo.d.ts.map +1 -0
- package/dist/engine/deploy/repo.js +282 -0
- package/dist/engine/deploy/repo.js.map +1 -0
- package/dist/engine/deploy/run-record.d.ts +28 -0
- package/dist/engine/deploy/run-record.d.ts.map +1 -0
- package/dist/engine/deploy/run-record.js +44 -0
- package/dist/engine/deploy/run-record.js.map +1 -0
- package/dist/engine/deploy/stack-ports-gate.d.ts +19 -0
- package/dist/engine/deploy/stack-ports-gate.d.ts.map +1 -0
- package/dist/engine/deploy/stack-ports-gate.js +54 -0
- package/dist/engine/deploy/stack-ports-gate.js.map +1 -0
- package/dist/engine/deploy/state.d.ts +289 -0
- package/dist/engine/deploy/state.d.ts.map +1 -0
- package/dist/engine/deploy/state.js +163 -0
- package/dist/engine/deploy/state.js.map +1 -0
- package/dist/engine/deploy/steps/app-step-context.d.ts +24 -0
- package/dist/engine/deploy/steps/app-step-context.d.ts.map +1 -0
- package/dist/engine/deploy/steps/app-step-context.js +45 -0
- package/dist/engine/deploy/steps/app-step-context.js.map +1 -0
- package/dist/engine/deploy/steps/pipeline.d.ts +46 -0
- package/dist/engine/deploy/steps/pipeline.d.ts.map +1 -0
- package/dist/engine/deploy/steps/pipeline.js +73 -0
- package/dist/engine/deploy/steps/pipeline.js.map +1 -0
- package/dist/engine/deploy/steps/plan.d.ts +28 -0
- package/dist/engine/deploy/steps/plan.d.ts.map +1 -0
- package/dist/engine/deploy/steps/plan.js +32 -0
- package/dist/engine/deploy/steps/plan.js.map +1 -0
- package/dist/engine/deploy/steps/registry.d.ts +182 -0
- package/dist/engine/deploy/steps/registry.d.ts.map +1 -0
- package/dist/engine/deploy/steps/registry.js +214 -0
- package/dist/engine/deploy/steps/registry.js.map +1 -0
- package/dist/engine/deploy/steps/step-values.d.ts +28 -0
- package/dist/engine/deploy/steps/step-values.d.ts.map +1 -0
- package/dist/engine/deploy/steps/step-values.js +33 -0
- package/dist/engine/deploy/steps/step-values.js.map +1 -0
- package/dist/engine/deploy/testing/fake-containers.d.ts +29 -0
- package/dist/engine/deploy/testing/fake-containers.d.ts.map +1 -0
- package/dist/engine/deploy/testing/fake-containers.js +32 -0
- package/dist/engine/deploy/testing/fake-containers.js.map +1 -0
- package/dist/engine/deploy/testing/fake-postgres.d.ts +88 -0
- package/dist/engine/deploy/testing/fake-postgres.d.ts.map +1 -0
- package/dist/engine/deploy/testing/fake-postgres.js +236 -0
- package/dist/engine/deploy/testing/fake-postgres.js.map +1 -0
- package/dist/engine/deploy/testing/fake-vps.d.ts +147 -0
- package/dist/engine/deploy/testing/fake-vps.d.ts.map +1 -0
- package/dist/engine/deploy/testing/fake-vps.js +371 -0
- package/dist/engine/deploy/testing/fake-vps.js.map +1 -0
- package/dist/engine/deploy/uninstall.d.ts +87 -0
- package/dist/engine/deploy/uninstall.d.ts.map +1 -0
- package/dist/engine/deploy/uninstall.js +321 -0
- package/dist/engine/deploy/uninstall.js.map +1 -0
- package/dist/engine/deploy/update.d.ts +114 -0
- package/dist/engine/deploy/update.d.ts.map +1 -0
- package/dist/engine/deploy/update.js +1385 -0
- package/dist/engine/deploy/update.js.map +1 -0
- package/dist/engine/deploy/version-step.d.ts +74 -0
- package/dist/engine/deploy/version-step.d.ts.map +1 -0
- package/dist/engine/deploy/version-step.js +177 -0
- package/dist/engine/deploy/version-step.js.map +1 -0
- package/dist/engine/device-auth.d.ts +240 -0
- package/dist/engine/device-auth.d.ts.map +1 -0
- package/dist/engine/device-auth.js +442 -0
- package/dist/engine/device-auth.js.map +1 -0
- package/dist/engine/device-login.d.ts +126 -0
- package/dist/engine/device-login.d.ts.map +1 -0
- package/dist/engine/device-login.js +164 -0
- package/dist/engine/device-login.js.map +1 -0
- package/dist/engine/errors.d.ts +314 -0
- package/dist/engine/errors.d.ts.map +1 -0
- package/dist/engine/errors.js +561 -0
- package/dist/engine/errors.js.map +1 -0
- package/dist/engine/github-raw-manifest.d.ts +59 -0
- package/dist/engine/github-raw-manifest.d.ts.map +1 -0
- package/dist/engine/github-raw-manifest.js +197 -0
- package/dist/engine/github-raw-manifest.js.map +1 -0
- package/dist/engine/identity.d.ts +169 -0
- package/dist/engine/identity.d.ts.map +1 -0
- package/dist/engine/identity.js +227 -0
- package/dist/engine/identity.js.map +1 -0
- package/dist/engine/index.d.ts +141 -0
- package/dist/engine/index.d.ts.map +1 -0
- package/dist/engine/index.js +147 -0
- package/dist/engine/index.js.map +1 -0
- package/dist/engine/init/local-profile.d.ts +93 -0
- package/dist/engine/init/local-profile.d.ts.map +1 -0
- package/dist/engine/init/local-profile.js +295 -0
- package/dist/engine/init/local-profile.js.map +1 -0
- package/dist/engine/init/run-init.d.ts +41 -0
- package/dist/engine/init/run-init.d.ts.map +1 -0
- package/dist/engine/init/run-init.js +297 -0
- package/dist/engine/init/run-init.js.map +1 -0
- package/dist/engine/node/capabilities.d.ts +433 -0
- package/dist/engine/node/capabilities.d.ts.map +1 -0
- package/dist/engine/node/capabilities.js +597 -0
- package/dist/engine/node/capabilities.js.map +1 -0
- package/dist/engine/node/daemon-channels.d.ts +66 -0
- package/dist/engine/node/daemon-channels.d.ts.map +1 -0
- package/dist/engine/node/daemon-channels.js +65 -0
- package/dist/engine/node/daemon-channels.js.map +1 -0
- package/dist/engine/node/daemon.d.ts +63 -0
- package/dist/engine/node/daemon.d.ts.map +1 -0
- package/dist/engine/node/daemon.js +279 -0
- package/dist/engine/node/daemon.js.map +1 -0
- package/dist/engine/node/doctor.d.ts +60 -0
- package/dist/engine/node/doctor.d.ts.map +1 -0
- package/dist/engine/node/doctor.js +447 -0
- package/dist/engine/node/doctor.js.map +1 -0
- package/dist/engine/node/enrollment.d.ts +98 -0
- package/dist/engine/node/enrollment.d.ts.map +1 -0
- package/dist/engine/node/enrollment.js +189 -0
- package/dist/engine/node/enrollment.js.map +1 -0
- package/dist/engine/node/env-flags.d.ts +5 -0
- package/dist/engine/node/env-flags.d.ts.map +1 -0
- package/dist/engine/node/env-flags.js +22 -0
- package/dist/engine/node/env-flags.js.map +1 -0
- package/dist/engine/node/executors/credential-hygiene.d.ts +63 -0
- package/dist/engine/node/executors/credential-hygiene.d.ts.map +1 -0
- package/dist/engine/node/executors/credential-hygiene.js +210 -0
- package/dist/engine/node/executors/credential-hygiene.js.map +1 -0
- package/dist/engine/node/executors/db-backup-run.d.ts +73 -0
- package/dist/engine/node/executors/db-backup-run.d.ts.map +1 -0
- package/dist/engine/node/executors/db-backup-run.js +362 -0
- package/dist/engine/node/executors/db-backup-run.js.map +1 -0
- package/dist/engine/node/executors/example-checksum.d.ts +30 -0
- package/dist/engine/node/executors/example-checksum.d.ts.map +1 -0
- package/dist/engine/node/executors/example-checksum.js +56 -0
- package/dist/engine/node/executors/example-checksum.js.map +1 -0
- package/dist/engine/node/executors/index.d.ts +213 -0
- package/dist/engine/node/executors/index.d.ts.map +1 -0
- package/dist/engine/node/executors/index.js +58 -0
- package/dist/engine/node/executors/index.js.map +1 -0
- package/dist/engine/node/executors/registry.d.ts +38 -0
- package/dist/engine/node/executors/registry.d.ts.map +1 -0
- package/dist/engine/node/executors/registry.js +103 -0
- package/dist/engine/node/executors/registry.js.map +1 -0
- package/dist/engine/node/heap-snapshot.d.ts +37 -0
- package/dist/engine/node/heap-snapshot.d.ts.map +1 -0
- package/dist/engine/node/heap-snapshot.js +160 -0
- package/dist/engine/node/heap-snapshot.js.map +1 -0
- package/dist/engine/node/host-telemetry.d.ts +38 -0
- package/dist/engine/node/host-telemetry.d.ts.map +1 -0
- package/dist/engine/node/host-telemetry.js +39 -0
- package/dist/engine/node/host-telemetry.js.map +1 -0
- package/dist/engine/node/host-vitals.d.ts +51 -0
- package/dist/engine/node/host-vitals.d.ts.map +1 -0
- package/dist/engine/node/host-vitals.js +117 -0
- package/dist/engine/node/host-vitals.js.map +1 -0
- package/dist/engine/node/install-deps.d.ts +231 -0
- package/dist/engine/node/install-deps.d.ts.map +1 -0
- package/dist/engine/node/install-deps.js +392 -0
- package/dist/engine/node/install-deps.js.map +1 -0
- package/dist/engine/node/ipc-protocol.d.ts +114 -0
- package/dist/engine/node/ipc-protocol.d.ts.map +1 -0
- package/dist/engine/node/ipc-protocol.js +122 -0
- package/dist/engine/node/ipc-protocol.js.map +1 -0
- package/dist/engine/node/lifecycle.d.ts +103 -0
- package/dist/engine/node/lifecycle.d.ts.map +1 -0
- package/dist/engine/node/lifecycle.js +260 -0
- package/dist/engine/node/lifecycle.js.map +1 -0
- package/dist/engine/node/logger.d.ts +95 -0
- package/dist/engine/node/logger.d.ts.map +1 -0
- package/dist/engine/node/logger.js +241 -0
- package/dist/engine/node/logger.js.map +1 -0
- package/dist/engine/node/memory-watchdog.d.ts +89 -0
- package/dist/engine/node/memory-watchdog.d.ts.map +1 -0
- package/dist/engine/node/memory-watchdog.js +248 -0
- package/dist/engine/node/memory-watchdog.js.map +1 -0
- package/dist/engine/node/models.d.ts +195 -0
- package/dist/engine/node/models.d.ts.map +1 -0
- package/dist/engine/node/models.js +379 -0
- package/dist/engine/node/models.js.map +1 -0
- package/dist/engine/node/node-api.d.ts +439 -0
- package/dist/engine/node/node-api.d.ts.map +1 -0
- package/dist/engine/node/node-api.js +125 -0
- package/dist/engine/node/node-api.js.map +1 -0
- package/dist/engine/node/node-config.d.ts +128 -0
- package/dist/engine/node/node-config.d.ts.map +1 -0
- package/dist/engine/node/node-config.js +237 -0
- package/dist/engine/node/node-config.js.map +1 -0
- package/dist/engine/node/node-dashboard-source.d.ts +83 -0
- package/dist/engine/node/node-dashboard-source.d.ts.map +1 -0
- package/dist/engine/node/node-dashboard-source.js +181 -0
- package/dist/engine/node/node-dashboard-source.js.map +1 -0
- package/dist/engine/node/node-engine.d.ts +282 -0
- package/dist/engine/node/node-engine.d.ts.map +1 -0
- package/dist/engine/node/node-engine.js +925 -0
- package/dist/engine/node/node-engine.js.map +1 -0
- package/dist/engine/node/node-errors.d.ts +54 -0
- package/dist/engine/node/node-errors.d.ts.map +1 -0
- package/dist/engine/node/node-errors.js +71 -0
- package/dist/engine/node/node-errors.js.map +1 -0
- package/dist/engine/node/node-events-queue.d.ts +27 -0
- package/dist/engine/node/node-events-queue.d.ts.map +1 -0
- package/dist/engine/node/node-events-queue.js +46 -0
- package/dist/engine/node/node-events-queue.js.map +1 -0
- package/dist/engine/node/node-events.d.ts +132 -0
- package/dist/engine/node/node-events.d.ts.map +1 -0
- package/dist/engine/node/node-events.js +2 -0
- package/dist/engine/node/node-events.js.map +1 -0
- package/dist/engine/node/node-vitals.d.ts +123 -0
- package/dist/engine/node/node-vitals.d.ts.map +1 -0
- package/dist/engine/node/node-vitals.js +266 -0
- package/dist/engine/node/node-vitals.js.map +1 -0
- package/dist/engine/node/paths.d.ts +39 -0
- package/dist/engine/node/paths.d.ts.map +1 -0
- package/dist/engine/node/paths.js +60 -0
- package/dist/engine/node/paths.js.map +1 -0
- package/dist/engine/node/pg-dump.d.ts +126 -0
- package/dist/engine/node/pg-dump.d.ts.map +1 -0
- package/dist/engine/node/pg-dump.js +223 -0
- package/dist/engine/node/pg-dump.js.map +1 -0
- package/dist/engine/node/pidfile.d.ts +38 -0
- package/dist/engine/node/pidfile.d.ts.map +1 -0
- package/dist/engine/node/pidfile.js +156 -0
- package/dist/engine/node/pidfile.js.map +1 -0
- package/dist/engine/node/power-probe.d.ts +59 -0
- package/dist/engine/node/power-probe.d.ts.map +1 -0
- package/dist/engine/node/power-probe.js +240 -0
- package/dist/engine/node/power-probe.js.map +1 -0
- package/dist/engine/node/power-watcher.d.ts +30 -0
- package/dist/engine/node/power-watcher.d.ts.map +1 -0
- package/dist/engine/node/power-watcher.js +116 -0
- package/dist/engine/node/power-watcher.js.map +1 -0
- package/dist/engine/node/runtime-state.d.ts +24 -0
- package/dist/engine/node/runtime-state.d.ts.map +1 -0
- package/dist/engine/node/runtime-state.js +19 -0
- package/dist/engine/node/runtime-state.js.map +1 -0
- package/dist/engine/node/runtime-tuning.d.ts +174 -0
- package/dist/engine/node/runtime-tuning.d.ts.map +1 -0
- package/dist/engine/node/runtime-tuning.js +327 -0
- package/dist/engine/node/runtime-tuning.js.map +1 -0
- package/dist/engine/node/service.d.ts +39 -0
- package/dist/engine/node/service.d.ts.map +1 -0
- package/dist/engine/node/service.js +215 -0
- package/dist/engine/node/service.js.map +1 -0
- package/dist/engine/node/start.d.ts +69 -0
- package/dist/engine/node/start.d.ts.map +1 -0
- package/dist/engine/node/start.js +325 -0
- package/dist/engine/node/start.js.map +1 -0
- package/dist/engine/node/worker-env-aliases.d.ts +39 -0
- package/dist/engine/node/worker-env-aliases.d.ts.map +1 -0
- package/dist/engine/node/worker-env-aliases.js +126 -0
- package/dist/engine/node/worker-env-aliases.js.map +1 -0
- package/dist/engine/node/worker-env-table.d.ts +15 -0
- package/dist/engine/node/worker-env-table.d.ts.map +1 -0
- package/dist/engine/node/worker-env-table.js +100 -0
- package/dist/engine/node/worker-env-table.js.map +1 -0
- package/dist/engine/node/worker-env.d.ts +67 -0
- package/dist/engine/node/worker-env.d.ts.map +1 -0
- package/dist/engine/node/worker-env.js +114 -0
- package/dist/engine/node/worker-env.js.map +1 -0
- package/dist/engine/output.d.ts +97 -0
- package/dist/engine/output.d.ts.map +1 -0
- package/dist/engine/output.js +274 -0
- package/dist/engine/output.js.map +1 -0
- package/dist/engine/package-info.d.ts +7 -0
- package/dist/engine/package-info.d.ts.map +1 -0
- package/dist/engine/package-info.js +38 -0
- package/dist/engine/package-info.js.map +1 -0
- package/dist/engine/program.d.ts +53 -0
- package/dist/engine/program.d.ts.map +1 -0
- package/dist/engine/program.js +213 -0
- package/dist/engine/program.js.map +1 -0
- package/dist/engine/prompt.d.ts +69 -0
- package/dist/engine/prompt.d.ts.map +1 -0
- package/dist/engine/prompt.js +205 -0
- package/dist/engine/prompt.js.map +1 -0
- package/dist/engine/registries.d.ts +5 -0
- package/dist/engine/registries.d.ts.map +1 -0
- package/dist/engine/registries.js +68 -0
- package/dist/engine/registries.js.map +1 -0
- package/dist/engine/request-body.d.ts +31 -0
- package/dist/engine/request-body.d.ts.map +1 -0
- package/dist/engine/request-body.js +156 -0
- package/dist/engine/request-body.js.map +1 -0
- package/dist/engine/semver.d.ts +31 -0
- package/dist/engine/semver.d.ts.map +1 -0
- package/dist/engine/semver.js +100 -0
- package/dist/engine/semver.js.map +1 -0
- package/dist/engine/test-support.d.ts +50 -0
- package/dist/engine/test-support.d.ts.map +1 -0
- package/dist/engine/test-support.js +86 -0
- package/dist/engine/test-support.js.map +1 -0
- package/dist/engine/tui/app-registry.d.ts +103 -0
- package/dist/engine/tui/app-registry.d.ts.map +1 -0
- package/dist/engine/tui/app-registry.js +103 -0
- package/dist/engine/tui/app-registry.js.map +1 -0
- package/dist/engine/tui/app.d.ts +11 -0
- package/dist/engine/tui/app.d.ts.map +1 -0
- package/dist/engine/tui/app.js +134 -0
- package/dist/engine/tui/app.js.map +1 -0
- package/dist/engine/tui/builtin-screens.d.ts +11 -0
- package/dist/engine/tui/builtin-screens.d.ts.map +1 -0
- package/dist/engine/tui/builtin-screens.js +69 -0
- package/dist/engine/tui/builtin-screens.js.map +1 -0
- package/dist/engine/tui/conformance.d.ts +149 -0
- package/dist/engine/tui/conformance.d.ts.map +1 -0
- package/dist/engine/tui/conformance.js +428 -0
- package/dist/engine/tui/conformance.js.map +1 -0
- package/dist/engine/tui/context.d.ts +220 -0
- package/dist/engine/tui/context.d.ts.map +1 -0
- package/dist/engine/tui/context.js +258 -0
- package/dist/engine/tui/context.js.map +1 -0
- package/dist/engine/tui/dashboard/index.d.ts +8 -0
- package/dist/engine/tui/dashboard/index.d.ts.map +1 -0
- package/dist/engine/tui/dashboard/index.js +5 -0
- package/dist/engine/tui/dashboard/index.js.map +1 -0
- package/dist/engine/tui/dashboard/jobs-insights.d.ts +145 -0
- package/dist/engine/tui/dashboard/jobs-insights.d.ts.map +1 -0
- package/dist/engine/tui/dashboard/jobs-insights.js +63 -0
- package/dist/engine/tui/dashboard/jobs-insights.js.map +1 -0
- package/dist/engine/tui/dashboard/node-embedded.d.ts +33 -0
- package/dist/engine/tui/dashboard/node-embedded.d.ts.map +1 -0
- package/dist/engine/tui/dashboard/node-embedded.js +81 -0
- package/dist/engine/tui/dashboard/node-embedded.js.map +1 -0
- package/dist/engine/tui/dashboard/source.d.ts +294 -0
- package/dist/engine/tui/dashboard/source.d.ts.map +1 -0
- package/dist/engine/tui/dashboard/source.js +397 -0
- package/dist/engine/tui/dashboard/source.js.map +1 -0
- package/dist/engine/tui/dashboard/use-dashboard.d.ts +23 -0
- package/dist/engine/tui/dashboard/use-dashboard.d.ts.map +1 -0
- package/dist/engine/tui/dashboard/use-dashboard.js +32 -0
- package/dist/engine/tui/dashboard/use-dashboard.js.map +1 -0
- package/dist/engine/tui/index.d.ts +25 -0
- package/dist/engine/tui/index.d.ts.map +1 -0
- package/dist/engine/tui/index.js +89 -0
- package/dist/engine/tui/index.js.map +1 -0
- package/dist/engine/tui/layout.d.ts +152 -0
- package/dist/engine/tui/layout.d.ts.map +1 -0
- package/dist/engine/tui/layout.js +214 -0
- package/dist/engine/tui/layout.js.map +1 -0
- package/dist/engine/tui/menu-registry.d.ts +201 -0
- package/dist/engine/tui/menu-registry.d.ts.map +1 -0
- package/dist/engine/tui/menu-registry.js +205 -0
- package/dist/engine/tui/menu-registry.js.map +1 -0
- package/dist/engine/tui/menu-tree.d.ts +198 -0
- package/dist/engine/tui/menu-tree.d.ts.map +1 -0
- package/dist/engine/tui/menu-tree.js +276 -0
- package/dist/engine/tui/menu-tree.js.map +1 -0
- package/dist/engine/tui/raw-mode.d.ts +54 -0
- package/dist/engine/tui/raw-mode.d.ts.map +1 -0
- package/dist/engine/tui/raw-mode.js +106 -0
- package/dist/engine/tui/raw-mode.js.map +1 -0
- package/dist/engine/tui/routes.d.ts +5 -0
- package/dist/engine/tui/routes.d.ts.map +1 -0
- package/dist/engine/tui/routes.js +16 -0
- package/dist/engine/tui/routes.js.map +1 -0
- package/dist/engine/tui/screen-registry.d.ts +170 -0
- package/dist/engine/tui/screen-registry.d.ts.map +1 -0
- package/dist/engine/tui/screen-registry.js +180 -0
- package/dist/engine/tui/screen-registry.js.map +1 -0
- package/dist/engine/tui/screen-sections.d.ts +9 -0
- package/dist/engine/tui/screen-sections.d.ts.map +1 -0
- package/dist/engine/tui/screen-sections.js +45 -0
- package/dist/engine/tui/screen-sections.js.map +1 -0
- package/dist/engine/tui/screens/deploy/advanced-model.d.ts +69 -0
- package/dist/engine/tui/screens/deploy/advanced-model.d.ts.map +1 -0
- package/dist/engine/tui/screens/deploy/advanced-model.js +228 -0
- package/dist/engine/tui/screens/deploy/advanced-model.js.map +1 -0
- package/dist/engine/tui/screens/deploy/doctor-model.d.ts +37 -0
- package/dist/engine/tui/screens/deploy/doctor-model.d.ts.map +1 -0
- package/dist/engine/tui/screens/deploy/doctor-model.js +89 -0
- package/dist/engine/tui/screens/deploy/doctor-model.js.map +1 -0
- package/dist/engine/tui/screens/deploy/doctor.d.ts +8 -0
- package/dist/engine/tui/screens/deploy/doctor.d.ts.map +1 -0
- package/dist/engine/tui/screens/deploy/doctor.js +163 -0
- package/dist/engine/tui/screens/deploy/doctor.js.map +1 -0
- package/dist/engine/tui/screens/deploy/fields.d.ts +123 -0
- package/dist/engine/tui/screens/deploy/fields.d.ts.map +1 -0
- package/dist/engine/tui/screens/deploy/fields.js +202 -0
- package/dist/engine/tui/screens/deploy/fields.js.map +1 -0
- package/dist/engine/tui/screens/deploy/flags-model.d.ts +67 -0
- package/dist/engine/tui/screens/deploy/flags-model.d.ts.map +1 -0
- package/dist/engine/tui/screens/deploy/flags-model.js +302 -0
- package/dist/engine/tui/screens/deploy/flags-model.js.map +1 -0
- package/dist/engine/tui/screens/deploy/index.d.ts +6 -0
- package/dist/engine/tui/screens/deploy/index.d.ts.map +1 -0
- package/dist/engine/tui/screens/deploy/index.js +83 -0
- package/dist/engine/tui/screens/deploy/index.js.map +1 -0
- package/dist/engine/tui/screens/deploy/install-model.d.ts +159 -0
- package/dist/engine/tui/screens/deploy/install-model.d.ts.map +1 -0
- package/dist/engine/tui/screens/deploy/install-model.js +319 -0
- package/dist/engine/tui/screens/deploy/install-model.js.map +1 -0
- package/dist/engine/tui/screens/deploy/install.d.ts +8 -0
- package/dist/engine/tui/screens/deploy/install.d.ts.map +1 -0
- package/dist/engine/tui/screens/deploy/install.js +365 -0
- package/dist/engine/tui/screens/deploy/install.js.map +1 -0
- package/dist/engine/tui/screens/deploy/model.d.ts +49 -0
- package/dist/engine/tui/screens/deploy/model.d.ts.map +1 -0
- package/dist/engine/tui/screens/deploy/model.js +59 -0
- package/dist/engine/tui/screens/deploy/model.js.map +1 -0
- package/dist/engine/tui/screens/deploy/run-model.d.ts +58 -0
- package/dist/engine/tui/screens/deploy/run-model.d.ts.map +1 -0
- package/dist/engine/tui/screens/deploy/run-model.js +117 -0
- package/dist/engine/tui/screens/deploy/run-model.js.map +1 -0
- package/dist/engine/tui/screens/deploy/run.d.ts +75 -0
- package/dist/engine/tui/screens/deploy/run.d.ts.map +1 -0
- package/dist/engine/tui/screens/deploy/run.js +201 -0
- package/dist/engine/tui/screens/deploy/run.js.map +1 -0
- package/dist/engine/tui/screens/deploy/status.d.ts +17 -0
- package/dist/engine/tui/screens/deploy/status.d.ts.map +1 -0
- package/dist/engine/tui/screens/deploy/status.js +107 -0
- package/dist/engine/tui/screens/deploy/status.js.map +1 -0
- package/dist/engine/tui/screens/deploy/update.d.ts +41 -0
- package/dist/engine/tui/screens/deploy/update.d.ts.map +1 -0
- package/dist/engine/tui/screens/deploy/update.js +175 -0
- package/dist/engine/tui/screens/deploy/update.js.map +1 -0
- package/dist/engine/tui/screens/deploy.d.ts +12 -0
- package/dist/engine/tui/screens/deploy.d.ts.map +1 -0
- package/dist/engine/tui/screens/deploy.js +23 -0
- package/dist/engine/tui/screens/deploy.js.map +1 -0
- package/dist/engine/tui/screens/invoke.d.ts +6 -0
- package/dist/engine/tui/screens/invoke.d.ts.map +1 -0
- package/dist/engine/tui/screens/invoke.js +196 -0
- package/dist/engine/tui/screens/invoke.js.map +1 -0
- package/dist/engine/tui/screens/jobs.d.ts +12 -0
- package/dist/engine/tui/screens/jobs.d.ts.map +1 -0
- package/dist/engine/tui/screens/jobs.js +72 -0
- package/dist/engine/tui/screens/jobs.js.map +1 -0
- package/dist/engine/tui/screens/login.d.ts +6 -0
- package/dist/engine/tui/screens/login.d.ts.map +1 -0
- package/dist/engine/tui/screens/login.js +263 -0
- package/dist/engine/tui/screens/login.js.map +1 -0
- package/dist/engine/tui/screens/logout.d.ts +6 -0
- package/dist/engine/tui/screens/logout.d.ts.map +1 -0
- package/dist/engine/tui/screens/logout.js +149 -0
- package/dist/engine/tui/screens/logout.js.map +1 -0
- package/dist/engine/tui/screens/menu.d.ts +25 -0
- package/dist/engine/tui/screens/menu.d.ts.map +1 -0
- package/dist/engine/tui/screens/menu.js +124 -0
- package/dist/engine/tui/screens/menu.js.map +1 -0
- package/dist/engine/tui/screens/node.d.ts +6 -0
- package/dist/engine/tui/screens/node.d.ts.map +1 -0
- package/dist/engine/tui/screens/node.js +277 -0
- package/dist/engine/tui/screens/node.js.map +1 -0
- package/dist/engine/tui/screens/not-logged-in.d.ts +12 -0
- package/dist/engine/tui/screens/not-logged-in.d.ts.map +1 -0
- package/dist/engine/tui/screens/not-logged-in.js +14 -0
- package/dist/engine/tui/screens/not-logged-in.js.map +1 -0
- package/dist/engine/tui/screens/status.d.ts +6 -0
- package/dist/engine/tui/screens/status.d.ts.map +1 -0
- package/dist/engine/tui/screens/status.js +138 -0
- package/dist/engine/tui/screens/status.js.map +1 -0
- package/dist/engine/tui/scroll-box.d.ts +42 -0
- package/dist/engine/tui/scroll-box.d.ts.map +1 -0
- package/dist/engine/tui/scroll-box.js +62 -0
- package/dist/engine/tui/scroll-box.js.map +1 -0
- package/dist/engine/tui/section-registry.d.ts +65 -0
- package/dist/engine/tui/section-registry.d.ts.map +1 -0
- package/dist/engine/tui/section-registry.js +90 -0
- package/dist/engine/tui/section-registry.js.map +1 -0
- package/dist/engine/tui/terminal.d.ts +31 -0
- package/dist/engine/tui/terminal.d.ts.map +1 -0
- package/dist/engine/tui/terminal.js +142 -0
- package/dist/engine/tui/terminal.js.map +1 -0
- package/dist/engine/tui/testing/feeds.d.ts +58 -0
- package/dist/engine/tui/testing/feeds.d.ts.map +1 -0
- package/dist/engine/tui/testing/feeds.js +67 -0
- package/dist/engine/tui/testing/feeds.js.map +1 -0
- package/dist/engine/tui/testing/harness.d.ts +243 -0
- package/dist/engine/tui/testing/harness.d.ts.map +1 -0
- package/dist/engine/tui/testing/harness.js +332 -0
- package/dist/engine/tui/testing/harness.js.map +1 -0
- package/dist/engine/tui/theme.d.ts +179 -0
- package/dist/engine/tui/theme.d.ts.map +1 -0
- package/dist/engine/tui/theme.js +111 -0
- package/dist/engine/tui/theme.js.map +1 -0
- package/dist/engine/tui/tty.d.ts +56 -0
- package/dist/engine/tui/tty.d.ts.map +1 -0
- package/dist/engine/tui/tty.js +146 -0
- package/dist/engine/tui/tty.js.map +1 -0
- package/dist/engine/tui/ui/active-items.d.ts +40 -0
- package/dist/engine/tui/ui/active-items.d.ts.map +1 -0
- package/dist/engine/tui/ui/active-items.js +38 -0
- package/dist/engine/tui/ui/active-items.js.map +1 -0
- package/dist/engine/tui/ui/event-log.d.ts +58 -0
- package/dist/engine/tui/ui/event-log.d.ts.map +1 -0
- package/dist/engine/tui/ui/event-log.js +32 -0
- package/dist/engine/tui/ui/event-log.js.map +1 -0
- package/dist/engine/tui/ui/index.d.ts +20 -0
- package/dist/engine/tui/ui/index.d.ts.map +1 -0
- package/dist/engine/tui/ui/index.js +14 -0
- package/dist/engine/tui/ui/index.js.map +1 -0
- package/dist/engine/tui/ui/meter-legend.d.ts +26 -0
- package/dist/engine/tui/ui/meter-legend.d.ts.map +1 -0
- package/dist/engine/tui/ui/meter-legend.js +25 -0
- package/dist/engine/tui/ui/meter-legend.js.map +1 -0
- package/dist/engine/tui/ui/run-summary.d.ts +58 -0
- package/dist/engine/tui/ui/run-summary.d.ts.map +1 -0
- package/dist/engine/tui/ui/run-summary.js +29 -0
- package/dist/engine/tui/ui/run-summary.js.map +1 -0
- package/dist/engine/tui/ui/segment-meter.d.ts +72 -0
- package/dist/engine/tui/ui/segment-meter.d.ts.map +1 -0
- package/dist/engine/tui/ui/segment-meter.js +128 -0
- package/dist/engine/tui/ui/segment-meter.js.map +1 -0
- package/dist/engine/tui/ui/status-line.d.ts +42 -0
- package/dist/engine/tui/ui/status-line.d.ts.map +1 -0
- package/dist/engine/tui/ui/status-line.js +35 -0
- package/dist/engine/tui/ui/status-line.js.map +1 -0
- package/dist/engine/tui/ui/tone.d.ts +46 -0
- package/dist/engine/tui/ui/tone.d.ts.map +1 -0
- package/dist/engine/tui/ui/tone.js +48 -0
- package/dist/engine/tui/ui/tone.js.map +1 -0
- package/dist/engine/update-notice-options.d.ts +70 -0
- package/dist/engine/update-notice-options.d.ts.map +1 -0
- package/dist/engine/update-notice-options.js +79 -0
- package/dist/engine/update-notice-options.js.map +1 -0
- package/dist/engine/update-notice.d.ts +69 -0
- package/dist/engine/update-notice.d.ts.map +1 -0
- package/dist/engine/update-notice.js +204 -0
- package/dist/engine/update-notice.js.map +1 -0
- package/dist/index.d.ts +4 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -5
- package/dist/index.js.map +1 -1
- package/dist/node/index.d.ts +3 -0
- package/dist/node/index.d.ts.map +1 -0
- package/dist/node/index.js +5 -0
- package/dist/node/index.js.map +1 -0
- package/dist/telemetry/index.d.ts +2 -1
- package/dist/telemetry/index.d.ts.map +1 -1
- package/dist/telemetry/index.js +1 -0
- package/dist/telemetry/index.js.map +1 -1
- package/dist/telemetry/node-span-relay.d.ts +1 -1
- package/dist/telemetry/node-span-relay.d.ts.map +1 -1
- package/dist/telemetry/node-span-relay.js +39 -6
- package/dist/telemetry/node-span-relay.js.map +1 -1
- package/dist/telemetry/node-span.d.ts +39 -7
- package/dist/telemetry/node-span.d.ts.map +1 -1
- package/dist/telemetry/node-span.js +19 -1
- package/dist/telemetry/node-span.js.map +1 -1
- package/dist/testing/index.d.ts +3 -0
- package/dist/testing/index.d.ts.map +1 -0
- package/dist/testing/index.js +4 -0
- package/dist/testing/index.js.map +1 -0
- package/dist/tui/index.d.ts +3 -0
- package/dist/tui/index.d.ts.map +1 -0
- package/dist/tui/index.js +7 -0
- package/dist/tui/index.js.map +1 -0
- package/dist/tui/testing/index.d.ts +5 -0
- package/dist/tui/testing/index.d.ts.map +1 -0
- package/dist/tui/testing/index.js +12 -0
- package/dist/tui/testing/index.js.map +1 -0
- package/dist/tui/ui/index.d.ts +2 -0
- package/dist/tui/ui/index.d.ts.map +1 -0
- package/dist/tui/ui/index.js +10 -0
- package/dist/tui/ui/index.js.map +1 -0
- package/package.json +56 -5
|
@@ -0,0 +1,295 @@
|
|
|
1
|
+
import { existsSync } from 'node:fs';
|
|
2
|
+
import { dirname, join, resolve } from 'node:path';
|
|
3
|
+
import { metadataFor, } from '../deploy/env-metadata.js';
|
|
4
|
+
// =============================================================================
|
|
5
|
+
// The LOCAL profile (issue #344, epic #341)
|
|
6
|
+
// =============================================================================
|
|
7
|
+
//
|
|
8
|
+
// `deploy install` and `init` ask the same question - "what belongs in
|
|
9
|
+
// infra/compose/.env?" - about two different machines. Everything that answers
|
|
10
|
+
// it is already written and is REUSED WHOLE: `parseEnvExample` produces the
|
|
11
|
+
// question list, `runEnvWizard` drives it, `generateBase64Key` makes the
|
|
12
|
+
// secrets, `serializeEnvFile` writes the file. This module is only the
|
|
13
|
+
// DIFFERENCE between the two machines, and it is deliberately about a page
|
|
14
|
+
// long, because that difference is genuinely small:
|
|
15
|
+
//
|
|
16
|
+
// - NODE_ENV is not forced to production. A checkout is a development
|
|
17
|
+
// environment; that is the entire point of it.
|
|
18
|
+
// - APP_URL is not derived from a public domain. There isn't one. The
|
|
19
|
+
// template's own default (http://localhost:3535) is already the right
|
|
20
|
+
// answer, which is why this file does not restate it.
|
|
21
|
+
// - The OAuth callback is still DERIVED rather than asked - from APP_URL
|
|
22
|
+
// instead of from a domain. The deploy path's reason holds unchanged
|
|
23
|
+
// locally: a callback that disagrees with APP_URL is the single most
|
|
24
|
+
// common way a hand-written .env fails, and both restate a fact the
|
|
25
|
+
// operator has already stated.
|
|
26
|
+
// - Google credentials and the admin address may be EMPTY here. On a VPS
|
|
27
|
+
// they cannot: a deployment nobody can log into is not a deployment. In a
|
|
28
|
+
// fresh clone "I have not created the OAuth client yet" is a real, normal
|
|
29
|
+
// state, and refusing to write a file over it just leaves the person with
|
|
30
|
+
// no .env at all.
|
|
31
|
+
//
|
|
32
|
+
// WHAT THIS FILE DELIBERATELY DOES NOT DO is re-specify defaults.
|
|
33
|
+
// `.env.example` is the specification (see env-spec.ts's header), so every
|
|
34
|
+
// value not named below - ports, token lifetimes, job queue tuning, storage
|
|
35
|
+
// limits - comes from the template, and a fork that adds a variable gets it
|
|
36
|
+
// here for free.
|
|
37
|
+
// =============================================================================
|
|
38
|
+
/** Where the template and the file it generates live, relative to the root. */
|
|
39
|
+
export const ENV_TEMPLATE_RELATIVE_PATH = join('infra', 'compose', '.env.example');
|
|
40
|
+
export const ENV_FILE_RELATIVE_PATH = join('infra', 'compose', '.env');
|
|
41
|
+
/**
|
|
42
|
+
* Walks up from `startDir` looking for the environment template.
|
|
43
|
+
*
|
|
44
|
+
* ANCHORED ON `.env.example`, NOT ON `.git` OR `package.json`. It is the file
|
|
45
|
+
* this command actually needs, so finding it IS the precondition; a checkout
|
|
46
|
+
* exported without its git directory, or a nested workspace with its own
|
|
47
|
+
* package.json, would both defeat the other two anchors.
|
|
48
|
+
*/
|
|
49
|
+
export function findRepoRoot(startDir) {
|
|
50
|
+
let current = resolve(startDir);
|
|
51
|
+
for (;;) {
|
|
52
|
+
if (existsSync(join(current, ENV_TEMPLATE_RELATIVE_PATH)))
|
|
53
|
+
return current;
|
|
54
|
+
const parent = dirname(current);
|
|
55
|
+
if (parent === current)
|
|
56
|
+
return undefined;
|
|
57
|
+
current = parent;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Generated with the CSPRNG, never put to anybody.
|
|
62
|
+
*
|
|
63
|
+
* Asking a human to invent a 32-byte key produces one of two things: a value
|
|
64
|
+
* pasted from another system, or `openssl rand -base64 32` run in a second
|
|
65
|
+
* terminal - which is precisely the manual step this command exists to remove.
|
|
66
|
+
*/
|
|
67
|
+
export const GENERATED_KEYS = [
|
|
68
|
+
'JWT_SECRET',
|
|
69
|
+
'COOKIE_SECRET',
|
|
70
|
+
'SECRETS_ENCRYPTION_KEY',
|
|
71
|
+
];
|
|
72
|
+
/**
|
|
73
|
+
* The only keys a person is asked about, because nothing can work them out.
|
|
74
|
+
*
|
|
75
|
+
* Note what is NOT here: everything with a usable template default. Eight
|
|
76
|
+
* questions is a setup; thirty-four is a form, and a form is something people
|
|
77
|
+
* click through - the same argument env-wizard.ts's header makes for deploy.
|
|
78
|
+
*/
|
|
79
|
+
export const PROMPTED_KEYS = [
|
|
80
|
+
'INITIAL_ADMIN_EMAIL',
|
|
81
|
+
'GOOGLE_CLIENT_ID',
|
|
82
|
+
'GOOGLE_CLIENT_SECRET',
|
|
83
|
+
'POSTGRES_HOST',
|
|
84
|
+
'POSTGRES_PORT',
|
|
85
|
+
'POSTGRES_USER',
|
|
86
|
+
'POSTGRES_PASSWORD',
|
|
87
|
+
'POSTGRES_DB',
|
|
88
|
+
];
|
|
89
|
+
/** Keys an unfinished setup may legitimately leave empty. */
|
|
90
|
+
export const BLANK_OK_KEYS = [
|
|
91
|
+
'INITIAL_ADMIN_EMAIL',
|
|
92
|
+
'GOOGLE_CLIENT_ID',
|
|
93
|
+
'GOOGLE_CLIENT_SECRET',
|
|
94
|
+
];
|
|
95
|
+
/**
|
|
96
|
+
* Keys the application cannot actually run without, in the order they bite.
|
|
97
|
+
*
|
|
98
|
+
* GOOGLE_CLIENT_ID is first because its absence is not a degraded feature: the
|
|
99
|
+
* API does not boot at all. Passport's OAuth2Strategy throws "OAuth2Strategy
|
|
100
|
+
* requires a clientID option" while Nest is still wiring modules, so the
|
|
101
|
+
* container exits before it ever serves a request. That fact is currently
|
|
102
|
+
* recorded in a comment in .github/workflows/ci.yml and nowhere a person
|
|
103
|
+
* setting the project up would look, which is why `init` says it out loud.
|
|
104
|
+
*/
|
|
105
|
+
export const REQUIRED_TO_RUN = [
|
|
106
|
+
'GOOGLE_CLIENT_ID',
|
|
107
|
+
'GOOGLE_CLIENT_SECRET',
|
|
108
|
+
'INITIAL_ADMIN_EMAIL',
|
|
109
|
+
];
|
|
110
|
+
/**
|
|
111
|
+
* The compose service name the database answers to, and the default offered
|
|
112
|
+
* for POSTGRES_HOST.
|
|
113
|
+
*
|
|
114
|
+
* THE ONE TEMPLATE DEFAULT THIS PROFILE OVERRIDES, and the reason is that the
|
|
115
|
+
* template's `localhost` is right for exactly one of the two readers of this
|
|
116
|
+
* file and wrong for the other. base.compose.yml passes POSTGRES_HOST into the
|
|
117
|
+
* api CONTAINER (falling back to `db` when .env omits it), and inside that
|
|
118
|
+
* container `localhost` is the container itself - so accepting every default
|
|
119
|
+
* would produce a stack that cannot reach its own database, which is the one
|
|
120
|
+
* outcome this command exists to prevent.
|
|
121
|
+
*
|
|
122
|
+
* The cost is stated in the prompt's help and in the next steps: host-side
|
|
123
|
+
* tooling (`prisma:migrate` run from the checkout) resolves this name too, and
|
|
124
|
+
* cannot resolve `db`. Somebody pointing at a PostgreSQL on their own machine
|
|
125
|
+
* answers `localhost` and gets the host-side commands instead.
|
|
126
|
+
*/
|
|
127
|
+
export const COMPOSE_DB_HOST = 'db';
|
|
128
|
+
/** True when this host name only means anything inside the compose network. */
|
|
129
|
+
export function isComposeInternalHost(host) {
|
|
130
|
+
return host !== undefined && host !== '' && !/^(localhost|127\.0\.0\.1|\[?::1\]?)$/.test(host);
|
|
131
|
+
}
|
|
132
|
+
function isBlank(value) {
|
|
133
|
+
return value === undefined || value === '';
|
|
134
|
+
}
|
|
135
|
+
/** `<APP_URL>/api/auth/<provider>/callback`, with any trailing slash removed. */
|
|
136
|
+
export function callbackUrlFor(appUrl, provider) {
|
|
137
|
+
if (isBlank(appUrl))
|
|
138
|
+
return undefined;
|
|
139
|
+
return `${appUrl.replace(/\/+$/, '')}/api/auth/${provider}/callback`;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Local derivations, keyed on the ANSWERS rather than on a domain.
|
|
143
|
+
*
|
|
144
|
+
* APP_URL is resolved before either of these, because `.env.example` presents
|
|
145
|
+
* the Application section before the OAuth ones and the wizard walks the
|
|
146
|
+
* template in file order - the same ordering guarantee the deploy path's
|
|
147
|
+
* derivations already rely on.
|
|
148
|
+
*/
|
|
149
|
+
const LOCAL_DERIVATIONS = {
|
|
150
|
+
GOOGLE_CALLBACK_URL: ({ answers }) => callbackUrlFor(answers.get('APP_URL'), 'google'),
|
|
151
|
+
// Only once somebody has actually configured Microsoft. Returning undefined
|
|
152
|
+
// leaves the key exactly as the template has it - commented out - rather
|
|
153
|
+
// than writing a callback for a provider this deployment does not use.
|
|
154
|
+
MICROSOFT_CALLBACK_URL: ({ answers }) => isBlank(answers.get('MICROSOFT_CLIENT_ID'))
|
|
155
|
+
? undefined
|
|
156
|
+
: callbackUrlFor(answers.get('APP_URL'), 'microsoft'),
|
|
157
|
+
};
|
|
158
|
+
/**
|
|
159
|
+
* The local annotation for one key.
|
|
160
|
+
*
|
|
161
|
+
* Built FROM `metadataFor`, not beside it. `secret`, `validate`, `generate`,
|
|
162
|
+
* `never` and `group` are facts about the variable itself and are identical on
|
|
163
|
+
* both machines - a password is a password, and TEST_AUTH_ENABLED is still
|
|
164
|
+
* never written. Only the four members that encode "this is a public VPS"
|
|
165
|
+
* (`fixed`, the domain-based `derive`, and which keys are `essential`) are
|
|
166
|
+
* replaced. Keeping the shared half means a fork that annotates a new variable
|
|
167
|
+
* gets it in both profiles at once.
|
|
168
|
+
*/
|
|
169
|
+
export function localMetadataFor(key) {
|
|
170
|
+
const base = metadataFor(key);
|
|
171
|
+
const local = {};
|
|
172
|
+
if (base.never === true)
|
|
173
|
+
local.never = true;
|
|
174
|
+
if (base.secret === true)
|
|
175
|
+
local.secret = true;
|
|
176
|
+
if (base.generate !== undefined)
|
|
177
|
+
local.generate = base.generate;
|
|
178
|
+
if (base.validate !== undefined)
|
|
179
|
+
local.validate = base.validate;
|
|
180
|
+
// Groups stay opt-in exactly as they are on a VPS: the observability and
|
|
181
|
+
// storage stacks are separate compose overlays, so their variables belong to
|
|
182
|
+
// whoever turns those on. Skipping them also keeps their several secret keys
|
|
183
|
+
// out of the question list, which is what keeps this to eight prompts.
|
|
184
|
+
if (base.group !== undefined)
|
|
185
|
+
local.group = base.group;
|
|
186
|
+
const derive = LOCAL_DERIVATIONS[key];
|
|
187
|
+
if (derive !== undefined)
|
|
188
|
+
local.derive = derive;
|
|
189
|
+
if (PROMPTED_KEYS.includes(key))
|
|
190
|
+
local.essential = true;
|
|
191
|
+
if (BLANK_OK_KEYS.includes(key))
|
|
192
|
+
local.allowBlank = true;
|
|
193
|
+
return local;
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* Per-key adjustments to the parsed template, applied before the wizard runs.
|
|
197
|
+
*
|
|
198
|
+
* Two kinds, both about what pressing Enter should mean:
|
|
199
|
+
*
|
|
200
|
+
* - A PLACEHOLDER is not a default. `your-google-client-id` fails the shared
|
|
201
|
+
* `rejectPlaceholder` validator, so leaving it as the fallback would trap
|
|
202
|
+
* somebody on a question whose offered answer is refused. Empty is the
|
|
203
|
+
* honest default for a credential that does not exist yet.
|
|
204
|
+
* - `.env.example`'s help is written for a person copying the file by hand.
|
|
205
|
+
* Where a prompt needs to say more than that, it is said here, next to the
|
|
206
|
+
* reason - never by editing `.env.example`, which is a validated file that
|
|
207
|
+
* both this CLI and Docker Compose read.
|
|
208
|
+
*/
|
|
209
|
+
const SPEC_OVERRIDES = {
|
|
210
|
+
POSTGRES_HOST: {
|
|
211
|
+
defaultValue: COMPOSE_DB_HOST,
|
|
212
|
+
help: [
|
|
213
|
+
'Where PostgreSQL is, as the API sees it.',
|
|
214
|
+
'',
|
|
215
|
+
` ${COMPOSE_DB_HOST} the database container (add -f devdb.compose.yml when you`,
|
|
216
|
+
' bring the stack up). The right answer if you have no',
|
|
217
|
+
' PostgreSQL of your own.',
|
|
218
|
+
' localhost a PostgreSQL already running on this machine.',
|
|
219
|
+
'',
|
|
220
|
+
'This name is also what `prisma:migrate` uses. A compose service name',
|
|
221
|
+
`resolves only inside the stack, so with ${COMPOSE_DB_HOST} the migration runs in the`,
|
|
222
|
+
'api container; with localhost it runs from this checkout.',
|
|
223
|
+
].join('\n'),
|
|
224
|
+
},
|
|
225
|
+
POSTGRES_PASSWORD: {
|
|
226
|
+
help: [
|
|
227
|
+
'The database password.',
|
|
228
|
+
'',
|
|
229
|
+
'Press Enter to accept the development default (postgres), which is',
|
|
230
|
+
'also what the devdb.compose.yml container is created with.',
|
|
231
|
+
].join('\n'),
|
|
232
|
+
},
|
|
233
|
+
GOOGLE_CLIENT_ID: {
|
|
234
|
+
defaultValue: '',
|
|
235
|
+
help: [
|
|
236
|
+
'REQUIRED to run the application. The API does not start without it:',
|
|
237
|
+
'Passport throws "OAuth2Strategy requires a clientID option" during',
|
|
238
|
+
'bootstrap, so the container exits before serving anything.',
|
|
239
|
+
'',
|
|
240
|
+
'Create one at https://console.cloud.google.com/apis/credentials, with',
|
|
241
|
+
'the callback URL shown at the end of this run as an authorised',
|
|
242
|
+
'redirect URI. You may leave it empty now and fill it in later.',
|
|
243
|
+
].join('\n'),
|
|
244
|
+
},
|
|
245
|
+
GOOGLE_CLIENT_SECRET: { defaultValue: '' },
|
|
246
|
+
INITIAL_ADMIN_EMAIL: {
|
|
247
|
+
defaultValue: '',
|
|
248
|
+
help: [
|
|
249
|
+
'The Google account that becomes the first Admin.',
|
|
250
|
+
'',
|
|
251
|
+
'The seed writes it to the allowlist, and the first login matching it',
|
|
252
|
+
'claims the Admin role. Every other address is refused by the allowlist,',
|
|
253
|
+
'so with this empty NOBODY can log in - not even you.',
|
|
254
|
+
].join('\n'),
|
|
255
|
+
},
|
|
256
|
+
};
|
|
257
|
+
/** Applies those adjustments, leaving every other spec exactly as parsed. */
|
|
258
|
+
export function localSpecs(specs) {
|
|
259
|
+
return specs.map((spec) => {
|
|
260
|
+
const override = SPEC_OVERRIDES[spec.key];
|
|
261
|
+
if (override === undefined)
|
|
262
|
+
return spec;
|
|
263
|
+
return {
|
|
264
|
+
...spec,
|
|
265
|
+
...(override.defaultValue === undefined ? {} : { defaultValue: override.defaultValue }),
|
|
266
|
+
...(override.help === undefined ? {} : { help: override.help }),
|
|
267
|
+
};
|
|
268
|
+
});
|
|
269
|
+
}
|
|
270
|
+
/**
|
|
271
|
+
* The answers an unattended run gives to the questions it cannot ask.
|
|
272
|
+
*
|
|
273
|
+
* The wizard refuses, by design, to let an ESSENTIAL key fall back to its
|
|
274
|
+
* template default when nobody is there to confirm it - `deploy install`
|
|
275
|
+
* silently shipping `POSTGRES_PASSWORD=postgres` to a public server is exactly
|
|
276
|
+
* the accident that rule prevents. Locally those defaults ARE the intended
|
|
277
|
+
* answers, so this supplies them as answers rather than weakening the rule.
|
|
278
|
+
*
|
|
279
|
+
* Only keys with a usable default appear. The three in BLANK_OK_KEYS have
|
|
280
|
+
* none, and stay empty through `allowBlank`.
|
|
281
|
+
*/
|
|
282
|
+
export function unattendedLocalAnswers(specs) {
|
|
283
|
+
const answers = new Map();
|
|
284
|
+
for (const spec of localSpecs(specs)) {
|
|
285
|
+
if (!PROMPTED_KEYS.includes(spec.key))
|
|
286
|
+
continue;
|
|
287
|
+
if (BLANK_OK_KEYS.includes(spec.key))
|
|
288
|
+
continue;
|
|
289
|
+
if (spec.defaultValue === '')
|
|
290
|
+
continue;
|
|
291
|
+
answers.set(spec.key, spec.defaultValue);
|
|
292
|
+
}
|
|
293
|
+
return answers;
|
|
294
|
+
}
|
|
295
|
+
//# sourceMappingURL=local-profile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"local-profile.js","sourceRoot":"","sources":["../../../src/engine/init/local-profile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEnD,OAAO,EACL,WAAW,GAGZ,MAAM,2BAA2B,CAAC;AAGnC,gFAAgF;AAChF,6CAA6C;AAC7C,gFAAgF;AAChF,EAAE;AACF,uEAAuE;AACvE,+EAA+E;AAC/E,4EAA4E;AAC5E,yEAAyE;AACzE,uEAAuE;AACvE,2EAA2E;AAC3E,oDAAoD;AACpD,EAAE;AACF,wEAAwE;AACxE,mDAAmD;AACnD,wEAAwE;AACxE,0EAA0E;AAC1E,0DAA0D;AAC1D,2EAA2E;AAC3E,yEAAyE;AACzE,yEAAyE;AACzE,wEAAwE;AACxE,mCAAmC;AACnC,2EAA2E;AAC3E,8EAA8E;AAC9E,8EAA8E;AAC9E,8EAA8E;AAC9E,sBAAsB;AACtB,EAAE;AACF,kEAAkE;AAClE,2EAA2E;AAC3E,4EAA4E;AAC5E,4EAA4E;AAC5E,iBAAiB;AACjB,gFAAgF;AAEhF,+EAA+E;AAC/E,MAAM,CAAC,MAAM,0BAA0B,GAAG,IAAI,CAAC,OAAO,EAAE,SAAS,EAAE,cAAc,CAAC,CAAC;AACnF,MAAM,CAAC,MAAM,sBAAsB,GAAG,IAAI,CAAC,OAAO,EAAE,SAAS,EAAE,MAAM,CAAC,CAAC;AAEvE;;;;;;;GAOG;AACH,MAAM,UAAU,YAAY,CAAC,QAAgB;IAC3C,IAAI,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;IAEhC,SAAS,CAAC;QACR,IAAI,UAAU,CAAC,IAAI,CAAC,OAAO,EAAE,0BAA0B,CAAC,CAAC;YAAE,OAAO,OAAO,CAAC;QAC1E,MAAM,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;QAChC,IAAI,MAAM,KAAK,OAAO;YAAE,OAAO,SAAS,CAAC;QACzC,OAAO,GAAG,MAAM,CAAC;IACnB,CAAC;AACH,CAAC;AAED;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,cAAc,GAAsB;IAC/C,YAAY;IACZ,eAAe;IACf,wBAAwB;CACzB,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,aAAa,GAAsB;IAC9C,qBAAqB;IACrB,kBAAkB;IAClB,sBAAsB;IACtB,eAAe;IACf,eAAe;IACf,eAAe;IACf,mBAAmB;IACnB,aAAa;CACd,CAAC;AAEF,6DAA6D;AAC7D,MAAM,CAAC,MAAM,aAAa,GAAsB;IAC9C,qBAAqB;IACrB,kBAAkB;IAClB,sBAAsB;CACvB,CAAC;AAEF;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,eAAe,GAAsB;IAChD,kBAAkB;IAClB,sBAAsB;IACtB,qBAAqB;CACtB,CAAC;AAEF;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,IAAI,CAAC;AAEpC,+EAA+E;AAC/E,MAAM,UAAU,qBAAqB,CAAC,IAAwB;IAC5D,OAAO,IAAI,KAAK,SAAS,IAAI,IAAI,KAAK,EAAE,IAAI,CAAC,sCAAsC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACjG,CAAC;AAED,SAAS,OAAO,CAAC,KAAyB;IACxC,OAAO,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,EAAE,CAAC;AAC7C,CAAC;AAED,iFAAiF;AACjF,MAAM,UAAU,cAAc,CAC5B,MAA0B,EAC1B,QAAgB;IAEhB,IAAI,OAAO,CAAC,MAAM,CAAC;QAAE,OAAO,SAAS,CAAC;IACtC,OAAO,GAAI,MAAiB,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,aAAa,QAAQ,WAAW,CAAC;AACnF,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,iBAAiB,GAEnB;IACF,mBAAmB,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,cAAc,CAAC,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,QAAQ,CAAC;IACtF,4EAA4E;IAC5E,yEAAyE;IACzE,uEAAuE;IACvE,sBAAsB,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CACtC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAC;QACzC,CAAC,CAAC,SAAS;QACX,CAAC,CAAC,cAAc,CAAC,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,WAAW,CAAC;CAC1D,CAAC;AAEF;;;;;;;;;;GAUG;AACH,MAAM,UAAU,gBAAgB,CAAC,GAAW;IAC1C,MAAM,IAAI,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC;IAC9B,MAAM,KAAK,GAAmB,EAAE,CAAC;IAEjC,IAAI,IAAI,CAAC,KAAK,KAAK,IAAI;QAAE,KAAK,CAAC,KAAK,GAAG,IAAI,CAAC;IAC5C,IAAI,IAAI,CAAC,MAAM,KAAK,IAAI;QAAE,KAAK,CAAC,MAAM,GAAG,IAAI,CAAC;IAC9C,IAAI,IAAI,CAAC,QAAQ,KAAK,SAAS;QAAE,KAAK,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;IAChE,IAAI,IAAI,CAAC,QAAQ,KAAK,SAAS;QAAE,KAAK,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;IAChE,yEAAyE;IACzE,6EAA6E;IAC7E,6EAA6E;IAC7E,uEAAuE;IACvE,IAAI,IAAI,CAAC,KAAK,KAAK,SAAS;QAAE,KAAK,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;IAEvD,MAAM,MAAM,GAAG,iBAAiB,CAAC,GAAG,CAAC,CAAC;IACtC,IAAI,MAAM,KAAK,SAAS;QAAE,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC;IAChD,IAAI,aAAa,CAAC,QAAQ,CAAC,GAAG,CAAC;QAAE,KAAK,CAAC,SAAS,GAAG,IAAI,CAAC;IACxD,IAAI,aAAa,CAAC,QAAQ,CAAC,GAAG,CAAC;QAAE,KAAK,CAAC,UAAU,GAAG,IAAI,CAAC;IAEzD,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,cAAc,GAEhB;IACF,aAAa,EAAE;QACb,YAAY,EAAE,eAAe;QAC7B,IAAI,EAAE;YACJ,0CAA0C;YAC1C,EAAE;YACF,KAAK,eAAe,oEAAoE;YACxF,mEAAmE;YACnE,sCAAsC;YACtC,4DAA4D;YAC5D,EAAE;YACF,sEAAsE;YACtE,2CAA2C,eAAe,4BAA4B;YACtF,2DAA2D;SAC5D,CAAC,IAAI,CAAC,IAAI,CAAC;KACb;IACD,iBAAiB,EAAE;QACjB,IAAI,EAAE;YACJ,wBAAwB;YACxB,EAAE;YACF,oEAAoE;YACpE,4DAA4D;SAC7D,CAAC,IAAI,CAAC,IAAI,CAAC;KACb;IACD,gBAAgB,EAAE;QAChB,YAAY,EAAE,EAAE;QAChB,IAAI,EAAE;YACJ,qEAAqE;YACrE,oEAAoE;YACpE,4DAA4D;YAC5D,EAAE;YACF,uEAAuE;YACvE,gEAAgE;YAChE,gEAAgE;SACjE,CAAC,IAAI,CAAC,IAAI,CAAC;KACb;IACD,oBAAoB,EAAE,EAAE,YAAY,EAAE,EAAE,EAAE;IAC1C,mBAAmB,EAAE;QACnB,YAAY,EAAE,EAAE;QAChB,IAAI,EAAE;YACJ,kDAAkD;YAClD,EAAE;YACF,sEAAsE;YACtE,yEAAyE;YACzE,sDAAsD;SACvD,CAAC,IAAI,CAAC,IAAI,CAAC;KACb;CACF,CAAC;AAEF,6EAA6E;AAC7E,MAAM,UAAU,UAAU,CAAC,KAA4B;IACrD,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;QACxB,MAAM,QAAQ,GAAG,cAAc,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAC1C,IAAI,QAAQ,KAAK,SAAS;YAAE,OAAO,IAAI,CAAC;QAExC,OAAO;YACL,GAAG,IAAI;YACP,GAAG,CAAC,QAAQ,CAAC,YAAY,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,QAAQ,CAAC,YAAY,EAAE,CAAC;YACvF,GAAG,CAAC,QAAQ,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,QAAQ,CAAC,IAAI,EAAE,CAAC;SAChE,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,sBAAsB,CAAC,KAA4B;IACjE,MAAM,OAAO,GAAG,IAAI,GAAG,EAAkB,CAAC;IAE1C,KAAK,MAAM,IAAI,IAAI,UAAU,CAAC,KAAK,CAAC,EAAE,CAAC;QACrC,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC;YAAE,SAAS;QAChD,IAAI,aAAa,CAAC,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC;YAAE,SAAS;QAC/C,IAAI,IAAI,CAAC,YAAY,KAAK,EAAE;YAAE,SAAS;QACvC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;IAC3C,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { type PromptContext } from '../prompt.js';
|
|
2
|
+
export interface InitOptions {
|
|
3
|
+
/** Where to start looking for the repository root. */
|
|
4
|
+
cwd?: string | undefined;
|
|
5
|
+
/** Skips the search when given. */
|
|
6
|
+
repoRoot?: string | undefined;
|
|
7
|
+
/** Overwrite an existing .env, keeping the values already in it. */
|
|
8
|
+
force?: boolean | undefined;
|
|
9
|
+
/** Never prompt: generate the secrets, take every default, leave OAuth blank. */
|
|
10
|
+
nonInteractive?: boolean | undefined;
|
|
11
|
+
/** Supplies INITIAL_ADMIN_EMAIL without a prompt. */
|
|
12
|
+
adminEmail?: string | undefined;
|
|
13
|
+
/** Review every variable, not only the eight that are asked by default. */
|
|
14
|
+
all?: boolean | undefined;
|
|
15
|
+
promptContext?: PromptContext | undefined;
|
|
16
|
+
stderr?: {
|
|
17
|
+
write(chunk: string): unknown;
|
|
18
|
+
} | undefined;
|
|
19
|
+
}
|
|
20
|
+
export interface InitResult {
|
|
21
|
+
/** Absolute path of the file that was written. */
|
|
22
|
+
envPath: string;
|
|
23
|
+
/** Number of variables in it. */
|
|
24
|
+
variables: number;
|
|
25
|
+
/** Keys whose value this run generated. Never their values. */
|
|
26
|
+
generated: string[];
|
|
27
|
+
/** Keys the application needs that came out empty. */
|
|
28
|
+
missingRequired: string[];
|
|
29
|
+
}
|
|
30
|
+
export declare function runInit(options?: InitOptions): Promise<InitResult>;
|
|
31
|
+
/**
|
|
32
|
+
* What to do next, in the order it has to be done.
|
|
33
|
+
*
|
|
34
|
+
* Written from the values that were actually chosen rather than as a fixed
|
|
35
|
+
* block of prose: the migration command depends on POSTGRES_HOST, because a
|
|
36
|
+
* compose service name resolves inside the stack and nowhere else, and a
|
|
37
|
+
* person told to run the wrong one of the two gets a connection error with no
|
|
38
|
+
* hint that it was the instruction that was wrong.
|
|
39
|
+
*/
|
|
40
|
+
export declare function formatNextSteps(values: ReadonlyMap<string, string>, missingRequired: readonly string[], composeDir?: string): string[];
|
|
41
|
+
//# sourceMappingURL=run-init.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run-init.d.ts","sourceRoot":"","sources":["../../../src/engine/init/run-init.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAsB,KAAK,aAAa,EAAE,MAAM,cAAc,CAAC;AAyCtE,MAAM,WAAW,WAAW;IAC1B,sDAAsD;IACtD,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,mCAAmC;IACnC,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC9B,oEAAoE;IACpE,KAAK,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC5B,iFAAiF;IACjF,cAAc,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IACrC,qDAAqD;IACrD,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,2EAA2E;IAC3E,GAAG,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAC1B,aAAa,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;IAC1C,MAAM,CAAC,EAAE;QAAE,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,GAAG,SAAS,CAAC;CACxD;AAED,MAAM,WAAW,UAAU;IACzB,kDAAkD;IAClD,OAAO,EAAE,MAAM,CAAC;IAChB,iCAAiC;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB,+DAA+D;IAC/D,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,sDAAsD;IACtD,eAAe,EAAE,MAAM,EAAE,CAAC;CAC3B;AAkFD,wBAAsB,OAAO,CAAC,OAAO,GAAE,WAAgB,GAAG,OAAO,CAAC,UAAU,CAAC,CAwJ5E;AAWD;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAC7B,MAAM,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,EACnC,eAAe,EAAE,SAAS,MAAM,EAAE,EAClC,UAAU,CAAC,EAAE,MAAM,GAClB,MAAM,EAAE,CAgFV"}
|
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
import { existsSync, mkdirSync, readdirSync, readFileSync, writeFileSync } from 'node:fs';
|
|
2
|
+
import { dirname, join } from 'node:path';
|
|
3
|
+
import { composeFilesForMode } from '@marinoscar/platform-infra';
|
|
4
|
+
import { cliName } from '../identity.js';
|
|
5
|
+
import { generateBase64Key } from '../deploy/env-metadata.js';
|
|
6
|
+
import { diffEnv, parseEnvExample, parseEnvFile, serializeEnvFile, } from '../deploy/env-spec.js';
|
|
7
|
+
import { runEnvWizard } from '../deploy/env-wizard.js';
|
|
8
|
+
import { PreconditionError, UsageError } from '../errors.js';
|
|
9
|
+
import { canPrompt, confirm } from '../prompt.js';
|
|
10
|
+
import { COMPOSE_DB_HOST, ENV_FILE_RELATIVE_PATH, ENV_TEMPLATE_RELATIVE_PATH, GENERATED_KEYS, REQUIRED_TO_RUN, findRepoRoot, isComposeInternalHost, localMetadataFor, localSpecs, unattendedLocalAnswers, } from './local-profile.js';
|
|
11
|
+
/** Reads and parses the template, failing with something actionable. */
|
|
12
|
+
function readTemplate(root) {
|
|
13
|
+
const path = join(root, ENV_TEMPLATE_RELATIVE_PATH);
|
|
14
|
+
let contents;
|
|
15
|
+
try {
|
|
16
|
+
contents = readFileSync(path, 'utf8');
|
|
17
|
+
}
|
|
18
|
+
catch {
|
|
19
|
+
throw new PreconditionError(`Cannot read the environment template at ${path}.\n` +
|
|
20
|
+
`${cliName()} init derives its questions from that file, so it cannot run without it.`);
|
|
21
|
+
}
|
|
22
|
+
const specs = parseEnvExample(contents);
|
|
23
|
+
if (specs.length === 0) {
|
|
24
|
+
throw new PreconditionError(`${path} declares no variables, so there is nothing to configure.`);
|
|
25
|
+
}
|
|
26
|
+
return { path, specs };
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* What a --force run would actually do to the file that is already there.
|
|
30
|
+
*
|
|
31
|
+
* Reuses `diffEnv` rather than describing the file in its own way - it is the
|
|
32
|
+
* same comparison `deploy update` makes when a new revision adds variables -
|
|
33
|
+
* but then FILTERS IT THROUGH THE LOCAL PROFILE, because `diffEnv` answers
|
|
34
|
+
* "what is in the template and not in the file" and that is not the same
|
|
35
|
+
* question. A commented-out template entry is an optional variable nothing
|
|
36
|
+
* writes, and a grouped one belongs to a compose overlay this command does not
|
|
37
|
+
* turn on. Listing those as "would be added" would be a promise the run does
|
|
38
|
+
* not keep, and thirty names is a lot of noise to hide the two that matter.
|
|
39
|
+
*/
|
|
40
|
+
function describeExisting(specs, current) {
|
|
41
|
+
const { missing, unknown } = diffEnv(specs, current);
|
|
42
|
+
const lines = [];
|
|
43
|
+
const additions = missing.filter((spec) => {
|
|
44
|
+
if (spec.optional)
|
|
45
|
+
return false;
|
|
46
|
+
const metadata = localMetadataFor(spec.key);
|
|
47
|
+
return metadata.never !== true && metadata.group === undefined;
|
|
48
|
+
});
|
|
49
|
+
// The wizard deletes these outright, whatever the template says.
|
|
50
|
+
const removals = [...current.keys()].filter((key) => localMetadataFor(key).never === true);
|
|
51
|
+
lines.push(` ${current.size} variable(s) are set in it.`);
|
|
52
|
+
if (additions.length > 0) {
|
|
53
|
+
lines.push(` ${additions.length} variable(s) would be added:`);
|
|
54
|
+
for (const spec of additions)
|
|
55
|
+
lines.push(` ${spec.key}`);
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
lines.push(' Nothing would be added: every variable it needs is already there.');
|
|
59
|
+
}
|
|
60
|
+
if (removals.length > 0) {
|
|
61
|
+
lines.push(` ${removals.length} variable(s) would be removed: ${removals.join(', ')}`);
|
|
62
|
+
}
|
|
63
|
+
if (unknown.length > 0) {
|
|
64
|
+
lines.push(` ${unknown.length} variable(s) are not in the template and would be kept untouched.`);
|
|
65
|
+
}
|
|
66
|
+
lines.push(' Every value already set would be kept, secrets included.');
|
|
67
|
+
return lines;
|
|
68
|
+
}
|
|
69
|
+
export async function runInit(options = {}) {
|
|
70
|
+
const stderr = options.stderr ?? process.stderr;
|
|
71
|
+
const write = (line) => {
|
|
72
|
+
stderr.write(`${line}\n`);
|
|
73
|
+
};
|
|
74
|
+
const root = options.repoRoot ?? findRepoRoot(options.cwd ?? process.cwd()) ?? undefined;
|
|
75
|
+
if (root === undefined) {
|
|
76
|
+
throw new PreconditionError(`Could not find ${ENV_TEMPLATE_RELATIVE_PATH} in this directory or any parent.\n` +
|
|
77
|
+
`Run ${cliName()} init from inside a checkout of this repository, or pass --repo-root <path>.`);
|
|
78
|
+
}
|
|
79
|
+
const { path: templatePath, specs } = readTemplate(root);
|
|
80
|
+
const envPath = join(root, ENV_FILE_RELATIVE_PATH);
|
|
81
|
+
const exists = existsSync(envPath);
|
|
82
|
+
const current = exists ? parseEnvFile(readFileSync(envPath, 'utf8')) : undefined;
|
|
83
|
+
write('');
|
|
84
|
+
write(` Bootstrapping ${envPath}`);
|
|
85
|
+
write(` Questions come from ${templatePath}`);
|
|
86
|
+
// ---------------------------------------------------------------------------
|
|
87
|
+
// 1. Never clobber silently.
|
|
88
|
+
// ---------------------------------------------------------------------------
|
|
89
|
+
// A .env holds the only copy of three generated secrets and a database
|
|
90
|
+
// password. Overwriting it is not undoable, and it is precisely the file
|
|
91
|
+
// somebody has just spent ten minutes getting right.
|
|
92
|
+
if (exists && options.force !== true) {
|
|
93
|
+
write('');
|
|
94
|
+
write(` ${envPath} already exists. Nothing has been changed.`);
|
|
95
|
+
const plan = describeExisting(specs, current);
|
|
96
|
+
const interactive = options.nonInteractive !== true && canPrompt(options.promptContext);
|
|
97
|
+
if (interactive) {
|
|
98
|
+
write('');
|
|
99
|
+
const show = await confirm(' Show what init would change?', { defaultValue: true }, options.promptContext);
|
|
100
|
+
if (show) {
|
|
101
|
+
write('');
|
|
102
|
+
for (const line of plan)
|
|
103
|
+
write(line);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
else {
|
|
107
|
+
write('');
|
|
108
|
+
for (const line of plan)
|
|
109
|
+
write(line);
|
|
110
|
+
}
|
|
111
|
+
throw new UsageError(`Refusing to overwrite ${envPath}. Re-run with --force to fill in what is missing (existing values, including secrets, are kept).`);
|
|
112
|
+
}
|
|
113
|
+
// Fail here rather than three questions into a wizard nobody can answer.
|
|
114
|
+
// `prompt()` refuses without a TTY, correctly, but its message is the
|
|
115
|
+
// general one ("supply the value on the command line") and this command's
|
|
116
|
+
// answer is a specific flag - said before anything is printed, not after a
|
|
117
|
+
// page of help text for a question that was never going to be asked.
|
|
118
|
+
if (options.nonInteractive !== true && !canPrompt(options.promptContext)) {
|
|
119
|
+
throw new UsageError(`${cliName()} init needs an interactive terminal to ask about the database and Google OAuth.\n` +
|
|
120
|
+
`Re-run with --non-interactive to generate the secrets, take every default and leave OAuth blank.`);
|
|
121
|
+
}
|
|
122
|
+
// ---------------------------------------------------------------------------
|
|
123
|
+
// 2. Generate the three secrets. Never ask.
|
|
124
|
+
// ---------------------------------------------------------------------------
|
|
125
|
+
// Only when there is nothing usable already: regenerating JWT_SECRET on a
|
|
126
|
+
// --force re-run would invalidate every session and every refresh token the
|
|
127
|
+
// developer is holding, for no reason they asked for.
|
|
128
|
+
const seed = new Map(current ?? []);
|
|
129
|
+
const generated = [];
|
|
130
|
+
for (const key of GENERATED_KEYS) {
|
|
131
|
+
const held = seed.get(key);
|
|
132
|
+
if (held !== undefined && held !== '')
|
|
133
|
+
continue;
|
|
134
|
+
seed.set(key, generateBase64Key());
|
|
135
|
+
generated.push(key);
|
|
136
|
+
}
|
|
137
|
+
// An unattended run answers with the local defaults rather than being
|
|
138
|
+
// refused for not having a person to confirm them. Never over an existing
|
|
139
|
+
// value: what is already in the file is a decision somebody made.
|
|
140
|
+
if (options.nonInteractive === true) {
|
|
141
|
+
for (const [key, value] of unattendedLocalAnswers(specs)) {
|
|
142
|
+
const held = seed.get(key);
|
|
143
|
+
if (held === undefined || held === '')
|
|
144
|
+
seed.set(key, value);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
// The flag is an explicit statement, so it wins over the file.
|
|
148
|
+
if (options.adminEmail !== undefined && options.adminEmail !== '') {
|
|
149
|
+
seed.set('INITIAL_ADMIN_EMAIL', options.adminEmail);
|
|
150
|
+
}
|
|
151
|
+
if (generated.length > 0) {
|
|
152
|
+
write('');
|
|
153
|
+
write(` Generated ${generated.length} secret(s) with the CSPRNG: ${generated.join(', ')}`);
|
|
154
|
+
write(' They are written to the file below and shown nowhere else.');
|
|
155
|
+
}
|
|
156
|
+
// ---------------------------------------------------------------------------
|
|
157
|
+
// 3. The wizard - the deploy one, with the local profile.
|
|
158
|
+
// ---------------------------------------------------------------------------
|
|
159
|
+
const prepared = localSpecs(specs);
|
|
160
|
+
const appUrl = seed.get('APP_URL') ?? prepared.find((spec) => spec.key === 'APP_URL')?.defaultValue ?? '';
|
|
161
|
+
const { values } = await runEnvWizard({
|
|
162
|
+
specs: prepared,
|
|
163
|
+
// Only consulted by derivations that want a bare host name; the local
|
|
164
|
+
// profile derives from APP_URL itself, so this is descriptive rather than
|
|
165
|
+
// load-bearing here.
|
|
166
|
+
domain: hostOf(appUrl),
|
|
167
|
+
existing: seed,
|
|
168
|
+
metadata: localMetadataFor,
|
|
169
|
+
...(options.all === undefined ? {} : { all: options.all }),
|
|
170
|
+
...(options.nonInteractive === undefined ? {} : { nonInteractive: options.nonInteractive }),
|
|
171
|
+
...(options.promptContext === undefined ? {} : { ctx: options.promptContext }),
|
|
172
|
+
});
|
|
173
|
+
// ---------------------------------------------------------------------------
|
|
174
|
+
// 4. Write it. 0600, because it holds every secret this application has.
|
|
175
|
+
// ---------------------------------------------------------------------------
|
|
176
|
+
mkdirSync(dirname(envPath), { recursive: true });
|
|
177
|
+
// Serialised against the ORIGINAL specs, so the generated file keeps the
|
|
178
|
+
// template's section banners and key order and diffs cleanly against it.
|
|
179
|
+
writeFileSync(envPath, serializeEnvFile(values, specs), { mode: 0o600 });
|
|
180
|
+
const missingRequired = REQUIRED_TO_RUN.filter((key) => {
|
|
181
|
+
const value = values.get(key);
|
|
182
|
+
return value === undefined || value === '';
|
|
183
|
+
});
|
|
184
|
+
write('');
|
|
185
|
+
write(` Wrote ${envPath} (${values.size} variables, mode 0600)`);
|
|
186
|
+
for (const line of formatNextSteps(values, missingRequired, join(root, 'infra', 'compose')))
|
|
187
|
+
write(line);
|
|
188
|
+
return {
|
|
189
|
+
envPath,
|
|
190
|
+
variables: values.size,
|
|
191
|
+
generated,
|
|
192
|
+
missingRequired,
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
/** Bare host of a URL, or the input unchanged when it is not one. */
|
|
196
|
+
function hostOf(url) {
|
|
197
|
+
try {
|
|
198
|
+
return new URL(url).host;
|
|
199
|
+
}
|
|
200
|
+
catch {
|
|
201
|
+
return url;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* What to do next, in the order it has to be done.
|
|
206
|
+
*
|
|
207
|
+
* Written from the values that were actually chosen rather than as a fixed
|
|
208
|
+
* block of prose: the migration command depends on POSTGRES_HOST, because a
|
|
209
|
+
* compose service name resolves inside the stack and nowhere else, and a
|
|
210
|
+
* person told to run the wrong one of the two gets a connection error with no
|
|
211
|
+
* hint that it was the instruction that was wrong.
|
|
212
|
+
*/
|
|
213
|
+
export function formatNextSteps(values, missingRequired, composeDir) {
|
|
214
|
+
const lines = [];
|
|
215
|
+
const inCompose = isComposeInternalHost(values.get('POSTGRES_HOST'));
|
|
216
|
+
const appUrl = values.get('APP_URL') ?? '';
|
|
217
|
+
const adminEmail = values.get('INITIAL_ADMIN_EMAIL') ?? '';
|
|
218
|
+
// The platform's dev files, then the app's dev overlays (app.<name> and
|
|
219
|
+
// app.dev.<name>), from the package's one ordering (#714).
|
|
220
|
+
const composeFiles = composeFilesForMode(inCompose ? 'devdb' : 'dev', { overlays: listComposeDir(composeDir) }).map((file) => `-f ${file}`);
|
|
221
|
+
const compose = `docker compose ${composeFiles.join(' ')}`;
|
|
222
|
+
const migrate = 'npm run prisma:migrate --workspace=api';
|
|
223
|
+
const seed = 'npm run prisma:seed --workspace=api';
|
|
224
|
+
if (missingRequired.length > 0) {
|
|
225
|
+
lines.push('');
|
|
226
|
+
lines.push(' ---------------------------------------------------------------');
|
|
227
|
+
lines.push(' GOOGLE OAUTH IS REQUIRED. The API will not start yet.');
|
|
228
|
+
lines.push(' ---------------------------------------------------------------');
|
|
229
|
+
lines.push('');
|
|
230
|
+
lines.push(` These are empty: ${missingRequired.join(', ')}`);
|
|
231
|
+
lines.push('');
|
|
232
|
+
lines.push(' Without GOOGLE_CLIENT_ID the API exits during bootstrap with');
|
|
233
|
+
lines.push(' "OAuth2Strategy requires a clientID option" - it is not a');
|
|
234
|
+
lines.push(' degraded mode, the process does not come up. Without');
|
|
235
|
+
lines.push(' INITIAL_ADMIN_EMAIL nobody can log in: the allowlist refuses');
|
|
236
|
+
lines.push(' every address, and that one is what seeds the first Admin.');
|
|
237
|
+
lines.push('');
|
|
238
|
+
lines.push(' Create an OAuth client at');
|
|
239
|
+
lines.push(' https://console.cloud.google.com/apis/credentials');
|
|
240
|
+
lines.push(' with this as an authorised redirect URI:');
|
|
241
|
+
lines.push(` ${values.get('GOOGLE_CALLBACK_URL') ?? ''}`);
|
|
242
|
+
lines.push(' then set the values in the file above.');
|
|
243
|
+
}
|
|
244
|
+
lines.push('');
|
|
245
|
+
lines.push(' Next steps');
|
|
246
|
+
lines.push('');
|
|
247
|
+
lines.push(' 1. Create the shared docker network (once per machine):');
|
|
248
|
+
lines.push(' docker network create devnet');
|
|
249
|
+
lines.push('');
|
|
250
|
+
lines.push(' 2. Start the stack, from infra/compose:');
|
|
251
|
+
lines.push(` ${compose} up`);
|
|
252
|
+
if (inCompose) {
|
|
253
|
+
lines.push('');
|
|
254
|
+
lines.push(` The devdb overlay is included because POSTGRES_HOST is "${values.get('POSTGRES_HOST') ?? ''}",`);
|
|
255
|
+
lines.push(' which is the database container it provides. Drop that -f if you');
|
|
256
|
+
lines.push(' meant a PostgreSQL of your own, and change POSTGRES_HOST to match.');
|
|
257
|
+
}
|
|
258
|
+
else {
|
|
259
|
+
lines.push('');
|
|
260
|
+
lines.push(' No PostgreSQL of your own? Add the database overlay:');
|
|
261
|
+
lines.push(` ${compose} -f devdb.compose.yml up`);
|
|
262
|
+
lines.push(' and set POSTGRES_HOST to the service name');
|
|
263
|
+
lines.push(` (${COMPOSE_DB_HOST}) so the api container can reach it.`);
|
|
264
|
+
}
|
|
265
|
+
lines.push('');
|
|
266
|
+
lines.push(' 3. Apply the database schema:');
|
|
267
|
+
if (inCompose) {
|
|
268
|
+
lines.push(` docker compose ${composeFiles.join(' ')} exec api ${migrate}`);
|
|
269
|
+
lines.push(` (POSTGRES_HOST is a compose service name, so this runs inside`);
|
|
270
|
+
lines.push(' the stack rather than from this checkout.)');
|
|
271
|
+
}
|
|
272
|
+
else {
|
|
273
|
+
lines.push(` ${migrate}`);
|
|
274
|
+
}
|
|
275
|
+
lines.push('');
|
|
276
|
+
lines.push(' 4. Seed the roles, permissions and the admin allowlist entry:');
|
|
277
|
+
lines.push(inCompose ? ` docker compose ${composeFiles.join(' ')} exec api ${seed}` : ` ${seed}`);
|
|
278
|
+
lines.push('');
|
|
279
|
+
lines.push(` 5. Open ${appUrl} and sign in with Google as`);
|
|
280
|
+
lines.push(adminEmail === ''
|
|
281
|
+
? ' whichever address you set as INITIAL_ADMIN_EMAIL.'
|
|
282
|
+
: ` ${adminEmail} - the first login with that address becomes Admin.`);
|
|
283
|
+
lines.push('');
|
|
284
|
+
return lines;
|
|
285
|
+
}
|
|
286
|
+
/** The file names in the checkout's infra/compose, or none when it cannot be read. */
|
|
287
|
+
function listComposeDir(composeDir) {
|
|
288
|
+
if (composeDir === undefined)
|
|
289
|
+
return [];
|
|
290
|
+
try {
|
|
291
|
+
return readdirSync(composeDir);
|
|
292
|
+
}
|
|
293
|
+
catch {
|
|
294
|
+
return [];
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
//# sourceMappingURL=run-init.js.map
|