@socketsecurity/cli-with-sentry 0.15.11 → 0.15.12
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/bin/cli.js +6 -6
- package/dist/.config/tsconfig.dts.tsbuildinfo +1 -1
- package/dist/cli.js +5731 -6607
- package/dist/cli.js.map +1 -1
- package/dist/constants.js +274 -305
- package/dist/constants.js.map +1 -1
- package/dist/instrument-with-sentry.js +28 -34
- package/dist/instrument-with-sentry.js.map +1 -1
- package/dist/shadow-bin.js +96 -123
- package/dist/shadow-bin.js.map +1 -1
- package/dist/shadow-inject.js +470 -580
- package/dist/shadow-inject.js.map +1 -1
- package/dist/socket-completion.bash +221 -0
- package/dist/types/cli.d.mts +2 -2
- package/dist/types/commands/analytics/cmd-analytics.d.mts +9 -15
- package/dist/types/commands/analytics/fetch-org-analytics.d.mts +4 -6
- package/dist/types/commands/analytics/fetch-repo-analytics.d.mts +4 -7
- package/dist/types/commands/analytics/handle-analytics.d.mts +9 -15
- package/dist/types/commands/analytics/handle-analytics.d.mts.map +1 -1
- package/dist/types/commands/analytics/output-analytics.d.mts +26 -46
- package/dist/types/commands/analytics/output-analytics.d.mts.map +1 -1
- package/dist/types/commands/audit-log/cmd-audit-log.d.mts +9 -15
- package/dist/types/commands/audit-log/fetch-audit-log.d.mts +10 -16
- package/dist/types/commands/audit-log/fetch-audit-log.d.mts.map +1 -1
- package/dist/types/commands/audit-log/handle-audit-log.d.mts +9 -15
- package/dist/types/commands/audit-log/handle-audit-log.d.mts.map +1 -1
- package/dist/types/commands/audit-log/output-audit-log.d.mts +22 -47
- package/dist/types/commands/audit-log/output-audit-log.d.mts.map +1 -1
- package/dist/types/commands/cdxgen/cmd-cdxgen.d.mts +9 -15
- package/dist/types/commands/cdxgen/cmd-cdxgen.d.mts.map +1 -1
- package/dist/types/commands/cdxgen/handle-cdxgen.d.mts +4 -0
- package/dist/types/commands/cdxgen/handle-cdxgen.d.mts.map +1 -0
- package/dist/types/commands/ci/cmd-ci.d.mts +9 -15
- package/dist/types/commands/ci/fetch-default-org-slug.d.mts +3 -3
- package/dist/types/commands/ci/handle-ci.d.mts +2 -2
- package/dist/types/commands/config/cmd-config-auto.d.mts +9 -15
- package/dist/types/commands/config/cmd-config-get.d.mts +9 -15
- package/dist/types/commands/config/cmd-config-list.d.mts +9 -15
- package/dist/types/commands/config/cmd-config-set.d.mts +9 -15
- package/dist/types/commands/config/cmd-config-unset.d.mts +9 -15
- package/dist/types/commands/config/cmd-config.d.mts +3 -3
- package/dist/types/commands/config/discover-config-value.d.mts +3 -5
- package/dist/types/commands/config/discover-config-value.d.mts.map +1 -1
- package/dist/types/commands/config/handle-config-auto.d.mts +7 -10
- package/dist/types/commands/config/handle-config-auto.d.mts.map +1 -1
- package/dist/types/commands/config/handle-config-get.d.mts +7 -10
- package/dist/types/commands/config/handle-config-get.d.mts.map +1 -1
- package/dist/types/commands/config/handle-config-set.d.mts +8 -12
- package/dist/types/commands/config/handle-config-set.d.mts.map +1 -1
- package/dist/types/commands/config/handle-config-unset.d.mts +7 -10
- package/dist/types/commands/config/handle-config-unset.d.mts.map +1 -1
- package/dist/types/commands/config/output-config-auto.d.mts +4 -8
- package/dist/types/commands/config/output-config-get.d.mts +4 -8
- package/dist/types/commands/config/output-config-list.d.mts +6 -9
- package/dist/types/commands/config/output-config-list.d.mts.map +1 -1
- package/dist/types/commands/config/output-config-set.d.mts +3 -6
- package/dist/types/commands/config/output-config-unset.d.mts +3 -6
- package/dist/types/commands/dependencies/cmd-dependencies.d.mts +9 -15
- package/dist/types/commands/dependencies/fetch-dependencies.d.mts +7 -10
- package/dist/types/commands/dependencies/fetch-dependencies.d.mts.map +1 -1
- package/dist/types/commands/dependencies/handle-dependencies.d.mts +7 -11
- package/dist/types/commands/dependencies/handle-dependencies.d.mts.map +1 -1
- package/dist/types/commands/dependencies/output-dependencies.d.mts +8 -15
- package/dist/types/commands/dependencies/output-dependencies.d.mts.map +1 -1
- package/dist/types/commands/diff-scan/cmd-diff-scan-get.d.mts +9 -15
- package/dist/types/commands/diff-scan/cmd-diff-scan.d.mts +3 -3
- package/dist/types/commands/diff-scan/fetch-diff-scan.d.mts +8 -12
- package/dist/types/commands/diff-scan/fetch-diff-scan.d.mts.map +1 -1
- package/dist/types/commands/diff-scan/handle-diff-scan.d.mts +10 -17
- package/dist/types/commands/diff-scan/handle-diff-scan.d.mts.map +1 -1
- package/dist/types/commands/diff-scan/output-diff-scan.d.mts +8 -15
- package/dist/types/commands/diff-scan/output-diff-scan.d.mts.map +1 -1
- package/dist/types/commands/fix/cmd-fix.d.mts +9 -15
- package/dist/types/commands/fix/git.d.mts +14 -49
- package/dist/types/commands/fix/npm-fix.d.mts +4 -16
- package/dist/types/commands/fix/npm-fix.d.mts.map +1 -1
- package/dist/types/commands/fix/open-pr.d.mts +20 -46
- package/dist/types/commands/fix/open-pr.d.mts.map +1 -1
- package/dist/types/commands/fix/pnpm-fix.d.mts +4 -16
- package/dist/types/commands/fix/pnpm-fix.d.mts.map +1 -1
- package/dist/types/commands/fix/run-fix.d.mts +3 -3
- package/dist/types/commands/fix/shared.d.mts +9 -15
- package/dist/types/commands/fix/types.d.mts +16 -16
- package/dist/types/commands/info/cmd-info.d.mts +9 -15
- package/dist/types/commands/info/fetch-package-info.d.mts +3 -7
- package/dist/types/commands/info/handle-package-info.d.mts +15 -22
- package/dist/types/commands/info/handle-package-info.d.mts.map +1 -1
- package/dist/types/commands/info/output-package-info.d.mts +10 -18
- package/dist/types/commands/info/output-package-info.d.mts.map +1 -1
- package/dist/types/commands/install/cmd-install-completion.d.mts +10 -0
- package/dist/types/commands/install/cmd-install-completion.d.mts.map +1 -0
- package/dist/types/commands/install/cmd-install.d.mts +3 -0
- package/dist/types/commands/install/cmd-install.d.mts.map +1 -0
- package/dist/types/commands/install/handle-install-completion.d.mts +2 -0
- package/dist/types/commands/install/handle-install-completion.d.mts.map +1 -0
- package/dist/types/commands/install/output-install-completion.d.mts +12 -0
- package/dist/types/commands/install/output-install-completion.d.mts.map +1 -0
- package/dist/types/commands/install/setup-tab-completion.d.mts +13 -0
- package/dist/types/commands/install/setup-tab-completion.d.mts.map +1 -0
- package/dist/types/commands/login/apply-login.d.mts +2 -7
- package/dist/types/commands/login/attempt-login.d.mts +2 -5
- package/dist/types/commands/login/attempt-login.d.mts.map +1 -1
- package/dist/types/commands/login/cmd-login.d.mts +9 -15
- package/dist/types/commands/logout/apply-logout.d.mts +2 -2
- package/dist/types/commands/logout/attempt-logout.d.mts +2 -2
- package/dist/types/commands/logout/cmd-logout.d.mts +9 -15
- package/dist/types/commands/manifest/cmd-manifest-auto.d.mts +9 -15
- package/dist/types/commands/manifest/cmd-manifest-cdxgen.d.mts +10 -0
- package/dist/types/commands/manifest/cmd-manifest-cdxgen.d.mts.map +1 -0
- package/dist/types/commands/manifest/cmd-manifest-conda.d.mts +9 -15
- package/dist/types/commands/manifest/cmd-manifest-gradle.d.mts +9 -15
- package/dist/types/commands/manifest/cmd-manifest-kotlin.d.mts +9 -15
- package/dist/types/commands/manifest/cmd-manifest-scala.d.mts +9 -15
- package/dist/types/commands/manifest/cmd-manifest.d.mts +9 -15
- package/dist/types/commands/manifest/cmd-manifest.d.mts.map +1 -1
- package/dist/types/commands/manifest/convert-conda-to-requirements.d.mts +7 -15
- package/dist/types/commands/manifest/convert_gradle_to_maven.d.mts +2 -8
- package/dist/types/commands/manifest/convert_sbt_to_maven.d.mts +2 -8
- package/dist/types/commands/manifest/handle-manifest-conda.d.mts +3 -9
- package/dist/types/commands/manifest/output-requirements.d.mts +6 -10
- package/dist/types/commands/{cdxgen → manifest}/run-cdxgen.d.mts +2 -2
- package/dist/types/commands/manifest/run-cdxgen.d.mts.map +1 -0
- package/dist/types/commands/npm/cmd-npm.d.mts +9 -15
- package/dist/types/commands/npx/cmd-npx.d.mts +9 -15
- package/dist/types/commands/oops/cmd-oops.d.mts +9 -15
- package/dist/types/commands/optimize/add-overrides.d.mts +18 -22
- package/dist/types/commands/optimize/apply-optimization.d.mts +2 -6
- package/dist/types/commands/optimize/cmd-optimize.d.mts +9 -15
- package/dist/types/commands/optimize/deps-includes-by-agent.d.mts +4 -7
- package/dist/types/commands/optimize/get-dependency-entries.d.mts +3 -5
- package/dist/types/commands/optimize/get-overrides-by-agent.d.mts +8 -11
- package/dist/types/commands/optimize/lockfile-includes-by-agent.d.mts +3 -10
- package/dist/types/commands/optimize/ls-by-agent.d.mts +6 -13
- package/dist/types/commands/optimize/shared.d.mts +2 -2
- package/dist/types/commands/optimize/types.d.mts +7 -7
- package/dist/types/commands/optimize/update-lockfile.d.mts +9 -12
- package/dist/types/commands/optimize/update-manifest-by-agent.d.mts +5 -11
- package/dist/types/commands/organization/cmd-organization-list.d.mts +9 -15
- package/dist/types/commands/organization/cmd-organization-policy-license.d.mts +9 -15
- package/dist/types/commands/organization/cmd-organization-policy-security.d.mts +9 -15
- package/dist/types/commands/organization/cmd-organization-policy.d.mts +3 -3
- package/dist/types/commands/organization/cmd-organization-quota.d.mts +9 -15
- package/dist/types/commands/organization/cmd-organization.d.mts +3 -3
- package/dist/types/commands/organization/fetch-license-policy.d.mts +4 -6
- package/dist/types/commands/organization/fetch-organization-list.d.mts +4 -6
- package/dist/types/commands/organization/fetch-quota.d.mts +4 -6
- package/dist/types/commands/organization/fetch-security-policy.d.mts +4 -6
- package/dist/types/commands/organization/handle-license-policy.d.mts +3 -6
- package/dist/types/commands/organization/handle-organization-list.d.mts +3 -5
- package/dist/types/commands/organization/handle-quota.d.mts +3 -3
- package/dist/types/commands/organization/handle-security-policy.d.mts +3 -6
- package/dist/types/commands/organization/output-license-policy.d.mts +4 -7
- package/dist/types/commands/organization/output-organization-list.d.mts +4 -7
- package/dist/types/commands/organization/output-quota.d.mts +4 -7
- package/dist/types/commands/organization/output-security-policy.d.mts +4 -7
- package/dist/types/commands/package/cmd-package-score.d.mts +9 -15
- package/dist/types/commands/package/cmd-package-shallow.d.mts +16 -22
- package/dist/types/commands/package/cmd-package.d.mts +3 -3
- package/dist/types/commands/package/fetch-purl-deep-score.d.mts +49 -51
- package/dist/types/commands/package/fetch-purls-shallow-score.d.mts +4 -6
- package/dist/types/commands/package/handle-purl-deep-score.d.mts +3 -6
- package/dist/types/commands/package/handle-purls-shallow-score.d.mts +6 -9
- package/dist/types/commands/package/handle-purls-shallow-score.d.mts.map +1 -1
- package/dist/types/commands/package/output-purl-score.d.mts +4 -8
- package/dist/types/commands/package/output-purls-shallow-score.d.mts +4 -8
- package/dist/types/commands/package/parse-package-specifiers.d.mts +5 -8
- package/dist/types/commands/raw-npm/cmd-raw-npm.d.mts +9 -15
- package/dist/types/commands/raw-npm/run-raw-npm.d.mts +2 -4
- package/dist/types/commands/raw-npx/cmd-raw-npx.d.mts +9 -15
- package/dist/types/commands/raw-npx/run-raw-npx.d.mts +2 -4
- package/dist/types/commands/report/cmd-report-create.d.mts +9 -15
- package/dist/types/commands/report/cmd-report-view.d.mts +9 -15
- package/dist/types/commands/report/cmd-report.d.mts +3 -3
- package/dist/types/commands/repos/cmd-repos-create.d.mts +9 -15
- package/dist/types/commands/repos/cmd-repos-del.d.mts +9 -15
- package/dist/types/commands/repos/cmd-repos-list.d.mts +9 -15
- package/dist/types/commands/repos/cmd-repos-update.d.mts +9 -15
- package/dist/types/commands/repos/cmd-repos-view.d.mts +9 -15
- package/dist/types/commands/repos/cmd-repos.d.mts +3 -3
- package/dist/types/commands/repos/fetch-create-repo.d.mts +11 -18
- package/dist/types/commands/repos/fetch-create-repo.d.mts.map +1 -1
- package/dist/types/commands/repos/fetch-delete-repo.d.mts +4 -7
- package/dist/types/commands/repos/fetch-list-repos.d.mts +10 -16
- package/dist/types/commands/repos/fetch-list-repos.d.mts.map +1 -1
- package/dist/types/commands/repos/fetch-update-repo.d.mts +11 -18
- package/dist/types/commands/repos/fetch-update-repo.d.mts.map +1 -1
- package/dist/types/commands/repos/fetch-view-repo.d.mts +4 -7
- package/dist/types/commands/repos/handle-create-repo.d.mts +10 -20
- package/dist/types/commands/repos/handle-create-repo.d.mts.map +1 -1
- package/dist/types/commands/repos/handle-delete-repo.d.mts +3 -7
- package/dist/types/commands/repos/handle-list-repos.d.mts +10 -17
- package/dist/types/commands/repos/handle-list-repos.d.mts.map +1 -1
- package/dist/types/commands/repos/handle-update-repo.d.mts +10 -20
- package/dist/types/commands/repos/handle-update-repo.d.mts.map +1 -1
- package/dist/types/commands/repos/handle-view-repo.d.mts +3 -7
- package/dist/types/commands/repos/output-create-repo.d.mts +4 -8
- package/dist/types/commands/repos/output-delete-repo.d.mts +4 -8
- package/dist/types/commands/repos/output-list-repos.d.mts +4 -7
- package/dist/types/commands/repos/output-update-repo.d.mts +4 -8
- package/dist/types/commands/repos/output-view-repo.d.mts +4 -7
- package/dist/types/commands/scan/cmd-scan-create.d.mts +9 -15
- package/dist/types/commands/scan/cmd-scan-del.d.mts +9 -15
- package/dist/types/commands/scan/cmd-scan-diff.d.mts +9 -15
- package/dist/types/commands/scan/cmd-scan-list.d.mts +3 -3
- package/dist/types/commands/scan/cmd-scan-metadata.d.mts +3 -3
- package/dist/types/commands/scan/cmd-scan-report.d.mts +3 -3
- package/dist/types/commands/scan/cmd-scan-view.d.mts +3 -3
- package/dist/types/commands/scan/cmd-scan.d.mts +3 -3
- package/dist/types/commands/scan/fetch-create-org-full-scan.d.mts +11 -26
- package/dist/types/commands/scan/fetch-create-org-full-scan.d.mts.map +1 -1
- package/dist/types/commands/scan/fetch-delete-org-full-scan.d.mts +4 -7
- package/dist/types/commands/scan/fetch-diff-scan.d.mts +8 -12
- package/dist/types/commands/scan/fetch-diff-scan.d.mts.map +1 -1
- package/dist/types/commands/scan/fetch-list-scans.d.mts +13 -22
- package/dist/types/commands/scan/fetch-list-scans.d.mts.map +1 -1
- package/dist/types/commands/scan/fetch-report-data.d.mts +8 -14
- package/dist/types/commands/scan/fetch-scan-metadata.d.mts +4 -7
- package/dist/types/commands/scan/fetch-scan.d.mts +4 -7
- package/dist/types/commands/scan/fetch-supported-scan-file-names.d.mts +4 -6
- package/dist/types/commands/scan/generate-report.d.mts +36 -50
- package/dist/types/commands/scan/generate-report.d.mts.map +1 -1
- package/dist/types/commands/scan/handle-create-new-scan.d.mts +20 -37
- package/dist/types/commands/scan/handle-create-new-scan.d.mts.map +1 -1
- package/dist/types/commands/scan/handle-delete-scan.d.mts +3 -7
- package/dist/types/commands/scan/handle-diff-scan.d.mts +10 -17
- package/dist/types/commands/scan/handle-diff-scan.d.mts.map +1 -1
- package/dist/types/commands/scan/handle-list-scans.d.mts +13 -23
- package/dist/types/commands/scan/handle-list-scans.d.mts.map +1 -1
- package/dist/types/commands/scan/handle-scan-metadata.d.mts +3 -7
- package/dist/types/commands/scan/handle-scan-report.d.mts +12 -21
- package/dist/types/commands/scan/handle-scan-report.d.mts.map +1 -1
- package/dist/types/commands/scan/handle-scan-view.d.mts +3 -8
- package/dist/types/commands/scan/output-create-new-scan.d.mts +4 -8
- package/dist/types/commands/scan/output-delete-scan.d.mts +4 -7
- package/dist/types/commands/scan/output-diff-scan.d.mts +8 -15
- package/dist/types/commands/scan/output-diff-scan.d.mts.map +1 -1
- package/dist/types/commands/scan/output-list-scans.d.mts +4 -7
- package/dist/types/commands/scan/output-scan-metadata.d.mts +4 -8
- package/dist/types/commands/scan/output-scan-report.d.mts +20 -38
- package/dist/types/commands/scan/output-scan-report.d.mts.map +1 -1
- package/dist/types/commands/scan/output-scan-view.d.mts +4 -10
- package/dist/types/commands/scan/stream-scan.d.mts +2 -6
- package/dist/types/commands/scan/suggest-org-slug.d.mts +2 -2
- package/dist/types/commands/scan/suggest-repo-slug.d.mts +4 -4
- package/dist/types/commands/scan/suggest_branch_slug.d.mts +2 -4
- package/dist/types/commands/scan/suggest_target.d.mts +2 -2
- package/dist/types/commands/threat-feed/cmd-threat-feed.d.mts +9 -15
- package/dist/types/commands/threat-feed/fetch-threat-feed.d.mts +10 -16
- package/dist/types/commands/threat-feed/fetch-threat-feed.d.mts.map +1 -1
- package/dist/types/commands/threat-feed/handle-threat-feed.d.mts +10 -17
- package/dist/types/commands/threat-feed/handle-threat-feed.d.mts.map +1 -1
- package/dist/types/commands/threat-feed/output-threat-feed.d.mts +4 -7
- package/dist/types/commands/threat-feed/types.d.mts +12 -12
- package/dist/types/commands/uninstall/cmd-uninstall-completion.d.mts +9 -0
- package/dist/types/commands/uninstall/cmd-uninstall-completion.d.mts.map +1 -0
- package/dist/types/commands/uninstall/cmd-uninstall.d.mts +3 -0
- package/dist/types/commands/uninstall/cmd-uninstall.d.mts.map +1 -0
- package/dist/types/commands/uninstall/handle-uninstall-completion.d.mts +2 -0
- package/dist/types/commands/uninstall/handle-uninstall-completion.d.mts.map +1 -0
- package/dist/types/commands/uninstall/output-uninstall-completion.d.mts +6 -0
- package/dist/types/commands/uninstall/output-uninstall-completion.d.mts.map +1 -0
- package/dist/types/commands/uninstall/teardown-tab-completion.d.mts +6 -0
- package/dist/types/commands/uninstall/teardown-tab-completion.d.mts.map +1 -0
- package/dist/types/commands/wrapper/add-socket-wrapper.d.mts +2 -2
- package/dist/types/commands/wrapper/check-socket-wrapper-setup.d.mts +2 -2
- package/dist/types/commands/wrapper/cmd-wrapper.d.mts +9 -15
- package/dist/types/commands/wrapper/postinstall-wrapper.d.mts +2 -2
- package/dist/types/commands/wrapper/postinstall-wrapper.d.mts.map +1 -1
- package/dist/types/commands/wrapper/remove-socket-wrapper.d.mts +2 -2
- package/dist/types/constants.d.mts +125 -135
- package/dist/types/constants.d.mts.map +1 -1
- package/dist/types/flags.d.mts +14 -17
- package/dist/types/flags.d.mts.map +1 -1
- package/dist/types/instrument-with-sentry.d.mts +2 -2
- package/dist/types/shadow/npm/arborist/index.d.mts +2 -2
- package/dist/types/shadow/npm/arborist/lib/arborist/index.d.mts +19 -24
- package/dist/types/shadow/npm/arborist/lib/arborist/types.d.mts +43 -71
- package/dist/types/shadow/npm/arborist/lib/dep-valid.d.mts +3 -8
- package/dist/types/shadow/npm/arborist/lib/edge.d.mts +58 -71
- package/dist/types/shadow/npm/arborist/lib/node.d.mts +55 -91
- package/dist/types/shadow/npm/arborist/lib/override-set.d.mts +26 -32
- package/dist/types/shadow/npm/arborist-helpers.d.mts +33 -66
- package/dist/types/shadow/npm/arborist-helpers.d.mts.map +1 -1
- package/dist/types/shadow/npm/bin.d.mts +2 -5
- package/dist/types/shadow/npm/inject.d.mts +2 -2
- package/dist/types/shadow/npm/install.d.mts +11 -16
- package/dist/types/shadow/npm/link.d.mts +2 -5
- package/dist/types/shadow/npm/paths.d.mts +7 -7
- package/dist/types/shadow/npm/proc-log/index.d.mts +3 -6
- package/dist/types/types.d.mts +15 -17
- package/dist/types/utils/agent.d.mts +11 -14
- package/dist/types/utils/alert/artifact.d.mts +32 -50
- package/dist/types/utils/alert/fix.d.mts +5 -5
- package/dist/types/utils/alert/severity.d.mts +12 -24
- package/dist/types/utils/alerts-map.d.mts +23 -36
- package/dist/types/utils/api.d.mts +11 -34
- package/dist/types/utils/check-input.d.mts +9 -12
- package/dist/types/utils/cmd.d.mts +4 -4
- package/dist/types/utils/color-or-markdown.d.mts +14 -23
- package/dist/types/utils/color-or-markdown.d.mts.map +1 -1
- package/dist/types/utils/completion.d.mts +11 -0
- package/dist/types/utils/completion.d.mts.map +1 -0
- package/dist/types/utils/config.d.mts +22 -31
- package/dist/types/utils/config.d.mts.map +1 -1
- package/dist/types/utils/determine-org-slug.d.mts +2 -7
- package/dist/types/utils/errors.d.mts +12 -21
- package/dist/types/utils/fail-msg-with-badge.d.mts +2 -5
- package/dist/types/utils/fs.d.mts +21 -52
- package/dist/types/utils/get-output-kind.d.mts +3 -6
- package/dist/types/utils/glob.d.mts +13 -24
- package/dist/types/utils/map-to-object.d.mts +4 -6
- package/dist/types/utils/markdown.d.mts +4 -15
- package/dist/types/utils/meow-with-subcommands.d.mts +34 -46
- package/dist/types/utils/meow-with-subcommands.d.mts.map +1 -1
- package/dist/types/utils/npm-paths.d.mts +7 -7
- package/dist/types/utils/npm-paths.d.mts.map +1 -1
- package/dist/types/utils/objects.d.mts +3 -8
- package/dist/types/utils/output-formatting.d.mts +14 -24
- package/dist/types/utils/package-environment.d.mts +51 -72
- package/dist/types/utils/package-environment.d.mts.map +1 -1
- package/dist/types/utils/path-resolve.d.mts +9 -14
- package/dist/types/utils/pnpm.d.mts +9 -7
- package/dist/types/utils/pnpm.d.mts.map +1 -1
- package/dist/types/utils/sdk.d.mts +8 -12
- package/dist/types/utils/semver.d.mts +5 -17
- package/dist/types/utils/serialize-result-json.d.mts +3 -3
- package/dist/types/utils/socket-package-alert.d.mts +62 -81
- package/dist/types/utils/socket-url.d.mts +9 -15
- package/dist/types/utils/spec.d.mts +4 -7
- package/dist/types/utils/spec.d.mts.map +1 -1
- package/dist/types/utils/strings.d.mts +2 -5
- package/dist/types/utils/translations.d.mts +592 -592
- package/dist/types/utils/walk-nested-map.d.mts +7 -10
- package/dist/utils.js +1531 -1833
- package/dist/utils.js.map +1 -1
- package/dist/vendor.js +38333 -51605
- package/dist/vendor.js.map +1 -1
- package/external/@socketsecurity/registry/external/@npmcli/package-json/index.js +5 -8
- package/external/@socketsecurity/registry/external/@npmcli/promise-spawn.js +2 -4
- package/external/@socketsecurity/registry/external/cacache.js +1 -2
- package/external/@socketsecurity/registry/external/libnpmpack.js +36 -76
- package/external/@socketsecurity/registry/external/make-fetch-happen.js +31 -67
- package/external/@socketsecurity/registry/external/pacote.js +36 -76
- package/external/@socketsecurity/registry/external/tinyglobby.js +3 -6
- package/external/@socketsecurity/registry/external/which.js +2 -4
- package/external/@socketsecurity/registry/lib/logger.d.ts +3 -1
- package/external/@socketsecurity/registry/lib/logger.js +149 -69
- package/external/@socketsecurity/registry/package.json +2 -2
- package/external/blessed/lib/alias.js +475 -468
- package/external/blessed/lib/blessed.js +12 -12
- package/external/blessed/lib/colors.js +234 -194
- package/external/blessed/lib/events.js +64 -70
- package/external/blessed/lib/gpmclient.js +117 -141
- package/external/blessed/lib/helpers.js +89 -94
- package/external/blessed/lib/keys.js +169 -342
- package/external/blessed/lib/program.js +2130 -2365
- package/external/blessed/lib/tput.js +1183 -1276
- package/external/blessed/lib/unicode.js +400 -522
- package/external/blessed/lib/widget.js +14 -14
- package/external/blessed/lib/widgets/ansiimage.js +90 -96
- package/external/blessed/lib/widgets/bigtext.js +91 -102
- package/external/blessed/lib/widgets/box.js +8 -8
- package/external/blessed/lib/widgets/button.js +23 -23
- package/external/blessed/lib/widgets/checkbox.js +50 -54
- package/external/blessed/lib/widgets/element.js +1415 -1716
- package/external/blessed/lib/widgets/filemanager.js +107 -118
- package/external/blessed/lib/widgets/form.js +144 -178
- package/external/blessed/lib/widgets/image.js +26 -36
- package/external/blessed/lib/widgets/input.js +8 -8
- package/external/blessed/lib/widgets/layout.js +103 -119
- package/external/blessed/lib/widgets/line.js +17 -20
- package/external/blessed/lib/widgets/list.js +349 -402
- package/external/blessed/lib/widgets/listbar.js +265 -306
- package/external/blessed/lib/widgets/listtable.js +133 -146
- package/external/blessed/lib/widgets/loading.js +31 -31
- package/external/blessed/lib/widgets/log.js +41 -40
- package/external/blessed/lib/widgets/message.js +64 -86
- package/external/blessed/lib/widgets/node.js +175 -207
- package/external/blessed/lib/widgets/overlayimage.js +360 -437
- package/external/blessed/lib/widgets/progressbar.js +79 -88
- package/external/blessed/lib/widgets/prompt.js +54 -61
- package/external/blessed/lib/widgets/question.js +48 -61
- package/external/blessed/lib/widgets/radiobutton.js +26 -27
- package/external/blessed/lib/widgets/radioset.js +8 -8
- package/external/blessed/lib/widgets/screen.js +1186 -1375
- package/external/blessed/lib/widgets/scrollablebox.js +202 -228
- package/external/blessed/lib/widgets/scrollabletext.js +9 -9
- package/external/blessed/lib/widgets/table.js +187 -216
- package/external/blessed/lib/widgets/terminal.js +258 -298
- package/external/blessed/lib/widgets/text.js +9 -9
- package/external/blessed/lib/widgets/textarea.js +188 -222
- package/external/blessed/lib/widgets/textbox.js +34 -36
- package/external/blessed/lib/widgets/video.js +55 -59
- package/external/blessed/usr/fonts/ter-u14b.json +1 -1
- package/external/blessed/usr/fonts/ter-u14n.json +1 -1
- package/external/blessed/vendor/tng.js +1016 -1144
- package/external/blessed-contrib/lib/layout/grid.js +345 -377
- package/external/blessed-contrib/lib/widget/charts/bar.js +6612 -7139
- package/external/blessed-contrib/lib/widget/charts/line.js +16224 -23941
- package/external/blessed-contrib/lib/widget/table.js +78 -96
- package/package.json +8 -8
- package/dist/types/commands/cdxgen/run-cdxgen.d.mts.map +0 -1
|
@@ -10,645 +10,592 @@
|
|
|
10
10
|
* Modules
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
var helpers = require('../helpers');
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
var Node = require('./node');
|
|
16
|
+
var Box = require('./box');
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
19
|
* List
|
|
20
20
|
*/
|
|
21
21
|
|
|
22
22
|
function List(options) {
|
|
23
|
-
|
|
23
|
+
var self = this;
|
|
24
24
|
|
|
25
25
|
if (!(this instanceof Node)) {
|
|
26
|
-
return new List(options)
|
|
26
|
+
return new List(options);
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
options = options || {}
|
|
29
|
+
options = options || {};
|
|
30
30
|
|
|
31
|
-
options.ignoreKeys = true
|
|
31
|
+
options.ignoreKeys = true;
|
|
32
32
|
// Possibly put this here: this.items = [];
|
|
33
|
-
options.scrollable = true
|
|
34
|
-
Box.call(this, options)
|
|
33
|
+
options.scrollable = true;
|
|
34
|
+
Box.call(this, options);
|
|
35
35
|
|
|
36
|
-
this.value = ''
|
|
37
|
-
this.items = []
|
|
38
|
-
this.ritems = []
|
|
39
|
-
this.selected = 0
|
|
40
|
-
this._isList = true
|
|
36
|
+
this.value = '';
|
|
37
|
+
this.items = [];
|
|
38
|
+
this.ritems = [];
|
|
39
|
+
this.selected = 0;
|
|
40
|
+
this._isList = true;
|
|
41
41
|
|
|
42
42
|
if (!this.style.selected) {
|
|
43
|
-
this.style.selected = {}
|
|
44
|
-
this.style.selected.bg = options.selectedBg
|
|
45
|
-
this.style.selected.fg = options.selectedFg
|
|
46
|
-
this.style.selected.bold = options.selectedBold
|
|
47
|
-
this.style.selected.underline = options.selectedUnderline
|
|
48
|
-
this.style.selected.blink = options.selectedBlink
|
|
49
|
-
this.style.selected.inverse = options.selectedInverse
|
|
50
|
-
this.style.selected.invisible = options.selectedInvisible
|
|
43
|
+
this.style.selected = {};
|
|
44
|
+
this.style.selected.bg = options.selectedBg;
|
|
45
|
+
this.style.selected.fg = options.selectedFg;
|
|
46
|
+
this.style.selected.bold = options.selectedBold;
|
|
47
|
+
this.style.selected.underline = options.selectedUnderline;
|
|
48
|
+
this.style.selected.blink = options.selectedBlink;
|
|
49
|
+
this.style.selected.inverse = options.selectedInverse;
|
|
50
|
+
this.style.selected.invisible = options.selectedInvisible;
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
if (!this.style.item) {
|
|
54
|
-
this.style.item = {}
|
|
55
|
-
this.style.item.bg = options.itemBg
|
|
56
|
-
this.style.item.fg = options.itemFg
|
|
57
|
-
this.style.item.bold = options.itemBold
|
|
58
|
-
this.style.item.underline = options.itemUnderline
|
|
59
|
-
this.style.item.blink = options.itemBlink
|
|
60
|
-
this.style.item.inverse = options.itemInverse
|
|
61
|
-
this.style.item.invisible = options.itemInvisible
|
|
54
|
+
this.style.item = {};
|
|
55
|
+
this.style.item.bg = options.itemBg;
|
|
56
|
+
this.style.item.fg = options.itemFg;
|
|
57
|
+
this.style.item.bold = options.itemBold;
|
|
58
|
+
this.style.item.underline = options.itemUnderline;
|
|
59
|
+
this.style.item.blink = options.itemBlink;
|
|
60
|
+
this.style.item.inverse = options.itemInverse;
|
|
61
|
+
this.style.item.invisible = options.itemInvisible;
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
// Legacy: for apps written before the addition of item attributes.
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
}
|
|
65
|
+
['bg', 'fg', 'bold', 'underline',
|
|
66
|
+
'blink', 'inverse', 'invisible'].forEach(function(name) {
|
|
67
|
+
if (self.style[name] != null && self.style.item[name] == null) {
|
|
68
|
+
self.style.item[name] = self.style[name];
|
|
70
69
|
}
|
|
71
|
-
)
|
|
70
|
+
});
|
|
72
71
|
|
|
73
72
|
if (this.options.itemHoverBg) {
|
|
74
|
-
this.options.itemHoverEffects = { bg: this.options.itemHoverBg }
|
|
73
|
+
this.options.itemHoverEffects = { bg: this.options.itemHoverBg };
|
|
75
74
|
}
|
|
76
75
|
|
|
77
76
|
if (this.options.itemHoverEffects) {
|
|
78
|
-
this.style.item.hover = this.options.itemHoverEffects
|
|
77
|
+
this.style.item.hover = this.options.itemHoverEffects;
|
|
79
78
|
}
|
|
80
79
|
|
|
81
80
|
if (this.options.itemFocusEffects) {
|
|
82
|
-
this.style.item.focus = this.options.itemFocusEffects
|
|
81
|
+
this.style.item.focus = this.options.itemFocusEffects;
|
|
83
82
|
}
|
|
84
83
|
|
|
85
|
-
this.interactive = options.interactive !== false
|
|
84
|
+
this.interactive = options.interactive !== false;
|
|
86
85
|
|
|
87
|
-
this.mouse = options.mouse || false
|
|
86
|
+
this.mouse = options.mouse || false;
|
|
88
87
|
|
|
89
88
|
if (options.items) {
|
|
90
|
-
this.ritems = options.items
|
|
91
|
-
options.items.forEach(this.add.bind(this))
|
|
89
|
+
this.ritems = options.items;
|
|
90
|
+
options.items.forEach(this.add.bind(this));
|
|
92
91
|
}
|
|
93
92
|
|
|
94
|
-
this.select(0)
|
|
93
|
+
this.select(0);
|
|
95
94
|
|
|
96
95
|
if (options.mouse) {
|
|
97
|
-
this.screen._listenMouse(this)
|
|
98
|
-
this.on('element wheeldown', function
|
|
99
|
-
self.select(self.selected + 2)
|
|
100
|
-
self.screen.render()
|
|
101
|
-
})
|
|
102
|
-
this.on('element wheelup', function
|
|
103
|
-
self.select(self.selected - 2)
|
|
104
|
-
self.screen.render()
|
|
105
|
-
})
|
|
96
|
+
this.screen._listenMouse(this);
|
|
97
|
+
this.on('element wheeldown', function() {
|
|
98
|
+
self.select(self.selected + 2);
|
|
99
|
+
self.screen.render();
|
|
100
|
+
});
|
|
101
|
+
this.on('element wheelup', function() {
|
|
102
|
+
self.select(self.selected - 2);
|
|
103
|
+
self.screen.render();
|
|
104
|
+
});
|
|
106
105
|
}
|
|
107
106
|
|
|
108
107
|
if (options.keys) {
|
|
109
|
-
this.on('keypress', function
|
|
108
|
+
this.on('keypress', function(ch, key) {
|
|
110
109
|
if (key.name === 'up' || (options.vi && key.name === 'k')) {
|
|
111
|
-
self.up()
|
|
112
|
-
self.screen.render()
|
|
113
|
-
return
|
|
110
|
+
self.up();
|
|
111
|
+
self.screen.render();
|
|
112
|
+
return;
|
|
114
113
|
}
|
|
115
114
|
if (key.name === 'down' || (options.vi && key.name === 'j')) {
|
|
116
|
-
self.down()
|
|
117
|
-
self.screen.render()
|
|
118
|
-
return
|
|
115
|
+
self.down();
|
|
116
|
+
self.screen.render();
|
|
117
|
+
return;
|
|
119
118
|
}
|
|
120
|
-
if (
|
|
121
|
-
|
|
122
|
-
(
|
|
123
|
-
|
|
124
|
-
self.enterSelected()
|
|
125
|
-
return
|
|
119
|
+
if (key.name === 'enter'
|
|
120
|
+
|| (options.vi && key.name === 'l' && !key.shift)) {
|
|
121
|
+
self.enterSelected();
|
|
122
|
+
return;
|
|
126
123
|
}
|
|
127
124
|
if (key.name === 'escape' || (options.vi && key.name === 'q')) {
|
|
128
|
-
self.cancelSelected()
|
|
129
|
-
return
|
|
125
|
+
self.cancelSelected();
|
|
126
|
+
return;
|
|
130
127
|
}
|
|
131
128
|
if (options.vi && key.name === 'u' && key.ctrl) {
|
|
132
|
-
self.move(-((self.height - self.iheight) / 2) | 0)
|
|
133
|
-
self.screen.render()
|
|
134
|
-
return
|
|
129
|
+
self.move(-((self.height - self.iheight) / 2) | 0);
|
|
130
|
+
self.screen.render();
|
|
131
|
+
return;
|
|
135
132
|
}
|
|
136
133
|
if (options.vi && key.name === 'd' && key.ctrl) {
|
|
137
|
-
self.move((
|
|
138
|
-
self.screen.render()
|
|
139
|
-
return
|
|
134
|
+
self.move((self.height - self.iheight) / 2 | 0);
|
|
135
|
+
self.screen.render();
|
|
136
|
+
return;
|
|
140
137
|
}
|
|
141
138
|
if (options.vi && key.name === 'b' && key.ctrl) {
|
|
142
|
-
self.move(-(self.height - self.iheight))
|
|
143
|
-
self.screen.render()
|
|
144
|
-
return
|
|
139
|
+
self.move(-(self.height - self.iheight));
|
|
140
|
+
self.screen.render();
|
|
141
|
+
return;
|
|
145
142
|
}
|
|
146
143
|
if (options.vi && key.name === 'f' && key.ctrl) {
|
|
147
|
-
self.move(self.height - self.iheight)
|
|
148
|
-
self.screen.render()
|
|
149
|
-
return
|
|
144
|
+
self.move(self.height - self.iheight);
|
|
145
|
+
self.screen.render();
|
|
146
|
+
return;
|
|
150
147
|
}
|
|
151
148
|
if (options.vi && key.name === 'h' && key.shift) {
|
|
152
|
-
self.move(self.childBase - self.selected)
|
|
153
|
-
self.screen.render()
|
|
154
|
-
return
|
|
149
|
+
self.move(self.childBase - self.selected);
|
|
150
|
+
self.screen.render();
|
|
151
|
+
return;
|
|
155
152
|
}
|
|
156
153
|
if (options.vi && key.name === 'm' && key.shift) {
|
|
157
154
|
// TODO: Maybe use Math.min(this.items.length,
|
|
158
155
|
// ... for calculating visible items elsewhere.
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
self.
|
|
163
|
-
|
|
156
|
+
var visible = Math.min(
|
|
157
|
+
self.height - self.iheight,
|
|
158
|
+
self.items.length) / 2 | 0;
|
|
159
|
+
self.move(self.childBase + visible - self.selected);
|
|
160
|
+
self.screen.render();
|
|
161
|
+
return;
|
|
164
162
|
}
|
|
165
163
|
if (options.vi && key.name === 'l' && key.shift) {
|
|
166
164
|
// XXX This goes one too far on lists with an odd number of items.
|
|
167
|
-
self.down(
|
|
168
|
-
self.
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
self.screen.render()
|
|
173
|
-
return
|
|
165
|
+
self.down(self.childBase
|
|
166
|
+
+ Math.min(self.height - self.iheight, self.items.length)
|
|
167
|
+
- self.selected);
|
|
168
|
+
self.screen.render();
|
|
169
|
+
return;
|
|
174
170
|
}
|
|
175
171
|
if (options.vi && key.name === 'g' && !key.shift) {
|
|
176
|
-
self.select(0)
|
|
177
|
-
self.screen.render()
|
|
178
|
-
return
|
|
172
|
+
self.select(0);
|
|
173
|
+
self.screen.render();
|
|
174
|
+
return;
|
|
179
175
|
}
|
|
180
176
|
if (options.vi && key.name === 'g' && key.shift) {
|
|
181
|
-
self.select(self.items.length - 1)
|
|
182
|
-
self.screen.render()
|
|
183
|
-
return
|
|
177
|
+
self.select(self.items.length - 1);
|
|
178
|
+
self.screen.render();
|
|
179
|
+
return;
|
|
184
180
|
}
|
|
185
181
|
|
|
186
182
|
if (options.vi && (key.ch === '/' || key.ch === '?')) {
|
|
187
183
|
if (typeof self.options.search !== 'function') {
|
|
188
|
-
return
|
|
184
|
+
return;
|
|
189
185
|
}
|
|
190
|
-
return self.options.search(function
|
|
191
|
-
if (
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
(err && err.test)
|
|
196
|
-
) {
|
|
197
|
-
value = err
|
|
198
|
-
err = null
|
|
199
|
-
}
|
|
200
|
-
if (err || !value) {
|
|
201
|
-
return self.screen.render()
|
|
186
|
+
return self.options.search(function(err, value) {
|
|
187
|
+
if (typeof err === 'string' || typeof err === 'function'
|
|
188
|
+
|| typeof err === 'number' || (err && err.test)) {
|
|
189
|
+
value = err;
|
|
190
|
+
err = null;
|
|
202
191
|
}
|
|
203
|
-
|
|
204
|
-
self.
|
|
205
|
-
|
|
192
|
+
if (err || !value) return self.screen.render();
|
|
193
|
+
self.select(self.fuzzyFind(value, key.ch === '?'));
|
|
194
|
+
self.screen.render();
|
|
195
|
+
});
|
|
206
196
|
}
|
|
207
|
-
})
|
|
197
|
+
});
|
|
208
198
|
}
|
|
209
199
|
|
|
210
|
-
this.on('resize', function
|
|
211
|
-
|
|
200
|
+
this.on('resize', function() {
|
|
201
|
+
var visible = self.height - self.iheight;
|
|
212
202
|
// if (self.selected < visible - 1) {
|
|
213
203
|
if (visible >= self.selected + 1) {
|
|
214
|
-
self.childBase = 0
|
|
215
|
-
self.childOffset = self.selected
|
|
204
|
+
self.childBase = 0;
|
|
205
|
+
self.childOffset = self.selected;
|
|
216
206
|
} else {
|
|
217
207
|
// Is this supposed to be: self.childBase = visible - self.selected + 1; ?
|
|
218
|
-
self.childBase = self.selected - visible + 1
|
|
219
|
-
self.childOffset = visible - 1
|
|
208
|
+
self.childBase = self.selected - visible + 1;
|
|
209
|
+
self.childOffset = visible - 1;
|
|
220
210
|
}
|
|
221
|
-
})
|
|
211
|
+
});
|
|
222
212
|
|
|
223
|
-
this.on('adopt', function
|
|
213
|
+
this.on('adopt', function(el) {
|
|
224
214
|
if (!~self.items.indexOf(el)) {
|
|
225
|
-
el.fixed = true
|
|
215
|
+
el.fixed = true;
|
|
226
216
|
}
|
|
227
|
-
})
|
|
217
|
+
});
|
|
228
218
|
|
|
229
219
|
// Ensure children are removed from the
|
|
230
220
|
// item list if they are items.
|
|
231
|
-
this.on('remove', function
|
|
232
|
-
self.removeItem(el)
|
|
233
|
-
})
|
|
221
|
+
this.on('remove', function(el) {
|
|
222
|
+
self.removeItem(el);
|
|
223
|
+
});
|
|
234
224
|
}
|
|
235
225
|
|
|
236
|
-
Object.setPrototypeOf(List.prototype, Box.prototype)
|
|
226
|
+
Object.setPrototypeOf(List.prototype, Box.prototype);
|
|
237
227
|
|
|
238
|
-
List.prototype.type = 'list'
|
|
228
|
+
List.prototype.type = 'list';
|
|
239
229
|
|
|
240
|
-
List.prototype.createItem = function
|
|
241
|
-
|
|
230
|
+
List.prototype.createItem = function(content) {
|
|
231
|
+
var self = this;
|
|
242
232
|
|
|
243
233
|
// Note: Could potentially use Button here.
|
|
244
|
-
|
|
234
|
+
var options = {
|
|
245
235
|
screen: this.screen,
|
|
246
236
|
content: content,
|
|
247
237
|
align: this.align || 'left',
|
|
248
238
|
top: 0,
|
|
249
239
|
left: 0,
|
|
250
|
-
right: this.scrollbar ? 1 : 0,
|
|
240
|
+
right: (this.scrollbar ? 1 : 0),
|
|
251
241
|
tags: this.parseTags,
|
|
252
242
|
height: 1,
|
|
253
243
|
hoverEffects: this.mouse ? this.style.item.hover : null,
|
|
254
244
|
focusEffects: this.mouse ? this.style.item.focus : null,
|
|
255
245
|
autoFocus: false
|
|
256
|
-
}
|
|
246
|
+
};
|
|
257
247
|
|
|
258
248
|
if (!this.screen.autoPadding) {
|
|
259
|
-
options.top = 1
|
|
260
|
-
options.left = this.ileft
|
|
261
|
-
options.right = this.iright + (this.scrollbar ? 1 : 0)
|
|
249
|
+
options.top = 1;
|
|
250
|
+
options.left = this.ileft;
|
|
251
|
+
options.right = this.iright + (this.scrollbar ? 1 : 0);
|
|
262
252
|
}
|
|
263
253
|
|
|
264
254
|
// if (this.shrink) {
|
|
265
255
|
// XXX NOTE: Maybe just do this on all shrinkage once autoPadding is default?
|
|
266
256
|
if (this.shrink && this.options.normalShrink) {
|
|
267
|
-
delete options.right
|
|
268
|
-
options.width = 'shrink'
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
return attr
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
)
|
|
257
|
+
delete options.right;
|
|
258
|
+
options.width = 'shrink';
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
['bg', 'fg', 'bold', 'underline',
|
|
262
|
+
'blink', 'inverse', 'invisible'].forEach(function(name) {
|
|
263
|
+
options[name] = function() {
|
|
264
|
+
var attr = self.items[self.selected] === item && self.interactive
|
|
265
|
+
? self.style.selected[name]
|
|
266
|
+
: self.style.item[name];
|
|
267
|
+
if (typeof attr === 'function') attr = attr(item);
|
|
268
|
+
return attr;
|
|
269
|
+
};
|
|
270
|
+
});
|
|
285
271
|
|
|
286
272
|
if (this.style.transparent) {
|
|
287
|
-
options.transparent = true
|
|
273
|
+
options.transparent = true;
|
|
288
274
|
}
|
|
289
275
|
|
|
290
|
-
|
|
276
|
+
var item = new Box(options);
|
|
291
277
|
|
|
292
278
|
if (this.mouse) {
|
|
293
|
-
item.on('click', function
|
|
294
|
-
self.focus()
|
|
279
|
+
item.on('click', function() {
|
|
280
|
+
self.focus();
|
|
295
281
|
if (self.items[self.selected] === item) {
|
|
296
|
-
self.emit('action', item, self.selected)
|
|
297
|
-
self.emit('select', item, self.selected)
|
|
298
|
-
return
|
|
282
|
+
self.emit('action', item, self.selected);
|
|
283
|
+
self.emit('select', item, self.selected);
|
|
284
|
+
return;
|
|
299
285
|
}
|
|
300
|
-
self.select(item)
|
|
301
|
-
self.screen.render()
|
|
302
|
-
})
|
|
286
|
+
self.select(item);
|
|
287
|
+
self.screen.render();
|
|
288
|
+
});
|
|
303
289
|
}
|
|
304
290
|
|
|
305
|
-
this.emit('create item')
|
|
291
|
+
this.emit('create item');
|
|
306
292
|
|
|
307
|
-
return item
|
|
308
|
-
}
|
|
293
|
+
return item;
|
|
294
|
+
};
|
|
309
295
|
|
|
310
296
|
List.prototype.add =
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
content = typeof content === 'string' ? content : content.getContent()
|
|
315
|
-
|
|
316
|
-
const item = this.createItem(content)
|
|
317
|
-
item.position.top = this.items.length
|
|
318
|
-
if (!this.screen.autoPadding) {
|
|
319
|
-
item.position.top = this.itop + this.items.length
|
|
320
|
-
}
|
|
297
|
+
List.prototype.addItem =
|
|
298
|
+
List.prototype.appendItem = function(content) {
|
|
299
|
+
content = typeof content === 'string' ? content : content.getContent();
|
|
321
300
|
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
301
|
+
var item = this.createItem(content);
|
|
302
|
+
item.position.top = this.items.length;
|
|
303
|
+
if (!this.screen.autoPadding) {
|
|
304
|
+
item.position.top = this.itop + this.items.length;
|
|
305
|
+
}
|
|
325
306
|
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
307
|
+
this.ritems.push(content);
|
|
308
|
+
this.items.push(item);
|
|
309
|
+
this.append(item);
|
|
329
310
|
|
|
330
|
-
|
|
311
|
+
if (this.items.length === 1) {
|
|
312
|
+
this.select(0);
|
|
313
|
+
}
|
|
331
314
|
|
|
332
|
-
|
|
333
|
-
}
|
|
315
|
+
this.emit('add item');
|
|
334
316
|
|
|
335
|
-
|
|
336
|
-
|
|
317
|
+
return item;
|
|
318
|
+
};
|
|
319
|
+
|
|
320
|
+
List.prototype.removeItem = function(child) {
|
|
321
|
+
var i = this.getItemIndex(child);
|
|
337
322
|
if (~i && this.items[i]) {
|
|
338
|
-
child = this.items.splice(i, 1)[0]
|
|
339
|
-
this.ritems.splice(i, 1)
|
|
340
|
-
this.remove(child)
|
|
341
|
-
for (
|
|
342
|
-
this.items[j].position.top
|
|
323
|
+
child = this.items.splice(i, 1)[0];
|
|
324
|
+
this.ritems.splice(i, 1);
|
|
325
|
+
this.remove(child);
|
|
326
|
+
for (var j = i; j < this.items.length; j++) {
|
|
327
|
+
this.items[j].position.top--;
|
|
343
328
|
}
|
|
344
329
|
if (i === this.selected) {
|
|
345
|
-
this.select(i - 1)
|
|
330
|
+
this.select(i - 1);
|
|
346
331
|
}
|
|
347
332
|
}
|
|
348
|
-
this.emit('remove item')
|
|
349
|
-
return child
|
|
350
|
-
}
|
|
351
|
-
|
|
352
|
-
List.prototype.insertItem = function
|
|
353
|
-
content = typeof content === 'string' ? content : content.getContent()
|
|
354
|
-
|
|
355
|
-
if (!~i)
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
}
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
item.position.top = i + (!this.screen.autoPadding ? 1 : 0)
|
|
366
|
-
this.ritems.splice(i, 0, content)
|
|
367
|
-
this.items.splice(i, 0, item)
|
|
368
|
-
this.append(item)
|
|
333
|
+
this.emit('remove item');
|
|
334
|
+
return child;
|
|
335
|
+
};
|
|
336
|
+
|
|
337
|
+
List.prototype.insertItem = function(child, content) {
|
|
338
|
+
content = typeof content === 'string' ? content : content.getContent();
|
|
339
|
+
var i = this.getItemIndex(child);
|
|
340
|
+
if (!~i) return;
|
|
341
|
+
if (i >= this.items.length) return this.appendItem(content);
|
|
342
|
+
var item = this.createItem(content);
|
|
343
|
+
for (var j = i; j < this.items.length; j++) {
|
|
344
|
+
this.items[j].position.top++;
|
|
345
|
+
}
|
|
346
|
+
item.position.top = i + (!this.screen.autoPadding ? 1 : 0);
|
|
347
|
+
this.ritems.splice(i, 0, content);
|
|
348
|
+
this.items.splice(i, 0, item);
|
|
349
|
+
this.append(item);
|
|
369
350
|
if (i === this.selected) {
|
|
370
|
-
this.select(i + 1)
|
|
351
|
+
this.select(i + 1);
|
|
371
352
|
}
|
|
372
|
-
this.emit('insert item')
|
|
373
|
-
}
|
|
353
|
+
this.emit('insert item');
|
|
354
|
+
};
|
|
374
355
|
|
|
375
|
-
List.prototype.getItem = function
|
|
376
|
-
return this.items[this.getItemIndex(child)]
|
|
377
|
-
}
|
|
356
|
+
List.prototype.getItem = function(child) {
|
|
357
|
+
return this.items[this.getItemIndex(child)];
|
|
358
|
+
};
|
|
378
359
|
|
|
379
|
-
List.prototype.setItem = function
|
|
380
|
-
content = typeof content === 'string' ? content : content.getContent()
|
|
381
|
-
|
|
382
|
-
if (!~i)
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
this.ritems[i] = content
|
|
387
|
-
}
|
|
360
|
+
List.prototype.setItem = function(child, content) {
|
|
361
|
+
content = typeof content === 'string' ? content : content.getContent();
|
|
362
|
+
var i = this.getItemIndex(child);
|
|
363
|
+
if (!~i) return;
|
|
364
|
+
this.items[i].setContent(content);
|
|
365
|
+
this.ritems[i] = content;
|
|
366
|
+
};
|
|
388
367
|
|
|
389
|
-
List.prototype.clearItems = function
|
|
390
|
-
return this.setItems([])
|
|
391
|
-
}
|
|
368
|
+
List.prototype.clearItems = function() {
|
|
369
|
+
return this.setItems([]);
|
|
370
|
+
};
|
|
392
371
|
|
|
393
|
-
List.prototype.setItems = function
|
|
394
|
-
|
|
395
|
-
selected = this.selected
|
|
396
|
-
sel = this.ritems[this.selected]
|
|
397
|
-
i = 0
|
|
372
|
+
List.prototype.setItems = function(items) {
|
|
373
|
+
var original = this.items.slice()
|
|
374
|
+
, selected = this.selected
|
|
375
|
+
, sel = this.ritems[this.selected]
|
|
376
|
+
, i = 0;
|
|
398
377
|
|
|
399
|
-
items = items.slice()
|
|
378
|
+
items = items.slice();
|
|
400
379
|
|
|
401
|
-
this.select(0)
|
|
380
|
+
this.select(0);
|
|
402
381
|
|
|
403
382
|
for (; i < items.length; i++) {
|
|
404
383
|
if (this.items[i]) {
|
|
405
|
-
this.items[i].setContent(items[i])
|
|
384
|
+
this.items[i].setContent(items[i]);
|
|
406
385
|
} else {
|
|
407
|
-
this.add(items[i])
|
|
386
|
+
this.add(items[i]);
|
|
408
387
|
}
|
|
409
388
|
}
|
|
410
389
|
|
|
411
390
|
for (; i < original.length; i++) {
|
|
412
|
-
this.remove(original[i])
|
|
391
|
+
this.remove(original[i]);
|
|
413
392
|
}
|
|
414
393
|
|
|
415
|
-
this.ritems = items
|
|
394
|
+
this.ritems = items;
|
|
416
395
|
|
|
417
396
|
// Try to find our old item if it still exists.
|
|
418
|
-
sel = items.indexOf(sel)
|
|
397
|
+
sel = items.indexOf(sel);
|
|
419
398
|
if (~sel) {
|
|
420
|
-
this.select(sel)
|
|
399
|
+
this.select(sel);
|
|
421
400
|
} else if (items.length === original.length) {
|
|
422
|
-
this.select(selected)
|
|
401
|
+
this.select(selected);
|
|
423
402
|
} else {
|
|
424
|
-
this.select(Math.min(selected, items.length - 1))
|
|
403
|
+
this.select(Math.min(selected, items.length - 1));
|
|
425
404
|
}
|
|
426
405
|
|
|
427
|
-
this.emit('set items')
|
|
428
|
-
}
|
|
406
|
+
this.emit('set items');
|
|
407
|
+
};
|
|
429
408
|
|
|
430
|
-
List.prototype.pushItem = function
|
|
431
|
-
this.appendItem(content)
|
|
432
|
-
return this.items.length
|
|
433
|
-
}
|
|
409
|
+
List.prototype.pushItem = function(content) {
|
|
410
|
+
this.appendItem(content);
|
|
411
|
+
return this.items.length;
|
|
412
|
+
};
|
|
434
413
|
|
|
435
|
-
List.prototype.popItem = function
|
|
436
|
-
return this.removeItem(this.items.length - 1)
|
|
437
|
-
}
|
|
414
|
+
List.prototype.popItem = function() {
|
|
415
|
+
return this.removeItem(this.items.length - 1);
|
|
416
|
+
};
|
|
438
417
|
|
|
439
|
-
List.prototype.unshiftItem = function
|
|
440
|
-
this.insertItem(0, content)
|
|
441
|
-
return this.items.length
|
|
442
|
-
}
|
|
418
|
+
List.prototype.unshiftItem = function(content) {
|
|
419
|
+
this.insertItem(0, content);
|
|
420
|
+
return this.items.length;
|
|
421
|
+
};
|
|
443
422
|
|
|
444
|
-
List.prototype.shiftItem = function
|
|
445
|
-
return this.removeItem(0)
|
|
446
|
-
}
|
|
423
|
+
List.prototype.shiftItem = function() {
|
|
424
|
+
return this.removeItem(0);
|
|
425
|
+
};
|
|
447
426
|
|
|
448
|
-
List.prototype.spliceItem = function
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
if (!~i)
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
const items = Array.prototype.slice.call(arguments, 2)
|
|
455
|
-
const removed = []
|
|
427
|
+
List.prototype.spliceItem = function(child, n) {
|
|
428
|
+
var self = this;
|
|
429
|
+
var i = this.getItemIndex(child);
|
|
430
|
+
if (!~i) return;
|
|
431
|
+
var items = Array.prototype.slice.call(arguments, 2);
|
|
432
|
+
var removed = [];
|
|
456
433
|
while (n--) {
|
|
457
|
-
removed.push(this.removeItem(i))
|
|
434
|
+
removed.push(this.removeItem(i));
|
|
458
435
|
}
|
|
459
|
-
items.forEach(function
|
|
460
|
-
self.insertItem(i++, item)
|
|
461
|
-
})
|
|
462
|
-
return removed
|
|
463
|
-
}
|
|
436
|
+
items.forEach(function(item) {
|
|
437
|
+
self.insertItem(i++, item);
|
|
438
|
+
});
|
|
439
|
+
return removed;
|
|
440
|
+
};
|
|
464
441
|
|
|
465
|
-
List.prototype.find =
|
|
466
|
-
|
|
467
|
-
|
|
442
|
+
List.prototype.find =
|
|
443
|
+
List.prototype.fuzzyFind = function(search, back) {
|
|
444
|
+
var start = this.selected + (back ? -1 : 1)
|
|
445
|
+
, i;
|
|
468
446
|
|
|
469
|
-
if (typeof search === 'number')
|
|
470
|
-
search += ''
|
|
471
|
-
}
|
|
447
|
+
if (typeof search === 'number') search += '';
|
|
472
448
|
|
|
473
449
|
if (search && search[0] === '/' && search[search.length - 1] === '/') {
|
|
474
450
|
try {
|
|
475
|
-
search = new RegExp(search.slice(1, -1))
|
|
476
|
-
} catch (e) {
|
|
451
|
+
search = new RegExp(search.slice(1, -1));
|
|
452
|
+
} catch (e) {
|
|
453
|
+
;
|
|
454
|
+
}
|
|
477
455
|
}
|
|
478
456
|
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
return !!~item.indexOf(search)
|
|
483
|
-
}
|
|
484
|
-
: search.test
|
|
485
|
-
? search.test.bind(search)
|
|
486
|
-
: search
|
|
457
|
+
var test = typeof search === 'string'
|
|
458
|
+
? function(item) { return !!~item.indexOf(search); }
|
|
459
|
+
: (search.test ? search.test.bind(search) : search);
|
|
487
460
|
|
|
488
461
|
if (typeof test !== 'function') {
|
|
489
462
|
if (this.screen.options.debug) {
|
|
490
|
-
throw new Error('fuzzyFind(): `test` is not a function.')
|
|
463
|
+
throw new Error('fuzzyFind(): `test` is not a function.');
|
|
491
464
|
}
|
|
492
|
-
return this.selected
|
|
465
|
+
return this.selected;
|
|
493
466
|
}
|
|
494
467
|
|
|
495
468
|
if (!back) {
|
|
496
469
|
for (i = start; i < this.ritems.length; i++) {
|
|
497
|
-
if (test(helpers.cleanTags(this.ritems[i])))
|
|
498
|
-
return i
|
|
499
|
-
}
|
|
470
|
+
if (test(helpers.cleanTags(this.ritems[i]))) return i;
|
|
500
471
|
}
|
|
501
472
|
for (i = 0; i < start; i++) {
|
|
502
|
-
if (test(helpers.cleanTags(this.ritems[i])))
|
|
503
|
-
return i
|
|
504
|
-
}
|
|
473
|
+
if (test(helpers.cleanTags(this.ritems[i]))) return i;
|
|
505
474
|
}
|
|
506
475
|
} else {
|
|
507
476
|
for (i = start; i >= 0; i--) {
|
|
508
|
-
if (test(helpers.cleanTags(this.ritems[i])))
|
|
509
|
-
return i
|
|
510
|
-
}
|
|
477
|
+
if (test(helpers.cleanTags(this.ritems[i]))) return i;
|
|
511
478
|
}
|
|
512
479
|
for (i = this.ritems.length - 1; i > start; i--) {
|
|
513
|
-
if (test(helpers.cleanTags(this.ritems[i])))
|
|
514
|
-
return i
|
|
515
|
-
}
|
|
480
|
+
if (test(helpers.cleanTags(this.ritems[i]))) return i;
|
|
516
481
|
}
|
|
517
482
|
}
|
|
518
483
|
|
|
519
|
-
return this.selected
|
|
520
|
-
}
|
|
484
|
+
return this.selected;
|
|
485
|
+
};
|
|
521
486
|
|
|
522
|
-
List.prototype.getItemIndex = function
|
|
487
|
+
List.prototype.getItemIndex = function(child) {
|
|
523
488
|
if (typeof child === 'number') {
|
|
524
|
-
return child
|
|
489
|
+
return child;
|
|
525
490
|
} else if (typeof child === 'string') {
|
|
526
|
-
|
|
527
|
-
if (~i)
|
|
528
|
-
return i
|
|
529
|
-
}
|
|
491
|
+
var i = this.ritems.indexOf(child);
|
|
492
|
+
if (~i) return i;
|
|
530
493
|
for (i = 0; i < this.ritems.length; i++) {
|
|
531
494
|
if (helpers.cleanTags(this.ritems[i]) === child) {
|
|
532
|
-
return i
|
|
495
|
+
return i;
|
|
533
496
|
}
|
|
534
497
|
}
|
|
535
|
-
return -1
|
|
498
|
+
return -1;
|
|
536
499
|
} else {
|
|
537
|
-
return this.items.indexOf(child)
|
|
500
|
+
return this.items.indexOf(child);
|
|
538
501
|
}
|
|
539
|
-
}
|
|
502
|
+
};
|
|
540
503
|
|
|
541
|
-
List.prototype.select = function
|
|
504
|
+
List.prototype.select = function(index) {
|
|
542
505
|
if (!this.interactive) {
|
|
543
|
-
return
|
|
506
|
+
return;
|
|
544
507
|
}
|
|
545
508
|
|
|
546
509
|
if (!this.items.length) {
|
|
547
|
-
this.selected = 0
|
|
548
|
-
this.value = ''
|
|
549
|
-
this.scrollTo(0)
|
|
550
|
-
return
|
|
510
|
+
this.selected = 0;
|
|
511
|
+
this.value = '';
|
|
512
|
+
this.scrollTo(0);
|
|
513
|
+
return;
|
|
551
514
|
}
|
|
552
515
|
|
|
553
516
|
if (typeof index === 'object') {
|
|
554
|
-
index = this.items.indexOf(index)
|
|
517
|
+
index = this.items.indexOf(index);
|
|
555
518
|
}
|
|
556
519
|
|
|
557
520
|
if (index < 0) {
|
|
558
|
-
index = 0
|
|
521
|
+
index = 0;
|
|
559
522
|
} else if (index >= this.items.length) {
|
|
560
|
-
index = this.items.length - 1
|
|
523
|
+
index = this.items.length - 1;
|
|
561
524
|
}
|
|
562
525
|
|
|
563
|
-
if (this.selected === index && this._listInitialized)
|
|
564
|
-
|
|
565
|
-
}
|
|
566
|
-
this._listInitialized = true
|
|
526
|
+
if (this.selected === index && this._listInitialized) return;
|
|
527
|
+
this._listInitialized = true;
|
|
567
528
|
|
|
568
|
-
this.selected = index
|
|
569
|
-
this.value = helpers.cleanTags(this.ritems[this.selected])
|
|
570
|
-
if (!this.parent)
|
|
571
|
-
|
|
572
|
-
}
|
|
573
|
-
this.scrollTo(this.selected)
|
|
529
|
+
this.selected = index;
|
|
530
|
+
this.value = helpers.cleanTags(this.ritems[this.selected]);
|
|
531
|
+
if (!this.parent) return;
|
|
532
|
+
this.scrollTo(this.selected);
|
|
574
533
|
|
|
575
534
|
// XXX Move `action` and `select` events here.
|
|
576
|
-
this.emit('select item', this.items[this.selected], this.selected)
|
|
577
|
-
}
|
|
535
|
+
this.emit('select item', this.items[this.selected], this.selected);
|
|
536
|
+
};
|
|
578
537
|
|
|
579
|
-
List.prototype.move = function
|
|
580
|
-
this.select(this.selected + offset)
|
|
581
|
-
}
|
|
538
|
+
List.prototype.move = function(offset) {
|
|
539
|
+
this.select(this.selected + offset);
|
|
540
|
+
};
|
|
582
541
|
|
|
583
|
-
List.prototype.up = function
|
|
584
|
-
this.move(-(offset || 1))
|
|
585
|
-
}
|
|
542
|
+
List.prototype.up = function(offset) {
|
|
543
|
+
this.move(-(offset || 1));
|
|
544
|
+
};
|
|
586
545
|
|
|
587
|
-
List.prototype.down = function
|
|
588
|
-
this.move(offset || 1)
|
|
589
|
-
}
|
|
546
|
+
List.prototype.down = function(offset) {
|
|
547
|
+
this.move(offset || 1);
|
|
548
|
+
};
|
|
590
549
|
|
|
591
|
-
List.prototype.pick = function
|
|
550
|
+
List.prototype.pick = function(label, callback) {
|
|
592
551
|
if (!callback) {
|
|
593
|
-
callback = label
|
|
594
|
-
label = null
|
|
552
|
+
callback = label;
|
|
553
|
+
label = null;
|
|
595
554
|
}
|
|
596
555
|
|
|
597
556
|
if (!this.interactive) {
|
|
598
|
-
return callback()
|
|
557
|
+
return callback();
|
|
599
558
|
}
|
|
600
559
|
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
if (focused && focused._done)
|
|
604
|
-
|
|
605
|
-
}
|
|
606
|
-
this.screen.saveFocus()
|
|
560
|
+
var self = this;
|
|
561
|
+
var focused = this.screen.focused;
|
|
562
|
+
if (focused && focused._done) focused._done('stop');
|
|
563
|
+
this.screen.saveFocus();
|
|
607
564
|
|
|
608
565
|
// XXX Keep above:
|
|
609
566
|
// var parent = this.parent;
|
|
610
567
|
// this.detach();
|
|
611
568
|
// parent.append(this);
|
|
612
569
|
|
|
613
|
-
this.focus()
|
|
614
|
-
this.show()
|
|
615
|
-
this.select(0)
|
|
616
|
-
if (label)
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
self.
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
}
|
|
633
|
-
|
|
634
|
-
List.prototype.
|
|
635
|
-
if (i != null)
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
this.emit('select', this.items[this.selected], this.selected)
|
|
640
|
-
}
|
|
641
|
-
|
|
642
|
-
List.prototype.cancelSelected = function (i) {
|
|
643
|
-
if (i != null) {
|
|
644
|
-
this.select(i)
|
|
645
|
-
}
|
|
646
|
-
this.emit('action')
|
|
647
|
-
this.emit('cancel')
|
|
648
|
-
}
|
|
570
|
+
this.focus();
|
|
571
|
+
this.show();
|
|
572
|
+
this.select(0);
|
|
573
|
+
if (label) this.setLabel(label);
|
|
574
|
+
this.screen.render();
|
|
575
|
+
this.once('action', function(el, selected) {
|
|
576
|
+
if (label) self.removeLabel();
|
|
577
|
+
self.screen.restoreFocus();
|
|
578
|
+
self.hide();
|
|
579
|
+
self.screen.render();
|
|
580
|
+
if (!el) return callback();
|
|
581
|
+
return callback(null, helpers.cleanTags(self.ritems[selected]));
|
|
582
|
+
});
|
|
583
|
+
};
|
|
584
|
+
|
|
585
|
+
List.prototype.enterSelected = function(i) {
|
|
586
|
+
if (i != null) this.select(i);
|
|
587
|
+
this.emit('action', this.items[this.selected], this.selected);
|
|
588
|
+
this.emit('select', this.items[this.selected], this.selected);
|
|
589
|
+
};
|
|
590
|
+
|
|
591
|
+
List.prototype.cancelSelected = function(i) {
|
|
592
|
+
if (i != null) this.select(i);
|
|
593
|
+
this.emit('action');
|
|
594
|
+
this.emit('cancel');
|
|
595
|
+
};
|
|
649
596
|
|
|
650
597
|
/**
|
|
651
598
|
* Expose
|
|
652
599
|
*/
|
|
653
600
|
|
|
654
|
-
module.exports = List
|
|
601
|
+
module.exports = List;
|