heroku 10.0.0-alpha.1 → 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.
- package/lib/commands/access/add.js +1 -1
- package/lib/commands/access/index.js +2 -1
- package/lib/commands/access/update.js +1 -1
- package/lib/commands/addons/attach.js +1 -1
- package/lib/commands/addons/create.js +1 -1
- package/lib/commands/addons/destroy.js +1 -1
- package/lib/commands/addons/detach.js +1 -1
- package/lib/commands/addons/docs.js +1 -1
- package/lib/commands/addons/info.js +1 -1
- package/lib/commands/addons/open.js +1 -1
- package/lib/commands/addons/plans.js +1 -1
- package/lib/commands/addons/rename.js +2 -2
- package/lib/commands/addons/upgrade.js +2 -2
- package/lib/commands/addons/wait.js +1 -1
- package/lib/commands/apps/open.js +1 -1
- package/lib/commands/apps/rename.js +1 -1
- package/lib/commands/apps/stacks/set.js +1 -1
- package/lib/commands/authorizations/info.js +1 -1
- package/lib/commands/authorizations/revoke.js +1 -1
- package/lib/commands/authorizations/rotate.js +1 -1
- package/lib/commands/authorizations/update.js +1 -1
- package/lib/commands/certs/add.js +2 -2
- package/lib/commands/certs/generate.js +1 -1
- package/lib/commands/certs/update.js +2 -2
- package/lib/commands/ci/config/get.js +1 -1
- package/lib/commands/ci/info.js +1 -1
- package/lib/commands/ci/rerun.js +1 -1
- package/lib/commands/clients/create.js +2 -2
- package/lib/commands/clients/destroy.js +1 -1
- package/lib/commands/clients/info.js +1 -1
- package/lib/commands/clients/rotate.js +1 -1
- package/lib/commands/clients/update.js +1 -1
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/domains/add.js +1 -1
- package/lib/commands/domains/info.js +1 -1
- package/lib/commands/domains/remove.js +1 -1
- package/lib/commands/domains/update.js +1 -1
- package/lib/commands/domains/wait.js +1 -1
- package/lib/commands/drains/add.js +1 -1
- package/lib/commands/drains/remove.js +1 -1
- package/lib/commands/features/disable.js +1 -1
- package/lib/commands/features/enable.js +1 -1
- package/lib/commands/features/info.js +1 -1
- package/lib/commands/git/credentials.js +1 -1
- package/lib/commands/keys/add.js +1 -1
- package/lib/commands/keys/remove.js +1 -1
- package/lib/commands/labs/disable.js +1 -1
- package/lib/commands/labs/enable.js +1 -1
- package/lib/commands/labs/info.js +1 -1
- package/lib/commands/local/index.js +1 -1
- package/lib/commands/members/add.js +1 -1
- package/lib/commands/pg/backups/cancel.js +1 -1
- package/lib/commands/pg/backups/capture.js +2 -1
- package/lib/commands/pg/backups/delete.js +1 -1
- package/lib/commands/pg/backups/download.js +1 -1
- package/lib/commands/pg/backups/info.js +1 -1
- package/lib/commands/pg/backups/restore.d.ts +1 -0
- package/lib/commands/pg/backups/restore.js +29 -2
- package/lib/commands/pg/backups/schedule.js +2 -1
- package/lib/commands/pg/backups/unschedule.js +2 -1
- package/lib/commands/pg/backups/url.js +1 -1
- package/lib/commands/pg/bloat.js +2 -1
- package/lib/commands/pg/blocking.js +2 -1
- package/lib/commands/pg/connection-pooling/attach.js +2 -1
- package/lib/commands/pg/copy.js +2 -2
- package/lib/commands/pg/credentials/create.js +2 -1
- package/lib/commands/pg/credentials/destroy.js +2 -1
- package/lib/commands/pg/credentials/repair-default.js +2 -1
- package/lib/commands/pg/credentials/rotate.js +2 -1
- package/lib/commands/pg/credentials/url.js +2 -1
- package/lib/commands/pg/credentials.js +2 -1
- package/lib/commands/pg/diagnose.js +1 -1
- package/lib/commands/pg/info.js +2 -1
- package/lib/commands/pg/kill.js +3 -2
- package/lib/commands/pg/killall.js +2 -1
- package/lib/commands/pg/links/create.js +3 -2
- package/lib/commands/pg/links/destroy.js +3 -2
- package/lib/commands/pg/links/index.js +2 -1
- package/lib/commands/pg/locks.js +2 -1
- package/lib/commands/pg/maintenance/index.js +2 -1
- package/lib/commands/pg/maintenance/run.js +2 -1
- package/lib/commands/pg/maintenance/window.js +3 -2
- package/lib/commands/pg/outliers.js +2 -1
- package/lib/commands/pg/promote.js +2 -1
- package/lib/commands/pg/ps.js +2 -1
- package/lib/commands/pg/psql.js +2 -1
- package/lib/commands/pg/pull.js +3 -2
- package/lib/commands/pg/push.js +4 -3
- package/lib/commands/pg/reset.js +2 -1
- package/lib/commands/pg/settings/auto-explain/log-analyze.js +3 -2
- package/lib/commands/pg/settings/auto-explain/log-buffers.js +3 -2
- package/lib/commands/pg/settings/auto-explain/log-format.js +3 -2
- package/lib/commands/pg/settings/auto-explain/log-min-duration.js +3 -2
- package/lib/commands/pg/settings/auto-explain/log-nested-statements.js +3 -2
- package/lib/commands/pg/settings/auto-explain/log-triggers.js +3 -2
- package/lib/commands/pg/settings/auto-explain/log-verbose.js +3 -2
- package/lib/commands/pg/settings/auto-explain.js +3 -2
- package/lib/commands/pg/settings/explain-data-connector-details.js +3 -2
- package/lib/commands/pg/settings/index.js +2 -1
- package/lib/commands/pg/settings/log-connections.js +3 -2
- package/lib/commands/pg/settings/log-lock-waits.js +3 -2
- package/lib/commands/pg/settings/log-min-duration-statement.js +3 -2
- package/lib/commands/pg/settings/log-min-error-statement.js +2 -1
- package/lib/commands/pg/settings/log-statement.js +3 -2
- package/lib/commands/pg/settings/track-functions.js +3 -2
- package/lib/commands/pg/unfollow.js +2 -1
- package/lib/commands/pg/upgrade.js +2 -1
- package/lib/commands/pg/vacuum-stats.js +2 -1
- package/lib/commands/pg/wait.js +2 -1
- package/lib/commands/ps/autoscale/enable.js +13 -2
- package/lib/commands/ps/index.js +15 -6
- package/lib/commands/redis/cli.js +1 -1
- package/lib/commands/redis/credentials.js +1 -1
- package/lib/commands/redis/info.js +1 -1
- package/lib/commands/redis/keyspace-notifications.js +1 -1
- package/lib/commands/redis/maintenance.js +1 -1
- package/lib/commands/redis/maxmemory.js +1 -1
- package/lib/commands/redis/promote.js +1 -1
- package/lib/commands/redis/stats-reset.js +1 -1
- package/lib/commands/redis/timeout.js +1 -1
- package/lib/commands/redis/upgrade.js +1 -1
- package/lib/commands/redis/wait.js +1 -1
- package/lib/commands/releases/index.js +4 -2
- package/lib/commands/releases/info.js +6 -2
- package/lib/commands/releases/output.js +1 -1
- package/lib/commands/releases/rollback.js +14 -4
- package/lib/commands/sessions/destroy.js +1 -1
- package/lib/commands/spaces/create.js +1 -1
- package/lib/commands/spaces/drains/set.js +1 -1
- package/lib/commands/spaces/trusted-ips/add.js +3 -6
- package/lib/commands/spaces/trusted-ips/index.js +1 -3
- package/lib/commands/spaces/trusted-ips/remove.js +3 -4
- package/lib/commands/webhooks/deliveries/info.js +1 -1
- package/lib/commands/webhooks/events/info.js +1 -1
- package/lib/commands/webhooks/info.js +1 -1
- package/lib/commands/webhooks/update.js +1 -1
- package/lib/lib/releases/releases.js +10 -3
- package/lib/lib/releases/status_helper.d.ts +2 -2
- package/lib/lib/releases/status_helper.js +5 -1
- package/lib/lib/types/app_process_tier.d.ts +4 -0
- package/lib/lib/types/app_process_tier.js +2 -0
- package/lib/nls.d.ts +8 -0
- package/lib/nls.js +14 -0
- package/lib/package.nls.json +6 -0
- package/oclif.manifest.json +836 -672
- package/package.json +3 -3
|
@@ -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
|
};
|
package/lib/commands/pg/wait.js
CHANGED
|
@@ -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
|
-
|
|
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;
|
package/lib/commands/ps/index.js
CHANGED
|
@@ -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
|
-
|
|
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' : '';
|
|
141
|
+
const suffix = extended ? '?extended=true' : '';
|
|
139
142
|
const promises = {
|
|
140
|
-
dynos: this.heroku.request(`/apps/${app}/dynos${suffix}
|
|
141
|
-
|
|
142
|
-
|
|
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 }), //
|
|
203
|
+
extended: command_1.flags.boolean({ char: 'x', hidden: true }), // only works with sudo privileges
|
|
195
204
|
};
|
|
@@ -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,
|
|
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.
|
|
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,
|
|
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
|
};
|
|
@@ -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
|
-
|
|
14
|
-
|
|
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
|
|
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
|
};
|
|
@@ -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
|
|
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,
|
|
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
|
|
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,
|
|
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
|
};
|
|
@@ -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
|
};
|
|
@@ -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: {
|
|
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.
|
|
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" | "
|
|
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 '
|
|
26
|
+
return 'cyan';
|
|
23
27
|
}
|
|
24
28
|
};
|
|
25
29
|
exports.color = color;
|
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;
|