heroku 10.13.2 → 11.0.0-alpha.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -10
- package/bin/dev +4 -12
- package/bin/dev.cmd +1 -1
- package/bin/run +4 -39
- package/lib/analytics.d.ts +3 -2
- package/lib/analytics.js +32 -27
- package/lib/commands/access/add.d.ts +4 -4
- package/lib/commands/access/add.js +27 -32
- package/lib/commands/access/index.d.ts +3 -3
- package/lib/commands/access/index.js +32 -34
- package/lib/commands/access/remove.d.ts +2 -2
- package/lib/commands/access/remove.js +14 -17
- package/lib/commands/access/update.d.ts +4 -4
- package/lib/commands/access/update.js +24 -28
- package/lib/commands/accounts/add.d.ts +1 -1
- package/lib/commands/accounts/add.js +14 -17
- package/lib/commands/accounts/current.js +12 -15
- package/lib/commands/accounts/index.js +11 -14
- package/lib/commands/accounts/remove.d.ts +1 -1
- package/lib/commands/accounts/remove.js +14 -17
- package/lib/commands/accounts/set.d.ts +1 -1
- package/lib/commands/accounts/set.js +12 -15
- package/lib/commands/addons/attach.d.ts +6 -6
- package/lib/commands/addons/attach.js +22 -25
- package/lib/commands/addons/create.d.ts +8 -7
- package/lib/commands/addons/create.js +42 -45
- package/lib/commands/addons/destroy.d.ts +7 -6
- package/lib/commands/addons/destroy.js +33 -36
- package/lib/commands/addons/detach.d.ts +3 -3
- package/lib/commands/addons/detach.js +18 -22
- package/lib/commands/addons/docs.d.ts +5 -4
- package/lib/commands/addons/docs.js +21 -23
- package/lib/commands/addons/index.d.ts +4 -4
- package/lib/commands/addons/index.js +90 -100
- package/lib/commands/addons/info.d.ts +3 -3
- package/lib/commands/addons/info.js +28 -35
- package/lib/commands/addons/open.d.ts +4 -4
- package/lib/commands/addons/open.js +27 -33
- package/lib/commands/addons/plans.d.ts +2 -2
- package/lib/commands/addons/plans.js +20 -23
- package/lib/commands/addons/rename.d.ts +2 -2
- package/lib/commands/addons/rename.js +12 -15
- package/lib/commands/addons/services.d.ts +1 -1
- package/lib/commands/addons/services.js +13 -16
- package/lib/commands/addons/upgrade.d.ts +4 -4
- package/lib/commands/addons/upgrade.js +52 -60
- package/lib/commands/addons/wait.d.ts +5 -4
- package/lib/commands/addons/wait.js +26 -28
- package/lib/commands/apps/create.d.ts +14 -12
- package/lib/commands/apps/create.js +89 -95
- package/lib/commands/apps/destroy.d.ts +4 -4
- package/lib/commands/apps/destroy.js +22 -26
- package/lib/commands/apps/errors.d.ts +6 -6
- package/lib/commands/apps/errors.js +54 -58
- package/lib/commands/apps/favorites/add.d.ts +2 -2
- package/lib/commands/apps/favorites/add.js +15 -18
- package/lib/commands/apps/favorites/index.d.ts +1 -1
- package/lib/commands/apps/favorites/index.js +12 -15
- package/lib/commands/apps/favorites/remove.d.ts +2 -2
- package/lib/commands/apps/favorites/remove.js +13 -16
- package/lib/commands/apps/index.d.ts +6 -6
- package/lib/commands/apps/index.js +41 -44
- package/lib/commands/apps/info.d.ts +6 -6
- package/lib/commands/apps/info.js +50 -53
- package/lib/commands/apps/join.d.ts +2 -2
- package/lib/commands/apps/join.js +13 -16
- package/lib/commands/apps/leave.d.ts +2 -2
- package/lib/commands/apps/leave.js +14 -17
- package/lib/commands/apps/lock.d.ts +2 -2
- package/lib/commands/apps/lock.js +15 -19
- package/lib/commands/apps/open.d.ts +3 -3
- package/lib/commands/apps/open.js +18 -21
- package/lib/commands/apps/rename.d.ts +3 -3
- package/lib/commands/apps/rename.js +26 -29
- package/lib/commands/apps/stacks/index.d.ts +2 -2
- package/lib/commands/apps/stacks/index.js +17 -21
- package/lib/commands/apps/stacks/set.d.ts +3 -3
- package/lib/commands/apps/stacks/set.js +23 -27
- package/lib/commands/apps/transfer.d.ts +11 -6
- package/lib/commands/apps/transfer.js +53 -61
- package/lib/commands/apps/unlock.d.ts +2 -2
- package/lib/commands/apps/unlock.js +15 -19
- package/lib/commands/auth/2fa/disable.js +10 -13
- package/lib/commands/auth/2fa/index.js +8 -10
- package/lib/commands/auth/login.d.ts +6 -2
- package/lib/commands/auth/login.js +12 -15
- package/lib/commands/auth/logout.js +7 -10
- package/lib/commands/auth/token.d.ts +0 -2
- package/lib/commands/auth/token.js +9 -14
- package/lib/commands/auth/whoami.js +4 -7
- package/lib/commands/authorizations/create.d.ts +5 -5
- package/lib/commands/authorizations/create.js +22 -25
- package/lib/commands/authorizations/index.d.ts +1 -1
- package/lib/commands/authorizations/index.js +20 -26
- package/lib/commands/authorizations/info.d.ts +2 -2
- package/lib/commands/authorizations/info.js +14 -17
- package/lib/commands/authorizations/revoke.d.ts +1 -1
- package/lib/commands/authorizations/revoke.js +14 -17
- package/lib/commands/authorizations/rotate.d.ts +1 -1
- package/lib/commands/authorizations/rotate.js +11 -14
- package/lib/commands/authorizations/update.d.ts +4 -4
- package/lib/commands/authorizations/update.js +16 -19
- package/lib/commands/buildpacks/add.d.ts +4 -4
- package/lib/commands/buildpacks/add.js +20 -23
- package/lib/commands/buildpacks/clear.d.ts +2 -2
- package/lib/commands/buildpacks/clear.js +9 -12
- package/lib/commands/buildpacks/index.d.ts +2 -2
- package/lib/commands/buildpacks/index.js +16 -19
- package/lib/commands/buildpacks/info.d.ts +1 -1
- package/lib/commands/buildpacks/info.js +25 -30
- package/lib/commands/buildpacks/remove.d.ts +4 -4
- package/lib/commands/buildpacks/remove.js +23 -26
- package/lib/commands/buildpacks/search.d.ts +4 -4
- package/lib/commands/buildpacks/search.js +26 -31
- package/lib/commands/buildpacks/set.d.ts +4 -4
- package/lib/commands/buildpacks/set.js +20 -22
- package/lib/commands/buildpacks/versions.d.ts +1 -1
- package/lib/commands/buildpacks/versions.js +26 -32
- package/lib/commands/certs/add.d.ts +18 -5
- package/lib/commands/certs/add.js +60 -54
- package/lib/commands/certs/auto/disable.d.ts +3 -3
- package/lib/commands/certs/auto/disable.js +20 -22
- package/lib/commands/certs/auto/enable.d.ts +4 -3
- package/lib/commands/certs/auto/enable.js +28 -30
- package/lib/commands/certs/auto/index.d.ts +3 -3
- package/lib/commands/certs/auto/index.js +48 -44
- package/lib/commands/certs/auto/refresh.d.ts +2 -2
- package/lib/commands/certs/auto/refresh.js +11 -14
- package/lib/commands/certs/generate.d.ts +14 -13
- package/lib/commands/certs/generate.js +41 -40
- package/lib/commands/certs/index.d.ts +2 -2
- package/lib/commands/certs/index.js +13 -16
- package/lib/commands/certs/info.d.ts +5 -5
- package/lib/commands/certs/info.js +21 -24
- package/lib/commands/certs/remove.d.ts +5 -5
- package/lib/commands/certs/remove.js +24 -26
- package/lib/commands/certs/update.d.ts +7 -7
- package/lib/commands/certs/update.js +39 -41
- package/lib/commands/ci/config/get.d.ts +5 -6
- package/lib/commands/ci/config/get.js +25 -29
- package/lib/commands/ci/config/index.d.ts +5 -5
- package/lib/commands/ci/config/index.js +27 -30
- package/lib/commands/ci/config/set.d.ts +3 -3
- package/lib/commands/ci/config/set.js +29 -32
- package/lib/commands/ci/config/unset.d.ts +3 -3
- package/lib/commands/ci/config/unset.js +22 -25
- package/lib/commands/ci/debug.d.ts +4 -4
- package/lib/commands/ci/debug.js +52 -57
- package/lib/commands/ci/index.d.ts +5 -5
- package/lib/commands/ci/index.js +18 -21
- package/lib/commands/ci/info.d.ts +5 -5
- package/lib/commands/ci/info.js +21 -24
- package/lib/commands/ci/last.d.ts +4 -4
- package/lib/commands/ci/last.js +19 -22
- package/lib/commands/ci/migrate-manifest.js +28 -28
- package/lib/commands/ci/open.d.ts +3 -4
- package/lib/commands/ci/open.js +15 -19
- package/lib/commands/ci/rerun.d.ts +4 -4
- package/lib/commands/ci/rerun.js +26 -29
- package/lib/commands/ci/run.d.ts +3 -3
- package/lib/commands/ci/run.js +24 -27
- package/lib/commands/clients/create.d.ts +4 -4
- package/lib/commands/clients/create.js +23 -26
- package/lib/commands/clients/destroy.d.ts +1 -1
- package/lib/commands/clients/destroy.js +10 -13
- package/lib/commands/clients/index.d.ts +1 -1
- package/lib/commands/clients/index.js +18 -21
- package/lib/commands/clients/info.d.ts +3 -3
- package/lib/commands/clients/info.js +20 -23
- package/lib/commands/clients/rotate.d.ts +3 -3
- package/lib/commands/clients/rotate.js +20 -23
- package/lib/commands/clients/update.d.ts +3 -3
- package/lib/commands/clients/update.js +19 -22
- package/lib/commands/config/edit.d.ts +3 -3
- package/lib/commands/config/edit.js +45 -51
- package/lib/commands/config/get.d.ts +4 -4
- package/lib/commands/config/get.js +19 -23
- package/lib/commands/config/index.d.ts +4 -4
- package/lib/commands/config/index.js +18 -22
- package/lib/commands/config/set.d.ts +2 -2
- package/lib/commands/config/set.js +31 -34
- package/lib/commands/config/unset.d.ts +2 -2
- package/lib/commands/config/unset.js +23 -31
- package/lib/commands/console.d.ts +4 -4
- package/lib/commands/console.js +14 -17
- package/lib/commands/container/login.d.ts +6 -1
- package/lib/commands/container/login.js +39 -41
- package/lib/commands/container/logout.d.ts +4 -1
- package/lib/commands/container/logout.js +21 -23
- package/lib/commands/container/pull.d.ts +5 -3
- package/lib/commands/container/pull.js +25 -27
- package/lib/commands/container/push.d.ts +9 -6
- package/lib/commands/container/push.js +67 -69
- package/lib/commands/container/release.d.ts +3 -3
- package/lib/commands/container/release.js +31 -32
- package/lib/commands/container/rm.d.ts +2 -2
- package/lib/commands/container/rm.js +19 -22
- package/lib/commands/container/run.d.ts +6 -4
- package/lib/commands/container/run.js +32 -34
- package/lib/commands/dashboard.js +52 -56
- package/lib/commands/domains/add.d.ts +12 -7
- package/lib/commands/domains/add.js +64 -70
- package/lib/commands/domains/clear.d.ts +2 -3
- package/lib/commands/domains/clear.js +12 -17
- package/lib/commands/domains/index.d.ts +11 -31
- package/lib/commands/domains/index.js +136 -92
- package/lib/commands/domains/info.d.ts +3 -4
- package/lib/commands/domains/info.js +20 -21
- package/lib/commands/domains/remove.d.ts +3 -4
- package/lib/commands/domains/remove.js +15 -21
- package/lib/commands/domains/update.d.ts +4 -5
- package/lib/commands/domains/update.js +20 -26
- package/lib/commands/domains/wait.d.ts +3 -4
- package/lib/commands/domains/wait.js +13 -17
- package/lib/commands/drains/add.d.ts +3 -3
- package/lib/commands/drains/add.js +13 -16
- package/lib/commands/drains/index.d.ts +4 -4
- package/lib/commands/drains/index.js +28 -25
- package/lib/commands/drains/remove.d.ts +3 -3
- package/lib/commands/drains/remove.js +14 -17
- package/lib/commands/features/disable.d.ts +3 -3
- package/lib/commands/features/disable.js +15 -18
- package/lib/commands/features/enable.d.ts +3 -3
- package/lib/commands/features/enable.js +15 -18
- package/lib/commands/features/index.d.ts +3 -3
- package/lib/commands/features/index.js +18 -23
- package/lib/commands/features/info.d.ts +4 -4
- package/lib/commands/features/info.js +18 -21
- package/lib/commands/git/clone.d.ts +3 -3
- package/lib/commands/git/clone.js +17 -21
- package/lib/commands/git/credentials.d.ts +1 -1
- package/lib/commands/git/credentials.js +15 -16
- package/lib/commands/git/remote.d.ts +2 -2
- package/lib/commands/git/remote.js +19 -23
- package/lib/commands/keys/add.d.ts +3 -3
- package/lib/commands/keys/add.js +36 -39
- package/lib/commands/keys/clear.js +6 -9
- package/lib/commands/keys/index.d.ts +2 -2
- package/lib/commands/keys/index.js +16 -19
- package/lib/commands/keys/remove.d.ts +1 -1
- package/lib/commands/keys/remove.js +14 -17
- package/lib/commands/labs/disable.d.ts +6 -3
- package/lib/commands/labs/disable.js +20 -23
- package/lib/commands/labs/enable.d.ts +3 -3
- package/lib/commands/labs/enable.js +16 -19
- package/lib/commands/labs/index.d.ts +3 -3
- package/lib/commands/labs/index.js +23 -28
- package/lib/commands/labs/info.d.ts +4 -4
- package/lib/commands/labs/info.js +19 -22
- package/lib/commands/local/index.d.ts +8 -6
- package/lib/commands/local/index.js +53 -57
- package/lib/commands/local/run.d.ts +2 -2
- package/lib/commands/local/run.js +23 -31
- package/lib/commands/local/version.js +5 -8
- package/lib/commands/logs.d.ts +10 -10
- package/lib/commands/logs.js +74 -74
- package/lib/commands/maintenance/index.d.ts +2 -2
- package/lib/commands/maintenance/index.js +10 -13
- package/lib/commands/maintenance/off.d.ts +2 -2
- package/lib/commands/maintenance/off.js +12 -15
- package/lib/commands/maintenance/on.d.ts +2 -2
- package/lib/commands/maintenance/on.js +12 -15
- package/lib/commands/mcp/start.d.ts +1 -4
- package/lib/commands/mcp/start.js +9 -14
- package/lib/commands/members/add.d.ts +3 -3
- package/lib/commands/members/add.js +24 -25
- package/lib/commands/members/index.d.ts +4 -4
- package/lib/commands/members/index.js +46 -43
- package/lib/commands/members/remove.d.ts +1 -1
- package/lib/commands/members/remove.js +19 -34
- package/lib/commands/members/set.d.ts +2 -2
- package/lib/commands/members/set.js +18 -15
- package/lib/commands/notifications/index.d.ts +5 -5
- package/lib/commands/notifications/index.js +27 -30
- package/lib/commands/orgs/index.d.ts +3 -3
- package/lib/commands/orgs/index.js +12 -15
- package/lib/commands/orgs/open.d.ts +1 -1
- package/lib/commands/orgs/open.js +12 -15
- package/lib/commands/pipelines/add.d.ts +4 -4
- package/lib/commands/pipelines/add.js +39 -42
- package/lib/commands/pipelines/connect.d.ts +2 -2
- package/lib/commands/pipelines/connect.js +36 -39
- package/lib/commands/pipelines/create.d.ts +5 -5
- package/lib/commands/pipelines/create.js +52 -56
- package/lib/commands/pipelines/destroy.d.ts +1 -1
- package/lib/commands/pipelines/destroy.js +20 -23
- package/lib/commands/pipelines/diff.d.ts +4 -4
- package/lib/commands/pipelines/diff.js +81 -92
- package/lib/commands/pipelines/index.d.ts +1 -1
- package/lib/commands/pipelines/index.js +14 -17
- package/lib/commands/pipelines/info.d.ts +3 -3
- package/lib/commands/pipelines/info.js +30 -33
- package/lib/commands/prompt.js +10 -13
- package/lib/commands/rake.d.ts +6 -6
- package/lib/commands/rake.js +19 -23
- package/lib/commands/regions.d.ts +3 -3
- package/lib/commands/regions.js +20 -19
- package/lib/commands/repl.js +8 -11
- package/lib/commands/reviewapps/disable.d.ts +9 -9
- package/lib/commands/reviewapps/disable.js +45 -48
- package/lib/commands/reviewapps/enable.d.ts +6 -6
- package/lib/commands/reviewapps/enable.js +35 -38
- package/lib/commands/sessions/destroy.d.ts +1 -1
- package/lib/commands/sessions/destroy.js +10 -13
- package/lib/commands/sessions/index.d.ts +1 -1
- package/lib/commands/sessions/index.js +25 -21
- package/lib/commands/status.d.ts +1 -1
- package/lib/commands/status.js +41 -52
- package/lib/commands/teams/index.d.ts +1 -1
- package/lib/commands/teams/index.js +14 -17
- package/lib/commands/telemetry/add.d.ts +6 -6
- package/lib/commands/telemetry/add.js +23 -25
- package/lib/commands/telemetry/index.d.ts +3 -3
- package/lib/commands/telemetry/index.js +14 -17
- package/lib/commands/telemetry/info.d.ts +1 -1
- package/lib/commands/telemetry/info.js +11 -14
- package/lib/commands/telemetry/remove.d.ts +4 -4
- package/lib/commands/telemetry/remove.js +19 -21
- package/lib/commands/telemetry/update.d.ts +5 -5
- package/lib/commands/telemetry/update.js +25 -27
- package/lib/commands/usage/addons.d.ts +2 -2
- package/lib/commands/usage/addons.js +26 -29
- package/lib/deps.d.ts +3 -3
- package/lib/deps.js +9 -14
- package/lib/file.d.ts +1 -1
- package/lib/file.js +26 -37
- package/lib/global_telemetry.d.ts +2 -1
- package/lib/global_telemetry.js +51 -43
- package/lib/hooks/command_not_found/performance_analytics.js +2 -4
- package/lib/hooks/init/performance_analytics.js +2 -4
- package/lib/hooks/init/terms-of-service.js +6 -10
- package/lib/hooks/init/version.js +3 -5
- package/lib/hooks/postrun/performance_analytics.js +2 -4
- package/lib/hooks/prerun/analytics.js +4 -6
- package/lib/hooks/recache.d.ts +1 -3
- package/lib/hooks/recache.js +47 -56
- package/lib/hooks/update/brew.js +9 -10
- package/lib/hooks/update/completions.js +1 -3
- package/lib/hooks/update/plugin-migrate.js +5 -9
- package/lib/hooks/update/tidy.js +8 -10
- package/lib/index.js +1 -5
- package/lib/lib/accounts/accounts.d.ts +20 -5
- package/lib/lib/accounts/accounts.js +67 -64
- package/lib/lib/addons/addons_wait.js +15 -23
- package/lib/lib/addons/create_addon.js +16 -20
- package/lib/lib/addons/destroy_addon.js +12 -16
- package/lib/lib/addons/resolve.d.ts +1 -1
- package/lib/lib/addons/resolve.js +35 -47
- package/lib/lib/addons/util.js +18 -27
- package/lib/lib/api.d.ts +1 -1
- package/lib/lib/api.js +42 -65
- package/lib/lib/apps/app-transfer.js +8 -12
- package/lib/lib/apps/error_info.js +1 -3
- package/lib/lib/apps/generation.d.ts +2 -2
- package/lib/lib/apps/generation.js +3 -9
- package/lib/lib/authorizations/authorizations.js +8 -11
- package/lib/lib/autocomplete/base.d.ts +1 -11
- package/lib/lib/autocomplete/base.js +49 -40
- package/lib/lib/autocomplete/cache.js +3 -8
- package/lib/lib/autocomplete/completions.d.ts +1 -41
- package/lib/lib/autocomplete/completions.js +290 -261
- package/lib/lib/buildpacks/buildpacks.js +52 -56
- package/lib/lib/certs/certificate_details.d.ts +1 -1
- package/lib/lib/certs/certificate_details.js +13 -17
- package/lib/lib/certs/display_table.d.ts +1 -1
- package/lib/lib/certs/display_table.js +5 -8
- package/lib/lib/certs/domains.d.ts +1 -1
- package/lib/lib/certs/domains.js +21 -39
- package/lib/lib/certs/flags.d.ts +1 -1
- package/lib/lib/certs/flags.js +2 -5
- package/lib/lib/certs/format_date.js +3 -6
- package/lib/lib/certs/get_cert_and_key.d.ts +10 -8
- package/lib/lib/certs/get_cert_and_key.js +8 -10
- package/lib/lib/ci/git.d.ts +2 -1
- package/lib/lib/ci/git.js +10 -23
- package/lib/lib/ci/interfaces/kolkrabbi.js +1 -2
- package/lib/lib/ci/pipelines.d.ts +24 -1
- package/lib/lib/ci/pipelines.js +68 -50
- package/lib/lib/ci/source.js +9 -12
- package/lib/lib/ci/test-run.js +47 -47
- package/lib/lib/ci/validate.d.ts +2 -2
- package/lib/lib/ci/validate.js +3 -7
- package/lib/lib/clients/clients.js +3 -6
- package/lib/lib/config/quote.js +9 -10
- package/lib/lib/config/util.d.ts +1 -1
- package/lib/lib/config/util.js +27 -10
- package/lib/lib/confirmCommand.d.ts +3 -1
- package/lib/lib/confirmCommand.js +20 -21
- package/lib/lib/container/debug.d.ts +2 -2
- package/lib/lib/container/debug.js +2 -5
- package/lib/lib/container/docker_helper.d.ts +16 -14
- package/lib/lib/container/docker_helper.js +177 -173
- package/lib/lib/container/helpers.js +7 -12
- package/lib/lib/container/streamer.js +3 -7
- package/lib/lib/domains/domains.js +17 -23
- package/lib/lib/domains/wait-for-domain.js +7 -11
- package/lib/lib/git/git.d.ts +1 -1
- package/lib/lib/git/git.js +24 -25
- package/lib/lib/git/push.js +1 -4
- package/lib/lib/local/env-file-validator.d.ts +1 -0
- package/lib/lib/local/env-file-validator.js +10 -0
- package/lib/lib/local/fork-foreman.js +12 -9
- package/lib/lib/local/load-foreman-procfile.d.ts +1 -0
- package/lib/lib/local/load-foreman-procfile.js +7 -2
- package/lib/lib/local/{run-foreman.js → run-foreman.cjs} +7 -1
- package/lib/lib/members/team-invite-utils.d.ts +14 -0
- package/lib/lib/members/team-invite-utils.js +26 -0
- package/lib/lib/members/util.js +8 -13
- package/lib/lib/notify.js +9 -9
- package/lib/lib/orgs/utils.js +11 -16
- package/lib/lib/pg/backups.d.ts +1 -17
- package/lib/lib/pg/backups.js +160 -149
- package/lib/lib/pg/bastion.d.ts +1 -29
- package/lib/lib/pg/bastion.js +129 -113
- package/lib/lib/pg/config.js +2 -6
- package/lib/lib/pg/download.js +14 -14
- package/lib/lib/pg/fetcher.d.ts +1 -39
- package/lib/lib/pg/fetcher.js +149 -123
- package/lib/lib/pg/host.js +1 -4
- package/lib/lib/pg/psql.d.ts +1 -48
- package/lib/lib/pg/psql.js +241 -218
- package/lib/lib/pg/push_pull.d.ts +1 -13
- package/lib/lib/pg/push_pull.js +120 -110
- package/lib/lib/pg/setter.d.ts +1 -16
- package/lib/lib/pg/setter.js +73 -63
- package/lib/lib/pg/types.js +1 -2
- package/lib/lib/pg/util.d.ts +1 -37
- package/lib/lib/pg/util.js +209 -178
- package/lib/lib/pipelines/disambiguate.js +8 -11
- package/lib/lib/pipelines/github-api.d.ts +1 -1
- package/lib/lib/pipelines/github-api.js +10 -7
- package/lib/lib/pipelines/infer.js +3 -6
- package/lib/lib/pipelines/key-by.js +1 -4
- package/lib/lib/pipelines/kolkrabbi-api.js +6 -7
- package/lib/lib/pipelines/ownership.d.ts +1 -1
- package/lib/lib/pipelines/ownership.js +10 -15
- package/lib/lib/pipelines/render-pipeline.d.ts +1 -1
- package/lib/lib/pipelines/render-pipeline.js +31 -20
- package/lib/lib/pipelines/setup/create-apps.d.ts +1 -1
- package/lib/lib/pipelines/setup/create-apps.js +5 -8
- package/lib/lib/pipelines/setup/get-ci-settings.js +3 -6
- package/lib/lib/pipelines/setup/get-github-token.js +1 -4
- package/lib/lib/pipelines/setup/get-name-and-repo.js +23 -31
- package/lib/lib/pipelines/setup/get-repo.js +1 -4
- package/lib/lib/pipelines/setup/get-settings.js +13 -16
- package/lib/lib/pipelines/setup/poll-app-setups.js +6 -9
- package/lib/lib/pipelines/setup/setup-pipeline.js +3 -6
- package/lib/lib/pipelines/setup/validate.js +5 -11
- package/lib/lib/pipelines/stages.js +1 -6
- package/lib/lib/redis/api.js +18 -21
- package/lib/lib/releases/output.js +3 -7
- package/lib/lib/releases/releases.js +8 -15
- package/lib/lib/releases/status_helper.js +2 -7
- package/lib/lib/run/colorize.js +55 -59
- package/lib/lib/run/dyno.d.ts +10 -5
- package/lib/lib/run/dyno.js +59 -51
- package/lib/lib/run/helpers.js +5 -11
- package/lib/lib/run/log-displayer.d.ts +14 -2
- package/lib/lib/run/log-displayer.js +121 -79
- package/lib/lib/sessions/sessions.js +1 -2
- package/lib/lib/spaces/format.js +16 -24
- package/lib/lib/spaces/hosts.d.ts +1 -9
- package/lib/lib/spaces/hosts.js +41 -33
- package/lib/lib/spaces/outbound-rules.d.ts +1 -4
- package/lib/lib/spaces/outbound-rules.js +79 -73
- package/lib/lib/spaces/parsers.js +1 -5
- package/lib/lib/spaces/peering.d.ts +1 -4
- package/lib/lib/spaces/peering.js +52 -51
- package/lib/lib/spaces/spaces.d.ts +1 -6
- package/lib/lib/spaces/spaces.js +39 -37
- package/lib/lib/spaces/vpn-connections.js +17 -21
- package/lib/lib/status/util.js +1 -5
- package/lib/lib/teamUtils.js +4 -10
- package/lib/lib/telemetry/util.d.ts +1 -1
- package/lib/lib/telemetry/util.js +14 -17
- package/lib/lib/time.js +3 -8
- package/lib/lib/types/app_errors.js +1 -2
- package/lib/lib/types/app_process_tier.d.ts +1 -1
- package/lib/lib/types/app_process_tier.js +1 -2
- package/lib/lib/types/domain.js +1 -2
- package/lib/lib/types/favorites.js +1 -2
- package/lib/lib/types/notifications.js +1 -2
- package/lib/lib/utils/keyValueParser.js +1 -4
- package/lib/lib/utils/multisort.js +2 -6
- package/lib/lib/utils/packageParser.js +10 -8
- package/lib/lib/utils/paginator.js +1 -5
- package/lib/lib/utils/sparkline.d.ts +7 -0
- package/lib/lib/utils/sparkline.js +35 -0
- package/lib/lib/utils/uuid-validate.js +1 -5
- package/lib/lib/webhooks/base.js +11 -9
- package/lib/nls.js +2 -6
- package/lib/oldCommands/autocomplete/create.d.ts +1 -0
- package/lib/oldCommands/autocomplete/create.js +254 -0
- package/lib/oldCommands/autocomplete/doctor.d.ts +1 -0
- package/lib/oldCommands/autocomplete/doctor.js +110 -0
- package/lib/oldCommands/autocomplete/index.d.ts +1 -0
- package/lib/oldCommands/autocomplete/index.js +80 -0
- package/lib/oldCommands/autocomplete/options.d.ts +1 -0
- package/lib/oldCommands/autocomplete/options.js +240 -0
- package/lib/oldCommands/autocomplete/script.d.ts +1 -0
- package/lib/oldCommands/autocomplete/script.js +35 -0
- package/lib/oldCommands/pg/backups/cancel.d.ts +1 -0
- package/lib/oldCommands/pg/backups/cancel.js +56 -0
- package/lib/oldCommands/pg/backups/capture.d.ts +1 -0
- package/lib/oldCommands/pg/backups/capture.js +77 -0
- package/lib/oldCommands/pg/backups/delete.d.ts +1 -0
- package/lib/oldCommands/pg/backups/delete.js +45 -0
- package/lib/oldCommands/pg/backups/download.d.ts +1 -0
- package/lib/oldCommands/pg/backups/download.js +64 -0
- package/lib/oldCommands/pg/backups/index.d.ts +1 -0
- package/lib/oldCommands/pg/backups/index.js +141 -0
- package/lib/oldCommands/pg/backups/info.d.ts +1 -0
- package/lib/oldCommands/pg/backups/info.js +102 -0
- package/lib/oldCommands/pg/backups/restore.d.ts +1 -0
- package/lib/oldCommands/pg/backups/restore.js +150 -0
- package/lib/oldCommands/pg/backups/schedule.d.ts +1 -0
- package/lib/oldCommands/pg/backups/schedule.js +107 -0
- package/lib/oldCommands/pg/backups/schedules.d.ts +1 -0
- package/lib/oldCommands/pg/backups/schedules.js +34 -0
- package/lib/oldCommands/pg/backups/unschedule.d.ts +1 -0
- package/lib/oldCommands/pg/backups/unschedule.js +60 -0
- package/lib/oldCommands/pg/backups/url.d.ts +1 -0
- package/lib/oldCommands/pg/backups/url.js +46 -0
- package/lib/oldCommands/pg/bloat.d.ts +1 -0
- package/lib/{commands → oldCommands}/pg/bloat.js +31 -26
- package/lib/oldCommands/pg/blocking.d.ts +1 -0
- package/lib/oldCommands/pg/blocking.js +48 -0
- package/lib/oldCommands/pg/connection-pooling/attach.d.ts +1 -0
- package/lib/oldCommands/pg/connection-pooling/attach.js +53 -0
- package/lib/oldCommands/pg/copy.d.ts +1 -0
- package/lib/oldCommands/pg/copy.js +104 -0
- package/lib/oldCommands/pg/credentials/create.d.ts +1 -0
- package/lib/oldCommands/pg/credentials/create.js +47 -0
- package/lib/oldCommands/pg/credentials/destroy.d.ts +1 -0
- package/lib/oldCommands/pg/credentials/destroy.js +56 -0
- package/lib/oldCommands/pg/credentials/repair-default.d.ts +1 -0
- package/lib/oldCommands/pg/credentials/repair-default.js +43 -0
- package/lib/oldCommands/pg/credentials/rotate.d.ts +1 -0
- package/lib/oldCommands/pg/credentials/rotate.js +97 -0
- package/lib/oldCommands/pg/credentials/url.d.ts +1 -0
- package/lib/oldCommands/pg/credentials/url.js +75 -0
- package/lib/oldCommands/pg/credentials.d.ts +1 -0
- package/lib/oldCommands/pg/credentials.js +77 -0
- package/lib/oldCommands/pg/diagnose.d.ts +1 -0
- package/lib/oldCommands/pg/diagnose.js +136 -0
- package/lib/oldCommands/pg/info.d.ts +1 -0
- package/lib/oldCommands/pg/info.js +110 -0
- package/lib/oldCommands/pg/kill.d.ts +1 -0
- package/lib/oldCommands/pg/kill.js +37 -0
- package/lib/oldCommands/pg/killall.d.ts +1 -0
- package/lib/oldCommands/pg/killall.js +31 -0
- package/lib/oldCommands/pg/links/create.d.ts +1 -0
- package/lib/oldCommands/pg/links/create.js +70 -0
- package/lib/oldCommands/pg/links/destroy.d.ts +1 -0
- package/lib/oldCommands/pg/links/destroy.js +51 -0
- package/lib/oldCommands/pg/links/index.d.ts +1 -0
- package/lib/oldCommands/pg/links/index.js +64 -0
- package/lib/oldCommands/pg/locks.d.ts +1 -0
- package/lib/oldCommands/pg/locks.js +60 -0
- package/lib/oldCommands/pg/maintenance/index.d.ts +1 -0
- package/lib/oldCommands/pg/maintenance/index.js +34 -0
- package/lib/oldCommands/pg/maintenance/run.d.ts +1 -0
- package/lib/oldCommands/pg/maintenance/run.js +44 -0
- package/lib/oldCommands/pg/maintenance/window.d.ts +1 -0
- package/lib/oldCommands/pg/maintenance/window.js +52 -0
- package/lib/oldCommands/pg/outliers.d.ts +1 -0
- package/lib/oldCommands/pg/outliers.js +110 -0
- package/lib/oldCommands/pg/promote.d.ts +1 -0
- package/lib/oldCommands/pg/promote.js +183 -0
- package/lib/oldCommands/pg/ps.d.ts +1 -0
- package/lib/oldCommands/pg/ps.js +56 -0
- package/lib/oldCommands/pg/psql.d.ts +1 -0
- package/lib/oldCommands/pg/psql.js +53 -0
- package/lib/oldCommands/pg/pull.d.ts +1 -0
- package/lib/oldCommands/pg/pull.js +114 -0
- package/lib/oldCommands/pg/push.d.ts +1 -0
- package/lib/oldCommands/pg/push.js +111 -0
- package/lib/oldCommands/pg/reset.d.ts +1 -0
- package/lib/oldCommands/pg/reset.js +49 -0
- package/lib/oldCommands/pg/settings/auto-explain/log-analyze.d.ts +1 -0
- package/lib/oldCommands/pg/settings/auto-explain/log-analyze.js +37 -0
- package/lib/oldCommands/pg/settings/auto-explain/log-buffers.d.ts +1 -0
- package/lib/oldCommands/pg/settings/auto-explain/log-buffers.js +35 -0
- package/lib/oldCommands/pg/settings/auto-explain/log-format.d.ts +1 -0
- package/lib/oldCommands/pg/settings/auto-explain/log-format.js +30 -0
- package/lib/oldCommands/pg/settings/auto-explain/log-min-duration.d.ts +1 -0
- package/lib/oldCommands/pg/settings/auto-explain/log-min-duration.js +39 -0
- package/lib/oldCommands/pg/settings/auto-explain/log-nested-statements.d.ts +1 -0
- package/lib/oldCommands/pg/settings/auto-explain/log-nested-statements.js +30 -0
- package/lib/oldCommands/pg/settings/auto-explain/log-triggers.d.ts +1 -0
- package/lib/oldCommands/pg/settings/auto-explain/log-triggers.js +35 -0
- package/lib/oldCommands/pg/settings/auto-explain/log-verbose.d.ts +1 -0
- package/lib/oldCommands/pg/settings/auto-explain/log-verbose.js +40 -0
- package/lib/oldCommands/pg/settings/auto-explain.d.ts +1 -0
- package/lib/oldCommands/pg/settings/auto-explain.js +45 -0
- package/lib/oldCommands/pg/settings/data-connector-details-logs.d.ts +1 -0
- package/lib/oldCommands/pg/settings/data-connector-details-logs.js +40 -0
- package/lib/oldCommands/pg/settings/index.d.ts +1 -0
- package/lib/oldCommands/pg/settings/index.js +41 -0
- package/lib/oldCommands/pg/settings/log-connections.d.ts +1 -0
- package/lib/oldCommands/pg/settings/log-connections.js +40 -0
- package/lib/oldCommands/pg/settings/log-lock-waits.d.ts +1 -0
- package/lib/oldCommands/pg/settings/log-lock-waits.js +36 -0
- package/lib/oldCommands/pg/settings/log-min-duration-statement.d.ts +1 -0
- package/lib/oldCommands/pg/settings/log-min-duration-statement.js +39 -0
- package/lib/oldCommands/pg/settings/log-min-error-statement.d.ts +1 -0
- package/lib/oldCommands/pg/settings/log-min-error-statement.js +31 -0
- package/lib/oldCommands/pg/settings/log-statement.d.ts +1 -0
- package/lib/oldCommands/pg/settings/log-statement.js +33 -0
- package/lib/oldCommands/pg/settings/track-functions.d.ts +1 -0
- package/lib/oldCommands/pg/settings/track-functions.js +33 -0
- package/lib/oldCommands/pg/unfollow.d.ts +1 -0
- package/lib/oldCommands/pg/unfollow.js +46 -0
- package/lib/oldCommands/pg/upgrade/cancel.d.ts +1 -0
- package/lib/oldCommands/pg/upgrade/cancel.js +62 -0
- package/lib/oldCommands/pg/upgrade/dryrun.d.ts +1 -0
- package/lib/oldCommands/pg/upgrade/dryrun.js +62 -0
- package/lib/oldCommands/pg/upgrade/index.d.ts +1 -0
- package/lib/oldCommands/pg/upgrade/index.js +85 -0
- package/lib/oldCommands/pg/upgrade/prepare.d.ts +1 -0
- package/lib/oldCommands/pg/upgrade/prepare.js +64 -0
- package/lib/oldCommands/pg/upgrade/run.d.ts +1 -0
- package/lib/oldCommands/pg/upgrade/run.js +106 -0
- package/lib/oldCommands/pg/upgrade/wait.d.ts +1 -0
- package/lib/oldCommands/pg/upgrade/wait.js +121 -0
- package/lib/oldCommands/pg/upgrade.d.ts +1 -0
- package/lib/oldCommands/pg/upgrade.js +66 -0
- package/lib/oldCommands/pg/vacuum-stats.d.ts +1 -0
- package/lib/{commands → oldCommands}/pg/vacuum-stats.js +30 -27
- package/lib/oldCommands/pg/wait.d.ts +1 -0
- package/lib/oldCommands/pg/wait.js +96 -0
- package/lib/oldCommands/pipelines/open.d.ts +1 -0
- package/lib/oldCommands/pipelines/open.js +25 -0
- package/lib/oldCommands/pipelines/promote.d.ts +1 -0
- package/lib/oldCommands/pipelines/promote.js +269 -0
- package/lib/oldCommands/pipelines/remove.d.ts +1 -0
- package/lib/oldCommands/pipelines/remove.js +29 -0
- package/lib/oldCommands/pipelines/rename.d.ts +1 -0
- package/lib/oldCommands/pipelines/rename.js +42 -0
- package/lib/oldCommands/pipelines/setup.d.ts +1 -0
- package/lib/oldCommands/pipelines/setup.js +117 -0
- package/lib/oldCommands/pipelines/transfer.d.ts +1 -0
- package/lib/oldCommands/pipelines/transfer.js +78 -0
- package/lib/oldCommands/pipelines/update.d.ts +1 -0
- package/lib/oldCommands/pipelines/update.js +39 -0
- package/lib/oldCommands/ps/autoscale/disable.d.ts +1 -0
- package/lib/oldCommands/ps/autoscale/disable.js +43 -0
- package/lib/oldCommands/ps/autoscale/enable.d.ts +1 -0
- package/lib/oldCommands/ps/autoscale/enable.js +103 -0
- package/lib/oldCommands/ps/index.d.ts +1 -0
- package/lib/oldCommands/ps/index.js +254 -0
- package/lib/oldCommands/ps/restart.d.ts +1 -0
- package/lib/oldCommands/ps/restart.js +78 -0
- package/lib/oldCommands/ps/scale.d.ts +1 -0
- package/lib/oldCommands/ps/scale.js +95 -0
- package/lib/oldCommands/ps/stop.d.ts +1 -0
- package/lib/oldCommands/ps/stop.js +73 -0
- package/lib/oldCommands/ps/type.d.ts +1 -0
- package/lib/oldCommands/ps/type.js +190 -0
- package/lib/oldCommands/ps/wait.d.ts +1 -0
- package/lib/oldCommands/ps/wait.js +93 -0
- package/lib/oldCommands/redis/cli.d.ts +1 -0
- package/lib/oldCommands/redis/cli.js +227 -0
- package/lib/oldCommands/redis/credentials.d.ts +1 -0
- package/lib/oldCommands/redis/credentials.js +36 -0
- package/lib/oldCommands/redis/info.d.ts +1 -0
- package/lib/oldCommands/redis/info.js +28 -0
- package/lib/oldCommands/redis/keyspace-notifications.d.ts +1 -0
- package/lib/oldCommands/redis/keyspace-notifications.js +55 -0
- package/lib/oldCommands/redis/maintenance.d.ts +1 -0
- package/lib/oldCommands/redis/maintenance.js +75 -0
- package/lib/oldCommands/redis/maxmemory.d.ts +1 -0
- package/lib/oldCommands/redis/maxmemory.js +46 -0
- package/lib/oldCommands/redis/promote.d.ts +1 -0
- package/lib/oldCommands/redis/promote.js +43 -0
- package/lib/oldCommands/redis/stats-reset.d.ts +1 -0
- package/lib/oldCommands/redis/stats-reset.js +40 -0
- package/lib/oldCommands/redis/timeout.d.ts +1 -0
- package/lib/oldCommands/redis/timeout.js +44 -0
- package/lib/oldCommands/redis/upgrade.d.ts +1 -0
- package/lib/oldCommands/redis/upgrade.js +41 -0
- package/lib/oldCommands/redis/wait.d.ts +1 -0
- package/lib/oldCommands/redis/wait.js +71 -0
- package/lib/oldCommands/releases/index.d.ts +1 -0
- package/lib/oldCommands/releases/index.js +156 -0
- package/lib/oldCommands/releases/info.d.ts +1 -0
- package/lib/oldCommands/releases/info.js +68 -0
- package/lib/oldCommands/releases/output.d.ts +1 -0
- package/lib/oldCommands/releases/output.js +42 -0
- package/lib/oldCommands/releases/retry.d.ts +1 -0
- package/lib/oldCommands/releases/retry.js +59 -0
- package/lib/oldCommands/releases/rollback.d.ts +1 -0
- package/lib/oldCommands/releases/rollback.js +65 -0
- package/lib/oldCommands/run/detached.d.ts +1 -0
- package/lib/oldCommands/run/detached.js +61 -0
- package/lib/oldCommands/run/index.d.ts +1 -0
- package/lib/oldCommands/run/index.js +72 -0
- package/lib/oldCommands/run/inside.d.ts +1 -0
- package/lib/oldCommands/run/inside.js +93 -0
- package/lib/oldCommands/spaces/create.d.ts +1 -0
- package/lib/oldCommands/spaces/create.js +99 -0
- package/lib/oldCommands/spaces/destroy.d.ts +1 -0
- package/lib/oldCommands/spaces/destroy.js +79 -0
- package/lib/oldCommands/spaces/drains/get.d.ts +1 -0
- package/lib/oldCommands/spaces/drains/get.js +33 -0
- package/lib/oldCommands/spaces/drains/set.d.ts +1 -0
- package/lib/oldCommands/spaces/drains/set.js +33 -0
- package/lib/oldCommands/spaces/hosts.d.ts +1 -0
- package/lib/oldCommands/spaces/hosts.js +42 -0
- package/lib/oldCommands/spaces/index.d.ts +1 -0
- package/lib/oldCommands/spaces/index.js +74 -0
- package/lib/oldCommands/spaces/info.d.ts +1 -0
- package/lib/oldCommands/spaces/info.js +59 -0
- package/lib/oldCommands/spaces/peerings/accept.d.ts +1 -0
- package/lib/oldCommands/spaces/peerings/accept.js +41 -0
- package/lib/oldCommands/spaces/peerings/destroy.d.ts +1 -0
- package/lib/oldCommands/spaces/peerings/destroy.js +51 -0
- package/lib/oldCommands/spaces/peerings/index.d.ts +1 -0
- package/lib/oldCommands/spaces/peerings/index.js +39 -0
- package/lib/oldCommands/spaces/peerings/info.d.ts +1 -0
- package/lib/{commands → oldCommands}/spaces/peerings/info.js +45 -38
- package/lib/oldCommands/spaces/ps.d.ts +1 -0
- package/lib/oldCommands/spaces/ps.js +97 -0
- package/lib/oldCommands/spaces/rename.d.ts +1 -0
- package/lib/oldCommands/spaces/rename.js +29 -0
- package/lib/oldCommands/spaces/topology.d.ts +1 -0
- package/lib/oldCommands/spaces/topology.js +95 -0
- package/lib/oldCommands/spaces/transfer.d.ts +1 -0
- package/lib/oldCommands/spaces/transfer.js +37 -0
- package/lib/oldCommands/spaces/trusted-ips/add.d.ts +1 -0
- package/lib/oldCommands/spaces/trusted-ips/add.js +48 -0
- package/lib/oldCommands/spaces/trusted-ips/index.d.ts +1 -0
- package/lib/oldCommands/spaces/trusted-ips/index.js +57 -0
- package/lib/oldCommands/spaces/trusted-ips/remove.d.ts +1 -0
- package/lib/oldCommands/spaces/trusted-ips/remove.js +50 -0
- package/lib/oldCommands/spaces/vpn/config.d.ts +1 -0
- package/lib/oldCommands/spaces/vpn/config.js +61 -0
- package/lib/oldCommands/spaces/vpn/connect.d.ts +1 -0
- package/lib/oldCommands/spaces/vpn/connect.js +54 -0
- package/lib/oldCommands/spaces/vpn/connections.d.ts +1 -0
- package/lib/oldCommands/spaces/vpn/connections.js +70 -0
- package/lib/oldCommands/spaces/vpn/destroy.d.ts +1 -0
- package/lib/oldCommands/spaces/vpn/destroy.js +48 -0
- package/lib/oldCommands/spaces/vpn/info.d.ts +1 -0
- package/lib/oldCommands/spaces/vpn/info.js +89 -0
- package/lib/oldCommands/spaces/vpn/update.d.ts +1 -0
- package/lib/oldCommands/spaces/vpn/update.js +46 -0
- package/lib/oldCommands/spaces/vpn/wait.d.ts +1 -0
- package/lib/oldCommands/spaces/vpn/wait.js +80 -0
- package/lib/oldCommands/spaces/wait.d.ts +1 -0
- package/lib/oldCommands/spaces/wait.js +106 -0
- package/lib/oldCommands/webhooks/add.d.ts +1 -0
- package/lib/oldCommands/webhooks/add.js +56 -0
- package/lib/oldCommands/webhooks/deliveries/index.d.ts +1 -0
- package/lib/oldCommands/webhooks/deliveries/index.js +90 -0
- package/lib/oldCommands/webhooks/deliveries/info.d.ts +1 -0
- package/lib/oldCommands/webhooks/deliveries/info.js +54 -0
- package/lib/oldCommands/webhooks/events/index.d.ts +1 -0
- package/lib/oldCommands/webhooks/events/index.js +56 -0
- package/lib/oldCommands/webhooks/events/info.d.ts +1 -0
- package/lib/oldCommands/webhooks/events/info.js +42 -0
- package/lib/oldCommands/webhooks/index.d.ts +1 -0
- package/lib/oldCommands/webhooks/index.js +55 -0
- package/lib/oldCommands/webhooks/info.d.ts +1 -0
- package/lib/oldCommands/webhooks/info.js +41 -0
- package/lib/oldCommands/webhooks/remove.d.ts +1 -0
- package/lib/oldCommands/webhooks/remove.js +37 -0
- package/lib/oldCommands/webhooks/update.d.ts +1 -0
- package/lib/oldCommands/webhooks/update.js +50 -0
- package/lib/user-config.d.ts +0 -1
- package/lib/user-config.js +23 -22
- package/npm-shrinkwrap.json +31675 -0
- package/oclif.manifest.json +964 -8402
- package/package.json +42 -55
- package/lib/commands/autocomplete/create.d.ts +0 -29
- package/lib/commands/autocomplete/create.js +0 -213
- package/lib/commands/autocomplete/doctor.d.ts +0 -12
- package/lib/commands/autocomplete/doctor.js +0 -98
- package/lib/commands/autocomplete/index.d.ts +0 -12
- package/lib/commands/autocomplete/index.js +0 -67
- package/lib/commands/autocomplete/options.d.ts +0 -25
- package/lib/commands/autocomplete/options.js +0 -210
- package/lib/commands/autocomplete/script.d.ts +0 -10
- package/lib/commands/autocomplete/script.js +0 -23
- package/lib/commands/certs/auto/wait.d.ts +0 -9
- package/lib/commands/certs/auto/wait.js +0 -14
- package/lib/commands/container/index.d.ts +0 -6
- package/lib/commands/container/index.js +0 -13
- package/lib/commands/pg/backups/cancel.d.ts +0 -15
- package/lib/commands/pg/backups/cancel.js +0 -49
- package/lib/commands/pg/backups/capture.d.ts +0 -15
- package/lib/commands/pg/backups/capture.js +0 -66
- package/lib/commands/pg/backups/delete.d.ts +0 -15
- package/lib/commands/pg/backups/delete.js +0 -38
- package/lib/commands/pg/backups/download.d.ts +0 -14
- package/lib/commands/pg/backups/download.js +0 -58
- package/lib/commands/pg/backups/index.d.ts +0 -20
- package/lib/commands/pg/backups/index.js +0 -130
- package/lib/commands/pg/backups/info.d.ts +0 -17
- package/lib/commands/pg/backups/info.js +0 -93
- package/lib/commands/pg/backups/restore.d.ts +0 -20
- package/lib/commands/pg/backups/restore.js +0 -135
- package/lib/commands/pg/backups/schedule.d.ts +0 -21
- package/lib/commands/pg/backups/schedule.js +0 -77
- package/lib/commands/pg/backups/schedules.d.ts +0 -10
- package/lib/commands/pg/backups/schedules.js +0 -32
- package/lib/commands/pg/backups/unschedule.d.ts +0 -13
- package/lib/commands/pg/backups/unschedule.js +0 -45
- package/lib/commands/pg/backups/url.d.ts +0 -13
- package/lib/commands/pg/backups/url.js +0 -41
- package/lib/commands/pg/bloat.d.ts +0 -13
- package/lib/commands/pg/blocking.d.ts +0 -13
- package/lib/commands/pg/blocking.js +0 -43
- package/lib/commands/pg/connection-pooling/attach.d.ts +0 -15
- package/lib/commands/pg/connection-pooling/attach.js +0 -42
- package/lib/commands/pg/copy.d.ts +0 -18
- package/lib/commands/pg/copy.js +0 -86
- package/lib/commands/pg/credentials/create.d.ts +0 -14
- package/lib/commands/pg/credentials/create.js +0 -41
- package/lib/commands/pg/credentials/destroy.d.ts +0 -16
- package/lib/commands/pg/credentials/destroy.js +0 -49
- package/lib/commands/pg/credentials/repair-default.d.ts +0 -15
- package/lib/commands/pg/credentials/repair-default.js +0 -40
- package/lib/commands/pg/credentials/rotate.d.ts +0 -17
- package/lib/commands/pg/credentials/rotate.js +0 -84
- package/lib/commands/pg/credentials/url.d.ts +0 -14
- package/lib/commands/pg/credentials/url.js +0 -65
- package/lib/commands/pg/credentials.d.ts +0 -16
- package/lib/commands/pg/credentials.js +0 -63
- package/lib/commands/pg/diagnose.d.ts +0 -18
- package/lib/commands/pg/diagnose.js +0 -110
- package/lib/commands/pg/info.d.ts +0 -14
- package/lib/commands/pg/info.js +0 -94
- package/lib/commands/pg/kill.d.ts +0 -15
- package/lib/commands/pg/kill.js +0 -33
- package/lib/commands/pg/killall.d.ts +0 -13
- package/lib/commands/pg/killall.js +0 -27
- package/lib/commands/pg/links/create.d.ts +0 -15
- package/lib/commands/pg/links/create.js +0 -59
- package/lib/commands/pg/links/destroy.d.ts +0 -16
- package/lib/commands/pg/links/destroy.js +0 -43
- package/lib/commands/pg/links/index.d.ts +0 -13
- package/lib/commands/pg/links/index.js +0 -61
- package/lib/commands/pg/locks.d.ts +0 -15
- package/lib/commands/pg/locks.js +0 -54
- package/lib/commands/pg/maintenance/index.d.ts +0 -13
- package/lib/commands/pg/maintenance/index.js +0 -30
- package/lib/commands/pg/maintenance/run.d.ts +0 -14
- package/lib/commands/pg/maintenance/run.js +0 -38
- package/lib/commands/pg/maintenance/window.d.ts +0 -15
- package/lib/commands/pg/maintenance/window.js +0 -42
- package/lib/commands/pg/outliers.d.ts +0 -19
- package/lib/commands/pg/outliers.js +0 -99
- package/lib/commands/pg/promote.d.ts +0 -14
- package/lib/commands/pg/promote.js +0 -170
- package/lib/commands/pg/ps.d.ts +0 -14
- package/lib/commands/pg/ps.js +0 -53
- package/lib/commands/pg/psql.d.ts +0 -16
- package/lib/commands/pg/psql.js +0 -50
- package/lib/commands/pg/pull.d.ts +0 -18
- package/lib/commands/pg/pull.js +0 -88
- package/lib/commands/pg/push.d.ts +0 -18
- package/lib/commands/pg/push.js +0 -85
- package/lib/commands/pg/reset.d.ts +0 -15
- package/lib/commands/pg/reset.js +0 -45
- package/lib/commands/pg/settings/auto-explain/log-analyze.d.ts +0 -13
- package/lib/commands/pg/settings/auto-explain/log-analyze.js +0 -33
- package/lib/commands/pg/settings/auto-explain/log-buffers.d.ts +0 -13
- package/lib/commands/pg/settings/auto-explain/log-buffers.js +0 -31
- package/lib/commands/pg/settings/auto-explain/log-format.d.ts +0 -12
- package/lib/commands/pg/settings/auto-explain/log-format.js +0 -27
- package/lib/commands/pg/settings/auto-explain/log-min-duration.d.ts +0 -13
- package/lib/commands/pg/settings/auto-explain/log-min-duration.js +0 -34
- package/lib/commands/pg/settings/auto-explain/log-nested-statements.d.ts +0 -12
- package/lib/commands/pg/settings/auto-explain/log-nested-statements.js +0 -26
- package/lib/commands/pg/settings/auto-explain/log-triggers.d.ts +0 -13
- package/lib/commands/pg/settings/auto-explain/log-triggers.js +0 -31
- package/lib/commands/pg/settings/auto-explain/log-verbose.d.ts +0 -17
- package/lib/commands/pg/settings/auto-explain/log-verbose.js +0 -34
- package/lib/commands/pg/settings/auto-explain.d.ts +0 -18
- package/lib/commands/pg/settings/auto-explain.js +0 -39
- package/lib/commands/pg/settings/data-connector-details-logs.d.ts +0 -17
- package/lib/commands/pg/settings/data-connector-details-logs.js +0 -35
- package/lib/commands/pg/settings/index.d.ts +0 -13
- package/lib/commands/pg/settings/index.js +0 -36
- package/lib/commands/pg/settings/log-connections.d.ts +0 -17
- package/lib/commands/pg/settings/log-connections.js +0 -35
- package/lib/commands/pg/settings/log-lock-waits.d.ts +0 -13
- package/lib/commands/pg/settings/log-lock-waits.js +0 -32
- package/lib/commands/pg/settings/log-min-duration-statement.d.ts +0 -12
- package/lib/commands/pg/settings/log-min-duration-statement.js +0 -34
- package/lib/commands/pg/settings/log-min-error-statement.d.ts +0 -12
- package/lib/commands/pg/settings/log-min-error-statement.js +0 -28
- package/lib/commands/pg/settings/log-statement.d.ts +0 -12
- package/lib/commands/pg/settings/log-statement.js +0 -31
- package/lib/commands/pg/settings/track-functions.d.ts +0 -12
- package/lib/commands/pg/settings/track-functions.js +0 -30
- package/lib/commands/pg/unfollow.d.ts +0 -14
- package/lib/commands/pg/unfollow.js +0 -41
- package/lib/commands/pg/upgrade/cancel.d.ts +0 -13
- package/lib/commands/pg/upgrade/cancel.js +0 -53
- package/lib/commands/pg/upgrade/dryrun.d.ts +0 -14
- package/lib/commands/pg/upgrade/dryrun.js +0 -53
- package/lib/commands/pg/upgrade/index.d.ts +0 -15
- package/lib/commands/pg/upgrade/index.js +0 -76
- package/lib/commands/pg/upgrade/prepare.d.ts +0 -14
- package/lib/commands/pg/upgrade/prepare.js +0 -54
- package/lib/commands/pg/upgrade/run.d.ts +0 -16
- package/lib/commands/pg/upgrade/run.js +0 -98
- package/lib/commands/pg/upgrade/wait.d.ts +0 -16
- package/lib/commands/pg/upgrade/wait.js +0 -103
- package/lib/commands/pg/vacuum-stats.d.ts +0 -13
- package/lib/commands/pg/wait.d.ts +0 -15
- package/lib/commands/pg/wait.js +0 -81
- package/lib/commands/pipelines/open.d.ts +0 -9
- package/lib/commands/pipelines/open.js +0 -19
- package/lib/commands/pipelines/promote.d.ts +0 -12
- package/lib/commands/pipelines/promote.js +0 -217
- package/lib/commands/pipelines/remove.d.ts +0 -10
- package/lib/commands/pipelines/remove.js +0 -23
- package/lib/commands/pipelines/rename.d.ts +0 -10
- package/lib/commands/pipelines/rename.js +0 -33
- package/lib/commands/pipelines/setup.d.ts +0 -14
- package/lib/commands/pipelines/setup.js +0 -91
- package/lib/commands/pipelines/transfer.d.ts +0 -13
- package/lib/commands/pipelines/transfer.js +0 -66
- package/lib/commands/pipelines/update.d.ts +0 -11
- package/lib/commands/pipelines/update.js +0 -32
- package/lib/commands/ps/autoscale/disable.d.ts +0 -9
- package/lib/commands/ps/autoscale/disable.js +0 -35
- package/lib/commands/ps/autoscale/enable.d.ts +0 -13
- package/lib/commands/ps/autoscale/enable.js +0 -77
- package/lib/commands/ps/index.d.ts +0 -15
- package/lib/commands/ps/index.js +0 -205
- package/lib/commands/ps/restart.d.ts +0 -18
- package/lib/commands/ps/restart.js +0 -70
- package/lib/commands/ps/scale.d.ts +0 -13
- package/lib/commands/ps/scale.js +0 -86
- package/lib/commands/ps/stop.d.ts +0 -18
- package/lib/commands/ps/stop.js +0 -64
- package/lib/commands/ps/type.d.ts +0 -12
- package/lib/commands/ps/type.js +0 -171
- package/lib/commands/ps/wait.d.ts +0 -12
- package/lib/commands/ps/wait.js +0 -79
- package/lib/commands/redis/cli.d.ts +0 -15
- package/lib/commands/redis/cli.js +0 -203
- package/lib/commands/redis/credentials.d.ts +0 -14
- package/lib/commands/redis/credentials.js +0 -32
- package/lib/commands/redis/info.d.ts +0 -15
- package/lib/commands/redis/info.js +0 -25
- package/lib/commands/redis/keyspace-notifications.d.ts +0 -14
- package/lib/commands/redis/keyspace-notifications.js +0 -47
- package/lib/commands/redis/maintenance.d.ts +0 -16
- package/lib/commands/redis/maintenance.js +0 -63
- package/lib/commands/redis/maxmemory.d.ts +0 -14
- package/lib/commands/redis/maxmemory.js +0 -40
- package/lib/commands/redis/promote.d.ts +0 -13
- package/lib/commands/redis/promote.js +0 -39
- package/lib/commands/redis/stats-reset.d.ts +0 -14
- package/lib/commands/redis/stats-reset.js +0 -36
- package/lib/commands/redis/timeout.d.ts +0 -14
- package/lib/commands/redis/timeout.js +0 -35
- package/lib/commands/redis/upgrade.d.ts +0 -15
- package/lib/commands/redis/upgrade.js +0 -37
- package/lib/commands/redis/wait.d.ts +0 -14
- package/lib/commands/redis/wait.js +0 -60
- package/lib/commands/releases/index.d.ts +0 -14
- package/lib/commands/releases/index.js +0 -127
- package/lib/commands/releases/info.d.ts +0 -15
- package/lib/commands/releases/info.js +0 -61
- package/lib/commands/releases/output.d.ts +0 -13
- package/lib/commands/releases/output.js +0 -37
- package/lib/commands/releases/retry.d.ts +0 -11
- package/lib/commands/releases/retry.js +0 -51
- package/lib/commands/releases/rollback.d.ts +0 -14
- package/lib/commands/releases/rollback.js +0 -58
- package/lib/commands/run/detached.d.ts +0 -15
- package/lib/commands/run/detached.js +0 -53
- package/lib/commands/run/index.d.ts +0 -18
- package/lib/commands/run/index.js +0 -65
- package/lib/commands/run/inside.d.ts +0 -18
- package/lib/commands/run/inside.js +0 -82
- package/lib/commands/spaces/create.d.ts +0 -23
- package/lib/commands/spaces/create.js +0 -89
- package/lib/commands/spaces/destroy.d.ts +0 -14
- package/lib/commands/spaces/destroy.js +0 -64
- package/lib/commands/spaces/drains/get.d.ts +0 -12
- package/lib/commands/spaces/drains/get.js +0 -27
- package/lib/commands/spaces/drains/set.d.ts +0 -14
- package/lib/commands/spaces/drains/set.js +0 -29
- package/lib/commands/spaces/hosts.d.ts +0 -14
- package/lib/commands/spaces/hosts.js +0 -37
- package/lib/commands/spaces/index.d.ts +0 -16
- package/lib/commands/spaces/index.js +0 -62
- package/lib/commands/spaces/info.d.ts +0 -14
- package/lib/commands/spaces/info.js +0 -49
- package/lib/commands/spaces/peerings/accept.d.ts +0 -15
- package/lib/commands/spaces/peerings/accept.js +0 -36
- package/lib/commands/spaces/peerings/destroy.d.ts +0 -15
- package/lib/commands/spaces/peerings/destroy.js +0 -45
- package/lib/commands/spaces/peerings/index.d.ts +0 -13
- package/lib/commands/spaces/peerings/index.js +0 -33
- package/lib/commands/spaces/peerings/info.d.ts +0 -15
- package/lib/commands/spaces/ps.d.ts +0 -15
- package/lib/commands/spaces/ps.js +0 -83
- package/lib/commands/spaces/rename.d.ts +0 -11
- package/lib/commands/spaces/rename.js +0 -26
- package/lib/commands/spaces/topology.d.ts +0 -32
- package/lib/commands/spaces/topology.js +0 -90
- package/lib/commands/spaces/transfer.d.ts +0 -11
- package/lib/commands/spaces/transfer.js +0 -35
- package/lib/commands/spaces/trusted-ips/add.d.ts +0 -16
- package/lib/commands/spaces/trusted-ips/add.js +0 -40
- package/lib/commands/spaces/trusted-ips/index.d.ts +0 -15
- package/lib/commands/spaces/trusted-ips/index.js +0 -51
- package/lib/commands/spaces/trusted-ips/remove.d.ts +0 -15
- package/lib/commands/spaces/trusted-ips/remove.js +0 -43
- package/lib/commands/spaces/vpn/config.d.ts +0 -14
- package/lib/commands/spaces/vpn/config.js +0 -55
- package/lib/commands/spaces/vpn/connect.d.ts +0 -15
- package/lib/commands/spaces/vpn/connect.js +0 -48
- package/lib/commands/spaces/vpn/connections.d.ts +0 -17
- package/lib/commands/spaces/vpn/connections.js +0 -58
- package/lib/commands/spaces/vpn/destroy.d.ts +0 -14
- package/lib/commands/spaces/vpn/destroy.js +0 -38
- package/lib/commands/spaces/vpn/info.d.ts +0 -16
- package/lib/commands/spaces/vpn/info.js +0 -83
- package/lib/commands/spaces/vpn/update.d.ts +0 -14
- package/lib/commands/spaces/vpn/update.js +0 -39
- package/lib/commands/spaces/vpn/wait.d.ts +0 -16
- package/lib/commands/spaces/vpn/wait.js +0 -71
- package/lib/commands/spaces/wait.d.ts +0 -17
- package/lib/commands/spaces/wait.js +0 -91
- package/lib/commands/webhooks/add.d.ts +0 -16
- package/lib/commands/webhooks/add.js +0 -48
- package/lib/commands/webhooks/deliveries/index.d.ts +0 -12
- package/lib/commands/webhooks/deliveries/index.js +0 -80
- package/lib/commands/webhooks/deliveries/info.d.ts +0 -14
- package/lib/commands/webhooks/deliveries/info.js +0 -43
- package/lib/commands/webhooks/events/index.d.ts +0 -11
- package/lib/commands/webhooks/events/index.js +0 -47
- package/lib/commands/webhooks/events/info.d.ts +0 -14
- package/lib/commands/webhooks/events/info.js +0 -32
- package/lib/commands/webhooks/index.d.ts +0 -11
- package/lib/commands/webhooks/index.js +0 -45
- package/lib/commands/webhooks/info.d.ts +0 -14
- package/lib/commands/webhooks/info.js +0 -32
- package/lib/commands/webhooks/remove.d.ts +0 -14
- package/lib/commands/webhooks/remove.js +0 -29
- package/lib/commands/webhooks/update.d.ts +0 -19
- package/lib/commands/webhooks/update.js +0 -41
- package/lib/lib/members/utils.d.ts +0 -2
- package/lib/lib/members/utils.js +0 -14
- /package/lib/lib/local/{run-foreman.d.ts → run-foreman.d.cts} +0 -0
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
export {};
|
|
2
|
+
/*
|
|
3
|
+
import color from '@heroku-cli/color'
|
|
4
|
+
import {APIClient, Command, flags} from '@heroku-cli/command'
|
|
5
|
+
import {Args, ux} from '@oclif/core'
|
|
6
|
+
import * as Heroku from '@heroku-cli/schema'
|
|
7
|
+
import pghost from '../../lib/pg/host'
|
|
8
|
+
import backupsFactory from '../../lib/pg/backups'
|
|
9
|
+
import {getAttachment} from '../../lib/pg/fetcher'
|
|
10
|
+
import {parsePostgresConnectionString} from '../../lib/pg/util'
|
|
11
|
+
import confirmCommand from '../../lib/confirmCommand'
|
|
12
|
+
import {BackupTransfer, CredentialsInfo} from '../../lib/pg/types'
|
|
13
|
+
|
|
14
|
+
const getAttachmentInfo = async function (heroku: APIClient, db: string, app: string) {
|
|
15
|
+
if (db.match(/^postgres:\/\//)) {
|
|
16
|
+
const conn = parsePostgresConnectionString(db)
|
|
17
|
+
const host = `${conn.host}:${conn.port}`
|
|
18
|
+
return {
|
|
19
|
+
name: conn.database ? `database ${conn.database} on ${host}` : `database on ${host}`,
|
|
20
|
+
url: db,
|
|
21
|
+
confirm: conn.database || conn.host,
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const attachment = await getAttachment(heroku, app, db)
|
|
26
|
+
if (!attachment)
|
|
27
|
+
throw new Error(`${db} not found on ${color.magenta(app)}`)
|
|
28
|
+
|
|
29
|
+
const {body: addon} = await heroku.get<Heroku.AddOnAttachment>(`/addons/${attachment.addon.name}`)
|
|
30
|
+
const {body: config} = await heroku.get<Heroku.ConfigVars>(`/apps/${attachment.app.name}/config-vars`)
|
|
31
|
+
const formattedConfig = Object.fromEntries(Object.entries(config).map(([k, v]) => [k.toUpperCase(), v]))
|
|
32
|
+
|
|
33
|
+
return {
|
|
34
|
+
name: attachment.name.replace(/^HEROKU_POSTGRESQL_/, '')
|
|
35
|
+
.replace(/_URL$/, ''),
|
|
36
|
+
url: formattedConfig[attachment.name.toUpperCase() + '_URL'],
|
|
37
|
+
attachment: {
|
|
38
|
+
...attachment,
|
|
39
|
+
addon,
|
|
40
|
+
},
|
|
41
|
+
confirm: app,
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export default class Copy extends Command {
|
|
46
|
+
static topic = 'pg';
|
|
47
|
+
static description = 'copy all data from source db to target';
|
|
48
|
+
static help = 'at least one of the databases must be a Heroku PostgreSQL DB';
|
|
49
|
+
static flags = {
|
|
50
|
+
'wait-interval': flags.string(),
|
|
51
|
+
verbose: flags.boolean(),
|
|
52
|
+
confirm: flags.string(),
|
|
53
|
+
app: flags.app({required: true}),
|
|
54
|
+
remote: flags.remote(),
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
static args = {
|
|
58
|
+
source: Args.string({required: true, description: 'config var exposed to the owning app containing the source database URL'}),
|
|
59
|
+
target: Args.string({required: true, description: 'config var exposed to the owning app containing the target database URL'}),
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
public async run(): Promise<void> {
|
|
63
|
+
const {flags, args} = await this.parse(Copy)
|
|
64
|
+
const {'wait-interval': waitInterval, verbose, confirm, app} = flags
|
|
65
|
+
const pgbackups = backupsFactory(app, this.heroku)
|
|
66
|
+
const interval = Math.max(3, Number.parseInt(waitInterval || '0', 10)) || 3
|
|
67
|
+
|
|
68
|
+
const [source, target] = await Promise.all([getAttachmentInfo(this.heroku, args.source, app), getAttachmentInfo(this.heroku, args.target, app)])
|
|
69
|
+
if (source.url === target.url)
|
|
70
|
+
throw new Error('Cannot copy database onto itself')
|
|
71
|
+
|
|
72
|
+
await confirmCommand(target.confirm || args.target, confirm, `WARNING: Destructive action\nThis command will remove all data from ${color.yellow(target.name)}\nData from ${color.yellow(source.name)} will then be transferred to ${color.yellow(target.name)}`)
|
|
73
|
+
ux.action.start(`Starting copy of ${color.yellow(source.name)} to ${color.yellow(target.name)}`)
|
|
74
|
+
const attachment = target.attachment || source.attachment
|
|
75
|
+
if (!attachment) {
|
|
76
|
+
throw new Error('Heroku PostgreSQL database must be source or target')
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
const {body: copy} = await this.heroku.post<BackupTransfer>(`/client/v11/databases/${attachment.addon.id}/transfers`, {
|
|
80
|
+
body: {
|
|
81
|
+
from_name: source.name, from_url: source.url, to_name: target.name, to_url: target.url,
|
|
82
|
+
},
|
|
83
|
+
hostname: pghost(),
|
|
84
|
+
})
|
|
85
|
+
ux.action.stop()
|
|
86
|
+
|
|
87
|
+
if (source.attachment) {
|
|
88
|
+
const {body: credentials} = await this.heroku.get<CredentialsInfo>(
|
|
89
|
+
`/postgres/v0/databases/${source.attachment.addon.name}/credentials`,
|
|
90
|
+
{
|
|
91
|
+
hostname: pghost(),
|
|
92
|
+
headers: {
|
|
93
|
+
Authorization: `Basic ${Buffer.from(`:${this.heroku.auth}`).toString('base64')}`,
|
|
94
|
+
},
|
|
95
|
+
})
|
|
96
|
+
if (credentials.length > 1) {
|
|
97
|
+
ux.warn('pg:copy will only copy your default credential and the data it has access to. Any additional credentials and data that only they can access will not be copied.')
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
await pgbackups.wait('Copying', copy.uuid, interval, verbose, attachment.addon.app?.name || app)
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
export {};
|
|
2
|
+
/*
|
|
3
|
+
import color from '@heroku-cli/color'
|
|
4
|
+
import {Command, flags} from '@heroku-cli/command'
|
|
5
|
+
import {Args, ux} from '@oclif/core'
|
|
6
|
+
import heredoc from 'tsheredoc'
|
|
7
|
+
import {getAttachment} from '../../../lib/pg/fetcher'
|
|
8
|
+
import host from '../../../lib/pg/host'
|
|
9
|
+
import {essentialPlan} from '../../../lib/pg/util'
|
|
10
|
+
import {nls} from '../../../nls'
|
|
11
|
+
|
|
12
|
+
export default class Create extends Command {
|
|
13
|
+
static topic = 'pg'
|
|
14
|
+
static description = 'create credential within database\nExample:\n\n heroku pg:credentials:create postgresql-something-12345 --name new-cred-name\n'
|
|
15
|
+
static flags = {
|
|
16
|
+
name: flags.string({char: 'n', required: true, description: 'name of the new credential within the database'}),
|
|
17
|
+
app: flags.app({required: true}),
|
|
18
|
+
remote: flags.remote(),
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
static args = {
|
|
22
|
+
database: Args.string({description: `${nls('pg:database:arg:description')} ${nls('pg:database:arg:description:default:suffix')}`}),
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
public async run(): Promise<void> {
|
|
26
|
+
const {flags, args} = await this.parse(Create)
|
|
27
|
+
const {app, name} = flags
|
|
28
|
+
const {addon: db} = await getAttachment(this.heroku, app as string, args.database)
|
|
29
|
+
if (essentialPlan(db)) {
|
|
30
|
+
throw new Error("You can't create a custom credential on Essential-tier databases.")
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const data = {name}
|
|
34
|
+
ux.action.start(`Creating credential ${color.cyan.bold(name)}`)
|
|
35
|
+
|
|
36
|
+
await this.heroku.post(`/postgres/v0/databases/${db.name}/credentials`, {hostname: host(), body: data})
|
|
37
|
+
ux.action.stop()
|
|
38
|
+
|
|
39
|
+
const attachCmd = `heroku addons:attach ${db.name} --credential ${name} -a ${app}`
|
|
40
|
+
const psqlCmd = `heroku pg:psql ${db.name} -a ${app}`
|
|
41
|
+
ux.log(heredoc(`
|
|
42
|
+
|
|
43
|
+
Please attach the credential to the apps you want to use it in by running ${color.cyan.bold(attachCmd)}.
|
|
44
|
+
Please define the new grants for the credential within Postgres: ${color.cyan.bold(psqlCmd)}.`))
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
export {};
|
|
2
|
+
/*
|
|
3
|
+
import color from '@heroku-cli/color'
|
|
4
|
+
import {Command, flags} from '@heroku-cli/command'
|
|
5
|
+
import {Args, ux} from '@oclif/core'
|
|
6
|
+
import * as Heroku from '@heroku-cli/schema'
|
|
7
|
+
import {essentialPlan} from '../../../lib/pg/util'
|
|
8
|
+
import {getAddon} from '../../../lib/pg/fetcher'
|
|
9
|
+
import pgHost from '../../../lib/pg/host'
|
|
10
|
+
import confirmCommand from '../../../lib/confirmCommand'
|
|
11
|
+
import {nls} from '../../../nls'
|
|
12
|
+
|
|
13
|
+
export default class Destroy extends Command {
|
|
14
|
+
static topic = 'pg';
|
|
15
|
+
static description = 'destroy credential within database';
|
|
16
|
+
static example = '$ heroku pg:credentials:destroy postgresql-transparent-56874 --name cred-name -a woodstock-production';
|
|
17
|
+
static flags = {
|
|
18
|
+
name: flags.string({char: 'n', required: true, description: 'unique identifier for the credential'}),
|
|
19
|
+
confirm: flags.string({char: 'c'}),
|
|
20
|
+
app: flags.app({required: true}),
|
|
21
|
+
remote: flags.remote(),
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
static args = {
|
|
25
|
+
database: Args.string({description: `${nls('pg:database:arg:description')} ${nls('pg:database:arg:description:default:suffix')}`}),
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
public async run(): Promise<void> {
|
|
29
|
+
const {flags, args} = await this.parse(Destroy)
|
|
30
|
+
const {database} = args
|
|
31
|
+
const {app, name, confirm} = flags
|
|
32
|
+
if (name === 'default') {
|
|
33
|
+
throw new Error('Default credential cannot be destroyed.')
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const db = await getAddon(this.heroku, app, database)
|
|
37
|
+
if (essentialPlan(db)) {
|
|
38
|
+
throw new Error("You can't destroy the default credential on Essential-tier databases.")
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const {body: attachments} = await this.heroku.get<Heroku.AddOnAttachment[]>(`/addons/${db.name}/addon-attachments`)
|
|
42
|
+
const credAttachments = attachments.filter(a => a.namespace === `credential:${name}`)
|
|
43
|
+
const credAttachmentApps = Array.from(new Set(credAttachments.map(a => a.app?.name)))
|
|
44
|
+
if (credAttachmentApps.length > 0)
|
|
45
|
+
throw new Error(`Credential ${name} must be detached from the app${credAttachmentApps.length > 1 ? 's' : ''} ${credAttachmentApps.map(appName => color.app(appName || ''))
|
|
46
|
+
.join(', ')} before destroying.`)
|
|
47
|
+
|
|
48
|
+
await confirmCommand(app, confirm)
|
|
49
|
+
ux.action.start(`Destroying credential ${color.cyan.bold(name)}`)
|
|
50
|
+
await this.heroku.delete(`/postgres/v0/databases/${db.name}/credentials/${encodeURIComponent(name)}`, {hostname: pgHost()})
|
|
51
|
+
ux.action.stop()
|
|
52
|
+
ux.log(`The credential has been destroyed within ${db.name}.`)
|
|
53
|
+
ux.log(`Database objects owned by ${name} will be assigned to the default credential.`)
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export {};
|
|
2
|
+
/*
|
|
3
|
+
import {Command, flags} from '@heroku-cli/command'
|
|
4
|
+
import {Args, ux} from '@oclif/core'
|
|
5
|
+
import {getAddon} from '../../../lib/pg/fetcher'
|
|
6
|
+
import {essentialPlan} from '../../../lib/pg/util'
|
|
7
|
+
import confirmCommand from '../../../lib/confirmCommand'
|
|
8
|
+
import heredoc from 'tsheredoc'
|
|
9
|
+
import pgHost from '../../../lib/pg/host'
|
|
10
|
+
import {nls} from '../../../nls'
|
|
11
|
+
|
|
12
|
+
export default class RepairDefault extends Command {
|
|
13
|
+
static topic = 'pg';
|
|
14
|
+
static description = 'repair the permissions of the default credential within database';
|
|
15
|
+
static example = '$ heroku pg:credentials:repair-default postgresql-something-12345';
|
|
16
|
+
static flags = {
|
|
17
|
+
confirm: flags.string({char: 'c'}),
|
|
18
|
+
app: flags.app({required: true}),
|
|
19
|
+
remote: flags.remote(),
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
static args = {
|
|
23
|
+
database: Args.string({description: `${nls('pg:database:arg:description')} ${nls('pg:database:arg:description:default:suffix')}`}),
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
public async run(): Promise<void> {
|
|
27
|
+
const {flags, args} = await this.parse(RepairDefault)
|
|
28
|
+
const {app, confirm} = flags
|
|
29
|
+
const {database} = args
|
|
30
|
+
const db = await getAddon(this.heroku, app, database)
|
|
31
|
+
if (essentialPlan(db))
|
|
32
|
+
throw new Error("You can't perform this operation on Essential-tier databases.")
|
|
33
|
+
await confirmCommand(app, confirm, heredoc(`
|
|
34
|
+
Destructive Action
|
|
35
|
+
Ownership of all database objects owned by additional credentials will be transferred to the default credential.
|
|
36
|
+
This command will also grant the default credential admin option for all additional credentials.
|
|
37
|
+
`))
|
|
38
|
+
ux.action.start('Resetting permissions and object ownership for default role to factory settings')
|
|
39
|
+
await this.heroku.post(`/postgres/v0/databases/${db.name}/repair-default`, {hostname: pgHost()})
|
|
40
|
+
ux.action.stop()
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
export {};
|
|
2
|
+
/*
|
|
3
|
+
import color from '@heroku-cli/color'
|
|
4
|
+
import {Command, flags} from '@heroku-cli/command'
|
|
5
|
+
import {APIClient} from '@heroku-cli/command/lib/api-client'
|
|
6
|
+
import type {AddOnAttachment} from '@heroku-cli/schema'
|
|
7
|
+
import {Args, ux} from '@oclif/core'
|
|
8
|
+
import confirmCommand from '../../../lib/confirmCommand'
|
|
9
|
+
import {getAttachment} from '../../../lib/pg/fetcher'
|
|
10
|
+
import host from '../../../lib/pg/host'
|
|
11
|
+
import {legacyEssentialPlan} from '../../../lib/pg/util'
|
|
12
|
+
import {nls} from '../../../nls'
|
|
13
|
+
|
|
14
|
+
export default class Rotate extends Command {
|
|
15
|
+
static topic = 'pg'
|
|
16
|
+
static description = 'rotate the database credentials'
|
|
17
|
+
static flags = {
|
|
18
|
+
name: flags.string({
|
|
19
|
+
char: 'n',
|
|
20
|
+
description: 'which credential to rotate (default credentials if not specified and --all is not used)',
|
|
21
|
+
}),
|
|
22
|
+
all: flags.boolean({description: 'rotate all credentials', exclusive: ['name']}),
|
|
23
|
+
confirm: flags.string({char: 'c'}),
|
|
24
|
+
force: flags.boolean({description: 'forces rotating the targeted credentials'}),
|
|
25
|
+
app: flags.app({required: true}),
|
|
26
|
+
remote: flags.remote(),
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
static args = {
|
|
30
|
+
database: Args.string({description: `${nls('pg:database:arg:description')} ${nls('pg:database:arg:description:default:suffix')}`}),
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
public async run(): Promise<void> {
|
|
34
|
+
const {flags, args} = await this.parse(Rotate)
|
|
35
|
+
const {app, all, confirm, name, force} = flags
|
|
36
|
+
const {addon: db} = await getAttachment(this.heroku, app, args.database)
|
|
37
|
+
const warnings: string[] = []
|
|
38
|
+
const cred = name || 'default'
|
|
39
|
+
if (all && name !== undefined) {
|
|
40
|
+
throw new Error('cannot pass both --all and --name')
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
if (legacyEssentialPlan(db) && cred !== 'default') {
|
|
44
|
+
throw new Error('Legacy Essential-tier databases do not support named credentials.')
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
if (all && force) {
|
|
48
|
+
warnings.push('This forces rotation on all credentials including the default credential.')
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
let {body: attachments} = await this.heroku.get<Required<AddOnAttachment>[]>(`/addons/${db.name}/addon-attachments`)
|
|
52
|
+
if (name) {
|
|
53
|
+
attachments = attachments.filter(a => a.namespace === `credential:${cred}`)
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
if (!all) {
|
|
57
|
+
warnings.push(`The password for the ${cred} credential will rotate.`)
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
if (all || force || cred === 'default') {
|
|
61
|
+
warnings.push('Connections will be reset and applications will be restarted.')
|
|
62
|
+
} else {
|
|
63
|
+
warnings.push('Connections older than 30 minutes will be reset, and a temporary rotation username will be used during the process.')
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
if (force) {
|
|
67
|
+
warnings.push(`Any followers lagging in replication (see ${color.cyan.bold('heroku pg:info')}) will be inaccessible until caught up.`)
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
if (attachments.length > 0) {
|
|
71
|
+
const uniqueAttachments = [...new Set(attachments.map(attachment => color.app(attachment.app.name || '')))]
|
|
72
|
+
.sort()
|
|
73
|
+
.join(', ')
|
|
74
|
+
|
|
75
|
+
warnings.push(`This command will affect the app${(attachments.length > 1) ? 's' : ''} ${uniqueAttachments}.`)
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
await confirmCommand(app, confirm, `Destructive Action\n${warnings.join('\n')}`)
|
|
79
|
+
const options: APIClient.Options = {
|
|
80
|
+
hostname: host(),
|
|
81
|
+
body: {forced: force ?? undefined},
|
|
82
|
+
headers: {
|
|
83
|
+
Authorization: `Basic ${Buffer.from(`:${this.heroku.auth}`).toString('base64')}`,
|
|
84
|
+
},
|
|
85
|
+
}
|
|
86
|
+
if (all) {
|
|
87
|
+
ux.action.start(`Rotating all credentials on ${color.yellow(db.name)}`)
|
|
88
|
+
await this.heroku.post(`/postgres/v0/databases/${db.name}/credentials_rotation`, options)
|
|
89
|
+
} else {
|
|
90
|
+
ux.action.start(`Rotating ${cred} on ${color.yellow(db.name)}`)
|
|
91
|
+
await this.heroku.post(`/postgres/v0/databases/${db.name}/credentials/${encodeURIComponent(cred)}/credentials_rotation`, options)
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
ux.action.stop()
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
export {};
|
|
2
|
+
/*
|
|
3
|
+
import color from '@heroku-cli/color'
|
|
4
|
+
import {Command, flags} from '@heroku-cli/command'
|
|
5
|
+
import {Args, ux} from '@oclif/core'
|
|
6
|
+
import {legacyEssentialPlan} from '../../../lib/pg/util'
|
|
7
|
+
import {getAddon} from '../../../lib/pg/fetcher'
|
|
8
|
+
import pgHost from '../../../lib/pg/host'
|
|
9
|
+
import {URL} from 'url'
|
|
10
|
+
import type {CredentialInfo} from '../../../lib/pg/types'
|
|
11
|
+
import heredoc from 'tsheredoc'
|
|
12
|
+
import {nls} from '../../../nls'
|
|
13
|
+
|
|
14
|
+
export default class Url extends Command {
|
|
15
|
+
static topic = 'pg'
|
|
16
|
+
static description = 'show information on a database credential'
|
|
17
|
+
static flags = {
|
|
18
|
+
name: flags.string({
|
|
19
|
+
char: 'n',
|
|
20
|
+
description: 'which credential to show (default credentials if not specified)',
|
|
21
|
+
default: 'default',
|
|
22
|
+
}),
|
|
23
|
+
app: flags.app({required: true}),
|
|
24
|
+
remote: flags.remote(),
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
static args = {
|
|
28
|
+
database: Args.string({description: `${nls('pg:database:arg:description')} ${nls('pg:database:arg:description:default:suffix')}`}),
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
public async run(): Promise<void> {
|
|
32
|
+
const {flags, args} = await this.parse(Url)
|
|
33
|
+
const {app, name} = flags
|
|
34
|
+
const {database} = args
|
|
35
|
+
const db = await getAddon(this.heroku, app, database)
|
|
36
|
+
if (legacyEssentialPlan(db) && name !== 'default') {
|
|
37
|
+
ux.error('Legacy Essential-tier databases do not support named credentials.')
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const {body: credInfo} = await this.heroku.get<CredentialInfo>(
|
|
41
|
+
`/postgres/v0/databases/${db.name}/credentials/${encodeURIComponent(name)}`,
|
|
42
|
+
{
|
|
43
|
+
hostname: pgHost(),
|
|
44
|
+
headers: {
|
|
45
|
+
Authorization: `Basic ${Buffer.from(`:${this.heroku.auth}`).toString('base64')}`,
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
)
|
|
49
|
+
const activeCreds = credInfo.credentials.find(c => c.state === 'active')
|
|
50
|
+
if (!activeCreds) {
|
|
51
|
+
ux.error(`Could not find any active credentials for ${name}`, {exit: 1})
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
const creds = Object.assign({}, db, {
|
|
55
|
+
database: credInfo.database, host: credInfo.host, port: credInfo.port,
|
|
56
|
+
}, {
|
|
57
|
+
user: activeCreds?.user, password: activeCreds?.password,
|
|
58
|
+
})
|
|
59
|
+
const connUrl = new URL(`postgres://${creds.host}/${creds.database}`)
|
|
60
|
+
connUrl.port = creds.port.toString()
|
|
61
|
+
if (creds.user && creds.password) {
|
|
62
|
+
connUrl.username = creds.user
|
|
63
|
+
connUrl.password = creds.password
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
ux.log(heredoc(`
|
|
67
|
+
Connection information for ${color.yellow(name)} credential.
|
|
68
|
+
Connection info string:
|
|
69
|
+
"dbname=${creds.database} host=${creds.host} port=${creds.port} user=${creds.user} password=${creds.password} sslmode=require"
|
|
70
|
+
Connection URL:
|
|
71
|
+
${connUrl}
|
|
72
|
+
`))
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
export {};
|
|
2
|
+
/*
|
|
3
|
+
import {Command, flags} from '@heroku-cli/command'
|
|
4
|
+
import {Args} from '@oclif/core'
|
|
5
|
+
import {hux} from '@heroku/heroku-cli-util'
|
|
6
|
+
import * as Heroku from '@heroku-cli/schema'
|
|
7
|
+
import pghost from '../../lib/pg/host'
|
|
8
|
+
import {getAddon} from '../../lib/pg/fetcher'
|
|
9
|
+
import {CredentialInfo, CredentialsInfo} from '../../lib/pg/types'
|
|
10
|
+
import {presentCredentialAttachments} from '../../lib/pg/util'
|
|
11
|
+
import {nls} from '../../nls'
|
|
12
|
+
|
|
13
|
+
export default class Credentials extends Command {
|
|
14
|
+
static topic = 'pg'
|
|
15
|
+
static description = 'show information on credentials in the database'
|
|
16
|
+
static flags = {
|
|
17
|
+
app: flags.app({required: true}),
|
|
18
|
+
remote: flags.remote(),
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
static args = {
|
|
22
|
+
database: Args.string({description: `${nls('pg:database:arg:description')} ${nls('pg:database:arg:description:default:suffix')}`}),
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
public async run(): Promise<void> {
|
|
26
|
+
const {flags, args} = await this.parse(Credentials)
|
|
27
|
+
const {app} = flags
|
|
28
|
+
const {database} = args
|
|
29
|
+
const addon = await getAddon(this.heroku, app, database)
|
|
30
|
+
|
|
31
|
+
const {body: credentials} = await this.heroku.get<CredentialsInfo>(
|
|
32
|
+
`/postgres/v0/databases/${addon.id}/credentials`,
|
|
33
|
+
{
|
|
34
|
+
hostname: pghost(),
|
|
35
|
+
headers: {
|
|
36
|
+
Authorization: `Basic ${Buffer.from(`:${this.heroku.auth}`).toString('base64')}`,
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
)
|
|
40
|
+
const sortedCredentials = this.sortByDefaultAndName(credentials)
|
|
41
|
+
const {body: attachments} = await this.heroku.get<Required<Heroku.AddOnAttachment>[]>(`/addons/${addon.id}/addon-attachments`)
|
|
42
|
+
|
|
43
|
+
const presentCredential = (cred: CredentialInfo): string => {
|
|
44
|
+
let credAttachments = [] as Required<Heroku.AddOnAttachment>[]
|
|
45
|
+
if (cred.name === 'default') {
|
|
46
|
+
credAttachments = attachments.filter(a => a.namespace === null)
|
|
47
|
+
} else {
|
|
48
|
+
credAttachments = attachments.filter(a => a.namespace === `credential:${cred.name}`)
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
return presentCredentialAttachments(app, credAttachments, sortedCredentials, cred.name)
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
hux.table(credentials, {
|
|
55
|
+
Credential: {
|
|
56
|
+
get: presentCredential,
|
|
57
|
+
},
|
|
58
|
+
State: {
|
|
59
|
+
get: cred => cred.state,
|
|
60
|
+
},
|
|
61
|
+
})
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
protected sortByDefaultAndName(credentials: CredentialsInfo) {
|
|
65
|
+
return credentials.sort((a, b) => {
|
|
66
|
+
const isDefaultA = this.isDefaultCredential(a)
|
|
67
|
+
const isDefaultB = this.isDefaultCredential(b)
|
|
68
|
+
|
|
69
|
+
return isDefaultB < isDefaultA ? -1 : (isDefaultA < isDefaultB ? 1 : a.name.localeCompare(b.name))
|
|
70
|
+
})
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
protected isDefaultCredential(cred: CredentialInfo): boolean {
|
|
74
|
+
return cred.name === 'default'
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
export {};
|
|
2
|
+
/*
|
|
3
|
+
import {Command, flags} from '@heroku-cli/command'
|
|
4
|
+
import {Args, ux} from '@oclif/core'
|
|
5
|
+
import {hux} from '@heroku/heroku-cli-util'
|
|
6
|
+
import {table} from '@oclif/core/lib/cli-ux/styled/table'
|
|
7
|
+
import {capitalize} from '@oclif/core/lib/util'
|
|
8
|
+
import heredoc from 'tsheredoc'
|
|
9
|
+
import {getAttachment} from '../../lib/pg/fetcher'
|
|
10
|
+
import host from '../../lib/pg/host'
|
|
11
|
+
import type {
|
|
12
|
+
AddOnAttachmentWithConfigVarsAndPlan,
|
|
13
|
+
PGDiagnoseCheck, PGDiagnoseRequest,
|
|
14
|
+
PGDiagnoseResponse,
|
|
15
|
+
PGDiagnoseResult,
|
|
16
|
+
} from '../../lib/pg/types'
|
|
17
|
+
import {
|
|
18
|
+
essentialPlan,
|
|
19
|
+
getConfigVarNameFromAttachment,
|
|
20
|
+
getConnectionDetails,
|
|
21
|
+
} from '../../lib/pg/util'
|
|
22
|
+
import color from '@heroku-cli/color'
|
|
23
|
+
import {uuidValidate} from '../../lib/utils/uuid-validate'
|
|
24
|
+
|
|
25
|
+
const PGDIAGNOSE_HOST = process.env.PGDIAGNOSE_URL || 'pgdiagnose.herokai.com'
|
|
26
|
+
|
|
27
|
+
export default class Diagnose extends Command {
|
|
28
|
+
static topic = 'pg'
|
|
29
|
+
static description = heredoc(`
|
|
30
|
+
run or view diagnostics report
|
|
31
|
+
defaults to DATABASE_URL database if no DATABASE is specified
|
|
32
|
+
if REPORT_ID is specified instead, a previous report is displayed
|
|
33
|
+
|
|
34
|
+
`)
|
|
35
|
+
|
|
36
|
+
static flags = {
|
|
37
|
+
json: flags.boolean({description: 'format output as JSON'}),
|
|
38
|
+
app: flags.app({required: true}),
|
|
39
|
+
remote: flags.remote(),
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
static args = {
|
|
43
|
+
'DATABASE|REPORT_ID': Args.string({description: 'config var exposed to the owning app containing the database URL or the report ID'}),
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
public async run(): Promise<void> {
|
|
47
|
+
const {flags, args} = await this.parse(Diagnose)
|
|
48
|
+
|
|
49
|
+
const id = args['DATABASE|REPORT_ID']
|
|
50
|
+
let report: PGDiagnoseResponse
|
|
51
|
+
if (id && uuidValidate(id)) {
|
|
52
|
+
({body: report} = await this.heroku.get<PGDiagnoseResponse>(`/reports/${encodeURIComponent(id)}`, {hostname: PGDIAGNOSE_HOST}))
|
|
53
|
+
} else {
|
|
54
|
+
report = await this.generateReport(id, flags.app)
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
this.displayReport(report, flags.json)
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
private displayReport(report: PGDiagnoseResponse, json: boolean) {
|
|
61
|
+
if (json) {
|
|
62
|
+
hux.styledJSON(report)
|
|
63
|
+
return
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
ux.log(`Report ${report.id} for ${report.app}::${report.database}\navailable for one month after creation on ${report.created_at}\n`)
|
|
67
|
+
|
|
68
|
+
this.display(report.checks.filter(c => c.status === 'red'))
|
|
69
|
+
this.display(report.checks.filter(c => c.status === 'yellow'))
|
|
70
|
+
this.display(report.checks.filter(c => c.status === 'green'))
|
|
71
|
+
this.display(report.checks.filter(c => !['red', 'yellow', 'green'].includes(c.status)))
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
private display(checks: PGDiagnoseCheck[]) {
|
|
75
|
+
checks.forEach(check => {
|
|
76
|
+
const colorFn = color[check.status] || ((txt: string) => txt)
|
|
77
|
+
ux.log(colorFn(`${check.status.toUpperCase()}: ${check.name}`))
|
|
78
|
+
const isNonEmptyArray = Array.isArray(check.results) && check.results.length > 0
|
|
79
|
+
const resultsKeys = Object.keys(check.results ?? {})
|
|
80
|
+
if (check.status === 'green' || (!isNonEmptyArray && resultsKeys.length === 0)) {
|
|
81
|
+
return
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
if (isNonEmptyArray) {
|
|
85
|
+
const keys = Object.keys(check.results[0]) as (keyof PGDiagnoseResult)[]
|
|
86
|
+
const cols = {} as Record<string, Partial<table.Column<PGDiagnoseResult>>>
|
|
87
|
+
keys.forEach(key => {
|
|
88
|
+
cols[capitalize(key)] = {
|
|
89
|
+
get: (row: PGDiagnoseResult): string => row[key],
|
|
90
|
+
}
|
|
91
|
+
})
|
|
92
|
+
hux.table(check.results, cols)
|
|
93
|
+
} else {
|
|
94
|
+
const [key] = resultsKeys
|
|
95
|
+
ux.log(`${key.split('_')
|
|
96
|
+
.map(s => capitalize(s))
|
|
97
|
+
.join(' ')} ${check.results[key as keyof PGDiagnoseResult]}`)
|
|
98
|
+
}
|
|
99
|
+
})
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
private async generateParams(url: string, db: AddOnAttachmentWithConfigVarsAndPlan, dbName: string): Promise<PGDiagnoseRequest> {
|
|
103
|
+
const base_params: PGDiagnoseRequest = {
|
|
104
|
+
url,
|
|
105
|
+
plan: db.plan.name.split(':')[1],
|
|
106
|
+
app: db.app.name as string,
|
|
107
|
+
database: dbName,
|
|
108
|
+
}
|
|
109
|
+
if (!essentialPlan(db)) {
|
|
110
|
+
const {body: metrics} = await this.heroku.get<unknown[]>(`/client/v11/databases/${db.id}/metrics`, {hostname: host()})
|
|
111
|
+
base_params.metrics = metrics
|
|
112
|
+
const {body: burstData} = await this.heroku.get<{
|
|
113
|
+
burst_status: string
|
|
114
|
+
}>(`/client/v11/databases/${db.id}/burst_status`, {hostname: host()})
|
|
115
|
+
if (burstData && Object.keys(burstData).length > 0) {
|
|
116
|
+
base_params.burst_data_present = true
|
|
117
|
+
base_params.burst_status = burstData.burst_status
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
return base_params
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
private async generateReport(database: string | undefined, app: string) {
|
|
125
|
+
const attachment = await getAttachment(this.heroku, app, database)
|
|
126
|
+
const {addon: db} = attachment
|
|
127
|
+
const {body: config} = await this.heroku.get<Record<string, string>>(`/apps/${app}/config-vars`)
|
|
128
|
+
const {url} = getConnectionDetails(attachment, config)
|
|
129
|
+
const dbName = getConfigVarNameFromAttachment(attachment, config)
|
|
130
|
+
const body = await this.generateParams(url, db, dbName)
|
|
131
|
+
const {body: report} = await this.heroku.post<PGDiagnoseResponse>('/reports', {hostname: PGDIAGNOSE_HOST, body})
|
|
132
|
+
|
|
133
|
+
return report
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|