opal-security 3.2.2 → 3.2.4

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 (36) hide show
  1. package/README.md +22 -22
  2. package/lib/commands/login.js +11 -11
  3. package/lib/commands/request/get.js +2 -1
  4. package/lib/graphql/graphql.d.ts +855 -158
  5. package/lib/graphql/graphql.js +107 -10
  6. package/lib/handler.d.ts +6 -6
  7. package/lib/handler.js +1 -1
  8. package/lib/labels.js +3 -0
  9. package/lib/lib/apollo.d.ts +3 -3
  10. package/lib/lib/apollo.js +24 -47
  11. package/lib/lib/request/api/mutations/create-request.d.ts +2 -2
  12. package/lib/lib/request/api/queries/apps.d.ts +2 -2
  13. package/lib/lib/request/api/queries/assets.d.ts +3 -3
  14. package/lib/lib/request/api/queries/assets.js +5 -5
  15. package/lib/lib/request/api/queries/request-defaults.d.ts +2 -2
  16. package/lib/lib/request/api/queries/request-defaults.js +2 -1
  17. package/lib/lib/request/api/queries/requests.d.ts +4 -4
  18. package/lib/lib/request/api/queries/roles.d.ts +3 -3
  19. package/lib/lib/request/api/queries/roles.js +9 -9
  20. package/lib/lib/request/displays.d.ts +3 -3
  21. package/lib/lib/request/displays.js +15 -15
  22. package/lib/lib/request/prompts/apps-prompt.d.ts +2 -2
  23. package/lib/lib/request/prompts/asset-prompt.d.ts +3 -3
  24. package/lib/lib/request/prompts/asset-prompt.js +27 -43
  25. package/lib/lib/request/prompts/duration-prompt.js +3 -0
  26. package/lib/lib/request/prompts/index.d.ts +0 -1
  27. package/lib/lib/request/prompts/index.js +1 -2
  28. package/lib/lib/request/prompts/role-prompt.d.ts +2 -2
  29. package/lib/lib/request/prompts/role-prompt.js +7 -16
  30. package/lib/lib/request/request-utils.d.ts +7 -8
  31. package/lib/lib/request/request-utils.js +17 -16
  32. package/lib/lib/resources.d.ts +1 -1
  33. package/lib/lib/sessions.d.ts +1 -1
  34. package/lib/lib/sessions.js +3 -2
  35. package/oclif.manifest.json +1 -1
  36. package/package.json +4 -3
@@ -1,5 +1,5 @@
1
1
  import type { Command } from "@oclif/core";
2
- import type { ResourceAccessLevel, ResourceAccessLevelInput } from "../types";
2
+ import type { ResourceAccessLevel, ResourceAccessLevelInput } from "../graphql/graphql";
3
3
  export type ResourceInfo = {
4
4
  id: string;
5
5
  name: string;
@@ -1,4 +1,4 @@
1
1
  import type { Command } from "@oclif/core";
2
- import type { ResourceAccessLevelInput } from "../types";
2
+ import type { ResourceAccessLevelInput } from "../graphql/graphql";
3
3
  export declare const getOrCreateSession: (command: Command, resourceId: string, accessLevel: ResourceAccessLevelInput, sessionId: string | undefined, metadataFragment: string, wantNewSession?: boolean) => Promise<any>;
4
4
  export declare const getSessionExpirationMessage: (session: any) => string;
@@ -118,6 +118,7 @@ const openBrowserAndPollForSession = async (command, message, resourceId, access
118
118
  return session;
119
119
  };
120
120
  const createSession = async (command, resourceId, accessLevel, sessionId, metadataFragment, wantNewSession) => {
121
+ var _a, _b, _c, _d;
121
122
  const { resp, error } = await (0, handler_1.runMutation)({
122
123
  command: command,
123
124
  query: CreateSessionDocument.replace("METADATA_FRAGMENT", metadataFragment),
@@ -130,9 +131,9 @@ const createSession = async (command, resourceId, accessLevel, sessionId, metada
130
131
  if (error) {
131
132
  return (0, apollo_1.handleError)(command, error);
132
133
  }
133
- switch (resp === null || resp === void 0 ? void 0 : resp.data.createSession.__typename) {
134
+ switch ((_b = (_a = resp === null || resp === void 0 ? void 0 : resp.data) === null || _a === void 0 ? void 0 : _a.createSession) === null || _b === void 0 ? void 0 : _b.__typename) {
134
135
  case "CreateSessionResult": {
135
- return resp.data.createSession.session;
136
+ return (_d = (_c = resp.data) === null || _c === void 0 ? void 0 : _c.createSession) === null || _d === void 0 ? void 0 : _d.session;
136
137
  }
137
138
  case "MfaInvalidError": {
138
139
  return openBrowserAndPollForSession(command, "❗ MFA validation needed. Please connect via browser. Opening browser and awaiting validation...", resourceId, accessLevel.accessLevelRemoteId, sessionId, metadataFragment, wantNewSession);
@@ -1047,5 +1047,5 @@
1047
1047
  ]
1048
1048
  }
1049
1049
  },
1050
- "version": "3.2.2"
1050
+ "version": "3.2.4"
1051
1051
  }
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "opal-security",
3
3
  "description": "Opal allows you to centrally manage access to all of your sensitive systems.",
4
- "version": "3.2.2",
4
+ "version": "3.2.4",
5
5
  "author": "Stephen Cobbe",
6
6
  "bin": {
7
7
  "opal": "./bin/run"
8
8
  },
9
9
  "bugs": "https://github.com/opalsecurity/opal-cli/issues",
10
10
  "dependencies": {
11
- "@apollo/client": "^3.13.5",
11
+ "@apollo/client": "^4.0.4",
12
12
  "@oclif/core": "^3.19.3",
13
13
  "@oclif/plugin-autocomplete": "^1.4.6",
14
14
  "@oclif/plugin-help": "^5.2.20",
@@ -17,7 +17,7 @@
17
17
  "chalk": "^2.4.2",
18
18
  "cli-table3": "^0.6.5",
19
19
  "enquirer": "^2.4.1",
20
- "graphql": "^15.5.0",
20
+ "graphql": "^16.11.0",
21
21
  "inquirer": "^8.2.6",
22
22
  "inquirer-autocomplete-prompt": "^2.0.1",
23
23
  "keychain": "^1.5.0",
@@ -27,6 +27,7 @@
27
27
  "open": "^8.0.4",
28
28
  "openid-client": "^5.6.5",
29
29
  "prettyjson": "^1.2.1",
30
+ "rxjs": "^7.8.2",
30
31
  "semver": "^7.5.4",
31
32
  "tslib": "^2.8.1"
32
33
  },