@socketsecurity/cli 0.4.1 → 0.4.2

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 (2) hide show
  1. package/lib/utils/sdk.js +9 -2
  2. package/package.json +9 -9
package/lib/utils/sdk.js CHANGED
@@ -9,10 +9,17 @@ import prompts from 'prompts'
9
9
  import { AuthError } from './errors.js'
10
10
 
11
11
  /**
12
- * @returns {Promise<import('@socketsecurity/sdk').SocketSdk>}
12
+ * The API key should be stored globally for the duration of the CLI execution
13
+ *
14
+ * @type {string | undefined}
13
15
  */
16
+ let apiKey
17
+
18
+ /** @returns {Promise<import('@socketsecurity/sdk').SocketSdk>} */
14
19
  export async function setupSdk () {
15
- let apiKey = process.env['SOCKET_SECURITY_API_KEY']
20
+ if (!apiKey) {
21
+ apiKey = process.env['SOCKET_SECURITY_API_KEY']
22
+ }
16
23
 
17
24
  if (!apiKey && isInteractive()) {
18
25
  const input = await prompts({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@socketsecurity/cli",
3
- "version": "0.4.1",
3
+ "version": "0.4.2",
4
4
  "description": "CLI tool for Socket.dev",
5
5
  "homepage": "http://github.com/SocketDev/socket-cli-js",
6
6
  "repository": {
@@ -38,7 +38,7 @@
38
38
  "test": "run-s check test:*"
39
39
  },
40
40
  "devDependencies": {
41
- "@socketsecurity/eslint-config": "^1.0.0",
41
+ "@socketsecurity/eslint-config": "^2.0.0",
42
42
  "@tsconfig/node14": "^1.0.3",
43
43
  "@types/chai": "^4.3.3",
44
44
  "@types/chai-as-promised": "^7.1.5",
@@ -46,22 +46,22 @@
46
46
  "@types/mock-fs": "^4.13.1",
47
47
  "@types/node": "^14.18.31",
48
48
  "@types/prompts": "^2.4.1",
49
- "@types/update-notifier": "^6.0.1",
50
- "@typescript-eslint/eslint-plugin": "^5.48.2",
51
- "@typescript-eslint/parser": "^5.48.2",
49
+ "@types/update-notifier": "^6.0.2",
50
+ "@typescript-eslint/eslint-plugin": "^5.51.0",
51
+ "@typescript-eslint/parser": "^5.51.0",
52
52
  "c8": "^7.12.0",
53
53
  "chai": "^4.3.6",
54
54
  "chai-as-promised": "^7.1.1",
55
55
  "dependency-check": "^5.0.0-7",
56
- "eslint": "^8.32.0",
56
+ "eslint": "^8.34.0",
57
57
  "eslint-config-standard": "^17.0.0",
58
58
  "eslint-config-standard-jsx": "^11.0.0",
59
59
  "eslint-import-resolver-typescript": "^3.5.3",
60
60
  "eslint-plugin-import": "^2.27.5",
61
- "eslint-plugin-jsdoc": "^39.5.0",
61
+ "eslint-plugin-jsdoc": "^40.0.0",
62
62
  "eslint-plugin-n": "^15.6.1",
63
63
  "eslint-plugin-promise": "^6.1.1",
64
- "eslint-plugin-react": "^7.32.1",
64
+ "eslint-plugin-react": "^7.32.2",
65
65
  "eslint-plugin-react-hooks": "^4.6.0",
66
66
  "eslint-plugin-unicorn": "^45.0.2",
67
67
  "husky": "^8.0.1",
@@ -71,7 +71,7 @@
71
71
  "nock": "^13.3.0",
72
72
  "npm-run-all2": "^6.0.2",
73
73
  "type-coverage": "^2.24.1",
74
- "typescript": "~4.9.4"
74
+ "typescript": "~4.9.5"
75
75
  },
76
76
  "dependencies": {
77
77
  "@apideck/better-ajv-errors": "^0.3.6",