heroku 10.7.0 → 10.7.1-alpha.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.
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 +1 -1
  116. package/package.json +9 -6
@@ -4,6 +4,7 @@ const color_1 = require("@heroku-cli/color");
4
4
  const command_1 = require("@heroku-cli/command");
5
5
  const api_client_1 = require("@heroku-cli/command/lib/api-client");
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 teamUtils_1 = require("../../lib/teamUtils");
9
10
  function printJSON(collaborators) {
@@ -40,7 +41,7 @@ function printAccess(app, collaborators) {
40
41
  })
41
42
  .value();
42
43
  const tableColumns = buildTableColumns(showPermissions);
43
- core_1.ux.table(collaborators, tableColumns);
44
+ heroku_cli_util_1.hux.table(collaborators, tableColumns);
44
45
  }
45
46
  function buildCollaboratorsArray(collaboratorsRaw, admins) {
46
47
  const collaboratorsNoAdmins = _.reject(collaboratorsRaw, { role: 'admin' });
@@ -2,13 +2,14 @@
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 accounts_1 = require("../../lib/accounts/accounts");
6
7
  const color_1 = require("@heroku-cli/color");
7
8
  class Current extends command_1.Command {
8
9
  async run() {
9
10
  const account = (0, accounts_1.current)();
10
11
  if (account) {
11
- core_1.ux.styledHeader(`Current account is ${account}`);
12
+ heroku_cli_util_1.hux.styledHeader(`Current account is ${account}`);
12
13
  }
13
14
  else {
14
15
  core_1.ux.error(`You haven't set an account. Run ${color_1.default.cmd('heroku accounts:add <account-name>')} to add an account to your cache or ${color_1.default.cmd('heroku accounts:set <account-name>')} to set the current account.`);
@@ -4,6 +4,7 @@ exports.renderAttachment = 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 util_1 = require("../../lib/addons/util");
8
9
  const lodash_1 = require("lodash");
9
10
  const printf = require('printf');
@@ -78,7 +79,7 @@ function displayAll(addons) {
78
79
  core_1.ux.log('No add-ons.');
79
80
  return;
80
81
  }
81
- core_1.ux.table(addons, {
82
+ heroku_cli_util_1.hux.table(addons, {
82
83
  'Owning App': {
83
84
  get: ({ app }) => color_1.default.cyan((app === null || app === void 0 ? void 0 : app.name) || ''),
84
85
  },
@@ -166,7 +167,7 @@ function displayForApp(app, addons) {
166
167
  }
167
168
  addons = (0, lodash_1.sortBy)(addons, isForeignApp, 'plan.name', 'name');
168
169
  core_1.ux.log();
169
- core_1.ux.table(addons, {
170
+ heroku_cli_util_1.hux.table(addons, {
170
171
  'Add-on': { get: presentAddon },
171
172
  Plan: {
172
173
  get: ({ plan }) => plan && plan.name !== undefined ?
@@ -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 util_1 = require("../../lib/addons/util");
7
8
  const resolve_1 = require("../../lib/addons/resolve");
8
9
  const topic = 'addons';
@@ -15,8 +16,8 @@ class Info extends command_1.Command {
15
16
  const { body: attachments } = await this.heroku.get(`/addons/${addon.id}/addon-attachments`);
16
17
  addon.plan.price = (0, util_1.grandfatheredPrice)(addon);
17
18
  addon.attachments = attachments;
18
- core_1.ux.styledHeader(color_1.default.magenta((_a = addon.name) !== null && _a !== void 0 ? _a : ''));
19
- core_1.ux.styledObject({
19
+ heroku_cli_util_1.hux.styledHeader(color_1.default.magenta((_a = addon.name) !== null && _a !== void 0 ? _a : ''));
20
+ heroku_cli_util_1.hux.styledObject({
20
21
  Plan: addon.plan.name,
21
22
  Price: (0, util_1.formatPrice)({ price: addon.plan.price, hourly: true }),
22
23
  'Max Price': (0, util_1.formatPrice)({ price: addon.plan.price, hourly: false }),
@@ -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("../../lib/addons/util");
6
7
  const _ = require("lodash");
7
8
  const printf = require("printf");
@@ -19,10 +20,10 @@ class Plans extends command_1.Command {
19
20
  });
20
21
  plans = _.sortBy(plans, ['price.contract', 'price.cents']);
21
22
  if (flags.json) {
22
- core_1.ux.styledJSON(plans);
23
+ heroku_cli_util_1.hux.styledJSON(plans);
23
24
  }
24
25
  else {
25
- core_1.ux.table(plans, {
26
+ heroku_cli_util_1.hux.table(plans, {
26
27
  default: {
27
28
  header: '',
28
29
  get: (plan) => plan.default ? 'default' : '',
@@ -3,15 +3,16 @@ 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 Services extends command_1.Command {
7
8
  async run() {
8
9
  const { flags } = await this.parse(Services);
9
10
  const { body: services } = await this.heroku.get('/addon-services');
10
11
  if (flags.json) {
11
- core_1.ux.styledJSON(services);
12
+ heroku_cli_util_1.hux.styledJSON(services);
12
13
  }
13
14
  else {
14
- core_1.ux.table(services, {
15
+ heroku_cli_util_1.hux.table(services, {
15
16
  name: {
16
17
  header: 'Slug',
17
18
  },
@@ -5,6 +5,7 @@ const fs_extra_1 = require("fs-extra");
5
5
  const command_1 = require("@heroku-cli/command");
6
6
  const completions_1 = require("@heroku-cli/command/lib/completions");
7
7
  const core_1 = require("@oclif/core");
8
+ const heroku_cli_util_1 = require("@heroku/heroku-cli-util");
8
9
  const color_1 = require("@heroku-cli/color");
9
10
  const lodash_1 = require("lodash");
10
11
  const git_1 = require("../../lib/git/git");
@@ -78,7 +79,7 @@ async function configureGitRemote(context, app) {
78
79
  }
79
80
  function printAppSummary(context, app, remoteUrl) {
80
81
  if (context.flags.json) {
81
- core_1.ux.styledJSON(app);
82
+ heroku_cli_util_1.hux.styledJSON(app);
82
83
  }
83
84
  else {
84
85
  core_1.ux.log(`${color_1.default.cyan(app.web_url || '')} | ${color_1.default.green(remoteUrl)}`);
@@ -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 error_info_1 = require("../../lib/apps/error_info");
8
9
  const colorize = (level, s) => {
@@ -85,7 +86,7 @@ class Errors extends command_1.Command {
85
86
  router,
86
87
  };
87
88
  if (flags.json) {
88
- core_1.ux.styledJSON(errors);
89
+ heroku_cli_util_1.hux.styledJSON(errors);
89
90
  }
90
91
  else {
91
92
  let t = buildErrorTable(errors.router, 'router');
@@ -96,8 +97,8 @@ class Errors extends command_1.Command {
96
97
  core_1.ux.log(`No errors on ${color_1.default.app(flags.app)} in the last ${hours} hours`);
97
98
  }
98
99
  else {
99
- core_1.ux.styledHeader(`Errors on ${color_1.default.app(flags.app)} in the last ${hours} hours`);
100
- core_1.ux.table(t, {
100
+ heroku_cli_util_1.hux.styledHeader(`Errors on ${color_1.default.app(flags.app)} in the last ${hours} hours`);
101
+ heroku_cli_util_1.hux.table(t, {
101
102
  source: {},
102
103
  name: { get: ({ name, level }) => colorize(level, name) },
103
104
  level: { get: ({ level }) => colorize(level, level) },
@@ -1,16 +1,17 @@
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 command_1 = require("@heroku-cli/command");
5
6
  class Index extends command_1.Command {
6
7
  async run() {
7
8
  const { flags } = await this.parse(Index);
8
9
  const { body: favorites } = await this.heroku.get('/favorites?type=app', { hostname: 'particleboard.heroku.com' });
9
10
  if (flags.json) {
10
- core_1.ux.styledJSON(favorites);
11
+ heroku_cli_util_1.hux.styledJSON(favorites);
11
12
  }
12
13
  else {
13
- core_1.ux.styledHeader('Favorited Apps');
14
+ heroku_cli_util_1.hux.styledHeader('Favorited Apps');
14
15
  for (const f of favorites) {
15
16
  core_1.ux.log(f.resource_name);
16
17
  }
@@ -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 command_1 = require("@heroku-cli/command");
5
6
  const _ = require("lodash");
6
7
  const color_1 = require("@heroku-cli/color");
@@ -38,17 +39,17 @@ function print(apps, user, space, team) {
38
39
  core_1.ux.log('You have no apps.');
39
40
  }
40
41
  else if (space) {
41
- core_1.ux.styledHeader(`Apps in space ${color_1.default.green(space)}`);
42
+ heroku_cli_util_1.hux.styledHeader(`Apps in space ${color_1.default.green(space)}`);
42
43
  listApps(apps);
43
44
  }
44
45
  else if (team) {
45
- core_1.ux.styledHeader(`Apps in team ${color_1.default.magenta(team)}`);
46
+ heroku_cli_util_1.hux.styledHeader(`Apps in team ${color_1.default.magenta(team)}`);
46
47
  listApps(apps);
47
48
  }
48
49
  else {
49
50
  apps = _.partition(apps, (app) => app.owner.email === user.email);
50
51
  if (apps[0].length > 0) {
51
- core_1.ux.styledHeader(`${color_1.default.cyan(user.email)} Apps`);
52
+ heroku_cli_util_1.hux.styledHeader(`${color_1.default.cyan(user.email)} Apps`);
52
53
  listApps(apps[0]);
53
54
  }
54
55
  const columns = {
@@ -56,8 +57,8 @@ function print(apps, user, space, team) {
56
57
  email: { get: ({ owner }) => owner.email },
57
58
  };
58
59
  if (apps[1].length > 0) {
59
- core_1.ux.styledHeader('Collaborated Apps');
60
- core_1.ux.table(apps[1], columns, { 'no-header': true });
60
+ heroku_cli_util_1.hux.styledHeader('Collaborated Apps');
61
+ heroku_cli_util_1.hux.table(apps[1], columns, { 'no-header': true });
61
62
  }
62
63
  }
63
64
  }
@@ -91,7 +92,7 @@ class AppsIndex extends command_1.Command {
91
92
  apps = apps.filter((a) => a.internal_routing);
92
93
  }
93
94
  if (flags.json) {
94
- core_1.ux.styledJSON(apps);
95
+ heroku_cli_util_1.hux.styledJSON(apps);
95
96
  }
96
97
  else {
97
98
  print(apps, user, space, team);
@@ -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 command_1 = require("@heroku-cli/command");
5
6
  const util = require("util");
6
7
  const _ = require("lodash");
@@ -75,8 +76,8 @@ function print(info, addons, collaborators, extended) {
75
76
  }
76
77
  return stack;
77
78
  })(info.app);
78
- core_1.ux.styledHeader(info.app.name);
79
- core_1.ux.styledObject(data);
79
+ heroku_cli_util_1.hux.styledHeader(info.app.name);
80
+ heroku_cli_util_1.hux.styledObject(data);
80
81
  if (extended) {
81
82
  core_1.ux.log('\n\n--- Extended Information ---\n\n');
82
83
  if (info.app.extended) {
@@ -128,7 +129,7 @@ class AppsInfo extends command_1.Command {
128
129
  shell();
129
130
  }
130
131
  else if (flags.json) {
131
- core_1.ux.styledJSON(info);
132
+ heroku_cli_util_1.hux.styledJSON(info);
132
133
  }
133
134
  else {
134
135
  print(info, addons, collaborators, flags.extended);
@@ -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 command_1 = require("@heroku-cli/command");
5
6
  const _ = require("lodash");
6
7
  const color_1 = require("@heroku-cli/color");
@@ -20,7 +21,7 @@ class StacksIndex extends command_1.Command {
20
21
  const app = appResponse.body;
21
22
  const stacks = stackResponse.body;
22
23
  const sortedStacks = _.sortBy(stacks, 'name');
23
- core_1.ux.styledHeader(`${color_1.default.app(app.name)} Available Stacks`);
24
+ heroku_cli_util_1.hux.styledHeader(`${color_1.default.app(app.name)} Available Stacks`);
24
25
  for (const stack of sortedStacks) {
25
26
  if (stack.name === app.stack.name) {
26
27
  core_1.ux.log(color_1.default.green('* ' + updateCedarName(stack.name)));
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const command_1 = require("@heroku-cli/command");
4
4
  const completions_1 = require("@heroku-cli/command/lib/completions");
5
5
  const core_1 = require("@oclif/core");
6
+ const heroku_cli_util_1 = require("@heroku/heroku-cli-util");
6
7
  const authorizations_1 = require("../../lib/authorizations/authorizations");
7
8
  class AuthorizationsCreate extends command_1.Command {
8
9
  async run() {
@@ -20,7 +21,7 @@ class AuthorizationsCreate extends command_1.Command {
20
21
  core_1.ux.log(auth.access_token && auth.access_token.token);
21
22
  }
22
23
  else if (flags.json) {
23
- core_1.ux.styledJSON(auth);
24
+ heroku_cli_util_1.hux.styledJSON(auth);
24
25
  }
25
26
  else {
26
27
  (0, authorizations_1.display)(auth);
@@ -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 AuthorizationsIndex extends command_1.Command {
8
9
  async run() {
@@ -10,14 +11,14 @@ class AuthorizationsIndex extends command_1.Command {
10
11
  let { body: authorizations } = await this.heroku.get('/oauth/authorizations');
11
12
  authorizations = sortBy(authorizations, 'description');
12
13
  if (flags.json) {
13
- core_1.ux.styledJSON(authorizations);
14
+ heroku_cli_util_1.hux.styledJSON(authorizations);
14
15
  }
15
16
  else if (authorizations.length === 0) {
16
17
  core_1.ux.log('No OAuth authorizations.');
17
18
  }
18
19
  else {
19
20
  const printLine = (...args) => this.log(...args);
20
- core_1.ux.table(authorizations, {
21
+ heroku_cli_util_1.hux.table(authorizations, {
21
22
  description: { get: (v) => color_1.default.green(v.description) },
22
23
  id: {},
23
24
  scope: { get: (v) => v.scope.join(',') },
@@ -2,13 +2,14 @@
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 authorizations_1 = require("../../lib/authorizations/authorizations");
6
7
  class AuthorizationsInfo extends command_1.Command {
7
8
  async run() {
8
9
  const { args, flags } = await this.parse(AuthorizationsInfo);
9
10
  const { body: authentication } = await this.heroku.get(`/oauth/authorizations/${args.id}`);
10
11
  if (flags.json) {
11
- core_1.ux.styledJSON(authentication);
12
+ heroku_cli_util_1.hux.styledJSON(authentication);
12
13
  }
13
14
  else {
14
15
  (0, authorizations_1.display)(authentication);
@@ -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 fs = require("fs-extra");
6
7
  const path = require("path");
7
8
  const base_1 = require("../../lib/autocomplete/base");
@@ -43,7 +44,7 @@ class Doctor extends base_1.AutocompleteBase {
43
44
  appsCacheValue = 'missing';
44
45
  }
45
46
  data.push({ name: 'apps completion cache', value: appsCacheValue });
46
- core_1.ux.table(data, {
47
+ heroku_cli_util_1.hux.table(data, {
47
48
  name: {},
48
49
  value: {},
49
50
  }, { 'no-header': true, printLine });
@@ -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 color_1 = require("@heroku-cli/color");
6
6
  const buildpacks_1 = require("../../lib/buildpacks/buildpacks");
7
7
  const generation_1 = require("../../lib/apps/generation");
@@ -28,7 +28,7 @@ class Index extends command_1.Command {
28
28
  else {
29
29
  header += ` Classic ${pluralizedBuildpacks} (from the Heroku Buildpack Registry)`;
30
30
  }
31
- core_1.ux.styledHeader(header);
31
+ heroku_cli_util_1.hux.styledHeader(header);
32
32
  buildpacksCommand.display(buildpacks, '');
33
33
  }
34
34
  }
@@ -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 true_myth_1 = require("true-myth");
6
7
  const buildpack_registry_1 = require("@heroku/buildpack-registry");
7
8
  class Info extends command_1.Command {
@@ -17,8 +18,8 @@ class Info extends command_1.Command {
17
18
  const result = await registry.info(args.buildpack);
18
19
  true_myth_1.Result.match({
19
20
  Ok: buildpack => {
20
- core_1.ux.styledHeader(args.buildpack);
21
- core_1.ux.styledObject(buildpack, ['description', 'category', 'license', 'support', 'source', 'readme']);
21
+ heroku_cli_util_1.hux.styledHeader(args.buildpack);
22
+ heroku_cli_util_1.hux.styledObject(buildpack, ['description', 'category', 'license', 'support', 'source', 'readme']);
22
23
  },
23
24
  Err: err => {
24
25
  if (err.status === 404) {
@@ -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 buildpack_registry_1 = require("@heroku/buildpack-registry");
6
7
  class Search extends command_1.Command {
7
8
  async run() {
@@ -30,7 +31,7 @@ class Search extends command_1.Command {
30
31
  };
31
32
  });
32
33
  const displayTable = (buildpacks) => {
33
- core_1.ux.table(buildpacks, {
34
+ heroku_cli_util_1.hux.table(buildpacks, {
34
35
  buildpack: {
35
36
  header: 'Buildpack',
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 true_myth_1 = require("true-myth");
6
7
  const buildpack_registry_1 = require("@heroku/buildpack-registry");
7
8
  class Versions extends command_1.Command {
@@ -21,7 +22,7 @@ class Versions extends command_1.Command {
21
22
  const result = await registry.listVersions(args.buildpack);
22
23
  true_myth_1.Result.match({
23
24
  Ok: versions => {
24
- core_1.ux.table(versions.sort((a, b) => {
25
+ heroku_cli_util_1.hux.table(versions.sort((a, b) => {
25
26
  return a.release > b.release ? -1 : 1;
26
27
  }), {
27
28
  release: {
@@ -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 domains_1 = require("../../lib/certs/domains");
7
8
  const inquirer_1 = require("inquirer");
8
9
  const get_cert_and_key_1 = require("../../lib/certs/get_cert_and_key");
@@ -14,7 +15,7 @@ async function configureDomains(app, heroku, cert) {
14
15
  const appDomains = apiDomains === null || apiDomains === void 0 ? void 0 : apiDomains.map((domain) => domain.hostname);
15
16
  const matchedDomains = matchDomains(certDomains, appDomains !== null && appDomains !== void 0 ? appDomains : []);
16
17
  if (matchedDomains.length > 0) {
17
- core_1.ux.styledHeader('Almost done! Which of these domains on this application would you like this certificate associated with?');
18
+ heroku_cli_util_1.hux.styledHeader('Almost done! Which of these domains on this application would you like this certificate associated with?');
18
19
  const selections = await (0, inquirer_1.prompt)([{
19
20
  type: 'checkbox',
20
21
  name: 'domains',
@@ -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 domains_1 = require("../../../lib/domains/domains");
7
8
  const notify_1 = require("../../../lib/notify");
8
9
  class Enable extends command_1.Command {
@@ -20,7 +21,7 @@ class Enable extends command_1.Command {
20
21
  }
21
22
  catch (error) {
22
23
  (0, notify_1.default)('heroku certs:auto:enable', 'An error occurred', false);
23
- core_1.ux.styledHeader(`${color_1.default.red('Error')}: The certificate could not be issued to all domains. See status with ${color_1.default.cmd('heroku certs:auto')}.`);
24
+ heroku_cli_util_1.hux.styledHeader(`${color_1.default.red('Error')}: The certificate could not be issued to all domains. See status with ${color_1.default.cmd('heroku certs:auto')}.`);
24
25
  throw error;
25
26
  }
26
27
  }
@@ -37,7 +38,7 @@ class Enable extends command_1.Command {
37
38
  (0, domains_1.printDomains)(changedCnames, message);
38
39
  }
39
40
  else {
40
- core_1.ux.styledHeader(message);
41
+ heroku_cli_util_1.hux.styledHeader(message);
41
42
  }
42
43
  }
43
44
  }
@@ -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 certificate_details_1 = require("../../../lib/certs/certificate_details");
7
8
  const domains_1 = require("../../../lib/domains/domains");
8
9
  const date_fns_1 = require("date-fns");
@@ -35,10 +36,10 @@ class Index extends command_1.Command {
35
36
  this.heroku.get(`/apps/${flags.app}/sni-endpoints`),
36
37
  ]);
37
38
  if (!app.acm) {
38
- core_1.ux.styledHeader(`Automatic Certificate Management is ${color_1.default.yellow('disabled')} on ${flags.app}`);
39
+ heroku_cli_util_1.hux.styledHeader(`Automatic Certificate Management is ${color_1.default.yellow('disabled')} on ${flags.app}`);
39
40
  return;
40
41
  }
41
- core_1.ux.styledHeader(`Automatic Certificate Management is ${color_1.default.green('enabled')} on ${flags.app}`);
42
+ heroku_cli_util_1.hux.styledHeader(`Automatic Certificate Management is ${color_1.default.green('enabled')} on ${flags.app}`);
42
43
  if (sniEndpoints.length === 1 && sniEndpoints[0].ssl_cert.acm) {
43
44
  (0, certificate_details_1.displayCertificateDetails)(sniEndpoints[0]);
44
45
  core_1.ux.log('');
@@ -63,7 +64,7 @@ class Index extends command_1.Command {
63
64
  See our documentation at https://devcenter.heroku.com/articles/automated-certificate-management#failure-reasons`;
64
65
  }
65
66
  if (domains.length > 0) {
66
- core_1.ux.table(domains, Object.assign(Object.assign({ Domain: {
67
+ heroku_cli_util_1.hux.table(domains, Object.assign(Object.assign({ Domain: {
67
68
  get: (domain) => domain.hostname,
68
69
  }, Status: {
69
70
  get: (domain) => humanize(domain.acm_status),
@@ -80,7 +81,7 @@ class Index extends command_1.Command {
80
81
  }
81
82
  }
82
83
  if (message) {
83
- core_1.ux.styledHeader(message);
84
+ heroku_cli_util_1.hux.styledHeader(message);
84
85
  }
85
86
  }
86
87
  }
@@ -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 color_1 = require("@heroku-cli/color");
6
7
  const shellescape = require("shell-escape");
7
8
  const pipelines_1 = require("../../../lib/ci/pipelines");
@@ -17,15 +18,15 @@ class CiConfig extends command_1.Command {
17
18
  });
18
19
  }
19
20
  else if (flags.json) {
20
- core_1.ux.styledJSON(config);
21
+ heroku_cli_util_1.hux.styledJSON(config);
21
22
  }
22
23
  else {
23
- core_1.ux.styledHeader(`${pipeline.name} test config vars`);
24
+ heroku_cli_util_1.hux.styledHeader(`${pipeline.name} test config vars`);
24
25
  const formattedConfig = {};
25
26
  Object.keys(config).forEach(key => {
26
27
  formattedConfig[color_1.default.green(key)] = config[key];
27
28
  });
28
- core_1.ux.styledObject(formattedConfig);
29
+ heroku_cli_util_1.hux.styledObject(formattedConfig);
29
30
  }
30
31
  }
31
32
  }
@@ -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 pipelines_1 = require("../../../lib/ci/pipelines");
5
6
  const command_1 = require("@heroku-cli/command");
6
7
  const api_1 = require("../../../lib/api");
@@ -27,7 +28,7 @@ class CiConfigSet extends command_1.Command {
27
28
  core_1.ux.action.start(`Setting ${Object.keys(vars).join(', ')}`);
28
29
  await (0, api_1.setPipelineConfigVars)(this.heroku, pipeline.id, vars);
29
30
  core_1.ux.action.stop();
30
- core_1.ux.styledObject(Object.keys(vars).reduce((memo, key) => {
31
+ heroku_cli_util_1.hux.styledObject(Object.keys(vars).reduce((memo, key) => {
31
32
  memo[color_1.default.green(key)] = vars[key];
32
33
  return memo;
33
34
  }, {}));
@@ -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 clients_1 = require("../../lib/clients/clients");
6
7
  class ClientsCreate extends command_1.Command {
7
8
  async run() {
@@ -14,7 +15,7 @@ class ClientsCreate extends command_1.Command {
14
15
  });
15
16
  core_1.ux.action.stop();
16
17
  if (flags.json) {
17
- core_1.ux.styledJSON(client);
18
+ heroku_cli_util_1.hux.styledJSON(client);
18
19
  }
19
20
  else {
20
21
  core_1.ux.log(`HEROKU_OAUTH_ID=${client.id}`);
@@ -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 ClientsIndex extends command_1.Command {
8
9
  async run() {
@@ -10,14 +11,14 @@ class ClientsIndex extends command_1.Command {
10
11
  let { body: clients } = await this.heroku.get('/oauth/clients');
11
12
  clients = sortBy(clients, 'name');
12
13
  if (flags.json) {
13
- core_1.ux.styledJSON(clients);
14
+ heroku_cli_util_1.hux.styledJSON(clients);
14
15
  }
15
16
  else if (clients.length === 0) {
16
17
  core_1.ux.log('No OAuth clients.');
17
18
  }
18
19
  else {
19
20
  const printLine = (...args) => this.log(...args);
20
- core_1.ux.table(clients, {
21
+ heroku_cli_util_1.hux.table(clients, {
21
22
  name: { get: (w) => color_1.default.green(w.name) },
22
23
  id: {},
23
24
  redirect_uri: {},
@@ -2,20 +2,21 @@
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 ClientsInfo extends command_1.Command {
6
7
  async run() {
7
8
  const { args, flags } = await this.parse(ClientsInfo);
8
9
  const { body: client } = await this.heroku.get(`/oauth/clients/${args.id}`);
9
10
  if (flags.json) {
10
- core_1.ux.styledJSON(client);
11
+ heroku_cli_util_1.hux.styledJSON(client);
11
12
  }
12
13
  else if (flags.shell) {
13
14
  core_1.ux.log(`HEROKU_OAUTH_ID=${client.id}`);
14
15
  core_1.ux.log(`HEROKU_OAUTH_SECRET=${client.secret}`);
15
16
  }
16
17
  else {
17
- core_1.ux.styledHeader(`${client.name}`);
18
- core_1.ux.styledObject(client);
18
+ heroku_cli_util_1.hux.styledHeader(`${client.name}`);
19
+ heroku_cli_util_1.hux.styledObject(client);
19
20
  }
20
21
  }
21
22
  }