@socketsecurity/cli-with-sentry 1.0.7 → 1.0.8

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.
Files changed (140) hide show
  1. package/dist/cli.js +41 -31
  2. package/dist/cli.js.map +1 -1
  3. package/dist/constants.js +8 -3
  4. package/dist/constants.js.map +1 -1
  5. package/dist/shadow-npm-bin.js +5 -5
  6. package/dist/shadow-npm-bin.js.map +1 -1
  7. package/dist/socket-completion.bash +23 -7
  8. package/dist/types/commands/fix/cmd-fix.d.mts.map +1 -1
  9. package/dist/types/commands/fix/handle-fix.d.mts +2 -1
  10. package/dist/types/commands/fix/handle-fix.d.mts.map +1 -1
  11. package/dist/types/commands/install/setup-tab-completion.d.mts.map +1 -1
  12. package/dist/types/commands/manifest/cmd-manifest-cdxgen.d.mts.map +1 -1
  13. package/dist/types/commands/npm/cmd-npm.d.mts.map +1 -1
  14. package/dist/types/commands/npx/cmd-npx.d.mts.map +1 -1
  15. package/dist/types/commands/raw-npm/cmd-raw-npm.d.mts.map +1 -1
  16. package/dist/types/commands/raw-npx/cmd-raw-npx.d.mts.map +1 -1
  17. package/dist/types/constants.d.mts.map +1 -1
  18. package/dist/types/utils/alerts-map.d.mts.map +1 -1
  19. package/dist/types/utils/api.d.mts.map +1 -1
  20. package/dist/types/utils/meow-with-subcommands.d.mts +2 -3
  21. package/dist/types/utils/meow-with-subcommands.d.mts.map +1 -1
  22. package/dist/utils.js +34 -45
  23. package/dist/utils.js.map +1 -1
  24. package/dist/vendor.js +27 -24
  25. package/external/@coana-tech/cli/cli.mjs +1 -1
  26. package/external/@socketsecurity/registry/lib/constants/npm-real-exec-path.js +2 -40
  27. package/external/@socketsecurity/registry/lib/npm.js +102 -71
  28. package/external/@socketsecurity/registry/lib/spinner.js +6 -0
  29. package/external/blessed-contrib/lib/widget/charts/bar.js +4 -3
  30. package/external/blessed-contrib/lib/widget/charts/line.js +4 -3
  31. package/external/blessed-contrib/lib/widget/table.js +3 -3
  32. package/package.json +11 -12
  33. package/external/node-gyp/.release-please-manifest.json +0 -3
  34. package/external/node-gyp/CHANGELOG.md +0 -1053
  35. package/external/node-gyp/CODE_OF_CONDUCT.md +0 -4
  36. package/external/node-gyp/CONTRIBUTING.md +0 -34
  37. package/external/node-gyp/LICENSE +0 -24
  38. package/external/node-gyp/README.md +0 -273
  39. package/external/node-gyp/SECURITY.md +0 -2
  40. package/external/node-gyp/addon.gypi +0 -204
  41. package/external/node-gyp/bin/node-gyp.js +0 -137
  42. package/external/node-gyp/eslint.config.js +0 -3
  43. package/external/node-gyp/gyp/.release-please-manifest.json +0 -3
  44. package/external/node-gyp/gyp/LICENSE +0 -28
  45. package/external/node-gyp/gyp/data/ninja/build.ninja +0 -4
  46. package/external/node-gyp/gyp/data/win/large-pdb-shim.cc +0 -12
  47. package/external/node-gyp/gyp/docs/GypVsCMake.md +0 -116
  48. package/external/node-gyp/gyp/docs/Hacking.md +0 -46
  49. package/external/node-gyp/gyp/docs/InputFormatReference.md +0 -1083
  50. package/external/node-gyp/gyp/docs/LanguageSpecification.md +0 -430
  51. package/external/node-gyp/gyp/docs/README.md +0 -27
  52. package/external/node-gyp/gyp/docs/Testing.md +0 -450
  53. package/external/node-gyp/gyp/docs/UserDocumentation.md +0 -965
  54. package/external/node-gyp/gyp/gyp +0 -8
  55. package/external/node-gyp/gyp/gyp.bat +0 -5
  56. package/external/node-gyp/gyp/gyp_main.py +0 -45
  57. package/external/node-gyp/gyp/pylib/gyp/MSVSNew.py +0 -365
  58. package/external/node-gyp/gyp/pylib/gyp/MSVSProject.py +0 -206
  59. package/external/node-gyp/gyp/pylib/gyp/MSVSSettings.py +0 -1272
  60. package/external/node-gyp/gyp/pylib/gyp/MSVSSettings_test.py +0 -1547
  61. package/external/node-gyp/gyp/pylib/gyp/MSVSToolFile.py +0 -59
  62. package/external/node-gyp/gyp/pylib/gyp/MSVSUserFile.py +0 -152
  63. package/external/node-gyp/gyp/pylib/gyp/MSVSUtil.py +0 -270
  64. package/external/node-gyp/gyp/pylib/gyp/MSVSVersion.py +0 -574
  65. package/external/node-gyp/gyp/pylib/gyp/__init__.py +0 -704
  66. package/external/node-gyp/gyp/pylib/gyp/common.py +0 -709
  67. package/external/node-gyp/gyp/pylib/gyp/common_test.py +0 -173
  68. package/external/node-gyp/gyp/pylib/gyp/easy_xml.py +0 -169
  69. package/external/node-gyp/gyp/pylib/gyp/easy_xml_test.py +0 -113
  70. package/external/node-gyp/gyp/pylib/gyp/flock_tool.py +0 -55
  71. package/external/node-gyp/gyp/pylib/gyp/generator/__init__.py +0 -0
  72. package/external/node-gyp/gyp/pylib/gyp/generator/analyzer.py +0 -805
  73. package/external/node-gyp/gyp/pylib/gyp/generator/android.py +0 -1172
  74. package/external/node-gyp/gyp/pylib/gyp/generator/cmake.py +0 -1319
  75. package/external/node-gyp/gyp/pylib/gyp/generator/compile_commands_json.py +0 -128
  76. package/external/node-gyp/gyp/pylib/gyp/generator/dump_dependency_json.py +0 -104
  77. package/external/node-gyp/gyp/pylib/gyp/generator/eclipse.py +0 -462
  78. package/external/node-gyp/gyp/pylib/gyp/generator/gypd.py +0 -89
  79. package/external/node-gyp/gyp/pylib/gyp/generator/gypsh.py +0 -56
  80. package/external/node-gyp/gyp/pylib/gyp/generator/make.py +0 -2745
  81. package/external/node-gyp/gyp/pylib/gyp/generator/msvs.py +0 -3976
  82. package/external/node-gyp/gyp/pylib/gyp/generator/msvs_test.py +0 -44
  83. package/external/node-gyp/gyp/pylib/gyp/generator/ninja.py +0 -2965
  84. package/external/node-gyp/gyp/pylib/gyp/generator/ninja_test.py +0 -67
  85. package/external/node-gyp/gyp/pylib/gyp/generator/xcode.py +0 -1391
  86. package/external/node-gyp/gyp/pylib/gyp/generator/xcode_test.py +0 -26
  87. package/external/node-gyp/gyp/pylib/gyp/input.py +0 -3112
  88. package/external/node-gyp/gyp/pylib/gyp/input_test.py +0 -99
  89. package/external/node-gyp/gyp/pylib/gyp/mac_tool.py +0 -767
  90. package/external/node-gyp/gyp/pylib/gyp/msvs_emulation.py +0 -1260
  91. package/external/node-gyp/gyp/pylib/gyp/ninja_syntax.py +0 -174
  92. package/external/node-gyp/gyp/pylib/gyp/simple_copy.py +0 -61
  93. package/external/node-gyp/gyp/pylib/gyp/win_tool.py +0 -373
  94. package/external/node-gyp/gyp/pylib/gyp/xcode_emulation.py +0 -1939
  95. package/external/node-gyp/gyp/pylib/gyp/xcode_emulation_test.py +0 -54
  96. package/external/node-gyp/gyp/pylib/gyp/xcode_ninja.py +0 -303
  97. package/external/node-gyp/gyp/pylib/gyp/xcodeproj_file.py +0 -3196
  98. package/external/node-gyp/gyp/pylib/gyp/xml_fix.py +0 -65
  99. package/external/node-gyp/gyp/pylib/packaging/LICENSE +0 -3
  100. package/external/node-gyp/gyp/pylib/packaging/LICENSE.APACHE +0 -177
  101. package/external/node-gyp/gyp/pylib/packaging/LICENSE.BSD +0 -23
  102. package/external/node-gyp/gyp/pylib/packaging/__init__.py +0 -15
  103. package/external/node-gyp/gyp/pylib/packaging/_elffile.py +0 -108
  104. package/external/node-gyp/gyp/pylib/packaging/_manylinux.py +0 -252
  105. package/external/node-gyp/gyp/pylib/packaging/_musllinux.py +0 -83
  106. package/external/node-gyp/gyp/pylib/packaging/_parser.py +0 -359
  107. package/external/node-gyp/gyp/pylib/packaging/_structures.py +0 -61
  108. package/external/node-gyp/gyp/pylib/packaging/_tokenizer.py +0 -192
  109. package/external/node-gyp/gyp/pylib/packaging/markers.py +0 -252
  110. package/external/node-gyp/gyp/pylib/packaging/metadata.py +0 -825
  111. package/external/node-gyp/gyp/pylib/packaging/py.typed +0 -0
  112. package/external/node-gyp/gyp/pylib/packaging/requirements.py +0 -90
  113. package/external/node-gyp/gyp/pylib/packaging/specifiers.py +0 -1030
  114. package/external/node-gyp/gyp/pylib/packaging/tags.py +0 -553
  115. package/external/node-gyp/gyp/pylib/packaging/utils.py +0 -172
  116. package/external/node-gyp/gyp/pylib/packaging/version.py +0 -563
  117. package/external/node-gyp/gyp/pyproject.toml +0 -115
  118. package/external/node-gyp/gyp/release-please-config.json +0 -11
  119. package/external/node-gyp/gyp/test_gyp.py +0 -261
  120. package/external/node-gyp/lib/Find-VisualStudio.cs +0 -250
  121. package/external/node-gyp/lib/build.js +0 -230
  122. package/external/node-gyp/lib/clean.js +0 -15
  123. package/external/node-gyp/lib/configure.js +0 -328
  124. package/external/node-gyp/lib/create-config-gypi.js +0 -153
  125. package/external/node-gyp/lib/download.js +0 -41
  126. package/external/node-gyp/lib/find-node-directory.js +0 -63
  127. package/external/node-gyp/lib/find-python.js +0 -310
  128. package/external/node-gyp/lib/find-visualstudio.js +0 -600
  129. package/external/node-gyp/lib/install.js +0 -415
  130. package/external/node-gyp/lib/list.js +0 -26
  131. package/external/node-gyp/lib/log.js +0 -168
  132. package/external/node-gyp/lib/node-gyp.js +0 -188
  133. package/external/node-gyp/lib/process-release.js +0 -148
  134. package/external/node-gyp/lib/rebuild.js +0 -12
  135. package/external/node-gyp/lib/remove.js +0 -43
  136. package/external/node-gyp/lib/util.js +0 -81
  137. package/external/node-gyp/macOS_Catalina_acid_test.sh +0 -21
  138. package/external/node-gyp/package.json +0 -52
  139. package/external/node-gyp/release-please-config.json +0 -40
  140. package/external/node-gyp/src/win_delay_load_hook.cc +0 -41
