@socketsecurity/cli-with-sentry 1.0.84 → 1.0.86
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/README.md +41 -52
- package/dist/cli.js +380 -396
- package/dist/cli.js.map +1 -1
- package/dist/constants.js +20 -48
- package/dist/constants.js.map +1 -1
- package/dist/flags.js +5 -4
- package/dist/flags.js.map +1 -1
- package/dist/socket-completion.bash +0 -2
- package/dist/utils.js +73 -93
- package/dist/utils.js.map +1 -1
- package/dist/vendor.js +381 -381
- package/external/@coana-tech/cli/cli.mjs +25295 -30074
- package/external/@socketsecurity/registry/external/@npmcli/package-json/index.js +39 -1
- package/external/@socketsecurity/registry/external/browserslist.js +7 -1
- package/external/@socketsecurity/registry/external/libnpmpack.js +93488 -97365
- package/external/@socketsecurity/registry/external/make-fetch-happen.js +4689 -7729
- package/external/@socketsecurity/registry/external/pacote.js +51922 -72554
- package/external/@socketsecurity/registry/lib/constants/env.js +4 -4
- package/external/@socketsecurity/registry/lib/npm.js +2 -4
- package/external/@socketsecurity/registry/lib/path.js +17 -0
- package/package.json +12 -12
- package/dist/tsconfig.dts.tsbuildinfo +0 -1
- package/dist/types/cli.d.mts +0 -3
- package/dist/types/cli.d.mts.map +0 -1
- package/dist/types/commands/analytics/cmd-analytics.d.mts +0 -10
- package/dist/types/commands/analytics/cmd-analytics.d.mts.map +0 -1
- package/dist/types/commands/analytics/fetch-org-analytics.d.mts +0 -8
- package/dist/types/commands/analytics/fetch-org-analytics.d.mts.map +0 -1
- package/dist/types/commands/analytics/fetch-repo-analytics.d.mts +0 -8
- package/dist/types/commands/analytics/fetch-repo-analytics.d.mts.map +0 -1
- package/dist/types/commands/analytics/handle-analytics.d.mts +0 -9
- package/dist/types/commands/analytics/handle-analytics.d.mts.map +0 -1
- package/dist/types/commands/analytics/output-analytics.d.mts +0 -28
- package/dist/types/commands/analytics/output-analytics.d.mts.map +0 -1
- package/dist/types/commands/audit-log/cmd-audit-log.d.mts +0 -10
- package/dist/types/commands/audit-log/cmd-audit-log.d.mts.map +0 -1
- package/dist/types/commands/audit-log/fetch-audit-log.d.mts +0 -15
- package/dist/types/commands/audit-log/fetch-audit-log.d.mts.map +0 -1
- package/dist/types/commands/audit-log/handle-audit-log.d.mts +0 -9
- package/dist/types/commands/audit-log/handle-audit-log.d.mts.map +0 -1
- package/dist/types/commands/audit-log/output-audit-log.d.mts +0 -22
- package/dist/types/commands/audit-log/output-audit-log.d.mts.map +0 -1
- package/dist/types/commands/ci/cmd-ci.d.mts +0 -10
- package/dist/types/commands/ci/cmd-ci.d.mts.map +0 -1
- package/dist/types/commands/ci/fetch-default-org-slug.d.mts +0 -4
- package/dist/types/commands/ci/fetch-default-org-slug.d.mts.map +0 -1
- package/dist/types/commands/ci/handle-ci.d.mts +0 -2
- package/dist/types/commands/ci/handle-ci.d.mts.map +0 -1
- package/dist/types/commands/config/cmd-config-auto.d.mts +0 -10
- package/dist/types/commands/config/cmd-config-auto.d.mts.map +0 -1
- package/dist/types/commands/config/cmd-config-get.d.mts +0 -10
- package/dist/types/commands/config/cmd-config-get.d.mts.map +0 -1
- package/dist/types/commands/config/cmd-config-list.d.mts +0 -10
- package/dist/types/commands/config/cmd-config-list.d.mts.map +0 -1
- package/dist/types/commands/config/cmd-config-set.d.mts +0 -10
- package/dist/types/commands/config/cmd-config-set.d.mts.map +0 -1
- package/dist/types/commands/config/cmd-config-unset.d.mts +0 -10
- package/dist/types/commands/config/cmd-config-unset.d.mts.map +0 -1
- package/dist/types/commands/config/cmd-config.d.mts +0 -3
- package/dist/types/commands/config/cmd-config.d.mts.map +0 -1
- package/dist/types/commands/config/discover-config-value.d.mts +0 -3
- package/dist/types/commands/config/discover-config-value.d.mts.map +0 -1
- package/dist/types/commands/config/handle-config-auto.d.mts +0 -7
- package/dist/types/commands/config/handle-config-auto.d.mts.map +0 -1
- package/dist/types/commands/config/handle-config-get.d.mts +0 -7
- package/dist/types/commands/config/handle-config-get.d.mts.map +0 -1
- package/dist/types/commands/config/handle-config-set.d.mts +0 -8
- package/dist/types/commands/config/handle-config-set.d.mts.map +0 -1
- package/dist/types/commands/config/handle-config-unset.d.mts +0 -7
- package/dist/types/commands/config/handle-config-unset.d.mts.map +0 -1
- package/dist/types/commands/config/output-config-auto.d.mts +0 -4
- package/dist/types/commands/config/output-config-auto.d.mts.map +0 -1
- package/dist/types/commands/config/output-config-get.d.mts +0 -4
- package/dist/types/commands/config/output-config-get.d.mts.map +0 -1
- package/dist/types/commands/config/output-config-list.d.mts +0 -6
- package/dist/types/commands/config/output-config-list.d.mts.map +0 -1
- package/dist/types/commands/config/output-config-set.d.mts +0 -3
- package/dist/types/commands/config/output-config-set.d.mts.map +0 -1
- package/dist/types/commands/config/output-config-unset.d.mts +0 -3
- package/dist/types/commands/config/output-config-unset.d.mts.map +0 -1
- package/dist/types/commands/fix/agent-fix.d.mts +0 -42
- package/dist/types/commands/fix/agent-fix.d.mts.map +0 -1
- package/dist/types/commands/fix/cmd-fix.d.mts +0 -10
- package/dist/types/commands/fix/cmd-fix.d.mts.map +0 -1
- package/dist/types/commands/fix/coana-fix.d.mts +0 -6
- package/dist/types/commands/fix/coana-fix.d.mts.map +0 -1
- package/dist/types/commands/fix/fix-branch-helpers.d.mts +0 -4
- package/dist/types/commands/fix/fix-branch-helpers.d.mts.map +0 -1
- package/dist/types/commands/fix/fix-env-helpers.d.mts +0 -13
- package/dist/types/commands/fix/fix-env-helpers.d.mts.map +0 -1
- package/dist/types/commands/fix/get-actual-tree.d.mts +0 -3
- package/dist/types/commands/fix/get-actual-tree.d.mts.map +0 -1
- package/dist/types/commands/fix/handle-fix.d.mts +0 -11
- package/dist/types/commands/fix/handle-fix.d.mts.map +0 -1
- package/dist/types/commands/fix/npm-fix.d.mts +0 -7
- package/dist/types/commands/fix/npm-fix.d.mts.map +0 -1
- package/dist/types/commands/fix/output-fix-result.d.mts +0 -3
- package/dist/types/commands/fix/output-fix-result.d.mts.map +0 -1
- package/dist/types/commands/fix/pnpm-fix.d.mts +0 -7
- package/dist/types/commands/fix/pnpm-fix.d.mts.map +0 -1
- package/dist/types/commands/fix/pull-request.d.mts +0 -47
- package/dist/types/commands/fix/pull-request.d.mts.map +0 -1
- package/dist/types/commands/fix/shared.d.mts +0 -8
- package/dist/types/commands/fix/shared.d.mts.map +0 -1
- package/dist/types/commands/fix/socket-git.d.mts +0 -32
- package/dist/types/commands/fix/socket-git.d.mts.map +0 -1
- package/dist/types/commands/install/cmd-install-completion.d.mts +0 -10
- package/dist/types/commands/install/cmd-install-completion.d.mts.map +0 -1
- package/dist/types/commands/install/cmd-install.d.mts +0 -3
- package/dist/types/commands/install/cmd-install.d.mts.map +0 -1
- package/dist/types/commands/install/handle-install-completion.d.mts +0 -2
- package/dist/types/commands/install/handle-install-completion.d.mts.map +0 -1
- package/dist/types/commands/install/output-install-completion.d.mts +0 -12
- package/dist/types/commands/install/output-install-completion.d.mts.map +0 -1
- package/dist/types/commands/install/setup-tab-completion.d.mts +0 -13
- package/dist/types/commands/install/setup-tab-completion.d.mts.map +0 -1
- package/dist/types/commands/json/cmd-json.d.mts +0 -10
- package/dist/types/commands/json/cmd-json.d.mts.map +0 -1
- package/dist/types/commands/json/handle-cmd-json.d.mts +0 -2
- package/dist/types/commands/json/handle-cmd-json.d.mts.map +0 -1
- package/dist/types/commands/json/output-cmd-json.d.mts +0 -2
- package/dist/types/commands/json/output-cmd-json.d.mts.map +0 -1
- package/dist/types/commands/login/apply-login.d.mts +0 -2
- package/dist/types/commands/login/apply-login.d.mts.map +0 -1
- package/dist/types/commands/login/attempt-login.d.mts +0 -6
- package/dist/types/commands/login/attempt-login.d.mts.map +0 -1
- package/dist/types/commands/login/cmd-login.d.mts +0 -10
- package/dist/types/commands/login/cmd-login.d.mts.map +0 -1
- package/dist/types/commands/logout/apply-logout.d.mts +0 -2
- package/dist/types/commands/logout/apply-logout.d.mts.map +0 -1
- package/dist/types/commands/logout/attempt-logout.d.mts +0 -2
- package/dist/types/commands/logout/attempt-logout.d.mts.map +0 -1
- package/dist/types/commands/logout/cmd-logout.d.mts +0 -10
- package/dist/types/commands/logout/cmd-logout.d.mts.map +0 -1
- package/dist/types/commands/manifest/cmd-manifest-auto.d.mts +0 -10
- package/dist/types/commands/manifest/cmd-manifest-auto.d.mts.map +0 -1
- package/dist/types/commands/manifest/cmd-manifest-cdxgen.d.mts +0 -10
- package/dist/types/commands/manifest/cmd-manifest-cdxgen.d.mts.map +0 -1
- package/dist/types/commands/manifest/cmd-manifest-conda.d.mts +0 -10
- package/dist/types/commands/manifest/cmd-manifest-conda.d.mts.map +0 -1
- package/dist/types/commands/manifest/cmd-manifest-gradle.d.mts +0 -10
- package/dist/types/commands/manifest/cmd-manifest-gradle.d.mts.map +0 -1
- package/dist/types/commands/manifest/cmd-manifest-kotlin.d.mts +0 -10
- package/dist/types/commands/manifest/cmd-manifest-kotlin.d.mts.map +0 -1
- package/dist/types/commands/manifest/cmd-manifest-scala.d.mts +0 -10
- package/dist/types/commands/manifest/cmd-manifest-scala.d.mts.map +0 -1
- package/dist/types/commands/manifest/cmd-manifest-setup.d.mts +0 -10
- package/dist/types/commands/manifest/cmd-manifest-setup.d.mts.map +0 -1
- package/dist/types/commands/manifest/cmd-manifest.d.mts +0 -10
- package/dist/types/commands/manifest/cmd-manifest.d.mts.map +0 -1
- package/dist/types/commands/manifest/convert-conda-to-requirements.d.mts +0 -8
- package/dist/types/commands/manifest/convert-conda-to-requirements.d.mts.map +0 -1
- package/dist/types/commands/manifest/convert_gradle_to_maven.d.mts +0 -7
- package/dist/types/commands/manifest/convert_gradle_to_maven.d.mts.map +0 -1
- package/dist/types/commands/manifest/convert_sbt_to_maven.d.mts +0 -8
- package/dist/types/commands/manifest/convert_sbt_to_maven.d.mts.map +0 -1
- package/dist/types/commands/manifest/detect-manifest-actions.d.mts +0 -13
- package/dist/types/commands/manifest/detect-manifest-actions.d.mts.map +0 -1
- package/dist/types/commands/manifest/generate_auto_manifest.d.mts +0 -9
- package/dist/types/commands/manifest/generate_auto_manifest.d.mts.map +0 -1
- package/dist/types/commands/manifest/handle-manifest-conda.d.mts +0 -9
- package/dist/types/commands/manifest/handle-manifest-conda.d.mts.map +0 -1
- package/dist/types/commands/manifest/handle-manifest-setup.d.mts +0 -2
- package/dist/types/commands/manifest/handle-manifest-setup.d.mts.map +0 -1
- package/dist/types/commands/manifest/output-manifest-setup.d.mts +0 -3
- package/dist/types/commands/manifest/output-manifest-setup.d.mts.map +0 -1
- package/dist/types/commands/manifest/output-requirements.d.mts +0 -6
- package/dist/types/commands/manifest/output-requirements.d.mts.map +0 -1
- package/dist/types/commands/manifest/run-cdxgen.d.mts +0 -2
- package/dist/types/commands/manifest/run-cdxgen.d.mts.map +0 -1
- package/dist/types/commands/manifest/setup-manifest-config.d.mts +0 -3
- package/dist/types/commands/manifest/setup-manifest-config.d.mts.map +0 -1
- package/dist/types/commands/npm/cmd-npm.d.mts +0 -10
- package/dist/types/commands/npm/cmd-npm.d.mts.map +0 -1
- package/dist/types/commands/npx/cmd-npx.d.mts +0 -10
- package/dist/types/commands/npx/cmd-npx.d.mts.map +0 -1
- package/dist/types/commands/oops/cmd-oops.d.mts +0 -10
- package/dist/types/commands/oops/cmd-oops.d.mts.map +0 -1
- package/dist/types/commands/optimize/add-overrides.d.mts +0 -20
- package/dist/types/commands/optimize/add-overrides.d.mts.map +0 -1
- package/dist/types/commands/optimize/apply-optimization.d.mts +0 -14
- package/dist/types/commands/optimize/apply-optimization.d.mts.map +0 -1
- package/dist/types/commands/optimize/cmd-optimize.d.mts +0 -10
- package/dist/types/commands/optimize/cmd-optimize.d.mts.map +0 -1
- package/dist/types/commands/optimize/deps-includes-by-agent.d.mts +0 -5
- package/dist/types/commands/optimize/deps-includes-by-agent.d.mts.map +0 -1
- package/dist/types/commands/optimize/get-dependency-entries.d.mts +0 -3
- package/dist/types/commands/optimize/get-dependency-entries.d.mts.map +0 -1
- package/dist/types/commands/optimize/get-overrides-by-agent.d.mts +0 -42
- package/dist/types/commands/optimize/get-overrides-by-agent.d.mts.map +0 -1
- package/dist/types/commands/optimize/handle-optimize.d.mts +0 -8
- package/dist/types/commands/optimize/handle-optimize.d.mts.map +0 -1
- package/dist/types/commands/optimize/lockfile-includes-by-agent.d.mts +0 -8
- package/dist/types/commands/optimize/lockfile-includes-by-agent.d.mts.map +0 -1
- package/dist/types/commands/optimize/ls-by-agent.d.mts +0 -13
- package/dist/types/commands/optimize/ls-by-agent.d.mts.map +0 -1
- package/dist/types/commands/optimize/output-optimize-result.d.mts +0 -9
- package/dist/types/commands/optimize/output-optimize-result.d.mts.map +0 -1
- package/dist/types/commands/optimize/shared.d.mts +0 -2
- package/dist/types/commands/optimize/shared.d.mts.map +0 -1
- package/dist/types/commands/optimize/types.d.mts +0 -9
- package/dist/types/commands/optimize/types.d.mts.map +0 -1
- package/dist/types/commands/optimize/update-lockfile.d.mts +0 -11
- package/dist/types/commands/optimize/update-lockfile.d.mts.map +0 -1
- package/dist/types/commands/optimize/update-manifest-by-agent.d.mts +0 -8
- package/dist/types/commands/optimize/update-manifest-by-agent.d.mts.map +0 -1
- package/dist/types/commands/organization/cmd-organization-dependencies.d.mts +0 -10
- package/dist/types/commands/organization/cmd-organization-dependencies.d.mts.map +0 -1
- package/dist/types/commands/organization/cmd-organization-list.d.mts +0 -10
- package/dist/types/commands/organization/cmd-organization-list.d.mts.map +0 -1
- package/dist/types/commands/organization/cmd-organization-policy-license.d.mts +0 -10
- package/dist/types/commands/organization/cmd-organization-policy-license.d.mts.map +0 -1
- package/dist/types/commands/organization/cmd-organization-policy-security.d.mts +0 -10
- package/dist/types/commands/organization/cmd-organization-policy-security.d.mts.map +0 -1
- package/dist/types/commands/organization/cmd-organization-policy.d.mts +0 -3
- package/dist/types/commands/organization/cmd-organization-policy.d.mts.map +0 -1
- package/dist/types/commands/organization/cmd-organization-quota.d.mts +0 -10
- package/dist/types/commands/organization/cmd-organization-quota.d.mts.map +0 -1
- package/dist/types/commands/organization/cmd-organization.d.mts +0 -3
- package/dist/types/commands/organization/cmd-organization.d.mts.map +0 -1
- package/dist/types/commands/organization/fetch-dependencies.d.mts +0 -12
- package/dist/types/commands/organization/fetch-dependencies.d.mts.map +0 -1
- package/dist/types/commands/organization/fetch-license-policy.d.mts +0 -8
- package/dist/types/commands/organization/fetch-license-policy.d.mts.map +0 -1
- package/dist/types/commands/organization/fetch-organization-list.d.mts +0 -8
- package/dist/types/commands/organization/fetch-organization-list.d.mts.map +0 -1
- package/dist/types/commands/organization/fetch-quota.d.mts +0 -8
- package/dist/types/commands/organization/fetch-quota.d.mts.map +0 -1
- package/dist/types/commands/organization/fetch-security-policy.d.mts +0 -8
- package/dist/types/commands/organization/fetch-security-policy.d.mts.map +0 -1
- package/dist/types/commands/organization/handle-dependencies.d.mts +0 -7
- package/dist/types/commands/organization/handle-dependencies.d.mts.map +0 -1
- package/dist/types/commands/organization/handle-license-policy.d.mts +0 -3
- package/dist/types/commands/organization/handle-license-policy.d.mts.map +0 -1
- package/dist/types/commands/organization/handle-organization-list.d.mts +0 -3
- package/dist/types/commands/organization/handle-organization-list.d.mts.map +0 -1
- package/dist/types/commands/organization/handle-quota.d.mts +0 -3
- package/dist/types/commands/organization/handle-quota.d.mts.map +0 -1
- package/dist/types/commands/organization/handle-security-policy.d.mts +0 -3
- package/dist/types/commands/organization/handle-security-policy.d.mts.map +0 -1
- package/dist/types/commands/organization/output-dependencies.d.mts +0 -8
- package/dist/types/commands/organization/output-dependencies.d.mts.map +0 -1
- package/dist/types/commands/organization/output-license-policy.d.mts +0 -4
- package/dist/types/commands/organization/output-license-policy.d.mts.map +0 -1
- package/dist/types/commands/organization/output-organization-list.d.mts +0 -4
- package/dist/types/commands/organization/output-organization-list.d.mts.map +0 -1
- package/dist/types/commands/organization/output-quota.d.mts +0 -4
- package/dist/types/commands/organization/output-quota.d.mts.map +0 -1
- package/dist/types/commands/organization/output-security-policy.d.mts +0 -4
- package/dist/types/commands/organization/output-security-policy.d.mts.map +0 -1
- package/dist/types/commands/package/cmd-package-score.d.mts +0 -10
- package/dist/types/commands/package/cmd-package-score.d.mts.map +0 -1
- package/dist/types/commands/package/cmd-package-shallow.d.mts +0 -17
- package/dist/types/commands/package/cmd-package-shallow.d.mts.map +0 -1
- package/dist/types/commands/package/cmd-package.d.mts +0 -3
- package/dist/types/commands/package/cmd-package.d.mts.map +0 -1
- package/dist/types/commands/package/fetch-purl-deep-score.d.mts +0 -51
- package/dist/types/commands/package/fetch-purl-deep-score.d.mts.map +0 -1
- package/dist/types/commands/package/fetch-purls-shallow-score.d.mts +0 -8
- package/dist/types/commands/package/fetch-purls-shallow-score.d.mts.map +0 -1
- package/dist/types/commands/package/handle-purl-deep-score.d.mts +0 -3
- package/dist/types/commands/package/handle-purl-deep-score.d.mts.map +0 -1
- package/dist/types/commands/package/handle-purls-shallow-score.d.mts +0 -6
- package/dist/types/commands/package/handle-purls-shallow-score.d.mts.map +0 -1
- package/dist/types/commands/package/output-purls-deep-score.d.mts +0 -5
- package/dist/types/commands/package/output-purls-deep-score.d.mts.map +0 -1
- package/dist/types/commands/package/output-purls-shallow-score.d.mts +0 -29
- package/dist/types/commands/package/output-purls-shallow-score.d.mts.map +0 -1
- package/dist/types/commands/package/parse-package-specifiers.d.mts +0 -9
- package/dist/types/commands/package/parse-package-specifiers.d.mts.map +0 -1
- package/dist/types/commands/raw-npm/cmd-raw-npm.d.mts +0 -10
- package/dist/types/commands/raw-npm/cmd-raw-npm.d.mts.map +0 -1
- package/dist/types/commands/raw-npm/run-raw-npm.d.mts +0 -2
- package/dist/types/commands/raw-npm/run-raw-npm.d.mts.map +0 -1
- package/dist/types/commands/raw-npx/cmd-raw-npx.d.mts +0 -10
- package/dist/types/commands/raw-npx/cmd-raw-npx.d.mts.map +0 -1
- package/dist/types/commands/raw-npx/run-raw-npx.d.mts +0 -2
- package/dist/types/commands/raw-npx/run-raw-npx.d.mts.map +0 -1
- package/dist/types/commands/repository/cmd-repository-create.d.mts +0 -10
- package/dist/types/commands/repository/cmd-repository-create.d.mts.map +0 -1
- package/dist/types/commands/repository/cmd-repository-del.d.mts +0 -10
- package/dist/types/commands/repository/cmd-repository-del.d.mts.map +0 -1
- package/dist/types/commands/repository/cmd-repository-list.d.mts +0 -10
- package/dist/types/commands/repository/cmd-repository-list.d.mts.map +0 -1
- package/dist/types/commands/repository/cmd-repository-update.d.mts +0 -10
- package/dist/types/commands/repository/cmd-repository-update.d.mts.map +0 -1
- package/dist/types/commands/repository/cmd-repository-view.d.mts +0 -10
- package/dist/types/commands/repository/cmd-repository-view.d.mts.map +0 -1
- package/dist/types/commands/repository/cmd-repository.d.mts +0 -3
- package/dist/types/commands/repository/cmd-repository.d.mts.map +0 -1
- package/dist/types/commands/repository/fetch-create-repo.d.mts +0 -16
- package/dist/types/commands/repository/fetch-create-repo.d.mts.map +0 -1
- package/dist/types/commands/repository/fetch-delete-repo.d.mts +0 -8
- package/dist/types/commands/repository/fetch-delete-repo.d.mts.map +0 -1
- package/dist/types/commands/repository/fetch-list-all-repos.d.mts +0 -10
- package/dist/types/commands/repository/fetch-list-all-repos.d.mts.map +0 -1
- package/dist/types/commands/repository/fetch-list-repos.d.mts +0 -15
- package/dist/types/commands/repository/fetch-list-repos.d.mts.map +0 -1
- package/dist/types/commands/repository/fetch-update-repo.d.mts +0 -16
- package/dist/types/commands/repository/fetch-update-repo.d.mts.map +0 -1
- package/dist/types/commands/repository/fetch-view-repo.d.mts +0 -8
- package/dist/types/commands/repository/fetch-view-repo.d.mts.map +0 -1
- package/dist/types/commands/repository/handle-create-repo.d.mts +0 -10
- package/dist/types/commands/repository/handle-create-repo.d.mts.map +0 -1
- package/dist/types/commands/repository/handle-delete-repo.d.mts +0 -3
- package/dist/types/commands/repository/handle-delete-repo.d.mts.map +0 -1
- package/dist/types/commands/repository/handle-list-repos.d.mts +0 -11
- package/dist/types/commands/repository/handle-list-repos.d.mts.map +0 -1
- package/dist/types/commands/repository/handle-update-repo.d.mts +0 -10
- package/dist/types/commands/repository/handle-update-repo.d.mts.map +0 -1
- package/dist/types/commands/repository/handle-view-repo.d.mts +0 -3
- package/dist/types/commands/repository/handle-view-repo.d.mts.map +0 -1
- package/dist/types/commands/repository/output-create-repo.d.mts +0 -4
- package/dist/types/commands/repository/output-create-repo.d.mts.map +0 -1
- package/dist/types/commands/repository/output-delete-repo.d.mts +0 -4
- package/dist/types/commands/repository/output-delete-repo.d.mts.map +0 -1
- package/dist/types/commands/repository/output-list-repos.d.mts +0 -4
- package/dist/types/commands/repository/output-list-repos.d.mts.map +0 -1
- package/dist/types/commands/repository/output-update-repo.d.mts +0 -4
- package/dist/types/commands/repository/output-update-repo.d.mts.map +0 -1
- package/dist/types/commands/repository/output-view-repo.d.mts +0 -4
- package/dist/types/commands/repository/output-view-repo.d.mts.map +0 -1
- package/dist/types/commands/scan/cmd-scan-create.d.mts +0 -10
- package/dist/types/commands/scan/cmd-scan-create.d.mts.map +0 -1
- package/dist/types/commands/scan/cmd-scan-del.d.mts +0 -10
- package/dist/types/commands/scan/cmd-scan-del.d.mts.map +0 -1
- package/dist/types/commands/scan/cmd-scan-diff.d.mts +0 -10
- package/dist/types/commands/scan/cmd-scan-diff.d.mts.map +0 -1
- package/dist/types/commands/scan/cmd-scan-github.d.mts +0 -10
- package/dist/types/commands/scan/cmd-scan-github.d.mts.map +0 -1
- package/dist/types/commands/scan/cmd-scan-list.d.mts +0 -3
- package/dist/types/commands/scan/cmd-scan-list.d.mts.map +0 -1
- package/dist/types/commands/scan/cmd-scan-metadata.d.mts +0 -3
- package/dist/types/commands/scan/cmd-scan-metadata.d.mts.map +0 -1
- package/dist/types/commands/scan/cmd-scan-reach.d.mts +0 -10
- package/dist/types/commands/scan/cmd-scan-reach.d.mts.map +0 -1
- package/dist/types/commands/scan/cmd-scan-report.d.mts +0 -3
- package/dist/types/commands/scan/cmd-scan-report.d.mts.map +0 -1
- package/dist/types/commands/scan/cmd-scan-setup.d.mts +0 -10
- package/dist/types/commands/scan/cmd-scan-setup.d.mts.map +0 -1
- package/dist/types/commands/scan/cmd-scan-view.d.mts +0 -3
- package/dist/types/commands/scan/cmd-scan-view.d.mts.map +0 -1
- package/dist/types/commands/scan/cmd-scan.d.mts +0 -3
- package/dist/types/commands/scan/cmd-scan.d.mts.map +0 -1
- package/dist/types/commands/scan/create-scan-from-github.d.mts +0 -12
- package/dist/types/commands/scan/create-scan-from-github.d.mts.map +0 -1
- package/dist/types/commands/scan/fetch-create-org-full-scan.d.mts +0 -20
- package/dist/types/commands/scan/fetch-create-org-full-scan.d.mts.map +0 -1
- package/dist/types/commands/scan/fetch-delete-org-full-scan.d.mts +0 -8
- package/dist/types/commands/scan/fetch-delete-org-full-scan.d.mts.map +0 -1
- package/dist/types/commands/scan/fetch-diff-scan.d.mts +0 -8
- package/dist/types/commands/scan/fetch-diff-scan.d.mts.map +0 -1
- package/dist/types/commands/scan/fetch-list-scans.d.mts +0 -18
- package/dist/types/commands/scan/fetch-list-scans.d.mts.map +0 -1
- package/dist/types/commands/scan/fetch-report-data.d.mts +0 -17
- package/dist/types/commands/scan/fetch-report-data.d.mts.map +0 -1
- package/dist/types/commands/scan/fetch-scan-metadata.d.mts +0 -8
- package/dist/types/commands/scan/fetch-scan-metadata.d.mts.map +0 -1
- package/dist/types/commands/scan/fetch-scan.d.mts +0 -4
- package/dist/types/commands/scan/fetch-scan.d.mts.map +0 -1
- package/dist/types/commands/scan/fetch-supported-scan-file-names.d.mts +0 -8
- package/dist/types/commands/scan/fetch-supported-scan-file-names.d.mts.map +0 -1
- package/dist/types/commands/scan/generate-report.d.mts +0 -43
- package/dist/types/commands/scan/generate-report.d.mts.map +0 -1
- package/dist/types/commands/scan/handle-create-github-scan.d.mts +0 -12
- package/dist/types/commands/scan/handle-create-github-scan.d.mts.map +0 -1
- package/dist/types/commands/scan/handle-create-new-scan.d.mts +0 -21
- package/dist/types/commands/scan/handle-create-new-scan.d.mts.map +0 -1
- package/dist/types/commands/scan/handle-delete-scan.d.mts +0 -3
- package/dist/types/commands/scan/handle-delete-scan.d.mts.map +0 -1
- package/dist/types/commands/scan/handle-diff-scan.d.mts +0 -10
- package/dist/types/commands/scan/handle-diff-scan.d.mts.map +0 -1
- package/dist/types/commands/scan/handle-list-scans.d.mts +0 -13
- package/dist/types/commands/scan/handle-list-scans.d.mts.map +0 -1
- package/dist/types/commands/scan/handle-scan-config.d.mts +0 -2
- package/dist/types/commands/scan/handle-scan-config.d.mts.map +0 -1
- package/dist/types/commands/scan/handle-scan-metadata.d.mts +0 -3
- package/dist/types/commands/scan/handle-scan-metadata.d.mts.map +0 -1
- package/dist/types/commands/scan/handle-scan-reach.d.mts +0 -8
- package/dist/types/commands/scan/handle-scan-reach.d.mts.map +0 -1
- package/dist/types/commands/scan/handle-scan-report.d.mts +0 -12
- package/dist/types/commands/scan/handle-scan-report.d.mts.map +0 -1
- package/dist/types/commands/scan/handle-scan-view.d.mts +0 -3
- package/dist/types/commands/scan/handle-scan-view.d.mts.map +0 -1
- package/dist/types/commands/scan/output-create-new-scan.d.mts +0 -4
- package/dist/types/commands/scan/output-create-new-scan.d.mts.map +0 -1
- package/dist/types/commands/scan/output-delete-scan.d.mts +0 -4
- package/dist/types/commands/scan/output-delete-scan.d.mts.map +0 -1
- package/dist/types/commands/scan/output-diff-scan.d.mts +0 -8
- package/dist/types/commands/scan/output-diff-scan.d.mts.map +0 -1
- package/dist/types/commands/scan/output-list-scans.d.mts +0 -4
- package/dist/types/commands/scan/output-list-scans.d.mts.map +0 -1
- package/dist/types/commands/scan/output-scan-config-result.d.mts +0 -3
- package/dist/types/commands/scan/output-scan-config-result.d.mts.map +0 -1
- package/dist/types/commands/scan/output-scan-github.d.mts +0 -3
- package/dist/types/commands/scan/output-scan-github.d.mts.map +0 -1
- package/dist/types/commands/scan/output-scan-metadata.d.mts +0 -4
- package/dist/types/commands/scan/output-scan-metadata.d.mts.map +0 -1
- package/dist/types/commands/scan/output-scan-reach.d.mts +0 -3
- package/dist/types/commands/scan/output-scan-reach.d.mts.map +0 -1
- package/dist/types/commands/scan/output-scan-report.d.mts +0 -20
- package/dist/types/commands/scan/output-scan-report.d.mts.map +0 -1
- package/dist/types/commands/scan/output-scan-view.d.mts +0 -4
- package/dist/types/commands/scan/output-scan-view.d.mts.map +0 -1
- package/dist/types/commands/scan/setup-scan-config.d.mts +0 -3
- package/dist/types/commands/scan/setup-scan-config.d.mts.map +0 -1
- package/dist/types/commands/scan/stream-scan.d.mts +0 -7
- package/dist/types/commands/scan/stream-scan.d.mts.map +0 -1
- package/dist/types/commands/scan/suggest-org-slug.d.mts +0 -2
- package/dist/types/commands/scan/suggest-org-slug.d.mts.map +0 -1
- package/dist/types/commands/scan/suggest-repo-slug.d.mts +0 -9
- package/dist/types/commands/scan/suggest-repo-slug.d.mts.map +0 -1
- package/dist/types/commands/scan/suggest-to-persist-orgslug.d.mts +0 -2
- package/dist/types/commands/scan/suggest-to-persist-orgslug.d.mts.map +0 -1
- package/dist/types/commands/scan/suggest_branch_slug.d.mts +0 -2
- package/dist/types/commands/scan/suggest_branch_slug.d.mts.map +0 -1
- package/dist/types/commands/scan/suggest_target.d.mts +0 -2
- package/dist/types/commands/scan/suggest_target.d.mts.map +0 -1
- package/dist/types/commands/threat-feed/cmd-threat-feed.d.mts +0 -10
- package/dist/types/commands/threat-feed/cmd-threat-feed.d.mts.map +0 -1
- package/dist/types/commands/threat-feed/fetch-threat-feed.d.mts +0 -13
- package/dist/types/commands/threat-feed/fetch-threat-feed.d.mts.map +0 -1
- package/dist/types/commands/threat-feed/handle-threat-feed.d.mts +0 -13
- package/dist/types/commands/threat-feed/handle-threat-feed.d.mts.map +0 -1
- package/dist/types/commands/threat-feed/output-threat-feed.d.mts +0 -4
- package/dist/types/commands/threat-feed/output-threat-feed.d.mts.map +0 -1
- package/dist/types/commands/threat-feed/types.d.mts +0 -15
- package/dist/types/commands/threat-feed/types.d.mts.map +0 -1
- package/dist/types/commands/uninstall/cmd-uninstall-completion.d.mts +0 -9
- package/dist/types/commands/uninstall/cmd-uninstall-completion.d.mts.map +0 -1
- package/dist/types/commands/uninstall/cmd-uninstall.d.mts +0 -3
- package/dist/types/commands/uninstall/cmd-uninstall.d.mts.map +0 -1
- package/dist/types/commands/uninstall/handle-uninstall-completion.d.mts +0 -2
- package/dist/types/commands/uninstall/handle-uninstall-completion.d.mts.map +0 -1
- package/dist/types/commands/uninstall/output-uninstall-completion.d.mts +0 -6
- package/dist/types/commands/uninstall/output-uninstall-completion.d.mts.map +0 -1
- package/dist/types/commands/uninstall/teardown-tab-completion.d.mts +0 -6
- package/dist/types/commands/uninstall/teardown-tab-completion.d.mts.map +0 -1
- package/dist/types/commands/wrapper/add-socket-wrapper.d.mts +0 -2
- package/dist/types/commands/wrapper/add-socket-wrapper.d.mts.map +0 -1
- package/dist/types/commands/wrapper/check-socket-wrapper-setup.d.mts +0 -2
- package/dist/types/commands/wrapper/check-socket-wrapper-setup.d.mts.map +0 -1
- package/dist/types/commands/wrapper/cmd-wrapper.d.mts +0 -10
- package/dist/types/commands/wrapper/cmd-wrapper.d.mts.map +0 -1
- package/dist/types/commands/wrapper/postinstall-wrapper.d.mts +0 -2
- package/dist/types/commands/wrapper/postinstall-wrapper.d.mts.map +0 -1
- package/dist/types/commands/wrapper/remove-socket-wrapper.d.mts +0 -2
- package/dist/types/commands/wrapper/remove-socket-wrapper.d.mts.map +0 -1
- package/dist/types/constants.d.mts +0 -149
- package/dist/types/constants.d.mts.map +0 -1
- package/dist/types/flags.d.mts +0 -17
- package/dist/types/flags.d.mts.map +0 -1
- package/dist/types/instrument-with-sentry.d.mts +0 -2
- package/dist/types/instrument-with-sentry.d.mts.map +0 -1
- package/dist/types/shadow/npm/arborist/index.d.mts +0 -8
- package/dist/types/shadow/npm/arborist/index.d.mts.map +0 -1
- package/dist/types/shadow/npm/arborist/lib/arborist/index.d.mts +0 -35
- package/dist/types/shadow/npm/arborist/lib/arborist/index.d.mts.map +0 -1
- package/dist/types/shadow/npm/arborist/types.d.mts +0 -123
- package/dist/types/shadow/npm/arborist/types.d.mts.map +0 -1
- package/dist/types/shadow/npm/arborist-helpers.d.mts +0 -39
- package/dist/types/shadow/npm/arborist-helpers.d.mts.map +0 -1
- package/dist/types/shadow/npm/bin.d.mts +0 -2
- package/dist/types/shadow/npm/bin.d.mts.map +0 -1
- package/dist/types/shadow/npm/inject.d.mts +0 -2
- package/dist/types/shadow/npm/inject.d.mts.map +0 -1
- package/dist/types/shadow/npm/install.d.mts +0 -13
- package/dist/types/shadow/npm/install.d.mts.map +0 -1
- package/dist/types/shadow/npm/link.d.mts +0 -2
- package/dist/types/shadow/npm/link.d.mts.map +0 -1
- package/dist/types/shadow/npm/paths.d.mts +0 -7
- package/dist/types/shadow/npm/paths.d.mts.map +0 -1
- package/dist/types/types.d.mts +0 -29
- package/dist/types/types.d.mts.map +0 -1
- package/dist/types/utils/agent.d.mts +0 -12
- package/dist/types/utils/agent.d.mts.map +0 -1
- package/dist/types/utils/alert/artifact.d.mts +0 -35
- package/dist/types/utils/alert/artifact.d.mts.map +0 -1
- package/dist/types/utils/alert/fix.d.mts +0 -6
- package/dist/types/utils/alert/fix.d.mts.map +0 -1
- package/dist/types/utils/alert/severity.d.mts +0 -14
- package/dist/types/utils/alert/severity.d.mts.map +0 -1
- package/dist/types/utils/alerts-map.d.mts +0 -24
- package/dist/types/utils/alerts-map.d.mts.map +0 -1
- package/dist/types/utils/api.d.mts +0 -18
- package/dist/types/utils/api.d.mts.map +0 -1
- package/dist/types/utils/check-input.d.mts +0 -9
- package/dist/types/utils/check-input.d.mts.map +0 -1
- package/dist/types/utils/cmd.d.mts +0 -5
- package/dist/types/utils/cmd.d.mts.map +0 -1
- package/dist/types/utils/coana.d.mts +0 -4
- package/dist/types/utils/coana.d.mts.map +0 -1
- package/dist/types/utils/color-or-markdown.d.mts +0 -16
- package/dist/types/utils/color-or-markdown.d.mts.map +0 -1
- package/dist/types/utils/completion.d.mts +0 -11
- package/dist/types/utils/completion.d.mts.map +0 -1
- package/dist/types/utils/config.d.mts +0 -32
- package/dist/types/utils/config.d.mts.map +0 -1
- package/dist/types/utils/determine-org-slug.d.mts +0 -2
- package/dist/types/utils/determine-org-slug.d.mts.map +0 -1
- package/dist/types/utils/errors.d.mts +0 -14
- package/dist/types/utils/errors.d.mts.map +0 -1
- package/dist/types/utils/fail-msg-with-badge.d.mts +0 -2
- package/dist/types/utils/fail-msg-with-badge.d.mts.map +0 -1
- package/dist/types/utils/fs.d.mts +0 -9
- package/dist/types/utils/fs.d.mts.map +0 -1
- package/dist/types/utils/get-output-kind.d.mts +0 -3
- package/dist/types/utils/get-output-kind.d.mts.map +0 -1
- package/dist/types/utils/git.d.mts +0 -29
- package/dist/types/utils/git.d.mts.map +0 -1
- package/dist/types/utils/glob.d.mts +0 -16
- package/dist/types/utils/glob.d.mts.map +0 -1
- package/dist/types/utils/lockfile.d.mts +0 -2
- package/dist/types/utils/lockfile.d.mts.map +0 -1
- package/dist/types/utils/map-to-object.d.mts +0 -10
- package/dist/types/utils/map-to-object.d.mts.map +0 -1
- package/dist/types/utils/markdown.d.mts +0 -10
- package/dist/types/utils/markdown.d.mts.map +0 -1
- package/dist/types/utils/meow-with-subcommands.d.mts +0 -47
- package/dist/types/utils/meow-with-subcommands.d.mts.map +0 -1
- package/dist/types/utils/ms-at-home.d.mts +0 -2
- package/dist/types/utils/ms-at-home.d.mts.map +0 -1
- package/dist/types/utils/npm-config.d.mts +0 -14
- package/dist/types/utils/npm-config.d.mts.map +0 -1
- package/dist/types/utils/npm-package-arg.d.mts +0 -4
- package/dist/types/utils/npm-package-arg.d.mts.map +0 -1
- package/dist/types/utils/npm-paths.d.mts +0 -7
- package/dist/types/utils/npm-paths.d.mts.map +0 -1
- package/dist/types/utils/objects.d.mts +0 -3
- package/dist/types/utils/objects.d.mts.map +0 -1
- package/dist/types/utils/output-formatting.d.mts +0 -16
- package/dist/types/utils/output-formatting.d.mts.map +0 -1
- package/dist/types/utils/package-environment.d.mts +0 -57
- package/dist/types/utils/package-environment.d.mts.map +0 -1
- package/dist/types/utils/path-resolve.d.mts +0 -14
- package/dist/types/utils/path-resolve.d.mts.map +0 -1
- package/dist/types/utils/pnpm.d.mts +0 -11
- package/dist/types/utils/pnpm.d.mts.map +0 -1
- package/dist/types/utils/purl.d.mts +0 -15
- package/dist/types/utils/purl.d.mts.map +0 -1
- package/dist/types/utils/sdk.d.mts +0 -13
- package/dist/types/utils/sdk.d.mts.map +0 -1
- package/dist/types/utils/semver.d.mts +0 -8
- package/dist/types/utils/semver.d.mts.map +0 -1
- package/dist/types/utils/serialize-result-json.d.mts +0 -5
- package/dist/types/utils/serialize-result-json.d.mts.map +0 -1
- package/dist/types/utils/socket-package-alert.d.mts +0 -77
- package/dist/types/utils/socket-package-alert.d.mts.map +0 -1
- package/dist/types/utils/socket-url.d.mts +0 -7
- package/dist/types/utils/socket-url.d.mts.map +0 -1
- package/dist/types/utils/socketjson.d.mts +0 -56
- package/dist/types/utils/socketjson.d.mts.map +0 -1
- package/dist/types/utils/spec.d.mts +0 -5
- package/dist/types/utils/spec.d.mts.map +0 -1
- package/dist/types/utils/strings.d.mts +0 -2
- package/dist/types/utils/strings.d.mts.map +0 -1
- package/dist/types/utils/tildify.d.mts +0 -4
- package/dist/types/utils/tildify.d.mts.map +0 -1
- package/dist/types/utils/translations.d.mts +0 -593
- package/dist/types/utils/translations.d.mts.map +0 -1
- package/dist/types/utils/walk-nested-map.d.mts +0 -7
- package/dist/types/utils/walk-nested-map.d.mts.map +0 -1
package/dist/cli.js
CHANGED
|
@@ -25,6 +25,7 @@ var sorts = require('../external/@socketsecurity/registry/lib/sorts');
|
|
|
25
25
|
var regexps = require('../external/@socketsecurity/registry/lib/regexps');
|
|
26
26
|
var shadowNpmInject = require('./shadow-npm-inject.js');
|
|
27
27
|
var require$$7 = require('../external/@socketsecurity/registry/lib/objects');
|
|
28
|
+
var path$1 = require('../external/@socketsecurity/registry/lib/path');
|
|
28
29
|
var shadowNpmBin = require('./shadow-npm-bin.js');
|
|
29
30
|
var require$$8 = require('../external/@socketsecurity/registry/lib/promises');
|
|
30
31
|
var require$$1 = require('node:util');
|
|
@@ -322,7 +323,7 @@ const {
|
|
|
322
323
|
} = constants;
|
|
323
324
|
const config$M = {
|
|
324
325
|
commandName: 'analytics',
|
|
325
|
-
description:
|
|
326
|
+
description: 'Look up analytics data',
|
|
326
327
|
hidden: false,
|
|
327
328
|
flags: {
|
|
328
329
|
...flags.commonFlags,
|
|
@@ -2089,10 +2090,6 @@ async function handleCreateNewScan({
|
|
|
2089
2090
|
}
|
|
2090
2091
|
|
|
2091
2092
|
async function handleCi(autoManifest) {
|
|
2092
|
-
// ci: {
|
|
2093
|
-
// description: 'Alias for "report create --view --strict"',
|
|
2094
|
-
// argv: ['report', 'create', '--view', '--strict']
|
|
2095
|
-
// }
|
|
2096
2093
|
const orgSlugCResult = await utils.getDefaultOrgSlug();
|
|
2097
2094
|
if (!orgSlugCResult.ok) {
|
|
2098
2095
|
process.exitCode = orgSlugCResult.code ?? 1;
|
|
@@ -2134,14 +2131,14 @@ const {
|
|
|
2134
2131
|
} = constants;
|
|
2135
2132
|
const config$K = {
|
|
2136
2133
|
commandName: 'ci',
|
|
2137
|
-
description: '
|
|
2138
|
-
hidden:
|
|
2134
|
+
description: 'Shorthand for `socket scan create --report --no-interactive`',
|
|
2135
|
+
hidden: false,
|
|
2139
2136
|
flags: {
|
|
2140
2137
|
...flags.commonFlags,
|
|
2141
2138
|
autoManifest: {
|
|
2142
2139
|
type: 'boolean',
|
|
2140
|
+
// Dev tools in CI environments are not likely to be set up, so this is safer.
|
|
2143
2141
|
default: false,
|
|
2144
|
-
// dev tools is not likely to be set up so this is safer
|
|
2145
2142
|
description: 'Auto generate manifest files where detected? See autoManifest flag in `socket scan create`'
|
|
2146
2143
|
}
|
|
2147
2144
|
},
|
|
@@ -2153,10 +2150,9 @@ const config$K = {
|
|
|
2153
2150
|
${utils.getFlagListOutput(config$K.flags)}
|
|
2154
2151
|
|
|
2155
2152
|
This command is intended to use in CI runs to allow automated systems to
|
|
2156
|
-
accept or reject a current build.
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
It will use the default org for the Socket API token.
|
|
2153
|
+
accept or reject a current build. It will use the default org of the
|
|
2154
|
+
Socket API token. The exit code will be non-zero when the scan does not pass
|
|
2155
|
+
your security policy.
|
|
2160
2156
|
|
|
2161
2157
|
The --autoManifest flag does the same as the one from \`socket scan create\`
|
|
2162
2158
|
but is not enabled by default since the CI is less likely to be set up with
|
|
@@ -2982,7 +2978,7 @@ ${utils.getSupportedConfigEntries().map(([key, desc]) => ` - ${key} -- ${des
|
|
|
2982
2978
|
});
|
|
2983
2979
|
}
|
|
2984
2980
|
|
|
2985
|
-
const description$7 = '
|
|
2981
|
+
const description$7 = 'Manage Socket CLI configuration';
|
|
2986
2982
|
const cmdConfig = {
|
|
2987
2983
|
description: description$7,
|
|
2988
2984
|
hidden: false,
|
|
@@ -3627,20 +3623,28 @@ async function getFixEnv() {
|
|
|
3627
3623
|
}
|
|
3628
3624
|
|
|
3629
3625
|
async function getActualTree(cwd = process.cwd()) {
|
|
3630
|
-
|
|
3631
|
-
|
|
3632
|
-
|
|
3633
|
-
|
|
3634
|
-
|
|
3635
|
-
|
|
3636
|
-
|
|
3637
|
-
|
|
3638
|
-
|
|
3626
|
+
try {
|
|
3627
|
+
// @npmcli/arborist DOES have partial support for pnpm structured node_modules
|
|
3628
|
+
// folders. However, support is iffy resulting in unhappy paths of errors and hangs.
|
|
3629
|
+
// So, to avoid unhappy paths, we restrict our usage to --dry-run loading of the
|
|
3630
|
+
// node_modules folder.
|
|
3631
|
+
const arb = new shadowNpmInject.Arborist({
|
|
3632
|
+
path: cwd,
|
|
3633
|
+
...shadowNpmInject.SAFE_NO_SAVE_ARBORIST_REIFY_OPTIONS_OVERRIDES
|
|
3634
|
+
});
|
|
3635
|
+
return {
|
|
3636
|
+
actualTree: await arb.loadActual()
|
|
3637
|
+
};
|
|
3638
|
+
} catch (e) {
|
|
3639
|
+
return {
|
|
3640
|
+
error: e
|
|
3641
|
+
};
|
|
3642
|
+
}
|
|
3639
3643
|
}
|
|
3640
3644
|
|
|
3641
3645
|
const {
|
|
3642
3646
|
BUN: BUN$4,
|
|
3643
|
-
NPM: NPM$
|
|
3647
|
+
NPM: NPM$6,
|
|
3644
3648
|
OVERRIDES: OVERRIDES$2,
|
|
3645
3649
|
PNPM: PNPM$7,
|
|
3646
3650
|
RESOLUTIONS: RESOLUTIONS$1,
|
|
@@ -3661,7 +3665,7 @@ function getOverridesDataBun(pkgEnvDetails, pkgJson = pkgEnvDetails.editablePkgJ
|
|
|
3661
3665
|
function getOverridesDataNpm(pkgEnvDetails, pkgJson = pkgEnvDetails.editablePkgJson.content) {
|
|
3662
3666
|
const overrides = pkgJson?.[OVERRIDES$2] ?? {};
|
|
3663
3667
|
return {
|
|
3664
|
-
type: NPM$
|
|
3668
|
+
type: NPM$6,
|
|
3665
3669
|
overrides
|
|
3666
3670
|
};
|
|
3667
3671
|
}
|
|
@@ -3714,7 +3718,7 @@ function getOverridesData(pkgEnvDetails, pkgJson) {
|
|
|
3714
3718
|
return getOverridesDataYarn(pkgEnvDetails, pkgJson);
|
|
3715
3719
|
case YARN_CLASSIC$4:
|
|
3716
3720
|
return getOverridesDataYarnClassic(pkgEnvDetails, pkgJson);
|
|
3717
|
-
case NPM$
|
|
3721
|
+
case NPM$6:
|
|
3718
3722
|
default:
|
|
3719
3723
|
return getOverridesDataNpm(pkgEnvDetails, pkgJson);
|
|
3720
3724
|
}
|
|
@@ -3865,7 +3869,13 @@ async function agentFix(pkgEnvDetails, actualTree, alertsMap, installer, {
|
|
|
3865
3869
|
}
|
|
3866
3870
|
if (fixEnv.isCi && fs$1.existsSync(path.join(rootPath, 'node_modules'))) {
|
|
3867
3871
|
// eslint-disable-next-line no-await-in-loop
|
|
3868
|
-
|
|
3872
|
+
const treeResult = await getActualTree(cwd);
|
|
3873
|
+
const maybeActualTree = treeResult.actualTree;
|
|
3874
|
+
if (!maybeActualTree) {
|
|
3875
|
+
// Exit early if install fails.
|
|
3876
|
+
return handleInstallFail(treeResult.error);
|
|
3877
|
+
}
|
|
3878
|
+
actualTree = maybeActualTree;
|
|
3869
3879
|
} else {
|
|
3870
3880
|
// eslint-disable-next-line no-await-in-loop
|
|
3871
3881
|
const installResult = await installer(pkgEnvDetails, {
|
|
@@ -4258,50 +4268,37 @@ async function install$1(pkgEnvDetails, options) {
|
|
|
4258
4268
|
// default is "notice".
|
|
4259
4269
|
// https://docs.npmjs.com/cli/v8/using-npm/config#loglevel
|
|
4260
4270
|
...(useDebug ? [] : ['--silent']), ...(extraArgs ?? [])];
|
|
4261
|
-
const quotedCmd = `\`${pkgEnvDetails.agent} install ${args.join(' ')}\``;
|
|
4262
|
-
require$$6.debugFn('stdio', `spawn: ${quotedCmd}`);
|
|
4263
4271
|
const isSpinning = spinner?.isSpinning;
|
|
4264
4272
|
spinner?.stop();
|
|
4265
|
-
|
|
4266
|
-
|
|
4273
|
+
const quotedCmd = `\`${pkgEnvDetails.agent} install ${args.join(' ')}\``;
|
|
4274
|
+
require$$6.debugFn('stdio', `spawn: ${quotedCmd}`);
|
|
4267
4275
|
try {
|
|
4268
4276
|
await utils.runAgentInstall(pkgEnvDetails, {
|
|
4269
4277
|
args,
|
|
4270
4278
|
spinner,
|
|
4271
4279
|
stdio: useDebug ? 'inherit' : 'ignore'
|
|
4272
4280
|
});
|
|
4273
|
-
} catch (
|
|
4274
|
-
|
|
4275
|
-
error = e;
|
|
4276
|
-
require$$6.debugFn('error', `caught: ${quotedCmd} failed`);
|
|
4277
|
-
require$$6.debugDir('inspect', {
|
|
4281
|
+
} catch (error) {
|
|
4282
|
+
const result = {
|
|
4278
4283
|
error
|
|
4279
|
-
}
|
|
4284
|
+
};
|
|
4285
|
+
require$$6.debugFn('error', `caught: ${quotedCmd} failed`);
|
|
4286
|
+
require$$6.debugDir('inspect', result);
|
|
4287
|
+
return result;
|
|
4280
4288
|
}
|
|
4281
|
-
|
|
4282
|
-
if (
|
|
4283
|
-
|
|
4284
|
-
|
|
4285
|
-
} catch (e) {
|
|
4286
|
-
errored = true;
|
|
4287
|
-
error = e;
|
|
4288
|
-
require$$6.debugFn('error', 'caught: Arborist error');
|
|
4289
|
-
require$$6.debugDir('inspect', {
|
|
4290
|
-
error
|
|
4291
|
-
});
|
|
4289
|
+
const treeResult = await getActualTree(cwd);
|
|
4290
|
+
if (treeResult.actualTree) {
|
|
4291
|
+
if (isSpinning) {
|
|
4292
|
+
spinner.start();
|
|
4292
4293
|
}
|
|
4294
|
+
return treeResult;
|
|
4293
4295
|
}
|
|
4296
|
+
require$$6.debugFn('error', 'caught: await arb.loadActual() error');
|
|
4297
|
+
require$$6.debugDir('inspect', treeResult);
|
|
4294
4298
|
if (isSpinning) {
|
|
4295
4299
|
spinner.start();
|
|
4296
4300
|
}
|
|
4297
|
-
return
|
|
4298
|
-
...(actualTree ? {
|
|
4299
|
-
actualTree
|
|
4300
|
-
} : undefined),
|
|
4301
|
-
...(errored ? {
|
|
4302
|
-
error
|
|
4303
|
-
} : undefined)
|
|
4304
|
-
};
|
|
4301
|
+
return treeResult;
|
|
4305
4302
|
}
|
|
4306
4303
|
async function npmFix(pkgEnvDetails, fixConfig) {
|
|
4307
4304
|
const {
|
|
@@ -4336,8 +4333,8 @@ async function npmFix(pkgEnvDetails, fixConfig) {
|
|
|
4336
4333
|
});
|
|
4337
4334
|
return {
|
|
4338
4335
|
ok: false,
|
|
4339
|
-
message: '
|
|
4340
|
-
cause: e?.message || 'Unknown
|
|
4336
|
+
message: 'npm error',
|
|
4337
|
+
cause: e?.message || 'Unknown npm error.'
|
|
4341
4338
|
};
|
|
4342
4339
|
}
|
|
4343
4340
|
alertsMap = await shadowNpmInject.getAlertsMapFromArborist(arb, getFixAlertsMapOptions());
|
|
@@ -4449,50 +4446,37 @@ async function install(pkgEnvDetails, options) {
|
|
|
4449
4446
|
// Enable a non-interactive pnpm install
|
|
4450
4447
|
// https://github.com/pnpm/pnpm/issues/6778
|
|
4451
4448
|
'--config.confirmModulesPurge=false', ...(extraArgs ?? [])];
|
|
4452
|
-
const quotedCmd = `\`${pkgEnvDetails.agent} install ${args.join(' ')}\``;
|
|
4453
|
-
require$$6.debugFn('stdio', `spawn: ${quotedCmd}`);
|
|
4454
4449
|
const isSpinning = spinner?.isSpinning;
|
|
4455
4450
|
spinner?.stop();
|
|
4456
|
-
|
|
4457
|
-
|
|
4451
|
+
const quotedCmd = `\`${pkgEnvDetails.agent} install ${args.join(' ')}\``;
|
|
4452
|
+
require$$6.debugFn('stdio', `spawn: ${quotedCmd}`);
|
|
4458
4453
|
try {
|
|
4459
4454
|
await utils.runAgentInstall(pkgEnvDetails, {
|
|
4460
4455
|
args,
|
|
4461
4456
|
spinner,
|
|
4462
4457
|
stdio: require$$6.isDebug('stdio') ? 'inherit' : 'ignore'
|
|
4463
4458
|
});
|
|
4464
|
-
} catch (
|
|
4465
|
-
|
|
4466
|
-
error = e;
|
|
4467
|
-
require$$6.debugFn('error', `caught: ${quotedCmd} failed`);
|
|
4468
|
-
require$$6.debugDir('inspect', {
|
|
4459
|
+
} catch (error) {
|
|
4460
|
+
const result = {
|
|
4469
4461
|
error
|
|
4470
|
-
}
|
|
4462
|
+
};
|
|
4463
|
+
require$$6.debugFn('error', `caught: ${quotedCmd} failed`);
|
|
4464
|
+
require$$6.debugDir('inspect', result);
|
|
4465
|
+
return result;
|
|
4471
4466
|
}
|
|
4472
|
-
|
|
4473
|
-
if (
|
|
4474
|
-
|
|
4475
|
-
|
|
4476
|
-
} catch (e) {
|
|
4477
|
-
errored = true;
|
|
4478
|
-
error = e;
|
|
4479
|
-
require$$6.debugFn('error', 'caught: Arborist error');
|
|
4480
|
-
require$$6.debugDir('inspect', {
|
|
4481
|
-
error
|
|
4482
|
-
});
|
|
4467
|
+
const treeResult = await getActualTree(cwd);
|
|
4468
|
+
if (treeResult.actualTree) {
|
|
4469
|
+
if (isSpinning) {
|
|
4470
|
+
spinner.start();
|
|
4483
4471
|
}
|
|
4472
|
+
return treeResult;
|
|
4484
4473
|
}
|
|
4474
|
+
require$$6.debugFn('error', 'caught: await arb.loadActual() error');
|
|
4475
|
+
require$$6.debugDir('inspect', treeResult);
|
|
4485
4476
|
if (isSpinning) {
|
|
4486
4477
|
spinner.start();
|
|
4487
4478
|
}
|
|
4488
|
-
return
|
|
4489
|
-
...(actualTree ? {
|
|
4490
|
-
actualTree
|
|
4491
|
-
} : undefined),
|
|
4492
|
-
...(errored ? {
|
|
4493
|
-
error
|
|
4494
|
-
} : undefined)
|
|
4495
|
-
};
|
|
4479
|
+
return treeResult;
|
|
4496
4480
|
}
|
|
4497
4481
|
async function pnpmFix(pkgEnvDetails, fixConfig) {
|
|
4498
4482
|
const {
|
|
@@ -4751,7 +4735,7 @@ const config$H = {
|
|
|
4751
4735
|
autoMerge: {
|
|
4752
4736
|
type: 'boolean',
|
|
4753
4737
|
default: false,
|
|
4754
|
-
description: `Enable auto-merge for pull requests that Socket opens.\n
|
|
4738
|
+
description: `Enable auto-merge for pull requests that Socket opens.\n See ${vendor.terminalLinkExports('GitHub documentation', 'https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/configuring-pull-request-merges/managing-auto-merge-for-pull-requests-in-your-repository')} for managing auto-merge for pull requests in your repository.`
|
|
4755
4739
|
},
|
|
4756
4740
|
autopilot: {
|
|
4757
4741
|
type: 'boolean',
|
|
@@ -4761,7 +4745,7 @@ const config$H = {
|
|
|
4761
4745
|
ghsa: {
|
|
4762
4746
|
type: 'string',
|
|
4763
4747
|
default: [],
|
|
4764
|
-
description: `Provide a list of ${vendor.terminalLinkExports('GHSA IDs', 'https://docs.github.com/en/code-security/security-advisories/working-with-global-security-advisories-from-the-github-advisory-database/about-the-github-advisory-database#about-ghsa-ids')} to compute fixes for, as either a comma separated value or as multiple flags.\n
|
|
4748
|
+
description: `Provide a list of ${vendor.terminalLinkExports('GHSA IDs', 'https://docs.github.com/en/code-security/security-advisories/working-with-global-security-advisories-from-the-github-advisory-database/about-the-github-advisory-database#about-ghsa-ids')} to compute fixes for, as either a comma separated value or as multiple flags.\n Use '--ghsa all' to lookup all GHSA IDs and compute fixes for them.`,
|
|
4765
4749
|
isMultiple: true,
|
|
4766
4750
|
hidden: true
|
|
4767
4751
|
},
|
|
@@ -4790,7 +4774,7 @@ const config$H = {
|
|
|
4790
4774
|
purl: {
|
|
4791
4775
|
type: 'string',
|
|
4792
4776
|
default: [],
|
|
4793
|
-
description: `Provide a list of ${vendor.terminalLinkExports('PURLs', 'https://github.com/package-url/purl-spec?tab=readme-ov-file#purl')} to compute fixes for, as either a comma separated value or as\n
|
|
4777
|
+
description: `Provide a list of ${vendor.terminalLinkExports('PURLs', 'https://github.com/package-url/purl-spec?tab=readme-ov-file#purl')} to compute fixes for, as either a comma separated value or as\n multiple flags, instead of querying the Socket API`,
|
|
4794
4778
|
isMultiple: true,
|
|
4795
4779
|
shortFlag: 'p'
|
|
4796
4780
|
},
|
|
@@ -4799,15 +4783,15 @@ const config$H = {
|
|
|
4799
4783
|
default: 'preserve',
|
|
4800
4784
|
description: `
|
|
4801
4785
|
Define how dependency version ranges are updated in package.json (default 'preserve').
|
|
4802
|
-
|
|
4803
|
-
|
|
4804
|
-
|
|
4805
|
-
|
|
4806
|
-
|
|
4807
|
-
|
|
4808
|
-
|
|
4809
|
-
|
|
4810
|
-
|
|
4786
|
+
Available styles:
|
|
4787
|
+
* caret - Use ^ range for compatible updates (e.g. ^1.2.3)
|
|
4788
|
+
* gt - Use > to allow any newer version (e.g. >1.2.3)
|
|
4789
|
+
* gte - Use >= to allow any newer version (e.g. >=1.2.3)
|
|
4790
|
+
* lt - Use < to allow only lower versions (e.g. <1.2.3)
|
|
4791
|
+
* lte - Use <= to allow only lower versions (e.g. <=1.2.3)
|
|
4792
|
+
* pin - Use the exact version (e.g. 1.2.3)
|
|
4793
|
+
* preserve - Retain the existing version range style as-is
|
|
4794
|
+
* tilde - Use ~ range for patch/minor updates (e.g. ~1.2.3)
|
|
4811
4795
|
`.trim()
|
|
4812
4796
|
},
|
|
4813
4797
|
test: {
|
|
@@ -5111,7 +5095,7 @@ async function run$G(argv, importMeta, {
|
|
|
5111
5095
|
await handleInstallCompletion(String(targetName));
|
|
5112
5096
|
}
|
|
5113
5097
|
|
|
5114
|
-
const description$6 = '
|
|
5098
|
+
const description$6 = 'Install Socket CLI tab completion';
|
|
5115
5099
|
const cmdInstall = {
|
|
5116
5100
|
description: description$6,
|
|
5117
5101
|
hidden: false,
|
|
@@ -5206,7 +5190,7 @@ async function attemptLogin(apiBaseUrl, apiProxy) {
|
|
|
5206
5190
|
apiBaseUrl ??= utils.getConfigValueOrUndef('apiBaseUrl') ?? undefined;
|
|
5207
5191
|
apiProxy ??= utils.getConfigValueOrUndef('apiProxy') ?? undefined;
|
|
5208
5192
|
const apiTokenInput = await prompts.password({
|
|
5209
|
-
message: `Enter your ${vendor.terminalLinkExports('Socket.dev API token', 'https://docs.socket.dev/docs/api-keys')} (leave blank
|
|
5193
|
+
message: `Enter your ${vendor.terminalLinkExports('Socket.dev API token', 'https://docs.socket.dev/docs/api-keys')} (leave blank to use a limited public token)`
|
|
5210
5194
|
});
|
|
5211
5195
|
if (apiTokenInput === undefined) {
|
|
5212
5196
|
logger.logger.fail('Canceled by user');
|
|
@@ -5335,7 +5319,7 @@ const {
|
|
|
5335
5319
|
} = constants;
|
|
5336
5320
|
const config$E = {
|
|
5337
5321
|
commandName: 'login',
|
|
5338
|
-
description: 'Socket API
|
|
5322
|
+
description: 'Setup Socket CLI with an API token and defaults',
|
|
5339
5323
|
hidden: false,
|
|
5340
5324
|
flags: {
|
|
5341
5325
|
...flags.commonFlags,
|
|
@@ -5453,14 +5437,14 @@ async function run$D(argv, importMeta, {
|
|
|
5453
5437
|
}
|
|
5454
5438
|
|
|
5455
5439
|
const {
|
|
5456
|
-
NPM: NPM$
|
|
5457
|
-
NPX
|
|
5440
|
+
NPM: NPM$5,
|
|
5441
|
+
NPX,
|
|
5458
5442
|
PACKAGE_LOCK_JSON,
|
|
5459
5443
|
PNPM: PNPM$5,
|
|
5460
5444
|
YARN,
|
|
5461
5445
|
YARN_LOCK
|
|
5462
5446
|
} = constants;
|
|
5463
|
-
const nodejsPlatformTypes = new Set(['javascript', 'js', 'nodejs', NPM$
|
|
5447
|
+
const nodejsPlatformTypes = new Set(['javascript', 'js', 'nodejs', NPM$5, PNPM$5, 'ts', 'tsx', 'typescript']);
|
|
5464
5448
|
function argvToArray(argv) {
|
|
5465
5449
|
if (argv['help']) {
|
|
5466
5450
|
return ['--help'];
|
|
@@ -5485,8 +5469,13 @@ function argvToArray(argv) {
|
|
|
5485
5469
|
result.push(`--${key}`, ...value.map(String));
|
|
5486
5470
|
}
|
|
5487
5471
|
}
|
|
5488
|
-
|
|
5489
|
-
|
|
5472
|
+
const pathArgs = argv['_'];
|
|
5473
|
+
if (Array.isArray(pathArgs)) {
|
|
5474
|
+
result.push(...pathArgs);
|
|
5475
|
+
}
|
|
5476
|
+
const argsAfterDoubleHyphen = argv['--'];
|
|
5477
|
+
if (Array.isArray(argsAfterDoubleHyphen)) {
|
|
5478
|
+
result.push('--', ...argsAfterDoubleHyphen);
|
|
5490
5479
|
}
|
|
5491
5480
|
return result;
|
|
5492
5481
|
}
|
|
@@ -5502,20 +5491,20 @@ async function runCdxgen(yargvWithYes) {
|
|
|
5502
5491
|
const yesArgs = yes ? ['--yes'] : [];
|
|
5503
5492
|
if (yargv.type !== YARN && nodejsPlatformTypes.has(yargv.type) && fs$1.existsSync(`./${YARN_LOCK}`)) {
|
|
5504
5493
|
if (fs$1.existsSync(`./${PACKAGE_LOCK_JSON}`)) {
|
|
5505
|
-
yargv.type = NPM$
|
|
5494
|
+
yargv.type = NPM$5;
|
|
5506
5495
|
} else {
|
|
5507
5496
|
// Use synp to create a package-lock.json from the yarn.lock,
|
|
5508
5497
|
// based on the node_modules folder, for a more accurate SBOM.
|
|
5509
5498
|
try {
|
|
5510
|
-
await shadowNpmBin(NPX
|
|
5499
|
+
await shadowNpmBin(NPX, [...yesArgs,
|
|
5511
5500
|
// Lazily access constants.ENV.INLINED_SOCKET_CLI_SYNP_VERSION.
|
|
5512
5501
|
`synp@${constants.ENV.INLINED_SOCKET_CLI_SYNP_VERSION}`, '--source-file', `./${YARN_LOCK}`]);
|
|
5513
|
-
yargv.type = NPM$
|
|
5502
|
+
yargv.type = NPM$5;
|
|
5514
5503
|
cleanupPackageLock = true;
|
|
5515
5504
|
} catch {}
|
|
5516
5505
|
}
|
|
5517
5506
|
}
|
|
5518
|
-
await shadowNpmBin(NPX
|
|
5507
|
+
await shadowNpmBin(NPX, [...yesArgs,
|
|
5519
5508
|
// Lazily access constants.ENV.INLINED_SOCKET_CLI_CYCLONEDX_CDXGEN_VERSION.
|
|
5520
5509
|
`@cyclonedx/cdxgen@${constants.ENV.INLINED_SOCKET_CLI_CYCLONEDX_CDXGEN_VERSION}`, ...argvToArray(yargv)]);
|
|
5521
5510
|
if (cleanupPackageLock) {
|
|
@@ -5759,16 +5748,25 @@ async function run$C(argv, importMeta, {
|
|
|
5759
5748
|
const yargv = {
|
|
5760
5749
|
...vendor.yargsParser(argv, yargsConfig)
|
|
5761
5750
|
};
|
|
5762
|
-
const
|
|
5751
|
+
const pathArgs = [];
|
|
5752
|
+
const unknowns = [];
|
|
5753
|
+
for (const a of yargv._) {
|
|
5754
|
+
if (path$1.isPath(a)) {
|
|
5755
|
+
pathArgs.push(a);
|
|
5756
|
+
} else {
|
|
5757
|
+
unknowns.push(a);
|
|
5758
|
+
}
|
|
5759
|
+
}
|
|
5760
|
+
yargv._ = pathArgs;
|
|
5763
5761
|
const {
|
|
5764
|
-
length:
|
|
5765
|
-
} =
|
|
5766
|
-
if (
|
|
5762
|
+
length: unknownsCount
|
|
5763
|
+
} = unknowns;
|
|
5764
|
+
if (unknownsCount) {
|
|
5767
5765
|
// Use exit status of 2 to indicate incorrect usage, generally invalid
|
|
5768
5766
|
// options or missing arguments.
|
|
5769
5767
|
// https://www.gnu.org/software/bash/manual/html_node/Exit-Status.html
|
|
5770
5768
|
process.exitCode = 2;
|
|
5771
|
-
logger.logger.fail(`Unknown ${words.pluralize('argument',
|
|
5769
|
+
logger.logger.fail(`Unknown ${words.pluralize('argument', unknownsCount)}: ${unknowns.join(', ')}`);
|
|
5772
5770
|
return;
|
|
5773
5771
|
}
|
|
5774
5772
|
if (cli.flags['dryRun']) {
|
|
@@ -7014,7 +7012,7 @@ async function run$w(argv, importMeta, {
|
|
|
7014
7012
|
|
|
7015
7013
|
const config$v = {
|
|
7016
7014
|
commandName: 'manifest',
|
|
7017
|
-
description: 'Generate a dependency manifest for
|
|
7015
|
+
description: 'Generate a dependency manifest for certain ecosystems',
|
|
7018
7016
|
hidden: false,
|
|
7019
7017
|
flags: {
|
|
7020
7018
|
...flags.commonFlags
|
|
@@ -7057,12 +7055,12 @@ const {
|
|
|
7057
7055
|
} = constants;
|
|
7058
7056
|
const config$u = {
|
|
7059
7057
|
commandName: 'npm',
|
|
7060
|
-
description:
|
|
7058
|
+
description: 'Run npm with the Socket wrapper',
|
|
7061
7059
|
hidden: false,
|
|
7062
7060
|
flags: {
|
|
7063
7061
|
...flags.commonFlags
|
|
7064
7062
|
},
|
|
7065
|
-
help:
|
|
7063
|
+
help: command => `
|
|
7066
7064
|
Usage
|
|
7067
7065
|
$ ${command} ...
|
|
7068
7066
|
|
|
@@ -7110,7 +7108,7 @@ const {
|
|
|
7110
7108
|
} = constants;
|
|
7111
7109
|
const config$t = {
|
|
7112
7110
|
commandName: 'npx',
|
|
7113
|
-
description:
|
|
7111
|
+
description: 'Run npx with the Socket wrapper',
|
|
7114
7112
|
hidden: false,
|
|
7115
7113
|
flags: {
|
|
7116
7114
|
...flags.commonFlags
|
|
@@ -7221,7 +7219,7 @@ async function run$s(argv, importMeta, {
|
|
|
7221
7219
|
|
|
7222
7220
|
const {
|
|
7223
7221
|
BUN: BUN$3,
|
|
7224
|
-
NPM: NPM$
|
|
7222
|
+
NPM: NPM$4,
|
|
7225
7223
|
PNPM: PNPM$4,
|
|
7226
7224
|
VLT: VLT$4,
|
|
7227
7225
|
YARN_BERRY: YARN_BERRY$3,
|
|
@@ -7241,7 +7239,7 @@ function lsStdoutIncludes(pkgEnvDetails, stdout, name) {
|
|
|
7241
7239
|
return matchLsCmdViewHumanStdout(stdout, name);
|
|
7242
7240
|
case PNPM$4:
|
|
7243
7241
|
case VLT$4:
|
|
7244
|
-
case NPM$
|
|
7242
|
+
case NPM$4:
|
|
7245
7243
|
default:
|
|
7246
7244
|
return matchQueryCmdStdout(stdout, name);
|
|
7247
7245
|
}
|
|
@@ -7274,7 +7272,7 @@ function getDependencyEntries(pkgEnvDetails) {
|
|
|
7274
7272
|
const {
|
|
7275
7273
|
BUN: BUN$2,
|
|
7276
7274
|
LOCK_EXT,
|
|
7277
|
-
NPM: NPM$
|
|
7275
|
+
NPM: NPM$3,
|
|
7278
7276
|
PNPM: PNPM$3,
|
|
7279
7277
|
VLT: VLT$3,
|
|
7280
7278
|
YARN_BERRY: YARN_BERRY$2,
|
|
@@ -7332,7 +7330,7 @@ function lockSrcIncludes(pkgEnvDetails, lockSrc, name, lockName) {
|
|
|
7332
7330
|
return yarnLockSrcIncludes(lockSrc, name);
|
|
7333
7331
|
case YARN_CLASSIC$2:
|
|
7334
7332
|
return yarnLockSrcIncludes(lockSrc, name);
|
|
7335
|
-
case NPM$
|
|
7333
|
+
case NPM$3:
|
|
7336
7334
|
default:
|
|
7337
7335
|
return npmLockSrcIncludes(lockSrc, name);
|
|
7338
7336
|
}
|
|
@@ -7340,7 +7338,7 @@ function lockSrcIncludes(pkgEnvDetails, lockSrc, name, lockName) {
|
|
|
7340
7338
|
|
|
7341
7339
|
const {
|
|
7342
7340
|
BUN: BUN$1,
|
|
7343
|
-
NPM: NPM$
|
|
7341
|
+
NPM: NPM$2,
|
|
7344
7342
|
PNPM: PNPM$2,
|
|
7345
7343
|
VLT: VLT$2,
|
|
7346
7344
|
YARN_BERRY: YARN_BERRY$1,
|
|
@@ -7432,7 +7430,7 @@ async function lsPnpm(pkgEnvDetails, options) {
|
|
|
7432
7430
|
__proto__: null,
|
|
7433
7431
|
...options
|
|
7434
7432
|
};
|
|
7435
|
-
if (npmExecPath && npmExecPath !== NPM$
|
|
7433
|
+
if (npmExecPath && npmExecPath !== NPM$2) {
|
|
7436
7434
|
const result = await npmQuery(npmExecPath, cwd);
|
|
7437
7435
|
if (result) {
|
|
7438
7436
|
return result;
|
|
@@ -7519,7 +7517,7 @@ async function listPackages(pkgEnvDetails, options) {
|
|
|
7519
7517
|
return await lsYarnBerry(pkgEnvDetails, options);
|
|
7520
7518
|
case YARN_CLASSIC$1:
|
|
7521
7519
|
return await lsYarnClassic(pkgEnvDetails, options);
|
|
7522
|
-
case NPM$
|
|
7520
|
+
case NPM$2:
|
|
7523
7521
|
default:
|
|
7524
7522
|
return await lsNpm(pkgEnvDetails, options);
|
|
7525
7523
|
}
|
|
@@ -7529,7 +7527,7 @@ const CMD_NAME = 'socket optimize';
|
|
|
7529
7527
|
|
|
7530
7528
|
const {
|
|
7531
7529
|
BUN,
|
|
7532
|
-
NPM: NPM$
|
|
7530
|
+
NPM: NPM$1,
|
|
7533
7531
|
OVERRIDES,
|
|
7534
7532
|
PNPM: PNPM$1,
|
|
7535
7533
|
RESOLUTIONS,
|
|
@@ -7654,7 +7652,7 @@ function updateManifest(agent, editablePkgJson, overrides) {
|
|
|
7654
7652
|
case YARN_CLASSIC:
|
|
7655
7653
|
updateResolutionsField(editablePkgJson, overrides);
|
|
7656
7654
|
return;
|
|
7657
|
-
case NPM$
|
|
7655
|
+
case NPM$1:
|
|
7658
7656
|
default:
|
|
7659
7657
|
updateOverridesField(editablePkgJson, overrides);
|
|
7660
7658
|
return;
|
|
@@ -7662,10 +7660,10 @@ function updateManifest(agent, editablePkgJson, overrides) {
|
|
|
7662
7660
|
}
|
|
7663
7661
|
|
|
7664
7662
|
const {
|
|
7665
|
-
NPM
|
|
7663
|
+
NPM,
|
|
7666
7664
|
PNPM
|
|
7667
7665
|
} = constants;
|
|
7668
|
-
const manifestNpmOverrides = registry.getManifestData(NPM
|
|
7666
|
+
const manifestNpmOverrides = registry.getManifestData(NPM);
|
|
7669
7667
|
async function addOverrides(pkgEnvDetails, pkgPath, options) {
|
|
7670
7668
|
const {
|
|
7671
7669
|
agent,
|
|
@@ -7697,7 +7695,7 @@ async function addOverrides(pkgEnvDetails, pkgPath, options) {
|
|
|
7697
7695
|
const workspace = isWorkspaceRoot ? 'root' : path.relative(rootPath, pkgPath);
|
|
7698
7696
|
if (isWorkspace && agent === PNPM &&
|
|
7699
7697
|
// npmExecPath will === the agent name IF it CANNOT be resolved.
|
|
7700
|
-
npmExecPath === NPM
|
|
7698
|
+
npmExecPath === NPM && !state.warnedPnpmWorkspaceRequiresNpm) {
|
|
7701
7699
|
state.warnedPnpmWorkspaceRequiresNpm = true;
|
|
7702
7700
|
spinner?.stop();
|
|
7703
7701
|
logger?.warn(utils.cmdPrefixMessage(CMD_NAME, `${agent} workspace support requires \`npm ls\`, falling back to \`${agent} list\``));
|
|
@@ -7730,7 +7728,7 @@ async function addOverrides(pkgEnvDetails, pkgPath, options) {
|
|
|
7730
7728
|
version
|
|
7731
7729
|
} = data;
|
|
7732
7730
|
const major = utils.getMajor(version);
|
|
7733
|
-
const sockOverridePrefix = `${NPM
|
|
7731
|
+
const sockOverridePrefix = `${NPM}:${sockRegPkgName}@`;
|
|
7734
7732
|
const sockOverrideSpec = `${sockOverridePrefix}${pin ? version : `^${major}`}`;
|
|
7735
7733
|
for (const {
|
|
7736
7734
|
1: depObj
|
|
@@ -7786,7 +7784,7 @@ async function addOverrides(pkgEnvDetails, pkgPath, options) {
|
|
|
7786
7784
|
const sockRegDepAlias = depAliasMap.get(sockRegPkgName);
|
|
7787
7785
|
const depAlias = sockRegDepAlias ?? origDepAlias;
|
|
7788
7786
|
let newSpec = sockOverrideSpec;
|
|
7789
|
-
if (type === NPM
|
|
7787
|
+
if (type === NPM && depAlias) {
|
|
7790
7788
|
// With npm one may not set an override for a package that one directly
|
|
7791
7789
|
// depends on unless both the dependency and the override itself share
|
|
7792
7790
|
// the exact same spec. To make this limitation easier to deal with,
|
|
@@ -8480,8 +8478,6 @@ async function handleSecurityPolicy(orgSlug, outputKind) {
|
|
|
8480
8478
|
const {
|
|
8481
8479
|
DRY_RUN_BAILING_NOW: DRY_RUN_BAILING_NOW$o
|
|
8482
8480
|
} = constants;
|
|
8483
|
-
|
|
8484
|
-
// TODO: secret toplevel alias `socket security policy`?
|
|
8485
8481
|
const config$o = {
|
|
8486
8482
|
commandName: 'security',
|
|
8487
8483
|
description: 'Retrieve the security policy of an organization',
|
|
@@ -8710,7 +8706,7 @@ const cmdOrganizationPolicy = {
|
|
|
8710
8706
|
defaultSub: 'list',
|
|
8711
8707
|
// Backwards compat
|
|
8712
8708
|
importMeta,
|
|
8713
|
-
name: parentName
|
|
8709
|
+
name: `${parentName} policy`
|
|
8714
8710
|
});
|
|
8715
8711
|
}
|
|
8716
8712
|
};
|
|
@@ -8824,7 +8820,7 @@ async function run$m(argv, importMeta, {
|
|
|
8824
8820
|
await handleQuota(outputKind);
|
|
8825
8821
|
}
|
|
8826
8822
|
|
|
8827
|
-
const description$4 = '
|
|
8823
|
+
const description$4 = 'Manage Socket organization account details';
|
|
8828
8824
|
const cmdOrganization = {
|
|
8829
8825
|
description: description$4,
|
|
8830
8826
|
hidden: false,
|
|
@@ -8857,7 +8853,7 @@ const cmdOrganization = {
|
|
|
8857
8853
|
argv,
|
|
8858
8854
|
description: description$4,
|
|
8859
8855
|
importMeta,
|
|
8860
|
-
name: parentName
|
|
8856
|
+
name: `${parentName} organization`
|
|
8861
8857
|
});
|
|
8862
8858
|
}
|
|
8863
8859
|
};
|
|
@@ -8906,125 +8902,123 @@ function createMarkdownReport(data) {
|
|
|
8906
8902
|
score
|
|
8907
8903
|
}
|
|
8908
8904
|
} = data;
|
|
8909
|
-
const
|
|
8910
|
-
arr.push('# Complete Package Score');
|
|
8911
|
-
arr.push('');
|
|
8905
|
+
const o = ['# Complete Package Score', ''];
|
|
8912
8906
|
if (dependencyCount) {
|
|
8913
|
-
|
|
8907
|
+
o.push(`This is a Socket report for the package *"${purl}"* and its *${dependencyCount}* direct/transitive dependencies.`);
|
|
8914
8908
|
} else {
|
|
8915
|
-
|
|
8909
|
+
o.push(`This is a Socket report for the package *"${purl}"*. It has *no dependencies*.`);
|
|
8916
8910
|
}
|
|
8917
|
-
|
|
8911
|
+
o.push('');
|
|
8918
8912
|
if (dependencyCount) {
|
|
8919
|
-
|
|
8913
|
+
o.push(`It will show you the shallow score for just the package itself and a deep score for all the transitives combined. Additionally you can see which capabilities were found and the top alerts as well as a package that was responsible for it.`);
|
|
8920
8914
|
} else {
|
|
8921
|
-
|
|
8922
|
-
|
|
8923
|
-
|
|
8915
|
+
o.push(`It will show you the shallow score for the package itself, which capabilities were found, and its top alerts.`);
|
|
8916
|
+
o.push('');
|
|
8917
|
+
o.push('Since it has no dependencies, the shallow score is also the deep score.');
|
|
8924
8918
|
}
|
|
8925
|
-
|
|
8919
|
+
o.push('');
|
|
8926
8920
|
if (dependencyCount) {
|
|
8927
8921
|
// This doesn't make much sense if there are no dependencies. Better to omit it.
|
|
8928
|
-
|
|
8929
|
-
|
|
8930
|
-
|
|
8931
|
-
|
|
8932
|
-
|
|
8922
|
+
o.push('The report should give you a good insight into the status of this package.');
|
|
8923
|
+
o.push('');
|
|
8924
|
+
o.push('## Package itself');
|
|
8925
|
+
o.push('');
|
|
8926
|
+
o.push('Here are results for the package itself (excluding data from dependencies).');
|
|
8933
8927
|
} else {
|
|
8934
|
-
|
|
8935
|
-
|
|
8936
|
-
|
|
8937
|
-
}
|
|
8938
|
-
|
|
8939
|
-
|
|
8940
|
-
|
|
8941
|
-
|
|
8942
|
-
|
|
8943
|
-
|
|
8944
|
-
|
|
8945
|
-
|
|
8946
|
-
|
|
8947
|
-
|
|
8948
|
-
|
|
8949
|
-
|
|
8950
|
-
|
|
8951
|
-
|
|
8928
|
+
o.push('## Report');
|
|
8929
|
+
o.push('');
|
|
8930
|
+
o.push('The report should give you a good insight into the status of this package.');
|
|
8931
|
+
}
|
|
8932
|
+
o.push('');
|
|
8933
|
+
o.push('### Shallow Score');
|
|
8934
|
+
o.push('');
|
|
8935
|
+
o.push('This score is just for the package itself:');
|
|
8936
|
+
o.push('');
|
|
8937
|
+
o.push(`- Overall: ${selfScore.overall}`);
|
|
8938
|
+
o.push(`- Maintenance: ${selfScore.maintenance}`);
|
|
8939
|
+
o.push(`- Quality: ${selfScore.quality}`);
|
|
8940
|
+
o.push(`- Supply Chain: ${selfScore.supplyChain}`);
|
|
8941
|
+
o.push(`- Vulnerability: ${selfScore.vulnerability}`);
|
|
8942
|
+
o.push(`- License: ${selfScore.license}`);
|
|
8943
|
+
o.push('');
|
|
8944
|
+
o.push('### Capabilities');
|
|
8945
|
+
o.push('');
|
|
8952
8946
|
if (selfCaps.length) {
|
|
8953
|
-
|
|
8954
|
-
|
|
8955
|
-
|
|
8956
|
-
|
|
8957
|
-
}
|
|
8947
|
+
o.push('These are the capabilities detected in the package itself:');
|
|
8948
|
+
o.push('');
|
|
8949
|
+
for (const cap of selfCaps) {
|
|
8950
|
+
o.push(`- ${cap}`);
|
|
8951
|
+
}
|
|
8958
8952
|
} else {
|
|
8959
|
-
|
|
8953
|
+
o.push('No capabilities were found in the package.');
|
|
8960
8954
|
}
|
|
8961
|
-
|
|
8962
|
-
|
|
8963
|
-
|
|
8955
|
+
o.push('');
|
|
8956
|
+
o.push('### Alerts for this package');
|
|
8957
|
+
o.push('');
|
|
8964
8958
|
if (selfAlerts.length) {
|
|
8965
8959
|
if (dependencyCount) {
|
|
8966
|
-
|
|
8960
|
+
o.push('These are the alerts found for the package itself:');
|
|
8967
8961
|
} else {
|
|
8968
|
-
|
|
8962
|
+
o.push('These are the alerts found for this package:');
|
|
8969
8963
|
}
|
|
8970
|
-
|
|
8971
|
-
|
|
8964
|
+
o.push('');
|
|
8965
|
+
o.push(utils.mdTable(selfAlerts, ['severity', 'name'], ['Severity', 'Alert Name']));
|
|
8972
8966
|
} else {
|
|
8973
|
-
|
|
8967
|
+
o.push('There are currently no alerts for this package.');
|
|
8974
8968
|
}
|
|
8975
|
-
|
|
8969
|
+
o.push('');
|
|
8976
8970
|
if (dependencyCount) {
|
|
8977
|
-
|
|
8978
|
-
|
|
8979
|
-
|
|
8980
|
-
|
|
8981
|
-
|
|
8982
|
-
|
|
8983
|
-
|
|
8984
|
-
|
|
8985
|
-
|
|
8986
|
-
|
|
8987
|
-
|
|
8988
|
-
|
|
8989
|
-
|
|
8990
|
-
|
|
8991
|
-
|
|
8992
|
-
|
|
8993
|
-
|
|
8994
|
-
|
|
8995
|
-
|
|
8996
|
-
|
|
8997
|
-
|
|
8998
|
-
|
|
8999
|
-
|
|
9000
|
-
|
|
9001
|
-
|
|
9002
|
-
|
|
9003
|
-
|
|
9004
|
-
|
|
9005
|
-
|
|
8971
|
+
o.push('## Transitive Package Results');
|
|
8972
|
+
o.push('');
|
|
8973
|
+
o.push('Here are results for the package and its direct/transitive dependencies.');
|
|
8974
|
+
o.push('');
|
|
8975
|
+
o.push('### Deep Score');
|
|
8976
|
+
o.push('');
|
|
8977
|
+
o.push('This score represents the package and and its direct/transitive dependencies:');
|
|
8978
|
+
o.push(`The function used to calculate the values in aggregate is: *"${func}"*`);
|
|
8979
|
+
o.push('');
|
|
8980
|
+
o.push(`- Overall: ${score.overall}`);
|
|
8981
|
+
o.push(`- Maintenance: ${score.maintenance}`);
|
|
8982
|
+
o.push(`- Quality: ${score.quality}`);
|
|
8983
|
+
o.push(`- Supply Chain: ${score.supplyChain}`);
|
|
8984
|
+
o.push(`- Vulnerability: ${score.vulnerability}`);
|
|
8985
|
+
o.push(`- License: ${score.license}`);
|
|
8986
|
+
o.push('');
|
|
8987
|
+
o.push('### Capabilities');
|
|
8988
|
+
o.push('');
|
|
8989
|
+
o.push('These are the packages with the lowest recorded score. If there is more than one with the lowest score, just one is shown here. This may help you figure out the source of low scores.');
|
|
8990
|
+
o.push('');
|
|
8991
|
+
o.push(`- Overall: ${lowest.overall}`);
|
|
8992
|
+
o.push(`- Maintenance: ${lowest.maintenance}`);
|
|
8993
|
+
o.push(`- Quality: ${lowest.quality}`);
|
|
8994
|
+
o.push(`- Supply Chain: ${lowest.supplyChain}`);
|
|
8995
|
+
o.push(`- Vulnerability: ${lowest.vulnerability}`);
|
|
8996
|
+
o.push(`- License: ${lowest.license}`);
|
|
8997
|
+
o.push('');
|
|
8998
|
+
o.push('### Capabilities');
|
|
8999
|
+
o.push('');
|
|
9006
9000
|
if (capabilities.length) {
|
|
9007
|
-
|
|
9008
|
-
|
|
9009
|
-
|
|
9010
|
-
|
|
9011
|
-
}
|
|
9001
|
+
o.push('These are the capabilities detected in at least one package:');
|
|
9002
|
+
o.push('');
|
|
9003
|
+
for (const cap of capabilities) {
|
|
9004
|
+
o.push(`- ${cap}`);
|
|
9005
|
+
}
|
|
9012
9006
|
} else {
|
|
9013
|
-
|
|
9007
|
+
o.push('This package had no capabilities and neither did any of its direct/transitive dependencies.');
|
|
9014
9008
|
}
|
|
9015
|
-
|
|
9016
|
-
|
|
9017
|
-
|
|
9009
|
+
o.push('');
|
|
9010
|
+
o.push('### Alerts');
|
|
9011
|
+
o.push('');
|
|
9018
9012
|
if (alerts.length) {
|
|
9019
|
-
|
|
9020
|
-
|
|
9021
|
-
|
|
9013
|
+
o.push('These are the alerts found:');
|
|
9014
|
+
o.push('');
|
|
9015
|
+
o.push(utils.mdTable(alerts, ['severity', 'name', 'example'], ['Severity', 'Alert Name', 'Example package reporting it']));
|
|
9022
9016
|
} else {
|
|
9023
|
-
|
|
9017
|
+
o.push('This package had no alerts and neither did any of its direct/transitive dependencies');
|
|
9024
9018
|
}
|
|
9025
|
-
|
|
9026
|
-
return arr.join('\n');
|
|
9019
|
+
o.push('');
|
|
9027
9020
|
}
|
|
9021
|
+
return o.join('\n');
|
|
9028
9022
|
}
|
|
9029
9023
|
|
|
9030
9024
|
async function handlePurlDeepScore(purl, outputKind) {
|
|
@@ -9058,12 +9052,12 @@ function parsePackageSpecifiers(ecosystem, pkgs) {
|
|
|
9058
9052
|
valid = false;
|
|
9059
9053
|
}
|
|
9060
9054
|
} else {
|
|
9061
|
-
// Assume ecosystem is a purl, too
|
|
9055
|
+
// Assume ecosystem is a purl, too.
|
|
9062
9056
|
pkgs.unshift(ecosystem);
|
|
9063
9057
|
for (let i = 0; i < pkgs.length; ++i) {
|
|
9064
9058
|
const pkg = pkgs[i] ?? '';
|
|
9065
9059
|
if (!/^(?:pkg:)?[a-zA-Z]+\/./.test(pkg)) {
|
|
9066
|
-
// At least one purl did not start with `pkg:eco/x` or `eco/x
|
|
9060
|
+
// At least one purl did not start with `pkg:eco/x` or `eco/x`.
|
|
9067
9061
|
valid = false;
|
|
9068
9062
|
break;
|
|
9069
9063
|
} else if (pkg.startsWith('pkg:')) {
|
|
@@ -9279,10 +9273,10 @@ function getAlertString(alerts, noColor = false) {
|
|
|
9279
9273
|
if (!alerts.size) {
|
|
9280
9274
|
return noColor ? `- Alerts: none!` : `- Alerts: ${vendor.yoctocolorsCjsExports.green('none')}!`;
|
|
9281
9275
|
}
|
|
9282
|
-
const
|
|
9283
|
-
const bad =
|
|
9284
|
-
const mid =
|
|
9285
|
-
const low =
|
|
9276
|
+
const o = Array.from(alerts.values());
|
|
9277
|
+
const bad = o.filter(alert => alert.severity !== 'low' && alert.severity !== 'middle').sort((a, b) => a.type < b.type ? -1 : a.type > b.type ? 1 : 0);
|
|
9278
|
+
const mid = o.filter(alert => alert.severity === 'middle').sort((a, b) => a.type < b.type ? -1 : a.type > b.type ? 1 : 0);
|
|
9279
|
+
const low = o.filter(alert => alert.severity === 'low').sort((a, b) => a.type < b.type ? -1 : a.type > b.type ? 1 : 0);
|
|
9286
9280
|
|
|
9287
9281
|
// We need to create the no-color string regardless because the actual string
|
|
9288
9282
|
// contains a bunch of invisible ANSI chars which would screw up length checks.
|
|
@@ -9302,12 +9296,12 @@ function preProcess(artifacts, requestedPurls) {
|
|
|
9302
9296
|
// API does not tell us which purls were not found.
|
|
9303
9297
|
// Generate all purls to try so we can try to match search request.
|
|
9304
9298
|
const purls = new Set();
|
|
9305
|
-
|
|
9299
|
+
for (const data of artifacts) {
|
|
9306
9300
|
purls.add(`pkg:${data.type}/${data.namespace ? `${data.namespace}/` : ''}${data.name}@${data.version}`);
|
|
9307
9301
|
purls.add(`pkg:${data.type}/${data.name}@${data.version}`);
|
|
9308
9302
|
purls.add(`pkg:${data.type}/${data.name}`);
|
|
9309
9303
|
purls.add(`pkg:${data.type}/${data.namespace ? `${data.namespace}/` : ''}${data.name}`);
|
|
9310
|
-
}
|
|
9304
|
+
}
|
|
9311
9305
|
// Try to match the searched purls against this list
|
|
9312
9306
|
const missing = requestedPurls.filter(purl => {
|
|
9313
9307
|
if (purls.has(purl)) {
|
|
@@ -9316,7 +9310,8 @@ function preProcess(artifacts, requestedPurls) {
|
|
|
9316
9310
|
if (purl.endsWith('@latest') && purls.has(purl.slice(0, -'@latest'.length))) {
|
|
9317
9311
|
return false;
|
|
9318
9312
|
}
|
|
9319
|
-
|
|
9313
|
+
// Not found.
|
|
9314
|
+
return true;
|
|
9320
9315
|
});
|
|
9321
9316
|
|
|
9322
9317
|
// Create a unique set of rows which represents each artifact that is returned
|
|
@@ -9324,13 +9319,13 @@ function preProcess(artifacts, requestedPurls) {
|
|
|
9324
9319
|
// .release field (observed with python, at least).
|
|
9325
9320
|
// Merge the alerts for duped packages. Use lowest score between all of them.
|
|
9326
9321
|
const rows = new Map();
|
|
9327
|
-
|
|
9322
|
+
for (const artifact of artifacts) {
|
|
9328
9323
|
const purl = `pkg:${artifact.type}/${artifact.namespace ? `${artifact.namespace}/` : ''}${artifact.name}${artifact.version ? `@${artifact.version}` : ''}`;
|
|
9329
9324
|
if (rows.has(purl)) {
|
|
9330
9325
|
const row = rows.get(purl);
|
|
9331
9326
|
if (!row) {
|
|
9332
|
-
//
|
|
9333
|
-
|
|
9327
|
+
// Unreachable; Satisfy TS.
|
|
9328
|
+
continue;
|
|
9334
9329
|
}
|
|
9335
9330
|
if ((artifact.score?.supplyChain || 100) < row.score.supplyChain) {
|
|
9336
9331
|
row.score.supplyChain = artifact.score?.supplyChain || 100;
|
|
@@ -9382,7 +9377,7 @@ function preProcess(artifacts, requestedPurls) {
|
|
|
9382
9377
|
alerts
|
|
9383
9378
|
});
|
|
9384
9379
|
}
|
|
9385
|
-
}
|
|
9380
|
+
}
|
|
9386
9381
|
return {
|
|
9387
9382
|
rows,
|
|
9388
9383
|
missing
|
|
@@ -9391,14 +9386,15 @@ function preProcess(artifacts, requestedPurls) {
|
|
|
9391
9386
|
function generateMarkdownReport(artifacts, missing) {
|
|
9392
9387
|
const blocks = [];
|
|
9393
9388
|
const dupes = new Set();
|
|
9394
|
-
artifacts.
|
|
9395
|
-
const block =
|
|
9389
|
+
for (const artifact of artifacts.values()) {
|
|
9390
|
+
const block = `## ${formatReportCard(artifact, false)}`;
|
|
9396
9391
|
if (dupes.has(block)) {
|
|
9397
|
-
|
|
9392
|
+
// Omit duplicate blocks.
|
|
9393
|
+
continue;
|
|
9398
9394
|
}
|
|
9399
9395
|
dupes.add(block);
|
|
9400
9396
|
blocks.push(block);
|
|
9401
|
-
}
|
|
9397
|
+
}
|
|
9402
9398
|
return `
|
|
9403
9399
|
# Shallow Package Report
|
|
9404
9400
|
|
|
@@ -9407,30 +9403,31 @@ This report contains the response for requesting data on some package url(s).
|
|
|
9407
9403
|
Please note: The listed scores are ONLY for the package itself. It does NOT
|
|
9408
9404
|
reflect the scores of any dependencies, transitive or otherwise.
|
|
9409
9405
|
|
|
9410
|
-
${missing.length ? `\n## Missing response\n\nAt least one package had no response or the purl was not canonical:\n\n${missing.map(purl =>
|
|
9406
|
+
${missing.length ? `\n## Missing response\n\nAt least one package had no response or the purl was not canonical:\n\n${missing.map(purl => `- ${purl}\n`).join('')}` : ''}
|
|
9411
9407
|
|
|
9412
9408
|
${blocks.join('\n\n\n')}
|
|
9413
9409
|
`.trim();
|
|
9414
9410
|
}
|
|
9415
9411
|
function generateTextReport(artifacts, missing) {
|
|
9416
|
-
const
|
|
9417
|
-
|
|
9418
|
-
|
|
9412
|
+
const o = [];
|
|
9413
|
+
o.push(`\n${vendor.yoctocolorsCjsExports.bold('Shallow Package Score')}\n`);
|
|
9414
|
+
o.push('Please note: The listed scores are ONLY for the package itself. It does NOT\n' + ' reflect the scores of any dependencies, transitive or otherwise.');
|
|
9419
9415
|
if (missing.length) {
|
|
9420
|
-
|
|
9416
|
+
o.push(`\nAt least one package had no response or the purl was not canonical:\n${missing.map(purl => `\n- ${vendor.yoctocolorsCjsExports.bold(purl)}`).join('')}`);
|
|
9421
9417
|
}
|
|
9422
|
-
const dupes = new Set();
|
|
9423
|
-
artifacts.
|
|
9418
|
+
const dupes = new Set();
|
|
9419
|
+
for (const artifact of artifacts.values()) {
|
|
9424
9420
|
const block = formatReportCard(artifact, true);
|
|
9425
9421
|
if (dupes.has(block)) {
|
|
9426
|
-
|
|
9422
|
+
// Omit duplicate blocks.
|
|
9423
|
+
continue;
|
|
9427
9424
|
}
|
|
9428
9425
|
dupes.add(block);
|
|
9429
|
-
|
|
9430
|
-
|
|
9431
|
-
}
|
|
9432
|
-
|
|
9433
|
-
return
|
|
9426
|
+
o.push('\n');
|
|
9427
|
+
o.push(block);
|
|
9428
|
+
}
|
|
9429
|
+
o.push('');
|
|
9430
|
+
return o.join('\n');
|
|
9434
9431
|
}
|
|
9435
9432
|
|
|
9436
9433
|
async function handlePurlsShallowScore({
|
|
@@ -9549,7 +9546,7 @@ async function run$k(argv, importMeta, {
|
|
|
9549
9546
|
});
|
|
9550
9547
|
}
|
|
9551
9548
|
|
|
9552
|
-
const description$3 = '
|
|
9549
|
+
const description$3 = 'Look up published package details';
|
|
9553
9550
|
const cmdPackage = {
|
|
9554
9551
|
description: description$3,
|
|
9555
9552
|
hidden: false,
|
|
@@ -9570,7 +9567,7 @@ const cmdPackage = {
|
|
|
9570
9567
|
argv,
|
|
9571
9568
|
description: description$3,
|
|
9572
9569
|
importMeta,
|
|
9573
|
-
name: parentName
|
|
9570
|
+
name: `${parentName} package`
|
|
9574
9571
|
});
|
|
9575
9572
|
}
|
|
9576
9573
|
};
|
|
@@ -9594,12 +9591,11 @@ async function runRawNpm(argv) {
|
|
|
9594
9591
|
}
|
|
9595
9592
|
|
|
9596
9593
|
const {
|
|
9597
|
-
DRY_RUN_BAILING_NOW: DRY_RUN_BAILING_NOW$j
|
|
9598
|
-
NPM
|
|
9594
|
+
DRY_RUN_BAILING_NOW: DRY_RUN_BAILING_NOW$j
|
|
9599
9595
|
} = constants;
|
|
9600
9596
|
const config$j = {
|
|
9601
9597
|
commandName: 'raw-npm',
|
|
9602
|
-
description:
|
|
9598
|
+
description: 'Run npm without the Socket wrapper',
|
|
9603
9599
|
hidden: false,
|
|
9604
9600
|
flags: {
|
|
9605
9601
|
...flags.commonFlags
|
|
@@ -9659,12 +9655,11 @@ async function runRawNpx(argv) {
|
|
|
9659
9655
|
}
|
|
9660
9656
|
|
|
9661
9657
|
const {
|
|
9662
|
-
DRY_RUN_BAILING_NOW: DRY_RUN_BAILING_NOW$i
|
|
9663
|
-
NPX
|
|
9658
|
+
DRY_RUN_BAILING_NOW: DRY_RUN_BAILING_NOW$i
|
|
9664
9659
|
} = constants;
|
|
9665
9660
|
const config$i = {
|
|
9666
9661
|
commandName: 'raw-npx',
|
|
9667
|
-
description:
|
|
9662
|
+
description: 'Run npx without the Socket wrapper',
|
|
9668
9663
|
hidden: false,
|
|
9669
9664
|
flags: {
|
|
9670
9665
|
...flags.commonFlags
|
|
@@ -10698,7 +10693,7 @@ async function run$d(argv, importMeta, {
|
|
|
10698
10693
|
await handleViewRepo(orgSlug, String(repoName), outputKind);
|
|
10699
10694
|
}
|
|
10700
10695
|
|
|
10701
|
-
const description$2 = '
|
|
10696
|
+
const description$2 = 'Manage registered repositories';
|
|
10702
10697
|
const cmdRepository = {
|
|
10703
10698
|
description: description$2,
|
|
10704
10699
|
async run(argv, importMeta, {
|
|
@@ -10744,14 +10739,14 @@ const {
|
|
|
10744
10739
|
} = constants;
|
|
10745
10740
|
const config$c = {
|
|
10746
10741
|
commandName: 'create',
|
|
10747
|
-
description: 'Create a scan',
|
|
10742
|
+
description: 'Create a new Socket scan and report',
|
|
10748
10743
|
hidden: false,
|
|
10749
10744
|
flags: {
|
|
10750
10745
|
...flags.commonFlags,
|
|
10751
10746
|
...flags.outputFlags,
|
|
10752
10747
|
autoManifest: {
|
|
10753
10748
|
type: 'boolean',
|
|
10754
|
-
description: 'Run `socket manifest auto` before collecting manifest files
|
|
10749
|
+
description: 'Run `socket manifest auto` before collecting manifest files. This is necessary for languages like Scala, Gradle, and Kotlin, See `socket manifest auto --help`.'
|
|
10755
10750
|
},
|
|
10756
10751
|
branch: {
|
|
10757
10752
|
type: 'string',
|
|
@@ -13655,7 +13650,7 @@ async function run$3(argv, importMeta, {
|
|
|
13655
13650
|
}
|
|
13656
13651
|
}
|
|
13657
13652
|
|
|
13658
|
-
const description$1 = '
|
|
13653
|
+
const description$1 = 'Manage Socket scans';
|
|
13659
13654
|
const cmdScan = {
|
|
13660
13655
|
description: description$1,
|
|
13661
13656
|
async run(argv, importMeta, {
|
|
@@ -13688,7 +13683,7 @@ const cmdScan = {
|
|
|
13688
13683
|
argv,
|
|
13689
13684
|
description: description$1,
|
|
13690
13685
|
importMeta,
|
|
13691
|
-
name: parentName
|
|
13686
|
+
name: `${parentName} scan`
|
|
13692
13687
|
});
|
|
13693
13688
|
}
|
|
13694
13689
|
};
|
|
@@ -13876,7 +13871,7 @@ const ECOSYSTEMS = new Set(['gem', 'golang', 'maven', 'npm', 'nuget', 'pypi']);
|
|
|
13876
13871
|
const TYPE_FILTERS = new Set(['anom', 'c', 'fp', 'joke', 'mal', 'secret', 'spy', 'tp', 'typo', 'u', 'vuln']);
|
|
13877
13872
|
const config$2 = {
|
|
13878
13873
|
commandName: 'threat-feed',
|
|
13879
|
-
description: '[
|
|
13874
|
+
description: '[Beta] View the threat feed',
|
|
13880
13875
|
hidden: false,
|
|
13881
13876
|
flags: {
|
|
13882
13877
|
...flags.commonFlags,
|
|
@@ -14231,7 +14226,7 @@ async function run$1(argv, importMeta, {
|
|
|
14231
14226
|
await handleUninstallCompletion(String(targetName));
|
|
14232
14227
|
}
|
|
14233
14228
|
|
|
14234
|
-
const description = '
|
|
14229
|
+
const description = 'Uninstall Socket CLI tab completion';
|
|
14235
14230
|
const cmdUninstall = {
|
|
14236
14231
|
description,
|
|
14237
14232
|
hidden: false,
|
|
@@ -14489,6 +14484,108 @@ async function run(argv, importMeta, {
|
|
|
14489
14484
|
}
|
|
14490
14485
|
}
|
|
14491
14486
|
|
|
14487
|
+
const rootCommands = {
|
|
14488
|
+
analytics: cmdAnalytics,
|
|
14489
|
+
'audit-log': cmdAuditLog,
|
|
14490
|
+
ci: cmdCI,
|
|
14491
|
+
cdxgen: cmdManifestCdxgen,
|
|
14492
|
+
config: cmdConfig,
|
|
14493
|
+
deps: cmdOrganizationDependencies,
|
|
14494
|
+
fix: cmdFix,
|
|
14495
|
+
install: cmdInstall,
|
|
14496
|
+
json: cmdJson,
|
|
14497
|
+
license: cmdOrganizationPolicyLicense,
|
|
14498
|
+
login: cmdLogin,
|
|
14499
|
+
logout: cmdLogout,
|
|
14500
|
+
manifest: cmdManifest,
|
|
14501
|
+
npm: cmdNpm,
|
|
14502
|
+
npx: cmdNpx,
|
|
14503
|
+
oops: cmdOops,
|
|
14504
|
+
optimize: cmdOptimize,
|
|
14505
|
+
organization: cmdOrganization,
|
|
14506
|
+
package: cmdPackage,
|
|
14507
|
+
'raw-npm': cmdRawNpm,
|
|
14508
|
+
'raw-npx': cmdRawNpx,
|
|
14509
|
+
repository: cmdRepository,
|
|
14510
|
+
scan: cmdScan,
|
|
14511
|
+
security: cmdOrganizationPolicySecurity,
|
|
14512
|
+
'threat-feed': cmdThreatFeed,
|
|
14513
|
+
uninstall: cmdUninstall,
|
|
14514
|
+
wrapper: cmdWrapper
|
|
14515
|
+
};
|
|
14516
|
+
const rootAliases = {
|
|
14517
|
+
audit: {
|
|
14518
|
+
description: cmdAuditLog.description,
|
|
14519
|
+
hidden: true,
|
|
14520
|
+
argv: ['audit-log']
|
|
14521
|
+
},
|
|
14522
|
+
auditLog: {
|
|
14523
|
+
description: cmdAuditLog.description,
|
|
14524
|
+
hidden: true,
|
|
14525
|
+
argv: ['audit-log']
|
|
14526
|
+
},
|
|
14527
|
+
auditLogs: {
|
|
14528
|
+
description: cmdAuditLog.description,
|
|
14529
|
+
hidden: true,
|
|
14530
|
+
argv: ['audit-log']
|
|
14531
|
+
},
|
|
14532
|
+
['audit-logs']: {
|
|
14533
|
+
description: cmdAuditLog.description,
|
|
14534
|
+
hidden: true,
|
|
14535
|
+
argv: ['audit-log']
|
|
14536
|
+
},
|
|
14537
|
+
feed: {
|
|
14538
|
+
description: cmdThreatFeed.description,
|
|
14539
|
+
hidden: true,
|
|
14540
|
+
argv: ['threat-feed']
|
|
14541
|
+
},
|
|
14542
|
+
org: {
|
|
14543
|
+
description: cmdOrganization.description,
|
|
14544
|
+
hidden: true,
|
|
14545
|
+
argv: ['organization']
|
|
14546
|
+
},
|
|
14547
|
+
orgs: {
|
|
14548
|
+
description: cmdOrganization.description,
|
|
14549
|
+
hidden: true,
|
|
14550
|
+
argv: ['organization']
|
|
14551
|
+
},
|
|
14552
|
+
organizations: {
|
|
14553
|
+
description: cmdOrganization.description,
|
|
14554
|
+
hidden: true,
|
|
14555
|
+
argv: ['organization']
|
|
14556
|
+
},
|
|
14557
|
+
organisation: {
|
|
14558
|
+
description: cmdOrganization.description,
|
|
14559
|
+
hidden: true,
|
|
14560
|
+
argv: ['organization']
|
|
14561
|
+
},
|
|
14562
|
+
organisations: {
|
|
14563
|
+
description: cmdOrganization.description,
|
|
14564
|
+
hidden: true,
|
|
14565
|
+
argv: ['organization']
|
|
14566
|
+
},
|
|
14567
|
+
pkg: {
|
|
14568
|
+
description: cmdPackage.description,
|
|
14569
|
+
hidden: true,
|
|
14570
|
+
argv: ['package']
|
|
14571
|
+
},
|
|
14572
|
+
repo: {
|
|
14573
|
+
description: cmdRepository.description,
|
|
14574
|
+
hidden: true,
|
|
14575
|
+
argv: ['repos']
|
|
14576
|
+
},
|
|
14577
|
+
repos: {
|
|
14578
|
+
description: cmdRepository.description,
|
|
14579
|
+
hidden: true,
|
|
14580
|
+
argv: ['repos']
|
|
14581
|
+
},
|
|
14582
|
+
repositories: {
|
|
14583
|
+
description: cmdRepository.description,
|
|
14584
|
+
hidden: true,
|
|
14585
|
+
argv: ['repos']
|
|
14586
|
+
}
|
|
14587
|
+
};
|
|
14588
|
+
|
|
14492
14589
|
const __filename$1 = require$$0.fileURLToPath(require('node:url').pathToFileURL(__filename).href);
|
|
14493
14590
|
void (async () => {
|
|
14494
14591
|
const registryUrl = vendor.registryUrl();
|
|
@@ -14505,123 +14602,8 @@ void (async () => {
|
|
|
14505
14602
|
version: constants.ENV.INLINED_SOCKET_CLI_VERSION
|
|
14506
14603
|
});
|
|
14507
14604
|
try {
|
|
14508
|
-
await utils.meowWithSubcommands({
|
|
14509
|
-
|
|
14510
|
-
'audit-log': cmdAuditLog,
|
|
14511
|
-
ci: cmdCI,
|
|
14512
|
-
config: cmdConfig,
|
|
14513
|
-
fix: cmdFix,
|
|
14514
|
-
install: cmdInstall,
|
|
14515
|
-
json: cmdJson,
|
|
14516
|
-
login: cmdLogin,
|
|
14517
|
-
logout: cmdLogout,
|
|
14518
|
-
npm: cmdNpm,
|
|
14519
|
-
npx: cmdNpx,
|
|
14520
|
-
oops: cmdOops,
|
|
14521
|
-
optimize: cmdOptimize,
|
|
14522
|
-
organization: cmdOrganization,
|
|
14523
|
-
package: cmdPackage,
|
|
14524
|
-
manifest: cmdManifest,
|
|
14525
|
-
scan: cmdScan,
|
|
14526
|
-
'raw-npm': cmdRawNpm,
|
|
14527
|
-
'raw-npx': cmdRawNpx,
|
|
14528
|
-
repos: cmdRepository,
|
|
14529
|
-
'threat-feed': cmdThreatFeed,
|
|
14530
|
-
uninstall: cmdUninstall,
|
|
14531
|
-
wrapper: cmdWrapper
|
|
14532
|
-
}, {
|
|
14533
|
-
aliases: {
|
|
14534
|
-
audit: {
|
|
14535
|
-
description: cmdAuditLog.description,
|
|
14536
|
-
hidden: true,
|
|
14537
|
-
argv: ['audit-log']
|
|
14538
|
-
},
|
|
14539
|
-
auditLog: {
|
|
14540
|
-
description: cmdAuditLog.description,
|
|
14541
|
-
hidden: true,
|
|
14542
|
-
argv: ['audit-log']
|
|
14543
|
-
},
|
|
14544
|
-
auditLogs: {
|
|
14545
|
-
description: cmdAuditLog.description,
|
|
14546
|
-
hidden: true,
|
|
14547
|
-
argv: ['audit-log']
|
|
14548
|
-
},
|
|
14549
|
-
['audit-logs']: {
|
|
14550
|
-
description: cmdAuditLog.description,
|
|
14551
|
-
hidden: true,
|
|
14552
|
-
argv: ['audit-log']
|
|
14553
|
-
},
|
|
14554
|
-
cdxgen: {
|
|
14555
|
-
description: cmdManifestCdxgen.description,
|
|
14556
|
-
hidden: true,
|
|
14557
|
-
argv: ['manifest', 'cdxgen']
|
|
14558
|
-
},
|
|
14559
|
-
deps: {
|
|
14560
|
-
description: cmdOrganizationDependencies.description,
|
|
14561
|
-
hidden: true,
|
|
14562
|
-
argv: ['dependencies']
|
|
14563
|
-
},
|
|
14564
|
-
feed: {
|
|
14565
|
-
description: cmdThreatFeed.description,
|
|
14566
|
-
hidden: true,
|
|
14567
|
-
argv: ['threat-feed']
|
|
14568
|
-
},
|
|
14569
|
-
license: {
|
|
14570
|
-
description: cmdOrganizationPolicyLicense.description,
|
|
14571
|
-
hidden: true,
|
|
14572
|
-
argv: ['organization', 'policy', 'license']
|
|
14573
|
-
},
|
|
14574
|
-
org: {
|
|
14575
|
-
description: cmdOrganization.description,
|
|
14576
|
-
hidden: true,
|
|
14577
|
-
argv: ['organization']
|
|
14578
|
-
},
|
|
14579
|
-
orgs: {
|
|
14580
|
-
description: cmdOrganization.description,
|
|
14581
|
-
hidden: true,
|
|
14582
|
-
argv: ['organization']
|
|
14583
|
-
},
|
|
14584
|
-
organizations: {
|
|
14585
|
-
description: cmdOrganization.description,
|
|
14586
|
-
hidden: true,
|
|
14587
|
-
argv: ['organization']
|
|
14588
|
-
},
|
|
14589
|
-
organisation: {
|
|
14590
|
-
description: cmdOrganization.description,
|
|
14591
|
-
hidden: true,
|
|
14592
|
-
argv: ['organization']
|
|
14593
|
-
},
|
|
14594
|
-
organisations: {
|
|
14595
|
-
description: cmdOrganization.description,
|
|
14596
|
-
hidden: true,
|
|
14597
|
-
argv: ['organization']
|
|
14598
|
-
},
|
|
14599
|
-
pkg: {
|
|
14600
|
-
description: cmdPackage.description,
|
|
14601
|
-
hidden: true,
|
|
14602
|
-
argv: ['package']
|
|
14603
|
-
},
|
|
14604
|
-
repo: {
|
|
14605
|
-
description: cmdRepository.description,
|
|
14606
|
-
hidden: true,
|
|
14607
|
-
argv: ['repos']
|
|
14608
|
-
},
|
|
14609
|
-
repository: {
|
|
14610
|
-
description: cmdRepository.description,
|
|
14611
|
-
hidden: true,
|
|
14612
|
-
argv: ['repos']
|
|
14613
|
-
},
|
|
14614
|
-
repositories: {
|
|
14615
|
-
description: cmdRepository.description,
|
|
14616
|
-
hidden: true,
|
|
14617
|
-
argv: ['repos']
|
|
14618
|
-
},
|
|
14619
|
-
security: {
|
|
14620
|
-
description: cmdOrganizationPolicySecurity.description,
|
|
14621
|
-
hidden: true,
|
|
14622
|
-
argv: ['organization', 'policy', 'security']
|
|
14623
|
-
}
|
|
14624
|
-
},
|
|
14605
|
+
await utils.meowWithSubcommands(rootCommands, {
|
|
14606
|
+
aliases: rootAliases,
|
|
14625
14607
|
argv: process.argv.slice(2),
|
|
14626
14608
|
// Lazily access constants.SOCKET_CLI_BIN_NAME.
|
|
14627
14609
|
name: constants.SOCKET_CLI_BIN_NAME,
|
|
@@ -14655,8 +14637,9 @@ void (async () => {
|
|
|
14655
14637
|
|
|
14656
14638
|
// Try to parse the flags, find out if --json is set.
|
|
14657
14639
|
const isJson = (() => {
|
|
14658
|
-
const cli = vendor.meow(
|
|
14640
|
+
const cli = vendor.meow({
|
|
14659
14641
|
argv: process.argv.slice(2),
|
|
14642
|
+
// Prevent meow from potentially exiting early.
|
|
14660
14643
|
autoHelp: false,
|
|
14661
14644
|
autoVersion: false,
|
|
14662
14645
|
flags: {},
|
|
@@ -14673,7 +14656,8 @@ void (async () => {
|
|
|
14673
14656
|
cause: errorMessage
|
|
14674
14657
|
}));
|
|
14675
14658
|
} else {
|
|
14676
|
-
|
|
14659
|
+
// Bump below any spinner.
|
|
14660
|
+
logger.logger.error('\n');
|
|
14677
14661
|
logger.logger.fail(utils.failMsgWithBadge(errorTitle, errorMessage));
|
|
14678
14662
|
if (errorBody) {
|
|
14679
14663
|
require$$6.debugDir('inspect', {
|
|
@@ -14684,5 +14668,5 @@ void (async () => {
|
|
|
14684
14668
|
await utils.captureException(e);
|
|
14685
14669
|
}
|
|
14686
14670
|
})();
|
|
14687
|
-
//# debugId=
|
|
14671
|
+
//# debugId=e1126a10-9fcb-4c15-b22c-219ee03915f8
|
|
14688
14672
|
//# sourceMappingURL=cli.js.map
|