heroku 11.0.2-alpha.0 → 11.0.2
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 +15 -1
- package/bin/run.cmd +1 -1
- package/bin/run.js +69 -0
- package/dist/commands/access/add.js +1 -1
- package/dist/commands/access/index.js +44 -44
- package/dist/commands/access/remove.js +2 -2
- package/dist/commands/access/update.js +1 -1
- package/dist/commands/accounts/add.js +1 -1
- package/dist/commands/accounts/current.js +2 -2
- package/dist/commands/accounts/index.js +2 -2
- package/dist/commands/accounts/remove.js +1 -1
- package/dist/commands/accounts/set.js +1 -1
- package/dist/commands/addons/attach.js +1 -1
- package/dist/commands/addons/create.js +33 -33
- package/dist/commands/addons/detach.js +1 -1
- package/dist/commands/addons/docs.js +1 -1
- package/dist/commands/addons/index.js +1 -1
- package/dist/commands/addons/open.d.ts +14 -14
- package/dist/commands/addons/open.js +2 -2
- package/dist/commands/addons/rename.js +1 -1
- package/dist/commands/addons/services.js +2 -2
- package/dist/commands/addons/upgrade.js +1 -1
- package/dist/commands/addons/wait.js +2 -2
- package/dist/commands/apps/destroy.js +1 -1
- package/dist/commands/apps/errors.js +2 -2
- package/dist/commands/apps/favorites/add.js +2 -2
- package/dist/commands/apps/favorites/index.js +2 -2
- package/dist/commands/apps/favorites/remove.js +2 -2
- package/dist/commands/apps/index.js +59 -59
- package/dist/commands/apps/join.js +2 -2
- package/dist/commands/apps/leave.js +2 -2
- package/dist/commands/apps/lock.js +2 -2
- package/dist/commands/apps/open.js +1 -1
- package/dist/commands/apps/rename.js +1 -1
- package/dist/commands/apps/stacks/index.js +8 -8
- package/dist/commands/apps/stacks/set.js +4 -4
- package/dist/commands/apps/transfer.js +1 -1
- package/dist/commands/apps/unlock.js +2 -2
- package/dist/commands/auth/2fa/disable.js +2 -2
- package/dist/commands/auth/2fa/index.js +2 -2
- package/dist/commands/auth/login.js +1 -1
- package/dist/commands/auth/logout.js +1 -1
- package/dist/commands/auth/token.js +2 -2
- package/dist/commands/authorizations/create.d.ts +2 -2
- package/dist/commands/authorizations/create.js +6 -6
- package/dist/commands/authorizations/index.js +2 -2
- package/dist/commands/authorizations/revoke.js +1 -1
- package/dist/commands/autocomplete/index.js +1 -1
- package/dist/commands/buildpacks/remove.js +1 -1
- package/dist/commands/buildpacks/versions.js +1 -1
- package/dist/commands/certs/auto/disable.js +2 -2
- package/dist/commands/certs/auto/enable.js +2 -2
- package/dist/commands/certs/auto/index.js +1 -1
- package/dist/commands/certs/auto/refresh.d.ts +1 -1
- package/dist/commands/certs/auto/refresh.js +2 -2
- package/dist/commands/certs/index.js +2 -2
- package/dist/commands/certs/info.js +2 -2
- package/dist/commands/certs/remove.js +2 -2
- package/dist/commands/certs/update.js +1 -1
- package/dist/commands/ci/config/get.js +1 -1
- package/dist/commands/ci/config/index.js +2 -2
- package/dist/commands/ci/config/set.js +8 -8
- package/dist/commands/ci/config/unset.js +2 -2
- package/dist/commands/ci/debug.js +1 -1
- package/dist/commands/ci/index.js +1 -1
- package/dist/commands/ci/info.d.ts +4 -4
- package/dist/commands/ci/info.js +5 -5
- package/dist/commands/ci/last.js +2 -2
- package/dist/commands/ci/migrate-manifest.js +2 -2
- package/dist/commands/ci/open.js +1 -1
- package/dist/commands/ci/rerun.js +3 -2
- package/dist/commands/ci/run.js +2 -2
- package/dist/commands/clients/create.d.ts +4 -4
- package/dist/commands/clients/create.js +7 -7
- package/dist/commands/clients/destroy.js +1 -1
- package/dist/commands/clients/index.js +2 -2
- package/dist/commands/clients/update.js +1 -1
- package/dist/commands/config/get.js +1 -1
- package/dist/commands/config/index.js +2 -2
- package/dist/commands/config/set.js +2 -2
- package/dist/commands/config/unset.js +2 -2
- package/dist/commands/container/login.js +1 -1
- package/dist/commands/container/logout.js +1 -1
- package/dist/commands/container/push.js +2 -2
- package/dist/commands/container/release.js +2 -2
- package/dist/commands/container/rm.js +2 -2
- package/dist/commands/container/run.js +2 -2
- package/dist/commands/dashboard.js +1 -1
- package/dist/commands/data/maintenances/index.js +4 -2
- package/dist/commands/data/pg/create.js +1 -1
- package/dist/commands/data/pg/credentials/destroy.js +13 -7
- package/dist/commands/domains/clear.js +2 -2
- package/dist/commands/domains/index.js +1 -1
- package/dist/commands/domains/info.d.ts +3 -3
- package/dist/commands/domains/info.js +5 -5
- package/dist/commands/domains/remove.js +1 -1
- package/dist/commands/domains/update.js +1 -1
- package/dist/commands/drains/add.js +1 -1
- package/dist/commands/drains/index.js +8 -8
- package/dist/commands/drains/remove.js +1 -1
- package/dist/commands/features/disable.js +1 -1
- package/dist/commands/features/enable.js +1 -1
- package/dist/commands/features/index.js +1 -1
- package/dist/commands/git/clone.js +1 -1
- package/dist/commands/git/remote.js +1 -1
- package/dist/commands/keys/clear.js +1 -1
- package/dist/commands/keys/index.js +6 -6
- package/dist/commands/keys/remove.js +1 -1
- package/dist/commands/labs/enable.js +6 -6
- package/dist/commands/labs/index.js +16 -16
- package/dist/commands/local/index.js +1 -1
- package/dist/commands/local/run.js +1 -1
- package/dist/commands/logs.js +2 -2
- package/dist/commands/maintenance/index.d.ts +1 -1
- package/dist/commands/maintenance/index.js +2 -2
- package/dist/commands/maintenance/off.js +2 -2
- package/dist/commands/maintenance/on.js +2 -2
- package/dist/commands/members/index.js +2 -2
- package/dist/commands/members/remove.js +2 -2
- package/dist/commands/notifications/index.js +1 -1
- package/dist/commands/orgs/open.d.ts +1 -1
- package/dist/commands/orgs/open.js +3 -3
- package/dist/commands/pg/backups/index.js +4 -2
- package/dist/commands/pg/backups/schedules.js +2 -2
- package/dist/commands/pipelines/add.js +1 -1
- package/dist/commands/pipelines/connect.d.ts +3 -3
- package/dist/commands/pipelines/connect.js +8 -8
- package/dist/commands/pipelines/create.js +1 -1
- package/dist/commands/pipelines/destroy.js +1 -1
- package/dist/commands/pipelines/diff.js +53 -51
- package/dist/commands/pipelines/index.js +2 -2
- package/dist/commands/pipelines/open.js +1 -1
- package/dist/commands/pipelines/promote.js +105 -105
- package/dist/commands/pipelines/remove.js +2 -2
- package/dist/commands/pipelines/rename.js +1 -1
- package/dist/commands/pipelines/setup.js +1 -1
- package/dist/commands/pipelines/update.js +2 -2
- package/dist/commands/ps/autoscale/disable.d.ts +1 -1
- package/dist/commands/ps/autoscale/disable.js +4 -4
- package/dist/commands/ps/autoscale/enable.d.ts +4 -4
- package/dist/commands/ps/autoscale/enable.js +16 -14
- package/dist/commands/ps/copy.js +1 -1
- package/dist/commands/ps/exec.js +2 -2
- package/dist/commands/ps/forward.js +2 -2
- package/dist/commands/ps/index.js +1 -1
- package/dist/commands/ps/restart.js +1 -1
- package/dist/commands/ps/scale.js +3 -3
- package/dist/commands/ps/socks.js +1 -1
- package/dist/commands/ps/stop.js +1 -1
- package/dist/commands/ps/type.js +22 -22
- package/dist/commands/ps/wait.js +2 -2
- package/dist/commands/rake.d.ts +5 -5
- package/dist/commands/rake.js +11 -11
- package/dist/commands/redis/stats-reset.js +1 -1
- package/dist/commands/redis/upgrade.js +1 -1
- package/dist/commands/redis/wait.js +1 -1
- package/dist/commands/releases/index.js +3 -3
- package/dist/commands/releases/retry.js +2 -2
- package/dist/commands/releases/rollback.js +1 -1
- package/dist/commands/repl.js +1 -1
- package/dist/commands/reviewapps/disable.js +2 -2
- package/dist/commands/reviewapps/enable.js +2 -2
- package/dist/commands/run/detached.js +2 -2
- package/dist/commands/run/index.js +2 -2
- package/dist/commands/run/inside.js +1 -1
- package/dist/commands/sessions/destroy.js +1 -1
- package/dist/commands/sessions/index.js +2 -2
- package/dist/commands/spaces/destroy.js +1 -1
- package/dist/commands/spaces/drains/get.js +2 -2
- package/dist/commands/spaces/drains/set.js +1 -1
- package/dist/commands/spaces/index.js +4 -3
- package/dist/commands/spaces/info.js +1 -1
- package/dist/commands/spaces/peerings/accept.js +1 -1
- package/dist/commands/spaces/peerings/destroy.js +1 -1
- package/dist/commands/spaces/peerings/info.js +1 -1
- package/dist/commands/spaces/rename.js +2 -2
- package/dist/commands/spaces/transfer.js +2 -2
- package/dist/commands/spaces/trusted-ips/add.js +1 -1
- package/dist/commands/spaces/trusted-ips/remove.js +1 -1
- package/dist/commands/spaces/vpn/connect.js +1 -1
- package/dist/commands/spaces/vpn/connections.js +1 -1
- package/dist/commands/spaces/vpn/destroy.js +1 -1
- package/dist/commands/spaces/vpn/update.js +1 -1
- package/dist/commands/spaces/vpn/wait.d.ts +6 -6
- package/dist/commands/spaces/vpn/wait.js +14 -14
- package/dist/commands/spaces/wait.js +1 -1
- package/dist/commands/telemetry/add.js +2 -2
- package/dist/commands/telemetry/index.js +2 -2
- package/dist/commands/telemetry/info.js +1 -1
- package/dist/commands/telemetry/update.js +1 -1
- package/dist/commands/usage/addons.js +3 -3
- package/dist/commands/version/info.js +1 -1
- package/dist/commands/webhooks/add.d.ts +3 -3
- package/dist/commands/webhooks/add.js +6 -6
- package/dist/commands/webhooks/events/index.js +3 -2
- package/dist/commands/webhooks/index.d.ts +1 -1
- package/dist/commands/webhooks/index.js +6 -4
- package/dist/commands/webhooks/remove.d.ts +4 -4
- package/dist/commands/webhooks/remove.js +7 -7
- package/dist/commands/webhooks/update.d.ts +6 -6
- package/dist/commands/webhooks/update.js +9 -9
- package/dist/global_telemetry.d.ts +35 -35
- package/dist/global_telemetry.js +131 -107
- package/dist/hooks/command_not_found/performance_analytics.d.ts +1 -1
- package/dist/hooks/command_not_found/performance_analytics.js +5 -1
- package/dist/hooks/init/performance_analytics.d.ts +1 -1
- package/dist/hooks/init/performance_analytics.js +5 -1
- package/dist/hooks/init/terms-of-service.d.ts +1 -1
- package/dist/hooks/init/terms-of-service.js +2 -2
- package/dist/hooks/init/version.d.ts +1 -1
- package/dist/hooks/init/version.js +4 -2
- package/dist/hooks/postrun/performance_analytics.d.ts +1 -1
- package/dist/hooks/postrun/performance_analytics.js +9 -4
- package/dist/hooks/prerun/analytics.d.ts +1 -1
- package/dist/hooks/prerun/analytics.js +9 -4
- package/dist/hooks/preupdate/check-npm-auth.d.ts +1 -1
- package/dist/hooks/preupdate/check-npm-auth.js +2 -2
- package/dist/hooks/update/brew.d.ts +1 -1
- package/dist/hooks/update/brew.js +1 -1
- package/dist/hooks/update/completions.d.ts +1 -1
- package/dist/hooks/update/show-version-info.d.ts +1 -1
- package/dist/hooks/update/show-version-info.js +2 -2
- package/dist/hooks/update/tidy.d.ts +1 -1
- package/dist/hooks/update/tidy.js +1 -1
- package/dist/lib/addons/addons_wait.js +2 -2
- package/dist/lib/addons/create_addon.js +1 -1
- package/dist/lib/addons/destroy_addon.js +1 -1
- package/dist/lib/addons/util.js +1 -1
- package/dist/lib/apps/app-transfer.js +2 -2
- package/dist/lib/buildpacks/buildpacks.d.ts +1 -1
- package/dist/lib/buildpacks/buildpacks.js +13 -13
- package/dist/lib/certs/certificate_details.js +1 -1
- package/dist/lib/certs/domains.js +12 -12
- package/dist/lib/ci/pipelines.js +1 -1
- package/dist/lib/ci/test-run.d.ts +2 -2
- package/dist/lib/ci/test-run.js +106 -106
- package/dist/lib/ci/validate.js +1 -1
- package/dist/lib/confirmCommand.js +1 -1
- package/dist/lib/container/docker_helper.js +1 -1
- package/dist/lib/container/helpers.js +2 -2
- package/dist/lib/data/poolConfig.js +2 -2
- package/dist/lib/domains/domains.d.ts +1 -1
- package/dist/lib/domains/domains.js +31 -31
- package/dist/lib/domains/wait-for-domain.js +1 -1
- package/dist/lib/git/git.js +1 -1
- package/dist/lib/local/env-file-validator.js +1 -1
- package/dist/lib/local/fork-foreman.js +12 -12
- package/dist/lib/members/util.js +2 -2
- package/dist/lib/notify.js +1 -1
- package/dist/lib/npm-auth.d.ts +2 -2
- package/dist/lib/npm-auth.js +16 -16
- package/dist/lib/orgs/utils.js +1 -1
- package/dist/lib/pg/backups.js +1 -1
- package/dist/lib/pg/psql.d.ts +5 -5
- package/dist/lib/pg/psql.js +19 -19
- package/dist/lib/pg/push_pull.js +1 -1
- package/dist/lib/pg/setter.js +1 -1
- package/dist/lib/pipelines/ownership.d.ts +1 -1
- package/dist/lib/pipelines/ownership.js +13 -13
- package/dist/lib/pipelines/render-pipeline.js +1 -1
- package/dist/lib/pipelines/setup/create-apps.js +18 -18
- package/dist/lib/pipelines/setup/get-name-and-repo.js +1 -1
- package/dist/lib/pipelines/setup/poll-app-setups.js +6 -6
- package/dist/lib/pipelines/setup/setup-pipeline.js +1 -1
- package/dist/lib/ps-exec/exec.js +1 -1
- package/dist/lib/ps-exec/ssh.d.ts +4 -4
- package/dist/lib/ps-exec/ssh.js +60 -60
- package/dist/lib/redis/api.d.ts +24 -24
- package/dist/lib/redis/api.js +1 -1
- package/dist/lib/run/colorize.js +113 -107
- package/dist/lib/run/dyno.d.ts +9 -9
- package/dist/lib/run/dyno.js +36 -32
- package/dist/lib/run/helpers.d.ts +7 -7
- package/dist/lib/run/helpers.js +43 -43
- package/dist/lib/run/log-displayer.js +2 -2
- package/dist/lib/spaces/format.d.ts +1 -1
- package/dist/lib/spaces/format.js +22 -22
- package/dist/lib/spaces/hosts.js +1 -1
- package/dist/lib/spaces/peering.js +1 -1
- package/dist/lib/spaces/spaces.d.ts +1 -1
- package/dist/lib/spaces/spaces.js +8 -5
- package/dist/lib/telemetry/util.d.ts +1 -1
- package/dist/lib/telemetry/util.js +13 -13
- package/dist/lib/utils/tableUtils.js +1 -1
- package/dist/lib/webhooks/base.js +1 -1
- package/npm-shrinkwrap.json +522 -907
- package/oclif.manifest.json +384 -384
- package/package.json +5 -5
- package/bin/run +0 -47
- package/dist/lib/utils/packageParser.d.ts +0 -2
- package/dist/lib/utils/packageParser.js +0 -14
package/CHANGELOG.md
CHANGED
|
@@ -4,13 +4,27 @@ All notable changes to this project will be documented in this file.
|
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
## [11.0.2
|
|
7
|
+
## [11.0.2](https://github.com/heroku/cli/compare/v11.0.1...v11.0.2) (2026-03-27)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Bug Fixes
|
|
11
|
+
|
|
12
|
+
* point bin to run.js instead of symlink for npm compatibility ([#3624](https://github.com/heroku/cli/issues/3624)) ([dd3cfa3](https://github.com/heroku/cli/commit/dd3cfa3bcc711ded29ca99d9403fa516c2e55473))
|
|
13
|
+
|
|
14
|
+
## [11.0.1](https://github.com/heroku/cli/compare/v11.0.0...v11.0.1) (2026-03-26)
|
|
8
15
|
|
|
9
16
|
|
|
10
17
|
### Bug Fixes
|
|
11
18
|
|
|
12
19
|
* address UI issues with confirmation prompts on multiple commands (W-21649376) ([#3602](https://github.com/heroku/cli/issues/3602)) ([7e96152](https://github.com/heroku/cli/commit/7e96152f8789d4580cd30b0e501866d6f01c9079))
|
|
13
20
|
* resolve addons across data maintenances commands ([#3609](https://github.com/heroku/cli/issues/3609)) ([84eb648](https://github.com/heroku/cli/commit/84eb64866d1204cb393bae80ae8b4c58eabcb1cc))
|
|
21
|
+
* separate TERM=dumb run status lines ([#3617](https://github.com/heroku/cli/issues/3617)) ([3eff3dc](https://github.com/heroku/cli/commit/3eff3dccfe6bb131756ed4a7984904f80af06165))
|
|
22
|
+
* show correct error message for Essential-tier (W-21653472) ([#3614](https://github.com/heroku/cli/issues/3614)) ([6fcb3a4](https://github.com/heroku/cli/commit/6fcb3a4ae28166c46b7412dec518afa275c54d6a))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Performance Improvements
|
|
26
|
+
|
|
27
|
+
* improve Windows CLI performance ([#3610](https://github.com/heroku/cli/issues/3610)) ([85c2224](https://github.com/heroku/cli/commit/85c2224f4a7d1c8068aff0b7945f24a7353c4c49))
|
|
14
28
|
|
|
15
29
|
## [11.0.0](https://github.com/heroku/cli/compare/v10.17.0...v11.0.0) (2026-03-18)
|
|
16
30
|
|
package/bin/run.cmd
CHANGED
package/bin/run.js
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
#!/usr/bin/env -S node --no-deprecation
|
|
2
|
+
/* eslint-disable n/no-process-exit */
|
|
3
|
+
/* eslint-disable n/no-unpublished-bin */
|
|
4
|
+
|
|
5
|
+
import {execute, settings} from '@oclif/core'
|
|
6
|
+
|
|
7
|
+
// Enable performance tracking when DEBUG=oclif:perf or DEBUG=* is set
|
|
8
|
+
if (process.env.DEBUG?.includes('oclif:perf') || process.env.DEBUG === '*') {
|
|
9
|
+
settings.performanceEnabled = true
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
process.env.HEROKU_UPDATE_INSTRUCTIONS = process.env.HEROKU_UPDATE_INSTRUCTIONS || 'update with: "npm update -g heroku"'
|
|
13
|
+
|
|
14
|
+
const now = new Date()
|
|
15
|
+
const cliStartTime = now.getTime()
|
|
16
|
+
|
|
17
|
+
// Skip telemetry entirely on Windows for performance (unless explicitly enabled)
|
|
18
|
+
const enableTelemetry = process.platform !== 'win32' || process.env.ENABLE_WINDOWS_TELEMETRY === 'true'
|
|
19
|
+
let globalTelemetry
|
|
20
|
+
|
|
21
|
+
if (enableTelemetry) {
|
|
22
|
+
// Dynamically import telemetry only when needed
|
|
23
|
+
globalTelemetry = await import('../dist/global_telemetry.js')
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
process.once('beforeExit', async code => {
|
|
27
|
+
if (!enableTelemetry) return
|
|
28
|
+
|
|
29
|
+
// capture as successful exit
|
|
30
|
+
if (global.cliTelemetry) {
|
|
31
|
+
if (global.cliTelemetry.isVersionOrHelp) {
|
|
32
|
+
const cmdStartTime = global.cliTelemetry.commandRunDuration
|
|
33
|
+
global.cliTelemetry.commandRunDuration = globalTelemetry.computeDuration(cmdStartTime)
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
global.cliTelemetry.exitCode = code
|
|
37
|
+
global.cliTelemetry.cliRunDuration = globalTelemetry.computeDuration(cliStartTime)
|
|
38
|
+
const telemetryData = global.cliTelemetry
|
|
39
|
+
await globalTelemetry.sendTelemetry(telemetryData)
|
|
40
|
+
}
|
|
41
|
+
})
|
|
42
|
+
|
|
43
|
+
process.on('SIGINT', () => {
|
|
44
|
+
if (enableTelemetry) {
|
|
45
|
+
// Fire-and-forget: attempt to send telemetry but don't block exit
|
|
46
|
+
const error = new Error('Received SIGINT')
|
|
47
|
+
error.cliRunDuration = globalTelemetry.computeDuration(cliStartTime)
|
|
48
|
+
globalTelemetry.sendTelemetry(error).catch(() => {})
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
process.exit(1)
|
|
52
|
+
})
|
|
53
|
+
|
|
54
|
+
process.on('SIGTERM', () => {
|
|
55
|
+
if (enableTelemetry) {
|
|
56
|
+
// Fire-and-forget: attempt to send telemetry but don't block exit
|
|
57
|
+
const error = new Error('Received SIGTERM')
|
|
58
|
+
error.cliRunDuration = globalTelemetry.computeDuration(cliStartTime)
|
|
59
|
+
globalTelemetry.sendTelemetry(error).catch(() => {})
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
process.exit(1)
|
|
63
|
+
})
|
|
64
|
+
|
|
65
|
+
if (enableTelemetry) {
|
|
66
|
+
globalTelemetry.initializeInstrumentation()
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
await execute({dir: import.meta.url})
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { color } from '@heroku/heroku-cli-util';
|
|
2
1
|
import { Command, flags } from '@heroku-cli/command';
|
|
2
|
+
import * as color from '@heroku/heroku-cli-util/color';
|
|
3
3
|
import { Args, ux } from '@oclif/core';
|
|
4
4
|
import { getOwner, isTeamApp } from '../../lib/teamUtils.js';
|
|
5
5
|
export default class AccessAdd extends Command {
|
|
@@ -1,51 +1,9 @@
|
|
|
1
|
-
import { color, hux } from '@heroku/heroku-cli-util';
|
|
2
1
|
import { Command, flags } from '@heroku-cli/command';
|
|
3
2
|
import { HerokuAPIError } from '@heroku-cli/command/lib/api-client.js';
|
|
4
|
-
import {
|
|
3
|
+
import { color, hux } from '@heroku/heroku-cli-util';
|
|
4
|
+
import { ux } from '@oclif/core/ux';
|
|
5
5
|
import _ from 'lodash';
|
|
6
6
|
import { getOwner, isTeamApp } from '../../lib/teamUtils.js';
|
|
7
|
-
function printJSON(collaborators) {
|
|
8
|
-
ux.stdout(JSON.stringify(collaborators, null, 2));
|
|
9
|
-
}
|
|
10
|
-
function buildTableColumns(showPermissions) {
|
|
11
|
-
const baseColumns = {
|
|
12
|
-
email: {
|
|
13
|
-
get: ({ email }) => color.user(email),
|
|
14
|
-
},
|
|
15
|
-
role: {
|
|
16
|
-
get: ({ role }) => color.info(role),
|
|
17
|
-
},
|
|
18
|
-
};
|
|
19
|
-
if (showPermissions) {
|
|
20
|
-
return {
|
|
21
|
-
...baseColumns,
|
|
22
|
-
permissions: {},
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
return baseColumns;
|
|
26
|
-
}
|
|
27
|
-
function printAccess(app, collaborators) {
|
|
28
|
-
const showPermissions = isTeamApp(app.owner?.email);
|
|
29
|
-
collaborators = _.chain(collaborators)
|
|
30
|
-
.sortBy(c => c.email || c.user.email)
|
|
31
|
-
.reject(c => /herokumanager\.com$/.test(c.user.email))
|
|
32
|
-
.map(collab => {
|
|
33
|
-
const { email } = collab.user;
|
|
34
|
-
const { permissions, role } = collab;
|
|
35
|
-
const data = { email, role: role || 'collaborator' };
|
|
36
|
-
if (showPermissions) {
|
|
37
|
-
data.permissions = _.map(_.sortBy(permissions, 'name'), 'name').join(', ');
|
|
38
|
-
}
|
|
39
|
-
return data;
|
|
40
|
-
})
|
|
41
|
-
.value();
|
|
42
|
-
const tableColumns = buildTableColumns(showPermissions);
|
|
43
|
-
hux.table(collaborators, tableColumns);
|
|
44
|
-
}
|
|
45
|
-
function buildCollaboratorsArray(collaboratorsRaw, admins) {
|
|
46
|
-
const collaboratorsNoAdmins = _.reject(collaboratorsRaw, { role: 'admin' });
|
|
47
|
-
return _.union(collaboratorsNoAdmins, admins);
|
|
48
|
-
}
|
|
49
7
|
export default class AccessIndex extends Command {
|
|
50
8
|
static description = 'list who has access to an app';
|
|
51
9
|
static flags = {
|
|
@@ -83,3 +41,45 @@ export default class AccessIndex extends Command {
|
|
|
83
41
|
printAccess(app, collaborators);
|
|
84
42
|
}
|
|
85
43
|
}
|
|
44
|
+
function buildCollaboratorsArray(collaboratorsRaw, admins) {
|
|
45
|
+
const collaboratorsNoAdmins = _.reject(collaboratorsRaw, { role: 'admin' });
|
|
46
|
+
return _.union(collaboratorsNoAdmins, admins);
|
|
47
|
+
}
|
|
48
|
+
function buildTableColumns(showPermissions) {
|
|
49
|
+
const baseColumns = {
|
|
50
|
+
email: {
|
|
51
|
+
get: ({ email }) => color.user(email),
|
|
52
|
+
},
|
|
53
|
+
role: {
|
|
54
|
+
get: ({ role }) => color.info(role),
|
|
55
|
+
},
|
|
56
|
+
};
|
|
57
|
+
if (showPermissions) {
|
|
58
|
+
return {
|
|
59
|
+
...baseColumns,
|
|
60
|
+
permissions: {},
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
return baseColumns;
|
|
64
|
+
}
|
|
65
|
+
function printAccess(app, collaborators) {
|
|
66
|
+
const showPermissions = isTeamApp(app.owner?.email);
|
|
67
|
+
collaborators = _.chain(collaborators)
|
|
68
|
+
.sortBy(c => c.email || c.user.email)
|
|
69
|
+
.reject(c => /herokumanager\.com$/.test(c.user.email))
|
|
70
|
+
.map(collab => {
|
|
71
|
+
const { email } = collab.user;
|
|
72
|
+
const { permissions, role } = collab;
|
|
73
|
+
const data = { email, role: role || 'collaborator' };
|
|
74
|
+
if (showPermissions) {
|
|
75
|
+
data.permissions = _.map(_.sortBy(permissions, 'name'), 'name').join(', ');
|
|
76
|
+
}
|
|
77
|
+
return data;
|
|
78
|
+
})
|
|
79
|
+
.value();
|
|
80
|
+
const tableColumns = buildTableColumns(showPermissions);
|
|
81
|
+
hux.table(collaborators, tableColumns);
|
|
82
|
+
}
|
|
83
|
+
function printJSON(collaborators) {
|
|
84
|
+
ux.stdout(JSON.stringify(collaborators, null, 2));
|
|
85
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { color } from '@heroku/heroku-cli-util';
|
|
2
1
|
import { Command, flags } from '@heroku-cli/command';
|
|
3
|
-
import
|
|
2
|
+
import * as color from '@heroku/heroku-cli-util/color';
|
|
3
|
+
import { ux } from '@oclif/core/ux';
|
|
4
4
|
export default class AccessRemove extends Command {
|
|
5
5
|
static description = 'remove users from a team app';
|
|
6
6
|
static example = `${color.command('heroku access:remove user@email.com --app APP')}`;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { color } from '@heroku/heroku-cli-util';
|
|
2
1
|
import { Command, flags } from '@heroku-cli/command';
|
|
2
|
+
import * as color from '@heroku/heroku-cli-util/color';
|
|
3
3
|
import { Args, ux } from '@oclif/core';
|
|
4
4
|
import { isTeamApp } from '../../lib/teamUtils.js';
|
|
5
5
|
export default class Update extends Command {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { color } from '@heroku/heroku-cli-util';
|
|
2
1
|
import { Command } from '@heroku-cli/command';
|
|
2
|
+
import * as color from '@heroku/heroku-cli-util/color';
|
|
3
3
|
import { Args, ux } from '@oclif/core';
|
|
4
4
|
import AccountsModule from '../../lib/accounts/accounts.js';
|
|
5
5
|
export default class Add extends Command {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { color, hux } from '@heroku/heroku-cli-util';
|
|
2
1
|
import { Command } from '@heroku-cli/command';
|
|
3
|
-
import {
|
|
2
|
+
import { color, hux } from '@heroku/heroku-cli-util';
|
|
3
|
+
import { ux } from '@oclif/core/ux';
|
|
4
4
|
import AccountsModule from '../../lib/accounts/accounts.js';
|
|
5
5
|
export default class Current extends Command {
|
|
6
6
|
static baseFlags = Command.baseFlagsWithoutPrompt();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { color } from '@heroku/heroku-cli-util';
|
|
2
1
|
import { Command } from '@heroku-cli/command';
|
|
3
|
-
import
|
|
2
|
+
import * as color from '@heroku/heroku-cli-util/color';
|
|
3
|
+
import { ux } from '@oclif/core/ux';
|
|
4
4
|
import accountsModule from '../../lib/accounts/accounts.js';
|
|
5
5
|
export default class AccountsIndex extends Command {
|
|
6
6
|
static baseFlags = Command.baseFlagsWithoutPrompt();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { color } from '@heroku/heroku-cli-util';
|
|
2
1
|
import { Command } from '@heroku-cli/command';
|
|
2
|
+
import * as color from '@heroku/heroku-cli-util/color';
|
|
3
3
|
import { Args, ux } from '@oclif/core';
|
|
4
4
|
import AccountsModule from '../../lib/accounts/accounts.js';
|
|
5
5
|
export default class Remove extends Command {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { color } from '@heroku/heroku-cli-util';
|
|
2
1
|
import { Command } from '@heroku-cli/command';
|
|
2
|
+
import * as color from '@heroku/heroku-cli-util/color';
|
|
3
3
|
import { Args, ux } from '@oclif/core';
|
|
4
4
|
import AccountsModule from '../../lib/accounts/accounts.js';
|
|
5
5
|
export default class Set extends Command {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Command, flags } from '@heroku-cli/command';
|
|
2
|
-
import
|
|
2
|
+
import * as color from '@heroku/heroku-cli-util/color';
|
|
3
3
|
import { Args, ux } from '@oclif/core';
|
|
4
4
|
import { trapConfirmationRequired } from '../../lib/addons/util.js';
|
|
5
5
|
export default class Attach extends Command {
|
|
@@ -1,42 +1,10 @@
|
|
|
1
|
-
import { color } from '@heroku/heroku-cli-util';
|
|
2
1
|
import { Command, flags } from '@heroku-cli/command';
|
|
2
|
+
import * as color from '@heroku/heroku-cli-util/color';
|
|
3
3
|
import { Args, ux } from '@oclif/core';
|
|
4
4
|
import tsheredoc from 'tsheredoc';
|
|
5
5
|
import createAddon from '../../lib/addons/create_addon.js';
|
|
6
6
|
import notify from '../../lib/notify.js';
|
|
7
7
|
const heredoc = tsheredoc.default;
|
|
8
|
-
function parseConfig(args) {
|
|
9
|
-
const config = {};
|
|
10
|
-
while (args.length > 0) {
|
|
11
|
-
let key = args.shift();
|
|
12
|
-
if (!key.startsWith('--'))
|
|
13
|
-
throw new Error(`Unexpected argument ${key}`);
|
|
14
|
-
key = key.replace(/^--/, '');
|
|
15
|
-
let val;
|
|
16
|
-
if (key.includes('=')) {
|
|
17
|
-
[key, ...val] = key.split('=');
|
|
18
|
-
val = val.join('=');
|
|
19
|
-
if (val === 'true') {
|
|
20
|
-
val = true;
|
|
21
|
-
}
|
|
22
|
-
config[key] = val;
|
|
23
|
-
}
|
|
24
|
-
else {
|
|
25
|
-
val = args.shift();
|
|
26
|
-
if (!val) {
|
|
27
|
-
config[key] = true;
|
|
28
|
-
}
|
|
29
|
-
else if (val.startsWith('--')) {
|
|
30
|
-
config[key] = true;
|
|
31
|
-
args.unshift(val);
|
|
32
|
-
}
|
|
33
|
-
else {
|
|
34
|
-
config[key] = val;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
return config;
|
|
39
|
-
}
|
|
40
8
|
export default class Create extends Command {
|
|
41
9
|
static args = {
|
|
42
10
|
'service:plan': Args.string({ description: 'unique identifier or unique name of the add-on service plan', required: true }),
|
|
@@ -98,3 +66,35 @@ export default class Create extends Command {
|
|
|
98
66
|
ux.stdout(`Run ${color.code('heroku addons:docs ' + addon?.addon_service?.name || '')} to view documentation.`);
|
|
99
67
|
}
|
|
100
68
|
}
|
|
69
|
+
function parseConfig(args) {
|
|
70
|
+
const config = {};
|
|
71
|
+
while (args.length > 0) {
|
|
72
|
+
let key = args.shift();
|
|
73
|
+
if (!key.startsWith('--'))
|
|
74
|
+
throw new Error(`Unexpected argument ${key}`);
|
|
75
|
+
key = key.replace(/^--/, '');
|
|
76
|
+
let val;
|
|
77
|
+
if (key.includes('=')) {
|
|
78
|
+
[key, ...val] = key.split('=');
|
|
79
|
+
val = val.join('=');
|
|
80
|
+
if (val === 'true') {
|
|
81
|
+
val = true;
|
|
82
|
+
}
|
|
83
|
+
config[key] = val;
|
|
84
|
+
}
|
|
85
|
+
else {
|
|
86
|
+
val = args.shift();
|
|
87
|
+
if (!val) {
|
|
88
|
+
config[key] = true;
|
|
89
|
+
}
|
|
90
|
+
else if (val.startsWith('--')) {
|
|
91
|
+
config[key] = true;
|
|
92
|
+
args.unshift(val);
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
config[key] = val;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
return config;
|
|
100
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { color } from '@heroku/heroku-cli-util';
|
|
2
1
|
import { Command, flags } from '@heroku-cli/command';
|
|
2
|
+
import * as color from '@heroku/heroku-cli-util/color';
|
|
3
3
|
import { Args, ux } from '@oclif/core';
|
|
4
4
|
export default class Detach extends Command {
|
|
5
5
|
static args = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { color, hux } from '@heroku/heroku-cli-util';
|
|
2
2
|
import { Command, flags } from '@heroku-cli/command';
|
|
3
|
-
import { ux } from '@oclif/core';
|
|
3
|
+
import { ux } from '@oclif/core/ux';
|
|
4
4
|
import _ from 'lodash';
|
|
5
5
|
import { formatPrice, formatState, grandfatheredPrice } from '../../lib/addons/util.js';
|
|
6
6
|
const topic = 'addons';
|
|
@@ -1,4 +1,18 @@
|
|
|
1
1
|
import { Command } from '@heroku-cli/command';
|
|
2
|
+
export interface AddonSso {
|
|
3
|
+
/**
|
|
4
|
+
* URL of the SSO request
|
|
5
|
+
*/
|
|
6
|
+
action: string;
|
|
7
|
+
/**
|
|
8
|
+
* SSO request method
|
|
9
|
+
*/
|
|
10
|
+
method: 'get' | 'post';
|
|
11
|
+
/**
|
|
12
|
+
* SSO params for POST request
|
|
13
|
+
*/
|
|
14
|
+
params?: SsoParams;
|
|
15
|
+
}
|
|
2
16
|
export interface SsoParams {
|
|
3
17
|
/**
|
|
4
18
|
* billing app name
|
|
@@ -41,20 +55,6 @@ export interface SsoParams {
|
|
|
41
55
|
*/
|
|
42
56
|
user_id: string;
|
|
43
57
|
}
|
|
44
|
-
export interface AddonSso {
|
|
45
|
-
/**
|
|
46
|
-
* URL of the SSO request
|
|
47
|
-
*/
|
|
48
|
-
action: string;
|
|
49
|
-
/**
|
|
50
|
-
* SSO request method
|
|
51
|
-
*/
|
|
52
|
-
method: 'get' | 'post';
|
|
53
|
-
/**
|
|
54
|
-
* SSO params for POST request
|
|
55
|
-
*/
|
|
56
|
-
params?: SsoParams;
|
|
57
|
-
}
|
|
58
58
|
export default class Open extends Command {
|
|
59
59
|
static args: {
|
|
60
60
|
addon: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { color } from '@heroku/heroku-cli-util';
|
|
2
|
-
import { HTTPError } from '@heroku/http-call';
|
|
3
1
|
import { Command, flags } from '@heroku-cli/command';
|
|
2
|
+
import * as color from '@heroku/heroku-cli-util/color';
|
|
3
|
+
import { HTTPError } from '@heroku/http-call';
|
|
4
4
|
import { Args, ux } from '@oclif/core';
|
|
5
5
|
import fs from 'node:fs/promises';
|
|
6
6
|
import os from 'node:os';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { color, hux } from '@heroku/heroku-cli-util';
|
|
2
1
|
import { Command, flags } from '@heroku-cli/command';
|
|
3
|
-
import {
|
|
2
|
+
import { color, hux } from '@heroku/heroku-cli-util';
|
|
3
|
+
import { ux } from '@oclif/core/ux';
|
|
4
4
|
export default class Services extends Command {
|
|
5
5
|
static description = 'list all available add-on services';
|
|
6
6
|
static flags = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { color } from '@heroku/heroku-cli-util';
|
|
2
1
|
import { Command, flags } from '@heroku-cli/command';
|
|
3
2
|
import { HerokuAPIError } from '@heroku-cli/command/lib/api-client.js';
|
|
3
|
+
import * as color from '@heroku/heroku-cli-util/color';
|
|
4
4
|
import { Args, ux } from '@oclif/core';
|
|
5
5
|
import { addonResolver } from '../../lib/addons/resolve.js';
|
|
6
6
|
import { formatPriceText } from '../../lib/addons/util.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { color } from '@heroku/heroku-cli-util';
|
|
2
1
|
import { Command, flags } from '@heroku-cli/command';
|
|
2
|
+
import * as color from '@heroku/heroku-cli-util/color';
|
|
3
3
|
import { Args, ux } from '@oclif/core';
|
|
4
|
-
import {
|
|
4
|
+
import { waitForAddonDeprovisioning, waitForAddonProvisioning } from '../../lib/addons/addons_wait.js';
|
|
5
5
|
import { resolveAddon } from '../../lib/addons/resolve.js';
|
|
6
6
|
import notify from '../../lib/notify.js';
|
|
7
7
|
export default class Wait extends Command {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { color } from '@heroku/heroku-cli-util';
|
|
2
1
|
import { Command, flags } from '@heroku-cli/command';
|
|
2
|
+
import * as color from '@heroku/heroku-cli-util/color';
|
|
3
3
|
import { Args, ux } from '@oclif/core';
|
|
4
4
|
import * as git from '../../lib/ci/git.js';
|
|
5
5
|
import ConfirmCommand from '../../lib/confirmCommand.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { color, hux } from '@heroku/heroku-cli-util';
|
|
2
1
|
import { Command, flags } from '@heroku-cli/command';
|
|
3
|
-
import {
|
|
2
|
+
import { color, hux } from '@heroku/heroku-cli-util';
|
|
3
|
+
import { ux } from '@oclif/core/ux';
|
|
4
4
|
import errorInfo from '../../lib/apps/error_info.js';
|
|
5
5
|
const colorize = (level, s) => {
|
|
6
6
|
switch (level) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { color } from '@heroku/heroku-cli-util';
|
|
2
1
|
import { Command, flags } from '@heroku-cli/command';
|
|
3
|
-
import
|
|
2
|
+
import * as color from '@heroku/heroku-cli-util/color';
|
|
3
|
+
import { ux } from '@oclif/core/ux';
|
|
4
4
|
export default class Add extends Command {
|
|
5
5
|
static description = 'favorites an app';
|
|
6
6
|
static flags = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { color, hux } from '@heroku/heroku-cli-util';
|
|
2
1
|
import { Command, flags } from '@heroku-cli/command';
|
|
3
|
-
import {
|
|
2
|
+
import { color, hux } from '@heroku/heroku-cli-util';
|
|
3
|
+
import { ux } from '@oclif/core/ux';
|
|
4
4
|
export default class Index extends Command {
|
|
5
5
|
static description = 'list favorited apps';
|
|
6
6
|
static flags = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { color } from '@heroku/heroku-cli-util';
|
|
2
1
|
import { Command, flags } from '@heroku-cli/command';
|
|
3
|
-
import
|
|
2
|
+
import * as color from '@heroku/heroku-cli-util/color';
|
|
3
|
+
import { ux } from '@oclif/core/ux';
|
|
4
4
|
export default class Remove extends Command {
|
|
5
5
|
static description = 'unfavorites an app';
|
|
6
6
|
static flags = {
|
|
@@ -1,65 +1,8 @@
|
|
|
1
|
-
import { color, hux } from '@heroku/heroku-cli-util';
|
|
2
1
|
import { Command, flags } from '@heroku-cli/command';
|
|
3
2
|
import { SpaceCompletion } from '@heroku-cli/command/lib/completions.js';
|
|
4
|
-
import {
|
|
3
|
+
import { color, hux } from '@heroku/heroku-cli-util';
|
|
4
|
+
import { ux } from '@oclif/core/ux';
|
|
5
5
|
import _ from 'lodash';
|
|
6
|
-
function annotateAppName(app) {
|
|
7
|
-
let name = color.app(app.name);
|
|
8
|
-
if (app.locked && app.internal_routing) {
|
|
9
|
-
name = `${color.app(app.name)} [internal/locked]`;
|
|
10
|
-
}
|
|
11
|
-
else if (app.locked) {
|
|
12
|
-
name = `${color.app(app.name)} [locked]`;
|
|
13
|
-
}
|
|
14
|
-
else if (app.internal_routing) {
|
|
15
|
-
name = `${color.app(app.name)} [internal]`;
|
|
16
|
-
}
|
|
17
|
-
return name;
|
|
18
|
-
}
|
|
19
|
-
function regionizeAppName(app) {
|
|
20
|
-
const name = annotateAppName(app);
|
|
21
|
-
if (app.region && app.region.name !== 'us') {
|
|
22
|
-
return `${name} (${color.info(app.region.name)})`;
|
|
23
|
-
}
|
|
24
|
-
return name;
|
|
25
|
-
}
|
|
26
|
-
function listApps(apps) {
|
|
27
|
-
apps.forEach((app) => ux.stdout(regionizeAppName(app)));
|
|
28
|
-
}
|
|
29
|
-
function print(apps, user, space, team) {
|
|
30
|
-
if (apps.length === 0) {
|
|
31
|
-
if (space)
|
|
32
|
-
ux.stdout(`There are no apps in space ${color.space(space)}.`);
|
|
33
|
-
else if (team)
|
|
34
|
-
ux.stdout(`There are no apps in team ${color.team(team)}.`);
|
|
35
|
-
else
|
|
36
|
-
ux.stdout('You have no apps.');
|
|
37
|
-
}
|
|
38
|
-
else if (space) {
|
|
39
|
-
hux.styledHeader(`Apps in space ${color.space(space)}`);
|
|
40
|
-
listApps(apps);
|
|
41
|
-
}
|
|
42
|
-
else if (team) {
|
|
43
|
-
hux.styledHeader(`Apps in team ${color.team(team)}`);
|
|
44
|
-
listApps(apps);
|
|
45
|
-
}
|
|
46
|
-
else {
|
|
47
|
-
apps = _.partition(apps, (app) => app.owner.email === user.email);
|
|
48
|
-
if (apps[0].length > 0) {
|
|
49
|
-
hux.styledHeader(`${color.user(user.email)} Apps`);
|
|
50
|
-
listApps(apps[0]);
|
|
51
|
-
}
|
|
52
|
-
const columns = {
|
|
53
|
-
Name: { get: regionizeAppName },
|
|
54
|
-
// eslint-disable-next-line perfectionist/sort-objects
|
|
55
|
-
Email: { get: ({ owner }) => color.user(owner.email) },
|
|
56
|
-
};
|
|
57
|
-
if (apps[1].length > 0) {
|
|
58
|
-
ux.stdout();
|
|
59
|
-
hux.table(apps[1], columns, { title: 'Collaborated Apps\n', titleOptions: { bold: true } });
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
6
|
export default class AppsIndex extends Command {
|
|
64
7
|
static description = 'list your apps';
|
|
65
8
|
static examples = [
|
|
@@ -115,3 +58,60 @@ export default class AppsIndex extends Command {
|
|
|
115
58
|
}
|
|
116
59
|
}
|
|
117
60
|
}
|
|
61
|
+
function annotateAppName(app) {
|
|
62
|
+
let name = color.app(app.name);
|
|
63
|
+
if (app.locked && app.internal_routing) {
|
|
64
|
+
name = `${color.app(app.name)} [internal/locked]`;
|
|
65
|
+
}
|
|
66
|
+
else if (app.locked) {
|
|
67
|
+
name = `${color.app(app.name)} [locked]`;
|
|
68
|
+
}
|
|
69
|
+
else if (app.internal_routing) {
|
|
70
|
+
name = `${color.app(app.name)} [internal]`;
|
|
71
|
+
}
|
|
72
|
+
return name;
|
|
73
|
+
}
|
|
74
|
+
function listApps(apps) {
|
|
75
|
+
apps.forEach((app) => ux.stdout(regionizeAppName(app)));
|
|
76
|
+
}
|
|
77
|
+
function print(apps, user, space, team) {
|
|
78
|
+
if (apps.length === 0) {
|
|
79
|
+
if (space)
|
|
80
|
+
ux.stdout(`There are no apps in space ${color.space(space)}.`);
|
|
81
|
+
else if (team)
|
|
82
|
+
ux.stdout(`There are no apps in team ${color.team(team)}.`);
|
|
83
|
+
else
|
|
84
|
+
ux.stdout('You have no apps.');
|
|
85
|
+
}
|
|
86
|
+
else if (space) {
|
|
87
|
+
hux.styledHeader(`Apps in space ${color.space(space)}`);
|
|
88
|
+
listApps(apps);
|
|
89
|
+
}
|
|
90
|
+
else if (team) {
|
|
91
|
+
hux.styledHeader(`Apps in team ${color.team(team)}`);
|
|
92
|
+
listApps(apps);
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
apps = _.partition(apps, (app) => app.owner.email === user.email);
|
|
96
|
+
if (apps[0].length > 0) {
|
|
97
|
+
hux.styledHeader(`${color.user(user.email)} Apps`);
|
|
98
|
+
listApps(apps[0]);
|
|
99
|
+
}
|
|
100
|
+
const columns = {
|
|
101
|
+
Name: { get: regionizeAppName },
|
|
102
|
+
// eslint-disable-next-line perfectionist/sort-objects
|
|
103
|
+
Email: { get: ({ owner }) => color.user(owner.email) },
|
|
104
|
+
};
|
|
105
|
+
if (apps[1].length > 0) {
|
|
106
|
+
ux.stdout();
|
|
107
|
+
hux.table(apps[1], columns, { title: 'Collaborated Apps\n', titleOptions: { bold: true } });
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
function regionizeAppName(app) {
|
|
112
|
+
const name = annotateAppName(app);
|
|
113
|
+
if (app.region && app.region.name !== 'us') {
|
|
114
|
+
return `${name} (${color.info(app.region.name)})`;
|
|
115
|
+
}
|
|
116
|
+
return name;
|
|
117
|
+
}
|