@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,159 +10,150 @@
|
|
|
10
10
|
* Modules
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
var Node = require('./node');
|
|
14
|
+
var Input = require('./input');
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
17
|
* ProgressBar
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
20
|
function ProgressBar(options) {
|
|
21
|
-
|
|
21
|
+
var self = this;
|
|
22
22
|
|
|
23
23
|
if (!(this instanceof Node)) {
|
|
24
|
-
return new ProgressBar(options)
|
|
24
|
+
return new ProgressBar(options);
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
options = options || {}
|
|
27
|
+
options = options || {};
|
|
28
28
|
|
|
29
|
-
Input.call(this, options)
|
|
29
|
+
Input.call(this, options);
|
|
30
30
|
|
|
31
|
-
this.filled = options.filled || 0
|
|
31
|
+
this.filled = options.filled || 0;
|
|
32
32
|
if (typeof this.filled === 'string') {
|
|
33
|
-
this.filled = +this.filled.slice(0, -1)
|
|
33
|
+
this.filled = +this.filled.slice(0, -1);
|
|
34
34
|
}
|
|
35
|
-
this.value = this.filled
|
|
35
|
+
this.value = this.filled;
|
|
36
36
|
|
|
37
|
-
this.pch = options.pch || ' '
|
|
37
|
+
this.pch = options.pch || ' ';
|
|
38
38
|
|
|
39
39
|
// XXX Workaround that predates the usage of `el.ch`.
|
|
40
40
|
if (options.ch) {
|
|
41
|
-
this.pch = options.ch
|
|
42
|
-
this.ch = ' '
|
|
41
|
+
this.pch = options.ch;
|
|
42
|
+
this.ch = ' ';
|
|
43
43
|
}
|
|
44
44
|
if (options.bch) {
|
|
45
|
-
this.ch = options.bch
|
|
45
|
+
this.ch = options.bch;
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
if (!this.style.bar) {
|
|
49
|
-
this.style.bar = {}
|
|
50
|
-
this.style.bar.fg = options.barFg
|
|
51
|
-
this.style.bar.bg = options.barBg
|
|
49
|
+
this.style.bar = {};
|
|
50
|
+
this.style.bar.fg = options.barFg;
|
|
51
|
+
this.style.bar.bg = options.barBg;
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
this.orientation = options.orientation || 'horizontal'
|
|
54
|
+
this.orientation = options.orientation || 'horizontal';
|
|
55
55
|
|
|
56
56
|
if (options.keys) {
|
|
57
|
-
this.on('keypress', function
|
|
58
|
-
|
|
57
|
+
this.on('keypress', function(ch, key) {
|
|
58
|
+
var back, forward;
|
|
59
59
|
if (self.orientation === 'horizontal') {
|
|
60
|
-
back = ['left', 'h']
|
|
61
|
-
forward = ['right', 'l']
|
|
60
|
+
back = ['left', 'h'];
|
|
61
|
+
forward = ['right', 'l'];
|
|
62
62
|
} else if (self.orientation === 'vertical') {
|
|
63
|
-
back = ['down', 'j']
|
|
64
|
-
forward = ['up', 'k']
|
|
63
|
+
back = ['down', 'j'];
|
|
64
|
+
forward = ['up', 'k'];
|
|
65
65
|
}
|
|
66
66
|
if (key.name === back[0] || (options.vi && key.name === back[1])) {
|
|
67
|
-
self.progress(-5)
|
|
68
|
-
self.screen.render()
|
|
69
|
-
return
|
|
67
|
+
self.progress(-5);
|
|
68
|
+
self.screen.render();
|
|
69
|
+
return;
|
|
70
70
|
}
|
|
71
71
|
if (key.name === forward[0] || (options.vi && key.name === forward[1])) {
|
|
72
|
-
self.progress(5)
|
|
73
|
-
self.screen.render()
|
|
74
|
-
return
|
|
72
|
+
self.progress(5);
|
|
73
|
+
self.screen.render();
|
|
74
|
+
return;
|
|
75
75
|
}
|
|
76
|
-
})
|
|
76
|
+
});
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
if (options.mouse) {
|
|
80
|
-
this.on('click', function
|
|
81
|
-
|
|
82
|
-
if (!self.lpos)
|
|
83
|
-
return
|
|
84
|
-
}
|
|
80
|
+
this.on('click', function(data) {
|
|
81
|
+
var x, y, m, p;
|
|
82
|
+
if (!self.lpos) return;
|
|
85
83
|
if (self.orientation === 'horizontal') {
|
|
86
|
-
x = data.x - self.lpos.xi
|
|
87
|
-
m = self.lpos.xl - self.lpos.xi - self.iwidth
|
|
88
|
-
p =
|
|
84
|
+
x = data.x - self.lpos.xi;
|
|
85
|
+
m = (self.lpos.xl - self.lpos.xi) - self.iwidth;
|
|
86
|
+
p = x / m * 100 | 0;
|
|
89
87
|
} else if (self.orientation === 'vertical') {
|
|
90
|
-
y = data.y - self.lpos.yi
|
|
91
|
-
m = self.lpos.yl - self.lpos.yi - self.iheight
|
|
92
|
-
p =
|
|
88
|
+
y = data.y - self.lpos.yi;
|
|
89
|
+
m = (self.lpos.yl - self.lpos.yi) - self.iheight;
|
|
90
|
+
p = y / m * 100 | 0;
|
|
93
91
|
}
|
|
94
|
-
self.setProgress(p)
|
|
95
|
-
})
|
|
92
|
+
self.setProgress(p);
|
|
93
|
+
});
|
|
96
94
|
}
|
|
97
95
|
}
|
|
98
96
|
|
|
99
|
-
Object.setPrototypeOf(ProgressBar.prototype, Input.prototype)
|
|
97
|
+
Object.setPrototypeOf(ProgressBar.prototype, Input.prototype);
|
|
100
98
|
|
|
101
|
-
ProgressBar.prototype.type = 'progress-bar'
|
|
99
|
+
ProgressBar.prototype.type = 'progress-bar';
|
|
102
100
|
|
|
103
|
-
ProgressBar.prototype.render = function
|
|
104
|
-
|
|
105
|
-
if (!ret)
|
|
106
|
-
return
|
|
107
|
-
}
|
|
101
|
+
ProgressBar.prototype.render = function() {
|
|
102
|
+
var ret = this._render();
|
|
103
|
+
if (!ret) return;
|
|
108
104
|
|
|
109
|
-
|
|
110
|
-
xl = ret.xl
|
|
111
|
-
yi = ret.yi
|
|
112
|
-
yl = ret.yl
|
|
113
|
-
dattr
|
|
105
|
+
var xi = ret.xi
|
|
106
|
+
, xl = ret.xl
|
|
107
|
+
, yi = ret.yi
|
|
108
|
+
, yl = ret.yl
|
|
109
|
+
, dattr;
|
|
114
110
|
|
|
115
|
-
if (this.border)
|
|
116
|
-
xi++, yi++, xl--, yl--
|
|
117
|
-
}
|
|
111
|
+
if (this.border) xi++, yi++, xl--, yl--;
|
|
118
112
|
|
|
119
113
|
if (this.orientation === 'horizontal') {
|
|
120
|
-
xl =
|
|
114
|
+
xl = xi + ((xl - xi) * (this.filled / 100)) | 0;
|
|
121
115
|
} else if (this.orientation === 'vertical') {
|
|
122
|
-
yi = yi + (yl - yi - (((yl - yi) * (this.filled / 100)) | 0))
|
|
116
|
+
yi = yi + ((yl - yi) - (((yl - yi) * (this.filled / 100)) | 0));
|
|
123
117
|
}
|
|
124
118
|
|
|
125
|
-
dattr = this.sattr(this.style.bar)
|
|
119
|
+
dattr = this.sattr(this.style.bar);
|
|
126
120
|
|
|
127
|
-
this.screen.fillRegion(dattr, this.pch, xi, xl, yi, yl)
|
|
121
|
+
this.screen.fillRegion(dattr, this.pch, xi, xl, yi, yl);
|
|
128
122
|
|
|
129
123
|
if (this.content) {
|
|
130
|
-
|
|
131
|
-
for (
|
|
132
|
-
line[xi + i][1] = this.content[i]
|
|
124
|
+
var line = this.screen.lines[yi];
|
|
125
|
+
for (var i = 0; i < this.content.length; i++) {
|
|
126
|
+
line[xi + i][1] = this.content[i];
|
|
133
127
|
}
|
|
134
|
-
line.dirty = true
|
|
128
|
+
line.dirty = true;
|
|
135
129
|
}
|
|
136
130
|
|
|
137
|
-
return ret
|
|
138
|
-
}
|
|
131
|
+
return ret;
|
|
132
|
+
};
|
|
139
133
|
|
|
140
|
-
ProgressBar.prototype.progress = function
|
|
141
|
-
this.filled += filled
|
|
142
|
-
if (this.filled < 0)
|
|
143
|
-
|
|
144
|
-
} else if (this.filled > 100) {
|
|
145
|
-
this.filled = 100
|
|
146
|
-
}
|
|
134
|
+
ProgressBar.prototype.progress = function(filled) {
|
|
135
|
+
this.filled += filled;
|
|
136
|
+
if (this.filled < 0) this.filled = 0;
|
|
137
|
+
else if (this.filled > 100) this.filled = 100;
|
|
147
138
|
if (this.filled === 100) {
|
|
148
|
-
this.emit('complete')
|
|
139
|
+
this.emit('complete');
|
|
149
140
|
}
|
|
150
|
-
this.value = this.filled
|
|
151
|
-
}
|
|
141
|
+
this.value = this.filled;
|
|
142
|
+
};
|
|
152
143
|
|
|
153
|
-
ProgressBar.prototype.setProgress = function
|
|
154
|
-
this.filled = 0
|
|
155
|
-
this.progress(filled)
|
|
156
|
-
}
|
|
144
|
+
ProgressBar.prototype.setProgress = function(filled) {
|
|
145
|
+
this.filled = 0;
|
|
146
|
+
this.progress(filled);
|
|
147
|
+
};
|
|
157
148
|
|
|
158
|
-
ProgressBar.prototype.reset = function
|
|
159
|
-
this.emit('reset')
|
|
160
|
-
this.filled = 0
|
|
161
|
-
this.value = this.filled
|
|
162
|
-
}
|
|
149
|
+
ProgressBar.prototype.reset = function() {
|
|
150
|
+
this.emit('reset');
|
|
151
|
+
this.filled = 0;
|
|
152
|
+
this.value = this.filled;
|
|
153
|
+
};
|
|
163
154
|
|
|
164
155
|
/**
|
|
165
156
|
* Expose
|
|
166
157
|
*/
|
|
167
158
|
|
|
168
|
-
module.exports = ProgressBar
|
|
159
|
+
module.exports = ProgressBar;
|
|
@@ -10,10 +10,10 @@
|
|
|
10
10
|
* Modules
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
var Node = require('./node');
|
|
14
|
+
var Box = require('./box');
|
|
15
|
+
var Button = require('./button');
|
|
16
|
+
var Textbox = require('./textbox');
|
|
17
17
|
|
|
18
18
|
/**
|
|
19
19
|
* Prompt
|
|
@@ -21,14 +21,14 @@ const Textbox = require('./textbox')
|
|
|
21
21
|
|
|
22
22
|
function Prompt(options) {
|
|
23
23
|
if (!(this instanceof Node)) {
|
|
24
|
-
return new Prompt(options)
|
|
24
|
+
return new Prompt(options);
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
options = options || {}
|
|
27
|
+
options = options || {};
|
|
28
28
|
|
|
29
|
-
options.hidden = true
|
|
29
|
+
options.hidden = true;
|
|
30
30
|
|
|
31
|
-
Box.call(this, options)
|
|
31
|
+
Box.call(this, options);
|
|
32
32
|
|
|
33
33
|
this._.input = new Textbox({
|
|
34
34
|
parent: this,
|
|
@@ -37,7 +37,7 @@ function Prompt(options) {
|
|
|
37
37
|
left: 2,
|
|
38
38
|
right: 2,
|
|
39
39
|
bg: 'black'
|
|
40
|
-
})
|
|
40
|
+
});
|
|
41
41
|
|
|
42
42
|
this._.okay = new Button({
|
|
43
43
|
parent: this,
|
|
@@ -51,7 +51,7 @@ function Prompt(options) {
|
|
|
51
51
|
hoverBg: 'blue',
|
|
52
52
|
autoFocus: false,
|
|
53
53
|
mouse: true
|
|
54
|
-
})
|
|
54
|
+
});
|
|
55
55
|
|
|
56
56
|
this._.cancel = new Button({
|
|
57
57
|
parent: this,
|
|
@@ -66,64 +66,57 @@ function Prompt(options) {
|
|
|
66
66
|
hoverBg: 'blue',
|
|
67
67
|
autoFocus: false,
|
|
68
68
|
mouse: true
|
|
69
|
-
})
|
|
69
|
+
});
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
-
Object.setPrototypeOf(Prompt.prototype, Box.prototype)
|
|
72
|
+
Object.setPrototypeOf(Prompt.prototype, Box.prototype);
|
|
73
73
|
|
|
74
|
-
Prompt.prototype.type = 'prompt'
|
|
74
|
+
Prompt.prototype.type = 'prompt';
|
|
75
75
|
|
|
76
76
|
Prompt.prototype.input =
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
self._.okay.removeListener('press', okay)
|
|
118
|
-
self._.cancel.removeListener('press', cancel)
|
|
119
|
-
return callback(err, data)
|
|
120
|
-
})
|
|
121
|
-
|
|
122
|
-
this.screen.render()
|
|
123
|
-
}
|
|
77
|
+
Prompt.prototype.setInput =
|
|
78
|
+
Prompt.prototype.readInput = function(text, value, callback) {
|
|
79
|
+
var self = this;
|
|
80
|
+
var okay, cancel;
|
|
81
|
+
|
|
82
|
+
if (!callback) {
|
|
83
|
+
callback = value;
|
|
84
|
+
value = '';
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
// Keep above:
|
|
88
|
+
// var parent = this.parent;
|
|
89
|
+
// this.detach();
|
|
90
|
+
// parent.append(this);
|
|
91
|
+
|
|
92
|
+
this.show();
|
|
93
|
+
this.setContent(' ' + text);
|
|
94
|
+
|
|
95
|
+
this._.input.value = value;
|
|
96
|
+
|
|
97
|
+
this.screen.saveFocus();
|
|
98
|
+
|
|
99
|
+
this._.okay.on('press', okay = function() {
|
|
100
|
+
self._.input.submit();
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
this._.cancel.on('press', cancel = function() {
|
|
104
|
+
self._.input.cancel();
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
this._.input.readInput(function(err, data) {
|
|
108
|
+
self.hide();
|
|
109
|
+
self.screen.restoreFocus();
|
|
110
|
+
self._.okay.removeListener('press', okay);
|
|
111
|
+
self._.cancel.removeListener('press', cancel);
|
|
112
|
+
return callback(err, data);
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
this.screen.render();
|
|
116
|
+
};
|
|
124
117
|
|
|
125
118
|
/**
|
|
126
119
|
* Expose
|
|
127
120
|
*/
|
|
128
121
|
|
|
129
|
-
module.exports = Prompt
|
|
122
|
+
module.exports = Prompt;
|
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
* Modules
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
var Node = require('./node');
|
|
14
|
+
var Box = require('./box');
|
|
15
|
+
var Button = require('./button');
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
18
|
* Question
|
|
@@ -20,13 +20,13 @@ const Button = require('./button')
|
|
|
20
20
|
|
|
21
21
|
function Question(options) {
|
|
22
22
|
if (!(this instanceof Node)) {
|
|
23
|
-
return new Question(options)
|
|
23
|
+
return new Question(options);
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
options = options || {}
|
|
27
|
-
options.hidden = true
|
|
26
|
+
options = options || {};
|
|
27
|
+
options.hidden = true;
|
|
28
28
|
|
|
29
|
-
Box.call(this, options)
|
|
29
|
+
Box.call(this, options);
|
|
30
30
|
|
|
31
31
|
this._.okay = new Button({
|
|
32
32
|
screen: this.screen,
|
|
@@ -41,7 +41,7 @@ function Question(options) {
|
|
|
41
41
|
hoverBg: 'blue',
|
|
42
42
|
autoFocus: false,
|
|
43
43
|
mouse: true
|
|
44
|
-
})
|
|
44
|
+
});
|
|
45
45
|
|
|
46
46
|
this._.cancel = new Button({
|
|
47
47
|
screen: this.screen,
|
|
@@ -57,75 +57,62 @@ function Question(options) {
|
|
|
57
57
|
hoverBg: 'blue',
|
|
58
58
|
autoFocus: false,
|
|
59
59
|
mouse: true
|
|
60
|
-
})
|
|
60
|
+
});
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
-
Object.setPrototypeOf(Question.prototype, Box.prototype)
|
|
63
|
+
Object.setPrototypeOf(Question.prototype, Box.prototype);
|
|
64
64
|
|
|
65
|
-
Question.prototype.type = 'question'
|
|
65
|
+
Question.prototype.type = 'question';
|
|
66
66
|
|
|
67
|
-
Question.prototype.ask = function
|
|
68
|
-
|
|
69
|
-
|
|
67
|
+
Question.prototype.ask = function(text, callback) {
|
|
68
|
+
var self = this;
|
|
69
|
+
var press, okay, cancel;
|
|
70
70
|
|
|
71
71
|
// Keep above:
|
|
72
72
|
// var parent = this.parent;
|
|
73
73
|
// this.detach();
|
|
74
74
|
// parent.append(this);
|
|
75
75
|
|
|
76
|
-
this.show()
|
|
77
|
-
this.setContent(' ' + text)
|
|
78
|
-
|
|
79
|
-
this.onScreenEvent(
|
|
80
|
-
'
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
done(null, true)
|
|
102
|
-
})
|
|
103
|
-
)
|
|
104
|
-
|
|
105
|
-
this._.cancel.on(
|
|
106
|
-
'press',
|
|
107
|
-
(cancel = function () {
|
|
108
|
-
done(null, false)
|
|
109
|
-
})
|
|
110
|
-
)
|
|
111
|
-
|
|
112
|
-
this.screen.saveFocus()
|
|
113
|
-
this.focus()
|
|
76
|
+
this.show();
|
|
77
|
+
this.setContent(' ' + text);
|
|
78
|
+
|
|
79
|
+
this.onScreenEvent('keypress', press = function(ch, key) {
|
|
80
|
+
if (key.name === 'mouse') return;
|
|
81
|
+
if (key.name !== 'enter'
|
|
82
|
+
&& key.name !== 'escape'
|
|
83
|
+
&& key.name !== 'q'
|
|
84
|
+
&& key.name !== 'y'
|
|
85
|
+
&& key.name !== 'n') {
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
88
|
+
done(null, key.name === 'enter' || key.name === 'y');
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
this._.okay.on('press', okay = function() {
|
|
92
|
+
done(null, true);
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
this._.cancel.on('press', cancel = function() {
|
|
96
|
+
done(null, false);
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
this.screen.saveFocus();
|
|
100
|
+
this.focus();
|
|
114
101
|
|
|
115
102
|
function done(err, data) {
|
|
116
|
-
self.hide()
|
|
117
|
-
self.screen.restoreFocus()
|
|
118
|
-
self.removeScreenEvent('keypress', press)
|
|
119
|
-
self._.okay.removeListener('press', okay)
|
|
120
|
-
self._.cancel.removeListener('press', cancel)
|
|
121
|
-
return callback(err, data)
|
|
103
|
+
self.hide();
|
|
104
|
+
self.screen.restoreFocus();
|
|
105
|
+
self.removeScreenEvent('keypress', press);
|
|
106
|
+
self._.okay.removeListener('press', okay);
|
|
107
|
+
self._.cancel.removeListener('press', cancel);
|
|
108
|
+
return callback(err, data);
|
|
122
109
|
}
|
|
123
110
|
|
|
124
|
-
this.screen.render()
|
|
125
|
-
}
|
|
111
|
+
this.screen.render();
|
|
112
|
+
};
|
|
126
113
|
|
|
127
114
|
/**
|
|
128
115
|
* Expose
|
|
129
116
|
*/
|
|
130
117
|
|
|
131
|
-
module.exports = Question
|
|
118
|
+
module.exports = Question;
|
|
@@ -10,55 +10,54 @@
|
|
|
10
10
|
* Modules
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
var Node = require('./node');
|
|
14
|
+
var Checkbox = require('./checkbox');
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
17
|
* RadioButton
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
20
|
function RadioButton(options) {
|
|
21
|
-
|
|
21
|
+
var self = this;
|
|
22
22
|
|
|
23
23
|
if (!(this instanceof Node)) {
|
|
24
|
-
return new RadioButton(options)
|
|
24
|
+
return new RadioButton(options);
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
options = options || {}
|
|
27
|
+
options = options || {};
|
|
28
28
|
|
|
29
|
-
Checkbox.call(this, options)
|
|
29
|
+
Checkbox.call(this, options);
|
|
30
30
|
|
|
31
|
-
this.on('check', function
|
|
32
|
-
|
|
33
|
-
while (
|
|
34
|
-
if (el.type === 'radio-set'
|
|
35
|
-
|
|
36
|
-
}
|
|
31
|
+
this.on('check', function() {
|
|
32
|
+
var el = self;
|
|
33
|
+
while (el = el.parent) {
|
|
34
|
+
if (el.type === 'radio-set'
|
|
35
|
+
|| el.type === 'form') break;
|
|
37
36
|
}
|
|
38
|
-
el = el || self.parent
|
|
39
|
-
el.forDescendants(function
|
|
37
|
+
el = el || self.parent;
|
|
38
|
+
el.forDescendants(function(el) {
|
|
40
39
|
if (el.type !== 'radio-button' || el === self) {
|
|
41
|
-
return
|
|
40
|
+
return;
|
|
42
41
|
}
|
|
43
|
-
el.uncheck()
|
|
44
|
-
})
|
|
45
|
-
})
|
|
42
|
+
el.uncheck();
|
|
43
|
+
});
|
|
44
|
+
});
|
|
46
45
|
}
|
|
47
46
|
|
|
48
|
-
Object.setPrototypeOf(RadioButton.prototype, Checkbox.prototype)
|
|
47
|
+
Object.setPrototypeOf(RadioButton.prototype, Checkbox.prototype);
|
|
49
48
|
|
|
50
|
-
RadioButton.prototype.type = 'radio-button'
|
|
49
|
+
RadioButton.prototype.type = 'radio-button';
|
|
51
50
|
|
|
52
|
-
RadioButton.prototype.render = function
|
|
53
|
-
this.clearPos(true)
|
|
54
|
-
this.setContent('(' + (this.checked ? '*' : ' ') + ') ' + this.text, true)
|
|
55
|
-
return this._render()
|
|
56
|
-
}
|
|
51
|
+
RadioButton.prototype.render = function() {
|
|
52
|
+
this.clearPos(true);
|
|
53
|
+
this.setContent('(' + (this.checked ? '*' : ' ') + ') ' + this.text, true);
|
|
54
|
+
return this._render();
|
|
55
|
+
};
|
|
57
56
|
|
|
58
|
-
RadioButton.prototype.toggle = RadioButton.prototype.check
|
|
57
|
+
RadioButton.prototype.toggle = RadioButton.prototype.check;
|
|
59
58
|
|
|
60
59
|
/**
|
|
61
60
|
* Expose
|
|
62
61
|
*/
|
|
63
62
|
|
|
64
|
-
module.exports = RadioButton
|
|
63
|
+
module.exports = RadioButton;
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
* Modules
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
var Node = require('./node');
|
|
14
|
+
var Box = require('./box');
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
17
|
* RadioSet
|
|
@@ -19,20 +19,20 @@ const Box = require('./box')
|
|
|
19
19
|
|
|
20
20
|
function RadioSet(options) {
|
|
21
21
|
if (!(this instanceof Node)) {
|
|
22
|
-
return new RadioSet(options)
|
|
22
|
+
return new RadioSet(options);
|
|
23
23
|
}
|
|
24
|
-
options = options || {}
|
|
24
|
+
options = options || {};
|
|
25
25
|
// Possibly inherit parent's style.
|
|
26
26
|
// options.style = this.parent.style;
|
|
27
|
-
Box.call(this, options)
|
|
27
|
+
Box.call(this, options);
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
Object.setPrototypeOf(RadioSet.prototype, Box.prototype)
|
|
30
|
+
Object.setPrototypeOf(RadioSet.prototype, Box.prototype);
|
|
31
31
|
|
|
32
|
-
RadioSet.prototype.type = 'radio-set'
|
|
32
|
+
RadioSet.prototype.type = 'radio-set';
|
|
33
33
|
|
|
34
34
|
/**
|
|
35
35
|
* Expose
|
|
36
36
|
*/
|
|
37
37
|
|
|
38
|
-
module.exports = RadioSet
|
|
38
|
+
module.exports = RadioSet;
|