heroku 10.7.0-alpha.0 → 10.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "heroku",
3
3
  "description": "CLI to interact with Heroku",
4
- "version": "10.7.0-alpha.0",
4
+ "version": "10.7.0",
5
5
  "author": "Heroku",
6
6
  "bin": "./bin/run",
7
7
  "bugs": "https://github.com/heroku/cli/issues",
@@ -137,7 +137,7 @@
137
137
  "typescript": "4.8.4"
138
138
  },
139
139
  "engines": {
140
- "node": "~20.x"
140
+ "node": "20.x"
141
141
  },
142
142
  "files": [
143
143
  "/autocomplete-scripts",
@@ -320,9 +320,6 @@
320
320
  "./lib/hooks/init/terms-of-service",
321
321
  "./lib/hooks/init/performance_analytics"
322
322
  ],
323
- "plugins:preinstall": [
324
- "./lib/hooks/plugins/preinstall/disclaimers"
325
- ],
326
323
  "prerun": [
327
324
  "./lib/hooks/prerun/analytics"
328
325
  ],
@@ -343,7 +340,7 @@
343
340
  },
344
341
  "update": {
345
342
  "node": {
346
- "version": "20.17.0"
343
+ "version": "20.19.1"
347
344
  },
348
345
  "s3": {
349
346
  "xz": true,
@@ -398,5 +395,5 @@
398
395
  "version": "oclif readme --multi && git add README.md ../../docs"
399
396
  },
400
397
  "types": "lib/index.d.ts",
401
- "gitHead": "5195774734d8b59ddf1feb93f8ec251c8479fbf8"
398
+ "gitHead": "71cac0ffeb21915420121db8d01e57f7c98c0578"
402
399
  }
