@heroku-cli/plugin-data 2.0.0-beta.0 → 3.0.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/README.md +76 -31
- package/dist/commands/data/connectors/create.d.ts +15 -0
- package/{lib → dist}/commands/data/connectors/create.js +23 -25
- package/dist/commands/data/connectors/destroy.d.ts +12 -0
- package/dist/commands/data/connectors/destroy.js +39 -0
- package/dist/commands/data/connectors/index.d.ts +14 -0
- package/{lib → dist}/commands/data/connectors/index.js +23 -24
- package/dist/commands/data/connectors/info.d.ts +12 -0
- package/{lib → dist}/commands/data/connectors/info.js +22 -23
- package/{lib → dist}/commands/data/connectors/pause.d.ts +2 -2
- package/dist/commands/data/connectors/pause.js +27 -0
- package/{lib → dist}/commands/data/connectors/resume.d.ts +2 -2
- package/dist/commands/data/connectors/resume.js +27 -0
- package/dist/commands/data/connectors/update.d.ts +17 -0
- package/{lib → dist}/commands/data/connectors/update.js +19 -21
- package/{lib → dist}/commands/data/connectors/wait.d.ts +2 -2
- package/{lib → dist}/commands/data/connectors/wait.js +11 -10
- package/dist/commands/data/enhanced-certificates/disable.d.ts +11 -0
- package/dist/commands/data/enhanced-certificates/disable.js +31 -0
- package/dist/commands/data/enhanced-certificates/enable.d.ts +12 -0
- package/dist/commands/data/enhanced-certificates/enable.js +34 -0
- package/dist/commands/data/enhanced-certificates/status.d.ts +12 -0
- package/dist/commands/data/enhanced-certificates/status.js +30 -0
- package/dist/commands/data/labs/disable.d.ts +13 -0
- package/dist/commands/data/labs/disable.js +44 -0
- package/dist/commands/data/labs/enable.d.ts +13 -0
- package/dist/commands/data/labs/enable.js +44 -0
- package/{lib → dist}/commands/data/labs/list.d.ts +3 -3
- package/{lib → dist}/commands/data/labs/list.js +18 -19
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/lib/base.js +25 -0
- package/oclif.manifest.json +149 -48
- package/package.json +33 -29
- package/lib/commands/data/connectors/create.d.ts +0 -15
- package/lib/commands/data/connectors/destroy.d.ts +0 -12
- package/lib/commands/data/connectors/destroy.js +0 -41
- package/lib/commands/data/connectors/index.d.ts +0 -14
- package/lib/commands/data/connectors/info.d.ts +0 -12
- package/lib/commands/data/connectors/pause.js +0 -28
- package/lib/commands/data/connectors/resume.js +0 -28
- package/lib/commands/data/connectors/update.d.ts +0 -17
- package/lib/commands/data/enhanced-certificates/disable.d.ts +0 -11
- package/lib/commands/data/enhanced-certificates/disable.js +0 -31
- package/lib/commands/data/enhanced-certificates/enable.d.ts +0 -12
- package/lib/commands/data/enhanced-certificates/enable.js +0 -34
- package/lib/commands/data/enhanced-certificates/status.d.ts +0 -12
- package/lib/commands/data/enhanced-certificates/status.js +0 -31
- package/lib/commands/data/labs/disable.d.ts +0 -13
- package/lib/commands/data/labs/disable.js +0 -44
- package/lib/commands/data/labs/enable.d.ts +0 -13
- package/lib/commands/data/labs/enable.js +0 -44
- package/lib/fetcher.d.ts +0 -3
- package/lib/fetcher.js +0 -16
- package/lib/index.d.ts +0 -2
- package/lib/index.js +0 -3
- package/lib/lib/base.js +0 -28
- package/lib/tsconfig.tsbuildinfo +0 -1
- /package/{lib → dist}/lib/base.d.ts +0 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import BaseCommand from '../../../lib/base.js';
|
|
2
|
+
export default class ConnectorsInfo extends BaseCommand {
|
|
3
|
+
static args: {
|
|
4
|
+
connector: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
5
|
+
};
|
|
6
|
+
static description: string;
|
|
7
|
+
static examples: string[];
|
|
8
|
+
static flags: {
|
|
9
|
+
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
10
|
+
};
|
|
11
|
+
run(): Promise<void>;
|
|
12
|
+
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
class ConnectorsInfo extends
|
|
1
|
+
import { flags } from '@heroku-cli/command';
|
|
2
|
+
import * as color from '@heroku/heroku-cli-util/color';
|
|
3
|
+
import { styledHeader, styledJSON, styledObject, table } from '@heroku/heroku-cli-util/hux';
|
|
4
|
+
import { Args } from '@oclif/core';
|
|
5
|
+
import { ux } from '@oclif/core/ux';
|
|
6
|
+
import BaseCommand from '../../../lib/base.js';
|
|
7
|
+
export default class ConnectorsInfo extends BaseCommand {
|
|
8
8
|
static args = {
|
|
9
|
-
connector:
|
|
9
|
+
connector: Args.string({ description: 'name of the connector', required: true }),
|
|
10
10
|
};
|
|
11
11
|
static description = 'Get information about a Data Connector\nRead more about this feature at https://devcenter.heroku.com/articles/heroku-data-connectors';
|
|
12
12
|
static examples = [
|
|
@@ -14,7 +14,7 @@ class ConnectorsInfo extends base_1.default {
|
|
|
14
14
|
'$ heroku data:connectors:info gentle-connector-1234 --json',
|
|
15
15
|
];
|
|
16
16
|
static flags = {
|
|
17
|
-
json:
|
|
17
|
+
json: flags.boolean({
|
|
18
18
|
description: 'Return the results as JSON',
|
|
19
19
|
}),
|
|
20
20
|
};
|
|
@@ -23,38 +23,37 @@ class ConnectorsInfo extends base_1.default {
|
|
|
23
23
|
const { connector } = args;
|
|
24
24
|
const { body: res } = await this.shogun.get(`/data/cdc/v0/connectors/${connector}`, this.shogun.defaults);
|
|
25
25
|
if (flags.json) {
|
|
26
|
-
|
|
26
|
+
styledJSON(res);
|
|
27
27
|
return;
|
|
28
28
|
}
|
|
29
29
|
if (res.status === 'creating') {
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
ux.stdout(`The Data Connector is now being provisioned for ${color.name(connector)}.`);
|
|
31
|
+
ux.stdout(`Use ${color.command(`heroku data:connectors:wait ${res.name}`)} to check the creation process.`);
|
|
32
32
|
return;
|
|
33
33
|
}
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
styledHeader(`Data Connector status for ${color.addon(connector)}`);
|
|
35
|
+
styledObject({
|
|
36
36
|
Lag: res.lag,
|
|
37
37
|
Status: res.status,
|
|
38
38
|
'Service Name': res.uuid || 'Provisioning',
|
|
39
39
|
});
|
|
40
40
|
if (res.topics && res.topics.length > 0) {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
41
|
+
ux.stdout();
|
|
42
|
+
styledHeader('Configuration');
|
|
43
|
+
table(res.topics, {
|
|
44
44
|
table_name: { header: 'Table Name' },
|
|
45
45
|
topic_name: { header: 'Topic Name' },
|
|
46
46
|
});
|
|
47
47
|
}
|
|
48
48
|
if (res.excluded_columns && res.excluded_columns.length > 0) {
|
|
49
|
-
|
|
50
|
-
|
|
49
|
+
ux.stdout();
|
|
50
|
+
ux.stdout(color.bold('Excluded Columns'));
|
|
51
51
|
for (const column of res.excluded_columns)
|
|
52
|
-
|
|
52
|
+
ux.stdout(column);
|
|
53
53
|
}
|
|
54
|
-
|
|
54
|
+
ux.stdout();
|
|
55
55
|
if (res.status === 'available') {
|
|
56
|
-
|
|
56
|
+
ux.stdout(`Your Data Connector is now ${color.success('available')}.`);
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
|
-
exports.default = ConnectorsInfo;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import BaseCommand from '../../../lib/base';
|
|
1
|
+
import BaseCommand from '../../../lib/base.js';
|
|
2
2
|
export default class ConnectorsPause extends BaseCommand {
|
|
3
3
|
static args: {
|
|
4
|
-
connector: import("@oclif/core/
|
|
4
|
+
connector: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
5
5
|
};
|
|
6
6
|
static description: string;
|
|
7
7
|
static examples: string[];
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Args } from '@oclif/core';
|
|
2
|
+
import { ux } from '@oclif/core/ux';
|
|
3
|
+
import BaseCommand from '../../../lib/base.js';
|
|
4
|
+
export default class ConnectorsPause extends BaseCommand {
|
|
5
|
+
static args = {
|
|
6
|
+
connector: Args.string({ description: 'name of the connector', required: true }),
|
|
7
|
+
};
|
|
8
|
+
static description = 'Pause change event creation on a Data Connector\nRead more about this feature at https://devcenter.heroku.com/articles/heroku-data-connectors';
|
|
9
|
+
static examples = [
|
|
10
|
+
'$ heroku data:connectors:pause gentle-connector-1234',
|
|
11
|
+
];
|
|
12
|
+
async run() {
|
|
13
|
+
const { args } = await this.parse(ConnectorsPause);
|
|
14
|
+
ux.action.start(`Pausing Data Connector ${args.connector}`);
|
|
15
|
+
try {
|
|
16
|
+
const { response } = await this.shogun.put(`/data/cdc/v0/connectors/${args.connector}/pause`, {
|
|
17
|
+
...this.shogun.defaults,
|
|
18
|
+
raw: true,
|
|
19
|
+
});
|
|
20
|
+
response.resume();
|
|
21
|
+
}
|
|
22
|
+
catch (error) {
|
|
23
|
+
ux.error(error);
|
|
24
|
+
}
|
|
25
|
+
ux.action.stop();
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import BaseCommand from '../../../lib/base';
|
|
1
|
+
import BaseCommand from '../../../lib/base.js';
|
|
2
2
|
export default class ConnectorsResume extends BaseCommand {
|
|
3
3
|
static args: {
|
|
4
|
-
connector: import("@oclif/core/
|
|
4
|
+
connector: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
5
5
|
};
|
|
6
6
|
static description: string;
|
|
7
7
|
static examples: string[];
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { Args } from '@oclif/core';
|
|
2
|
+
import { ux } from '@oclif/core/ux';
|
|
3
|
+
import BaseCommand from '../../../lib/base.js';
|
|
4
|
+
export default class ConnectorsResume extends BaseCommand {
|
|
5
|
+
static args = {
|
|
6
|
+
connector: Args.string({ description: 'name of the connector', required: true }),
|
|
7
|
+
};
|
|
8
|
+
static description = 'Resume change event creation on a Data Connector\nRead more about this feature at https://devcenter.heroku.com/articles/heroku-data-connectors';
|
|
9
|
+
static examples = [
|
|
10
|
+
'$ heroku data:connectors:resume gentle-connector-1234',
|
|
11
|
+
];
|
|
12
|
+
async run() {
|
|
13
|
+
const { args } = await this.parse(ConnectorsResume);
|
|
14
|
+
ux.action.start(`Resuming Data Connector ${args.connector}`);
|
|
15
|
+
try {
|
|
16
|
+
const { response } = await this.shogun.put(`/data/cdc/v0/connectors/${args.connector}/resume`, {
|
|
17
|
+
...this.shogun.defaults,
|
|
18
|
+
raw: true,
|
|
19
|
+
});
|
|
20
|
+
response.resume();
|
|
21
|
+
}
|
|
22
|
+
catch (error) {
|
|
23
|
+
ux.error(error);
|
|
24
|
+
}
|
|
25
|
+
ux.action.stop();
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import BaseCommand from '../../../lib/base.js';
|
|
2
|
+
export default class ConnectorsUpdate extends BaseCommand {
|
|
3
|
+
static args: {
|
|
4
|
+
connector: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
5
|
+
};
|
|
6
|
+
static description: string;
|
|
7
|
+
static examples: string[];
|
|
8
|
+
static flags: {
|
|
9
|
+
setting: import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
'add-table': import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
|
+
'remove-table': import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
12
|
+
'exclude-column': import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
|
+
'remove-excluded-column': import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
|
+
};
|
|
15
|
+
run(): Promise<void>;
|
|
16
|
+
private parseSettings;
|
|
17
|
+
}
|
|
@@ -1,38 +1,37 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
class ConnectorsUpdate extends base_1.default {
|
|
1
|
+
import { flags } from '@heroku-cli/command';
|
|
2
|
+
import * as color from '@heroku/heroku-cli-util/color';
|
|
3
|
+
import { Args } from '@oclif/core';
|
|
4
|
+
import { ux } from '@oclif/core/ux';
|
|
5
|
+
import BaseCommand from '../../../lib/base.js';
|
|
6
|
+
export default class ConnectorsUpdate extends BaseCommand {
|
|
8
7
|
static args = {
|
|
9
|
-
connector:
|
|
8
|
+
connector: Args.string({ description: 'name of the connector', required: true }),
|
|
10
9
|
};
|
|
11
10
|
static description = 'Update the settings, tables, and columns to exclude for a Data Connector\nRead more about this feature at https://devcenter.heroku.com/articles/heroku-data-connectors#update-configuration';
|
|
12
11
|
static examples = [
|
|
13
12
|
'$ heroku data:connectors:update gentle-connector-1234 --setting key=value --setting otherKey=otherValue --add-table public.posts --add-table public.people --remove-table public.messages --exclude-column public.posts.key --remove-excluded-column public.parcels.key',
|
|
14
13
|
];
|
|
15
14
|
static flags = {
|
|
16
|
-
setting:
|
|
15
|
+
setting: flags.string({
|
|
17
16
|
multiple: true,
|
|
18
17
|
required: false,
|
|
19
18
|
}),
|
|
20
|
-
'add-table':
|
|
19
|
+
'add-table': flags.string({
|
|
21
20
|
description: 'Tables to add',
|
|
22
21
|
multiple: true,
|
|
23
22
|
required: false,
|
|
24
23
|
}),
|
|
25
|
-
'remove-table':
|
|
24
|
+
'remove-table': flags.string({
|
|
26
25
|
description: 'Tables to remove',
|
|
27
26
|
multiple: true,
|
|
28
27
|
required: false,
|
|
29
28
|
}),
|
|
30
|
-
'exclude-column':
|
|
29
|
+
'exclude-column': flags.string({
|
|
31
30
|
description: 'Columns to exclude',
|
|
32
31
|
multiple: true,
|
|
33
32
|
required: false,
|
|
34
33
|
}),
|
|
35
|
-
'remove-excluded-column':
|
|
34
|
+
'remove-excluded-column': flags.string({
|
|
36
35
|
description: 'Columns to no longer exclude',
|
|
37
36
|
multiple: true,
|
|
38
37
|
required: false,
|
|
@@ -46,7 +45,7 @@ class ConnectorsUpdate extends base_1.default {
|
|
|
46
45
|
const excludedColumnsToAdd = flags['exclude-column'] || [];
|
|
47
46
|
const excludedColumnsToRemove = flags['remove-excluded-column'] || [];
|
|
48
47
|
const params = this.parseSettings(setting);
|
|
49
|
-
|
|
48
|
+
ux.action.start(`Updating Data Connector ${args.connector}`);
|
|
50
49
|
try {
|
|
51
50
|
const { body: res } = await this.shogun.get(`/data/cdc/v0/connectors/${args.connector}`, this.shogun.defaults);
|
|
52
51
|
const tables = [...new Set([...res.tables, ...tablesToAdd].filter(t => !tablesToRemove.includes(t)))];
|
|
@@ -61,18 +60,18 @@ class ConnectorsUpdate extends base_1.default {
|
|
|
61
60
|
});
|
|
62
61
|
}
|
|
63
62
|
catch (error) {
|
|
64
|
-
|
|
63
|
+
ux.error(error);
|
|
65
64
|
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
65
|
+
ux.action.stop();
|
|
66
|
+
ux.stdout();
|
|
67
|
+
ux.stdout('Your Data Connector is now being updated.');
|
|
68
|
+
ux.stdout(`Use ${color.command(`heroku data:connectors:wait ${args.connector}`)} to check the update process.`);
|
|
70
69
|
}
|
|
71
70
|
parseSettings(settings) {
|
|
72
71
|
return settings.map(setting => {
|
|
73
72
|
const [key, value] = setting.split('=');
|
|
74
73
|
if (!key || !value) {
|
|
75
|
-
|
|
74
|
+
ux.error('You must pass each --setting flag using the format `key=value`');
|
|
76
75
|
}
|
|
77
76
|
return [key, value];
|
|
78
77
|
}).reduce((acc, [key, value]) => {
|
|
@@ -81,4 +80,3 @@ class ConnectorsUpdate extends base_1.default {
|
|
|
81
80
|
}, {});
|
|
82
81
|
}
|
|
83
82
|
}
|
|
84
|
-
exports.default = ConnectorsUpdate;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import BaseCommand from '../../../lib/base';
|
|
1
|
+
import BaseCommand from '../../../lib/base.js';
|
|
2
2
|
export default class ConnectorsWait extends BaseCommand {
|
|
3
3
|
static args: {
|
|
4
|
-
connector: import("@oclif/core/
|
|
4
|
+
connector: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
5
5
|
};
|
|
6
6
|
static description: string;
|
|
7
7
|
static examples: string[];
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
class ConnectorsWait extends base_1.default {
|
|
1
|
+
import { Args } from '@oclif/core';
|
|
2
|
+
import { ux } from '@oclif/core/ux';
|
|
3
|
+
import BaseCommand from '../../../lib/base.js';
|
|
4
|
+
export default class ConnectorsWait extends BaseCommand {
|
|
6
5
|
static args = {
|
|
7
|
-
connector:
|
|
6
|
+
connector: Args.string({ description: 'name of the connector', required: true }),
|
|
8
7
|
};
|
|
9
8
|
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
9
|
static examples = [
|
|
@@ -14,14 +13,16 @@ class ConnectorsWait extends base_1.default {
|
|
|
14
13
|
const { args } = await this.parse(ConnectorsWait);
|
|
15
14
|
const { connector } = args;
|
|
16
15
|
let status;
|
|
17
|
-
|
|
16
|
+
ux.action.start('Waiting for the Data Connector to be provisioned');
|
|
18
17
|
/* eslint-disable no-await-in-loop */
|
|
19
18
|
while (status !== 'available') {
|
|
20
19
|
const { body: res } = await this.shogun.get(`/data/cdc/v0/connectors/${connector}`, this.shogun.defaults);
|
|
21
20
|
status = res.status;
|
|
22
|
-
await
|
|
21
|
+
await new Promise(resolve => {
|
|
22
|
+
setTimeout(resolve, 10_000);
|
|
23
|
+
});
|
|
23
24
|
}
|
|
24
|
-
|
|
25
|
+
/* eslint-enable no-await-in-loop */
|
|
26
|
+
ux.action.stop();
|
|
25
27
|
}
|
|
26
28
|
}
|
|
27
|
-
exports.default = ConnectorsWait;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import BaseCommand from '../../../lib/base.js';
|
|
2
|
+
export default class DataEnhancedCertificatesDisable extends BaseCommand {
|
|
3
|
+
static args: {
|
|
4
|
+
addon: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
5
|
+
};
|
|
6
|
+
static description: string;
|
|
7
|
+
static flags: {
|
|
8
|
+
app: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
|
+
};
|
|
10
|
+
run(): Promise<void>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { flags } from '@heroku-cli/command';
|
|
2
|
+
import { AddonResolver } from '@heroku/heroku-cli-util/utils/addons';
|
|
3
|
+
import { Args } from '@oclif/core';
|
|
4
|
+
import { ux } from '@oclif/core/ux';
|
|
5
|
+
import BaseCommand from '../../../lib/base.js';
|
|
6
|
+
export default class DataEnhancedCertificatesDisable extends BaseCommand {
|
|
7
|
+
static args = {
|
|
8
|
+
addon: Args.string({ description: 'name of the addon', required: true }),
|
|
9
|
+
};
|
|
10
|
+
static description = 'Disable enhanced certificates on an Addon\nRead more about this feature at https://devcenter.heroku.com/articles/heroku-data-enhanced-certificates';
|
|
11
|
+
static flags = {
|
|
12
|
+
app: flags.app(),
|
|
13
|
+
};
|
|
14
|
+
async run() {
|
|
15
|
+
const { args, flags } = await this.parse(DataEnhancedCertificatesDisable);
|
|
16
|
+
const addonResolver = new AddonResolver(this.heroku);
|
|
17
|
+
const addon = await addonResolver.resolve(args.addon, flags.app);
|
|
18
|
+
ux.action.start(`Disabling Enhanced Certificates Beta on ${addon.name}`);
|
|
19
|
+
try {
|
|
20
|
+
const { response } = await this.shogun.put(`/client/v11/enhanced_certificates/${addon.id}/disable`, {
|
|
21
|
+
...this.shogun.defaults,
|
|
22
|
+
raw: true,
|
|
23
|
+
});
|
|
24
|
+
response.resume();
|
|
25
|
+
}
|
|
26
|
+
catch (error) {
|
|
27
|
+
ux.error(error);
|
|
28
|
+
}
|
|
29
|
+
ux.action.stop();
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import BaseCommand from '../../../lib/base.js';
|
|
2
|
+
export default class DataEnhancedCertificatesEnable extends BaseCommand {
|
|
3
|
+
static args: {
|
|
4
|
+
addon: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
5
|
+
};
|
|
6
|
+
static description: string;
|
|
7
|
+
static examples: string[];
|
|
8
|
+
static flags: {
|
|
9
|
+
app: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
};
|
|
11
|
+
run(): Promise<void>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { flags } from '@heroku-cli/command';
|
|
2
|
+
import { AddonResolver } from '@heroku/heroku-cli-util/utils/addons';
|
|
3
|
+
import { Args } from '@oclif/core';
|
|
4
|
+
import { ux } from '@oclif/core/ux';
|
|
5
|
+
import BaseCommand from '../../../lib/base.js';
|
|
6
|
+
export default class DataEnhancedCertificatesEnable extends BaseCommand {
|
|
7
|
+
static args = {
|
|
8
|
+
addon: Args.string({ description: 'name of the addon', required: true }),
|
|
9
|
+
};
|
|
10
|
+
static description = 'Enable enhanced certificates on an Addon\nRead more about this feature at https://devcenter.heroku.com/articles/heroku-data-enhanced-certificates';
|
|
11
|
+
static examples = [
|
|
12
|
+
'$ heroku data:enhanced-certificates:enable happy-postgres-1234 -a example-app',
|
|
13
|
+
];
|
|
14
|
+
static flags = {
|
|
15
|
+
app: flags.app(),
|
|
16
|
+
};
|
|
17
|
+
async run() {
|
|
18
|
+
const { args, flags } = await this.parse(DataEnhancedCertificatesEnable);
|
|
19
|
+
const addonResolver = new AddonResolver(this.heroku);
|
|
20
|
+
const addon = await addonResolver.resolve(args.addon, flags.app);
|
|
21
|
+
ux.action.start(`Enabling Enhanced Certificates Beta on ${addon.name}`);
|
|
22
|
+
try {
|
|
23
|
+
const { response } = await this.shogun.put(`/client/v11/enhanced_certificates/${addon.id}/enable`, {
|
|
24
|
+
...this.shogun.defaults,
|
|
25
|
+
raw: true,
|
|
26
|
+
});
|
|
27
|
+
response.resume();
|
|
28
|
+
}
|
|
29
|
+
catch (error) {
|
|
30
|
+
ux.error(error);
|
|
31
|
+
}
|
|
32
|
+
ux.action.stop();
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import BaseCommand from '../../../lib/base.js';
|
|
2
|
+
export default class DataEnhancedCertificatesStatus extends BaseCommand {
|
|
3
|
+
static args: {
|
|
4
|
+
addon: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
5
|
+
};
|
|
6
|
+
static description: string;
|
|
7
|
+
static flags: {
|
|
8
|
+
app: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
9
|
+
json: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
10
|
+
};
|
|
11
|
+
run(): Promise<void>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { flags } from '@heroku-cli/command';
|
|
2
|
+
import * as color from '@heroku/heroku-cli-util/color';
|
|
3
|
+
import { styledHeader, styledJSON, styledObject } from '@heroku/heroku-cli-util/hux';
|
|
4
|
+
import { AddonResolver } from '@heroku/heroku-cli-util/utils/addons';
|
|
5
|
+
import { Args } from '@oclif/core';
|
|
6
|
+
import BaseCommand from '../../../lib/base.js';
|
|
7
|
+
export default class DataEnhancedCertificatesStatus extends BaseCommand {
|
|
8
|
+
static args = {
|
|
9
|
+
addon: Args.string({ description: 'name of the addon', required: true }),
|
|
10
|
+
};
|
|
11
|
+
static description = 'Get the status of Enhanced Certificates\nRead more about this feature at https://devcenter.heroku.com/articles/heroku-data-enhanced-certificates';
|
|
12
|
+
static flags = {
|
|
13
|
+
app: flags.app(),
|
|
14
|
+
json: flags.boolean({ description: 'Return the results as JSON' }),
|
|
15
|
+
};
|
|
16
|
+
async run() {
|
|
17
|
+
const { args, flags } = await this.parse(DataEnhancedCertificatesStatus);
|
|
18
|
+
const addonResolver = new AddonResolver(this.heroku);
|
|
19
|
+
const addon = await addonResolver.resolve(args.addon, flags.app);
|
|
20
|
+
const { body: res } = await this.shogun.get(`/client/v11/enhanced_certificates/${addon.id}/status`, this.shogun.defaults);
|
|
21
|
+
if (flags.json) {
|
|
22
|
+
styledJSON(res);
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
styledHeader(`Enhanced Certificates for ${color.addon(addon.name)}.`);
|
|
26
|
+
styledObject({
|
|
27
|
+
Status: res.status,
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import BaseCommand from '../../../lib/base.js';
|
|
2
|
+
export default class LabsDisable extends BaseCommand {
|
|
3
|
+
static args: {
|
|
4
|
+
feature: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
5
|
+
};
|
|
6
|
+
static description: string;
|
|
7
|
+
static examples: string[];
|
|
8
|
+
static flags: {
|
|
9
|
+
addon: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
app: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
|
+
};
|
|
12
|
+
run(): Promise<void>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { flags } from '@heroku-cli/command';
|
|
2
|
+
import * as color from '@heroku/heroku-cli-util/color';
|
|
3
|
+
import { AddonResolver } from '@heroku/heroku-cli-util/utils/addons';
|
|
4
|
+
import { Args } from '@oclif/core';
|
|
5
|
+
import { ux } from '@oclif/core/ux';
|
|
6
|
+
import BaseCommand from '../../../lib/base.js';
|
|
7
|
+
export default class LabsDisable extends BaseCommand {
|
|
8
|
+
static args = {
|
|
9
|
+
feature: Args.string({ description: 'name of the feature', required: true }),
|
|
10
|
+
};
|
|
11
|
+
static description = 'Disable experimental features on an addon';
|
|
12
|
+
static examples = [
|
|
13
|
+
'$ heroku data:labs:disable wal-compression --addon=happy-postgres-1234 -a example-app',
|
|
14
|
+
];
|
|
15
|
+
static flags = {
|
|
16
|
+
addon: flags.string({
|
|
17
|
+
description: 'The addon you want to disable features on',
|
|
18
|
+
required: true,
|
|
19
|
+
}),
|
|
20
|
+
app: flags.app(),
|
|
21
|
+
};
|
|
22
|
+
async run() {
|
|
23
|
+
const { args, flags } = await this.parse(LabsDisable);
|
|
24
|
+
const addonResolver = new AddonResolver(this.heroku);
|
|
25
|
+
const addon = await addonResolver.resolve(flags.addon, flags.app);
|
|
26
|
+
ux.action.start(`Disabling ${args.feature} on ${color.addon(addon.name)}`);
|
|
27
|
+
try {
|
|
28
|
+
const { response } = await this.shogun.put(`/client/v11/labs/${addon.id}/disable`, {
|
|
29
|
+
...this.shogun.defaults,
|
|
30
|
+
body: {
|
|
31
|
+
feature: args.feature,
|
|
32
|
+
},
|
|
33
|
+
raw: true,
|
|
34
|
+
});
|
|
35
|
+
response.resume();
|
|
36
|
+
}
|
|
37
|
+
catch (error) {
|
|
38
|
+
ux.error(error);
|
|
39
|
+
}
|
|
40
|
+
finally {
|
|
41
|
+
ux.action.stop();
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import BaseCommand from '../../../lib/base.js';
|
|
2
|
+
export default class LabsEnable extends BaseCommand {
|
|
3
|
+
static args: {
|
|
4
|
+
feature: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
5
|
+
};
|
|
6
|
+
static description: string;
|
|
7
|
+
static examples: string[];
|
|
8
|
+
static flags: {
|
|
9
|
+
addon: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
10
|
+
app: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
11
|
+
};
|
|
12
|
+
run(): Promise<void>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { flags } from '@heroku-cli/command';
|
|
2
|
+
import * as color from '@heroku/heroku-cli-util/color';
|
|
3
|
+
import { AddonResolver } from '@heroku/heroku-cli-util/utils/addons';
|
|
4
|
+
import { Args } from '@oclif/core';
|
|
5
|
+
import { ux } from '@oclif/core/ux';
|
|
6
|
+
import BaseCommand from '../../../lib/base.js';
|
|
7
|
+
export default class LabsEnable extends BaseCommand {
|
|
8
|
+
static args = {
|
|
9
|
+
feature: Args.string({ description: 'name of the feature', required: true }),
|
|
10
|
+
};
|
|
11
|
+
static description = 'Enable experimental features on an addon';
|
|
12
|
+
static examples = [
|
|
13
|
+
'$ heroku data:labs:enable wal-compression --addon=happy-postgres-1234 -a example-app',
|
|
14
|
+
];
|
|
15
|
+
static flags = {
|
|
16
|
+
addon: flags.string({
|
|
17
|
+
description: 'The addon you want to enable features on',
|
|
18
|
+
required: true,
|
|
19
|
+
}),
|
|
20
|
+
app: flags.app(),
|
|
21
|
+
};
|
|
22
|
+
async run() {
|
|
23
|
+
const { args, flags } = await this.parse(LabsEnable);
|
|
24
|
+
const addonResolver = new AddonResolver(this.heroku);
|
|
25
|
+
const addon = await addonResolver.resolve(flags.addon, flags.app);
|
|
26
|
+
ux.action.start(`Enabling ${args.feature} on ${color.addon(addon.name)}`);
|
|
27
|
+
try {
|
|
28
|
+
const { response } = await this.shogun.put(`/client/v11/labs/${addon.id}/enable`, {
|
|
29
|
+
...this.shogun.defaults,
|
|
30
|
+
body: {
|
|
31
|
+
feature: args.feature,
|
|
32
|
+
},
|
|
33
|
+
raw: true,
|
|
34
|
+
});
|
|
35
|
+
response.resume();
|
|
36
|
+
}
|
|
37
|
+
catch (error) {
|
|
38
|
+
ux.error(error);
|
|
39
|
+
}
|
|
40
|
+
finally {
|
|
41
|
+
ux.action.stop();
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import BaseCommand from '../../../lib/base';
|
|
1
|
+
import BaseCommand from '../../../lib/base.js';
|
|
2
2
|
type DataLabsFeature = {
|
|
3
3
|
description: string;
|
|
4
4
|
name: string;
|
|
@@ -9,12 +9,12 @@ type DataLabsFeature = {
|
|
|
9
9
|
};
|
|
10
10
|
export default class LabsList extends BaseCommand {
|
|
11
11
|
static args: {
|
|
12
|
-
addon: import("@oclif/core/
|
|
12
|
+
addon: import("@oclif/core/interfaces").Arg<string, Record<string, unknown>>;
|
|
13
13
|
};
|
|
14
14
|
static description: string;
|
|
15
15
|
static examples: string[];
|
|
16
16
|
static flags: {
|
|
17
|
-
app: import("@oclif/core/
|
|
17
|
+
app: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
18
18
|
};
|
|
19
19
|
printFeatures(features: Array<DataLabsFeature>, addonName: string): void;
|
|
20
20
|
run(): Promise<void>;
|