@heroku-cli/plugin-mtls 0.8.2 → 0.9.1

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 (42) hide show
  1. package/README.md +18 -33
  2. package/{lib/base.d.ts → base.d.ts} +11 -11
  3. package/{lib/base.js → base.js} +2 -2
  4. package/{lib/commands → commands}/data/mtls/certificates/create.js +7 -7
  5. package/{lib/commands → commands}/data/mtls/certificates/delete.js +7 -7
  6. package/{lib/commands → commands}/data/mtls/certificates/download.js +29 -26
  7. package/{lib/commands → commands}/data/mtls/certificates/get.js +6 -6
  8. package/{lib/commands → commands}/data/mtls/certificates/index.js +13 -8
  9. package/{lib/commands → commands}/data/mtls/create.js +8 -8
  10. package/{lib/commands → commands}/data/mtls/destroy.js +7 -7
  11. package/{lib/commands → commands}/data/mtls/index.js +15 -10
  12. package/{lib/commands → commands}/data/mtls/ip-rules/create.js +8 -8
  13. package/{lib/commands → commands}/data/mtls/ip-rules/delete.js +7 -7
  14. package/{lib/commands → commands}/data/mtls/ip-rules/get.js +6 -6
  15. package/{lib/commands → commands}/data/mtls/ip-rules/index.js +7 -7
  16. package/lib/{lib/fetcher.js → fetcher.js} +17 -17
  17. package/oclif.manifest.json +1 -1
  18. package/package.json +6 -39
  19. package/utils/is-error-http.d.ts +8 -0
  20. package/utils/is-error-http.js +7 -0
  21. package/utils/is-error-message.d.ts +3 -0
  22. package/utils/is-error-message.js +7 -0
  23. package/utils/table.d.ts +3 -0
  24. package/{lib/utils → utils}/table.js +5 -2
  25. package/LICENSE +0 -21
  26. package/lib/utils/table.d.ts +0 -3
  27. package/yarn.lock +0 -3334
  28. package/{lib/commands → commands}/data/mtls/certificates/create.d.ts +2 -2
  29. package/{lib/commands → commands}/data/mtls/certificates/delete.d.ts +2 -2
  30. package/{lib/commands → commands}/data/mtls/certificates/download.d.ts +2 -2
  31. package/{lib/commands → commands}/data/mtls/certificates/get.d.ts +2 -2
  32. package/{lib/commands → commands}/data/mtls/certificates/index.d.ts +2 -2
  33. package/{lib/commands → commands}/data/mtls/create.d.ts +2 -2
  34. package/{lib/commands → commands}/data/mtls/destroy.d.ts +2 -2
  35. package/{lib/commands → commands}/data/mtls/index.d.ts +2 -2
  36. package/{lib/commands → commands}/data/mtls/ip-rules/create.d.ts +2 -2
  37. package/{lib/commands → commands}/data/mtls/ip-rules/delete.d.ts +2 -2
  38. package/{lib/commands → commands}/data/mtls/ip-rules/get.d.ts +2 -2
  39. package/{lib/commands → commands}/data/mtls/ip-rules/index.d.ts +2 -2
  40. /package/{lib/index.d.ts → index.d.ts} +0 -0
  41. /package/{lib/index.js → index.js} +0 -0
  42. /package/lib/{lib/fetcher.d.ts → fetcher.d.ts} +0 -0
@@ -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;
@@ -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;
@@ -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
  }
@@ -1 +1 @@
1
- {"version":"0.8.2","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.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"}]}}}
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.2",
5
- "author": "rmanrique@heroku.com",
4
+ "version": "0.9.1",
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,55 +13,22 @@
13
13
  "@types/supports-color": "^5.3.0",
14
14
  "cli-ux": "^5.3.0",
15
15
  "inquirer": "^6.5.0",
16
- "tslib": "^1"
17
- },
18
- "devDependencies": {
19
- "@fancy-test/nock": "^0.1.1",
20
- "@heroku-cli/schema": "^1.0.25",
21
- "@oclif/dev-cli": "^1",
22
- "@oclif/plugin-help": "^2",
23
- "@oclif/test": "^1",
24
- "@oclif/tslint": "^3",
25
- "@types/chai": "^4",
26
- "@types/mocha": "^5",
27
- "@types/node": "^10",
28
- "chai": "^4",
29
- "globby": "^8",
30
- "mocha": "^5",
31
- "nock": "^10.0.6",
32
- "nyc": "^13",
33
- "sinon": "^7.3.2",
34
- "ts-node": "^8",
35
- "tslint": "^5",
36
- "typescript": "^3.3"
16
+ "tslib": "~2.6.2"
37
17
  },
38
18
  "engines": {
39
19
  "node": ">=8.0.0"
40
20
  },
41
- "files": [
42
- "/lib",
43
- "/npm-shrinkwrap.json",
44
- "/oclif.manifest.json",
45
- "/yarn.lock"
46
- ],
47
21
  "homepage": "https://github.com/heroku/heroku-cli-plugin-mtls",
48
22
  "keywords": [
49
23
  "oclif-plugin"
50
24
  ],
51
25
  "license": "MIT",
52
26
  "oclif": {
53
- "commands": "./lib/commands",
27
+ "commands": "./commands",
54
28
  "bin": "heroku",
55
29
  "devPlugins": [
56
30
  "@oclif/plugin-help"
57
31
  ]
58
32
  },
59
- "repository": "heroku/heroku-cli-plugin-mtls",
60
- "scripts": {
61
- "postpack": "rm -f oclif.manifest.json",
62
- "posttest": "tslint -p test -t stylish",
63
- "prepack": "rm -rf lib && tsc -b && oclif-dev manifest && oclif-dev readme",
64
- "test": "nyc --extension .ts mocha --forbid-only \"test/**/*.test.ts\"",
65
- "version": "oclif-dev readme && git add README.md"
66
- }
67
- }
33
+ "repository": "heroku/heroku-cli-plugin-mtls"
34
+ }
@@ -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;
@@ -0,0 +1,3 @@
1
+ import { MTLSCertificate, MTLSIPRule } from '../base';
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;
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2019 rmanrique@heroku.com
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
@@ -1,3 +0,0 @@
1
- import { MTLSCertificate, MTLSIPRule } from '../base';
2
- export declare const certificatesTable: (data: MTLSCertificate[]) => void;
3
- export declare const ipRulesTable: (data: MTLSIPRule[]) => void;