@socketsecurity/cli-with-sentry 1.1.48 → 1.1.49
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.
- package/CHANGELOG.md +11 -0
- package/dist/cli.js +121 -15
- package/dist/cli.js.map +1 -1
- package/dist/constants.js +4 -4
- package/dist/constants.js.map +1 -1
- package/dist/tsconfig.dts.tsbuildinfo +1 -1
- package/dist/types/commands/npm/cmd-npm.d.mts.map +1 -1
- package/dist/types/commands/npx/cmd-npx.d.mts.map +1 -1
- package/dist/types/commands/pnpm/cmd-pnpm.d.mts.map +1 -1
- package/dist/types/commands/yarn/cmd-yarn.d.mts.map +1 -1
- package/dist/types/utils/ecosystem.d.mts +6 -3
- package/dist/types/utils/ecosystem.d.mts.map +1 -1
- package/dist/types/utils/sdk.d.mts.map +1 -1
- package/dist/types/utils/telemetry/integration.d.mts +146 -0
- package/dist/types/utils/telemetry/integration.d.mts.map +1 -0
- package/dist/types/utils/telemetry/service.d.mts +65 -0
- package/dist/types/utils/telemetry/service.d.mts.map +1 -0
- package/dist/types/utils/telemetry/types.d.mts +40 -0
- package/dist/types/utils/telemetry/types.d.mts.map +1 -0
- package/dist/utils.js +915 -16
- package/dist/utils.js.map +1 -1
- package/dist/vendor.js +124 -20
- package/package.json +4 -4
package/dist/vendor.js
CHANGED
|
@@ -27712,7 +27712,8 @@ var isInteractiveExports = /*@__PURE__*/ requireIsInteractive();
|
|
|
27712
27712
|
var dist$e = {};
|
|
27713
27713
|
|
|
27714
27714
|
var name$4 = "@socketsecurity/sdk";
|
|
27715
|
-
var version$8 = "1.4.
|
|
27715
|
+
var version$8 = "1.4.95";
|
|
27716
|
+
var packageManager = "pnpm@10.24.0";
|
|
27716
27717
|
var license = "MIT";
|
|
27717
27718
|
var description = "SDK for the Socket API client";
|
|
27718
27719
|
var author = {
|
|
@@ -27855,6 +27856,7 @@ var typeCoverage = {
|
|
|
27855
27856
|
var require$$14 = {
|
|
27856
27857
|
name: name$4,
|
|
27857
27858
|
version: version$8,
|
|
27859
|
+
packageManager: packageManager,
|
|
27858
27860
|
license: license,
|
|
27859
27861
|
description: description,
|
|
27860
27862
|
author: author,
|
|
@@ -28018,14 +28020,14 @@ function requireDist$e () {
|
|
|
28018
28020
|
/**
|
|
28019
28021
|
* Array of sensitive header names that should be redacted in logs
|
|
28020
28022
|
*/
|
|
28021
|
-
const SENSITIVE_HEADERS = [
|
|
28023
|
+
const SENSITIVE_HEADERS = new Set([
|
|
28022
28024
|
'authorization',
|
|
28023
28025
|
'cookie',
|
|
28024
28026
|
'set-cookie',
|
|
28025
28027
|
'proxy-authorization',
|
|
28026
28028
|
'www-authenticate',
|
|
28027
|
-
'proxy-authenticate'
|
|
28028
|
-
];
|
|
28029
|
+
'proxy-authenticate'
|
|
28030
|
+
]);
|
|
28029
28031
|
/**
|
|
28030
28032
|
* Sanitize headers for logging by redacting sensitive values.
|
|
28031
28033
|
*/
|
|
@@ -28041,7 +28043,7 @@ function requireDist$e () {
|
|
|
28041
28043
|
// Plain object iteration works for both HeadersRecord and IncomingHttpHeaders
|
|
28042
28044
|
for (const [key, value] of Object.entries(headers)) {
|
|
28043
28045
|
const keyLower = key.toLowerCase();
|
|
28044
|
-
if (SENSITIVE_HEADERS.
|
|
28046
|
+
if (SENSITIVE_HEADERS.has(keyLower)) {
|
|
28045
28047
|
sanitized[key] = '[REDACTED]';
|
|
28046
28048
|
}
|
|
28047
28049
|
else {
|
|
@@ -28080,7 +28082,7 @@ function requireDist$e () {
|
|
|
28080
28082
|
duration: Date.now() - startTime,
|
|
28081
28083
|
status: response.statusCode,
|
|
28082
28084
|
statusText: response.statusMessage,
|
|
28083
|
-
headers: sanitizeHeaders(response.headers)
|
|
28085
|
+
headers: sanitizeHeaders(response.headers)
|
|
28084
28086
|
});
|
|
28085
28087
|
return response;
|
|
28086
28088
|
}
|
|
@@ -28096,7 +28098,7 @@ function requireDist$e () {
|
|
|
28096
28098
|
method,
|
|
28097
28099
|
url,
|
|
28098
28100
|
headers: sanitizeHeaders(options.headers),
|
|
28099
|
-
timeout: options.timeout
|
|
28101
|
+
timeout: options.timeout
|
|
28100
28102
|
});
|
|
28101
28103
|
try {
|
|
28102
28104
|
const req = getHttpModule(baseUrl)
|
|
@@ -28112,7 +28114,7 @@ function requireDist$e () {
|
|
|
28112
28114
|
duration: Date.now() - startTime,
|
|
28113
28115
|
status: response.statusCode,
|
|
28114
28116
|
statusText: response.statusMessage,
|
|
28115
|
-
headers: sanitizeHeaders(response.headers)
|
|
28117
|
+
headers: sanitizeHeaders(response.headers)
|
|
28116
28118
|
});
|
|
28117
28119
|
return response;
|
|
28118
28120
|
}
|
|
@@ -28121,7 +28123,7 @@ function requireDist$e () {
|
|
|
28121
28123
|
method,
|
|
28122
28124
|
url,
|
|
28123
28125
|
duration: Date.now() - startTime,
|
|
28124
|
-
error: error
|
|
28126
|
+
error: error
|
|
28125
28127
|
});
|
|
28126
28128
|
throw error;
|
|
28127
28129
|
}
|
|
@@ -28134,19 +28136,19 @@ function requireDist$e () {
|
|
|
28134
28136
|
const headers = {
|
|
28135
28137
|
...options?.headers,
|
|
28136
28138
|
'Content-Length': Buffer.byteLength(body, 'utf8'),
|
|
28137
|
-
'Content-Type': 'application/json'
|
|
28139
|
+
'Content-Type': 'application/json'
|
|
28138
28140
|
};
|
|
28139
28141
|
hooks?.onRequest?.({
|
|
28140
28142
|
method,
|
|
28141
28143
|
url,
|
|
28142
28144
|
headers: sanitizeHeaders(headers),
|
|
28143
|
-
timeout: options.timeout
|
|
28145
|
+
timeout: options.timeout
|
|
28144
28146
|
});
|
|
28145
28147
|
try {
|
|
28146
28148
|
const req = getHttpModule(baseUrl).request(url, {
|
|
28147
28149
|
method,
|
|
28148
28150
|
...options,
|
|
28149
|
-
headers
|
|
28151
|
+
headers
|
|
28150
28152
|
});
|
|
28151
28153
|
req.write(body);
|
|
28152
28154
|
req.end();
|
|
@@ -28157,7 +28159,7 @@ function requireDist$e () {
|
|
|
28157
28159
|
duration: Date.now() - startTime,
|
|
28158
28160
|
status: response.statusCode,
|
|
28159
28161
|
statusText: response.statusMessage,
|
|
28160
|
-
headers: sanitizeHeaders(response.headers)
|
|
28162
|
+
headers: sanitizeHeaders(response.headers)
|
|
28161
28163
|
});
|
|
28162
28164
|
return response;
|
|
28163
28165
|
}
|
|
@@ -28166,7 +28168,52 @@ function requireDist$e () {
|
|
|
28166
28168
|
method,
|
|
28167
28169
|
url,
|
|
28168
28170
|
duration: Date.now() - startTime,
|
|
28169
|
-
error: error
|
|
28171
|
+
error: error
|
|
28172
|
+
});
|
|
28173
|
+
throw error;
|
|
28174
|
+
}
|
|
28175
|
+
}
|
|
28176
|
+
async function createPutRequest(baseUrl, urlPath, putJson, options, hooks) {
|
|
28177
|
+
const startTime = Date.now();
|
|
28178
|
+
const url = `${baseUrl}${urlPath}`;
|
|
28179
|
+
const method = 'PUT';
|
|
28180
|
+
const body = JSON.stringify(putJson);
|
|
28181
|
+
const headers = {
|
|
28182
|
+
...options?.headers,
|
|
28183
|
+
'Content-Length': Buffer.byteLength(body, 'utf8'),
|
|
28184
|
+
'Content-Type': 'application/json'
|
|
28185
|
+
};
|
|
28186
|
+
hooks?.onRequest?.({
|
|
28187
|
+
method,
|
|
28188
|
+
url,
|
|
28189
|
+
headers: sanitizeHeaders(headers),
|
|
28190
|
+
timeout: options.timeout
|
|
28191
|
+
});
|
|
28192
|
+
try {
|
|
28193
|
+
const req = getHttpModule(baseUrl).request(url, {
|
|
28194
|
+
method,
|
|
28195
|
+
...options,
|
|
28196
|
+
headers
|
|
28197
|
+
});
|
|
28198
|
+
req.write(body);
|
|
28199
|
+
req.end();
|
|
28200
|
+
const response = await getResponse(req);
|
|
28201
|
+
hooks?.onResponse?.({
|
|
28202
|
+
method,
|
|
28203
|
+
url,
|
|
28204
|
+
duration: Date.now() - startTime,
|
|
28205
|
+
status: response.statusCode,
|
|
28206
|
+
statusText: response.statusMessage,
|
|
28207
|
+
headers: sanitizeHeaders(response.headers)
|
|
28208
|
+
});
|
|
28209
|
+
return response;
|
|
28210
|
+
}
|
|
28211
|
+
catch (error) {
|
|
28212
|
+
hooks?.onResponse?.({
|
|
28213
|
+
method,
|
|
28214
|
+
url,
|
|
28215
|
+
duration: Date.now() - startTime,
|
|
28216
|
+
error: error
|
|
28170
28217
|
});
|
|
28171
28218
|
throw error;
|
|
28172
28219
|
}
|
|
@@ -28224,19 +28271,19 @@ function requireDist$e () {
|
|
|
28224
28271
|
const method = 'POST';
|
|
28225
28272
|
const headers = {
|
|
28226
28273
|
...options?.headers,
|
|
28227
|
-
'Content-Type': `multipart/form-data; boundary=${boundary}
|
|
28274
|
+
'Content-Type': `multipart/form-data; boundary=${boundary}`
|
|
28228
28275
|
};
|
|
28229
28276
|
const startTime = Date.now();
|
|
28230
28277
|
const req = getHttpModule(baseUrl).request(url, {
|
|
28231
28278
|
method,
|
|
28232
28279
|
...options,
|
|
28233
|
-
headers
|
|
28280
|
+
headers
|
|
28234
28281
|
});
|
|
28235
28282
|
hooks?.onRequest?.({
|
|
28236
28283
|
method,
|
|
28237
28284
|
url: url.toString(),
|
|
28238
28285
|
headers: sanitizeHeaders(headers),
|
|
28239
|
-
timeout: options.timeout
|
|
28286
|
+
timeout: options.timeout
|
|
28240
28287
|
});
|
|
28241
28288
|
// Send headers early to prompt server validation (auth, URL, quota, etc.).
|
|
28242
28289
|
req.flushHeaders();
|
|
@@ -28248,7 +28295,7 @@ function requireDist$e () {
|
|
|
28248
28295
|
duration: Date.now() - startTime,
|
|
28249
28296
|
status: response.statusCode,
|
|
28250
28297
|
statusText: response.statusMessage,
|
|
28251
|
-
headers: sanitizeHeaders(response.headers)
|
|
28298
|
+
headers: sanitizeHeaders(response.headers)
|
|
28252
28299
|
});
|
|
28253
28300
|
pass(response);
|
|
28254
28301
|
}, error => {
|
|
@@ -28256,7 +28303,7 @@ function requireDist$e () {
|
|
|
28256
28303
|
method,
|
|
28257
28304
|
url: url.toString(),
|
|
28258
28305
|
duration: Date.now() - startTime,
|
|
28259
|
-
error: error
|
|
28306
|
+
error: error
|
|
28260
28307
|
});
|
|
28261
28308
|
fail(error);
|
|
28262
28309
|
});
|
|
@@ -29020,6 +29067,63 @@ function requireDist$e () {
|
|
|
29020
29067
|
return (await this.#handleApiError(e));
|
|
29021
29068
|
}
|
|
29022
29069
|
}
|
|
29070
|
+
async updateOrgTelemetryConfig(orgSlug, telemetryData) {
|
|
29071
|
+
try {
|
|
29072
|
+
const data = await getResponseJson(await createPutRequest(this.#baseUrl, `orgs/${encodeURIComponent(orgSlug)}/telemetry/config`, telemetryData, this.#reqOptions, this.#hooks));
|
|
29073
|
+
return this.#handleApiSuccess(data);
|
|
29074
|
+
}
|
|
29075
|
+
catch (e) {
|
|
29076
|
+
return await this.#handleApiError(e);
|
|
29077
|
+
}
|
|
29078
|
+
}
|
|
29079
|
+
async getOrgTelemetryConfig(orgSlug) {
|
|
29080
|
+
try {
|
|
29081
|
+
const data = await getResponseJson(await createGetRequest(this.#baseUrl, `orgs/${encodeURIComponent(orgSlug)}/telemetry/config`, this.#reqOptions, this.#hooks));
|
|
29082
|
+
return this.#handleApiSuccess(data);
|
|
29083
|
+
}
|
|
29084
|
+
catch (e) {
|
|
29085
|
+
return await this.#handleApiError(e);
|
|
29086
|
+
}
|
|
29087
|
+
}
|
|
29088
|
+
async postOrgTelemetry(orgSlug, telemetryData) {
|
|
29089
|
+
try {
|
|
29090
|
+
const data = await getResponseJson(await createPostRequest(this.#baseUrl, `orgs/${encodeURIComponent(orgSlug)}/telemetry`, telemetryData, this.#reqOptions, this.#hooks));
|
|
29091
|
+
return {
|
|
29092
|
+
success: true,
|
|
29093
|
+
status: 200,
|
|
29094
|
+
data: data
|
|
29095
|
+
};
|
|
29096
|
+
}
|
|
29097
|
+
catch (e) {
|
|
29098
|
+
if (!(e instanceof ResponseError)) {
|
|
29099
|
+
throw new Error('Unexpected Socket API error', { cause: e });
|
|
29100
|
+
}
|
|
29101
|
+
const { statusCode } = e.response;
|
|
29102
|
+
if (statusCode && statusCode >= 500) {
|
|
29103
|
+
throw new Error(`Socket API server error (${statusCode})`, { cause: e });
|
|
29104
|
+
}
|
|
29105
|
+
const bodyStr = await getErrorResponseBody(e.response);
|
|
29106
|
+
let body;
|
|
29107
|
+
try {
|
|
29108
|
+
const parsed = JSON.parse(bodyStr);
|
|
29109
|
+
if (typeof parsed?.error?.message === 'string') {
|
|
29110
|
+
body = parsed.error.message;
|
|
29111
|
+
}
|
|
29112
|
+
}
|
|
29113
|
+
catch {
|
|
29114
|
+
body = bodyStr;
|
|
29115
|
+
}
|
|
29116
|
+
const result = {
|
|
29117
|
+
success: false,
|
|
29118
|
+
status: statusCode ?? 0,
|
|
29119
|
+
error: e.message ?? 'Unknown error'
|
|
29120
|
+
};
|
|
29121
|
+
if (body) {
|
|
29122
|
+
result.cause = body;
|
|
29123
|
+
}
|
|
29124
|
+
return result;
|
|
29125
|
+
}
|
|
29126
|
+
}
|
|
29023
29127
|
}
|
|
29024
29128
|
dist$e.SocketSdk = SocketSdk;
|
|
29025
29129
|
// Add aliases.
|
|
@@ -162218,5 +162322,5 @@ exports.terminalLinkExports = terminalLinkExports;
|
|
|
162218
162322
|
exports.updater = updater$1;
|
|
162219
162323
|
exports.yargsParser = yargsParser;
|
|
162220
162324
|
exports.yoctocolorsCjsExports = yoctocolorsCjsExports;
|
|
162221
|
-
//# debugId=
|
|
162325
|
+
//# debugId=a1e9cf09-ba27-40db-936b-544fb7a17c51
|
|
162222
162326
|
//# sourceMappingURL=vendor.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@socketsecurity/cli-with-sentry",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.49",
|
|
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 AND OFL-1.1",
|
|
@@ -95,7 +95,7 @@
|
|
|
95
95
|
"@babel/preset-typescript": "7.27.1",
|
|
96
96
|
"@babel/runtime": "7.28.4",
|
|
97
97
|
"@biomejs/biome": "2.2.4",
|
|
98
|
-
"@coana-tech/cli": "14.12.
|
|
98
|
+
"@coana-tech/cli": "14.12.134",
|
|
99
99
|
"@cyclonedx/cdxgen": "11.11.0",
|
|
100
100
|
"@dotenvx/dotenvx": "1.49.0",
|
|
101
101
|
"@eslint/compat": "1.3.2",
|
|
@@ -123,7 +123,7 @@
|
|
|
123
123
|
"@socketregistry/packageurl-js": "1.0.9",
|
|
124
124
|
"@socketsecurity/config": "3.0.1",
|
|
125
125
|
"@socketsecurity/registry": "1.1.17",
|
|
126
|
-
"@socketsecurity/sdk": "1.4.
|
|
126
|
+
"@socketsecurity/sdk": "1.4.95",
|
|
127
127
|
"@types/blessed": "0.1.25",
|
|
128
128
|
"@types/cmd-shim": "5.0.2",
|
|
129
129
|
"@types/js-yaml": "4.0.9",
|
|
@@ -291,6 +291,6 @@
|
|
|
291
291
|
"strict": true
|
|
292
292
|
},
|
|
293
293
|
"dependencies": {
|
|
294
|
-
"@sentry/node": "10.
|
|
294
|
+
"@sentry/node": "10.31.0"
|
|
295
295
|
}
|
|
296
296
|
}
|