@socketsecurity/cli-with-sentry 0.15.46 → 0.15.47
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/cli.js +15 -8
- package/dist/cli.js.map +1 -1
- package/dist/constants.js +3 -3
- package/dist/constants.js.map +1 -1
- package/dist/types/commands/fix/pnpm-fix.d.mts.map +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -3702,10 +3702,10 @@ function getSocketBranchPattern(options) {
|
|
|
3702
3702
|
...options
|
|
3703
3703
|
};
|
|
3704
3704
|
const purlObj = purl ? utils.getPurlObject(purl) : null;
|
|
3705
|
-
const escType = purlObj ? regexps.escapeRegExp(purlObj.type) : '[
|
|
3706
|
-
const escWorkspace = workspace ? `${regexps.escapeRegExp(formatBranchName(workspace))}` : '
|
|
3705
|
+
const escType = purlObj ? regexps.escapeRegExp(purlObj.type) : '[^/]+';
|
|
3706
|
+
const escWorkspace = workspace ? `${regexps.escapeRegExp(formatBranchName(workspace))}` : '.+';
|
|
3707
3707
|
const escMaybeNamespace = purlObj?.namespace ? `${regexps.escapeRegExp(formatBranchName(purlObj.namespace))}--` : '';
|
|
3708
|
-
const escFullName = purlObj ? `${escMaybeNamespace}${regexps.escapeRegExp(formatBranchName(purlObj.name))}` : '[
|
|
3708
|
+
const escFullName = purlObj ? `${escMaybeNamespace}${regexps.escapeRegExp(formatBranchName(purlObj.name))}` : '[^/_]+';
|
|
3709
3709
|
const escVersion = purlObj ? regexps.escapeRegExp(formatBranchName(purlObj.version)) : '[^_]+';
|
|
3710
3710
|
const escNewVersion = newVersion ? regexps.escapeRegExp(formatBranchName(newVersion)) : '[^_]+';
|
|
3711
3711
|
return new RegExp(`^socket/(${escType})/(${escWorkspace})/(${escFullName})_(${escVersion})_(${escNewVersion})$`);
|
|
@@ -11662,8 +11662,9 @@ async function testAndDownloadManifestFile({
|
|
|
11662
11662
|
repoApiUrl,
|
|
11663
11663
|
tmpDir
|
|
11664
11664
|
}) {
|
|
11665
|
-
debug.debugFn('
|
|
11665
|
+
debug.debugFn('testing: file', file);
|
|
11666
11666
|
if (!SUPPORTED_FILE_PATTERNS.some(regex => regex.test(file))) {
|
|
11667
|
+
debug.debugFn(' - skip: not a known pattern');
|
|
11667
11668
|
// Not an error.
|
|
11668
11669
|
return {
|
|
11669
11670
|
ok: true,
|
|
@@ -11672,7 +11673,7 @@ async function testAndDownloadManifestFile({
|
|
|
11672
11673
|
}
|
|
11673
11674
|
};
|
|
11674
11675
|
}
|
|
11675
|
-
debug.debugFn('found: manifest file', file);
|
|
11676
|
+
debug.debugFn('found: manifest file, going to attempt to download it;', file);
|
|
11676
11677
|
const result = await downloadManifestFile({
|
|
11677
11678
|
file,
|
|
11678
11679
|
tmpDir,
|
|
@@ -11741,7 +11742,8 @@ async function streamDownloadWithFetch(localPath, downloadUrl) {
|
|
|
11741
11742
|
try {
|
|
11742
11743
|
response = await fetch(downloadUrl);
|
|
11743
11744
|
if (!response.ok) {
|
|
11744
|
-
const errorMsg = `Download failed: ${response.status} ${response.statusText} for ${downloadUrl}`;
|
|
11745
|
+
const errorMsg = `Download failed due to bad server response: ${response.status} ${response.statusText} for ${downloadUrl}`;
|
|
11746
|
+
logger.logger.fail(errorMsg);
|
|
11745
11747
|
return {
|
|
11746
11748
|
ok: false,
|
|
11747
11749
|
message: 'Download Failed',
|
|
@@ -11749,6 +11751,7 @@ async function streamDownloadWithFetch(localPath, downloadUrl) {
|
|
|
11749
11751
|
};
|
|
11750
11752
|
}
|
|
11751
11753
|
if (!response.body) {
|
|
11754
|
+
logger.logger.fail(`Download failed because the server response was empty, for ${downloadUrl}`);
|
|
11752
11755
|
return {
|
|
11753
11756
|
ok: false,
|
|
11754
11757
|
message: 'Download Failed',
|
|
@@ -11767,7 +11770,10 @@ async function streamDownloadWithFetch(localPath, downloadUrl) {
|
|
|
11767
11770
|
data: localPath
|
|
11768
11771
|
};
|
|
11769
11772
|
} catch (error) {
|
|
11770
|
-
logger.logger.fail('An error
|
|
11773
|
+
logger.logger.fail('An error was thrown while trying to download a manifest file... url:', downloadUrl);
|
|
11774
|
+
debug.debugFn('Raw error:');
|
|
11775
|
+
debug.debugFn(error);
|
|
11776
|
+
|
|
11771
11777
|
// If an error occurs and fileStream was created, attempt to clean up.
|
|
11772
11778
|
if (fs$1.existsSync(localPath)) {
|
|
11773
11779
|
// Check if fileStream was even opened before trying to delete
|
|
@@ -11788,6 +11794,7 @@ async function streamDownloadWithFetch(localPath, downloadUrl) {
|
|
|
11788
11794
|
// If error was due to bad HTTP status
|
|
11789
11795
|
detailedError += ` (HTTP Status: ${response.status} ${response.statusText})`;
|
|
11790
11796
|
}
|
|
11797
|
+
debug.debugFn(detailedError);
|
|
11791
11798
|
return {
|
|
11792
11799
|
ok: false,
|
|
11793
11800
|
message: 'Download Failed',
|
|
@@ -14268,5 +14275,5 @@ void (async () => {
|
|
|
14268
14275
|
await utils.captureException(e);
|
|
14269
14276
|
}
|
|
14270
14277
|
})();
|
|
14271
|
-
//# debugId=
|
|
14278
|
+
//# debugId=7ed4fffc-f660-40e2-8f0b-b1981857752e
|
|
14272
14279
|
//# sourceMappingURL=cli.js.map
|