@socketsecurity/cli-with-sentry 0.14.50 → 0.14.51
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/dist/constants.js +2 -2
- package/dist/constants.js.map +1 -1
- package/dist/instrument-with-sentry.js +2 -2
- package/dist/instrument-with-sentry.js.map +1 -1
- package/dist/module-sync/cli.js +91 -108
- package/dist/module-sync/cli.js.map +1 -1
- package/dist/module-sync/index.d.ts +1 -1
- package/dist/module-sync/index.js +18 -19
- package/dist/module-sync/index.js.map +1 -1
- package/dist/module-sync/npm-paths.js +3 -43
- package/dist/module-sync/npm-paths.js.map +1 -1
- package/dist/require/cli.js +91 -108
- package/dist/require/cli.js.map +1 -1
- package/package.json +6 -6
- package/dist/module-sync/logging.d.ts +0 -16
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { SafeEdge } from "./edge.js";
|
|
3
3
|
import { SafeNode } from "./node.js";
|
|
4
4
|
import indentString from "@socketregistry/indent-string/index.cjs";
|
|
5
|
-
import { LogSymbols } from "
|
|
5
|
+
import { LogSymbols } from "@socketsecurity/registry/lib/logger";
|
|
6
6
|
import { SocketSdkResultType } from "@socketsecurity/sdk";
|
|
7
7
|
import { Diff, ArboristClass } from "./types.js";
|
|
8
8
|
import { ObjectEncodingOptions, OpenMode, PathLike } from "node:fs";
|
|
@@ -34,6 +34,7 @@ var npmPaths = require('./npm-paths.js');
|
|
|
34
34
|
var fs = require('node:fs');
|
|
35
35
|
var os = require('node:os');
|
|
36
36
|
var config = require('@socketsecurity/config');
|
|
37
|
+
var logger = require('@socketsecurity/registry/lib/logger');
|
|
37
38
|
var terminalLink = _socketInterop(require('terminal-link'));
|
|
38
39
|
var colors = _socketInterop(require('yoctocolors-cjs'));
|
|
39
40
|
var indentString = require('@socketregistry/indent-string/index.cjs');
|
|
@@ -134,7 +135,7 @@ function getSettings() {
|
|
|
134
135
|
try {
|
|
135
136
|
Object.assign(_settings, JSON.parse(Buffer.from(raw, 'base64').toString()));
|
|
136
137
|
} catch {
|
|
137
|
-
|
|
138
|
+
logger.logger.warn(`Failed to parse settings at ${settingsPath}`);
|
|
138
139
|
}
|
|
139
140
|
} else {
|
|
140
141
|
fs.mkdirSync(path.dirname(settingsPath), {
|
|
@@ -158,7 +159,7 @@ function getSettingsPath() {
|
|
|
158
159
|
if (WIN32) {
|
|
159
160
|
if (!_warnedSettingPathWin32Missing) {
|
|
160
161
|
_warnedSettingPathWin32Missing = true;
|
|
161
|
-
|
|
162
|
+
logger.logger.warn(`Missing %${LOCALAPPDATA}%`);
|
|
162
163
|
}
|
|
163
164
|
} else {
|
|
164
165
|
dataHome = path.join(os.homedir(), ...(process.platform === 'darwin' ? ['Library', 'Application Support'] : ['.local', 'share']));
|
|
@@ -375,7 +376,7 @@ const {
|
|
|
375
376
|
ALERT_TYPE_SOCKET_UPGRADE_AVAILABLE,
|
|
376
377
|
CVE_ALERT_PROPS_FIRST_PATCHED_VERSION_IDENTIFIER: CVE_ALERT_PROPS_FIRST_PATCHED_VERSION_IDENTIFIER$1,
|
|
377
378
|
CVE_ALERT_PROPS_VULNERABLE_VERSION_RANGE,
|
|
378
|
-
abortSignal: abortSignal$
|
|
379
|
+
abortSignal: abortSignal$1
|
|
379
380
|
} = constants;
|
|
380
381
|
async function* createBatchGenerator(chunk) {
|
|
381
382
|
// Adds the first 'abort' listener to abortSignal.
|
|
@@ -386,7 +387,7 @@ async function* createBatchGenerator(chunk) {
|
|
|
386
387
|
headers: {
|
|
387
388
|
Authorization: `Basic ${btoa(`${getPublicToken()}:`)}`
|
|
388
389
|
},
|
|
389
|
-
signal: abortSignal$
|
|
390
|
+
signal: abortSignal$1
|
|
390
391
|
}).end(JSON.stringify({
|
|
391
392
|
components: chunk.map(id => ({
|
|
392
393
|
purl: `pkg:npm/${id}`
|
|
@@ -396,7 +397,7 @@ async function* createBatchGenerator(chunk) {
|
|
|
396
397
|
const {
|
|
397
398
|
0: res
|
|
398
399
|
} = await events.once(req, 'response', {
|
|
399
|
-
signal: abortSignal$
|
|
400
|
+
signal: abortSignal$1
|
|
400
401
|
});
|
|
401
402
|
const ok = res.statusCode >= 200 && res.statusCode <= 299;
|
|
402
403
|
if (!ok) {
|
|
@@ -405,7 +406,7 @@ async function* createBatchGenerator(chunk) {
|
|
|
405
406
|
const rli = readline.createInterface({
|
|
406
407
|
input: res,
|
|
407
408
|
crlfDelay: Infinity,
|
|
408
|
-
signal: abortSignal$
|
|
409
|
+
signal: abortSignal$1
|
|
409
410
|
});
|
|
410
411
|
for await (const line of rli) {
|
|
411
412
|
yield JSON.parse(line);
|
|
@@ -416,11 +417,11 @@ async function* batchScan(pkgIds, concurrencyLimit = 50) {
|
|
|
416
417
|
// abortSignal so we multiply the concurrencyLimit by 2.
|
|
417
418
|
const neededMaxListeners = concurrencyLimit * 2;
|
|
418
419
|
// Increase abortSignal max listeners count to avoid Node's MaxListenersExceededWarning.
|
|
419
|
-
const oldAbortSignalMaxListeners = events.getMaxListeners(abortSignal$
|
|
420
|
+
const oldAbortSignalMaxListeners = events.getMaxListeners(abortSignal$1);
|
|
420
421
|
let abortSignalMaxListeners = oldAbortSignalMaxListeners;
|
|
421
422
|
if (oldAbortSignalMaxListeners < neededMaxListeners) {
|
|
422
423
|
abortSignalMaxListeners = oldAbortSignalMaxListeners + neededMaxListeners;
|
|
423
|
-
events.setMaxListeners(abortSignalMaxListeners, abortSignal$
|
|
424
|
+
events.setMaxListeners(abortSignalMaxListeners, abortSignal$1);
|
|
424
425
|
}
|
|
425
426
|
const {
|
|
426
427
|
length: pkgIdsCount
|
|
@@ -471,7 +472,7 @@ async function* batchScan(pkgIds, concurrencyLimit = 50) {
|
|
|
471
472
|
}
|
|
472
473
|
// Reset abortSignal max listeners count.
|
|
473
474
|
if (abortSignalMaxListeners > oldAbortSignalMaxListeners) {
|
|
474
|
-
events.setMaxListeners(oldAbortSignalMaxListeners, abortSignal$
|
|
475
|
+
events.setMaxListeners(oldAbortSignalMaxListeners, abortSignal$1);
|
|
475
476
|
}
|
|
476
477
|
}
|
|
477
478
|
function isArtifactAlertCveFixable(alert) {
|
|
@@ -485,7 +486,7 @@ function isArtifactAlertUpgradeFixable(alert) {
|
|
|
485
486
|
}
|
|
486
487
|
|
|
487
488
|
const {
|
|
488
|
-
abortSignal
|
|
489
|
+
abortSignal
|
|
489
490
|
} = constants;
|
|
490
491
|
const ERROR_UX = {
|
|
491
492
|
block: true,
|
|
@@ -622,7 +623,7 @@ async function uxLookup(settings) {
|
|
|
622
623
|
while (_uxLookup === undefined) {
|
|
623
624
|
// eslint-disable-next-line no-await-in-loop
|
|
624
625
|
await promises.setTimeout(1, {
|
|
625
|
-
signal: abortSignal
|
|
626
|
+
signal: abortSignal
|
|
626
627
|
});
|
|
627
628
|
}
|
|
628
629
|
return _uxLookup(settings);
|
|
@@ -697,13 +698,13 @@ void (async () => {
|
|
|
697
698
|
_uxLookup = createAlertUXLookup(settings);
|
|
698
699
|
})();
|
|
699
700
|
|
|
700
|
-
const markdownLogSymbols = {
|
|
701
|
+
const markdownLogSymbols = Object.freeze({
|
|
701
702
|
__proto__: null,
|
|
702
703
|
info: ':information_source:',
|
|
703
704
|
error: ':stop_sign:',
|
|
704
705
|
success: ':white_check_mark:',
|
|
705
706
|
warning: ':warning:'
|
|
706
|
-
};
|
|
707
|
+
});
|
|
707
708
|
class ColorOrMarkdown {
|
|
708
709
|
constructor(useMarkdown) {
|
|
709
710
|
this.useMarkdown = !!useMarkdown;
|
|
@@ -739,7 +740,7 @@ class ColorOrMarkdown {
|
|
|
739
740
|
return this.useMarkdown ? `* ${indentedContent.join('\n* ')}\n` : `${indentedContent.join('\n')}\n`;
|
|
740
741
|
}
|
|
741
742
|
get logSymbols() {
|
|
742
|
-
return this.useMarkdown ? markdownLogSymbols :
|
|
743
|
+
return this.useMarkdown ? markdownLogSymbols : logger.Logger.LOG_SYMBOLS;
|
|
743
744
|
}
|
|
744
745
|
}
|
|
745
746
|
|
|
@@ -1455,8 +1456,7 @@ const {
|
|
|
1455
1456
|
NPM_REGISTRY_URL,
|
|
1456
1457
|
OVERRIDES,
|
|
1457
1458
|
PNPM,
|
|
1458
|
-
RESOLUTIONS
|
|
1459
|
-
abortSignal
|
|
1459
|
+
RESOLUTIONS
|
|
1460
1460
|
} = constants;
|
|
1461
1461
|
const formatter = new ColorOrMarkdown(false);
|
|
1462
1462
|
function findBestPatchVersion(node, availableVersions, vulnerableVersionRange, _firstPatchedVersionIdentifier) {
|
|
@@ -1764,8 +1764,7 @@ async function reify(...args) {
|
|
|
1764
1764
|
default: false
|
|
1765
1765
|
}, {
|
|
1766
1766
|
input,
|
|
1767
|
-
output
|
|
1768
|
-
signal: abortSignal
|
|
1767
|
+
output
|
|
1769
1768
|
}))) {
|
|
1770
1769
|
throw new Error('Socket npm exiting due to risks');
|
|
1771
1770
|
}
|
|
@@ -1867,5 +1866,5 @@ exports.safeReadFile = safeReadFile;
|
|
|
1867
1866
|
exports.setupSdk = setupSdk;
|
|
1868
1867
|
exports.updateNode = updateNode;
|
|
1869
1868
|
exports.updateSetting = updateSetting;
|
|
1870
|
-
//# debugId=
|
|
1869
|
+
//# debugId=d413b96a-751b-43c9-8ce7-50c11ea5826
|
|
1871
1870
|
//# sourceMappingURL=index.js.map
|