@socketsecurity/cli-with-sentry 1.1.25 → 2.0.0
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/CHANGELOG.md +51 -218
- package/README.md +41 -74
- package/dist/cli.js.bz +0 -0
- package/dist/cli.js.bz.sha256 +1 -0
- package/dist/index.js +2 -0
- package/package.json +31 -274
- package/bin/cli.js +0 -52
- package/bin/npm-cli.js +0 -29
- package/bin/npx-cli.js +0 -29
- package/bin/pnpm-cli.js +0 -29
- package/bin/yarn-cli.js +0 -29
- package/dist/cli.js +0 -14999
- package/dist/cli.js.map +0 -1
- package/dist/constants.js +0 -845
- package/dist/constants.js.map +0 -1
- package/dist/flags.js +0 -212
- package/dist/flags.js.map +0 -1
- package/dist/init.gradle +0 -250
- package/dist/instrument-with-sentry.js +0 -44
- package/dist/instrument-with-sentry.js.map +0 -1
- package/dist/npm-cli.js +0 -30
- package/dist/npm-cli.js.map +0 -1
- package/dist/npx-cli.js +0 -26
- package/dist/npx-cli.js.map +0 -1
- package/dist/pnpm-cli.js +0 -30
- package/dist/pnpm-cli.js.map +0 -1
- package/dist/shadow-npm-bin.js +0 -8
- package/dist/shadow-npm-bin.js.map +0 -1
- package/dist/shadow-npm-bin2.js +0 -102
- package/dist/shadow-npm-bin2.js.map +0 -1
- package/dist/shadow-npm-inject.js +0 -307
- package/dist/shadow-npm-inject.js.map +0 -1
- package/dist/shadow-npx-bin.js +0 -12
- package/dist/shadow-npx-bin.js.map +0 -1
- package/dist/shadow-pnpm-bin.js +0 -8
- package/dist/shadow-pnpm-bin.js.map +0 -1
- package/dist/shadow-pnpm-bin2.js +0 -300
- package/dist/shadow-pnpm-bin2.js.map +0 -1
- package/dist/shadow-yarn-bin.js +0 -96
- package/dist/shadow-yarn-bin.js.map +0 -1
- 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 -10
- package/dist/types/commands/analytics/handle-analytics.d.mts.map +0 -1
- package/dist/types/commands/analytics/output-analytics.d.mts +0 -29
- 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 -9
- 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 -9
- package/dist/types/commands/config/cmd-config-get.d.mts.map +0 -1
- package/dist/types/commands/config/cmd-config-list.d.mts +0 -9
- 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/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/env-helpers.d.mts +0 -26
- package/dist/types/commands/fix/env-helpers.d.mts.map +0 -1
- package/dist/types/commands/fix/git.d.mts +0 -13
- package/dist/types/commands/fix/git.d.mts.map +0 -1
- package/dist/types/commands/fix/handle-fix.d.mts +0 -20
- package/dist/types/commands/fix/handle-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/pull-request.d.mts +0 -31
- package/dist/types/commands/fix/pull-request.d.mts.map +0 -1
- package/dist/types/commands/fix/types.d.mts +0 -21
- package/dist/types/commands/fix/types.d.mts.map +0 -1
- package/dist/types/commands/install/cmd-install-completion.d.mts +0 -9
- 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 -9
- 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 -9
- package/dist/types/commands/logout/cmd-logout.d.mts.map +0 -1
- package/dist/types/commands/manifest/cmd-manifest-auto.d.mts +0 -9
- package/dist/types/commands/manifest/cmd-manifest-auto.d.mts.map +0 -1
- package/dist/types/commands/manifest/cmd-manifest-cdxgen.d.mts +0 -9
- package/dist/types/commands/manifest/cmd-manifest-cdxgen.d.mts.map +0 -1
- package/dist/types/commands/manifest/cmd-manifest-conda.d.mts +0 -9
- package/dist/types/commands/manifest/cmd-manifest-conda.d.mts.map +0 -1
- package/dist/types/commands/manifest/cmd-manifest-gradle.d.mts +0 -9
- package/dist/types/commands/manifest/cmd-manifest-gradle.d.mts.map +0 -1
- package/dist/types/commands/manifest/cmd-manifest-kotlin.d.mts +0 -9
- package/dist/types/commands/manifest/cmd-manifest-kotlin.d.mts.map +0 -1
- package/dist/types/commands/manifest/cmd-manifest-scala.d.mts +0 -9
- package/dist/types/commands/manifest/cmd-manifest-scala.d.mts.map +0 -1
- package/dist/types/commands/manifest/cmd-manifest-setup.d.mts +0 -9
- package/dist/types/commands/manifest/cmd-manifest-setup.d.mts.map +0 -1
- package/dist/types/commands/manifest/cmd-manifest.d.mts +0 -9
- 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 -6
- 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 -9
- package/dist/types/commands/npx/cmd-npx.d.mts.map +0 -1
- package/dist/types/commands/oops/cmd-oops.d.mts +0 -9
- 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 -9
- 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 -20
- 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/patch/cmd-patch.d.mts +0 -10
- package/dist/types/commands/patch/cmd-patch.d.mts.map +0 -1
- package/dist/types/commands/patch/handle-patch.d.mts +0 -12
- package/dist/types/commands/patch/handle-patch.d.mts.map +0 -1
- package/dist/types/commands/patch/manifest-schema.d.mts +0 -34
- package/dist/types/commands/patch/manifest-schema.d.mts.map +0 -1
- package/dist/types/commands/patch/output-patch-result.d.mts +0 -5
- package/dist/types/commands/patch/output-patch-result.d.mts.map +0 -1
- package/dist/types/commands/pnpm/cmd-pnpm.d.mts +0 -10
- package/dist/types/commands/pnpm/cmd-pnpm.d.mts.map +0 -1
- package/dist/types/commands/raw-npm/cmd-raw-npm.d.mts +0 -9
- 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 -9
- 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 -12
- 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 -5
- 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/repository/types.d.mts +0 -2
- package/dist/types/commands/repository/types.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 -4
- package/dist/types/commands/scan/cmd-scan-list.d.mts.map +0 -1
- package/dist/types/commands/scan/cmd-scan-metadata.d.mts +0 -4
- 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 -4
- package/dist/types/commands/scan/cmd-scan-report.d.mts.map +0 -1
- package/dist/types/commands/scan/cmd-scan-setup.d.mts +0 -9
- package/dist/types/commands/scan/cmd-scan-setup.d.mts.map +0 -1
- package/dist/types/commands/scan/cmd-scan-view.d.mts +0 -4
- 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 -10
- package/dist/types/commands/scan/fetch-supported-scan-file-names.d.mts.map +0 -1
- package/dist/types/commands/scan/finalize-tier1-scan.d.mts +0 -12
- package/dist/types/commands/scan/finalize-tier1-scan.d.mts.map +0 -1
- package/dist/types/commands/scan/generate-report.d.mts +0 -44
- 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 -29
- 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 -12
- package/dist/types/commands/scan/handle-scan-reach.d.mts.map +0 -1
- package/dist/types/commands/scan/handle-scan-report.d.mts +0 -14
- 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 -10
- 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 -7
- package/dist/types/commands/scan/output-scan-reach.d.mts.map +0 -1
- package/dist/types/commands/scan/output-scan-report.d.mts +0 -22
- 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/perform-reachability-analysis.d.mts +0 -27
- package/dist/types/commands/scan/perform-reachability-analysis.d.mts.map +0 -1
- package/dist/types/commands/scan/reachability-flags.d.mts +0 -3
- package/dist/types/commands/scan/reachability-flags.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-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/scan/types.d.mts +0 -3
- package/dist/types/commands/scan/types.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 -8
- 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 -9
- 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/commands/yarn/cmd-yarn.d.mts +0 -10
- package/dist/types/commands/yarn/cmd-yarn.d.mts.map +0 -1
- package/dist/types/commands.d.mts +0 -203
- package/dist/types/commands.d.mts.map +0 -1
- package/dist/types/constants.d.mts +0 -299
- package/dist/types/constants.d.mts.map +0 -1
- package/dist/types/flags.d.mts +0 -18
- 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/npm-cli.d.mts +0 -3
- package/dist/types/npm-cli.d.mts.map +0 -1
- package/dist/types/npx-cli.d.mts +0 -3
- package/dist/types/npx-cli.d.mts.map +0 -1
- package/dist/types/pnpm-cli.d.mts +0 -3
- package/dist/types/pnpm-cli.d.mts.map +0 -1
- package/dist/types/sea/bootstrap.d.mts +0 -2
- package/dist/types/sea/bootstrap.d.mts.map +0 -1
- package/dist/types/sea/build-sea.d.mts +0 -27
- package/dist/types/sea/build-sea.d.mts.map +0 -1
- package/dist/types/shadow/common.d.mts +0 -23
- package/dist/types/shadow/common.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 -24
- package/dist/types/shadow/npm/arborist-helpers.d.mts.map +0 -1
- package/dist/types/shadow/npm/bin.d.mts +0 -5
- 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/paths.d.mts +0 -6
- package/dist/types/shadow/npm/paths.d.mts.map +0 -1
- package/dist/types/shadow/npm-base.d.mts +0 -11
- package/dist/types/shadow/npm-base.d.mts.map +0 -1
- package/dist/types/shadow/npx/bin.d.mts +0 -5
- package/dist/types/shadow/npx/bin.d.mts.map +0 -1
- package/dist/types/shadow/pnpm/bin.d.mts +0 -10
- package/dist/types/shadow/pnpm/bin.d.mts.map +0 -1
- package/dist/types/shadow/stdio-ipc.d.mts +0 -7
- package/dist/types/shadow/stdio-ipc.d.mts.map +0 -1
- package/dist/types/shadow/yarn/bin.d.mts +0 -10
- package/dist/types/shadow/yarn/bin.d.mts.map +0 -1
- package/dist/types/test/json-output-validation.d.mts +0 -37
- package/dist/types/test/json-output-validation.d.mts.map +0 -1
- package/dist/types/test/mocks/socket-auth.d.mts +0 -88
- package/dist/types/test/mocks/socket-auth.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 -21
- 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 -27
- package/dist/types/utils/alerts-map.d.mts.map +0 -1
- package/dist/types/utils/api.d.mts +0 -44
- 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 -50
- package/dist/types/utils/cmd.d.mts.map +0 -1
- package/dist/types/utils/coana.d.mts +0 -2
- 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 -34
- package/dist/types/utils/config.d.mts.map +0 -1
- package/dist/types/utils/cve-to-ghsa.d.mts +0 -6
- package/dist/types/utils/cve-to-ghsa.d.mts.map +0 -1
- package/dist/types/utils/debug.d.mts +0 -45
- package/dist/types/utils/debug.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/dlx-binary.d.mts +0 -58
- package/dist/types/utils/dlx-binary.d.mts.map +0 -1
- package/dist/types/utils/dlx-detection.d.mts +0 -29
- package/dist/types/utils/dlx-detection.d.mts.map +0 -1
- package/dist/types/utils/dlx.d.mts +0 -36
- package/dist/types/utils/dlx.d.mts.map +0 -1
- package/dist/types/utils/ecosystem.d.mts +0 -20
- package/dist/types/utils/ecosystem.d.mts.map +0 -1
- package/dist/types/utils/errors.d.mts +0 -62
- package/dist/types/utils/errors.d.mts.map +0 -1
- package/dist/types/utils/extract-names.d.mts +0 -15
- package/dist/types/utils/extract-names.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/filter-config.d.mts +0 -5
- package/dist/types/utils/filter-config.d.mts.map +0 -1
- package/dist/types/utils/fs.d.mts +0 -8
- 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 -35
- package/dist/types/utils/git.d.mts.map +0 -1
- package/dist/types/utils/github.d.mts +0 -38
- package/dist/types/utils/github.d.mts.map +0 -1
- package/dist/types/utils/glob.d.mts +0 -15
- 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 -27
- package/dist/types/utils/markdown.d.mts.map +0 -1
- package/dist/types/utils/meow-with-subcommands.d.mts +0 -83
- 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 -8
- 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/npm-spec.d.mts +0 -57
- package/dist/types/utils/npm-spec.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/organization.d.mts +0 -5
- package/dist/types/utils/organization.d.mts.map +0 -1
- package/dist/types/utils/output-formatting.d.mts +0 -20
- 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-paths.d.mts +0 -5
- package/dist/types/utils/pnpm-paths.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-to-ghsa.d.mts +0 -6
- package/dist/types/utils/purl-to-ghsa.d.mts.map +0 -1
- package/dist/types/utils/purl.d.mts +0 -71
- package/dist/types/utils/purl.d.mts.map +0 -1
- package/dist/types/utils/requirements.d.mts +0 -125
- package/dist/types/utils/requirements.d.mts.map +0 -1
- package/dist/types/utils/sdk.d.mts +0 -17
- package/dist/types/utils/sdk.d.mts.map +0 -1
- package/dist/types/utils/semver.d.mts +0 -7
- 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/shadow-links.d.mts +0 -5
- package/dist/types/utils/shadow-links.d.mts.map +0 -1
- package/dist/types/utils/socket-json.d.mts +0 -59
- package/dist/types/utils/socket-json.d.mts.map +0 -1
- package/dist/types/utils/socket-package-alert.d.mts +0 -80
- package/dist/types/utils/socket-package-alert.d.mts.map +0 -1
- package/dist/types/utils/socket-url.d.mts +0 -8
- package/dist/types/utils/socket-url.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 -14
- package/dist/types/utils/strings.d.mts.map +0 -1
- package/dist/types/utils/terminal-link.d.mts +0 -52
- package/dist/types/utils/terminal-link.d.mts.map +0 -1
- package/dist/types/utils/tildify.d.mts +0 -2
- package/dist/types/utils/tildify.d.mts.map +0 -1
- package/dist/types/utils/translations.d.mts +0 -617
- 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/types/utils/yarn-paths.d.mts +0 -5
- package/dist/types/utils/yarn-paths.d.mts.map +0 -1
- package/dist/types/utils/yarn-version.d.mts +0 -2
- package/dist/types/utils/yarn-version.d.mts.map +0 -1
- package/dist/types/yarn-cli.d.mts +0 -3
- package/dist/types/yarn-cli.d.mts.map +0 -1
- package/dist/utils.js +0 -6146
- package/dist/utils.js.map +0 -1
- package/dist/vendor.js +0 -162074
- package/dist/yarn-cli.js +0 -30
- package/dist/yarn-cli.js.map +0 -1
- package/external/@socketsecurity/registry/LICENSE +0 -21
- package/external/@socketsecurity/registry/README.md +0 -9
- package/external/@socketsecurity/registry/extensions.json +0 -28
- package/external/@socketsecurity/registry/external/@inquirer/confirm.js +0 -3165
- package/external/@socketsecurity/registry/external/@inquirer/input.js +0 -3202
- package/external/@socketsecurity/registry/external/@inquirer/password.js +0 -3307
- package/external/@socketsecurity/registry/external/@inquirer/search.js +0 -3519
- package/external/@socketsecurity/registry/external/@inquirer/select.js +0 -3655
- package/external/@socketsecurity/registry/external/@npmcli/package-json/index.js +0 -21406
- package/external/@socketsecurity/registry/external/@npmcli/package-json/lib/read-package.js +0 -183
- package/external/@socketsecurity/registry/external/@npmcli/package-json/lib/sort.js +0 -274
- package/external/@socketsecurity/registry/external/@npmcli/promise-spawn.js +0 -704
- package/external/@socketsecurity/registry/external/@socketregistry/is-unicode-supported.js +0 -54
- package/external/@socketsecurity/registry/external/@socketregistry/packageurl-js.js +0 -4516
- package/external/@socketsecurity/registry/external/@socketregistry/yocto-spinner.js +0 -453
- package/external/@socketsecurity/registry/external/@yarnpkg/extensions.js +0 -1406
- package/external/@socketsecurity/registry/external/browserslist.js +0 -20496
- package/external/@socketsecurity/registry/external/cacache.js +0 -16208
- package/external/@socketsecurity/registry/external/debug.js +0 -1163
- package/external/@socketsecurity/registry/external/fast-glob.js +0 -7994
- package/external/@socketsecurity/registry/external/fast-sort.js +0 -181
- package/external/@socketsecurity/registry/external/libnpmpack.js +0 -106271
- package/external/@socketsecurity/registry/external/make-fetch-happen.js +0 -38997
- package/external/@socketsecurity/registry/external/normalize-package-data.js +0 -5343
- package/external/@socketsecurity/registry/external/npm-package-arg.js +0 -5773
- package/external/@socketsecurity/registry/external/pacote.js +0 -74109
- package/external/@socketsecurity/registry/external/picomatch.js +0 -2307
- package/external/@socketsecurity/registry/external/semver.js +0 -2618
- package/external/@socketsecurity/registry/external/signal-exit.js +0 -336
- package/external/@socketsecurity/registry/external/spdx-correct.js +0 -1457
- package/external/@socketsecurity/registry/external/spdx-expression-parse.js +0 -1043
- package/external/@socketsecurity/registry/external/streaming-iterables.js +0 -326
- package/external/@socketsecurity/registry/external/validate-npm-package-name.js +0 -108
- package/external/@socketsecurity/registry/external/which.js +0 -405
- package/external/@socketsecurity/registry/external/yoctocolors-cjs.js +0 -101
- package/external/@socketsecurity/registry/index.js +0 -31
- package/external/@socketsecurity/registry/lib/agent.js +0 -390
- package/external/@socketsecurity/registry/lib/arrays.js +0 -89
- package/external/@socketsecurity/registry/lib/bin.js +0 -650
- package/external/@socketsecurity/registry/lib/constants/abort-controller.js +0 -15
- package/external/@socketsecurity/registry/lib/constants/abort-signal.js +0 -27
- package/external/@socketsecurity/registry/lib/constants/at-latest.js +0 -3
- package/external/@socketsecurity/registry/lib/constants/biome-json.js +0 -3
- package/external/@socketsecurity/registry/lib/constants/bun-lock.js +0 -3
- package/external/@socketsecurity/registry/lib/constants/bun-lockb.js +0 -3
- package/external/@socketsecurity/registry/lib/constants/bun.js +0 -3
- package/external/@socketsecurity/registry/lib/constants/ci.js +0 -3
- package/external/@socketsecurity/registry/lib/constants/column-limit.js +0 -3
- package/external/@socketsecurity/registry/lib/constants/copy-left-licenses.js +0 -27
- package/external/@socketsecurity/registry/lib/constants/darwin.js +0 -3
- package/external/@socketsecurity/registry/lib/constants/dot-git-dir.js +0 -3
- package/external/@socketsecurity/registry/lib/constants/dot-package-lock-json.js +0 -3
- package/external/@socketsecurity/registry/lib/constants/dot-socket-dir.js +0 -3
- package/external/@socketsecurity/registry/lib/constants/empty-file.js +0 -3
- package/external/@socketsecurity/registry/lib/constants/empty-value.js +0 -3
- package/external/@socketsecurity/registry/lib/constants/env.js +0 -59
- package/external/@socketsecurity/registry/lib/constants/eslint-config-js.js +0 -3
- package/external/@socketsecurity/registry/lib/constants/esnext.js +0 -3
- package/external/@socketsecurity/registry/lib/constants/exec-path.js +0 -3
- package/external/@socketsecurity/registry/lib/constants/ext-cjs.js +0 -3
- package/external/@socketsecurity/registry/lib/constants/ext-cmd.js +0 -3
- package/external/@socketsecurity/registry/lib/constants/ext-cts.js +0 -3
- package/external/@socketsecurity/registry/lib/constants/ext-dts.js +0 -3
- package/external/@socketsecurity/registry/lib/constants/ext-js.js +0 -3
- package/external/@socketsecurity/registry/lib/constants/ext-json.js +0 -3
- package/external/@socketsecurity/registry/lib/constants/ext-lock.js +0 -3
- package/external/@socketsecurity/registry/lib/constants/ext-lockb.js +0 -3
- package/external/@socketsecurity/registry/lib/constants/ext-md.js +0 -3
- package/external/@socketsecurity/registry/lib/constants/ext-mjs.js +0 -3
- package/external/@socketsecurity/registry/lib/constants/ext-mts.js +0 -3
- package/external/@socketsecurity/registry/lib/constants/ext-ps1.js +0 -3
- package/external/@socketsecurity/registry/lib/constants/ext-yaml.js +0 -3
- package/external/@socketsecurity/registry/lib/constants/ext-yml.js +0 -3
- package/external/@socketsecurity/registry/lib/constants/extensions-json.js +0 -3
- package/external/@socketsecurity/registry/lib/constants/extensions.js +0 -3
- package/external/@socketsecurity/registry/lib/constants/get-ipc.js +0 -10
- package/external/@socketsecurity/registry/lib/constants/gitignore.js +0 -3
- package/external/@socketsecurity/registry/lib/constants/index.js +0 -139
- package/external/@socketsecurity/registry/lib/constants/ipc-handler.js +0 -19
- package/external/@socketsecurity/registry/lib/constants/ipc-object.js +0 -6
- package/external/@socketsecurity/registry/lib/constants/ipc-promise.js +0 -47
- package/external/@socketsecurity/registry/lib/constants/ipc-target.js +0 -3
- package/external/@socketsecurity/registry/lib/constants/k-internals-symbol.js +0 -3
- package/external/@socketsecurity/registry/lib/constants/latest.js +0 -3
- package/external/@socketsecurity/registry/lib/constants/license-glob-recursive.js +0 -3
- package/external/@socketsecurity/registry/lib/constants/license-glob.js +0 -3
- package/external/@socketsecurity/registry/lib/constants/license-original-glob-recursive.js +0 -3
- package/external/@socketsecurity/registry/lib/constants/license-original-glob.js +0 -3
- package/external/@socketsecurity/registry/lib/constants/license-original.js +0 -3
- package/external/@socketsecurity/registry/lib/constants/license.js +0 -3
- package/external/@socketsecurity/registry/lib/constants/lifecycle-script-names.js +0 -18
- package/external/@socketsecurity/registry/lib/constants/loop-sentinel.js +0 -3
- package/external/@socketsecurity/registry/lib/constants/maintained-node-versions.js +0 -47
- package/external/@socketsecurity/registry/lib/constants/manifest-json.js +0 -3
- package/external/@socketsecurity/registry/lib/constants/mit.js +0 -3
- package/external/@socketsecurity/registry/lib/constants/node-auth-token.js +0 -3
- package/external/@socketsecurity/registry/lib/constants/node-debug-flags.js +0 -9
- package/external/@socketsecurity/registry/lib/constants/node-env.js +0 -3
- package/external/@socketsecurity/registry/lib/constants/node-harden-flags.js +0 -29
- package/external/@socketsecurity/registry/lib/constants/node-modules-glob-recursive.js +0 -3
- package/external/@socketsecurity/registry/lib/constants/node-modules.js +0 -3
- package/external/@socketsecurity/registry/lib/constants/node-no-warnings-flags.js +0 -16
- package/external/@socketsecurity/registry/lib/constants/node-version.js +0 -3
- package/external/@socketsecurity/registry/lib/constants/npm-exec-path.js +0 -5
- package/external/@socketsecurity/registry/lib/constants/npm-real-exec-path.js +0 -6
- package/external/@socketsecurity/registry/lib/constants/npm-shrinkwrap-json.js +0 -3
- package/external/@socketsecurity/registry/lib/constants/npm.js +0 -3
- package/external/@socketsecurity/registry/lib/constants/npx.js +0 -3
- package/external/@socketsecurity/registry/lib/constants/overrides.js +0 -3
- package/external/@socketsecurity/registry/lib/constants/package-default-node-range.js +0 -6
- package/external/@socketsecurity/registry/lib/constants/package-default-socket-categories.js +0 -3
- package/external/@socketsecurity/registry/lib/constants/package-default-version.js +0 -3
- package/external/@socketsecurity/registry/lib/constants/package-extensions.js +0 -47
- package/external/@socketsecurity/registry/lib/constants/package-json.js +0 -3
- package/external/@socketsecurity/registry/lib/constants/package-lock-json.js +0 -3
- package/external/@socketsecurity/registry/lib/constants/packument-cache.js +0 -3
- package/external/@socketsecurity/registry/lib/constants/pacote-cache-path.js +0 -9
- package/external/@socketsecurity/registry/lib/constants/pnpm-exec-path.js +0 -5
- package/external/@socketsecurity/registry/lib/constants/pnpm-lock-yaml.js +0 -3
- package/external/@socketsecurity/registry/lib/constants/pnpm.js +0 -3
- package/external/@socketsecurity/registry/lib/constants/pre-commit.js +0 -3
- package/external/@socketsecurity/registry/lib/constants/readme-glob-recursive.js +0 -3
- package/external/@socketsecurity/registry/lib/constants/readme-glob.js +0 -3
- package/external/@socketsecurity/registry/lib/constants/readme-md.js +0 -3
- package/external/@socketsecurity/registry/lib/constants/registry-scope-delimiter.js +0 -3
- package/external/@socketsecurity/registry/lib/constants/registry.js +0 -3
- package/external/@socketsecurity/registry/lib/constants/resolutions.js +0 -3
- package/external/@socketsecurity/registry/lib/constants/socket-github-org.js +0 -3
- package/external/@socketsecurity/registry/lib/constants/socket-ipc-handshake.js +0 -3
- package/external/@socketsecurity/registry/lib/constants/socket-override-scope.js +0 -3
- package/external/@socketsecurity/registry/lib/constants/socket-public-api-token.js +0 -3
- package/external/@socketsecurity/registry/lib/constants/socket-registry-npm-org.js +0 -3
- package/external/@socketsecurity/registry/lib/constants/socket-registry-package-name.js +0 -3
- package/external/@socketsecurity/registry/lib/constants/socket-registry-repo-name.js +0 -3
- package/external/@socketsecurity/registry/lib/constants/socket-registry-scope.js +0 -3
- package/external/@socketsecurity/registry/lib/constants/socket-security-scope.js +0 -3
- package/external/@socketsecurity/registry/lib/constants/spinner.js +0 -4
- package/external/@socketsecurity/registry/lib/constants/supports-node-compile-cache-api.js +0 -8
- package/external/@socketsecurity/registry/lib/constants/supports-node-compile-cache-env-var.js +0 -8
- package/external/@socketsecurity/registry/lib/constants/supports-node-disable-warning-flag.js +0 -8
- package/external/@socketsecurity/registry/lib/constants/supports-node-permission-flag.js +0 -8
- package/external/@socketsecurity/registry/lib/constants/supports-node-require-module.js +0 -3
- package/external/@socketsecurity/registry/lib/constants/supports-node-run.js +0 -8
- package/external/@socketsecurity/registry/lib/constants/supports-process-send.js +0 -5
- package/external/@socketsecurity/registry/lib/constants/ts-libs-available.js +0 -22
- package/external/@socketsecurity/registry/lib/constants/ts-types-available.js +0 -3
- package/external/@socketsecurity/registry/lib/constants/tsconfig-json.js +0 -3
- package/external/@socketsecurity/registry/lib/constants/undefined-token.js +0 -3
- package/external/@socketsecurity/registry/lib/constants/unknown-error.js +0 -3
- package/external/@socketsecurity/registry/lib/constants/unknown-value.js +0 -3
- package/external/@socketsecurity/registry/lib/constants/unlicenced.js +0 -3
- package/external/@socketsecurity/registry/lib/constants/unlicensed.js +0 -3
- package/external/@socketsecurity/registry/lib/constants/utf8.js +0 -3
- package/external/@socketsecurity/registry/lib/constants/vitest.js +0 -3
- package/external/@socketsecurity/registry/lib/constants/vlt-lock-json.js +0 -3
- package/external/@socketsecurity/registry/lib/constants/vlt.js +0 -3
- package/external/@socketsecurity/registry/lib/constants/win32.js +0 -3
- package/external/@socketsecurity/registry/lib/constants/yarn-berry.js +0 -3
- package/external/@socketsecurity/registry/lib/constants/yarn-classic.js +0 -3
- package/external/@socketsecurity/registry/lib/constants/yarn-exec-path.js +0 -5
- package/external/@socketsecurity/registry/lib/constants/yarn-lock.js +0 -3
- package/external/@socketsecurity/registry/lib/constants/yarn.js +0 -3
- package/external/@socketsecurity/registry/lib/debug.js +0 -264
- package/external/@socketsecurity/registry/lib/env.js +0 -62
- package/external/@socketsecurity/registry/lib/fs.js +0 -556
- package/external/@socketsecurity/registry/lib/functions.js +0 -20
- package/external/@socketsecurity/registry/lib/globs.js +0 -145
- package/external/@socketsecurity/registry/lib/json.js +0 -69
- package/external/@socketsecurity/registry/lib/logger.js +0 -534
- package/external/@socketsecurity/registry/lib/objects.js +0 -422
- package/external/@socketsecurity/registry/lib/packages.js +0 -1376
- package/external/@socketsecurity/registry/lib/path.js +0 -231
- package/external/@socketsecurity/registry/lib/promises.js +0 -286
- package/external/@socketsecurity/registry/lib/prompts.js +0 -63
- package/external/@socketsecurity/registry/lib/regexps.js +0 -23
- package/external/@socketsecurity/registry/lib/sorts.js +0 -70
- package/external/@socketsecurity/registry/lib/spawn.js +0 -252
- package/external/@socketsecurity/registry/lib/spinner.js +0 -205
- package/external/@socketsecurity/registry/lib/streams.js +0 -84
- package/external/@socketsecurity/registry/lib/strings.js +0 -235
- package/external/@socketsecurity/registry/lib/url.js +0 -68
- package/external/@socketsecurity/registry/lib/words.js +0 -45
- package/external/@socketsecurity/registry/manifest.json +0 -1875
- package/external/blessed/LICENSE +0 -20
- package/external/blessed/README.md +0 -2421
- package/external/blessed/lib/alias.js +0 -528
- package/external/blessed/lib/blessed.js +0 -34
- package/external/blessed/lib/colors.js +0 -532
- package/external/blessed/lib/events.js +0 -191
- package/external/blessed/lib/gpmclient.js +0 -223
- package/external/blessed/lib/helpers.js +0 -167
- package/external/blessed/lib/keys.js +0 -341
- package/external/blessed/lib/program.js +0 -4297
- package/external/blessed/lib/tput.js +0 -3020
- package/external/blessed/lib/unicode.js +0 -792
- package/external/blessed/lib/widget.js +0 -62
- package/external/blessed/lib/widgets/ansiimage.js +0 -169
- package/external/blessed/lib/widgets/bigtext.js +0 -161
- package/external/blessed/lib/widgets/box.js +0 -36
- package/external/blessed/lib/widgets/button.js +0 -64
- package/external/blessed/lib/widgets/checkbox.js +0 -93
- package/external/blessed/lib/widgets/element.js +0 -2572
- package/external/blessed/lib/widgets/filemanager.js +0 -214
- package/external/blessed/lib/widgets/form.js +0 -269
- package/external/blessed/lib/widgets/image.js +0 -63
- package/external/blessed/lib/widgets/input.js +0 -36
- package/external/blessed/lib/widgets/layout.js +0 -235
- package/external/blessed/lib/widgets/line.js +0 -58
- package/external/blessed/lib/widgets/list.js +0 -601
- package/external/blessed/lib/widgets/listbar.js +0 -413
- package/external/blessed/lib/widgets/listtable.js +0 -254
- package/external/blessed/lib/widgets/loading.js +0 -90
- package/external/blessed/lib/widgets/log.js +0 -85
- package/external/blessed/lib/widgets/message.js +0 -125
- package/external/blessed/lib/widgets/node.js +0 -284
- package/external/blessed/lib/widgets/overlayimage.js +0 -719
- package/external/blessed/lib/widgets/progressbar.js +0 -159
- package/external/blessed/lib/widgets/prompt.js +0 -122
- package/external/blessed/lib/widgets/question.js +0 -118
- package/external/blessed/lib/widgets/radiobutton.js +0 -63
- package/external/blessed/lib/widgets/radioset.js +0 -38
- package/external/blessed/lib/widgets/screen.js +0 -2300
- package/external/blessed/lib/widgets/scrollablebox.js +0 -391
- package/external/blessed/lib/widgets/scrollabletext.js +0 -37
- package/external/blessed/lib/widgets/table.js +0 -356
- package/external/blessed/lib/widgets/terminal.js +0 -414
- package/external/blessed/lib/widgets/text.js +0 -37
- package/external/blessed/lib/widgets/textarea.js +0 -344
- package/external/blessed/lib/widgets/textbox.js +0 -79
- package/external/blessed/lib/widgets/video.js +0 -128
- package/external/blessed/usr/fonts/AUTHORS +0 -1
- package/external/blessed/usr/fonts/LICENSE +0 -94
- package/external/blessed/usr/fonts/README +0 -340
- package/external/blessed/usr/fonts/ter-u14b.json +0 -17826
- package/external/blessed/usr/fonts/ter-u14n.json +0 -17826
- package/external/blessed/usr/linux +0 -0
- package/external/blessed/usr/windows-ansi +0 -0
- package/external/blessed/usr/xterm +0 -0
- package/external/blessed/usr/xterm-256color +0 -0
- package/external/blessed/usr/xterm.termcap +0 -243
- package/external/blessed/usr/xterm.terminfo +0 -1977
- package/external/blessed/vendor/tng.js +0 -1757
- package/external/blessed-contrib/LICENSE.md +0 -21
- package/external/blessed-contrib/lib/layout/grid.js +0 -409
- package/external/blessed-contrib/lib/widget/charts/bar.js +0 -8370
- package/external/blessed-contrib/lib/widget/charts/line.js +0 -17924
- package/external/blessed-contrib/lib/widget/table.js +0 -187
- package/shadow-bin/npm +0 -27
- package/shadow-bin/npx +0 -27
- package/shadow-bin/pnpm +0 -27
- package/shadow-bin/yarn +0 -27
- /package/{translations.json → data/alert-translations.json} +0 -0
- /package/{requirements.json → data/command-api-requirements.json} +0 -0
- /package/{dist → data}/socket-completion.bash +0 -0
|
@@ -1,1376 +0,0 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
const { isArray: ArrayIsArray } = Array
|
|
4
|
-
const { hasOwn: ObjectHasOwn } = Object
|
|
5
|
-
|
|
6
|
-
const abortSignal = /*@__PURE__*/ require('./constants/abort-signal')
|
|
7
|
-
const copyLeftLicenses = /*@__PURE__*/ require('./constants/copy-left-licenses')
|
|
8
|
-
const LOOP_SENTINEL = /*@__PURE__*/ require('./constants/loop-sentinel')
|
|
9
|
-
const PACKAGE_DEFAULT_SOCKET_CATEGORIES = /*@__PURE__*/ require('./constants/package-default-socket-categories')
|
|
10
|
-
const packumentCache = /*@__PURE__*/ require('./constants/packument-cache')
|
|
11
|
-
const REGISTRY_SCOPE_DELIMITER = /*@__PURE__*/ require('./constants/registry-scope-delimiter')
|
|
12
|
-
const SOCKET_GITHUB_ORG = /*@__PURE__*/ require('./constants/socket-github-org')
|
|
13
|
-
const SOCKET_REGISTRY_REPO_NAME = /*@__PURE__*/ require('./constants/socket-registry-repo-name')
|
|
14
|
-
const SOCKET_REGISTRY_SCOPE = /*@__PURE__*/ require('./constants/socket-registry-scope')
|
|
15
|
-
const { readJson, readJsonSync } = /*@__PURE__*/ require('./fs')
|
|
16
|
-
const {
|
|
17
|
-
getOwnPropertyValues,
|
|
18
|
-
isObject,
|
|
19
|
-
isObjectObject,
|
|
20
|
-
merge,
|
|
21
|
-
objectEntries
|
|
22
|
-
} = /*@__PURE__*/ require('./objects')
|
|
23
|
-
const { isNodeModules, normalizePath } = /*@__PURE__*/ require('./path')
|
|
24
|
-
const { escapeRegExp } = /*@__PURE__*/ require('./regexps')
|
|
25
|
-
const { isNonEmptyString } = /*@__PURE__*/ require('./strings')
|
|
26
|
-
|
|
27
|
-
const BINARY_OPERATION_NODE_TYPE = 'BinaryOperation'
|
|
28
|
-
const LICENSE_NODE_TYPE = 'License'
|
|
29
|
-
|
|
30
|
-
const escapedScopeRegExp = new RegExp(
|
|
31
|
-
`^[^${escapeRegExp(REGISTRY_SCOPE_DELIMITER[0])}]+${escapeRegExp(REGISTRY_SCOPE_DELIMITER)}(?!${escapeRegExp(REGISTRY_SCOPE_DELIMITER[0])})`
|
|
32
|
-
)
|
|
33
|
-
const fileReferenceRegExp = /^SEE LICEN[CS]E IN (.+)$/
|
|
34
|
-
const pkgScopePrefixRegExp = /^@socketregistry\//
|
|
35
|
-
|
|
36
|
-
const identSymbol = Symbol.for('indent')
|
|
37
|
-
const newlineSymbol = Symbol.for('newline')
|
|
38
|
-
|
|
39
|
-
let _cacache
|
|
40
|
-
/**
|
|
41
|
-
* Get the cacache module for cache operations.
|
|
42
|
-
* @returns {Object} The cacache module.
|
|
43
|
-
* @private
|
|
44
|
-
*/
|
|
45
|
-
/*@__NO_SIDE_EFFECTS__*/
|
|
46
|
-
function getCacache() {
|
|
47
|
-
if (_cacache === undefined) {
|
|
48
|
-
_cacache = /*@__PURE__*/ require('../external/cacache')
|
|
49
|
-
}
|
|
50
|
-
return _cacache
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
let _EditablePackageJsonClass
|
|
54
|
-
/**
|
|
55
|
-
* Get the EditablePackageJson class for package.json manipulation.
|
|
56
|
-
* @returns {Class} The EditablePackageJson class.
|
|
57
|
-
* @private
|
|
58
|
-
*/
|
|
59
|
-
/*@__NO_SIDE_EFFECTS__*/
|
|
60
|
-
function getEditablePackageJsonClass() {
|
|
61
|
-
if (_EditablePackageJsonClass === undefined) {
|
|
62
|
-
const EditablePackageJsonBase = /*@__PURE__*/ require('../external/@npmcli/package-json')
|
|
63
|
-
const {
|
|
64
|
-
parse,
|
|
65
|
-
read
|
|
66
|
-
} = /*@__PURE__*/ require('../external/@npmcli/package-json/lib/read-package')
|
|
67
|
-
const {
|
|
68
|
-
packageSort
|
|
69
|
-
} = /*@__PURE__*/ require('../external/@npmcli/package-json/lib/sort')
|
|
70
|
-
_EditablePackageJsonClass = class EditablePackageJson extends (
|
|
71
|
-
EditablePackageJsonBase
|
|
72
|
-
) {
|
|
73
|
-
static fixSteps = EditablePackageJsonBase.fixSteps
|
|
74
|
-
static normalizeSteps = EditablePackageJsonBase.normalizeSteps
|
|
75
|
-
static prepareSteps = EditablePackageJsonBase.prepareSteps
|
|
76
|
-
|
|
77
|
-
_canSave = true
|
|
78
|
-
_path = undefined
|
|
79
|
-
_readFileContent = ''
|
|
80
|
-
_readFileJson = null
|
|
81
|
-
|
|
82
|
-
static async create(path, opts = {}) {
|
|
83
|
-
const p = new _EditablePackageJsonClass()
|
|
84
|
-
await p.create(path)
|
|
85
|
-
return opts.data ? p.update(opts.data) : p
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
static async fix(path, opts) {
|
|
89
|
-
const p = new _EditablePackageJsonClass()
|
|
90
|
-
await p.load(path, true)
|
|
91
|
-
return p.fix(opts)
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
static async load(path, opts = {}) {
|
|
95
|
-
const p = new _EditablePackageJsonClass()
|
|
96
|
-
// Avoid try/catch if we aren't going to create
|
|
97
|
-
if (!opts.create) {
|
|
98
|
-
return await p.load(path)
|
|
99
|
-
}
|
|
100
|
-
try {
|
|
101
|
-
return await p.load(path)
|
|
102
|
-
} catch (err) {
|
|
103
|
-
if (!err.message.startsWith('Could not read package.json')) {
|
|
104
|
-
throw err
|
|
105
|
-
}
|
|
106
|
-
return await p.create(path)
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
static async normalize(path, opts) {
|
|
111
|
-
const p = new _EditablePackageJsonClass()
|
|
112
|
-
await p.load(path)
|
|
113
|
-
return await p.normalize(opts)
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
static async prepare(path, opts) {
|
|
117
|
-
const p = new _EditablePackageJsonClass()
|
|
118
|
-
await p.load(path, true)
|
|
119
|
-
return await p.prepare(opts)
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
create(path) {
|
|
123
|
-
super.create(path)
|
|
124
|
-
this._path = path
|
|
125
|
-
return this
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
async fix(opts = {}) {
|
|
129
|
-
await super.fix(opts)
|
|
130
|
-
return this
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
fromComment(data) {
|
|
134
|
-
super.fromComment(data)
|
|
135
|
-
return this
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
fromContent(data) {
|
|
139
|
-
super.fromContent(data)
|
|
140
|
-
this._canSave = false
|
|
141
|
-
return this
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
fromJSON(data) {
|
|
145
|
-
super.fromJSON(data)
|
|
146
|
-
return this
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
async load(path, parseIndex) {
|
|
150
|
-
this._path = path
|
|
151
|
-
const { promises: fsPromises } = getFs()
|
|
152
|
-
let parseErr
|
|
153
|
-
try {
|
|
154
|
-
this._readFileContent = await read(this.filename)
|
|
155
|
-
} catch (err) {
|
|
156
|
-
if (!parseIndex) {
|
|
157
|
-
throw err
|
|
158
|
-
}
|
|
159
|
-
parseErr = err
|
|
160
|
-
}
|
|
161
|
-
if (parseErr) {
|
|
162
|
-
const indexFile = path.resolve(this.path, 'index.js')
|
|
163
|
-
let indexFileContent
|
|
164
|
-
try {
|
|
165
|
-
indexFileContent = await fsPromises.readFile(indexFile, 'utf8')
|
|
166
|
-
} catch {
|
|
167
|
-
throw parseErr
|
|
168
|
-
}
|
|
169
|
-
try {
|
|
170
|
-
this.fromComment(indexFileContent)
|
|
171
|
-
} catch {
|
|
172
|
-
throw parseErr
|
|
173
|
-
}
|
|
174
|
-
// This wasn't a package.json so prevent saving
|
|
175
|
-
this._canSave = false
|
|
176
|
-
return this
|
|
177
|
-
}
|
|
178
|
-
this.fromJSON(this._readFileContent)
|
|
179
|
-
// Add AFTER fromJSON is called in case it errors.
|
|
180
|
-
this._readFileJson = parse(this._readFileContent)
|
|
181
|
-
return this
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
async normalize(opts = {}) {
|
|
185
|
-
await super.normalize(opts)
|
|
186
|
-
return this
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
get path() {
|
|
190
|
-
return this._path
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
async prepare(opts = {}) {
|
|
194
|
-
await super.prepare(opts)
|
|
195
|
-
return this
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
async save(options) {
|
|
199
|
-
if (!this._canSave || this.content === undefined) {
|
|
200
|
-
throw new Error('No package.json to save to')
|
|
201
|
-
}
|
|
202
|
-
const { ignoreWhitespace = false, sort = false } = {
|
|
203
|
-
__proto__: null,
|
|
204
|
-
...options
|
|
205
|
-
}
|
|
206
|
-
const {
|
|
207
|
-
[identSymbol]: indent,
|
|
208
|
-
[newlineSymbol]: newline,
|
|
209
|
-
...rest
|
|
210
|
-
} = this.content
|
|
211
|
-
const content = sort ? packageSort(rest) : rest
|
|
212
|
-
const {
|
|
213
|
-
[identSymbol]: _indent,
|
|
214
|
-
[newlineSymbol]: _newline,
|
|
215
|
-
...origContent
|
|
216
|
-
} = this._readFileJson
|
|
217
|
-
|
|
218
|
-
if (
|
|
219
|
-
ignoreWhitespace &&
|
|
220
|
-
getUtil().isDeepStrictEqual(content, origContent)
|
|
221
|
-
) {
|
|
222
|
-
return false
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
const format = indent === undefined ? ' ' : indent
|
|
226
|
-
const eol = newline === undefined ? '\n' : newline
|
|
227
|
-
const fileContent = `${JSON.stringify(
|
|
228
|
-
content,
|
|
229
|
-
null,
|
|
230
|
-
format
|
|
231
|
-
)}\n`.replace(/\n/g, eol)
|
|
232
|
-
|
|
233
|
-
if (
|
|
234
|
-
!ignoreWhitespace &&
|
|
235
|
-
fileContent.trim() === this._readFileContent.trim()
|
|
236
|
-
) {
|
|
237
|
-
return false
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
const { promises: fsPromises } = getFs()
|
|
241
|
-
await fsPromises.writeFile(this.filename, fileContent)
|
|
242
|
-
this._readFileContent = fileContent
|
|
243
|
-
this._readFileJson = parse(fileContent)
|
|
244
|
-
return true
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
async saveSync(options) {
|
|
248
|
-
if (!this._canSave || this.content === undefined) {
|
|
249
|
-
throw new Error('No package.json to save to')
|
|
250
|
-
}
|
|
251
|
-
const { ignoreWhitespace = false, sort = false } = {
|
|
252
|
-
__proto__: null,
|
|
253
|
-
...options
|
|
254
|
-
}
|
|
255
|
-
const {
|
|
256
|
-
[Symbol.for('indent')]: indent,
|
|
257
|
-
[Symbol.for('newline')]: newline,
|
|
258
|
-
...rest
|
|
259
|
-
} = this.content
|
|
260
|
-
const content = sort ? packageSort(rest) : rest
|
|
261
|
-
|
|
262
|
-
if (
|
|
263
|
-
ignoreWhitespace &&
|
|
264
|
-
getUtil().isDeepStrictEqual(content, this._readFileJson)
|
|
265
|
-
) {
|
|
266
|
-
return false
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
const format = indent === undefined ? ' ' : indent
|
|
270
|
-
const eol = newline === undefined ? '\n' : newline
|
|
271
|
-
const fileContent = `${JSON.stringify(
|
|
272
|
-
content,
|
|
273
|
-
null,
|
|
274
|
-
format
|
|
275
|
-
)}\n`.replace(/\n/g, eol)
|
|
276
|
-
|
|
277
|
-
if (
|
|
278
|
-
!ignoreWhitespace &&
|
|
279
|
-
fileContent.trim() === this._readFileContent.trim()
|
|
280
|
-
) {
|
|
281
|
-
return false
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
const fs = getFs()
|
|
285
|
-
fs.writeFileSync(this.filename, fileContent)
|
|
286
|
-
this._readFileContent = fileContent
|
|
287
|
-
this._readFileJson = parse(fileContent)
|
|
288
|
-
return true
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
update(content) {
|
|
292
|
-
super.update(content)
|
|
293
|
-
return this
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
willSave(options) {
|
|
297
|
-
const { ignoreWhitespace = false, sort = false } = {
|
|
298
|
-
__proto__: null,
|
|
299
|
-
...options
|
|
300
|
-
}
|
|
301
|
-
if (!this._canSave || this.content === undefined) {
|
|
302
|
-
return false
|
|
303
|
-
}
|
|
304
|
-
const {
|
|
305
|
-
[Symbol.for('indent')]: indent,
|
|
306
|
-
[Symbol.for('newline')]: newline,
|
|
307
|
-
...rest
|
|
308
|
-
} = this.content
|
|
309
|
-
const content = sort ? packageSort(rest) : rest
|
|
310
|
-
|
|
311
|
-
if (
|
|
312
|
-
ignoreWhitespace &&
|
|
313
|
-
getUtil().isDeepStrictEqual(content, this._readFileJson)
|
|
314
|
-
) {
|
|
315
|
-
return false
|
|
316
|
-
}
|
|
317
|
-
|
|
318
|
-
const format = indent === undefined ? ' ' : indent
|
|
319
|
-
const eol = newline === undefined ? '\n' : newline
|
|
320
|
-
const fileContent = `${JSON.stringify(
|
|
321
|
-
content,
|
|
322
|
-
null,
|
|
323
|
-
format
|
|
324
|
-
)}\n`.replace(/\n/g, eol)
|
|
325
|
-
|
|
326
|
-
if (
|
|
327
|
-
!ignoreWhitespace &&
|
|
328
|
-
fileContent.trim() === this._readFileContent.trim()
|
|
329
|
-
) {
|
|
330
|
-
return false
|
|
331
|
-
}
|
|
332
|
-
return true
|
|
333
|
-
}
|
|
334
|
-
}
|
|
335
|
-
}
|
|
336
|
-
return _EditablePackageJsonClass
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
let _fetcher
|
|
340
|
-
/*@__NO_SIDE_EFFECTS__*/
|
|
341
|
-
function getFetcher() {
|
|
342
|
-
if (_fetcher === undefined) {
|
|
343
|
-
const makeFetchHappen = /*@__PURE__*/ require('../external/make-fetch-happen')
|
|
344
|
-
_fetcher = makeFetchHappen.defaults({
|
|
345
|
-
cachePath: /*@__PURE__*/ require('./constants/pacote-cache-path'),
|
|
346
|
-
// Prefer-offline: Staleness checks for cached data will be bypassed, but
|
|
347
|
-
// missing data will be requested from the server.
|
|
348
|
-
// https://github.com/npm/make-fetch-happen?tab=readme-ov-file#--optscache
|
|
349
|
-
cache: 'force-cache'
|
|
350
|
-
})
|
|
351
|
-
}
|
|
352
|
-
return _fetcher
|
|
353
|
-
}
|
|
354
|
-
|
|
355
|
-
let _fs
|
|
356
|
-
/*@__NO_SIDE_EFFECTS__*/
|
|
357
|
-
function getFs() {
|
|
358
|
-
if (_fs === undefined) {
|
|
359
|
-
// Use non-'node:' prefixed require to avoid Webpack errors.
|
|
360
|
-
// eslint-disable-next-line n/prefer-node-protocol
|
|
361
|
-
_fs = /*@__PURE__*/ require('fs')
|
|
362
|
-
}
|
|
363
|
-
return _fs
|
|
364
|
-
}
|
|
365
|
-
|
|
366
|
-
let _normalizePackageData
|
|
367
|
-
/*@__NO_SIDE_EFFECTS__*/
|
|
368
|
-
function getNormalizePackageData() {
|
|
369
|
-
if (_normalizePackageData === undefined) {
|
|
370
|
-
_normalizePackageData = /*@__PURE__*/ require('../external/normalize-package-data')
|
|
371
|
-
}
|
|
372
|
-
return _normalizePackageData
|
|
373
|
-
}
|
|
374
|
-
|
|
375
|
-
let _npmPackageArg
|
|
376
|
-
/*@__NO_SIDE_EFFECTS__*/
|
|
377
|
-
function getNpmPackageArg() {
|
|
378
|
-
if (_npmPackageArg === undefined) {
|
|
379
|
-
_npmPackageArg = /*@__PURE__*/ require('../external/npm-package-arg')
|
|
380
|
-
}
|
|
381
|
-
return _npmPackageArg
|
|
382
|
-
}
|
|
383
|
-
|
|
384
|
-
let _pack
|
|
385
|
-
/*@__NO_SIDE_EFFECTS__*/
|
|
386
|
-
function getPack() {
|
|
387
|
-
if (_pack === undefined) {
|
|
388
|
-
_pack = /*@__PURE__*/ require('../external/libnpmpack')
|
|
389
|
-
}
|
|
390
|
-
return _pack
|
|
391
|
-
}
|
|
392
|
-
|
|
393
|
-
let _PackageURL
|
|
394
|
-
/*@__NO_SIDE_EFFECTS__*/
|
|
395
|
-
function getPackageURL() {
|
|
396
|
-
if (_PackageURL === undefined) {
|
|
397
|
-
// The 'packageurl-js' package is browser safe.
|
|
398
|
-
const packageUrlJs = /*@__PURE__*/ require('../external/@socketregistry/packageurl-js')
|
|
399
|
-
_PackageURL = packageUrlJs.PackageURL
|
|
400
|
-
}
|
|
401
|
-
return _PackageURL
|
|
402
|
-
}
|
|
403
|
-
|
|
404
|
-
let _pacote
|
|
405
|
-
/*@__NO_SIDE_EFFECTS__*/
|
|
406
|
-
function getPacote() {
|
|
407
|
-
if (_pacote === undefined) {
|
|
408
|
-
_pacote = /*@__PURE__*/ require('../external/pacote')
|
|
409
|
-
}
|
|
410
|
-
return _pacote
|
|
411
|
-
}
|
|
412
|
-
|
|
413
|
-
let _path
|
|
414
|
-
/*@__NO_SIDE_EFFECTS__*/
|
|
415
|
-
function getPath() {
|
|
416
|
-
if (_path === undefined) {
|
|
417
|
-
// Use non-'node:' prefixed require to avoid Webpack errors.
|
|
418
|
-
// eslint-disable-next-line n/prefer-node-protocol
|
|
419
|
-
_path = /*@__PURE__*/ require('path')
|
|
420
|
-
}
|
|
421
|
-
return _path
|
|
422
|
-
}
|
|
423
|
-
|
|
424
|
-
let _semver
|
|
425
|
-
/*@__NO_SIDE_EFFECTS__*/
|
|
426
|
-
function getSemver() {
|
|
427
|
-
if (_semver === undefined) {
|
|
428
|
-
// The 'semver' package is browser safe.
|
|
429
|
-
_semver = /*@__PURE__*/ require('../external/semver')
|
|
430
|
-
}
|
|
431
|
-
return _semver
|
|
432
|
-
}
|
|
433
|
-
|
|
434
|
-
let _spdxCorrect
|
|
435
|
-
/*@__NO_SIDE_EFFECTS__*/
|
|
436
|
-
function getSpdxCorrect() {
|
|
437
|
-
if (_spdxCorrect === undefined) {
|
|
438
|
-
// The 'spdx-correct' package is browser safe.
|
|
439
|
-
_spdxCorrect = /*@__PURE__*/ require('../external/spdx-correct')
|
|
440
|
-
}
|
|
441
|
-
return _spdxCorrect
|
|
442
|
-
}
|
|
443
|
-
|
|
444
|
-
let _spdxExpParse
|
|
445
|
-
/*@__NO_SIDE_EFFECTS__*/
|
|
446
|
-
function getSpdxExpParse() {
|
|
447
|
-
if (_spdxExpParse === undefined) {
|
|
448
|
-
// The 'spdx-expression-parse' package is browser safe.
|
|
449
|
-
_spdxExpParse = /*@__PURE__*/ require('../external/spdx-expression-parse')
|
|
450
|
-
}
|
|
451
|
-
return _spdxExpParse
|
|
452
|
-
}
|
|
453
|
-
|
|
454
|
-
let _util
|
|
455
|
-
/*@__NO_SIDE_EFFECTS__*/
|
|
456
|
-
function getUtil() {
|
|
457
|
-
if (_util === undefined) {
|
|
458
|
-
// Use non-'node:' prefixed require to avoid Webpack errors.
|
|
459
|
-
// eslint-disable-next-line n/prefer-node-protocol
|
|
460
|
-
_util = /*@__PURE__*/ require('util')
|
|
461
|
-
}
|
|
462
|
-
return _util
|
|
463
|
-
}
|
|
464
|
-
|
|
465
|
-
let _validateNpmPackageName
|
|
466
|
-
/*@__NO_SIDE_EFFECTS__*/
|
|
467
|
-
function getValidateNpmPackageName() {
|
|
468
|
-
if (_validateNpmPackageName === undefined) {
|
|
469
|
-
_validateNpmPackageName = /*@__PURE__*/ require('../external/validate-npm-package-name')
|
|
470
|
-
}
|
|
471
|
-
return _validateNpmPackageName
|
|
472
|
-
}
|
|
473
|
-
|
|
474
|
-
/**
|
|
475
|
-
* Collect licenses that are incompatible (copyleft).
|
|
476
|
-
* @param {Object[]} licenseNodes - Array of license nodes.
|
|
477
|
-
* @returns {Object[]} Array of incompatible license nodes.
|
|
478
|
-
*/
|
|
479
|
-
/*@__NO_SIDE_EFFECTS__*/
|
|
480
|
-
function collectIncompatibleLicenses(licenseNodes) {
|
|
481
|
-
const result = []
|
|
482
|
-
for (let i = 0, { length } = licenseNodes; i < length; i += 1) {
|
|
483
|
-
const node = licenseNodes[i]
|
|
484
|
-
if (copyLeftLicenses.has(node.license)) {
|
|
485
|
-
result.push(node)
|
|
486
|
-
}
|
|
487
|
-
}
|
|
488
|
-
return result
|
|
489
|
-
}
|
|
490
|
-
|
|
491
|
-
/**
|
|
492
|
-
* Collect warnings from license nodes.
|
|
493
|
-
* @param {Object[]} licenseNodes - Array of license nodes.
|
|
494
|
-
* @returns {string[]} Array of warning messages.
|
|
495
|
-
*/
|
|
496
|
-
/*@__NO_SIDE_EFFECTS__*/
|
|
497
|
-
function collectLicenseWarnings(licenseNodes) {
|
|
498
|
-
const warnings = new Map()
|
|
499
|
-
for (let i = 0, { length } = licenseNodes; i < length; i += 1) {
|
|
500
|
-
const node = licenseNodes[i]
|
|
501
|
-
const { license } = node
|
|
502
|
-
if (license === 'UNLICENSED') {
|
|
503
|
-
warnings.set('UNLICENSED', `Package is unlicensed`)
|
|
504
|
-
} else if (node.inFile !== undefined) {
|
|
505
|
-
warnings.set('IN_FILE', `License terms specified in ${node.inFile}`)
|
|
506
|
-
}
|
|
507
|
-
}
|
|
508
|
-
return [...warnings.values()]
|
|
509
|
-
}
|
|
510
|
-
|
|
511
|
-
/**
|
|
512
|
-
* Create an AST node from a raw node.
|
|
513
|
-
* @param {Object} rawNode - Raw node data.
|
|
514
|
-
* @returns {Object} AST node.
|
|
515
|
-
*/
|
|
516
|
-
/*@__NO_SIDE_EFFECTS__*/
|
|
517
|
-
function createAstNode(rawNode) {
|
|
518
|
-
return ObjectHasOwn(rawNode, 'license')
|
|
519
|
-
? createLicenseNode(rawNode)
|
|
520
|
-
: createBinaryOperationNode(rawNode)
|
|
521
|
-
}
|
|
522
|
-
|
|
523
|
-
/**
|
|
524
|
-
* Create a binary operation AST node.
|
|
525
|
-
* @param {Object} rawNode - Raw node with left, right, and conjunction.
|
|
526
|
-
* @returns {Object} Binary operation node.
|
|
527
|
-
*/
|
|
528
|
-
/*@__NO_SIDE_EFFECTS__*/
|
|
529
|
-
function createBinaryOperationNode(rawNode) {
|
|
530
|
-
let left
|
|
531
|
-
let right
|
|
532
|
-
let { left: rawLeft, right: rawRight } = rawNode
|
|
533
|
-
const { conjunction } = rawNode
|
|
534
|
-
rawNode = undefined
|
|
535
|
-
return {
|
|
536
|
-
__proto__: null,
|
|
537
|
-
type: BINARY_OPERATION_NODE_TYPE,
|
|
538
|
-
get left() {
|
|
539
|
-
if (left === undefined) {
|
|
540
|
-
left = createAstNode(rawLeft)
|
|
541
|
-
rawLeft = undefined
|
|
542
|
-
}
|
|
543
|
-
return left
|
|
544
|
-
},
|
|
545
|
-
conjunction,
|
|
546
|
-
get right() {
|
|
547
|
-
if (right === undefined) {
|
|
548
|
-
right = createAstNode(rawRight)
|
|
549
|
-
rawRight = undefined
|
|
550
|
-
}
|
|
551
|
-
return right
|
|
552
|
-
}
|
|
553
|
-
}
|
|
554
|
-
}
|
|
555
|
-
|
|
556
|
-
/**
|
|
557
|
-
* Create a license AST node.
|
|
558
|
-
* @param {Object} rawNode - Raw license node data.
|
|
559
|
-
* @returns {Object} License node.
|
|
560
|
-
*/
|
|
561
|
-
/*@__NO_SIDE_EFFECTS__*/
|
|
562
|
-
function createLicenseNode(rawNode) {
|
|
563
|
-
return { __proto__: null, ...rawNode, type: LICENSE_NODE_TYPE }
|
|
564
|
-
}
|
|
565
|
-
|
|
566
|
-
/**
|
|
567
|
-
* Create a package.json object for a Socket registry package.
|
|
568
|
-
* @param {string} sockRegPkgName - Socket registry package name.
|
|
569
|
-
* @param {string} directory - Directory path.
|
|
570
|
-
* @param {Object} [options] - Creation options.
|
|
571
|
-
* @returns {Object} Package.json object.
|
|
572
|
-
*/
|
|
573
|
-
/*@__NO_SIDE_EFFECTS__*/
|
|
574
|
-
function createPackageJson(sockRegPkgName, directory, options) {
|
|
575
|
-
const {
|
|
576
|
-
dependencies,
|
|
577
|
-
description,
|
|
578
|
-
engines,
|
|
579
|
-
exports: entryExportsRaw,
|
|
580
|
-
files,
|
|
581
|
-
keywords,
|
|
582
|
-
main,
|
|
583
|
-
overrides,
|
|
584
|
-
resolutions,
|
|
585
|
-
sideEffects,
|
|
586
|
-
socket,
|
|
587
|
-
type,
|
|
588
|
-
version
|
|
589
|
-
} = { __proto__: null, ...options }
|
|
590
|
-
const PACKAGE_DEFAULT_NODE_RANGE = /*@__PURE__*/ require('./constants/package-default-node-range')
|
|
591
|
-
const name = `@socketregistry/${sockRegPkgName.replace(pkgScopePrefixRegExp, '')}`
|
|
592
|
-
const entryExports = resolvePackageJsonEntryExports(entryExportsRaw)
|
|
593
|
-
const githubUrl = `https://github.com/${SOCKET_GITHUB_ORG}/${SOCKET_REGISTRY_REPO_NAME}`
|
|
594
|
-
return {
|
|
595
|
-
__proto__: null,
|
|
596
|
-
name,
|
|
597
|
-
version,
|
|
598
|
-
license: 'MIT',
|
|
599
|
-
description,
|
|
600
|
-
keywords,
|
|
601
|
-
homepage: `${githubUrl}/tree/main/${directory}`,
|
|
602
|
-
repository: {
|
|
603
|
-
type: 'git',
|
|
604
|
-
url: `git+${githubUrl}.git`,
|
|
605
|
-
directory
|
|
606
|
-
},
|
|
607
|
-
...(type ? { type } : {}),
|
|
608
|
-
...(entryExports ? { exports: { ...entryExports } } : {}),
|
|
609
|
-
...(entryExports ? {} : { main: `${main ?? './index.js'}` }),
|
|
610
|
-
sideEffects: sideEffects !== undefined && !!sideEffects,
|
|
611
|
-
...(isObjectObject(dependencies)
|
|
612
|
-
? { dependencies: { ...dependencies } }
|
|
613
|
-
: {}),
|
|
614
|
-
...(isObjectObject(overrides) ? { overrides: { ...overrides } } : {}),
|
|
615
|
-
...(isObjectObject(resolutions) ? { resolutions: { ...resolutions } } : {}),
|
|
616
|
-
...(isObjectObject(engines)
|
|
617
|
-
? {
|
|
618
|
-
engines: Object.fromEntries(
|
|
619
|
-
objectEntries(engines).map(pair => {
|
|
620
|
-
if (pair[0] === 'node') {
|
|
621
|
-
const semver = getSemver()
|
|
622
|
-
const { 1: range } = pair
|
|
623
|
-
if (
|
|
624
|
-
!semver.satisfies(
|
|
625
|
-
// Roughly check Node range as semver.coerce will strip leading
|
|
626
|
-
// v's, carets (^), comparators (<,<=,>,>=,=), and tildes (~).
|
|
627
|
-
semver.coerce(range),
|
|
628
|
-
PACKAGE_DEFAULT_NODE_RANGE
|
|
629
|
-
)
|
|
630
|
-
) {
|
|
631
|
-
pair[1] = PACKAGE_DEFAULT_NODE_RANGE
|
|
632
|
-
}
|
|
633
|
-
}
|
|
634
|
-
return pair
|
|
635
|
-
})
|
|
636
|
-
)
|
|
637
|
-
}
|
|
638
|
-
: { engines: { node: PACKAGE_DEFAULT_NODE_RANGE } }),
|
|
639
|
-
files: ArrayIsArray(files) ? files.slice() : ['*.d.ts', '*.js'],
|
|
640
|
-
...(isObjectObject(socket)
|
|
641
|
-
? { socket: { ...socket } }
|
|
642
|
-
: {
|
|
643
|
-
socket: {
|
|
644
|
-
// Valid categories are: cleanup, levelup, speedup, tuneup
|
|
645
|
-
categories: PACKAGE_DEFAULT_SOCKET_CATEGORIES
|
|
646
|
-
}
|
|
647
|
-
})
|
|
648
|
-
}
|
|
649
|
-
}
|
|
650
|
-
|
|
651
|
-
/**
|
|
652
|
-
* Extract a package to a destination directory.
|
|
653
|
-
* @param {string} pkgNameOrId - Package name or identifier.
|
|
654
|
-
* @param {Object} [options] - Extraction options.
|
|
655
|
-
* @param {Function} [callback] - Callback to execute after extraction.
|
|
656
|
-
* @returns {Promise<void>} Resolves when extraction is complete.
|
|
657
|
-
*/
|
|
658
|
-
/*@__NO_SIDE_EFFECTS__*/
|
|
659
|
-
async function extractPackage(pkgNameOrId, options, callback) {
|
|
660
|
-
if (arguments.length === 2 && typeof options === 'function') {
|
|
661
|
-
callback = options
|
|
662
|
-
options = undefined
|
|
663
|
-
}
|
|
664
|
-
const { dest, tmpPrefix, ...extractOptions_ } = {
|
|
665
|
-
__proto__: null,
|
|
666
|
-
...options
|
|
667
|
-
}
|
|
668
|
-
const extractOptions = {
|
|
669
|
-
__proto__: null,
|
|
670
|
-
packumentCache,
|
|
671
|
-
preferOffline: true,
|
|
672
|
-
...extractOptions_
|
|
673
|
-
}
|
|
674
|
-
const pacote = getPacote()
|
|
675
|
-
if (typeof dest === 'string') {
|
|
676
|
-
await pacote.extract(pkgNameOrId, dest, extractOptions)
|
|
677
|
-
if (typeof callback === 'function') {
|
|
678
|
-
await callback(dest)
|
|
679
|
-
}
|
|
680
|
-
} else {
|
|
681
|
-
// The DefinitelyTyped types for cacache.tmp.withTmp are incorrect.
|
|
682
|
-
// It DOES returns a promise.
|
|
683
|
-
const cacache = getCacache()
|
|
684
|
-
await cacache.tmp.withTmp(
|
|
685
|
-
/*@__PURE__*/ require('./constants/pacote-cache-path'),
|
|
686
|
-
{ tmpPrefix },
|
|
687
|
-
async tmpDirPath => {
|
|
688
|
-
await pacote.extract(pkgNameOrId, tmpDirPath, extractOptions)
|
|
689
|
-
if (typeof callback === 'function') {
|
|
690
|
-
await callback(tmpDirPath)
|
|
691
|
-
}
|
|
692
|
-
}
|
|
693
|
-
)
|
|
694
|
-
}
|
|
695
|
-
}
|
|
696
|
-
|
|
697
|
-
/**
|
|
698
|
-
* Fetch the manifest for a package.
|
|
699
|
-
* @param {string} pkgNameOrId - Package name or identifier.
|
|
700
|
-
* @param {Object} [options] - Fetch options.
|
|
701
|
-
* @returns {Promise<Object|null>} Package manifest or null if failed.
|
|
702
|
-
*/
|
|
703
|
-
/*@__NO_SIDE_EFFECTS__*/
|
|
704
|
-
async function fetchPackageManifest(pkgNameOrId, options) {
|
|
705
|
-
const pacoteOptions = {
|
|
706
|
-
__proto__: null,
|
|
707
|
-
signal: abortSignal,
|
|
708
|
-
...options,
|
|
709
|
-
packumentCache,
|
|
710
|
-
preferOffline: true
|
|
711
|
-
}
|
|
712
|
-
const { signal } = pacoteOptions
|
|
713
|
-
if (signal?.aborted) {
|
|
714
|
-
return null
|
|
715
|
-
}
|
|
716
|
-
const pacote = getPacote()
|
|
717
|
-
let result
|
|
718
|
-
try {
|
|
719
|
-
result = await pacote.manifest(pkgNameOrId, pacoteOptions)
|
|
720
|
-
} catch {}
|
|
721
|
-
if (signal?.aborted) {
|
|
722
|
-
return null
|
|
723
|
-
}
|
|
724
|
-
if (result) {
|
|
725
|
-
const npmPackageArg = getNpmPackageArg()
|
|
726
|
-
const spec = npmPackageArg(pkgNameOrId, pacoteOptions.where)
|
|
727
|
-
if (isRegistryFetcherType(spec.type)) {
|
|
728
|
-
return result
|
|
729
|
-
}
|
|
730
|
-
}
|
|
731
|
-
// Convert a manifest not fetched by RegistryFetcher to one that is.
|
|
732
|
-
return result
|
|
733
|
-
? fetchPackageManifest(`${result.name}@${result.version}`, pacoteOptions)
|
|
734
|
-
: null
|
|
735
|
-
}
|
|
736
|
-
|
|
737
|
-
/**
|
|
738
|
-
* Fetch the packument (package document) for a package.
|
|
739
|
-
* @param {string} pkgNameOrId - Package name or identifier.
|
|
740
|
-
* @param {Object} [options] - Fetch options.
|
|
741
|
-
* @returns {Promise<Object|null>} Package packument or null if failed.
|
|
742
|
-
*/
|
|
743
|
-
/*@__NO_SIDE_EFFECTS__*/
|
|
744
|
-
async function fetchPackagePackument(pkgNameOrId, options) {
|
|
745
|
-
const pacote = getPacote()
|
|
746
|
-
try {
|
|
747
|
-
return await pacote.packument(pkgNameOrId, {
|
|
748
|
-
__proto__: null,
|
|
749
|
-
signal: abortSignal,
|
|
750
|
-
...options,
|
|
751
|
-
packumentCache,
|
|
752
|
-
preferOffline: true
|
|
753
|
-
})
|
|
754
|
-
} catch {}
|
|
755
|
-
return null
|
|
756
|
-
}
|
|
757
|
-
|
|
758
|
-
/**
|
|
759
|
-
* Find package extensions for a given package.
|
|
760
|
-
* @param {string} pkgName - Package name.
|
|
761
|
-
* @param {string} pkgVer - Package version.
|
|
762
|
-
* @returns {Object} Package extensions.
|
|
763
|
-
*/
|
|
764
|
-
/*@__NO_SIDE_EFFECTS__*/
|
|
765
|
-
function findPackageExtensions(pkgName, pkgVer) {
|
|
766
|
-
let result
|
|
767
|
-
const packageExtensions = /*@__PURE__*/ require('./constants/package-extensions')
|
|
768
|
-
for (const { 0: selector, 1: ext } of packageExtensions) {
|
|
769
|
-
const lastAtSignIndex = selector.lastIndexOf('@')
|
|
770
|
-
const name = selector.slice(0, lastAtSignIndex)
|
|
771
|
-
if (pkgName === name) {
|
|
772
|
-
const semver = getSemver()
|
|
773
|
-
const range = selector.slice(lastAtSignIndex + 1)
|
|
774
|
-
if (semver.satisfies(pkgVer, range)) {
|
|
775
|
-
if (result === undefined) {
|
|
776
|
-
result = {}
|
|
777
|
-
}
|
|
778
|
-
merge(result, ext)
|
|
779
|
-
}
|
|
780
|
-
}
|
|
781
|
-
}
|
|
782
|
-
return result
|
|
783
|
-
}
|
|
784
|
-
|
|
785
|
-
/**
|
|
786
|
-
* Find types for a subpath in package exports.
|
|
787
|
-
* @param {Object} entryExports - Package exports object.
|
|
788
|
-
* @param {string} subpath - Subpath to find types for.
|
|
789
|
-
* @returns {string|undefined} Types path if found.
|
|
790
|
-
*/
|
|
791
|
-
/*@__NO_SIDE_EFFECTS__*/
|
|
792
|
-
function findTypesForSubpath(entryExports, subpath) {
|
|
793
|
-
const queue = [entryExports]
|
|
794
|
-
let pos = 0
|
|
795
|
-
while (pos < queue.length) {
|
|
796
|
-
if (pos === LOOP_SENTINEL) {
|
|
797
|
-
throw new Error(
|
|
798
|
-
'Detected infinite loop in entry exports crawl of getTypesForSubpath'
|
|
799
|
-
)
|
|
800
|
-
}
|
|
801
|
-
const value = queue[pos++]
|
|
802
|
-
if (ArrayIsArray(value)) {
|
|
803
|
-
for (let i = 0, { length } = value; i < length; i += 1) {
|
|
804
|
-
const item = value[i]
|
|
805
|
-
if (item === subpath) {
|
|
806
|
-
return value.types
|
|
807
|
-
}
|
|
808
|
-
if (isObject(item)) {
|
|
809
|
-
queue.push(item)
|
|
810
|
-
}
|
|
811
|
-
}
|
|
812
|
-
} else if (isObject(value)) {
|
|
813
|
-
const keys = Object.getOwnPropertyNames(value)
|
|
814
|
-
for (let i = 0, { length } = keys; i < length; i += 1) {
|
|
815
|
-
const item = value[keys[i]]
|
|
816
|
-
if (item === subpath) {
|
|
817
|
-
return value.types
|
|
818
|
-
}
|
|
819
|
-
if (isObject(item)) {
|
|
820
|
-
queue.push(item)
|
|
821
|
-
}
|
|
822
|
-
}
|
|
823
|
-
}
|
|
824
|
-
}
|
|
825
|
-
return undefined
|
|
826
|
-
}
|
|
827
|
-
|
|
828
|
-
/**
|
|
829
|
-
* Get the release tag for a version.
|
|
830
|
-
* @param {string} version - Version string.
|
|
831
|
-
* @returns {string} Release tag.
|
|
832
|
-
*/
|
|
833
|
-
/*@__NO_SIDE_EFFECTS__*/
|
|
834
|
-
function getReleaseTag(version) {
|
|
835
|
-
const semver = getSemver()
|
|
836
|
-
return semver.prerelease(version)?.join('.') ?? 'latest'
|
|
837
|
-
}
|
|
838
|
-
|
|
839
|
-
/**
|
|
840
|
-
* Extract details from a repository URL.
|
|
841
|
-
* @param {string} [repoUrl=''] - Repository URL.
|
|
842
|
-
* @returns {Object} Repository details with host, user, and project.
|
|
843
|
-
*/
|
|
844
|
-
/*@__NO_SIDE_EFFECTS__*/
|
|
845
|
-
function getRepoUrlDetails(repoUrl = '') {
|
|
846
|
-
const userAndRepo = repoUrl.replace(/^.+github.com\//, '').split('/')
|
|
847
|
-
const { 0: user } = userAndRepo
|
|
848
|
-
const project =
|
|
849
|
-
userAndRepo.length > 1 ? userAndRepo[1].slice(0, -'.git'.length) : ''
|
|
850
|
-
return { user, project }
|
|
851
|
-
}
|
|
852
|
-
|
|
853
|
-
/**
|
|
854
|
-
* Get subpaths from package exports.
|
|
855
|
-
* @param {Object} entryExports - Package exports object.
|
|
856
|
-
* @returns {string[]} Array of subpaths.
|
|
857
|
-
*/
|
|
858
|
-
/*@__NO_SIDE_EFFECTS__*/
|
|
859
|
-
function getSubpaths(entryExports) {
|
|
860
|
-
const result = []
|
|
861
|
-
const queue = getOwnPropertyValues(entryExports)
|
|
862
|
-
let pos = 0
|
|
863
|
-
while (pos < queue.length) {
|
|
864
|
-
if (pos === LOOP_SENTINEL) {
|
|
865
|
-
throw new Error(
|
|
866
|
-
'Detected infinite loop in entry exports crawl of getSubpaths'
|
|
867
|
-
)
|
|
868
|
-
}
|
|
869
|
-
const value = queue[pos++]
|
|
870
|
-
if (typeof value === 'string') {
|
|
871
|
-
result.push(value)
|
|
872
|
-
} else if (ArrayIsArray(value)) {
|
|
873
|
-
queue.push(...value)
|
|
874
|
-
} else if (isObject(value)) {
|
|
875
|
-
queue.push(...getOwnPropertyValues(value))
|
|
876
|
-
}
|
|
877
|
-
}
|
|
878
|
-
return result
|
|
879
|
-
}
|
|
880
|
-
|
|
881
|
-
/*@__NO_SIDE_EFFECTS__*/
|
|
882
|
-
function gitHubTagRefUrl(user, project, tag) {
|
|
883
|
-
return `https://api.github.com/repos/${user}/${project}/git/ref/tags/${tag}`
|
|
884
|
-
}
|
|
885
|
-
|
|
886
|
-
/*@__NO_SIDE_EFFECTS__*/
|
|
887
|
-
function gitHubTgzUrl(user, project, sha) {
|
|
888
|
-
return `https://github.com/${user}/${project}/archive/${sha}.tar.gz`
|
|
889
|
-
}
|
|
890
|
-
|
|
891
|
-
/*@__NO_SIDE_EFFECTS__*/
|
|
892
|
-
function isBlessedPackageName(name) {
|
|
893
|
-
return (
|
|
894
|
-
typeof name === 'string' &&
|
|
895
|
-
(name === 'socket' ||
|
|
896
|
-
name.startsWith('@socketoverride/') ||
|
|
897
|
-
name.startsWith('@socketregistry/') ||
|
|
898
|
-
name.startsWith('@socketsecurity/'))
|
|
899
|
-
)
|
|
900
|
-
}
|
|
901
|
-
|
|
902
|
-
/*@__NO_SIDE_EFFECTS__*/
|
|
903
|
-
function isConditionalExports(entryExports) {
|
|
904
|
-
if (!isObjectObject(entryExports)) {
|
|
905
|
-
return false
|
|
906
|
-
}
|
|
907
|
-
const keys = Object.getOwnPropertyNames(entryExports)
|
|
908
|
-
const { length } = keys
|
|
909
|
-
if (!length) {
|
|
910
|
-
return false
|
|
911
|
-
}
|
|
912
|
-
// Conditional entry exports do NOT contain keys starting with '.'.
|
|
913
|
-
// Entry exports cannot contain some keys starting with '.' and some not.
|
|
914
|
-
// The exports object MUST either be an object of package subpath keys OR
|
|
915
|
-
// an object of main entry condition name keys only.
|
|
916
|
-
for (let i = 0; i < length; i += 1) {
|
|
917
|
-
const key = keys[i]
|
|
918
|
-
if (key.length > 0 && key.charCodeAt(0) === 46 /*'.'*/) {
|
|
919
|
-
return false
|
|
920
|
-
}
|
|
921
|
-
}
|
|
922
|
-
return true
|
|
923
|
-
}
|
|
924
|
-
|
|
925
|
-
/*@__NO_SIDE_EFFECTS__*/
|
|
926
|
-
function isGitHubTgzSpec(spec, where) {
|
|
927
|
-
let parsedSpec
|
|
928
|
-
if (isObjectObject(spec)) {
|
|
929
|
-
parsedSpec = spec
|
|
930
|
-
} else {
|
|
931
|
-
const npmPackageArg = getNpmPackageArg()
|
|
932
|
-
parsedSpec = npmPackageArg(spec, where)
|
|
933
|
-
}
|
|
934
|
-
return (
|
|
935
|
-
parsedSpec.type === 'remote' && !!parsedSpec.saveSpec?.endsWith('.tar.gz')
|
|
936
|
-
)
|
|
937
|
-
}
|
|
938
|
-
|
|
939
|
-
/*@__NO_SIDE_EFFECTS__*/
|
|
940
|
-
function isGitHubUrlSpec(spec, where) {
|
|
941
|
-
let parsedSpec
|
|
942
|
-
if (isObjectObject(spec)) {
|
|
943
|
-
parsedSpec = spec
|
|
944
|
-
} else {
|
|
945
|
-
const npmPackageArg = getNpmPackageArg()
|
|
946
|
-
parsedSpec = npmPackageArg(spec, where)
|
|
947
|
-
}
|
|
948
|
-
return (
|
|
949
|
-
parsedSpec.type === 'git' &&
|
|
950
|
-
parsedSpec.hosted?.domain === 'github.com' &&
|
|
951
|
-
isNonEmptyString(parsedSpec.gitCommittish)
|
|
952
|
-
)
|
|
953
|
-
}
|
|
954
|
-
|
|
955
|
-
/*@__NO_SIDE_EFFECTS__*/
|
|
956
|
-
function isRegistryFetcherType(type) {
|
|
957
|
-
// RegistryFetcher spec.type check based on:
|
|
958
|
-
// https://github.com/npm/pacote/blob/v19.0.0/lib/fetcher.js#L467-L488
|
|
959
|
-
return (
|
|
960
|
-
type === 'alias' || type === 'range' || type === 'tag' || type === 'version'
|
|
961
|
-
)
|
|
962
|
-
}
|
|
963
|
-
|
|
964
|
-
/*@__NO_SIDE_EFFECTS__*/
|
|
965
|
-
function isSubpathExports(entryExports) {
|
|
966
|
-
if (isObjectObject(entryExports)) {
|
|
967
|
-
const keys = Object.getOwnPropertyNames(entryExports)
|
|
968
|
-
for (let i = 0, { length } = keys; i < length; i += 1) {
|
|
969
|
-
// Subpath entry exports contain keys starting with '.'.
|
|
970
|
-
// Entry exports cannot contain some keys starting with '.' and some not.
|
|
971
|
-
// The exports object MUST either be an object of package subpath keys OR
|
|
972
|
-
// an object of main entry condition name keys only.
|
|
973
|
-
if (keys[i].charCodeAt(0) === 46 /*'.'*/) {
|
|
974
|
-
return true
|
|
975
|
-
}
|
|
976
|
-
}
|
|
977
|
-
}
|
|
978
|
-
return false
|
|
979
|
-
}
|
|
980
|
-
|
|
981
|
-
/*@__NO_SIDE_EFFECTS__*/
|
|
982
|
-
function isValidPackageName(name) {
|
|
983
|
-
const validateNpmPackageName = getValidateNpmPackageName()
|
|
984
|
-
return validateNpmPackageName(name).validForOldPackages
|
|
985
|
-
}
|
|
986
|
-
|
|
987
|
-
/*@__NO_SIDE_EFFECTS__*/
|
|
988
|
-
function pkgJsonToEditable(pkgJson, options) {
|
|
989
|
-
const { normalize, ...normalizeOptions } = { __proto__: null, ...options }
|
|
990
|
-
const EditablePackageJson = getEditablePackageJsonClass()
|
|
991
|
-
return new EditablePackageJson().fromContent(
|
|
992
|
-
normalize ? normalizePackageJson(pkgJson, normalizeOptions) : pkgJson
|
|
993
|
-
)
|
|
994
|
-
}
|
|
995
|
-
|
|
996
|
-
/*@__NO_SIDE_EFFECTS__*/
|
|
997
|
-
function normalizePackageJson(pkgJson, options) {
|
|
998
|
-
const { preserve } = { __proto__: null, ...options }
|
|
999
|
-
const preserved = [
|
|
1000
|
-
['_id', undefined],
|
|
1001
|
-
['readme', undefined],
|
|
1002
|
-
...(ObjectHasOwn(pkgJson, 'bugs') ? [] : [['bugs', undefined]]),
|
|
1003
|
-
...(ObjectHasOwn(pkgJson, 'homepage') ? [] : [['homepage', undefined]]),
|
|
1004
|
-
...(ObjectHasOwn(pkgJson, 'name') ? [] : [['name', undefined]]),
|
|
1005
|
-
...(ObjectHasOwn(pkgJson, 'version') ? [] : [['version', undefined]]),
|
|
1006
|
-
...(ArrayIsArray(preserve)
|
|
1007
|
-
? preserve.map(k => [
|
|
1008
|
-
k,
|
|
1009
|
-
ObjectHasOwn(pkgJson, k) ? pkgJson[k] : undefined
|
|
1010
|
-
])
|
|
1011
|
-
: [])
|
|
1012
|
-
]
|
|
1013
|
-
const normalizePackageData = getNormalizePackageData()
|
|
1014
|
-
normalizePackageData(pkgJson)
|
|
1015
|
-
merge(pkgJson, findPackageExtensions(pkgJson.name, pkgJson.version))
|
|
1016
|
-
// Revert/remove properties we don't care to have normalized.
|
|
1017
|
-
// Properties with undefined values are omitted when saved as JSON.
|
|
1018
|
-
for (const { 0: key, 1: value } of preserved) {
|
|
1019
|
-
pkgJson[key] = value
|
|
1020
|
-
}
|
|
1021
|
-
return pkgJson
|
|
1022
|
-
}
|
|
1023
|
-
|
|
1024
|
-
/*@__NO_SIDE_EFFECTS__*/
|
|
1025
|
-
async function packPackage(spec, options) {
|
|
1026
|
-
const pack = getPack()
|
|
1027
|
-
return await pack(spec, {
|
|
1028
|
-
__proto__: null,
|
|
1029
|
-
signal: abortSignal,
|
|
1030
|
-
...options,
|
|
1031
|
-
packumentCache,
|
|
1032
|
-
preferOffline: true
|
|
1033
|
-
})
|
|
1034
|
-
}
|
|
1035
|
-
|
|
1036
|
-
/*@__NO_SIDE_EFFECTS__*/
|
|
1037
|
-
function parseSpdxExp(spdxExp) {
|
|
1038
|
-
const spdxExpParse = getSpdxExpParse()
|
|
1039
|
-
try {
|
|
1040
|
-
return spdxExpParse(spdxExp)
|
|
1041
|
-
} catch {}
|
|
1042
|
-
const spdxCorrect = getSpdxCorrect()
|
|
1043
|
-
const corrected = spdxCorrect(spdxExp)
|
|
1044
|
-
return corrected ? spdxExpParse(corrected) : null
|
|
1045
|
-
}
|
|
1046
|
-
|
|
1047
|
-
/*@__NO_SIDE_EFFECTS__*/
|
|
1048
|
-
async function readPackageJson(filepath, options) {
|
|
1049
|
-
const { editable, normalize, throws, ...normalizeOptions } = {
|
|
1050
|
-
__proto__: null,
|
|
1051
|
-
...options
|
|
1052
|
-
}
|
|
1053
|
-
const pkgJson = await readJson(resolvePackageJsonPath(filepath), { throws })
|
|
1054
|
-
if (pkgJson) {
|
|
1055
|
-
return editable
|
|
1056
|
-
? await toEditablePackageJson(pkgJson, {
|
|
1057
|
-
path: filepath,
|
|
1058
|
-
normalize,
|
|
1059
|
-
...normalizeOptions
|
|
1060
|
-
})
|
|
1061
|
-
: normalize
|
|
1062
|
-
? normalizePackageJson(pkgJson, normalizeOptions)
|
|
1063
|
-
: pkgJson
|
|
1064
|
-
}
|
|
1065
|
-
return null
|
|
1066
|
-
}
|
|
1067
|
-
|
|
1068
|
-
/*@__NO_SIDE_EFFECTS__*/
|
|
1069
|
-
function readPackageJsonSync(filepath, options) {
|
|
1070
|
-
const { editable, normalize, throws, ...normalizeOptions } = {
|
|
1071
|
-
__proto__: null,
|
|
1072
|
-
...options
|
|
1073
|
-
}
|
|
1074
|
-
const pkgJson = readJsonSync(resolvePackageJsonPath(filepath), { throws })
|
|
1075
|
-
if (pkgJson) {
|
|
1076
|
-
return editable
|
|
1077
|
-
? toEditablePackageJsonSync(pkgJson, {
|
|
1078
|
-
path: filepath,
|
|
1079
|
-
normalize,
|
|
1080
|
-
...normalizeOptions
|
|
1081
|
-
})
|
|
1082
|
-
: normalize
|
|
1083
|
-
? normalizePackageJson(pkgJson, normalizeOptions)
|
|
1084
|
-
: pkgJson
|
|
1085
|
-
}
|
|
1086
|
-
return null
|
|
1087
|
-
}
|
|
1088
|
-
|
|
1089
|
-
/*@__NO_SIDE_EFFECTS__*/
|
|
1090
|
-
function resolveEscapedScope(sockRegPkgName) {
|
|
1091
|
-
return escapedScopeRegExp.exec(sockRegPkgName)?.[0] ?? ''
|
|
1092
|
-
}
|
|
1093
|
-
|
|
1094
|
-
/*@__NO_SIDE_EFFECTS__*/
|
|
1095
|
-
async function resolveGitHubTgzUrl(pkgNameOrId, where) {
|
|
1096
|
-
const whereIsPkgJson = isObjectObject(where)
|
|
1097
|
-
const pkgJson = whereIsPkgJson
|
|
1098
|
-
? where
|
|
1099
|
-
: await readPackageJson(where, { normalize: true })
|
|
1100
|
-
const { version } = pkgJson
|
|
1101
|
-
const npmPackageArg = getNpmPackageArg()
|
|
1102
|
-
const parsedSpec = npmPackageArg(
|
|
1103
|
-
pkgNameOrId,
|
|
1104
|
-
whereIsPkgJson ? undefined : where
|
|
1105
|
-
)
|
|
1106
|
-
const isTarballUrl = isGitHubTgzSpec(parsedSpec)
|
|
1107
|
-
if (isTarballUrl) {
|
|
1108
|
-
return parsedSpec.saveSpec
|
|
1109
|
-
}
|
|
1110
|
-
const isGitHubUrl = isGitHubUrlSpec(parsedSpec)
|
|
1111
|
-
const { project, user } = isGitHubUrl
|
|
1112
|
-
? parsedSpec.hosted
|
|
1113
|
-
: getRepoUrlDetails(pkgJson.repository?.url)
|
|
1114
|
-
|
|
1115
|
-
if (user && project) {
|
|
1116
|
-
let apiUrl = ''
|
|
1117
|
-
if (isGitHubUrl) {
|
|
1118
|
-
apiUrl = gitHubTagRefUrl(user, project, parsedSpec.gitCommittish)
|
|
1119
|
-
} else {
|
|
1120
|
-
const fetcher = getFetcher()
|
|
1121
|
-
// First try to resolve the sha for a tag starting with "v", e.g. v1.2.3.
|
|
1122
|
-
apiUrl = gitHubTagRefUrl(user, project, `v${version}`)
|
|
1123
|
-
if (!(await fetcher(apiUrl, { method: 'head' })).ok) {
|
|
1124
|
-
// If a sha isn't found, try again with the "v" removed, e.g. 1.2.3.
|
|
1125
|
-
apiUrl = gitHubTagRefUrl(user, project, version)
|
|
1126
|
-
if (!(await fetcher(apiUrl, { method: 'head' })).ok) {
|
|
1127
|
-
apiUrl = ''
|
|
1128
|
-
}
|
|
1129
|
-
}
|
|
1130
|
-
}
|
|
1131
|
-
if (apiUrl) {
|
|
1132
|
-
const fetcher = getFetcher()
|
|
1133
|
-
const resp = await fetcher(apiUrl)
|
|
1134
|
-
const json = await resp.json()
|
|
1135
|
-
const sha = json?.object?.sha
|
|
1136
|
-
if (sha) {
|
|
1137
|
-
return gitHubTgzUrl(user, project, sha)
|
|
1138
|
-
}
|
|
1139
|
-
}
|
|
1140
|
-
}
|
|
1141
|
-
return ''
|
|
1142
|
-
}
|
|
1143
|
-
|
|
1144
|
-
/*@__NO_SIDE_EFFECTS__*/
|
|
1145
|
-
function resolveOriginalPackageName(sockRegPkgName) {
|
|
1146
|
-
const name = sockRegPkgName.startsWith(`${SOCKET_REGISTRY_SCOPE}/`)
|
|
1147
|
-
? sockRegPkgName.slice(SOCKET_REGISTRY_SCOPE.length + 1)
|
|
1148
|
-
: sockRegPkgName
|
|
1149
|
-
const escapedScope = resolveEscapedScope(name)
|
|
1150
|
-
return escapedScope
|
|
1151
|
-
? `${unescapeScope(escapedScope)}/${name.slice(escapedScope.length)}`
|
|
1152
|
-
: name
|
|
1153
|
-
}
|
|
1154
|
-
|
|
1155
|
-
/*@__NO_SIDE_EFFECTS__*/
|
|
1156
|
-
function resolvePackageJsonDirname(filepath) {
|
|
1157
|
-
if (filepath.endsWith('package.json')) {
|
|
1158
|
-
const path = getPath()
|
|
1159
|
-
return path.dirname(filepath)
|
|
1160
|
-
}
|
|
1161
|
-
return filepath
|
|
1162
|
-
}
|
|
1163
|
-
|
|
1164
|
-
/*@__NO_SIDE_EFFECTS__*/
|
|
1165
|
-
function resolvePackageJsonEntryExports(entryExports) {
|
|
1166
|
-
// If conditional exports main sugar
|
|
1167
|
-
// https://nodejs.org/api/packages.html#exports-sugar
|
|
1168
|
-
if (typeof entryExports === 'string' || ArrayIsArray(entryExports)) {
|
|
1169
|
-
return { '.': entryExports }
|
|
1170
|
-
}
|
|
1171
|
-
if (isConditionalExports(entryExports)) {
|
|
1172
|
-
return entryExports
|
|
1173
|
-
}
|
|
1174
|
-
return isObject(entryExports) ? entryExports : undefined
|
|
1175
|
-
}
|
|
1176
|
-
|
|
1177
|
-
/*@__NO_SIDE_EFFECTS__*/
|
|
1178
|
-
function resolvePackageJsonPath(filepath) {
|
|
1179
|
-
if (filepath.endsWith('package.json')) {
|
|
1180
|
-
return filepath
|
|
1181
|
-
}
|
|
1182
|
-
const path = getPath()
|
|
1183
|
-
return path.join(filepath, 'package.json')
|
|
1184
|
-
}
|
|
1185
|
-
|
|
1186
|
-
/*@__NO_SIDE_EFFECTS__*/
|
|
1187
|
-
function resolvePackageLicenses(licenseFieldValue, where) {
|
|
1188
|
-
// Based off of validate-npm-package-license which npm, by way of normalize-package-data,
|
|
1189
|
-
// uses to validate license field values:
|
|
1190
|
-
// https://github.com/kemitchell/validate-npm-package-license.js/blob/v3.0.4/index.js#L40-L41
|
|
1191
|
-
if (
|
|
1192
|
-
licenseFieldValue === 'UNLICENSED' ||
|
|
1193
|
-
licenseFieldValue === 'UNLICENCED'
|
|
1194
|
-
) {
|
|
1195
|
-
return [{ license: 'UNLICENSED' }]
|
|
1196
|
-
}
|
|
1197
|
-
// Match "SEE LICENSE IN <relativeFilepathToLicense>"
|
|
1198
|
-
// https://github.com/kemitchell/validate-npm-package-license.js/blob/v3.0.4/index.js#L48-L53
|
|
1199
|
-
const match = fileReferenceRegExp.exec(licenseFieldValue)
|
|
1200
|
-
if (match) {
|
|
1201
|
-
const path = getPath()
|
|
1202
|
-
return [
|
|
1203
|
-
{
|
|
1204
|
-
license: licenseFieldValue,
|
|
1205
|
-
inFile: normalizePath(path.relative(where, match[1]))
|
|
1206
|
-
}
|
|
1207
|
-
]
|
|
1208
|
-
}
|
|
1209
|
-
const licenseNodes = []
|
|
1210
|
-
const ast = parseSpdxExp(licenseFieldValue)
|
|
1211
|
-
if (ast) {
|
|
1212
|
-
// SPDX expressions are valid, too except if they contain "LicenseRef" or
|
|
1213
|
-
// "DocumentRef". If the licensing terms cannot be described with standardized
|
|
1214
|
-
// SPDX identifiers, then the terms should be put in a file in the package
|
|
1215
|
-
// and the license field should point users there, e.g. "SEE LICENSE IN LICENSE.txt".
|
|
1216
|
-
// https://github.com/kemitchell/validate-npm-package-license.js/blob/v3.0.4/index.js#L18-L24
|
|
1217
|
-
visitLicenses(ast, {
|
|
1218
|
-
__proto__: null,
|
|
1219
|
-
License(node) {
|
|
1220
|
-
const { license } = node
|
|
1221
|
-
if (
|
|
1222
|
-
license.startsWith('LicenseRef') ||
|
|
1223
|
-
license.startsWith('DocumentRef')
|
|
1224
|
-
) {
|
|
1225
|
-
licenseNodes.length = 0
|
|
1226
|
-
return false
|
|
1227
|
-
}
|
|
1228
|
-
licenseNodes.push(node)
|
|
1229
|
-
}
|
|
1230
|
-
})
|
|
1231
|
-
}
|
|
1232
|
-
return licenseNodes
|
|
1233
|
-
}
|
|
1234
|
-
|
|
1235
|
-
/*@__NO_SIDE_EFFECTS__*/
|
|
1236
|
-
function resolvePackageName(purlObj, delimiter = '/') {
|
|
1237
|
-
const { name, namespace } = purlObj
|
|
1238
|
-
return `${namespace ? `${namespace}${delimiter}` : ''}${name}`
|
|
1239
|
-
}
|
|
1240
|
-
|
|
1241
|
-
/*@__NO_SIDE_EFFECTS__*/
|
|
1242
|
-
function resolveRegistryPackageName(pkgName) {
|
|
1243
|
-
const purlObj = getPackageURL().fromString(`pkg:npm/${pkgName}`)
|
|
1244
|
-
return purlObj.namespace
|
|
1245
|
-
? `${purlObj.namespace.slice(1)}${REGISTRY_SCOPE_DELIMITER}${purlObj.name}`
|
|
1246
|
-
: pkgName
|
|
1247
|
-
}
|
|
1248
|
-
|
|
1249
|
-
/*@__NO_SIDE_EFFECTS__*/
|
|
1250
|
-
async function toEditablePackageJson(pkgJson, options) {
|
|
1251
|
-
const { path: filepath, ...pkgJsonToEditableOptions } = {
|
|
1252
|
-
__proto__: null,
|
|
1253
|
-
...options
|
|
1254
|
-
}
|
|
1255
|
-
const { normalize, ...normalizeOptions } = pkgJsonToEditableOptions
|
|
1256
|
-
if (typeof filepath !== 'string') {
|
|
1257
|
-
return pkgJsonToEditable(pkgJson, pkgJsonToEditableOptions)
|
|
1258
|
-
}
|
|
1259
|
-
const EditablePackageJson = getEditablePackageJsonClass()
|
|
1260
|
-
const pkgJsonPath = resolvePackageJsonDirname(filepath)
|
|
1261
|
-
return (
|
|
1262
|
-
await EditablePackageJson.load(pkgJsonPath, { create: true })
|
|
1263
|
-
).fromJSON(
|
|
1264
|
-
`${JSON.stringify(
|
|
1265
|
-
normalize
|
|
1266
|
-
? normalizePackageJson(pkgJson, {
|
|
1267
|
-
__proto__: null,
|
|
1268
|
-
...(isNodeModules(pkgJsonPath) ? {} : { preserve: ['repository'] }),
|
|
1269
|
-
...normalizeOptions
|
|
1270
|
-
})
|
|
1271
|
-
: pkgJson,
|
|
1272
|
-
null,
|
|
1273
|
-
2
|
|
1274
|
-
)}\n`
|
|
1275
|
-
)
|
|
1276
|
-
}
|
|
1277
|
-
|
|
1278
|
-
/*@__NO_SIDE_EFFECTS__*/
|
|
1279
|
-
function toEditablePackageJsonSync(pkgJson, options) {
|
|
1280
|
-
const { path: filepath, ...pkgJsonToEditableOptions } = {
|
|
1281
|
-
__proto__: null,
|
|
1282
|
-
...options
|
|
1283
|
-
}
|
|
1284
|
-
const { normalize, ...normalizeOptions } = pkgJsonToEditableOptions
|
|
1285
|
-
if (typeof filepath !== 'string') {
|
|
1286
|
-
return pkgJsonToEditable(pkgJson, pkgJsonToEditableOptions)
|
|
1287
|
-
}
|
|
1288
|
-
const EditablePackageJson = getEditablePackageJsonClass()
|
|
1289
|
-
const pkgJsonPath = resolvePackageJsonDirname(filepath)
|
|
1290
|
-
return new EditablePackageJson().create(pkgJsonPath).fromJSON(
|
|
1291
|
-
`${JSON.stringify(
|
|
1292
|
-
normalize
|
|
1293
|
-
? normalizePackageJson(pkgJson, {
|
|
1294
|
-
__proto__: null,
|
|
1295
|
-
...(isNodeModules(pkgJsonPath) ? {} : { preserve: ['repository'] }),
|
|
1296
|
-
...normalizeOptions
|
|
1297
|
-
})
|
|
1298
|
-
: pkgJson,
|
|
1299
|
-
null,
|
|
1300
|
-
2
|
|
1301
|
-
)}\n`
|
|
1302
|
-
)
|
|
1303
|
-
}
|
|
1304
|
-
|
|
1305
|
-
/*@__NO_SIDE_EFFECTS__*/
|
|
1306
|
-
function unescapeScope(escapedScope) {
|
|
1307
|
-
return `@${escapedScope.slice(0, -REGISTRY_SCOPE_DELIMITER.length)}`
|
|
1308
|
-
}
|
|
1309
|
-
|
|
1310
|
-
/*@__NO_SIDE_EFFECTS__*/
|
|
1311
|
-
function visitLicenses(ast, visitor) {
|
|
1312
|
-
const queue = [[createAstNode(ast), undefined]]
|
|
1313
|
-
let pos = 0
|
|
1314
|
-
let { length: queueLength } = queue
|
|
1315
|
-
while (pos < queueLength) {
|
|
1316
|
-
if (pos === LOOP_SENTINEL) {
|
|
1317
|
-
throw new Error('Detected infinite loop in ast crawl of visitLicenses')
|
|
1318
|
-
}
|
|
1319
|
-
// AST nodes can be a license node which looks like
|
|
1320
|
-
// {
|
|
1321
|
-
// license: string
|
|
1322
|
-
// plus?: boolean
|
|
1323
|
-
// exception?: string
|
|
1324
|
-
// }
|
|
1325
|
-
// or a binary operation node which looks like
|
|
1326
|
-
// {
|
|
1327
|
-
// left: License | BinaryOperation
|
|
1328
|
-
// conjunction: string
|
|
1329
|
-
// right: License | BinaryOperation
|
|
1330
|
-
// }
|
|
1331
|
-
const { 0: node, 1: parent } = queue[pos++]
|
|
1332
|
-
const { type } = node
|
|
1333
|
-
if (visitor[type]?.(node, parent) === false) {
|
|
1334
|
-
break
|
|
1335
|
-
}
|
|
1336
|
-
if (type === BINARY_OPERATION_NODE_TYPE) {
|
|
1337
|
-
queue[queueLength++] = [node.left, node]
|
|
1338
|
-
queue[queueLength++] = [node.right, node]
|
|
1339
|
-
}
|
|
1340
|
-
}
|
|
1341
|
-
}
|
|
1342
|
-
|
|
1343
|
-
module.exports = {
|
|
1344
|
-
collectIncompatibleLicenses,
|
|
1345
|
-
collectLicenseWarnings,
|
|
1346
|
-
createPackageJson,
|
|
1347
|
-
extractPackage,
|
|
1348
|
-
fetchPackageManifest,
|
|
1349
|
-
fetchPackagePackument,
|
|
1350
|
-
findTypesForSubpath,
|
|
1351
|
-
getReleaseTag,
|
|
1352
|
-
getRepoUrlDetails,
|
|
1353
|
-
getSubpaths,
|
|
1354
|
-
isBlessedPackageName,
|
|
1355
|
-
isConditionalExports,
|
|
1356
|
-
isGitHubTgzSpec,
|
|
1357
|
-
isGitHubUrlSpec,
|
|
1358
|
-
isSubpathExports,
|
|
1359
|
-
isValidPackageName,
|
|
1360
|
-
normalizePackageJson,
|
|
1361
|
-
packPackage,
|
|
1362
|
-
readPackageJson,
|
|
1363
|
-
readPackageJsonSync,
|
|
1364
|
-
resolveEscapedScope,
|
|
1365
|
-
resolveGitHubTgzUrl,
|
|
1366
|
-
resolveOriginalPackageName,
|
|
1367
|
-
resolvePackageJsonDirname,
|
|
1368
|
-
resolvePackageJsonEntryExports,
|
|
1369
|
-
resolvePackageJsonPath,
|
|
1370
|
-
resolvePackageLicenses,
|
|
1371
|
-
resolvePackageName,
|
|
1372
|
-
resolveRegistryPackageName,
|
|
1373
|
-
toEditablePackageJson,
|
|
1374
|
-
toEditablePackageJsonSync,
|
|
1375
|
-
unescapeScope
|
|
1376
|
-
}
|