@socketsecurity/cli-with-sentry 0.15.42 → 0.15.44

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 (556) hide show
  1. package/dist/cli.js +592 -455
  2. package/dist/cli.js.map +1 -1
  3. package/dist/constants.js +3 -3
  4. package/dist/constants.js.map +1 -1
  5. package/dist/shadow-inject.js +10 -3
  6. package/dist/shadow-inject.js.map +1 -1
  7. package/dist/types/cli.d.mts +2 -0
  8. package/dist/types/cli.d.mts.map +1 -0
  9. package/dist/types/commands/analytics/cmd-analytics.d.mts +10 -0
  10. package/dist/types/commands/analytics/cmd-analytics.d.mts.map +1 -0
  11. package/dist/types/commands/analytics/fetch-org-analytics.d.mts +4 -0
  12. package/dist/types/commands/analytics/fetch-org-analytics.d.mts.map +1 -0
  13. package/dist/types/commands/analytics/fetch-repo-analytics.d.mts +4 -0
  14. package/dist/types/commands/analytics/fetch-repo-analytics.d.mts.map +1 -0
  15. package/dist/types/commands/analytics/handle-analytics.d.mts +9 -0
  16. package/dist/types/commands/analytics/handle-analytics.d.mts.map +1 -0
  17. package/dist/types/commands/analytics/output-analytics.d.mts +28 -0
  18. package/dist/types/commands/analytics/output-analytics.d.mts.map +1 -0
  19. package/dist/types/commands/audit-log/cmd-audit-log.d.mts +10 -0
  20. package/dist/types/commands/audit-log/cmd-audit-log.d.mts.map +1 -0
  21. package/dist/types/commands/audit-log/fetch-audit-log.d.mts +10 -0
  22. package/dist/types/commands/audit-log/fetch-audit-log.d.mts.map +1 -0
  23. package/dist/types/commands/audit-log/handle-audit-log.d.mts +9 -0
  24. package/dist/types/commands/audit-log/handle-audit-log.d.mts.map +1 -0
  25. package/dist/types/commands/audit-log/output-audit-log.d.mts +22 -0
  26. package/dist/types/commands/audit-log/output-audit-log.d.mts.map +1 -0
  27. package/dist/types/commands/cdxgen/cmd-cdxgen.d.mts +10 -0
  28. package/dist/types/commands/cdxgen/cmd-cdxgen.d.mts.map +1 -0
  29. package/dist/types/commands/cdxgen/handle-cdxgen.d.mts +4 -0
  30. package/dist/types/commands/cdxgen/handle-cdxgen.d.mts.map +1 -0
  31. package/dist/types/commands/ci/cmd-ci.d.mts +10 -0
  32. package/dist/types/commands/ci/cmd-ci.d.mts.map +1 -0
  33. package/dist/types/commands/ci/fetch-default-org-slug.d.mts +4 -0
  34. package/dist/types/commands/ci/fetch-default-org-slug.d.mts.map +1 -0
  35. package/dist/types/commands/ci/handle-ci.d.mts +2 -0
  36. package/dist/types/commands/ci/handle-ci.d.mts.map +1 -0
  37. package/dist/types/commands/config/cmd-config-auto.d.mts +10 -0
  38. package/dist/types/commands/config/cmd-config-auto.d.mts.map +1 -0
  39. package/dist/types/commands/config/cmd-config-get.d.mts +10 -0
  40. package/dist/types/commands/config/cmd-config-get.d.mts.map +1 -0
  41. package/dist/types/commands/config/cmd-config-list.d.mts +10 -0
  42. package/dist/types/commands/config/cmd-config-list.d.mts.map +1 -0
  43. package/dist/types/commands/config/cmd-config-set.d.mts +10 -0
  44. package/dist/types/commands/config/cmd-config-set.d.mts.map +1 -0
  45. package/dist/types/commands/config/cmd-config-unset.d.mts +10 -0
  46. package/dist/types/commands/config/cmd-config-unset.d.mts.map +1 -0
  47. package/dist/types/commands/config/cmd-config.d.mts +3 -0
  48. package/dist/types/commands/config/cmd-config.d.mts.map +1 -0
  49. package/dist/types/commands/config/discover-config-value.d.mts +3 -0
  50. package/dist/types/commands/config/discover-config-value.d.mts.map +1 -0
  51. package/dist/types/commands/config/handle-config-auto.d.mts +7 -0
  52. package/dist/types/commands/config/handle-config-auto.d.mts.map +1 -0
  53. package/dist/types/commands/config/handle-config-get.d.mts +7 -0
  54. package/dist/types/commands/config/handle-config-get.d.mts.map +1 -0
  55. package/dist/types/commands/config/handle-config-set.d.mts +8 -0
  56. package/dist/types/commands/config/handle-config-set.d.mts.map +1 -0
  57. package/dist/types/commands/config/handle-config-unset.d.mts +7 -0
  58. package/dist/types/commands/config/handle-config-unset.d.mts.map +1 -0
  59. package/dist/types/commands/config/output-config-auto.d.mts +4 -0
  60. package/dist/types/commands/config/output-config-auto.d.mts.map +1 -0
  61. package/dist/types/commands/config/output-config-get.d.mts +4 -0
  62. package/dist/types/commands/config/output-config-get.d.mts.map +1 -0
  63. package/dist/types/commands/config/output-config-list.d.mts +6 -0
  64. package/dist/types/commands/config/output-config-list.d.mts.map +1 -0
  65. package/dist/types/commands/config/output-config-set.d.mts +3 -0
  66. package/dist/types/commands/config/output-config-set.d.mts.map +1 -0
  67. package/dist/types/commands/config/output-config-unset.d.mts +3 -0
  68. package/dist/types/commands/config/output-config-unset.d.mts.map +1 -0
  69. package/dist/types/commands/dependencies/cmd-dependencies.d.mts +10 -0
  70. package/dist/types/commands/dependencies/cmd-dependencies.d.mts.map +1 -0
  71. package/dist/types/commands/dependencies/fetch-dependencies.d.mts +7 -0
  72. package/dist/types/commands/dependencies/fetch-dependencies.d.mts.map +1 -0
  73. package/dist/types/commands/dependencies/handle-dependencies.d.mts +7 -0
  74. package/dist/types/commands/dependencies/handle-dependencies.d.mts.map +1 -0
  75. package/dist/types/commands/dependencies/output-dependencies.d.mts +8 -0
  76. package/dist/types/commands/dependencies/output-dependencies.d.mts.map +1 -0
  77. package/dist/types/commands/diff-scan/cmd-diff-scan-get.d.mts +10 -0
  78. package/dist/types/commands/diff-scan/cmd-diff-scan-get.d.mts.map +1 -0
  79. package/dist/types/commands/diff-scan/cmd-diff-scan.d.mts +3 -0
  80. package/dist/types/commands/diff-scan/cmd-diff-scan.d.mts.map +1 -0
  81. package/dist/types/commands/diff-scan/fetch-diff-scan.d.mts +8 -0
  82. package/dist/types/commands/diff-scan/fetch-diff-scan.d.mts.map +1 -0
  83. package/dist/types/commands/diff-scan/handle-diff-scan.d.mts +10 -0
  84. package/dist/types/commands/diff-scan/handle-diff-scan.d.mts.map +1 -0
  85. package/dist/types/commands/diff-scan/output-diff-scan.d.mts +8 -0
  86. package/dist/types/commands/diff-scan/output-diff-scan.d.mts.map +1 -0
  87. package/dist/types/commands/fix/cmd-fix.d.mts +10 -0
  88. package/dist/types/commands/fix/cmd-fix.d.mts.map +1 -0
  89. package/dist/types/commands/fix/git.d.mts +40 -0
  90. package/dist/types/commands/fix/git.d.mts.map +1 -0
  91. package/dist/types/commands/fix/handle-fix.d.mts +13 -0
  92. package/dist/types/commands/fix/handle-fix.d.mts.map +1 -0
  93. package/dist/types/commands/fix/npm-fix.d.mts +15 -0
  94. package/dist/types/commands/fix/npm-fix.d.mts.map +1 -0
  95. package/dist/types/commands/fix/open-pr.d.mts +49 -0
  96. package/dist/types/commands/fix/open-pr.d.mts.map +1 -0
  97. package/dist/types/commands/fix/output-fix-result.d.mts +3 -0
  98. package/dist/types/commands/fix/output-fix-result.d.mts.map +1 -0
  99. package/dist/types/commands/fix/pnpm-fix.d.mts +15 -0
  100. package/dist/types/commands/fix/pnpm-fix.d.mts.map +1 -0
  101. package/dist/types/commands/fix/run-fix.d.mts +12 -0
  102. package/dist/types/commands/fix/run-fix.d.mts.map +1 -0
  103. package/dist/types/commands/fix/shared.d.mts +9 -0
  104. package/dist/types/commands/fix/shared.d.mts.map +1 -0
  105. package/dist/types/commands/info/cmd-info.d.mts +10 -0
  106. package/dist/types/commands/info/cmd-info.d.mts.map +1 -0
  107. package/dist/types/commands/info/fetch-package-info.d.mts +3 -0
  108. package/dist/types/commands/info/fetch-package-info.d.mts.map +1 -0
  109. package/dist/types/commands/info/handle-package-info.d.mts +17 -0
  110. package/dist/types/commands/info/handle-package-info.d.mts.map +1 -0
  111. package/dist/types/commands/info/output-package-info.d.mts +10 -0
  112. package/dist/types/commands/info/output-package-info.d.mts.map +1 -0
  113. package/dist/types/commands/install/cmd-install-completion.d.mts +10 -0
  114. package/dist/types/commands/install/cmd-install-completion.d.mts.map +1 -0
  115. package/dist/types/commands/install/cmd-install.d.mts +3 -0
  116. package/dist/types/commands/install/cmd-install.d.mts.map +1 -0
  117. package/dist/types/commands/install/handle-install-completion.d.mts +2 -0
  118. package/dist/types/commands/install/handle-install-completion.d.mts.map +1 -0
  119. package/dist/types/commands/install/output-install-completion.d.mts +12 -0
  120. package/dist/types/commands/install/output-install-completion.d.mts.map +1 -0
  121. package/dist/types/commands/install/setup-tab-completion.d.mts +13 -0
  122. package/dist/types/commands/install/setup-tab-completion.d.mts.map +1 -0
  123. package/dist/types/commands/login/apply-login.d.mts +2 -0
  124. package/dist/types/commands/login/apply-login.d.mts.map +1 -0
  125. package/dist/types/commands/login/attempt-login.d.mts +2 -0
  126. package/dist/types/commands/login/attempt-login.d.mts.map +1 -0
  127. package/dist/types/commands/login/cmd-login.d.mts +10 -0
  128. package/dist/types/commands/login/cmd-login.d.mts.map +1 -0
  129. package/dist/types/commands/logout/apply-logout.d.mts +2 -0
  130. package/dist/types/commands/logout/apply-logout.d.mts.map +1 -0
  131. package/dist/types/commands/logout/attempt-logout.d.mts +2 -0
  132. package/dist/types/commands/logout/attempt-logout.d.mts.map +1 -0
  133. package/dist/types/commands/logout/cmd-logout.d.mts +10 -0
  134. package/dist/types/commands/logout/cmd-logout.d.mts.map +1 -0
  135. package/dist/types/commands/manifest/cmd-manifest-auto.d.mts +10 -0
  136. package/dist/types/commands/manifest/cmd-manifest-auto.d.mts.map +1 -0
  137. package/dist/types/commands/manifest/cmd-manifest-cdxgen.d.mts +10 -0
  138. package/dist/types/commands/manifest/cmd-manifest-cdxgen.d.mts.map +1 -0
  139. package/dist/types/commands/manifest/cmd-manifest-conda.d.mts +10 -0
  140. package/dist/types/commands/manifest/cmd-manifest-conda.d.mts.map +1 -0
  141. package/dist/types/commands/manifest/cmd-manifest-gradle.d.mts +10 -0
  142. package/dist/types/commands/manifest/cmd-manifest-gradle.d.mts.map +1 -0
  143. package/dist/types/commands/manifest/cmd-manifest-kotlin.d.mts +10 -0
  144. package/dist/types/commands/manifest/cmd-manifest-kotlin.d.mts.map +1 -0
  145. package/dist/types/commands/manifest/cmd-manifest-scala.d.mts +10 -0
  146. package/dist/types/commands/manifest/cmd-manifest-scala.d.mts.map +1 -0
  147. package/dist/types/commands/manifest/cmd-manifest-setup.d.mts +10 -0
  148. package/dist/types/commands/manifest/cmd-manifest-setup.d.mts.map +1 -0
  149. package/dist/types/commands/manifest/cmd-manifest.d.mts +10 -0
  150. package/dist/types/commands/manifest/cmd-manifest.d.mts.map +1 -0
  151. package/dist/types/commands/manifest/convert-conda-to-requirements.d.mts +8 -0
  152. package/dist/types/commands/manifest/convert-conda-to-requirements.d.mts.map +1 -0
  153. package/dist/types/commands/manifest/convert_gradle_to_maven.d.mts +7 -0
  154. package/dist/types/commands/manifest/convert_gradle_to_maven.d.mts.map +1 -0
  155. package/dist/types/commands/manifest/convert_sbt_to_maven.d.mts +8 -0
  156. package/dist/types/commands/manifest/convert_sbt_to_maven.d.mts.map +1 -0
  157. package/dist/types/commands/manifest/detect-manifest-actions.d.mts +13 -0
  158. package/dist/types/commands/manifest/detect-manifest-actions.d.mts.map +1 -0
  159. package/dist/types/commands/manifest/generate_auto_manifest.d.mts +9 -0
  160. package/dist/types/commands/manifest/generate_auto_manifest.d.mts.map +1 -0
  161. package/dist/types/commands/manifest/handle-manifest-conda.d.mts +9 -0
  162. package/dist/types/commands/manifest/handle-manifest-conda.d.mts.map +1 -0
  163. package/dist/types/commands/manifest/handle-manifest-setup.d.mts +2 -0
  164. package/dist/types/commands/manifest/handle-manifest-setup.d.mts.map +1 -0
  165. package/dist/types/commands/manifest/output-manifest-setup.d.mts +3 -0
  166. package/dist/types/commands/manifest/output-manifest-setup.d.mts.map +1 -0
  167. package/dist/types/commands/manifest/output-requirements.d.mts +6 -0
  168. package/dist/types/commands/manifest/output-requirements.d.mts.map +1 -0
  169. package/dist/types/commands/manifest/run-cdxgen.d.mts +2 -0
  170. package/dist/types/commands/manifest/run-cdxgen.d.mts.map +1 -0
  171. package/dist/types/commands/manifest/setup-manifest-config.d.mts +3 -0
  172. package/dist/types/commands/manifest/setup-manifest-config.d.mts.map +1 -0
  173. package/dist/types/commands/npm/cmd-npm.d.mts +10 -0
  174. package/dist/types/commands/npm/cmd-npm.d.mts.map +1 -0
  175. package/dist/types/commands/npx/cmd-npx.d.mts +10 -0
  176. package/dist/types/commands/npx/cmd-npx.d.mts.map +1 -0
  177. package/dist/types/commands/oops/cmd-oops.d.mts +10 -0
  178. package/dist/types/commands/oops/cmd-oops.d.mts.map +1 -0
  179. package/dist/types/commands/optimize/add-overrides.d.mts +20 -0
  180. package/dist/types/commands/optimize/add-overrides.d.mts.map +1 -0
  181. package/dist/types/commands/optimize/apply-optimization.d.mts +9 -0
  182. package/dist/types/commands/optimize/apply-optimization.d.mts.map +1 -0
  183. package/dist/types/commands/optimize/cmd-optimize.d.mts +10 -0
  184. package/dist/types/commands/optimize/cmd-optimize.d.mts.map +1 -0
  185. package/dist/types/commands/optimize/deps-includes-by-agent.d.mts +4 -0
  186. package/dist/types/commands/optimize/deps-includes-by-agent.d.mts.map +1 -0
  187. package/dist/types/commands/optimize/get-dependency-entries.d.mts +3 -0
  188. package/dist/types/commands/optimize/get-dependency-entries.d.mts.map +1 -0
  189. package/dist/types/commands/optimize/get-overrides-by-agent.d.mts +9 -0
  190. package/dist/types/commands/optimize/get-overrides-by-agent.d.mts.map +1 -0
  191. package/dist/types/commands/optimize/handle-optimize.d.mts +8 -0
  192. package/dist/types/commands/optimize/handle-optimize.d.mts.map +1 -0
  193. package/dist/types/commands/optimize/lockfile-includes-by-agent.d.mts +3 -0
  194. package/dist/types/commands/optimize/lockfile-includes-by-agent.d.mts.map +1 -0
  195. package/dist/types/commands/optimize/ls-by-agent.d.mts +7 -0
  196. package/dist/types/commands/optimize/ls-by-agent.d.mts.map +1 -0
  197. package/dist/types/commands/optimize/output-optimize-result.d.mts +9 -0
  198. package/dist/types/commands/optimize/output-optimize-result.d.mts.map +1 -0
  199. package/dist/types/commands/optimize/shared.d.mts +2 -0
  200. package/dist/types/commands/optimize/shared.d.mts.map +1 -0
  201. package/dist/types/commands/optimize/types.d.mts +9 -0
  202. package/dist/types/commands/optimize/types.d.mts.map +1 -0
  203. package/dist/types/commands/optimize/update-lockfile.d.mts +11 -0
  204. package/dist/types/commands/optimize/update-lockfile.d.mts.map +1 -0
  205. package/dist/types/commands/optimize/update-manifest-by-agent.d.mts +5 -0
  206. package/dist/types/commands/optimize/update-manifest-by-agent.d.mts.map +1 -0
  207. package/dist/types/commands/organization/cmd-organization-list.d.mts +10 -0
  208. package/dist/types/commands/organization/cmd-organization-list.d.mts.map +1 -0
  209. package/dist/types/commands/organization/cmd-organization-policy-license.d.mts +10 -0
  210. package/dist/types/commands/organization/cmd-organization-policy-license.d.mts.map +1 -0
  211. package/dist/types/commands/organization/cmd-organization-policy-security.d.mts +10 -0
  212. package/dist/types/commands/organization/cmd-organization-policy-security.d.mts.map +1 -0
  213. package/dist/types/commands/organization/cmd-organization-policy.d.mts +3 -0
  214. package/dist/types/commands/organization/cmd-organization-policy.d.mts.map +1 -0
  215. package/dist/types/commands/organization/cmd-organization-quota.d.mts +10 -0
  216. package/dist/types/commands/organization/cmd-organization-quota.d.mts.map +1 -0
  217. package/dist/types/commands/organization/cmd-organization.d.mts +3 -0
  218. package/dist/types/commands/organization/cmd-organization.d.mts.map +1 -0
  219. package/dist/types/commands/organization/fetch-license-policy.d.mts +4 -0
  220. package/dist/types/commands/organization/fetch-license-policy.d.mts.map +1 -0
  221. package/dist/types/commands/organization/fetch-organization-list.d.mts +4 -0
  222. package/dist/types/commands/organization/fetch-organization-list.d.mts.map +1 -0
  223. package/dist/types/commands/organization/fetch-quota.d.mts +4 -0
  224. package/dist/types/commands/organization/fetch-quota.d.mts.map +1 -0
  225. package/dist/types/commands/organization/fetch-security-policy.d.mts +4 -0
  226. package/dist/types/commands/organization/fetch-security-policy.d.mts.map +1 -0
  227. package/dist/types/commands/organization/handle-license-policy.d.mts +3 -0
  228. package/dist/types/commands/organization/handle-license-policy.d.mts.map +1 -0
  229. package/dist/types/commands/organization/handle-organization-list.d.mts +3 -0
  230. package/dist/types/commands/organization/handle-organization-list.d.mts.map +1 -0
  231. package/dist/types/commands/organization/handle-quota.d.mts +3 -0
  232. package/dist/types/commands/organization/handle-quota.d.mts.map +1 -0
  233. package/dist/types/commands/organization/handle-security-policy.d.mts +3 -0
  234. package/dist/types/commands/organization/handle-security-policy.d.mts.map +1 -0
  235. package/dist/types/commands/organization/output-license-policy.d.mts +4 -0
  236. package/dist/types/commands/organization/output-license-policy.d.mts.map +1 -0
  237. package/dist/types/commands/organization/output-organization-list.d.mts +4 -0
  238. package/dist/types/commands/organization/output-organization-list.d.mts.map +1 -0
  239. package/dist/types/commands/organization/output-quota.d.mts +4 -0
  240. package/dist/types/commands/organization/output-quota.d.mts.map +1 -0
  241. package/dist/types/commands/organization/output-security-policy.d.mts +4 -0
  242. package/dist/types/commands/organization/output-security-policy.d.mts.map +1 -0
  243. package/dist/types/commands/package/cmd-package-score.d.mts +10 -0
  244. package/dist/types/commands/package/cmd-package-score.d.mts.map +1 -0
  245. package/dist/types/commands/package/cmd-package-shallow.d.mts +17 -0
  246. package/dist/types/commands/package/cmd-package-shallow.d.mts.map +1 -0
  247. package/dist/types/commands/package/cmd-package.d.mts +3 -0
  248. package/dist/types/commands/package/cmd-package.d.mts.map +1 -0
  249. package/dist/types/commands/package/fetch-purl-deep-score.d.mts +51 -0
  250. package/dist/types/commands/package/fetch-purl-deep-score.d.mts.map +1 -0
  251. package/dist/types/commands/package/fetch-purls-shallow-score.d.mts +4 -0
  252. package/dist/types/commands/package/fetch-purls-shallow-score.d.mts.map +1 -0
  253. package/dist/types/commands/package/handle-purl-deep-score.d.mts +3 -0
  254. package/dist/types/commands/package/handle-purl-deep-score.d.mts.map +1 -0
  255. package/dist/types/commands/package/handle-purls-shallow-score.d.mts +6 -0
  256. package/dist/types/commands/package/handle-purls-shallow-score.d.mts.map +1 -0
  257. package/dist/types/commands/package/output-purl-score.d.mts +4 -0
  258. package/dist/types/commands/package/output-purl-score.d.mts.map +1 -0
  259. package/dist/types/commands/package/output-purls-shallow-score.d.mts +4 -0
  260. package/dist/types/commands/package/output-purls-shallow-score.d.mts.map +1 -0
  261. package/dist/types/commands/package/parse-package-specifiers.d.mts +9 -0
  262. package/dist/types/commands/package/parse-package-specifiers.d.mts.map +1 -0
  263. package/dist/types/commands/raw-npm/cmd-raw-npm.d.mts +10 -0
  264. package/dist/types/commands/raw-npm/cmd-raw-npm.d.mts.map +1 -0
  265. package/dist/types/commands/raw-npm/run-raw-npm.d.mts +2 -0
  266. package/dist/types/commands/raw-npm/run-raw-npm.d.mts.map +1 -0
  267. package/dist/types/commands/raw-npx/cmd-raw-npx.d.mts +10 -0
  268. package/dist/types/commands/raw-npx/cmd-raw-npx.d.mts.map +1 -0
  269. package/dist/types/commands/raw-npx/run-raw-npx.d.mts +2 -0
  270. package/dist/types/commands/raw-npx/run-raw-npx.d.mts.map +1 -0
  271. package/dist/types/commands/report/cmd-report-create.d.mts +10 -0
  272. package/dist/types/commands/report/cmd-report-create.d.mts.map +1 -0
  273. package/dist/types/commands/report/cmd-report-view.d.mts +10 -0
  274. package/dist/types/commands/report/cmd-report-view.d.mts.map +1 -0
  275. package/dist/types/commands/report/cmd-report.d.mts +3 -0
  276. package/dist/types/commands/report/cmd-report.d.mts.map +1 -0
  277. package/dist/types/commands/repos/cmd-repos-create.d.mts +10 -0
  278. package/dist/types/commands/repos/cmd-repos-create.d.mts.map +1 -0
  279. package/dist/types/commands/repos/cmd-repos-del.d.mts +10 -0
  280. package/dist/types/commands/repos/cmd-repos-del.d.mts.map +1 -0
  281. package/dist/types/commands/repos/cmd-repos-list.d.mts +10 -0
  282. package/dist/types/commands/repos/cmd-repos-list.d.mts.map +1 -0
  283. package/dist/types/commands/repos/cmd-repos-update.d.mts +10 -0
  284. package/dist/types/commands/repos/cmd-repos-update.d.mts.map +1 -0
  285. package/dist/types/commands/repos/cmd-repos-view.d.mts +10 -0
  286. package/dist/types/commands/repos/cmd-repos-view.d.mts.map +1 -0
  287. package/dist/types/commands/repos/cmd-repos.d.mts +3 -0
  288. package/dist/types/commands/repos/cmd-repos.d.mts.map +1 -0
  289. package/dist/types/commands/repos/fetch-create-repo.d.mts +11 -0
  290. package/dist/types/commands/repos/fetch-create-repo.d.mts.map +1 -0
  291. package/dist/types/commands/repos/fetch-delete-repo.d.mts +4 -0
  292. package/dist/types/commands/repos/fetch-delete-repo.d.mts.map +1 -0
  293. package/dist/types/commands/repos/fetch-list-all-repos.d.mts +8 -0
  294. package/dist/types/commands/repos/fetch-list-all-repos.d.mts.map +1 -0
  295. package/dist/types/commands/repos/fetch-list-repos.d.mts +10 -0
  296. package/dist/types/commands/repos/fetch-list-repos.d.mts.map +1 -0
  297. package/dist/types/commands/repos/fetch-update-repo.d.mts +11 -0
  298. package/dist/types/commands/repos/fetch-update-repo.d.mts.map +1 -0
  299. package/dist/types/commands/repos/fetch-view-repo.d.mts +4 -0
  300. package/dist/types/commands/repos/fetch-view-repo.d.mts.map +1 -0
  301. package/dist/types/commands/repos/handle-create-repo.d.mts +10 -0
  302. package/dist/types/commands/repos/handle-create-repo.d.mts.map +1 -0
  303. package/dist/types/commands/repos/handle-delete-repo.d.mts +3 -0
  304. package/dist/types/commands/repos/handle-delete-repo.d.mts.map +1 -0
  305. package/dist/types/commands/repos/handle-list-repos.d.mts +11 -0
  306. package/dist/types/commands/repos/handle-list-repos.d.mts.map +1 -0
  307. package/dist/types/commands/repos/handle-update-repo.d.mts +10 -0
  308. package/dist/types/commands/repos/handle-update-repo.d.mts.map +1 -0
  309. package/dist/types/commands/repos/handle-view-repo.d.mts +3 -0
  310. package/dist/types/commands/repos/handle-view-repo.d.mts.map +1 -0
  311. package/dist/types/commands/repos/output-create-repo.d.mts +4 -0
  312. package/dist/types/commands/repos/output-create-repo.d.mts.map +1 -0
  313. package/dist/types/commands/repos/output-delete-repo.d.mts +4 -0
  314. package/dist/types/commands/repos/output-delete-repo.d.mts.map +1 -0
  315. package/dist/types/commands/repos/output-list-repos.d.mts +4 -0
  316. package/dist/types/commands/repos/output-list-repos.d.mts.map +1 -0
  317. package/dist/types/commands/repos/output-update-repo.d.mts +4 -0
  318. package/dist/types/commands/repos/output-update-repo.d.mts.map +1 -0
  319. package/dist/types/commands/repos/output-view-repo.d.mts +4 -0
  320. package/dist/types/commands/repos/output-view-repo.d.mts.map +1 -0
  321. package/dist/types/commands/scan/cmd-scan-create.d.mts +10 -0
  322. package/dist/types/commands/scan/cmd-scan-create.d.mts.map +1 -0
  323. package/dist/types/commands/scan/cmd-scan-del.d.mts +10 -0
  324. package/dist/types/commands/scan/cmd-scan-del.d.mts.map +1 -0
  325. package/dist/types/commands/scan/cmd-scan-diff.d.mts +10 -0
  326. package/dist/types/commands/scan/cmd-scan-diff.d.mts.map +1 -0
  327. package/dist/types/commands/scan/cmd-scan-github.d.mts +10 -0
  328. package/dist/types/commands/scan/cmd-scan-github.d.mts.map +1 -0
  329. package/dist/types/commands/scan/cmd-scan-list.d.mts +3 -0
  330. package/dist/types/commands/scan/cmd-scan-list.d.mts.map +1 -0
  331. package/dist/types/commands/scan/cmd-scan-metadata.d.mts +3 -0
  332. package/dist/types/commands/scan/cmd-scan-metadata.d.mts.map +1 -0
  333. package/dist/types/commands/scan/cmd-scan-reach.d.mts +10 -0
  334. package/dist/types/commands/scan/cmd-scan-reach.d.mts.map +1 -0
  335. package/dist/types/commands/scan/cmd-scan-report.d.mts +3 -0
  336. package/dist/types/commands/scan/cmd-scan-report.d.mts.map +1 -0
  337. package/dist/types/commands/scan/cmd-scan-setup.d.mts +10 -0
  338. package/dist/types/commands/scan/cmd-scan-setup.d.mts.map +1 -0
  339. package/dist/types/commands/scan/cmd-scan-view.d.mts +3 -0
  340. package/dist/types/commands/scan/cmd-scan-view.d.mts.map +1 -0
  341. package/dist/types/commands/scan/cmd-scan.d.mts +3 -0
  342. package/dist/types/commands/scan/cmd-scan.d.mts.map +1 -0
  343. package/dist/types/commands/scan/create-scan-from-github.d.mts +12 -0
  344. package/dist/types/commands/scan/create-scan-from-github.d.mts.map +1 -0
  345. package/dist/types/commands/scan/fetch-create-org-full-scan.d.mts +11 -0
  346. package/dist/types/commands/scan/fetch-create-org-full-scan.d.mts.map +1 -0
  347. package/dist/types/commands/scan/fetch-delete-org-full-scan.d.mts +4 -0
  348. package/dist/types/commands/scan/fetch-delete-org-full-scan.d.mts.map +1 -0
  349. package/dist/types/commands/scan/fetch-diff-scan.d.mts +8 -0
  350. package/dist/types/commands/scan/fetch-diff-scan.d.mts.map +1 -0
  351. package/dist/types/commands/scan/fetch-list-scans.d.mts +13 -0
  352. package/dist/types/commands/scan/fetch-list-scans.d.mts.map +1 -0
  353. package/dist/types/commands/scan/fetch-report-data.d.mts +12 -0
  354. package/dist/types/commands/scan/fetch-report-data.d.mts.map +1 -0
  355. package/dist/types/commands/scan/fetch-scan-metadata.d.mts +4 -0
  356. package/dist/types/commands/scan/fetch-scan-metadata.d.mts.map +1 -0
  357. package/dist/types/commands/scan/fetch-scan.d.mts +4 -0
  358. package/dist/types/commands/scan/fetch-scan.d.mts.map +1 -0
  359. package/dist/types/commands/scan/fetch-supported-scan-file-names.d.mts +4 -0
  360. package/dist/types/commands/scan/fetch-supported-scan-file-names.d.mts.map +1 -0
  361. package/dist/types/commands/scan/generate-report.d.mts +43 -0
  362. package/dist/types/commands/scan/generate-report.d.mts.map +1 -0
  363. package/dist/types/commands/scan/handle-create-github-scan.d.mts +12 -0
  364. package/dist/types/commands/scan/handle-create-github-scan.d.mts.map +1 -0
  365. package/dist/types/commands/scan/handle-create-new-scan.d.mts +21 -0
  366. package/dist/types/commands/scan/handle-create-new-scan.d.mts.map +1 -0
  367. package/dist/types/commands/scan/handle-delete-scan.d.mts +3 -0
  368. package/dist/types/commands/scan/handle-delete-scan.d.mts.map +1 -0
  369. package/dist/types/commands/scan/handle-diff-scan.d.mts +10 -0
  370. package/dist/types/commands/scan/handle-diff-scan.d.mts.map +1 -0
  371. package/dist/types/commands/scan/handle-list-scans.d.mts +13 -0
  372. package/dist/types/commands/scan/handle-list-scans.d.mts.map +1 -0
  373. package/dist/types/commands/scan/handle-reach-scan.d.mts +3 -0
  374. package/dist/types/commands/scan/handle-reach-scan.d.mts.map +1 -0
  375. package/dist/types/commands/scan/handle-scan-config.d.mts +2 -0
  376. package/dist/types/commands/scan/handle-scan-config.d.mts.map +1 -0
  377. package/dist/types/commands/scan/handle-scan-metadata.d.mts +3 -0
  378. package/dist/types/commands/scan/handle-scan-metadata.d.mts.map +1 -0
  379. package/dist/types/commands/scan/handle-scan-report.d.mts +12 -0
  380. package/dist/types/commands/scan/handle-scan-report.d.mts.map +1 -0
  381. package/dist/types/commands/scan/handle-scan-view.d.mts +3 -0
  382. package/dist/types/commands/scan/handle-scan-view.d.mts.map +1 -0
  383. package/dist/types/commands/scan/output-create-new-scan.d.mts +4 -0
  384. package/dist/types/commands/scan/output-create-new-scan.d.mts.map +1 -0
  385. package/dist/types/commands/scan/output-delete-scan.d.mts +4 -0
  386. package/dist/types/commands/scan/output-delete-scan.d.mts.map +1 -0
  387. package/dist/types/commands/scan/output-diff-scan.d.mts +8 -0
  388. package/dist/types/commands/scan/output-diff-scan.d.mts.map +1 -0
  389. package/dist/types/commands/scan/output-list-scans.d.mts +4 -0
  390. package/dist/types/commands/scan/output-list-scans.d.mts.map +1 -0
  391. package/dist/types/commands/scan/output-scan-config-result.d.mts +3 -0
  392. package/dist/types/commands/scan/output-scan-config-result.d.mts.map +1 -0
  393. package/dist/types/commands/scan/output-scan-metadata.d.mts +4 -0
  394. package/dist/types/commands/scan/output-scan-metadata.d.mts.map +1 -0
  395. package/dist/types/commands/scan/output-scan-reach.d.mts +3 -0
  396. package/dist/types/commands/scan/output-scan-reach.d.mts.map +1 -0
  397. package/dist/types/commands/scan/output-scan-report.d.mts +20 -0
  398. package/dist/types/commands/scan/output-scan-report.d.mts.map +1 -0
  399. package/dist/types/commands/scan/output-scan-view.d.mts +4 -0
  400. package/dist/types/commands/scan/output-scan-view.d.mts.map +1 -0
  401. package/dist/types/commands/scan/scan-reachability.d.mts +3 -0
  402. package/dist/types/commands/scan/scan-reachability.d.mts.map +1 -0
  403. package/dist/types/commands/scan/setup-scan-config.d.mts +3 -0
  404. package/dist/types/commands/scan/setup-scan-config.d.mts.map +1 -0
  405. package/dist/types/commands/scan/stream-scan.d.mts +2 -0
  406. package/dist/types/commands/scan/stream-scan.d.mts.map +1 -0
  407. package/dist/types/commands/scan/suggest-org-slug.d.mts +2 -0
  408. package/dist/types/commands/scan/suggest-org-slug.d.mts.map +1 -0
  409. package/dist/types/commands/scan/suggest-repo-slug.d.mts +5 -0
  410. package/dist/types/commands/scan/suggest-repo-slug.d.mts.map +1 -0
  411. package/dist/types/commands/scan/suggest_branch_slug.d.mts +2 -0
  412. package/dist/types/commands/scan/suggest_branch_slug.d.mts.map +1 -0
  413. package/dist/types/commands/scan/suggest_target.d.mts +2 -0
  414. package/dist/types/commands/scan/suggest_target.d.mts.map +1 -0
  415. package/dist/types/commands/threat-feed/cmd-threat-feed.d.mts +10 -0
  416. package/dist/types/commands/threat-feed/cmd-threat-feed.d.mts.map +1 -0
  417. package/dist/types/commands/threat-feed/fetch-threat-feed.d.mts +10 -0
  418. package/dist/types/commands/threat-feed/fetch-threat-feed.d.mts.map +1 -0
  419. package/dist/types/commands/threat-feed/handle-threat-feed.d.mts +10 -0
  420. package/dist/types/commands/threat-feed/handle-threat-feed.d.mts.map +1 -0
  421. package/dist/types/commands/threat-feed/output-threat-feed.d.mts +4 -0
  422. package/dist/types/commands/threat-feed/output-threat-feed.d.mts.map +1 -0
  423. package/dist/types/commands/threat-feed/types.d.mts +15 -0
  424. package/dist/types/commands/threat-feed/types.d.mts.map +1 -0
  425. package/dist/types/commands/uninstall/cmd-uninstall-completion.d.mts +9 -0
  426. package/dist/types/commands/uninstall/cmd-uninstall-completion.d.mts.map +1 -0
  427. package/dist/types/commands/uninstall/cmd-uninstall.d.mts +3 -0
  428. package/dist/types/commands/uninstall/cmd-uninstall.d.mts.map +1 -0
  429. package/dist/types/commands/uninstall/handle-uninstall-completion.d.mts +2 -0
  430. package/dist/types/commands/uninstall/handle-uninstall-completion.d.mts.map +1 -0
  431. package/dist/types/commands/uninstall/output-uninstall-completion.d.mts +6 -0
  432. package/dist/types/commands/uninstall/output-uninstall-completion.d.mts.map +1 -0
  433. package/dist/types/commands/uninstall/teardown-tab-completion.d.mts +6 -0
  434. package/dist/types/commands/uninstall/teardown-tab-completion.d.mts.map +1 -0
  435. package/dist/types/commands/wrapper/add-socket-wrapper.d.mts +2 -0
  436. package/dist/types/commands/wrapper/add-socket-wrapper.d.mts.map +1 -0
  437. package/dist/types/commands/wrapper/check-socket-wrapper-setup.d.mts +2 -0
  438. package/dist/types/commands/wrapper/check-socket-wrapper-setup.d.mts.map +1 -0
  439. package/dist/types/commands/wrapper/cmd-wrapper.d.mts +10 -0
  440. package/dist/types/commands/wrapper/cmd-wrapper.d.mts.map +1 -0
  441. package/dist/types/commands/wrapper/postinstall-wrapper.d.mts +2 -0
  442. package/dist/types/commands/wrapper/postinstall-wrapper.d.mts.map +1 -0
  443. package/dist/types/commands/wrapper/remove-socket-wrapper.d.mts +2 -0
  444. package/dist/types/commands/wrapper/remove-socket-wrapper.d.mts.map +1 -0
  445. package/dist/types/constants.d.mts +128 -0
  446. package/dist/types/constants.d.mts.map +1 -0
  447. package/dist/types/flags.d.mts +16 -0
  448. package/dist/types/flags.d.mts.map +1 -0
  449. package/dist/types/instrument-with-sentry.d.mts +2 -0
  450. package/dist/types/instrument-with-sentry.d.mts.map +1 -0
  451. package/dist/types/shadow/npm/arborist/index.d.mts +19 -0
  452. package/dist/types/shadow/npm/arborist/index.d.mts.map +1 -0
  453. package/dist/types/shadow/npm/arborist/lib/arborist/index.d.mts +24 -0
  454. package/dist/types/shadow/npm/arborist/lib/arborist/index.d.mts.map +1 -0
  455. package/dist/types/shadow/npm/arborist/types.d.mts +119 -0
  456. package/dist/types/shadow/npm/arborist/types.d.mts.map +1 -0
  457. package/dist/types/shadow/npm/arborist-helpers.d.mts +35 -0
  458. package/dist/types/shadow/npm/arborist-helpers.d.mts.map +1 -0
  459. package/dist/types/shadow/npm/bin.d.mts +2 -0
  460. package/dist/types/shadow/npm/bin.d.mts.map +1 -0
  461. package/dist/types/shadow/npm/inject.d.mts +2 -0
  462. package/dist/types/shadow/npm/inject.d.mts.map +1 -0
  463. package/dist/types/shadow/npm/install.d.mts +13 -0
  464. package/dist/types/shadow/npm/install.d.mts.map +1 -0
  465. package/dist/types/shadow/npm/link.d.mts +2 -0
  466. package/dist/types/shadow/npm/link.d.mts.map +1 -0
  467. package/dist/types/shadow/npm/paths.d.mts +7 -0
  468. package/dist/types/shadow/npm/paths.d.mts.map +1 -0
  469. package/dist/types/shadow/npm/proc-log/index.d.mts +3 -0
  470. package/dist/types/shadow/npm/proc-log/index.d.mts.map +1 -0
  471. package/dist/types/types.d.mts +29 -0
  472. package/dist/types/types.d.mts.map +1 -0
  473. package/dist/types/utils/agent.d.mts +12 -0
  474. package/dist/types/utils/agent.d.mts.map +1 -0
  475. package/dist/types/utils/alert/artifact.d.mts +35 -0
  476. package/dist/types/utils/alert/artifact.d.mts.map +1 -0
  477. package/dist/types/utils/alert/fix.d.mts +6 -0
  478. package/dist/types/utils/alert/fix.d.mts.map +1 -0
  479. package/dist/types/utils/alert/severity.d.mts +14 -0
  480. package/dist/types/utils/alert/severity.d.mts.map +1 -0
  481. package/dist/types/utils/alerts-map.d.mts +25 -0
  482. package/dist/types/utils/alerts-map.d.mts.map +1 -0
  483. package/dist/types/utils/api.d.mts +13 -0
  484. package/dist/types/utils/api.d.mts.map +1 -0
  485. package/dist/types/utils/check-input.d.mts +9 -0
  486. package/dist/types/utils/check-input.d.mts.map +1 -0
  487. package/dist/types/utils/cmd.d.mts +4 -0
  488. package/dist/types/utils/cmd.d.mts.map +1 -0
  489. package/dist/types/utils/color-or-markdown.d.mts +16 -0
  490. package/dist/types/utils/color-or-markdown.d.mts.map +1 -0
  491. package/dist/types/utils/completion.d.mts +11 -0
  492. package/dist/types/utils/completion.d.mts.map +1 -0
  493. package/dist/types/utils/config.d.mts +31 -0
  494. package/dist/types/utils/config.d.mts.map +1 -0
  495. package/dist/types/utils/determine-org-slug.d.mts +2 -0
  496. package/dist/types/utils/determine-org-slug.d.mts.map +1 -0
  497. package/dist/types/utils/errors.d.mts +14 -0
  498. package/dist/types/utils/errors.d.mts.map +1 -0
  499. package/dist/types/utils/fail-msg-with-badge.d.mts +2 -0
  500. package/dist/types/utils/fail-msg-with-badge.d.mts.map +1 -0
  501. package/dist/types/utils/fs.d.mts +22 -0
  502. package/dist/types/utils/fs.d.mts.map +1 -0
  503. package/dist/types/utils/get-output-kind.d.mts +3 -0
  504. package/dist/types/utils/get-output-kind.d.mts.map +1 -0
  505. package/dist/types/utils/glob.d.mts +14 -0
  506. package/dist/types/utils/glob.d.mts.map +1 -0
  507. package/dist/types/utils/map-to-object.d.mts +10 -0
  508. package/dist/types/utils/map-to-object.d.mts.map +1 -0
  509. package/dist/types/utils/markdown.d.mts +10 -0
  510. package/dist/types/utils/markdown.d.mts.map +1 -0
  511. package/dist/types/utils/meow-with-subcommands.d.mts +50 -0
  512. package/dist/types/utils/meow-with-subcommands.d.mts.map +1 -0
  513. package/dist/types/utils/npm-package-arg.d.mts +4 -0
  514. package/dist/types/utils/npm-package-arg.d.mts.map +1 -0
  515. package/dist/types/utils/npm-paths.d.mts +7 -0
  516. package/dist/types/utils/npm-paths.d.mts.map +1 -0
  517. package/dist/types/utils/objects.d.mts +3 -0
  518. package/dist/types/utils/objects.d.mts.map +1 -0
  519. package/dist/types/utils/output-formatting.d.mts +15 -0
  520. package/dist/types/utils/output-formatting.d.mts.map +1 -0
  521. package/dist/types/utils/package-environment.d.mts +57 -0
  522. package/dist/types/utils/package-environment.d.mts.map +1 -0
  523. package/dist/types/utils/path-resolve.d.mts +10 -0
  524. package/dist/types/utils/path-resolve.d.mts.map +1 -0
  525. package/dist/types/utils/pnpm.d.mts +11 -0
  526. package/dist/types/utils/pnpm.d.mts.map +1 -0
  527. package/dist/types/utils/purl.d.mts +97 -0
  528. package/dist/types/utils/purl.d.mts.map +1 -0
  529. package/dist/types/utils/sdk.d.mts +8 -0
  530. package/dist/types/utils/sdk.d.mts.map +1 -0
  531. package/dist/types/utils/semver.d.mts +8 -0
  532. package/dist/types/utils/semver.d.mts.map +1 -0
  533. package/dist/types/utils/serialize-result-json.d.mts +5 -0
  534. package/dist/types/utils/serialize-result-json.d.mts.map +1 -0
  535. package/dist/types/utils/socket-package-alert.d.mts +78 -0
  536. package/dist/types/utils/socket-package-alert.d.mts.map +1 -0
  537. package/dist/types/utils/socket-url.d.mts +7 -0
  538. package/dist/types/utils/socket-url.d.mts.map +1 -0
  539. package/dist/types/utils/socketjson.d.mts +56 -0
  540. package/dist/types/utils/socketjson.d.mts.map +1 -0
  541. package/dist/types/utils/spec.d.mts +5 -0
  542. package/dist/types/utils/spec.d.mts.map +1 -0
  543. package/dist/types/utils/strings.d.mts +2 -0
  544. package/dist/types/utils/strings.d.mts.map +1 -0
  545. package/dist/types/utils/translations.d.mts +593 -0
  546. package/dist/types/utils/translations.d.mts.map +1 -0
  547. package/dist/types/utils/walk-nested-map.d.mts +7 -0
  548. package/dist/types/utils/walk-nested-map.d.mts.map +1 -0
  549. package/dist/utils.js +278 -168
  550. package/dist/utils.js.map +1 -1
  551. package/dist/vendor.js +57456 -53054
  552. package/external/@socketsecurity/registry/external/browserslist.js +395 -358
  553. package/external/@socketsecurity/registry/lib/debug.js +15 -5
  554. package/external/@socketsecurity/registry/lib/logger.js +3 -10
  555. package/external/@socketsecurity/registry/lib/strings.js +9 -1
  556. package/package.json +26 -26
