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
@@ -33,5 +33,5 @@ Output.flags = {
33
33
  app: command_1.flags.app({ required: true }),
34
34
  };
35
35
  Output.args = {
36
- release: core_1.Args.string(),
36
+ release: core_1.Args.string({ description: 'ID of the release. If omitted, we use the last release ID.' }),
37
37
  };
@@ -10,8 +10,18 @@ class Rollback extends command_1.Command {
10
10
  const { flags, args } = await this.parse(Rollback);
11
11
  const { app } = flags;
12
12
  const release = await (0, releases_1.findByPreviousOrId)(this.heroku, app, args.release);
13
- core_1.ux.action.start(`Rolling back ${color_1.default.magenta(app)} to ${color_1.default.green('v' + release.version)}`);
14
- const { body: latest } = await this.heroku.post(`/apps/${app}/releases`, { body: { release: release.id } });
13
+ if (!release) {
14
+ core_1.ux.error(`No eligible release found for ${color_1.default.app(app)} to roll back to.`);
15
+ }
16
+ core_1.ux.action.start(`Rolling back ${color_1.default.app(app)} to ${color_1.default.green('v' + release.version)}`);
17
+ const { body: latest } = await this.heroku.post(`/apps/${app}/releases`, {
18
+ body: {
19
+ release: release.id,
20
+ },
21
+ headers: {
22
+ Accept: 'application/vnd.heroku+json; version=3.sdk',
23
+ },
24
+ });
15
25
  const streamUrl = latest.output_stream_url;
16
26
  core_1.ux.action.stop(`done, ${color_1.default.green('v' + latest.version)}`);
17
27
  core_1.ux.warn("Rollback affects code and config vars; it doesn't add or remove addons.");
@@ -37,12 +47,12 @@ Rollback.topic = 'releases';
37
47
  Rollback.hiddenAliases = ['rollback'];
38
48
  Rollback.description = `Roll back to a previous release.
39
49
 
40
- If RELEASE is not specified, it will roll back one release.
50
+ If RELEASE is not specified, it will roll back to the last eligible release.
41
51
  `;
42
52
  Rollback.flags = {
43
53
  remote: command_1.flags.remote(),
44
54
  app: command_1.flags.app({ required: true }),
45
55
  };
46
56
  Rollback.args = {
47
- release: core_1.Args.string(),
57
+ release: core_1.Args.string({ description: 'ID of the release. If omitted, we use the last eligible release.' }),
48
58
  };
@@ -14,5 +14,5 @@ class SessionsDestroy extends command_1.Command {
14
14
  exports.default = SessionsDestroy;
15
15
  SessionsDestroy.description = 'delete (logout) OAuth session by ID';
16
16
  SessionsDestroy.args = {
17
- id: core_1.Args.string({ required: true }),
17
+ id: core_1.Args.string({ required: true, description: 'ID of the OAuth session' }),
18
18
  };
@@ -7,6 +7,7 @@ export default class Create extends Command {
7
7
  channel: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
8
8
  cidr: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
9
9
  'data-cidr': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
10
+ features: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
10
11
  generation: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
11
12
  'kpi-url': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
12
13
  'log-drain-url': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
@@ -6,6 +6,7 @@ const core_1 = require("@oclif/core");
6
6
  const tsheredoc_1 = require("tsheredoc");
7
7
  const spaces_1 = require("../../lib/spaces/spaces");
8
8
  const completions_1 = require("../../lib/autocomplete/completions");
9
+ const parsers_1 = require("../../lib/spaces/parsers");
9
10
  class Create extends command_1.Command {
10
11
  async run() {
11
12
  const { flags, args } = await this.parse(Create);
@@ -29,7 +30,7 @@ class Create extends command_1.Command {
29
30
  channel_name: channel,
30
31
  cidr,
31
32
  data_cidr: dataCidr,
32
- // features: splitCsv(features),
33
+ features: (0, parsers_1.splitCsv)(features),
33
34
  generation,
34
35
  kpi_url: kpiUrl,
35
36
  log_drain_url: logDrainUrl,
@@ -65,13 +66,14 @@ Create.examples = [(0, tsheredoc_1.default) `
65
66
  CIDR: 10.0.0.0/16
66
67
  Data CIDR: 172.23.0.0/20
67
68
  State: allocating
69
+ Generation: cedar
68
70
  Created at: 2016-01-06T03:23:13Z
69
71
  `];
70
72
  Create.flags = {
71
73
  channel: command_1.flags.string({ hidden: true }),
72
74
  cidr: command_1.flags.string({ description: 'RFC-1918 CIDR the space will use' }),
73
75
  'data-cidr': command_1.flags.string({ description: 'RFC-1918 CIDR used by Heroku Data resources for the space' }),
74
- // features: flags.string({hidden: true, description: 'a list of features separated by commas'}),
76
+ features: command_1.flags.string({ hidden: true, description: 'a list of features separated by commas' }),
75
77
  generation: command_1.flags.string({ description: 'generation for space', default: 'cedar', options: ['cedar', 'fir'] }),
76
78
  'kpi-url': command_1.flags.string({ hidden: true, description: 'self-managed KPI endpoint to use' }),
77
79
  'log-drain-url': command_1.flags.string({ hidden: true, description: 'direct log drain url' }),
@@ -25,5 +25,5 @@ Set.flags = {
25
25
  space: command_1.flags.string({ char: 's', description: 'space for which to set log drain', required: true }),
26
26
  };
27
27
  Set.args = {
28
- url: core_1.Args.string({ required: true }),
28
+ url: core_1.Args.string({ required: true, description: 'URL to replace the log drain with' }),
29
29
  };
@@ -9,15 +9,12 @@ class Add extends command_1.Command {
9
9
  const { flags, args } = await this.parse(Add);
10
10
  const { space } = flags;
11
11
  const url = `/spaces/${space}/inbound-ruleset`;
12
- const options = {
13
- headers: { Accept: 'application/vnd.heroku+json; version=3.dogwood' },
14
- };
15
- const { body: ruleset } = await this.heroku.get(url, options);
12
+ const { body: ruleset } = await this.heroku.get(url);
16
13
  if (!this.isUniqueRule(ruleset, args.source)) {
17
14
  throw new Error(`A rule already exists for ${args.source}.`);
18
15
  }
19
16
  ruleset.rules.push({ action: 'allow', source: args.source });
20
- await this.heroku.put(url, Object.assign(Object.assign({}, options), { body: ruleset }));
17
+ await this.heroku.put(url, { body: ruleset });
21
18
  core_1.ux.log(`Added ${color_1.default.cyan.bold(args.source)} to trusted IP ranges on ${color_1.default.cyan.bold(space)}`);
22
19
  core_1.ux.warn('It may take a few moments for the changes to take effect.');
23
20
  }
@@ -39,5 +36,5 @@ Add.flags = {
39
36
  confirm: command_1.flags.string({ description: 'set to space name to bypass confirm prompt' }),
40
37
  };
41
38
  Add.args = {
42
- source: core_1.Args.string({ required: true }),
39
+ source: core_1.Args.string({ required: true, description: 'IP address in CIDR notation' }),
43
40
  };
@@ -10,9 +10,7 @@ class Index extends command_1.Command {
10
10
  if (!space) {
11
11
  throw new Error('Space name required.\nUSAGE: heroku trusted-ips my-space');
12
12
  }
13
- const { body: rules } = await this.heroku.get(`/spaces/${space}/inbound-ruleset`, {
14
- headers: { Accept: 'application/vnd.heroku+json; version=3.dogwood' },
15
- });
13
+ const { body: rules } = await this.heroku.get(`/spaces/${space}/inbound-ruleset`);
16
14
  if (flags.json) {
17
15
  core_1.ux.log(JSON.stringify(rules, null, 2));
18
16
  }
@@ -10,8 +10,7 @@ class Remove extends command_1.Command {
10
10
  const { flags, args } = await this.parse(Remove);
11
11
  const space = flags.space;
12
12
  const url = `/spaces/${space}/inbound-ruleset`;
13
- const opts = { headers: { Accept: 'application/vnd.heroku+json; version=3.dogwood' } };
14
- const { body: rules } = await this.heroku.get(url, opts);
13
+ const { body: rules } = await this.heroku.get(url);
15
14
  if (((_a = rules.rules) === null || _a === void 0 ? void 0 : _a.length) === 0) {
16
15
  throw new Error('No IP ranges are configured. Nothing to do.');
17
16
  }
@@ -20,7 +19,7 @@ class Remove extends command_1.Command {
20
19
  if (((_d = rules.rules) === null || _d === void 0 ? void 0 : _d.length) === originalLength) {
21
20
  throw new Error(`No IP range matching ${args.source} was found.`);
22
21
  }
23
- await this.heroku.put(url, Object.assign(Object.assign({}, opts), { body: rules }));
22
+ await this.heroku.put(url, { body: rules });
24
23
  core_1.ux.log(`Removed ${color_1.default.cyan.bold(args.source)} from trusted IP ranges on ${color_1.default.cyan.bold(space)}`);
25
24
  core_1.ux.warn('It may take a few moments for the changes to take effect.');
26
25
  }
@@ -40,5 +39,5 @@ Remove.flags = {
40
39
  confirm: command_1.flags.string({ description: 'set to space name to bypass confirm prompt' }),
41
40
  };
42
41
  Remove.args = {
43
- source: core_1.Args.string({ required: true }),
42
+ source: core_1.Args.string({ required: true, description: 'IP address in CIDR notation' }),
44
43
  };
@@ -13,6 +13,5 @@ export default class Add extends Command {
13
13
  headers: import("@oclif/core/lib/interfaces/parser").Arg<string, Record<string, unknown>>;
14
14
  };
15
15
  static example: string;
16
- private getTypeAndName;
17
16
  run(): Promise<void>;
18
17
  }
@@ -5,24 +5,25 @@ const core_1 = require("@oclif/core");
5
5
  const tsheredoc_1 = require("tsheredoc");
6
6
  const util_1 = require("../../lib/telemetry/util");
7
7
  class Add extends command_1.Command {
8
- constructor() {
9
- super(...arguments);
10
- this.getTypeAndName = function (app, space) {
11
- if (app) {
12
- return { type: 'app', name: app };
13
- }
14
- return { type: 'space', name: space };
15
- };
16
- }
17
8
  async run() {
18
9
  const { flags, args } = await this.parse(Add);
19
10
  const { app, space, signals, endpoint, transport } = flags;
20
11
  const { headers } = args;
21
- const typeAndName = this.getTypeAndName(app, space);
12
+ let id;
13
+ if (app) {
14
+ const { body: herokuApp } = await this.heroku.get(`/apps/${app}`, {
15
+ headers: { Accept: 'application/vnd.heroku+json; version=3.sdk' },
16
+ });
17
+ id = herokuApp.id;
18
+ }
19
+ else {
20
+ const { body: herokuSpace } = await this.heroku.get(`/spaces/${space}`);
21
+ id = herokuSpace.id;
22
+ }
22
23
  const drainConfig = {
23
24
  owner: {
24
- type: typeAndName.type,
25
- id: typeAndName.name,
25
+ type: app ? 'app' : 'space',
26
+ id,
26
27
  },
27
28
  signals: (0, util_1.validateAndFormatSignals)(signals),
28
29
  exporter: {
@@ -31,24 +32,13 @@ class Add extends command_1.Command {
31
32
  headers: JSON.parse(headers),
32
33
  },
33
34
  };
34
- if (app) {
35
- const { body: drain } = await this.heroku.post(`/apps/${app}/telemetry-drains`, {
36
- body: drainConfig,
37
- headers: {
38
- Accept: 'application/vnd.heroku+json; version=3.sdk',
39
- },
40
- });
41
- core_1.ux.log(`successfully added drain ${drain.exporter.endpoint}`);
42
- }
43
- else if (space) {
44
- const { body: drain } = await this.heroku.post(`/spaces/${space}/telemetry-drains`, {
45
- body: drainConfig,
46
- headers: {
47
- Accept: 'application/vnd.heroku+json; version=3.sdk',
48
- },
49
- });
50
- core_1.ux.log(`successfully added drain ${drain.exporter.endpoint}`);
51
- }
35
+ const { body: drain } = await this.heroku.post('/telemetry-drains', {
36
+ body: drainConfig,
37
+ headers: {
38
+ Accept: 'application/vnd.heroku+json; version=3.sdk',
39
+ },
40
+ });
41
+ core_1.ux.log(`successfully added drain ${drain.exporter.endpoint}`);
52
42
  }
53
43
  }
54
44
  exports.default = Add;
@@ -66,5 +56,5 @@ Add.args = {
66
56
  };
67
57
  Add.example = (0, tsheredoc_1.default)(`
68
58
  Add a telemetry drain to an app to collect logs and traces:
69
- $ heroku telemetry:add --signals logs,traces --endpoint https://my-endpoint.com --transport http 'x-drain-example-team: API_KEY x-drain-example-dataset: METRICS_DATASET'
59
+ $ heroku telemetry:add --app myapp --signals logs,traces --endpoint https://my-endpoint.com --transport http '{"x-drain-example-team": "API_KEY", "x-drain-example-dataset": "METRICS_DATASET"}'
70
60
  `);
@@ -9,5 +9,5 @@ export default class Index extends Command {
9
9
  };
10
10
  static example: string;
11
11
  run(): Promise<void>;
12
- protected display(telemetryDrains: TelemetryDrains, ownerType: 'App' | 'Space'): void;
12
+ protected display(telemetryDrains: TelemetryDrains, owner: string | undefined): void;
13
13
  }
@@ -6,13 +6,14 @@ class Index extends command_1.Command {
6
6
  async run() {
7
7
  const { flags } = await this.parse(Index);
8
8
  const { app, space } = flags;
9
+ let drains = [];
9
10
  if (app) {
10
11
  const { body: appTelemetryDrains } = await this.heroku.get(`/apps/${app}/telemetry-drains`, {
11
12
  headers: {
12
13
  Accept: 'application/vnd.heroku+json; version=3.sdk',
13
14
  },
14
15
  });
15
- this.display(appTelemetryDrains, 'App');
16
+ drains = appTelemetryDrains;
16
17
  }
17
18
  else if (space) {
18
19
  const { body: spaceTelemetryDrains } = await this.heroku.get(`/spaces/${space}/telemetry-drains`, {
@@ -20,17 +21,22 @@ class Index extends command_1.Command {
20
21
  Accept: 'application/vnd.heroku+json; version=3.sdk',
21
22
  },
22
23
  });
23
- this.display(spaceTelemetryDrains, 'Space');
24
+ drains = spaceTelemetryDrains;
24
25
  }
26
+ this.display(drains, app || space);
25
27
  }
26
- display(telemetryDrains, ownerType) {
27
- core_1.ux.styledHeader(`${ownerType} Telemetry Drains`);
28
- core_1.ux.table(telemetryDrains, {
29
- ID: { get: telemetryDrain => telemetryDrain.id },
30
- Signals: { get: telemetryDrain => telemetryDrain.signals },
31
- Endpoint: { get: telemetryDrain => telemetryDrain.exporter.endpoint },
32
- [ownerType]: { get: telemetryDrain => telemetryDrain.owner.name },
33
- });
28
+ display(telemetryDrains, owner) {
29
+ if (telemetryDrains.length === 0) {
30
+ core_1.ux.log(`There are no telemetry drains in ${owner}`);
31
+ }
32
+ else {
33
+ core_1.ux.styledHeader(`${owner} Telemetry Drains`);
34
+ core_1.ux.table(telemetryDrains, {
35
+ ID: { get: telemetryDrain => telemetryDrain.id },
36
+ Signals: { get: telemetryDrain => telemetryDrain.signals },
37
+ Endpoint: { get: telemetryDrain => telemetryDrain.exporter.endpoint },
38
+ });
39
+ }
34
40
  }
35
41
  }
36
42
  exports.default = Index;
@@ -15,8 +15,8 @@ class Remove extends command_1.Command {
15
15
  `));
16
16
  }
17
17
  if (telemetry_drain_id) {
18
- const telemetryDrain = await this.removeDrain(telemetry_drain_id);
19
- core_1.ux.action.start(`Removing telemetry drain ${telemetry_drain_id}, which was configured for ${telemetryDrain.owner.type} ${telemetryDrain.owner.name}`);
18
+ core_1.ux.action.start(`Removing telemetry drain ${telemetry_drain_id}`);
19
+ await this.removeDrain(telemetry_drain_id);
20
20
  }
21
21
  else if (app) {
22
22
  core_1.ux.action.start(`Removing all telemetry drains from app ${app}`);
@@ -38,5 +38,5 @@ DeliveriesInfo.flags = {
38
38
  pipeline: command_1.flags.pipeline({ char: 'p', description: 'pipeline on which to list', hidden: true }),
39
39
  };
40
40
  DeliveriesInfo.args = {
41
- id: core_1.Args.string({ required: true }),
41
+ id: core_1.Args.string({ required: true, description: 'ID of the webhook event' }),
42
42
  };
@@ -27,5 +27,5 @@ Info.flags = {
27
27
  pipeline: command_1.flags.pipeline({ char: 'p', description: 'pipeline on which to list', hidden: true }),
28
28
  };
29
29
  Info.args = {
30
- id: core_1.Args.string({ required: true }),
30
+ id: core_1.Args.string({ required: true, description: 'ID of the webhook event' }),
31
31
  };
@@ -27,5 +27,5 @@ WebhooksInfo.flags = {
27
27
  pipeline: command_1.flags.pipeline({ char: 'p', description: 'pipeline on which to list', hidden: true }),
28
28
  };
29
29
  WebhooksInfo.args = {
30
- id: core_1.Args.string({ required: true }),
30
+ id: core_1.Args.string({ required: true, description: 'ID of the webhook' }),
31
31
  };
@@ -37,5 +37,5 @@ WebhooksUpdate.flags = {
37
37
  url: command_1.flags.string({ char: 'u', description: 'URL for receiver', required: true }),
38
38
  };
39
39
  WebhooksUpdate.args = {
40
- id: core_1.Args.string({ required: true }),
40
+ id: core_1.Args.string({ required: true, description: 'ID of the webhook' }),
41
41
  };
@@ -0,0 +1,3 @@
1
+ import { Hook } from '@oclif/core';
2
+ declare const hook: Hook<'plugins:preinstall'>;
3
+ export default hook;
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const core_1 = require("@oclif/core");
4
+ const hook = async function (options) {
5
+ const npmPackageNames = ['@heroku/plugin-ai', '@heroku-cli/plugin-ai'];
6
+ if (options.plugin.type !== 'npm' || !npmPackageNames.includes(options.plugin.name))
7
+ return;
8
+ core_1.ux.warn('\n\nThis pilot feature is a Beta Service. You may opt to try such Beta Service in your sole discretion. ' +
9
+ 'Any use of the Beta Service is subject to the applicable Beta Services Terms provided at ' +
10
+ 'https://www.salesforce.com/company/legal/customer-agreements/. While use of the pilot feature itself is free, ' +
11
+ 'to the extent such use consumes a generally available Service, you may be charged for that consumption as set ' +
12
+ 'forth in the Documentation. Your continued use of this pilot feature constitutes your acceptance of the foregoing.\n\n' +
13
+ 'For clarity and without limitation, the various third-party machine learning and generative artificial intelligence ' +
14
+ '(AI) models and applications (each a “Platform”) integrated with the Beta Service are Non-SFDC Applications, ' +
15
+ 'as that term is defined in the Beta Services Terms. Note that these third-party Platforms include features that use ' +
16
+ 'generative AI technology. Due to the nature of generative AI, the output that a Platform generates may be ' +
17
+ 'unpredictable, and may include inaccurate or harmful responses. Before using any generative AI output, Customer is ' +
18
+ 'solely responsible for reviewing the output for accuracy, safety, and compliance with applicable laws and third-party ' +
19
+ 'acceptable use policies. In addition, Customer’s use of each Platform may be subject to the Platform’s own terms and ' +
20
+ 'conditions, compliance with which Customer is solely responsible.\n');
21
+ const response = await core_1.ux.prompt('Continue? (Y/N)');
22
+ if (response.toUpperCase() !== 'Y') {
23
+ core_1.ux.error('Canceled', { exit: 1 });
24
+ }
25
+ };
26
+ exports.default = hook;
@@ -4,7 +4,10 @@ exports.findByPreviousOrId = exports.findByLatestOrId = exports.getRelease = exp
4
4
  const findRelease = async function (heroku, app, search) {
5
5
  const { body: releases } = await heroku.request(`/apps/${app}/releases`, {
6
6
  partial: true,
7
- headers: { Range: 'version ..; max=10, order=desc' },
7
+ headers: {
8
+ Range: 'version ..; max=10, order=desc',
9
+ Accept: 'application/vnd.heroku+json; version=3.sdk',
10
+ },
8
11
  });
9
12
  return search(releases);
10
13
  };
@@ -12,7 +15,11 @@ exports.findRelease = findRelease;
12
15
  const getRelease = async function (heroku, app, release) {
13
16
  let id = release.toLowerCase();
14
17
  id = id.startsWith('v') ? id.slice(1) : id;
15
- const { body: releaseResponse } = await heroku.get(`/apps/${app}/releases/${id}`);
18
+ const { body: releaseResponse } = await heroku.get(`/apps/${app}/releases/${id}`, {
19
+ headers: {
20
+ Accept: 'application/vnd.heroku+json; version=3.sdk',
21
+ },
22
+ });
16
23
  return releaseResponse;
17
24
  };
18
25
  exports.getRelease = getRelease;
@@ -25,7 +32,7 @@ const findByLatestOrId = async function (heroku, app, release = 'current') {
25
32
  exports.findByLatestOrId = findByLatestOrId;
26
33
  const findByPreviousOrId = async function (heroku, app, release = 'previous') {
27
34
  if (release === 'previous') {
28
- return (0, exports.findRelease)(heroku, app, releases => releases.filter(r => r.status === 'succeeded')[1]);
35
+ return (0, exports.findRelease)(heroku, app, releases => releases.filter(r => r.eligible_for_rollback)[1]);
29
36
  }
30
37
  return (0, exports.getRelease)(heroku, app, release);
31
38
  };
@@ -1,5 +1,5 @@
1
1
  export declare const description: (release: {
2
2
  [k: string]: any;
3
3
  status?: string | undefined;
4
- }) => "" | "release command executing" | "release command failed";
5
- export declare const color: (s?: string) => "red" | "yellow" | "white";
4
+ }) => "" | "release command executing" | "release command failed" | "release expired";
5
+ export declare const color: (s?: string) => "red" | "yellow" | "gray" | "cyan";
@@ -7,6 +7,8 @@ const description = function (release) {
7
7
  return 'release command executing';
8
8
  case 'failed':
9
9
  return 'release command failed';
10
+ case 'expired':
11
+ return 'release expired';
10
12
  default:
11
13
  return '';
12
14
  }
@@ -18,8 +20,10 @@ const color = function (s) {
18
20
  return 'yellow';
19
21
  case 'failed':
20
22
  return 'red';
23
+ case 'expired':
24
+ return 'gray';
21
25
  default:
22
- return 'white';
26
+ return 'cyan';
23
27
  }
24
28
  };
25
29
  exports.color = color;
@@ -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 color_1 = require("@heroku-cli/color");
4
5
  const colorize_1 = require("./colorize");
5
6
  const generation_1 = require("../apps/generation");
6
7
  const EventSource = require('@heroku/eventsource');
@@ -55,17 +56,20 @@ async function logDisplayer(heroku, options) {
55
56
  const requestBodyParameters = {
56
57
  source: options.source,
57
58
  };
58
- if (firApp)
59
+ if (firApp) {
60
+ process.stderr.write(color_1.default.cyan.bold('Fetching logs...\n\n'));
59
61
  Object.assign(requestBodyParameters, {
60
62
  dyno: options.dyno,
61
63
  type: options.type,
62
64
  });
63
- else
65
+ }
66
+ else {
64
67
  Object.assign(requestBodyParameters, {
65
68
  dyno: options.dyno || options.type,
66
69
  lines: options.lines,
67
70
  tail: options.tail,
68
71
  });
72
+ }
69
73
  let recreateLogSession = false;
70
74
  do {
71
75
  const { body: logSession } = await heroku.post(`/apps/${options.app}/log-sessions`, {
@@ -0,0 +1,4 @@
1
+ import { App } from './fir';
2
+ export interface AppProcessTier extends App {
3
+ process_tier: string;
4
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/lib/nls.d.ts ADDED
@@ -0,0 +1,8 @@
1
+ import * as nlsValues from './package.nls.json';
2
+ /**
3
+ * Non-localized strings util.
4
+ *
5
+ * @param key The key of the non-localized string to retrieve.
6
+ * @return string
7
+ */
8
+ export declare function nls<T extends keyof typeof nlsValues>(key: T): typeof nlsValues[T];
package/lib/nls.js ADDED
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.nls = void 0;
4
+ const nlsValues = require("./package.nls.json");
5
+ /**
6
+ * Non-localized strings util.
7
+ *
8
+ * @param key The key of the non-localized string to retrieve.
9
+ * @return string
10
+ */
11
+ function nls(key) {
12
+ return nlsValues[key];
13
+ }
14
+ exports.nls = nls;
@@ -0,0 +1,6 @@
1
+ {
2
+ "pg:database:arg:description": "config var containing the connection string, unique name, ID, or alias of the database. To access another app's database, prepend the app name to the config var or alias with `APP_NAME::`",
3
+ "pg:database:arg:description:default:suffix": ". If omitted, we use DATABASE_URL.",
4
+ "pg:database:arg:description:arbitrary:suffix": ". If omitted, we use a random database attached to the app.",
5
+ "pg:database:arg:description:all-dbs:suffix": ". If omitted, we use all databases."
6
+ }