@@ -1,13 +0,0 @@
1
- import { Command } from '@heroku-cli/command';
2
- export default class Upgrade extends Command {
3
- static topic: string;
4
- static description: string;
5
- static flags: {
6
- confirm: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
7
- app: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
8
- };
9
- static args: {
10
- database: import("@oclif/core/lib/interfaces/parser").Arg<string | undefined, Record<string, unknown>>;
11
- };
12
- run(): Promise<void>;
13
- }
@@ -1,53 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const color_1 = require("@heroku-cli/color");
4
- const command_1 = require("@heroku-cli/command");
5
- const core_1 = require("@oclif/core");
6
- const tsheredoc_1 = require("tsheredoc");
7
- const fetcher_1 = require("../../../lib/pg/fetcher");
8
- const host_1 = require("../../../lib/pg/host");
9
- const util_1 = require("../../../lib/pg/util");
10
- const confirmCommand_1 = require("../../../lib/confirmCommand");
11
- const nls_1 = require("../../../nls");
12
- class Upgrade extends command_1.Command {
13
- async run() {
14
- const { flags, args } = await this.parse(Upgrade);
15
- const { app, confirm } = flags;
16
- const { database } = args;
17
- const db = await (0, fetcher_1.getAddon)(this.heroku, app, database);
18
- if ((0, util_1.legacyEssentialPlan)(db))
19
- core_1.ux.error(`You can only use ${color_1.default.cmd('pg:upgrade:*')} commands on Essential-* and higher plans.`);
20
- if ((0, util_1.essentialNumPlan)(db))
21
- core_1.ux.error(`You can't use ${color_1.default.cmd('pg:upgrade:cancel')} on Essential-tier databases. You can only use this command on Standard-tier and higher leader databases.`);
22
- const { body: replica } = await this.heroku.get(`/client/v11/databases/${db.id}`, { hostname: (0, host_1.default)() });
23
- if (replica.following)
24
- core_1.ux.error(`You can't use ${color_1.default.cmd('pg:upgrade:cancel')} on follower databases. You can only use this command on Standard-tier and higher leader databases.`);
25
- await (0, confirmCommand_1.default)(app, confirm, (0, tsheredoc_1.default)(`
26
- Destructive action
27
- You're canceling the scheduled version upgrade for ${color_1.default.addon(db.name)}.
28
-
29
- You can't undo this action.
30
- `));
31
- try {
32
- core_1.ux.action.start(`Cancelling upgrade on ${color_1.default.addon(db.name)}`);
33
- const response = await this.heroku.post(`/client/v11/databases/${db.id}/upgrade/cancel`, { hostname: (0, host_1.default)(), body: {} });
34
- core_1.ux.action.stop('done\n' + (0, util_1.formatResponseWithCommands)(response.body.message));
35
- }
36
- catch (error) {
37
- const response = error;
38
- core_1.ux.error((0, util_1.formatResponseWithCommands)(response.body.message) + `\n\nError ID: ${response.body.id}`);
39
- }
40
- }
41
- }
42
- exports.default = Upgrade;
43
- Upgrade.topic = 'pg';
44
- Upgrade.description = (0, tsheredoc_1.default)(`
45
- cancels a scheduled upgrade. You can't cancel a version upgrade that's in progress.
46
- `);
47
- Upgrade.flags = {
48
- confirm: command_1.flags.string({ char: 'c' }),
49
- app: command_1.flags.app({ required: true }),
50
- };
51
- Upgrade.args = {
52
- database: core_1.Args.string({ description: `${(0, nls_1.nls)('pg:database:arg:description')} ${(0, nls_1.nls)('pg:database:arg:description:default:suffix')}` }),
53
- };
@@ -1,14 +0,0 @@
1
- import { Command } from '@heroku-cli/command';
2
- export default class Upgrade extends Command {
3
- static topic: string;
4
- static description: string;
5
- static flags: {
6
- confirm: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
7
- version: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
8
- app: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
9
- };
10
- static args: {
11
- database: import("@oclif/core/lib/interfaces/parser").Arg<string | undefined, Record<string, unknown>>;
12
- };
13
- run(): Promise<void>;
14
- }
@@ -1,54 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const color_1 = require("@heroku-cli/color");
4
- const command_1 = require("@heroku-cli/command");
5
- const core_1 = require("@oclif/core");
6
- const tsheredoc_1 = require("tsheredoc");
7
- const fetcher_1 = require("../../../lib/pg/fetcher");
8
- const host_1 = require("../../../lib/pg/host");
9
- const util_1 = require("../../../lib/pg/util");
10
- const confirmCommand_1 = require("../../../lib/confirmCommand");
11
- const nls_1 = require("../../../nls");
12
- class Upgrade extends command_1.Command {
13
- async run() {
14
- const { flags, args } = await this.parse(Upgrade);
15
- const { app, version, confirm } = flags;
16
- const { database } = args;
17
- const db = await (0, fetcher_1.getAddon)(this.heroku, app, database);
18
- if ((0, util_1.legacyEssentialPlan)(db))
19
- core_1.ux.error(`You can only use ${color_1.default.cmd('pg:upgrade:*')} commands on Essential-* and higher plans.`);
20
- if ((0, util_1.essentialNumPlan)(db))
21
- core_1.ux.error(`You can't use ${color_1.default.cmd('pg:upgrade:dryrun')} on Essential-tier databases. You can only use this command on Standard-tier and higher leader databases.`);
22
- const versionPhrase = version ? (0, tsheredoc_1.default)(`Postgres version ${version}`) : (0, tsheredoc_1.default)('the latest supported Postgres version');
23
- const { body: replica } = await this.heroku.get(`/client/v11/databases/${db.id}`, { hostname: (0, host_1.default)() });
24
- if (replica.following)
25
- core_1.ux.error(`You can't use ${color_1.default.cmd('pg:upgrade:dryrun')} on follower databases. You can only use this command on Standard-tier and higher leader databases.`);
26
- await (0, confirmCommand_1.default)(app, confirm, (0, tsheredoc_1.default)(`
27
- Destructive action
28
- This command starts a test upgrade for ${color_1.default.addon(db.name)} to ${versionPhrase}.
29
- `));
30
- try {
31
- const data = { version };
32
- core_1.ux.action.start(`Starting a test upgrade on ${color_1.default.addon(db.name)}`);
33
- const response = await this.heroku.post(`/client/v11/databases/${db.id}/upgrade/dry_run`, { hostname: (0, host_1.default)(), body: data });
34
- core_1.ux.action.stop('done\n' + (0, util_1.formatResponseWithCommands)(response.body.message));
35
- }
36
- catch (error) {
37
- const response = error;
38
- core_1.ux.error((0, util_1.formatResponseWithCommands)(response.body.message) + `\n\nError ID: ${response.body.id}`);
39
- }
40
- }
41
- }
42
- exports.default = Upgrade;
43
- Upgrade.topic = 'pg';
44
- Upgrade.description = (0, tsheredoc_1.default)(`
45
- simulates a Postgres version upgrade on a Standard-tier and higher leader database by creating and upgrading a follower database. Heroku sends the results of the test upgrade via email.
46
- `);
47
- Upgrade.flags = {
48
- confirm: command_1.flags.string({ char: 'c' }),
49
- version: command_1.flags.string({ char: 'v', description: 'Postgres version to upgrade to' }),
50
- app: command_1.flags.app({ required: true }),
51
- };
52
- Upgrade.args = {
53
- database: core_1.Args.string({ description: `${(0, nls_1.nls)('pg:database:arg:description')} ${(0, nls_1.nls)('pg:database:arg:description:default:suffix')}` }),
54
- };
@@ -1,76 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const color_1 = require("@heroku-cli/color");
4
- const command_1 = require("@heroku-cli/command");
5
- const core_1 = require("@oclif/core");
6
- const tsheredoc_1 = require("tsheredoc");
7
- const fetcher_1 = require("../../../lib/pg/fetcher");
8
- const host_1 = require("../../../lib/pg/host");
9
- const util_1 = require("../../../lib/pg/util");
10
- const confirmCommand_1 = require("../../../lib/confirmCommand");
11
- const nls_1 = require("../../../nls");
12
- class Upgrade extends command_1.Command {
13
- async run() {
14
- const { flags, args } = await this.parse(Upgrade);
15
- const { app, version, confirm } = flags;
16
- const { database } = args;
17
- const db = await (0, fetcher_1.getAddon)(this.heroku, app, database);
18
- if ((0, util_1.legacyEssentialPlan)(db))
19
- core_1.ux.error(`You can only use ${color_1.default.cmd('heroku pg:upgrade')} on Essential-tier databases and follower databases on Standard-tier and higher plans.`);
20
- const versionPhrase = version ? (0, tsheredoc_1.default)(`Postgres version ${version}`) : (0, tsheredoc_1.default)('the latest supported Postgres version');
21
- const { body: replica } = await this.heroku.get(`/client/v11/databases/${db.id}`, { hostname: (0, host_1.default)() });
22
- if (replica.following) {
23
- const { body: configVars } = await this.heroku.get(`/apps/${app}/config-vars`);
24
- const origin = (0, util_1.databaseNameFromUrl)(replica.following, configVars);
25
- await (0, confirmCommand_1.default)(app, confirm, (0, tsheredoc_1.default)(`
26
- We're deprecating this command. To upgrade your database's Postgres version, use the new ${color_1.default.cmd('pg:upgrade:*')} subcommands. See https://devcenter.heroku.com/changelog-items/3179.
27
-
28
- Destructive action
29
- You're upgrading ${color_1.default.addon(db.name)} to ${versionPhrase}. The database will stop following ${origin} and become writable.
30
-
31
- You can't undo this action.
32
- `));
33
- }
34
- else if ((0, util_1.essentialNumPlan)(db)) {
35
- await (0, confirmCommand_1.default)(app, confirm, (0, tsheredoc_1.default)(`
36
- We're deprecating this command. To upgrade your database's Postgres version, use the new ${color_1.default.cmd('pg:upgrade:*')} subcommands. See https://devcenter.heroku.com/changelog-items/3179.
37
-
38
- Destructive action
39
- You're upgrading ${color_1.default.addon(db.name)} to ${versionPhrase}.
40
-
41
- You can't undo this action.
42
- `));
43
- }
44
- else {
45
- core_1.ux.warn((0, tsheredoc_1.default)(`
46
- We're deprecating this command. To upgrade your database's Postgres version, use the new ${color_1.default.cmd('pg:upgrade:*')} subcommands. See https://devcenter.heroku.com/changelog-items/3179.`));
47
- core_1.ux.error(`You can only use ${color_1.default.cmd('heroku pg:upgrade')} on Essential-tier databases and follower databases on Standard-tier and higher plans.`);
48
- }
49
- try {
50
- const data = { version };
51
- core_1.ux.action.start(`Starting upgrade on ${color_1.default.addon(db.name)}`);
52
- const response = await this.heroku.post(`/client/v11/databases/${db.id}/upgrade`, { hostname: (0, host_1.default)(), body: data });
53
- core_1.ux.action.stop((0, tsheredoc_1.default)(`done\n${(0, util_1.formatResponseWithCommands)(response.body.message)}`));
54
- }
55
- catch (error) {
56
- const response = error;
57
- core_1.ux.error((0, tsheredoc_1.default)(`${(0, util_1.formatResponseWithCommands)(response.body.message)}\n\nError ID: ${response.body.id}`));
58
- }
59
- }
60
- }
61
- exports.default = Upgrade;
62
- Upgrade.topic = 'pg';
63
- Upgrade.description = (0, tsheredoc_1.default)(`
64
- We're deprecating this command. To upgrade your database's Postgres version, use the new ${color_1.default.cmd('pg:upgrade:*')} subcommands. See https://devcenter.heroku.com/changelog-items/3179.
65
-
66
- For an Essential-tier plan, this command upgrades the database's Postgres version. For a Standard-tier and higher plan, this command unfollows the leader database before upgrading the Postgres version.
67
- `);
68
- Upgrade.flags = {
69
- confirm: command_1.flags.string({ char: 'c' }),
70
- version: command_1.flags.string({ char: 'v', description: 'Postgres version to upgrade to' }),
71
- app: command_1.flags.app({ required: true }),
72
- remote: command_1.flags.remote(),
73
- };
74
- Upgrade.args = {
75
- database: core_1.Args.string({ description: `${(0, nls_1.nls)('pg:database:arg:description')} ${(0, nls_1.nls)('pg:database:arg:description:default:suffix')}` }),
76
- };
@@ -1,14 +0,0 @@
1
- import { Command } from '@heroku-cli/command';
2
- export default class Upgrade extends Command {
3
- static topic: string;
4
- static description: string;
5
- static flags: {
6
- confirm: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
7
- version: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
8
- app: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
9
- };
10
- static args: {
11
- database: import("@oclif/core/lib/interfaces/parser").Arg<string | undefined, Record<string, unknown>>;
12
- };
13
- run(): Promise<void>;
14
- }
@@ -1,54 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const color_1 = require("@heroku-cli/color");
4
- const command_1 = require("@heroku-cli/command");
5
- const core_1 = require("@oclif/core");
6
- const tsheredoc_1 = require("tsheredoc");
7
- const fetcher_1 = require("../../../lib/pg/fetcher");
8
- const host_1 = require("../../../lib/pg/host");
9
- const util_1 = require("../../../lib/pg/util");
10
- const confirmCommand_1 = require("../../../lib/confirmCommand");
11
- const nls_1 = require("../../../nls");
12
- class Upgrade extends command_1.Command {
13
- async run() {
14
- const { flags, args } = await this.parse(Upgrade);
15
- const { app, version, confirm } = flags;
16
- const { database } = args;
17
- const db = await (0, fetcher_1.getAddon)(this.heroku, app, database);
18
- if ((0, util_1.legacyEssentialPlan)(db))
19
- core_1.ux.error(`You can only use ${color_1.default.cmd('pg:upgrade:*')} commands on Essential-* and higher plans.`);
20
- if ((0, util_1.essentialNumPlan)(db))
21
- core_1.ux.error(`You can only use ${color_1.default.cmd('heroku pg:upgrade:prepare')} on Standard-tier and higher leader databases. For Essential-tier databases, use ${color_1.default.cmd('heroku pg:upgrade:run')} instead.`);
22
- const versionPhrase = version ? (0, tsheredoc_1.default)(`Postgres version ${version}`) : (0, tsheredoc_1.default)('the latest supported Postgres version');
23
- const { body: replica } = await this.heroku.get(`/client/v11/databases/${db.id}`, { hostname: (0, host_1.default)() });
24
- if (replica.following)
25
- core_1.ux.error(`You can only use ${color_1.default.cmd('heroku pg:upgrade:prepare')} on Standard-tier and higher leader databases. For follower databases, use ${color_1.default.cmd('heroku pg:upgrade:run')} instead.`);
26
- await (0, confirmCommand_1.default)(app, confirm, (0, tsheredoc_1.default)(`
27
- Destructive action
28
- This command prepares the upgrade for ${color_1.default.addon(db.name)} to ${versionPhrase} and schedules to upgrade it during the next available maintenance window.
29
- `));
30
- try {
31
- const data = { version };
32
- core_1.ux.action.start(`Preparing upgrade on ${color_1.default.addon(db.name)}`);
33
- const response = await this.heroku.post(`/client/v11/databases/${db.id}/upgrade/prepare`, { hostname: (0, host_1.default)(), body: data });
34
- core_1.ux.action.stop((0, tsheredoc_1.default)(`done\n${(0, util_1.formatResponseWithCommands)(response.body.message)}`));
35
- }
36
- catch (error) {
37
- const response = error;
38
- core_1.ux.error((0, tsheredoc_1.default)(`${(0, util_1.formatResponseWithCommands)(response.body.message)}\n\nError ID: ${response.body.id}`));
39
- }
40
- }
41
- }
42
- exports.default = Upgrade;
43
- Upgrade.topic = 'pg';
44
- Upgrade.description = (0, tsheredoc_1.default)(`
45
- prepares the upgrade for Standard-tier and higher leader databases and schedules it for the next available maintenance window. To start a version upgrade on Essential-tier and follower databases, use ${color_1.default.cmd('heroku pg:upgrade:run')} instead.
46
- `);
47
- Upgrade.flags = {
48
- confirm: command_1.flags.string({ char: 'c' }),
49
- version: command_1.flags.string({ char: 'v', description: 'Postgres version to upgrade to' }),
50
- app: command_1.flags.app({ required: true }),
51
- };
52
- Upgrade.args = {
53
- database: core_1.Args.string({ description: `${(0, nls_1.nls)('pg:database:arg:description')} ${(0, nls_1.nls)('pg:database:arg:description:default:suffix')}` }),
54
- };
@@ -1,16 +0,0 @@
1
- import { Command } from '@heroku-cli/command';
2
- export default class Upgrade extends Command {
3
- static topic: string;
4
- static description: string;
5
- static examples: string[];
6
- static flags: {
7
- confirm: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
8
- version: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
9
- app: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
10
- remote: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
11
- };
12
- static args: {
13
- database: import("@oclif/core/lib/interfaces/parser").Arg<string | undefined, Record<string, unknown>>;
14
- };
15
- run(): Promise<void>;
16
- }
@@ -1,98 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const color_1 = require("@heroku-cli/color");
4
- const command_1 = require("@heroku-cli/command");
5
- const core_1 = require("@oclif/core");
6
- const tsheredoc_1 = require("tsheredoc");
7
- const fetcher_1 = require("../../../lib/pg/fetcher");
8
- const host_1 = require("../../../lib/pg/host");
9
- const util_1 = require("../../../lib/pg/util");
10
- const confirmCommand_1 = require("../../../lib/confirmCommand");
11
- const nls_1 = require("../../../nls");
12
- class Upgrade extends command_1.Command {
13
- async run() {
14
- const { flags, args } = await this.parse(Upgrade);
15
- const { app, version, confirm } = flags;
16
- const { database } = args;
17
- const db = await (0, fetcher_1.getAddon)(this.heroku, app, database);
18
- if ((0, util_1.legacyEssentialPlan)(db))
19
- core_1.ux.error(`You can only use ${color_1.default.cmd('pg:upgrade:*')} commands on Essential-* and higher plans.`);
20
- const versionPhrase = version ? (0, tsheredoc_1.default)(`Postgres version ${version}`) : (0, tsheredoc_1.default)('the latest supported Postgres version');
21
- const { body: replica } = await this.heroku.get(`/client/v11/databases/${db.id}`, { hostname: (0, host_1.default)() });
22
- if ((0, util_1.essentialNumPlan)(db)) {
23
- await (0, confirmCommand_1.default)(app, confirm, (0, tsheredoc_1.default)(`
24
- Destructive action
25
- You're upgrading ${color_1.default.addon(db.name)} to ${versionPhrase}.
26
-
27
- You can't undo this action.
28
- `));
29
- }
30
- else if (replica.following) {
31
- const { body: configVars } = await this.heroku.get(`/apps/${app}/config-vars`);
32
- const origin = (0, util_1.databaseNameFromUrl)(replica.following, configVars);
33
- await (0, confirmCommand_1.default)(app, confirm, (0, tsheredoc_1.default)(`
34
- Destructive action
35
- You're upgrading ${color_1.default.addon(db.name)} to ${versionPhrase}. The database will stop following ${origin} and become writable.
36
-
37
- You can't undo this action.
38
- `));
39
- }
40
- else {
41
- await (0, confirmCommand_1.default)(app, confirm, (0, tsheredoc_1.default)(`
42
- Destructive action
43
- You're upgrading the Postgres version on ${color_1.default.addon(db.name)}. This action also upgrades any followers on the database.
44
-
45
- You can't undo this action.
46
- `));
47
- }
48
- try {
49
- const data = { version };
50
- core_1.ux.action.start(`Starting upgrade on ${color_1.default.addon(db.name)}`);
51
- const response = await this.heroku.post(`/client/v11/databases/${db.id}/upgrade/run`, { hostname: (0, host_1.default)(), body: data });
52
- core_1.ux.action.stop((0, tsheredoc_1.default)(`done\n${(0, util_1.formatResponseWithCommands)(response.body.message)}`));
53
- }
54
- catch (error) {
55
- if (error instanceof Error && 'body' in error) {
56
- const response = error;
57
- core_1.ux.error((0, tsheredoc_1.default)(`${(0, util_1.formatResponseWithCommands)(response.body.message)}\n\nError ID: ${response.body.id}`));
58
- }
59
- else {
60
- throw error;
61
- }
62
- }
63
- }
64
- }
65
- exports.default = Upgrade;
66
- Upgrade.topic = 'pg';
67
- Upgrade.description = (0, tsheredoc_1.default)(`
68
- starts a Postgres version upgrade
69
-
70
- On Essential-tier databases, this command upgrades the database's Postgres version.
71
-
72
- On Standard-tier and higher leader databases, this command runs a previously scheduled Postgres version upgrade. You must run ${color_1.default.cmd('pg:upgrade:prepare')} before this command to schedule a version upgrade.
73
-
74
- On follower databases, this command unfollows the leader database before upgrading the follower's Postgres version.
75
- `);
76
- Upgrade.examples = [
77
- (0, tsheredoc_1.default) `
78
- # Upgrade an Essential-tier database to a specific version
79
- $ heroku pg:upgrade:run postgresql-curved-12345 --version 14 --app myapp
80
- `,
81
- (0, tsheredoc_1.default) `
82
- # Upgrade a Standard-tier follower database to the latest supported version
83
- $ heroku pg:upgrade:run HEROKU_POSTGRESQL_BLUE_URL --app myapp
84
- `,
85
- (0, tsheredoc_1.default) `
86
- # Run a previously scheduled upgrade on a Standard-tier leader database
87
- $ heroku pg:upgrade:run DATABASE_URL --app myapp
88
- `,
89
- ];
90
- Upgrade.flags = {
91
- confirm: command_1.flags.string({ char: 'c' }),
92
- version: command_1.flags.string({ char: 'v', description: 'Postgres version to upgrade to' }),
93
- app: command_1.flags.app({ required: true }),
94
- remote: command_1.flags.remote({ char: 'r' }),
95
- };
96
- Upgrade.args = {
97
- database: core_1.Args.string({ description: `${(0, nls_1.nls)('pg:database:arg:description')} ${(0, nls_1.nls)('pg:database:arg:description:default:suffix')}` }),
98
- };
@@ -1,16 +0,0 @@
1
- import { Command } from '@heroku-cli/command';
2
- export default class Wait extends Command {
3
- static topic: string;
4
- static description: string;
5
- static flags: {
6
- 'wait-interval': import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
7
- 'no-notify': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
8
- app: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
9
- remote: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
10
- };
11
- static examples: string[];
12
- static args: {
13
- database: import("@oclif/core/lib/interfaces/parser").Arg<string | undefined, Record<string, unknown>>;
14
- };
15
- run(): Promise<void>;
16
- }
@@ -1,103 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const color_1 = require("@heroku-cli/color");
4
- const command_1 = require("@heroku-cli/command");
5
- const core_1 = require("@oclif/core");
6
- const debug_1 = require("debug");
7
- const tsheredoc_1 = require("tsheredoc");
8
- const fetcher_1 = require("../../../lib/pg/fetcher");
9
- const host_1 = require("../../../lib/pg/host");
10
- const notify_1 = require("../../../lib/notify");
11
- const http_call_1 = require("@heroku/http-call");
12
- const nls_1 = require("../../../nls");
13
- const util_1 = require("../../../lib/pg/util");
14
- const wait = (ms) => new Promise(resolve => {
15
- setTimeout(resolve, ms);
16
- });
17
- class Wait extends command_1.Command {
18
- async run() {
19
- const { flags, args } = await this.parse(Wait);
20
- const { app, 'wait-interval': waitInterval } = flags;
21
- const dbName = args.database;
22
- const pgDebug = (0, debug_1.default)('pg');
23
- const waitFor = async (db) => {
24
- const interval = (!waitInterval || waitInterval < 0) ? 5 : waitInterval;
25
- let status;
26
- let waiting = false;
27
- let retries = 20;
28
- const notFoundMessage = 'Waiting to provision...';
29
- while (true) {
30
- try {
31
- ({ body: status } = await this.heroku.get(`/client/v11/databases/${db.id}/upgrade/wait_status`, { hostname: (0, host_1.default)() }));
32
- }
33
- catch (error) {
34
- if (error instanceof http_call_1.HTTPError && (!retries || error.statusCode !== 404)) {
35
- const httpError = error;
36
- pgDebug(httpError);
37
- throw httpError;
38
- }
39
- retries--;
40
- status = { 'waiting?': true, message: notFoundMessage };
41
- }
42
- let message = (0, util_1.formatResponseWithCommands)(status.message);
43
- if (status.step)
44
- message = (0, tsheredoc_1.default)(`(${status.step}) ${message}`);
45
- if (status['error?']) {
46
- (0, notify_1.default)('error', `${db.name} ${message}`, false);
47
- core_1.ux.error(message || '', { exit: 1 });
48
- }
49
- if (!status['waiting?']) {
50
- if (waiting) {
51
- core_1.ux.action.stop(message);
52
- }
53
- else {
54
- core_1.ux.log((0, tsheredoc_1.default)(`Waiting for database ${color_1.default.yellow(db.name)}... ${message}`));
55
- }
56
- return;
57
- }
58
- if (!waiting) {
59
- waiting = true;
60
- core_1.ux.action.start(`Waiting for database ${color_1.default.yellow(db.name)}`, message);
61
- }
62
- core_1.ux.action.status = message;
63
- await wait(interval * 1000);
64
- }
65
- };
66
- let dbs = [];
67
- if (dbName) {
68
- dbs = [await (0, fetcher_1.getAddon)(this.heroku, app, dbName)];
69
- }
70
- else {
71
- core_1.ux.error((0, tsheredoc_1.default)('You must provide a database. Run `--help` for more information on the command.'));
72
- }
73
- for (const db of dbs) {
74
- await waitFor(db);
75
- }
76
- }
77
- }
78
- exports.default = Wait;
79
- Wait.topic = 'pg';
80
- Wait.description = 'provides the status of an upgrade and blocks it until the operation is complete';
81
- Wait.flags = {
82
- 'wait-interval': command_1.flags.integer({ description: 'how frequently to poll in seconds (to avoid rate limiting)' }),
83
- 'no-notify': command_1.flags.boolean({ description: 'do not show OS notification' }),
84
- app: command_1.flags.app({ required: true }),
85
- remote: command_1.flags.remote(),
86
- };
87
- Wait.examples = [
88
- (0, tsheredoc_1.default)(`
89
- # Wait for upgrade to complete with default settings
90
- $ heroku pg:upgrade:wait postgresql-curved-12345 --app myapp
91
- `),
92
- (0, tsheredoc_1.default)(`
93
- # Wait with custom polling interval
94
- $ heroku pg:upgrade:wait postgresql-curved-12345 --app myapp --wait-interval 10
95
- `),
96
- (0, tsheredoc_1.default)(`
97
- # Wait without showing OS notifications
98
- $ heroku pg:upgrade:wait postgresql-curved-12345 --app myapp --no-notify
99
- `),
100
- ];
101
- Wait.args = {
102
- database: core_1.Args.string({ description: `${(0, nls_1.nls)('pg:database:arg:description')}` }),
103
- };
@@ -1,3 +0,0 @@
1
- import { Hook } from '@oclif/core';
2
- declare const hook: Hook<'plugins:preinstall'>;
3
- export default hook;
@@ -1,26 +0,0 @@
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;