heroku 10.7.0 → 10.7.1-alpha.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/README.md +1 -0
- package/bin/heroku-prompts.js +235 -0
- package/bin/heroku-repl.js +620 -0
- package/bin/run +36 -7
- package/lib/analytics.js +3 -1
- package/lib/commands/access/index.js +2 -1
- package/lib/commands/accounts/current.js +2 -1
- package/lib/commands/addons/index.js +3 -2
- package/lib/commands/addons/info.js +3 -2
- package/lib/commands/addons/plans.js +3 -2
- package/lib/commands/addons/services.js +3 -2
- package/lib/commands/apps/create.js +2 -1
- package/lib/commands/apps/errors.js +4 -3
- package/lib/commands/apps/favorites/index.js +3 -2
- package/lib/commands/apps/index.js +7 -6
- package/lib/commands/apps/info.js +4 -3
- package/lib/commands/apps/stacks/index.js +2 -1
- package/lib/commands/authorizations/create.js +2 -1
- package/lib/commands/authorizations/index.js +3 -2
- package/lib/commands/authorizations/info.js +2 -1
- package/lib/commands/autocomplete/doctor.js +2 -1
- package/lib/commands/buildpacks/index.js +2 -2
- package/lib/commands/buildpacks/info.js +3 -2
- package/lib/commands/buildpacks/search.js +2 -1
- package/lib/commands/buildpacks/versions.js +2 -1
- package/lib/commands/certs/add.js +2 -1
- package/lib/commands/certs/auto/enable.js +3 -2
- package/lib/commands/certs/auto/index.js +5 -4
- package/lib/commands/ci/config/index.js +4 -3
- package/lib/commands/ci/config/set.js +2 -1
- package/lib/commands/clients/create.js +2 -1
- package/lib/commands/clients/index.js +3 -2
- package/lib/commands/clients/info.js +4 -3
- package/lib/commands/clients/rotate.js +4 -3
- package/lib/commands/config/edit.js +2 -1
- package/lib/commands/config/index.js +4 -3
- package/lib/commands/config/set.js +2 -1
- package/lib/commands/container/pull.js +2 -2
- package/lib/commands/container/push.js +5 -4
- package/lib/commands/container/run.js +3 -2
- package/lib/commands/domains/add.js +2 -1
- package/lib/commands/domains/index.js +5 -4
- package/lib/commands/domains/info.js +2 -1
- package/lib/commands/drains/index.js +4 -3
- package/lib/commands/features/index.js +3 -2
- package/lib/commands/features/info.js +4 -3
- package/lib/commands/keys/add.js +2 -1
- package/lib/commands/keys/index.js +3 -2
- package/lib/commands/labs/disable.js +2 -1
- package/lib/commands/labs/index.js +3 -2
- package/lib/commands/labs/info.js +4 -3
- package/lib/commands/members/index.js +2 -1
- package/lib/commands/notifications/index.js +3 -2
- package/lib/commands/pg/backups/index.js +7 -6
- package/lib/commands/pg/backups/info.js +4 -3
- package/lib/commands/pg/backups/schedules.js +2 -1
- package/lib/commands/pg/credentials.js +2 -1
- package/lib/commands/pg/diagnose.js +3 -2
- package/lib/commands/pg/info.js +4 -3
- package/lib/commands/pg/links/index.js +3 -2
- package/lib/commands/pg/settings/index.js +3 -2
- package/lib/commands/pipelines/diff.js +3 -2
- package/lib/commands/pipelines/index.js +3 -2
- package/lib/commands/pipelines/info.js +2 -1
- package/lib/commands/pipelines/promote.js +2 -1
- package/lib/commands/pipelines/transfer.js +2 -1
- package/lib/commands/ps/index.js +5 -4
- package/lib/commands/ps/type.js +5 -4
- package/lib/commands/ps/wait.js +2 -1
- package/lib/commands/regions.js +3 -3
- package/lib/commands/releases/index.js +3 -2
- package/lib/commands/releases/info.js +6 -5
- package/lib/commands/sessions/index.js +3 -2
- package/lib/commands/spaces/create.js +3 -2
- package/lib/commands/spaces/index.js +2 -1
- package/lib/commands/spaces/ps.js +3 -2
- package/lib/commands/spaces/topology.js +4 -3
- package/lib/commands/spaces/trusted-ips/index.js +3 -2
- package/lib/commands/spaces/vpn/config.js +2 -1
- package/lib/commands/spaces/vpn/connections.js +4 -3
- package/lib/commands/spaces/vpn/info.js +6 -5
- package/lib/commands/spaces/vpn/wait.js +2 -1
- package/lib/commands/status.js +3 -2
- package/lib/commands/teams/index.js +3 -3
- package/lib/commands/telemetry/index.js +3 -2
- package/lib/commands/usage/addons.js +3 -2
- package/lib/commands/webhooks/add.js +2 -1
- package/lib/commands/webhooks/deliveries/index.js +2 -2
- package/lib/commands/webhooks/deliveries/info.js +5 -4
- package/lib/commands/webhooks/events/index.js +2 -1
- package/lib/commands/webhooks/events/info.js +3 -2
- package/lib/commands/webhooks/index.js +2 -2
- package/lib/commands/webhooks/info.js +3 -2
- package/lib/global_telemetry.d.ts +1 -1
- package/lib/global_telemetry.js +3 -1
- package/lib/lib/authorizations/authorizations.js +2 -2
- package/lib/lib/certs/certificate_details.js +2 -1
- package/lib/lib/certs/display_table.js +2 -2
- package/lib/lib/ci/test-run.js +4 -3
- package/lib/lib/confirmCommand.js +2 -1
- package/lib/lib/domains/domains.js +4 -3
- package/lib/lib/domains/wait-for-domain.js +2 -2
- package/lib/lib/orgs/utils.js +2 -1
- package/lib/lib/pipelines/render-pipeline.js +3 -2
- package/lib/lib/pipelines/setup/get-ci-settings.js +2 -2
- package/lib/lib/pipelines/setup/get-name-and-repo.js +3 -2
- package/lib/lib/pipelines/setup/get-settings.js +6 -6
- package/lib/lib/redis/api.js +4 -3
- package/lib/lib/spaces/hosts.js +3 -2
- package/lib/lib/spaces/outbound-rules.js +4 -3
- package/lib/lib/spaces/peering.js +5 -4
- package/lib/lib/spaces/spaces.js +3 -2
- package/lib/lib/spaces/vpn-connections.js +3 -3
- package/lib/lib/telemetry/util.js +3 -2
- package/oclif.manifest.json +129 -129
- package/package.json +9 -6
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const color_1 = require("@heroku-cli/color");
|
|
4
4
|
const command_1 = require("@heroku-cli/command");
|
|
5
5
|
const core_1 = require("@oclif/core");
|
|
6
|
+
const heroku_cli_util_1 = require("@heroku/heroku-cli-util");
|
|
6
7
|
const fetcher_1 = require("../../../lib/pg/fetcher");
|
|
7
8
|
const host_1 = require("../../../lib/pg/host");
|
|
8
9
|
const nls_1 = require("../../../nls");
|
|
@@ -29,7 +30,7 @@ class Index extends command_1.Command {
|
|
|
29
30
|
core_1.ux.log();
|
|
30
31
|
else
|
|
31
32
|
once = true;
|
|
32
|
-
|
|
33
|
+
heroku_cli_util_1.hux.styledHeader(color_1.default.yellow(db.name));
|
|
33
34
|
if (db.links.message)
|
|
34
35
|
return core_1.ux.log(db.links.message);
|
|
35
36
|
if (db.links.length === 0)
|
|
@@ -40,7 +41,7 @@ class Index extends command_1.Command {
|
|
|
40
41
|
const remoteAttachmentName = ((_a = link.remote) === null || _a === void 0 ? void 0 : _a.attachment_name) || '';
|
|
41
42
|
const remoteName = ((_b = link.remote) === null || _b === void 0 ? void 0 : _b.name) || '';
|
|
42
43
|
const remoteLinkText = `${color_1.default.green(remoteAttachmentName)} (${color_1.default.yellow(remoteName)})`;
|
|
43
|
-
|
|
44
|
+
heroku_cli_util_1.hux.styledObject({
|
|
44
45
|
created_at: link.created_at,
|
|
45
46
|
remote: remoteLinkText,
|
|
46
47
|
});
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const command_1 = require("@heroku-cli/command");
|
|
4
4
|
const core_1 = require("@oclif/core");
|
|
5
|
+
const heroku_cli_util_1 = require("@heroku/heroku-cli-util");
|
|
5
6
|
const resolve_1 = require("../../../lib/addons/resolve");
|
|
6
7
|
const util_1 = require("../../../lib/pg/util");
|
|
7
8
|
const host_1 = require("../../../lib/pg/host");
|
|
@@ -15,12 +16,12 @@ class Index extends command_1.Command {
|
|
|
15
16
|
if ((0, util_1.essentialPlan)(db))
|
|
16
17
|
core_1.ux.error('You can’t perform this operation on Essential-tier databases.');
|
|
17
18
|
const { body: settings } = await this.heroku.get(`/postgres/v0/databases/${db.id}/config`, { hostname: (0, host_1.default)() });
|
|
18
|
-
|
|
19
|
+
heroku_cli_util_1.hux.styledHeader(db.name);
|
|
19
20
|
const remapped = {};
|
|
20
21
|
Object.keys(settings).forEach(k => {
|
|
21
22
|
remapped[k.replace(/_/g, '-')] = settings[k].value;
|
|
22
23
|
});
|
|
23
|
-
|
|
24
|
+
heroku_cli_util_1.hux.styledObject(remapped);
|
|
24
25
|
}
|
|
25
26
|
}
|
|
26
27
|
exports.default = Index;
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const color_1 = require("@heroku-cli/color");
|
|
4
4
|
const command_1 = require("@heroku-cli/command");
|
|
5
5
|
const core_1 = require("@oclif/core");
|
|
6
|
+
const heroku_cli_util_1 = require("@heroku/heroku-cli-util");
|
|
6
7
|
const http_call_1 = require("@heroku/http-call");
|
|
7
8
|
const api_1 = require("../../lib/api");
|
|
8
9
|
const kolkrabbi_api_1 = require("../../lib/pipelines/kolkrabbi-api");
|
|
@@ -34,7 +35,7 @@ async function diff(targetApp, downstreamApp, githubToken, herokuUserAgent) {
|
|
|
34
35
|
}
|
|
35
36
|
const { body: githubDiff } = await http_call_1.default.get(`https://api.github.com/repos/${path}`, { headers });
|
|
36
37
|
core_1.ux.log('');
|
|
37
|
-
|
|
38
|
+
heroku_cli_util_1.hux.styledHeader(`${color_1.default.app(targetApp.name)} is ahead of ${color_1.default.app(downstreamApp.name)} by ${githubDiff.ahead_by} commit${githubDiff.ahead_by === 1 ? '' : 's'}`);
|
|
38
39
|
const mapped = githubDiff.commits.map((commit) => {
|
|
39
40
|
return {
|
|
40
41
|
sha: commit.sha.slice(0, 7),
|
|
@@ -43,7 +44,7 @@ async function diff(targetApp, downstreamApp, githubToken, herokuUserAgent) {
|
|
|
43
44
|
message: commit.commit.message.split('\n')[0],
|
|
44
45
|
};
|
|
45
46
|
}).reverse();
|
|
46
|
-
|
|
47
|
+
heroku_cli_util_1.hux.table(mapped, {
|
|
47
48
|
sha: {
|
|
48
49
|
header: 'SHA',
|
|
49
50
|
},
|
|
@@ -2,15 +2,16 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const command_1 = require("@heroku-cli/command");
|
|
4
4
|
const core_1 = require("@oclif/core");
|
|
5
|
+
const heroku_cli_util_1 = require("@heroku/heroku-cli-util");
|
|
5
6
|
class Pipelines extends command_1.Command {
|
|
6
7
|
async run() {
|
|
7
8
|
const { flags } = await this.parse(Pipelines);
|
|
8
9
|
const { body: pipelines } = await this.heroku.get('/pipelines');
|
|
9
10
|
if (flags.json) {
|
|
10
|
-
|
|
11
|
+
heroku_cli_util_1.hux.styledJSON(pipelines);
|
|
11
12
|
}
|
|
12
13
|
else {
|
|
13
|
-
|
|
14
|
+
heroku_cli_util_1.hux.styledHeader('My Pipelines');
|
|
14
15
|
for (const pipeline of pipelines) {
|
|
15
16
|
core_1.ux.log(pipeline.name);
|
|
16
17
|
}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const command_1 = require("@heroku-cli/command");
|
|
4
4
|
const core_1 = require("@oclif/core");
|
|
5
|
+
const heroku_cli_util_1 = require("@heroku/heroku-cli-util");
|
|
5
6
|
const api_1 = require("../../lib/api");
|
|
6
7
|
const disambiguate_1 = require("../../lib/pipelines/disambiguate");
|
|
7
8
|
const render_pipeline_1 = require("../../lib/pipelines/render-pipeline");
|
|
@@ -11,7 +12,7 @@ class PipelinesInfo extends command_1.Command {
|
|
|
11
12
|
const pipeline = await (0, disambiguate_1.default)(this.heroku, args.pipeline);
|
|
12
13
|
const pipelineApps = await (0, api_1.listPipelineApps)(this.heroku, pipeline.id);
|
|
13
14
|
if (flags.json) {
|
|
14
|
-
|
|
15
|
+
heroku_cli_util_1.hux.styledJSON({ pipeline, apps: pipelineApps });
|
|
15
16
|
}
|
|
16
17
|
else {
|
|
17
18
|
await (0, render_pipeline_1.default)(this.heroku, pipeline, pipelineApps, {
|
|
@@ -4,6 +4,7 @@ exports.sleep = void 0;
|
|
|
4
4
|
const color_1 = require("@heroku-cli/color");
|
|
5
5
|
const command_1 = require("@heroku-cli/command");
|
|
6
6
|
const core_1 = require("@oclif/core");
|
|
7
|
+
const heroku_cli_util_1 = require("@heroku/heroku-cli-util");
|
|
7
8
|
const assert = require("assert");
|
|
8
9
|
const node_fetch_1 = require("node-fetch");
|
|
9
10
|
const Stream = require("stream");
|
|
@@ -196,7 +197,7 @@ class Promote extends command_1.Command {
|
|
|
196
197
|
else {
|
|
197
198
|
core_1.ux.warn('\nPromotion to some apps failed');
|
|
198
199
|
}
|
|
199
|
-
|
|
200
|
+
heroku_cli_util_1.hux.styledObject(styledTargets);
|
|
200
201
|
}
|
|
201
202
|
}
|
|
202
203
|
exports.default = Promote;
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const color_1 = require("@heroku-cli/color");
|
|
4
4
|
const command_1 = require("@heroku-cli/command");
|
|
5
5
|
const core_1 = require("@oclif/core");
|
|
6
|
+
const heroku_cli_util_1 = require("@heroku/heroku-cli-util");
|
|
6
7
|
const api_1 = require("../../lib/api");
|
|
7
8
|
const disambiguate_1 = require("../../lib/pipelines/disambiguate");
|
|
8
9
|
const render_pipeline_1 = require("../../lib/pipelines/render-pipeline");
|
|
@@ -36,7 +37,7 @@ class PipelinesTransfer extends command_1.Command {
|
|
|
36
37
|
core_1.ux.log('');
|
|
37
38
|
core_1.ux.warn(`This will transfer ${color_1.default.pipeline(pipeline.name)} and all of the listed apps to the ${args.owner} ${displayType}`);
|
|
38
39
|
core_1.ux.warn(`to proceed, type ${color_1.default.red(pipeline.name)} or re-run this command with ${color_1.default.red('--confirm')} ${pipeline.name}`);
|
|
39
|
-
confirmName = await
|
|
40
|
+
confirmName = await heroku_cli_util_1.hux.prompt('', {});
|
|
40
41
|
}
|
|
41
42
|
if (confirmName !== pipeline.name) {
|
|
42
43
|
core_1.ux.warn(`Confirmation did not match ${color_1.default.red(pipeline.name)}. Aborted.`);
|
package/lib/commands/ps/index.js
CHANGED
|
@@ -4,6 +4,7 @@ const tslib_1 = require("tslib");
|
|
|
4
4
|
const color_1 = require("@heroku-cli/color");
|
|
5
5
|
const command_1 = require("@heroku-cli/command");
|
|
6
6
|
const core_1 = require("@oclif/core");
|
|
7
|
+
const heroku_cli_util_1 = require("@heroku/heroku-cli-util");
|
|
7
8
|
const time_1 = require("../../lib/time");
|
|
8
9
|
const tsheredoc_1 = require("tsheredoc");
|
|
9
10
|
function getProcessNumber(s) {
|
|
@@ -41,7 +42,7 @@ function truncate(s) {
|
|
|
41
42
|
}
|
|
42
43
|
function printExtended(dynos) {
|
|
43
44
|
const sortedDynos = dynos.sort(byProcessTypeAndNumber);
|
|
44
|
-
|
|
45
|
+
heroku_cli_util_1.hux.table(sortedDynos, {
|
|
45
46
|
ID: { get: (dyno) => dyno.id },
|
|
46
47
|
Process: { get: (dyno) => dyno.name },
|
|
47
48
|
State: { get: (dyno) => `${dyno.state} ${(0, time_1.ago)(new Date(dyno.updated_at))}` },
|
|
@@ -117,7 +118,7 @@ function printDynos(dynos) {
|
|
|
117
118
|
const commands = dynos.filter(d => d.type !== 'run').map(d => d.command).filter(uniqueValues);
|
|
118
119
|
// Print one-off dynos
|
|
119
120
|
if (oneOffs.length > 0) {
|
|
120
|
-
|
|
121
|
+
heroku_cli_util_1.hux.styledHeader(`${color_1.default.green('run')}: one-off processes (${color_1.default.yellow(oneOffs.length.toString())})`);
|
|
121
122
|
oneOffs.forEach(dyno => core_1.ux.log(decorateOneOffDyno(dyno)));
|
|
122
123
|
core_1.ux.log();
|
|
123
124
|
}
|
|
@@ -127,7 +128,7 @@ function printDynos(dynos) {
|
|
|
127
128
|
const type = commandDynos[0].type;
|
|
128
129
|
// eslint-disable-next-line unicorn/explicit-length-check
|
|
129
130
|
const size = commandDynos[0].size || '1X';
|
|
130
|
-
|
|
131
|
+
heroku_cli_util_1.hux.styledHeader(`${color_1.default.green(type)} (${color_1.default.cyan(size)}): ${command} (${color_1.default.yellow(commandDynos.length.toString())})`);
|
|
131
132
|
for (const dyno of commandDynos)
|
|
132
133
|
core_1.ux.log(decorateCommandDyno(dyno));
|
|
133
134
|
core_1.ux.log();
|
|
@@ -168,7 +169,7 @@ class Index extends command_1.Command {
|
|
|
168
169
|
}
|
|
169
170
|
selectedDynos = selectedDynos.sort(byProcessName);
|
|
170
171
|
if (json)
|
|
171
|
-
|
|
172
|
+
heroku_cli_util_1.hux.styledJSON(selectedDynos);
|
|
172
173
|
else if (extended)
|
|
173
174
|
printExtended(selectedDynos);
|
|
174
175
|
else {
|
package/lib/commands/ps/type.js
CHANGED
|
@@ -4,6 +4,7 @@ const tslib_1 = require("tslib");
|
|
|
4
4
|
const color_1 = require("@heroku-cli/color");
|
|
5
5
|
const command_1 = require("@heroku-cli/command");
|
|
6
6
|
const core_1 = require("@oclif/core");
|
|
7
|
+
const heroku_cli_util_1 = require("@heroku/heroku-cli-util");
|
|
7
8
|
const lodash_1 = require("lodash");
|
|
8
9
|
const tsheredoc_1 = require("tsheredoc");
|
|
9
10
|
const COST_MONTHLY = {
|
|
@@ -101,8 +102,8 @@ const displayFormation = async (heroku, app) => {
|
|
|
101
102
|
if (formation.length === 0) {
|
|
102
103
|
throw emptyFormationErr(app);
|
|
103
104
|
}
|
|
104
|
-
|
|
105
|
-
|
|
105
|
+
heroku_cli_util_1.hux.styledHeader('Process Types');
|
|
106
|
+
heroku_cli_util_1.hux.table(formationTableData, {
|
|
106
107
|
type: {},
|
|
107
108
|
size: {},
|
|
108
109
|
qty: {},
|
|
@@ -110,8 +111,8 @@ const displayFormation = async (heroku, app) => {
|
|
|
110
111
|
'max cost/month': {},
|
|
111
112
|
});
|
|
112
113
|
core_1.ux.log();
|
|
113
|
-
|
|
114
|
-
|
|
114
|
+
heroku_cli_util_1.hux.styledHeader('Dyno Totals');
|
|
115
|
+
heroku_cli_util_1.hux.table(dynoTotalsTableData, {
|
|
115
116
|
type: {},
|
|
116
117
|
total: {},
|
|
117
118
|
});
|
package/lib/commands/ps/wait.js
CHANGED
|
@@ -3,6 +3,7 @@ var _a;
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
const command_1 = require("@heroku-cli/command");
|
|
5
5
|
const core_1 = require("@oclif/core");
|
|
6
|
+
const heroku_cli_util_1 = require("@heroku/heroku-cli-util");
|
|
6
7
|
class Wait extends command_1.Command {
|
|
7
8
|
async run() {
|
|
8
9
|
const { flags } = await this.parse(Wait);
|
|
@@ -44,7 +45,7 @@ class Wait extends command_1.Command {
|
|
|
44
45
|
core_1.ux.action.start(`Waiting for every dyno to be running v${latestRelease.version}`);
|
|
45
46
|
}
|
|
46
47
|
core_1.ux.action.status = releasedFraction;
|
|
47
|
-
await
|
|
48
|
+
await heroku_cli_util_1.hux.wait(interval * 1000);
|
|
48
49
|
}
|
|
49
50
|
}
|
|
50
51
|
}
|
package/lib/commands/regions.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const color_1 = require("@heroku-cli/color");
|
|
4
4
|
const command_1 = require("@heroku-cli/command");
|
|
5
|
-
const
|
|
5
|
+
const heroku_cli_util_1 = require("@heroku/heroku-cli-util");
|
|
6
6
|
const _ = require("lodash");
|
|
7
7
|
class Regions extends command_1.Command {
|
|
8
8
|
async run() {
|
|
@@ -16,10 +16,10 @@ class Regions extends command_1.Command {
|
|
|
16
16
|
}
|
|
17
17
|
regions = _.sortBy(regions, ['private_capable', 'name']);
|
|
18
18
|
if (flags.json) {
|
|
19
|
-
|
|
19
|
+
heroku_cli_util_1.hux.styledJSON(regions);
|
|
20
20
|
}
|
|
21
21
|
else {
|
|
22
|
-
|
|
22
|
+
heroku_cli_util_1.hux.table(regions, {
|
|
23
23
|
name: {
|
|
24
24
|
header: 'ID',
|
|
25
25
|
get: ({ name }) => color_1.default.green(name),
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const color_1 = require("@heroku-cli/color");
|
|
4
4
|
const command_1 = require("@heroku-cli/command");
|
|
5
5
|
const core_1 = require("@oclif/core");
|
|
6
|
+
const heroku_cli_util_1 = require("@heroku/heroku-cli-util");
|
|
6
7
|
const lodash_1 = require("lodash");
|
|
7
8
|
const statusHelper = require("../../lib/releases/status_helper");
|
|
8
9
|
const time = require("../../lib/time");
|
|
@@ -104,8 +105,8 @@ class Index extends command_1.Command {
|
|
|
104
105
|
if (currentRelease) {
|
|
105
106
|
header += ' - ' + color_1.default.cyan(`Current: v${currentRelease.version}`);
|
|
106
107
|
}
|
|
107
|
-
|
|
108
|
-
|
|
108
|
+
heroku_cli_util_1.hux.styledHeader(header);
|
|
109
|
+
heroku_cli_util_1.hux.table(releases, columns, { 'no-header': true, 'no-truncate': true, extended });
|
|
109
110
|
}
|
|
110
111
|
}
|
|
111
112
|
}
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const color_1 = require("@heroku-cli/color");
|
|
4
4
|
const command_1 = require("@heroku-cli/command");
|
|
5
5
|
const core_1 = require("@oclif/core");
|
|
6
|
+
const heroku_cli_util_1 = require("@heroku/heroku-cli-util");
|
|
6
7
|
const shellescape = require("shell-escape");
|
|
7
8
|
const { forEach } = require('lodash');
|
|
8
9
|
const releases_1 = require("../../lib/releases/releases");
|
|
@@ -14,7 +15,7 @@ class Info extends command_1.Command {
|
|
|
14
15
|
const { json, shell, app } = flags;
|
|
15
16
|
const release = await (0, releases_1.findByLatestOrId)(this.heroku, app, args.release);
|
|
16
17
|
if (json) {
|
|
17
|
-
|
|
18
|
+
heroku_cli_util_1.hux.styledJSON(release);
|
|
18
19
|
}
|
|
19
20
|
else {
|
|
20
21
|
let releaseChange = release.description;
|
|
@@ -25,8 +26,8 @@ class Info extends command_1.Command {
|
|
|
25
26
|
if (status) {
|
|
26
27
|
releaseChange += ' (' + color_1.default[statusColor](status) + ')';
|
|
27
28
|
}
|
|
28
|
-
|
|
29
|
-
|
|
29
|
+
heroku_cli_util_1.hux.styledHeader(`Release ${color_1.default.cyan('v' + release.version)}`);
|
|
30
|
+
heroku_cli_util_1.hux.styledObject({
|
|
30
31
|
'Add-ons': release.addon_plan_names,
|
|
31
32
|
Change: releaseChange,
|
|
32
33
|
By: userEmail,
|
|
@@ -34,14 +35,14 @@ class Info extends command_1.Command {
|
|
|
34
35
|
When: release.created_at,
|
|
35
36
|
});
|
|
36
37
|
core_1.ux.log();
|
|
37
|
-
|
|
38
|
+
heroku_cli_util_1.hux.styledHeader(`${color_1.default.cyan('v' + release.version)} Config vars`);
|
|
38
39
|
if (shell) {
|
|
39
40
|
forEach(config, (v, k) => {
|
|
40
41
|
core_1.ux.log(`${k}=${shellescape([v])}`);
|
|
41
42
|
});
|
|
42
43
|
}
|
|
43
44
|
else {
|
|
44
|
-
|
|
45
|
+
heroku_cli_util_1.hux.styledObject(config);
|
|
45
46
|
}
|
|
46
47
|
}
|
|
47
48
|
}
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const color_1 = require("@heroku-cli/color");
|
|
4
4
|
const command_1 = require("@heroku-cli/command");
|
|
5
5
|
const core_1 = require("@oclif/core");
|
|
6
|
+
const heroku_cli_util_1 = require("@heroku/heroku-cli-util");
|
|
6
7
|
const { sortBy } = require('lodash');
|
|
7
8
|
class SessionsIndex extends command_1.Command {
|
|
8
9
|
async run() {
|
|
@@ -10,14 +11,14 @@ class SessionsIndex extends command_1.Command {
|
|
|
10
11
|
let { body: sessions } = await this.heroku.get('/oauth/sessions');
|
|
11
12
|
sessions = sortBy(sessions, 'description');
|
|
12
13
|
if (flags.json) {
|
|
13
|
-
|
|
14
|
+
heroku_cli_util_1.hux.styledJSON(sessions);
|
|
14
15
|
}
|
|
15
16
|
else if (sessions.length === 0) {
|
|
16
17
|
core_1.ux.log('No OAuth sessions.');
|
|
17
18
|
}
|
|
18
19
|
else {
|
|
19
20
|
const printLine = (...args) => this.log(...args);
|
|
20
|
-
|
|
21
|
+
heroku_cli_util_1.hux.table(sessions, {
|
|
21
22
|
description: { get: (v) => color_1.default.green(v.description) },
|
|
22
23
|
id: {},
|
|
23
24
|
}, { 'no-header': true, printLine });
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const color_1 = require("@heroku-cli/color");
|
|
4
4
|
const command_1 = require("@heroku-cli/command");
|
|
5
5
|
const core_1 = require("@oclif/core");
|
|
6
|
+
const heroku_cli_util_1 = require("@heroku/heroku-cli-util");
|
|
6
7
|
const tsheredoc_1 = require("tsheredoc");
|
|
7
8
|
const spaces_1 = require("../../lib/spaces/spaces");
|
|
8
9
|
const completions_1 = require("../../lib/autocomplete/completions");
|
|
@@ -44,8 +45,8 @@ class Create extends command_1.Command {
|
|
|
44
45
|
core_1.ux.action.stop();
|
|
45
46
|
core_1.ux.warn(`${color_1.default.bold('Spend Alert.')} Each Heroku ${spaceType} Private Space costs ~${dollarAmountHourly}/hour (max ${dollarAmountMonthly}/month), pro-rated to the second.`);
|
|
46
47
|
core_1.ux.warn(`Use ${color_1.default.cmd('heroku spaces:wait')} to track allocation.`);
|
|
47
|
-
|
|
48
|
-
|
|
48
|
+
heroku_cli_util_1.hux.styledHeader(space.name);
|
|
49
|
+
heroku_cli_util_1.hux.styledObject({
|
|
49
50
|
ID: space.id, Team: space.team.name, Region: space.region.name, CIDR: space.cidr, 'Data CIDR': space.data_cidr, State: space.state, Shield: (0, spaces_1.displayShieldState)(space), Generation: (0, generation_1.getGeneration)(space), 'Created at': space.created_at,
|
|
50
51
|
}, ['ID', 'Team', 'Region', 'CIDR', 'Data CIDR', 'State', 'Shield', 'Generation', 'Created at']);
|
|
51
52
|
}
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const color_1 = require("@heroku-cli/color");
|
|
4
4
|
const command_1 = require("@heroku-cli/command");
|
|
5
5
|
const core_1 = require("@oclif/core");
|
|
6
|
+
const heroku_cli_util_1 = require("@heroku/heroku-cli-util");
|
|
6
7
|
const generation_1 = require("../../lib/apps/generation");
|
|
7
8
|
class Index extends command_1.Command {
|
|
8
9
|
async run() {
|
|
@@ -39,7 +40,7 @@ class Index extends command_1.Command {
|
|
|
39
40
|
core_1.ux.log(JSON.stringify(spaces, null, 2));
|
|
40
41
|
}
|
|
41
42
|
display(spaces) {
|
|
42
|
-
|
|
43
|
+
heroku_cli_util_1.hux.table(spaces, {
|
|
43
44
|
Name: { get: space => space.name },
|
|
44
45
|
Team: { get: space => space.team.name },
|
|
45
46
|
Region: { get: space => space.region.name },
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const color_1 = require("@heroku-cli/color");
|
|
4
4
|
const command_1 = require("@heroku-cli/command");
|
|
5
5
|
const core_1 = require("@oclif/core");
|
|
6
|
+
const heroku_cli_util_1 = require("@heroku/heroku-cli-util");
|
|
6
7
|
const time_1 = require("../../lib/time");
|
|
7
8
|
const getProcessNum = (s) => Number.parseInt(s.split('.', 2)[1], 10);
|
|
8
9
|
class Ps extends command_1.Command {
|
|
@@ -27,7 +28,7 @@ class Ps extends command_1.Command {
|
|
|
27
28
|
});
|
|
28
29
|
}
|
|
29
30
|
if (flags.json) {
|
|
30
|
-
|
|
31
|
+
heroku_cli_util_1.hux.styledJSON(spaceDynos);
|
|
31
32
|
}
|
|
32
33
|
else {
|
|
33
34
|
this.render(spaceDynos);
|
|
@@ -61,7 +62,7 @@ class Ps extends command_1.Command {
|
|
|
61
62
|
(_b = dynosByCommand.get(key)) === null || _b === void 0 ? void 0 : _b.push(item);
|
|
62
63
|
}
|
|
63
64
|
for (const [key, dynos] of dynosByCommand) {
|
|
64
|
-
|
|
65
|
+
heroku_cli_util_1.hux.styledHeader(`${appName} ${key} (${color_1.default.yellow(dynos.length)})`);
|
|
65
66
|
dynos.sort((a, b) => getProcessNum(a) - getProcessNum(b));
|
|
66
67
|
for (const dyno of dynos) {
|
|
67
68
|
core_1.ux.log(dyno);
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const command_1 = require("@heroku-cli/command");
|
|
4
4
|
const core_1 = require("@oclif/core");
|
|
5
|
+
const heroku_cli_util_1 = require("@heroku/heroku-cli-util");
|
|
5
6
|
const tsheredoc_1 = require("tsheredoc");
|
|
6
7
|
const color_1 = require("@heroku-cli/color");
|
|
7
8
|
class Topology extends command_1.Command {
|
|
@@ -27,7 +28,7 @@ class Topology extends command_1.Command {
|
|
|
27
28
|
}
|
|
28
29
|
render(topology, appInfo, json) {
|
|
29
30
|
if (json) {
|
|
30
|
-
|
|
31
|
+
heroku_cli_util_1.hux.styledJSON(topology);
|
|
31
32
|
}
|
|
32
33
|
else if (topology.apps) {
|
|
33
34
|
topology.apps.forEach(app => {
|
|
@@ -62,8 +63,8 @@ class Topology extends command_1.Command {
|
|
|
62
63
|
if (formations.length > 0) {
|
|
63
64
|
header += ` (${color_1.default.cyan(formations.join(', '))})`;
|
|
64
65
|
}
|
|
65
|
-
|
|
66
|
-
|
|
66
|
+
heroku_cli_util_1.hux.styledHeader(header || '');
|
|
67
|
+
heroku_cli_util_1.hux.styledObject({
|
|
67
68
|
Domains: domains, Dynos: dynos,
|
|
68
69
|
}, ['Domains', 'Dynos']);
|
|
69
70
|
core_1.ux.log();
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const command_1 = require("@heroku-cli/command");
|
|
4
4
|
const core_1 = require("@oclif/core");
|
|
5
|
+
const heroku_cli_util_1 = require("@heroku/heroku-cli-util");
|
|
5
6
|
const tsheredoc_1 = require("tsheredoc");
|
|
6
7
|
class Index extends command_1.Command {
|
|
7
8
|
async run() {
|
|
@@ -20,13 +21,13 @@ class Index extends command_1.Command {
|
|
|
20
21
|
}
|
|
21
22
|
displayRules(space, ruleset) {
|
|
22
23
|
if (ruleset.rules.length > 0) {
|
|
23
|
-
|
|
24
|
+
heroku_cli_util_1.hux.styledHeader('Trusted IP Ranges');
|
|
24
25
|
for (const rule of ruleset.rules) {
|
|
25
26
|
core_1.ux.log(rule.source);
|
|
26
27
|
}
|
|
27
28
|
}
|
|
28
29
|
else {
|
|
29
|
-
|
|
30
|
+
heroku_cli_util_1.hux.styledHeader(`${space} has no trusted IP ranges. All inbound web requests to dynos are blocked.`);
|
|
30
31
|
}
|
|
31
32
|
}
|
|
32
33
|
}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const command_1 = require("@heroku-cli/command");
|
|
4
4
|
const core_1 = require("@oclif/core");
|
|
5
|
+
const heroku_cli_util_1 = require("@heroku/heroku-cli-util");
|
|
5
6
|
const vpn_connections_1 = require("../../../lib/spaces/vpn-connections");
|
|
6
7
|
const tsheredoc_1 = require("tsheredoc");
|
|
7
8
|
class Config extends command_1.Command {
|
|
@@ -11,7 +12,7 @@ class Config extends command_1.Command {
|
|
|
11
12
|
const { name } = args;
|
|
12
13
|
const { body: vpnConnection } = await this.heroku.get(`/spaces/${space}/vpn-connections/${name}`);
|
|
13
14
|
if (json) {
|
|
14
|
-
|
|
15
|
+
heroku_cli_util_1.hux.styledJSON(vpnConnection);
|
|
15
16
|
}
|
|
16
17
|
else {
|
|
17
18
|
(0, vpn_connections_1.displayVPNConfigInfo)(space, name, vpnConnection);
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const command_1 = require("@heroku-cli/command");
|
|
4
4
|
const core_1 = require("@oclif/core");
|
|
5
|
+
const heroku_cli_util_1 = require("@heroku/heroku-cli-util");
|
|
5
6
|
const tsheredoc_1 = require("tsheredoc");
|
|
6
7
|
const format_1 = require("../../../lib/spaces/format");
|
|
7
8
|
class Connections extends command_1.Command {
|
|
@@ -13,7 +14,7 @@ class Connections extends command_1.Command {
|
|
|
13
14
|
}
|
|
14
15
|
render(space, connections, json) {
|
|
15
16
|
if (json) {
|
|
16
|
-
|
|
17
|
+
heroku_cli_util_1.hux.styledJSON(connections);
|
|
17
18
|
}
|
|
18
19
|
else {
|
|
19
20
|
this.displayVPNConnections(space, connections);
|
|
@@ -24,8 +25,8 @@ class Connections extends command_1.Command {
|
|
|
24
25
|
core_1.ux.log('No VPN Connections have been created yet');
|
|
25
26
|
return;
|
|
26
27
|
}
|
|
27
|
-
|
|
28
|
-
|
|
28
|
+
heroku_cli_util_1.hux.styledHeader(`${space} VPN Connections`);
|
|
29
|
+
heroku_cli_util_1.hux.table(connections, {
|
|
29
30
|
Name: {
|
|
30
31
|
get: c => c.name || c.id,
|
|
31
32
|
},
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const command_1 = require("@heroku-cli/command");
|
|
4
4
|
const core_1 = require("@oclif/core");
|
|
5
|
+
const heroku_cli_util_1 = require("@heroku/heroku-cli-util");
|
|
5
6
|
const tsheredoc_1 = require("tsheredoc");
|
|
6
7
|
const format_1 = require("../../../lib/spaces/format");
|
|
7
8
|
class Info extends command_1.Command {
|
|
@@ -14,8 +15,8 @@ class Info extends command_1.Command {
|
|
|
14
15
|
this.render(connectionName, vpnConnection, json);
|
|
15
16
|
}
|
|
16
17
|
displayVPNInfo(name, vpnConnection) {
|
|
17
|
-
|
|
18
|
-
|
|
18
|
+
heroku_cli_util_1.hux.styledHeader(`${name} VPN Info`);
|
|
19
|
+
heroku_cli_util_1.hux.styledObject({
|
|
19
20
|
Name: name,
|
|
20
21
|
ID: vpnConnection.id,
|
|
21
22
|
'Public IP': vpnConnection.public_ip,
|
|
@@ -27,8 +28,8 @@ class Info extends command_1.Command {
|
|
|
27
28
|
vpnConnectionTunnels.forEach((val, i) => {
|
|
28
29
|
val.tunnel_id = 'Tunnel ' + (i + 1);
|
|
29
30
|
});
|
|
30
|
-
|
|
31
|
-
|
|
31
|
+
heroku_cli_util_1.hux.styledHeader(`${name} VPN Tunnel Info`);
|
|
32
|
+
heroku_cli_util_1.hux.table(vpnConnectionTunnels, {
|
|
32
33
|
tunnel_id: { header: 'VPN Tunnel' },
|
|
33
34
|
ip: { header: 'IP Address' },
|
|
34
35
|
status: {
|
|
@@ -41,7 +42,7 @@ class Info extends command_1.Command {
|
|
|
41
42
|
}
|
|
42
43
|
render(name, vpnConnection, json) {
|
|
43
44
|
if (json) {
|
|
44
|
-
|
|
45
|
+
heroku_cli_util_1.hux.styledJSON(vpnConnection);
|
|
45
46
|
}
|
|
46
47
|
else {
|
|
47
48
|
this.displayVPNInfo(name, vpnConnection);
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const color_1 = require("@heroku-cli/color");
|
|
4
4
|
const command_1 = require("@heroku-cli/command");
|
|
5
5
|
const core_1 = require("@oclif/core");
|
|
6
|
+
const heroku_cli_util_1 = require("@heroku/heroku-cli-util");
|
|
6
7
|
const vpn_connections_1 = require("../../../lib/spaces/vpn-connections");
|
|
7
8
|
const tsheredoc_1 = require("tsheredoc");
|
|
8
9
|
const wait = (ms) => new Promise(resolve => {
|
|
@@ -36,7 +37,7 @@ class Wait extends command_1.Command {
|
|
|
36
37
|
core_1.ux.action.stop();
|
|
37
38
|
const { body: newVpnConnection } = await this.heroku.get(`/spaces/${space}/vpn-connections/${name}`);
|
|
38
39
|
if (json) {
|
|
39
|
-
|
|
40
|
+
heroku_cli_util_1.hux.styledJSON(newVpnConnection);
|
|
40
41
|
}
|
|
41
42
|
else {
|
|
42
43
|
(0, vpn_connections_1.displayVPNConfigInfo)(space, name, newVpnConnection);
|
package/lib/commands/status.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const color_1 = require("@heroku-cli/color");
|
|
4
4
|
const core_1 = require("@oclif/core");
|
|
5
|
+
const heroku_cli_util_1 = require("@heroku/heroku-cli-util");
|
|
5
6
|
const util_1 = require("@oclif/core/lib/util");
|
|
6
7
|
const date_fns_1 = require("date-fns");
|
|
7
8
|
const http_call_1 = require("@heroku/http-call");
|
|
@@ -21,7 +22,7 @@ class Status extends core_1.Command {
|
|
|
21
22
|
const host = process.env.HEROKU_STATUS_HOST || 'https://status.heroku.com';
|
|
22
23
|
const { body } = await http_call_1.default.get(host + apiPath);
|
|
23
24
|
if (flags.json) {
|
|
24
|
-
|
|
25
|
+
heroku_cli_util_1.hux.styledJSON(body);
|
|
25
26
|
return;
|
|
26
27
|
}
|
|
27
28
|
for (const item of body.status) {
|
|
@@ -30,7 +31,7 @@ class Status extends core_1.Command {
|
|
|
30
31
|
}
|
|
31
32
|
for (const incident of body.incidents) {
|
|
32
33
|
core_1.ux.log();
|
|
33
|
-
|
|
34
|
+
heroku_cli_util_1.hux.styledHeader(`${incident.title} ${color_1.default.yellow(incident.created_at)} ${color_1.default.cyan(incident.full_url)}`);
|
|
34
35
|
const padding = (0, util_2.maxBy)(incident.updates, (i) => i.update_type.length).update_type.length + 0;
|
|
35
36
|
for (const u of incident.updates) {
|
|
36
37
|
core_1.ux.log(`${color_1.default.yellow(u.update_type.padEnd(padding))} ${new Date(u.updated_at).toISOString()} (${(0, date_fns_1.formatDistanceToNow)(new Date(u.updated_at))} ago)`);
|
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const color_1 = require("@heroku-cli/color");
|
|
4
4
|
const command_1 = require("@heroku-cli/command");
|
|
5
|
-
const
|
|
5
|
+
const heroku_cli_util_1 = require("@heroku/heroku-cli-util");
|
|
6
6
|
class Index extends command_1.Command {
|
|
7
7
|
async run() {
|
|
8
8
|
const { flags } = await this.parse(Index);
|
|
9
9
|
const { body: teams } = await this.heroku.get('/teams');
|
|
10
10
|
if (flags.json)
|
|
11
|
-
|
|
11
|
+
heroku_cli_util_1.hux.styledJSON(teams);
|
|
12
12
|
else {
|
|
13
|
-
|
|
13
|
+
heroku_cli_util_1.hux.table(teams.sort((a, b) => {
|
|
14
14
|
const aName = (a === null || a === void 0 ? void 0 : a.name) || '';
|
|
15
15
|
const bName = (b === null || b === void 0 ? void 0 : b.name) || '';
|
|
16
16
|
return (aName > bName) ? 1 : ((bName > aName) ? -1 : 0);
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const command_1 = require("@heroku-cli/command");
|
|
4
4
|
const core_1 = require("@oclif/core");
|
|
5
|
+
const heroku_cli_util_1 = require("@heroku/heroku-cli-util");
|
|
5
6
|
class Index extends command_1.Command {
|
|
6
7
|
async run() {
|
|
7
8
|
const { flags } = await this.parse(Index);
|
|
@@ -30,8 +31,8 @@ class Index extends command_1.Command {
|
|
|
30
31
|
core_1.ux.log(`There are no telemetry drains in ${owner}`);
|
|
31
32
|
}
|
|
32
33
|
else {
|
|
33
|
-
|
|
34
|
-
|
|
34
|
+
heroku_cli_util_1.hux.styledHeader(`${owner} Telemetry Drains`);
|
|
35
|
+
heroku_cli_util_1.hux.table(telemetryDrains, {
|
|
35
36
|
ID: { get: telemetryDrain => telemetryDrain.id },
|
|
36
37
|
Signals: { get: telemetryDrain => telemetryDrain.signals },
|
|
37
38
|
Endpoint: { get: telemetryDrain => telemetryDrain.exporter.endpoint },
|