@socketsecurity/cli-with-sentry 0.15.60 → 0.15.62

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.
@@ -29,6 +29,10 @@ function normalizeRetryOptions(options) {
29
29
  // Optional callback invoked on each retry attempt:
30
30
  // (attempt: number, error: unknown, delay: number) => void
31
31
  onRetry,
32
+ // Whether onRetry can cancel retries by returning `false`.
33
+ onRetryCancelOnFalse = false,
34
+ // Whether onRetry will rethrow errors.
35
+ onRetryRethrow = false,
32
36
  // Number of retry attempts (0 = no retries, only initial attempt).
33
37
  retries = 0,
34
38
  // AbortSignal used to support cancellation.
@@ -42,6 +46,8 @@ function normalizeRetryOptions(options) {
42
46
  jitter,
43
47
  maxDelayMs,
44
48
  onRetry,
49
+ onRetryCancelOnFalse,
50
+ onRetryRethrow,
45
51
  retries,
46
52
  signal
47
53
  }
@@ -129,6 +135,8 @@ async function pRetry(callbackFn, options) {
129
135
  jitter,
130
136
  maxDelayMs,
131
137
  onRetry,
138
+ onRetryCancelOnFalse,
139
+ onRetryRethrow,
132
140
  retries,
133
141
  signal
134
142
  } = normalizeRetryOptions(options)
@@ -166,8 +174,15 @@ async function pRetry(callbackFn, options) {
166
174
  waitTime = Math.min(waitTime, maxDelayMs)
167
175
  if (typeof onRetry === 'function') {
168
176
  try {
169
- onRetry(retries - attempts, e, waitTime)
170
- } catch {}
177
+ const result = onRetry(retries - attempts, e, waitTime)
178
+ if (result === false && onRetryCancelOnFalse) {
179
+ break
180
+ }
181
+ } catch (e) {
182
+ if (onRetryRethrow) {
183
+ throw e
184
+ }
185
+ }
171
186
  }
172
187
  // eslint-disable-next-line no-await-in-loop
173
188
  await timers.setTimeout(waitTime, undefined, { signal })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@socketsecurity/cli-with-sentry",
3
- "version": "0.15.60",
3
+ "version": "0.15.62",
4
4
  "description": "CLI for Socket.dev, includes Sentry error handling, otherwise identical to the regular `socket` package",
5
5
  "homepage": "https://github.com/SocketDev/socket-cli",
6
6
  "license": "MIT",
@@ -87,10 +87,10 @@
87
87
  "@biomejs/biome": "1.9.4",
88
88
  "@coana-tech/cli": "14.9.24",
89
89
  "@cyclonedx/cdxgen": "11.3.2",
90
- "@dotenvx/dotenvx": "1.44.1",
91
- "@eslint/compat": "1.2.9",
90
+ "@dotenvx/dotenvx": "1.44.2",
91
+ "@eslint/compat": "1.3.0",
92
92
  "@eslint/js": "9.28.0",
93
- "@npmcli/arborist": "9.1.1",
93
+ "@npmcli/arborist": "9.1.2",
94
94
  "@octokit/graphql": "9.0.1",
95
95
  "@octokit/openapi-types": "25.1.0",
96
96
  "@octokit/request-error": "7.0.0",
@@ -111,21 +111,21 @@
111
111
  "@socketregistry/is-interactive": "1.0.6",
112
112
  "@socketregistry/packageurl-js": "1.0.7",
113
113
  "@socketsecurity/config": "3.0.1",
114
- "@socketsecurity/registry": "1.0.207",
115
- "@socketsecurity/sdk": "1.4.43",
114
+ "@socketsecurity/registry": "1.0.208",
115
+ "@socketsecurity/sdk": "1.4.45",
116
116
  "@types/blessed": "0.1.25",
117
117
  "@types/cmd-shim": "5.0.2",
118
118
  "@types/js-yaml": "4.0.9",
119
119
  "@types/micromatch": "4.0.9",
120
120
  "@types/mock-fs": "4.13.4",
121
- "@types/node": "24.0.0",
121
+ "@types/node": "24.0.1",
122
122
  "@types/npmcli__arborist": "6.3.0",
123
123
  "@types/proc-log": "3.0.4",
124
124
  "@types/semver": "7.7.0",
125
125
  "@types/which": "3.0.4",
126
126
  "@types/yargs-parser": "21.0.3",
127
127
  "@typescript-eslint/parser": "8.34.0",
128
- "@typescript/native-preview": "7.0.0-dev.20250610.1",
128
+ "@typescript/native-preview": "7.0.0-dev.20250612.1",
129
129
  "@vitest/coverage-v8": "3.2.3",
130
130
  "blessed": "0.1.81",
131
131
  "blessed-contrib": "4.11.0",
@@ -137,7 +137,7 @@
137
137
  "dev-null-cli": "2.0.0",
138
138
  "eslint": "9.28.0",
139
139
  "eslint-import-resolver-typescript": "4.4.3",
140
- "eslint-plugin-import-x": "4.15.1",
140
+ "eslint-plugin-import-x": "4.15.2",
141
141
  "eslint-plugin-n": "17.19.0",
142
142
  "eslint-plugin-sort-destructure-keys": "2.0.0",
143
143
  "eslint-plugin-unicorn": "56.0.1",
@@ -146,7 +146,7 @@
146
146
  "husky": "9.1.7",
147
147
  "ignore": "7.0.5",
148
148
  "js-yaml": "npm:@zkochan/js-yaml@0.0.7",
149
- "knip": "5.60.2",
149
+ "knip": "5.61.0",
150
150
  "lint-staged": "16.1.0",
151
151
  "magic-string": "0.30.17",
152
152
  "meow": "13.2.0",
@@ -156,9 +156,9 @@
156
156
  "npm-package-arg": "12.0.2",
157
157
  "npm-run-all2": "8.0.4",
158
158
  "open": "10.1.2",
159
- "oxlint": "1.0.0",
159
+ "oxlint": "1.1.0",
160
160
  "pony-cause": "2.1.11",
161
- "rollup": "4.42.0",
161
+ "rollup": "4.43.0",
162
162
  "semver": "7.7.2",
163
163
  "synp": "1.9.14",
164
164
  "terminal-link": "2.1.1",
@@ -234,6 +234,6 @@
234
234
  "strict": true
235
235
  },
236
236
  "dependencies": {
237
- "@sentry/node": "9.28.0"
237
+ "@sentry/node": "9.28.1"
238
238
  }
239
239
  }