opal-security 3.0.0 → 3.0.1-beta.4f1a7ce

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 (80) hide show
  1. package/README.md +59 -44
  2. package/bin/run +1 -1
  3. package/lib/commands/aws/identity.d.ts +1 -1
  4. package/lib/commands/aws/identity.js +2 -2
  5. package/lib/commands/clear-auth-provider.d.ts +1 -1
  6. package/lib/commands/clear-auth-provider.js +3 -3
  7. package/lib/commands/curl-example.d.ts +1 -1
  8. package/lib/commands/curl-example.js +2 -2
  9. package/lib/commands/iam-roles/start.d.ts +1 -1
  10. package/lib/commands/iam-roles/start.js +14 -14
  11. package/lib/commands/kube-roles/start.d.ts +1 -1
  12. package/lib/commands/kube-roles/start.js +10 -10
  13. package/lib/commands/login.d.ts +1 -1
  14. package/lib/commands/login.js +71 -63
  15. package/lib/commands/logout.d.ts +1 -1
  16. package/lib/commands/logout.js +3 -3
  17. package/lib/commands/postgres-instances/start.d.ts +1 -1
  18. package/lib/commands/postgres-instances/start.js +35 -34
  19. package/lib/commands/request/create.d.ts +6 -0
  20. package/lib/commands/request/create.js +37 -0
  21. package/lib/commands/request/get.d.ts +6 -0
  22. package/lib/commands/request/get.js +13 -0
  23. package/lib/commands/request/list.d.ts +7 -0
  24. package/lib/commands/request/list.js +14 -0
  25. package/lib/commands/resources/get.d.ts +1 -1
  26. package/lib/commands/resources/get.js +11 -4
  27. package/lib/commands/set-auth-provider.d.ts +1 -1
  28. package/lib/commands/set-auth-provider.js +6 -4
  29. package/lib/commands/set-custom-header.d.ts +1 -1
  30. package/lib/commands/set-custom-header.js +5 -3
  31. package/lib/commands/set-token.d.ts +1 -1
  32. package/lib/commands/set-token.js +26 -19
  33. package/lib/commands/set-url.d.ts +1 -1
  34. package/lib/commands/set-url.js +13 -12
  35. package/lib/commands/ssh/copyFrom.d.ts +1 -1
  36. package/lib/commands/ssh/copyFrom.js +13 -13
  37. package/lib/commands/ssh/copyTo.d.ts +1 -1
  38. package/lib/commands/ssh/copyTo.js +13 -13
  39. package/lib/commands/ssh/start.d.ts +1 -1
  40. package/lib/commands/ssh/start.js +14 -15
  41. package/lib/graphql/fragment-masking.d.ts +19 -0
  42. package/lib/graphql/fragment-masking.js +21 -0
  43. package/lib/graphql/gql.d.ts +46 -0
  44. package/lib/graphql/gql.js +14 -0
  45. package/lib/graphql/graphql.d.ts +11476 -0
  46. package/lib/graphql/graphql.js +1819 -0
  47. package/lib/graphql/index.d.ts +2 -0
  48. package/lib/graphql/index.js +5 -0
  49. package/lib/handler.d.ts +5 -5
  50. package/lib/handler.js +7 -7
  51. package/lib/index.d.ts +1 -1
  52. package/lib/lib/apollo.d.ts +3 -2
  53. package/lib/lib/apollo.js +59 -46
  54. package/lib/lib/aws.js +15 -12
  55. package/lib/lib/cmd.d.ts +4 -6
  56. package/lib/lib/cmd.js +11 -11
  57. package/lib/lib/config.js +14 -14
  58. package/lib/lib/credentials/index.d.ts +1 -1
  59. package/lib/lib/credentials/index.js +6 -6
  60. package/lib/lib/credentials/keychain.js +5 -5
  61. package/lib/lib/credentials/localEncryption.d.ts +2 -2
  62. package/lib/lib/credentials/localEncryption.js +33 -24
  63. package/lib/lib/flags.js +9 -9
  64. package/lib/lib/requests.d.ts +22 -0
  65. package/lib/lib/requests.js +274 -0
  66. package/lib/lib/resources.d.ts +2 -2
  67. package/lib/lib/resources.js +29 -23
  68. package/lib/lib/sessions.d.ts +2 -2
  69. package/lib/lib/sessions.js +18 -17
  70. package/lib/lib/ssh.d.ts +1 -1
  71. package/lib/lib/ssh.js +8 -8
  72. package/lib/lib/util.d.ts +0 -1
  73. package/lib/lib/util.js +13 -13
  74. package/lib/types.d.ts +1787 -1787
  75. package/lib/utils/displays.d.ts +5 -0
  76. package/lib/utils/displays.js +65 -0
  77. package/lib/utils/utils.d.ts +1 -0
  78. package/lib/utils/utils.js +18 -0
  79. package/oclif.manifest.json +70 -3
  80. package/package.json +25 -29
