socket 1.1.78 → 1.1.79

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.
@@ -1 +1 @@
1
- {"version":3,"file":"output-scan-reach.d.mts","sourceRoot":"","sources":["../../../../src/commands/scan/output-scan-reach.mts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,qCAAqC,CAAA;AACrF,OAAO,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAE1D,wBAAsB,eAAe,CACnC,MAAM,EAAE,OAAO,CAAC,0BAA0B,CAAC,EAC3C,EAAE,UAAU,EAAE,UAAU,EAAE,EAAE;IAAE,UAAU,EAAE,UAAU,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,GACzE,OAAO,CAAC,IAAI,CAAC,CAmBf"}
1
+ {"version":3,"file":"output-scan-reach.d.mts","sourceRoot":"","sources":["../../../../src/commands/scan/output-scan-reach.mts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,qCAAqC,CAAA;AACrF,OAAO,KAAK,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAE1D,wBAAsB,eAAe,CACnC,MAAM,EAAE,OAAO,CAAC,0BAA0B,CAAC,EAC3C,EAAE,UAAU,EAAE,UAAU,EAAE,EAAE;IAAE,UAAU,EAAE,UAAU,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,GACzE,OAAO,CAAC,IAAI,CAAC,CAmCf"}
@@ -1,2 +1,9 @@
1
+ export type ReachabilityError = {
2
+ componentName: string;
3
+ componentVersion: string;
4
+ ghsaId: string;
5
+ subprojectPath: string;
6
+ };
7
+ export declare function extractReachabilityErrors(socketFactsFile: string): ReachabilityError[];
1
8
  export declare function extractTier1ReachabilityScanId(socketFactsFile: string): string | undefined;
2
9
  //# sourceMappingURL=coana.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"coana.d.mts","sourceRoot":"","sources":["../../../src/utils/coana.mts"],"names":[],"mappings":"AAeA,wBAAgB,8BAA8B,CAC5C,eAAe,EAAE,MAAM,GACtB,MAAM,GAAG,SAAS,CAQpB"}
1
+ {"version":3,"file":"coana.d.mts","sourceRoot":"","sources":["../../../src/utils/coana.mts"],"names":[],"mappings":"AAeA,MAAM,MAAM,iBAAiB,GAAG;IAC9B,aAAa,EAAE,MAAM,CAAA;IACrB,gBAAgB,EAAE,MAAM,CAAA;IACxB,MAAM,EAAE,MAAM,CAAA;IACd,cAAc,EAAE,MAAM,CAAA;CACvB,CAAA;AAED,wBAAgB,yBAAyB,CACvC,eAAe,EAAE,MAAM,GACtB,iBAAiB,EAAE,CA0CrB;AAED,wBAAgB,8BAA8B,CAC5C,eAAe,EAAE,MAAM,GACtB,MAAM,GAAG,SAAS,CAQpB"}
@@ -1 +1 @@
1
- {"version":3,"file":"npm-paths.d.mts","sourceRoot":"","sources":["../../../src/utils/npm-paths.mts"],"names":[],"mappings":"AAsBA,wBAAgB,aAAa,IAAI,MAAM,CAQtC;AAWD,wBAAgB,aAAa,WAyB5B;AAGD,wBAAgB,aAAa,IAAI,MAAM,CAAC,OAAO,CAY9C;AAGD,wBAAgB,aAAa,IAAI,MAAM,CAQtC;AAUD,wBAAgB,oBAAoB,YAEnC;AAED,wBAAgB,oBAAoB,YAEnC"}
1
+ {"version":3,"file":"npm-paths.d.mts","sourceRoot":"","sources":["../../../src/utils/npm-paths.mts"],"names":[],"mappings":"AAwCA,wBAAgB,aAAa,IAAI,MAAM,CAQtC;AAkBD,wBAAgB,aAAa,WAyB5B;AAGD,wBAAgB,aAAa,IAAI,MAAM,CAAC,OAAO,CAY9C;AAGD,wBAAgB,aAAa,IAAI,MAAM,CAQtC;AAmBD,wBAAgB,oBAAoB,YAEnC;AAED,wBAAgB,oBAAoB,YAEnC"}
package/dist/utils.js CHANGED
@@ -4482,6 +4482,36 @@ function* walkNestedMap(map, keys = []) {
4482
4482
  * - Extracts tier 1 reachability scan identifiers
4483
4483
  */
4484
4484
 
4485
+ function extractReachabilityErrors(socketFactsFile) {
4486
+ const json = fs$1.readJsonSync(socketFactsFile, {
4487
+ throws: false
4488
+ });
4489
+ if (!json || !Array.isArray(json.components)) {
4490
+ return [];
4491
+ }
4492
+ const errors = [];
4493
+ for (const component of json.components) {
4494
+ if (!Array.isArray(component.reachability)) {
4495
+ continue;
4496
+ }
4497
+ for (const ghsaEntry of component.reachability) {
4498
+ if (!Array.isArray(ghsaEntry.reachability)) {
4499
+ continue;
4500
+ }
4501
+ for (const entry of ghsaEntry.reachability) {
4502
+ if (entry.type === 'error') {
4503
+ errors.push({
4504
+ componentName: String(component.name ?? ''),
4505
+ componentVersion: String(component.version ?? ''),
4506
+ ghsaId: String(ghsaEntry.ghsa_id ?? ''),
4507
+ subprojectPath: String(entry.subprojectPath ?? '')
4508
+ });
4509
+ }
4510
+ }
4511
+ }
4512
+ }
4513
+ return errors;
4514
+ }
4485
4515
  function extractTier1ReachabilityScanId(socketFactsFile) {
4486
4516
  const json = fs$1.readJsonSync(socketFactsFile, {
4487
4517
  throws: false
@@ -5959,6 +5989,23 @@ function exitWithBinPathError$1(binName) {
5959
5989
  // This line is never reached in production, but helps tests.
5960
5990
  throw new Error('process.exit called');
5961
5991
  }
5992
+
5993
+ // Find a binary next to the running node binary (process.execPath).
5994
+ // This avoids picking up a project-local binary from node_modules/.bin
5995
+ // on PATH, e.g. the standalone "npx" package which bundles npm@5.1.0
5996
+ // that is incompatible with Node 22+.
5997
+ function findBinNextToNode(binName) {
5998
+ const nodeDir = path.dirname(process.execPath);
5999
+ const binPath = path.join(nodeDir, binName);
6000
+ if (fs.existsSync(binPath)) {
6001
+ try {
6002
+ return bin.resolveBinPathSync(binPath);
6003
+ } catch {
6004
+ return undefined;
6005
+ }
6006
+ }
6007
+ return undefined;
6008
+ }
5962
6009
  let _npmBinPath;
5963
6010
  function getNpmBinPath() {
5964
6011
  if (_npmBinPath === undefined) {
@@ -5972,7 +6019,18 @@ function getNpmBinPath() {
5972
6019
  let _npmBinPathDetails;
5973
6020
  function getNpmBinPathDetails() {
5974
6021
  if (_npmBinPathDetails === undefined) {
5975
- _npmBinPathDetails = findBinPathDetailsSync(constants.NPM);
6022
+ // First try to find npm next to the node binary to avoid picking up
6023
+ // a project-local npm from node_modules/.bin on PATH.
6024
+ const npmNextToNode = findBinNextToNode(constants.NPM);
6025
+ if (npmNextToNode) {
6026
+ _npmBinPathDetails = {
6027
+ name: constants.NPM,
6028
+ path: npmNextToNode,
6029
+ shadowed: false
6030
+ };
6031
+ } else {
6032
+ _npmBinPathDetails = findBinPathDetailsSync(constants.NPM);
6033
+ }
5976
6034
  }
5977
6035
  return _npmBinPathDetails;
5978
6036
  }
@@ -6024,7 +6082,20 @@ function getNpxBinPath() {
6024
6082
  let _npxBinPathDetails;
6025
6083
  function getNpxBinPathDetails() {
6026
6084
  if (_npxBinPathDetails === undefined) {
6027
- _npxBinPathDetails = findBinPathDetailsSync('npx');
6085
+ // First try to find npx next to the node binary to avoid picking up
6086
+ // a project-local npx from node_modules/.bin on PATH (e.g., the
6087
+ // standalone npx package which bundles npm@5.1.0, incompatible
6088
+ // with Node 22+).
6089
+ const npxNextToNode = findBinNextToNode('npx');
6090
+ if (npxNextToNode) {
6091
+ _npxBinPathDetails = {
6092
+ name: 'npx',
6093
+ path: npxNextToNode,
6094
+ shadowed: false
6095
+ };
6096
+ } else {
6097
+ _npxBinPathDetails = findBinPathDetailsSync('npx');
6098
+ }
6028
6099
  }
6029
6100
  return _npxBinPathDetails;
6030
6101
  }
@@ -7703,6 +7774,7 @@ exports.detectAndValidatePackageEnvironment = detectAndValidatePackageEnvironmen
7703
7774
  exports.detectDefaultBranch = detectDefaultBranch;
7704
7775
  exports.determineOrgSlug = determineOrgSlug;
7705
7776
  exports.enablePrAutoMerge = enablePrAutoMerge;
7777
+ exports.extractReachabilityErrors = extractReachabilityErrors;
7706
7778
  exports.extractTier1ReachabilityScanId = extractTier1ReachabilityScanId;
7707
7779
  exports.failMsgWithBadge = failMsgWithBadge;
7708
7780
  exports.fetchGhsaDetails = fetchGhsaDetails;
@@ -7813,5 +7885,5 @@ exports.updateConfigValue = updateConfigValue;
7813
7885
  exports.walkNestedMap = walkNestedMap;
7814
7886
  exports.webLink = webLink;
7815
7887
  exports.writeSocketJson = writeSocketJson;
7816
- //# debugId=c107f1c4-3417-4dcc-ad18-d22becac7c1e
7888
+ //# debugId=8ab81ec7-1b88-43f4-85b0-ff74e04851d2
7817
7889
  //# sourceMappingURL=utils.js.map