package/dist/utils.js CHANGED
@@ -736,30 +736,23 @@ async function queryApiSafeText(path, fetchSpinnerDesc) {
736
736
  cause: 'User must be authenticated to run this command. To log in, run the command `socket login` and enter your API key.'
737
737
  };
738
738
  }
739
+
740
+ // Lazily access constants.spinner.
741
+ const {
742
+ spinner
743
+ } = constants;
739
744
  if (fetchSpinnerDesc) {
740
- // Lazily access constants.spinner.
741
- const {
742
- spinner
743
- } = constants;
744
745
  spinner.start(`Requesting ${fetchSpinnerDesc} from API...`);
745
746
  }
746
747
  let result;
747
748
  try {
748
749
  result = await queryApi(path, apiToken);
749
750
  if (fetchSpinnerDesc) {
750
- // Lazily access constants.spinner.
751
- const {
752
- spinner
753
- } = constants;
754
751
  spinner.successAndStop(`Received API response (after requesting ${fetchSpinnerDesc}).`);
755
752
  }
756
753
  } catch (e) {
757
754
  if (fetchSpinnerDesc) {
758
- // Lazily access constants.spinner.
759
- const {
760
- spinner
761
- } = constants;
762
- spinner.failAndStop(`An error was thrown while requesting ${fetchSpinnerDesc}`);
755
+ spinner.failAndStop(`An error was thrown while requesting ${fetchSpinnerDesc}.`);
763
756
  }
764
757
  const cause = e?.message;
765
758
  debug.debugFn('catch: queryApi() error\n', e);
@@ -1250,8 +1243,8 @@ async function meowWithSubcommands(subcommands, options) {
1250
1243
  });
