@socketsecurity/cli-with-sentry 0.15.10 → 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.
Files changed (403) hide show
  1. package/bin/cli.js +6 -6
  2. package/dist/.config/tsconfig.dts.tsbuildinfo +1 -1
  3. package/dist/cli.js +5731 -6607
  4. package/dist/cli.js.map +1 -1
  5. package/dist/constants.js +274 -305
  6. package/dist/constants.js.map +1 -1
  7. package/dist/instrument-with-sentry.js +28 -34
  8. package/dist/instrument-with-sentry.js.map +1 -1
  9. package/dist/shadow-bin.js +96 -123
  10. package/dist/shadow-bin.js.map +1 -1
  11. package/dist/shadow-inject.js +470 -580
  12. package/dist/shadow-inject.js.map +1 -1
  13. package/dist/socket-completion.bash +221 -0
  14. package/dist/types/cli.d.mts +2 -2
  15. package/dist/types/commands/analytics/cmd-analytics.d.mts +9 -15
  16. package/dist/types/commands/analytics/fetch-org-analytics.d.mts +4 -6
  17. package/dist/types/commands/analytics/fetch-repo-analytics.d.mts +4 -7
  18. package/dist/types/commands/analytics/handle-analytics.d.mts +9 -15
  19. package/dist/types/commands/analytics/handle-analytics.d.mts.map +1 -1
  20. package/dist/types/commands/analytics/output-analytics.d.mts +26 -46
  21. package/dist/types/commands/analytics/output-analytics.d.mts.map +1 -1
  22. package/dist/types/commands/audit-log/cmd-audit-log.d.mts +9 -15
  23. package/dist/types/commands/audit-log/fetch-audit-log.d.mts +10 -16
  24. package/dist/types/commands/audit-log/fetch-audit-log.d.mts.map +1 -1
  25. package/dist/types/commands/audit-log/handle-audit-log.d.mts +9 -15
  26. package/dist/types/commands/audit-log/handle-audit-log.d.mts.map +1 -1
  27. package/dist/types/commands/audit-log/output-audit-log.d.mts +22 -47
  28. package/dist/types/commands/audit-log/output-audit-log.d.mts.map +1 -1
  29. package/dist/types/commands/cdxgen/cmd-cdxgen.d.mts +9 -15
  30. package/dist/types/commands/cdxgen/cmd-cdxgen.d.mts.map +1 -1
  31. package/dist/types/commands/cdxgen/handle-cdxgen.d.mts +4 -0
  32. package/dist/types/commands/cdxgen/handle-cdxgen.d.mts.map +1 -0
  33. package/dist/types/commands/ci/cmd-ci.d.mts +9 -15
  34. package/dist/types/commands/ci/fetch-default-org-slug.d.mts +3 -3
  35. package/dist/types/commands/ci/handle-ci.d.mts +2 -2
  36. package/dist/types/commands/config/cmd-config-auto.d.mts +9 -15
  37. package/dist/types/commands/config/cmd-config-get.d.mts +9 -15
  38. package/dist/types/commands/config/cmd-config-list.d.mts +9 -15
  39. package/dist/types/commands/config/cmd-config-set.d.mts +9 -15
  40. package/dist/types/commands/config/cmd-config-unset.d.mts +9 -15
  41. package/dist/types/commands/config/cmd-config.d.mts +3 -3
  42. package/dist/types/commands/config/discover-config-value.d.mts +3 -5
  43. package/dist/types/commands/config/discover-config-value.d.mts.map +1 -1
  44. package/dist/types/commands/config/handle-config-auto.d.mts +7 -10
  45. package/dist/types/commands/config/handle-config-auto.d.mts.map +1 -1
  46. package/dist/types/commands/config/handle-config-get.d.mts +7 -10
  47. package/dist/types/commands/config/handle-config-get.d.mts.map +1 -1
  48. package/dist/types/commands/config/handle-config-set.d.mts +8 -12
  49. package/dist/types/commands/config/handle-config-set.d.mts.map +1 -1
  50. package/dist/types/commands/config/handle-config-unset.d.mts +7 -10
  51. package/dist/types/commands/config/handle-config-unset.d.mts.map +1 -1
  52. package/dist/types/commands/config/output-config-auto.d.mts +4 -8
  53. package/dist/types/commands/config/output-config-get.d.mts +4 -8
  54. package/dist/types/commands/config/output-config-list.d.mts +6 -9
  55. package/dist/types/commands/config/output-config-list.d.mts.map +1 -1
  56. package/dist/types/commands/config/output-config-set.d.mts +3 -6
  57. package/dist/types/commands/config/output-config-unset.d.mts +3 -6
  58. package/dist/types/commands/dependencies/cmd-dependencies.d.mts +9 -15
  59. package/dist/types/commands/dependencies/fetch-dependencies.d.mts +7 -10
  60. package/dist/types/commands/dependencies/fetch-dependencies.d.mts.map +1 -1
  61. package/dist/types/commands/dependencies/handle-dependencies.d.mts +7 -11
  62. package/dist/types/commands/dependencies/handle-dependencies.d.mts.map +1 -1
  63. package/dist/types/commands/dependencies/output-dependencies.d.mts +8 -15
  64. package/dist/types/commands/dependencies/output-dependencies.d.mts.map +1 -1
  65. package/dist/types/commands/diff-scan/cmd-diff-scan-get.d.mts +9 -15
  66. package/dist/types/commands/diff-scan/cmd-diff-scan.d.mts +3 -3
  67. package/dist/types/commands/diff-scan/fetch-diff-scan.d.mts +8 -12
  68. package/dist/types/commands/diff-scan/fetch-diff-scan.d.mts.map +1 -1
  69. package/dist/types/commands/diff-scan/handle-diff-scan.d.mts +10 -17
  70. package/dist/types/commands/diff-scan/handle-diff-scan.d.mts.map +1 -1
  71. package/dist/types/commands/diff-scan/output-diff-scan.d.mts +8 -15
  72. package/dist/types/commands/diff-scan/output-diff-scan.d.mts.map +1 -1
  73. package/dist/types/commands/fix/cmd-fix.d.mts +9 -15
  74. package/dist/types/commands/fix/git.d.mts +14 -49
  75. package/dist/types/commands/fix/npm-fix.d.mts +4 -16
  76. package/dist/types/commands/fix/npm-fix.d.mts.map +1 -1
  77. package/dist/types/commands/fix/open-pr.d.mts +20 -46
  78. package/dist/types/commands/fix/open-pr.d.mts.map +1 -1
  79. package/dist/types/commands/fix/pnpm-fix.d.mts +4 -16
  80. package/dist/types/commands/fix/pnpm-fix.d.mts.map +1 -1
  81. package/dist/types/commands/fix/run-fix.d.mts +3 -3
  82. package/dist/types/commands/fix/shared.d.mts +9 -15
  83. package/dist/types/commands/fix/types.d.mts +16 -16
  84. package/dist/types/commands/info/cmd-info.d.mts +9 -15
  85. package/dist/types/commands/info/fetch-package-info.d.mts +3 -7
  86. package/dist/types/commands/info/handle-package-info.d.mts +15 -22
  87. package/dist/types/commands/info/handle-package-info.d.mts.map +1 -1
  88. package/dist/types/commands/info/output-package-info.d.mts +10 -18
  89. package/dist/types/commands/info/output-package-info.d.mts.map +1 -1
  90. package/dist/types/commands/install/cmd-install-completion.d.mts +10 -0
  91. package/dist/types/commands/install/cmd-install-completion.d.mts.map +1 -0
  92. package/dist/types/commands/install/cmd-install.d.mts +3 -0
  93. package/dist/types/commands/install/cmd-install.d.mts.map +1 -0
  94. package/dist/types/commands/install/handle-install-completion.d.mts +2 -0
  95. package/dist/types/commands/install/handle-install-completion.d.mts.map +1 -0
  96. package/dist/types/commands/install/output-install-completion.d.mts +12 -0
  97. package/dist/types/commands/install/output-install-completion.d.mts.map +1 -0
  98. package/dist/types/commands/install/setup-tab-completion.d.mts +13 -0
  99. package/dist/types/commands/install/setup-tab-completion.d.mts.map +1 -0
  100. package/dist/types/commands/login/apply-login.d.mts +2 -7
  101. package/dist/types/commands/login/attempt-login.d.mts +2 -5
  102. package/dist/types/commands/login/attempt-login.d.mts.map +1 -1
  103. package/dist/types/commands/login/cmd-login.d.mts +9 -15
  104. package/dist/types/commands/logout/apply-logout.d.mts +2 -2
  105. package/dist/types/commands/logout/attempt-logout.d.mts +2 -2
  106. package/dist/types/commands/logout/cmd-logout.d.mts +9 -15
  107. package/dist/types/commands/manifest/cmd-manifest-auto.d.mts +9 -15
  108. package/dist/types/commands/manifest/cmd-manifest-cdxgen.d.mts +10 -0
  109. package/dist/types/commands/manifest/cmd-manifest-cdxgen.d.mts.map +1 -0
  110. package/dist/types/commands/manifest/cmd-manifest-conda.d.mts +9 -15
  111. package/dist/types/commands/manifest/cmd-manifest-gradle.d.mts +9 -15
  112. package/dist/types/commands/manifest/cmd-manifest-kotlin.d.mts +9 -15
  113. package/dist/types/commands/manifest/cmd-manifest-scala.d.mts +9 -15
  114. package/dist/types/commands/manifest/cmd-manifest.d.mts +9 -15
  115. package/dist/types/commands/manifest/cmd-manifest.d.mts.map +1 -1
  116. package/dist/types/commands/manifest/convert-conda-to-requirements.d.mts +7 -15
  117. package/dist/types/commands/manifest/convert_gradle_to_maven.d.mts +2 -8
  118. package/dist/types/commands/manifest/convert_sbt_to_maven.d.mts +2 -8
  119. package/dist/types/commands/manifest/handle-manifest-conda.d.mts +3 -9
  120. package/dist/types/commands/manifest/output-requirements.d.mts +6 -10
  121. package/dist/types/commands/{cdxgen → manifest}/run-cdxgen.d.mts +2 -2
  122. package/dist/types/commands/manifest/run-cdxgen.d.mts.map +1 -0
  123. package/dist/types/commands/npm/cmd-npm.d.mts +9 -15
  124. package/dist/types/commands/npx/cmd-npx.d.mts +9 -15
  125. package/dist/types/commands/oops/cmd-oops.d.mts +9 -15
  126. package/dist/types/commands/optimize/add-overrides.d.mts +18 -22
  127. package/dist/types/commands/optimize/apply-optimization.d.mts +2 -6
  128. package/dist/types/commands/optimize/cmd-optimize.d.mts +9 -15
  129. package/dist/types/commands/optimize/deps-includes-by-agent.d.mts +4 -7
  130. package/dist/types/commands/optimize/get-dependency-entries.d.mts +3 -5
  131. package/dist/types/commands/optimize/get-overrides-by-agent.d.mts +8 -11
  132. package/dist/types/commands/optimize/lockfile-includes-by-agent.d.mts +3 -10
  133. package/dist/types/commands/optimize/ls-by-agent.d.mts +6 -13
  134. package/dist/types/commands/optimize/shared.d.mts +2 -2
  135. package/dist/types/commands/optimize/types.d.mts +7 -7
  136. package/dist/types/commands/optimize/update-lockfile.d.mts +9 -12
  137. package/dist/types/commands/optimize/update-manifest-by-agent.d.mts +5 -11
  138. package/dist/types/commands/organization/cmd-organization-list.d.mts +9 -15
  139. package/dist/types/commands/organization/cmd-organization-policy-license.d.mts +9 -15
  140. package/dist/types/commands/organization/cmd-organization-policy-security.d.mts +9 -15
  141. package/dist/types/commands/organization/cmd-organization-policy.d.mts +3 -3
  142. package/dist/types/commands/organization/cmd-organization-quota.d.mts +9 -15
  143. package/dist/types/commands/organization/cmd-organization.d.mts +3 -3
  144. package/dist/types/commands/organization/fetch-license-policy.d.mts +4 -6
  145. package/dist/types/commands/organization/fetch-organization-list.d.mts +4 -6
  146. package/dist/types/commands/organization/fetch-quota.d.mts +4 -6
  147. package/dist/types/commands/organization/fetch-security-policy.d.mts +4 -6
  148. package/dist/types/commands/organization/handle-license-policy.d.mts +3 -6
  149. package/dist/types/commands/organization/handle-organization-list.d.mts +3 -5
  150. package/dist/types/commands/organization/handle-quota.d.mts +3 -3
  151. package/dist/types/commands/organization/handle-security-policy.d.mts +3 -6
  152. package/dist/types/commands/organization/output-license-policy.d.mts +4 -7
  153. package/dist/types/commands/organization/output-organization-list.d.mts +4 -7
  154. package/dist/types/commands/organization/output-quota.d.mts +4 -7
  155. package/dist/types/commands/organization/output-security-policy.d.mts +4 -7
  156. package/dist/types/commands/package/cmd-package-score.d.mts +9 -15
  157. package/dist/types/commands/package/cmd-package-shallow.d.mts +16 -22
  158. package/dist/types/commands/package/cmd-package.d.mts +3 -3
  159. package/dist/types/commands/package/fetch-purl-deep-score.d.mts +49 -51
  160. package/dist/types/commands/package/fetch-purls-shallow-score.d.mts +4 -6
  161. package/dist/types/commands/package/handle-purl-deep-score.d.mts +3 -6
  162. package/dist/types/commands/package/handle-purls-shallow-score.d.mts +6 -9
  163. package/dist/types/commands/package/handle-purls-shallow-score.d.mts.map +1 -1
  164. package/dist/types/commands/package/output-purl-score.d.mts +4 -8
  165. package/dist/types/commands/package/output-purls-shallow-score.d.mts +4 -8
  166. package/dist/types/commands/package/parse-package-specifiers.d.mts +5 -8
  167. package/dist/types/commands/raw-npm/cmd-raw-npm.d.mts +9 -15
  168. package/dist/types/commands/raw-npm/run-raw-npm.d.mts +2 -4
  169. package/dist/types/commands/raw-npx/cmd-raw-npx.d.mts +9 -15
  170. package/dist/types/commands/raw-npx/run-raw-npx.d.mts +2 -4
  171. package/dist/types/commands/report/cmd-report-create.d.mts +9 -15
  172. package/dist/types/commands/report/cmd-report-view.d.mts +9 -15
  173. package/dist/types/commands/report/cmd-report.d.mts +3 -3
  174. package/dist/types/commands/repos/cmd-repos-create.d.mts +9 -15
  175. package/dist/types/commands/repos/cmd-repos-del.d.mts +9 -15
  176. package/dist/types/commands/repos/cmd-repos-list.d.mts +9 -15
  177. package/dist/types/commands/repos/cmd-repos-update.d.mts +9 -15
  178. package/dist/types/commands/repos/cmd-repos-view.d.mts +9 -15
  179. package/dist/types/commands/repos/cmd-repos.d.mts +3 -3
  180. package/dist/types/commands/repos/fetch-create-repo.d.mts +11 -18
  181. package/dist/types/commands/repos/fetch-create-repo.d.mts.map +1 -1
  182. package/dist/types/commands/repos/fetch-delete-repo.d.mts +4 -7
  183. package/dist/types/commands/repos/fetch-list-repos.d.mts +10 -16
  184. package/dist/types/commands/repos/fetch-list-repos.d.mts.map +1 -1
  185. package/dist/types/commands/repos/fetch-update-repo.d.mts +11 -18
  186. package/dist/types/commands/repos/fetch-update-repo.d.mts.map +1 -1
  187. package/dist/types/commands/repos/fetch-view-repo.d.mts +4 -7
  188. package/dist/types/commands/repos/handle-create-repo.d.mts +10 -20
  189. package/dist/types/commands/repos/handle-create-repo.d.mts.map +1 -1
  190. package/dist/types/commands/repos/handle-delete-repo.d.mts +3 -7
  191. package/dist/types/commands/repos/handle-list-repos.d.mts +10 -17
  192. package/dist/types/commands/repos/handle-list-repos.d.mts.map +1 -1
  193. package/dist/types/commands/repos/handle-update-repo.d.mts +10 -20
  194. package/dist/types/commands/repos/handle-update-repo.d.mts.map +1 -1
  195. package/dist/types/commands/repos/handle-view-repo.d.mts +3 -7
  196. package/dist/types/commands/repos/output-create-repo.d.mts +4 -8
  197. package/dist/types/commands/repos/output-delete-repo.d.mts +4 -8
  198. package/dist/types/commands/repos/output-list-repos.d.mts +4 -7
  199. package/dist/types/commands/repos/output-update-repo.d.mts +4 -8
  200. package/dist/types/commands/repos/output-view-repo.d.mts +4 -7
  201. package/dist/types/commands/scan/cmd-scan-create.d.mts +9 -15
  202. package/dist/types/commands/scan/cmd-scan-del.d.mts +9 -15
  203. package/dist/types/commands/scan/cmd-scan-diff.d.mts +9 -15
  204. package/dist/types/commands/scan/cmd-scan-list.d.mts +3 -3
  205. package/dist/types/commands/scan/cmd-scan-metadata.d.mts +3 -3
  206. package/dist/types/commands/scan/cmd-scan-report.d.mts +3 -3
  207. package/dist/types/commands/scan/cmd-scan-view.d.mts +3 -3
  208. package/dist/types/commands/scan/cmd-scan.d.mts +3 -3
  209. package/dist/types/commands/scan/fetch-create-org-full-scan.d.mts +11 -26
  210. package/dist/types/commands/scan/fetch-create-org-full-scan.d.mts.map +1 -1
  211. package/dist/types/commands/scan/fetch-delete-org-full-scan.d.mts +4 -7
  212. package/dist/types/commands/scan/fetch-diff-scan.d.mts +8 -12
  213. package/dist/types/commands/scan/fetch-diff-scan.d.mts.map +1 -1
  214. package/dist/types/commands/scan/fetch-list-scans.d.mts +13 -22
  215. package/dist/types/commands/scan/fetch-list-scans.d.mts.map +1 -1
  216. package/dist/types/commands/scan/fetch-report-data.d.mts +8 -14
  217. package/dist/types/commands/scan/fetch-scan-metadata.d.mts +4 -7
  218. package/dist/types/commands/scan/fetch-scan.d.mts +4 -7
  219. package/dist/types/commands/scan/fetch-supported-scan-file-names.d.mts +4 -6
  220. package/dist/types/commands/scan/generate-report.d.mts +36 -50
  221. package/dist/types/commands/scan/generate-report.d.mts.map +1 -1
  222. package/dist/types/commands/scan/handle-create-new-scan.d.mts +20 -37
  223. package/dist/types/commands/scan/handle-create-new-scan.d.mts.map +1 -1
  224. package/dist/types/commands/scan/handle-delete-scan.d.mts +3 -7
  225. package/dist/types/commands/scan/handle-diff-scan.d.mts +10 -17
  226. package/dist/types/commands/scan/handle-diff-scan.d.mts.map +1 -1
  227. package/dist/types/commands/scan/handle-list-scans.d.mts +13 -23
  228. package/dist/types/commands/scan/handle-list-scans.d.mts.map +1 -1
  229. package/dist/types/commands/scan/handle-scan-metadata.d.mts +3 -7
  230. package/dist/types/commands/scan/handle-scan-report.d.mts +12 -21
  231. package/dist/types/commands/scan/handle-scan-report.d.mts.map +1 -1
  232. package/dist/types/commands/scan/handle-scan-view.d.mts +3 -8
  233. package/dist/types/commands/scan/output-create-new-scan.d.mts +4 -8
  234. package/dist/types/commands/scan/output-delete-scan.d.mts +4 -7
  235. package/dist/types/commands/scan/output-diff-scan.d.mts +8 -15
  236. package/dist/types/commands/scan/output-diff-scan.d.mts.map +1 -1
  237. package/dist/types/commands/scan/output-list-scans.d.mts +4 -7
  238. package/dist/types/commands/scan/output-scan-metadata.d.mts +4 -8
  239. package/dist/types/commands/scan/output-scan-report.d.mts +20 -38
  240. package/dist/types/commands/scan/output-scan-report.d.mts.map +1 -1
  241. package/dist/types/commands/scan/output-scan-view.d.mts +4 -10
  242. package/dist/types/commands/scan/stream-scan.d.mts +2 -6
  243. package/dist/types/commands/scan/suggest-org-slug.d.mts +2 -2
  244. package/dist/types/commands/scan/suggest-repo-slug.d.mts +4 -4
  245. package/dist/types/commands/scan/suggest_branch_slug.d.mts +2 -4
  246. package/dist/types/commands/scan/suggest_target.d.mts +2 -2
  247. package/dist/types/commands/threat-feed/cmd-threat-feed.d.mts +9 -15
  248. package/dist/types/commands/threat-feed/fetch-threat-feed.d.mts +10 -16
  249. package/dist/types/commands/threat-feed/fetch-threat-feed.d.mts.map +1 -1
  250. package/dist/types/commands/threat-feed/handle-threat-feed.d.mts +10 -17
  251. package/dist/types/commands/threat-feed/handle-threat-feed.d.mts.map +1 -1
  252. package/dist/types/commands/threat-feed/output-threat-feed.d.mts +4 -7
  253. package/dist/types/commands/threat-feed/types.d.mts +12 -12
  254. package/dist/types/commands/uninstall/cmd-uninstall-completion.d.mts +9 -0
  255. package/dist/types/commands/uninstall/cmd-uninstall-completion.d.mts.map +1 -0
  256. package/dist/types/commands/uninstall/cmd-uninstall.d.mts +3 -0
  257. package/dist/types/commands/uninstall/cmd-uninstall.d.mts.map +1 -0
  258. package/dist/types/commands/uninstall/handle-uninstall-completion.d.mts +2 -0
  259. package/dist/types/commands/uninstall/handle-uninstall-completion.d.mts.map +1 -0
  260. package/dist/types/commands/uninstall/output-uninstall-completion.d.mts +6 -0
  261. package/dist/types/commands/uninstall/output-uninstall-completion.d.mts.map +1 -0
  262. package/dist/types/commands/uninstall/teardown-tab-completion.d.mts +6 -0
  263. package/dist/types/commands/uninstall/teardown-tab-completion.d.mts.map +1 -0
  264. package/dist/types/commands/wrapper/add-socket-wrapper.d.mts +2 -2
  265. package/dist/types/commands/wrapper/check-socket-wrapper-setup.d.mts +2 -2
  266. package/dist/types/commands/wrapper/cmd-wrapper.d.mts +9 -15
  267. package/dist/types/commands/wrapper/postinstall-wrapper.d.mts +2 -2
  268. package/dist/types/commands/wrapper/postinstall-wrapper.d.mts.map +1 -1
  269. package/dist/types/commands/wrapper/remove-socket-wrapper.d.mts +2 -2
  270. package/dist/types/constants.d.mts +125 -135
  271. package/dist/types/constants.d.mts.map +1 -1
  272. package/dist/types/flags.d.mts +14 -17
  273. package/dist/types/flags.d.mts.map +1 -1
  274. package/dist/types/instrument-with-sentry.d.mts +2 -2
  275. package/dist/types/shadow/npm/arborist/index.d.mts +2 -2
  276. package/dist/types/shadow/npm/arborist/lib/arborist/index.d.mts +19 -24
  277. package/dist/types/shadow/npm/arborist/lib/arborist/types.d.mts +43 -71
  278. package/dist/types/shadow/npm/arborist/lib/dep-valid.d.mts +3 -8
  279. package/dist/types/shadow/npm/arborist/lib/edge.d.mts +58 -71
  280. package/dist/types/shadow/npm/arborist/lib/node.d.mts +55 -91
  281. package/dist/types/shadow/npm/arborist/lib/override-set.d.mts +26 -32
  282. package/dist/types/shadow/npm/arborist-helpers.d.mts +33 -66
  283. package/dist/types/shadow/npm/arborist-helpers.d.mts.map +1 -1
  284. package/dist/types/shadow/npm/bin.d.mts +2 -5
  285. package/dist/types/shadow/npm/inject.d.mts +2 -2
  286. package/dist/types/shadow/npm/install.d.mts +11 -16
  287. package/dist/types/shadow/npm/link.d.mts +2 -5
  288. package/dist/types/shadow/npm/paths.d.mts +7 -7
  289. package/dist/types/shadow/npm/proc-log/index.d.mts +3 -6
  290. package/dist/types/types.d.mts +15 -17
  291. package/dist/types/utils/agent.d.mts +11 -14
  292. package/dist/types/utils/alert/artifact.d.mts +32 -50
  293. package/dist/types/utils/alert/fix.d.mts +5 -5
  294. package/dist/types/utils/alert/severity.d.mts +12 -24
  295. package/dist/types/utils/alerts-map.d.mts +23 -36
  296. package/dist/types/utils/api.d.mts +11 -34
  297. package/dist/types/utils/check-input.d.mts +9 -12
  298. package/dist/types/utils/cmd.d.mts +4 -4
  299. package/dist/types/utils/color-or-markdown.d.mts +14 -23
  300. package/dist/types/utils/color-or-markdown.d.mts.map +1 -1
  301. package/dist/types/utils/completion.d.mts +11 -0
  302. package/dist/types/utils/completion.d.mts.map +1 -0
  303. package/dist/types/utils/config.d.mts +22 -31
  304. package/dist/types/utils/config.d.mts.map +1 -1
  305. package/dist/types/utils/determine-org-slug.d.mts +2 -7
  306. package/dist/types/utils/errors.d.mts +12 -21
  307. package/dist/types/utils/fail-msg-with-badge.d.mts +2 -5
  308. package/dist/types/utils/fs.d.mts +21 -52
  309. package/dist/types/utils/get-output-kind.d.mts +3 -6
  310. package/dist/types/utils/glob.d.mts +13 -24
  311. package/dist/types/utils/map-to-object.d.mts +4 -6
  312. package/dist/types/utils/markdown.d.mts +4 -15
  313. package/dist/types/utils/meow-with-subcommands.d.mts +34 -46
  314. package/dist/types/utils/meow-with-subcommands.d.mts.map +1 -1
  315. package/dist/types/utils/npm-paths.d.mts +7 -7
  316. package/dist/types/utils/npm-paths.d.mts.map +1 -1
  317. package/dist/types/utils/objects.d.mts +3 -8
  318. package/dist/types/utils/output-formatting.d.mts +14 -24
  319. package/dist/types/utils/package-environment.d.mts +51 -72
  320. package/dist/types/utils/package-environment.d.mts.map +1 -1
  321. package/dist/types/utils/path-resolve.d.mts +9 -14
  322. package/dist/types/utils/pnpm.d.mts +9 -7
  323. package/dist/types/utils/pnpm.d.mts.map +1 -1
  324. package/dist/types/utils/sdk.d.mts +8 -12
  325. package/dist/types/utils/semver.d.mts +5 -17
  326. package/dist/types/utils/serialize-result-json.d.mts +3 -3
  327. package/dist/types/utils/socket-package-alert.d.mts +62 -81
  328. package/dist/types/utils/socket-url.d.mts +9 -15
  329. package/dist/types/utils/spec.d.mts +4 -7
  330. package/dist/types/utils/spec.d.mts.map +1 -1
  331. package/dist/types/utils/strings.d.mts +2 -5
  332. package/dist/types/utils/translations.d.mts +592 -592
  333. package/dist/types/utils/walk-nested-map.d.mts +7 -10
  334. package/dist/utils.js +1531 -1833
  335. package/dist/utils.js.map +1 -1
  336. package/dist/vendor.js +38333 -51605
  337. package/dist/vendor.js.map +1 -1
  338. package/external/@socketsecurity/registry/external/@npmcli/package-json/index.js +5 -8
  339. package/external/@socketsecurity/registry/external/@npmcli/promise-spawn.js +2 -4
  340. package/external/@socketsecurity/registry/external/cacache.js +1 -2
  341. package/external/@socketsecurity/registry/external/libnpmpack.js +36 -76
  342. package/external/@socketsecurity/registry/external/make-fetch-happen.js +31 -67
  343. package/external/@socketsecurity/registry/external/pacote.js +36 -76
  344. package/external/@socketsecurity/registry/external/tinyglobby.js +3 -6
  345. package/external/@socketsecurity/registry/external/which.js +2 -4
  346. package/external/@socketsecurity/registry/lib/logger.d.ts +4 -1
  347. package/external/@socketsecurity/registry/lib/logger.js +160 -73
  348. package/external/@socketsecurity/registry/lib/spinner.js +5 -1
  349. package/external/@socketsecurity/registry/package.json +2 -2
  350. package/external/blessed/lib/alias.js +475 -468
  351. package/external/blessed/lib/blessed.js +12 -12
  352. package/external/blessed/lib/colors.js +234 -194
  353. package/external/blessed/lib/events.js +64 -70
  354. package/external/blessed/lib/gpmclient.js +117 -141
  355. package/external/blessed/lib/helpers.js +89 -94
  356. package/external/blessed/lib/keys.js +169 -342
  357. package/external/blessed/lib/program.js +2130 -2365
  358. package/external/blessed/lib/tput.js +1183 -1276
  359. package/external/blessed/lib/unicode.js +400 -522
  360. package/external/blessed/lib/widget.js +14 -14
  361. package/external/blessed/lib/widgets/ansiimage.js +90 -96
  362. package/external/blessed/lib/widgets/bigtext.js +91 -102
  363. package/external/blessed/lib/widgets/box.js +8 -8
  364. package/external/blessed/lib/widgets/button.js +23 -23
  365. package/external/blessed/lib/widgets/checkbox.js +50 -54
  366. package/external/blessed/lib/widgets/element.js +1415 -1716
  367. package/external/blessed/lib/widgets/filemanager.js +107 -118
  368. package/external/blessed/lib/widgets/form.js +144 -178
  369. package/external/blessed/lib/widgets/image.js +26 -36
  370. package/external/blessed/lib/widgets/input.js +8 -8
  371. package/external/blessed/lib/widgets/layout.js +103 -119
  372. package/external/blessed/lib/widgets/line.js +17 -20
  373. package/external/blessed/lib/widgets/list.js +349 -402
  374. package/external/blessed/lib/widgets/listbar.js +265 -306
  375. package/external/blessed/lib/widgets/listtable.js +133 -146
  376. package/external/blessed/lib/widgets/loading.js +31 -31
  377. package/external/blessed/lib/widgets/log.js +41 -40
  378. package/external/blessed/lib/widgets/message.js +64 -86
  379. package/external/blessed/lib/widgets/node.js +175 -207
  380. package/external/blessed/lib/widgets/overlayimage.js +360 -437
  381. package/external/blessed/lib/widgets/progressbar.js +79 -88
  382. package/external/blessed/lib/widgets/prompt.js +54 -61
  383. package/external/blessed/lib/widgets/question.js +48 -61
  384. package/external/blessed/lib/widgets/radiobutton.js +26 -27
  385. package/external/blessed/lib/widgets/radioset.js +8 -8
  386. package/external/blessed/lib/widgets/screen.js +1186 -1375
  387. package/external/blessed/lib/widgets/scrollablebox.js +202 -228
  388. package/external/blessed/lib/widgets/scrollabletext.js +9 -9
  389. package/external/blessed/lib/widgets/table.js +187 -216
  390. package/external/blessed/lib/widgets/terminal.js +258 -298
  391. package/external/blessed/lib/widgets/text.js +9 -9
  392. package/external/blessed/lib/widgets/textarea.js +188 -222
  393. package/external/blessed/lib/widgets/textbox.js +34 -36
  394. package/external/blessed/lib/widgets/video.js +55 -59
  395. package/external/blessed/usr/fonts/ter-u14b.json +1 -1
  396. package/external/blessed/usr/fonts/ter-u14n.json +1 -1
  397. package/external/blessed/vendor/tng.js +1016 -1144
  398. package/external/blessed-contrib/lib/layout/grid.js +345 -377
  399. package/external/blessed-contrib/lib/widget/charts/bar.js +6612 -7139
  400. package/external/blessed-contrib/lib/widget/charts/line.js +16224 -23941
  401. package/external/blessed-contrib/lib/widget/table.js +78 -96
  402. package/package.json +9 -9
  403. package/dist/types/commands/cdxgen/run-cdxgen.d.mts.map +0 -1
