heroku 10.0.0-alpha.0 → 10.0.0-alpha.2

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 (162) hide show
  1. package/lib/commands/access/add.js +1 -1
  2. package/lib/commands/access/index.js +2 -1
  3. package/lib/commands/access/update.js +1 -1
  4. package/lib/commands/addons/attach.js +1 -1
  5. package/lib/commands/addons/create.js +1 -1
  6. package/lib/commands/addons/destroy.js +1 -1
  7. package/lib/commands/addons/detach.js +1 -1
  8. package/lib/commands/addons/docs.js +1 -1
  9. package/lib/commands/addons/info.js +1 -1
  10. package/lib/commands/addons/open.js +1 -1
  11. package/lib/commands/addons/plans.js +1 -1
  12. package/lib/commands/addons/rename.js +2 -2
  13. package/lib/commands/addons/upgrade.js +2 -2
  14. package/lib/commands/addons/wait.js +1 -1
  15. package/lib/commands/apps/open.js +1 -1
  16. package/lib/commands/apps/rename.js +1 -1
  17. package/lib/commands/apps/stacks/set.js +1 -1
  18. package/lib/commands/authorizations/info.js +1 -1
  19. package/lib/commands/authorizations/revoke.js +1 -1
  20. package/lib/commands/authorizations/rotate.js +1 -1
  21. package/lib/commands/authorizations/update.js +1 -1
  22. package/lib/commands/certs/add.js +2 -2
  23. package/lib/commands/certs/generate.js +1 -1
  24. package/lib/commands/certs/update.js +2 -2
  25. package/lib/commands/ci/config/get.js +1 -1
  26. package/lib/commands/ci/info.js +1 -1
  27. package/lib/commands/ci/rerun.js +1 -1
  28. package/lib/commands/clients/create.js +2 -2
  29. package/lib/commands/clients/destroy.js +1 -1
  30. package/lib/commands/clients/info.js +1 -1
  31. package/lib/commands/clients/rotate.js +1 -1
  32. package/lib/commands/clients/update.js +1 -1
  33. package/lib/commands/config/get.js +1 -1
  34. package/lib/commands/domains/add.js +1 -1
  35. package/lib/commands/domains/info.js +1 -1
  36. package/lib/commands/domains/remove.js +1 -1
  37. package/lib/commands/domains/update.js +1 -1
  38. package/lib/commands/domains/wait.js +1 -1
  39. package/lib/commands/drains/add.js +1 -1
  40. package/lib/commands/drains/remove.js +1 -1
  41. package/lib/commands/features/disable.js +1 -1
  42. package/lib/commands/features/enable.js +1 -1
  43. package/lib/commands/features/info.js +1 -1
  44. package/lib/commands/git/credentials.js +1 -1
  45. package/lib/commands/keys/add.js +1 -1
  46. package/lib/commands/keys/remove.js +1 -1
  47. package/lib/commands/labs/disable.js +1 -1
  48. package/lib/commands/labs/enable.js +1 -1
  49. package/lib/commands/labs/info.js +1 -1
  50. package/lib/commands/local/index.js +1 -1
  51. package/lib/commands/logs.d.ts +2 -2
  52. package/lib/commands/logs.js +9 -7
  53. package/lib/commands/members/add.js +1 -1
  54. package/lib/commands/pg/backups/cancel.js +1 -1
  55. package/lib/commands/pg/backups/capture.js +2 -1
  56. package/lib/commands/pg/backups/delete.js +1 -1
  57. package/lib/commands/pg/backups/download.js +1 -1
  58. package/lib/commands/pg/backups/info.js +1 -1
  59. package/lib/commands/pg/backups/restore.d.ts +1 -0
  60. package/lib/commands/pg/backups/restore.js +29 -2
  61. package/lib/commands/pg/backups/schedule.js +2 -1
  62. package/lib/commands/pg/backups/unschedule.js +2 -1
  63. package/lib/commands/pg/backups/url.js +1 -1
  64. package/lib/commands/pg/bloat.js +2 -1
  65. package/lib/commands/pg/blocking.js +2 -1
  66. package/lib/commands/pg/connection-pooling/attach.js +2 -1
  67. package/lib/commands/pg/copy.js +2 -2
  68. package/lib/commands/pg/credentials/create.js +2 -1
  69. package/lib/commands/pg/credentials/destroy.js +2 -1
  70. package/lib/commands/pg/credentials/repair-default.js +2 -1
  71. package/lib/commands/pg/credentials/rotate.js +2 -1
  72. package/lib/commands/pg/credentials/url.js +2 -1
  73. package/lib/commands/pg/credentials.js +2 -1
  74. package/lib/commands/pg/diagnose.js +1 -1
  75. package/lib/commands/pg/info.js +2 -1
  76. package/lib/commands/pg/kill.js +3 -2
  77. package/lib/commands/pg/killall.js +2 -1
  78. package/lib/commands/pg/links/create.js +3 -2
  79. package/lib/commands/pg/links/destroy.js +3 -2
  80. package/lib/commands/pg/links/index.js +2 -1
  81. package/lib/commands/pg/locks.js +2 -1
  82. package/lib/commands/pg/maintenance/index.js +2 -1
  83. package/lib/commands/pg/maintenance/run.js +2 -1
  84. package/lib/commands/pg/maintenance/window.js +3 -2
  85. package/lib/commands/pg/outliers.js +2 -1
  86. package/lib/commands/pg/promote.js +2 -1
  87. package/lib/commands/pg/ps.js +2 -1
  88. package/lib/commands/pg/psql.js +2 -1
  89. package/lib/commands/pg/pull.js +3 -2
  90. package/lib/commands/pg/push.js +4 -3
  91. package/lib/commands/pg/reset.js +2 -1
  92. package/lib/commands/pg/settings/auto-explain/log-analyze.js +3 -2
  93. package/lib/commands/pg/settings/auto-explain/log-buffers.js +3 -2
  94. package/lib/commands/pg/settings/auto-explain/log-format.js +3 -2
  95. package/lib/commands/pg/settings/auto-explain/log-min-duration.js +3 -2
  96. package/lib/commands/pg/settings/auto-explain/log-nested-statements.js +3 -2
  97. package/lib/commands/pg/settings/auto-explain/log-triggers.js +3 -2
  98. package/lib/commands/pg/settings/auto-explain/log-verbose.js +3 -2
  99. package/lib/commands/pg/settings/auto-explain.js +3 -2
  100. package/lib/commands/pg/settings/explain-data-connector-details.js +3 -2
  101. package/lib/commands/pg/settings/index.js +2 -1
  102. package/lib/commands/pg/settings/log-connections.js +3 -2
  103. package/lib/commands/pg/settings/log-lock-waits.js +3 -2
  104. package/lib/commands/pg/settings/log-min-duration-statement.js +3 -2
  105. package/lib/commands/pg/settings/log-min-error-statement.js +2 -1
  106. package/lib/commands/pg/settings/log-statement.js +3 -2
  107. package/lib/commands/pg/settings/track-functions.js +3 -2
  108. package/lib/commands/pg/unfollow.js +2 -1
  109. package/lib/commands/pg/upgrade.js +2 -1
  110. package/lib/commands/pg/vacuum-stats.js +2 -1
  111. package/lib/commands/pg/wait.js +2 -1
  112. package/lib/commands/ps/autoscale/enable.js +13 -2
  113. package/lib/commands/ps/index.js +15 -6
  114. package/lib/commands/ps/restart.d.ts +2 -1
  115. package/lib/commands/ps/restart.js +43 -11
  116. package/lib/commands/ps/stop.d.ts +3 -2
  117. package/lib/commands/ps/stop.js +40 -9
  118. package/lib/commands/ps/type.js +2 -1
  119. package/lib/commands/redis/cli.js +1 -1
  120. package/lib/commands/redis/credentials.js +1 -1
  121. package/lib/commands/redis/info.js +1 -1
  122. package/lib/commands/redis/keyspace-notifications.js +1 -1
  123. package/lib/commands/redis/maintenance.js +1 -1
  124. package/lib/commands/redis/maxmemory.js +1 -1
  125. package/lib/commands/redis/promote.js +1 -1
  126. package/lib/commands/redis/stats-reset.js +1 -1
  127. package/lib/commands/redis/timeout.js +1 -1
  128. package/lib/commands/redis/upgrade.js +1 -1
  129. package/lib/commands/redis/wait.js +1 -1
  130. package/lib/commands/releases/index.js +4 -2
  131. package/lib/commands/releases/info.js +6 -2
  132. package/lib/commands/releases/output.js +1 -1
  133. package/lib/commands/releases/rollback.js +14 -4
  134. package/lib/commands/sessions/destroy.js +1 -1
  135. package/lib/commands/spaces/create.d.ts +1 -0
  136. package/lib/commands/spaces/create.js +4 -2
  137. package/lib/commands/spaces/drains/set.js +1 -1
  138. package/lib/commands/spaces/trusted-ips/add.js +3 -6
  139. package/lib/commands/spaces/trusted-ips/index.js +1 -3
  140. package/lib/commands/spaces/trusted-ips/remove.js +3 -4
  141. package/lib/commands/telemetry/add.d.ts +0 -1
  142. package/lib/commands/telemetry/add.js +21 -31
  143. package/lib/commands/telemetry/index.d.ts +1 -1
  144. package/lib/commands/telemetry/index.js +16 -10
  145. package/lib/commands/telemetry/remove.js +2 -2
  146. package/lib/commands/webhooks/deliveries/info.js +1 -1
  147. package/lib/commands/webhooks/events/info.js +1 -1
  148. package/lib/commands/webhooks/info.js +1 -1
  149. package/lib/commands/webhooks/update.js +1 -1
  150. package/lib/hooks/plugins/preinstall/disclaimers.d.ts +3 -0
  151. package/lib/hooks/plugins/preinstall/disclaimers.js +26 -0
  152. package/lib/lib/releases/releases.js +10 -3
  153. package/lib/lib/releases/status_helper.d.ts +2 -2
  154. package/lib/lib/releases/status_helper.js +5 -1
  155. package/lib/lib/run/log-displayer.js +6 -2
  156. package/lib/lib/types/app_process_tier.d.ts +4 -0
  157. package/lib/lib/types/app_process_tier.js +2 -0
  158. package/lib/nls.d.ts +8 -0
  159. package/lib/nls.js +14 -0
  160. package/lib/package.nls.json +6 -0
  161. package/oclif.manifest.json +237 -23
  162. package/package.json +6 -3
