heroku 8.1.9 → 8.2.0-beta.1
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 +5 -6
- 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 +80 -43
- package/lib/hooks/update/b.d.ts +0 -2
- package/lib/hooks/update/b.js +0 -48
|
@@ -0,0 +1,56 @@
|
|
|
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 true_myth_1 = require("true-myth");
|
|
6
|
+
const buildpack_registry_1 = require("@heroku/buildpack-registry");
|
|
7
|
+
class Versions extends command_1.Command {
|
|
8
|
+
async run() {
|
|
9
|
+
const { args } = await this.parse(Versions);
|
|
10
|
+
const herokuAuth = this.heroku.auth || '';
|
|
11
|
+
if (herokuAuth === '') {
|
|
12
|
+
this.error('You need to be logged in to run this command.');
|
|
13
|
+
}
|
|
14
|
+
const registry = new buildpack_registry_1.BuildpackRegistry();
|
|
15
|
+
true_myth_1.Result.match({
|
|
16
|
+
Ok: _ => { },
|
|
17
|
+
Err: err => {
|
|
18
|
+
this.error(`Could not find the buildpack.\n${err}`);
|
|
19
|
+
},
|
|
20
|
+
}, buildpack_registry_1.BuildpackRegistry.isValidBuildpackSlug(args.buildpack));
|
|
21
|
+
const result = await registry.listVersions(args.buildpack);
|
|
22
|
+
true_myth_1.Result.match({
|
|
23
|
+
Ok: versions => {
|
|
24
|
+
core_1.ux.table(versions.sort((a, b) => {
|
|
25
|
+
return a.release > b.release ? -1 : 1;
|
|
26
|
+
}), {
|
|
27
|
+
release: {
|
|
28
|
+
header: 'Version',
|
|
29
|
+
},
|
|
30
|
+
created_at: {
|
|
31
|
+
header: 'Released At',
|
|
32
|
+
},
|
|
33
|
+
status: {
|
|
34
|
+
header: 'Status',
|
|
35
|
+
},
|
|
36
|
+
});
|
|
37
|
+
},
|
|
38
|
+
Err: err => {
|
|
39
|
+
if (err.status === 404) {
|
|
40
|
+
this.error(`Could not find '${args.buildpack}'`);
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
this.error(`Problem fetching versions, ${err.status}: ${err.description}`);
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
}, result);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
exports.default = Versions;
|
|
50
|
+
Versions.description = 'list versions of a buildpack';
|
|
51
|
+
Versions.args = {
|
|
52
|
+
buildpack: core_1.Args.string({
|
|
53
|
+
required: true,
|
|
54
|
+
description: 'namespace/name of the buildpack',
|
|
55
|
+
}),
|
|
56
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Command } from '@oclif/core';
|
|
2
|
+
export default class CertsAutoWait extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static hidden: boolean;
|
|
5
|
+
static flags: {
|
|
6
|
+
help: import("@oclif/core/lib/interfaces").BooleanFlag<void>;
|
|
7
|
+
};
|
|
8
|
+
run(): Promise<void>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const core_1 = require("@oclif/core");
|
|
4
|
+
class CertsAutoWait extends core_1.Command {
|
|
5
|
+
async run() {
|
|
6
|
+
this.parse(CertsAutoWait);
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
exports.default = CertsAutoWait;
|
|
10
|
+
CertsAutoWait.description = 'waits for the certificate to be activated';
|
|
11
|
+
CertsAutoWait.hidden = true;
|
|
12
|
+
CertsAutoWait.flags = {
|
|
13
|
+
help: core_1.Flags.help({ char: 'h' }),
|
|
14
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Command } from '@heroku-cli/command';
|
|
2
|
+
export default class CiIndex extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static flags: {
|
|
6
|
+
app: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
7
|
+
watch: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
8
|
+
pipeline: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
9
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
10
|
+
};
|
|
11
|
+
run(): Promise<void>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const command_1 = require("@heroku-cli/command");
|
|
4
|
+
const pipelines_1 = require("../../lib/ci/pipelines");
|
|
5
|
+
const test_run_1 = require("../../lib/ci/test-run");
|
|
6
|
+
class CiIndex extends command_1.Command {
|
|
7
|
+
async run() {
|
|
8
|
+
const { flags } = await this.parse(CiIndex);
|
|
9
|
+
const pipeline = await (0, pipelines_1.getPipeline)(flags, this);
|
|
10
|
+
const { body: testRuns } = await this.heroku.get(`/pipelines/${pipeline.id}/test-runs`);
|
|
11
|
+
await (0, test_run_1.renderList)(this, testRuns, pipeline, flags.watch, flags.json);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
exports.default = CiIndex;
|
|
15
|
+
CiIndex.description = 'display the most recent CI runs for the given pipeline';
|
|
16
|
+
CiIndex.examples = [
|
|
17
|
+
`$ heroku ci --app murmuring-headland-14719
|
|
18
|
+
`,
|
|
19
|
+
];
|
|
20
|
+
CiIndex.flags = {
|
|
21
|
+
app: command_1.flags.string({ char: 'a', description: 'app name' }),
|
|
22
|
+
watch: command_1.flags.boolean({ description: 'keep running and watch for new and update tests', required: false }),
|
|
23
|
+
pipeline: command_1.flags.pipeline({ required: false }),
|
|
24
|
+
json: command_1.flags.boolean({ description: 'output in json format', required: false }),
|
|
25
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Command } from '@heroku-cli/command';
|
|
2
|
+
export default class CiInfo extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static flags: {
|
|
6
|
+
app: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
7
|
+
node: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
8
|
+
pipeline: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
9
|
+
};
|
|
10
|
+
static args: {
|
|
11
|
+
'test-run': import("@oclif/core/lib/interfaces/parser").Arg<string, Record<string, unknown>>;
|
|
12
|
+
};
|
|
13
|
+
run(): Promise<void>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
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 pipelines_1 = require("../../lib/ci/pipelines");
|
|
6
|
+
const test_run_1 = require("../../lib/ci/test-run");
|
|
7
|
+
class CiInfo extends command_1.Command {
|
|
8
|
+
async run() {
|
|
9
|
+
const { args, flags } = await this.parse(CiInfo);
|
|
10
|
+
const pipeline = await (0, pipelines_1.getPipeline)(flags, this);
|
|
11
|
+
const { body: testRun } = await this.heroku.get(`/pipelines/${pipeline.id}/test-runs/${args['test-run']}`);
|
|
12
|
+
const { body: testNodes } = await this.heroku.get(`/test-runs/${testRun.id}/test-nodes`);
|
|
13
|
+
await (0, test_run_1.displayTestRunInfo)(this, testRun, testNodes, flags.node);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
exports.default = CiInfo;
|
|
17
|
+
CiInfo.description = 'show the status of a specific test run';
|
|
18
|
+
CiInfo.examples = [
|
|
19
|
+
`$ heroku ci:info 1288 --app murmuring-headland-14719
|
|
20
|
+
`,
|
|
21
|
+
];
|
|
22
|
+
CiInfo.flags = {
|
|
23
|
+
app: command_1.flags.string({ char: 'a', description: 'app name' }),
|
|
24
|
+
node: command_1.flags.string({ description: 'the node number to show its setup and output', required: false }),
|
|
25
|
+
pipeline: command_1.flags.pipeline({ required: false }),
|
|
26
|
+
};
|
|
27
|
+
CiInfo.args = {
|
|
28
|
+
'test-run': core_1.Args.string({ required: true }),
|
|
29
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Command } from '@heroku-cli/command';
|
|
2
|
+
export default class CiLast extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static flags: {
|
|
6
|
+
app: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
7
|
+
node: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
8
|
+
pipeline: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
9
|
+
};
|
|
10
|
+
run(): Promise<void>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
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 pipelines_1 = require("../../lib/ci/pipelines");
|
|
6
|
+
const test_run_1 = require("../../lib/ci/test-run");
|
|
7
|
+
class CiLast extends command_1.Command {
|
|
8
|
+
async run() {
|
|
9
|
+
const { flags } = await this.parse(CiLast);
|
|
10
|
+
const pipeline = await (0, pipelines_1.getPipeline)(flags, this);
|
|
11
|
+
const headers = { Range: 'number ..; order=desc,max=1' };
|
|
12
|
+
const { body: latestTestRuns } = await this.heroku.get(`/pipelines/${pipeline.id}/test-runs`, { headers });
|
|
13
|
+
if (latestTestRuns.length === 0) {
|
|
14
|
+
return core_1.ux.warn('No Heroku CI runs found for the specified app and/or pipeline.');
|
|
15
|
+
}
|
|
16
|
+
const { body: testRun } = await this.heroku.get(`/pipelines/${pipeline.id}/test-runs/${latestTestRuns[0].number}`);
|
|
17
|
+
const { body: testNodes } = await this.heroku.get(`/test-runs/${testRun.id}/test-nodes`);
|
|
18
|
+
await (0, test_run_1.displayTestRunInfo)(this, testRun, testNodes, flags.node);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
exports.default = CiLast;
|
|
22
|
+
CiLast.description = 'looks for the most recent run and returns the output of that run';
|
|
23
|
+
CiLast.examples = [
|
|
24
|
+
`$ heroku ci:last --pipeline=my-pipeline --node 100
|
|
25
|
+
`,
|
|
26
|
+
];
|
|
27
|
+
CiLast.flags = {
|
|
28
|
+
app: command_1.flags.string({ char: 'a', description: 'app name' }),
|
|
29
|
+
node: command_1.flags.string({ description: 'the node number to show its setup and output', required: false }),
|
|
30
|
+
pipeline: command_1.flags.pipeline({ required: false }),
|
|
31
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Command } from '@heroku-cli/command';
|
|
2
|
+
export default class CiReRun extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static flags: {
|
|
6
|
+
app: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
7
|
+
pipeline: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
8
|
+
};
|
|
9
|
+
static args: {
|
|
10
|
+
number: import("@oclif/core/lib/interfaces/parser").Arg<string | undefined, Record<string, unknown>>;
|
|
11
|
+
};
|
|
12
|
+
run(): Promise<void>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
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 pipelines_1 = require("../../lib/ci/pipelines");
|
|
6
|
+
const source_1 = require("../../lib/ci/source");
|
|
7
|
+
const test_run_1 = require("../../lib/ci/test-run");
|
|
8
|
+
class CiReRun extends command_1.Command {
|
|
9
|
+
async run() {
|
|
10
|
+
const { flags, args } = await this.parse(CiReRun);
|
|
11
|
+
const pipeline = await (0, pipelines_1.getPipeline)(flags, this);
|
|
12
|
+
let sourceTestRun;
|
|
13
|
+
if (args.number) {
|
|
14
|
+
const testRunResponse = await this.heroku.get(`/pipelines/${pipeline.id}/test-runs/${args.number}`);
|
|
15
|
+
sourceTestRun = testRunResponse.body;
|
|
16
|
+
}
|
|
17
|
+
else {
|
|
18
|
+
const { body: testRuns } = await this.heroku.get(`/pipelines/${pipeline.id}/test-runs`, { headers: { Range: 'number ..; order=desc,max=1' } });
|
|
19
|
+
sourceTestRun = testRuns[0];
|
|
20
|
+
}
|
|
21
|
+
this.log(`Rerunning test run #${sourceTestRun.number}...`);
|
|
22
|
+
core_1.ux.action.start('Preparing source');
|
|
23
|
+
const sourceBlobUrl = await (0, source_1.createSourceBlob)(sourceTestRun.commit_sha, this);
|
|
24
|
+
core_1.ux.action.stop();
|
|
25
|
+
const { body: pipelineRepository } = await this.heroku.get(`https://kolkrabbi.heroku.com/pipelines/${pipeline.id}/repository`);
|
|
26
|
+
core_1.ux.action.start('Starting test run');
|
|
27
|
+
const organization = pipelineRepository.organization && pipelineRepository.organization.name;
|
|
28
|
+
const { body: testRun } = await this.heroku.post('/test-runs', { body: {
|
|
29
|
+
commit_branch: sourceTestRun.commit_branch,
|
|
30
|
+
commit_message: sourceTestRun.commit_message,
|
|
31
|
+
commit_sha: sourceTestRun.commit_sha,
|
|
32
|
+
pipeline: pipeline.id,
|
|
33
|
+
organization,
|
|
34
|
+
source_blob_url: sourceBlobUrl,
|
|
35
|
+
},
|
|
36
|
+
});
|
|
37
|
+
core_1.ux.action.stop();
|
|
38
|
+
await (0, test_run_1.displayAndExit)(pipeline, testRun.number, this);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
exports.default = CiReRun;
|
|
42
|
+
CiReRun.description = 'rerun tests against current directory';
|
|
43
|
+
CiReRun.examples = [
|
|
44
|
+
`$ heroku ci:rerun 985 --app murmuring-headland-14719
|
|
45
|
+
`,
|
|
46
|
+
];
|
|
47
|
+
CiReRun.flags = {
|
|
48
|
+
app: command_1.flags.string({ char: 'a', description: 'app name' }),
|
|
49
|
+
pipeline: command_1.flags.pipeline({ required: false }),
|
|
50
|
+
};
|
|
51
|
+
CiReRun.args = {
|
|
52
|
+
number: core_1.Args.string({ required: false }),
|
|
53
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Command } from '@heroku-cli/command';
|
|
2
|
+
export default class CiRun extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static flags: {
|
|
6
|
+
app: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
7
|
+
pipeline: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
8
|
+
};
|
|
9
|
+
run(): Promise<void>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
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 git = require("../../lib/ci/git");
|
|
6
|
+
const pipelines_1 = require("../../lib/ci/pipelines");
|
|
7
|
+
const source_1 = require("../../lib/ci/source");
|
|
8
|
+
const test_run_1 = require("../../lib/ci/test-run");
|
|
9
|
+
class CiRun extends command_1.Command {
|
|
10
|
+
async run() {
|
|
11
|
+
const { flags } = await this.parse(CiRun);
|
|
12
|
+
const pipeline = await (0, pipelines_1.getPipeline)(flags, this);
|
|
13
|
+
const commit = await git.readCommit('HEAD');
|
|
14
|
+
core_1.ux.action.start('Preparing source');
|
|
15
|
+
const sourceBlobUrl = await (0, source_1.createSourceBlob)(commit.ref, this);
|
|
16
|
+
core_1.ux.action.stop();
|
|
17
|
+
core_1.ux.action.start('Starting test run');
|
|
18
|
+
const { body: pipelineRepository } = await this.heroku.get(`https://kolkrabbi.heroku.com/pipelines/${pipeline.id}/repository`);
|
|
19
|
+
const organization = pipelineRepository.organization && pipelineRepository.organization.name;
|
|
20
|
+
const { body: testRun } = await this.heroku.post('/test-runs', { body: {
|
|
21
|
+
commit_branch: commit.branch,
|
|
22
|
+
commit_message: commit.message,
|
|
23
|
+
commit_sha: commit.ref,
|
|
24
|
+
pipeline: pipeline.id,
|
|
25
|
+
organization,
|
|
26
|
+
source_blob_url: sourceBlobUrl,
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
core_1.ux.action.stop();
|
|
30
|
+
await (0, test_run_1.displayAndExit)(pipeline, testRun.number, this);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
exports.default = CiRun;
|
|
34
|
+
CiRun.description = 'run tests against current directory';
|
|
35
|
+
CiRun.examples = [
|
|
36
|
+
`$ heroku ci:run --app murmuring-headland-14719
|
|
37
|
+
`,
|
|
38
|
+
];
|
|
39
|
+
CiRun.flags = {
|
|
40
|
+
app: command_1.flags.string({ char: 'a', description: 'app name' }),
|
|
41
|
+
pipeline: command_1.flags.pipeline({ required: false }),
|
|
42
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Command } from '@heroku-cli/command';
|
|
2
|
+
export default class ClientsCreate extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static flags: {
|
|
6
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
7
|
+
shell: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
8
|
+
};
|
|
9
|
+
static args: {
|
|
10
|
+
name: import("@oclif/core/lib/interfaces/parser").Arg<string, Record<string, unknown>>;
|
|
11
|
+
redirect_uri: import("@oclif/core/lib/interfaces/parser").Arg<string, Record<string, unknown>>;
|
|
12
|
+
};
|
|
13
|
+
run(): Promise<void>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
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 clients_1 = require("../../lib/clients/clients");
|
|
6
|
+
class ClientsCreate extends command_1.Command {
|
|
7
|
+
async run() {
|
|
8
|
+
const { args, flags } = await this.parse(ClientsCreate);
|
|
9
|
+
const { redirect_uri, name } = args;
|
|
10
|
+
(0, clients_1.validateURL)(redirect_uri);
|
|
11
|
+
core_1.ux.action.start(`Creating ${name}`);
|
|
12
|
+
const { body: client } = await this.heroku.post('/oauth/clients', {
|
|
13
|
+
body: { name, redirect_uri },
|
|
14
|
+
});
|
|
15
|
+
core_1.ux.action.stop();
|
|
16
|
+
if (flags.json) {
|
|
17
|
+
core_1.ux.styledJSON(client);
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
core_1.ux.log(`HEROKU_OAUTH_ID=${client.id}`);
|
|
21
|
+
core_1.ux.log(`HEROKU_OAUTH_SECRET=${client.secret}`);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
exports.default = ClientsCreate;
|
|
26
|
+
ClientsCreate.description = 'create a new OAuth client';
|
|
27
|
+
ClientsCreate.examples = [
|
|
28
|
+
'$ heroku clients:create "Amazing" https://amazing-client.herokuapp.com/auth/heroku/callback',
|
|
29
|
+
];
|
|
30
|
+
ClientsCreate.flags = {
|
|
31
|
+
json: command_1.flags.boolean({ char: 'j', description: 'output in json format' }),
|
|
32
|
+
shell: command_1.flags.boolean({ char: 's', description: 'output in shell format' }),
|
|
33
|
+
};
|
|
34
|
+
ClientsCreate.args = {
|
|
35
|
+
name: core_1.Args.string({ required: true }),
|
|
36
|
+
redirect_uri: core_1.Args.string({ required: true }),
|
|
37
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Command } from '@heroku-cli/command';
|
|
2
|
+
export default class ClientsDestroy extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static args: {
|
|
5
|
+
id: import("@oclif/core/lib/interfaces/parser").Arg<string, Record<string, unknown>>;
|
|
6
|
+
};
|
|
7
|
+
run(): Promise<void>;
|
|
8
|
+
}
|
|
@@ -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
|
+
const core_1 = require("@oclif/core");
|
|
6
|
+
class ClientsDestroy extends command_1.Command {
|
|
7
|
+
async run() {
|
|
8
|
+
const { args } = await this.parse(ClientsDestroy);
|
|
9
|
+
core_1.ux.action.start(`Destroying ${color_1.default.cyan(args.id)}`);
|
|
10
|
+
await this.heroku.delete(`/oauth/clients/${args.id}`);
|
|
11
|
+
core_1.ux.action.stop();
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
exports.default = ClientsDestroy;
|
|
15
|
+
ClientsDestroy.description = 'delete client by ID';
|
|
16
|
+
ClientsDestroy.args = {
|
|
17
|
+
id: core_1.Args.string({ required: true }),
|
|
18
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
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 ClientsIndex extends command_1.Command {
|
|
8
|
+
async run() {
|
|
9
|
+
const { flags } = await this.parse(ClientsIndex);
|
|
10
|
+
let { body: clients } = await this.heroku.get('/oauth/clients');
|
|
11
|
+
clients = sortBy(clients, 'name');
|
|
12
|
+
if (flags.json) {
|
|
13
|
+
core_1.ux.styledJSON(clients);
|
|
14
|
+
}
|
|
15
|
+
else if (clients.length === 0) {
|
|
16
|
+
core_1.ux.log('No OAuth clients.');
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
const printLine = (...args) => this.log(...args);
|
|
20
|
+
core_1.ux.table(clients, {
|
|
21
|
+
name: { get: (w) => color_1.default.green(w.name) },
|
|
22
|
+
id: {},
|
|
23
|
+
redirect_uri: {},
|
|
24
|
+
}, { 'no-header': true, printLine });
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
exports.default = ClientsIndex;
|
|
29
|
+
ClientsIndex.description = 'list your OAuth clients';
|
|
30
|
+
ClientsIndex.flags = {
|
|
31
|
+
json: command_1.flags.boolean({ char: 'j', name: 'json', description: 'output in json format' }),
|
|
32
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Command } from '@heroku-cli/command';
|
|
2
|
+
export default class ClientsInfo extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static flags: {
|
|
6
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
7
|
+
shell: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
8
|
+
};
|
|
9
|
+
static args: {
|
|
10
|
+
id: import("@oclif/core/lib/interfaces/parser").Arg<string, Record<string, unknown>>;
|
|
11
|
+
};
|
|
12
|
+
run(): Promise<void>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
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 ClientsInfo extends command_1.Command {
|
|
6
|
+
async run() {
|
|
7
|
+
const { args, flags } = await this.parse(ClientsInfo);
|
|
8
|
+
const { body: client } = await this.heroku.get(`/oauth/clients/${args.id}`);
|
|
9
|
+
if (flags.json) {
|
|
10
|
+
core_1.ux.styledJSON(client);
|
|
11
|
+
}
|
|
12
|
+
else if (flags.shell) {
|
|
13
|
+
core_1.ux.log(`HEROKU_OAUTH_ID=${client.id}`);
|
|
14
|
+
core_1.ux.log(`HEROKU_OAUTH_SECRET=${client.secret}`);
|
|
15
|
+
}
|
|
16
|
+
else {
|
|
17
|
+
core_1.ux.styledHeader(`${client.name}`);
|
|
18
|
+
core_1.ux.styledObject(client);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.default = ClientsInfo;
|
|
23
|
+
ClientsInfo.description = 'show details of an oauth client';
|
|
24
|
+
ClientsInfo.examples = [
|
|
25
|
+
'$ heroku clients:info 36120128-fee7-455e-8b7f-807aee130946',
|
|
26
|
+
];
|
|
27
|
+
ClientsInfo.flags = {
|
|
28
|
+
json: command_1.flags.boolean({ char: 'j', description: 'output in json format' }),
|
|
29
|
+
shell: command_1.flags.boolean({ char: 's', description: 'output in shell format' }),
|
|
30
|
+
};
|
|
31
|
+
ClientsInfo.args = {
|
|
32
|
+
id: core_1.Args.string({ required: true }),
|
|
33
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Command } from '@heroku-cli/command';
|
|
2
|
+
export default class ClientsRotate extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static flags: {
|
|
5
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
6
|
+
shell: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
7
|
+
};
|
|
8
|
+
static args: {
|
|
9
|
+
id: import("@oclif/core/lib/interfaces/parser").Arg<string, Record<string, unknown>>;
|
|
10
|
+
};
|
|
11
|
+
run(): Promise<void>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
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 ClientsRotate extends command_1.Command {
|
|
7
|
+
async run() {
|
|
8
|
+
const { args, flags } = await this.parse(ClientsRotate);
|
|
9
|
+
core_1.ux.action.start(`Updating ${color_1.default.cyan(args.id)}`);
|
|
10
|
+
const { body: client } = await this.heroku.post(`/oauth/clients/${encodeURIComponent(args.id)}/actions/rotate-credentials`);
|
|
11
|
+
core_1.ux.action.stop();
|
|
12
|
+
if (flags.json) {
|
|
13
|
+
core_1.ux.styledJSON(client);
|
|
14
|
+
}
|
|
15
|
+
else if (flags.shell) {
|
|
16
|
+
core_1.ux.log(`HEROKU_OAUTH_ID=${client.id}`);
|
|
17
|
+
core_1.ux.log(`HEROKU_OAUTH_SECRET=${client.secret}`);
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
core_1.ux.styledHeader(`${client.name}`);
|
|
21
|
+
core_1.ux.styledObject(client);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
exports.default = ClientsRotate;
|
|
26
|
+
ClientsRotate.description = 'rotate OAuth client secret';
|
|
27
|
+
ClientsRotate.flags = {
|
|
28
|
+
json: command_1.flags.boolean({ char: 'j', description: 'output in json format' }),
|
|
29
|
+
shell: command_1.flags.boolean({ char: 's', description: 'output in shell format' }),
|
|
30
|
+
};
|
|
31
|
+
ClientsRotate.args = {
|
|
32
|
+
id: core_1.Args.string({ required: true }),
|
|
33
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Command } from '@heroku-cli/command';
|
|
2
|
+
export default class ClientsUpdate extends Command {
|
|
3
|
+
static description: string;
|
|
4
|
+
static examples: string[];
|
|
5
|
+
static flags: {
|
|
6
|
+
name: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
7
|
+
url: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
8
|
+
};
|
|
9
|
+
static args: {
|
|
10
|
+
id: import("@oclif/core/lib/interfaces/parser").Arg<string, Record<string, unknown>>;
|
|
11
|
+
};
|
|
12
|
+
run(): Promise<void>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
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 clients_1 = require("../../lib/clients/clients");
|
|
7
|
+
const isEmpty = (o) => Object.keys(o).length === 0;
|
|
8
|
+
const getUpdates = (flags) => {
|
|
9
|
+
const updates = {};
|
|
10
|
+
if (flags.url)
|
|
11
|
+
updates.redirect_uri = (0, clients_1.validateURL)(flags.url);
|
|
12
|
+
if (flags.name)
|
|
13
|
+
updates.name = flags.name;
|
|
14
|
+
return updates;
|
|
15
|
+
};
|
|
16
|
+
class ClientsUpdate extends command_1.Command {
|
|
17
|
+
async run() {
|
|
18
|
+
const { args, flags } = await this.parse(ClientsUpdate);
|
|
19
|
+
const body = getUpdates(flags);
|
|
20
|
+
if (isEmpty(body))
|
|
21
|
+
this.error('No changes provided.');
|
|
22
|
+
core_1.ux.action.start(`Updating ${color_1.default.cyan(args.id)}`);
|
|
23
|
+
await this.heroku.patch(`/oauth/clients/${encodeURIComponent(args.id)}`, { body });
|
|
24
|
+
core_1.ux.action.stop();
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
exports.default = ClientsUpdate;
|
|
28
|
+
ClientsUpdate.description = 'update OAuth client';
|
|
29
|
+
ClientsUpdate.examples = [
|
|
30
|
+
'$ heroku clients:update 3e304bda-d376-4278-bdea-6d6c08aa1359 --url https://amazing-client.herokuapp.com/auth/heroku/callback',
|
|
31
|
+
];
|
|
32
|
+
ClientsUpdate.flags = {
|
|
33
|
+
name: command_1.flags.string({ char: 'n', description: 'change the client name' }),
|
|
34
|
+
url: command_1.flags.string({ description: 'change the client redirect URL' }),
|
|
35
|
+
};
|
|
36
|
+
ClientsUpdate.args = {
|
|
37
|
+
id: core_1.Args.string({ required: true }),
|
|
38
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Command } from '@heroku-cli/command';
|
|
2
|
+
interface Config {
|
|
3
|
+
[key: string]: string;
|
|
4
|
+
}
|
|
5
|
+
export declare function stringToConfig(s: string): Config;
|
|
6
|
+
export default class ConfigEdit extends Command {
|
|
7
|
+
static description: string;
|
|
8
|
+
static examples: string[];
|
|
9
|
+
static flags: {
|
|
10
|
+
app: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
11
|
+
remote: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
12
|
+
};
|
|
13
|
+
static args: {
|
|
14
|
+
key: import("@oclif/core/lib/interfaces/parser").Arg<string | undefined, Record<string, unknown>>;
|
|
15
|
+
};
|
|
16
|
+
app: string;
|
|
17
|
+
run(): Promise<void>;
|
|
18
|
+
private fetchLatestConfig;
|
|
19
|
+
private diffPrompt;
|
|
20
|
+
private verifyUnchanged;
|
|
21
|
+
private updateConfig;
|
|
22
|
+
}
|
|
23
|
+
export {};
|