@socketsecurity/cli-with-sentry 0.15.20 → 0.15.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/dist/cli.js +1220 -431
- package/dist/cli.js.map +1 -1
- package/dist/constants.js +25 -35
- package/dist/constants.js.map +1 -1
- package/dist/utils.js +14 -14
- package/dist/utils.js.map +1 -1
- package/dist/vendor.js +4 -4
- package/dist/vendor.js.map +1 -1
- package/external/@socketsecurity/registry/lib/promises.js +1 -1
- package/external/@socketsecurity/registry/package.json +1 -1
- package/package.json +11 -10
- package/dist/.config/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 -4
- package/dist/types/commands/analytics/fetch-org-analytics.d.mts.map +0 -1
- package/dist/types/commands/analytics/fetch-repo-analytics.d.mts +0 -4
- package/dist/types/commands/analytics/fetch-repo-analytics.d.mts.map +0 -1
- package/dist/types/commands/analytics/handle-analytics.d.mts +0 -9
- package/dist/types/commands/analytics/handle-analytics.d.mts.map +0 -1
- package/dist/types/commands/analytics/output-analytics.d.mts +0 -28
- package/dist/types/commands/analytics/output-analytics.d.mts.map +0 -1
- package/dist/types/commands/audit-log/cmd-audit-log.d.mts +0 -10
- package/dist/types/commands/audit-log/cmd-audit-log.d.mts.map +0 -1
- package/dist/types/commands/audit-log/fetch-audit-log.d.mts +0 -10
- 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/cdxgen/cmd-cdxgen.d.mts +0 -10
- package/dist/types/commands/cdxgen/cmd-cdxgen.d.mts.map +0 -1
- package/dist/types/commands/cdxgen/handle-cdxgen.d.mts +0 -4
- package/dist/types/commands/cdxgen/handle-cdxgen.d.mts.map +0 -1
- package/dist/types/commands/ci/cmd-ci.d.mts +0 -10
- package/dist/types/commands/ci/cmd-ci.d.mts.map +0 -1
- package/dist/types/commands/ci/fetch-default-org-slug.d.mts +0 -3
- package/dist/types/commands/ci/fetch-default-org-slug.d.mts.map +0 -1
- package/dist/types/commands/ci/handle-ci.d.mts +0 -2
- package/dist/types/commands/ci/handle-ci.d.mts.map +0 -1
- package/dist/types/commands/config/cmd-config-auto.d.mts +0 -10
- package/dist/types/commands/config/cmd-config-auto.d.mts.map +0 -1
- package/dist/types/commands/config/cmd-config-get.d.mts +0 -10
- package/dist/types/commands/config/cmd-config-get.d.mts.map +0 -1
- package/dist/types/commands/config/cmd-config-list.d.mts +0 -10
- package/dist/types/commands/config/cmd-config-list.d.mts.map +0 -1
- package/dist/types/commands/config/cmd-config-set.d.mts +0 -10
- package/dist/types/commands/config/cmd-config-set.d.mts.map +0 -1
- package/dist/types/commands/config/cmd-config-unset.d.mts +0 -10
- package/dist/types/commands/config/cmd-config-unset.d.mts.map +0 -1
- package/dist/types/commands/config/cmd-config.d.mts +0 -3
- package/dist/types/commands/config/cmd-config.d.mts.map +0 -1
- package/dist/types/commands/config/discover-config-value.d.mts +0 -3
- package/dist/types/commands/config/discover-config-value.d.mts.map +0 -1
- package/dist/types/commands/config/handle-config-auto.d.mts +0 -7
- package/dist/types/commands/config/handle-config-auto.d.mts.map +0 -1
- package/dist/types/commands/config/handle-config-get.d.mts +0 -7
- package/dist/types/commands/config/handle-config-get.d.mts.map +0 -1
- package/dist/types/commands/config/handle-config-set.d.mts +0 -8
- package/dist/types/commands/config/handle-config-set.d.mts.map +0 -1
- package/dist/types/commands/config/handle-config-unset.d.mts +0 -7
- package/dist/types/commands/config/handle-config-unset.d.mts.map +0 -1
- package/dist/types/commands/config/output-config-auto.d.mts +0 -4
- package/dist/types/commands/config/output-config-auto.d.mts.map +0 -1
- package/dist/types/commands/config/output-config-get.d.mts +0 -4
- package/dist/types/commands/config/output-config-get.d.mts.map +0 -1
- package/dist/types/commands/config/output-config-list.d.mts +0 -6
- package/dist/types/commands/config/output-config-list.d.mts.map +0 -1
- package/dist/types/commands/config/output-config-set.d.mts +0 -3
- package/dist/types/commands/config/output-config-set.d.mts.map +0 -1
- package/dist/types/commands/config/output-config-unset.d.mts +0 -3
- package/dist/types/commands/config/output-config-unset.d.mts.map +0 -1
- package/dist/types/commands/dependencies/cmd-dependencies.d.mts +0 -10
- package/dist/types/commands/dependencies/cmd-dependencies.d.mts.map +0 -1
- package/dist/types/commands/dependencies/fetch-dependencies.d.mts +0 -7
- package/dist/types/commands/dependencies/fetch-dependencies.d.mts.map +0 -1
- package/dist/types/commands/dependencies/handle-dependencies.d.mts +0 -7
- package/dist/types/commands/dependencies/handle-dependencies.d.mts.map +0 -1
- package/dist/types/commands/dependencies/output-dependencies.d.mts +0 -8
- package/dist/types/commands/dependencies/output-dependencies.d.mts.map +0 -1
- package/dist/types/commands/diff-scan/cmd-diff-scan-get.d.mts +0 -10
- package/dist/types/commands/diff-scan/cmd-diff-scan-get.d.mts.map +0 -1
- package/dist/types/commands/diff-scan/cmd-diff-scan.d.mts +0 -3
- package/dist/types/commands/diff-scan/cmd-diff-scan.d.mts.map +0 -1
- package/dist/types/commands/diff-scan/fetch-diff-scan.d.mts +0 -8
- package/dist/types/commands/diff-scan/fetch-diff-scan.d.mts.map +0 -1
- package/dist/types/commands/diff-scan/handle-diff-scan.d.mts +0 -10
- package/dist/types/commands/diff-scan/handle-diff-scan.d.mts.map +0 -1
- package/dist/types/commands/diff-scan/output-diff-scan.d.mts +0 -8
- package/dist/types/commands/diff-scan/output-diff-scan.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/git.d.mts +0 -14
- package/dist/types/commands/fix/git.d.mts.map +0 -1
- package/dist/types/commands/fix/npm-fix.d.mts +0 -4
- package/dist/types/commands/fix/npm-fix.d.mts.map +0 -1
- package/dist/types/commands/fix/open-pr.d.mts +0 -28
- package/dist/types/commands/fix/open-pr.d.mts.map +0 -1
- package/dist/types/commands/fix/pnpm-fix.d.mts +0 -4
- package/dist/types/commands/fix/pnpm-fix.d.mts.map +0 -1
- package/dist/types/commands/fix/run-fix.d.mts +0 -3
- package/dist/types/commands/fix/run-fix.d.mts.map +0 -1
- package/dist/types/commands/fix/shared.d.mts +0 -9
- package/dist/types/commands/fix/shared.d.mts.map +0 -1
- package/dist/types/commands/fix/types.d.mts +0 -18
- package/dist/types/commands/fix/types.d.mts.map +0 -1
- package/dist/types/commands/info/cmd-info.d.mts +0 -10
- package/dist/types/commands/info/cmd-info.d.mts.map +0 -1
- package/dist/types/commands/info/fetch-package-info.d.mts +0 -3
- package/dist/types/commands/info/fetch-package-info.d.mts.map +0 -1
- package/dist/types/commands/info/handle-package-info.d.mts +0 -17
- package/dist/types/commands/info/handle-package-info.d.mts.map +0 -1
- package/dist/types/commands/info/output-package-info.d.mts +0 -10
- package/dist/types/commands/info/output-package-info.d.mts.map +0 -1
- package/dist/types/commands/install/cmd-install-completion.d.mts +0 -10
- package/dist/types/commands/install/cmd-install-completion.d.mts.map +0 -1
- package/dist/types/commands/install/cmd-install.d.mts +0 -3
- package/dist/types/commands/install/cmd-install.d.mts.map +0 -1
- package/dist/types/commands/install/handle-install-completion.d.mts +0 -2
- package/dist/types/commands/install/handle-install-completion.d.mts.map +0 -1
- package/dist/types/commands/install/output-install-completion.d.mts +0 -12
- package/dist/types/commands/install/output-install-completion.d.mts.map +0 -1
- package/dist/types/commands/install/setup-tab-completion.d.mts +0 -13
- package/dist/types/commands/install/setup-tab-completion.d.mts.map +0 -1
- package/dist/types/commands/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 -2
- package/dist/types/commands/login/attempt-login.d.mts.map +0 -1
- package/dist/types/commands/login/cmd-login.d.mts +0 -10
- package/dist/types/commands/login/cmd-login.d.mts.map +0 -1
- package/dist/types/commands/logout/apply-logout.d.mts +0 -2
- package/dist/types/commands/logout/apply-logout.d.mts.map +0 -1
- package/dist/types/commands/logout/attempt-logout.d.mts +0 -2
- package/dist/types/commands/logout/attempt-logout.d.mts.map +0 -1
- package/dist/types/commands/logout/cmd-logout.d.mts +0 -10
- package/dist/types/commands/logout/cmd-logout.d.mts.map +0 -1
- package/dist/types/commands/manifest/cmd-manifest-auto.d.mts +0 -10
- package/dist/types/commands/manifest/cmd-manifest-auto.d.mts.map +0 -1
- package/dist/types/commands/manifest/cmd-manifest-cdxgen.d.mts +0 -10
- package/dist/types/commands/manifest/cmd-manifest-cdxgen.d.mts.map +0 -1
- package/dist/types/commands/manifest/cmd-manifest-conda.d.mts +0 -10
- package/dist/types/commands/manifest/cmd-manifest-conda.d.mts.map +0 -1
- package/dist/types/commands/manifest/cmd-manifest-gradle.d.mts +0 -10
- package/dist/types/commands/manifest/cmd-manifest-gradle.d.mts.map +0 -1
- package/dist/types/commands/manifest/cmd-manifest-kotlin.d.mts +0 -10
- package/dist/types/commands/manifest/cmd-manifest-kotlin.d.mts.map +0 -1
- package/dist/types/commands/manifest/cmd-manifest-scala.d.mts +0 -10
- package/dist/types/commands/manifest/cmd-manifest-scala.d.mts.map +0 -1
- package/dist/types/commands/manifest/cmd-manifest.d.mts +0 -10
- package/dist/types/commands/manifest/cmd-manifest.d.mts.map +0 -1
- package/dist/types/commands/manifest/convert-conda-to-requirements.d.mts +0 -7
- 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 -2
- 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 -2
- 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 -9
- package/dist/types/commands/manifest/detect-manifest-actions.d.mts.map +0 -1
- package/dist/types/commands/manifest/generate_auto_manifest.d.mts +0 -4
- package/dist/types/commands/manifest/generate_auto_manifest.d.mts.map +0 -1
- package/dist/types/commands/manifest/handle-manifest-conda.d.mts +0 -3
- package/dist/types/commands/manifest/handle-manifest-conda.d.mts.map +0 -1
- package/dist/types/commands/manifest/output-requirements.d.mts +0 -6
- package/dist/types/commands/manifest/output-requirements.d.mts.map +0 -1
- package/dist/types/commands/manifest/run-cdxgen.d.mts +0 -2
- package/dist/types/commands/manifest/run-cdxgen.d.mts.map +0 -1
- package/dist/types/commands/npm/cmd-npm.d.mts +0 -10
- package/dist/types/commands/npm/cmd-npm.d.mts.map +0 -1
- package/dist/types/commands/npx/cmd-npx.d.mts +0 -10
- package/dist/types/commands/npx/cmd-npx.d.mts.map +0 -1
- package/dist/types/commands/oops/cmd-oops.d.mts +0 -10
- package/dist/types/commands/oops/cmd-oops.d.mts.map +0 -1
- package/dist/types/commands/optimize/add-overrides.d.mts +0 -20
- package/dist/types/commands/optimize/add-overrides.d.mts.map +0 -1
- package/dist/types/commands/optimize/apply-optimization.d.mts +0 -2
- 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 -4
- 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 -9
- package/dist/types/commands/optimize/get-overrides-by-agent.d.mts.map +0 -1
- package/dist/types/commands/optimize/lockfile-includes-by-agent.d.mts +0 -3
- 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 -7
- package/dist/types/commands/optimize/ls-by-agent.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 -10
- package/dist/types/commands/optimize/update-lockfile.d.mts.map +0 -1
- package/dist/types/commands/optimize/update-manifest-by-agent.d.mts +0 -5
- package/dist/types/commands/optimize/update-manifest-by-agent.d.mts.map +0 -1
- package/dist/types/commands/organization/cmd-organization-list.d.mts +0 -10
- package/dist/types/commands/organization/cmd-organization-list.d.mts.map +0 -1
- package/dist/types/commands/organization/cmd-organization-policy-license.d.mts +0 -10
- package/dist/types/commands/organization/cmd-organization-policy-license.d.mts.map +0 -1
- package/dist/types/commands/organization/cmd-organization-policy-security.d.mts +0 -10
- package/dist/types/commands/organization/cmd-organization-policy-security.d.mts.map +0 -1
- package/dist/types/commands/organization/cmd-organization-policy.d.mts +0 -3
- package/dist/types/commands/organization/cmd-organization-policy.d.mts.map +0 -1
- package/dist/types/commands/organization/cmd-organization-quota.d.mts +0 -10
- package/dist/types/commands/organization/cmd-organization-quota.d.mts.map +0 -1
- package/dist/types/commands/organization/cmd-organization.d.mts +0 -3
- package/dist/types/commands/organization/cmd-organization.d.mts.map +0 -1
- package/dist/types/commands/organization/fetch-license-policy.d.mts +0 -4
- package/dist/types/commands/organization/fetch-license-policy.d.mts.map +0 -1
- package/dist/types/commands/organization/fetch-organization-list.d.mts +0 -4
- package/dist/types/commands/organization/fetch-organization-list.d.mts.map +0 -1
- package/dist/types/commands/organization/fetch-quota.d.mts +0 -4
- package/dist/types/commands/organization/fetch-quota.d.mts.map +0 -1
- package/dist/types/commands/organization/fetch-security-policy.d.mts +0 -4
- package/dist/types/commands/organization/fetch-security-policy.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-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 -4
- 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-purl-score.d.mts +0 -4
- package/dist/types/commands/package/output-purl-score.d.mts.map +0 -1
- package/dist/types/commands/package/output-purls-shallow-score.d.mts +0 -4
- 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 -5
- package/dist/types/commands/package/parse-package-specifiers.d.mts.map +0 -1
- package/dist/types/commands/raw-npm/cmd-raw-npm.d.mts +0 -10
- package/dist/types/commands/raw-npm/cmd-raw-npm.d.mts.map +0 -1
- package/dist/types/commands/raw-npm/run-raw-npm.d.mts +0 -2
- package/dist/types/commands/raw-npm/run-raw-npm.d.mts.map +0 -1
- package/dist/types/commands/raw-npx/cmd-raw-npx.d.mts +0 -10
- package/dist/types/commands/raw-npx/cmd-raw-npx.d.mts.map +0 -1
- package/dist/types/commands/raw-npx/run-raw-npx.d.mts +0 -2
- package/dist/types/commands/raw-npx/run-raw-npx.d.mts.map +0 -1
- package/dist/types/commands/report/cmd-report-create.d.mts +0 -10
- package/dist/types/commands/report/cmd-report-create.d.mts.map +0 -1
- package/dist/types/commands/report/cmd-report-view.d.mts +0 -10
- package/dist/types/commands/report/cmd-report-view.d.mts.map +0 -1
- package/dist/types/commands/report/cmd-report.d.mts +0 -3
- package/dist/types/commands/report/cmd-report.d.mts.map +0 -1
- package/dist/types/commands/repos/cmd-repos-create.d.mts +0 -10
- package/dist/types/commands/repos/cmd-repos-create.d.mts.map +0 -1
- package/dist/types/commands/repos/cmd-repos-del.d.mts +0 -10
- package/dist/types/commands/repos/cmd-repos-del.d.mts.map +0 -1
- package/dist/types/commands/repos/cmd-repos-list.d.mts +0 -10
- package/dist/types/commands/repos/cmd-repos-list.d.mts.map +0 -1
- package/dist/types/commands/repos/cmd-repos-update.d.mts +0 -10
- package/dist/types/commands/repos/cmd-repos-update.d.mts.map +0 -1
- package/dist/types/commands/repos/cmd-repos-view.d.mts +0 -10
- package/dist/types/commands/repos/cmd-repos-view.d.mts.map +0 -1
- package/dist/types/commands/repos/cmd-repos.d.mts +0 -3
- package/dist/types/commands/repos/cmd-repos.d.mts.map +0 -1
- package/dist/types/commands/repos/fetch-create-repo.d.mts +0 -11
- package/dist/types/commands/repos/fetch-create-repo.d.mts.map +0 -1
- package/dist/types/commands/repos/fetch-delete-repo.d.mts +0 -4
- package/dist/types/commands/repos/fetch-delete-repo.d.mts.map +0 -1
- package/dist/types/commands/repos/fetch-list-all-repos.d.mts +0 -8
- package/dist/types/commands/repos/fetch-list-all-repos.d.mts.map +0 -1
- package/dist/types/commands/repos/fetch-list-repos.d.mts +0 -10
- package/dist/types/commands/repos/fetch-list-repos.d.mts.map +0 -1
- package/dist/types/commands/repos/fetch-update-repo.d.mts +0 -11
- package/dist/types/commands/repos/fetch-update-repo.d.mts.map +0 -1
- package/dist/types/commands/repos/fetch-view-repo.d.mts +0 -4
- package/dist/types/commands/repos/fetch-view-repo.d.mts.map +0 -1
- package/dist/types/commands/repos/handle-create-repo.d.mts +0 -10
- package/dist/types/commands/repos/handle-create-repo.d.mts.map +0 -1
- package/dist/types/commands/repos/handle-delete-repo.d.mts +0 -3
- package/dist/types/commands/repos/handle-delete-repo.d.mts.map +0 -1
- package/dist/types/commands/repos/handle-list-repos.d.mts +0 -11
- package/dist/types/commands/repos/handle-list-repos.d.mts.map +0 -1
- package/dist/types/commands/repos/handle-update-repo.d.mts +0 -10
- package/dist/types/commands/repos/handle-update-repo.d.mts.map +0 -1
- package/dist/types/commands/repos/handle-view-repo.d.mts +0 -3
- package/dist/types/commands/repos/handle-view-repo.d.mts.map +0 -1
- package/dist/types/commands/repos/output-create-repo.d.mts +0 -4
- package/dist/types/commands/repos/output-create-repo.d.mts.map +0 -1
- package/dist/types/commands/repos/output-delete-repo.d.mts +0 -4
- package/dist/types/commands/repos/output-delete-repo.d.mts.map +0 -1
- package/dist/types/commands/repos/output-list-repos.d.mts +0 -4
- package/dist/types/commands/repos/output-list-repos.d.mts.map +0 -1
- package/dist/types/commands/repos/output-update-repo.d.mts +0 -4
- package/dist/types/commands/repos/output-update-repo.d.mts.map +0 -1
- package/dist/types/commands/repos/output-view-repo.d.mts +0 -4
- package/dist/types/commands/repos/output-view-repo.d.mts.map +0 -1
- package/dist/types/commands/scan/cmd-scan-create.d.mts +0 -10
- package/dist/types/commands/scan/cmd-scan-create.d.mts.map +0 -1
- package/dist/types/commands/scan/cmd-scan-del.d.mts +0 -10
- package/dist/types/commands/scan/cmd-scan-del.d.mts.map +0 -1
- package/dist/types/commands/scan/cmd-scan-diff.d.mts +0 -10
- package/dist/types/commands/scan/cmd-scan-diff.d.mts.map +0 -1
- package/dist/types/commands/scan/cmd-scan-list.d.mts +0 -3
- package/dist/types/commands/scan/cmd-scan-list.d.mts.map +0 -1
- package/dist/types/commands/scan/cmd-scan-metadata.d.mts +0 -3
- package/dist/types/commands/scan/cmd-scan-metadata.d.mts.map +0 -1
- package/dist/types/commands/scan/cmd-scan-report.d.mts +0 -3
- package/dist/types/commands/scan/cmd-scan-report.d.mts.map +0 -1
- package/dist/types/commands/scan/cmd-scan-view.d.mts +0 -3
- package/dist/types/commands/scan/cmd-scan-view.d.mts.map +0 -1
- package/dist/types/commands/scan/cmd-scan.d.mts +0 -3
- package/dist/types/commands/scan/cmd-scan.d.mts.map +0 -1
- package/dist/types/commands/scan/fetch-create-org-full-scan.d.mts +0 -11
- 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 -4
- 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 -13
- package/dist/types/commands/scan/fetch-list-scans.d.mts.map +0 -1
- package/dist/types/commands/scan/fetch-report-data.d.mts +0 -12
- package/dist/types/commands/scan/fetch-report-data.d.mts.map +0 -1
- package/dist/types/commands/scan/fetch-scan-metadata.d.mts +0 -4
- 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 -4
- package/dist/types/commands/scan/fetch-supported-scan-file-names.d.mts.map +0 -1
- package/dist/types/commands/scan/generate-report.d.mts +0 -41
- package/dist/types/commands/scan/generate-report.d.mts.map +0 -1
- package/dist/types/commands/scan/handle-create-new-scan.d.mts +0 -21
- package/dist/types/commands/scan/handle-create-new-scan.d.mts.map +0 -1
- package/dist/types/commands/scan/handle-delete-scan.d.mts +0 -3
- package/dist/types/commands/scan/handle-delete-scan.d.mts.map +0 -1
- package/dist/types/commands/scan/handle-diff-scan.d.mts +0 -10
- package/dist/types/commands/scan/handle-diff-scan.d.mts.map +0 -1
- package/dist/types/commands/scan/handle-list-scans.d.mts +0 -13
- package/dist/types/commands/scan/handle-list-scans.d.mts.map +0 -1
- package/dist/types/commands/scan/handle-scan-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-report.d.mts +0 -12
- package/dist/types/commands/scan/handle-scan-report.d.mts.map +0 -1
- package/dist/types/commands/scan/handle-scan-view.d.mts +0 -3
- package/dist/types/commands/scan/handle-scan-view.d.mts.map +0 -1
- package/dist/types/commands/scan/output-create-new-scan.d.mts +0 -4
- package/dist/types/commands/scan/output-create-new-scan.d.mts.map +0 -1
- package/dist/types/commands/scan/output-delete-scan.d.mts +0 -4
- package/dist/types/commands/scan/output-delete-scan.d.mts.map +0 -1
- package/dist/types/commands/scan/output-diff-scan.d.mts +0 -8
- package/dist/types/commands/scan/output-diff-scan.d.mts.map +0 -1
- package/dist/types/commands/scan/output-list-scans.d.mts +0 -4
- package/dist/types/commands/scan/output-list-scans.d.mts.map +0 -1
- package/dist/types/commands/scan/output-scan-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-report.d.mts +0 -20
- package/dist/types/commands/scan/output-scan-report.d.mts.map +0 -1
- package/dist/types/commands/scan/output-scan-view.d.mts +0 -4
- package/dist/types/commands/scan/output-scan-view.d.mts.map +0 -1
- package/dist/types/commands/scan/stream-scan.d.mts +0 -2
- package/dist/types/commands/scan/stream-scan.d.mts.map +0 -1
- package/dist/types/commands/scan/suggest-org-slug.d.mts +0 -2
- package/dist/types/commands/scan/suggest-org-slug.d.mts.map +0 -1
- package/dist/types/commands/scan/suggest-repo-slug.d.mts +0 -5
- package/dist/types/commands/scan/suggest-repo-slug.d.mts.map +0 -1
- package/dist/types/commands/scan/suggest_branch_slug.d.mts +0 -2
- package/dist/types/commands/scan/suggest_branch_slug.d.mts.map +0 -1
- package/dist/types/commands/scan/suggest_target.d.mts +0 -2
- package/dist/types/commands/scan/suggest_target.d.mts.map +0 -1
- package/dist/types/commands/threat-feed/cmd-threat-feed.d.mts +0 -10
- package/dist/types/commands/threat-feed/cmd-threat-feed.d.mts.map +0 -1
- package/dist/types/commands/threat-feed/fetch-threat-feed.d.mts +0 -10
- 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 -10
- package/dist/types/commands/threat-feed/handle-threat-feed.d.mts.map +0 -1
- package/dist/types/commands/threat-feed/output-threat-feed.d.mts +0 -4
- package/dist/types/commands/threat-feed/output-threat-feed.d.mts.map +0 -1
- package/dist/types/commands/threat-feed/types.d.mts +0 -15
- package/dist/types/commands/threat-feed/types.d.mts.map +0 -1
- package/dist/types/commands/uninstall/cmd-uninstall-completion.d.mts +0 -9
- package/dist/types/commands/uninstall/cmd-uninstall-completion.d.mts.map +0 -1
- package/dist/types/commands/uninstall/cmd-uninstall.d.mts +0 -3
- package/dist/types/commands/uninstall/cmd-uninstall.d.mts.map +0 -1
- package/dist/types/commands/uninstall/handle-uninstall-completion.d.mts +0 -2
- package/dist/types/commands/uninstall/handle-uninstall-completion.d.mts.map +0 -1
- package/dist/types/commands/uninstall/output-uninstall-completion.d.mts +0 -6
- package/dist/types/commands/uninstall/output-uninstall-completion.d.mts.map +0 -1
- package/dist/types/commands/uninstall/teardown-tab-completion.d.mts +0 -6
- package/dist/types/commands/uninstall/teardown-tab-completion.d.mts.map +0 -1
- package/dist/types/commands/wrapper/add-socket-wrapper.d.mts +0 -2
- package/dist/types/commands/wrapper/add-socket-wrapper.d.mts.map +0 -1
- package/dist/types/commands/wrapper/check-socket-wrapper-setup.d.mts +0 -2
- package/dist/types/commands/wrapper/check-socket-wrapper-setup.d.mts.map +0 -1
- package/dist/types/commands/wrapper/cmd-wrapper.d.mts +0 -10
- package/dist/types/commands/wrapper/cmd-wrapper.d.mts.map +0 -1
- package/dist/types/commands/wrapper/postinstall-wrapper.d.mts +0 -2
- package/dist/types/commands/wrapper/postinstall-wrapper.d.mts.map +0 -1
- package/dist/types/commands/wrapper/remove-socket-wrapper.d.mts +0 -2
- package/dist/types/commands/wrapper/remove-socket-wrapper.d.mts.map +0 -1
- package/dist/types/constants.d.mts +0 -127
- package/dist/types/constants.d.mts.map +0 -1
- package/dist/types/flags.d.mts +0 -14
- package/dist/types/flags.d.mts.map +0 -1
- package/dist/types/instrument-with-sentry.d.mts +0 -2
- package/dist/types/instrument-with-sentry.d.mts.map +0 -1
- package/dist/types/shadow/npm/arborist/index.d.mts +0 -2
- package/dist/types/shadow/npm/arborist/index.d.mts.map +0 -1
- package/dist/types/shadow/npm/arborist/lib/arborist/index.d.mts +0 -22
- package/dist/types/shadow/npm/arborist/lib/arborist/index.d.mts.map +0 -1
- package/dist/types/shadow/npm/arborist/lib/arborist/types.d.mts +0 -47
- package/dist/types/shadow/npm/arborist/lib/arborist/types.d.mts.map +0 -1
- package/dist/types/shadow/npm/arborist/lib/dep-valid.d.mts +0 -3
- package/dist/types/shadow/npm/arborist/lib/dep-valid.d.mts.map +0 -1
- package/dist/types/shadow/npm/arborist/lib/edge.d.mts +0 -62
- package/dist/types/shadow/npm/arborist/lib/edge.d.mts.map +0 -1
- package/dist/types/shadow/npm/arborist/lib/node.d.mts +0 -58
- package/dist/types/shadow/npm/arborist/lib/node.d.mts.map +0 -1
- package/dist/types/shadow/npm/arborist/lib/override-set.d.mts +0 -30
- package/dist/types/shadow/npm/arborist/lib/override-set.d.mts.map +0 -1
- package/dist/types/shadow/npm/arborist-helpers.d.mts +0 -37
- package/dist/types/shadow/npm/arborist-helpers.d.mts.map +0 -1
- package/dist/types/shadow/npm/bin.d.mts +0 -2
- package/dist/types/shadow/npm/bin.d.mts.map +0 -1
- package/dist/types/shadow/npm/inject.d.mts +0 -2
- package/dist/types/shadow/npm/inject.d.mts.map +0 -1
- package/dist/types/shadow/npm/install.d.mts +0 -12
- package/dist/types/shadow/npm/install.d.mts.map +0 -1
- package/dist/types/shadow/npm/link.d.mts +0 -2
- package/dist/types/shadow/npm/link.d.mts.map +0 -1
- package/dist/types/shadow/npm/paths.d.mts +0 -7
- package/dist/types/shadow/npm/paths.d.mts.map +0 -1
- package/dist/types/shadow/npm/proc-log/index.d.mts +0 -3
- package/dist/types/shadow/npm/proc-log/index.d.mts.map +0 -1
- package/dist/types/types.d.mts +0 -16
- 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 -33
- 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 -13
- package/dist/types/utils/alert/severity.d.mts.map +0 -1
- package/dist/types/utils/alerts-map.d.mts +0 -25
- package/dist/types/utils/alerts-map.d.mts.map +0 -1
- package/dist/types/utils/api.d.mts +0 -11
- 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 -4
- package/dist/types/utils/cmd.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 -25
- package/dist/types/utils/config.d.mts.map +0 -1
- package/dist/types/utils/determine-org-slug.d.mts +0 -2
- package/dist/types/utils/determine-org-slug.d.mts.map +0 -1
- package/dist/types/utils/errors.d.mts +0 -14
- package/dist/types/utils/errors.d.mts.map +0 -1
- package/dist/types/utils/fail-msg-with-badge.d.mts +0 -2
- package/dist/types/utils/fail-msg-with-badge.d.mts.map +0 -1
- package/dist/types/utils/fs.d.mts +0 -22
- 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/glob.d.mts +0 -14
- package/dist/types/utils/glob.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 -4
- package/dist/types/utils/markdown.d.mts.map +0 -1
- package/dist/types/utils/meow-with-subcommands.d.mts +0 -45
- package/dist/types/utils/meow-with-subcommands.d.mts.map +0 -1
- package/dist/types/utils/npm-paths.d.mts +0 -7
- package/dist/types/utils/npm-paths.d.mts.map +0 -1
- package/dist/types/utils/objects.d.mts +0 -3
- package/dist/types/utils/objects.d.mts.map +0 -1
- package/dist/types/utils/output-formatting.d.mts +0 -15
- package/dist/types/utils/output-formatting.d.mts.map +0 -1
- package/dist/types/utils/package-environment.d.mts +0 -54
- package/dist/types/utils/package-environment.d.mts.map +0 -1
- package/dist/types/utils/path-resolve.d.mts +0 -10
- package/dist/types/utils/path-resolve.d.mts.map +0 -1
- package/dist/types/utils/pnpm.d.mts +0 -9
- package/dist/types/utils/pnpm.d.mts.map +0 -1
- package/dist/types/utils/sdk.d.mts +0 -8
- package/dist/types/utils/sdk.d.mts.map +0 -1
- package/dist/types/utils/semver.d.mts +0 -5
- package/dist/types/utils/semver.d.mts.map +0 -1
- package/dist/types/utils/serialize-result-json.d.mts +0 -3
- package/dist/types/utils/serialize-result-json.d.mts.map +0 -1
- package/dist/types/utils/socket-package-alert.d.mts +0 -71
- package/dist/types/utils/socket-package-alert.d.mts.map +0 -1
- package/dist/types/utils/socket-url.d.mts +0 -9
- package/dist/types/utils/socket-url.d.mts.map +0 -1
- package/dist/types/utils/spec.d.mts +0 -4
- package/dist/types/utils/spec.d.mts.map +0 -1
- package/dist/types/utils/strings.d.mts +0 -2
- package/dist/types/utils/strings.d.mts.map +0 -1
- package/dist/types/utils/translations.d.mts +0 -593
- package/dist/types/utils/translations.d.mts.map +0 -1
- package/dist/types/utils/walk-nested-map.d.mts +0 -7
- package/dist/types/utils/walk-nested-map.d.mts.map +0 -1
package/dist/constants.js
CHANGED
|
@@ -74,6 +74,7 @@ const LAZY_ENV = () => {
|
|
|
74
74
|
const {
|
|
75
75
|
env
|
|
76
76
|
} = process;
|
|
77
|
+
const GITHUB_TOKEN = envAsString(env['GITHUB_TOKEN']);
|
|
77
78
|
// We inline some environment values so that they CANNOT be influenced by user
|
|
78
79
|
// provided environment variables.
|
|
79
80
|
return Object.freeze({
|
|
@@ -87,9 +88,9 @@ const LAZY_ENV = () => {
|
|
|
87
88
|
// can be used to differentiate when tests are being run locally or by GitHub Actions.
|
|
88
89
|
// https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/store-information-in-variables#default-environment-variables
|
|
89
90
|
GITHUB_ACTIONS: envAsBoolean(env['GITHUB_ACTIONS']),
|
|
90
|
-
// The short ref name of the branch or tag that triggered the GitHub workflow
|
|
91
|
-
// This value matches the branch or tag name shown on GitHub. For example,
|
|
92
|
-
// For pull requests, the format is <pr_number>/merge.
|
|
91
|
+
// The short ref name of the branch or tag that triggered the GitHub workflow
|
|
92
|
+
// run. This value matches the branch or tag name shown on GitHub. For example,
|
|
93
|
+
// feature-branch-1. For pull requests, the format is <pr_number>/merge.
|
|
93
94
|
// https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/store-information-in-variables#default-environment-variables
|
|
94
95
|
GITHUB_REF_NAME: envAsString(env['GITHUB_REF_NAME']),
|
|
95
96
|
// The type of ref that triggered the workflow run. Valid values are branch or tag.
|
|
@@ -98,10 +99,11 @@ const LAZY_ENV = () => {
|
|
|
98
99
|
// The owner and repository name. For example, octocat/Hello-World.
|
|
99
100
|
// https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/store-information-in-variables#default-environment-variables
|
|
100
101
|
GITHUB_REPOSITORY: envAsString(env['GITHUB_REPOSITORY']),
|
|
101
|
-
// The GITHUB_TOKEN secret is a GitHub App installation access token.
|
|
102
|
-
// permissions are limited to the repository that contains the
|
|
102
|
+
// The GITHUB_TOKEN secret is a GitHub App installation access token.
|
|
103
|
+
// The token's permissions are limited to the repository that contains the
|
|
104
|
+
// workflow.
|
|
103
105
|
// https://docs.github.com/en/actions/security-for-github-actions/security-guides/automatic-token-authentication#about-the-github_token-secret
|
|
104
|
-
GITHUB_TOKEN
|
|
106
|
+
GITHUB_TOKEN,
|
|
105
107
|
// Comp-time inlined @cyclonedx/cdxgen package version.
|
|
106
108
|
// The '@rollup/plugin-replace' will replace "process.env['INLINED_CYCLONEDX_CDXGEN_VERSION']".
|
|
107
109
|
INLINED_CYCLONEDX_CDXGEN_VERSION: envAsString("11.3.1"),
|
|
@@ -122,10 +124,10 @@ const LAZY_ENV = () => {
|
|
|
122
124
|
INLINED_SOCKET_CLI_SENTRY_BUILD: envAsBoolean(true),
|
|
123
125
|
// Comp-time inlined Socket package version.
|
|
124
126
|
// The '@rollup/plugin-replace' will replace "process.env['INLINED_SOCKET_CLI_VERSION']".
|
|
125
|
-
INLINED_SOCKET_CLI_VERSION: envAsString("0.15.
|
|
127
|
+
INLINED_SOCKET_CLI_VERSION: envAsString("0.15.22"),
|
|
126
128
|
// Comp-time inlined Socket package version hash.
|
|
127
129
|
// The '@rollup/plugin-replace' will replace "process.env['INLINED_SOCKET_CLI_VERSION_HASH']".
|
|
128
|
-
INLINED_SOCKET_CLI_VERSION_HASH: envAsString("0.15.
|
|
130
|
+
INLINED_SOCKET_CLI_VERSION_HASH: envAsString("0.15.22:53aedba:349464b3:pub"),
|
|
129
131
|
// Comp-time inlined synp package version.
|
|
130
132
|
// The '@rollup/plugin-replace' will replace "process.env['INLINED_SYNP_VERSION']".
|
|
131
133
|
INLINED_SYNP_VERSION: envAsString("1.9.14"),
|
|
@@ -146,40 +148,28 @@ const LAZY_ENV = () => {
|
|
|
146
148
|
PATH: envAsString(env['PATH']),
|
|
147
149
|
// Flag to accepts risks of safe-npm and safe-npx run.
|
|
148
150
|
SOCKET_CLI_ACCEPT_RISKS: envAsBoolean(env[SOCKET_CLI_ACCEPT_RISKS]),
|
|
151
|
+
// Flag to change the base URL for all API-calls.
|
|
152
|
+
// https://github.com/SocketDev/socket-cli?tab=readme-ov-file#environment-variables-for-development
|
|
153
|
+
SOCKET_CLI_API_BASE_URL: envAsString(env['SOCKET_CLI_API_BASE_URL']) || envAsString(env['SOCKET_SECURITY_API_BASE_URL']),
|
|
154
|
+
// Flag to set the proxy all requests are routed through.
|
|
155
|
+
// https://github.com/SocketDev/socket-cli?tab=readme-ov-file#environment-variables-for-development
|
|
156
|
+
SOCKET_CLI_API_PROXY: envAsString(env['SOCKET_CLI_API_PROXY']) || envAsString(env['SOCKET_SECURITY_API_PROXY']),
|
|
157
|
+
// Flag to set the API token.
|
|
158
|
+
// https://github.com/SocketDev/socket-cli?tab=readme-ov-file#environment-variables
|
|
159
|
+
SOCKET_CLI_API_TOKEN: envAsString(env['SOCKET_CLI_API_TOKEN']) || envAsString(env['SOCKET_CLI_API_KEY']) || envAsString(env['SOCKET_SECURITY_API_TOKEN']) || envAsString(env['SOCKET_SECURITY_API_KEY']),
|
|
149
160
|
// Flag containing a JSON stringified Socket configuration object.
|
|
150
161
|
SOCKET_CLI_CONFIG: envAsString(env['SOCKET_CLI_CONFIG']),
|
|
151
162
|
// Flag to help debug Socket CLI.
|
|
152
163
|
SOCKET_CLI_DEBUG: envAsBoolean(env['SOCKET_CLI_DEBUG']),
|
|
164
|
+
// A classic GitHub personal access token with the "repo" scope or a
|
|
165
|
+
// fine-grained access token with at least read/write permissions set for
|
|
166
|
+
// "Contents" and "Pull Request".
|
|
167
|
+
// https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens
|
|
168
|
+
SOCKET_CLI_GITHUB_TOKEN: envAsString(env['SOCKET_CLI_GITHUB_TOKEN']) || envAsString(env['SOCKET_SECURITY_GITHUB_PAT']) || GITHUB_TOKEN,
|
|
153
169
|
// Flag to make the default API token `undefined`.
|
|
154
170
|
SOCKET_CLI_NO_API_TOKEN: envAsBoolean(env['SOCKET_CLI_NO_API_TOKEN']),
|
|
155
171
|
// Flag to view all risks of safe-npm and safe-npx run.
|
|
156
172
|
SOCKET_CLI_VIEW_ALL_RISKS: envAsBoolean(env[SOCKET_CLI_VIEW_ALL_RISKS]),
|
|
157
|
-
// Flag to change the base URL for all API-calls.
|
|
158
|
-
// https://github.com/SocketDev/socket-cli?tab=readme-ov-file#environment-variables-for-development
|
|
159
|
-
SOCKET_SECURITY_API_BASE_URL: envAsString(env['SOCKET_SECURITY_API_BASE_URL']) ||
|
|
160
|
-
// For consistency; allow socket_cli prefix too
|
|
161
|
-
envAsString(env['SOCKET_CLI_API_BASE_URL']),
|
|
162
|
-
// Flag to set the proxy all requests are routed through.
|
|
163
|
-
// https://github.com/SocketDev/socket-cli?tab=readme-ov-file#environment-variables-for-development
|
|
164
|
-
SOCKET_SECURITY_API_PROXY: envAsString(env['SOCKET_SECURITY_API_PROXY']) ||
|
|
165
|
-
// For consistency; allow socket_cli prefix too
|
|
166
|
-
envAsString(env['SOCKET_CLI_API_BASE_URL']),
|
|
167
|
-
// Flag to set the API token.
|
|
168
|
-
// https://github.com/SocketDev/socket-cli?tab=readme-ov-file#environment-variables
|
|
169
|
-
SOCKET_SECURITY_API_TOKEN:
|
|
170
|
-
// Note: These are SOCKET_SECURITY prefixed because they're not specific
|
|
171
|
-
// to the CLI. For the sake of consistency we'll also support the env
|
|
172
|
-
// keys that do have the SOCKET_CLI prefix, it's an easy mistake.
|
|
173
|
-
// In case multiple are supplied, the tokens supersede the keys and the
|
|
174
|
-
// security prefix supersedes the cli prefix. "Adventure mode" ;)
|
|
175
|
-
envAsString(env['SOCKET_SECURITY_API_TOKEN']) ||
|
|
176
|
-
// Keep 'SOCKET_SECURITY_API_KEY' alias.
|
|
177
|
-
// TODO: Remove 'SOCKET_SECURITY_API_KEY' alias.
|
|
178
|
-
envAsString(env['SOCKET_SECURITY_API_KEY']) || envAsString(env['SOCKET_CLI_API_TOKEN']) || envAsString(env['SOCKET_CLI_API_KEY']),
|
|
179
|
-
// A classic GitHub personal access token with the "repo" scope or a fine-grained
|
|
180
|
-
// access token with read/write permissions set for "Contents" and "Pull Request".
|
|
181
|
-
// https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens
|
|
182
|
-
SOCKET_SECURITY_GITHUB_PAT: envAsString(env['SOCKET_SECURITY_GITHUB_PAT']),
|
|
183
173
|
// Specifies the type of terminal or terminal emulator being used by the process.
|
|
184
174
|
TERM: envAsString(env['TERM']),
|
|
185
175
|
// The location of the base directory on Linux and MacOS used to store
|
|
@@ -408,5 +398,5 @@ const constants = createConstantsObject({
|
|
|
408
398
|
});
|
|
409
399
|
|
|
410
400
|
module.exports = constants;
|
|
411
|
-
//# debugId=
|
|
401
|
+
//# debugId=ac8f109d-4e95-4c90-924f-71d7c453d532
|
|
412
402
|
//# sourceMappingURL=constants.js.map
|
package/dist/constants.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sources":["../src/constants.mts"],"sourcesContent":["import { realpathSync } from 'node:fs'\nimport { createRequire } from 'node:module'\nimport os from 'node:os'\nimport path from 'node:path'\nimport { fileURLToPath } from 'node:url'\n\nimport registryConstants from '@socketsecurity/registry/lib/constants'\n\nimport type { Agent } from './utils/package-environment.mts'\nimport type { Remap } from '@socketsecurity/registry/lib/objects'\n\nconst require = createRequire(import.meta.url)\nconst __filename = fileURLToPath(import.meta.url)\nconst __dirname = path.dirname(__filename)\n\nconst {\n kInternalsSymbol,\n [kInternalsSymbol as unknown as 'Symbol(kInternalsSymbol)']: {\n attributes: registryConstantsAttribs,\n createConstantsObject,\n getIpc,\n },\n} = registryConstants\n\ntype RegistryEnv = typeof registryConstants.ENV\n\ntype RegistryInternals = (typeof registryConstants)['Symbol(kInternalsSymbol)']\n\ntype Sentry = any\n\ntype Internals = Remap<\n Omit<RegistryInternals, 'getIpc'> &\n Readonly<{\n getIpc: {\n (): Promise<IPC>\n <K extends keyof IPC | undefined>(\n key?: K | undefined,\n ): Promise<K extends keyof IPC ? IPC[K] : IPC>\n }\n getSentry: () => Sentry\n setSentry(Sentry: Sentry): boolean\n }>\n>\n\ntype ENV = Remap<\n RegistryEnv &\n Readonly<{\n DISABLE_GITHUB_CACHE: boolean\n GITHUB_ACTIONS: boolean\n GITHUB_REF_NAME: string\n GITHUB_REF_TYPE: string\n GITHUB_REPOSITORY: string\n GITHUB_TOKEN: string\n INLINED_CYCLONEDX_CDXGEN_VERSION: string\n INLINED_SOCKET_CLI_HOMEPAGE: string\n INLINED_SOCKET_CLI_LEGACY_BUILD: string\n INLINED_SOCKET_CLI_NAME: string\n INLINED_SOCKET_CLI_PUBLISHED_BUILD: string\n INLINED_SOCKET_CLI_SENTRY_BUILD: string\n INLINED_SOCKET_CLI_VERSION: string\n INLINED_SOCKET_CLI_VERSION_HASH: string\n INLINED_SYNP_VERSION: string\n LOCALAPPDATA: string\n NODE_COMPILE_CACHE: string\n PATH: string\n SOCKET_CLI_ACCEPT_RISKS: boolean\n SOCKET_CLI_CONFIG: string\n SOCKET_CLI_DEBUG: boolean\n SOCKET_CLI_NO_API_TOKEN: boolean\n SOCKET_CLI_VIEW_ALL_RISKS: boolean\n SOCKET_SECURITY_API_BASE_URL: string\n SOCKET_SECURITY_API_PROXY: string\n SOCKET_SECURITY_API_TOKEN: string\n SOCKET_SECURITY_GITHUB_PAT: string\n TERM: string\n XDG_DATA_HOME: string\n }>\n>\n\ntype IPC = Readonly<{\n SOCKET_CLI_FIX?: string | undefined\n SOCKET_CLI_OPTIMIZE?: boolean | undefined\n SOCKET_CLI_SAFE_BIN?: string | undefined\n SOCKET_CLI_SAFE_PROGRESS?: boolean | undefined\n}>\n\ntype Constants = Remap<\n Omit<typeof registryConstants, 'Symbol(kInternalsSymbol)' | 'ENV' | 'IPC'> & {\n readonly 'Symbol(kInternalsSymbol)': Internals\n readonly ALERT_TYPE_CRITICAL_CVE: 'criticalCVE'\n readonly ALERT_TYPE_CVE: 'cve'\n readonly ALERT_TYPE_MEDIUM_CVE: 'mediumCVE'\n readonly ALERT_TYPE_MILD_CVE: 'mildCVE'\n readonly API_V0_URL: 'https://api.socket.dev/v0/'\n readonly BINARY_LOCK_EXT: '.lockb'\n readonly BUN: 'bun'\n readonly CLI: 'cli'\n readonly CVE_ALERT_PROPS_FIRST_PATCHED_VERSION_IDENTIFIER: 'firstPatchedVersionIdentifier'\n readonly ENV: ENV\n readonly DRY_RUN_LABEL: '[DryRun]'\n readonly DRY_RUN_BAILING_NOW: '[DryRun] Bailing now'\n readonly DRY_RUN_NOT_SAVING: '[DryRun] Not saving'\n readonly IPC: IPC\n readonly LOCK_EXT: '.lock'\n readonly NPM_BUGGY_OVERRIDES_PATCHED_VERSION: '11.2.0'\n readonly NPM_REGISTRY_URL: 'https://registry.npmjs.org'\n readonly PNPM: 'pnpm'\n readonly REDACTED: '<redacted>'\n readonly SHADOW_BIN: 'shadow-bin'\n readonly SHADOW_INJECT: 'shadow-inject'\n readonly SOCKET: 'socket'\n readonly SOCKET_CLI_ACCEPT_RISKS: 'SOCKET_CLI_ACCEPT_RISKS'\n readonly SOCKET_CLI_BIN_NAME: 'socket'\n readonly SOCKET_CLI_BIN_NAME_ALIAS: 'cli'\n readonly SOCKET_CLI_CONFIG: 'SOCKET_CLI_CONFIG'\n readonly SOCKET_CLI_FIX: 'SOCKET_CLI_FIX'\n readonly SOCKET_CLI_ISSUES_URL: 'https://github.com/SocketDev/socket-cli/issues'\n readonly SOCKET_CLI_SENTRY_BIN_NAME_ALIAS: 'cli-with-sentry'\n readonly SOCKET_CLI_LEGACY_PACKAGE_NAME: '@socketsecurity/cli'\n readonly SOCKET_CLI_NPM_BIN_NAME: 'socket-npm'\n readonly SOCKET_CLI_NPX_BIN_NAME: 'socket-npx'\n readonly SOCKET_CLI_OPTIMIZE: 'SOCKET_CLI_OPTIMIZE'\n readonly SOCKET_CLI_PACKAGE_NAME: 'socket'\n readonly SOCKET_CLI_SAFE_BIN: 'SOCKET_CLI_SAFE_BIN'\n readonly SOCKET_CLI_SAFE_PROGRESS: 'SOCKET_CLI_SAFE_PROGRESS'\n readonly SOCKET_CLI_SENTRY_BIN_NAME: 'socket-with-sentry'\n readonly SOCKET_CLI_SENTRY_NPM_BIN_NAME: 'socket-npm-with-sentry'\n readonly SOCKET_CLI_SENTRY_NPX_BIN_NAME: 'socket-npx-with-sentry'\n readonly SOCKET_CLI_SENTRY_PACKAGE_NAME: '@socketsecurity/cli-with-sentry'\n readonly SOCKET_CLI_VIEW_ALL_RISKS: 'SOCKET_CLI_VIEW_ALL_RISKS'\n readonly SOCKET_WEBSITE_URL: 'https://socket.dev'\n readonly VLT: 'vlt'\n readonly WITH_SENTRY: 'with-sentry'\n readonly YARN: 'yarn'\n readonly YARN_BERRY: 'yarn/berry'\n readonly YARN_CLASSIC: 'yarn/classic'\n readonly YARN_LOCK: 'yarn.lock'\n readonly bashRcPath: string\n readonly blessedOptions: {\n smartCSR: boolean\n term: string\n useBCE: boolean\n }\n readonly distCliPath: string\n readonly distInstrumentWithSentryPath: string\n readonly distShadowBinPath: string\n readonly distShadowInjectPath: string\n readonly githubCachePath: string\n readonly homePath: string\n readonly minimumVersionByAgent: Map<Agent, string>\n readonly nmBinPath: string\n readonly nodeHardenFlags: string[]\n readonly rootBinPath: string\n readonly distPath: string\n readonly rootPath: string\n readonly shadowBinPath: string\n readonly socketAppDataPath: string\n readonly socketCachePath: string\n readonly zshRcPath: string\n }\n>\n\nconst ALERT_TYPE_CRITICAL_CVE = 'criticalCVE'\nconst ALERT_TYPE_CVE = 'cve'\nconst ALERT_TYPE_MEDIUM_CVE = 'mediumCVE'\nconst ALERT_TYPE_MILD_CVE = 'mildCVE'\nconst API_V0_URL = 'https://api.socket.dev/v0/'\nconst BINARY_LOCK_EXT = '.lockb'\nconst BUN = 'bun'\nconst CLI = 'cli'\nconst CVE_ALERT_PROPS_FIRST_PATCHED_VERSION_IDENTIFIER =\n 'firstPatchedVersionIdentifier'\nconst DRY_RUN_LABEL = '[DryRun]'\nconst DRY_RUN_BAILING_NOW = `${DRY_RUN_LABEL}: Bailing now`\nconst DRY_RUN_NOT_SAVING = `${DRY_RUN_LABEL}: Not saving`\nconst LOCALAPPDATA = 'LOCALAPPDATA'\nconst LOCK_EXT = '.lock'\nconst NPM_BUGGY_OVERRIDES_PATCHED_VERSION = '11.2.0'\nconst NPM_REGISTRY_URL = 'https://registry.npmjs.org'\nconst PNPM = 'pnpm'\nconst REDACTED = '<redacted>'\nconst SHADOW_BIN = 'shadow-bin'\nconst SHADOW_INJECT = 'shadow-inject'\nconst SOCKET = 'socket'\nconst SOCKET_CLI_ACCEPT_RISKS = 'SOCKET_CLI_ACCEPT_RISKS'\nconst SOCKET_CLI_BIN_NAME = 'socket'\nconst SOCKET_CLI_BIN_NAME_ALIAS = 'cli'\nconst SOCKET_CLI_FIX = 'SOCKET_CLI_FIX'\nconst SOCKET_CLI_ISSUES_URL = 'https://github.com/SocketDev/socket-cli/issues'\nconst SOCKET_CLI_LEGACY_PACKAGE_NAME = '@socketsecurity/cli'\nconst SOCKET_CLI_OPTIMIZE = 'SOCKET_CLI_OPTIMIZE'\nconst SOCKET_CLI_NPM_BIN_NAME = 'socket-npm'\nconst SOCKET_CLI_NPX_BIN_NAME = 'socket-npx'\nconst SOCKET_CLI_PACKAGE_NAME = 'socket'\nconst SOCKET_CLI_SAFE_BIN = 'SOCKET_CLI_SAFE_BIN'\nconst SOCKET_CLI_SAFE_PROGRESS = 'SOCKET_CLI_SAFE_PROGRESS'\nconst SOCKET_CLI_SENTRY_BIN_NAME = 'socket-with-sentry'\nconst SOCKET_CLI_SENTRY_BIN_NAME_ALIAS = 'cli-with-sentry'\nconst SOCKET_CLI_SENTRY_NPM_BIN_NAME = 'socket-npm-with-sentry'\nconst SOCKET_CLI_SENTRY_NPX_BIN_NAME = 'socket-npx-with-sentry'\nconst SOCKET_CLI_SENTRY_PACKAGE_NAME = '@socketsecurity/cli-with-sentry'\nconst SOCKET_CLI_VIEW_ALL_RISKS = 'SOCKET_CLI_VIEW_ALL_RISKS'\nconst SOCKET_WEBSITE_URL = 'https://socket.dev'\nconst VLT = 'vlt'\nconst WITH_SENTRY = 'with-sentry'\nconst YARN = 'yarn'\nconst YARN_BERRY = 'yarn/berry'\nconst YARN_CLASSIC = 'yarn/classic'\nconst YARN_LOCK = 'yarn.lock'\n\nlet _Sentry: any\n\nconst LAZY_ENV = () => {\n const {\n envAsBoolean,\n envAsString,\n } = require('@socketsecurity/registry/lib/env')\n const { env } = process\n // We inline some environment values so that they CANNOT be influenced by user\n // provided environment variables.\n return Object.freeze({\n __proto__: null,\n // Lazily access registryConstants.ENV.\n ...registryConstants.ENV,\n // Flag to disable using GitHub's workflow actions/cache.\n // https://github.com/actions/cache\n DISABLE_GITHUB_CACHE: envAsBoolean(env['DISABLE_GITHUB_CACHE']),\n // Always set to true when GitHub Actions is running the workflow. This variable\n // can be used to differentiate when tests are being run locally or by GitHub Actions.\n // https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/store-information-in-variables#default-environment-variables\n GITHUB_ACTIONS: envAsBoolean(env['GITHUB_ACTIONS']),\n // The short ref name of the branch or tag that triggered the GitHub workflow run.\n // This value matches the branch or tag name shown on GitHub. For example, feature-branch-1.\n // For pull requests, the format is <pr_number>/merge.\n // https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/store-information-in-variables#default-environment-variables\n GITHUB_REF_NAME: envAsString(env['GITHUB_REF_NAME']),\n // The type of ref that triggered the workflow run. Valid values are branch or tag.\n // https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/store-information-in-variables#default-environment-variables\n GITHUB_REF_TYPE: envAsString(env['GITHUB_REF_TYPE']),\n // The owner and repository name. For example, octocat/Hello-World.\n // https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/store-information-in-variables#default-environment-variables\n GITHUB_REPOSITORY: envAsString(env['GITHUB_REPOSITORY']),\n // The GITHUB_TOKEN secret is a GitHub App installation access token. The token's\n // permissions are limited to the repository that contains the workflow.\n // https://docs.github.com/en/actions/security-for-github-actions/security-guides/automatic-token-authentication#about-the-github_token-secret\n GITHUB_TOKEN: envAsString(env['GITHUB_TOKEN']),\n // Comp-time inlined @cyclonedx/cdxgen package version.\n // The '@rollup/plugin-replace' will replace \"process.env['INLINED_CYCLONEDX_CDXGEN_VERSION']\".\n INLINED_CYCLONEDX_CDXGEN_VERSION: envAsString(\n process.env['INLINED_CYCLONEDX_CDXGEN_VERSION'],\n ),\n // Comp-time inlined Socket package homepage.\n // The '@rollup/plugin-replace' will replace \"process.env['INLINED_SOCKET_CLI_HOMEPAGE']\".\n INLINED_SOCKET_CLI_HOMEPAGE: envAsString(\n process.env['INLINED_SOCKET_CLI_HOMEPAGE'],\n ),\n // Comp-time inlined flag to determine if this is the Legacy build.\n // The '@rollup/plugin-replace' will replace \"process.env['INLINED_SOCKET_CLI_LEGACY_BUILD']\".\n INLINED_SOCKET_CLI_LEGACY_BUILD: envAsBoolean(\n process.env['INLINED_SOCKET_CLI_LEGACY_BUILD'],\n ),\n // Comp-time inlined Socket package name.\n // The '@rollup/plugin-replace' will replace \"process.env['INLINED_SOCKET_CLI_NAME']\".\n INLINED_SOCKET_CLI_NAME: envAsString(\n process.env['INLINED_SOCKET_CLI_NAME'],\n ),\n // Comp-time inlined flag to determine if this is a published build.\n // The '@rollup/plugin-replace' will replace \"process.env['INLINED_SOCKET_CLI_PUBLISHED_BUILD']\".\n INLINED_SOCKET_CLI_PUBLISHED_BUILD: envAsBoolean(\n process.env['INLINED_SOCKET_CLI_PUBLISHED_BUILD'],\n ),\n // Comp-time inlined flag to determine if this is the Sentry build.\n // The '@rollup/plugin-replace' will replace \"process.env['INLINED_SOCKET_CLI_SENTRY_BUILD']\".\n INLINED_SOCKET_CLI_SENTRY_BUILD: envAsBoolean(\n process.env['INLINED_SOCKET_CLI_SENTRY_BUILD'],\n ),\n // Comp-time inlined Socket package version.\n // The '@rollup/plugin-replace' will replace \"process.env['INLINED_SOCKET_CLI_VERSION']\".\n INLINED_SOCKET_CLI_VERSION: envAsString(\n process.env['INLINED_SOCKET_CLI_VERSION'],\n ),\n // Comp-time inlined Socket package version hash.\n // The '@rollup/plugin-replace' will replace \"process.env['INLINED_SOCKET_CLI_VERSION_HASH']\".\n INLINED_SOCKET_CLI_VERSION_HASH: envAsString(\n process.env['INLINED_SOCKET_CLI_VERSION_HASH'],\n ),\n // Comp-time inlined synp package version.\n // The '@rollup/plugin-replace' will replace \"process.env['INLINED_SYNP_VERSION']\".\n INLINED_SYNP_VERSION: envAsString(process.env['INLINED_SYNP_VERSION']),\n // The location of the %localappdata% folder on Windows used to store user-specific,\n // non-roaming application data, like temporary files, cached data, and program\n // settings, that are specific to the current machine and user.\n LOCALAPPDATA: envAsString(env[LOCALAPPDATA]),\n // Flag to enable the module compile cache for the Node.js instance.\n // https://nodejs.org/api/cli.html#node_compile_cachedir\n NODE_COMPILE_CACHE:\n // Lazily access constants.SUPPORTS_NODE_COMPILE_CACHE_ENV_VAR.\n constants.SUPPORTS_NODE_COMPILE_CACHE_ENV_VAR\n ? // Lazily access constants.socketCachePath.\n constants.socketCachePath\n : '',\n // PATH is an environment variable that lists directories where executable\n // programs are located. When a command is run, the system searches these\n // directories to find the executable.\n PATH: envAsString(env['PATH']),\n // Flag to accepts risks of safe-npm and safe-npx run.\n SOCKET_CLI_ACCEPT_RISKS: envAsBoolean(env[SOCKET_CLI_ACCEPT_RISKS]),\n // Flag containing a JSON stringified Socket configuration object.\n SOCKET_CLI_CONFIG: envAsString(env['SOCKET_CLI_CONFIG']),\n // Flag to help debug Socket CLI.\n SOCKET_CLI_DEBUG: envAsBoolean(env['SOCKET_CLI_DEBUG']),\n // Flag to make the default API token `undefined`.\n SOCKET_CLI_NO_API_TOKEN: envAsBoolean(env['SOCKET_CLI_NO_API_TOKEN']),\n // Flag to view all risks of safe-npm and safe-npx run.\n SOCKET_CLI_VIEW_ALL_RISKS: envAsBoolean(env[SOCKET_CLI_VIEW_ALL_RISKS]),\n // Flag to change the base URL for all API-calls.\n // https://github.com/SocketDev/socket-cli?tab=readme-ov-file#environment-variables-for-development\n SOCKET_SECURITY_API_BASE_URL:\n envAsString(env['SOCKET_SECURITY_API_BASE_URL']) ||\n // For consistency; allow socket_cli prefix too\n envAsString(env['SOCKET_CLI_API_BASE_URL']),\n // Flag to set the proxy all requests are routed through.\n // https://github.com/SocketDev/socket-cli?tab=readme-ov-file#environment-variables-for-development\n SOCKET_SECURITY_API_PROXY:\n envAsString(env['SOCKET_SECURITY_API_PROXY']) ||\n // For consistency; allow socket_cli prefix too\n envAsString(env['SOCKET_CLI_API_BASE_URL']),\n // Flag to set the API token.\n // https://github.com/SocketDev/socket-cli?tab=readme-ov-file#environment-variables\n SOCKET_SECURITY_API_TOKEN:\n // Note: These are SOCKET_SECURITY prefixed because they're not specific\n // to the CLI. For the sake of consistency we'll also support the env\n // keys that do have the SOCKET_CLI prefix, it's an easy mistake.\n // In case multiple are supplied, the tokens supersede the keys and the\n // security prefix supersedes the cli prefix. \"Adventure mode\" ;)\n envAsString(env['SOCKET_SECURITY_API_TOKEN']) ||\n // Keep 'SOCKET_SECURITY_API_KEY' alias.\n // TODO: Remove 'SOCKET_SECURITY_API_KEY' alias.\n envAsString(env['SOCKET_SECURITY_API_KEY']) ||\n envAsString(env['SOCKET_CLI_API_TOKEN']) ||\n envAsString(env['SOCKET_CLI_API_KEY']),\n // A classic GitHub personal access token with the \"repo\" scope or a fine-grained\n // access token with read/write permissions set for \"Contents\" and \"Pull Request\".\n // https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens\n SOCKET_SECURITY_GITHUB_PAT: envAsString(env['SOCKET_SECURITY_GITHUB_PAT']),\n // Specifies the type of terminal or terminal emulator being used by the process.\n TERM: envAsString(env['TERM']),\n // The location of the base directory on Linux and MacOS used to store\n // user-specific data files, defaulting to $HOME/.local/share if not set or empty.\n XDG_DATA_HOME: envAsString(env['XDG_DATA_HOME']),\n })\n}\n\nconst lazyBashRcPath = () =>\n // Lazily access constants.homePath.\n path.join(constants.homePath, '.bashrc')\n\nconst lazyBlessedOptions = () =>\n Object.freeze({\n smartCSR: true,\n // Lazily access constants.WIN32.\n term: constants.WIN32 ? 'windows-ansi' : 'xterm',\n useBCE: true,\n })\n\nconst lazyDistCliPath = () =>\n // Lazily access constants.distPath.\n path.join(constants.distPath, 'cli.js')\n\nconst lazyDistInstrumentWithSentryPath = () =>\n // Lazily access constants.distPath.\n path.join(constants.distPath, 'instrument-with-sentry.js')\n\nconst lazyDistShadowBinPath = () =>\n // Lazily access constants.distPath.\n path.join(constants.distPath, `${SHADOW_BIN}.js`)\n\nconst lazyDistShadowInjectPath = () =>\n // Lazily access constants.distPath.\n path.join(constants.distPath, `${SHADOW_INJECT}.js`)\n\nconst lazyGithubCachePath = () =>\n // Lazily access constants.socketCachePath.\n path.join(constants.socketCachePath, 'github')\n\nconst lazyHomePath = () => os.homedir()\n\nconst lazyMinimumVersionByAgent = () =>\n new Map([\n // Bun >=1.1.39 supports the text-based lockfile.\n // https://bun.sh/blog/bun-lock-text-lockfile\n [BUN, '1.1.39'],\n // The npm version bundled with Node 18.\n // https://nodejs.org/en/about/previous-releases#looking-for-the-latest-release-of-a-version-branch\n ['npm', '10.8.2'],\n // 8.x is the earliest version to support Node 18.\n // https://pnpm.io/installation#compatibility\n // https://www.npmjs.com/package/pnpm?activeTab=versions\n [PNPM, '8.15.7'],\n // 4.x supports >= Node 18.12.0\n // https://github.com/yarnpkg/berry/blob/%40yarnpkg/core/4.1.0/CHANGELOG.md#400\n [YARN_BERRY, '4.0.0'],\n // Latest 1.x.\n // https://www.npmjs.com/package/yarn?activeTab=versions\n [YARN_CLASSIC, '1.22.22'],\n // vlt does not support overrides so we don't gate on it.\n [VLT, '*'],\n ])\n\nconst lazyNmBinPath = () =>\n // Lazily access constants.rootPath.\n path.join(constants.rootPath, 'node_modules/.bin')\n\n// Redefine registryConstants.nodeHardenFlags to account for the\n// INLINED_SOCKET_CLI_SENTRY_BUILD environment variable.\nconst lazyNodeHardenFlags = () =>\n Object.freeze(\n // Lazily access constants.ENV.INLINED_SOCKET_CLI_SENTRY_BUILD.\n constants.ENV.INLINED_SOCKET_CLI_SENTRY_BUILD ||\n // Lazily access constants.WIN32.\n constants.WIN32\n ? []\n : // Harden Node security.\n // https://nodejs.org/en/learn/getting-started/security-best-practices\n [\n '--disable-proto',\n 'throw',\n // We have contributed the following patches to our dependencies to make\n // Node's --frozen-intrinsics workable.\n // √ https://github.com/SBoudrias/Inquirer.js/pull/1683\n // √ https://github.com/pnpm/components/pull/23\n '--frozen-intrinsics',\n '--no-deprecation',\n ],\n )\n\nconst lazyRootBinPath = () =>\n // Lazily access constants.rootPath.\n path.join(constants.rootPath, 'bin')\n\nconst lazyDistPath = () =>\n // Lazily access constants.rootPath.\n path.join(constants.rootPath, 'dist')\n\nconst lazyRootPath = () => path.join(realpathSync.native(__dirname), '..')\n\nconst lazySocketAppDataPath = (): string | undefined => {\n // Get the OS app data folder:\n // - Win: %LOCALAPPDATA% or fail?\n // - Mac: %XDG_DATA_HOME% or fallback to \"~/Library/Application Support/\"\n // - Linux: %XDG_DATA_HOME% or fallback to \"~/.local/share/\"\n // Note: LOCALAPPDATA is typically: C:\\Users\\USERNAME\\AppData\n // Note: XDG stands for \"X Desktop Group\", nowadays \"freedesktop.org\"\n // On most systems that path is: $HOME/.local/share\n // Then append `socket/settings`, so:\n // - Win: %LOCALAPPDATA%\\socket\\settings or return undefined\n // - Mac: %XDG_DATA_HOME%/socket/settings or \"~/Library/Application Support/socket/settings\"\n // - Linux: %XDG_DATA_HOME%/socket/settings or \"~/.local/share/socket/settings\"\n\n // Lazily access constants.WIN32.\n const { WIN32 } = constants\n let dataHome: string | undefined = WIN32\n ? // Lazily access constants.ENV.LOCALAPPDATA\n constants.ENV.LOCALAPPDATA\n : // Lazily access constants.ENV.XDG_DATA_HOME\n constants.ENV.XDG_DATA_HOME\n if (!dataHome) {\n if (WIN32) {\n const logger = require('@socketsecurity/registry/lib/logger')\n logger.warn(`Missing %${LOCALAPPDATA}%`)\n } else {\n dataHome = path.join(\n // Lazily access constants.homePath.\n constants.homePath,\n // Lazily access constants.DARWIN.\n constants.DARWIN ? 'Library/Application Support' : '.local/share',\n )\n }\n }\n return dataHome ? path.join(dataHome, 'socket/settings') : undefined\n}\n\nconst lazySocketCachePath = () =>\n // Lazily access constants.rootPath.\n path.join(constants.rootPath, '.cache')\n\nconst lazyShadowBinPath = () =>\n // Lazily access constants.rootPath.\n path.join(constants.rootPath, SHADOW_BIN)\n\nconst lazyZshRcPath = () =>\n // Lazily access constants.homePath.\n path.join(constants.homePath, '.zshrc')\n\nconst constants: Constants = createConstantsObject(\n {\n ...registryConstantsAttribs.props,\n ALERT_TYPE_CRITICAL_CVE,\n ALERT_TYPE_CVE,\n ALERT_TYPE_MEDIUM_CVE,\n ALERT_TYPE_MILD_CVE,\n API_V0_URL,\n BINARY_LOCK_EXT,\n BUN,\n CLI,\n CVE_ALERT_PROPS_FIRST_PATCHED_VERSION_IDENTIFIER,\n DRY_RUN_LABEL,\n DRY_RUN_BAILING_NOW,\n DRY_RUN_NOT_SAVING,\n ENV: undefined,\n LOCK_EXT,\n NPM_BUGGY_OVERRIDES_PATCHED_VERSION,\n NPM_REGISTRY_URL,\n PNPM,\n REDACTED,\n SHADOW_BIN,\n SHADOW_INJECT,\n SOCKET,\n SOCKET_CLI_ACCEPT_RISKS,\n SOCKET_CLI_BIN_NAME,\n SOCKET_CLI_BIN_NAME_ALIAS,\n SOCKET_CLI_FIX,\n SOCKET_CLI_ISSUES_URL,\n SOCKET_CLI_SENTRY_BIN_NAME_ALIAS,\n SOCKET_CLI_LEGACY_PACKAGE_NAME,\n SOCKET_CLI_NPM_BIN_NAME,\n SOCKET_CLI_NPX_BIN_NAME,\n SOCKET_CLI_OPTIMIZE,\n SOCKET_CLI_PACKAGE_NAME,\n SOCKET_CLI_SAFE_BIN,\n SOCKET_CLI_SAFE_PROGRESS,\n SOCKET_CLI_SENTRY_BIN_NAME,\n SOCKET_CLI_SENTRY_NPM_BIN_NAME,\n SOCKET_CLI_SENTRY_NPX_BIN_NAME,\n SOCKET_CLI_SENTRY_PACKAGE_NAME,\n SOCKET_CLI_VIEW_ALL_RISKS,\n SOCKET_WEBSITE_URL,\n VLT,\n WITH_SENTRY,\n YARN,\n YARN_BERRY,\n YARN_CLASSIC,\n YARN_LOCK,\n bashRcPath: undefined,\n blessedOptions: undefined,\n distCliPath: undefined,\n distInstrumentWithSentryPath: undefined,\n distPath: undefined,\n distShadowBinPath: undefined,\n distShadowInjectPath: undefined,\n githubCachePath: undefined,\n homePath: undefined,\n minimumVersionByAgent: undefined,\n nmBinPath: undefined,\n nodeHardenFlags: undefined,\n rootBinPath: undefined,\n rootPath: undefined,\n shadowBinPath: undefined,\n socketAppDataPath: undefined,\n socketCachePath: undefined,\n zshRcPath: undefined,\n },\n {\n getters: {\n ...registryConstantsAttribs.getters,\n ENV: LAZY_ENV,\n bashRcPath: lazyBashRcPath,\n blessedOptions: lazyBlessedOptions,\n distCliPath: lazyDistCliPath,\n distInstrumentWithSentryPath: lazyDistInstrumentWithSentryPath,\n distPath: lazyDistPath,\n distShadowBinPath: lazyDistShadowBinPath,\n distShadowInjectPath: lazyDistShadowInjectPath,\n githubCachePath: lazyGithubCachePath,\n homePath: lazyHomePath,\n minimumVersionByAgent: lazyMinimumVersionByAgent,\n nmBinPath: lazyNmBinPath,\n nodeHardenFlags: lazyNodeHardenFlags,\n rootBinPath: lazyRootBinPath,\n rootPath: lazyRootPath,\n shadowBinPath: lazyShadowBinPath,\n socketAppDataPath: lazySocketAppDataPath,\n socketCachePath: lazySocketCachePath,\n zshRcPath: lazyZshRcPath,\n },\n internals: {\n ...registryConstantsAttribs.internals,\n getIpc,\n getSentry() {\n return _Sentry\n },\n setSentry(Sentry: Sentry): boolean {\n if (_Sentry === undefined) {\n _Sentry = Sentry\n return true\n }\n return false\n },\n },\n },\n) as Constants\n\nexport default constants\n"],"names":["attributes","getIpc","envAsString","env","__proto__","DISABLE_GITHUB_CACHE","GITHUB_ACTIONS","GITHUB_REF_NAME","GITHUB_REF_TYPE","GITHUB_REPOSITORY","GITHUB_TOKEN","LOCALAPPDATA","constants","PATH","SOCKET_CLI_ACCEPT_RISKS","SOCKET_CLI_CONFIG","SOCKET_CLI_DEBUG","SOCKET_CLI_NO_API_TOKEN","SOCKET_CLI_VIEW_ALL_RISKS","SOCKET_SECURITY_API_BASE_URL","SOCKET_SECURITY_API_PROXY","SOCKET_SECURITY_GITHUB_PAT","TERM","XDG_DATA_HOME","path","smartCSR","term","useBCE","WIN32","logger","ENV","bashRcPath","blessedOptions","distCliPath","distInstrumentWithSentryPath","distPath","distShadowBinPath","distShadowInjectPath","githubCachePath","homePath","minimumVersionByAgent","nmBinPath","nodeHardenFlags","rootBinPath","rootPath","shadowBinPath","socketAppDataPath","socketCachePath","zshRcPath","getters","internals","getSentry","_Sentry"],"mappings":";;;;;;;;;;AAWA,iBAAA;AACA;AACA;AAEA;;AAEE;AACEA;;AAEAC;AACF;AACF;AA4IA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAEA;;;AAGIC;AACF;;AACQC;AAAI;AACZ;AACA;;AAEEC;AACA;;AAEA;AACA;AACAC;AACA;AACA;AACA;AACAC;AACA;AACA;AACA;AACA;AACAC;AACA;AACA;AACAC;AACA;AACA;AACAC;AACA;AACA;AACA;AACAC;AACA;AACA;;AAIA;AACA;;AAIA;AACA;;AAIA;AACA;;AAIA;AACA;;AAIA;AACA;;AAIA;AACA;;AAIA;AACA;;AAIA;AACA;;AAEA;AACA;AACA;AACAC;AACA;AACA;;AAEE;AACAC;AACI;;AAGN;AACA;AACA;AACAC;AACA;AACAC;AACA;AACAC;AACA;AACAC;AACA;AACAC;AACA;AACAC;AACA;AACA;AACAC;AAEE;AACAjB;AACF;AACA;AACAkB;AAEE;AACAlB;AACF;AACA;;AAEE;AACA;AACA;AACA;AACA;AACAA;AACA;AACA;;AAIF;AACA;AACA;AACAmB;AACA;AACAC;AACA;AACA;AACAC;AACF;AACF;AAEA;AACE;AACAC;AAEF;AAEIC;AACA;AACAC;AACAC;AACF;AAEF;AACE;AACAH;AAEF;AACE;AACAA;AAEF;AACE;AACAA;AAEF;AACE;AACAA;AAEF;AACE;AACAA;AAEF;AAEA;AAEI;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGJ;AACE;AACAA;;AAEF;AACA;AACA;AAEI;AACAZ;AACE;AACAA;AAEE;AACA;AACA;AAGE;AACA;AACA;AACA;AACA;AAKV;AACE;AACAY;AAEF;AACE;AACAA;AAEF;AAEA;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AACQI;AAAM;;AAEV;;AAEA;;;AAGF;AACE;AACAC;AACF;;AAEI;AACAjB;AACA;AACAA;AAEJ;AACF;;AAEF;AAEA;AACE;AACAY;AAEF;AACE;AACAA;AAEF;AACE;AACAA;AAEIZ;;;;;;;;;;;;;;AAeFkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCAC;AACAC;AACAC;AACAC;AACAC;AACAC;AACAC;AACAC;AACAC;AACAC;AACAC;AACAC;AACAC;AACAC;AACAC;AACAC;AACAC;AACAC;AACF;AAEEC;;AAEEnB;AACAC;AACAC;AACAC;AACAC;AACAC;AACAC;AACAC;AACAC;AACAC;AACAC;AACAC;AACAC;AACAC;AACAC;AACAC;AACAC;AACAC;AACAC;;AAEFE;;;AAGEC;AACE;;;;AAIEC;AACA;AACF;AACA;AACF;AACF;AACF;;","debugId":"12a4e559-90da-4869-8af3-5ee327d1a67b"}
|
|
1
|
+
{"version":3,"file":"constants.js","sources":["../src/constants.mts"],"sourcesContent":["import { realpathSync } from 'node:fs'\nimport { createRequire } from 'node:module'\nimport os from 'node:os'\nimport path from 'node:path'\nimport { fileURLToPath } from 'node:url'\n\nimport registryConstants from '@socketsecurity/registry/lib/constants'\n\nimport type { Agent } from './utils/package-environment.mts'\nimport type { Remap } from '@socketsecurity/registry/lib/objects'\n\nconst require = createRequire(import.meta.url)\nconst __filename = fileURLToPath(import.meta.url)\nconst __dirname = path.dirname(__filename)\n\nconst {\n kInternalsSymbol,\n [kInternalsSymbol as unknown as 'Symbol(kInternalsSymbol)']: {\n attributes: registryConstantsAttribs,\n createConstantsObject,\n getIpc,\n },\n} = registryConstants\n\ntype RegistryEnv = typeof registryConstants.ENV\n\ntype RegistryInternals = (typeof registryConstants)['Symbol(kInternalsSymbol)']\n\ntype Sentry = any\n\ntype Internals = Remap<\n Omit<RegistryInternals, 'getIpc'> &\n Readonly<{\n getIpc: {\n (): Promise<IPC>\n <K extends keyof IPC | undefined>(\n key?: K | undefined,\n ): Promise<K extends keyof IPC ? IPC[K] : IPC>\n }\n getSentry: () => Sentry\n setSentry(Sentry: Sentry): boolean\n }>\n>\n\ntype ENV = Remap<\n RegistryEnv &\n Readonly<{\n DISABLE_GITHUB_CACHE: boolean\n GITHUB_ACTIONS: boolean\n GITHUB_REF_NAME: string\n GITHUB_REF_TYPE: string\n GITHUB_REPOSITORY: string\n GITHUB_TOKEN: string\n INLINED_CYCLONEDX_CDXGEN_VERSION: string\n INLINED_SOCKET_CLI_HOMEPAGE: string\n INLINED_SOCKET_CLI_LEGACY_BUILD: string\n INLINED_SOCKET_CLI_NAME: string\n INLINED_SOCKET_CLI_PUBLISHED_BUILD: string\n INLINED_SOCKET_CLI_SENTRY_BUILD: string\n INLINED_SOCKET_CLI_VERSION: string\n INLINED_SOCKET_CLI_VERSION_HASH: string\n INLINED_SYNP_VERSION: string\n LOCALAPPDATA: string\n NODE_COMPILE_CACHE: string\n PATH: string\n SOCKET_CLI_ACCEPT_RISKS: boolean\n SOCKET_CLI_API_BASE_URL: string\n SOCKET_CLI_API_PROXY: string\n SOCKET_CLI_API_TOKEN: string\n SOCKET_CLI_CONFIG: string\n SOCKET_CLI_DEBUG: boolean\n SOCKET_CLI_GITHUB_TOKEN: string\n SOCKET_CLI_NO_API_TOKEN: boolean\n SOCKET_CLI_VIEW_ALL_RISKS: boolean\n TERM: string\n XDG_DATA_HOME: string\n }>\n>\n\ntype IPC = Readonly<{\n SOCKET_CLI_FIX?: string | undefined\n SOCKET_CLI_OPTIMIZE?: boolean | undefined\n SOCKET_CLI_SAFE_BIN?: string | undefined\n SOCKET_CLI_SAFE_PROGRESS?: boolean | undefined\n}>\n\ntype Constants = Remap<\n Omit<typeof registryConstants, 'Symbol(kInternalsSymbol)' | 'ENV' | 'IPC'> & {\n readonly 'Symbol(kInternalsSymbol)': Internals\n readonly ALERT_TYPE_CRITICAL_CVE: 'criticalCVE'\n readonly ALERT_TYPE_CVE: 'cve'\n readonly ALERT_TYPE_MEDIUM_CVE: 'mediumCVE'\n readonly ALERT_TYPE_MILD_CVE: 'mildCVE'\n readonly API_V0_URL: 'https://api.socket.dev/v0/'\n readonly BINARY_LOCK_EXT: '.lockb'\n readonly BUN: 'bun'\n readonly CLI: 'cli'\n readonly CVE_ALERT_PROPS_FIRST_PATCHED_VERSION_IDENTIFIER: 'firstPatchedVersionIdentifier'\n readonly ENV: ENV\n readonly DRY_RUN_LABEL: '[DryRun]'\n readonly DRY_RUN_BAILING_NOW: '[DryRun] Bailing now'\n readonly DRY_RUN_NOT_SAVING: '[DryRun] Not saving'\n readonly IPC: IPC\n readonly LOCK_EXT: '.lock'\n readonly NPM_BUGGY_OVERRIDES_PATCHED_VERSION: '11.2.0'\n readonly NPM_REGISTRY_URL: 'https://registry.npmjs.org'\n readonly PNPM: 'pnpm'\n readonly REDACTED: '<redacted>'\n readonly SHADOW_BIN: 'shadow-bin'\n readonly SHADOW_INJECT: 'shadow-inject'\n readonly SOCKET: 'socket'\n readonly SOCKET_CLI_ACCEPT_RISKS: 'SOCKET_CLI_ACCEPT_RISKS'\n readonly SOCKET_CLI_BIN_NAME: 'socket'\n readonly SOCKET_CLI_BIN_NAME_ALIAS: 'cli'\n readonly SOCKET_CLI_CONFIG: 'SOCKET_CLI_CONFIG'\n readonly SOCKET_CLI_FIX: 'SOCKET_CLI_FIX'\n readonly SOCKET_CLI_ISSUES_URL: 'https://github.com/SocketDev/socket-cli/issues'\n readonly SOCKET_CLI_SENTRY_BIN_NAME_ALIAS: 'cli-with-sentry'\n readonly SOCKET_CLI_LEGACY_PACKAGE_NAME: '@socketsecurity/cli'\n readonly SOCKET_CLI_NPM_BIN_NAME: 'socket-npm'\n readonly SOCKET_CLI_NPX_BIN_NAME: 'socket-npx'\n readonly SOCKET_CLI_OPTIMIZE: 'SOCKET_CLI_OPTIMIZE'\n readonly SOCKET_CLI_PACKAGE_NAME: 'socket'\n readonly SOCKET_CLI_SAFE_BIN: 'SOCKET_CLI_SAFE_BIN'\n readonly SOCKET_CLI_SAFE_PROGRESS: 'SOCKET_CLI_SAFE_PROGRESS'\n readonly SOCKET_CLI_SENTRY_BIN_NAME: 'socket-with-sentry'\n readonly SOCKET_CLI_SENTRY_NPM_BIN_NAME: 'socket-npm-with-sentry'\n readonly SOCKET_CLI_SENTRY_NPX_BIN_NAME: 'socket-npx-with-sentry'\n readonly SOCKET_CLI_SENTRY_PACKAGE_NAME: '@socketsecurity/cli-with-sentry'\n readonly SOCKET_CLI_VIEW_ALL_RISKS: 'SOCKET_CLI_VIEW_ALL_RISKS'\n readonly SOCKET_WEBSITE_URL: 'https://socket.dev'\n readonly VLT: 'vlt'\n readonly WITH_SENTRY: 'with-sentry'\n readonly YARN: 'yarn'\n readonly YARN_BERRY: 'yarn/berry'\n readonly YARN_CLASSIC: 'yarn/classic'\n readonly YARN_LOCK: 'yarn.lock'\n readonly bashRcPath: string\n readonly blessedOptions: {\n smartCSR: boolean\n term: string\n useBCE: boolean\n }\n readonly distCliPath: string\n readonly distInstrumentWithSentryPath: string\n readonly distShadowBinPath: string\n readonly distShadowInjectPath: string\n readonly githubCachePath: string\n readonly homePath: string\n readonly minimumVersionByAgent: Map<Agent, string>\n readonly nmBinPath: string\n readonly nodeHardenFlags: string[]\n readonly rootBinPath: string\n readonly distPath: string\n readonly rootPath: string\n readonly shadowBinPath: string\n readonly socketAppDataPath: string\n readonly socketCachePath: string\n readonly zshRcPath: string\n }\n>\n\nconst ALERT_TYPE_CRITICAL_CVE = 'criticalCVE'\nconst ALERT_TYPE_CVE = 'cve'\nconst ALERT_TYPE_MEDIUM_CVE = 'mediumCVE'\nconst ALERT_TYPE_MILD_CVE = 'mildCVE'\nconst API_V0_URL = 'https://api.socket.dev/v0/'\nconst BINARY_LOCK_EXT = '.lockb'\nconst BUN = 'bun'\nconst CLI = 'cli'\nconst CVE_ALERT_PROPS_FIRST_PATCHED_VERSION_IDENTIFIER =\n 'firstPatchedVersionIdentifier'\nconst DRY_RUN_LABEL = '[DryRun]'\nconst DRY_RUN_BAILING_NOW = `${DRY_RUN_LABEL}: Bailing now`\nconst DRY_RUN_NOT_SAVING = `${DRY_RUN_LABEL}: Not saving`\nconst LOCALAPPDATA = 'LOCALAPPDATA'\nconst LOCK_EXT = '.lock'\nconst NPM_BUGGY_OVERRIDES_PATCHED_VERSION = '11.2.0'\nconst NPM_REGISTRY_URL = 'https://registry.npmjs.org'\nconst PNPM = 'pnpm'\nconst REDACTED = '<redacted>'\nconst SHADOW_BIN = 'shadow-bin'\nconst SHADOW_INJECT = 'shadow-inject'\nconst SOCKET = 'socket'\nconst SOCKET_CLI_ACCEPT_RISKS = 'SOCKET_CLI_ACCEPT_RISKS'\nconst SOCKET_CLI_BIN_NAME = 'socket'\nconst SOCKET_CLI_BIN_NAME_ALIAS = 'cli'\nconst SOCKET_CLI_FIX = 'SOCKET_CLI_FIX'\nconst SOCKET_CLI_ISSUES_URL = 'https://github.com/SocketDev/socket-cli/issues'\nconst SOCKET_CLI_LEGACY_PACKAGE_NAME = '@socketsecurity/cli'\nconst SOCKET_CLI_OPTIMIZE = 'SOCKET_CLI_OPTIMIZE'\nconst SOCKET_CLI_NPM_BIN_NAME = 'socket-npm'\nconst SOCKET_CLI_NPX_BIN_NAME = 'socket-npx'\nconst SOCKET_CLI_PACKAGE_NAME = 'socket'\nconst SOCKET_CLI_SAFE_BIN = 'SOCKET_CLI_SAFE_BIN'\nconst SOCKET_CLI_SAFE_PROGRESS = 'SOCKET_CLI_SAFE_PROGRESS'\nconst SOCKET_CLI_SENTRY_BIN_NAME = 'socket-with-sentry'\nconst SOCKET_CLI_SENTRY_BIN_NAME_ALIAS = 'cli-with-sentry'\nconst SOCKET_CLI_SENTRY_NPM_BIN_NAME = 'socket-npm-with-sentry'\nconst SOCKET_CLI_SENTRY_NPX_BIN_NAME = 'socket-npx-with-sentry'\nconst SOCKET_CLI_SENTRY_PACKAGE_NAME = '@socketsecurity/cli-with-sentry'\nconst SOCKET_CLI_VIEW_ALL_RISKS = 'SOCKET_CLI_VIEW_ALL_RISKS'\nconst SOCKET_WEBSITE_URL = 'https://socket.dev'\nconst VLT = 'vlt'\nconst WITH_SENTRY = 'with-sentry'\nconst YARN = 'yarn'\nconst YARN_BERRY = 'yarn/berry'\nconst YARN_CLASSIC = 'yarn/classic'\nconst YARN_LOCK = 'yarn.lock'\n\nlet _Sentry: any\n\nconst LAZY_ENV = () => {\n const {\n envAsBoolean,\n envAsString,\n } = require('@socketsecurity/registry/lib/env')\n const { env } = process\n const GITHUB_TOKEN = envAsString(env['GITHUB_TOKEN'])\n // We inline some environment values so that they CANNOT be influenced by user\n // provided environment variables.\n return Object.freeze({\n __proto__: null,\n // Lazily access registryConstants.ENV.\n ...registryConstants.ENV,\n // Flag to disable using GitHub's workflow actions/cache.\n // https://github.com/actions/cache\n DISABLE_GITHUB_CACHE: envAsBoolean(env['DISABLE_GITHUB_CACHE']),\n // Always set to true when GitHub Actions is running the workflow. This variable\n // can be used to differentiate when tests are being run locally or by GitHub Actions.\n // https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/store-information-in-variables#default-environment-variables\n GITHUB_ACTIONS: envAsBoolean(env['GITHUB_ACTIONS']),\n // The short ref name of the branch or tag that triggered the GitHub workflow\n // run. This value matches the branch or tag name shown on GitHub. For example,\n // feature-branch-1. For pull requests, the format is <pr_number>/merge.\n // https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/store-information-in-variables#default-environment-variables\n GITHUB_REF_NAME: envAsString(env['GITHUB_REF_NAME']),\n // The type of ref that triggered the workflow run. Valid values are branch or tag.\n // https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/store-information-in-variables#default-environment-variables\n GITHUB_REF_TYPE: envAsString(env['GITHUB_REF_TYPE']),\n // The owner and repository name. For example, octocat/Hello-World.\n // https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/store-information-in-variables#default-environment-variables\n GITHUB_REPOSITORY: envAsString(env['GITHUB_REPOSITORY']),\n // The GITHUB_TOKEN secret is a GitHub App installation access token.\n // The token's permissions are limited to the repository that contains the\n // workflow.\n // https://docs.github.com/en/actions/security-for-github-actions/security-guides/automatic-token-authentication#about-the-github_token-secret\n GITHUB_TOKEN,\n // Comp-time inlined @cyclonedx/cdxgen package version.\n // The '@rollup/plugin-replace' will replace \"process.env['INLINED_CYCLONEDX_CDXGEN_VERSION']\".\n INLINED_CYCLONEDX_CDXGEN_VERSION: envAsString(\n process.env['INLINED_CYCLONEDX_CDXGEN_VERSION'],\n ),\n // Comp-time inlined Socket package homepage.\n // The '@rollup/plugin-replace' will replace \"process.env['INLINED_SOCKET_CLI_HOMEPAGE']\".\n INLINED_SOCKET_CLI_HOMEPAGE: envAsString(\n process.env['INLINED_SOCKET_CLI_HOMEPAGE'],\n ),\n // Comp-time inlined flag to determine if this is the Legacy build.\n // The '@rollup/plugin-replace' will replace \"process.env['INLINED_SOCKET_CLI_LEGACY_BUILD']\".\n INLINED_SOCKET_CLI_LEGACY_BUILD: envAsBoolean(\n process.env['INLINED_SOCKET_CLI_LEGACY_BUILD'],\n ),\n // Comp-time inlined Socket package name.\n // The '@rollup/plugin-replace' will replace \"process.env['INLINED_SOCKET_CLI_NAME']\".\n INLINED_SOCKET_CLI_NAME: envAsString(\n process.env['INLINED_SOCKET_CLI_NAME'],\n ),\n // Comp-time inlined flag to determine if this is a published build.\n // The '@rollup/plugin-replace' will replace \"process.env['INLINED_SOCKET_CLI_PUBLISHED_BUILD']\".\n INLINED_SOCKET_CLI_PUBLISHED_BUILD: envAsBoolean(\n process.env['INLINED_SOCKET_CLI_PUBLISHED_BUILD'],\n ),\n // Comp-time inlined flag to determine if this is the Sentry build.\n // The '@rollup/plugin-replace' will replace \"process.env['INLINED_SOCKET_CLI_SENTRY_BUILD']\".\n INLINED_SOCKET_CLI_SENTRY_BUILD: envAsBoolean(\n process.env['INLINED_SOCKET_CLI_SENTRY_BUILD'],\n ),\n // Comp-time inlined Socket package version.\n // The '@rollup/plugin-replace' will replace \"process.env['INLINED_SOCKET_CLI_VERSION']\".\n INLINED_SOCKET_CLI_VERSION: envAsString(\n process.env['INLINED_SOCKET_CLI_VERSION'],\n ),\n // Comp-time inlined Socket package version hash.\n // The '@rollup/plugin-replace' will replace \"process.env['INLINED_SOCKET_CLI_VERSION_HASH']\".\n INLINED_SOCKET_CLI_VERSION_HASH: envAsString(\n process.env['INLINED_SOCKET_CLI_VERSION_HASH'],\n ),\n // Comp-time inlined synp package version.\n // The '@rollup/plugin-replace' will replace \"process.env['INLINED_SYNP_VERSION']\".\n INLINED_SYNP_VERSION: envAsString(process.env['INLINED_SYNP_VERSION']),\n // The location of the %localappdata% folder on Windows used to store user-specific,\n // non-roaming application data, like temporary files, cached data, and program\n // settings, that are specific to the current machine and user.\n LOCALAPPDATA: envAsString(env[LOCALAPPDATA]),\n // Flag to enable the module compile cache for the Node.js instance.\n // https://nodejs.org/api/cli.html#node_compile_cachedir\n NODE_COMPILE_CACHE:\n // Lazily access constants.SUPPORTS_NODE_COMPILE_CACHE_ENV_VAR.\n constants.SUPPORTS_NODE_COMPILE_CACHE_ENV_VAR\n ? // Lazily access constants.socketCachePath.\n constants.socketCachePath\n : '',\n // PATH is an environment variable that lists directories where executable\n // programs are located. When a command is run, the system searches these\n // directories to find the executable.\n PATH: envAsString(env['PATH']),\n // Flag to accepts risks of safe-npm and safe-npx run.\n SOCKET_CLI_ACCEPT_RISKS: envAsBoolean(env[SOCKET_CLI_ACCEPT_RISKS]),\n // Flag to change the base URL for all API-calls.\n // https://github.com/SocketDev/socket-cli?tab=readme-ov-file#environment-variables-for-development\n SOCKET_CLI_API_BASE_URL:\n envAsString(env['SOCKET_CLI_API_BASE_URL']) ||\n envAsString(env['SOCKET_SECURITY_API_BASE_URL']),\n // Flag to set the proxy all requests are routed through.\n // https://github.com/SocketDev/socket-cli?tab=readme-ov-file#environment-variables-for-development\n SOCKET_CLI_API_PROXY:\n envAsString(env['SOCKET_CLI_API_PROXY']) ||\n envAsString(env['SOCKET_SECURITY_API_PROXY']),\n // Flag to set the API token.\n // https://github.com/SocketDev/socket-cli?tab=readme-ov-file#environment-variables\n SOCKET_CLI_API_TOKEN:\n envAsString(env['SOCKET_CLI_API_TOKEN']) ||\n envAsString(env['SOCKET_CLI_API_KEY']) ||\n envAsString(env['SOCKET_SECURITY_API_TOKEN']) ||\n envAsString(env['SOCKET_SECURITY_API_KEY']),\n // Flag containing a JSON stringified Socket configuration object.\n SOCKET_CLI_CONFIG: envAsString(env['SOCKET_CLI_CONFIG']),\n // Flag to help debug Socket CLI.\n SOCKET_CLI_DEBUG: envAsBoolean(env['SOCKET_CLI_DEBUG']),\n // A classic GitHub personal access token with the \"repo\" scope or a\n // fine-grained access token with at least read/write permissions set for\n // \"Contents\" and \"Pull Request\".\n // https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens\n SOCKET_CLI_GITHUB_TOKEN:\n envAsString(env['SOCKET_CLI_GITHUB_TOKEN']) ||\n envAsString(env['SOCKET_SECURITY_GITHUB_PAT']) ||\n GITHUB_TOKEN,\n // Flag to make the default API token `undefined`.\n SOCKET_CLI_NO_API_TOKEN: envAsBoolean(env['SOCKET_CLI_NO_API_TOKEN']),\n // Flag to view all risks of safe-npm and safe-npx run.\n SOCKET_CLI_VIEW_ALL_RISKS: envAsBoolean(env[SOCKET_CLI_VIEW_ALL_RISKS]),\n // Specifies the type of terminal or terminal emulator being used by the process.\n TERM: envAsString(env['TERM']),\n // The location of the base directory on Linux and MacOS used to store\n // user-specific data files, defaulting to $HOME/.local/share if not set or empty.\n XDG_DATA_HOME: envAsString(env['XDG_DATA_HOME']),\n })\n}\n\nconst lazyBashRcPath = () =>\n // Lazily access constants.homePath.\n path.join(constants.homePath, '.bashrc')\n\nconst lazyBlessedOptions = () =>\n Object.freeze({\n smartCSR: true,\n // Lazily access constants.WIN32.\n term: constants.WIN32 ? 'windows-ansi' : 'xterm',\n useBCE: true,\n })\n\nconst lazyDistCliPath = () =>\n // Lazily access constants.distPath.\n path.join(constants.distPath, 'cli.js')\n\nconst lazyDistInstrumentWithSentryPath = () =>\n // Lazily access constants.distPath.\n path.join(constants.distPath, 'instrument-with-sentry.js')\n\nconst lazyDistShadowBinPath = () =>\n // Lazily access constants.distPath.\n path.join(constants.distPath, `${SHADOW_BIN}.js`)\n\nconst lazyDistShadowInjectPath = () =>\n // Lazily access constants.distPath.\n path.join(constants.distPath, `${SHADOW_INJECT}.js`)\n\nconst lazyGithubCachePath = () =>\n // Lazily access constants.socketCachePath.\n path.join(constants.socketCachePath, 'github')\n\nconst lazyHomePath = () => os.homedir()\n\nconst lazyMinimumVersionByAgent = () =>\n new Map([\n // Bun >=1.1.39 supports the text-based lockfile.\n // https://bun.sh/blog/bun-lock-text-lockfile\n [BUN, '1.1.39'],\n // The npm version bundled with Node 18.\n // https://nodejs.org/en/about/previous-releases#looking-for-the-latest-release-of-a-version-branch\n ['npm', '10.8.2'],\n // 8.x is the earliest version to support Node 18.\n // https://pnpm.io/installation#compatibility\n // https://www.npmjs.com/package/pnpm?activeTab=versions\n [PNPM, '8.15.7'],\n // 4.x supports >= Node 18.12.0\n // https://github.com/yarnpkg/berry/blob/%40yarnpkg/core/4.1.0/CHANGELOG.md#400\n [YARN_BERRY, '4.0.0'],\n // Latest 1.x.\n // https://www.npmjs.com/package/yarn?activeTab=versions\n [YARN_CLASSIC, '1.22.22'],\n // vlt does not support overrides so we don't gate on it.\n [VLT, '*'],\n ])\n\nconst lazyNmBinPath = () =>\n // Lazily access constants.rootPath.\n path.join(constants.rootPath, 'node_modules/.bin')\n\n// Redefine registryConstants.nodeHardenFlags to account for the\n// INLINED_SOCKET_CLI_SENTRY_BUILD environment variable.\nconst lazyNodeHardenFlags = () =>\n Object.freeze(\n // Lazily access constants.ENV.INLINED_SOCKET_CLI_SENTRY_BUILD.\n constants.ENV.INLINED_SOCKET_CLI_SENTRY_BUILD ||\n // Lazily access constants.WIN32.\n constants.WIN32\n ? []\n : // Harden Node security.\n // https://nodejs.org/en/learn/getting-started/security-best-practices\n [\n '--disable-proto',\n 'throw',\n // We have contributed the following patches to our dependencies to make\n // Node's --frozen-intrinsics workable.\n // √ https://github.com/SBoudrias/Inquirer.js/pull/1683\n // √ https://github.com/pnpm/components/pull/23\n '--frozen-intrinsics',\n '--no-deprecation',\n ],\n )\n\nconst lazyRootBinPath = () =>\n // Lazily access constants.rootPath.\n path.join(constants.rootPath, 'bin')\n\nconst lazyDistPath = () =>\n // Lazily access constants.rootPath.\n path.join(constants.rootPath, 'dist')\n\nconst lazyRootPath = () => path.join(realpathSync.native(__dirname), '..')\n\nconst lazySocketAppDataPath = (): string | undefined => {\n // Get the OS app data folder:\n // - Win: %LOCALAPPDATA% or fail?\n // - Mac: %XDG_DATA_HOME% or fallback to \"~/Library/Application Support/\"\n // - Linux: %XDG_DATA_HOME% or fallback to \"~/.local/share/\"\n // Note: LOCALAPPDATA is typically: C:\\Users\\USERNAME\\AppData\n // Note: XDG stands for \"X Desktop Group\", nowadays \"freedesktop.org\"\n // On most systems that path is: $HOME/.local/share\n // Then append `socket/settings`, so:\n // - Win: %LOCALAPPDATA%\\socket\\settings or return undefined\n // - Mac: %XDG_DATA_HOME%/socket/settings or \"~/Library/Application Support/socket/settings\"\n // - Linux: %XDG_DATA_HOME%/socket/settings or \"~/.local/share/socket/settings\"\n\n // Lazily access constants.WIN32.\n const { WIN32 } = constants\n let dataHome: string | undefined = WIN32\n ? // Lazily access constants.ENV.LOCALAPPDATA\n constants.ENV.LOCALAPPDATA\n : // Lazily access constants.ENV.XDG_DATA_HOME\n constants.ENV.XDG_DATA_HOME\n if (!dataHome) {\n if (WIN32) {\n const logger = require('@socketsecurity/registry/lib/logger')\n logger.warn(`Missing %${LOCALAPPDATA}%`)\n } else {\n dataHome = path.join(\n // Lazily access constants.homePath.\n constants.homePath,\n // Lazily access constants.DARWIN.\n constants.DARWIN ? 'Library/Application Support' : '.local/share',\n )\n }\n }\n return dataHome ? path.join(dataHome, 'socket/settings') : undefined\n}\n\nconst lazySocketCachePath = () =>\n // Lazily access constants.rootPath.\n path.join(constants.rootPath, '.cache')\n\nconst lazyShadowBinPath = () =>\n // Lazily access constants.rootPath.\n path.join(constants.rootPath, SHADOW_BIN)\n\nconst lazyZshRcPath = () =>\n // Lazily access constants.homePath.\n path.join(constants.homePath, '.zshrc')\n\nconst constants: Constants = createConstantsObject(\n {\n ...registryConstantsAttribs.props,\n ALERT_TYPE_CRITICAL_CVE,\n ALERT_TYPE_CVE,\n ALERT_TYPE_MEDIUM_CVE,\n ALERT_TYPE_MILD_CVE,\n API_V0_URL,\n BINARY_LOCK_EXT,\n BUN,\n CLI,\n CVE_ALERT_PROPS_FIRST_PATCHED_VERSION_IDENTIFIER,\n DRY_RUN_LABEL,\n DRY_RUN_BAILING_NOW,\n DRY_RUN_NOT_SAVING,\n ENV: undefined,\n LOCK_EXT,\n NPM_BUGGY_OVERRIDES_PATCHED_VERSION,\n NPM_REGISTRY_URL,\n PNPM,\n REDACTED,\n SHADOW_BIN,\n SHADOW_INJECT,\n SOCKET,\n SOCKET_CLI_ACCEPT_RISKS,\n SOCKET_CLI_BIN_NAME,\n SOCKET_CLI_BIN_NAME_ALIAS,\n SOCKET_CLI_FIX,\n SOCKET_CLI_ISSUES_URL,\n SOCKET_CLI_SENTRY_BIN_NAME_ALIAS,\n SOCKET_CLI_LEGACY_PACKAGE_NAME,\n SOCKET_CLI_NPM_BIN_NAME,\n SOCKET_CLI_NPX_BIN_NAME,\n SOCKET_CLI_OPTIMIZE,\n SOCKET_CLI_PACKAGE_NAME,\n SOCKET_CLI_SAFE_BIN,\n SOCKET_CLI_SAFE_PROGRESS,\n SOCKET_CLI_SENTRY_BIN_NAME,\n SOCKET_CLI_SENTRY_NPM_BIN_NAME,\n SOCKET_CLI_SENTRY_NPX_BIN_NAME,\n SOCKET_CLI_SENTRY_PACKAGE_NAME,\n SOCKET_CLI_VIEW_ALL_RISKS,\n SOCKET_WEBSITE_URL,\n VLT,\n WITH_SENTRY,\n YARN,\n YARN_BERRY,\n YARN_CLASSIC,\n YARN_LOCK,\n bashRcPath: undefined,\n blessedOptions: undefined,\n distCliPath: undefined,\n distInstrumentWithSentryPath: undefined,\n distPath: undefined,\n distShadowBinPath: undefined,\n distShadowInjectPath: undefined,\n githubCachePath: undefined,\n homePath: undefined,\n minimumVersionByAgent: undefined,\n nmBinPath: undefined,\n nodeHardenFlags: undefined,\n rootBinPath: undefined,\n rootPath: undefined,\n shadowBinPath: undefined,\n socketAppDataPath: undefined,\n socketCachePath: undefined,\n zshRcPath: undefined,\n },\n {\n getters: {\n ...registryConstantsAttribs.getters,\n ENV: LAZY_ENV,\n bashRcPath: lazyBashRcPath,\n blessedOptions: lazyBlessedOptions,\n distCliPath: lazyDistCliPath,\n distInstrumentWithSentryPath: lazyDistInstrumentWithSentryPath,\n distPath: lazyDistPath,\n distShadowBinPath: lazyDistShadowBinPath,\n distShadowInjectPath: lazyDistShadowInjectPath,\n githubCachePath: lazyGithubCachePath,\n homePath: lazyHomePath,\n minimumVersionByAgent: lazyMinimumVersionByAgent,\n nmBinPath: lazyNmBinPath,\n nodeHardenFlags: lazyNodeHardenFlags,\n rootBinPath: lazyRootBinPath,\n rootPath: lazyRootPath,\n shadowBinPath: lazyShadowBinPath,\n socketAppDataPath: lazySocketAppDataPath,\n socketCachePath: lazySocketCachePath,\n zshRcPath: lazyZshRcPath,\n },\n internals: {\n ...registryConstantsAttribs.internals,\n getIpc,\n getSentry() {\n return _Sentry\n },\n setSentry(Sentry: Sentry): boolean {\n if (_Sentry === undefined) {\n _Sentry = Sentry\n return true\n }\n return false\n },\n },\n },\n) as Constants\n\nexport default constants\n"],"names":["attributes","getIpc","envAsString","env","__proto__","DISABLE_GITHUB_CACHE","GITHUB_ACTIONS","GITHUB_REF_NAME","GITHUB_REF_TYPE","GITHUB_REPOSITORY","LOCALAPPDATA","constants","PATH","SOCKET_CLI_ACCEPT_RISKS","SOCKET_CLI_API_BASE_URL","SOCKET_CLI_API_PROXY","SOCKET_CLI_API_TOKEN","SOCKET_CLI_CONFIG","SOCKET_CLI_DEBUG","SOCKET_CLI_GITHUB_TOKEN","SOCKET_CLI_NO_API_TOKEN","SOCKET_CLI_VIEW_ALL_RISKS","TERM","XDG_DATA_HOME","path","smartCSR","term","useBCE","WIN32","logger","ENV","bashRcPath","blessedOptions","distCliPath","distInstrumentWithSentryPath","distPath","distShadowBinPath","distShadowInjectPath","githubCachePath","homePath","minimumVersionByAgent","nmBinPath","nodeHardenFlags","rootBinPath","rootPath","shadowBinPath","socketAppDataPath","socketCachePath","zshRcPath","getters","internals","getSentry","_Sentry"],"mappings":";;;;;;;;;;AAWA,iBAAA;AACA;AACA;AAEA;;AAEE;AACEA;;AAEAC;AACF;AACF;AA4IA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAEA;AAEA;;;AAGIC;AACF;;AACQC;AAAI;;AAEZ;AACA;;AAEEC;AACA;;AAEA;AACA;AACAC;AACA;AACA;AACA;AACAC;AACA;AACA;AACA;AACA;AACAC;AACA;AACA;AACAC;AACA;AACA;AACAC;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAIA;AACA;;AAIA;AACA;;AAIA;AACA;;AAIA;AACA;;AAIA;AACA;;AAIA;AACA;;AAIA;AACA;;AAIA;AACA;;AAEA;AACA;AACA;AACAC;AACA;AACA;;AAEE;AACAC;AACI;;AAGN;AACA;AACA;AACAC;AACA;AACAC;AACA;AACA;AACAC;AAGA;AACA;AACAC;AAGA;AACA;AACAC;AAKA;AACAC;AACA;AACAC;AACA;AACA;AACA;AACA;AACAC;AAIA;AACAC;AACA;AACAC;AACA;AACAC;AACA;AACA;AACAC;AACF;AACF;AAEA;AACE;AACAC;AAEF;AAEIC;AACA;AACAC;AACAC;AACF;AAEF;AACE;AACAH;AAEF;AACE;AACAA;AAEF;AACE;AACAA;AAEF;AACE;AACAA;AAEF;AACE;AACAA;AAEF;AAEA;AAEI;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAGJ;AACE;AACAA;;AAEF;AACA;AACA;AAEI;AACAb;AACE;AACAA;AAEE;AACA;AACA;AAGE;AACA;AACA;AACA;AACA;AAKV;AACE;AACAa;AAEF;AACE;AACAA;AAEF;AAEA;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AACQI;AAAM;;AAEV;;AAEA;;;AAGF;AACE;AACAC;AACF;;AAEI;AACAlB;AACA;AACAA;AAEJ;AACF;;AAEF;AAEA;AACE;AACAa;AAEF;AACE;AACAA;AAEF;AACE;AACAA;AAEIb;;;;;;;;;;;;;;AAeFmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCAC;AACAC;AACAC;AACAC;AACAC;AACAC;AACAC;AACAC;AACAC;AACAC;AACAC;AACAC;AACAC;AACAC;AACAC;AACAC;AACAC;AACAC;AACF;AAEEC;;AAEEnB;AACAC;AACAC;AACAC;AACAC;AACAC;AACAC;AACAC;AACAC;AACAC;AACAC;AACAC;AACAC;AACAC;AACAC;AACAC;AACAC;AACAC;AACAC;;AAEFE;;;AAGEC;AACE;;;;AAIEC;AACA;AACF;AACA;AACF;AACF;AACF;;","debugId":"ac8f109d-4e95-4c90-924f-71d7c453d532"}
|
package/dist/utils.js
CHANGED
|
@@ -505,16 +505,16 @@ const {
|
|
|
505
505
|
// The API server that should be used for operations.
|
|
506
506
|
function getDefaultApiBaseUrl$1() {
|
|
507
507
|
const baseUrl =
|
|
508
|
-
// Lazily access constants.ENV.
|
|
509
|
-
constants.ENV.
|
|
508
|
+
// Lazily access constants.ENV.SOCKET_CLI_API_BASE_URL.
|
|
509
|
+
constants.ENV.SOCKET_CLI_API_BASE_URL || getConfigValueOrUndef('apiBaseUrl');
|
|
510
510
|
return strings.isNonEmptyString(baseUrl) ? baseUrl : undefined;
|
|
511
511
|
}
|
|
512
512
|
|
|
513
513
|
// The API server that should be used for operations.
|
|
514
514
|
function getDefaultHttpProxy() {
|
|
515
515
|
const apiProxy =
|
|
516
|
-
// Lazily access constants.ENV.
|
|
517
|
-
constants.ENV.
|
|
516
|
+
// Lazily access constants.ENV.SOCKET_CLI_API_PROXY.
|
|
517
|
+
constants.ENV.SOCKET_CLI_API_PROXY || getConfigValueOrUndef('apiProxy');
|
|
518
518
|
return strings.isNonEmptyString(apiProxy) ? apiProxy : undefined;
|
|
519
519
|
}
|
|
520
520
|
|
|
@@ -526,8 +526,8 @@ function getDefaultToken() {
|
|
|
526
526
|
_defaultToken = undefined;
|
|
527
527
|
} else {
|
|
528
528
|
const key =
|
|
529
|
-
// Lazily access constants.ENV.
|
|
530
|
-
constants.ENV.
|
|
529
|
+
// Lazily access constants.ENV.SOCKET_CLI_API_TOKEN.
|
|
530
|
+
constants.ENV.SOCKET_CLI_API_TOKEN || getConfigValueOrUndef('apiToken') || _defaultToken;
|
|
531
531
|
_defaultToken = strings.isNonEmptyString(key) ? key : undefined;
|
|
532
532
|
}
|
|
533
533
|
return _defaultToken;
|
|
@@ -541,8 +541,8 @@ function hasDefaultToken() {
|
|
|
541
541
|
}
|
|
542
542
|
function getPublicToken() {
|
|
543
543
|
return (
|
|
544
|
-
// Lazily access constants.ENV.
|
|
545
|
-
(constants.ENV.
|
|
544
|
+
// Lazily access constants.ENV.SOCKET_CLI_API_TOKEN.
|
|
545
|
+
(constants.ENV.SOCKET_CLI_API_TOKEN || getDefaultToken()) ?? SOCKET_PUBLIC_API_TOKEN
|
|
546
546
|
);
|
|
547
547
|
}
|
|
548
548
|
async function setupSdk(apiToken = getDefaultToken(), apiBaseUrl = getDefaultApiBaseUrl$1(), proxy = getDefaultHttpProxy()) {
|
|
@@ -694,9 +694,9 @@ async function getErrorMessageForHttpStatusCode(code) {
|
|
|
694
694
|
|
|
695
695
|
// The API server that should be used for operations.
|
|
696
696
|
function getDefaultApiBaseUrl() {
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
697
|
+
const baseUrl =
|
|
698
|
+
// Lazily access constants.ENV.SOCKET_CLI_API_BASE_URL.
|
|
699
|
+
constants.ENV.SOCKET_CLI_API_BASE_URL || getConfigValueOrUndef('apiBaseUrl');
|
|
700
700
|
if (strings.isNonEmptyString(baseUrl)) {
|
|
701
701
|
return baseUrl;
|
|
702
702
|
}
|
|
@@ -1131,8 +1131,8 @@ async function meowWithSubcommands(subcommands, options) {
|
|
|
1131
1131
|
// The config will be marked as readOnly to prevent persisting it.
|
|
1132
1132
|
overrideConfigApiToken(undefined);
|
|
1133
1133
|
} else {
|
|
1134
|
-
// Lazily access constants.ENV.
|
|
1135
|
-
const tokenOverride = constants.ENV.
|
|
1134
|
+
// Lazily access constants.ENV.SOCKET_CLI_API_TOKEN.
|
|
1135
|
+
const tokenOverride = constants.ENV.SOCKET_CLI_API_TOKEN;
|
|
1136
1136
|
if (tokenOverride) {
|
|
1137
1137
|
// This will set the token (even if there was a config override) and
|
|
1138
1138
|
// set it to readOnly, making sure the temp token won't be persisted.
|
|
@@ -2935,5 +2935,5 @@ exports.supportedConfigKeys = supportedConfigKeys;
|
|
|
2935
2935
|
exports.updateConfigValue = updateConfigValue;
|
|
2936
2936
|
exports.validationFlags = validationFlags;
|
|
2937
2937
|
exports.walkNestedMap = walkNestedMap;
|
|
2938
|
-
//# debugId=
|
|
2938
|
+
//# debugId=b0a949b5-7c7b-46ea-b147-73f0f9c6007a
|
|
2939
2939
|
//# sourceMappingURL=utils.js.map
|