@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.
- package/dist/cli.js +592 -455
- package/dist/cli.js.map +1 -1
- package/dist/constants.js +3 -3
- package/dist/constants.js.map +1 -1
- package/dist/shadow-inject.js +10 -3
- package/dist/shadow-inject.js.map +1 -1
- package/dist/types/cli.d.mts +2 -0
- package/dist/types/cli.d.mts.map +1 -0
- package/dist/types/commands/analytics/cmd-analytics.d.mts +10 -0
- package/dist/types/commands/analytics/cmd-analytics.d.mts.map +1 -0
- package/dist/types/commands/analytics/fetch-org-analytics.d.mts +4 -0
- package/dist/types/commands/analytics/fetch-org-analytics.d.mts.map +1 -0
- package/dist/types/commands/analytics/fetch-repo-analytics.d.mts +4 -0
- package/dist/types/commands/analytics/fetch-repo-analytics.d.mts.map +1 -0
- package/dist/types/commands/analytics/handle-analytics.d.mts +9 -0
- package/dist/types/commands/analytics/handle-analytics.d.mts.map +1 -0
- package/dist/types/commands/analytics/output-analytics.d.mts +28 -0
- package/dist/types/commands/analytics/output-analytics.d.mts.map +1 -0
- package/dist/types/commands/audit-log/cmd-audit-log.d.mts +10 -0
- package/dist/types/commands/audit-log/cmd-audit-log.d.mts.map +1 -0
- package/dist/types/commands/audit-log/fetch-audit-log.d.mts +10 -0
- package/dist/types/commands/audit-log/fetch-audit-log.d.mts.map +1 -0
- package/dist/types/commands/audit-log/handle-audit-log.d.mts +9 -0
- package/dist/types/commands/audit-log/handle-audit-log.d.mts.map +1 -0
- package/dist/types/commands/audit-log/output-audit-log.d.mts +22 -0
- package/dist/types/commands/audit-log/output-audit-log.d.mts.map +1 -0
- package/dist/types/commands/cdxgen/cmd-cdxgen.d.mts +10 -0
- package/dist/types/commands/cdxgen/cmd-cdxgen.d.mts.map +1 -0
- package/dist/types/commands/cdxgen/handle-cdxgen.d.mts +4 -0
- package/dist/types/commands/cdxgen/handle-cdxgen.d.mts.map +1 -0
- package/dist/types/commands/ci/cmd-ci.d.mts +10 -0
- package/dist/types/commands/ci/cmd-ci.d.mts.map +1 -0
- package/dist/types/commands/ci/fetch-default-org-slug.d.mts +4 -0
- package/dist/types/commands/ci/fetch-default-org-slug.d.mts.map +1 -0
- package/dist/types/commands/ci/handle-ci.d.mts +2 -0
- package/dist/types/commands/ci/handle-ci.d.mts.map +1 -0
- package/dist/types/commands/config/cmd-config-auto.d.mts +10 -0
- package/dist/types/commands/config/cmd-config-auto.d.mts.map +1 -0
- package/dist/types/commands/config/cmd-config-get.d.mts +10 -0
- package/dist/types/commands/config/cmd-config-get.d.mts.map +1 -0
- package/dist/types/commands/config/cmd-config-list.d.mts +10 -0
- package/dist/types/commands/config/cmd-config-list.d.mts.map +1 -0
- package/dist/types/commands/config/cmd-config-set.d.mts +10 -0
- package/dist/types/commands/config/cmd-config-set.d.mts.map +1 -0
- package/dist/types/commands/config/cmd-config-unset.d.mts +10 -0
- package/dist/types/commands/config/cmd-config-unset.d.mts.map +1 -0
- package/dist/types/commands/config/cmd-config.d.mts +3 -0
- package/dist/types/commands/config/cmd-config.d.mts.map +1 -0
- package/dist/types/commands/config/discover-config-value.d.mts +3 -0
- package/dist/types/commands/config/discover-config-value.d.mts.map +1 -0
- package/dist/types/commands/config/handle-config-auto.d.mts +7 -0
- package/dist/types/commands/config/handle-config-auto.d.mts.map +1 -0
- package/dist/types/commands/config/handle-config-get.d.mts +7 -0
- package/dist/types/commands/config/handle-config-get.d.mts.map +1 -0
- package/dist/types/commands/config/handle-config-set.d.mts +8 -0
- package/dist/types/commands/config/handle-config-set.d.mts.map +1 -0
- package/dist/types/commands/config/handle-config-unset.d.mts +7 -0
- package/dist/types/commands/config/handle-config-unset.d.mts.map +1 -0
- package/dist/types/commands/config/output-config-auto.d.mts +4 -0
- package/dist/types/commands/config/output-config-auto.d.mts.map +1 -0
- package/dist/types/commands/config/output-config-get.d.mts +4 -0
- package/dist/types/commands/config/output-config-get.d.mts.map +1 -0
- package/dist/types/commands/config/output-config-list.d.mts +6 -0
- package/dist/types/commands/config/output-config-list.d.mts.map +1 -0
- package/dist/types/commands/config/output-config-set.d.mts +3 -0
- package/dist/types/commands/config/output-config-set.d.mts.map +1 -0
- package/dist/types/commands/config/output-config-unset.d.mts +3 -0
- package/dist/types/commands/config/output-config-unset.d.mts.map +1 -0
- package/dist/types/commands/dependencies/cmd-dependencies.d.mts +10 -0
- package/dist/types/commands/dependencies/cmd-dependencies.d.mts.map +1 -0
- package/dist/types/commands/dependencies/fetch-dependencies.d.mts +7 -0
- package/dist/types/commands/dependencies/fetch-dependencies.d.mts.map +1 -0
- package/dist/types/commands/dependencies/handle-dependencies.d.mts +7 -0
- package/dist/types/commands/dependencies/handle-dependencies.d.mts.map +1 -0
- package/dist/types/commands/dependencies/output-dependencies.d.mts +8 -0
- package/dist/types/commands/dependencies/output-dependencies.d.mts.map +1 -0
- package/dist/types/commands/diff-scan/cmd-diff-scan-get.d.mts +10 -0
- package/dist/types/commands/diff-scan/cmd-diff-scan-get.d.mts.map +1 -0
- package/dist/types/commands/diff-scan/cmd-diff-scan.d.mts +3 -0
- package/dist/types/commands/diff-scan/cmd-diff-scan.d.mts.map +1 -0
- package/dist/types/commands/diff-scan/fetch-diff-scan.d.mts +8 -0
- package/dist/types/commands/diff-scan/fetch-diff-scan.d.mts.map +1 -0
- package/dist/types/commands/diff-scan/handle-diff-scan.d.mts +10 -0
- package/dist/types/commands/diff-scan/handle-diff-scan.d.mts.map +1 -0
- package/dist/types/commands/diff-scan/output-diff-scan.d.mts +8 -0
- package/dist/types/commands/diff-scan/output-diff-scan.d.mts.map +1 -0
- package/dist/types/commands/fix/cmd-fix.d.mts +10 -0
- package/dist/types/commands/fix/cmd-fix.d.mts.map +1 -0
- package/dist/types/commands/fix/git.d.mts +40 -0
- package/dist/types/commands/fix/git.d.mts.map +1 -0
- package/dist/types/commands/fix/handle-fix.d.mts +13 -0
- package/dist/types/commands/fix/handle-fix.d.mts.map +1 -0
- package/dist/types/commands/fix/npm-fix.d.mts +15 -0
- package/dist/types/commands/fix/npm-fix.d.mts.map +1 -0
- package/dist/types/commands/fix/open-pr.d.mts +49 -0
- package/dist/types/commands/fix/open-pr.d.mts.map +1 -0
- package/dist/types/commands/fix/output-fix-result.d.mts +3 -0
- package/dist/types/commands/fix/output-fix-result.d.mts.map +1 -0
- package/dist/types/commands/fix/pnpm-fix.d.mts +15 -0
- package/dist/types/commands/fix/pnpm-fix.d.mts.map +1 -0
- package/dist/types/commands/fix/run-fix.d.mts +12 -0
- package/dist/types/commands/fix/run-fix.d.mts.map +1 -0
- package/dist/types/commands/fix/shared.d.mts +9 -0
- package/dist/types/commands/fix/shared.d.mts.map +1 -0
- package/dist/types/commands/info/cmd-info.d.mts +10 -0
- package/dist/types/commands/info/cmd-info.d.mts.map +1 -0
- package/dist/types/commands/info/fetch-package-info.d.mts +3 -0
- package/dist/types/commands/info/fetch-package-info.d.mts.map +1 -0
- package/dist/types/commands/info/handle-package-info.d.mts +17 -0
- package/dist/types/commands/info/handle-package-info.d.mts.map +1 -0
- package/dist/types/commands/info/output-package-info.d.mts +10 -0
- package/dist/types/commands/info/output-package-info.d.mts.map +1 -0
- package/dist/types/commands/install/cmd-install-completion.d.mts +10 -0
- package/dist/types/commands/install/cmd-install-completion.d.mts.map +1 -0
- package/dist/types/commands/install/cmd-install.d.mts +3 -0
- package/dist/types/commands/install/cmd-install.d.mts.map +1 -0
- package/dist/types/commands/install/handle-install-completion.d.mts +2 -0
- package/dist/types/commands/install/handle-install-completion.d.mts.map +1 -0
- package/dist/types/commands/install/output-install-completion.d.mts +12 -0
- package/dist/types/commands/install/output-install-completion.d.mts.map +1 -0
- package/dist/types/commands/install/setup-tab-completion.d.mts +13 -0
- package/dist/types/commands/install/setup-tab-completion.d.mts.map +1 -0
- package/dist/types/commands/login/apply-login.d.mts +2 -0
- package/dist/types/commands/login/apply-login.d.mts.map +1 -0
- package/dist/types/commands/login/attempt-login.d.mts +2 -0
- package/dist/types/commands/login/attempt-login.d.mts.map +1 -0
- package/dist/types/commands/login/cmd-login.d.mts +10 -0
- package/dist/types/commands/login/cmd-login.d.mts.map +1 -0
- package/dist/types/commands/logout/apply-logout.d.mts +2 -0
- package/dist/types/commands/logout/apply-logout.d.mts.map +1 -0
- package/dist/types/commands/logout/attempt-logout.d.mts +2 -0
- package/dist/types/commands/logout/attempt-logout.d.mts.map +1 -0
- package/dist/types/commands/logout/cmd-logout.d.mts +10 -0
- package/dist/types/commands/logout/cmd-logout.d.mts.map +1 -0
- package/dist/types/commands/manifest/cmd-manifest-auto.d.mts +10 -0
- package/dist/types/commands/manifest/cmd-manifest-auto.d.mts.map +1 -0
- package/dist/types/commands/manifest/cmd-manifest-cdxgen.d.mts +10 -0
- package/dist/types/commands/manifest/cmd-manifest-cdxgen.d.mts.map +1 -0
- package/dist/types/commands/manifest/cmd-manifest-conda.d.mts +10 -0
- package/dist/types/commands/manifest/cmd-manifest-conda.d.mts.map +1 -0
- package/dist/types/commands/manifest/cmd-manifest-gradle.d.mts +10 -0
- package/dist/types/commands/manifest/cmd-manifest-gradle.d.mts.map +1 -0
- package/dist/types/commands/manifest/cmd-manifest-kotlin.d.mts +10 -0
- package/dist/types/commands/manifest/cmd-manifest-kotlin.d.mts.map +1 -0
- package/dist/types/commands/manifest/cmd-manifest-scala.d.mts +10 -0
- package/dist/types/commands/manifest/cmd-manifest-scala.d.mts.map +1 -0
- package/dist/types/commands/manifest/cmd-manifest-setup.d.mts +10 -0
- package/dist/types/commands/manifest/cmd-manifest-setup.d.mts.map +1 -0
- package/dist/types/commands/manifest/cmd-manifest.d.mts +10 -0
- package/dist/types/commands/manifest/cmd-manifest.d.mts.map +1 -0
- package/dist/types/commands/manifest/convert-conda-to-requirements.d.mts +8 -0
- package/dist/types/commands/manifest/convert-conda-to-requirements.d.mts.map +1 -0
- package/dist/types/commands/manifest/convert_gradle_to_maven.d.mts +7 -0
- package/dist/types/commands/manifest/convert_gradle_to_maven.d.mts.map +1 -0
- package/dist/types/commands/manifest/convert_sbt_to_maven.d.mts +8 -0
- package/dist/types/commands/manifest/convert_sbt_to_maven.d.mts.map +1 -0
- package/dist/types/commands/manifest/detect-manifest-actions.d.mts +13 -0
- package/dist/types/commands/manifest/detect-manifest-actions.d.mts.map +1 -0
- package/dist/types/commands/manifest/generate_auto_manifest.d.mts +9 -0
- package/dist/types/commands/manifest/generate_auto_manifest.d.mts.map +1 -0
- package/dist/types/commands/manifest/handle-manifest-conda.d.mts +9 -0
- package/dist/types/commands/manifest/handle-manifest-conda.d.mts.map +1 -0
- package/dist/types/commands/manifest/handle-manifest-setup.d.mts +2 -0
- package/dist/types/commands/manifest/handle-manifest-setup.d.mts.map +1 -0
- package/dist/types/commands/manifest/output-manifest-setup.d.mts +3 -0
- package/dist/types/commands/manifest/output-manifest-setup.d.mts.map +1 -0
- package/dist/types/commands/manifest/output-requirements.d.mts +6 -0
- package/dist/types/commands/manifest/output-requirements.d.mts.map +1 -0
- package/dist/types/commands/manifest/run-cdxgen.d.mts +2 -0
- package/dist/types/commands/manifest/run-cdxgen.d.mts.map +1 -0
- package/dist/types/commands/manifest/setup-manifest-config.d.mts +3 -0
- package/dist/types/commands/manifest/setup-manifest-config.d.mts.map +1 -0
- package/dist/types/commands/npm/cmd-npm.d.mts +10 -0
- package/dist/types/commands/npm/cmd-npm.d.mts.map +1 -0
- package/dist/types/commands/npx/cmd-npx.d.mts +10 -0
- package/dist/types/commands/npx/cmd-npx.d.mts.map +1 -0
- package/dist/types/commands/oops/cmd-oops.d.mts +10 -0
- package/dist/types/commands/oops/cmd-oops.d.mts.map +1 -0
- package/dist/types/commands/optimize/add-overrides.d.mts +20 -0
- package/dist/types/commands/optimize/add-overrides.d.mts.map +1 -0
- package/dist/types/commands/optimize/apply-optimization.d.mts +9 -0
- package/dist/types/commands/optimize/apply-optimization.d.mts.map +1 -0
- package/dist/types/commands/optimize/cmd-optimize.d.mts +10 -0
- package/dist/types/commands/optimize/cmd-optimize.d.mts.map +1 -0
- package/dist/types/commands/optimize/deps-includes-by-agent.d.mts +4 -0
- package/dist/types/commands/optimize/deps-includes-by-agent.d.mts.map +1 -0
- package/dist/types/commands/optimize/get-dependency-entries.d.mts +3 -0
- package/dist/types/commands/optimize/get-dependency-entries.d.mts.map +1 -0
- package/dist/types/commands/optimize/get-overrides-by-agent.d.mts +9 -0
- package/dist/types/commands/optimize/get-overrides-by-agent.d.mts.map +1 -0
- package/dist/types/commands/optimize/handle-optimize.d.mts +8 -0
- package/dist/types/commands/optimize/handle-optimize.d.mts.map +1 -0
- package/dist/types/commands/optimize/lockfile-includes-by-agent.d.mts +3 -0
- package/dist/types/commands/optimize/lockfile-includes-by-agent.d.mts.map +1 -0
- package/dist/types/commands/optimize/ls-by-agent.d.mts +7 -0
- package/dist/types/commands/optimize/ls-by-agent.d.mts.map +1 -0
- package/dist/types/commands/optimize/output-optimize-result.d.mts +9 -0
- package/dist/types/commands/optimize/output-optimize-result.d.mts.map +1 -0
- package/dist/types/commands/optimize/shared.d.mts +2 -0
- package/dist/types/commands/optimize/shared.d.mts.map +1 -0
- package/dist/types/commands/optimize/types.d.mts +9 -0
- package/dist/types/commands/optimize/types.d.mts.map +1 -0
- package/dist/types/commands/optimize/update-lockfile.d.mts +11 -0
- package/dist/types/commands/optimize/update-lockfile.d.mts.map +1 -0
- package/dist/types/commands/optimize/update-manifest-by-agent.d.mts +5 -0
- package/dist/types/commands/optimize/update-manifest-by-agent.d.mts.map +1 -0
- package/dist/types/commands/organization/cmd-organization-list.d.mts +10 -0
- package/dist/types/commands/organization/cmd-organization-list.d.mts.map +1 -0
- package/dist/types/commands/organization/cmd-organization-policy-license.d.mts +10 -0
- package/dist/types/commands/organization/cmd-organization-policy-license.d.mts.map +1 -0
- package/dist/types/commands/organization/cmd-organization-policy-security.d.mts +10 -0
- package/dist/types/commands/organization/cmd-organization-policy-security.d.mts.map +1 -0
- package/dist/types/commands/organization/cmd-organization-policy.d.mts +3 -0
- package/dist/types/commands/organization/cmd-organization-policy.d.mts.map +1 -0
- package/dist/types/commands/organization/cmd-organization-quota.d.mts +10 -0
- package/dist/types/commands/organization/cmd-organization-quota.d.mts.map +1 -0
- package/dist/types/commands/organization/cmd-organization.d.mts +3 -0
- package/dist/types/commands/organization/cmd-organization.d.mts.map +1 -0
- package/dist/types/commands/organization/fetch-license-policy.d.mts +4 -0
- package/dist/types/commands/organization/fetch-license-policy.d.mts.map +1 -0
- package/dist/types/commands/organization/fetch-organization-list.d.mts +4 -0
- package/dist/types/commands/organization/fetch-organization-list.d.mts.map +1 -0
- package/dist/types/commands/organization/fetch-quota.d.mts +4 -0
- package/dist/types/commands/organization/fetch-quota.d.mts.map +1 -0
- package/dist/types/commands/organization/fetch-security-policy.d.mts +4 -0
- package/dist/types/commands/organization/fetch-security-policy.d.mts.map +1 -0
- package/dist/types/commands/organization/handle-license-policy.d.mts +3 -0
- package/dist/types/commands/organization/handle-license-policy.d.mts.map +1 -0
- package/dist/types/commands/organization/handle-organization-list.d.mts +3 -0
- package/dist/types/commands/organization/handle-organization-list.d.mts.map +1 -0
- package/dist/types/commands/organization/handle-quota.d.mts +3 -0
- package/dist/types/commands/organization/handle-quota.d.mts.map +1 -0
- package/dist/types/commands/organization/handle-security-policy.d.mts +3 -0
- package/dist/types/commands/organization/handle-security-policy.d.mts.map +1 -0
- package/dist/types/commands/organization/output-license-policy.d.mts +4 -0
- package/dist/types/commands/organization/output-license-policy.d.mts.map +1 -0
- package/dist/types/commands/organization/output-organization-list.d.mts +4 -0
- package/dist/types/commands/organization/output-organization-list.d.mts.map +1 -0
- package/dist/types/commands/organization/output-quota.d.mts +4 -0
- package/dist/types/commands/organization/output-quota.d.mts.map +1 -0
- package/dist/types/commands/organization/output-security-policy.d.mts +4 -0
- package/dist/types/commands/organization/output-security-policy.d.mts.map +1 -0
- package/dist/types/commands/package/cmd-package-score.d.mts +10 -0
- package/dist/types/commands/package/cmd-package-score.d.mts.map +1 -0
- package/dist/types/commands/package/cmd-package-shallow.d.mts +17 -0
- package/dist/types/commands/package/cmd-package-shallow.d.mts.map +1 -0
- package/dist/types/commands/package/cmd-package.d.mts +3 -0
- package/dist/types/commands/package/cmd-package.d.mts.map +1 -0
- package/dist/types/commands/package/fetch-purl-deep-score.d.mts +51 -0
- package/dist/types/commands/package/fetch-purl-deep-score.d.mts.map +1 -0
- package/dist/types/commands/package/fetch-purls-shallow-score.d.mts +4 -0
- package/dist/types/commands/package/fetch-purls-shallow-score.d.mts.map +1 -0
- package/dist/types/commands/package/handle-purl-deep-score.d.mts +3 -0
- package/dist/types/commands/package/handle-purl-deep-score.d.mts.map +1 -0
- package/dist/types/commands/package/handle-purls-shallow-score.d.mts +6 -0
- package/dist/types/commands/package/handle-purls-shallow-score.d.mts.map +1 -0
- package/dist/types/commands/package/output-purl-score.d.mts +4 -0
- package/dist/types/commands/package/output-purl-score.d.mts.map +1 -0
- package/dist/types/commands/package/output-purls-shallow-score.d.mts +4 -0
- package/dist/types/commands/package/output-purls-shallow-score.d.mts.map +1 -0
- package/dist/types/commands/package/parse-package-specifiers.d.mts +9 -0
- package/dist/types/commands/package/parse-package-specifiers.d.mts.map +1 -0
- package/dist/types/commands/raw-npm/cmd-raw-npm.d.mts +10 -0
- package/dist/types/commands/raw-npm/cmd-raw-npm.d.mts.map +1 -0
- package/dist/types/commands/raw-npm/run-raw-npm.d.mts +2 -0
- package/dist/types/commands/raw-npm/run-raw-npm.d.mts.map +1 -0
- package/dist/types/commands/raw-npx/cmd-raw-npx.d.mts +10 -0
- package/dist/types/commands/raw-npx/cmd-raw-npx.d.mts.map +1 -0
- package/dist/types/commands/raw-npx/run-raw-npx.d.mts +2 -0
- package/dist/types/commands/raw-npx/run-raw-npx.d.mts.map +1 -0
- package/dist/types/commands/report/cmd-report-create.d.mts +10 -0
- package/dist/types/commands/report/cmd-report-create.d.mts.map +1 -0
- package/dist/types/commands/report/cmd-report-view.d.mts +10 -0
- package/dist/types/commands/report/cmd-report-view.d.mts.map +1 -0
- package/dist/types/commands/report/cmd-report.d.mts +3 -0
- package/dist/types/commands/report/cmd-report.d.mts.map +1 -0
- package/dist/types/commands/repos/cmd-repos-create.d.mts +10 -0
- package/dist/types/commands/repos/cmd-repos-create.d.mts.map +1 -0
- package/dist/types/commands/repos/cmd-repos-del.d.mts +10 -0
- package/dist/types/commands/repos/cmd-repos-del.d.mts.map +1 -0
- package/dist/types/commands/repos/cmd-repos-list.d.mts +10 -0
- package/dist/types/commands/repos/cmd-repos-list.d.mts.map +1 -0
- package/dist/types/commands/repos/cmd-repos-update.d.mts +10 -0
- package/dist/types/commands/repos/cmd-repos-update.d.mts.map +1 -0
- package/dist/types/commands/repos/cmd-repos-view.d.mts +10 -0
- package/dist/types/commands/repos/cmd-repos-view.d.mts.map +1 -0
- package/dist/types/commands/repos/cmd-repos.d.mts +3 -0
- package/dist/types/commands/repos/cmd-repos.d.mts.map +1 -0
- package/dist/types/commands/repos/fetch-create-repo.d.mts +11 -0
- package/dist/types/commands/repos/fetch-create-repo.d.mts.map +1 -0
- package/dist/types/commands/repos/fetch-delete-repo.d.mts +4 -0
- package/dist/types/commands/repos/fetch-delete-repo.d.mts.map +1 -0
- package/dist/types/commands/repos/fetch-list-all-repos.d.mts +8 -0
- package/dist/types/commands/repos/fetch-list-all-repos.d.mts.map +1 -0
- package/dist/types/commands/repos/fetch-list-repos.d.mts +10 -0
- package/dist/types/commands/repos/fetch-list-repos.d.mts.map +1 -0
- package/dist/types/commands/repos/fetch-update-repo.d.mts +11 -0
- package/dist/types/commands/repos/fetch-update-repo.d.mts.map +1 -0
- package/dist/types/commands/repos/fetch-view-repo.d.mts +4 -0
- package/dist/types/commands/repos/fetch-view-repo.d.mts.map +1 -0
- package/dist/types/commands/repos/handle-create-repo.d.mts +10 -0
- package/dist/types/commands/repos/handle-create-repo.d.mts.map +1 -0
- package/dist/types/commands/repos/handle-delete-repo.d.mts +3 -0
- package/dist/types/commands/repos/handle-delete-repo.d.mts.map +1 -0
- package/dist/types/commands/repos/handle-list-repos.d.mts +11 -0
- package/dist/types/commands/repos/handle-list-repos.d.mts.map +1 -0
- package/dist/types/commands/repos/handle-update-repo.d.mts +10 -0
- package/dist/types/commands/repos/handle-update-repo.d.mts.map +1 -0
- package/dist/types/commands/repos/handle-view-repo.d.mts +3 -0
- package/dist/types/commands/repos/handle-view-repo.d.mts.map +1 -0
- package/dist/types/commands/repos/output-create-repo.d.mts +4 -0
- package/dist/types/commands/repos/output-create-repo.d.mts.map +1 -0
- package/dist/types/commands/repos/output-delete-repo.d.mts +4 -0
- package/dist/types/commands/repos/output-delete-repo.d.mts.map +1 -0
- package/dist/types/commands/repos/output-list-repos.d.mts +4 -0
- package/dist/types/commands/repos/output-list-repos.d.mts.map +1 -0
- package/dist/types/commands/repos/output-update-repo.d.mts +4 -0
- package/dist/types/commands/repos/output-update-repo.d.mts.map +1 -0
- package/dist/types/commands/repos/output-view-repo.d.mts +4 -0
- package/dist/types/commands/repos/output-view-repo.d.mts.map +1 -0
- package/dist/types/commands/scan/cmd-scan-create.d.mts +10 -0
- package/dist/types/commands/scan/cmd-scan-create.d.mts.map +1 -0
- package/dist/types/commands/scan/cmd-scan-del.d.mts +10 -0
- package/dist/types/commands/scan/cmd-scan-del.d.mts.map +1 -0
- package/dist/types/commands/scan/cmd-scan-diff.d.mts +10 -0
- package/dist/types/commands/scan/cmd-scan-diff.d.mts.map +1 -0
- package/dist/types/commands/scan/cmd-scan-github.d.mts +10 -0
- package/dist/types/commands/scan/cmd-scan-github.d.mts.map +1 -0
- package/dist/types/commands/scan/cmd-scan-list.d.mts +3 -0
- package/dist/types/commands/scan/cmd-scan-list.d.mts.map +1 -0
- package/dist/types/commands/scan/cmd-scan-metadata.d.mts +3 -0
- package/dist/types/commands/scan/cmd-scan-metadata.d.mts.map +1 -0
- package/dist/types/commands/scan/cmd-scan-reach.d.mts +10 -0
- package/dist/types/commands/scan/cmd-scan-reach.d.mts.map +1 -0
- package/dist/types/commands/scan/cmd-scan-report.d.mts +3 -0
- package/dist/types/commands/scan/cmd-scan-report.d.mts.map +1 -0
- package/dist/types/commands/scan/cmd-scan-setup.d.mts +10 -0
- package/dist/types/commands/scan/cmd-scan-setup.d.mts.map +1 -0
- package/dist/types/commands/scan/cmd-scan-view.d.mts +3 -0
- package/dist/types/commands/scan/cmd-scan-view.d.mts.map +1 -0
- package/dist/types/commands/scan/cmd-scan.d.mts +3 -0
- package/dist/types/commands/scan/cmd-scan.d.mts.map +1 -0
- package/dist/types/commands/scan/create-scan-from-github.d.mts +12 -0
- package/dist/types/commands/scan/create-scan-from-github.d.mts.map +1 -0
- package/dist/types/commands/scan/fetch-create-org-full-scan.d.mts +11 -0
- package/dist/types/commands/scan/fetch-create-org-full-scan.d.mts.map +1 -0
- package/dist/types/commands/scan/fetch-delete-org-full-scan.d.mts +4 -0
- package/dist/types/commands/scan/fetch-delete-org-full-scan.d.mts.map +1 -0
- package/dist/types/commands/scan/fetch-diff-scan.d.mts +8 -0
- package/dist/types/commands/scan/fetch-diff-scan.d.mts.map +1 -0
- package/dist/types/commands/scan/fetch-list-scans.d.mts +13 -0
- package/dist/types/commands/scan/fetch-list-scans.d.mts.map +1 -0
- package/dist/types/commands/scan/fetch-report-data.d.mts +12 -0
- package/dist/types/commands/scan/fetch-report-data.d.mts.map +1 -0
- package/dist/types/commands/scan/fetch-scan-metadata.d.mts +4 -0
- package/dist/types/commands/scan/fetch-scan-metadata.d.mts.map +1 -0
- package/dist/types/commands/scan/fetch-scan.d.mts +4 -0
- package/dist/types/commands/scan/fetch-scan.d.mts.map +1 -0
- package/dist/types/commands/scan/fetch-supported-scan-file-names.d.mts +4 -0
- package/dist/types/commands/scan/fetch-supported-scan-file-names.d.mts.map +1 -0
- package/dist/types/commands/scan/generate-report.d.mts +43 -0
- package/dist/types/commands/scan/generate-report.d.mts.map +1 -0
- package/dist/types/commands/scan/handle-create-github-scan.d.mts +12 -0
- package/dist/types/commands/scan/handle-create-github-scan.d.mts.map +1 -0
- package/dist/types/commands/scan/handle-create-new-scan.d.mts +21 -0
- package/dist/types/commands/scan/handle-create-new-scan.d.mts.map +1 -0
- package/dist/types/commands/scan/handle-delete-scan.d.mts +3 -0
- package/dist/types/commands/scan/handle-delete-scan.d.mts.map +1 -0
- package/dist/types/commands/scan/handle-diff-scan.d.mts +10 -0
- package/dist/types/commands/scan/handle-diff-scan.d.mts.map +1 -0
- package/dist/types/commands/scan/handle-list-scans.d.mts +13 -0
- package/dist/types/commands/scan/handle-list-scans.d.mts.map +1 -0
- package/dist/types/commands/scan/handle-reach-scan.d.mts +3 -0
- package/dist/types/commands/scan/handle-reach-scan.d.mts.map +1 -0
- package/dist/types/commands/scan/handle-scan-config.d.mts +2 -0
- package/dist/types/commands/scan/handle-scan-config.d.mts.map +1 -0
- package/dist/types/commands/scan/handle-scan-metadata.d.mts +3 -0
- package/dist/types/commands/scan/handle-scan-metadata.d.mts.map +1 -0
- package/dist/types/commands/scan/handle-scan-report.d.mts +12 -0
- package/dist/types/commands/scan/handle-scan-report.d.mts.map +1 -0
- package/dist/types/commands/scan/handle-scan-view.d.mts +3 -0
- package/dist/types/commands/scan/handle-scan-view.d.mts.map +1 -0
- package/dist/types/commands/scan/output-create-new-scan.d.mts +4 -0
- package/dist/types/commands/scan/output-create-new-scan.d.mts.map +1 -0
- package/dist/types/commands/scan/output-delete-scan.d.mts +4 -0
- package/dist/types/commands/scan/output-delete-scan.d.mts.map +1 -0
- package/dist/types/commands/scan/output-diff-scan.d.mts +8 -0
- package/dist/types/commands/scan/output-diff-scan.d.mts.map +1 -0
- package/dist/types/commands/scan/output-list-scans.d.mts +4 -0
- package/dist/types/commands/scan/output-list-scans.d.mts.map +1 -0
- package/dist/types/commands/scan/output-scan-config-result.d.mts +3 -0
- package/dist/types/commands/scan/output-scan-config-result.d.mts.map +1 -0
- package/dist/types/commands/scan/output-scan-metadata.d.mts +4 -0
- package/dist/types/commands/scan/output-scan-metadata.d.mts.map +1 -0
- package/dist/types/commands/scan/output-scan-reach.d.mts +3 -0
- package/dist/types/commands/scan/output-scan-reach.d.mts.map +1 -0
- package/dist/types/commands/scan/output-scan-report.d.mts +20 -0
- package/dist/types/commands/scan/output-scan-report.d.mts.map +1 -0
- package/dist/types/commands/scan/output-scan-view.d.mts +4 -0
- package/dist/types/commands/scan/output-scan-view.d.mts.map +1 -0
- package/dist/types/commands/scan/scan-reachability.d.mts +3 -0
- package/dist/types/commands/scan/scan-reachability.d.mts.map +1 -0
- package/dist/types/commands/scan/setup-scan-config.d.mts +3 -0
- package/dist/types/commands/scan/setup-scan-config.d.mts.map +1 -0
- package/dist/types/commands/scan/stream-scan.d.mts +2 -0
- package/dist/types/commands/scan/stream-scan.d.mts.map +1 -0
- package/dist/types/commands/scan/suggest-org-slug.d.mts +2 -0
- package/dist/types/commands/scan/suggest-org-slug.d.mts.map +1 -0
- package/dist/types/commands/scan/suggest-repo-slug.d.mts +5 -0
- package/dist/types/commands/scan/suggest-repo-slug.d.mts.map +1 -0
- package/dist/types/commands/scan/suggest_branch_slug.d.mts +2 -0
- package/dist/types/commands/scan/suggest_branch_slug.d.mts.map +1 -0
- package/dist/types/commands/scan/suggest_target.d.mts +2 -0
- package/dist/types/commands/scan/suggest_target.d.mts.map +1 -0
- package/dist/types/commands/threat-feed/cmd-threat-feed.d.mts +10 -0
- package/dist/types/commands/threat-feed/cmd-threat-feed.d.mts.map +1 -0
- package/dist/types/commands/threat-feed/fetch-threat-feed.d.mts +10 -0
- package/dist/types/commands/threat-feed/fetch-threat-feed.d.mts.map +1 -0
- package/dist/types/commands/threat-feed/handle-threat-feed.d.mts +10 -0
- package/dist/types/commands/threat-feed/handle-threat-feed.d.mts.map +1 -0
- package/dist/types/commands/threat-feed/output-threat-feed.d.mts +4 -0
- package/dist/types/commands/threat-feed/output-threat-feed.d.mts.map +1 -0
- package/dist/types/commands/threat-feed/types.d.mts +15 -0
- package/dist/types/commands/threat-feed/types.d.mts.map +1 -0
- package/dist/types/commands/uninstall/cmd-uninstall-completion.d.mts +9 -0
- package/dist/types/commands/uninstall/cmd-uninstall-completion.d.mts.map +1 -0
- package/dist/types/commands/uninstall/cmd-uninstall.d.mts +3 -0
- package/dist/types/commands/uninstall/cmd-uninstall.d.mts.map +1 -0
- package/dist/types/commands/uninstall/handle-uninstall-completion.d.mts +2 -0
- package/dist/types/commands/uninstall/handle-uninstall-completion.d.mts.map +1 -0
- package/dist/types/commands/uninstall/output-uninstall-completion.d.mts +6 -0
- package/dist/types/commands/uninstall/output-uninstall-completion.d.mts.map +1 -0
- package/dist/types/commands/uninstall/teardown-tab-completion.d.mts +6 -0
- package/dist/types/commands/uninstall/teardown-tab-completion.d.mts.map +1 -0
- package/dist/types/commands/wrapper/add-socket-wrapper.d.mts +2 -0
- package/dist/types/commands/wrapper/add-socket-wrapper.d.mts.map +1 -0
- package/dist/types/commands/wrapper/check-socket-wrapper-setup.d.mts +2 -0
- package/dist/types/commands/wrapper/check-socket-wrapper-setup.d.mts.map +1 -0
- package/dist/types/commands/wrapper/cmd-wrapper.d.mts +10 -0
- package/dist/types/commands/wrapper/cmd-wrapper.d.mts.map +1 -0
- package/dist/types/commands/wrapper/postinstall-wrapper.d.mts +2 -0
- package/dist/types/commands/wrapper/postinstall-wrapper.d.mts.map +1 -0
- package/dist/types/commands/wrapper/remove-socket-wrapper.d.mts +2 -0
- package/dist/types/commands/wrapper/remove-socket-wrapper.d.mts.map +1 -0
- package/dist/types/constants.d.mts +128 -0
- package/dist/types/constants.d.mts.map +1 -0
- package/dist/types/flags.d.mts +16 -0
- package/dist/types/flags.d.mts.map +1 -0
- package/dist/types/instrument-with-sentry.d.mts +2 -0
- package/dist/types/instrument-with-sentry.d.mts.map +1 -0
- package/dist/types/shadow/npm/arborist/index.d.mts +19 -0
- package/dist/types/shadow/npm/arborist/index.d.mts.map +1 -0
- package/dist/types/shadow/npm/arborist/lib/arborist/index.d.mts +24 -0
- package/dist/types/shadow/npm/arborist/lib/arborist/index.d.mts.map +1 -0
- package/dist/types/shadow/npm/arborist/types.d.mts +119 -0
- package/dist/types/shadow/npm/arborist/types.d.mts.map +1 -0
- package/dist/types/shadow/npm/arborist-helpers.d.mts +35 -0
- package/dist/types/shadow/npm/arborist-helpers.d.mts.map +1 -0
- package/dist/types/shadow/npm/bin.d.mts +2 -0
- package/dist/types/shadow/npm/bin.d.mts.map +1 -0
- package/dist/types/shadow/npm/inject.d.mts +2 -0
- package/dist/types/shadow/npm/inject.d.mts.map +1 -0
- package/dist/types/shadow/npm/install.d.mts +13 -0
- package/dist/types/shadow/npm/install.d.mts.map +1 -0
- package/dist/types/shadow/npm/link.d.mts +2 -0
- package/dist/types/shadow/npm/link.d.mts.map +1 -0
- package/dist/types/shadow/npm/paths.d.mts +7 -0
- package/dist/types/shadow/npm/paths.d.mts.map +1 -0
- package/dist/types/shadow/npm/proc-log/index.d.mts +3 -0
- package/dist/types/shadow/npm/proc-log/index.d.mts.map +1 -0
- package/dist/types/types.d.mts +29 -0
- package/dist/types/types.d.mts.map +1 -0
- package/dist/types/utils/agent.d.mts +12 -0
- package/dist/types/utils/agent.d.mts.map +1 -0
- package/dist/types/utils/alert/artifact.d.mts +35 -0
- package/dist/types/utils/alert/artifact.d.mts.map +1 -0
- package/dist/types/utils/alert/fix.d.mts +6 -0
- package/dist/types/utils/alert/fix.d.mts.map +1 -0
- package/dist/types/utils/alert/severity.d.mts +14 -0
- package/dist/types/utils/alert/severity.d.mts.map +1 -0
- package/dist/types/utils/alerts-map.d.mts +25 -0
- package/dist/types/utils/alerts-map.d.mts.map +1 -0
- package/dist/types/utils/api.d.mts +13 -0
- package/dist/types/utils/api.d.mts.map +1 -0
- package/dist/types/utils/check-input.d.mts +9 -0
- package/dist/types/utils/check-input.d.mts.map +1 -0
- package/dist/types/utils/cmd.d.mts +4 -0
- package/dist/types/utils/cmd.d.mts.map +1 -0
- package/dist/types/utils/color-or-markdown.d.mts +16 -0
- package/dist/types/utils/color-or-markdown.d.mts.map +1 -0
- package/dist/types/utils/completion.d.mts +11 -0
- package/dist/types/utils/completion.d.mts.map +1 -0
- package/dist/types/utils/config.d.mts +31 -0
- package/dist/types/utils/config.d.mts.map +1 -0
- package/dist/types/utils/determine-org-slug.d.mts +2 -0
- package/dist/types/utils/determine-org-slug.d.mts.map +1 -0
- package/dist/types/utils/errors.d.mts +14 -0
- package/dist/types/utils/errors.d.mts.map +1 -0
- package/dist/types/utils/fail-msg-with-badge.d.mts +2 -0
- package/dist/types/utils/fail-msg-with-badge.d.mts.map +1 -0
- package/dist/types/utils/fs.d.mts +22 -0
- package/dist/types/utils/fs.d.mts.map +1 -0
- package/dist/types/utils/get-output-kind.d.mts +3 -0
- package/dist/types/utils/get-output-kind.d.mts.map +1 -0
- package/dist/types/utils/glob.d.mts +14 -0
- package/dist/types/utils/glob.d.mts.map +1 -0
- package/dist/types/utils/map-to-object.d.mts +10 -0
- package/dist/types/utils/map-to-object.d.mts.map +1 -0
- package/dist/types/utils/markdown.d.mts +10 -0
- package/dist/types/utils/markdown.d.mts.map +1 -0
- package/dist/types/utils/meow-with-subcommands.d.mts +50 -0
- package/dist/types/utils/meow-with-subcommands.d.mts.map +1 -0
- package/dist/types/utils/npm-package-arg.d.mts +4 -0
- package/dist/types/utils/npm-package-arg.d.mts.map +1 -0
- package/dist/types/utils/npm-paths.d.mts +7 -0
- package/dist/types/utils/npm-paths.d.mts.map +1 -0
- package/dist/types/utils/objects.d.mts +3 -0
- package/dist/types/utils/objects.d.mts.map +1 -0
- package/dist/types/utils/output-formatting.d.mts +15 -0
- package/dist/types/utils/output-formatting.d.mts.map +1 -0
- package/dist/types/utils/package-environment.d.mts +57 -0
- package/dist/types/utils/package-environment.d.mts.map +1 -0
- package/dist/types/utils/path-resolve.d.mts +10 -0
- package/dist/types/utils/path-resolve.d.mts.map +1 -0
- package/dist/types/utils/pnpm.d.mts +11 -0
- package/dist/types/utils/pnpm.d.mts.map +1 -0
- package/dist/types/utils/purl.d.mts +97 -0
- package/dist/types/utils/purl.d.mts.map +1 -0
- package/dist/types/utils/sdk.d.mts +8 -0
- package/dist/types/utils/sdk.d.mts.map +1 -0
- package/dist/types/utils/semver.d.mts +8 -0
- package/dist/types/utils/semver.d.mts.map +1 -0
- package/dist/types/utils/serialize-result-json.d.mts +5 -0
- package/dist/types/utils/serialize-result-json.d.mts.map +1 -0
- package/dist/types/utils/socket-package-alert.d.mts +78 -0
- package/dist/types/utils/socket-package-alert.d.mts.map +1 -0
- package/dist/types/utils/socket-url.d.mts +7 -0
- package/dist/types/utils/socket-url.d.mts.map +1 -0
- package/dist/types/utils/socketjson.d.mts +56 -0
- package/dist/types/utils/socketjson.d.mts.map +1 -0
- package/dist/types/utils/spec.d.mts +5 -0
- package/dist/types/utils/spec.d.mts.map +1 -0
- package/dist/types/utils/strings.d.mts +2 -0
- package/dist/types/utils/strings.d.mts.map +1 -0
- package/dist/types/utils/translations.d.mts +593 -0
- package/dist/types/utils/translations.d.mts.map +1 -0
- package/dist/types/utils/walk-nested-map.d.mts +7 -0
- package/dist/types/utils/walk-nested-map.d.mts.map +1 -0
- package/dist/utils.js +278 -168
- package/dist/utils.js.map +1 -1
- package/dist/vendor.js +57456 -53054
- package/external/@socketsecurity/registry/external/browserslist.js +395 -358
- package/external/@socketsecurity/registry/lib/debug.js +15 -5
- package/external/@socketsecurity/registry/lib/logger.js +3 -10
- package/external/@socketsecurity/registry/lib/strings.js +9 -1
- 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$
|
|
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$
|
|
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
|
|
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
|
-
|
|
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
|
|
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
|
-
${
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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
|
|
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(
|
|
1626
|
-
const
|
|
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 === '
|
|
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,
|
|
2126
|
+
async function addArtifactToAlertsMap(artifact, alertsByPurl, options) {
|
|
2094
2127
|
// Make TypeScript happy.
|
|
2095
2128
|
if (!artifact.name || !artifact.version || !artifact.alerts?.length) {
|
|
2096
|
-
return
|
|
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
|
|
2190
|
+
return alertsByPurl;
|
|
2156
2191
|
}
|
|
2157
|
-
const
|
|
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
|
-
|
|
2241
|
+
alertsByPurl.set(purl, sockPkgAlerts);
|
|
2207
2242
|
}
|
|
2208
|
-
return
|
|
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
|
|
2243
|
-
alertsMapLoop: for (const
|
|
2244
|
-
|
|
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(
|
|
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 (!
|
|
2252
|
-
|
|
2290
|
+
if (!infoByPartialPurl) {
|
|
2291
|
+
infoByPartialPurl = new Map();
|
|
2253
2292
|
}
|
|
2254
|
-
let infos =
|
|
2293
|
+
let infos = infoByPartialPurl.get(partialPurl);
|
|
2255
2294
|
if (!infos) {
|
|
2256
2295
|
infos = new Map();
|
|
2257
|
-
|
|
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
|
|
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
|
|
2310
|
-
const
|
|
2311
|
-
const
|
|
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:
|
|
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
|
-
|
|
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
|
-
|
|
2373
|
+
viewableAlertsByPurl.set(purl, viewableAlerts);
|
|
2335
2374
|
if (viewableAlerts.find(a => a.blocked || getAlertSeverityOrder(a) < ALERT_SEVERITY_ORDER.middle)) {
|
|
2336
|
-
|
|
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:
|
|
2343
|
-
} of
|
|
2344
|
-
if (
|
|
2381
|
+
0: purl
|
|
2382
|
+
} of viewableAlertsByPurl.entries()) {
|
|
2383
|
+
if (aboveTheFoldPurls.size >= MIN_ABOVE_THE_FOLD_COUNT) {
|
|
2345
2384
|
break;
|
|
2346
2385
|
}
|
|
2347
|
-
|
|
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:
|
|
2390
|
+
0: purl,
|
|
2352
2391
|
1: hiddenAlerts
|
|
2353
|
-
} of
|
|
2354
|
-
if (
|
|
2392
|
+
} of hiddenAlertsByPurl.entries()) {
|
|
2393
|
+
if (aboveTheFoldPurls.size >= MIN_ABOVE_THE_FOLD_COUNT) {
|
|
2355
2394
|
break;
|
|
2356
2395
|
}
|
|
2357
|
-
|
|
2358
|
-
const viewableAlerts =
|
|
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
|
-
|
|
2405
|
+
hiddenAlertsByPurl.delete(purl);
|
|
2367
2406
|
}
|
|
2368
|
-
|
|
2407
|
+
viewableAlertsByPurl.set(purl, [...viewableAlerts, ...removedHiddenAlerts]);
|
|
2369
2408
|
}
|
|
2370
2409
|
}
|
|
2371
|
-
const
|
|
2372
|
-
for (let i = 0, prevAboveTheFold = true, 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:
|
|
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 =
|
|
2397
|
-
const
|
|
2398
|
-
const
|
|
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
|
-
|
|
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 =
|
|
2448
|
+
const hiddenAlerts = hiddenAlertsByPurl.get(purl) ?? [];
|
|
2409
2449
|
const {
|
|
2410
2450
|
length: hiddenAlertsCount
|
|
2411
2451
|
} = hiddenAlerts;
|
|
2412
2452
|
if (hiddenAlertsCount) {
|
|
2413
|
-
|
|
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 =
|
|
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:
|
|
2471
|
+
0: purl,
|
|
2432
2472
|
1: alerts
|
|
2433
|
-
} of
|
|
2434
|
-
if (
|
|
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(`${
|
|
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
|
|
2592
|
+
const alertsByPurl = new Map();
|
|
2484
2593
|
if (!remaining) {
|
|
2485
|
-
return
|
|
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,
|
|
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
|
|
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.
|
|
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=
|
|
3243
|
+
//# debugId=c940586c-7f80-4e5e-ab46-bf967fcb3730
|
|
3134
3244
|
//# sourceMappingURL=utils.js.map
|