@heroku-cli/plugin-data 1.3.2 → 2.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/LICENSE +1 -1
- package/README.md +197 -107
- package/lib/commands/data/connectors/create.d.ts +8 -9
- package/lib/commands/data/connectors/create.js +52 -49
- package/lib/commands/data/connectors/destroy.d.ts +5 -6
- package/lib/commands/data/connectors/destroy.js +22 -24
- package/lib/commands/data/connectors/index.d.ts +6 -7
- package/lib/commands/data/connectors/index.js +38 -38
- package/lib/commands/data/connectors/info.d.ts +4 -4
- package/lib/commands/data/connectors/info.js +31 -32
- package/lib/commands/data/connectors/pause.d.ts +3 -3
- package/lib/commands/data/connectors/pause.js +16 -15
- package/lib/commands/data/connectors/resume.d.ts +3 -3
- package/lib/commands/data/connectors/resume.js +16 -15
- package/lib/commands/data/connectors/update.d.ts +9 -9
- package/lib/commands/data/connectors/update.js +60 -57
- package/lib/commands/data/connectors/wait.d.ts +3 -3
- package/lib/commands/data/connectors/wait.js +13 -13
- package/lib/commands/data/enhanced-certificates/disable.d.ts +4 -5
- package/lib/commands/data/enhanced-certificates/disable.js +16 -11
- package/lib/commands/data/enhanced-certificates/enable.d.ts +4 -5
- package/lib/commands/data/enhanced-certificates/enable.js +19 -14
- package/lib/commands/data/enhanced-certificates/status.d.ts +5 -6
- package/lib/commands/data/enhanced-certificates/status.js +14 -12
- package/lib/commands/data/labs/disable.d.ts +5 -6
- package/lib/commands/data/labs/disable.js +28 -20
- package/lib/commands/data/labs/enable.d.ts +5 -6
- package/lib/commands/data/labs/enable.js +28 -20
- package/lib/commands/data/labs/list.d.ts +14 -6
- package/lib/commands/data/labs/list.js +18 -16
- package/lib/fetcher.d.ts +1 -1
- package/lib/fetcher.js +5 -10
- package/lib/lib/base.d.ts +5 -5
- package/lib/lib/base.js +10 -7
- package/lib/tsconfig.tsbuildinfo +1 -0
- package/oclif.manifest.json +646 -1
- package/package.json +28 -30
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const
|
|
3
|
+
const core_1 = require("@oclif/core");
|
|
4
4
|
const base_1 = require("../../../lib/base");
|
|
5
5
|
class ConnectorsWait extends base_1.default {
|
|
6
|
+
static args = {
|
|
7
|
+
connector: core_1.Args.string({ description: 'name of the connector', required: true }),
|
|
8
|
+
};
|
|
9
|
+
static description = 'Wait for your Data Connector to be provisioned\nRead more about this feature at https://devcenter.heroku.com/articles/heroku-data-connectors';
|
|
10
|
+
static examples = [
|
|
11
|
+
'$ heroku data:connectors:wait gentle-connector-1234',
|
|
12
|
+
];
|
|
6
13
|
async run() {
|
|
7
|
-
const { args } = this.parse(ConnectorsWait);
|
|
8
|
-
const connector = args
|
|
14
|
+
const { args } = await this.parse(ConnectorsWait);
|
|
15
|
+
const { connector } = args;
|
|
9
16
|
let status;
|
|
10
|
-
|
|
17
|
+
core_1.ux.action.start('Waiting for the Data Connector to be provisioned');
|
|
11
18
|
/* eslint-disable no-await-in-loop */
|
|
12
19
|
while (status !== 'available') {
|
|
13
20
|
const { body: res } = await this.shogun.get(`/data/cdc/v0/connectors/${connector}`, this.shogun.defaults);
|
|
14
21
|
status = res.status;
|
|
15
|
-
await
|
|
22
|
+
await core_1.ux.wait(10_000);
|
|
16
23
|
}
|
|
17
|
-
|
|
24
|
+
core_1.ux.action.stop();
|
|
18
25
|
}
|
|
19
26
|
}
|
|
20
27
|
exports.default = ConnectorsWait;
|
|
21
|
-
ConnectorsWait.description = 'Wait for your Data Connector to be provisioned\nRead more about this feature at https://devcenter.heroku.com/articles/heroku-data-connectors';
|
|
22
|
-
ConnectorsWait.args = [
|
|
23
|
-
{ name: 'connector' },
|
|
24
|
-
];
|
|
25
|
-
ConnectorsWait.examples = [
|
|
26
|
-
'$ heroku data:connectors:wait gentle-connector-1234',
|
|
27
|
-
];
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import { flags } from '@heroku-cli/command';
|
|
2
1
|
import BaseCommand from '../../../lib/base';
|
|
3
2
|
export default class DataEnhancedCertificatesDisable extends BaseCommand {
|
|
3
|
+
static args: {
|
|
4
|
+
addon: import("@oclif/core/lib/interfaces/parser").Arg<string, Record<string, unknown>>;
|
|
5
|
+
};
|
|
4
6
|
static description: string;
|
|
5
7
|
static flags: {
|
|
6
|
-
app:
|
|
8
|
+
app: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
7
9
|
};
|
|
8
|
-
static args: {
|
|
9
|
-
name: string;
|
|
10
|
-
}[];
|
|
11
10
|
run(): Promise<void>;
|
|
12
11
|
}
|
|
@@ -1,26 +1,31 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const command_1 = require("@heroku-cli/command");
|
|
4
|
-
const
|
|
4
|
+
const core_1 = require("@oclif/core");
|
|
5
5
|
const fetcher_1 = require("../../../fetcher");
|
|
6
6
|
const base_1 = require("../../../lib/base");
|
|
7
7
|
class DataEnhancedCertificatesDisable extends base_1.default {
|
|
8
|
+
static args = {
|
|
9
|
+
addon: core_1.Args.string({ description: 'name of the addon', required: true }),
|
|
10
|
+
};
|
|
11
|
+
static description = 'Disable enhanced certificates on an Addon\nRead more about this feature at https://devcenter.heroku.com/articles/heroku-data-enhanced-certificates';
|
|
12
|
+
static flags = {
|
|
13
|
+
app: command_1.flags.app(),
|
|
14
|
+
};
|
|
8
15
|
async run() {
|
|
9
|
-
const { args, flags } = this.parse(DataEnhancedCertificatesDisable);
|
|
16
|
+
const { args, flags } = await this.parse(DataEnhancedCertificatesDisable);
|
|
10
17
|
const addon = await (0, fetcher_1.fetchAddon)(this.heroku, args.addon, flags.app);
|
|
11
|
-
|
|
18
|
+
core_1.ux.action.start(`Disabling Enhanced Certificates Beta on ${addon.name}`);
|
|
12
19
|
try {
|
|
13
|
-
await this.shogun.put(`/client/v11/enhanced_certificates/${addon.id}/disable`,
|
|
20
|
+
await this.shogun.put(`/client/v11/enhanced_certificates/${addon.id}/disable`, {
|
|
21
|
+
...this.shogun.defaults,
|
|
22
|
+
raw: true,
|
|
23
|
+
});
|
|
14
24
|
}
|
|
15
25
|
catch (error) {
|
|
16
|
-
|
|
26
|
+
core_1.ux.error(error);
|
|
17
27
|
}
|
|
18
|
-
|
|
28
|
+
core_1.ux.action.stop();
|
|
19
29
|
}
|
|
20
30
|
}
|
|
21
31
|
exports.default = DataEnhancedCertificatesDisable;
|
|
22
|
-
DataEnhancedCertificatesDisable.description = 'Disable enhanced certificates on an Addon\nRead more about this feature at https://devcenter.heroku.com/articles/heroku-data-enhanced-certificates';
|
|
23
|
-
DataEnhancedCertificatesDisable.flags = {
|
|
24
|
-
app: command_1.flags.app(),
|
|
25
|
-
};
|
|
26
|
-
DataEnhancedCertificatesDisable.args = [{ name: 'addon' }];
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import { flags } from '@heroku-cli/command';
|
|
2
1
|
import BaseCommand from '../../../lib/base';
|
|
3
2
|
export default class DataEnhancedCertificatesEnable extends BaseCommand {
|
|
3
|
+
static args: {
|
|
4
|
+
addon: import("@oclif/core/lib/interfaces/parser").Arg<string, Record<string, unknown>>;
|
|
5
|
+
};
|
|
4
6
|
static description: string;
|
|
5
7
|
static examples: string[];
|
|
6
8
|
static flags: {
|
|
7
|
-
app:
|
|
9
|
+
app: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
8
10
|
};
|
|
9
|
-
static args: {
|
|
10
|
-
name: string;
|
|
11
|
-
}[];
|
|
12
11
|
run(): Promise<void>;
|
|
13
12
|
}
|
|
@@ -1,29 +1,34 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const command_1 = require("@heroku-cli/command");
|
|
4
|
-
const
|
|
4
|
+
const core_1 = require("@oclif/core");
|
|
5
5
|
const fetcher_1 = require("../../../fetcher");
|
|
6
6
|
const base_1 = require("../../../lib/base");
|
|
7
7
|
class DataEnhancedCertificatesEnable extends base_1.default {
|
|
8
|
+
static args = {
|
|
9
|
+
addon: core_1.Args.string({ description: 'name of the addon', required: true }),
|
|
10
|
+
};
|
|
11
|
+
static description = 'Enable enhanced certificates on an Addon\nRead more about this feature at https://devcenter.heroku.com/articles/heroku-data-enhanced-certificates';
|
|
12
|
+
static examples = [
|
|
13
|
+
'$ heroku data:enhanced-certificates:enable happy-postgres-1234 -a example-app',
|
|
14
|
+
];
|
|
15
|
+
static flags = {
|
|
16
|
+
app: command_1.flags.app(),
|
|
17
|
+
};
|
|
8
18
|
async run() {
|
|
9
|
-
const { args, flags } = this.parse(DataEnhancedCertificatesEnable);
|
|
19
|
+
const { args, flags } = await this.parse(DataEnhancedCertificatesEnable);
|
|
10
20
|
const addon = await (0, fetcher_1.fetchAddon)(this.heroku, args.addon, flags.app);
|
|
11
|
-
|
|
21
|
+
core_1.ux.action.start(`Enabling Enhanced Certificates Beta on ${addon.name}`);
|
|
12
22
|
try {
|
|
13
|
-
await this.shogun.put(`/client/v11/enhanced_certificates/${addon.id}/enable`,
|
|
23
|
+
await this.shogun.put(`/client/v11/enhanced_certificates/${addon.id}/enable`, {
|
|
24
|
+
...this.shogun.defaults,
|
|
25
|
+
raw: true,
|
|
26
|
+
});
|
|
14
27
|
}
|
|
15
28
|
catch (error) {
|
|
16
|
-
|
|
29
|
+
core_1.ux.error(error);
|
|
17
30
|
}
|
|
18
|
-
|
|
31
|
+
core_1.ux.action.stop();
|
|
19
32
|
}
|
|
20
33
|
}
|
|
21
34
|
exports.default = DataEnhancedCertificatesEnable;
|
|
22
|
-
DataEnhancedCertificatesEnable.description = 'Enable enhanced certificates on an Addon\nRead more about this feature at https://devcenter.heroku.com/articles/heroku-data-enhanced-certificates';
|
|
23
|
-
DataEnhancedCertificatesEnable.examples = [
|
|
24
|
-
'$ heroku data:enhanced-certificates:enable happy-postgres-1234 -a example-app',
|
|
25
|
-
];
|
|
26
|
-
DataEnhancedCertificatesEnable.flags = {
|
|
27
|
-
app: command_1.flags.app(),
|
|
28
|
-
};
|
|
29
|
-
DataEnhancedCertificatesEnable.args = [{ name: 'addon' }];
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import { flags } from '@heroku-cli/command';
|
|
2
1
|
import BaseCommand from '../../../lib/base';
|
|
3
2
|
export default class DataEnhancedCertificatesStatus extends BaseCommand {
|
|
3
|
+
static args: {
|
|
4
|
+
addon: import("@oclif/core/lib/interfaces/parser").Arg<string, Record<string, unknown>>;
|
|
5
|
+
};
|
|
4
6
|
static description: string;
|
|
5
7
|
static flags: {
|
|
6
|
-
app:
|
|
7
|
-
json: import("@oclif/
|
|
8
|
+
app: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
9
|
+
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
8
10
|
};
|
|
9
|
-
static args: {
|
|
10
|
-
name: string;
|
|
11
|
-
}[];
|
|
12
11
|
run(): Promise<void>;
|
|
13
12
|
}
|
|
@@ -1,29 +1,31 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const command_1 = require("@heroku-cli/command");
|
|
4
3
|
const color_1 = require("@heroku-cli/color");
|
|
5
|
-
const
|
|
4
|
+
const command_1 = require("@heroku-cli/command");
|
|
5
|
+
const core_1 = require("@oclif/core");
|
|
6
6
|
const fetcher_1 = require("../../../fetcher");
|
|
7
7
|
const base_1 = require("../../../lib/base");
|
|
8
8
|
class DataEnhancedCertificatesStatus extends base_1.default {
|
|
9
|
+
static args = {
|
|
10
|
+
addon: core_1.Args.string({ description: 'name of the addon', required: true }),
|
|
11
|
+
};
|
|
12
|
+
static description = 'Get the status of Enhanced Certificates\nRead more about this feature at https://devcenter.heroku.com/articles/heroku-data-enhanced-certificates';
|
|
13
|
+
static flags = {
|
|
14
|
+
app: command_1.flags.app(),
|
|
15
|
+
json: command_1.flags.boolean({ description: 'Return the results as JSON' }),
|
|
16
|
+
};
|
|
9
17
|
async run() {
|
|
10
|
-
const { args, flags } = this.parse(DataEnhancedCertificatesStatus);
|
|
18
|
+
const { args, flags } = await this.parse(DataEnhancedCertificatesStatus);
|
|
11
19
|
const addon = await (0, fetcher_1.fetchAddon)(this.heroku, args.addon, flags.app);
|
|
12
20
|
const { body: res } = await this.shogun.get(`/client/v11/enhanced_certificates/${addon.id}/status`, this.shogun.defaults);
|
|
13
21
|
if (flags.json) {
|
|
14
|
-
|
|
22
|
+
core_1.ux.styledJSON(res);
|
|
15
23
|
return;
|
|
16
24
|
}
|
|
17
|
-
|
|
18
|
-
|
|
25
|
+
core_1.ux.styledHeader(`Enhanced Certificates for ${color_1.default.cyan(addon.name)}.`);
|
|
26
|
+
core_1.ux.styledObject({
|
|
19
27
|
Status: res.status,
|
|
20
28
|
});
|
|
21
29
|
}
|
|
22
30
|
}
|
|
23
31
|
exports.default = DataEnhancedCertificatesStatus;
|
|
24
|
-
DataEnhancedCertificatesStatus.description = 'Get the status of Enhanced Certificates\nRead more about this feature at https://devcenter.heroku.com/articles/heroku-data-enhanced-certificates';
|
|
25
|
-
DataEnhancedCertificatesStatus.flags = {
|
|
26
|
-
app: command_1.flags.app(),
|
|
27
|
-
json: command_1.flags.boolean({ description: 'Return the results as JSON' }),
|
|
28
|
-
};
|
|
29
|
-
DataEnhancedCertificatesStatus.args = [{ name: 'addon' }];
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import { flags } from '@heroku-cli/command';
|
|
2
1
|
import BaseCommand from '../../../lib/base';
|
|
3
2
|
export default class LabsDisable extends BaseCommand {
|
|
3
|
+
static args: {
|
|
4
|
+
feature: import("@oclif/core/lib/interfaces/parser").Arg<string, Record<string, unknown>>;
|
|
5
|
+
};
|
|
4
6
|
static description: string;
|
|
5
7
|
static examples: string[];
|
|
6
|
-
static args: {
|
|
7
|
-
name: string;
|
|
8
|
-
}[];
|
|
9
8
|
static flags: {
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
addon: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
10
|
+
app: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
12
11
|
};
|
|
13
12
|
run(): Promise<void>;
|
|
14
13
|
}
|
|
@@ -1,36 +1,44 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const command_1 = require("@heroku-cli/command");
|
|
4
3
|
const color_1 = require("@heroku-cli/color");
|
|
5
|
-
const
|
|
4
|
+
const command_1 = require("@heroku-cli/command");
|
|
5
|
+
const core_1 = require("@oclif/core");
|
|
6
6
|
const fetcher_1 = require("../../../fetcher");
|
|
7
7
|
const base_1 = require("../../../lib/base");
|
|
8
8
|
class LabsDisable extends base_1.default {
|
|
9
|
+
static args = {
|
|
10
|
+
feature: core_1.Args.string({ description: 'name of the feature', required: true }),
|
|
11
|
+
};
|
|
12
|
+
static description = 'Disable experimental features on an addon';
|
|
13
|
+
static examples = [
|
|
14
|
+
'$ heroku data:labs:disable wal-compression --addon=happy-postgres-1234 -a example-app',
|
|
15
|
+
];
|
|
16
|
+
static flags = {
|
|
17
|
+
addon: command_1.flags.string({
|
|
18
|
+
description: 'The addon you want to disable features on',
|
|
19
|
+
required: true,
|
|
20
|
+
}),
|
|
21
|
+
app: command_1.flags.app(),
|
|
22
|
+
};
|
|
9
23
|
async run() {
|
|
10
|
-
const { args, flags } = this.parse(LabsDisable);
|
|
24
|
+
const { args, flags } = await this.parse(LabsDisable);
|
|
11
25
|
const addon = await (0, fetcher_1.fetchAddon)(this.heroku, flags.addon, flags.app);
|
|
12
|
-
|
|
26
|
+
core_1.ux.action.start(`Disabling ${args.feature} on ${color_1.default.cyan(addon.name)}...`);
|
|
13
27
|
try {
|
|
14
|
-
await this.shogun.put(`/client/v11/labs/${addon.id}/disable`,
|
|
28
|
+
await this.shogun.put(`/client/v11/labs/${addon.id}/disable`, {
|
|
29
|
+
...this.shogun.defaults,
|
|
30
|
+
body: {
|
|
15
31
|
feature: args.feature,
|
|
16
|
-
}
|
|
32
|
+
},
|
|
33
|
+
raw: true,
|
|
34
|
+
});
|
|
17
35
|
}
|
|
18
36
|
catch (error) {
|
|
19
|
-
|
|
37
|
+
core_1.ux.error(error);
|
|
38
|
+
}
|
|
39
|
+
finally {
|
|
40
|
+
core_1.ux.action.stop();
|
|
20
41
|
}
|
|
21
|
-
cli_ux_1.cli.action.stop();
|
|
22
42
|
}
|
|
23
43
|
}
|
|
24
44
|
exports.default = LabsDisable;
|
|
25
|
-
LabsDisable.description = 'Disable experimental features on an addon';
|
|
26
|
-
LabsDisable.examples = [
|
|
27
|
-
'$ heroku data:labs:disable wal-compression --addon=happy-postgres-1234 -a example-app',
|
|
28
|
-
];
|
|
29
|
-
LabsDisable.args = [{ name: 'feature' }];
|
|
30
|
-
LabsDisable.flags = {
|
|
31
|
-
app: command_1.flags.app(),
|
|
32
|
-
addon: command_1.flags.string({
|
|
33
|
-
description: 'The addon you want to disable features on',
|
|
34
|
-
required: true,
|
|
35
|
-
}),
|
|
36
|
-
};
|
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import { flags } from '@heroku-cli/command';
|
|
2
1
|
import BaseCommand from '../../../lib/base';
|
|
3
2
|
export default class LabsEnable extends BaseCommand {
|
|
3
|
+
static args: {
|
|
4
|
+
feature: import("@oclif/core/lib/interfaces/parser").Arg<string, Record<string, unknown>>;
|
|
5
|
+
};
|
|
4
6
|
static description: string;
|
|
5
7
|
static examples: string[];
|
|
6
|
-
static args: {
|
|
7
|
-
name: string;
|
|
8
|
-
}[];
|
|
9
8
|
static flags: {
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
addon: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
10
|
+
app: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
12
11
|
};
|
|
13
12
|
run(): Promise<void>;
|
|
14
13
|
}
|
|
@@ -1,36 +1,44 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const command_1 = require("@heroku-cli/command");
|
|
4
3
|
const color_1 = require("@heroku-cli/color");
|
|
5
|
-
const
|
|
4
|
+
const command_1 = require("@heroku-cli/command");
|
|
5
|
+
const core_1 = require("@oclif/core");
|
|
6
6
|
const fetcher_1 = require("../../../fetcher");
|
|
7
7
|
const base_1 = require("../../../lib/base");
|
|
8
8
|
class LabsEnable extends base_1.default {
|
|
9
|
+
static args = {
|
|
10
|
+
feature: core_1.Args.string({ description: 'name of the feature', required: true }),
|
|
11
|
+
};
|
|
12
|
+
static description = 'Enable experimental features on an addon';
|
|
13
|
+
static examples = [
|
|
14
|
+
'$ heroku data:labs:enable wal-compression --addon=happy-postgres-1234 -a example-app',
|
|
15
|
+
];
|
|
16
|
+
static flags = {
|
|
17
|
+
addon: command_1.flags.string({
|
|
18
|
+
description: 'The addon you want to enable features on',
|
|
19
|
+
required: true,
|
|
20
|
+
}),
|
|
21
|
+
app: command_1.flags.app(),
|
|
22
|
+
};
|
|
9
23
|
async run() {
|
|
10
|
-
const { args, flags } = this.parse(LabsEnable);
|
|
24
|
+
const { args, flags } = await this.parse(LabsEnable);
|
|
11
25
|
const addon = await (0, fetcher_1.fetchAddon)(this.heroku, flags.addon, flags.app);
|
|
12
|
-
|
|
26
|
+
core_1.ux.action.start(`Enabling ${args.feature} on ${color_1.default.cyan(addon.name)}...`);
|
|
13
27
|
try {
|
|
14
|
-
await this.shogun.put(`/client/v11/labs/${addon.id}/enable`,
|
|
28
|
+
await this.shogun.put(`/client/v11/labs/${addon.id}/enable`, {
|
|
29
|
+
...this.shogun.defaults,
|
|
30
|
+
body: {
|
|
15
31
|
feature: args.feature,
|
|
16
|
-
}
|
|
32
|
+
},
|
|
33
|
+
raw: true,
|
|
34
|
+
});
|
|
17
35
|
}
|
|
18
36
|
catch (error) {
|
|
19
|
-
|
|
37
|
+
core_1.ux.error(error);
|
|
38
|
+
}
|
|
39
|
+
finally {
|
|
40
|
+
core_1.ux.action.stop();
|
|
20
41
|
}
|
|
21
|
-
cli_ux_1.cli.action.stop();
|
|
22
42
|
}
|
|
23
43
|
}
|
|
24
44
|
exports.default = LabsEnable;
|
|
25
|
-
LabsEnable.description = 'Enable experimental features on an addon';
|
|
26
|
-
LabsEnable.examples = [
|
|
27
|
-
'$ heroku data:labs:enable wal-compression --addon=happy-postgres-1234 -a example-app',
|
|
28
|
-
];
|
|
29
|
-
LabsEnable.args = [{ name: 'feature' }];
|
|
30
|
-
LabsEnable.flags = {
|
|
31
|
-
app: command_1.flags.app(),
|
|
32
|
-
addon: command_1.flags.string({
|
|
33
|
-
description: 'The addon you want to enable features on',
|
|
34
|
-
required: true,
|
|
35
|
-
}),
|
|
36
|
-
};
|
|
@@ -1,14 +1,22 @@
|
|
|
1
|
-
import { flags } from '@heroku-cli/command';
|
|
2
1
|
import BaseCommand from '../../../lib/base';
|
|
2
|
+
type DataLabsFeature = {
|
|
3
|
+
description: string;
|
|
4
|
+
name: string;
|
|
5
|
+
status: {
|
|
6
|
+
enabled: boolean;
|
|
7
|
+
message: string;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
3
10
|
export default class LabsList extends BaseCommand {
|
|
11
|
+
static args: {
|
|
12
|
+
addon: import("@oclif/core/lib/interfaces/parser").Arg<string, Record<string, unknown>>;
|
|
13
|
+
};
|
|
4
14
|
static description: string;
|
|
5
15
|
static examples: string[];
|
|
6
|
-
static args: {
|
|
7
|
-
name: string;
|
|
8
|
-
}[];
|
|
9
16
|
static flags: {
|
|
10
|
-
app:
|
|
17
|
+
app: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
11
18
|
};
|
|
12
|
-
printFeatures(features: Array<
|
|
19
|
+
printFeatures(features: Array<DataLabsFeature>, addonName: string): void;
|
|
13
20
|
run(): Promise<void>;
|
|
14
21
|
}
|
|
22
|
+
export {};
|
|
@@ -1,17 +1,27 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const command_1 = require("@heroku-cli/command");
|
|
4
3
|
const color_1 = require("@heroku-cli/color");
|
|
5
|
-
const
|
|
4
|
+
const command_1 = require("@heroku-cli/command");
|
|
5
|
+
const core_1 = require("@oclif/core");
|
|
6
6
|
const fetcher_1 = require("../../../fetcher");
|
|
7
7
|
const base_1 = require("../../../lib/base");
|
|
8
8
|
class LabsList extends base_1.default {
|
|
9
|
+
static args = {
|
|
10
|
+
addon: core_1.Args.string({ description: 'name of the addon', required: true }),
|
|
11
|
+
};
|
|
12
|
+
static description = 'List available experimental features on an addon and their statuses';
|
|
13
|
+
static examples = [
|
|
14
|
+
'$ heroku data:labs:list happy-postgres-1234',
|
|
15
|
+
];
|
|
16
|
+
static flags = {
|
|
17
|
+
app: command_1.flags.app(),
|
|
18
|
+
};
|
|
9
19
|
printFeatures(features, addonName) {
|
|
10
20
|
features.sort((a, b) => a.name < b.name ? -1 : 1);
|
|
11
21
|
const longest = Math.max.apply(null, features.map(f => f.name.length));
|
|
12
|
-
|
|
22
|
+
core_1.ux.styledHeader(`Experimental Features Available for ${color_1.default.cyan(addonName)}:`);
|
|
13
23
|
for (const f of features) {
|
|
14
|
-
const pref = f.status.enabled ? '[+]' : f.status.message ? '[-]' : '[ ]';
|
|
24
|
+
const pref = f.status.enabled ? '[+]' : (f.status.message ? '[-]' : '[ ]');
|
|
15
25
|
let line = `${pref} ${f.name.padEnd(longest)}`;
|
|
16
26
|
if (f.status.enabled)
|
|
17
27
|
line = color_1.default.green(line);
|
|
@@ -20,28 +30,20 @@ class LabsList extends base_1.default {
|
|
|
20
30
|
let statusMessage = f.status.message ? `(STATUS: ${f.status.message})` : '';
|
|
21
31
|
statusMessage = color_1.default.yellow(statusMessage);
|
|
22
32
|
line = `${line} ${statusMessage} ${f.description}`;
|
|
23
|
-
|
|
33
|
+
core_1.ux.log(line);
|
|
24
34
|
}
|
|
25
35
|
}
|
|
26
36
|
async run() {
|
|
27
|
-
const { args, flags } = this.parse(LabsList);
|
|
37
|
+
const { args, flags } = await this.parse(LabsList);
|
|
28
38
|
const addon = await (0, fetcher_1.fetchAddon)(this.heroku, args.addon, flags.app);
|
|
29
39
|
try {
|
|
30
40
|
const { body: res } = await this.shogun.get(`/client/v11/labs/${addon.id}/list`, this.shogun.defaults);
|
|
31
41
|
this.printFeatures(res.message, addon.name);
|
|
32
42
|
}
|
|
33
43
|
catch (error) {
|
|
34
|
-
|
|
44
|
+
core_1.ux.error(error);
|
|
35
45
|
}
|
|
36
|
-
|
|
46
|
+
core_1.ux.action.stop();
|
|
37
47
|
}
|
|
38
48
|
}
|
|
39
49
|
exports.default = LabsList;
|
|
40
|
-
LabsList.description = 'List available experimental features on an addon and their statuses';
|
|
41
|
-
LabsList.examples = [
|
|
42
|
-
'$ heroku data:labs:list happy-postgres-1234',
|
|
43
|
-
];
|
|
44
|
-
LabsList.args = [{ name: 'addon' }];
|
|
45
|
-
LabsList.flags = {
|
|
46
|
-
app: command_1.flags.app(),
|
|
47
|
-
};
|
package/lib/fetcher.d.ts
CHANGED
package/lib/fetcher.js
CHANGED
|
@@ -1,21 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.fetchAddon =
|
|
3
|
+
exports.fetchAddon = fetchAddon;
|
|
4
4
|
async function fetchAddon(heroku, addon, app) {
|
|
5
5
|
const { body: result } = await heroku.post('/actions/addons/resolve', {
|
|
6
6
|
body: {
|
|
7
|
-
app,
|
|
8
7
|
addon,
|
|
9
|
-
|
|
8
|
+
app,
|
|
9
|
+
},
|
|
10
10
|
});
|
|
11
11
|
if (result.length > 1) {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
else {
|
|
16
|
-
throw new Error('Unable to determine addon');
|
|
17
|
-
}
|
|
12
|
+
const error = app === undefined ? new Error('Unable to determine addon, try including an app') : new Error('Unable to determine addon');
|
|
13
|
+
throw error;
|
|
18
14
|
}
|
|
19
15
|
return result[0];
|
|
20
16
|
}
|
|
21
|
-
exports.fetchAddon = fetchAddon;
|
package/lib/lib/base.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { APIClient, Command } from '@heroku-cli/command';
|
|
2
|
-
import {
|
|
2
|
+
import { Config } from '@oclif/core';
|
|
3
3
|
export default abstract class Base extends Command {
|
|
4
4
|
shogun: APIClient;
|
|
5
|
-
constructor(argv: Array<string>, config:
|
|
5
|
+
constructor(argv: Array<string>, config: Config);
|
|
6
6
|
}
|
|
7
7
|
export interface PostgresConnector {
|
|
8
8
|
created_at: string;
|
|
@@ -14,8 +14,8 @@ export interface PostgresConnector {
|
|
|
14
14
|
kafka_app: {
|
|
15
15
|
name: string;
|
|
16
16
|
};
|
|
17
|
-
name: string;
|
|
18
17
|
lag: string;
|
|
18
|
+
name: string;
|
|
19
19
|
postgres_addon: {
|
|
20
20
|
name: string;
|
|
21
21
|
uuid: string;
|
|
@@ -23,7 +23,7 @@ export interface PostgresConnector {
|
|
|
23
23
|
postgres_app: {
|
|
24
24
|
name: string;
|
|
25
25
|
};
|
|
26
|
-
status: '
|
|
26
|
+
status: 'available' | 'creating';
|
|
27
27
|
tables: string[];
|
|
28
28
|
topics: {
|
|
29
29
|
table_name: string;
|
|
@@ -36,5 +36,5 @@ export interface EnhancedCertificate {
|
|
|
36
36
|
status: string;
|
|
37
37
|
}
|
|
38
38
|
export interface Labs {
|
|
39
|
-
message: Array<
|
|
39
|
+
message: Array<unknown>;
|
|
40
40
|
}
|
package/lib/lib/base.js
CHANGED
|
@@ -1,25 +1,28 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.confirmConnector =
|
|
4
|
-
const command_1 = require("@heroku-cli/command");
|
|
5
|
-
const cli_ux_1 = require("cli-ux");
|
|
3
|
+
exports.confirmConnector = confirmConnector;
|
|
6
4
|
const color_1 = require("@heroku-cli/color");
|
|
5
|
+
const command_1 = require("@heroku-cli/command");
|
|
6
|
+
const core_1 = require("@oclif/core");
|
|
7
7
|
class Base extends command_1.Command {
|
|
8
|
+
shogun;
|
|
8
9
|
constructor(argv, config) {
|
|
9
10
|
super(argv, config);
|
|
10
11
|
const client = new command_1.APIClient(this.config, {});
|
|
11
12
|
client.defaults.host = process.env.HEROKU_DATA_HOST || 'api.data.heroku.com';
|
|
12
|
-
client.defaults.headers =
|
|
13
|
+
client.defaults.headers = {
|
|
14
|
+
...this.heroku.defaults.headers,
|
|
15
|
+
authorization: `Basic ${Buffer.from(':' + this.heroku.auth).toString('base64')}`,
|
|
16
|
+
};
|
|
13
17
|
this.shogun = client;
|
|
14
18
|
}
|
|
15
19
|
}
|
|
16
20
|
exports.default = Base;
|
|
17
21
|
async function confirmConnector(connector, confirm) {
|
|
18
22
|
if (!confirm) {
|
|
19
|
-
confirm = await
|
|
23
|
+
confirm = await core_1.ux.prompt(`To proceed, type ${color_1.default.bold.red(connector)} or re-run this command with ${color_1.default.bold.red('--confirm', connector)}`);
|
|
20
24
|
}
|
|
21
25
|
if (confirm !== connector) {
|
|
22
|
-
|
|
26
|
+
core_1.ux.error(`Confirmation ${color_1.default.bold.red(confirm)} did not match ${color_1.default.bold.red(connector)}. Aborted.`);
|
|
23
27
|
}
|
|
24
28
|
}
|
|
25
|
-
exports.confirmConnector = confirmConnector;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"root":["../src/fetcher.ts","../src/index.ts","../src/commands/data/connectors/create.ts","../src/commands/data/connectors/destroy.ts","../src/commands/data/connectors/index.ts","../src/commands/data/connectors/info.ts","../src/commands/data/connectors/pause.ts","../src/commands/data/connectors/resume.ts","../src/commands/data/connectors/update.ts","../src/commands/data/connectors/wait.ts","../src/commands/data/enhanced-certificates/disable.ts","../src/commands/data/enhanced-certificates/enable.ts","../src/commands/data/enhanced-certificates/status.ts","../src/commands/data/labs/disable.ts","../src/commands/data/labs/enable.ts","../src/commands/data/labs/list.ts","../src/lib/base.ts"],"version":"5.8.2"}
|