@@ -4,6 +4,7 @@ const command_1 = require("@heroku-cli/command");
4
4
  const core_1 = require("@oclif/core");
5
5
  const tsheredoc_1 = require("tsheredoc");
6
6
  const setter_1 = require("../../../lib/pg/setter");
7
+ const nls_1 = require("../../../nls");
7
8
  // ref: https://www.postgresql.org/docs/current/auto-explain.html
8
9
  class AutoExplain extends setter_1.PGSettingsCommand {
9
10
  constructor() {
@@ -32,7 +33,7 @@ AutoExplain.flags = {
32
33
  remote: command_1.flags.remote(),
33
34
  };
34
35
  AutoExplain.args = {
35
- database: core_1.Args.string(),
36
- value: core_1.Args.string(),
36
+ database: core_1.Args.string({ description: `${(0, nls_1.nls)('pg:database:arg:description')} ${(0, nls_1.nls)('pg:database:arg:description:default:suffix')}` }),
37
+ value: core_1.Args.string({ description: 'boolean indicating if execution plans of queries will be logged for future connections' }),
37
38
  };
38
39
  AutoExplain.strict = false;
@@ -4,6 +4,7 @@ const command_1 = require("@heroku-cli/command");
4
4
  const core_1 = require("@oclif/core");
5
5
  const tsheredoc_1 = require("tsheredoc");
6
6
  const setter_1 = require("../../../lib/pg/setter");
7
+ const nls_1 = require("../../../nls");
7
8
  class ExplainDataConnectorDetails extends setter_1.PGSettingsCommand {
8
9
  constructor() {
9
10
  super(...arguments);
@@ -28,6 +29,6 @@ ExplainDataConnectorDetails.flags = {
28
29
  remote: command_1.flags.remote(),
29
30
  };
30
31
  ExplainDataConnectorDetails.args = {
31
- database: core_1.Args.string(),
32
- value: core_1.Args.string(),
32
+ database: core_1.Args.string({ description: `${(0, nls_1.nls)('pg:database:arg:description')} ${(0, nls_1.nls)('pg:database:arg:description:default:suffix')}` }),
33
+ value: core_1.Args.string({ description: 'boolean indicating if data replication slot details get logged' }),
33
34
  };
@@ -5,6 +5,7 @@ const core_1 = require("@oclif/core");
5
5
  const resolve_1 = require("../../../lib/addons/resolve");
6
6
  const util_1 = require("../../../lib/pg/util");
7
7
  const host_1 = require("../../../lib/pg/host");
8
+ const nls_1 = require("../../../nls");
8
9
  class Index extends command_1.Command {
9
10
  async run() {
10
11
  const { flags, args } = await this.parse(Index);
@@ -30,5 +31,5 @@ Index.flags = {
30
31
  remote: command_1.flags.remote(),
31
32
  };
32
33
  Index.args = {
33
- database: core_1.Args.string(),
34
+ database: core_1.Args.string({ description: `${(0, nls_1.nls)('pg:database:arg:description')} ${(0, nls_1.nls)('pg:database:arg:description:default:suffix')}` }),
34
35
  };
@@ -4,6 +4,7 @@ const command_1 = require("@heroku-cli/command");
4
4
  const core_1 = require("@oclif/core");
5
5
  const tsheredoc_1 = require("tsheredoc");
6
6
  const setter_1 = require("../../../lib/pg/setter");
7
+ const nls_1 = require("../../../nls");
7
8
  class LogConnections extends setter_1.PGSettingsCommand {
8
9
  constructor() {
9
10
  super(...arguments);
@@ -29,6 +30,6 @@ LogConnections.flags = {
29
30
  remote: command_1.flags.remote(),
30
31
  };
31
32
  LogConnections.args = {
32
- database: core_1.Args.string(),
33
- value: core_1.Args.string(),
33
+ database: core_1.Args.string({ description: `${(0, nls_1.nls)('pg:database:arg:description')} ${(0, nls_1.nls)('pg:database:arg:description:default:suffix')}` }),
34
+ value: core_1.Args.string({ description: 'boolean indicating if database login attempts get logged' }),
34
35
  };
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const core_1 = require("@oclif/core");
4
4
  const tsheredoc_1 = require("tsheredoc");
5
5
  const setter_1 = require("../../../lib/pg/setter");
6
+ const nls_1 = require("../../../nls");
6
7
  class LogLockWaits extends setter_1.PGSettingsCommand {
7
8
  constructor() {
8
9
  super(...arguments);
@@ -26,6 +27,6 @@ LogLockWaits.description = (0, tsheredoc_1.default)(`
26
27
  Applications and their query patterns should try to avoid changes to many different tables within the same transaction.
27
28
  `);
28
29
  LogLockWaits.args = {
29
- database: core_1.Args.string(),
30
- value: core_1.Args.string(),
30
+ database: core_1.Args.string({ description: `${(0, nls_1.nls)('pg:database:arg:description')} ${(0, nls_1.nls)('pg:database:arg:description:default:suffix')}` }),
31
+ value: core_1.Args.string({ description: 'boolean indicating if a message gets logged when a session waits longer than the deadlock_timeout to acquire a lock' }),
31
32
  };
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const core_1 = require("@oclif/core");
4
4
  const tsheredoc_1 = require("tsheredoc");
5
5
  const setter_1 = require("../../../lib/pg/setter");
6
+ const nls_1 = require("../../../nls");
6
7
  class LogMinDurationStatement extends setter_1.PGSettingsCommand {
7
8
  constructor() {
8
9
  super(...arguments);
@@ -28,6 +29,6 @@ LogMinDurationStatement.description = (0, tsheredoc_1.default)(`
28
29
  Setting log_min_duration_statement to zero prints all statement durations and -1 will disable logging statement durations.
29
30
  `);
30
31
  LogMinDurationStatement.args = {
31
- database: core_1.Args.string(),
32
- value: core_1.Args.string(),
32
+ database: core_1.Args.string({ description: `${(0, nls_1.nls)('pg:database:arg:description')} ${(0, nls_1.nls)('pg:database:arg:description:default:suffix')}` }),
33
+ value: core_1.Args.string({ description: 'milliseconds to wait for a statement to complete before logging it' }),
33
34
  };
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const core_1 = require("@oclif/core");
4
4
  const tsheredoc_1 = require("tsheredoc");
5
5
  const setter_1 = require("../../../lib/pg/setter");
6
+ const nls_1 = require("../../../nls");
6
7
  class LogMinErrorStatement extends setter_1.PGSettingsCommand {
7
8
  constructor() {
8
9
  super(...arguments);
@@ -22,6 +23,6 @@ LogMinErrorStatement.description = (0, tsheredoc_1.default)(`
22
23
  Use this setting to prevent logging SQL queries that contain sensitive information. Default is "error".
23
24
  `);
24
25
  LogMinErrorStatement.args = {
25
- database: core_1.Args.string(),
26
+ database: core_1.Args.string({ description: `${(0, nls_1.nls)('pg:database:arg:description')} ${(0, nls_1.nls)('pg:database:arg:description:default:suffix')}` }),
26
27
  value: core_1.Args.string({ options: ['error', 'log', 'fatal', 'panic'] }),
27
28
  };
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const core_1 = require("@oclif/core");
4
4
  const tsheredoc_1 = require("tsheredoc");
5
5
  const setter_1 = require("../../../lib/pg/setter");
6
+ const nls_1 = require("../../../nls");
6
7
  class LogStatement extends setter_1.PGSettingsCommand {
7
8
  constructor() {
8
9
  super(...arguments);
@@ -25,6 +26,6 @@ LogStatement.description = (0, tsheredoc_1.default)(`
25
26
  all - All statements are logged
26
27
  `);
27
28
  LogStatement.args = {
28
- database: core_1.Args.string(),
29
- value: core_1.Args.string({ options: ['none', 'ddl', 'mod', 'all'] }),
29
+ database: core_1.Args.string({ description: `${(0, nls_1.nls)('pg:database:arg:description')} ${(0, nls_1.nls)('pg:database:arg:description:default:suffix')}` }),
30
+ value: core_1.Args.string({ options: ['none', 'ddl', 'mod', 'all'], description: 'type of SQL statements to log\n<options: none|ddl|mod|all>' }),
30
31
  };
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const core_1 = require("@oclif/core");
4
4
  const tsheredoc_1 = require("tsheredoc");
5
5
  const setter_1 = require("../../../lib/pg/setter");
6
+ const nls_1 = require("../../../nls");
6
7
  // ref: https://www.postgresql.org/docs/current/runtime-config-statistics.html#GUC-TRACK-FUNCTIONS
7
8
  class TrackFunctions extends setter_1.PGSettingsCommand {
8
9
  constructor() {
@@ -24,6 +25,6 @@ TrackFunctions.description = (0, tsheredoc_1.default)(`
24
25
  pl - Only procedural language functions are tracked
25
26
  all - All functions, including SQL and C language functions, are tracked. Simple SQL-language that are inlined are not tracked`);
26
27
  TrackFunctions.args = {
27
- database: core_1.Args.string(),
28
- value: core_1.Args.string({ options: ['none', 'pl', 'all'] }),
28
+ database: core_1.Args.string({ description: `${(0, nls_1.nls)('pg:database:arg:description')} ${(0, nls_1.nls)('pg:database:arg:description:default:suffix')}` }),
29
+ value: core_1.Args.string({ options: ['none', 'pl', 'all'], description: 'function type to track\n<options: none|pl|all>' }),
29
30
  };
@@ -8,6 +8,7 @@ const host_1 = require("../../lib/pg/host");
8
8
  const util_1 = require("../../lib/pg/util");
9
9
  const confirmCommand_1 = require("../../lib/confirmCommand");
10
10
  const tsheredoc_1 = require("tsheredoc");
11
+ const nls_1 = require("../../nls");
11
12
  class Unfollow extends command_1.Command {
12
13
  async run() {
13
14
  const { flags, args } = await this.parse(Unfollow);
@@ -36,5 +37,5 @@ Unfollow.flags = {
36
37
  remote: command_1.flags.remote(),
37
38
  };
38
39
  Unfollow.args = {
39
- database: core_1.Args.string({ required: true }),
40
+ database: core_1.Args.string({ required: true, description: (0, nls_1.nls)('pg:database:arg:description') }),
40
41
  };
@@ -8,6 +8,7 @@ const fetcher_1 = require("../../lib/pg/fetcher");
8
8
  const host_1 = require("../../lib/pg/host");
9
9
  const util_1 = require("../../lib/pg/util");
10
10
  const confirmCommand_1 = require("../../lib/confirmCommand");
11
+ const nls_1 = require("../../nls");
11
12
  class Upgrade extends command_1.Command {
12
13
  async run() {
13
14
  const { flags, args } = await this.parse(Upgrade);
@@ -54,5 +55,5 @@ Upgrade.flags = {
54
55
  remote: command_1.flags.remote(),
55
56
  };
56
57
  Upgrade.args = {
57
- database: core_1.Args.string(),
58
+ database: core_1.Args.string({ description: `${(0, nls_1.nls)('pg:database:arg:description')} ${(0, nls_1.nls)('pg:database:arg:description:default:suffix')}` }),
58
59
  };
@@ -5,6 +5,7 @@ const core_1 = require("@oclif/core");
5
5
  const fetcher_1 = require("../../lib/pg/fetcher");
6
6
  const psql_1 = require("../../lib/pg/psql");
7
7
  const tsheredoc_1 = require("tsheredoc");
8
+ const nls_1 = require("../../nls");
8
9
  class VacuumStats extends command_1.Command {
9
10
  async run() {
10
11
  const { flags, args } = await this.parse(VacuumStats);
@@ -61,5 +62,5 @@ VacuumStats.flags = {
61
62
  remote: command_1.flags.remote(),
62
63
  };
63
64
  VacuumStats.args = {
64
- database: core_1.Args.string(),
65
+ database: core_1.Args.string({ description: `${(0, nls_1.nls)('pg:database:arg:description')} ${(0, nls_1.nls)('pg:database:arg:description:default:suffix')}` }),
65
66
  };
@@ -7,6 +7,7 @@ const debug_1 = require("debug");
7
7
  const fetcher_1 = require("../../lib/pg/fetcher");
8
8
  const host_1 = require("../../lib/pg/host");
9
9
  const notify_1 = require("../../lib/notify");
10
+ const nls_1 = require("../../nls");
10
11
  const wait = (ms) => new Promise(resolve => {
11
12
  setTimeout(resolve, ms);
12
13
  });
@@ -75,5 +76,5 @@ Wait.flags = {
75
76
  remote: command_1.flags.remote(),
76
77
  };
77
78
  Wait.args = {
78
- database: core_1.Args.string(),
79
+ database: core_1.Args.string({ description: `${(0, nls_1.nls)('pg:database:arg:description')} ${(0, nls_1.nls)('pg:database:arg:description:all-dbs:suffix')}` }),
79
80
  };
@@ -12,12 +12,23 @@ class Enable extends command_1.Command {
12
12
  const { flags } = await this.parse(Enable);
13
13
  core_1.ux.action.start('Enabling dyno autoscaling');
14
14
  const [appResponse, formationResponse] = await Promise.all([
15
- this.heroku.get(`/apps/${flags.app}`),
16
- this.heroku.get(`/apps/${flags.app}/formation`),
15
+ this.heroku.get(`/apps/${flags.app}`, {
16
+ headers: {
17
+ Accept: 'application/vnd.heroku+json; version=3.sdk',
18
+ },
19
+ }),
20
+ this.heroku.get(`/apps/${flags.app}/formation`, {
21
+ headers: {
22
+ Accept: 'application/vnd.heroku+json; version=3.sdk',
23
+ },
24
+ }),
17
25
  ]);
18
26
  const app = appResponse.body;
19
27
  const formations = formationResponse.body;
20
28
  const webFormation = formations.find((f) => f.type === 'web');
29
+ if (app.generation === 'fir') {
30
+ throw new Error('Autoscaling is unavailable for apps in this space. See https://devcenter.heroku.com/articles/generations.');
31
+ }
21
32
  if (!webFormation)
22
33
  throw new Error(`${flags.app} does not have any web dynos to scale`);
23
34
  const { size } = webFormation;
@@ -7,7 +7,10 @@ const core_1 = require("@oclif/core");
7
7
  const time_1 = require("../../lib/time");
8
8
  const tsheredoc_1 = require("tsheredoc");
9
9
  function getProcessNumber(s) {
10
- return Number.parseInt(s.split('.', 2)[1], 10);
10
+ const [processType, dynoNumber] = (s.match(/^([^.]+)\.(.*)$/) || []).slice(1, 3);
11
+ if (!processType || !(dynoNumber === null || dynoNumber === void 0 ? void 0 : dynoNumber.match(/^\d+$/)))
12
+ return 0;
13
+ return Number.parseInt(dynoNumber, 10);
11
14
  }
12
15
  function uniqueValues(value, index, self) {
13
16
  return self.indexOf(value) === index;
@@ -135,11 +138,17 @@ class Index extends command_1.Command {
135
138
  const _a = await this.parse(Index), { flags } = _a, restParse = tslib_1.__rest(_a, ["flags"]);
136
139
  const { app, json, extended } = flags;
137
140
  const types = restParse.argv;
138
- const suffix = extended ? '?extended=true' : ''; // read previous comment, including this on the request doesn't make any difference.
141
+ const suffix = extended ? '?extended=true' : '';
139
142
  const promises = {
140
- dynos: this.heroku.request(`/apps/${app}/dynos${suffix}`),
141
- appInfo: this.heroku.request(`/apps/${app}`, { headers: { Accept: 'application/vnd.heroku+json; version=3.process-tier' } }),
142
- accountInfo: this.heroku.request('/account'),
143
+ dynos: this.heroku.request(`/apps/${app}/dynos${suffix}`, {
144
+ headers: { Accept: 'application/vnd.heroku+json; version=3.sdk' },
145
+ }),
146
+ appInfo: this.heroku.request(`/apps/${app}`, {
147
+ headers: { Accept: 'application/vnd.heroku+json; version=3.sdk' },
148
+ }),
149
+ accountInfo: this.heroku.request('/account', {
150
+ headers: { Accept: 'application/vnd.heroku+json; version=3.sdk' },
151
+ }),
143
152
  };
144
153
  const [{ body: dynos }, { body: appInfo }, { body: accountInfo }] = await Promise.all([promises.dynos, promises.appInfo, promises.accountInfo]);
145
154
  const shielded = appInfo.space && appInfo.space.shield;
@@ -191,5 +200,5 @@ Index.flags = {
191
200
  app: command_1.flags.app({ required: true }),
192
201
  remote: command_1.flags.remote(),
193
202
  json: command_1.flags.boolean({ description: 'display as json' }),
194
- extended: command_1.flags.boolean({ char: 'x', hidden: true }), // should be removed? Platform API doesn't serialize extended attributes even if the query param `extended=true` is sent.
203
+ extended: command_1.flags.boolean({ char: 'x', hidden: true }), // only works with sudo privileges
195
204
  };
@@ -5,13 +5,14 @@ export default class Restart extends Command {
5
5
  static aliases: string[];
6
6
  static hiddenAliases: string[];
7
7
  static examples: string[];
8
- static help: string;
9
8
  static args: {
10
9
  dyno: import("@oclif/core/lib/interfaces/parser").Arg<string | undefined, Record<string, unknown>>;
11
10
  };
12
11
  static flags: {
13
12
  app: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
14
13
  remote: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
14
+ 'dyno-name': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
15
+ 'process-type': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
15
16
  };
16
17
  run(): Promise<void>;
17
18
  }
@@ -3,36 +3,68 @@ 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 completions_1 = require("@heroku-cli/command/lib/completions");
7
+ const tsheredoc_1 = require("tsheredoc");
6
8
  class Restart extends command_1.Command {
7
9
  async run() {
8
10
  const { args, flags } = await this.parse(Restart);
9
11
  const app = flags.app;
10
- const dyno = args.dyno;
12
+ const dyno = flags['dyno-name'] || args.dyno;
13
+ const type = flags['process-type'];
11
14
  let msg = 'Restarting';
12
- if (dyno)
13
- msg += ` ${color_1.default.cyan(dyno)}`;
14
- msg += (dyno && dyno.includes('.')) ? ' dyno' : ' dynos';
15
+ let restartUrl;
16
+ if (type) {
17
+ msg += ` all ${color_1.default.cyan(type)} dynos`;
18
+ restartUrl = `/apps/${app}/formations/${encodeURIComponent(type)}`;
19
+ }
20
+ else if (dyno) {
21
+ if (args.dyno) {
22
+ core_1.ux.warn(`DYNO is a deprecated argument. Use ${color_1.default.cmd('--dyno-name')} or ${color_1.default.cmd('--process-type')} instead.`);
23
+ }
24
+ msg += ` dyno ${color_1.default.cyan(dyno)}`;
25
+ restartUrl = `/apps/${app}/dynos/${encodeURIComponent(dyno)}`;
26
+ }
27
+ else {
28
+ msg += ' all dynos';
29
+ restartUrl = `/apps/${app}/dynos`;
30
+ }
15
31
  msg += ` on ${color_1.default.app(app)}`;
16
32
  core_1.ux.action.start(msg);
17
- await this.heroku.delete(dyno ? `/apps/${app}/dynos/${encodeURIComponent(dyno)}` : `/apps/${app}/dynos`);
33
+ await this.heroku.delete(restartUrl, {
34
+ headers: {
35
+ Accept: 'application/vnd.heroku+json; version=3.sdk',
36
+ },
37
+ });
18
38
  core_1.ux.action.stop();
19
39
  }
20
40
  }
21
41
  exports.default = Restart;
22
- Restart.description = 'restart app dynos';
42
+ Restart.description = (0, tsheredoc_1.default)(`
43
+ restart an app dyno or process type
44
+ if neither --dyno nor --type are specified, restarts all dynos on app
45
+ `);
23
46
  Restart.topic = 'ps';
24
47
  Restart.aliases = ['dyno:restart'];
25
48
  Restart.hiddenAliases = ['restart'];
26
49
  Restart.examples = [
27
- '$ heroku ps:restart web.1',
28
- '$ heroku ps:restart web',
29
- '$ heroku ps:restart',
50
+ '$ heroku ps:restart --app myapp --dyno-name web.1',
51
+ '$ heroku ps:restart --app myapp --process-type web',
52
+ '$ heroku ps:restart --app myapp',
30
53
  ];
31
- Restart.help = 'if DYNO is not specified, restarts all dynos on app';
32
54
  Restart.args = {
33
- dyno: core_1.Args.string({ required: false }),
55
+ dyno: core_1.Args.string({ description: 'name of the dyno to restart', required: false, deprecated: true }),
34
56
  };
35
57
  Restart.flags = {
36
58
  app: command_1.flags.app({ required: true }),
37
59
  remote: command_1.flags.remote(),
60
+ 'dyno-name': command_1.flags.string({
61
+ char: 'd',
62
+ description: 'name of the dyno to restart',
63
+ }),
64
+ 'process-type': command_1.flags.string({
65
+ char: 'p',
66
+ description: 'name of the process type to restart',
67
+ completion: completions_1.ProcessTypeCompletion,
68
+ exclusive: ['dyno-name'],
69
+ }),
38
70
  };
@@ -5,13 +5,14 @@ export default class Stop extends Command {
5
5
  static aliases: string[];
6
6
  static hiddenAliases: string[];
7
7
  static examples: string[];
8
- static help: string;
9
8
  static args: {
10
- dyno: import("@oclif/core/lib/interfaces/parser").Arg<string, Record<string, unknown>>;
9
+ dyno: import("@oclif/core/lib/interfaces/parser").Arg<string | undefined, Record<string, unknown>>;
11
10
  };
12
11
  static flags: {
13
12
  app: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
14
13
  remote: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
14
+ 'dyno-name': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
15
+ 'process-type': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
15
16
  };
16
17
  run(): Promise<void>;
17
18
  }
@@ -3,31 +3,62 @@ 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 completions_1 = require("@heroku-cli/command/lib/completions");
7
+ const tsheredoc_1 = require("tsheredoc");
6
8
  class Stop extends command_1.Command {
7
9
  async run() {
8
10
  const { args, flags } = await this.parse(Stop);
9
11
  const app = flags.app;
10
- const dyno = args.dyno;
11
- const type = dyno.includes('.') ? 'ps' : 'type';
12
- core_1.ux.action.start(`Stopping ${color_1.default.cyan(dyno)} ${type === 'ps' ? 'dyno' : 'dynos'} on ${color_1.default.app(app)}`);
13
- await this.heroku.post(`/apps/${app}/dynos/${dyno}/actions/stop`);
12
+ const dyno = flags['dyno-name'] || args.dyno;
13
+ const type = flags['process-type'];
14
+ let msg = 'Stopping';
15
+ let stopUrl = '';
16
+ if (type) {
17
+ msg += ` all ${color_1.default.cyan(type)} dynos`;
18
+ stopUrl = `/apps/${app}/formations/${encodeURIComponent(type)}/actions/stop`;
19
+ }
20
+ else if (dyno) {
21
+ if (args.dyno) {
22
+ core_1.ux.warn(`DYNO is a deprecated argument. Use ${color_1.default.cmd('--dyno-name')} or ${color_1.default.cmd('--process-type')} instead.`);
23
+ }
24
+ msg += ` dyno ${color_1.default.cyan(dyno)}`;
25
+ stopUrl = `/apps/${app}/dynos/${encodeURIComponent(dyno)}/actions/stop`;
26
+ }
27
+ else {
28
+ core_1.ux.error((0, tsheredoc_1.default)(`
29
+ Please specify a process type or dyno name to stop.
30
+ See more help with --help
31
+ `));
32
+ }
33
+ msg += ` on ${color_1.default.app(app)}`;
34
+ core_1.ux.action.start(msg);
35
+ await this.heroku.post(stopUrl, { headers: { Accept: 'application/vnd.heroku+json; version=3.sdk' } });
14
36
  core_1.ux.action.stop();
15
37
  }
16
38
  }
17
39
  exports.default = Stop;
18
- Stop.description = 'stop app dyno';
40
+ Stop.description = 'stop an app dyno or process type';
19
41
  Stop.topic = 'ps';
20
42
  Stop.aliases = ['dyno:stop', 'ps:kill', 'dyno:kill'];
21
43
  Stop.hiddenAliases = ['stop', 'kill'];
22
44
  Stop.examples = [
23
- '$ heroku ps:stop run.1828',
24
- '$ heroku ps:stop run',
45
+ '$ heroku ps:stop --app myapp --dyno-name run.1828',
46
+ '$ heroku ps:stop --app myapp --process-type run',
25
47
  ];
26
- Stop.help = 'stop app dyno or dyno type';
27
48
  Stop.args = {
28
- dyno: core_1.Args.string({ required: true }),
49
+ dyno: core_1.Args.string({ description: 'name of the dyno to stop', required: false, deprecated: true }),
29
50
  };
30
51
  Stop.flags = {
31
52
  app: command_1.flags.app({ required: true }),
32
53
  remote: command_1.flags.remote(),
54
+ 'dyno-name': command_1.flags.string({
55
+ char: 'd',
56
+ description: 'name of the dyno to stop',
57
+ }),
58
+ 'process-type': command_1.flags.string({
59
+ char: 'p',
60
+ description: 'name of the process type to stop',
61
+ completion: completions_1.ProcessTypeCompletion,
62
+ exclusive: ['dyno-name'],
63
+ }),
33
64
  };
@@ -72,7 +72,7 @@ const displayFormation = async (heroku, app) => {
72
72
  if (formation.length === 0) {
73
73
  throw emptyFormationErr(app);
74
74
  }
75
- core_1.ux.styledHeader('Dyno Types');
75
+ core_1.ux.styledHeader('Process Types');
76
76
  core_1.ux.table(formationTableData, {
77
77
  type: {},
78
78
  size: {},
@@ -80,6 +80,7 @@ const displayFormation = async (heroku, app) => {
80
80
  'cost/hour': {},
81
81
  'max cost/month': {},
82
82
  });
83
+ core_1.ux.log();
83
84
  core_1.ux.styledHeader('Dyno Totals');
84
85
  core_1.ux.table(dynoTotalsTableData, {
85
86
  type: {},
@@ -187,7 +187,7 @@ Cli.flags = {
187
187
  remote: command_1.flags.remote(),
188
188
  };
189
189
  Cli.args = {
190
- database: core_1.Args.string(),
190
+ database: core_1.Args.string({ description: 'name of the Key-Value Store database. If omitted, it defaults to the primary database associated with the app.' }),
191
191
  };
192
192
  Cli.examples = [
193
193
  '$ heroku redis:cli --app=my-app my-database',
@@ -28,5 +28,5 @@ Credentials.flags = {
28
28
  reset: command_1.flags.boolean({ description: 'reset credentials' }),
29
29
  };
30
30
  Credentials.args = {
31
- database: core_1.Args.string({ required: false }),
31
+ database: core_1.Args.string({ required: false, description: 'name of the Key-Value Store database. If omitted, it defaults to the primary database associated with the app.' }),
32
32
  };
@@ -21,5 +21,5 @@ Info.flags = {
21
21
  json: command_1.flags.boolean({ char: 'j', description: 'output in json format' }),
22
22
  };
23
23
  Info.args = {
24
- database: core_1.Args.string(),
24
+ database: core_1.Args.string({ description: 'name of the Key-Value Store database. If omitted, it defaults to the primary database associated with the app.' }),
25
25
  };
@@ -43,5 +43,5 @@ KeyspaceNotifications.flags = {
43
43
  config: command_1.flags.string({ char: 'c', description: 'set keyspace notifications configuration', hasValue: true, required: true }),
44
44
  };
45
45
  KeyspaceNotifications.args = {
46
- database: core_1.Args.string(),
46
+ database: core_1.Args.string({ description: 'name of the Key-Value Store database. If omitted, it defaults to the primary database associated with the app.' }),
47
47
  };
@@ -59,5 +59,5 @@ Maintenance.flags = {
59
59
  }),
60
60
  };
61
61
  Maintenance.args = {
62
- database: core_1.Args.string({ required: false }),
62
+ database: core_1.Args.string({ required: false, description: 'name of the Key-Value Store database. If omitted, it defaults to the primary database associated with the app.' }),
63
63
  };
@@ -36,5 +36,5 @@ MaxMemory.flags = {
36
36
  remote: command_1.flags.remote(),
37
37
  };
38
38
  MaxMemory.args = {
39
- database: core_1.Args.string(),
39
+ database: core_1.Args.string({ description: 'name of the Key-Value Store database. If omitted, it defaults to the primary database associated with the app.' }),
40
40
  };
@@ -35,5 +35,5 @@ Promote.flags = {
35
35
  remote: command_1.flags.remote(),
36
36
  };
37
37
  Promote.args = {
38
- database: core_1.Args.string({ required: false }),
38
+ database: core_1.Args.string({ required: false, description: 'name of the Key-Value Store database. If omitted, it defaults to the primary database associated with the app.' }),
39
39
  };
@@ -32,5 +32,5 @@ StatsReset.flags = {
32
32
  confirm: command_1.flags.string({ char: 'c' }),
33
33
  };
34
34
  StatsReset.args = {
35
- database: core_1.Args.string(),
35
+ database: core_1.Args.string({ description: 'name of the Key-Value Store database. If omitted, it defaults to the primary database associated with the app.' }),
36
36
  };
@@ -31,5 +31,5 @@ Timeout.flags = {
31
31
  seconds: command_1.flags.integer({ char: 's', description: 'set timeout value', required: true }),
32
32
  };
33
33
  Timeout.args = {
34
- database: core_1.Args.string(),
34
+ database: core_1.Args.string({ description: 'name of the Key-Value Store database. If omitted, it defaults to the primary database associated with the app.' }),
35
35
  };
@@ -33,5 +33,5 @@ Upgrade.flags = {
33
33
  confirm: command_1.flags.string({ char: 'c' }),
34
34
  };
35
35
  Upgrade.args = {
36
- database: core_1.Args.string(),
36
+ database: core_1.Args.string({ description: 'name of the Key-Value Store database. If omitted, it defaults to the primary database associated with the app.' }),
37
37
  };
@@ -56,5 +56,5 @@ Wait.flags = {
56
56
  remote: command_1.flags.remote(),
57
57
  };
58
58
  Wait.args = {
59
- database: core_1.Args.string({ required: false }),
59
+ database: core_1.Args.string({ required: false, description: 'name of the Key-Value Store database. If omitted, it defaults to the primary database associated with the app.' }),
60
60
  };
@@ -57,8 +57,10 @@ class Index extends command_1.Command {
57
57
  const { app, num, json, extended } = flags;
58
58
  const url = `/apps/${app}/releases${extended ? '?extended=true' : ''}`;
59
59
  const { body: releases } = await this.heroku.request(url, {
60
- partial: true, headers: {
60
+ partial: true,
61
+ headers: {
61
62
  Range: `version ..; max=${num || 15}, order=desc`,
63
+ Accept: 'application/vnd.heroku+json; version=3.sdk',
62
64
  },
63
65
  });
64
66
  let optimizationWidth = 0;
@@ -100,7 +102,7 @@ class Index extends command_1.Command {
100
102
  let header = `${app} Releases`;
101
103
  const currentRelease = releases.find(r => r.current === true);
102
104
  if (currentRelease) {
103
- header += ' - ' + color_1.default.blue(`Current: v${currentRelease.version}`);
105
+ header += ' - ' + color_1.default.cyan(`Current: v${currentRelease.version}`);
104
106
  }
105
107
  core_1.ux.styledHeader(header);
106
108
  core_1.ux.table(releases, columns, { 'no-header': true, 'no-truncate': true, extended });
@@ -27,7 +27,11 @@ class Info extends command_1.Command {
27
27
  }
28
28
  core_1.ux.styledHeader(`Release ${color_1.default.cyan('v' + release.version)}`);
29
29
  core_1.ux.styledObject({
30
- 'Add-ons': release.addon_plan_names, Change: releaseChange, By: userEmail, When: release.created_at,
30
+ 'Add-ons': release.addon_plan_names,
31
+ Change: releaseChange,
32
+ By: userEmail,
33
+ 'Eligible for Rollback?': release.eligible_for_rollback ? 'Yes' : 'No',
34
+ When: release.created_at,
31
35
  });
32
36
  core_1.ux.log();
33
37
  core_1.ux.styledHeader(`${color_1.default.cyan('v' + release.version)} Config vars`);
@@ -52,5 +56,5 @@ Info.flags = {
52
56
  app: command_1.flags.app({ required: true }),
53
57
  };
54
58
  Info.args = {
55
- release: core_1.Args.string(),
59
+ release: core_1.Args.string({ description: 'ID of the release. If omitted, we use the last release ID.' }),
56
60
  };