@@ -10,645 +10,592 @@
10
10
  * Modules
11
11
  */
12
12
 
13
- const helpers = require('../helpers')
13
+ var helpers = require('../helpers');
14
14
 
15
- const Node = require('./node')
16
- const Box = require('./box')
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
- const self = this
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
- ;['bg', 'fg', 'bold', 'underline', 'blink', 'inverse', 'invisible'].forEach(
66
- function (name) {
67
- if (self.style[name] != null && self.style.item[name] == null) {
68
- self.style.item[name] = self.style[name]
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 (ch, key) {
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
- key.name === 'enter' ||
122
- (options.vi && key.name === 'l' && !key.shift)
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(((self.height - self.iheight) / 2) | 0)
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
- const visible =
160
- (Math.min(self.height - self.iheight, self.items.length) / 2) | 0
161
- self.move(self.childBase + visible - self.selected)
162
- self.screen.render()
163
- return
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.childBase +
169
- Math.min(self.height - self.iheight, self.items.length) -
170
- self.selected
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 (err, value) {
191
- if (
192
- typeof err === 'string' ||
193
- typeof err === 'function' ||
194
- typeof err === 'number' ||
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
- self.select(self.fuzzyFind(value, key.ch === '?'))
204
- self.screen.render()
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
- const visible = self.height - self.iheight
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 (el) {
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 (el) {
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 (content) {
241
- const self = this
230
+ List.prototype.createItem = function(content) {
231
+ var self = this;
242
232
 
243
233
  // Note: Could potentially use Button here.
244
- const options = {
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
- ;['bg', 'fg', 'bold', 'underline', 'blink', 'inverse', 'invisible'].forEach(
272
- function (name) {
273
- options[name] = function () {
274
- let attr =
275
- self.items[self.selected] === item && self.interactive
276
- ? self.style.selected[name]
277
- : self.style.item[name]
278
- if (typeof attr === 'function') {
279
- attr = attr(item)
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
- const item = new Box(options)
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
- List.prototype.addItem =
312
- List.prototype.appendItem =
313
- function (content) {
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
- this.ritems.push(content)
323
- this.items.push(item)
324
- this.append(item)
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
- if (this.items.length === 1) {
327
- this.select(0)
328
- }
307
+ this.ritems.push(content);
308
+ this.items.push(item);
309
+ this.append(item);
329
310
 
330
- this.emit('add item')
311
+ if (this.items.length === 1) {
312
+ this.select(0);
313
+ }
331
314
 
332
- return item
333
- }
315
+ this.emit('add item');
334
316
 
335
- List.prototype.removeItem = function (child) {
336
- const i = this.getItemIndex(child)
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 (let j = i; j < this.items.length; j++) {
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 (child, content) {
353
- content = typeof content === 'string' ? content : content.getContent()
354
- const i = this.getItemIndex(child)
355
- if (!~i) {
356
- return
357
- }
358
- if (i >= this.items.length) {
359
- return this.appendItem(content)
360
- }
361
- const item = this.createItem(content)
362
- for (let j = i; j < this.items.length; j++) {
363
- this.items[j].position.top++
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 (child) {
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 (child, content) {
380
- content = typeof content === 'string' ? content : content.getContent()
381
- const i = this.getItemIndex(child)
382
- if (!~i) {
383
- return
384
- }
385
- this.items[i].setContent(content)
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 (items) {
394
- let original = this.items.slice(),
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 (content) {
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 (content) {
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 (child, n) {
449
- const self = this
450
- let i = this.getItemIndex(child)
451
- if (!~i) {
452
- return
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 (item) {
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 = List.prototype.fuzzyFind = function (search, back) {
466
- let start = this.selected + (back ? -1 : 1),
467
- i
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
- const test =
480
- typeof search === 'string'
481
- ? function (item) {
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 (child) {
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
- let i = this.ritems.indexOf(child)
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 (index) {
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
- return
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
- return
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 (offset) {
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 (offset) {
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 (offset) {
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 (label, callback) {
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
- const self = this
602
- const focused = this.screen.focused
603
- if (focused && focused._done) {
604
- focused._done('stop')
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
- this.setLabel(label)
618
- }
619
- this.screen.render()
620
- this.once('action', function (el, selected) {
621
- if (label) {
622
- self.removeLabel()
623
- }
624
- self.screen.restoreFocus()
625
- self.hide()
626
- self.screen.render()
627
- if (!el) {
628
- return callback()
629
- }
630
- return callback(null, helpers.cleanTags(self.ritems[selected]))
631
- })
632
- }
633
-
634
- List.prototype.enterSelected = function (i) {
635
- if (i != null) {
636
- this.select(i)
637
- }
638
- this.emit('action', this.items[this.selected], this.selected)
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;