@socketsecurity/cli-with-sentry 0.15.11 → 0.15.13
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 +5739 -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 +39272 -51880
- 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/@socketregistry/yocto-spinner.js +1 -1
- package/external/@socketsecurity/registry/external/@socketregistry/yocto-spinner.js.map +1 -1
- 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/constants/skip-tests-by-ecosystem.js +5 -1
- package/external/@socketsecurity/registry/lib/logger.d.ts +3 -1
- package/external/@socketsecurity/registry/lib/logger.js +152 -70
- package/external/@socketsecurity/registry/package.json +3 -3
- 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 +13 -13
- package/dist/types/commands/cdxgen/run-cdxgen.d.mts.map +0 -1
|
@@ -6,84 +6,80 @@
|
|
|
6
6
|
* https://github.com/chjj/blessed
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
var slice = Array.prototype.slice;
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* EventEmitter
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
15
|
function EventEmitter() {
|
|
16
|
-
if (!this._events) {
|
|
17
|
-
this._events = {}
|
|
18
|
-
}
|
|
16
|
+
if (!this._events) this._events = {};
|
|
19
17
|
}
|
|
20
18
|
|
|
21
|
-
EventEmitter.prototype.setMaxListeners = function
|
|
22
|
-
this._maxListeners = n
|
|
23
|
-
}
|
|
19
|
+
EventEmitter.prototype.setMaxListeners = function(n) {
|
|
20
|
+
this._maxListeners = n;
|
|
21
|
+
};
|
|
24
22
|
|
|
25
|
-
EventEmitter.prototype.addListener = function
|
|
23
|
+
EventEmitter.prototype.addListener = function(type, listener) {
|
|
26
24
|
if (!this._events[type]) {
|
|
27
|
-
this._events[type] = listener
|
|
25
|
+
this._events[type] = listener;
|
|
28
26
|
} else if (typeof this._events[type] === 'function') {
|
|
29
|
-
this._events[type] = [this._events[type], listener]
|
|
27
|
+
this._events[type] = [this._events[type], listener];
|
|
30
28
|
} else {
|
|
31
|
-
this._events[type].push(listener)
|
|
29
|
+
this._events[type].push(listener);
|
|
32
30
|
}
|
|
33
|
-
this._emit('newListener', [type, listener])
|
|
34
|
-
}
|
|
31
|
+
this._emit('newListener', [type, listener]);
|
|
32
|
+
};
|
|
35
33
|
|
|
36
|
-
EventEmitter.prototype.on = EventEmitter.prototype.addListener
|
|
34
|
+
EventEmitter.prototype.on = EventEmitter.prototype.addListener;
|
|
37
35
|
|
|
38
|
-
EventEmitter.prototype.removeListener = function
|
|
39
|
-
|
|
40
|
-
if (!handler)
|
|
41
|
-
return
|
|
42
|
-
}
|
|
36
|
+
EventEmitter.prototype.removeListener = function(type, listener) {
|
|
37
|
+
var handler = this._events[type];
|
|
38
|
+
if (!handler) return;
|
|
43
39
|
|
|
44
40
|
if (typeof handler === 'function' || handler.length === 1) {
|
|
45
|
-
delete this._events[type]
|
|
46
|
-
this._emit('removeListener', [type, listener])
|
|
47
|
-
return
|
|
41
|
+
delete this._events[type];
|
|
42
|
+
this._emit('removeListener', [type, listener]);
|
|
43
|
+
return;
|
|
48
44
|
}
|
|
49
45
|
|
|
50
|
-
for (
|
|
46
|
+
for (var i = 0; i < handler.length; i++) {
|
|
51
47
|
if (handler[i] === listener || handler[i].listener === listener) {
|
|
52
|
-
handler.splice(i, 1)
|
|
53
|
-
this._emit('removeListener', [type, listener])
|
|
54
|
-
return
|
|
48
|
+
handler.splice(i, 1);
|
|
49
|
+
this._emit('removeListener', [type, listener]);
|
|
50
|
+
return;
|
|
55
51
|
}
|
|
56
52
|
}
|
|
57
|
-
}
|
|
53
|
+
};
|
|
58
54
|
|
|
59
|
-
EventEmitter.prototype.off = EventEmitter.prototype.removeListener
|
|
55
|
+
EventEmitter.prototype.off = EventEmitter.prototype.removeListener;
|
|
60
56
|
|
|
61
|
-
EventEmitter.prototype.removeAllListeners = function
|
|
57
|
+
EventEmitter.prototype.removeAllListeners = function(type) {
|
|
62
58
|
if (type) {
|
|
63
|
-
delete this._events[type]
|
|
59
|
+
delete this._events[type];
|
|
64
60
|
} else {
|
|
65
|
-
this._events = {}
|
|
61
|
+
this._events = {};
|
|
66
62
|
}
|
|
67
|
-
}
|
|
63
|
+
};
|
|
68
64
|
|
|
69
|
-
EventEmitter.prototype.once = function
|
|
65
|
+
EventEmitter.prototype.once = function(type, listener) {
|
|
70
66
|
function on() {
|
|
71
|
-
this.removeListener(type, on)
|
|
72
|
-
return listener.apply(this, arguments)
|
|
67
|
+
this.removeListener(type, on);
|
|
68
|
+
return listener.apply(this, arguments);
|
|
73
69
|
}
|
|
74
|
-
on.listener = listener
|
|
75
|
-
return this.on(type, on)
|
|
76
|
-
}
|
|
70
|
+
on.listener = listener;
|
|
71
|
+
return this.on(type, on);
|
|
72
|
+
};
|
|
77
73
|
|
|
78
|
-
EventEmitter.prototype.listeners = function
|
|
74
|
+
EventEmitter.prototype.listeners = function(type) {
|
|
79
75
|
return typeof this._events[type] === 'function'
|
|
80
76
|
? [this._events[type]]
|
|
81
|
-
: this._events[type] || []
|
|
82
|
-
}
|
|
77
|
+
: this._events[type] || [];
|
|
78
|
+
};
|
|
83
79
|
|
|
84
|
-
EventEmitter.prototype._emit = function
|
|
85
|
-
|
|
86
|
-
ret
|
|
80
|
+
EventEmitter.prototype._emit = function(type, args) {
|
|
81
|
+
var handler = this._events[type]
|
|
82
|
+
, ret;
|
|
87
83
|
|
|
88
84
|
// if (type !== 'event') {
|
|
89
85
|
// this._emit('event', [type.replace(/^element /, '')].concat(args));
|
|
@@ -91,41 +87,41 @@ EventEmitter.prototype._emit = function (type, args) {
|
|
|
91
87
|
|
|
92
88
|
if (!handler) {
|
|
93
89
|
if (type === 'error') {
|
|
94
|
-
throw new args[0]
|
|
90
|
+
throw new args[0];
|
|
95
91
|
}
|
|
96
|
-
return
|
|
92
|
+
return;
|
|
97
93
|
}
|
|
98
94
|
|
|
99
95
|
if (typeof handler === 'function') {
|
|
100
|
-
return handler.apply(this, args)
|
|
96
|
+
return handler.apply(this, args);
|
|
101
97
|
}
|
|
102
98
|
|
|
103
|
-
for (
|
|
99
|
+
for (var i = 0; i < handler.length; i++) {
|
|
104
100
|
if (handler[i].apply(this, args) === false) {
|
|
105
|
-
ret = false
|
|
101
|
+
ret = false;
|
|
106
102
|
}
|
|
107
103
|
}
|
|
108
104
|
|
|
109
|
-
return ret !== false
|
|
110
|
-
}
|
|
105
|
+
return ret !== false;
|
|
106
|
+
};
|
|
111
107
|
|
|
112
|
-
EventEmitter.prototype.emit = function
|
|
113
|
-
|
|
114
|
-
params = slice.call(arguments)
|
|
115
|
-
el = this
|
|
108
|
+
EventEmitter.prototype.emit = function(type) {
|
|
109
|
+
var args = slice.call(arguments, 1)
|
|
110
|
+
, params = slice.call(arguments)
|
|
111
|
+
, el = this;
|
|
116
112
|
|
|
117
|
-
this._emit('event', params)
|
|
113
|
+
this._emit('event', params);
|
|
118
114
|
|
|
119
115
|
if (this.type === 'screen') {
|
|
120
|
-
return this._emit(type, args)
|
|
116
|
+
return this._emit(type, args);
|
|
121
117
|
}
|
|
122
118
|
|
|
123
119
|
if (this._emit(type, args) === false) {
|
|
124
|
-
return false
|
|
120
|
+
return false;
|
|
125
121
|
}
|
|
126
122
|
|
|
127
|
-
type = 'element ' + type
|
|
128
|
-
args.unshift(this)
|
|
123
|
+
type = 'element ' + type;
|
|
124
|
+
args.unshift(this);
|
|
129
125
|
// `element` prefix
|
|
130
126
|
// params = [type].concat(args);
|
|
131
127
|
// no `element` prefix
|
|
@@ -133,16 +129,14 @@ EventEmitter.prototype.emit = function (type) {
|
|
|
133
129
|
|
|
134
130
|
do {
|
|
135
131
|
// el._emit('event', params);
|
|
136
|
-
if (!el._events[type])
|
|
137
|
-
continue
|
|
138
|
-
}
|
|
132
|
+
if (!el._events[type]) continue;
|
|
139
133
|
if (el._emit(type, args) === false) {
|
|
140
|
-
return false
|
|
134
|
+
return false;
|
|
141
135
|
}
|
|
142
|
-
} while (
|
|
136
|
+
} while (el = el.parent);
|
|
143
137
|
|
|
144
|
-
return true
|
|
145
|
-
}
|
|
138
|
+
return true;
|
|
139
|
+
};
|
|
146
140
|
|
|
147
141
|
// For hooking into the main EventEmitter if we want to.
|
|
148
142
|
// Might be better to do things this way being that it
|
|
@@ -191,7 +185,7 @@ EventEmitter.prototype.emit = function (type) {
|
|
|
191
185
|
* Expose
|
|
192
186
|
*/
|
|
193
187
|
|
|
194
|
-
exports = EventEmitter
|
|
195
|
-
exports.EventEmitter = EventEmitter
|
|
188
|
+
exports = EventEmitter;
|
|
189
|
+
exports.EventEmitter = EventEmitter;
|
|
196
190
|
|
|
197
|
-
module.exports = exports
|
|
191
|
+
module.exports = exports;
|
|
@@ -6,25 +6,25 @@
|
|
|
6
6
|
* https://github.com/chjj/blessed
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
var net = require('net');
|
|
10
|
+
var fs = require('fs');
|
|
11
|
+
var EventEmitter = require('events').EventEmitter;
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
var GPM_USE_MAGIC = false;
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
GPM_DRAG = 2
|
|
17
|
-
GPM_DOWN = 4
|
|
18
|
-
GPM_UP = 8
|
|
15
|
+
var GPM_MOVE = 1
|
|
16
|
+
, GPM_DRAG = 2
|
|
17
|
+
, GPM_DOWN = 4
|
|
18
|
+
, GPM_UP = 8;
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
GPM_MFLAG = 128
|
|
20
|
+
var GPM_DOUBLE = 32
|
|
21
|
+
, GPM_MFLAG = 128;
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
GPM_HARD = 256
|
|
23
|
+
var GPM_REQ_NOPASTE = 3
|
|
24
|
+
, GPM_HARD = 256;
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
var GPM_MAGIC = 0x47706D4C;
|
|
27
|
+
var GPM_SOCKET = '/dev/gpmctl';
|
|
28
28
|
|
|
29
29
|
// typedef struct Gpm_Connect {
|
|
30
30
|
// unsigned short eventMask, defaultMask;
|
|
@@ -33,31 +33,29 @@ const GPM_SOCKET = '/dev/gpmctl'
|
|
|
33
33
|
// int vc;
|
|
34
34
|
// } Gpm_Connect;
|
|
35
35
|
|
|
36
|
-
function send_config(socket, Gpm_Connect,
|
|
37
|
-
|
|
36
|
+
function send_config(socket, Gpm_Connect, callback) {
|
|
37
|
+
var buffer;
|
|
38
38
|
if (GPM_USE_MAGIC) {
|
|
39
|
-
buffer = new Buffer(20)
|
|
40
|
-
buffer.writeUInt32LE(GPM_MAGIC, 0)
|
|
41
|
-
buffer.writeUInt16LE(Gpm_Connect.eventMask, 4)
|
|
42
|
-
buffer.writeUInt16LE(Gpm_Connect.defaultMask, 6)
|
|
43
|
-
buffer.writeUInt16LE(Gpm_Connect.minMod, 8)
|
|
44
|
-
buffer.writeUInt16LE(Gpm_Connect.maxMod, 10)
|
|
45
|
-
buffer.writeInt16LE(process.pid, 12)
|
|
46
|
-
buffer.writeInt16LE(Gpm_Connect.vc, 16)
|
|
39
|
+
buffer = new Buffer(20);
|
|
40
|
+
buffer.writeUInt32LE(GPM_MAGIC, 0);
|
|
41
|
+
buffer.writeUInt16LE(Gpm_Connect.eventMask, 4);
|
|
42
|
+
buffer.writeUInt16LE(Gpm_Connect.defaultMask, 6);
|
|
43
|
+
buffer.writeUInt16LE(Gpm_Connect.minMod, 8);
|
|
44
|
+
buffer.writeUInt16LE(Gpm_Connect.maxMod, 10);
|
|
45
|
+
buffer.writeInt16LE(process.pid, 12);
|
|
46
|
+
buffer.writeInt16LE(Gpm_Connect.vc, 16);
|
|
47
47
|
} else {
|
|
48
|
-
buffer = new Buffer(16)
|
|
49
|
-
buffer.writeUInt16LE(Gpm_Connect.eventMask, 0)
|
|
50
|
-
buffer.writeUInt16LE(Gpm_Connect.defaultMask, 2)
|
|
51
|
-
buffer.writeUInt16LE(Gpm_Connect.minMod, 4)
|
|
52
|
-
buffer.writeUInt16LE(Gpm_Connect.maxMod, 6)
|
|
53
|
-
buffer.writeInt16LE(Gpm_Connect.pid, 8)
|
|
54
|
-
buffer.writeInt16LE(Gpm_Connect.vc, 12)
|
|
48
|
+
buffer = new Buffer(16);
|
|
49
|
+
buffer.writeUInt16LE(Gpm_Connect.eventMask, 0);
|
|
50
|
+
buffer.writeUInt16LE(Gpm_Connect.defaultMask, 2);
|
|
51
|
+
buffer.writeUInt16LE(Gpm_Connect.minMod, 4);
|
|
52
|
+
buffer.writeUInt16LE(Gpm_Connect.maxMod, 6);
|
|
53
|
+
buffer.writeInt16LE(Gpm_Connect.pid, 8);
|
|
54
|
+
buffer.writeInt16LE(Gpm_Connect.vc, 12);
|
|
55
55
|
}
|
|
56
|
-
socket.write(buffer, function
|
|
57
|
-
if (callback)
|
|
58
|
-
|
|
59
|
-
}
|
|
60
|
-
})
|
|
56
|
+
socket.write(buffer, function() {
|
|
57
|
+
if (callback) callback();
|
|
58
|
+
});
|
|
61
59
|
}
|
|
62
60
|
|
|
63
61
|
// typedef struct Gpm_Event {
|
|
@@ -78,170 +76,148 @@ function send_config(socket, Gpm_Connect, callback) {
|
|
|
78
76
|
// } Gpm_Event;
|
|
79
77
|
|
|
80
78
|
function parseEvent(raw) {
|
|
81
|
-
|
|
82
|
-
evnt.buttons = raw[0]
|
|
83
|
-
evnt.modifiers = raw[1]
|
|
84
|
-
evnt.vc = raw.readUInt16LE(2)
|
|
85
|
-
evnt.dx = raw.readInt16LE(4)
|
|
86
|
-
evnt.dy = raw.readInt16LE(6)
|
|
87
|
-
evnt.x = raw.readInt16LE(8)
|
|
88
|
-
evnt.y = raw.readInt16LE(10)
|
|
89
|
-
evnt.type = raw.readInt16LE(12)
|
|
90
|
-
evnt.clicks = raw.readInt32LE(16)
|
|
91
|
-
evnt.margin = raw.readInt32LE(20)
|
|
92
|
-
evnt.wdx = raw.readInt16LE(24)
|
|
93
|
-
evnt.wdy = raw.readInt16LE(26)
|
|
94
|
-
return evnt
|
|
79
|
+
var evnt = {};
|
|
80
|
+
evnt.buttons = raw[0];
|
|
81
|
+
evnt.modifiers = raw[1];
|
|
82
|
+
evnt.vc = raw.readUInt16LE(2);
|
|
83
|
+
evnt.dx = raw.readInt16LE(4);
|
|
84
|
+
evnt.dy = raw.readInt16LE(6);
|
|
85
|
+
evnt.x = raw.readInt16LE(8);
|
|
86
|
+
evnt.y = raw.readInt16LE(10);
|
|
87
|
+
evnt.type = raw.readInt16LE(12);
|
|
88
|
+
evnt.clicks = raw.readInt32LE(16);
|
|
89
|
+
evnt.margin = raw.readInt32LE(20);
|
|
90
|
+
evnt.wdx = raw.readInt16LE(24);
|
|
91
|
+
evnt.wdy = raw.readInt16LE(26);
|
|
92
|
+
return evnt;
|
|
95
93
|
}
|
|
96
94
|
|
|
97
95
|
function GpmClient(options) {
|
|
98
96
|
if (!(this instanceof GpmClient)) {
|
|
99
|
-
return new GpmClient(options)
|
|
97
|
+
return new GpmClient(options);
|
|
100
98
|
}
|
|
101
99
|
|
|
102
|
-
EventEmitter.call(this)
|
|
100
|
+
EventEmitter.call(this);
|
|
103
101
|
|
|
104
|
-
|
|
102
|
+
var pid = process.pid;
|
|
105
103
|
|
|
106
104
|
// check tty for /dev/tty[n]
|
|
107
|
-
|
|
105
|
+
var path;
|
|
108
106
|
try {
|
|
109
|
-
path = fs.readlinkSync('/proc/' + pid + '/fd/0')
|
|
110
|
-
} catch (e) {
|
|
111
|
-
|
|
107
|
+
path = fs.readlinkSync('/proc/' + pid + '/fd/0');
|
|
108
|
+
} catch (e) {
|
|
109
|
+
;
|
|
110
|
+
}
|
|
111
|
+
var tty = /tty[0-9]+$/.exec(path);
|
|
112
112
|
if (tty === null) {
|
|
113
113
|
// TODO: should also check for /dev/input/..
|
|
114
114
|
}
|
|
115
115
|
|
|
116
|
-
|
|
116
|
+
var vc;
|
|
117
117
|
if (tty) {
|
|
118
|
-
tty = tty[0]
|
|
119
|
-
vc = +/[0-9]+$/.exec(tty)[0]
|
|
118
|
+
tty = tty[0];
|
|
119
|
+
vc = +/[0-9]+$/.exec(tty)[0];
|
|
120
120
|
}
|
|
121
121
|
|
|
122
|
-
|
|
122
|
+
var self = this;
|
|
123
123
|
|
|
124
124
|
if (tty) {
|
|
125
|
-
fs.stat(GPM_SOCKET, function
|
|
125
|
+
fs.stat(GPM_SOCKET, function(err, stat) {
|
|
126
126
|
if (err || !stat.isSocket()) {
|
|
127
|
-
return
|
|
127
|
+
return;
|
|
128
128
|
}
|
|
129
129
|
|
|
130
|
-
|
|
130
|
+
var conf = {
|
|
131
131
|
eventMask: 0xffff,
|
|
132
132
|
defaultMask: GPM_MOVE | GPM_HARD,
|
|
133
133
|
minMod: 0,
|
|
134
134
|
maxMod: 0xffff,
|
|
135
135
|
pid: pid,
|
|
136
136
|
vc: vc
|
|
137
|
-
}
|
|
137
|
+
};
|
|
138
138
|
|
|
139
|
-
|
|
140
|
-
this.gpm = gpm
|
|
139
|
+
var gpm = net.createConnection(GPM_SOCKET);
|
|
140
|
+
this.gpm = gpm;
|
|
141
141
|
|
|
142
|
-
gpm.on('connect', function
|
|
143
|
-
send_config(gpm, conf, function
|
|
144
|
-
conf.pid = 0
|
|
145
|
-
conf.vc = GPM_REQ_NOPASTE
|
|
142
|
+
gpm.on('connect', function() {
|
|
143
|
+
send_config(gpm, conf, function() {
|
|
144
|
+
conf.pid = 0;
|
|
145
|
+
conf.vc = GPM_REQ_NOPASTE;
|
|
146
146
|
//send_config(gpm, conf);
|
|
147
|
-
})
|
|
148
|
-
})
|
|
147
|
+
});
|
|
148
|
+
});
|
|
149
149
|
|
|
150
|
-
gpm.on('data', function
|
|
151
|
-
|
|
150
|
+
gpm.on('data', function(packet) {
|
|
151
|
+
var evnt = parseEvent(packet);
|
|
152
152
|
switch (evnt.type & 15) {
|
|
153
153
|
case GPM_MOVE:
|
|
154
154
|
if (evnt.dx || evnt.dy) {
|
|
155
|
-
self.emit('move', evnt.buttons, evnt.modifiers, evnt.x, evnt.y)
|
|
155
|
+
self.emit('move', evnt.buttons, evnt.modifiers, evnt.x, evnt.y);
|
|
156
156
|
}
|
|
157
157
|
if (evnt.wdx || evnt.wdy) {
|
|
158
|
-
self.emit(
|
|
159
|
-
|
|
160
|
-
evnt.
|
|
161
|
-
evnt.modifiers,
|
|
162
|
-
evnt.x,
|
|
163
|
-
evnt.y,
|
|
164
|
-
evnt.wdx,
|
|
165
|
-
evnt.wdy
|
|
166
|
-
)
|
|
158
|
+
self.emit('mousewheel',
|
|
159
|
+
evnt.buttons, evnt.modifiers,
|
|
160
|
+
evnt.x, evnt.y, evnt.wdx, evnt.wdy);
|
|
167
161
|
}
|
|
168
|
-
break
|
|
162
|
+
break;
|
|
169
163
|
case GPM_DRAG:
|
|
170
164
|
if (evnt.dx || evnt.dy) {
|
|
171
|
-
self.emit('drag', evnt.buttons, evnt.modifiers, evnt.x, evnt.y)
|
|
165
|
+
self.emit('drag', evnt.buttons, evnt.modifiers, evnt.x, evnt.y);
|
|
172
166
|
}
|
|
173
167
|
if (evnt.wdx || evnt.wdy) {
|
|
174
|
-
self.emit(
|
|
175
|
-
|
|
176
|
-
evnt.
|
|
177
|
-
evnt.modifiers,
|
|
178
|
-
evnt.x,
|
|
179
|
-
evnt.y,
|
|
180
|
-
evnt.wdx,
|
|
181
|
-
evnt.wdy
|
|
182
|
-
)
|
|
168
|
+
self.emit('mousewheel',
|
|
169
|
+
evnt.buttons, evnt.modifiers,
|
|
170
|
+
evnt.x, evnt.y, evnt.wdx, evnt.wdy);
|
|
183
171
|
}
|
|
184
|
-
break
|
|
172
|
+
break;
|
|
185
173
|
case GPM_DOWN:
|
|
186
|
-
self.emit('btndown', evnt.buttons, evnt.modifiers, evnt.x, evnt.y)
|
|
174
|
+
self.emit('btndown', evnt.buttons, evnt.modifiers, evnt.x, evnt.y);
|
|
187
175
|
if (evnt.type & GPM_DOUBLE) {
|
|
188
|
-
self.emit(
|
|
189
|
-
'dblclick',
|
|
190
|
-
evnt.buttons,
|
|
191
|
-
evnt.modifiers,
|
|
192
|
-
evnt.x,
|
|
193
|
-
evnt.y
|
|
194
|
-
)
|
|
176
|
+
self.emit('dblclick', evnt.buttons, evnt.modifiers, evnt.x, evnt.y);
|
|
195
177
|
}
|
|
196
|
-
break
|
|
178
|
+
break;
|
|
197
179
|
case GPM_UP:
|
|
198
|
-
self.emit('btnup', evnt.buttons, evnt.modifiers, evnt.x, evnt.y)
|
|
180
|
+
self.emit('btnup', evnt.buttons, evnt.modifiers, evnt.x, evnt.y);
|
|
199
181
|
if (!(evnt.type & GPM_MFLAG)) {
|
|
200
|
-
self.emit('click', evnt.buttons, evnt.modifiers, evnt.x, evnt.y)
|
|
182
|
+
self.emit('click', evnt.buttons, evnt.modifiers, evnt.x, evnt.y);
|
|
201
183
|
}
|
|
202
|
-
break
|
|
184
|
+
break;
|
|
203
185
|
}
|
|
204
|
-
})
|
|
186
|
+
});
|
|
205
187
|
|
|
206
|
-
gpm.on('error', function
|
|
207
|
-
self.stop()
|
|
208
|
-
})
|
|
209
|
-
})
|
|
188
|
+
gpm.on('error', function() {
|
|
189
|
+
self.stop();
|
|
190
|
+
});
|
|
191
|
+
});
|
|
210
192
|
}
|
|
211
193
|
}
|
|
212
194
|
|
|
213
|
-
Object.setPrototypeOf(GpmClient.prototype, EventEmitter.prototype)
|
|
195
|
+
Object.setPrototypeOf(GpmClient.prototype, EventEmitter.prototype);
|
|
214
196
|
|
|
215
|
-
GpmClient.prototype.stop = function
|
|
197
|
+
GpmClient.prototype.stop = function() {
|
|
216
198
|
if (this.gpm) {
|
|
217
|
-
this.gpm.end()
|
|
199
|
+
this.gpm.end();
|
|
218
200
|
}
|
|
219
|
-
delete this.gpm
|
|
220
|
-
}
|
|
201
|
+
delete this.gpm;
|
|
202
|
+
};
|
|
221
203
|
|
|
222
|
-
GpmClient.prototype.ButtonName =
|
|
223
|
-
if (btn & 4)
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
}
|
|
229
|
-
if (btn & 1) {
|
|
230
|
-
return 'right'
|
|
231
|
-
}
|
|
232
|
-
return ''
|
|
233
|
-
}
|
|
204
|
+
GpmClient.prototype.ButtonName = function(btn) {
|
|
205
|
+
if (btn & 4) return 'left';
|
|
206
|
+
if (btn & 2) return 'middle';
|
|
207
|
+
if (btn & 1) return 'right';
|
|
208
|
+
return '';
|
|
209
|
+
};
|
|
234
210
|
|
|
235
|
-
GpmClient.prototype.hasShiftKey =
|
|
236
|
-
return mod & 1 ? true : false
|
|
237
|
-
}
|
|
211
|
+
GpmClient.prototype.hasShiftKey = function(mod) {
|
|
212
|
+
return (mod & 1) ? true : false;
|
|
213
|
+
};
|
|
238
214
|
|
|
239
|
-
GpmClient.prototype.hasCtrlKey =
|
|
240
|
-
return mod & 4 ? true : false
|
|
241
|
-
}
|
|
215
|
+
GpmClient.prototype.hasCtrlKey = function(mod) {
|
|
216
|
+
return (mod & 4) ? true : false;
|
|
217
|
+
};
|
|
242
218
|
|
|
243
|
-
GpmClient.prototype.hasMetaKey =
|
|
244
|
-
return mod & 8 ? true : false
|
|
245
|
-
}
|
|
219
|
+
GpmClient.prototype.hasMetaKey = function(mod) {
|
|
220
|
+
return (mod & 8) ? true : false;
|
|
221
|
+
};
|
|
246
222
|
|
|
247
|
-
module.exports = GpmClient
|
|
223
|
+
module.exports = GpmClient;
|