@heroku-cli/plugin-mtls 0.8.1 → 0.9.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.
Files changed (37) hide show
  1. package/README.md +18 -33
  2. package/lib/base.d.ts +11 -11
  3. package/lib/base.js +2 -2
  4. package/lib/commands/data/mtls/certificates/create.d.ts +2 -2
  5. package/lib/commands/data/mtls/certificates/create.js +7 -7
  6. package/lib/commands/data/mtls/certificates/delete.d.ts +2 -2
  7. package/lib/commands/data/mtls/certificates/delete.js +7 -7
  8. package/lib/commands/data/mtls/certificates/download.d.ts +2 -2
  9. package/lib/commands/data/mtls/certificates/download.js +29 -26
  10. package/lib/commands/data/mtls/certificates/get.d.ts +2 -2
  11. package/lib/commands/data/mtls/certificates/get.js +6 -6
  12. package/lib/commands/data/mtls/certificates/index.d.ts +2 -2
  13. package/lib/commands/data/mtls/certificates/index.js +13 -8
  14. package/lib/commands/data/mtls/create.d.ts +2 -2
  15. package/lib/commands/data/mtls/create.js +8 -8
  16. package/lib/commands/data/mtls/destroy.d.ts +2 -2
  17. package/lib/commands/data/mtls/destroy.js +7 -7
  18. package/lib/commands/data/mtls/index.d.ts +2 -2
  19. package/lib/commands/data/mtls/index.js +15 -10
  20. package/lib/commands/data/mtls/ip-rules/create.d.ts +2 -2
  21. package/lib/commands/data/mtls/ip-rules/create.js +8 -8
  22. package/lib/commands/data/mtls/ip-rules/delete.d.ts +2 -2
  23. package/lib/commands/data/mtls/ip-rules/delete.js +7 -7
  24. package/lib/commands/data/mtls/ip-rules/get.d.ts +2 -2
  25. package/lib/commands/data/mtls/ip-rules/get.js +6 -6
  26. package/lib/commands/data/mtls/ip-rules/index.d.ts +2 -2
  27. package/lib/commands/data/mtls/ip-rules/index.js +7 -7
  28. package/lib/lib/fetcher.js +17 -17
  29. package/lib/utils/is-error-http.d.ts +8 -0
  30. package/lib/utils/is-error-http.js +7 -0
  31. package/lib/utils/is-error-message.d.ts +3 -0
  32. package/lib/utils/is-error-message.js +7 -0
  33. package/lib/utils/table.d.ts +2 -2
  34. package/lib/utils/table.js +5 -2
  35. package/oclif.manifest.json +1 -1
  36. package/package.json +18 -13
  37. package/yarn.lock +2701 -1773
@@ -8,24 +8,24 @@ const fetcher_1 = require("../../../lib/fetcher");
8
8
  class MTLSDestroy extends base_1.default {
9
9
  async run() {
10
10
  const { args, flags } = this.parse(MTLSDestroy);
11
- const addon = await fetcher_1.default(this.heroku, args.addon, flags.app);
11
+ const addon = await (0, fetcher_1.default)(this.heroku, args.addon, flags.app);
12
12
  if (addon.kind === 'kafka') {
13
13
  cli_ux_1.cli.error('Kafka has mTLS enabled by default and you cannot disable it');
14
14
  }
15
- cli_ux_1.cli.action.start(`Disabling MTLS on ${color_1.default.cyan(addon.name)}`);
15
+ cli_ux_1.cli.action.start(`Disabling MTLS on ${color_1.color.cyan(addon.name)}`);
16
16
  await this.shogun.delete(addon.endpoint, this.shogun.defaults);
17
17
  cli_ux_1.cli.action.stop();
18
18
  }
19
19
  }
20
- MTLSDestroy.description = 'destroy MTLS configuration on your addon';
20
+ exports.default = MTLSDestroy;
21
21
  MTLSDestroy.aliases = ['data:mtls:delete'];
22
22
  MTLSDestroy.args = [
23
23
  { name: 'addon' },
24
24
  ];
25
- MTLSDestroy.flags = {
26
- app: command_1.flags.app({ required: true })
27
- };
25
+ MTLSDestroy.description = 'destroy MTLS configuration on your addon';
28
26
  MTLSDestroy.examples = [
29
27
  '$ heroku data:mtls:destroy postgresql-sushi-12345'
30
28
  ];
31
- exports.default = MTLSDestroy;
29
+ MTLSDestroy.flags = {
30
+ app: command_1.flags.app({ required: true })
31
+ };
@@ -1,13 +1,13 @@
1
1
  import { flags } from '@heroku-cli/command';
2
2
  import BaseCommand from '../../../base';
3
3
  export default class MTLSIndex extends BaseCommand {
4
- static description: string;
5
4
  static args: {
6
5
  name: string;
7
6
  }[];
7
+ static description: string;
8
+ static examples: string[];
8
9
  static flags: {
9
10
  app: flags.IOptionFlag<string>;
10
11
  };
11
- static examples: string[];
12
12
  run(): Promise<void>;
13
13
  }
@@ -5,12 +5,14 @@ const command_1 = require("@heroku-cli/command");
5
5
  const cli_ux_1 = require("cli-ux");
