heroku 8.1.9 → 8.2.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/autocomplete-scripts/README.md +7 -0
- package/autocomplete-scripts/bash/heroku.bash +59 -0
- package/autocomplete-scripts/brew/bash +4 -0
- package/autocomplete-scripts/brew/zsh/_heroku +59 -0
- package/autocomplete-scripts/zsh/_heroku +53 -0
- package/bin/bats-test-runner.js +7 -0
- package/bin/dev +17 -0
- package/bin/dev.cmd +3 -0
- package/bin/run +36 -1
- package/lib/analytics.d.ts +2 -2
- package/lib/analytics.js +3 -4
- package/lib/commands/auth/2fa/disable.d.ts +7 -0
- package/lib/commands/auth/2fa/disable.js +16 -0
- package/lib/commands/auth/2fa/index.d.ts +6 -0
- package/lib/commands/auth/2fa/index.js +18 -0
- package/lib/commands/auth/login.d.ts +8 -0
- package/lib/commands/auth/login.js +25 -0
- package/lib/commands/auth/logout.d.ts +6 -0
- package/lib/commands/auth/logout.js +14 -0
- package/lib/commands/auth/token.d.ts +7 -0
- package/lib/commands/auth/token.js +31 -0
- package/lib/commands/auth/whoami.d.ts +7 -0
- package/lib/commands/auth/whoami.js +26 -0
- package/lib/commands/authorizations/create.d.ts +13 -0
- package/lib/commands/authorizations/create.js +41 -0
- package/lib/commands/authorizations/index.d.ts +9 -0
- package/lib/commands/authorizations/index.js +35 -0
- package/lib/commands/authorizations/info.d.ts +11 -0
- package/lib/commands/authorizations/info.js +25 -0
- package/lib/commands/authorizations/revoke.d.ts +10 -0
- package/lib/commands/authorizations/revoke.js +22 -0
- package/lib/commands/authorizations/rotate.d.ts +8 -0
- package/lib/commands/authorizations/rotate.js +19 -0
- package/lib/commands/authorizations/update.d.ts +13 -0
- package/lib/commands/authorizations/update.js +36 -0
- package/lib/commands/autocomplete/create.d.ts +29 -0
- package/lib/commands/autocomplete/create.js +213 -0
- package/lib/commands/autocomplete/doctor.d.ts +12 -0
- package/lib/commands/autocomplete/doctor.js +97 -0
- package/lib/commands/autocomplete/index.d.ts +12 -0
- package/lib/commands/autocomplete/index.js +67 -0
- package/lib/commands/autocomplete/options.d.ts +25 -0
- package/lib/commands/autocomplete/options.js +210 -0
- package/lib/commands/autocomplete/script.d.ts +10 -0
- package/lib/commands/autocomplete/script.js +23 -0
- package/lib/commands/buildpacks/add.d.ts +13 -0
- package/lib/commands/buildpacks/add.js +43 -0
- package/lib/commands/buildpacks/clear.d.ts +9 -0
- package/lib/commands/buildpacks/clear.js +17 -0
- package/lib/commands/buildpacks/index.d.ts +9 -0
- package/lib/commands/buildpacks/index.js +25 -0
- package/lib/commands/buildpacks/info.d.ts +8 -0
- package/lib/commands/buildpacks/info.js +41 -0
- package/lib/commands/buildpacks/remove.d.ts +13 -0
- package/lib/commands/buildpacks/remove.js +55 -0
- package/lib/commands/buildpacks/search.d.ts +13 -0
- package/lib/commands/buildpacks/search.js +69 -0
- package/lib/commands/buildpacks/set.d.ts +13 -0
- package/lib/commands/buildpacks/set.js +42 -0
- package/lib/commands/buildpacks/versions.d.ts +8 -0
- package/lib/commands/buildpacks/versions.js +56 -0
- package/lib/commands/certs/auto/wait.d.ts +9 -0
- package/lib/commands/certs/auto/wait.js +14 -0
- package/lib/commands/ci/index.d.ts +12 -0
- package/lib/commands/ci/index.js +25 -0
- package/lib/commands/ci/info.d.ts +14 -0
- package/lib/commands/ci/info.js +29 -0
- package/lib/commands/ci/last.d.ts +11 -0
- package/lib/commands/ci/last.js +31 -0
- package/lib/commands/ci/rerun.d.ts +13 -0
- package/lib/commands/ci/rerun.js +53 -0
- package/lib/commands/ci/run.d.ts +10 -0
- package/lib/commands/ci/run.js +42 -0
- package/lib/commands/clients/create.d.ts +14 -0
- package/lib/commands/clients/create.js +37 -0
- package/lib/commands/clients/destroy.d.ts +8 -0
- package/lib/commands/clients/destroy.js +18 -0
- package/lib/commands/clients/index.d.ts +8 -0
- package/lib/commands/clients/index.js +32 -0
- package/lib/commands/clients/info.d.ts +13 -0
- package/lib/commands/clients/info.js +33 -0
- package/lib/commands/clients/rotate.d.ts +12 -0
- package/lib/commands/clients/rotate.js +33 -0
- package/lib/commands/clients/update.d.ts +13 -0
- package/lib/commands/clients/update.js +38 -0
- package/lib/commands/config/edit.d.ts +23 -0
- package/lib/commands/config/edit.js +132 -0
- package/lib/commands/config/get.d.ts +16 -0
- package/lib/commands/config/get.js +35 -0
- package/lib/commands/config/index.d.ts +11 -0
- package/lib/commands/config/index.js +33 -0
- package/lib/commands/config/unset.d.ts +12 -0
- package/lib/commands/config/unset.js +51 -0
- package/lib/commands/console.d.ts +11 -0
- package/lib/commands/console.js +30 -0
- package/lib/commands/domains/add.d.ts +19 -0
- package/lib/commands/domains/add.js +117 -0
- package/lib/commands/domains/clear.d.ts +11 -0
- package/lib/commands/domains/clear.js +26 -0
- package/lib/commands/domains/index.d.ts +40 -0
- package/lib/commands/domains/index.js +79 -0
- package/lib/commands/domains/info.d.ts +14 -0
- package/lib/commands/domains/info.js +25 -0
- package/lib/commands/domains/remove.d.ts +14 -0
- package/lib/commands/domains/remove.js +26 -0
- package/lib/commands/domains/update.d.ts +15 -0
- package/lib/commands/domains/update.js +40 -0
- package/lib/commands/domains/wait.d.ts +13 -0
- package/lib/commands/domains/wait.js +32 -0
- package/lib/commands/git/clone.d.ts +13 -0
- package/lib/commands/git/clone.js +29 -0
- package/lib/commands/git/credentials.d.ts +9 -0
- package/lib/commands/git/credentials.js +32 -0
- package/lib/commands/git/remote.d.ts +11 -0
- package/lib/commands/git/remote.js +44 -0
- package/lib/commands/labs/disable.d.ts +11 -0
- package/lib/commands/labs/disable.js +65 -0
- package/lib/commands/local/index.d.ts +17 -0
- package/lib/commands/local/index.js +75 -0
- package/lib/commands/local/run.d.ts +11 -0
- package/lib/commands/local/run.js +38 -0
- package/lib/commands/local/version.d.ts +5 -0
- package/lib/commands/local/version.js +13 -0
- package/lib/commands/logs.d.ts +16 -0
- package/lib/commands/logs.js +45 -0
- package/lib/commands/pipelines/add.d.ts +14 -0
- package/lib/commands/pipelines/add.js +61 -0
- package/lib/commands/pipelines/connect.d.ts +12 -0
- package/lib/commands/pipelines/connect.js +52 -0
- package/lib/commands/pipelines/create.d.ts +15 -0
- package/lib/commands/pipelines/create.js +91 -0
- package/lib/commands/pipelines/destroy.d.ts +9 -0
- package/lib/commands/pipelines/destroy.js +27 -0
- package/lib/commands/pipelines/diff.d.ts +19 -0
- package/lib/commands/pipelines/diff.js +152 -0
- package/lib/commands/pipelines/index.d.ts +9 -0
- package/lib/commands/pipelines/index.js +27 -0
- package/lib/commands/pipelines/info.d.ts +13 -0
- package/lib/commands/pipelines/info.js +43 -0
- package/lib/commands/pipelines/open.d.ts +9 -0
- package/lib/commands/pipelines/open.js +19 -0
- package/lib/commands/pipelines/promote.d.ts +12 -0
- package/lib/commands/pipelines/promote.js +216 -0
- package/lib/commands/pipelines/remove.d.ts +10 -0
- package/lib/commands/pipelines/remove.js +23 -0
- package/lib/commands/pipelines/rename.d.ts +10 -0
- package/lib/commands/pipelines/rename.js +33 -0
- package/lib/commands/pipelines/setup.d.ts +14 -0
- package/lib/commands/pipelines/setup.js +91 -0
- package/lib/commands/pipelines/transfer.d.ts +13 -0
- package/lib/commands/pipelines/transfer.js +65 -0
- package/lib/commands/pipelines/update.d.ts +11 -0
- package/lib/commands/pipelines/update.js +32 -0
- package/lib/commands/ps/autoscale/disable.d.ts +9 -0
- package/lib/commands/ps/autoscale/disable.js +35 -0
- package/lib/commands/ps/autoscale/enable.d.ts +13 -0
- package/lib/commands/ps/autoscale/enable.js +65 -0
- package/lib/commands/ps/wait.d.ts +12 -0
- package/lib/commands/ps/wait.js +78 -0
- package/lib/commands/rake.d.ts +14 -0
- package/lib/commands/rake.js +46 -0
- package/lib/commands/regions.d.ts +11 -0
- package/lib/commands/regions.js +45 -0
- package/lib/commands/reviewapps/disable.d.ts +17 -0
- package/lib/commands/reviewapps/disable.js +102 -0
- package/lib/commands/reviewapps/enable.d.ts +14 -0
- package/lib/commands/reviewapps/enable.js +89 -0
- package/lib/commands/run/detached.d.ts +15 -0
- package/lib/commands/run/detached.js +56 -0
- package/lib/commands/run/index.d.ts +18 -0
- package/lib/commands/run/index.js +64 -0
- package/lib/commands/run/inside.d.ts +15 -0
- package/lib/commands/run/inside.js +55 -0
- package/lib/commands/sessions/destroy.d.ts +8 -0
- package/lib/commands/sessions/destroy.js +18 -0
- package/lib/commands/sessions/index.d.ts +8 -0
- package/lib/commands/sessions/index.js +31 -0
- package/lib/commands/status.d.ts +8 -0
- package/lib/commands/status.js +46 -0
- package/lib/commands/webhooks/add.d.ts +16 -0
- package/lib/commands/webhooks/add.js +47 -0
- package/lib/commands/webhooks/deliveries/index.d.ts +12 -0
- package/lib/commands/webhooks/deliveries/index.js +80 -0
- package/lib/commands/webhooks/deliveries/info.d.ts +14 -0
- package/lib/commands/webhooks/deliveries/info.js +42 -0
- package/lib/commands/webhooks/events/index.d.ts +11 -0
- package/lib/commands/webhooks/events/index.js +46 -0
- package/lib/commands/webhooks/events/info.d.ts +14 -0
- package/lib/commands/webhooks/events/info.js +31 -0
- package/lib/commands/webhooks/index.d.ts +11 -0
- package/lib/commands/webhooks/index.js +45 -0
- package/lib/commands/webhooks/info.d.ts +14 -0
- package/lib/commands/webhooks/info.js +31 -0
- package/lib/commands/webhooks/remove.d.ts +14 -0
- package/lib/commands/webhooks/remove.js +29 -0
- package/lib/commands/webhooks/update.d.ts +19 -0
- package/lib/commands/webhooks/update.js +41 -0
- package/lib/file.js +2 -3
- package/lib/global_telemetry.d.ts +53 -0
- package/lib/global_telemetry.js +82 -0
- package/lib/hooks/command_not_found/performance_analytics.d.ts +3 -0
- package/lib/hooks/command_not_found/performance_analytics.js +7 -0
- package/lib/hooks/init/terms-of-service.js +3 -4
- package/lib/hooks/init/version.d.ts +2 -1
- package/lib/hooks/init/version.js +1 -2
- package/lib/hooks/postrun/performance_analytics.d.ts +3 -0
- package/lib/hooks/postrun/performance_analytics.js +11 -0
- package/lib/hooks/prerun/analytics.d.ts +2 -1
- package/lib/hooks/prerun/analytics.js +4 -4
- package/lib/hooks/recache.d.ts +3 -0
- package/lib/hooks/recache.js +56 -0
- package/lib/hooks/update/brew.d.ts +2 -1
- package/lib/hooks/update/brew.js +3 -5
- package/lib/hooks/update/completions.d.ts +2 -1
- package/lib/hooks/update/completions.js +2 -3
- package/lib/hooks/update/plugin-migrate.d.ts +2 -1
- package/lib/hooks/update/plugin-migrate.js +3 -5
- package/lib/hooks/update/tidy.d.ts +2 -1
- package/lib/hooks/update/tidy.js +3 -5
- package/lib/lib/authorizations/authorizations.d.ts +2 -0
- package/lib/lib/authorizations/authorizations.js +39 -0
- package/lib/lib/autocomplete/base.d.ts +11 -0
- package/lib/lib/autocomplete/base.js +44 -0
- package/lib/lib/autocomplete/cache.d.ts +2 -0
- package/lib/lib/autocomplete/cache.js +28 -0
- package/lib/lib/autocomplete/completions.d.ts +37 -0
- package/lib/lib/autocomplete/completions.js +261 -0
- package/lib/lib/buildpacks/buildpacks.d.ts +32 -0
- package/lib/lib/buildpacks/buildpacks.js +161 -0
- package/lib/lib/buildpacks/push.d.ts +0 -0
- package/lib/lib/buildpacks/push.js +4 -0
- package/lib/lib/ci/git.d.ts +8 -0
- package/lib/lib/ci/git.js +71 -0
- package/lib/lib/ci/interfaces/kolkrabbi.d.ts +311 -0
- package/lib/lib/ci/interfaces/kolkrabbi.js +7 -0
- package/lib/lib/ci/pipelines.d.ts +3 -0
- package/lib/lib/ci/pipelines.js +57 -0
- package/lib/lib/ci/source.d.ts +2 -0
- package/lib/lib/ci/source.js +42 -0
- package/lib/lib/ci/test-run.d.ts +5 -0
- package/lib/lib/ci/test-run.js +232 -0
- package/lib/lib/clients/clients.d.ts +1 -0
- package/lib/lib/clients/clients.js +25 -0
- package/lib/lib/config/quote.d.ts +2 -0
- package/lib/lib/config/quote.js +33 -0
- package/lib/lib/config/util.d.ts +3 -0
- package/lib/lib/config/util.js +12 -0
- package/lib/lib/domains/wait-for-domain.d.ts +3 -0
- package/lib/lib/domains/wait-for-domain.js +19 -0
- package/lib/lib/git/git.d.ts +8 -0
- package/lib/lib/git/git.js +56 -0
- package/lib/lib/local/fork-foreman.d.ts +1 -0
- package/lib/lib/local/fork-foreman.js +33 -0
- package/lib/lib/local/load-foreman-procfile.d.ts +0 -0
- package/lib/lib/local/load-foreman-procfile.js +2 -0
- package/lib/lib/local/run-foreman.d.ts +0 -0
- package/lib/lib/local/run-foreman.js +2 -0
- package/lib/lib/pipelines/api.d.ts +25 -0
- package/lib/lib/pipelines/api.js +130 -0
- package/lib/lib/pipelines/disambiguate.d.ts +3 -0
- package/lib/lib/pipelines/disambiguate.js +49 -0
- package/lib/lib/pipelines/github-api.d.ts +8 -0
- package/lib/lib/pipelines/github-api.js +18 -0
- package/lib/lib/pipelines/infer.d.ts +1 -0
- package/lib/lib/pipelines/infer.js +11 -0
- package/lib/lib/pipelines/key-by.d.ts +1 -0
- package/lib/lib/pipelines/key-by.js +11 -0
- package/lib/lib/pipelines/kolkrabbi-api.d.ts +14 -0
- package/lib/lib/pipelines/kolkrabbi-api.js +62 -0
- package/lib/lib/pipelines/ownership.d.ts +4 -0
- package/lib/lib/pipelines/ownership.js +40 -0
- package/lib/lib/pipelines/render-pipeline.d.ts +6 -0
- package/lib/lib/pipelines/render-pipeline.js +52 -0
- package/lib/lib/pipelines/setup/create-apps.d.ts +1 -0
- package/lib/lib/pipelines/setup/create-apps.js +44 -0
- package/lib/lib/pipelines/setup/get-ci-settings.d.ts +4 -0
- package/lib/lib/pipelines/setup/get-ci-settings.js +19 -0
- package/lib/lib/pipelines/setup/get-github-token.d.ts +1 -0
- package/lib/lib/pipelines/setup/get-github-token.js +10 -0
- package/lib/lib/pipelines/setup/get-name-and-repo.d.ts +1 -0
- package/lib/lib/pipelines/setup/get-name-and-repo.js +47 -0
- package/lib/lib/pipelines/setup/get-repo.d.ts +1 -0
- package/lib/lib/pipelines/setup/get-repo.js +8 -0
- package/lib/lib/pipelines/setup/get-settings.d.ts +9 -0
- package/lib/lib/pipelines/setup/get-settings.js +39 -0
- package/lib/lib/pipelines/setup/poll-app-setups.d.ts +1 -0
- package/lib/lib/pipelines/setup/poll-app-setups.js +25 -0
- package/lib/lib/pipelines/setup/setup-pipeline.d.ts +1 -0
- package/lib/lib/pipelines/setup/setup-pipeline.js +15 -0
- package/lib/lib/pipelines/setup/validate.d.ts +9 -0
- package/lib/lib/pipelines/setup/validate.js +31 -0
- package/lib/lib/pipelines/stages.d.ts +7 -0
- package/lib/lib/pipelines/stages.js +22 -0
- package/lib/lib/run/colorize.d.ts +2 -0
- package/lib/lib/run/colorize.js +300 -0
- package/lib/lib/run/dyno.d.ts +72 -0
- package/lib/lib/run/dyno.js +397 -0
- package/lib/lib/run/helpers.d.ts +2 -0
- package/lib/lib/run/helpers.js +34 -0
- package/lib/lib/run/line-transform.d.ts +4 -0
- package/lib/lib/run/line-transform.js +26 -0
- package/lib/lib/run/log-displayer.d.ts +10 -0
- package/lib/lib/run/log-displayer.js +79 -0
- package/lib/lib/sessions/sessions.d.ts +7 -0
- package/lib/lib/sessions/sessions.js +2 -0
- package/lib/lib/status/util.d.ts +1 -0
- package/lib/lib/status/util.js +14 -0
- package/lib/lib/webhooks/base.d.ts +13 -0
- package/lib/lib/webhooks/base.js +28 -0
- package/lib/user-config.js +2 -3
- package/oclif.manifest.json +3376 -2
- package/package.json +79 -42
- package/lib/hooks/update/b.d.ts +0 -2
- package/lib/hooks/update/b.js +0 -48
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
if ! type __ltrim_colon_completions >/dev/null 2>&1; then
|
|
4
|
+
# Copyright © 2006-2008, Ian Macdonald <ian@caliban.org>
|
|
5
|
+
# © 2009-2017, Bash Completion Maintainers
|
|
6
|
+
__ltrim_colon_completions() {
|
|
7
|
+
# If word-to-complete contains a colon,
|
|
8
|
+
# and bash-version < 4,
|
|
9
|
+
# or bash-version >= 4 and COMP_WORDBREAKS contains a colon
|
|
10
|
+
if [[
|
|
11
|
+
"$1" == *:* && (
|
|
12
|
+
${BASH_VERSINFO[0]} -lt 4 ||
|
|
13
|
+
(${BASH_VERSINFO[0]} -ge 4 && "$COMP_WORDBREAKS" == *:*)
|
|
14
|
+
)
|
|
15
|
+
]]; then
|
|
16
|
+
# Remove colon-word prefix from COMPREPLY items
|
|
17
|
+
local colon_word=${1%${1##*:}}
|
|
18
|
+
local i=${#COMPREPLY[*]}
|
|
19
|
+
while [ $((--i)) -ge 0 ]; do
|
|
20
|
+
COMPREPLY[$i]=${COMPREPLY[$i]#"$colon_word"}
|
|
21
|
+
done
|
|
22
|
+
fi
|
|
23
|
+
}
|
|
24
|
+
fi
|
|
25
|
+
|
|
26
|
+
_compreply_cli () {
|
|
27
|
+
opts=("$(heroku autocomplete:options "$(echo "${COMP_WORDS[*]}")")")
|
|
28
|
+
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
_heroku()
|
|
32
|
+
{
|
|
33
|
+
# print error and exit if vars are not set
|
|
34
|
+
: "${HEROKU_AC_ANALYTICS_DIR?}"
|
|
35
|
+
: "${HEROKU_AC_COMMANDS_PATH?}"
|
|
36
|
+
|
|
37
|
+
local cur="${COMP_WORDS[COMP_CWORD]}" opts IFS=$' \t\n'
|
|
38
|
+
COMPREPLY=()
|
|
39
|
+
mkdir -p "$HEROKU_AC_ANALYTICS_DIR"
|
|
40
|
+
|
|
41
|
+
if [[ "${COMP_CWORD}" -eq 1 ]] ; then
|
|
42
|
+
touch "$HEROKU_AC_ANALYTICS_DIR"/command
|
|
43
|
+
opts=$(grep -oe '^[a-zA-Z0-9:_-]\+' $HEROKU_AC_COMMANDS_PATH)
|
|
44
|
+
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
|
|
45
|
+
__ltrim_colon_completions "$cur"
|
|
46
|
+
else
|
|
47
|
+
if [[ $cur == "-"* ]] ; then
|
|
48
|
+
touch "$HEROKU_AC_ANALYTICS_DIR"/flag
|
|
49
|
+
opts=$(grep "${COMP_WORDS[1]}" $HEROKU_AC_COMMANDS_PATH | sed -n "s/^${COMP_WORDS[1]} //p")
|
|
50
|
+
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
|
|
51
|
+
else
|
|
52
|
+
touch "$HEROKU_AC_ANALYTICS_DIR"/value
|
|
53
|
+
_compreply_cli
|
|
54
|
+
fi
|
|
55
|
+
fi
|
|
56
|
+
return 0
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
complete -F _heroku heroku
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
#compdef heroku
|
|
2
|
+
|
|
3
|
+
### Keep in sync with zsh shim
|
|
4
|
+
HEROKU_AC_ANALYTICS_DIR=$HOME/Library/Caches/heroku/autocomplete/completion_analytics;
|
|
5
|
+
HEROKU_AC_COMMANDS_PATH=$HOME/Library/Caches/heroku/autocomplete/commands;
|
|
6
|
+
HEROKU_AC_ZSH_SETTERS_PATH=${HEROKU_AC_COMMANDS_PATH}_setters && test -f $HEROKU_AC_ZSH_SETTERS_PATH && source $HEROKU_AC_ZSH_SETTERS_PATH;
|
|
7
|
+
|
|
8
|
+
### Keep in sync with autocomplete/zsh/_heroku
|
|
9
|
+
_heroku () {
|
|
10
|
+
# exit if vars are not set
|
|
11
|
+
: "${HEROKU_AC_ANALYTICS_DIR?}"
|
|
12
|
+
: "${HEROKU_AC_COMMANDS_PATH?}"
|
|
13
|
+
|
|
14
|
+
local -a _flags=()
|
|
15
|
+
local _command_id=${words[2]}
|
|
16
|
+
local _cur=${words[CURRENT]}
|
|
17
|
+
|
|
18
|
+
mkdir -p "$HEROKU_AC_ANALYTICS_DIR"
|
|
19
|
+
|
|
20
|
+
## all commands
|
|
21
|
+
_complete_commands () {
|
|
22
|
+
touch "$HEROKU_AC_ANALYTICS_DIR"/command
|
|
23
|
+
local -a _all_commands_list
|
|
24
|
+
if type _set_all_commands_list >/dev/null 2>&1; then
|
|
25
|
+
_set_all_commands_list
|
|
26
|
+
_describe -t all-commands "all commands" _all_commands_list
|
|
27
|
+
return
|
|
28
|
+
fi
|
|
29
|
+
# fallback to grep'ing cmds from cache
|
|
30
|
+
compadd $(grep -oe '^[a-zA-Z0-9:_-]\+' $HEROKU_AC_COMMANDS_PATH)
|
|
31
|
+
}
|
|
32
|
+
## end all commands
|
|
33
|
+
|
|
34
|
+
_compadd_args () {
|
|
35
|
+
compadd $(echo $([[ -n $REPORTTIME ]] && REPORTTIME=100; heroku autocomplete:options "${words}"))
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
_compadd_flag_options () {
|
|
39
|
+
touch "$HEROKU_AC_ANALYTICS_DIR"/value
|
|
40
|
+
_compadd_args
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
if [ $CURRENT -gt 2 ]; then
|
|
44
|
+
if [[ "$_cur" == -* ]]; then
|
|
45
|
+
touch "$HEROKU_AC_ANALYTICS_DIR"/flag
|
|
46
|
+
local _flag_completion_func="_set_${_command_id//:/_}_flags"
|
|
47
|
+
declare -f $_flag_completion_func >/dev/null && $_flag_completion_func
|
|
48
|
+
else
|
|
49
|
+
if type _compadd_args >/dev/null 2>&1; then
|
|
50
|
+
_compadd_args
|
|
51
|
+
fi
|
|
52
|
+
fi
|
|
53
|
+
fi
|
|
54
|
+
|
|
55
|
+
_arguments '1: :_complete_commands' \
|
|
56
|
+
$_flags
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
_heroku
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
#compdef heroku
|
|
2
|
+
|
|
3
|
+
_heroku () {
|
|
4
|
+
# exit if vars are not set
|
|
5
|
+
: "${HEROKU_AC_ANALYTICS_DIR?}"
|
|
6
|
+
: "${HEROKU_AC_COMMANDS_PATH?}"
|
|
7
|
+
|
|
8
|
+
local -a _flags=()
|
|
9
|
+
local _command_id=${words[2]}
|
|
10
|
+
local _cur=${words[CURRENT]}
|
|
11
|
+
|
|
12
|
+
mkdir -p "$HEROKU_AC_ANALYTICS_DIR"
|
|
13
|
+
|
|
14
|
+
## all commands
|
|
15
|
+
_complete_commands () {
|
|
16
|
+
touch "$HEROKU_AC_ANALYTICS_DIR"/command
|
|
17
|
+
local -a _all_commands_list
|
|
18
|
+
if type _set_all_commands_list >/dev/null 2>&1; then
|
|
19
|
+
_set_all_commands_list
|
|
20
|
+
_describe -t all-commands "all commands" _all_commands_list
|
|
21
|
+
return
|
|
22
|
+
fi
|
|
23
|
+
# fallback to grep'ing cmds from cache
|
|
24
|
+
compadd $(grep -oe '^[a-zA-Z0-9:_-]\+' $HEROKU_AC_COMMANDS_PATH)
|
|
25
|
+
}
|
|
26
|
+
## end all commands
|
|
27
|
+
|
|
28
|
+
_compadd_args () {
|
|
29
|
+
compadd $(echo $([[ -n $REPORTTIME ]] && REPORTTIME=100; heroku autocomplete:options "${words}"))
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
_compadd_flag_options () {
|
|
33
|
+
touch "$HEROKU_AC_ANALYTICS_DIR"/value
|
|
34
|
+
_compadd_args
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
if [ $CURRENT -gt 2 ]; then
|
|
38
|
+
if [[ "$_cur" == -* ]]; then
|
|
39
|
+
touch "$HEROKU_AC_ANALYTICS_DIR"/flag
|
|
40
|
+
local _flag_completion_func="_set_${_command_id//:/_}_flags"
|
|
41
|
+
declare -f $_flag_completion_func >/dev/null && $_flag_completion_func
|
|
42
|
+
else
|
|
43
|
+
if type _compadd_args >/dev/null 2>&1; then
|
|
44
|
+
_compadd_args
|
|
45
|
+
fi
|
|
46
|
+
fi
|
|
47
|
+
fi
|
|
48
|
+
|
|
49
|
+
_arguments '1: :_complete_commands' \
|
|
50
|
+
$_flags
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
_heroku
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const os = require('os')
|
|
4
|
+
const {spawn} = require('child_process')
|
|
5
|
+
|
|
6
|
+
if (os.platform() === 'win32' || os.platform() === 'windows') console.log('skipping on windows')
|
|
7
|
+
else spawn('yarn bats test/acceptance/*.bats', {stdio: 'inherit', shell: true})
|
package/bin/dev
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const oclif = require('@oclif/core')
|
|
4
|
+
|
|
5
|
+
const path = require('path')
|
|
6
|
+
const project = path.join(__dirname, '..', 'tsconfig.json')
|
|
7
|
+
|
|
8
|
+
// In dev mode -> use ts-node and dev plugins
|
|
9
|
+
process.env.NODE_ENV = 'development'
|
|
10
|
+
|
|
11
|
+
require('ts-node').register({project})
|
|
12
|
+
|
|
13
|
+
// In dev mode, always show stack traces
|
|
14
|
+
oclif.settings.debug = true;
|
|
15
|
+
|
|
16
|
+
// Start the CLI
|
|
17
|
+
oclif.run().then(oclif.flush).catch(oclif.Errors.handle)
|
package/bin/dev.cmd
ADDED
package/bin/run
CHANGED
|
@@ -1,7 +1,42 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
+
require('dotenv').config()
|
|
4
|
+
|
|
3
5
|
process.env.HEROKU_UPDATE_INSTRUCTIONS = process.env.HEROKU_UPDATE_INSTRUCTIONS || 'update with: "npm update -g heroku"'
|
|
4
6
|
|
|
7
|
+
const now = new Date()
|
|
8
|
+
const cliStartTime = now.getTime()
|
|
9
|
+
const globalTelemetry = require('../lib/global_telemetry')
|
|
10
|
+
|
|
11
|
+
process.once('beforeExit', async code => {
|
|
12
|
+
// capture as successful exit
|
|
13
|
+
global.cliTelemetry.exitCode = code
|
|
14
|
+
global.cliTelemetry.cliRunDuration = globalTelemetry.computeDuration(cliStartTime)
|
|
15
|
+
const telemetryData = global.cliTelemetry
|
|
16
|
+
await globalTelemetry.sendTelemetry(telemetryData)
|
|
17
|
+
})
|
|
18
|
+
|
|
19
|
+
process.on('SIGINT', async () => {
|
|
20
|
+
// capture as unsuccessful exit
|
|
21
|
+
let error = new Error('Received SIGINT')
|
|
22
|
+
error.cliRunDuration = globalTelemetry.computeDuration(cliStartTime)
|
|
23
|
+
await globalTelemetry.sendTelemetry(error)
|
|
24
|
+
})
|
|
25
|
+
|
|
26
|
+
process.on('SIGTERM', async () => {
|
|
27
|
+
// capture as unsuccessful exit
|
|
28
|
+
let error = new Error('Received SIGTERM')
|
|
29
|
+
error.cliRunDuration = globalTelemetry.computeDuration(cliStartTime)
|
|
30
|
+
await globalTelemetry.sendTelemetry(error)
|
|
31
|
+
})
|
|
32
|
+
|
|
5
33
|
const oclif = require('@oclif/core')
|
|
6
34
|
|
|
7
|
-
oclif.run().then(require('@oclif/core/flush')).catch(
|
|
35
|
+
oclif.run().then(require('@oclif/core/flush')).catch(async error => {
|
|
36
|
+
// capture any errors raised by oclif
|
|
37
|
+
let cliError = error
|
|
38
|
+
cliError.cliRunDuration = globalTelemetry.computeDuration(cliStartTime)
|
|
39
|
+
await globalTelemetry.sendTelemetry(cliError)
|
|
40
|
+
console.log(`Error: ${error.message}`)
|
|
41
|
+
})
|
|
42
|
+
|
package/lib/analytics.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Interfaces } from '@oclif/core';
|
|
1
|
+
import { Command, Interfaces } from '@oclif/core';
|
|
2
2
|
import deps from './deps';
|
|
3
3
|
export interface RecordOpts {
|
|
4
|
-
Command:
|
|
4
|
+
Command: Command.Class;
|
|
5
5
|
argv: string[];
|
|
6
6
|
}
|
|
7
7
|
export interface AnalyticsInterface {
|
package/lib/analytics.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
3
|
const command_1 = require("@heroku-cli/command");
|
|
5
|
-
const netrc_parser_1 =
|
|
6
|
-
const path =
|
|
7
|
-
const deps_1 =
|
|
4
|
+
const netrc_parser_1 = require("netrc-parser");
|
|
5
|
+
const path = require("path");
|
|
6
|
+
const deps_1 = require("./deps");
|
|
8
7
|
const debug = require('debug')('heroku:analytics');
|
|
9
8
|
class AnalyticsCommand {
|
|
10
9
|
constructor(config) {
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const command_1 = require("@heroku-cli/command");
|
|
4
|
+
const core_1 = require("@oclif/core");
|
|
5
|
+
class Auth2faGenerate extends command_1.Command {
|
|
6
|
+
async run() {
|
|
7
|
+
core_1.ux.error('this command has been removed, in favor of disabling MFA in your Account Settings in a browser: https://dashboard.heroku.com/account');
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.default = Auth2faGenerate;
|
|
11
|
+
Auth2faGenerate.description = 'disables 2fa on account';
|
|
12
|
+
Auth2faGenerate.example = '$ heroku auth:2fa:disable';
|
|
13
|
+
Auth2faGenerate.aliases = [
|
|
14
|
+
'twofactor:disable',
|
|
15
|
+
'2fa:disable',
|
|
16
|
+
];
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const color_1 = require("@heroku-cli/color");
|
|
4
|
+
const command_1 = require("@heroku-cli/command");
|
|
5
|
+
class TwoFactor extends command_1.Command {
|
|
6
|
+
async run() {
|
|
7
|
+
const { body: account } = await this.heroku.get('/account');
|
|
8
|
+
if (account.two_factor_authentication) {
|
|
9
|
+
this.log(`Two-factor authentication is ${color_1.default.bold('enabled')}`);
|
|
10
|
+
}
|
|
11
|
+
else {
|
|
12
|
+
this.log(`Two-factor authentication is ${color_1.default.bold('not enabled')}`);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
exports.default = TwoFactor;
|
|
17
|
+
TwoFactor.description = 'check 2fa status';
|
|
18
|
+
TwoFactor.aliases = ['2fa', 'twofactor'];
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Command } from '@heroku-cli/command';
|
|
2
|
+
import { FlagInput } from '@oclif/core/lib/interfaces/parser';
|
|
3
|
+
export default class Login extends Command {
|
|
4
|
+
static description: string;
|
|
5
|
+
static aliases: string[];
|
|
6
|
+
static flags: FlagInput;
|
|
7
|
+
run(): Promise<void>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const color_1 = require("@heroku-cli/color");
|
|
4
|
+
const command_1 = require("@heroku-cli/command");
|
|
5
|
+
class Login extends command_1.Command {
|
|
6
|
+
async run() {
|
|
7
|
+
const { flags } = await this.parse(Login);
|
|
8
|
+
let method;
|
|
9
|
+
if (flags.interactive)
|
|
10
|
+
method = 'interactive';
|
|
11
|
+
await this.heroku.login({ method, expiresIn: flags['expires-in'], browser: flags.browser });
|
|
12
|
+
const { body: account } = await this.heroku.get('/account', { retryAuth: false });
|
|
13
|
+
this.log(`Logged in as ${color_1.default.green(account.email)}`);
|
|
14
|
+
await this.config.runHook('recache', { type: 'login' });
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.default = Login;
|
|
18
|
+
Login.description = 'login with your Heroku credentials';
|
|
19
|
+
Login.aliases = ['login'];
|
|
20
|
+
Login.flags = {
|
|
21
|
+
browser: command_1.flags.string({ description: 'browser to open SSO with (example: "firefox", "safari")' }),
|
|
22
|
+
sso: command_1.flags.boolean({ hidden: true, char: 's', description: 'login for enterprise users under SSO' }),
|
|
23
|
+
interactive: command_1.flags.boolean({ char: 'i', description: 'login with username/password' }),
|
|
24
|
+
'expires-in': command_1.flags.integer({ char: 'e', description: 'duration of token in seconds (default 30 days)' }),
|
|
25
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const command_1 = require("@heroku-cli/command");
|
|
4
|
+
const core_1 = require("@oclif/core");
|
|
5
|
+
class Logout extends command_1.Command {
|
|
6
|
+
async run() {
|
|
7
|
+
core_1.ux.action.start('Logging out');
|
|
8
|
+
await this.heroku.logout();
|
|
9
|
+
await this.config.runHook('recache', { type: 'logout' });
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
exports.default = Logout;
|
|
13
|
+
Logout.description = 'clears local login credentials and invalidates API session';
|
|
14
|
+
Logout.aliases = ['logout'];
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const color_1 = require("@heroku-cli/color");
|
|
4
|
+
const command_1 = require("@heroku-cli/command");
|
|
5
|
+
const date_fns_1 = require("date-fns");
|
|
6
|
+
class AuthToken extends command_1.Command {
|
|
7
|
+
async run() {
|
|
8
|
+
this.parse(AuthToken);
|
|
9
|
+
if (!this.heroku.auth)
|
|
10
|
+
this.error('not logged in');
|
|
11
|
+
try {
|
|
12
|
+
const { body: tokens } = await this.heroku.get('/oauth/authorizations', { retryAuth: false });
|
|
13
|
+
const token = tokens.find((t) => t.access_token && t.access_token.token === this.heroku.auth);
|
|
14
|
+
if (token && token.access_token.expires_in) {
|
|
15
|
+
const d = new Date();
|
|
16
|
+
d.setSeconds(d.getSeconds() + token.access_token.expires_in);
|
|
17
|
+
this.warn(`token will expire ${(0, date_fns_1.formatRelative)(d, new Date())}\nUse ${color_1.default.cmd('heroku authorizations:create')} to generate a long-term token`);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
catch (error) {
|
|
21
|
+
this.warn(error);
|
|
22
|
+
}
|
|
23
|
+
this.log(this.heroku.auth);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
exports.default = AuthToken;
|
|
27
|
+
AuthToken.description = `outputs current CLI authentication token.
|
|
28
|
+
By default, the CLI auth token is only valid for 1 year. To generate a long-lived token, use heroku authorizations:create`;
|
|
29
|
+
AuthToken.flags = {
|
|
30
|
+
help: command_1.flags.help({ char: 'h' }),
|
|
31
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const command_1 = require("@heroku-cli/command");
|
|
4
|
+
class AuthWhoami extends command_1.Command {
|
|
5
|
+
async run() {
|
|
6
|
+
if (process.env.HEROKU_API_KEY)
|
|
7
|
+
this.warn('HEROKU_API_KEY is set');
|
|
8
|
+
if (!this.heroku.auth)
|
|
9
|
+
this.notloggedin();
|
|
10
|
+
try {
|
|
11
|
+
const { body: account } = await this.heroku.get('/account', { retryAuth: false });
|
|
12
|
+
this.log(account.email);
|
|
13
|
+
}
|
|
14
|
+
catch (error) {
|
|
15
|
+
if (error.statusCode === 401)
|
|
16
|
+
this.notloggedin();
|
|
17
|
+
throw error;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
notloggedin() {
|
|
21
|
+
this.error('not logged in', { exit: 100 });
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
exports.default = AuthWhoami;
|
|
25
|
+
AuthWhoami.description = 'display the current logged in user';
|
|
26
|
+
AuthWhoami.aliases = ['whoami'];
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Command } from '@heroku-cli/command';
|
|
2
|
+
export default class AuthorizationsCreate extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static flags: {
|
|
6
|
+
description: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
7
|
+
short: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
8
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
9
|
+
scope: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
10
|
+
'expires-in': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
11
|
+
};
|
|
12
|
+
run(): Promise<void>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const command_1 = require("@heroku-cli/command");
|
|
4
|
+
const completions_1 = require("@heroku-cli/command/lib/completions");
|
|
5
|
+
const core_1 = require("@oclif/core");
|
|
6
|
+
const authorizations_1 = require("../../lib/authorizations/authorizations");
|
|
7
|
+
class AuthorizationsCreate extends command_1.Command {
|
|
8
|
+
async run() {
|
|
9
|
+
const { flags } = await this.parse(AuthorizationsCreate);
|
|
10
|
+
core_1.ux.action.start('Creating OAuth Authorization');
|
|
11
|
+
const { body: auth } = await this.heroku.post('/oauth/authorizations', {
|
|
12
|
+
body: {
|
|
13
|
+
description: flags.description,
|
|
14
|
+
scope: flags.scope ? flags.scope.split(',') : undefined,
|
|
15
|
+
expires_in: flags['expires-in'],
|
|
16
|
+
},
|
|
17
|
+
});
|
|
18
|
+
core_1.ux.action.stop();
|
|
19
|
+
if (flags.short) {
|
|
20
|
+
core_1.ux.log(auth.access_token && auth.access_token.token);
|
|
21
|
+
}
|
|
22
|
+
else if (flags.json) {
|
|
23
|
+
core_1.ux.styledJSON(auth);
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
(0, authorizations_1.display)(auth);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
exports.default = AuthorizationsCreate;
|
|
31
|
+
AuthorizationsCreate.description = 'create a new OAuth authorization';
|
|
32
|
+
AuthorizationsCreate.examples = [
|
|
33
|
+
'$ heroku authorizations:create --description "For use with Anvil"',
|
|
34
|
+
];
|
|
35
|
+
AuthorizationsCreate.flags = {
|
|
36
|
+
description: command_1.flags.string({ char: 'd', description: 'set a custom authorization' }),
|
|
37
|
+
short: command_1.flags.boolean({ char: 'S', description: 'only output token' }),
|
|
38
|
+
json: command_1.flags.boolean({ char: 'j', description: 'output in json format' }),
|
|
39
|
+
scope: command_1.flags.string({ char: 's', description: 'set custom OAuth scopes', completion: completions_1.ScopeCompletion }),
|
|
40
|
+
'expires-in': command_1.flags.string({ char: 'e', description: 'set expiration in seconds (default no expiration)' }),
|
|
41
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Command } from '@heroku-cli/command';
|
|
2
|
+
export default class AuthorizationsIndex extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static flags: {
|
|
6
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
7
|
+
};
|
|
8
|
+
run(): Promise<void>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const color_1 = require("@heroku-cli/color");
|
|
4
|
+
const command_1 = require("@heroku-cli/command");
|
|
5
|
+
const core_1 = require("@oclif/core");
|
|
6
|
+
const { sortBy } = require('lodash');
|
|
7
|
+
class AuthorizationsIndex extends command_1.Command {
|
|
8
|
+
async run() {
|
|
9
|
+
const { flags } = await this.parse(AuthorizationsIndex);
|
|
10
|
+
let { body: authorizations } = await this.heroku.get('/oauth/authorizations');
|
|
11
|
+
authorizations = sortBy(authorizations, 'description');
|
|
12
|
+
if (flags.json) {
|
|
13
|
+
core_1.ux.styledJSON(authorizations);
|
|
14
|
+
}
|
|
15
|
+
else if (authorizations.length === 0) {
|
|
16
|
+
core_1.ux.log('No OAuth authorizations.');
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
const printLine = (...args) => this.log(...args);
|
|
20
|
+
core_1.ux.table(authorizations, {
|
|
21
|
+
description: { get: (v) => color_1.default.green(v.description) },
|
|
22
|
+
id: {},
|
|
23
|
+
scope: { get: (v) => v.scope.join(',') },
|
|
24
|
+
}, { 'no-header': true, printLine });
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
exports.default = AuthorizationsIndex;
|
|
29
|
+
AuthorizationsIndex.description = 'list OAuth authorizations';
|
|
30
|
+
AuthorizationsIndex.examples = [
|
|
31
|
+
'$ heroku authorizations',
|
|
32
|
+
];
|
|
33
|
+
AuthorizationsIndex.flags = {
|
|
34
|
+
json: command_1.flags.boolean({ char: 'j', description: 'output in json format' }),
|
|
35
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Command } from '@heroku-cli/command';
|
|
2
|
+
export default class AuthorizationsInfo extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static flags: {
|
|
5
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
6
|
+
};
|
|
7
|
+
static args: {
|
|
8
|
+
id: import("@oclif/core/lib/interfaces/parser").Arg<string, Record<string, unknown>>;
|
|
9
|
+
};
|
|
10
|
+
run(): Promise<void>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const command_1 = require("@heroku-cli/command");
|
|
4
|
+
const core_1 = require("@oclif/core");
|
|
5
|
+
const authorizations_1 = require("../../lib/authorizations/authorizations");
|
|
6
|
+
class AuthorizationsInfo extends command_1.Command {
|
|
7
|
+
async run() {
|
|
8
|
+
const { args, flags } = await this.parse(AuthorizationsInfo);
|
|
9
|
+
const { body: authentication } = await this.heroku.get(`/oauth/authorizations/${args.id}`);
|
|
10
|
+
if (flags.json) {
|
|
11
|
+
core_1.ux.styledJSON(authentication);
|
|
12
|
+
}
|
|
13
|
+
else {
|
|
14
|
+
(0, authorizations_1.display)(authentication);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
exports.default = AuthorizationsInfo;
|
|
19
|
+
AuthorizationsInfo.description = 'show an existing OAuth authorization';
|
|
20
|
+
AuthorizationsInfo.flags = {
|
|
21
|
+
json: command_1.flags.boolean({ char: 'j', description: 'output in json format' }),
|
|
22
|
+
};
|
|
23
|
+
AuthorizationsInfo.args = {
|
|
24
|
+
id: core_1.Args.string({ required: true }),
|
|
25
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Command } from '@heroku-cli/command';
|
|
2
|
+
export default class AuthorizationsRevoke extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static aliases: string[];
|
|
5
|
+
static examples: string[];
|
|
6
|
+
static args: {
|
|
7
|
+
id: import("@oclif/core/lib/interfaces/parser").Arg<string, Record<string, unknown>>;
|
|
8
|
+
};
|
|
9
|
+
run(): Promise<void>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const color_1 = require("@heroku-cli/color");
|
|
4
|
+
const command_1 = require("@heroku-cli/command");
|
|
5
|
+
const core_1 = require("@oclif/core");
|
|
6
|
+
class AuthorizationsRevoke extends command_1.Command {
|
|
7
|
+
async run() {
|
|
8
|
+
const { args } = await this.parse(AuthorizationsRevoke);
|
|
9
|
+
core_1.ux.action.start('Revoking OAuth Authorization');
|
|
10
|
+
const { body: auth } = await this.heroku.delete(`/oauth/authorizations/${encodeURIComponent(args.id)}`);
|
|
11
|
+
core_1.ux.action.stop(`done, revoked authorization from ${color_1.default.cyan(auth.description)}`);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
exports.default = AuthorizationsRevoke;
|
|
15
|
+
AuthorizationsRevoke.description = 'revoke OAuth authorization';
|
|
16
|
+
AuthorizationsRevoke.aliases = ['authorizations:revoke', 'authorizations:destroy'];
|
|
17
|
+
AuthorizationsRevoke.examples = [
|
|
18
|
+
'$ heroku authorizations:revoke 105a7bfa-34c3-476e-873a-b1ac3fdc12fb',
|
|
19
|
+
];
|
|
20
|
+
AuthorizationsRevoke.args = {
|
|
21
|
+
id: core_1.Args.string({ required: true }),
|
|
22
|
+
};
|