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.
Files changed (116) hide show
  1. package/README.md +1 -0
  2. package/bin/heroku-prompts.js +235 -0
  3. package/bin/heroku-repl.js +620 -0
  4. package/bin/run +36 -7
  5. package/lib/analytics.js +3 -1
  6. package/lib/commands/access/index.js +2 -1
  7. package/lib/commands/accounts/current.js +2 -1
  8. package/lib/commands/addons/index.js +3 -2
  9. package/lib/commands/addons/info.js +3 -2
  10. package/lib/commands/addons/plans.js +3 -2
  11. package/lib/commands/addons/services.js +3 -2
  12. package/lib/commands/apps/create.js +2 -1
  13. package/lib/commands/apps/errors.js +4 -3
  14. package/lib/commands/apps/favorites/index.js +3 -2
  15. package/lib/commands/apps/index.js +7 -6
  16. package/lib/commands/apps/info.js +4 -3
  17. package/lib/commands/apps/stacks/index.js +2 -1
  18. package/lib/commands/authorizations/create.js +2 -1
  19. package/lib/commands/authorizations/index.js +3 -2
  20. package/lib/commands/authorizations/info.js +2 -1
  21. package/lib/commands/autocomplete/doctor.js +2 -1
  22. package/lib/commands/buildpacks/index.js +2 -2
  23. package/lib/commands/buildpacks/info.js +3 -2
  24. package/lib/commands/buildpacks/search.js +2 -1
  25. package/lib/commands/buildpacks/versions.js +2 -1
  26. package/lib/commands/certs/add.js +2 -1
  27. package/lib/commands/certs/auto/enable.js +3 -2
  28. package/lib/commands/certs/auto/index.js +5 -4
  29. package/lib/commands/ci/config/index.js +4 -3
  30. package/lib/commands/ci/config/set.js +2 -1
  31. package/lib/commands/clients/create.js +2 -1
  32. package/lib/commands/clients/index.js +3 -2
  33. package/lib/commands/clients/info.js +4 -3
  34. package/lib/commands/clients/rotate.js +4 -3
  35. package/lib/commands/config/edit.js +2 -1
  36. package/lib/commands/config/index.js +4 -3
  37. package/lib/commands/config/set.js +2 -1
  38. package/lib/commands/container/pull.js +2 -2
  39. package/lib/commands/container/push.js +5 -4
  40. package/lib/commands/container/run.js +3 -2
  41. package/lib/commands/domains/add.js +2 -1
  42. package/lib/commands/domains/index.js +5 -4
  43. package/lib/commands/domains/info.js +2 -1
  44. package/lib/commands/drains/index.js +4 -3
  45. package/lib/commands/features/index.js +3 -2
  46. package/lib/commands/features/info.js +4 -3
  47. package/lib/commands/keys/add.js +2 -1
  48. package/lib/commands/keys/index.js +3 -2
  49. package/lib/commands/labs/disable.js +2 -1
  50. package/lib/commands/labs/index.js +3 -2
  51. package/lib/commands/labs/info.js +4 -3
  52. package/lib/commands/members/index.js +2 -1
  53. package/lib/commands/notifications/index.js +3 -2
  54. package/lib/commands/pg/backups/index.js +7 -6
  55. package/lib/commands/pg/backups/info.js +4 -3
  56. package/lib/commands/pg/backups/schedules.js +2 -1
  57. package/lib/commands/pg/credentials.js +2 -1
  58. package/lib/commands/pg/diagnose.js +3 -2
  59. package/lib/commands/pg/info.js +4 -3
  60. package/lib/commands/pg/links/index.js +3 -2
  61. package/lib/commands/pg/settings/index.js +3 -2
  62. package/lib/commands/pipelines/diff.js +3 -2
  63. package/lib/commands/pipelines/index.js +3 -2
  64. package/lib/commands/pipelines/info.js +2 -1
  65. package/lib/commands/pipelines/promote.js +2 -1
  66. package/lib/commands/pipelines/transfer.js +2 -1
  67. package/lib/commands/ps/index.js +5 -4
  68. package/lib/commands/ps/type.js +5 -4
  69. package/lib/commands/ps/wait.js +2 -1
  70. package/lib/commands/regions.js +3 -3
  71. package/lib/commands/releases/index.js +3 -2
  72. package/lib/commands/releases/info.js +6 -5
  73. package/lib/commands/sessions/index.js +3 -2
  74. package/lib/commands/spaces/create.js +3 -2
  75. package/lib/commands/spaces/index.js +2 -1
  76. package/lib/commands/spaces/ps.js +3 -2
  77. package/lib/commands/spaces/topology.js +4 -3
  78. package/lib/commands/spaces/trusted-ips/index.js +3 -2
  79. package/lib/commands/spaces/vpn/config.js +2 -1
  80. package/lib/commands/spaces/vpn/connections.js +4 -3
  81. package/lib/commands/spaces/vpn/info.js +6 -5
  82. package/lib/commands/spaces/vpn/wait.js +2 -1
  83. package/lib/commands/status.js +3 -2
  84. package/lib/commands/teams/index.js +3 -3
  85. package/lib/commands/telemetry/index.js +3 -2
  86. package/lib/commands/usage/addons.js +3 -2
  87. package/lib/commands/webhooks/add.js +2 -1
  88. package/lib/commands/webhooks/deliveries/index.js +2 -2
  89. package/lib/commands/webhooks/deliveries/info.js +5 -4
  90. package/lib/commands/webhooks/events/index.js +2 -1
  91. package/lib/commands/webhooks/events/info.js +3 -2
  92. package/lib/commands/webhooks/index.js +2 -2
  93. package/lib/commands/webhooks/info.js +3 -2
  94. package/lib/global_telemetry.d.ts +1 -1
  95. package/lib/global_telemetry.js +3 -1
  96. package/lib/lib/authorizations/authorizations.js +2 -2
  97. package/lib/lib/certs/certificate_details.js +2 -1
  98. package/lib/lib/certs/display_table.js +2 -2
  99. package/lib/lib/ci/test-run.js +4 -3
  100. package/lib/lib/confirmCommand.js +2 -1
  101. package/lib/lib/domains/domains.js +4 -3
  102. package/lib/lib/domains/wait-for-domain.js +2 -2
  103. package/lib/lib/orgs/utils.js +2 -1
  104. package/lib/lib/pipelines/render-pipeline.js +3 -2
  105. package/lib/lib/pipelines/setup/get-ci-settings.js +2 -2
  106. package/lib/lib/pipelines/setup/get-name-and-repo.js +3 -2
  107. package/lib/lib/pipelines/setup/get-settings.js +6 -6
  108. package/lib/lib/redis/api.js +4 -3
  109. package/lib/lib/spaces/hosts.js +3 -2
  110. package/lib/lib/spaces/outbound-rules.js +4 -3
  111. package/lib/lib/spaces/peering.js +5 -4
  112. package/lib/lib/spaces/spaces.js +3 -2
  113. package/lib/lib/spaces/vpn-connections.js +3 -3
  114. package/lib/lib/telemetry/util.js +3 -2
  115. package/oclif.manifest.json +129 -129
  116. 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
  class ClientsRotate extends command_1.Command {
7
8
  async run() {
8
9
  const { args, flags } = await this.parse(ClientsRotate);
@@ -10,15 +11,15 @@ class ClientsRotate extends command_1.Command {
10
11
  const { body: client } = await this.heroku.post(`/oauth/clients/${encodeURIComponent(args.id)}/actions/rotate-credentials`);
11
12
  core_1.ux.action.stop();
12
13
  if (flags.json) {
13
- core_1.ux.styledJSON(client);
14
+ heroku_cli_util_1.hux.styledJSON(client);
14
15
  }
15
16
  else if (flags.shell) {
16
17
  core_1.ux.log(`HEROKU_OAUTH_ID=${client.id}`);
17
18
  core_1.ux.log(`HEROKU_OAUTH_SECRET=${client.secret}`);
18
19
  }
19
20
  else {
20
- core_1.ux.styledHeader(`${client.name}`);
21
- core_1.ux.styledObject(client);
21
+ heroku_cli_util_1.hux.styledHeader(`${client.name}`);
22
+ heroku_cli_util_1.hux.styledObject(client);
22
23
  }
23
24
  }
24
25
  }
@@ -4,6 +4,7 @@ exports.stringToConfig = 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 _ = require("lodash");
8
9
  const quote_1 = require("../../lib/config/quote");
9
10
  const util_1 = require("../../lib/config/util");
@@ -95,7 +96,7 @@ class ConfigEdit extends command_1.Command {
95
96
  core_1.ux.log('Config Diff:');
96
97
  showDiff(original, newConfig);
97
98
  core_1.ux.log();
98
- return core_1.ux.confirm(`Update config on ${color_1.color.app(this.app)} with these values?`);
99
+ return heroku_cli_util_1.hux.confirm(`Update config on ${color_1.color.app(this.app)} with these values?`);
99
100
  }
100
101
  async verifyUnchanged(original) {
101
102
  const latest = await this.fetchLatestConfig();
@@ -4,6 +4,7 @@ exports.ConfigIndex = 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 _ = require("lodash");
8
9
  const quote_1 = require("../../lib/config/quote");
9
10
  class ConfigIndex extends command_1.Command {
@@ -15,11 +16,11 @@ class ConfigIndex extends command_1.Command {
15
16
  .forEach(([k, v]) => core_1.ux.log(`${k}=${(0, quote_1.quote)(v)}`));
16
17
  }
17
18
  else if (flags.json) {
18
- core_1.ux.styledJSON(config);
19
+ heroku_cli_util_1.hux.styledJSON(config);
19
20
  }
20
21
  else {
21
- core_1.ux.styledHeader(`${flags.app} Config Vars`);
22
- core_1.ux.styledObject(_.mapKeys(config, (_, k) => color_1.default.configVar(k)));
22
+ heroku_cli_util_1.hux.styledHeader(`${flags.app} Config Vars`);
23
+ heroku_cli_util_1.hux.styledObject(_.mapKeys(config, (_, k) => color_1.default.configVar(k)));
23
24
  }
24
25
  }
25
26
  }
@@ -4,6 +4,7 @@ const color_1 = require("@heroku-cli/color");
4
4
  const command_1 = require("@heroku-cli/command");
5
5
  const lodash_1 = require("lodash");
6
6
  const core_1 = require("@oclif/core");
7
+ const heroku_cli_util_1 = require("@heroku/heroku-cli-util");
7
8
  const lastRelease = async (client, app) => {
8
9
  const { body: releases } = await client.get(`/apps/${app}/releases`, {
9
10
  method: 'GET',
@@ -36,7 +37,7 @@ class Set extends command_1.Command {
36
37
  core_1.ux.action.stop(`done, ${color_1.default.release('v' + release.version)}`);
37
38
  config = (0, lodash_1.pickBy)(config, (_, k) => vars[k]);
38
39
  config = (0, lodash_1.mapKeys)(config, (_, k) => color_1.default.green(k));
39
- core_1.ux.styledObject(config);
40
+ heroku_cli_util_1.hux.styledObject(config);
40
41
  await this.config.runHook('recache', { type: 'config', app: flags.app });
41
42
  }
42
43
  }
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const command_1 = require("@heroku-cli/command");
4
- const core_1 = require("@oclif/core");
4
+ const heroku_cli_util_1 = require("@heroku/heroku-cli-util");
5
5
  const DockerHelper = require("../../lib/container/docker_helper");
6
6
  const helpers_1 = require("../../lib/container/helpers");
7
7
  const debug_1 = require("../../lib/container/debug");
@@ -22,7 +22,7 @@ class Pull extends command_1.Command {
22
22
  }
23
23
  for (const process of argv) {
24
24
  const tag = `${registry}/${app}/${process}`;
25
- core_1.ux.styledHeader(`Pulling ${process} as ${tag}`);
25
+ heroku_cli_util_1.hux.styledHeader(`Pulling ${process} as ${tag}`);
26
26
  await DockerHelper.pullImage(tag);
27
27
  }
28
28
  }
@@ -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 DockerHelper = require("../../lib/container/docker_helper");
6
7
  const helpers_1 = require("../../lib/container/helpers");
7
8
  const debug_1 = require("../../lib/container/debug");
@@ -55,10 +56,10 @@ class Push extends command_1.Command {
55
56
  try {
56
57
  for (const job of jobs) {
57
58
  if (job.name === 'standard') {
58
- core_1.ux.styledHeader(`Building ${processTypes} (${job.dockerfile})`);
59
+ heroku_cli_util_1.hux.styledHeader(`Building ${processTypes} (${job.dockerfile})`);
59
60
  }
60
61
  else {
61
- core_1.ux.styledHeader(`Building ${job.name} (${job.dockerfile})`);
62
+ heroku_cli_util_1.hux.styledHeader(`Building ${job.name} (${job.dockerfile})`);
62
63
  }
63
64
  await DockerHelper.buildImage({
64
65
  dockerfile: job.dockerfile,
@@ -75,10 +76,10 @@ class Push extends command_1.Command {
75
76
  try {
76
77
  for (const job of jobs) {
77
78
  if (job.name === 'standard') {
78
- core_1.ux.styledHeader(`Pushing ${processTypes} (${job.dockerfile})`);
79
+ heroku_cli_util_1.hux.styledHeader(`Pushing ${processTypes} (${job.dockerfile})`);
79
80
  }
80
81
  else {
81
- core_1.ux.styledHeader(`Pushing ${job.name} (${job.dockerfile})`);
82
+ heroku_cli_util_1.hux.styledHeader(`Pushing ${job.name} (${job.dockerfile})`);
82
83
  }
83
84
  await DockerHelper.pushImage(job.resource);
84
85
  }
@@ -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 DockerHelper = require("../../lib/container/docker_helper");
6
7
  const helpers_1 = require("../../lib/container/helpers");
7
8
  const debug_1 = require("../../lib/container/debug");
@@ -36,10 +37,10 @@ class Run extends command_1.Command {
36
37
  }
37
38
  const job = jobs[0];
38
39
  if (command.length === 0) {
39
- core_1.ux.styledHeader(`Running ${job.resource}`);
40
+ heroku_cli_util_1.hux.styledHeader(`Running ${job.resource}`);
40
41
  }
41
42
  else {
42
- core_1.ux.styledHeader(`Running '${command}' on ${job.resource}`);
43
+ heroku_cli_util_1.hux.styledHeader(`Running '${command}' on ${job.resource}`);
43
44
  }
44
45
  try {
45
46
  await DockerHelper.runImage(job.resource, command, port);
@@ -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 spinner_1 = require("@oclif/core/lib/cli-ux/action/spinner");
7
8
  const inquirer_1 = require("inquirer");
8
9
  const shellescape = require("shell-escape");
@@ -75,7 +76,7 @@ class DomainsAdd extends command_1.Command {
75
76
  body: domainCreatePayload,
76
77
  });
77
78
  if (flags.json) {
78
- core_1.ux.styledJSON(domain);
79
+ heroku_cli_util_1.hux.styledJSON(domain);
79
80
  }
80
81
  else {
81
82
  core_1.ux.log(`Configure your app's DNS provider to point to the DNS Target ${color_1.color.green(domain.cname || '')}.
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const command_1 = require("@heroku-cli/command");
4
4
  const color_1 = require("@heroku-cli/color");
5
5
  const core_1 = require("@oclif/core");
6
+ const heroku_cli_util_1 = require("@heroku/heroku-cli-util");
6
7
  const Uri = require("urijs");
7
8
  const prompts_1 = require("@inquirer/prompts");
8
9
  const paginator_1 = require("../../lib/utils/paginator");
@@ -87,10 +88,10 @@ class DomainsIndex extends command_1.Command {
87
88
  customDomains = this.getFilteredDomains(flags.filter, domains).filteredDomains;
88
89
  }
89
90
  if (flags.json) {
90
- core_1.ux.styledJSON(domains);
91
+ heroku_cli_util_1.hux.styledJSON(domains);
91
92
  }
92
93
  else {
93
- core_1.ux.styledHeader(`${flags.app} Heroku Domain`);
94
+ heroku_cli_util_1.hux.styledHeader(`${flags.app} Heroku Domain`);
94
95
  core_1.ux.log(herokuDomain && herokuDomain.hostname);
95
96
  if (customDomains && customDomains.length > 0) {
96
97
  core_1.ux.log();
@@ -102,8 +103,8 @@ class DomainsIndex extends command_1.Command {
102
103
  }
103
104
  }
104
105
  core_1.ux.log();
105
- core_1.ux.styledHeader(`${flags.app} Custom Domains`);
106
- core_1.ux.table(customDomains, this.tableConfig(true), Object.assign(Object.assign({}, flags), { 'no-truncate': true }));
106
+ heroku_cli_util_1.hux.styledHeader(`${flags.app} Custom Domains`);
107
+ heroku_cli_util_1.hux.table(customDomains, this.tableConfig(true), Object.assign(Object.assign({}, flags), { 'no-truncate': true }));
107
108
  }
108
109
  }
109
110
  }
@@ -2,12 +2,13 @@
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 DomainsInfo extends command_1.Command {
6
7
  async run() {
7
8
  const { args, flags } = await this.parse(DomainsInfo);
8
9
  const { body: res } = await this.heroku.get(`/apps/${flags.app}/domains/${args.hostname}`);
9
10
  const domain = Object.assign(Object.assign({}, res), { app: res.app && res.app.name });
10
- core_1.ux.styledObject(domain);
11
+ heroku_cli_util_1.hux.styledObject(domain);
11
12
  }
12
13
  }
13
14
  exports.default = DomainsInfo;
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const core_1 = require("@oclif/core");
4
+ const heroku_cli_util_1 = require("@heroku/heroku-cli-util");
4
5
  const color_1 = require("@heroku-cli/color");
5
6
  const command_1 = require("@heroku-cli/command");
6
7
  const lodash_1 = require("lodash");
@@ -19,19 +20,19 @@ class Drains extends command_1.Command {
19
20
  }
20
21
  const { body: drains } = await this.heroku.get(path);
21
22
  if (flags.json) {
22
- core_1.ux.styledJSON(drains);
23
+ heroku_cli_util_1.hux.styledJSON(drains);
23
24
  }
24
25
  else {
25
26
  const [drainsWithAddons, drainsWithoutAddons] = (0, lodash_1.partition)(drains, 'addon');
26
27
  if (drainsWithoutAddons.length > 0) {
27
- core_1.ux.styledHeader('Drains');
28
+ heroku_cli_util_1.hux.styledHeader('Drains');
28
29
  drainsWithoutAddons.forEach((drain) => {
29
30
  styledDrain(drain.url || '', color_1.default.green(drain.token || ''), drain);
30
31
  });
31
32
  }
32
33
  if (drainsWithAddons.length > 0) {
33
34
  const addons = await Promise.all(drainsWithAddons.map((d) => { var _a; return this.heroku.get(`/apps/${flags.app}/addons/${(_a = d.addon) === null || _a === void 0 ? void 0 : _a.name}`); }));
34
- core_1.ux.styledHeader('Add-on Drains');
35
+ heroku_cli_util_1.hux.styledHeader('Add-on Drains');
35
36
  addons.forEach(({ body: addon }, i) => {
36
37
  var _a;
37
38
  styledDrain(color_1.default.yellow(((_a = addon.plan) === null || _a === void 0 ? void 0 : _a.name) || ''), color_1.default.green(addon.name || ''), drainsWithAddons[i]);
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const core_1 = require("@oclif/core");
4
+ const heroku_cli_util_1 = require("@heroku/heroku-cli-util");
4
5
  const color_1 = require("@heroku-cli/color");
5
6
  const command_1 = require("@heroku-cli/command");
6
7
  const lodash_1 = require("lodash");
@@ -13,10 +14,10 @@ class Features extends command_1.Command {
13
14
  features = features.filter(f => f.state === 'general');
14
15
  features = (0, lodash_1.sortBy)(features, 'name');
15
16
  if (json) {
16
- core_1.ux.styledJSON(features);
17
+ heroku_cli_util_1.hux.styledJSON(features);
17
18
  }
18
19
  else {
19
- core_1.ux.styledHeader(`App Features ${color_1.default.app(app)}`);
20
+ heroku_cli_util_1.hux.styledHeader(`App Features ${color_1.default.app(app)}`);
20
21
  const longest = Math.max.apply(null, features.map(f => { var _a; return ((_a = f.name) === null || _a === void 0 ? void 0 : _a.length) || 0; }));
21
22
  for (const f of features) {
22
23
  let line = `${f.enabled ? '[+]' : '[ ]'} ${(_a = f.name) === null || _a === void 0 ? void 0 : _a.padEnd(longest)}`;
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const core_1 = require("@oclif/core");
4
+ const heroku_cli_util_1 = require("@heroku/heroku-cli-util");
4
5
  const color_1 = require("@heroku-cli/color");
5
6
  const command_1 = require("@heroku-cli/command");
6
7
  class Info extends command_1.Command {
@@ -9,11 +10,11 @@ class Info extends command_1.Command {
9
10
  const { app, json } = flags;
10
11
  const { body: feature } = await this.heroku.get(`/apps/${app}/features/${args.feature}`);
11
12
  if (json) {
12
- core_1.ux.styledJSON(feature);
13
+ heroku_cli_util_1.hux.styledJSON(feature);
13
14
  }
14
15
  else {
15
- core_1.ux.styledHeader(feature.name || '');
16
- core_1.ux.styledObject({
16
+ heroku_cli_util_1.hux.styledHeader(feature.name || '');
17
+ heroku_cli_util_1.hux.styledObject({
17
18
  Description: feature.description,
18
19
  Enabled: feature.enabled ? color_1.default.green('true') : color_1.default.red('false'),
19
20
  Docs: feature.doc_url,
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const core_1 = require("@oclif/core");
4
+ const heroku_cli_util_1 = require("@heroku/heroku-cli-util");
4
5
  const color_1 = require("@heroku-cli/color");
5
6
  const command_1 = require("@heroku-cli/command");
6
7
  const inquirer = require("inquirer");
@@ -22,7 +23,7 @@ async function confirmPrompt(message) {
22
23
  message: message,
23
24
  }]);
24
25
  }
25
- const data = await core_1.ux.prompt(message + ' [Y/n]');
26
+ const data = await heroku_cli_util_1.hux.prompt(message + ' [Y/n]');
26
27
  return { yes: /^y(es)?/i.test(data) };
27
28
  }
28
29
  class Add extends command_1.Command {
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const core_1 = require("@oclif/core");
4
+ const heroku_cli_util_1 = require("@heroku/heroku-cli-util");
4
5
  const color_1 = require("@heroku-cli/color");
5
6
  const command_1 = require("@heroku-cli/command");
6
7
  function formatKey(key) {
@@ -12,13 +13,13 @@ class Keys extends command_1.Command {
12
13
  const { flags } = await this.parse(Keys);
13
14
  const { body: keys } = await this.heroku.get('/account/keys');
14
15
  if (flags.json) {
15
- core_1.ux.styledJSON(keys);
16
+ heroku_cli_util_1.hux.styledJSON(keys);
16
17
  }
17
18
  else if (keys.length === 0) {
18
19
  core_1.ux.warn('You have no SSH keys.');
19
20
  }
20
21
  else {
21
- core_1.ux.styledHeader(`${color_1.default.cyan(keys[0].email || '')} keys`);
22
+ heroku_cli_util_1.hux.styledHeader(`${color_1.default.cyan(keys[0].email || '')} keys`);
22
23
  if (flags.long) {
23
24
  keys.forEach(k => core_1.ux.log(k.public_key));
24
25
  }
@@ -3,11 +3,12 @@ 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 SecurityExceptionFeatures = {
7
8
  'spaces-strict-tls': {
8
9
  async prompt(app) {
9
10
  core_1.ux.warn('Insecure Action');
10
- const name = await core_1.ux.prompt(`You are enabling an older security protocol, TLS 1.0, which some organizations may not deem secure.
11
+ const name = await heroku_cli_util_1.hux.prompt(`You are enabling an older security protocol, TLS 1.0, which some organizations may not deem secure.
11
12
  To proceed, type ${app} or re-run this command with --confirm ${app}`);
12
13
  return name;
13
14
  },
@@ -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
  function printJSON(features) {
8
9
  core_1.ux.log(JSON.stringify(features, null, 2));
@@ -51,11 +52,11 @@ class LabsIndex extends command_1.Command {
51
52
  printJSON({ app, user });
52
53
  }
53
54
  else {
54
- core_1.ux.styledHeader(`User Features ${color_1.default.cyan(features.currentUser.email)}`);
55
+ heroku_cli_util_1.hux.styledHeader(`User Features ${color_1.default.cyan(features.currentUser.email)}`);
55
56
  printFeatures(features.user);
56
57
  if (features.app) {
57
58
  core_1.ux.log();
58
- core_1.ux.styledHeader(`App Features ${color_1.default.app(flags.app)}`);
59
+ heroku_cli_util_1.hux.styledHeader(`App Features ${color_1.default.app(flags.app)}`);
59
60
  printFeatures(features.app);
60
61
  }
61
62
  }
@@ -3,9 +3,10 @@ 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
  function print(feature) {
7
- core_1.ux.styledHeader(feature.name);
8
- core_1.ux.styledObject({
8
+ heroku_cli_util_1.hux.styledHeader(feature.name);
9
+ heroku_cli_util_1.hux.styledObject({
9
10
  Description: feature.description,
10
11
  Enabled: feature.enabled ? color_1.default.green(feature.enabled) : color_1.default.red(feature.enabled),
11
12
  Docs: feature.doc_url,
@@ -29,7 +30,7 @@ class LabsInfo extends command_1.Command {
29
30
  feature = featureResponse.body;
30
31
  }
31
32
  if (flags.json) {
32
- core_1.ux.styledJSON(feature);
33
+ heroku_cli_util_1.hux.styledJSON(feature);
33
34
  }
34
35
  else {
35
36
  print(feature);
@@ -4,6 +4,7 @@ const color_1 = require("@heroku-cli/color");
4
4
  const command_1 = require("@heroku-cli/command");
5
5
  const completions_1 = require("@heroku-cli/command/lib/completions");
6
6
  const core_1 = require("@oclif/core");
7
+ const heroku_cli_util_1 = require("@heroku/heroku-cli-util");
7
8
  const _ = require('lodash');
8
9
  const buildTableColumns = (teamInvites) => {
9
10
  const baseColumns = {
@@ -61,7 +62,7 @@ class MembersIndex extends command_1.Command {
61
62
  }
62
63
  else {
63
64
  const tableColumns = buildTableColumns(teamInvites);
64
- core_1.ux.table(members, tableColumns);
65
+ heroku_cli_util_1.hux.table(members, tableColumns);
65
66
  }
66
67
  }
67
68
  }
@@ -3,11 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const command_1 = require("@heroku-cli/command");
4
4
  const color_1 = require("@heroku-cli/color");
5
5
  const core_1 = require("@oclif/core");
6
+ const heroku_cli_util_1 = require("@heroku/heroku-cli-util");
6
7
  const time = require("../../lib/time");
7
8
  const wrap = require("word-wrap");
8
9
  function displayNotifications(notifications, app, readNotification) {
9
10
  const read = readNotification ? 'Read' : 'Unread';
10
- core_1.ux.styledHeader(app ? `${read} Notifications for ${color_1.default.app(app.name)}` : `${read} Notifications`);
11
+ heroku_cli_util_1.hux.styledHeader(app ? `${read} Notifications for ${color_1.default.app(app.name)}` : `${read} Notifications`);
11
12
  for (const n of notifications) {
12
13
  core_1.ux.log(color_1.default.yellow(`\n${n.title}\n`));
13
14
  core_1.ux.log(wrap(`\n${color_1.default.dim(time.ago(new Date(n.created_at)))}\n${n.body}`, { width: 80 }));
@@ -31,7 +32,7 @@ class NotificationsIndex extends command_1.Command {
31
32
  await Promise.all(notifications.map(n => this.heroku.patch(`/user/notifications/${n.id}`, { hostname: 'telex.heroku.com', body: { read: true } })));
32
33
  }
33
34
  if (flags.json) {
34
- core_1.ux.styledJSON(notifications);
35
+ heroku_cli_util_1.hux.styledJSON(notifications);
35
36
  return;
36
37
  }
37
38
  if (notifications.length === 0) {
@@ -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 backups_1 = require("../../../lib/pg/backups");
7
8
  const host_1 = require("../../../lib/pg/host");
8
9
  class Index extends command_1.Command {
@@ -26,12 +27,12 @@ class Index extends command_1.Command {
26
27
  displayBackups(transfers, app) {
27
28
  const backups = transfers.filter(backupTransfer => backupTransfer.from_type === 'pg_dump' && backupTransfer.to_type === 'gof3r');
28
29
  const { name, status, filesize } = (0, backups_1.default)(app, this.heroku);
29
- core_1.ux.styledHeader('Backups');
30
+ heroku_cli_util_1.hux.styledHeader('Backups');
30
31
  if (backups.length === 0) {
31
32
  core_1.ux.log(`No backups. Capture one with ${color_1.default.cyan.bold('heroku pg:backups:capture')}`);
32
33
  }
33
34
  else {
34
- core_1.ux.table(backups, {
35
+ heroku_cli_util_1.hux.table(backups, {
35
36
  ID: {
36
37
  get: (transfer) => color_1.default.cyan(name(transfer)),
37
38
  },
@@ -56,12 +57,12 @@ class Index extends command_1.Command {
56
57
  .filter(t => t.from_type !== 'pg_dump' && t.to_type === 'pg_restore')
57
58
  .slice(0, 10); // first 10 only
58
59
  const { name, status, filesize } = (0, backups_1.default)(app, this.heroku);
59
- core_1.ux.styledHeader('Restores');
60
+ heroku_cli_util_1.hux.styledHeader('Restores');
60
61
  if (restores.length === 0) {
61
62
  core_1.ux.log(`No restores found. Use ${color_1.default.cyan.bold('heroku pg:backups:restore')} to restore a backup`);
62
63
  }
63
64
  else {
64
- core_1.ux.table(restores, {
65
+ heroku_cli_util_1.hux.table(restores, {
65
66
  ID: {
66
67
  get: (transfer) => color_1.default.cyan(name(transfer)),
67
68
  },
@@ -84,12 +85,12 @@ class Index extends command_1.Command {
84
85
  displayCopies(transfers, app) {
85
86
  const { name, status, filesize } = (0, backups_1.default)(app, this.heroku);
86
87
  const copies = transfers.filter(t => t.from_type === 'pg_dump' && t.to_type === 'pg_restore').slice(0, 10);
87
- core_1.ux.styledHeader('Copies');
88
+ heroku_cli_util_1.hux.styledHeader('Copies');
88
89
  if (copies.length === 0) {
89
90
  core_1.ux.log(`No copies found. Use ${color_1.default.cyan.bold('heroku pg:copy')} to copy a database to another`);
90
91
  }
91
92
  else {
92
- core_1.ux.table(copies, {
93
+ heroku_cli_util_1.hux.table(copies, {
93
94
  ID: {
94
95
  get: (transfer) => color_1.default.cyan(name(transfer)),
95
96
  },
@@ -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 host_1 = require("../../../lib/pg/host");
7
8
  const backups_1 = require("../../../lib/pg/backups");
8
9
  const lodash_1 = require("lodash");
@@ -53,8 +54,8 @@ class Info extends command_1.Command {
53
54
  };
54
55
  this.displayBackup = (backup, app) => {
55
56
  const { filesize, name } = (0, backups_1.default)(app, this.heroku);
56
- core_1.ux.styledHeader(`Backup ${color_1.default.cyan(name(backup))}`);
57
- core_1.ux.styledObject({
57
+ heroku_cli_util_1.hux.styledHeader(`Backup ${color_1.default.cyan(name(backup))}`);
58
+ heroku_cli_util_1.hux.styledObject({
58
59
  Database: color_1.default.green(backup.from_name),
59
60
  'Started at': backup.started_at,
60
61
  'Finished at': backup.finished_at,
@@ -65,7 +66,7 @@ class Info extends command_1.Command {
65
66
  core_1.ux.log();
66
67
  };
67
68
  this.displayLogs = (backup) => {
68
- core_1.ux.styledHeader('Backup Logs');
69
+ heroku_cli_util_1.hux.styledHeader('Backup Logs');
69
70
  for (const log of backup.logs)
70
71
  core_1.ux.log(`${log.created_at} ${log.message}`);
71
72
  core_1.ux.log();
@@ -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 host_1 = require("../../../lib/pg/host");
7
8
  const fetcher_1 = require("../../../lib/pg/fetcher");
8
9
  class Schedules extends command_1.Command {
@@ -15,7 +16,7 @@ class Schedules extends command_1.Command {
15
16
  core_1.ux.warn(`No backup schedules found on ${color_1.default.app(app)}\nUse ${color_1.default.cyan.bold('heroku pg:backups:schedule')} to set one up`);
16
17
  }
17
18
  else {
18
- core_1.ux.styledHeader('Backup Schedules');
19
+ heroku_cli_util_1.hux.styledHeader('Backup Schedules');
19
20
  for (const s of schedules) {
20
21
  core_1.ux.log(`${color_1.default.green(s.name)}: daily at ${s.hour}:00 ${s.timezone}`);
21
22
  }
@@ -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 host_1 = require("../../lib/pg/host");
6
7
  const fetcher_1 = require("../../lib/pg/fetcher");
7
8
  const util_1 = require("../../lib/pg/util");
@@ -30,7 +31,7 @@ class Credentials extends command_1.Command {
30
31
  }
31
32
  return (0, util_1.presentCredentialAttachments)(app, credAttachments, sortedCredentials, cred.name);
32
33
  };
33
- core_1.ux.table(credentials, {
34
+ heroku_cli_util_1.hux.table(credentials, {
34
35
  Credential: {
35
36
  get: presentCredential,
36
37
  },
@@ -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 util_1 = require("@oclif/core/lib/util");
6
7
  const tsheredoc_1 = require("tsheredoc");
7
8
  const fetcher_1 = require("../../lib/pg/fetcher");
@@ -25,7 +26,7 @@ class Diagnose extends command_1.Command {
25
26
  }
26
27
  displayReport(report, json) {
27
28
  if (json) {
28
- core_1.ux.styledJSON(report);
29
+ heroku_cli_util_1.hux.styledJSON(report);
29
30
  return;
30
31
  }
31
32
  core_1.ux.log(`Report ${report.id} for ${report.app}::${report.database}\navailable for one month after creation on ${report.created_at}\n`);
@@ -52,7 +53,7 @@ class Diagnose extends command_1.Command {
52
53
  get: (row) => row[key],
53
54
  };
54
55
  });
55
- core_1.ux.table(check.results, cols);
56
+ heroku_cli_util_1.hux.table(check.results, cols);
56
57
  }
57
58
  else {
58
59
  const [key] = resultsKeys;
@@ -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 host_1 = require("../../lib/pg/host");
7
8
  const fetcher_1 = require("../../lib/pg/fetcher");
8
9
  const util_1 = require("../../lib/pg/util");
@@ -10,11 +11,11 @@ const nls_1 = require("../../nls");
10
11
  function displayDB(db, app) {
11
12
  var _a, _b, _c, _d, _e;
12
13
  if (db.addon.attachment_names) {
13
- core_1.ux.styledHeader(db.addon.attachment_names.map((c) => color_1.default.green(c + '_URL'))
14
+ heroku_cli_util_1.hux.styledHeader(db.addon.attachment_names.map((c) => color_1.default.green(c + '_URL'))
14
15
  .join(', '));
15
16
  }
16
17
  else {
17
- core_1.ux.styledHeader(((_a = db.configVars) === null || _a === void 0 ? void 0 : _a.map(c => color_1.default.green(c)).join(', ')) || '');
18
+ heroku_cli_util_1.hux.styledHeader(((_a = db.configVars) === null || _a === void 0 ? void 0 : _a.map(c => color_1.default.green(c)).join(', ')) || '');
18
19
  }
19
20
  if (db.addon.app.name && db.addon.app.name !== app) {
20
21
  (_b = db.dbInfo) === null || _b === void 0 ? void 0 : _b.info.push({ name: 'Billing App', values: [color_1.default.cyan(db.addon.app.name)] });
@@ -34,7 +35,7 @@ function displayDB(db, app) {
34
35
  }
35
36
  });
36
37
  const keys = (_e = db.dbInfo) === null || _e === void 0 ? void 0 : _e.info.map(i => i.name);
37
- core_1.ux.styledObject(info, keys);
38
+ heroku_cli_util_1.hux.styledObject(info, keys);
38
39
  core_1.ux.log();
39
40
  }
40
41
  class Info extends command_1.Command {