@socketsecurity/cli-with-sentry 1.0.100 → 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 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 gqlResp = await cacheFetch(gqlCacheKey, () => octokitGraphql(`
3383
- query($identifiers: [SecurityAdvisoryIdentifierFilter!]!) {
3384
- securityAdvisories(first: ${ids.length}, identifiers: $identifiers) {
3385
- nodes {
3386
- ghsaId
3387
- cveId
3388
- summary
3389
- severity
3390
- publishedAt
3391
- withdrawnAt
3392
- references {
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
- identifiers: ids.map(id => ({
3408
- type: 'GHSA',
3409
- value: id
3410
- }))
3411
- }));
3412
- const advisories = gqlResp?.securityAdvisories?.nodes || [];
3413
- for (const advisory of advisories) {
3414
- if (advisory.ghsaId) {
3415
- results.set(advisory.ghsaId, advisory);
3416
- }
3417
- }
3418
-
3419
- // Log any missing advisories
3420
- for (const id of ids) {
3421
- if (!results.has(id)) {
3422
- require$$8.debugFn('notice', `No advisory found for ${id}`);
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) {
@@ -15533,5 +15523,5 @@ void (async () => {
15533
15523
  await utils.captureException(e);
15534
15524
  }
15535
15525
  })();
15536
- //# debugId=ae8893ee-c6c6-456e-8176-51ca01466ef5
15526
+ //# debugId=a4903131-9deb-4ec0-b986-17c43c335d82
15537
15527
  //# sourceMappingURL=cli.js.map