1251
1244
  if (commands.size) {
1252
1245
  logger.logger.fail('Found commands in the list that were not marked as public or not defined at all:',
1253
- // Node < 22 will print 'Object (n)' before the array. So to have
1254
- // consistent test snapshots we use joinAnd.
1246
+ // Node < 22 will print 'Object (n)' before the array. So to have consistent
1247
+ // test snapshots we use joinAnd.
1255
1248
  arrays.joinAnd(Array.from(commands).sort(sorts.naturalCompare).map(c => `'${c}'`)));
1256
1249
  }
1257
1250
  const out = [];
@@ -1318,11 +1311,11 @@ ${isRootCommand ? ` $ ${name} scan create --json` : ''}${isRootCommand ? `\
1318
1311
  flags,
1319
1312
  // Do not strictly check for flags here.
1320
1313
  allowUnknownFlags: true,
1321
- booleanDefault: undefined,
1322
- // We want to detect whether a bool flag is given at all.
1323
- // We will emit help when we're ready
1314
+ // We will emit help when we're ready.
1324
1315
  // Plus, if we allow this then meow() can just exit here.
1325
- autoHelp: false
1316
+ autoHelp: false,
1317
+ // We want to detect whether a bool flag is given at all.
1318
+ booleanDefault: undefined
1326
1319
  });
1327
1320
 
1328
1321
  // ...else we provide basic instructions and help.
@@ -1345,8 +1338,8 @@ ${isRootCommand ? ` $ ${name} scan create --json` : ''}${isRootCommand ? `\
1345
1338
  * Note: meow will exit immediately if it calls its .showHelp()
1346
1339
  */
1347
1340
  function meowOrExit({
1348
- // allowUnknownFlags, // commands that pass-through args need to allow this
1349
1341
  argv,
1342
+ collectUnknownFlags = true,
1350
1343
  config,
1351
1344
  importMeta,
1352
1345
  parentName
@@ -1356,15 +1349,15 @@ function meowOrExit({
1356
1349
  // This exits if .printHelp() is called either by meow itself or by us.
1357
1350
  const cli = vendor.meow({
1358
1351
  argv,
1359
- description: config.description,
1360
- help: config.help(command, config),
1361
- importMeta,
1362
- flags: config.flags,
1363
- allowUnknownFlags: true,
1364
- // meow will exit(1) before printing the banner
1352
+ autoHelp: false,
1353
+ // meow will exit(0) before printing the banner.
1365
1354
  booleanDefault: undefined,
1366
1355
  // We want to detect whether a bool flag is given at all.
1367
- autoHelp: false // meow will exit(0) before printing the banner
1356
+ collectUnknownFlags,
1357
+ description: config.description,
1358
+ flags: config.flags,
1359
+ help: config.help(command, config),
1360
+ importMeta
1368
1361
  });
1369
1362
  if (!cli.flags['nobanner']) {
1370
1363
  emitBanner(command, String(cli.flags['org'] || '') || undefined);
@@ -1373,18 +1366,18 @@ function meowOrExit({
1373
1366
  }
1374
1367
 
1375
1368
  // As per https://github.com/sindresorhus/meow/issues/178
1376
- // Setting allowUnknownFlags:true makes it reject camel cased flags...
1369
+ // Setting `allowUnknownFlags: false` makes it reject camel cased flags.
1377
1370
  // if (!allowUnknownFlags) {
1378
1371
  // // Run meow specifically with the flag setting. It will exit(2) if an
1379
1372
  // // invalid flag is set and print a message.
1380
1373
  // meow({
1381
1374
  // argv,
1375
+ // allowUnknownFlags: false,
1376
+ // autoHelp: false,
1382
1377
  // description: config.description,
1378
+ // flags: config.flags,
1383
1379
  // help: config.help(command, config),
1384
1380
  // importMeta,
1385
- // flags: config.flags,
1386
- // allowUnknownFlags: false,
1387
- // autoHelp: false,
1388
1381
  // })
1389
1382
  // }
1390
1383
 
@@ -1402,7 +1395,7 @@ function meowOrExit({
1402
1395
  importMeta,
1403
1396
  flags: config.flags,
1404
1397
  // As per https://github.com/sindresorhus/meow/issues/178
1405
- // Setting allowUnknownFlags:true makes it reject camel cased flags...
1398
+ // Setting `allowUnknownFlags: false` makes it reject camel cased flags.
1406
1399
  // allowUnknownFlags: Boolean(allowUnknownFlags),
1407
1400
  autoHelp: false
1408
1401
  });
@@ -1650,7 +1643,7 @@ function findBinPathDetailsSync(binName) {
1650
1643
  if (path.dirname(binPath) === shadowBinPath) {
1651
1644
  shadowIndex = i;
1652
1645
  } else {
1653
- theBinPath = npm.resolveBinPath(binPath);
1646
+ theBinPath = npm.resolveBinPathSync(binPath);
1654
1647
  break;
1655
1648
  }
1656
1649
  }
@@ -2618,18 +2611,14 @@ async function getAlertsMapFromPurls(purls, options_) {
2618
2611
  const statusMessage = batchResult.error ?? 'No status message';
2619
2612
  throw new Error(`Socket API server error (${statusCode}): ${statusMessage}`);
2620
2613
  } else {
2621
- const {
2622
- spinner
2623
- } = constants;
2624
- spinner.stop();
2614
+ spinner?.stop();
2625
2615
  debug.debugFn('Received a result=false:', batchResult);
2626
2616
  logger.logger.fail(`Received a ${batchResult.status} response from Socket API which we consider a permanent failure:`, batchResult.error, batchResult.cause ? `( ${batchResult.cause} )` : '');
2627
2617
  break;
2628
2618
  }
2629
2619
  remaining -= 1;
2630
- if (spinner && remaining > 0) {
2631
- spinner.start();
2632
- spinner.setText(getText());
2620
+ if (remaining > 0) {
2621
+ spinner?.start(getText());
2633
2622
  }
2634
2623
  }
2635
2624
  spinner?.stop();
@@ -2716,10 +2705,10 @@ function safeNpmInstall(options) {
2716
2705
  const useDebug = debug.isDebug();
2717
2706
  const terminatorPos = args.indexOf('--');
2718
2707
  const rawBinArgs = terminatorPos === -1 ? args : args.slice(0, terminatorPos);
2719
- const progressArg = rawBinArgs.findLast(npm.isProgressFlag) !== '--no-progress';
2720
- const binArgs = rawBinArgs.filter(a => !npm.isAuditFlag(a) && !npm.isFundFlag(a) && !npm.isProgressFlag(a));
2708
+ const progressArg = rawBinArgs.findLast(npm.isNpmProgressFlag) !== '--no-progress';
2709
+ const binArgs = rawBinArgs.filter(a => !npm.isNpmAuditFlag(a) && !npm.isNpmFundFlag(a) && !npm.isNpmProgressFlag(a));
2721
2710
  const otherArgs = terminatorPos === -1 ? [] : args.slice(terminatorPos);
2722
- const isSilent = !useDebug && !binArgs.some(npm.isLoglevelFlag);
2711
+ const isSilent = !useDebug && !binArgs.some(npm.isNpmLoglevelFlag);
2723
2712
  const logLevelArgs = isSilent ? ['--loglevel', 'silent'] : [];
2724
2713
  const spawnPromise = spawn.spawn(
2725
2714
  // Lazily access constants.execPath.
@@ -2733,7 +2722,7 @@ function safeNpmInstall(options) {
2733
2722
  // Lazily access constants.instrumentWithSentryPath.
2734
2723
  constants.instrumentWithSentryPath] : []), '--require',
2735
2724
  // Lazily access constants.shadowNpmInjectPath.
2736
- constants.shadowNpmInjectPath, npm.realExecPathSync(agentExecPath), 'install',
2725
+ constants.shadowNpmInjectPath, npm.resolveBinPathSync(agentExecPath), 'install',
2737
2726
  // Avoid code paths for 'audit' and 'fund'.
2738
2727
  '--no-audit', '--no-fund',
2739
2728
  // Add '--no-progress' to fix input being swallowed by the npm spinner.
@@ -3307,5 +3296,5 @@ exports.tildify = tildify;
3307
3296
  exports.updateConfigValue = updateConfigValue;
3308
3297
  exports.walkNestedMap = walkNestedMap;
3309
3298
  exports.writeSocketJson = writeSocketJson;
3310
- //# debugId=c449034f-0662-4913-b76c-200b29ef02a1
3299
+ //# debugId=8665890c-d81b-4306-b3df-f3ed91367593
3311
3300
  //# sourceMappingURL=utils.js.map