heroku 10.13.2 → 10.13.3-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/pg/backups/cancel.js +4 -4
- package/lib/commands/pg/backups/capture.js +5 -5
- package/lib/commands/pg/backups/delete.js +2 -2
- package/lib/commands/pg/backups/download.js +3 -3
- package/lib/commands/pg/backups/index.js +2 -2
- package/lib/commands/pg/backups/info.js +3 -3
- package/lib/commands/pg/backups/restore.js +5 -5
- package/lib/commands/pg/backups/schedule.js +7 -7
- package/lib/commands/pg/backups/schedules.js +2 -2
- package/lib/commands/pg/backups/unschedule.js +6 -5
- package/lib/commands/pg/backups/url.js +3 -3
- package/lib/commands/pg/bloat.js +5 -4
- package/lib/commands/pg/blocking.js +5 -4
- package/lib/commands/pg/connection-pooling/attach.js +5 -6
- package/lib/commands/pg/copy.js +6 -7
- package/lib/commands/pg/credentials/create.js +4 -4
- package/lib/commands/pg/credentials/destroy.js +4 -4
- package/lib/commands/pg/credentials/repair-default.js +4 -4
- package/lib/commands/pg/credentials/rotate.js +4 -4
- package/lib/commands/pg/credentials/url.js +4 -4
- package/lib/commands/pg/credentials.js +4 -4
- package/lib/commands/pg/diagnose.js +6 -5
- package/lib/commands/pg/info.js +5 -3
- package/lib/commands/pg/kill.js +6 -5
- package/lib/commands/pg/killall.js +4 -4
- package/lib/commands/pg/links/create.js +10 -8
- package/lib/commands/pg/links/destroy.js +4 -4
- package/lib/commands/pg/links/index.js +14 -8
- package/lib/commands/pg/locks.js +5 -4
- package/lib/commands/pg/maintenance/index.js +4 -4
- package/lib/commands/pg/maintenance/run.js +4 -4
- package/lib/commands/pg/maintenance/window.js +4 -4
- package/lib/commands/pg/outliers.d.ts +2 -2
- package/lib/commands/pg/outliers.js +9 -7
- package/lib/commands/pg/promote.js +5 -4
- package/lib/commands/pg/ps.js +6 -5
- package/lib/commands/pg/psql.js +6 -4
- package/lib/commands/pg/pull.d.ts +1 -1
- package/lib/commands/pg/pull.js +4 -4
- package/lib/commands/pg/push.d.ts +1 -1
- package/lib/commands/pg/push.js +4 -4
- package/lib/commands/pg/reset.js +4 -4
- package/lib/commands/pg/settings/index.js +2 -2
- package/lib/commands/pg/unfollow.js +5 -5
- package/lib/commands/pg/upgrade/cancel.js +5 -5
- package/lib/commands/pg/upgrade/dryrun.js +5 -5
- package/lib/commands/pg/upgrade/index.js +5 -5
- package/lib/commands/pg/upgrade/prepare.js +5 -5
- package/lib/commands/pg/upgrade/run.js +5 -5
- package/lib/commands/pg/upgrade/wait.js +9 -4
- package/lib/commands/pg/vacuum-stats.js +5 -4
- package/lib/commands/pg/wait.js +6 -4
- package/lib/commands/run/detached.d.ts +1 -0
- package/lib/commands/run/detached.js +5 -1
- package/lib/commands/run/index.d.ts +1 -0
- package/lib/commands/run/index.js +7 -2
- package/lib/commands/run/inside.js +1 -6
- package/lib/lib/addons/resolve.d.ts +6 -7
- package/lib/lib/pg/backups.js +4 -4
- package/lib/lib/pg/fetcher.d.ts +3 -34
- package/lib/lib/pg/fetcher.js +3 -92
- package/lib/lib/pg/psql.d.ts +5 -36
- package/lib/lib/pg/psql.js +17 -195
- package/lib/lib/pg/push_pull.d.ts +2 -7
- package/lib/lib/pg/push_pull.js +9 -7
- package/lib/lib/pg/setter.js +3 -3
- package/lib/lib/pg/types.d.ts +10 -15
- package/lib/lib/pg/util.d.ts +6 -32
- package/lib/lib/pg/util.js +3 -70
- package/lib/lib/run/helpers.d.ts +10 -0
- package/lib/lib/run/helpers.js +22 -1
- package/oclif.manifest.json +142 -130
- package/package.json +4 -6
- package/lib/lib/pg/bastion.d.ts +0 -29
- package/lib/lib/pg/bastion.js +0 -121
- package/lib/lib/pg/config.d.ts +0 -2
- package/lib/lib/pg/config.js +0 -13
- package/lib/lib/pg/host.d.ts +0 -1
- package/lib/lib/pg/host.js +0 -6
package/lib/lib/pg/util.js
CHANGED
|
@@ -1,20 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.databaseNameFromUrl = exports.configVarNamesFromValue = exports.presentCredentialAttachments = exports.formatResponseWithCommands = exports.essentialPlan = exports.legacyEssentialPlan = exports.essentialNumPlan = void 0;
|
|
4
4
|
const color_1 = require("@heroku-cli/color");
|
|
5
5
|
const core_1 = require("@oclif/core");
|
|
6
|
-
const debug_1 = require("debug");
|
|
7
6
|
const addons_1 = require("../../commands/addons");
|
|
8
7
|
const multisort_1 = require("../utils/multisort");
|
|
9
|
-
const
|
|
10
|
-
const process_1 = require("process");
|
|
11
|
-
function getConfigVarName(configVars) {
|
|
12
|
-
const connStringVars = configVars.filter(cv => (cv.endsWith('_URL')));
|
|
13
|
-
if (connStringVars.length === 0)
|
|
14
|
-
throw new Error('Database URL not found for this addon');
|
|
15
|
-
return connStringVars[0];
|
|
16
|
-
}
|
|
17
|
-
exports.getConfigVarName = getConfigVarName;
|
|
8
|
+
const heroku_cli_util_1 = require("@heroku/heroku-cli-util");
|
|
18
9
|
const essentialNumPlan = (addon) => { var _a, _b; return Boolean((_b = (_a = addon === null || addon === void 0 ? void 0 : addon.plan) === null || _a === void 0 ? void 0 : _a.name) === null || _b === void 0 ? void 0 : _b.split(':')[1].match(/^essential/)); };
|
|
19
10
|
exports.essentialNumPlan = essentialNumPlan;
|
|
20
11
|
const legacyEssentialPlan = (addon) => { var _a, _b; return Boolean((_b = (_a = addon === null || addon === void 0 ? void 0 : addon.plan) === null || _a === void 0 ? void 0 : _a.name) === null || _b === void 0 ? void 0 : _b.split(':')[1].match(/(dev|basic|mini)$/)); };
|
|
@@ -23,22 +14,6 @@ function essentialPlan(addon) {
|
|
|
23
14
|
return (0, exports.essentialNumPlan)(addon) || (0, exports.legacyEssentialPlan)(addon);
|
|
24
15
|
}
|
|
25
16
|
exports.essentialPlan = essentialPlan;
|
|
26
|
-
function getConfigVarNameFromAttachment(attachment, config = {}) {
|
|
27
|
-
var _a, _b;
|
|
28
|
-
const configVars = (_b = (_a = attachment.config_vars) === null || _a === void 0 ? void 0 : _a.filter((cv) => {
|
|
29
|
-
var _a;
|
|
30
|
-
return (_a = config[cv]) === null || _a === void 0 ? void 0 : _a.startsWith('postgres://');
|
|
31
|
-
})) !== null && _b !== void 0 ? _b : [];
|
|
32
|
-
if (configVars.length === 0) {
|
|
33
|
-
core_1.ux.error(`No config vars found for ${attachment.name}; perhaps they were removed as a side effect of ${color_1.default.cmd('heroku rollback')}? Use ${color_1.default.cmd('heroku addons:attach')} to create a new attachment and then ${color_1.default.cmd('heroku addons:detach')} to remove the current attachment.`);
|
|
34
|
-
}
|
|
35
|
-
const configVarName = `${attachment.name}_URL`;
|
|
36
|
-
if (configVars.includes(configVarName) && configVarName in config) {
|
|
37
|
-
return configVarName;
|
|
38
|
-
}
|
|
39
|
-
return getConfigVarName(configVars);
|
|
40
|
-
}
|
|
41
|
-
exports.getConfigVarNameFromAttachment = getConfigVarNameFromAttachment;
|
|
42
17
|
function formatResponseWithCommands(response) {
|
|
43
18
|
return response.replace(/`(.*?)`/g, (_, word) => color_1.default.cmd(word));
|
|
44
19
|
}
|
|
@@ -102,33 +77,6 @@ function presentCredentialAttachments(app, credAttachments, credentials, cred) {
|
|
|
102
77
|
return [cred, ...attLines, ...rotationLines].join('\n');
|
|
103
78
|
}
|
|
104
79
|
exports.presentCredentialAttachments = presentCredentialAttachments;
|
|
105
|
-
const getConnectionDetails = (attachment, configVars = {}) => {
|
|
106
|
-
const connStringVar = getConfigVarNameFromAttachment(attachment, configVars);
|
|
107
|
-
// remove _URL from the end of the config var name
|
|
108
|
-
const baseName = connStringVar.slice(0, -4);
|
|
109
|
-
// build the default payload for non-bastion dbs
|
|
110
|
-
(0, debug_1.default)(`Using "${connStringVar}" to connect to your database…`);
|
|
111
|
-
const conn = (0, exports.parsePostgresConnectionString)(configVars[connStringVar]);
|
|
112
|
-
const payload = {
|
|
113
|
-
user: conn.user,
|
|
114
|
-
password: conn.password,
|
|
115
|
-
database: conn.database,
|
|
116
|
-
host: conn.host,
|
|
117
|
-
port: conn.port,
|
|
118
|
-
pathname: conn.pathname,
|
|
119
|
-
url: conn.url,
|
|
120
|
-
attachment,
|
|
121
|
-
};
|
|
122
|
-
// If bastion creds exist, graft it into the payload
|
|
123
|
-
const bastion = (0, bastion_1.getBastion)(configVars, baseName);
|
|
124
|
-
if (bastion) {
|
|
125
|
-
Object.assign(payload, bastion);
|
|
126
|
-
}
|
|
127
|
-
return payload;
|
|
128
|
-
};
|
|
129
|
-
exports.getConnectionDetails = getConnectionDetails;
|
|
130
|
-
const bastionKeyPlan = (a) => Boolean(a.plan.name.match(/private/));
|
|
131
|
-
exports.bastionKeyPlan = bastionKeyPlan;
|
|
132
80
|
const configVarNamesFromValue = (config, value) => {
|
|
133
81
|
const keys = [];
|
|
134
82
|
for (const key of Object.keys(config)) {
|
|
@@ -166,22 +114,7 @@ const databaseNameFromUrl = (uri, config) => {
|
|
|
166
114
|
if (name) {
|
|
167
115
|
return color_1.default.configVar(name.replace(/_URL$/, ''));
|
|
168
116
|
}
|
|
169
|
-
const conn =
|
|
117
|
+
const conn = heroku_cli_util_1.utils.pg.DatabaseResolver.parsePostgresConnectionString(uri);
|
|
170
118
|
return `${conn.host}:${conn.port}${conn.pathname}`;
|
|
171
119
|
};
|
|
172
120
|
exports.databaseNameFromUrl = databaseNameFromUrl;
|
|
173
|
-
const parsePostgresConnectionString = (db) => {
|
|
174
|
-
const dbPath = db.match(/:\/\//) ? db : `postgres:///${db}`;
|
|
175
|
-
const url = new URL(dbPath);
|
|
176
|
-
const { username, password, hostname, pathname, port } = url;
|
|
177
|
-
return {
|
|
178
|
-
user: username,
|
|
179
|
-
password,
|
|
180
|
-
database: pathname.charAt(0) === '/' ? pathname.slice(1) : pathname,
|
|
181
|
-
host: hostname,
|
|
182
|
-
port: port || process_1.env.PGPORT || (hostname && '5432'),
|
|
183
|
-
pathname,
|
|
184
|
-
url: dbPath,
|
|
185
|
-
};
|
|
186
|
-
};
|
|
187
|
-
exports.parsePostgresConnectionString = parsePostgresConnectionString;
|
package/lib/lib/run/helpers.d.ts
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
import type { APIClient } from '@heroku-cli/command';
|
|
1
2
|
export declare function revertSortedArgs(processArgs: Array<string>, argv: Array<string>): string[];
|
|
2
3
|
export declare function buildCommand(args: Array<string>, prependLauncher?: boolean): string;
|
|
3
4
|
export declare function buildEnvFromFlag(flag: string): {};
|
|
5
|
+
/**
|
|
6
|
+
* Determines whether to prepend `launcher` to the command for a given app.
|
|
7
|
+
* Behavior: Only prepend on CNB stack apps and when not explicitly disabled.
|
|
8
|
+
*/
|
|
9
|
+
export declare function shouldPrependLauncher(heroku: APIClient, appName: string, disableLauncher: boolean): Promise<boolean>;
|
|
10
|
+
/**
|
|
11
|
+
* Builds the command string, automatically deciding whether to prepend `launcher`.
|
|
12
|
+
*/
|
|
13
|
+
export declare function buildCommandWithLauncher(heroku: APIClient, appName: string, args: string[], disableLauncher: boolean): Promise<string>;
|
package/lib/lib/run/helpers.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.buildEnvFromFlag = exports.buildCommand = exports.revertSortedArgs = void 0;
|
|
3
|
+
exports.buildCommandWithLauncher = exports.shouldPrependLauncher = exports.buildEnvFromFlag = exports.buildCommand = exports.revertSortedArgs = void 0;
|
|
4
4
|
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
|
5
5
|
const core_1 = require("@oclif/core");
|
|
6
6
|
// this function exists because oclif sorts argv
|
|
@@ -56,3 +56,24 @@ function buildEnvFromFlag(flag) {
|
|
|
56
56
|
return env;
|
|
57
57
|
}
|
|
58
58
|
exports.buildEnvFromFlag = buildEnvFromFlag;
|
|
59
|
+
/**
|
|
60
|
+
* Determines whether to prepend `launcher` to the command for a given app.
|
|
61
|
+
* Behavior: Only prepend on CNB stack apps and when not explicitly disabled.
|
|
62
|
+
*/
|
|
63
|
+
async function shouldPrependLauncher(heroku, appName, disableLauncher) {
|
|
64
|
+
if (disableLauncher)
|
|
65
|
+
return false;
|
|
66
|
+
const { body: app } = await heroku.get(`/apps/${appName}`, {
|
|
67
|
+
headers: { Accept: 'application/vnd.heroku+json; version=3.sdk' },
|
|
68
|
+
});
|
|
69
|
+
return (app.stack && app.stack.name) === 'cnb';
|
|
70
|
+
}
|
|
71
|
+
exports.shouldPrependLauncher = shouldPrependLauncher;
|
|
72
|
+
/**
|
|
73
|
+
* Builds the command string, automatically deciding whether to prepend `launcher`.
|
|
74
|
+
*/
|
|
75
|
+
async function buildCommandWithLauncher(heroku, appName, args, disableLauncher) {
|
|
76
|
+
const prependLauncher = await shouldPrependLauncher(heroku, appName, disableLauncher);
|
|
77
|
+
return buildCommand(args, prependLauncher);
|
|
78
|
+
}
|
|
79
|
+
exports.buildCommandWithLauncher = buildCommandWithLauncher;
|
package/oclif.manifest.json
CHANGED
|
@@ -580,6 +580,134 @@
|
|
|
580
580
|
"update.js"
|
|
581
581
|
]
|
|
582
582
|
},
|
|
583
|
+
"accounts:add": {
|
|
584
|
+
"aliases": [],
|
|
585
|
+
"args": {
|
|
586
|
+
"name": {
|
|
587
|
+
"description": "name of Heroku account to add",
|
|
588
|
+
"name": "name",
|
|
589
|
+
"required": true
|
|
590
|
+
}
|
|
591
|
+
},
|
|
592
|
+
"description": "add a Heroku account to your cache",
|
|
593
|
+
"examples": "heroku accounts:add my-account",
|
|
594
|
+
"flags": {},
|
|
595
|
+
"hasDynamicHelp": false,
|
|
596
|
+
"hiddenAliases": [],
|
|
597
|
+
"id": "accounts:add",
|
|
598
|
+
"pluginAlias": "heroku",
|
|
599
|
+
"pluginName": "heroku",
|
|
600
|
+
"pluginType": "core",
|
|
601
|
+
"strict": true,
|
|
602
|
+
"example": "heroku accounts:add my-account",
|
|
603
|
+
"isESM": false,
|
|
604
|
+
"relativePath": [
|
|
605
|
+
"lib",
|
|
606
|
+
"commands",
|
|
607
|
+
"accounts",
|
|
608
|
+
"add.js"
|
|
609
|
+
]
|
|
610
|
+
},
|
|
611
|
+
"accounts:current": {
|
|
612
|
+
"aliases": [],
|
|
613
|
+
"args": {},
|
|
614
|
+
"description": "display the current Heroku account",
|
|
615
|
+
"examples": "heroku accounts:current",
|
|
616
|
+
"flags": {},
|
|
617
|
+
"hasDynamicHelp": false,
|
|
618
|
+
"hiddenAliases": [],
|
|
619
|
+
"id": "accounts:current",
|
|
620
|
+
"pluginAlias": "heroku",
|
|
621
|
+
"pluginName": "heroku",
|
|
622
|
+
"pluginType": "core",
|
|
623
|
+
"strict": true,
|
|
624
|
+
"example": "heroku accounts:current",
|
|
625
|
+
"isESM": false,
|
|
626
|
+
"relativePath": [
|
|
627
|
+
"lib",
|
|
628
|
+
"commands",
|
|
629
|
+
"accounts",
|
|
630
|
+
"current.js"
|
|
631
|
+
]
|
|
632
|
+
},
|
|
633
|
+
"accounts": {
|
|
634
|
+
"aliases": [],
|
|
635
|
+
"args": {},
|
|
636
|
+
"description": "list the Heroku accounts in your cache",
|
|
637
|
+
"examples": "heroku accounts",
|
|
638
|
+
"flags": {},
|
|
639
|
+
"hasDynamicHelp": false,
|
|
640
|
+
"hiddenAliases": [],
|
|
641
|
+
"id": "accounts",
|
|
642
|
+
"pluginAlias": "heroku",
|
|
643
|
+
"pluginName": "heroku",
|
|
644
|
+
"pluginType": "core",
|
|
645
|
+
"strict": true,
|
|
646
|
+
"example": "heroku accounts",
|
|
647
|
+
"isESM": false,
|
|
648
|
+
"relativePath": [
|
|
649
|
+
"lib",
|
|
650
|
+
"commands",
|
|
651
|
+
"accounts",
|
|
652
|
+
"index.js"
|
|
653
|
+
]
|
|
654
|
+
},
|
|
655
|
+
"accounts:remove": {
|
|
656
|
+
"aliases": [],
|
|
657
|
+
"args": {
|
|
658
|
+
"name": {
|
|
659
|
+
"description": "name of Heroku account to remove",
|
|
660
|
+
"name": "name",
|
|
661
|
+
"required": true
|
|
662
|
+
}
|
|
663
|
+
},
|
|
664
|
+
"description": "remove a Heroku account from your cache",
|
|
665
|
+
"examples": "heroku accounts:remove my-account",
|
|
666
|
+
"flags": {},
|
|
667
|
+
"hasDynamicHelp": false,
|
|
668
|
+
"hiddenAliases": [],
|
|
669
|
+
"id": "accounts:remove",
|
|
670
|
+
"pluginAlias": "heroku",
|
|
671
|
+
"pluginName": "heroku",
|
|
672
|
+
"pluginType": "core",
|
|
673
|
+
"strict": true,
|
|
674
|
+
"example": "heroku accounts:remove my-account",
|
|
675
|
+
"isESM": false,
|
|
676
|
+
"relativePath": [
|
|
677
|
+
"lib",
|
|
678
|
+
"commands",
|
|
679
|
+
"accounts",
|
|
680
|
+
"remove.js"
|
|
681
|
+
]
|
|
682
|
+
},
|
|
683
|
+
"accounts:set": {
|
|
684
|
+
"aliases": [],
|
|
685
|
+
"args": {
|
|
686
|
+
"name": {
|
|
687
|
+
"description": "name of account to set",
|
|
688
|
+
"name": "name",
|
|
689
|
+
"required": true
|
|
690
|
+
}
|
|
691
|
+
},
|
|
692
|
+
"description": "set the current Heroku account from your cache",
|
|
693
|
+
"examples": "heroku accounts:set my-account",
|
|
694
|
+
"flags": {},
|
|
695
|
+
"hasDynamicHelp": false,
|
|
696
|
+
"hiddenAliases": [],
|
|
697
|
+
"id": "accounts:set",
|
|
698
|
+
"pluginAlias": "heroku",
|
|
699
|
+
"pluginName": "heroku",
|
|
700
|
+
"pluginType": "core",
|
|
701
|
+
"strict": true,
|
|
702
|
+
"example": "heroku accounts:set my-account",
|
|
703
|
+
"isESM": false,
|
|
704
|
+
"relativePath": [
|
|
705
|
+
"lib",
|
|
706
|
+
"commands",
|
|
707
|
+
"accounts",
|
|
708
|
+
"set.js"
|
|
709
|
+
]
|
|
710
|
+
},
|
|
583
711
|
"addons:attach": {
|
|
584
712
|
"aliases": [],
|
|
585
713
|
"args": {
|
|
@@ -1234,134 +1362,6 @@
|
|
|
1234
1362
|
"wait.js"
|
|
1235
1363
|
]
|
|
1236
1364
|
},
|
|
1237
|
-
"accounts:add": {
|
|
1238
|
-
"aliases": [],
|
|
1239
|
-
"args": {
|
|
1240
|
-
"name": {
|
|
1241
|
-
"description": "name of Heroku account to add",
|
|
1242
|
-
"name": "name",
|
|
1243
|
-
"required": true
|
|
1244
|
-
}
|
|
1245
|
-
},
|
|
1246
|
-
"description": "add a Heroku account to your cache",
|
|
1247
|
-
"examples": "heroku accounts:add my-account",
|
|
1248
|
-
"flags": {},
|
|
1249
|
-
"hasDynamicHelp": false,
|
|
1250
|
-
"hiddenAliases": [],
|
|
1251
|
-
"id": "accounts:add",
|
|
1252
|
-
"pluginAlias": "heroku",
|
|
1253
|
-
"pluginName": "heroku",
|
|
1254
|
-
"pluginType": "core",
|
|
1255
|
-
"strict": true,
|
|
1256
|
-
"example": "heroku accounts:add my-account",
|
|
1257
|
-
"isESM": false,
|
|
1258
|
-
"relativePath": [
|
|
1259
|
-
"lib",
|
|
1260
|
-
"commands",
|
|
1261
|
-
"accounts",
|
|
1262
|
-
"add.js"
|
|
1263
|
-
]
|
|
1264
|
-
},
|
|
1265
|
-
"accounts:current": {
|
|
1266
|
-
"aliases": [],
|
|
1267
|
-
"args": {},
|
|
1268
|
-
"description": "display the current Heroku account",
|
|
1269
|
-
"examples": "heroku accounts:current",
|
|
1270
|
-
"flags": {},
|
|
1271
|
-
"hasDynamicHelp": false,
|
|
1272
|
-
"hiddenAliases": [],
|
|
1273
|
-
"id": "accounts:current",
|
|
1274
|
-
"pluginAlias": "heroku",
|
|
1275
|
-
"pluginName": "heroku",
|
|
1276
|
-
"pluginType": "core",
|
|
1277
|
-
"strict": true,
|
|
1278
|
-
"example": "heroku accounts:current",
|
|
1279
|
-
"isESM": false,
|
|
1280
|
-
"relativePath": [
|
|
1281
|
-
"lib",
|
|
1282
|
-
"commands",
|
|
1283
|
-
"accounts",
|
|
1284
|
-
"current.js"
|
|
1285
|
-
]
|
|
1286
|
-
},
|
|
1287
|
-
"accounts": {
|
|
1288
|
-
"aliases": [],
|
|
1289
|
-
"args": {},
|
|
1290
|
-
"description": "list the Heroku accounts in your cache",
|
|
1291
|
-
"examples": "heroku accounts",
|
|
1292
|
-
"flags": {},
|
|
1293
|
-
"hasDynamicHelp": false,
|
|
1294
|
-
"hiddenAliases": [],
|
|
1295
|
-
"id": "accounts",
|
|
1296
|
-
"pluginAlias": "heroku",
|
|
1297
|
-
"pluginName": "heroku",
|
|
1298
|
-
"pluginType": "core",
|
|
1299
|
-
"strict": true,
|
|
1300
|
-
"example": "heroku accounts",
|
|
1301
|
-
"isESM": false,
|
|
1302
|
-
"relativePath": [
|
|
1303
|
-
"lib",
|
|
1304
|
-
"commands",
|
|
1305
|
-
"accounts",
|
|
1306
|
-
"index.js"
|
|
1307
|
-
]
|
|
1308
|
-
},
|
|
1309
|
-
"accounts:remove": {
|
|
1310
|
-
"aliases": [],
|
|
1311
|
-
"args": {
|
|
1312
|
-
"name": {
|
|
1313
|
-
"description": "name of Heroku account to remove",
|
|
1314
|
-
"name": "name",
|
|
1315
|
-
"required": true
|
|
1316
|
-
}
|
|
1317
|
-
},
|
|
1318
|
-
"description": "remove a Heroku account from your cache",
|
|
1319
|
-
"examples": "heroku accounts:remove my-account",
|
|
1320
|
-
"flags": {},
|
|
1321
|
-
"hasDynamicHelp": false,
|
|
1322
|
-
"hiddenAliases": [],
|
|
1323
|
-
"id": "accounts:remove",
|
|
1324
|
-
"pluginAlias": "heroku",
|
|
1325
|
-
"pluginName": "heroku",
|
|
1326
|
-
"pluginType": "core",
|
|
1327
|
-
"strict": true,
|
|
1328
|
-
"example": "heroku accounts:remove my-account",
|
|
1329
|
-
"isESM": false,
|
|
1330
|
-
"relativePath": [
|
|
1331
|
-
"lib",
|
|
1332
|
-
"commands",
|
|
1333
|
-
"accounts",
|
|
1334
|
-
"remove.js"
|
|
1335
|
-
]
|
|
1336
|
-
},
|
|
1337
|
-
"accounts:set": {
|
|
1338
|
-
"aliases": [],
|
|
1339
|
-
"args": {
|
|
1340
|
-
"name": {
|
|
1341
|
-
"description": "name of account to set",
|
|
1342
|
-
"name": "name",
|
|
1343
|
-
"required": true
|
|
1344
|
-
}
|
|
1345
|
-
},
|
|
1346
|
-
"description": "set the current Heroku account from your cache",
|
|
1347
|
-
"examples": "heroku accounts:set my-account",
|
|
1348
|
-
"flags": {},
|
|
1349
|
-
"hasDynamicHelp": false,
|
|
1350
|
-
"hiddenAliases": [],
|
|
1351
|
-
"id": "accounts:set",
|
|
1352
|
-
"pluginAlias": "heroku",
|
|
1353
|
-
"pluginName": "heroku",
|
|
1354
|
-
"pluginType": "core",
|
|
1355
|
-
"strict": true,
|
|
1356
|
-
"example": "heroku accounts:set my-account",
|
|
1357
|
-
"isESM": false,
|
|
1358
|
-
"relativePath": [
|
|
1359
|
-
"lib",
|
|
1360
|
-
"commands",
|
|
1361
|
-
"accounts",
|
|
1362
|
-
"set.js"
|
|
1363
|
-
]
|
|
1364
|
-
},
|
|
1365
1365
|
"apps:create": {
|
|
1366
1366
|
"aliases": [],
|
|
1367
1367
|
"args": {
|
|
@@ -9399,6 +9399,12 @@
|
|
|
9399
9399
|
"hasDynamicHelp": false,
|
|
9400
9400
|
"multiple": false,
|
|
9401
9401
|
"type": "option"
|
|
9402
|
+
},
|
|
9403
|
+
"no-launcher": {
|
|
9404
|
+
"description": "don’t prepend ‘launcher’ before a command",
|
|
9405
|
+
"name": "no-launcher",
|
|
9406
|
+
"allowNo": false,
|
|
9407
|
+
"type": "boolean"
|
|
9402
9408
|
}
|
|
9403
9409
|
},
|
|
9404
9410
|
"hasDynamicHelp": false,
|
|
@@ -9419,7 +9425,7 @@
|
|
|
9419
9425
|
"run": {
|
|
9420
9426
|
"aliases": [],
|
|
9421
9427
|
"args": {},
|
|
9422
|
-
"description": "run a one-off process inside a heroku dyno\nShows a notification if the dyno takes more than 20 seconds to start.",
|
|
9428
|
+
"description": "run a one-off process inside a heroku dyno\nShows a notification if the dyno takes more than 20 seconds to start.\nHeroku automatically prepends ‘launcher’ to the command on CNB apps (use --no-launcher to disable).",
|
|
9423
9429
|
"examples": [
|
|
9424
9430
|
"$ heroku run bash",
|
|
9425
9431
|
"$ heroku run -s standard-2x -- myscript.sh -a arg1 -s arg2"
|
|
@@ -9490,6 +9496,12 @@
|
|
|
9490
9496
|
"name": "no-notify",
|
|
9491
9497
|
"allowNo": false,
|
|
9492
9498
|
"type": "boolean"
|
|
9499
|
+
},
|
|
9500
|
+
"no-launcher": {
|
|
9501
|
+
"description": "don’t prepend ‘launcher’ before a command",
|
|
9502
|
+
"name": "no-launcher",
|
|
9503
|
+
"allowNo": false,
|
|
9504
|
+
"type": "boolean"
|
|
9493
9505
|
}
|
|
9494
9506
|
},
|
|
9495
9507
|
"hasDynamicHelp": false,
|
|
@@ -15007,5 +15019,5 @@
|
|
|
15007
15019
|
]
|
|
15008
15020
|
}
|
|
15009
15021
|
},
|
|
15010
|
-
"version": "10.13.
|
|
15022
|
+
"version": "10.13.3-beta.0"
|
|
15011
15023
|
}
|
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.13.
|
|
4
|
+
"version": "10.13.3-beta.0",
|
|
5
5
|
"author": "Heroku",
|
|
6
6
|
"bin": "./bin/run",
|
|
7
7
|
"bugs": "https://github.com/heroku/cli/issues",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"@heroku-cli/schema": "^1.0.25",
|
|
14
14
|
"@heroku/buildpack-registry": "^1.0.1",
|
|
15
15
|
"@heroku/eventsource": "^1.0.7",
|
|
16
|
-
"@heroku/heroku-cli-util": "^9.
|
|
16
|
+
"@heroku/heroku-cli-util": "^9.1.3",
|
|
17
17
|
"@heroku/http-call": "^5.5.0",
|
|
18
18
|
"@heroku/mcp-server": "1.0.7-alpha.1",
|
|
19
19
|
"@heroku/plugin-ai": "^1.0.1",
|
|
@@ -36,7 +36,6 @@
|
|
|
36
36
|
"@opentelemetry/sdk-trace-node": "^1.15.1",
|
|
37
37
|
"@opentelemetry/semantic-conventions": "^1.24.1",
|
|
38
38
|
"@types/js-yaml": "^3.12.5",
|
|
39
|
-
"@types/tunnel-ssh": "4.1.1",
|
|
40
39
|
"ansi-escapes": "3.2.0",
|
|
41
40
|
"async-file": "^2.0.2",
|
|
42
41
|
"bytes": "^3.1.2",
|
|
@@ -62,7 +61,7 @@
|
|
|
62
61
|
"printf": "0.6.1",
|
|
63
62
|
"psl": "^1.9.0",
|
|
64
63
|
"redis-parser": "^3.0.0",
|
|
65
|
-
"rollbar": "^2.26.
|
|
64
|
+
"rollbar": "^2.26.4",
|
|
66
65
|
"semver": "7.6.1",
|
|
67
66
|
"shell-escape": "^0.2.0",
|
|
68
67
|
"shell-quote": "^1.8.1",
|
|
@@ -76,7 +75,6 @@
|
|
|
76
75
|
"true-myth": "2.2.3",
|
|
77
76
|
"tsheredoc": "^1.0.1",
|
|
78
77
|
"tslib": "1.14.1",
|
|
79
|
-
"tunnel-ssh": "4.1.6",
|
|
80
78
|
"urijs": "^1.19.11",
|
|
81
79
|
"validator": "^13.7.0",
|
|
82
80
|
"word-wrap": "^1.2.5",
|
|
@@ -400,5 +398,5 @@
|
|
|
400
398
|
"version": "oclif readme --multi && git add README.md ../../docs"
|
|
401
399
|
},
|
|
402
400
|
"types": "lib/index.d.ts",
|
|
403
|
-
"gitHead": "
|
|
401
|
+
"gitHead": "ab7b708ba071c64166847e53632d8fe71f3ea39a"
|
|
404
402
|
}
|
package/lib/lib/pg/bastion.d.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
/// <reference types="node" />
|
|
3
|
-
import { APIClient } from '@heroku-cli/command';
|
|
4
|
-
import * as createTunnel from 'tunnel-ssh';
|
|
5
|
-
import { ConnectionDetails } from './util';
|
|
6
|
-
export declare const getBastion: (config: Record<string, string>, baseName: string) => {
|
|
7
|
-
bastionHost: string;
|
|
8
|
-
bastionKey: string;
|
|
9
|
-
} | {
|
|
10
|
-
bastionHost?: undefined;
|
|
11
|
-
bastionKey?: undefined;
|
|
12
|
-
};
|
|
13
|
-
export declare const env: (db: ConnectionDetails) => {
|
|
14
|
-
PGAPPNAME: string;
|
|
15
|
-
PGSSLMODE: string;
|
|
16
|
-
} & NodeJS.ProcessEnv;
|
|
17
|
-
export declare type TunnelConfig = createTunnel.Config;
|
|
18
|
-
export declare function tunnelConfig(db: ConnectionDetails): TunnelConfig;
|
|
19
|
-
export declare function getConfigs(db: ConnectionDetails): {
|
|
20
|
-
dbEnv: NodeJS.ProcessEnv;
|
|
21
|
-
dbTunnelConfig: createTunnel.Config;
|
|
22
|
-
};
|
|
23
|
-
export declare function sshTunnel(db: ConnectionDetails, dbTunnelConfig: TunnelConfig, timeout?: number): Promise<void | import("net").Server | null>;
|
|
24
|
-
export declare function fetchConfig(heroku: APIClient, db: {
|
|
25
|
-
id: string;
|
|
26
|
-
}): Promise<import("@heroku/http-call").HTTP<{
|
|
27
|
-
host: string;
|
|
28
|
-
private_key: string;
|
|
29
|
-
}>>;
|
package/lib/lib/pg/bastion.js
DELETED
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.fetchConfig = exports.sshTunnel = exports.getConfigs = exports.tunnelConfig = exports.env = exports.getBastion = void 0;
|
|
4
|
-
const debug = require('debug')('pg');
|
|
5
|
-
const EventEmitter = require("node:events");
|
|
6
|
-
const createTunnel = require("tunnel-ssh");
|
|
7
|
-
const util_1 = require("util");
|
|
8
|
-
const host_1 = require("./host");
|
|
9
|
-
const core_1 = require("@oclif/core");
|
|
10
|
-
const getBastion = function (config, baseName) {
|
|
11
|
-
// If there are bastions, extract a host and a key
|
|
12
|
-
// otherwise, return an empty Object
|
|
13
|
-
// If there are bastions:
|
|
14
|
-
// * there should be one *_BASTION_KEY
|
|
15
|
-
// * pick one host from the comma-separated list in *_BASTIONS
|
|
16
|
-
// We assert that _BASTIONS and _BASTION_KEY always exist together
|
|
17
|
-
// If either is falsy, pretend neither exist
|
|
18
|
-
const bastionKey = config[`${baseName}_BASTION_KEY`];
|
|
19
|
-
const bastions = (config[`${baseName}_BASTIONS`] || '').split(',');
|
|
20
|
-
const bastionHost = bastions[Math.floor(Math.random() * bastions.length)];
|
|
21
|
-
return (bastionKey && bastionHost) ? { bastionHost, bastionKey } : {};
|
|
22
|
-
};
|
|
23
|
-
exports.getBastion = getBastion;
|
|
24
|
-
const env = (db) => {
|
|
25
|
-
const baseEnv = Object.assign({
|
|
26
|
-
PGAPPNAME: 'psql non-interactive',
|
|
27
|
-
PGSSLMODE: (!db.host || db.host === 'localhost') ? 'prefer' : 'require',
|
|
28
|
-
}, process.env);
|
|
29
|
-
const mapping = {
|
|
30
|
-
PGUSER: 'user',
|
|
31
|
-
PGPASSWORD: 'password',
|
|
32
|
-
PGDATABASE: 'database',
|
|
33
|
-
PGPORT: 'port',
|
|
34
|
-
PGHOST: 'host',
|
|
35
|
-
};
|
|
36
|
-
Object.keys(mapping).forEach(envVar => {
|
|
37
|
-
const val = db[mapping[envVar]];
|
|
38
|
-
if (val) {
|
|
39
|
-
baseEnv[envVar] = val;
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
return baseEnv;
|
|
43
|
-
};
|
|
44
|
-
exports.env = env;
|
|
45
|
-
function tunnelConfig(db) {
|
|
46
|
-
const localHost = '127.0.0.1';
|
|
47
|
-
const localPort = Math.floor((Math.random() * (65535 - 49152)) + 49152);
|
|
48
|
-
return {
|
|
49
|
-
username: 'bastion',
|
|
50
|
-
host: db.bastionHost,
|
|
51
|
-
privateKey: db.bastionKey,
|
|
52
|
-
dstHost: db.host || undefined,
|
|
53
|
-
dstPort: (db.port && Number.parseInt(db.port, 10)) || undefined,
|
|
54
|
-
localHost,
|
|
55
|
-
localPort,
|
|
56
|
-
};
|
|
57
|
-
}
|
|
58
|
-
exports.tunnelConfig = tunnelConfig;
|
|
59
|
-
function getConfigs(db) {
|
|
60
|
-
const dbEnv = (0, exports.env)(db);
|
|
61
|
-
const dbTunnelConfig = tunnelConfig(db);
|
|
62
|
-
if (db.bastionKey) {
|
|
63
|
-
Object.assign(dbEnv, {
|
|
64
|
-
PGPORT: dbTunnelConfig.localPort,
|
|
65
|
-
PGHOST: dbTunnelConfig.localHost,
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
return {
|
|
69
|
-
dbEnv,
|
|
70
|
-
dbTunnelConfig,
|
|
71
|
-
};
|
|
72
|
-
}
|
|
73
|
-
exports.getConfigs = getConfigs;
|
|
74
|
-
class Timeout {
|
|
75
|
-
constructor(timeout, message) {
|
|
76
|
-
this.events = new EventEmitter();
|
|
77
|
-
this.timeout = timeout;
|
|
78
|
-
this.message = message;
|
|
79
|
-
}
|
|
80
|
-
async promise() {
|
|
81
|
-
this.timer = setTimeout(() => {
|
|
82
|
-
this.events.emit('error', new Error(this.message));
|
|
83
|
-
}, this.timeout);
|
|
84
|
-
try {
|
|
85
|
-
await EventEmitter.once(this.events, 'cancelled');
|
|
86
|
-
}
|
|
87
|
-
finally {
|
|
88
|
-
clearTimeout(this.timer);
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
cancel() {
|
|
92
|
-
this.events.emit('cancelled');
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
async function sshTunnel(db, dbTunnelConfig, timeout = 10000) {
|
|
96
|
-
if (!db.bastionKey) {
|
|
97
|
-
return null;
|
|
98
|
-
}
|
|
99
|
-
const timeoutInstance = new Timeout(timeout, 'Establishing a secure tunnel timed out');
|
|
100
|
-
const createSSHTunnel = (0, util_1.promisify)(createTunnel);
|
|
101
|
-
try {
|
|
102
|
-
return await Promise.race([
|
|
103
|
-
timeoutInstance.promise(),
|
|
104
|
-
createSSHTunnel(dbTunnelConfig),
|
|
105
|
-
]);
|
|
106
|
-
}
|
|
107
|
-
catch (error) {
|
|
108
|
-
debug(error);
|
|
109
|
-
core_1.ux.error('Unable to establish a secure tunnel to your database.');
|
|
110
|
-
}
|
|
111
|
-
finally {
|
|
112
|
-
timeoutInstance.cancel();
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
exports.sshTunnel = sshTunnel;
|
|
116
|
-
async function fetchConfig(heroku, db) {
|
|
117
|
-
return heroku.get(`/client/v11/databases/${encodeURIComponent(db.id)}/bastion`, {
|
|
118
|
-
hostname: (0, host_1.default)(),
|
|
119
|
-
});
|
|
120
|
-
}
|
|
121
|
-
exports.fetchConfig = fetchConfig;
|
package/lib/lib/pg/config.d.ts
DELETED
package/lib/lib/pg/config.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getConfig = void 0;
|
|
4
|
-
const responseByAppId = new Map();
|
|
5
|
-
async function getConfig(heroku, app) {
|
|
6
|
-
if (!responseByAppId.has(app)) {
|
|
7
|
-
const promise = heroku.get(`/apps/${app}/config-vars`);
|
|
8
|
-
responseByAppId.set(app, promise);
|
|
9
|
-
}
|
|
10
|
-
const result = await responseByAppId.get(app);
|
|
11
|
-
return result === null || result === void 0 ? void 0 : result.body;
|
|
12
|
-
}
|
|
13
|
-
exports.getConfig = getConfig;
|
package/lib/lib/pg/host.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function (): string;
|