package/dist/utils.js CHANGED
@@ -21,10 +21,11 @@ var spawn = require('../external/@socketsecurity/registry/lib/spawn');
21
21
  var npm = require('../external/@socketsecurity/registry/lib/npm');
22
22
  var words = require('../external/@socketsecurity/registry/lib/words');
23
23
  var fs$1 = require('../external/@socketsecurity/registry/lib/fs');
24
+ var require$$7 = require('../external/@socketsecurity/registry/lib/promises');
24
25
 
25
26
  var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
26
27
  const {
27
- NPM: NPM$6,
28
+ NPM: NPM$5,
28
29
  PNPM: PNPM$2
29
30
  } = constants;
30
31
  const PNPM_WORKSPACE = `${PNPM$2}-workspace`;
@@ -135,7 +136,7 @@ function workspacePatternToGlobPattern(workspace) {
135
136
  return `${workspace}/package.json`;
136
137
  }
137
138
  async function filterGlobResultToSupportedFiles(entries, supportedFiles) {
138
- const patterns = ['golang', NPM$6, 'maven', 'pypi', 'gem', 'nuget'].reduce((r, n) => {
139
+ const patterns = ['golang', NPM$5, 'maven', 'pypi', 'gem', 'nuget'].reduce((r, n) => {
139
140
  const supported = supportedFiles[n];
140
141
  r.push(...(supported ? Object.values(supported).map(p => `**/${p.pattern}`) : []));
141
142
  return r;
@@ -180,9 +181,11 @@ async function globWithGitIgnore(patterns, options) {
180
181
  return absolute ? filtered.map(p => path.resolve(cwd, p)) : filtered;
181
182
  }
182
183
  async function globNodeModules(cwd = process.cwd()) {
183
- return await vendor.distExports.glob('**/node_modules/**', {
184
+ return await vendor.distExports.glob('**/node_modules', {
184
185
  absolute: true,
185
- cwd
186
+ cwd,
187
+ expandDirectories: false,
188
+ onlyDirectories: true
186
189
  });
187
190
  }
188
191
  async function globWorkspace(agent, cwd = process.cwd()) {
@@ -203,7 +206,12 @@ const {
203
206
  } = constants;
204
207
  async function removeNodeModules(cwd = process.cwd()) {
205
208
  const nodeModulesPaths = await globNodeModules(cwd);
206
- await Promise.all(nodeModulesPaths.map(p => fs$1.remove(p)));
209
+ await require$$7.pEach(nodeModulesPaths, 3, p => fs$1.remove(p, {
210
+ force: true,
211
+ recursive: true
212
+ }), {
213
+ retries: 3
214
+ });
207
215
  }
208
216
  async function findUp(name, {
209
217
  cwd = process.cwd(),
@@ -1093,13 +1101,43 @@ async function meowWithSubcommands(subcommands, options) {
1093
1101
  };
1094
1102
 
1095
1103
  // No further args or first arg is a flag (shrug)
1096
- if (name === 'socket' && (!commandOrAliasName || commandOrAliasName?.startsWith('-'))) {
1104
+ const isRootCommand = name === 'socket' && (!commandOrAliasName || commandOrAliasName?.startsWith('-'));
1105
+ if (isRootCommand) {
1106
+ flags['help'] = {
1107
+ type: 'boolean',
1108
+ hidden: false,
1109
+ // Only show on root
1110
+ description: 'Give you detailed help information about any sub-command'
1111
+ };
1112
+ flags['config'] = {
1113
+ type: 'string',
1114
+ hidden: false,
1115
+ // Only show on root
1116
+ description: 'Allows you to temp overrides the internal CLI config'
1117
+ };
1097
1118
  flags['dryRun'] = {
1098
1119
  type: 'boolean',
1099
- default: false,
1100
1120
  hidden: false,
1101
1121
  // Only show on root
1102
- description: 'Do input validation for a command and exit 0 when input is ok. Every command should support this flag (not shown on help screens)'
1122
+ description: 'Do input validation for a sub-command and then exit'
1123
+ };
1124
+ flags['json'] = {
1125
+ type: 'boolean',
1126
+ hidden: false,
1127
+ // Only show on root
1128
+ description: 'Ensure stdout only receives proper JSON (Most non-interactive commands support this)'
1129
+ };
1130
+ flags['markdown'] = {
1131
+ type: 'boolean',
1132
+ hidden: false,
1133
+ // Only show on root
1134
+ description: 'Ensure stdout only receives a markdown report (Many commands that support --json also support this)'
1135
+ };
1136
+ flags['version'] = {
1137
+ type: 'boolean',
1138
+ hidden: false,
1139
+ // Only show on root
1140
+ description: 'Show version of CLI'
1103
1141
  };
1104
1142
  }
1105
1143
 
@@ -1172,35 +1210,97 @@ async function meowWithSubcommands(subcommands, options) {
1172
1210
  delete subcommands['info'];
1173
1211
  delete subcommands['report'];
1174
1212
  }
1213
+ function formatCommandsForHelp(isRootCommand) {
1214
+ if (!isRootCommand || !isTestingV1()) {
1215
+ return getHelpListOutput({
1216
+ ...objects.toSortedObject(Object.fromEntries(Object.entries(subcommands).filter(({
1217
+ 1: subcommand
1218
+ }) => !subcommand.hidden))),
1219
+ ...objects.toSortedObject(Object.fromEntries(Object.entries(aliases).filter(({
1220
+ 1: alias
1221
+ }) => {
1222
+ const {
1223
+ hidden
1224
+ } = alias;
1225
+ const cmdName = hidden ? '' : alias.argv[0];
1226
+ const subcommand = cmdName ? subcommands[cmdName] : undefined;
1227
+ return subcommand && !subcommand.hidden;
1228
+ })))
1229
+ }, 6);
1230
+ }
1231
+
1232
+ // "Bucket" some commands for easier usage
1233
+
1234
+ const commands = new Set(['analytics', 'audit-log', 'config', 'dependencies', 'fix', 'install', 'login', 'logout', 'manifest', 'npm', 'npx', 'optimize', 'organization', 'package', 'raw-npm', 'raw-npx', 'repos', 'scan', 'threat-feed', 'uninstall', 'wrapper']);
1235
+ Object.entries(subcommands).filter(([_name, subcommand]) => !subcommand.hidden).map(([name]) => name).forEach(name => {
1236
+ if (commands.has(name)) {
1237
+ commands.delete(name);
1238
+ } else {
1239
+ logger.logger.fail('Received a visible command that was not added to the list here;', name);
1240
+ }
1241
+ });
1242
+ if (commands.size) {
1243
+ logger.logger.fail('Found commands in the list that were not marked as public or were not defined at all:', Array.from(commands).sort());
1244
+ }
1245
+ const out = [];
1246
+ out.push('All commands have their own --help page');
1247
+ out.push(' ');
1248
+ out.push(' Main commands');
1249
+ out.push(' ');
1250
+ out.push(' socket login Setup the CLI with an API Token and defaults');
1251
+ out.push(' socket scan create Create a new Scan and report');
1252
+ out.push(' socket package score Request the (shallow) security score of a particular package');
1253
+ out.push(' socket ci Shorthand for CI; socket scan create --report --no-interactive');
1254
+ out.push(' ');
1255
+ out.push(' Socket API');
1256
+ out.push(' ');
1257
+ out.push(' analytics Look up analytics data');
1258
+ out.push(' audit-log Look up the audit log for an organization');
1259
+ out.push(' organization Manage organization account details');
1260
+ out.push(' package Look up published package details');
1261
+ out.push(' repository Manage registered repositories');
1262
+ out.push(' scan Manage Socket scans');
1263
+ out.push(' threat-feed [beta] View the threat feed');
1264
+ out.push(' ');
1265
+ out.push(' Local tools');
1266
+ out.push(' ');
1267
+ out.push(' fix Update dependencies with "fixable" Socket alerts');
1268
+ out.push(' manifest Generate a dependency manifest for certain languages');
1269
+ out.push(' npm npm wrapper functionality');
1270
+ out.push(' npx npx wrapper functionality');
1271
+ out.push(' optimize Optimize dependencies with @socketregistry overrides');
1272
+ out.push(' raw-npm Temporarily disable the Socket npm wrapper');
1273
+ out.push(' raw-npx Temporarily disable the Socket npx wrapper');
1274
+ out.push(' ');
1275
+ out.push(' CLI configuration');
1276
+ out.push(' ');
1277
+ out.push(' config Manage the CLI configuration directly');
1278
+ out.push(' install Manually install CLI tab completion on your system');
1279
+ out.push(' login Socket API login and CLI setup');
1280
+ out.push(' logout Socket API logout');
1281
+ out.push(' uninstall Remove the CLI tab completion from your system');
1282
+ out.push(' wrapper Enable or disable the Socket npm/npx wrapper');
1283
+ return out.join('\n');
1284
+ }
1175
1285
 
1176
1286
  // Parse it again. Config overrides should now be applied (may affect help).
1287
+ // Note: this is displayed as help screen if the command does not override it
1288
+ // (which is the case for most sub-commands with sub-commands)
1177
1289
  const cli2 = vendor.meow(`
1178
1290
  Usage
1179
1291
  $ ${name} <command>
1180
1292
 
1181
- Commands
1182
- ${getHelpListOutput({
1183
- ...objects.toSortedObject(Object.fromEntries(Object.entries(subcommands).filter(({
1184
- 1: subcommand
1185
- }) => !subcommand.hidden))),
1186
- ...objects.toSortedObject(Object.fromEntries(Object.entries(aliases).filter(({
1187
- 1: alias
1188
- }) => {
1189
- const {
1190
- hidden
1191
- } = alias;
1192
- const cmdName = hidden ? '' : alias.argv[0];
1193
- const subcommand = cmdName ? subcommands[cmdName] : undefined;
1194
- return subcommand && !subcommand.hidden;
1195
- })))
1196
- }, 6)}
1293
+ ${isRootCommand && isTestingV1() ? '' : ' Commands'}
1294
+ ${formatCommandsForHelp(isRootCommand)}
1197
1295
 
1198
- Options
1199
- ${getFlagListOutput(flags, 6)}
1296
+ ${isRootCommand && isTestingV1() ? ' Options' : ' Options'}${isRootCommand ? ' (Note: all CLI commands have these flags even when not displayed in their help)\n' : ''}
1297
+ ${getFlagListOutput(flags, 6, isTestingV1() ? {
1298
+ padName: 25
1299
+ } : undefined)}
1200
1300
 
1201
1301
  Examples
1202
1302
  $ ${name} --help
1203
- `, {
1303
+ ${isRootCommand ? ` $ ${name} scan create` : ''}${isRootCommand ? `\n $ ${name} package score npm left-pad` : ''}`, {
1204
1304
  argv,
1205
1305
  importMeta,
1206
1306
  ...additionalOptions,
@@ -1397,7 +1497,7 @@ async function determineOrgSlug(orgFlag, firstArg, interactive, dryRun) {
1397
1497
 
1398
1498
  const {
1399
1499
  NODE_MODULES: NODE_MODULES$1,
1400
- NPM: NPM$5,
1500
+ NPM: NPM$4,
1401
1501
  shadowBinPath
1402
1502
  } = constants;
1403
1503
  function findBinPathDetailsSync(binName) {
@@ -1432,7 +1532,7 @@ function findNpmPathSync(npmBinPath) {
1432
1532
  } = constants;
1433
1533
  let thePath = npmBinPath;
1434
1534
  while (true) {
1435
- const libNmNpmPath = path.join(thePath, 'lib', NODE_MODULES$1, NPM$5);
1535
+ const libNmNpmPath = path.join(thePath, 'lib', NODE_MODULES$1, NPM$4);
1436
1536
  // mise puts its npm bin in a path like:
1437
1537
  // /Users/SomeUsername/.local/share/mise/installs/node/vX.X.X/bin/npm.
1438
1538
  // HOWEVER, the location of the npm install is:
@@ -1444,7 +1544,7 @@ function findNpmPathSync(npmBinPath) {
1444
1544
  fs.existsSync(libNmNpmPath) && fs.statSync(libNmNpmPath, {
1445
1545
  throwIfNoEntry: false
1446
1546
  })?.isDirectory()) {
1447
- thePath = path.join(libNmNpmPath, NPM$5);
1547
+ thePath = path.join(libNmNpmPath, NPM$4);
1448
1548
  }
1449
1549
  const nmPath = path.join(thePath, NODE_MODULES$1);
1450
1550
  if (
@@ -1462,9 +1562,9 @@ function findNpmPathSync(npmBinPath) {
1462
1562
  throwIfNoEntry: false
1463
1563
  })?.isDirectory() && (
1464
1564
  // Optimistically look for the default location.
1465
- path.basename(thePath) === NPM$5 ||
1565
+ path.basename(thePath) === NPM$4 ||
1466
1566
  // Chocolatey installs npm bins in the same directory as node bins.
1467
- WIN32 && fs.existsSync(path.join(thePath, `${NPM$5}.cmd`)))) {
1567
+ WIN32 && fs.existsSync(path.join(thePath, `${NPM$4}.cmd`)))) {
1468
1568
  return thePath;
1469
1569
  }
1470
1570
  const parent = path.dirname(thePath);
@@ -1502,7 +1602,7 @@ async function getPackageFilesForScan(cwd, inputPaths, supportedFiles, config) {
1502
1602
 
1503
1603
  const {
1504
1604
  NODE_MODULES,
1505
- NPM: NPM$4,
1605
+ NPM: NPM$3,
1506
1606
  NPX,
1507
1607
  SOCKET_CLI_ISSUES_URL
1508
1608
  } = constants;
@@ -1516,7 +1616,7 @@ function exitWithBinPathError(binName) {
1516
1616
  let _npmBinPathDetails;
1517
1617
  function getNpmBinPathDetails() {
1518
1618
  if (_npmBinPathDetails === undefined) {
1519
- _npmBinPathDetails = findBinPathDetailsSync(NPM$4);
1619
+ _npmBinPathDetails = findBinPathDetailsSync(NPM$3);
1520
1620
  }
1521
1621
  return _npmBinPathDetails;
1522
1622
  }
@@ -1538,7 +1638,7 @@ function getNpmBinPath() {
1538
1638
  if (_npmBinPath === undefined) {
1539
1639
  _npmBinPath = getNpmBinPathDetails().path;
1540
1640
  if (!_npmBinPath) {
1541
- exitWithBinPathError(NPM$4);
1641
+ exitWithBinPathError(NPM$3);
1542
1642
  }
1543
1643
  }
1544
1644
  return _npmBinPath;
@@ -1567,7 +1667,7 @@ let _npmRequire;
1567
1667
  function getNpmRequire() {
1568
1668
  if (_npmRequire === undefined) {
1569
1669
  const npmPath = getNpmPath();
1570
- const npmNmPath = path.join(npmPath, NODE_MODULES, NPM$4);
1670
+ const npmNmPath = path.join(npmPath, NODE_MODULES, NPM$3);
1571
1671
  _npmRequire = Module.createRequire(path.join(fs.existsSync(npmNmPath) ? npmNmPath : npmPath, '<dummy-basename>'));
1572
1672
  }
1573
1673
  return _npmRequire;
@@ -1609,10 +1709,15 @@ function isHelpFlag(cmdArg) {
1609
1709
  return helpFlags.has(cmdArg);
1610
1710
  }
1611
1711
 
1712
+ function getPurlObject(purl) {
1713
+ return typeof purl === 'string' ? vendor.packageurlJsExports.PackageURL.fromString(purl) : purl;
1714
+ }
1715
+
1612
1716
  const {
1613
1717
  SOCKET_WEBSITE_URL
1614
1718
  } = constants;
1615
- function getPkgFullNameFromPurlObj(purlObj) {
1719
+ function getPkgFullNameFromPurl(purl) {
1720
+ const purlObj = getPurlObject(purl);
1616
1721
  const {
1617
1722
  name,
1618
1723
  namespace
@@ -1622,13 +1727,14 @@ function getPkgFullNameFromPurlObj(purlObj) {
1622
1727
  function getSocketDevAlertUrl(alertType) {
1623
1728
  return `${SOCKET_WEBSITE_URL}/alerts/${alertType}`;
1624
1729
  }
1625
- function getSocketDevPackageOverviewUrlFromPurl(purlObj) {
1626
- const fullName = getPkgFullNameFromPurlObj(purlObj);
1730
+ function getSocketDevPackageOverviewUrlFromPurl(purl) {
1731
+ const purlObj = getPurlObject(purl);
1732
+ const fullName = getPkgFullNameFromPurl(purlObj);
1627
1733
  return getSocketDevPackageOverviewUrl(purlObj.type, fullName, purlObj.version);
1628
1734
  }
1629
1735
  function getSocketDevPackageOverviewUrl(ecosystem, fullName, version) {
1630
1736
  const url = `${SOCKET_WEBSITE_URL}/${ecosystem}/package/${fullName}`;
1631
- return ecosystem === 'go' ? `${url}${version ? `?section=overview&version=${version}` : ''}` : `${url}${version ? `/overview/${version}` : ''}`;
1737
+ return ecosystem === 'golang' ? `${url}${version ? `?section=overview&version=${version}` : ''}` : `${url}${version ? `/overview/${version}` : ''}`;
1632
1738
  }
1633
1739
 
1634
1740
  /**
@@ -1757,10 +1863,6 @@ async function writeSocketJson(cwd, socketJson) {
1757
1863
  };
1758
1864
  }
1759
1865
 
1760
- function getPurlObject(purl) {
1761
- return typeof purl === 'string' ? vendor.packageurlJsExports.PackageURL.fromString(purl) : purl;
1762
- }
1763
-
1764
1866
  const {
1765
1867
  ALERT_TYPE_CRITICAL_CVE,
1766
1868
  ALERT_TYPE_CVE,
@@ -1964,72 +2066,6 @@ function getTranslations() {
1964
2066
  return _translations;
1965
2067
  }
1966
2068
 
1967
- function extractOverridesFromPnpmLockfileContent(lockfileContent) {
1968
- return typeof lockfileContent === 'string' ? /^overrides:(\r?\n {2}.+)+(?:\r?\n)*/m.exec(lockfileContent)?.[0] ?? '' : '';
1969
- }
1970
- async function extractPurlsFromPnpmLockfile(lockfile) {
1971
- const packages = lockfile?.packages ?? {};
1972
- const seen = new Set();
1973
- const visit = pkgPath => {
1974
- if (seen.has(pkgPath)) {
1975
- return;
1976
- }
1977
- const pkg = packages[pkgPath];
1978
- if (!pkg) {
1979
- return;
1980
- }
1981
- seen.add(pkgPath);
1982
- const deps = {
1983
- __proto__: null,
1984
- ...pkg.dependencies,
1985
- ...pkg.optionalDependencies,
1986
- ...pkg.devDependencies
1987
- };
1988
- for (const depName in deps) {
1989
- const ref = deps[depName];
1990
- const subKey = isPnpmDepPath(ref) ? ref : `/${depName}@${ref}`;
1991
- visit(subKey);
1992
- }
1993
- };
1994
- for (const pkgPath of Object.keys(packages)) {
1995
- visit(pkgPath);
1996
- }
1997
- return [...seen].map(p => idToPurl(stripPnpmPeerSuffix(stripLeadingPnpmDepPathSlash(p))));
1998
- }
1999
- function isPnpmDepPath(maybeDepPath) {
2000
- return maybeDepPath.length > 0 && maybeDepPath.charCodeAt(0) === 47; /*'/'*/
2001
- }
2002
- function parsePnpmLockfile(lockfileContent) {
2003
- let result;
2004
- if (typeof lockfileContent === 'string') {
2005
- try {
2006
- result = vendor.jsYaml.load(strings.stripBom(lockfileContent));
2007
- } catch {}
2008
- }
2009
- return objects.isObjectObject(result) ? result : null;
2010
- }
2011
- function parsePnpmLockfileVersion(version) {
2012
- try {
2013
- return vendor.semverExports.coerce(version);
2014
- } catch {}
2015
- return null;
2016
- }
2017
- async function readPnpmLockfile(lockfilePath) {
2018
- return fs.existsSync(lockfilePath) ? await readFileUtf8(lockfilePath) : null;
2019
- }
2020
- function stripLeadingPnpmDepPathSlash(depPath) {
2021
- return isPnpmDepPath(depPath) ? depPath.slice(1) : depPath;
2022
- }
2023
- function stripPnpmPeerSuffix(depPath) {
2024
- const parenIndex = depPath.indexOf('(');
2025
- const index = parenIndex === -1 ? depPath.indexOf('_') : parenIndex;
2026
- return index === -1 ? depPath : depPath.slice(0, index);
2027
- }
2028
-
2029
- function idToPurl(id) {
2030
- return `pkg:npm/${id}`;
2031
- }
2032
-
2033
2069
  const ALERT_SEVERITY_COLOR = createEnum({
2034
2070
  critical: 'magenta',
2035
2071
  high: 'red',
@@ -2043,9 +2079,6 @@ const ALERT_SEVERITY_ORDER = createEnum({
2043
2079
  low: 3,
2044
2080
  none: 4
2045
2081
  });
2046
- const {
2047
- NPM: NPM$3
2048
- } = constants;
2049
2082
  const MIN_ABOVE_THE_FOLD_COUNT = 3;
2050
2083
  const MIN_ABOVE_THE_FOLD_ALERT_COUNT = 1;
2051
2084
  const format = new ColorOrMarkdown(false);
@@ -2090,10 +2123,10 @@ function getHiddenRisksDescription(riskCounts) {
2090
2123
  }
2091
2124
  return `(${descriptions.join('; ')})`;
2092
2125
  }
2093
- async function addArtifactToAlertsMap(artifact, alertsByPkgId, options) {
2126
+ async function addArtifactToAlertsMap(artifact, alertsByPurl, options) {
2094
2127
  // Make TypeScript happy.
2095
2128
  if (!artifact.name || !artifact.version || !artifact.alerts?.length) {
2096
- return alertsByPkgId;
2129
+ return alertsByPurl;
2097
2130
  }
2098
2131
  const {
2099
2132
  consolidate = false,
@@ -2116,6 +2149,7 @@ async function addArtifactToAlertsMap(artifact, alertsByPkgId, options) {
2116
2149
  };
2117
2150
  const name = packages.resolvePackageName(artifact);
2118
2151
  const {
2152
+ type: ecosystem,
2119
2153
  version
2120
2154
  } = artifact;
2121
2155
  const enabledState = {
@@ -2145,6 +2179,7 @@ async function addArtifactToAlertsMap(artifact, alertsByPkgId, options) {
2145
2179
  type: alert.type,
2146
2180
  blocked,
2147
2181
  critical,
2182
+ ecosystem,
2148
2183
  fixable,
2149
2184
  raw: alert,
2150
2185
  upgradable
@@ -2152,9 +2187,9 @@ async function addArtifactToAlertsMap(artifact, alertsByPkgId, options) {
2152
2187
  }
2153
2188
  }
2154
2189
  if (!sockPkgAlerts.length) {
2155
- return alertsByPkgId;
2190
+ return alertsByPurl;
2156
2191
  }
2157
- const pkgId = `${name}@${version}`;
2192
+ const purl = `pkg:${ecosystem}/${name}@${version}`;
2158
2193
  const major = getMajor(version);
2159
2194
  if (consolidate) {
2160
2195
  const highestForCve = new Map();
@@ -2203,9 +2238,9 @@ async function addArtifactToAlertsMap(artifact, alertsByPkgId, options) {
2203
2238
  sockPkgAlerts.sort((a, b) => sorts.naturalCompare(a.type, b.type));
2204
2239
  }
2205
2240
  if (sockPkgAlerts.length) {
2206
- alertsByPkgId.set(pkgId, sockPkgAlerts);
2241
+ alertsByPurl.set(purl, sockPkgAlerts);
2207
2242
  }
2208
- return alertsByPkgId;
2243
+ return alertsByPurl;
2209
2244
  }
2210
2245
  function alertsHaveBlocked(alerts) {
2211
2246
  return alerts.find(a => a.blocked) !== undefined;
@@ -2239,22 +2274,26 @@ function getCveInfoFromAlertsMap(alertsMap, options_) {
2239
2274
  ...options.exclude
2240
2275
  };
2241
2276
  let count = 0;
2242
- let infoByPkgName = null;
2243
- alertsMapLoop: for (const [pkgId, sockPkgAlerts] of alertsMap) {
2244
- const purlObj = vendor.packageurlJsExports.PackageURL.fromString(idToPurl(pkgId));
2277
+ let infoByPartialPurl = null;
2278
+ alertsMapLoop: for (const {
2279
+ 0: purl,
2280
+ 1: sockPkgAlerts
2281
+ } of alertsMap) {
2282
+ const purlObj = getPurlObject(purl);
2283
+ const partialPurl = new vendor.packageurlJsExports$1.PackageURL(purlObj.type, purlObj.namespace, purlObj.name).toString();
2245
2284
  const name = packages.resolvePackageName(purlObj);
2246
2285
  sockPkgAlertsLoop: for (const sockPkgAlert of sockPkgAlerts) {
2247
2286
  const alert = sockPkgAlert.raw;
2248
- if (alert.fix?.type !== ALERT_FIX_TYPE.cve || options.exclude.upgradable && registry.getManifestData(NPM$3, name)) {
2287
+ if (alert.fix?.type !== ALERT_FIX_TYPE.cve || options.exclude.upgradable && registry.getManifestData(sockPkgAlert.ecosystem, name)) {
2249
2288
  continue sockPkgAlertsLoop;
2250
2289
  }
2251
- if (!infoByPkgName) {
2252
- infoByPkgName = new Map();
2290
+ if (!infoByPartialPurl) {
2291
+ infoByPartialPurl = new Map();
2253
2292
  }
2254
- let infos = infoByPkgName.get(name);
2293
+ let infos = infoByPartialPurl.get(partialPurl);
2255
2294
  if (!infos) {
2256
2295
  infos = new Map();
2257
- infoByPkgName.set(name, infos);
2296
+ infoByPartialPurl.set(partialPurl, infos);
2258
2297
  }
2259
2298
  const {
2260
2299
  key
@@ -2273,7 +2312,7 @@ function getCveInfoFromAlertsMap(alertsMap, options_) {
2273
2312
  vulnerableVersionRange: new vendor.semverExports.Range(
2274
2313
  // Replace ', ' in a range like '>= 1.0.0, < 1.8.2' with ' ' so that
2275
2314
  // semver.Range will parse it without erroring.
2276
- vulnerableVersionRange.replace(/, +/g, ' ')).format()
2315
+ vulnerableVersionRange.replace(/, +/g, ' ').replace(/; +/g, ' || ')).format()
2277
2316
  });
2278
2317
  if (++count >= options.limit) {
2279
2318
  break alertsMapLoop;
@@ -2286,12 +2325,12 @@ function getCveInfoFromAlertsMap(alertsMap, options_) {
2286
2325
  debug.debugFn('fail: invalid SocketPackageAlert\n', alert);
2287
2326
  if (error) {
2288
2327
  // Explicitly use debugLog here.
2289
- debug.debugLog(error);
2328
+ debug.debugLog(error.message ?? error);
2290
2329
  }
2291
2330
  }
2292
2331
  }
2293
2332
  }
2294
- return infoByPkgName;
2333
+ return infoByPartialPurl;
2295
2334
  }
2296
2335
  function getSeverityLabel(severity) {
2297
2336
  return severity === 'middle' ? 'moderate' : severity;
@@ -2306,14 +2345,14 @@ function logAlertsMap(alertsMap, options) {
2306
2345
  };
2307
2346
  const translations = getTranslations();
2308
2347
  const sortedEntries = [...alertsMap.entries()].sort((a, b) => getAlertsSeverityOrder(a[1]) - getAlertsSeverityOrder(b[1]));
2309
- const aboveTheFoldPkgIds = new Set();
2310
- const viewableAlertsByPkgId = new Map();
2311
- const hiddenAlertsByPkgId = new Map();
2348
+ const aboveTheFoldPurls = new Set();
2349
+ const viewableAlertsByPurl = new Map();
2350
+ const hiddenAlertsByPurl = new Map();
2312
2351
  for (let i = 0, {
2313
2352
  length
2314
2353
  } = sortedEntries; i < length; i += 1) {
2315
2354
  const {
2316
- 0: pkgId,
2355
+ 0: purl,
2317
2356
  1: alerts
2318
2357
  } = sortedEntries[i];
2319
2358
  const hiddenAlerts = [];
@@ -2325,37 +2364,37 @@ function logAlertsMap(alertsMap, options) {
2325
2364
  return keep;
2326
2365
  });
2327
2366
  if (hiddenAlerts.length) {
2328
- hiddenAlertsByPkgId.set(pkgId, hiddenAlerts.sort(alertSeverityComparator));
2367
+ hiddenAlertsByPurl.set(purl, hiddenAlerts.sort(alertSeverityComparator));
2329
2368
  }
2330
2369
  if (!viewableAlerts.length) {
2331
2370
  continue;
2332
2371
  }
2333
2372
  viewableAlerts.sort(alertSeverityComparator);
2334
- viewableAlertsByPkgId.set(pkgId, viewableAlerts);
2373
+ viewableAlertsByPurl.set(purl, viewableAlerts);
2335
2374
  if (viewableAlerts.find(a => a.blocked || getAlertSeverityOrder(a) < ALERT_SEVERITY_ORDER.middle)) {
2336
- aboveTheFoldPkgIds.add(pkgId);
2375
+ aboveTheFoldPurls.add(purl);
2337
2376
  }
2338
2377
  }
2339
2378
 
2340
2379
  // If MIN_ABOVE_THE_FOLD_COUNT is NOT met add more from viewable pkg ids.
2341
2380
  for (const {
2342
- 0: pkgId
2343
- } of viewableAlertsByPkgId.entries()) {
2344
- if (aboveTheFoldPkgIds.size >= MIN_ABOVE_THE_FOLD_COUNT) {
2381
+ 0: purl
2382
+ } of viewableAlertsByPurl.entries()) {
2383
+ if (aboveTheFoldPurls.size >= MIN_ABOVE_THE_FOLD_COUNT) {
2345
2384
  break;
2346
2385
  }
2347
- aboveTheFoldPkgIds.add(pkgId);
2386
+ aboveTheFoldPurls.add(purl);
2348
2387
  }
2349
2388
  // If MIN_ABOVE_THE_FOLD_COUNT is STILL NOT met add more from hidden pkg ids.
2350
2389
  for (const {
2351
- 0: pkgId,
2390
+ 0: purl,
2352
2391
  1: hiddenAlerts
2353
- } of hiddenAlertsByPkgId.entries()) {
2354
- if (aboveTheFoldPkgIds.size >= MIN_ABOVE_THE_FOLD_COUNT) {
2392
+ } of hiddenAlertsByPurl.entries()) {
2393
+ if (aboveTheFoldPurls.size >= MIN_ABOVE_THE_FOLD_COUNT) {
2355
2394
  break;
2356
2395
  }
2357
- aboveTheFoldPkgIds.add(pkgId);
2358
- const viewableAlerts = viewableAlertsByPkgId.get(pkgId) ?? [];
2396
+ aboveTheFoldPurls.add(purl);
2397
+ const viewableAlerts = viewableAlertsByPurl.get(purl) ?? [];
2359
2398
  if (viewableAlerts.length < MIN_ABOVE_THE_FOLD_ALERT_COUNT) {
2360
2399
  const neededCount = MIN_ABOVE_THE_FOLD_ALERT_COUNT - viewableAlerts.length;
2361
2400
  let removedHiddenAlerts;
@@ -2363,17 +2402,17 @@ function logAlertsMap(alertsMap, options) {
2363
2402
  removedHiddenAlerts = hiddenAlerts.splice(0, MIN_ABOVE_THE_FOLD_ALERT_COUNT);
2364
2403
  } else {
2365
2404
  removedHiddenAlerts = hiddenAlerts;
2366
- hiddenAlertsByPkgId.delete(pkgId);
2405
+ hiddenAlertsByPurl.delete(purl);
2367
2406
  }
2368
- viewableAlertsByPkgId.set(pkgId, [...viewableAlerts, ...removedHiddenAlerts]);
2407
+ viewableAlertsByPurl.set(purl, [...viewableAlerts, ...removedHiddenAlerts]);
2369
2408
  }
2370
2409
  }
2371
- const mentionedPkgIdsWithHiddenAlerts = new Set();
2372
- for (let i = 0, prevAboveTheFold = true, entries = [...viewableAlertsByPkgId.entries()], {
2410
+ const mentionedPurlsWithHiddenAlerts = new Set();
2411
+ for (let i = 0, prevAboveTheFold = true, entries = [...viewableAlertsByPurl.entries()], {
2373
2412
  length
2374
2413
  } = entries; i < length; i += 1) {
2375
2414
  const {
2376
- 0: pkgId,
2415
+ 0: purl,
2377
2416
  1: alerts
2378
2417
  } = entries[i];
2379
2418
  const lines = new Set();
@@ -2393,11 +2432,12 @@ function logAlertsMap(alertsMap, options) {
2393
2432
  // TODO: emoji seems to mis-align terminals sometimes
2394
2433
  lines.add(` ${content}`);
2395
2434
  }
2396
- const purlObj = vendor.packageurlJsExports.PackageURL.fromString(idToPurl(pkgId));
2397
- const hyperlink = format.hyperlink(pkgId, getSocketDevPackageOverviewUrl(NPM$3, packages.resolvePackageName(purlObj), purlObj.version));
2398
- const isAboveTheFold = aboveTheFoldPkgIds.has(pkgId);
2435
+ const purlObj = getPurlObject(purl);
2436
+ const pkgName = packages.resolvePackageName(purlObj);
2437
+ const hyperlink = format.hyperlink(pkgName, getSocketDevPackageOverviewUrl(purlObj.type, pkgName, purlObj.version));
2438
+ const isAboveTheFold = aboveTheFoldPurls.has(purl);
2399
2439
  if (isAboveTheFold) {
2400
- aboveTheFoldPkgIds.add(pkgId);
2440
+ aboveTheFoldPurls.add(purl);
2401
2441
  output.write(`${i ? '\n' : ''}${hyperlink}:\n`);
2402
2442
  } else {
2403
2443
  output.write(`${prevAboveTheFold ? '\n' : ''}${hyperlink}:\n`);
@@ -2405,12 +2445,12 @@ function logAlertsMap(alertsMap, options) {
2405
2445
  for (const line of lines) {
2406
2446
  output.write(`${line}\n`);
2407
2447
  }
2408
- const hiddenAlerts = hiddenAlertsByPkgId.get(pkgId) ?? [];
2448
+ const hiddenAlerts = hiddenAlertsByPurl.get(purl) ?? [];
2409
2449
  const {
2410
2450
  length: hiddenAlertsCount
2411
2451
  } = hiddenAlerts;
2412
2452
  if (hiddenAlertsCount) {
2413
- mentionedPkgIdsWithHiddenAlerts.add(pkgId);
2453
+ mentionedPurlsWithHiddenAlerts.add(purl);
2414
2454
  if (hiddenAlertsCount === 1) {
2415
2455
  output.write(` ${vendor.yoctocolorsCjsExports.dim(`+1 Hidden ${getSeverityLabel(hiddenAlerts[0].raw.severity ?? 'low')} risk alert`)}\n`);
2416
2456
  } else {
@@ -2419,7 +2459,7 @@ function logAlertsMap(alertsMap, options) {
2419
2459
  }
2420
2460
  prevAboveTheFold = isAboveTheFold;
2421
2461
  }
2422
- const additionalHiddenCount = hiddenAlertsByPkgId.size - mentionedPkgIdsWithHiddenAlerts.size;
2462
+ const additionalHiddenCount = hiddenAlertsByPurl.size - mentionedPurlsWithHiddenAlerts.size;
2423
2463
  if (additionalHiddenCount) {
2424
2464
  const totalRiskCounts = {
2425
2465
  critical: 0,
@@ -2428,10 +2468,10 @@ function logAlertsMap(alertsMap, options) {
2428
2468
  low: 0
2429
2469
  };
2430
2470
  for (const {
2431
- 0: pkgId,
2471
+ 0: purl,
2432
2472
  1: alerts
2433
- } of hiddenAlertsByPkgId.entries()) {
2434
- if (mentionedPkgIdsWithHiddenAlerts.has(pkgId)) {
2473
+ } of hiddenAlertsByPurl.entries()) {
2474
+ if (mentionedPurlsWithHiddenAlerts.has(purl)) {
2435
2475
  continue;
2436
2476
  }
2437
2477
  const riskCounts = getHiddenRiskCounts(alerts);
@@ -2440,11 +2480,80 @@ function logAlertsMap(alertsMap, options) {
2440
2480
  totalRiskCounts.middle += riskCounts.middle;
2441
2481
  totalRiskCounts.low += riskCounts.low;
2442
2482
  }
2443
- output.write(`${aboveTheFoldPkgIds.size ? '\n' : ''}${vendor.yoctocolorsCjsExports.dim(`${aboveTheFoldPkgIds.size ? '+' : ''}${additionalHiddenCount} Packages with hidden alerts ${vendor.yoctocolorsCjsExports.italic(getHiddenRisksDescription(totalRiskCounts))}`)}\n`);
2483
+ output.write(`${aboveTheFoldPurls.size ? '\n' : ''}${vendor.yoctocolorsCjsExports.dim(`${aboveTheFoldPurls.size ? '+' : ''}${additionalHiddenCount} Packages with hidden alerts ${vendor.yoctocolorsCjsExports.italic(getHiddenRisksDescription(totalRiskCounts))}`)}\n`);
2444
2484
  }
2445
2485
  output.write('\n');
2446
2486
  }
2447
2487
 
2488
+ function idToNpmPurl(id) {
2489
+ return `pkg:npm/${id}`;
2490
+ }
2491
+ function idToPurl(id, type) {
2492
+ return `pkg:${type}/${id}`;
2493
+ }
2494
+
2495
+ function extractOverridesFromPnpmLockfileContent(lockfileContent) {
2496
+ return typeof lockfileContent === 'string' ? /^overrides:(\r?\n {2}.+)+(?:\r?\n)*/m.exec(lockfileContent)?.[0] ?? '' : '';
2497
+ }
2498
+ async function extractPurlsFromPnpmLockfile(lockfile) {
2499
+ const packages = lockfile?.packages ?? {};
2500
+ const seen = new Set();
2501
+ const visit = pkgPath => {
2502
+ if (seen.has(pkgPath)) {
2503
+ return;
2504
+ }
2505
+ const pkg = packages[pkgPath];
2506
+ if (!pkg) {
2507
+ return;
2508
+ }
2509
+ seen.add(pkgPath);
2510
+ const deps = {
2511
+ __proto__: null,
2512
+ ...pkg.dependencies,
2513
+ ...pkg.optionalDependencies,
2514
+ ...pkg.devDependencies
2515
+ };
2516
+ for (const depName in deps) {
2517
+ const ref = deps[depName];
2518
+ const subKey = isPnpmDepPath(ref) ? ref : `/${depName}@${ref}`;
2519
+ visit(subKey);
2520
+ }
2521
+ };
2522
+ for (const pkgPath of Object.keys(packages)) {
2523
+ visit(pkgPath);
2524
+ }
2525
+ return [...seen].map(p => idToNpmPurl(stripPnpmPeerSuffix(stripLeadingPnpmDepPathSlash(p))));
2526
+ }
2527
+ function isPnpmDepPath(maybeDepPath) {
2528
+ return maybeDepPath.length > 0 && maybeDepPath.charCodeAt(0) === 47; /*'/'*/
2529
+ }
2530
+ function parsePnpmLockfile(lockfileContent) {
2531
+ let result;
2532
+ if (typeof lockfileContent === 'string') {
2533
+ try {
2534
+ result = vendor.jsYaml.load(strings.stripBom(lockfileContent));
2535
+ } catch {}
2536
+ }
2537
+ return objects.isObjectObject(result) ? result : null;
2538
+ }
2539
+ function parsePnpmLockfileVersion(version) {
2540
+ try {
2541
+ return vendor.semverExports.coerce(version);
2542
+ } catch {}
2543
+ return null;
2544
+ }
2545
+ async function readPnpmLockfile(lockfilePath) {
2546
+ return fs.existsSync(lockfilePath) ? await readFileUtf8(lockfilePath) : null;
2547
+ }
2548
+ function stripLeadingPnpmDepPathSlash(depPath) {
2549
+ return isPnpmDepPath(depPath) ? depPath.slice(1) : depPath;
2550
+ }
2551
+ function stripPnpmPeerSuffix(depPath) {
2552
+ const parenIndex = depPath.indexOf('(');
2553
+ const index = parenIndex === -1 ? depPath.indexOf('_') : parenIndex;
2554
+ return index === -1 ? depPath : depPath.slice(0, index);
2555
+ }
2556
+
2448
2557
  async function getAlertsMapFromPnpmLockfile(lockfile, options) {
2449
2558
  const purls = await extractPurlsFromPnpmLockfile(lockfile);
2450
2559
  return await getAlertsMapFromPurls(purls, {
@@ -2480,9 +2589,9 @@ async function getAlertsMapFromPurls(purls, options_) {
2480
2589
  let {
2481
2590
  length: remaining
2482
2591
  } = uniqPurls;
2483
- const alertsByPkgId = new Map();
2592
+ const alertsByPurl = new Map();
2484
2593
  if (!remaining) {
2485
- return alertsByPkgId;
2594
+ return alertsByPurl;
2486
2595
  }
2487
2596
  const getText = () => `Looking up data for ${remaining} packages`;
2488
2597
  spinner?.start(getText());
@@ -2512,7 +2621,7 @@ async function getAlertsMapFromPurls(purls, options_) {
2512
2621
  }))
2513
2622
  })) {
2514
2623
  if (batchResult.success) {
2515
- await addArtifactToAlertsMap(batchResult.data, alertsByPkgId, alertsMapOptions);
2624
+ await addArtifactToAlertsMap(batchResult.data, alertsByPurl, alertsMapOptions);
2516
2625
  } else if (!options.nothrow) {
2517
2626
  const statusCode = batchResult.status ?? 'unknown';
2518
2627
  const statusMessage = batchResult.error ?? 'No status message';
@@ -2525,7 +2634,7 @@ async function getAlertsMapFromPurls(purls, options_) {
2525
2634
  }
2526
2635
  }
2527
2636
  spinner?.stop();
2528
- return alertsByPkgId;
2637
+ return alertsByPurl;
2529
2638
  }
2530
2639
 
2531
2640
  function npa(...args) {
@@ -3083,7 +3192,7 @@ exports.getNpmRequire = getNpmRequire;
3083
3192
  exports.getNpxBinPath = getNpxBinPath;
3084
3193
  exports.getOutputKind = getOutputKind;
3085
3194
  exports.getPackageFilesForScan = getPackageFilesForScan;
3086
- exports.getPkgFullNameFromPurlObj = getPkgFullNameFromPurlObj;
3195
+ exports.getPkgFullNameFromPurl = getPkgFullNameFromPurl;
3087
3196
  exports.getPublicToken = getPublicToken;
3088
3197
  exports.getPurlObject = getPurlObject;
3089
3198
  exports.getSeverityCount = getSeverityCount;
@@ -3096,6 +3205,7 @@ exports.handleApiCall = handleApiCall;
3096
3205
  exports.handleApiCallNoSpinner = handleApiCallNoSpinner;
3097
3206
  exports.handleUnsuccessfulApiResponse = handleUnsuccessfulApiResponse;
3098
3207
  exports.hasDefaultToken = hasDefaultToken;
3208
+ exports.idToNpmPurl = idToNpmPurl;
3099
3209
  exports.idToPurl = idToPurl;
3100
3210
  exports.isHelpFlag = isHelpFlag;
3101
3211
  exports.isNpmBinPathShadowed = isNpmBinPathShadowed;
@@ -3130,5 +3240,5 @@ exports.updateConfigValue = updateConfigValue;
3130
3240
  exports.validationFlags = validationFlags;
3131
3241
  exports.walkNestedMap = walkNestedMap;
3132
3242
  exports.writeSocketJson = writeSocketJson;
3133
- //# debugId=26e03419-502d-4c19-9c00-b8622567d403
3243
+ //# debugId=c940586c-7f80-4e5e-ab46-bf967fcb3730
3134
3244
  //# sourceMappingURL=utils.js.map