heroku 10.0.0-alpha.1 → 10.0.0-beta.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/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 +18 -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/buildpacks/index.js +9 -3
- 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/pipelines/diff.d.ts +1 -1
- package/lib/commands/pipelines/diff.js +24 -14
- package/lib/commands/pipelines/promote.js +1 -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/telemetry/add.d.ts +0 -1
- package/lib/commands/telemetry/add.js +1 -2
- 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/api.d.ts +12 -3
- package/lib/lib/api.js +15 -14
- package/lib/lib/buildpacks/buildpacks.d.ts +2 -4
- package/lib/lib/buildpacks/buildpacks.js +37 -8
- package/lib/lib/pipelines/ownership.d.ts +3 -2
- package/lib/lib/pipelines/render-pipeline.d.ts +2 -1
- package/lib/lib/pipelines/render-pipeline.js +6 -6
- 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 +167 -11
- package/package.json +3 -4
|
@@ -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
|
};
|
|
@@ -3,7 +3,6 @@ export default class Add extends Command {
|
|
|
3
3
|
static description: string;
|
|
4
4
|
static flags: {
|
|
5
5
|
app: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
6
|
-
remote: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
7
6
|
space: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
8
7
|
signals: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
9
8
|
endpoint: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
@@ -44,8 +44,7 @@ class Add extends command_1.Command {
|
|
|
44
44
|
exports.default = Add;
|
|
45
45
|
Add.description = 'Add and configure a new telemetry drain. Defaults to collecting all telemetry unless otherwise specified.';
|
|
46
46
|
Add.flags = {
|
|
47
|
-
app: command_1.flags.
|
|
48
|
-
remote: command_1.flags.remote({ description: 'git remote of app to add a drain to' }),
|
|
47
|
+
app: command_1.flags.string({ char: 'a', exactlyOne: ['app', 'space'], description: 'app to add a drain to' }),
|
|
49
48
|
space: command_1.flags.string({ char: 's', description: 'space to add a drain to' }),
|
|
50
49
|
signals: command_1.flags.string({ default: 'all', description: 'comma-delimited list of signals to collect (traces, metrics, logs). Use "all" to collect all signals.' }),
|
|
51
50
|
endpoint: command_1.flags.string({ required: true, description: 'drain url' }),
|
|
@@ -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
|
};
|
package/lib/lib/api.d.ts
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { APIClient } from '@heroku-cli/command';
|
|
2
2
|
import * as Heroku from '@heroku-cli/schema';
|
|
3
|
+
import { App, PipelineCoupling, Release } from './types/fir';
|
|
3
4
|
export declare const V3_HEADER = "application/vnd.heroku+json; version=3";
|
|
5
|
+
export declare const SDK_HEADER = "application/vnd.heroku+json; version=3.sdk";
|
|
4
6
|
export declare const FILTERS_HEADER: string;
|
|
5
7
|
export declare const PIPELINES_HEADER: string;
|
|
6
8
|
export declare function createAppSetup(heroku: APIClient, body: {
|
|
@@ -12,17 +14,24 @@ export declare function createPipeline(heroku: APIClient, name: any, owner: any)
|
|
|
12
14
|
export declare function createPipelineTransfer(heroku: APIClient, pipeline: Heroku.Pipeline): Promise<import("http-call").HTTP<unknown>>;
|
|
13
15
|
export declare function destroyPipeline(heroku: APIClient, name: any, pipelineId: any): Promise<import("http-call").HTTP<unknown>>;
|
|
14
16
|
export declare function findPipelineByName(heroku: APIClient, idOrName: string): Promise<import("http-call").HTTP<Heroku.Pipeline[]>>;
|
|
15
|
-
export
|
|
17
|
+
export interface PipelineCouplingSdk extends Required<PipelineCoupling> {
|
|
18
|
+
generation: 'fir' | 'cedar';
|
|
19
|
+
}
|
|
20
|
+
export declare function getCoupling(heroku: APIClient, app: string): Promise<import("http-call").HTTP<PipelineCouplingSdk>>;
|
|
16
21
|
export declare function getPipeline(heroku: APIClient, id: string): Promise<import("http-call").HTTP<Heroku.Pipeline>>;
|
|
17
22
|
export declare function updatePipeline(heroku: APIClient, id: string, body: Heroku.Pipeline): Promise<import("http-call").HTTP<Heroku.Pipeline>>;
|
|
18
23
|
export declare function getTeam(heroku: APIClient, teamId: any): Promise<import("http-call").HTTP<Heroku.Team>>;
|
|
19
24
|
export declare function getAccountInfo(heroku: APIClient, id?: string): Promise<import("http-call").HTTP<Heroku.Account>>;
|
|
20
25
|
export declare function getAppSetup(heroku: APIClient, buildId: any): Promise<import("http-call").HTTP<Heroku.AppSetup>>;
|
|
21
|
-
export
|
|
26
|
+
export interface AppWithPipelineCoupling extends App {
|
|
27
|
+
pipelineCoupling: PipelineCouplingSdk;
|
|
28
|
+
[k: string]: unknown;
|
|
29
|
+
}
|
|
30
|
+
export declare function listPipelineApps(heroku: APIClient, pipelineId: string): Promise<Array<AppWithPipelineCoupling>>;
|
|
22
31
|
export declare function patchCoupling(heroku: APIClient, id: string, stage: string): Promise<import("http-call").HTTP<Heroku.PipelineCoupling>>;
|
|
23
32
|
export declare function removeCoupling(heroku: APIClient, app: string): Promise<import("http-call").HTTP<unknown>>;
|
|
24
33
|
export declare function updateCoupling(heroku: APIClient, app: string, stage: string): Promise<import("http-call").HTTP<Heroku.PipelineCoupling>>;
|
|
25
|
-
export declare function getReleases(heroku: APIClient, appId: string): Promise<import("http-call").HTTP<
|
|
34
|
+
export declare function getReleases(heroku: APIClient, appId: string): Promise<import("http-call").HTTP<Release[]>>;
|
|
26
35
|
export declare function getPipelineConfigVars(heroku: APIClient, pipelineID: string): Promise<import("http-call").HTTP<Heroku.ConfigVars>>;
|
|
27
36
|
export declare function setPipelineConfigVars(heroku: APIClient, pipelineID: string, body: Heroku.ConfigVars | Record<string, null>): Promise<import("http-call").HTTP<Heroku.ConfigVars>>;
|
|
28
37
|
export declare function createTestRun(heroku: APIClient, body: Heroku.TestRun): Promise<import("http-call").HTTP<Heroku.TestRun>>;
|
package/lib/lib/api.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.updateTestRun = exports.getTestNodes = exports.createTestRun = exports.setPipelineConfigVars = exports.getPipelineConfigVars = exports.getReleases = exports.updateCoupling = exports.removeCoupling = exports.patchCoupling = exports.listPipelineApps = exports.getAppSetup = exports.getAccountInfo = exports.getTeam = exports.updatePipeline = exports.getPipeline = exports.getCoupling = exports.findPipelineByName = exports.destroyPipeline = exports.createPipelineTransfer = exports.createPipeline = exports.createCoupling = exports.postCoupling = exports.createAppSetup = exports.PIPELINES_HEADER = exports.FILTERS_HEADER = exports.V3_HEADER = void 0;
|
|
4
|
-
const lodash_1 = require("lodash");
|
|
3
|
+
exports.updateTestRun = exports.getTestNodes = exports.createTestRun = exports.setPipelineConfigVars = exports.getPipelineConfigVars = exports.getReleases = exports.updateCoupling = exports.removeCoupling = exports.patchCoupling = exports.listPipelineApps = exports.getAppSetup = exports.getAccountInfo = exports.getTeam = exports.updatePipeline = exports.getPipeline = exports.getCoupling = exports.findPipelineByName = exports.destroyPipeline = exports.createPipelineTransfer = exports.createPipeline = exports.createCoupling = exports.postCoupling = exports.createAppSetup = exports.PIPELINES_HEADER = exports.FILTERS_HEADER = exports.SDK_HEADER = exports.V3_HEADER = void 0;
|
|
5
4
|
exports.V3_HEADER = 'application/vnd.heroku+json; version=3';
|
|
5
|
+
exports.SDK_HEADER = 'application/vnd.heroku+json; version=3.sdk';
|
|
6
6
|
exports.FILTERS_HEADER = `${exports.V3_HEADER}.filters`;
|
|
7
7
|
exports.PIPELINES_HEADER = `${exports.V3_HEADER}.pipelines`;
|
|
8
8
|
const CI_HEADER = `${exports.V3_HEADER}.ci`;
|
|
@@ -53,7 +53,9 @@ function findPipelineByName(heroku, idOrName) {
|
|
|
53
53
|
}
|
|
54
54
|
exports.findPipelineByName = findPipelineByName;
|
|
55
55
|
function getCoupling(heroku, app) {
|
|
56
|
-
return heroku.get(`/apps/${app}/pipeline-couplings
|
|
56
|
+
return heroku.get(`/apps/${app}/pipeline-couplings`, {
|
|
57
|
+
headers: { Accept: exports.SDK_HEADER },
|
|
58
|
+
});
|
|
57
59
|
}
|
|
58
60
|
exports.getCoupling = getCoupling;
|
|
59
61
|
function getPipeline(heroku, id) {
|
|
@@ -89,17 +91,16 @@ function getAppSetup(heroku, buildId) {
|
|
|
89
91
|
}
|
|
90
92
|
exports.getAppSetup = getAppSetup;
|
|
91
93
|
function listCouplings(heroku, pipelineId) {
|
|
92
|
-
return heroku.get(`/pipelines/${pipelineId}/pipeline-couplings
|
|
94
|
+
return heroku.get(`/pipelines/${pipelineId}/pipeline-couplings`, {
|
|
95
|
+
headers: { Accept: exports.SDK_HEADER },
|
|
96
|
+
});
|
|
93
97
|
}
|
|
94
|
-
function listPipelineApps(heroku, pipelineId) {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
return Object.assign(Object.assign({}, app), { coupling: couplingsByAppId[app.id] });
|
|
101
|
-
});
|
|
102
|
-
});
|
|
98
|
+
async function listPipelineApps(heroku, pipelineId) {
|
|
99
|
+
const { body: couplings } = await listCouplings(heroku, pipelineId);
|
|
100
|
+
const appIds = couplings.map(coupling => coupling.app.id || '');
|
|
101
|
+
const { body: apps } = await getAppFilter(heroku, appIds);
|
|
102
|
+
return apps.map(app => {
|
|
103
|
+
return Object.assign(Object.assign({}, app), { pipelineCoupling: couplings.find(coupling => coupling.app.id === app.id) });
|
|
103
104
|
});
|
|
104
105
|
}
|
|
105
106
|
exports.listPipelineApps = listPipelineApps;
|
|
@@ -121,7 +122,7 @@ function updateCoupling(heroku, app, stage) {
|
|
|
121
122
|
exports.updateCoupling = updateCoupling;
|
|
122
123
|
function getReleases(heroku, appId) {
|
|
123
124
|
return heroku.get(`/apps/${appId}/releases`, {
|
|
124
|
-
headers: { Accept: exports.
|
|
125
|
+
headers: { Accept: exports.SDK_HEADER, Range: 'version ..; order=desc' },
|
|
125
126
|
partial: true,
|
|
126
127
|
});
|
|
127
128
|
}
|
|
@@ -11,10 +11,8 @@ export declare class BuildpackCommand {
|
|
|
11
11
|
heroku: APIClient;
|
|
12
12
|
registry: BuildpackRegistry;
|
|
13
13
|
constructor(heroku: APIClient);
|
|
14
|
-
fetch(app: string): Promise<any[]>;
|
|
15
|
-
mapBuildpackResponse(buildpacks:
|
|
16
|
-
body: any;
|
|
17
|
-
}): BuildpackResponse[];
|
|
14
|
+
fetch(app: string, isFirApp?: boolean): Promise<any[]>;
|
|
15
|
+
mapBuildpackResponse(buildpacks: BuildpackResponse[]): BuildpackResponse[];
|
|
18
16
|
display(buildpacks: BuildpackResponse[], indent: string): void;
|
|
19
17
|
registryNameToUrl(buildpack: string): Promise<string>;
|
|
20
18
|
findUrl(buildpacks: BuildpackResponse[], buildpack: string): Promise<number>;
|
|
@@ -7,19 +7,48 @@ const core_1 = require("@oclif/core");
|
|
|
7
7
|
const lodash_1 = require("lodash");
|
|
8
8
|
const true_myth_1 = require("true-myth");
|
|
9
9
|
const push_1 = require("../git/push");
|
|
10
|
-
const
|
|
10
|
+
const validator_1 = require("validator");
|
|
11
11
|
class BuildpackCommand {
|
|
12
12
|
constructor(heroku) {
|
|
13
13
|
this.heroku = heroku;
|
|
14
14
|
this.registry = new buildpack_registry_1.BuildpackRegistry();
|
|
15
15
|
}
|
|
16
|
-
async fetch(app) {
|
|
17
|
-
|
|
16
|
+
async fetch(app, isFirApp = false) {
|
|
17
|
+
let buildpacks;
|
|
18
|
+
if (isFirApp) {
|
|
19
|
+
const { body: releases } = await this.heroku.request(`/apps/${app}/releases`, {
|
|
20
|
+
partial: true,
|
|
21
|
+
headers: {
|
|
22
|
+
Range: 'version ..; max=10, order=desc',
|
|
23
|
+
Accept: 'application/vnd.heroku+json; version=3.sdk',
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
if (releases.length === 0 || releases[0].oci_image === null)
|
|
27
|
+
return [];
|
|
28
|
+
const latestImageId = releases[0].oci_image.id;
|
|
29
|
+
const { body: ociImages } = await this.heroku.get(`/apps/${app}/oci-images/${latestImageId}`, {
|
|
30
|
+
headers: {
|
|
31
|
+
Accept: 'application/vnd.heroku+json; version=3.sdk',
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
buildpacks = ociImages[0].buildpacks.map((b, index) => {
|
|
35
|
+
return {
|
|
36
|
+
buildpack: {
|
|
37
|
+
url: b.id || b.homepage,
|
|
38
|
+
name: b.id,
|
|
39
|
+
},
|
|
40
|
+
ordinal: index,
|
|
41
|
+
};
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
const { body: buildpackInstallations } = await this.heroku.get(`/apps/${app}/buildpack-installations`);
|
|
46
|
+
buildpacks = buildpackInstallations;
|
|
47
|
+
}
|
|
18
48
|
return this.mapBuildpackResponse(buildpacks);
|
|
19
49
|
}
|
|
20
50
|
mapBuildpackResponse(buildpacks) {
|
|
21
|
-
|
|
22
|
-
return body.map((bp) => {
|
|
51
|
+
return buildpacks.map((bp) => {
|
|
23
52
|
bp.buildpack.url = bp.buildpack.url.replace(/^urn:buildpack:/, '');
|
|
24
53
|
return bp;
|
|
25
54
|
});
|
|
@@ -35,11 +64,11 @@ class BuildpackCommand {
|
|
|
35
64
|
}
|
|
36
65
|
}
|
|
37
66
|
async registryNameToUrl(buildpack) {
|
|
38
|
-
if (
|
|
67
|
+
if ((0, validator_1.isURL)(buildpack)) {
|
|
39
68
|
return buildpack;
|
|
40
69
|
}
|
|
41
70
|
true_myth_1.Result.match({
|
|
42
|
-
Ok:
|
|
71
|
+
Ok: () => { },
|
|
43
72
|
Err: err => {
|
|
44
73
|
core_1.ux.error(`Could not find the buildpack: ${buildpack}. ${err}`, { exit: 1 });
|
|
45
74
|
},
|
|
@@ -93,7 +122,7 @@ class BuildpackCommand {
|
|
|
93
122
|
return this.put(app, buildpackUpdates);
|
|
94
123
|
}
|
|
95
124
|
async put(app, buildpackUpdates) {
|
|
96
|
-
const buildpacks = await this.heroku.put(`/apps/${app}/buildpack-installations`, {
|
|
125
|
+
const { body: buildpacks } = await this.heroku.put(`/apps/${app}/buildpack-installations`, {
|
|
97
126
|
headers: { Range: '' },
|
|
98
127
|
body: { updates: buildpackUpdates },
|
|
99
128
|
});
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { APIClient } from '@heroku-cli/command';
|
|
2
2
|
import * as Heroku from '@heroku-cli/schema';
|
|
3
|
-
|
|
4
|
-
export declare function
|
|
3
|
+
import { AppWithPipelineCoupling } from '../api';
|
|
4
|
+
export declare function warnMixedOwnership(pipelineApps: Array<AppWithPipelineCoupling>, pipeline: Heroku.Pipeline, owner: string): void;
|
|
5
|
+
export declare function getOwner(heroku: APIClient, apps: Array<AppWithPipelineCoupling>, pipeline: Heroku.Pipeline): Promise<any>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { APIClient } from '@heroku-cli/command';
|
|
2
2
|
import * as Heroku from '@heroku-cli/schema';
|
|
3
|
-
|
|
3
|
+
import { AppWithPipelineCoupling } from '../api';
|
|
4
|
+
export default function renderPipeline(heroku: APIClient, pipeline: Heroku.Pipeline, pipelineApps: Array<AppWithPipelineCoupling>, { withOwners, showOwnerWarning }?: {
|
|
4
5
|
withOwners: boolean;
|
|
5
6
|
showOwnerWarning: boolean;
|
|
6
7
|
}): Promise<void>;
|
|
@@ -24,7 +24,7 @@ async function renderPipeline(heroku, pipeline, pipelineApps,
|
|
|
24
24
|
'coupling.stage': {
|
|
25
25
|
header: 'stage',
|
|
26
26
|
get(row) {
|
|
27
|
-
return row.
|
|
27
|
+
return row.pipelineCoupling.stage;
|
|
28
28
|
},
|
|
29
29
|
},
|
|
30
30
|
};
|
|
@@ -34,15 +34,15 @@ async function renderPipeline(heroku, pipeline, pipelineApps,
|
|
|
34
34
|
get(row) {
|
|
35
35
|
const email = row.owner && row.owner.email;
|
|
36
36
|
if (email) {
|
|
37
|
-
return email.endsWith('@herokumanager.com') ? `${
|
|
37
|
+
return email.endsWith('@herokumanager.com') ? `${email.split('@')[0]} (team)` : email;
|
|
38
38
|
}
|
|
39
39
|
},
|
|
40
40
|
};
|
|
41
41
|
}
|
|
42
|
-
const developmentApps = (0, lodash_1.sortBy)(pipelineApps.filter(app => app.
|
|
43
|
-
const reviewApps = (0, lodash_1.sortBy)(pipelineApps.filter(app => app.
|
|
44
|
-
const stagingApps = (0, lodash_1.sortBy)(pipelineApps.filter(app => app.
|
|
45
|
-
const productionApps = (0, lodash_1.sortBy)(pipelineApps.filter(app => app.
|
|
42
|
+
const developmentApps = (0, lodash_1.sortBy)(pipelineApps.filter(app => app.pipelineCoupling.stage === 'development'), ['name']);
|
|
43
|
+
const reviewApps = (0, lodash_1.sortBy)(pipelineApps.filter(app => app.pipelineCoupling.stage === 'review'), ['name']);
|
|
44
|
+
const stagingApps = (0, lodash_1.sortBy)(pipelineApps.filter(app => app.pipelineCoupling.stage === 'staging'), ['name']);
|
|
45
|
+
const productionApps = (0, lodash_1.sortBy)(pipelineApps.filter(app => app.pipelineCoupling.stage === 'production'), ['name']);
|
|
46
46
|
const apps = developmentApps.concat(reviewApps).concat(stagingApps).concat(productionApps);
|
|
47
47
|
core_1.ux.table(apps, columns);
|
|
48
48
|
if (showOwnerWarning && pipeline.owner) {
|
|
@@ -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;
|
|
@@ -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
|
+
}
|