package/lib/lib/ssh.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- import { Command } from '@oclif/core';
1
+ import type { Command } from "@oclif/core";
2
2
  export declare const selectComputeInstance: (command: Command, action: string) => Promise<void | import("./resources").ResourceInfo>;
3
3
  export declare const assertSessionManagerPluginExists: () => Promise<boolean>;
package/lib/lib/ssh.js CHANGED
@@ -4,18 +4,18 @@ exports.assertSessionManagerPluginExists = exports.selectComputeInstance = void
4
4
  const cmd_1 = require("../lib/cmd");
5
5
  const resources_1 = require("./resources");
6
6
  const selectComputeInstance = async (command, action) => {
7
- return (0, resources_1.promptUserForResource)(command, 'AWS_EC2_INSTANCE', `Select an EC2 instance to ${action}`);
7
+ return (0, resources_1.promptUserForResource)(command, "AWS_EC2_INSTANCE", `Select an EC2 instance to ${action}`);
8
8
  };
9
9
  exports.selectComputeInstance = selectComputeInstance;
10
10
  const assertSessionManagerPluginExists = async () => {
11
- const errorMessage = '❗ AWS session manager plugin is required to use SSH functionality. ' +
12
- 'Please install it then retry your command. Installation instructions can be found at ' +
13
- 'https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager-working-with-install-plugin.html.';
14
- let checkPluginCommand = 'command -v session-manager-plugin';
15
- if (process.platform === 'win32')
16
- checkPluginCommand = 'where session-manager-plugin';
11
+ const errorMessage = "❗ AWS session manager plugin is required to use SSH functionality. " +
12
+ "Please install it then retry your command. Installation instructions can be found at " +
13
+ "https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager-working-with-install-plugin.html.";
14
+ let checkPluginCommand = "command -v session-manager-plugin";
15
+ if (process.platform === "win32")
16
+ checkPluginCommand = "where session-manager-plugin";
17
17
  try {
18
- const stdOut = await (0, cmd_1.runCommandExecWithCallback)(checkPluginCommand, function (error, stdOut, stdErr) {
18
+ const stdOut = await (0, cmd_1.runCommandExecWithCallback)(checkPluginCommand, (error, stdOut, stdErr) => {
19
19
  // Error if there's no output, meaning the plugin is not installed
20
20
  if (!stdOut) {
21
21
  console.log(errorMessage);
package/lib/lib/util.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- /// <reference types="node" />
2
1
  export declare const sleep: (ms: number) => Promise<unknown>;
3
2
  export declare const copyToClipboard: (content: string) => import("child_process").ChildProcess;
4
3
  export declare const displayContent: (content: string) => import("child_process").ChildProcess;
package/lib/lib/util.js CHANGED
@@ -1,40 +1,40 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.displayContent = exports.copyToClipboard = exports.sleep = void 0;
4
- const child_process_1 = require("child_process");
4
+ const node_child_process_1 = require("node:child_process");
5
5
  const sleep = (ms) => {
6
- return new Promise(resolve => {
6
+ return new Promise((resolve) => {
7
7
  setTimeout(resolve, ms);
8
8
  });
9
9
  };
10
10
  exports.sleep = sleep;
11
11
  const getCopyCommand = () => {
12
12
  switch (process.platform) {
13
- case 'darwin':
14
- return 'pbcopy';
15
- case 'win32':
16
- return 'clip';
13
+ case "darwin":
14
+ return "pbcopy";
15
+ case "win32":
16
+ return "clip";
17
17
  default:
18
- return 'xclip -selection clipboard';
18
+ return "xclip -selection clipboard";
19
19
  }
20
20
  };
21
21
  const copyToClipboard = (content) => {
22
22
  const copyCommand = getCopyCommand();
23
- return (0, child_process_1.exec)(`echo "${content}" | ${copyCommand}`);
23
+ return (0, node_child_process_1.exec)(`echo "${content}" | ${copyCommand}`);
24
24
  };
25
25
  exports.copyToClipboard = copyToClipboard;
26
26
  const getDisplayCommand = () => {
27
27
  switch (process.platform) {
28
- case 'win32':
29
- return 'more';
28
+ case "win32":
29
+ return "more";
30
30
  default:
31
- return 'less';
31
+ return "less";
32
32
  }
33
33
  };
34
34
  const displayContent = (content) => {
35
35
  const displayCommand = getDisplayCommand();
36
- return (0, child_process_1.spawn)(`cat <<< "${content}" | ${displayCommand}`, {
37
- stdio: 'inherit',
36
+ return (0, node_child_process_1.spawn)(`cat <<< "${content}" | ${displayCommand}`, {
37
+ stdio: "inherit",
38
38
  shell: true,
39
39
  });
40
40
  };