@socketsecurity/cli-with-sentry 1.0.99 → 1.0.101
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 +35 -41
- package/dist/cli.js.map +1 -1
- package/dist/constants.js +3 -3
- package/dist/constants.js.map +1 -1
- package/dist/tsconfig.dts.tsbuildinfo +1 -1
- package/dist/types/commands/fix/coana-fix.d.mts.map +1 -1
- package/dist/types/commands/fix/pull-request.d.mts.map +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -3379,47 +3379,37 @@ async function fetchGhsaDetails(ids) {
|
|
|
3379
3379
|
const octokitGraphql = getOctokitGraphql();
|
|
3380
3380
|
try {
|
|
3381
3381
|
const gqlCacheKey = `${ids.join('-')}-graphql-snapshot`;
|
|
3382
|
-
const
|
|
3383
|
-
|
|
3384
|
-
|
|
3385
|
-
|
|
3386
|
-
|
|
3387
|
-
|
|
3388
|
-
|
|
3389
|
-
|
|
3390
|
-
|
|
3391
|
-
|
|
3392
|
-
|
|
3393
|
-
url
|
|
3394
|
-
}
|
|
3395
|
-
vulnerabilities(first: 10) {
|
|
3396
|
-
nodes {
|
|
3397
|
-
package {
|
|
3398
|
-
ecosystem
|
|
3399
|
-
name
|
|
3400
|
-
}
|
|
3401
|
-
vulnerableVersionRange
|
|
3402
|
-
}
|
|
3403
|
-
}
|
|
3382
|
+
const aliases = ids.map((id, index) => `advisory${index}: securityAdvisory(ghsaId: "${id}") {
|
|
3383
|
+
ghsaId
|
|
3384
|
+
summary
|
|
3385
|
+
severity
|
|
3386
|
+
publishedAt
|
|
3387
|
+
withdrawnAt
|
|
3388
|
+
vulnerabilities(first: 10) {
|
|
3389
|
+
nodes {
|
|
3390
|
+
package {
|
|
3391
|
+
ecosystem
|
|
3392
|
+
name
|
|
3404
3393
|
}
|
|
3394
|
+
vulnerableVersionRange
|
|
3405
3395
|
}
|
|
3406
|
-
}
|
|
3407
|
-
|
|
3408
|
-
|
|
3409
|
-
|
|
3410
|
-
|
|
3411
|
-
|
|
3412
|
-
|
|
3413
|
-
for (
|
|
3414
|
-
|
|
3415
|
-
|
|
3416
|
-
|
|
3417
|
-
|
|
3418
|
-
|
|
3419
|
-
|
|
3420
|
-
|
|
3421
|
-
|
|
3422
|
-
require$$8.debugFn('notice', `
|
|
3396
|
+
}
|
|
3397
|
+
}`).join('\n');
|
|
3398
|
+
const gqlResp = await cacheFetch(gqlCacheKey, () => octokitGraphql(`
|
|
3399
|
+
query {
|
|
3400
|
+
${aliases}
|
|
3401
|
+
}
|
|
3402
|
+
`));
|
|
3403
|
+
for (let i = 0, {
|
|
3404
|
+
length
|
|
3405
|
+
} = ids; i < length; i += 1) {
|
|
3406
|
+
const id = ids[i];
|
|
3407
|
+
const advisoryKey = `advisory${i}`;
|
|
3408
|
+
const advisory = gqlResp?.[advisoryKey];
|
|
3409
|
+
if (advisory && advisory.ghsaId) {
|
|
3410
|
+
results.set(id, advisory);
|
|
3411
|
+
} else {
|
|
3412
|
+
require$$8.debugFn('notice', `miss: no advisory found for ${id}`);
|
|
3423
3413
|
}
|
|
3424
3414
|
}
|
|
3425
3415
|
} catch (e) {
|
|
@@ -3938,7 +3928,9 @@ async function coanaFix(fixConfig) {
|
|
|
3938
3928
|
}
|
|
3939
3929
|
};
|
|
3940
3930
|
}
|
|
3931
|
+
require$$8.debugFn('notice', `fetch: ${ids.length} GHSA details for ${arrays.joinAnd(ids)}`);
|
|
3941
3932
|
const ghsaDetails = await fetchGhsaDetails(ids);
|
|
3933
|
+
require$$8.debugFn('notice', `found: ${ghsaDetails.size} GHSA details`);
|
|
3942
3934
|
const scanBaseNames = new Set(scanFilepaths.map(p => path.basename(p)));
|
|
3943
3935
|
let count = 0;
|
|
3944
3936
|
let overallFixed = false;
|
|
@@ -3979,7 +3971,9 @@ async function coanaFix(fixConfig) {
|
|
|
3979
3971
|
continue ghsaLoop;
|
|
3980
3972
|
}
|
|
3981
3973
|
require$$8.debugFn('notice', `pr: creating for ${id}`);
|
|
3982
|
-
const
|
|
3974
|
+
const details = ghsaDetails.get(id);
|
|
3975
|
+
const summary = details?.summary;
|
|
3976
|
+
require$$8.debugFn('notice', `ghsa: ${id} details ${details ? 'found' : 'missing'}`);
|
|
3983
3977
|
const pushed =
|
|
3984
3978
|
// eslint-disable-next-line no-await-in-loop
|
|
3985
3979
|
(await utils.gitCreateBranch(branch, cwd)) && (
|
|
@@ -15529,5 +15523,5 @@ void (async () => {
|
|
|
15529
15523
|
await utils.captureException(e);
|
|
15530
15524
|
}
|
|
15531
15525
|
})();
|
|
15532
|
-
//# debugId=
|
|
15526
|
+
//# debugId=a4903131-9deb-4ec0-b986-17c43c335d82
|
|
15533
15527
|
//# sourceMappingURL=cli.js.map
|