6
6
  const base_1 = require("../../../base");
7
7
  const fetcher_1 = require("../../../lib/fetcher");
8
+ const is_error_http_1 = require("../../../utils/is-error-http");
9
+ const is_error_message_1 = require("../../../utils/is-error-message");
8
10
  const table_1 = require("../../../utils/table");
9
11
  class MTLSIndex extends base_1.default {
10
12
  async run() {
11
13
  try {
12
14
  const { args, flags } = this.parse(MTLSIndex);
13
- const addon = await fetcher_1.default(this.heroku, args.addon, flags.app);
15
+ const addon = await (0, fetcher_1.default)(this.heroku, args.addon, flags.app);
14
16
  if (addon.kind === 'kafka') {
15
17
  const { body: ipRules } = await this.shogun.get(`${addon.endpoint}/ip-rules`, this.shogun.defaults);
16
18
  cli_ux_1.cli.styledObject({
@@ -21,7 +23,7 @@ class MTLSIndex extends base_1.default {
21
23
  this.log();
22
24
  this.log(color_1.color.underline('IP Rules'));
23
25
  this.log();
24
- table_1.ipRulesTable(ipRules);
26
+ (0, table_1.ipRulesTable)(ipRules);
25
27
  }
26
28
  }
27
29
  else {
@@ -40,18 +42,21 @@ class MTLSIndex extends base_1.default {
40
42
  this.log();
41
43
  this.log(color_1.color.underline('Certificates'));
42
44
  this.log();
43
- table_1.certificatesTable(certs);
45
+ (0, table_1.certificatesTable)(certs);
44
46
  }
45
47
  if (ipRules.length > 0) {
46
48
  this.log();
47
49
  this.log(color_1.color.underline('IP Rules'));
48
50
  this.log();
49
- table_1.ipRulesTable(ipRules);
51
+ (0, table_1.ipRulesTable)(ipRules);
50
52
  }
51
53
  }
52
54
  }
53
55
  catch (err) {
54
- if (err.http && err.http.statusCode === 404) {
56
+ if (!(0, is_error_message_1.isErrorMessage)(err)) {
57
+ return;
58
+ }
59
+ if ((0, is_error_http_1.isErrorHttp)(err) && err.http && err.http.statusCode === 404) {
55
60
  if (err.http.body.resource === 'add_on') {
56
61
  this.error(err.message);
57
62
  }
@@ -65,14 +70,14 @@ class MTLSIndex extends base_1.default {
65
70
  }
66
71
  }
67
72
  }
68
- MTLSIndex.description = 'get the status of MTLS for your addon';
73
+ exports.default = MTLSIndex;
69
74
  MTLSIndex.args = [
70
75
  { name: 'addon' }
71
76
  ];
72
- MTLSIndex.flags = {
73
- app: command_1.flags.app({ required: true })
74
- };
77
+ MTLSIndex.description = 'get the status of MTLS for your addon';
75
78
  MTLSIndex.examples = [
76
79
  '$ heroku data:mtls postgresql-sushi-12345',
77
80
  ];
78
- exports.default = MTLSIndex;
81
+ MTLSIndex.flags = {
82
+ app: command_1.flags.app({ required: true })
83
+ };
@@ -1,15 +1,15 @@
1
1
  import { flags } from '@heroku-cli/command';
2
2
  import BaseCommand from '../../../../base';
3
3
  export default class MTLSIPCreate extends BaseCommand {
4
- static description: string;
5
4
  static args: {
6
5
  name: string;
7
6
  }[];
7
+ static description: string;
8
+ static examples: string[];
8
9
  static flags: {
9
10
  app: flags.IOptionFlag<string>;
10
11
  cidr: flags.IOptionFlag<string>;
11
12
  description: flags.IOptionFlag<string | undefined>;
12
13
  };
13
- static examples: string[];
14
14
  run(): Promise<void>;
15
15
  }
@@ -8,9 +8,9 @@ const fetcher_1 = require("../../../../lib/fetcher");
8
8
  class MTLSIPCreate extends base_1.default {
9
9
  async run() {
10
10
  const { args, flags } = this.parse(MTLSIPCreate);
11
- const addon = await fetcher_1.default(this.heroku, args.addon, flags.app);
12
- cli_ux_1.cli.action.start(`Creating IP Rule for ${color_1.default.cyan(addon.name)}`);
13
- const { body: res } = await this.shogun.post(`${addon.endpoint}/ip-rules`, Object.assign({}, this.shogun.defaults, { body: {
11
+ const addon = await (0, fetcher_1.default)(this.heroku, args.addon, flags.app);
12
+ cli_ux_1.cli.action.start(`Creating IP Rule for ${color_1.color.cyan(addon.name)}`);
13
+ const { body: res } = await this.shogun.post(`${addon.endpoint}/ip-rules`, Object.assign(Object.assign({}, this.shogun.defaults), { body: {
14
14
  cidr: flags.cidr,
15
15
  description: flags.description
16
16
  } }));
@@ -18,16 +18,16 @@ class MTLSIPCreate extends base_1.default {
18
18
  cli_ux_1.cli.styledObject(res);
19
19
  }
20
20
  }
21
- MTLSIPCreate.description = 'create an IP Rule for your MTLS enabled addon';
21
+ exports.default = MTLSIPCreate;
22
22
  MTLSIPCreate.args = [
23
23
  { name: 'addon' }
24
24
  ];
25
+ MTLSIPCreate.description = 'create an IP Rule for your MTLS enabled addon';
26
+ MTLSIPCreate.examples = [
27
+ '$ heroku data:mtls:ip-rules:create postgresql-sushi-12345 --cidr "1.2.3.4/32" --description "home IP address"'
28
+ ];
25
29
  MTLSIPCreate.flags = {
26
30
  app: command_1.flags.app({ required: true }),
27
31
  cidr: command_1.flags.string({ required: true }),
28
32
  description: command_1.flags.string({ required: false })
29
33
  };
30
- MTLSIPCreate.examples = [
31
- '$ heroku data:mtls:ip-rules:create postgresql-sushi-12345 --cidr "1.2.3.4/32" --description "home IP address"'
32
- ];
33
- exports.default = MTLSIPCreate;
@@ -1,15 +1,15 @@
1
1
  import { flags } from '@heroku-cli/command';
2
2
  import BaseCommand from '../../../../base';
3
3
  export default class MTLSIPDelete extends BaseCommand {
4
- static description: string;
5
4
  static args: {
6
5
  name: string;
7
6
  }[];
7
+ static description: string;
8
+ static examples: string[];
8
9
  static flags: {
9
10
  app: flags.IOptionFlag<string>;
10
11
  cidr: flags.IOptionFlag<string | undefined>;
11
12
  id: flags.IOptionFlag<string | undefined>;
12
13
  };
13
- static examples: string[];
14
14
  run(): Promise<void>;
15
15
  }
@@ -12,8 +12,8 @@ class MTLSIPDelete extends base_1.default {
12
12
  cli_ux_1.cli.error('You need at least pass in the id or cidr of the IP Rule');
13
13
  }
14
14
  else {
15
- const addon = await fetcher_1.default(this.heroku, args.addon, flags.app);
16
- cli_ux_1.cli.action.start(`Deleting IP Rule for ${color_1.default.cyan(addon.name)}`);
15
+ const addon = await (0, fetcher_1.default)(this.heroku, args.addon, flags.app);
16
+ cli_ux_1.cli.action.start(`Deleting IP Rule for ${color_1.color.cyan(addon.name)}`);
17
17
  let id = '';
18
18
  if (flags.id) {
19
19
  id = flags.id;
@@ -33,16 +33,16 @@ class MTLSIPDelete extends base_1.default {
33
33
  }
34
34
  }
35
35
  }
36
- MTLSIPDelete.description = 'delete a specific IP Rule for your MTLS enabled addon';
36
+ exports.default = MTLSIPDelete;
37
37
  MTLSIPDelete.args = [
38
38
  { name: 'addon' }
39
39
  ];
40
+ MTLSIPDelete.description = 'delete a specific IP Rule for your MTLS enabled addon';
41
+ MTLSIPDelete.examples = [
42
+ '$ heroku data:mtls:ip-rules:delete postgresql-sushi-12345 --id "1862ec85-fdc1-47b3-924e-a91d26ca3a7c"'
43
+ ];
40
44
  MTLSIPDelete.flags = {
41
45
  app: command_1.flags.app({ required: true }),
42
46
  cidr: command_1.flags.string({ description: 'cidr of IP Rule' }),
43
47
  id: command_1.flags.string({ description: 'id of IP Rule' })
44
48
  };
45
- MTLSIPDelete.examples = [
46
- '$ heroku data:mtls:ip-rules:delete postgresql-sushi-12345 --id "1862ec85-fdc1-47b3-924e-a91d26ca3a7c"'
47
- ];
48
- exports.default = MTLSIPDelete;
@@ -1,14 +1,14 @@
1
1
  import { flags } from '@heroku-cli/command';
2
2
  import BaseCommand from '../../../../base';
3
3
  export default class MTLSIPGet extends BaseCommand {
4
- static description: string;
5
4
  static args: {
6
5
  name: string;
7
6
  }[];
7
+ static description: string;
8
+ static examples: string[];
8
9
  static flags: {
9
10
  app: flags.IOptionFlag<string>;
10
11
  id: flags.IOptionFlag<string>;
11
12
  };
12
- static examples: string[];
13
13
  run(): Promise<void>;
14
14
  }
@@ -7,20 +7,20 @@ const fetcher_1 = require("../../../../lib/fetcher");
7
7
  class MTLSIPGet extends base_1.default {
8
8
  async run() {
9
9
  const { args, flags } = this.parse(MTLSIPGet);
10
- const addon = await fetcher_1.default(this.heroku, args.addon, flags.app);
10
+ const addon = await (0, fetcher_1.default)(this.heroku, args.addon, flags.app);
11
11
  const { body: res } = await this.shogun.get(`${addon.endpoint}/ip-rules/${flags.id}`, this.shogun.defaults);
12
12
  cli_ux_1.cli.styledObject(res);
13
13
  }
14
14
  }
15
- MTLSIPGet.description = 'get a specific IP Rule for your MTLS enabled addon';
15
+ exports.default = MTLSIPGet;
16
16
  MTLSIPGet.args = [
17
17
  { name: 'addon' }
18
18
  ];
19
+ MTLSIPGet.description = 'get a specific IP Rule for your MTLS enabled addon';
20
+ MTLSIPGet.examples = [
21
+ '$ heroku data:mtls:ip-rules:get postgresql-sushi-12345 --id "1862ec85-fdc1-47b3-924e-a91d26ca3a7c"'
22
+ ];
19
23
  MTLSIPGet.flags = {
20
24
  app: command_1.flags.app({ required: true }),
21
25
  id: command_1.flags.string({ required: true, description: 'id of IP Rule' })
22
26
  };
23
- MTLSIPGet.examples = [
24
- '$ heroku data:mtls:ip-rules:get postgresql-sushi-12345 --id "1862ec85-fdc1-47b3-924e-a91d26ca3a7c"'
25
- ];
26
- exports.default = MTLSIPGet;
@@ -1,13 +1,13 @@
1
1
  import { flags } from '@heroku-cli/command';
2
2
  import BaseCommand from '../../../../base';
3
3
  export default class MTLSIPIndex extends BaseCommand {
4
- static description: string;
5
4
  static args: {
6
5
  name: string;
7
6
  }[];
7
+ static description: string;
8
+ static examples: string[];
8
9
  static flags: {
9
10
  app: flags.IOptionFlag<string>;
10
11
  };
11
- static examples: string[];
12
12
  run(): Promise<void>;
13
13
  }
@@ -8,24 +8,24 @@ const table_1 = require("../../../../utils/table");
8
8
  class MTLSIPIndex extends base_1.default {
9
9
  async run() {
10
10
  const { args, flags } = this.parse(MTLSIPIndex);
11
- const addon = await fetcher_1.default(this.heroku, args.addon, flags.app);
11
+ const addon = await (0, fetcher_1.default)(this.heroku, args.addon, flags.app);
12
12
  const { body: res } = await this.shogun.get(`${addon.endpoint}/ip-rules`, this.shogun.defaults);
13
13
  if (res.length === 0) {
14
14
  cli_ux_1.cli.log('You currently have no IP Rules setup');
15
15
  }
16
16
  else {
17
- table_1.ipRulesTable(res);
17
+ (0, table_1.ipRulesTable)(res);
18
18
  }
19
19
  }
20
20
  }
21
- MTLSIPIndex.description = 'get the IP Rules for your MTLS enabled addon';
21
+ exports.default = MTLSIPIndex;
22
22
  MTLSIPIndex.args = [
23
23
  { name: 'addon' }
24
24
  ];
25
- MTLSIPIndex.flags = {
26
- app: command_1.flags.app({ required: true })
27
- };
25
+ MTLSIPIndex.description = 'get the IP Rules for your MTLS enabled addon';
28
26
  MTLSIPIndex.examples = [
29
27
  '$ heroku data:mtls:ip-rules postgresql-sushi-12345',
30
28
  ];
31
- exports.default = MTLSIPIndex;
29
+ MTLSIPIndex.flags = {
30
+ app: command_1.flags.app({ required: true })
31
+ };
@@ -2,9 +2,9 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const cli_ux_1 = require("cli-ux");
4
4
  async function default_1(heroku, addon_attachment, app) {
5
- const filteredAddon = addon_attachment ?
6
- await findAddonGivenAttachment(heroku, addon_attachment, app) :
7
- await findAllAddons(heroku, app);
5
+ const filteredAddon = addon_attachment
6
+ ? await findAddonGivenAttachment(heroku, addon_attachment, app)
7
+ : await findAllAddons(heroku, app);
8
8
  if (filteredAddon) {
9
9
  if (filteredAddon.addon_service.name.startsWith('heroku-postgresql')) {
10
10
  return {
@@ -13,8 +13,8 @@ async function default_1(heroku, addon_attachment, app) {
13
13
  kind: 'postgresql'
14
14
  };
15
15
  }
16
- else if (filteredAddon.addon_service.name.startsWith('heroku-kafka') &&
17
- RegExp(/private|shield/).test(filteredAddon.plan.name)) {
16
+ if (filteredAddon.addon_service.name.startsWith('heroku-kafka')
17
+ && /private|shield/.test(filteredAddon.plan.name)) {
18
18
  return {
19
19
  name: filteredAddon.name,
20
20
  endpoint: `/data/kafka/v0/clusters/${filteredAddon.id}`,
@@ -26,12 +26,13 @@ async function default_1(heroku, addon_attachment, app) {
26
26
  exports.default = default_1;
27
27
  async function findAllAddons(heroku, app) {
28
28
  const { body: addon_list } = await heroku.get(`/apps/${app}/addons`);
29
- let filtered_list = addon_list.filter((addon) => {
29
+ const filtered_list = addon_list.filter((addon) => {
30
30
  if (addon.addon_service) {
31
- return addon.addon_service.name &&
32
- (addon.addon_service.name.startsWith('heroku-postgresql') ||
33
- addon.addon_service.name.startsWith('heroku-kafka'));
31
+ return addon.addon_service.name
32
+ && (addon.addon_service.name.startsWith('heroku-postgresql')
33
+ || addon.addon_service.name.startsWith('heroku-kafka'));
34
34
  }
35
+ return false;
35
36
  });
36
37
  if (filtered_list.length === 0) {
37
38
  cli_ux_1.cli.error('No addons found');
@@ -54,17 +55,16 @@ async function findAddonGivenAttachment(heroku, addon_attachment, app) {
54
55
  if (res.id === 'not_found') {
55
56
  cli_ux_1.cli.error(res.message);
56
57
  }
57
- let addon = res.find((addon) => {
58
+ const addon = res.find((addon) => {
58
59
  if (addon.addon_service) {
59
- return addon.addon_service.name &&
60
- (addon.addon_service.name.startsWith('heroku-postgresql') ||
61
- addon.addon_service.name.startsWith('heroku-kafka'));
60
+ return addon.addon_service.name
61
+ && (addon.addon_service.name.startsWith('heroku-postgresql')
62
+ || addon.addon_service.name.startsWith('heroku-kafka'));
62
63
  }
64
+ return false;
63
65
  });
64
- if (!addon) {
65
- cli_ux_1.cli.error('No addons found');
66
- }
67
- else {
66
+ if (addon) {
68
67
  return addon;
69
68
  }
69
+ cli_ux_1.cli.error('No addons found');
70
70
  }
@@ -0,0 +1,8 @@
1
+ export declare function isErrorHttp(error: unknown): error is {
2
+ http: {
3
+ body: {
4
+ resource: string;
5
+ };
6
+ statusCode: number;
7
+ };
8
+ };
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isErrorHttp = void 0;
4
+ function isErrorHttp(error) {
5
+ return error !== null && typeof error === 'object' && Reflect.has(error, 'http');
6
+ }
7
+ exports.isErrorHttp = isErrorHttp;
@@ -0,0 +1,3 @@
1
+ export declare function isErrorMessage(error: unknown): error is {
2
+ message: string;
3
+ };
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isErrorMessage = void 0;
4
+ function isErrorMessage(error) {
5
+ return error !== null && typeof error === 'object' && Reflect.has(error, 'message');
6
+ }
7
+ exports.isErrorMessage = isErrorMessage;
@@ -1,3 +1,3 @@
1
1
  import { MTLSCertificate, MTLSIPRule } from '../base';
2
- export declare const certificatesTable: (data: MTLSCertificate[]) => void;
3
- export declare const ipRulesTable: (data: MTLSIPRule[]) => void;
2
+ export declare const certificatesTable: (data: Array<MTLSCertificate>) => void;
3
+ export declare const ipRulesTable: (data: Array<MTLSIPRule>) => void;
@@ -1,15 +1,18 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ipRulesTable = exports.certificatesTable = void 0;
3
4
  const cli_ux_1 = require("cli-ux");
4
- exports.certificatesTable = (data) => cli_ux_1.cli.table(data, {
5
+ const certificatesTable = (data) => cli_ux_1.cli.table(data, {
5
6
  id: { header: 'id' },
6
7
  created_at: { header: 'Created At' },
7
8
  status: { header: 'Status' }
8
9
  });
9
- exports.ipRulesTable = (data) => cli_ux_1.cli.table(data, {
10
+ exports.certificatesTable = certificatesTable;
11
+ const ipRulesTable = (data) => cli_ux_1.cli.table(data, {
10
12
  id: { header: 'id' },
11
13
  cidr: { header: 'CIDR' },
12
14
  description: { header: 'Description' },
13
15
  created_at: { header: 'Created At' },
14
16
  status: { header: 'Status' }
15
17
  });
18
+ exports.ipRulesTable = ipRulesTable;
@@ -1 +1 @@
1
- {"version":"0.8.1","commands":{"data:mtls:create":{"id":"data:mtls:create","description":"enable MTLS for your addon","pluginName":"@heroku-cli/plugin-mtls","pluginType":"core","aliases":[],"examples":["$ heroku data:mtls:create postgresql-sushi-12345"],"flags":{"app":{"name":"app","type":"option","char":"a","description":"app to run command against","required":true}},"args":[{"name":"addon"}]},"data:mtls:destroy":{"id":"data:mtls:destroy","description":"destroy MTLS configuration on your addon","pluginName":"@heroku-cli/plugin-mtls","pluginType":"core","aliases":["data:mtls:delete"],"examples":["$ heroku data:mtls:destroy postgresql-sushi-12345"],"flags":{"app":{"name":"app","type":"option","char":"a","description":"app to run command against","required":true}},"args":[{"name":"addon"}]},"data:mtls":{"id":"data:mtls","description":"get the status of MTLS for your addon","pluginName":"@heroku-cli/plugin-mtls","pluginType":"core","aliases":[],"examples":["$ heroku data:mtls postgresql-sushi-12345"],"flags":{"app":{"name":"app","type":"option","char":"a","description":"app to run command against","required":true}},"args":[{"name":"addon"}]},"data:mtls:certificates:create":{"id":"data:mtls:certificates:create","description":"create a new certificate for your MTLS enabled addon","pluginName":"@heroku-cli/plugin-mtls","pluginType":"core","aliases":[],"examples":["$ heroku data:mtls:certificates:create postgresql-sushi-12345"],"flags":{"app":{"name":"app","type":"option","char":"a","description":"app to run command against","required":true}},"args":[{"name":"addon"}]},"data:mtls:certificates:delete":{"id":"data:mtls:certificates:delete","description":"delete a specific certificate for your MTLS enabled addon","pluginName":"@heroku-cli/plugin-mtls","pluginType":"core","aliases":[],"examples":["$ heroku data:mtls:certificates:delete postgresql-sushi-12345 --id \"1862ec85-fdc1-47b3-924e-a91d26ca3a7c\""],"flags":{"app":{"name":"app","type":"option","char":"a","description":"app to run command against","required":true},"id":{"name":"id","type":"option","description":"id of certificate","required":true}},"args":[{"name":"addon"}]},"data:mtls:certificates:download":{"id":"data:mtls:certificates:download","description":"download your certificate bundle for your mTLS addon","pluginName":"@heroku-cli/plugin-mtls","pluginType":"core","aliases":[],"examples":["$ heroku data:mtls:certificates:download postgresql-sushi-12345 --id \"3559a4df-2c82-4473-86cf-181310a6ef4f\"","$ heroku data:mtls:certificates:download postgresql-sushi-12345 --id \"3559a4df-2c82-4473-86cf-181310a6ef4f\" --dir \"./folder\"","$ heroku data:mtls:certificates:download postgresql-sushi-12345 --id \"3559a4df-2c82-4473-86cf-181310a6ef4f --prefix \"prefix_\""],"flags":{"app":{"name":"app","type":"option","char":"a","description":"app to run command against","required":true},"dir":{"name":"dir","type":"option","description":"directory to download files to. defaults to HOME:/.postgresql","required":false},"id":{"name":"id","type":"option","description":"ID of certificate to download","required":false},"prefix":{"name":"prefix","type":"option","description":"prefix to put in front of downloaded file names","required":true,"default":""}},"args":[{"name":"addon"}]},"data:mtls:certificates:get":{"id":"data:mtls:certificates:get","description":"get a specific certificate for your MTLS enabled addon","pluginName":"@heroku-cli/plugin-mtls","pluginType":"core","aliases":[],"examples":["$ heroku data:mtls:certificates:create postgresql-sushi-12345 --id \"1862ec85-fdc1-47b3-924e-a91d26ca3a7c\""],"flags":{"app":{"name":"app","type":"option","char":"a","description":"app to run command against","required":true},"id":{"name":"id","type":"option","description":"id of IP Rule","required":true}},"args":[{"name":"addon"}]},"data:mtls:certificates":{"id":"data:mtls:certificates","description":"get the certificates for your MTLS enabled addon","pluginName":"@heroku-cli/plugin-mtls","pluginType":"core","aliases":[],"examples":["$ heroku data:mtls:ip-rules postgresql-sushi-12345"],"flags":{"app":{"name":"app","type":"option","char":"a","description":"app to run command against","required":true}},"args":[{"name":"addon"}]},"data:mtls:ip-rules:create":{"id":"data:mtls:ip-rules:create","description":"create an IP Rule for your MTLS enabled addon","pluginName":"@heroku-cli/plugin-mtls","pluginType":"core","aliases":[],"examples":["$ heroku data:mtls:ip-rules:create postgresql-sushi-12345 --cidr \"1.2.3.4/32\" --description \"home IP address\""],"flags":{"app":{"name":"app","type":"option","char":"a","description":"app to run command against","required":true},"cidr":{"name":"cidr","type":"option","required":true},"description":{"name":"description","type":"option","required":false}},"args":[{"name":"addon"}]},"data:mtls:ip-rules:delete":{"id":"data:mtls:ip-rules:delete","description":"delete a specific IP Rule for your MTLS enabled addon","pluginName":"@heroku-cli/plugin-mtls","pluginType":"core","aliases":[],"examples":["$ heroku data:mtls:ip-rules:delete postgresql-sushi-12345 --id \"1862ec85-fdc1-47b3-924e-a91d26ca3a7c\""],"flags":{"app":{"name":"app","type":"option","char":"a","description":"app to run command against","required":true},"cidr":{"name":"cidr","type":"option","description":"cidr of IP Rule"},"id":{"name":"id","type":"option","description":"id of IP Rule"}},"args":[{"name":"addon"}]},"data:mtls:ip-rules:get":{"id":"data:mtls:ip-rules:get","description":"get a specific IP Rule for your MTLS enabled addon","pluginName":"@heroku-cli/plugin-mtls","pluginType":"core","aliases":[],"examples":["$ heroku data:mtls:ip-rules:get postgresql-sushi-12345 --id \"1862ec85-fdc1-47b3-924e-a91d26ca3a7c\""],"flags":{"app":{"name":"app","type":"option","char":"a","description":"app to run command against","required":true},"id":{"name":"id","type":"option","description":"id of IP Rule","required":true}},"args":[{"name":"addon"}]},"data:mtls:ip-rules":{"id":"data:mtls:ip-rules","description":"get the IP Rules for your MTLS enabled addon","pluginName":"@heroku-cli/plugin-mtls","pluginType":"core","aliases":[],"examples":["$ heroku data:mtls:ip-rules postgresql-sushi-12345"],"flags":{"app":{"name":"app","type":"option","char":"a","description":"app to run command against","required":true}},"args":[{"name":"addon"}]}}}
1
+ {"version":"0.9.0","commands":{"data:mtls:create":{"id":"data:mtls:create","description":"enable MTLS for your addon","pluginName":"@heroku-cli/plugin-mtls","pluginType":"core","aliases":[],"examples":["$ heroku data:mtls:create postgresql-sushi-12345"],"flags":{"app":{"name":"app","type":"option","char":"a","description":"app to run command against","required":true}},"args":[{"name":"addon"}]},"data:mtls:destroy":{"id":"data:mtls:destroy","description":"destroy MTLS configuration on your addon","pluginName":"@heroku-cli/plugin-mtls","pluginType":"core","aliases":["data:mtls:delete"],"examples":["$ heroku data:mtls:destroy postgresql-sushi-12345"],"flags":{"app":{"name":"app","type":"option","char":"a","description":"app to run command against","required":true}},"args":[{"name":"addon"}]},"data:mtls":{"id":"data:mtls","description":"get the status of MTLS for your addon","pluginName":"@heroku-cli/plugin-mtls","pluginType":"core","aliases":[],"examples":["$ heroku data:mtls postgresql-sushi-12345"],"flags":{"app":{"name":"app","type":"option","char":"a","description":"app to run command against","required":true}},"args":[{"name":"addon"}]},"data:mtls:certificates:create":{"id":"data:mtls:certificates:create","description":"create a new certificate for your MTLS enabled addon","pluginName":"@heroku-cli/plugin-mtls","pluginType":"core","aliases":[],"examples":["$ heroku data:mtls:certificates:create postgresql-sushi-12345"],"flags":{"app":{"name":"app","type":"option","char":"a","description":"app to run command against","required":true}},"args":[{"name":"addon"}]},"data:mtls:certificates:delete":{"id":"data:mtls:certificates:delete","description":"delete a specific certificate for your MTLS enabled addon","pluginName":"@heroku-cli/plugin-mtls","pluginType":"core","aliases":[],"examples":["$ heroku data:mtls:certificates:delete postgresql-sushi-12345 --id \"1862ec85-fdc1-47b3-924e-a91d26ca3a7c\""],"flags":{"app":{"name":"app","type":"option","char":"a","description":"app to run command against","required":true},"id":{"name":"id","type":"option","description":"id of certificate","required":true}},"args":[{"name":"addon"}]},"data:mtls:certificates:download":{"id":"data:mtls:certificates:download","description":"download your certificate bundle for your mTLS addon","pluginName":"@heroku-cli/plugin-mtls","pluginType":"core","aliases":[],"examples":["$ heroku data:mtls:certificates:download postgresql-sushi-12345 --id \"3559a4df-2c82-4473-86cf-181310a6ef4f\"","$ heroku data:mtls:certificates:download postgresql-sushi-12345 --id \"3559a4df-2c82-4473-86cf-181310a6ef4f\" --dir \"./folder\"","$ heroku data:mtls:certificates:download postgresql-sushi-12345 --id \"3559a4df-2c82-4473-86cf-181310a6ef4f --prefix \"prefix_\""],"flags":{"app":{"name":"app","type":"option","char":"a","description":"app to run command against","required":true},"dir":{"name":"dir","type":"option","description":"directory to download files to. defaults to HOME:/.postgresql","required":false},"id":{"name":"id","type":"option","description":"ID of certificate to download","required":false},"prefix":{"name":"prefix","type":"option","description":"prefix to put in front of downloaded file names","required":true,"default":""}},"args":[{"name":"addon"}]},"data:mtls:certificates:get":{"id":"data:mtls:certificates:get","description":"get a specific certificate for your MTLS enabled addon","pluginName":"@heroku-cli/plugin-mtls","pluginType":"core","aliases":[],"examples":["$ heroku data:mtls:certificates:create postgresql-sushi-12345 --id \"1862ec85-fdc1-47b3-924e-a91d26ca3a7c\""],"flags":{"app":{"name":"app","type":"option","char":"a","description":"app to run command against","required":true},"id":{"name":"id","type":"option","description":"id of IP Rule","required":true}},"args":[{"name":"addon"}]},"data:mtls:certificates":{"id":"data:mtls:certificates","description":"get the certificates for your MTLS enabled addon","pluginName":"@heroku-cli/plugin-mtls","pluginType":"core","aliases":[],"examples":["$ heroku data:mtls:ip-rules postgresql-sushi-12345"],"flags":{"app":{"name":"app","type":"option","char":"a","description":"app to run command against","required":true}},"args":[{"name":"addon"}]},"data:mtls:ip-rules:create":{"id":"data:mtls:ip-rules:create","description":"create an IP Rule for your MTLS enabled addon","pluginName":"@heroku-cli/plugin-mtls","pluginType":"core","aliases":[],"examples":["$ heroku data:mtls:ip-rules:create postgresql-sushi-12345 --cidr \"1.2.3.4/32\" --description \"home IP address\""],"flags":{"app":{"name":"app","type":"option","char":"a","description":"app to run command against","required":true},"cidr":{"name":"cidr","type":"option","required":true},"description":{"name":"description","type":"option","required":false}},"args":[{"name":"addon"}]},"data:mtls:ip-rules:delete":{"id":"data:mtls:ip-rules:delete","description":"delete a specific IP Rule for your MTLS enabled addon","pluginName":"@heroku-cli/plugin-mtls","pluginType":"core","aliases":[],"examples":["$ heroku data:mtls:ip-rules:delete postgresql-sushi-12345 --id \"1862ec85-fdc1-47b3-924e-a91d26ca3a7c\""],"flags":{"app":{"name":"app","type":"option","char":"a","description":"app to run command against","required":true},"cidr":{"name":"cidr","type":"option","description":"cidr of IP Rule"},"id":{"name":"id","type":"option","description":"id of IP Rule"}},"args":[{"name":"addon"}]},"data:mtls:ip-rules:get":{"id":"data:mtls:ip-rules:get","description":"get a specific IP Rule for your MTLS enabled addon","pluginName":"@heroku-cli/plugin-mtls","pluginType":"core","aliases":[],"examples":["$ heroku data:mtls:ip-rules:get postgresql-sushi-12345 --id \"1862ec85-fdc1-47b3-924e-a91d26ca3a7c\""],"flags":{"app":{"name":"app","type":"option","char":"a","description":"app to run command against","required":true},"id":{"name":"id","type":"option","description":"id of IP Rule","required":true}},"args":[{"name":"addon"}]},"data:mtls:ip-rules":{"id":"data:mtls:ip-rules","description":"get the IP Rules for your MTLS enabled addon","pluginName":"@heroku-cli/plugin-mtls","pluginType":"core","aliases":[],"examples":["$ heroku data:mtls:ip-rules postgresql-sushi-12345"],"flags":{"app":{"name":"app","type":"option","char":"a","description":"app to run command against","required":true}},"args":[{"name":"addon"}]}}}
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@heroku-cli/plugin-mtls",
3
3
  "description": "heroku mtls cli",
4
- "version": "0.8.1",
5
- "author": "rmanrique@heroku.com",
4
+ "version": "0.9.0",
5
+ "author": "Heroku",
6
6
  "bugs": "https://github.com/heroku/heroku-cli-plugin-mtls/issues",
7
7
  "dependencies": {
8
8
  "@heroku-cli/color": "^1.1.14",
@@ -13,7 +13,7 @@
13
13
  "@types/supports-color": "^5.3.0",
14
14
  "cli-ux": "^5.3.0",
15
15
  "inquirer": "^6.5.0",
16
- "tslib": "^1"
16
+ "tslib": "~2.6.2"
17
17
  },
18
18
  "devDependencies": {
19
19
  "@fancy-test/nock": "^0.1.1",
@@ -21,19 +21,22 @@
21
21
  "@oclif/dev-cli": "^1",
22
22
  "@oclif/plugin-help": "^2",
23
23
  "@oclif/test": "^1",
24
- "@oclif/tslint": "^3",
25
24
  "@types/chai": "^4",
26
25
  "@types/mocha": "^5",
27
- "@types/node": "^10",
26
+ "@types/node": "^20.10.4",
27
+ "@types/sinon": "^17.0.2",
28
+ "@typescript-eslint/eslint-plugin": "^6.14.0",
29
+ "@typescript-eslint/parser": "6.x",
28
30
  "chai": "^4",
29
- "globby": "^8",
30
- "mocha": "^5",
31
+ "eslint": "8.x",
32
+ "eslint-config-oclif": "^5.0.0",
33
+ "eslint-config-oclif-typescript": "^3.0.26",
34
+ "mocha": "10.x",
31
35
  "nock": "^10.0.6",
32
- "nyc": "^13",
36
+ "nyc": "^15.1.0",
33
37
  "sinon": "^7.3.2",
34
- "ts-node": "^8",
35
- "tslint": "^5",
36
- "typescript": "^3.3"
38
+ "ts-node": "10.x",
39
+ "typescript": "4.x"
37
40
  },
38
41
  "engines": {
39
42
  "node": ">=8.0.0"
@@ -58,10 +61,12 @@
58
61
  },
59
62
  "repository": "heroku/heroku-cli-plugin-mtls",
60
63
  "scripts": {
64
+ "lint": "eslint . --ext .ts --config .eslintrc",
65
+ "lint:fix": "yarn run lint -- --fix",
61
66
  "postpack": "rm -f oclif.manifest.json",
62
- "posttest": "tslint -p test -t stylish",
67
+ "posttest": "yarn run lint",
63
68
  "prepack": "rm -rf lib && tsc -b && oclif-dev manifest && oclif-dev readme",
64
- "test": "nyc --extension .ts mocha --forbid-only \"test/**/*.test.ts\"",
69
+ "test": "nyc --extension .ts mocha --config test/mocharc.json --forbid-only \"test/**/*.test.ts\"",
65
70
  "version": "oclif-dev readme && git add README.md"
66
71
  }
67
72
  }