appmap 0.60.0 → 0.62.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (998) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +6 -16
  3. data/ARCHITECTURE.md +68 -0
  4. data/CHANGELOG.md +33 -0
  5. data/exe/appmap-index +7 -0
  6. data/lib/appmap.rb +2 -0
  7. data/lib/appmap/agent.rb +0 -11
  8. data/lib/appmap/command/agent_setup/status.rb +1 -1
  9. data/lib/appmap/command/index.rb +25 -0
  10. data/lib/appmap/command/inspect.rb +0 -1
  11. data/lib/appmap/config.rb +8 -1
  12. data/lib/appmap/depends.rb +2 -0
  13. data/lib/appmap/depends/api.rb +84 -0
  14. data/lib/appmap/depends/configuration.rb +59 -0
  15. data/lib/appmap/depends/node_cli.rb +44 -0
  16. data/lib/appmap/depends/rake_tasks.rb +58 -0
  17. data/lib/appmap/depends/test_file_inspector.rb +89 -0
  18. data/lib/appmap/depends/test_runner.rb +106 -0
  19. data/lib/appmap/depends/util.rb +34 -0
  20. data/lib/appmap/service/integration_test_path_finder.rb +29 -25
  21. data/lib/appmap/service/test_command_provider.rb +5 -7
  22. data/lib/appmap/service/validator/config_validator.rb +9 -0
  23. data/lib/appmap/version.rb +1 -1
  24. data/node_modules/@appland/cli/CHANGELOG.md +96 -0
  25. data/node_modules/@appland/cli/package.json +49 -0
  26. data/node_modules/@appland/cli/src/appMapCatalog.js +39 -0
  27. data/node_modules/@appland/cli/src/appland/getAppMap.js +55 -0
  28. data/node_modules/@appland/cli/src/appland/listAppMaps.js +58 -0
  29. data/node_modules/@appland/cli/src/appland/settings.js +62 -0
  30. data/node_modules/@appland/cli/src/appland/types.d.ts +16 -0
  31. data/node_modules/@appland/cli/src/cli.js +576 -0
  32. data/node_modules/@appland/cli/src/database.js +197 -0
  33. data/node_modules/@appland/cli/src/depends.js +157 -0
  34. data/node_modules/@appland/cli/src/fingerprint/algorithms.js +71 -0
  35. data/node_modules/@appland/cli/src/fingerprint/canonicalize.js +70 -0
  36. data/node_modules/@appland/cli/src/fingerprint/canonicalize/base.js +58 -0
  37. data/node_modules/@appland/cli/src/fingerprint/canonicalize/classDependencies.js +36 -0
  38. data/node_modules/@appland/cli/src/fingerprint/canonicalize/classes.js +14 -0
  39. data/node_modules/@appland/cli/src/fingerprint/canonicalize/eventTree.js +19 -0
  40. data/node_modules/@appland/cli/src/fingerprint/canonicalize/httpClientRequests.js +18 -0
  41. data/node_modules/@appland/cli/src/fingerprint/canonicalize/httpServerRequests.js +18 -0
  42. data/node_modules/@appland/cli/src/fingerprint/canonicalize/info.js +55 -0
  43. data/node_modules/@appland/cli/src/fingerprint/canonicalize/labels.js +10 -0
  44. data/node_modules/@appland/cli/src/fingerprint/canonicalize/packageDependencies.js +36 -0
  45. data/node_modules/@appland/cli/src/fingerprint/canonicalize/packages.js +14 -0
  46. data/node_modules/@appland/cli/src/fingerprint/canonicalize/sqlNormalized.js +19 -0
  47. data/node_modules/@appland/cli/src/fingerprint/canonicalize/sqlTables.js +24 -0
  48. data/node_modules/@appland/cli/src/fingerprint/canonicalize/trace.js +57 -0
  49. data/node_modules/@appland/cli/src/fingerprint/canonicalize/unique.js +8 -0
  50. data/node_modules/@appland/cli/src/fingerprint/canonicalize/update.js +85 -0
  51. data/node_modules/@appland/cli/src/fingerprint/fingerprintDirectoryCommand.js +30 -0
  52. data/node_modules/@appland/cli/src/fingerprint/fingerprintQueue.js +30 -0
  53. data/node_modules/@appland/cli/src/fingerprint/fingerprintWatchCommand.js +64 -0
  54. data/node_modules/@appland/cli/src/fingerprint/fingerprinter.js +186 -0
  55. data/node_modules/@appland/cli/src/fingerprint/index.js +24 -0
  56. data/node_modules/@appland/cli/src/functionStats.js +168 -0
  57. data/node_modules/@appland/cli/src/inspect.js +7 -0
  58. data/node_modules/@appland/cli/src/inspect/fields.js +66 -0
  59. data/node_modules/@appland/cli/src/inspect/filter.js +105 -0
  60. data/node_modules/@appland/cli/src/inspect/home.js +64 -0
  61. data/node_modules/@appland/cli/src/inspect/print.js +231 -0
  62. data/node_modules/@appland/cli/src/inspect/reset.js +10 -0
  63. data/node_modules/@appland/cli/src/inspect/types.d.ts +11 -0
  64. data/node_modules/@appland/cli/src/inspect/undoFilter.js +10 -0
  65. data/node_modules/@appland/cli/src/inventoryCommand.js +59 -0
  66. data/node_modules/@appland/cli/src/search/codeObjectMatcher.js +75 -0
  67. data/node_modules/@appland/cli/src/search/constants.js +5 -0
  68. data/node_modules/@appland/cli/src/search/findCodeObjects.js +293 -0
  69. data/node_modules/@appland/cli/src/search/findEvents.js +184 -0
  70. data/node_modules/@appland/cli/src/search/matchFilter.js +65 -0
  71. data/node_modules/@appland/cli/src/search/matchSpec.js +198 -0
  72. data/node_modules/@appland/cli/src/search/trigram.js +107 -0
  73. data/node_modules/@appland/cli/src/search/types.d.ts +107 -0
  74. data/node_modules/@appland/cli/src/search/utils.js +4 -0
  75. data/node_modules/@appland/cli/src/swagger/README.md +75 -0
  76. data/node_modules/@appland/cli/src/swagger/command.js +42 -0
  77. data/node_modules/@appland/cli/src/swagger/method.js +173 -0
  78. data/node_modules/@appland/cli/src/swagger/model.js +54 -0
  79. data/node_modules/@appland/cli/src/swagger/path.js +38 -0
  80. data/node_modules/@appland/cli/src/swagger/response.js +34 -0
  81. data/node_modules/@appland/cli/src/swagger/schema.js +38 -0
  82. data/node_modules/@appland/cli/src/swagger/securitySchemes.js +60 -0
  83. data/node_modules/@appland/cli/src/swagger/settings.js +9 -0
  84. data/node_modules/@appland/cli/src/swagger/util.js +79 -0
  85. data/node_modules/@appland/cli/src/utils.js +164 -0
  86. data/node_modules/@appland/cli/tests/unit/depends.spec.js +55 -0
  87. data/node_modules/@appland/cli/tests/unit/fingerprint/canonicalize.spec.js +42 -0
  88. data/node_modules/@appland/cli/tests/unit/fingerprint/sql.spec.js +40 -0
  89. data/node_modules/@appland/cli/tests/unit/fixtures/app/controllers/organizations_controller.rb +1 -0
  90. data/node_modules/@appland/cli/tests/unit/fixtures/app/models/configuration.rb +1 -0
  91. data/node_modules/@appland/cli/tests/unit/fixtures/app/models/show.rb +1 -0
  92. data/node_modules/@appland/cli/tests/unit/fixtures/app/models/user.rb +1 -0
  93. data/node_modules/@appland/cli/tests/unit/fixtures/canonicalize/revoke_api_key.info.json +246 -0
  94. data/node_modules/@appland/cli/tests/unit/fixtures/canonicalize/revoke_api_key.trace.json +289 -0
  95. data/node_modules/@appland/cli/tests/unit/fixtures/canonicalize/revoke_api_key.update.json +78 -0
  96. data/node_modules/@appland/cli/tests/unit/fixtures/revoke_api_key.appmap.json +899 -0
  97. data/node_modules/@appland/cli/tests/unit/fixtures/user_page_scenario.appmap.json +1774 -0
  98. data/node_modules/@appland/cli/tests/unit/inspect.spec.js +94 -0
  99. data/node_modules/@appland/models/CHANGELOG.md +83 -0
  100. data/node_modules/@appland/models/README.md +8 -0
  101. data/node_modules/@appland/models/dist/index.cjs +4250 -0
  102. data/node_modules/@appland/models/dist/index.js +4193 -0
  103. data/node_modules/@appland/models/package.json +50 -0
  104. data/node_modules/@rollup/plugin-alias/CHANGELOG.md +92 -0
  105. data/node_modules/@rollup/plugin-alias/LICENSE +21 -0
  106. data/node_modules/@rollup/plugin-alias/README.md +174 -0
  107. data/node_modules/@rollup/plugin-alias/dist/index.es.js +95 -0
  108. data/node_modules/@rollup/plugin-alias/dist/index.js +101 -0
  109. data/node_modules/@rollup/plugin-alias/package.json +78 -0
  110. data/node_modules/@rollup/plugin-alias/types/index.d.ts +36 -0
  111. data/node_modules/ansi-regex/index.d.ts +37 -0
  112. data/node_modules/ansi-regex/index.js +10 -0
  113. data/node_modules/ansi-regex/license +9 -0
  114. data/node_modules/ansi-regex/package.json +55 -0
  115. data/node_modules/ansi-regex/readme.md +78 -0
  116. data/node_modules/ansi-styles/index.d.ts +345 -0
  117. data/node_modules/ansi-styles/index.js +163 -0
  118. data/node_modules/ansi-styles/license +9 -0
  119. data/node_modules/ansi-styles/package.json +56 -0
  120. data/node_modules/ansi-styles/readme.md +152 -0
  121. data/node_modules/anymatch/LICENSE +15 -0
  122. data/node_modules/anymatch/README.md +87 -0
  123. data/node_modules/anymatch/index.d.ts +19 -0
  124. data/node_modules/anymatch/index.js +104 -0
  125. data/node_modules/anymatch/package.json +48 -0
  126. data/node_modules/argparse/CHANGELOG.md +185 -0
  127. data/node_modules/argparse/LICENSE +21 -0
  128. data/node_modules/argparse/README.md +257 -0
  129. data/node_modules/argparse/index.js +3 -0
  130. data/node_modules/argparse/lib/action.js +146 -0
  131. data/node_modules/argparse/lib/action/append.js +53 -0
  132. data/node_modules/argparse/lib/action/append/constant.js +47 -0
  133. data/node_modules/argparse/lib/action/count.js +40 -0
  134. data/node_modules/argparse/lib/action/help.js +47 -0
  135. data/node_modules/argparse/lib/action/store.js +50 -0
  136. data/node_modules/argparse/lib/action/store/constant.js +43 -0
  137. data/node_modules/argparse/lib/action/store/false.js +27 -0
  138. data/node_modules/argparse/lib/action/store/true.js +26 -0
  139. data/node_modules/argparse/lib/action/subparsers.js +149 -0
  140. data/node_modules/argparse/lib/action/version.js +47 -0
  141. data/node_modules/argparse/lib/action_container.js +482 -0
  142. data/node_modules/argparse/lib/argparse.js +14 -0
  143. data/node_modules/argparse/lib/argument/error.js +50 -0
  144. data/node_modules/argparse/lib/argument/exclusive.js +54 -0
  145. data/node_modules/argparse/lib/argument/group.js +75 -0
  146. data/node_modules/argparse/lib/argument_parser.js +1161 -0
  147. data/node_modules/argparse/lib/const.js +21 -0
  148. data/node_modules/argparse/lib/help/added_formatters.js +87 -0
  149. data/node_modules/argparse/lib/help/formatter.js +795 -0
  150. data/node_modules/argparse/lib/namespace.js +76 -0
  151. data/node_modules/argparse/lib/utils.js +57 -0
  152. data/node_modules/argparse/package.json +34 -0
  153. data/node_modules/async/CHANGELOG.md +331 -0
  154. data/node_modules/async/LICENSE +19 -0
  155. data/node_modules/async/README.md +60 -0
  156. data/node_modules/async/all.js +54 -0
  157. data/node_modules/async/allLimit.js +46 -0
  158. data/node_modules/async/allSeries.js +45 -0
  159. data/node_modules/async/any.js +56 -0
  160. data/node_modules/async/anyLimit.js +47 -0
  161. data/node_modules/async/anySeries.js +46 -0
  162. data/node_modules/async/apply.js +55 -0
  163. data/node_modules/async/applyEach.js +57 -0
  164. data/node_modules/async/applyEachSeries.js +37 -0
  165. data/node_modules/async/asyncify.js +118 -0
  166. data/node_modules/async/auto.js +267 -0
  167. data/node_modules/async/autoInject.js +156 -0
  168. data/node_modules/async/bower.json +17 -0
  169. data/node_modules/async/cargo.js +63 -0
  170. data/node_modules/async/cargoQueue.js +71 -0
  171. data/node_modules/async/compose.js +55 -0
  172. data/node_modules/async/concat.js +47 -0
  173. data/node_modules/async/concatLimit.js +60 -0
  174. data/node_modules/async/concatSeries.js +41 -0
  175. data/node_modules/async/constant.js +55 -0
  176. data/node_modules/async/detect.js +61 -0
  177. data/node_modules/async/detectLimit.js +48 -0
  178. data/node_modules/async/detectSeries.js +47 -0
  179. data/node_modules/async/dir.js +43 -0
  180. data/node_modules/async/dist/async.js +4846 -0
  181. data/node_modules/async/dist/async.min.js +1 -0
  182. data/node_modules/async/dist/async.mjs +4734 -0
  183. data/node_modules/async/doDuring.js +68 -0
  184. data/node_modules/async/doUntil.js +46 -0
  185. data/node_modules/async/doWhilst.js +68 -0
  186. data/node_modules/async/during.js +78 -0
  187. data/node_modules/async/each.js +88 -0
  188. data/node_modules/async/eachLimit.js +50 -0
  189. data/node_modules/async/eachOf.js +116 -0
  190. data/node_modules/async/eachOfLimit.js +47 -0
  191. data/node_modules/async/eachOfSeries.js +39 -0
  192. data/node_modules/async/eachSeries.js +44 -0
  193. data/node_modules/async/ensureAsync.js +67 -0
  194. data/node_modules/async/every.js +54 -0
  195. data/node_modules/async/everyLimit.js +46 -0
  196. data/node_modules/async/everySeries.js +45 -0
  197. data/node_modules/async/filter.js +53 -0
  198. data/node_modules/async/filterLimit.js +45 -0
  199. data/node_modules/async/filterSeries.js +43 -0
  200. data/node_modules/async/find.js +61 -0
  201. data/node_modules/async/findLimit.js +48 -0
  202. data/node_modules/async/findSeries.js +47 -0
  203. data/node_modules/async/flatMap.js +47 -0
  204. data/node_modules/async/flatMapLimit.js +60 -0
  205. data/node_modules/async/flatMapSeries.js +41 -0
  206. data/node_modules/async/foldl.js +77 -0
  207. data/node_modules/async/foldr.js +41 -0
  208. data/node_modules/async/forEach.js +88 -0
  209. data/node_modules/async/forEachLimit.js +50 -0
  210. data/node_modules/async/forEachOf.js +116 -0
  211. data/node_modules/async/forEachOfLimit.js +47 -0
  212. data/node_modules/async/forEachOfSeries.js +39 -0
  213. data/node_modules/async/forEachSeries.js +44 -0
  214. data/node_modules/async/forever.js +68 -0
  215. data/node_modules/async/groupBy.js +54 -0
  216. data/node_modules/async/groupByLimit.js +71 -0
  217. data/node_modules/async/groupBySeries.js +36 -0
  218. data/node_modules/async/index.js +588 -0
  219. data/node_modules/async/inject.js +77 -0
  220. data/node_modules/async/internal/DoublyLinkedList.js +92 -0
  221. data/node_modules/async/internal/Heap.js +120 -0
  222. data/node_modules/async/internal/applyEach.js +29 -0
  223. data/node_modules/async/internal/asyncEachOfLimit.js +75 -0
  224. data/node_modules/async/internal/awaitify.js +27 -0
  225. data/node_modules/async/internal/breakLoop.js +10 -0
  226. data/node_modules/async/internal/consoleFunc.js +27 -0
  227. data/node_modules/async/internal/createTester.js +40 -0
  228. data/node_modules/async/internal/eachOfLimit.js +90 -0
  229. data/node_modules/async/internal/filter.js +55 -0
  230. data/node_modules/async/internal/getIterator.js +11 -0
  231. data/node_modules/async/internal/initialParams.js +14 -0
  232. data/node_modules/async/internal/isArrayLike.js +10 -0
  233. data/node_modules/async/internal/iterator.js +54 -0
  234. data/node_modules/async/internal/map.js +30 -0
  235. data/node_modules/async/internal/once.js +17 -0
  236. data/node_modules/async/internal/onlyOnce.js +15 -0
  237. data/node_modules/async/internal/parallel.js +34 -0
  238. data/node_modules/async/internal/promiseCallback.js +23 -0
  239. data/node_modules/async/internal/queue.js +291 -0
  240. data/node_modules/async/internal/range.js +14 -0
  241. data/node_modules/async/internal/reject.js +26 -0
  242. data/node_modules/async/internal/setImmediate.js +30 -0
  243. data/node_modules/async/internal/withoutIndex.js +10 -0
  244. data/node_modules/async/internal/wrapAsync.js +34 -0
  245. data/node_modules/async/log.js +41 -0
  246. data/node_modules/async/map.js +62 -0
  247. data/node_modules/async/mapLimit.js +45 -0
  248. data/node_modules/async/mapSeries.js +44 -0
  249. data/node_modules/async/mapValues.js +62 -0
  250. data/node_modules/async/mapValuesLimit.js +61 -0
  251. data/node_modules/async/mapValuesSeries.js +37 -0
  252. data/node_modules/async/memoize.js +91 -0
  253. data/node_modules/async/nextTick.js +52 -0
  254. data/node_modules/async/package.json +82 -0
  255. data/node_modules/async/parallel.js +91 -0
  256. data/node_modules/async/parallelLimit.js +41 -0
  257. data/node_modules/async/priorityQueue.js +84 -0
  258. data/node_modules/async/queue.js +167 -0
  259. data/node_modules/async/race.js +67 -0
  260. data/node_modules/async/reduce.js +77 -0
  261. data/node_modules/async/reduceRight.js +41 -0
  262. data/node_modules/async/reflect.js +78 -0
  263. data/node_modules/async/reflectAll.js +93 -0
  264. data/node_modules/async/reject.js +53 -0
  265. data/node_modules/async/rejectLimit.js +45 -0
  266. data/node_modules/async/rejectSeries.js +43 -0
  267. data/node_modules/async/retry.js +159 -0
  268. data/node_modules/async/retryable.js +77 -0
  269. data/node_modules/async/select.js +53 -0
  270. data/node_modules/async/selectLimit.js +45 -0
  271. data/node_modules/async/selectSeries.js +43 -0
  272. data/node_modules/async/seq.js +79 -0
  273. data/node_modules/async/series.js +86 -0
  274. data/node_modules/async/setImmediate.js +45 -0
  275. data/node_modules/async/some.js +56 -0
  276. data/node_modules/async/someLimit.js +47 -0
  277. data/node_modules/async/someSeries.js +46 -0
  278. data/node_modules/async/sortBy.js +88 -0
  279. data/node_modules/async/timeout.js +89 -0
  280. data/node_modules/async/times.js +50 -0
  281. data/node_modules/async/timesLimit.js +43 -0
  282. data/node_modules/async/timesSeries.js +32 -0
  283. data/node_modules/async/transform.js +81 -0
  284. data/node_modules/async/tryEach.js +78 -0
  285. data/node_modules/async/unmemoize.js +25 -0
  286. data/node_modules/async/until.js +61 -0
  287. data/node_modules/async/waterfall.js +105 -0
  288. data/node_modules/async/whilst.js +78 -0
  289. data/node_modules/async/wrapSync.js +118 -0
  290. data/node_modules/at-least-node/LICENSE +6 -0
  291. data/node_modules/at-least-node/README.md +25 -0
  292. data/node_modules/at-least-node/index.js +5 -0
  293. data/node_modules/at-least-node/package.json +32 -0
  294. data/node_modules/balanced-match/LICENSE.md +21 -0
  295. data/node_modules/balanced-match/README.md +97 -0
  296. data/node_modules/balanced-match/index.js +62 -0
  297. data/node_modules/balanced-match/package.json +48 -0
  298. data/node_modules/binary-extensions/binary-extensions.json +260 -0
  299. data/node_modules/binary-extensions/binary-extensions.json.d.ts +3 -0
  300. data/node_modules/binary-extensions/index.d.ts +14 -0
  301. data/node_modules/binary-extensions/index.js +1 -0
  302. data/node_modules/binary-extensions/license +9 -0
  303. data/node_modules/binary-extensions/package.json +38 -0
  304. data/node_modules/binary-extensions/readme.md +41 -0
  305. data/node_modules/brace-expansion/LICENSE +21 -0
  306. data/node_modules/brace-expansion/README.md +129 -0
  307. data/node_modules/brace-expansion/index.js +201 -0
  308. data/node_modules/brace-expansion/package.json +47 -0
  309. data/node_modules/braces/CHANGELOG.md +184 -0
  310. data/node_modules/braces/LICENSE +21 -0
  311. data/node_modules/braces/README.md +593 -0
  312. data/node_modules/braces/index.js +170 -0
  313. data/node_modules/braces/lib/compile.js +57 -0
  314. data/node_modules/braces/lib/constants.js +57 -0
  315. data/node_modules/braces/lib/expand.js +113 -0
  316. data/node_modules/braces/lib/parse.js +333 -0
  317. data/node_modules/braces/lib/stringify.js +32 -0
  318. data/node_modules/braces/lib/utils.js +112 -0
  319. data/node_modules/braces/package.json +77 -0
  320. data/node_modules/chokidar/LICENSE +21 -0
  321. data/node_modules/chokidar/README.md +308 -0
  322. data/node_modules/chokidar/index.js +973 -0
  323. data/node_modules/chokidar/lib/constants.js +65 -0
  324. data/node_modules/chokidar/lib/fsevents-handler.js +524 -0
  325. data/node_modules/chokidar/lib/nodefs-handler.js +646 -0
  326. data/node_modules/chokidar/package.json +78 -0
  327. data/node_modules/chokidar/types/index.d.ts +187 -0
  328. data/node_modules/cli-progress/CHANGES.md +169 -0
  329. data/node_modules/cli-progress/LICENSE.md +24 -0
  330. data/node_modules/cli-progress/README.md +446 -0
  331. data/node_modules/cli-progress/cli-progress.js +21 -0
  332. data/node_modules/cli-progress/lib/eta.js +73 -0
  333. data/node_modules/cli-progress/lib/format-bar.js +11 -0
  334. data/node_modules/cli-progress/lib/format-time.js +34 -0
  335. data/node_modules/cli-progress/lib/format-value.js +22 -0
  336. data/node_modules/cli-progress/lib/formatter.js +80 -0
  337. data/node_modules/cli-progress/lib/generic-bar.js +212 -0
  338. data/node_modules/cli-progress/lib/multi-bar.js +201 -0
  339. data/node_modules/cli-progress/lib/options.js +95 -0
  340. data/node_modules/cli-progress/lib/single-bar.js +124 -0
  341. data/node_modules/cli-progress/lib/terminal.js +159 -0
  342. data/node_modules/cli-progress/package.json +46 -0
  343. data/node_modules/cli-progress/presets/index.js +11 -0
  344. data/node_modules/cli-progress/presets/legacy.js +6 -0
  345. data/node_modules/cli-progress/presets/rect.js +5 -0
  346. data/node_modules/cli-progress/presets/shades-classic.js +6 -0
  347. data/node_modules/cli-progress/presets/shades-grey.js +8 -0
  348. data/node_modules/cliui/CHANGELOG.md +121 -0
  349. data/node_modules/cliui/LICENSE.txt +14 -0
  350. data/node_modules/cliui/README.md +141 -0
  351. data/node_modules/cliui/build/index.cjs +302 -0
  352. data/node_modules/cliui/build/lib/index.js +287 -0
  353. data/node_modules/cliui/build/lib/string-utils.js +27 -0
  354. data/node_modules/cliui/index.mjs +13 -0
  355. data/node_modules/cliui/package.json +83 -0
  356. data/node_modules/color-convert/CHANGELOG.md +54 -0
  357. data/node_modules/color-convert/LICENSE +21 -0
  358. data/node_modules/color-convert/README.md +68 -0
  359. data/node_modules/color-convert/conversions.js +839 -0
  360. data/node_modules/color-convert/index.js +81 -0
  361. data/node_modules/color-convert/package.json +48 -0
  362. data/node_modules/color-convert/route.js +97 -0
  363. data/node_modules/color-name/LICENSE +8 -0
  364. data/node_modules/color-name/README.md +11 -0
  365. data/node_modules/color-name/index.js +152 -0
  366. data/node_modules/color-name/package.json +28 -0
  367. data/node_modules/colors/LICENSE +25 -0
  368. data/node_modules/colors/README.md +221 -0
  369. data/node_modules/colors/examples/normal-usage.js +82 -0
  370. data/node_modules/colors/examples/safe-string.js +79 -0
  371. data/node_modules/colors/index.d.ts +136 -0
  372. data/node_modules/colors/lib/colors.js +211 -0
  373. data/node_modules/colors/lib/custom/trap.js +46 -0
  374. data/node_modules/colors/lib/custom/zalgo.js +110 -0
  375. data/node_modules/colors/lib/extendStringPrototype.js +110 -0
  376. data/node_modules/colors/lib/index.js +13 -0
  377. data/node_modules/colors/lib/maps/america.js +10 -0
  378. data/node_modules/colors/lib/maps/rainbow.js +12 -0
  379. data/node_modules/colors/lib/maps/random.js +11 -0
  380. data/node_modules/colors/lib/maps/zebra.js +5 -0
  381. data/node_modules/colors/lib/styles.js +95 -0
  382. data/node_modules/colors/lib/system/has-flag.js +35 -0
  383. data/node_modules/colors/lib/system/supports-colors.js +151 -0
  384. data/node_modules/colors/package.json +45 -0
  385. data/node_modules/colors/safe.d.ts +48 -0
  386. data/node_modules/colors/safe.js +10 -0
  387. data/node_modules/colors/themes/generic-logging.js +12 -0
  388. data/node_modules/concat-map/LICENSE +18 -0
  389. data/node_modules/concat-map/README.markdown +62 -0
  390. data/node_modules/concat-map/example/map.js +6 -0
  391. data/node_modules/concat-map/index.js +13 -0
  392. data/node_modules/concat-map/package.json +43 -0
  393. data/node_modules/concat-map/test/map.js +39 -0
  394. data/node_modules/console-table-printer/CHANGELOG.md +96 -0
  395. data/node_modules/console-table-printer/LICENSE +21 -0
  396. data/node_modules/console-table-printer/README.md +180 -0
  397. data/node_modules/console-table-printer/dist/index.d.ts +4 -0
  398. data/node_modules/console-table-printer/dist/index.js +10 -0
  399. data/node_modules/console-table-printer/dist/src/console-table-printer.d.ts +14 -0
  400. data/node_modules/console-table-printer/dist/src/console-table-printer.js +32 -0
  401. data/node_modules/console-table-printer/dist/src/internalTable/input-converter.d.ts +6 -0
  402. data/node_modules/console-table-printer/dist/src/internalTable/input-converter.js +15 -0
  403. data/node_modules/console-table-printer/dist/src/internalTable/internal-table-printer.d.ts +4 -0
  404. data/node_modules/console-table-printer/dist/src/internalTable/internal-table-printer.js +115 -0
  405. data/node_modules/console-table-printer/dist/src/internalTable/internal-table.d.ts +25 -0
  406. data/node_modules/console-table-printer/dist/src/internalTable/internal-table.js +80 -0
  407. data/node_modules/console-table-printer/dist/src/internalTable/table-pre-processors.d.ts +3 -0
  408. data/node_modules/console-table-printer/dist/src/internalTable/table-pre-processors.js +43 -0
  409. data/node_modules/console-table-printer/dist/src/models/common.d.ts +10 -0
  410. data/node_modules/console-table-printer/dist/src/models/common.js +2 -0
  411. data/node_modules/console-table-printer/dist/src/models/external-table.d.ts +26 -0
  412. data/node_modules/console-table-printer/dist/src/models/external-table.js +2 -0
  413. data/node_modules/console-table-printer/dist/src/models/internal-table.d.ts +21 -0
  414. data/node_modules/console-table-printer/dist/src/models/internal-table.js +2 -0
  415. data/node_modules/console-table-printer/dist/src/utils/colored-console-line.d.ts +8 -0
  416. data/node_modules/console-table-printer/dist/src/utils/colored-console-line.js +29 -0
  417. data/node_modules/console-table-printer/dist/src/utils/console-utils.d.ts +2 -0
  418. data/node_modules/console-table-printer/dist/src/utils/console-utils.js +8 -0
  419. data/node_modules/console-table-printer/dist/src/utils/string-utils.d.ts +4 -0
  420. data/node_modules/console-table-printer/dist/src/utils/string-utils.js +54 -0
  421. data/node_modules/console-table-printer/dist/src/utils/table-constants.d.ts +10 -0
  422. data/node_modules/console-table-printer/dist/src/utils/table-constants.js +49 -0
  423. data/node_modules/console-table-printer/dist/src/utils/table-helpers.d.ts +26 -0
  424. data/node_modules/console-table-printer/dist/src/utils/table-helpers.js +91 -0
  425. data/node_modules/console-table-printer/package.json +51 -0
  426. data/node_modules/cross-env/CHANGELOG.md +5 -0
  427. data/node_modules/cross-env/LICENSE +20 -0
  428. data/node_modules/cross-env/README.md +291 -0
  429. data/node_modules/cross-env/package.json +54 -0
  430. data/node_modules/cross-env/src/bin/cross-env-shell.js +5 -0
  431. data/node_modules/cross-env/src/bin/cross-env.js +5 -0
  432. data/node_modules/cross-env/src/command.js +32 -0
  433. data/node_modules/cross-env/src/index.js +95 -0
  434. data/node_modules/cross-env/src/is-windows.js +2 -0
  435. data/node_modules/cross-env/src/variable.js +69 -0
  436. data/node_modules/cross-spawn/CHANGELOG.md +130 -0
  437. data/node_modules/cross-spawn/LICENSE +21 -0
  438. data/node_modules/cross-spawn/README.md +96 -0
  439. data/node_modules/cross-spawn/index.js +39 -0
  440. data/node_modules/cross-spawn/lib/enoent.js +59 -0
  441. data/node_modules/cross-spawn/lib/parse.js +91 -0
  442. data/node_modules/cross-spawn/lib/util/escape.js +45 -0
  443. data/node_modules/cross-spawn/lib/util/readShebang.js +23 -0
  444. data/node_modules/cross-spawn/lib/util/resolveCommand.js +52 -0
  445. data/node_modules/cross-spawn/package.json +73 -0
  446. data/node_modules/crypto-js/CONTRIBUTING.md +28 -0
  447. data/node_modules/crypto-js/LICENSE +24 -0
  448. data/node_modules/crypto-js/README.md +249 -0
  449. data/node_modules/crypto-js/aes.js +234 -0
  450. data/node_modules/crypto-js/bower.json +35 -0
  451. data/node_modules/crypto-js/cipher-core.js +890 -0
  452. data/node_modules/crypto-js/core.js +797 -0
  453. data/node_modules/crypto-js/crypto-js.js +6059 -0
  454. data/node_modules/crypto-js/docs/QuickStartGuide.wiki +470 -0
  455. data/node_modules/crypto-js/enc-base64.js +136 -0
  456. data/node_modules/crypto-js/enc-hex.js +18 -0
  457. data/node_modules/crypto-js/enc-latin1.js +18 -0
  458. data/node_modules/crypto-js/enc-utf16.js +149 -0
  459. data/node_modules/crypto-js/enc-utf8.js +18 -0
  460. data/node_modules/crypto-js/evpkdf.js +134 -0
  461. data/node_modules/crypto-js/format-hex.js +66 -0
  462. data/node_modules/crypto-js/format-openssl.js +18 -0
  463. data/node_modules/crypto-js/hmac-md5.js +18 -0
  464. data/node_modules/crypto-js/hmac-ripemd160.js +18 -0
  465. data/node_modules/crypto-js/hmac-sha1.js +18 -0
  466. data/node_modules/crypto-js/hmac-sha224.js +18 -0
  467. data/node_modules/crypto-js/hmac-sha256.js +18 -0
  468. data/node_modules/crypto-js/hmac-sha3.js +18 -0
  469. data/node_modules/crypto-js/hmac-sha384.js +18 -0
  470. data/node_modules/crypto-js/hmac-sha512.js +18 -0
  471. data/node_modules/crypto-js/hmac.js +143 -0
  472. data/node_modules/crypto-js/index.js +18 -0
  473. data/node_modules/crypto-js/lib-typedarrays.js +76 -0
  474. data/node_modules/crypto-js/md5.js +268 -0
  475. data/node_modules/crypto-js/mode-cfb.js +80 -0
  476. data/node_modules/crypto-js/mode-ctr-gladman.js +116 -0
  477. data/node_modules/crypto-js/mode-ctr.js +58 -0
  478. data/node_modules/crypto-js/mode-ecb.js +40 -0
  479. data/node_modules/crypto-js/mode-ofb.js +54 -0
  480. data/node_modules/crypto-js/package.json +38 -0
  481. data/node_modules/crypto-js/pad-ansix923.js +49 -0
  482. data/node_modules/crypto-js/pad-iso10126.js +44 -0
  483. data/node_modules/crypto-js/pad-iso97971.js +40 -0
  484. data/node_modules/crypto-js/pad-nopadding.js +30 -0
  485. data/node_modules/crypto-js/pad-pkcs7.js +18 -0
  486. data/node_modules/crypto-js/pad-zeropadding.js +47 -0
  487. data/node_modules/crypto-js/pbkdf2.js +145 -0
  488. data/node_modules/crypto-js/rabbit-legacy.js +190 -0
  489. data/node_modules/crypto-js/rabbit.js +192 -0
  490. data/node_modules/crypto-js/rc4.js +139 -0
  491. data/node_modules/crypto-js/ripemd160.js +267 -0
  492. data/node_modules/crypto-js/sha1.js +150 -0
  493. data/node_modules/crypto-js/sha224.js +80 -0
  494. data/node_modules/crypto-js/sha256.js +199 -0
  495. data/node_modules/crypto-js/sha3.js +326 -0
  496. data/node_modules/crypto-js/sha384.js +83 -0
  497. data/node_modules/crypto-js/sha512.js +326 -0
  498. data/node_modules/crypto-js/tripledes.js +779 -0
  499. data/node_modules/crypto-js/x64-core.js +304 -0
  500. data/node_modules/diff/CONTRIBUTING.md +39 -0
  501. data/node_modules/diff/LICENSE +31 -0
  502. data/node_modules/diff/README.md +208 -0
  503. data/node_modules/diff/dist/diff.js +1582 -0
  504. data/node_modules/diff/lib/convert/dmp.js +32 -0
  505. data/node_modules/diff/lib/convert/xml.js +42 -0
  506. data/node_modules/diff/lib/diff/array.js +45 -0
  507. data/node_modules/diff/lib/diff/base.js +304 -0
  508. data/node_modules/diff/lib/diff/character.js +37 -0
  509. data/node_modules/diff/lib/diff/css.js +41 -0
  510. data/node_modules/diff/lib/diff/json.js +163 -0
  511. data/node_modules/diff/lib/diff/line.js +89 -0
  512. data/node_modules/diff/lib/diff/sentence.js +41 -0
  513. data/node_modules/diff/lib/diff/word.js +108 -0
  514. data/node_modules/diff/lib/index.es6.js +1553 -0
  515. data/node_modules/diff/lib/index.js +216 -0
  516. data/node_modules/diff/lib/index.mjs +1553 -0
  517. data/node_modules/diff/lib/patch/apply.js +238 -0
  518. data/node_modules/diff/lib/patch/create.js +267 -0
  519. data/node_modules/diff/lib/patch/merge.js +613 -0
  520. data/node_modules/diff/lib/patch/parse.js +167 -0
  521. data/node_modules/diff/lib/util/array.js +32 -0
  522. data/node_modules/diff/lib/util/distance-iterator.js +57 -0
  523. data/node_modules/diff/lib/util/params.js +24 -0
  524. data/node_modules/diff/package.json +87 -0
  525. data/node_modules/diff/release-notes.md +303 -0
  526. data/node_modules/diff/runtime.js +3 -0
  527. data/node_modules/emoji-regex/LICENSE-MIT.txt +20 -0
  528. data/node_modules/emoji-regex/README.md +73 -0
  529. data/node_modules/emoji-regex/es2015/index.js +6 -0
  530. data/node_modules/emoji-regex/es2015/text.js +6 -0
  531. data/node_modules/emoji-regex/index.d.ts +23 -0
  532. data/node_modules/emoji-regex/index.js +6 -0
  533. data/node_modules/emoji-regex/package.json +50 -0
  534. data/node_modules/emoji-regex/text.js +6 -0
  535. data/node_modules/escalade/dist/index.js +22 -0
  536. data/node_modules/escalade/dist/index.mjs +22 -0
  537. data/node_modules/escalade/index.d.ts +3 -0
  538. data/node_modules/escalade/license +9 -0
  539. data/node_modules/escalade/package.json +61 -0
  540. data/node_modules/escalade/readme.md +211 -0
  541. data/node_modules/escalade/sync/index.d.ts +2 -0
  542. data/node_modules/escalade/sync/index.js +18 -0
  543. data/node_modules/escalade/sync/index.mjs +18 -0
  544. data/node_modules/esprima/ChangeLog +235 -0
  545. data/node_modules/esprima/LICENSE.BSD +21 -0
  546. data/node_modules/esprima/README.md +46 -0
  547. data/node_modules/esprima/bin/esparse.js +139 -0
  548. data/node_modules/esprima/bin/esvalidate.js +236 -0
  549. data/node_modules/esprima/dist/esprima.js +6709 -0
  550. data/node_modules/esprima/package.json +112 -0
  551. data/node_modules/fill-range/LICENSE +21 -0
  552. data/node_modules/fill-range/README.md +237 -0
  553. data/node_modules/fill-range/index.js +249 -0
  554. data/node_modules/fill-range/package.json +69 -0
  555. data/node_modules/fs-extra/CHANGELOG.md +902 -0
  556. data/node_modules/fs-extra/LICENSE +15 -0
  557. data/node_modules/fs-extra/README.md +264 -0
  558. data/node_modules/fs-extra/lib/copy-sync/copy-sync.js +166 -0
  559. data/node_modules/fs-extra/lib/copy-sync/index.js +5 -0
  560. data/node_modules/fs-extra/lib/copy/copy.js +232 -0
  561. data/node_modules/fs-extra/lib/copy/index.js +6 -0
  562. data/node_modules/fs-extra/lib/empty/index.js +48 -0
  563. data/node_modules/fs-extra/lib/ensure/file.js +69 -0
  564. data/node_modules/fs-extra/lib/ensure/index.js +23 -0
  565. data/node_modules/fs-extra/lib/ensure/link.js +61 -0
  566. data/node_modules/fs-extra/lib/ensure/symlink-paths.js +99 -0
  567. data/node_modules/fs-extra/lib/ensure/symlink-type.js +31 -0
  568. data/node_modules/fs-extra/lib/ensure/symlink.js +63 -0
  569. data/node_modules/fs-extra/lib/fs/index.js +130 -0
  570. data/node_modules/fs-extra/lib/index.js +27 -0
  571. data/node_modules/fs-extra/lib/json/index.js +16 -0
  572. data/node_modules/fs-extra/lib/json/jsonfile.js +11 -0
  573. data/node_modules/fs-extra/lib/json/output-json-sync.js +12 -0
  574. data/node_modules/fs-extra/lib/json/output-json.js +12 -0
  575. data/node_modules/fs-extra/lib/mkdirs/index.js +14 -0
  576. data/node_modules/fs-extra/lib/mkdirs/make-dir.js +141 -0
  577. data/node_modules/fs-extra/lib/move-sync/index.js +5 -0
  578. data/node_modules/fs-extra/lib/move-sync/move-sync.js +47 -0
  579. data/node_modules/fs-extra/lib/move/index.js +6 -0
  580. data/node_modules/fs-extra/lib/move/move.js +65 -0
  581. data/node_modules/fs-extra/lib/output/index.js +40 -0
  582. data/node_modules/fs-extra/lib/path-exists/index.js +12 -0
  583. data/node_modules/fs-extra/lib/remove/index.js +9 -0
  584. data/node_modules/fs-extra/lib/remove/rimraf.js +302 -0
  585. data/node_modules/fs-extra/lib/util/stat.js +139 -0
  586. data/node_modules/fs-extra/lib/util/utimes.js +26 -0
  587. data/node_modules/fs-extra/package.json +70 -0
  588. data/node_modules/fs.realpath/LICENSE +43 -0
  589. data/node_modules/fs.realpath/README.md +33 -0
  590. data/node_modules/fs.realpath/index.js +66 -0
  591. data/node_modules/fs.realpath/old.js +303 -0
  592. data/node_modules/fs.realpath/package.json +26 -0
  593. data/node_modules/fsevents/LICENSE +22 -0
  594. data/node_modules/fsevents/README.md +83 -0
  595. data/node_modules/fsevents/fsevents.d.ts +46 -0
  596. data/node_modules/fsevents/fsevents.js +82 -0
  597. data/node_modules/fsevents/fsevents.node +0 -0
  598. data/node_modules/fsevents/package.json +62 -0
  599. data/node_modules/get-caller-file/LICENSE.md +6 -0
  600. data/node_modules/get-caller-file/README.md +41 -0
  601. data/node_modules/get-caller-file/index.d.ts +2 -0
  602. data/node_modules/get-caller-file/index.js +22 -0
  603. data/node_modules/get-caller-file/index.js.map +1 -0
  604. data/node_modules/get-caller-file/package.json +42 -0
  605. data/node_modules/glob-parent/CHANGELOG.md +110 -0
  606. data/node_modules/glob-parent/LICENSE +15 -0
  607. data/node_modules/glob-parent/README.md +137 -0
  608. data/node_modules/glob-parent/index.js +42 -0
  609. data/node_modules/glob-parent/package.json +48 -0
  610. data/node_modules/glob/LICENSE +21 -0
  611. data/node_modules/glob/README.md +375 -0
  612. data/node_modules/glob/changelog.md +67 -0
  613. data/node_modules/glob/common.js +234 -0
  614. data/node_modules/glob/glob.js +788 -0
  615. data/node_modules/glob/package.json +51 -0
  616. data/node_modules/glob/sync.js +484 -0
  617. data/node_modules/graceful-fs/LICENSE +15 -0
  618. data/node_modules/graceful-fs/README.md +133 -0
  619. data/node_modules/graceful-fs/clone.js +23 -0
  620. data/node_modules/graceful-fs/graceful-fs.js +373 -0
  621. data/node_modules/graceful-fs/legacy-streams.js +118 -0
  622. data/node_modules/graceful-fs/package.json +50 -0
  623. data/node_modules/graceful-fs/polyfills.js +346 -0
  624. data/node_modules/inflight/LICENSE +15 -0
  625. data/node_modules/inflight/README.md +37 -0
  626. data/node_modules/inflight/inflight.js +54 -0
  627. data/node_modules/inflight/package.json +29 -0
  628. data/node_modules/inherits/LICENSE +16 -0
  629. data/node_modules/inherits/README.md +42 -0
  630. data/node_modules/inherits/inherits.js +9 -0
  631. data/node_modules/inherits/inherits_browser.js +27 -0
  632. data/node_modules/inherits/package.json +29 -0
  633. data/node_modules/is-binary-path/index.d.ts +17 -0
  634. data/node_modules/is-binary-path/index.js +7 -0
  635. data/node_modules/is-binary-path/license +9 -0
  636. data/node_modules/is-binary-path/package.json +40 -0
  637. data/node_modules/is-binary-path/readme.md +34 -0
  638. data/node_modules/is-extglob/LICENSE +21 -0
  639. data/node_modules/is-extglob/README.md +107 -0
  640. data/node_modules/is-extglob/index.js +20 -0
  641. data/node_modules/is-extglob/package.json +69 -0
  642. data/node_modules/is-fullwidth-code-point/index.d.ts +17 -0
  643. data/node_modules/is-fullwidth-code-point/index.js +50 -0
  644. data/node_modules/is-fullwidth-code-point/license +9 -0
  645. data/node_modules/is-fullwidth-code-point/package.json +42 -0
  646. data/node_modules/is-fullwidth-code-point/readme.md +39 -0
  647. data/node_modules/is-glob/LICENSE +21 -0
  648. data/node_modules/is-glob/README.md +206 -0
  649. data/node_modules/is-glob/index.js +48 -0
  650. data/node_modules/is-glob/package.json +81 -0
  651. data/node_modules/is-number/LICENSE +21 -0
  652. data/node_modules/is-number/README.md +187 -0
  653. data/node_modules/is-number/index.js +18 -0
  654. data/node_modules/is-number/package.json +82 -0
  655. data/node_modules/isexe/LICENSE +15 -0
  656. data/node_modules/isexe/README.md +51 -0
  657. data/node_modules/isexe/index.js +57 -0
  658. data/node_modules/isexe/mode.js +41 -0
  659. data/node_modules/isexe/package.json +31 -0
  660. data/node_modules/isexe/test/basic.js +221 -0
  661. data/node_modules/isexe/windows.js +42 -0
  662. data/node_modules/js-yaml/CHANGELOG.md +557 -0
  663. data/node_modules/js-yaml/LICENSE +21 -0
  664. data/node_modules/js-yaml/README.md +299 -0
  665. data/node_modules/js-yaml/bin/js-yaml.js +132 -0
  666. data/node_modules/js-yaml/dist/js-yaml.js +3989 -0
  667. data/node_modules/js-yaml/dist/js-yaml.min.js +1 -0
  668. data/node_modules/js-yaml/index.js +7 -0
  669. data/node_modules/js-yaml/lib/js-yaml.js +39 -0
  670. data/node_modules/js-yaml/lib/js-yaml/common.js +59 -0
  671. data/node_modules/js-yaml/lib/js-yaml/dumper.js +850 -0
  672. data/node_modules/js-yaml/lib/js-yaml/exception.js +43 -0
  673. data/node_modules/js-yaml/lib/js-yaml/loader.js +1644 -0
  674. data/node_modules/js-yaml/lib/js-yaml/mark.js +76 -0
  675. data/node_modules/js-yaml/lib/js-yaml/schema.js +108 -0
  676. data/node_modules/js-yaml/lib/js-yaml/schema/core.js +18 -0
  677. data/node_modules/js-yaml/lib/js-yaml/schema/default_full.js +25 -0
  678. data/node_modules/js-yaml/lib/js-yaml/schema/default_safe.js +28 -0
  679. data/node_modules/js-yaml/lib/js-yaml/schema/failsafe.js +17 -0
  680. data/node_modules/js-yaml/lib/js-yaml/schema/json.js +25 -0
  681. data/node_modules/js-yaml/lib/js-yaml/type.js +61 -0
  682. data/node_modules/js-yaml/lib/js-yaml/type/binary.js +138 -0
  683. data/node_modules/js-yaml/lib/js-yaml/type/bool.js +35 -0
  684. data/node_modules/js-yaml/lib/js-yaml/type/float.js +116 -0
  685. data/node_modules/js-yaml/lib/js-yaml/type/int.js +173 -0
  686. data/node_modules/js-yaml/lib/js-yaml/type/js/function.js +93 -0
  687. data/node_modules/js-yaml/lib/js-yaml/type/js/regexp.js +60 -0
  688. data/node_modules/js-yaml/lib/js-yaml/type/js/undefined.js +28 -0
  689. data/node_modules/js-yaml/lib/js-yaml/type/map.js +8 -0
  690. data/node_modules/js-yaml/lib/js-yaml/type/merge.js +12 -0
  691. data/node_modules/js-yaml/lib/js-yaml/type/null.js +34 -0
  692. data/node_modules/js-yaml/lib/js-yaml/type/omap.js +44 -0
  693. data/node_modules/js-yaml/lib/js-yaml/type/pairs.js +53 -0
  694. data/node_modules/js-yaml/lib/js-yaml/type/seq.js +8 -0
  695. data/node_modules/js-yaml/lib/js-yaml/type/set.js +29 -0
  696. data/node_modules/js-yaml/lib/js-yaml/type/str.js +8 -0
  697. data/node_modules/js-yaml/lib/js-yaml/type/timestamp.js +88 -0
  698. data/node_modules/js-yaml/package.json +49 -0
  699. data/node_modules/jsonfile/CHANGELOG.md +171 -0
  700. data/node_modules/jsonfile/LICENSE +15 -0
  701. data/node_modules/jsonfile/README.md +230 -0
  702. data/node_modules/jsonfile/index.js +88 -0
  703. data/node_modules/jsonfile/package.json +40 -0
  704. data/node_modules/jsonfile/utils.js +14 -0
  705. data/node_modules/lru-cache/LICENSE +15 -0
  706. data/node_modules/lru-cache/README.md +166 -0
  707. data/node_modules/lru-cache/index.js +334 -0
  708. data/node_modules/lru-cache/package.json +34 -0
  709. data/node_modules/minimatch/LICENSE +15 -0
  710. data/node_modules/minimatch/README.md +209 -0
  711. data/node_modules/minimatch/minimatch.js +923 -0
  712. data/node_modules/minimatch/package.json +30 -0
  713. data/node_modules/normalize-path/LICENSE +21 -0
  714. data/node_modules/normalize-path/README.md +127 -0
  715. data/node_modules/normalize-path/index.js +35 -0
  716. data/node_modules/normalize-path/package.json +77 -0
  717. data/node_modules/once/LICENSE +15 -0
  718. data/node_modules/once/README.md +79 -0
  719. data/node_modules/once/once.js +42 -0
  720. data/node_modules/once/package.json +33 -0
  721. data/node_modules/path-is-absolute/index.js +20 -0
  722. data/node_modules/path-is-absolute/license +21 -0
  723. data/node_modules/path-is-absolute/package.json +43 -0
  724. data/node_modules/path-is-absolute/readme.md +59 -0
  725. data/node_modules/path-key/index.d.ts +40 -0
  726. data/node_modules/path-key/index.js +16 -0
  727. data/node_modules/path-key/license +9 -0
  728. data/node_modules/path-key/package.json +39 -0
  729. data/node_modules/path-key/readme.md +61 -0
  730. data/node_modules/picomatch/CHANGELOG.md +126 -0
  731. data/node_modules/picomatch/LICENSE +21 -0
  732. data/node_modules/picomatch/README.md +707 -0
  733. data/node_modules/picomatch/index.js +3 -0
  734. data/node_modules/picomatch/lib/constants.js +179 -0
  735. data/node_modules/picomatch/lib/parse.js +1084 -0
  736. data/node_modules/picomatch/lib/picomatch.js +342 -0
  737. data/node_modules/picomatch/lib/scan.js +391 -0
  738. data/node_modules/picomatch/lib/utils.js +64 -0
  739. data/node_modules/picomatch/package.json +81 -0
  740. data/node_modules/readdirp/LICENSE +21 -0
  741. data/node_modules/readdirp/README.md +122 -0
  742. data/node_modules/readdirp/index.d.ts +43 -0
  743. data/node_modules/readdirp/index.js +287 -0
  744. data/node_modules/readdirp/package.json +122 -0
  745. data/node_modules/require-directory/LICENSE +22 -0
  746. data/node_modules/require-directory/README.markdown +184 -0
  747. data/node_modules/require-directory/index.js +86 -0
  748. data/node_modules/require-directory/package.json +40 -0
  749. data/node_modules/semver/CHANGELOG.md +111 -0
  750. data/node_modules/semver/LICENSE +15 -0
  751. data/node_modules/semver/README.md +566 -0
  752. data/node_modules/semver/bin/semver.js +173 -0
  753. data/node_modules/semver/classes/comparator.js +135 -0
  754. data/node_modules/semver/classes/index.js +5 -0
  755. data/node_modules/semver/classes/range.js +510 -0
  756. data/node_modules/semver/classes/semver.js +287 -0
  757. data/node_modules/semver/functions/clean.js +6 -0
  758. data/node_modules/semver/functions/cmp.js +48 -0
  759. data/node_modules/semver/functions/coerce.js +51 -0
  760. data/node_modules/semver/functions/compare-build.js +7 -0
  761. data/node_modules/semver/functions/compare-loose.js +3 -0
  762. data/node_modules/semver/functions/compare.js +5 -0
  763. data/node_modules/semver/functions/diff.js +23 -0
  764. data/node_modules/semver/functions/eq.js +3 -0
  765. data/node_modules/semver/functions/gt.js +3 -0
  766. data/node_modules/semver/functions/gte.js +3 -0
  767. data/node_modules/semver/functions/inc.js +15 -0
  768. data/node_modules/semver/functions/lt.js +3 -0
  769. data/node_modules/semver/functions/lte.js +3 -0
  770. data/node_modules/semver/functions/major.js +3 -0
  771. data/node_modules/semver/functions/minor.js +3 -0
  772. data/node_modules/semver/functions/neq.js +3 -0
  773. data/node_modules/semver/functions/parse.js +33 -0
  774. data/node_modules/semver/functions/patch.js +3 -0
  775. data/node_modules/semver/functions/prerelease.js +6 -0
  776. data/node_modules/semver/functions/rcompare.js +3 -0
  777. data/node_modules/semver/functions/rsort.js +3 -0
  778. data/node_modules/semver/functions/satisfies.js +10 -0
  779. data/node_modules/semver/functions/sort.js +3 -0
  780. data/node_modules/semver/functions/valid.js +6 -0
  781. data/node_modules/semver/index.js +48 -0
  782. data/node_modules/semver/internal/constants.js +17 -0
  783. data/node_modules/semver/internal/debug.js +9 -0
  784. data/node_modules/semver/internal/identifiers.js +23 -0
  785. data/node_modules/semver/internal/parse-options.js +11 -0
  786. data/node_modules/semver/internal/re.js +182 -0
  787. data/node_modules/semver/package.json +41 -0
  788. data/node_modules/semver/preload.js +2 -0
  789. data/node_modules/semver/range.bnf +16 -0
  790. data/node_modules/semver/ranges/gtr.js +4 -0
  791. data/node_modules/semver/ranges/intersects.js +7 -0
  792. data/node_modules/semver/ranges/ltr.js +4 -0
  793. data/node_modules/semver/ranges/max-satisfying.js +25 -0
  794. data/node_modules/semver/ranges/min-satisfying.js +24 -0
  795. data/node_modules/semver/ranges/min-version.js +60 -0
  796. data/node_modules/semver/ranges/outside.js +80 -0
  797. data/node_modules/semver/ranges/simplify.js +44 -0
  798. data/node_modules/semver/ranges/subset.js +222 -0
  799. data/node_modules/semver/ranges/to-comparators.js +8 -0
  800. data/node_modules/semver/ranges/valid.js +11 -0
  801. data/node_modules/shebang-command/index.js +19 -0
  802. data/node_modules/shebang-command/license +9 -0
  803. data/node_modules/shebang-command/package.json +34 -0
  804. data/node_modules/shebang-command/readme.md +34 -0
  805. data/node_modules/shebang-regex/index.d.ts +22 -0
  806. data/node_modules/shebang-regex/index.js +2 -0
  807. data/node_modules/shebang-regex/license +9 -0
  808. data/node_modules/shebang-regex/package.json +35 -0
  809. data/node_modules/shebang-regex/readme.md +33 -0
  810. data/node_modules/simple-wcswidth/CHANGELOG.md +13 -0
  811. data/node_modules/simple-wcswidth/LICENSE +21 -0
  812. data/node_modules/simple-wcswidth/README.md +100 -0
  813. data/node_modules/simple-wcswidth/dist/index.d.ts +3 -0
  814. data/node_modules/simple-wcswidth/dist/index.js +10 -0
  815. data/node_modules/simple-wcswidth/dist/src/binary-search.d.ts +3 -0
  816. data/node_modules/simple-wcswidth/dist/src/binary-search.js +24 -0
  817. data/node_modules/simple-wcswidth/dist/src/models.d.ts +4 -0
  818. data/node_modules/simple-wcswidth/dist/src/models.js +2 -0
  819. data/node_modules/simple-wcswidth/dist/src/non-spacing-chars.d.ts +3 -0
  820. data/node_modules/simple-wcswidth/dist/src/non-spacing-chars.js +149 -0
  821. data/node_modules/simple-wcswidth/dist/src/wcswidth.d.ts +2 -0
  822. data/node_modules/simple-wcswidth/dist/src/wcswidth.js +20 -0
  823. data/node_modules/simple-wcswidth/dist/src/wcwidth.d.ts +2 -0
  824. data/node_modules/simple-wcswidth/dist/src/wcwidth.js +67 -0
  825. data/node_modules/simple-wcswidth/package.json +44 -0
  826. data/node_modules/slash/index.d.ts +25 -0
  827. data/node_modules/slash/index.js +11 -0
  828. data/node_modules/slash/license +9 -0
  829. data/node_modules/slash/package.json +35 -0
  830. data/node_modules/slash/readme.md +44 -0
  831. data/node_modules/sprintf-js/LICENSE +24 -0
  832. data/node_modules/sprintf-js/README.md +88 -0
  833. data/node_modules/sprintf-js/bower.json +14 -0
  834. data/node_modules/sprintf-js/demo/angular.html +20 -0
  835. data/node_modules/sprintf-js/dist/angular-sprintf.min.js +4 -0
  836. data/node_modules/sprintf-js/dist/angular-sprintf.min.js.map +1 -0
  837. data/node_modules/sprintf-js/dist/angular-sprintf.min.map +1 -0
  838. data/node_modules/sprintf-js/dist/sprintf.min.js +4 -0
  839. data/node_modules/sprintf-js/dist/sprintf.min.js.map +1 -0
  840. data/node_modules/sprintf-js/dist/sprintf.min.map +1 -0
  841. data/node_modules/sprintf-js/gruntfile.js +36 -0
  842. data/node_modules/sprintf-js/package.json +22 -0
  843. data/node_modules/sprintf-js/src/angular-sprintf.js +18 -0
  844. data/node_modules/sprintf-js/src/sprintf.js +208 -0
  845. data/node_modules/sprintf-js/test/test.js +82 -0
  846. data/node_modules/sqlite-parser/CHANGELOG.md +1263 -0
  847. data/node_modules/sqlite-parser/LICENSE +22 -0
  848. data/node_modules/sqlite-parser/README.md +187 -0
  849. data/node_modules/sqlite-parser/bin/sqlite-parser +7 -0
  850. data/node_modules/sqlite-parser/dist/sqlite-parser.js +19 -0
  851. data/node_modules/sqlite-parser/lib/index.js +6 -0
  852. data/node_modules/sqlite-parser/lib/parser.js +6 -0
  853. data/node_modules/sqlite-parser/lib/streaming-shim.js +6 -0
  854. data/node_modules/sqlite-parser/lib/streaming.js +6 -0
  855. data/node_modules/sqlite-parser/lib/tracer.js +6 -0
  856. data/node_modules/sqlite-parser/package.json +75 -0
  857. data/node_modules/string-width/index.d.ts +29 -0
  858. data/node_modules/string-width/index.js +47 -0
  859. data/node_modules/string-width/license +9 -0
  860. data/node_modules/string-width/package.json +56 -0
  861. data/node_modules/string-width/readme.md +50 -0
  862. data/node_modules/strip-ansi/index.d.ts +17 -0
  863. data/node_modules/strip-ansi/index.js +4 -0
  864. data/node_modules/strip-ansi/license +9 -0
  865. data/node_modules/strip-ansi/package.json +54 -0
  866. data/node_modules/strip-ansi/readme.md +46 -0
  867. data/node_modules/to-regex-range/LICENSE +21 -0
  868. data/node_modules/to-regex-range/README.md +305 -0
  869. data/node_modules/to-regex-range/index.js +288 -0
  870. data/node_modules/to-regex-range/package.json +88 -0
  871. data/node_modules/universalify/LICENSE +20 -0
  872. data/node_modules/universalify/README.md +76 -0
  873. data/node_modules/universalify/index.js +24 -0
  874. data/node_modules/universalify/package.json +34 -0
  875. data/node_modules/which/CHANGELOG.md +166 -0
  876. data/node_modules/which/LICENSE +15 -0
  877. data/node_modules/which/README.md +54 -0
  878. data/node_modules/which/bin/node-which +52 -0
  879. data/node_modules/which/package.json +43 -0
  880. data/node_modules/which/which.js +125 -0
  881. data/node_modules/wrap-ansi/index.js +216 -0
  882. data/node_modules/wrap-ansi/license +9 -0
  883. data/node_modules/wrap-ansi/package.json +62 -0
  884. data/node_modules/wrap-ansi/readme.md +91 -0
  885. data/node_modules/wrappy/LICENSE +15 -0
  886. data/node_modules/wrappy/README.md +36 -0
  887. data/node_modules/wrappy/package.json +29 -0
  888. data/node_modules/wrappy/wrappy.js +33 -0
  889. data/node_modules/y18n/CHANGELOG.md +100 -0
  890. data/node_modules/y18n/LICENSE +13 -0
  891. data/node_modules/y18n/README.md +127 -0
  892. data/node_modules/y18n/build/index.cjs +203 -0
  893. data/node_modules/y18n/build/lib/cjs.js +6 -0
  894. data/node_modules/y18n/build/lib/index.js +174 -0
  895. data/node_modules/y18n/build/lib/platform-shims/node.js +19 -0
  896. data/node_modules/y18n/index.mjs +8 -0
  897. data/node_modules/y18n/package.json +70 -0
  898. data/node_modules/yallist/LICENSE +15 -0
  899. data/node_modules/yallist/README.md +204 -0
  900. data/node_modules/yallist/iterator.js +8 -0
  901. data/node_modules/yallist/package.json +29 -0
  902. data/node_modules/yallist/yallist.js +426 -0
  903. data/node_modules/yargs-parser/CHANGELOG.md +263 -0
  904. data/node_modules/yargs-parser/LICENSE.txt +14 -0
  905. data/node_modules/yargs-parser/README.md +518 -0
  906. data/node_modules/yargs-parser/browser.js +29 -0
  907. data/node_modules/yargs-parser/build/index.cjs +1042 -0
  908. data/node_modules/yargs-parser/build/lib/index.js +59 -0
  909. data/node_modules/yargs-parser/build/lib/string-utils.js +65 -0
  910. data/node_modules/yargs-parser/build/lib/tokenize-arg-string.js +40 -0
  911. data/node_modules/yargs-parser/build/lib/yargs-parser-types.js +12 -0
  912. data/node_modules/yargs-parser/build/lib/yargs-parser.js +1037 -0
  913. data/node_modules/yargs-parser/package.json +87 -0
  914. data/node_modules/yargs/CHANGELOG.md +151 -0
  915. data/node_modules/yargs/LICENSE +21 -0
  916. data/node_modules/yargs/README.md +204 -0
  917. data/node_modules/yargs/browser.mjs +7 -0
  918. data/node_modules/yargs/build/index.cjs +1 -0
  919. data/node_modules/yargs/build/lib/argsert.js +62 -0
  920. data/node_modules/yargs/build/lib/command.js +436 -0
  921. data/node_modules/yargs/build/lib/completion-templates.js +48 -0
  922. data/node_modules/yargs/build/lib/completion.js +166 -0
  923. data/node_modules/yargs/build/lib/middleware.js +85 -0
  924. data/node_modules/yargs/build/lib/parse-command.js +32 -0
  925. data/node_modules/yargs/build/lib/typings/common-types.js +9 -0
  926. data/node_modules/yargs/build/lib/typings/yargs-parser-types.js +1 -0
  927. data/node_modules/yargs/build/lib/usage.js +567 -0
  928. data/node_modules/yargs/build/lib/utils/apply-extends.js +59 -0
  929. data/node_modules/yargs/build/lib/utils/is-promise.js +5 -0
  930. data/node_modules/yargs/build/lib/utils/levenshtein.js +26 -0
  931. data/node_modules/yargs/build/lib/utils/maybe-async-result.js +17 -0
  932. data/node_modules/yargs/build/lib/utils/obj-filter.js +10 -0
  933. data/node_modules/yargs/build/lib/utils/process-argv.js +17 -0
  934. data/node_modules/yargs/build/lib/utils/set-blocking.js +12 -0
  935. data/node_modules/yargs/build/lib/utils/which-module.js +10 -0
  936. data/node_modules/yargs/build/lib/validation.js +279 -0
  937. data/node_modules/yargs/build/lib/yargs-factory.js +1452 -0
  938. data/node_modules/yargs/build/lib/yerror.js +7 -0
  939. data/node_modules/yargs/helpers/helpers.mjs +10 -0
  940. data/node_modules/yargs/helpers/index.js +14 -0
  941. data/node_modules/yargs/helpers/package.json +3 -0
  942. data/node_modules/yargs/index.cjs +43 -0
  943. data/node_modules/yargs/index.mjs +8 -0
  944. data/node_modules/yargs/lib/platform-shims/browser.mjs +94 -0
  945. data/node_modules/yargs/lib/platform-shims/esm.mjs +67 -0
  946. data/node_modules/yargs/locales/be.json +46 -0
  947. data/node_modules/yargs/locales/de.json +46 -0
  948. data/node_modules/yargs/locales/en.json +51 -0
  949. data/node_modules/yargs/locales/es.json +46 -0
  950. data/node_modules/yargs/locales/fi.json +49 -0
  951. data/node_modules/yargs/locales/fr.json +53 -0
  952. data/node_modules/yargs/locales/hi.json +49 -0
  953. data/node_modules/yargs/locales/hu.json +46 -0
  954. data/node_modules/yargs/locales/id.json +50 -0
  955. data/node_modules/yargs/locales/it.json +46 -0
  956. data/node_modules/yargs/locales/ja.json +51 -0
  957. data/node_modules/yargs/locales/ko.json +49 -0
  958. data/node_modules/yargs/locales/nb.json +44 -0
  959. data/node_modules/yargs/locales/nl.json +49 -0
  960. data/node_modules/yargs/locales/nn.json +44 -0
  961. data/node_modules/yargs/locales/pirate.json +13 -0
  962. data/node_modules/yargs/locales/pl.json +49 -0
  963. data/node_modules/yargs/locales/pt.json +45 -0
  964. data/node_modules/yargs/locales/pt_BR.json +48 -0
  965. data/node_modules/yargs/locales/ru.json +46 -0
  966. data/node_modules/yargs/locales/th.json +46 -0
  967. data/node_modules/yargs/locales/tr.json +48 -0
  968. data/node_modules/yargs/locales/uk_UA.json +51 -0
  969. data/node_modules/yargs/locales/zh_CN.json +48 -0
  970. data/node_modules/yargs/locales/zh_TW.json +47 -0
  971. data/node_modules/yargs/package.json +116 -0
  972. data/node_modules/yargs/yargs +9 -0
  973. data/package.json +1 -1
  974. data/spec/depends/api_spec.rb +184 -0
  975. data/spec/depends/spec_helper.rb +27 -0
  976. data/spec/fixtures/depends/.gitignore +2 -0
  977. data/spec/fixtures/depends/app/controllers/api/api_keys_controller.rb +2 -0
  978. data/spec/fixtures/depends/app/controllers/organizations_controller.rb +2 -0
  979. data/spec/fixtures/depends/app/models/api_key.rb +2 -0
  980. data/spec/fixtures/depends/app/models/configuration.rb +2 -0
  981. data/spec/fixtures/depends/app/models/show.rb +2 -0
  982. data/spec/fixtures/depends/app/models/user.rb +2 -0
  983. data/spec/fixtures/depends/revoke_api_key.appmap.json +901 -0
  984. data/spec/fixtures/depends/spec/actual_rspec_test.rb +7 -0
  985. data/spec/fixtures/depends/spec/api_spec.rb +2 -0
  986. data/spec/fixtures/depends/spec/user_spec.rb +2 -0
  987. data/spec/fixtures/depends/test/actual_minitest_test.rb +5 -0
  988. data/spec/fixtures/depends/user_page_scenario.appmap.json +1776 -0
  989. data/spec/fixtures/rails5_users_app/create_app +3 -3
  990. data/spec/fixtures/rails6_users_app/create_app +3 -3
  991. data/spec/fixtures/rails6_users_app/lib/tasks/appmap.rake +11 -1
  992. data/spec/service/config_analyzer_spec.rb +3 -3
  993. data/spec/service/integration_test_path_finder_spec.rb +24 -0
  994. data/test/agent_setup_status_test.rb +7 -4
  995. data/test/agent_setup_validate_test.rb +19 -2
  996. data/test/test_helper.rb +3 -0
  997. data/yarn.lock +23 -9
  998. metadata +984 -7
@@ -0,0 +1,7 @@
1
+ // Bootstrap yargs for browser:
2
+ import browserPlatformShim from './lib/platform-shims/browser.mjs';
3
+ import {YargsFactory} from './build/lib/yargs-factory.js';
4
+
5
+ const Yargs = YargsFactory(browserPlatformShim);
6
+
7
+ export default Yargs;
@@ -0,0 +1 @@
1
+ "use strict";var t=require("assert");class e extends Error{constructor(t){super(t||"yargs error"),this.name="YError",Error.captureStackTrace(this,e)}}let s,n=[];function i(t,o,a,h){s=h;let l={};if(Object.prototype.hasOwnProperty.call(t,"extends")){if("string"!=typeof t.extends)return l;const r=/\.json|\..*rc$/.test(t.extends);let h=null;if(r)h=function(t,e){return s.path.resolve(t,e)}(o,t.extends);else try{h=require.resolve(t.extends)}catch(e){return t}!function(t){if(n.indexOf(t)>-1)throw new e(`Circular extended configurations: '${t}'.`)}(h),n.push(h),l=r?JSON.parse(s.readFileSync(h,"utf8")):require(t.extends),delete t.extends,l=i(l,s.path.dirname(h),a,s)}return n=[],a?r(l,t):Object.assign({},l,t)}function r(t,e){const s={};function n(t){return t&&"object"==typeof t&&!Array.isArray(t)}Object.assign(s,t);for(const i of Object.keys(e))n(e[i])&&n(s[i])?s[i]=r(t[i],e[i]):s[i]=e[i];return s}function o(t){const e=t.replace(/\s{2,}/g," ").split(/\s+(?![^[]*]|[^<]*>)/),s=/\.*[\][<>]/g,n=e.shift();if(!n)throw new Error(`No command found in: ${t}`);const i={cmd:n.replace(s,""),demanded:[],optional:[]};return e.forEach(((t,n)=>{let r=!1;t=t.replace(/\s/g,""),/\.+[\]>]/.test(t)&&n===e.length-1&&(r=!0),/^\[/.test(t)?i.optional.push({cmd:t.replace(s,"").split("|"),variadic:r}):i.demanded.push({cmd:t.replace(s,"").split("|"),variadic:r})})),i}const a=["first","second","third","fourth","fifth","sixth"];function h(t,s,n){try{let i=0;const[r,a,h]="object"==typeof t?[{demanded:[],optional:[]},t,s]:[o(`cmd ${t}`),s,n],d=[].slice.call(a);for(;d.length&&void 0===d[d.length-1];)d.pop();const u=h||d.length;if(u<r.demanded.length)throw new e(`Not enough arguments provided. Expected ${r.demanded.length} but received ${d.length}.`);const p=r.demanded.length+r.optional.length;if(u>p)throw new e(`Too many arguments provided. Expected max ${p} but received ${u}.`);r.demanded.forEach((t=>{const e=l(d.shift());0===t.cmd.filter((t=>t===e||"*"===t)).length&&c(e,t.cmd,i),i+=1})),r.optional.forEach((t=>{if(0===d.length)return;const e=l(d.shift());0===t.cmd.filter((t=>t===e||"*"===t)).length&&c(e,t.cmd,i),i+=1}))}catch(t){console.warn(t.stack)}}function l(t){return Array.isArray(t)?"array":null===t?"null":typeof t}function c(t,s,n){throw new e(`Invalid ${a[n]||"manyith"} argument. Expected ${s.join(" or ")} but received ${t}.`)}function d(t){return!!t&&!!t.then&&"function"==typeof t.then}function u(t,e,s,n){s.assert.notStrictEqual(t,e,n)}function p(t,e){e.assert.strictEqual(typeof t,"string")}function g(t){return Object.keys(t)}function m(t={},e=(()=>!0)){const s={};return g(t).forEach((n=>{e(n,t[n])&&(s[n]=t[n])})),s}function f(){return process.versions.electron&&!process.defaultApp?0:1}function y(){return process.argv[f()]}var b=Object.freeze({__proto__:null,hideBin:function(t){return t.slice(f()+1)},getProcessArgvBin:y});function O(t,e,s,n){if("a"===s&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===s?n:"a"===s?n.call(t):n?n.value:e.get(t)}function v(t,e,s,n,i){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?i.call(t,s):i?i.value=s:e.set(t,s),s}class w{constructor(t){this.globalMiddleware=[],this.frozens=[],this.yargs=t}addMiddleware(t,e,s=!0){if(h("<array|function> [boolean] [boolean]",[t,e,s],arguments.length),Array.isArray(t)){for(let n=0;n<t.length;n++){if("function"!=typeof t[n])throw Error("middleware must be a function");const i=t[n];i.applyBeforeValidation=e,i.global=s}Array.prototype.push.apply(this.globalMiddleware,t)}else if("function"==typeof t){const n=t;n.applyBeforeValidation=e,n.global=s,this.globalMiddleware.push(t)}return this.yargs}addCoerceMiddleware(t,e){const s=this.yargs.getAliases();return this.globalMiddleware=this.globalMiddleware.filter((t=>{const n=[...s[e]||[],e];return!t.option||!n.includes(t.option)})),t.option=e,this.addMiddleware(t,!0,!0)}getMiddleware(){return this.globalMiddleware}freeze(){this.frozens.push([...this.globalMiddleware])}unfreeze(){const t=this.frozens.pop();void 0!==t&&(this.globalMiddleware=t)}reset(){this.globalMiddleware=this.globalMiddleware.filter((t=>t.global))}}function C(t,e,s,n){return s.reduce(((t,s)=>{if(s.applyBeforeValidation!==n)return t;if(d(t))return t.then((t=>Promise.all([t,s(t,e)]))).then((([t,e])=>Object.assign(t,e)));{const n=s(t,e);return d(n)?n.then((e=>Object.assign(t,e))):Object.assign(t,n)}}),t)}function j(t,e,s=(t=>{throw t})){try{const s="function"==typeof t?t():t;return d(s)?s.then((t=>e(t))):e(s)}catch(t){return s(t)}}const x=/(^\*)|(^\$0)/;class _{constructor(t,e,s,n){this.requireCache=new Set,this.handlers={},this.aliasMap={},this.frozens=[],this.shim=n,this.usage=t,this.globalMiddleware=s,this.validation=e}addDirectory(t,e,s,n){"boolean"!=typeof(n=n||{}).recurse&&(n.recurse=!1),Array.isArray(n.extensions)||(n.extensions=["js"]);const i="function"==typeof n.visit?n.visit:t=>t;n.visit=(t,e,s)=>{const n=i(t,e,s);if(n){if(this.requireCache.has(e))return n;this.requireCache.add(e),this.addHandler(n)}return n},this.shim.requireDirectory({require:e,filename:s},t,n)}addHandler(t,e,s,n,i,r){let a=[];const h=function(t){return t?t.map((t=>(t.applyBeforeValidation=!1,t))):[]}(i);if(n=n||(()=>{}),Array.isArray(t))if(function(t){return t.every((t=>"string"==typeof t))}(t))[t,...a]=t;else for(const e of t)this.addHandler(e);else{if(function(t){return"object"==typeof t&&!Array.isArray(t)}(t)){let e=Array.isArray(t.command)||"string"==typeof t.command?t.command:this.moduleName(t);return t.aliases&&(e=[].concat(e).concat(t.aliases)),void this.addHandler(e,this.extractDesc(t),t.builder,t.handler,t.middlewares,t.deprecated)}if(M(s))return void this.addHandler([t].concat(a),e,s.builder,s.handler,s.middlewares,s.deprecated)}if("string"==typeof t){const i=o(t);a=a.map((t=>o(t).cmd));let l=!1;const c=[i.cmd].concat(a).filter((t=>!x.test(t)||(l=!0,!1)));0===c.length&&l&&c.push("$0"),l&&(i.cmd=c[0],a=c.slice(1),t=t.replace(x,i.cmd)),a.forEach((t=>{this.aliasMap[t]=i.cmd})),!1!==e&&this.usage.command(t,e,l,a,r),this.handlers[i.cmd]={original:t,description:e,handler:n,builder:s||{},middlewares:h,deprecated:r,demanded:i.demanded,optional:i.optional},l&&(this.defaultCommand=this.handlers[i.cmd])}}getCommandHandlers(){return this.handlers}getCommands(){return Object.keys(this.handlers).concat(Object.keys(this.aliasMap))}hasDefaultCommand(){return!!this.defaultCommand}runCommand(t,e,s,n,i,r){const o=this.handlers[t]||this.handlers[this.aliasMap[t]]||this.defaultCommand,a=e.getInternalMethods().getContext(),h=a.commands.slice(),l=!t;t&&(a.commands.push(t),a.fullCommands.push(o.original));const c=this.applyBuilderUpdateUsageAndParse(l,o,e,s.aliases,h,n,i,r);return d(c)?c.then((t=>this.applyMiddlewareAndGetResult(l,o,t.innerArgv,a,i,t.aliases,e))):this.applyMiddlewareAndGetResult(l,o,c.innerArgv,a,i,c.aliases,e)}applyBuilderUpdateUsageAndParse(t,e,s,n,i,r,o,a){const h=e.builder;let l=s;if(k(h)){const c=h(s.getInternalMethods().reset(n),a);if(d(c))return c.then((n=>{var a;return l=(a=n)&&"function"==typeof a.getInternalMethods?n:s,this.parseAndUpdateUsage(t,e,l,i,r,o)}))}else(function(t){return"object"==typeof t})(h)&&(l=s.getInternalMethods().reset(n),Object.keys(e.builder).forEach((t=>{l.option(t,h[t])})));return this.parseAndUpdateUsage(t,e,l,i,r,o)}parseAndUpdateUsage(t,e,s,n,i,r){t&&s.getInternalMethods().getUsageInstance().unfreeze(),this.shouldUpdateUsage(s)&&s.getInternalMethods().getUsageInstance().usage(this.usageFromParentCommandsCommandHandler(n,e),e.description);const o=s.getInternalMethods().runYargsParserAndExecuteCommands(null,void 0,!0,i,r);return d(o)?o.then((t=>({aliases:s.parsed.aliases,innerArgv:t}))):{aliases:s.parsed.aliases,innerArgv:o}}shouldUpdateUsage(t){return!t.getInternalMethods().getUsageInstance().getUsageDisabled()&&0===t.getInternalMethods().getUsageInstance().getUsage().length}usageFromParentCommandsCommandHandler(t,e){const s=x.test(e.original)?e.original.replace(x,"").trim():e.original,n=t.filter((t=>!x.test(t)));return n.push(s),`$0 ${n.join(" ")}`}applyMiddlewareAndGetResult(t,e,s,n,i,r,o){let a={};if(i)return s;o.getInternalMethods().getHasOutput()||(a=this.populatePositionals(e,s,n,o));const h=this.globalMiddleware.getMiddleware().slice(0).concat(e.middlewares);if(s=C(s,o,h,!0),!o.getInternalMethods().getHasOutput()){const e=o.getInternalMethods().runValidation(r,a,o.parsed.error,t);s=j(s,(t=>(e(t),t)))}if(e.handler&&!o.getInternalMethods().getHasOutput()){o.getInternalMethods().setHasOutput();const n=!!o.getOptions().configuration["populate--"];o.getInternalMethods().postProcess(s,n,!1,!1),s=j(s=C(s,o,h,!1),(t=>{const s=e.handler(t);return d(s)?s.then((()=>t)):t})),t||o.getInternalMethods().getUsageInstance().cacheHelpMessage(),d(s)&&!o.getInternalMethods().hasParseCallback()&&s.catch((t=>{try{o.getInternalMethods().getUsageInstance().fail(null,t)}catch(t){}}))}return t||(n.commands.pop(),n.fullCommands.pop()),s}populatePositionals(t,e,s,n){e._=e._.slice(s.commands.length);const i=t.demanded.slice(0),r=t.optional.slice(0),o={};for(this.validation.positionalCount(i.length,e._.length);i.length;){const t=i.shift();this.populatePositional(t,e,o)}for(;r.length;){const t=r.shift();this.populatePositional(t,e,o)}return e._=s.commands.concat(e._.map((t=>""+t))),this.postProcessPositionals(e,o,this.cmdToParseOptions(t.original),n),o}populatePositional(t,e,s){const n=t.cmd[0];t.variadic?s[n]=e._.splice(0).map(String):e._.length&&(s[n]=[String(e._.shift())])}cmdToParseOptions(t){const e={array:[],default:{},alias:{},demand:{}},s=o(t);return s.demanded.forEach((t=>{const[s,...n]=t.cmd;t.variadic&&(e.array.push(s),e.default[s]=[]),e.alias[s]=n,e.demand[s]=!0})),s.optional.forEach((t=>{const[s,...n]=t.cmd;t.variadic&&(e.array.push(s),e.default[s]=[]),e.alias[s]=n})),e}postProcessPositionals(t,e,s,n){const i=Object.assign({},n.getOptions());i.default=Object.assign(s.default,i.default);for(const t of Object.keys(s.alias))i.alias[t]=(i.alias[t]||[]).concat(s.alias[t]);i.array=i.array.concat(s.array),i.config={};const r=[];if(Object.keys(e).forEach((t=>{e[t].map((e=>{i.configuration["unknown-options-as-args"]&&(i.key[t]=!0),r.push(`--${t}`),r.push(e)}))})),!r.length)return;const o=Object.assign({},i.configuration,{"populate--":!1}),a=this.shim.Parser.detailed(r,Object.assign({},i,{configuration:o}));if(a.error)n.getInternalMethods().getUsageInstance().fail(a.error.message,a.error);else{const s=Object.keys(e);Object.keys(e).forEach((t=>{s.push(...a.aliases[t])})),Object.keys(a.argv).forEach((n=>{-1!==s.indexOf(n)&&(e[n]||(e[n]=a.argv[n]),t[n]=a.argv[n])}))}}runDefaultBuilderOn(t){if(!this.defaultCommand)return;if(this.shouldUpdateUsage(t)){const e=x.test(this.defaultCommand.original)?this.defaultCommand.original:this.defaultCommand.original.replace(/^[^[\]<>]*/,"$0 ");t.getInternalMethods().getUsageInstance().usage(e,this.defaultCommand.description)}const e=this.defaultCommand.builder;if(k(e))return e(t,!0);M(e)||Object.keys(e).forEach((s=>{t.option(s,e[s])}))}moduleName(t){const e=function(t){if("undefined"==typeof require)return null;for(let e,s=0,n=Object.keys(require.cache);s<n.length;s++)if(e=require.cache[n[s]],e.exports===t)return e;return null}(t);if(!e)throw new Error(`No command name given for module: ${this.shim.inspect(t)}`);return this.commandFromFilename(e.filename)}commandFromFilename(t){return this.shim.path.basename(t,this.shim.path.extname(t))}extractDesc({describe:t,description:e,desc:s}){for(const n of[t,e,s]){if("string"==typeof n||!1===n)return n;u(n,!0,this.shim)}return!1}freeze(){this.frozens.push({handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand})}unfreeze(){const t=this.frozens.pop();u(t,void 0,this.shim),({handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand}=t)}reset(){return this.handlers={},this.aliasMap={},this.defaultCommand=void 0,this.requireCache=new Set,this}}function M(t){return"object"==typeof t&&!!t.builder&&"function"==typeof t.handler}function k(t){return"function"==typeof t}function E(t){"undefined"!=typeof process&&[process.stdout,process.stderr].forEach((e=>{const s=e;s._handle&&s.isTTY&&"function"==typeof s._handle.setBlocking&&s._handle.setBlocking(t)}))}function S(t){return"boolean"==typeof t}function $(t,s){const n=s.y18n.__,i={},r=[];i.failFn=function(t){r.push(t)};let o=null,a=!0;i.showHelpOnFail=function(t=!0,e){const[s,n]="string"==typeof t?[!0,t]:[t,e];return o=n,a=s,i};let h=!1;i.fail=function(s,n){const l=t.getInternalMethods().getLoggerInstance();if(!r.length){if(t.getExitProcess()&&E(!0),h||(h=!0,a&&(t.showHelp("error"),l.error()),(s||n)&&l.error(s||n),o&&((s||n)&&l.error(""),l.error(o))),n=n||new e(s),t.getExitProcess())return t.exit(1);if(t.getInternalMethods().hasParseCallback())return t.exit(1,n);throw n}for(let t=r.length-1;t>=0;--t){const e=r[t];if(S(e)){if(n)throw n;if(s)throw Error(s)}else e(s,n,i)}};let l=[],c=!1;i.usage=(t,e)=>null===t?(c=!0,l=[],i):(c=!1,l.push([t,e||""]),i),i.getUsage=()=>l,i.getUsageDisabled=()=>c,i.getPositionalGroupName=()=>n("Positionals:");let d=[];i.example=(t,e)=>{d.push([t,e||""])};let u=[];i.command=function(t,e,s,n,i=!1){s&&(u=u.map((t=>(t[2]=!1,t)))),u.push([t,e||"",s,n,i])},i.getCommands=()=>u;let p={};i.describe=function(t,e){Array.isArray(t)?t.forEach((t=>{i.describe(t,e)})):"object"==typeof t?Object.keys(t).forEach((e=>{i.describe(e,t[e])})):p[t]=e},i.getDescriptions=()=>p;let g=[];i.epilog=t=>{g.push(t)};let f,y=!1;function b(){return y||(f=function(){const t=80;return s.process.stdColumns?Math.min(t,s.process.stdColumns):t}(),y=!0),f}i.wrap=t=>{y=!0,f=t};const O="__yargsString__:";function v(t,e,n){let i=0;return Array.isArray(t)||(t=Object.values(t).map((t=>[t]))),t.forEach((t=>{i=Math.max(s.stringWidth(n?`${n} ${I(t[0])}`:I(t[0]))+A(t[0]),i)})),e&&(i=Math.min(i,parseInt((.5*e).toString(),10))),i}let w;function C(e){return t.getOptions().hiddenOptions.indexOf(e)<0||t.parsed.argv[t.getOptions().showHiddenOpt]}function j(t,e){let s=`[${n("default:")} `;if(void 0===t&&!e)return null;if(e)s+=e;else switch(typeof t){case"string":s+=`"${t}"`;break;case"object":s+=JSON.stringify(t);break;default:s+=t}return`${s}]`}i.deferY18nLookup=t=>O+t,i.help=function(){if(w)return w;!function(){const e=t.getDemandedOptions(),s=t.getOptions();(Object.keys(s.alias)||[]).forEach((n=>{s.alias[n].forEach((r=>{p[r]&&i.describe(n,p[r]),r in e&&t.demandOption(n,e[r]),~s.boolean.indexOf(r)&&t.boolean(n),~s.count.indexOf(r)&&t.count(n),~s.string.indexOf(r)&&t.string(n),~s.normalize.indexOf(r)&&t.normalize(n),~s.array.indexOf(r)&&t.array(n),~s.number.indexOf(r)&&t.number(n)}))}))}();const e=t.customScriptName?t.$0:s.path.basename(t.$0),r=t.getDemandedOptions(),o=t.getDemandedCommands(),a=t.getDeprecatedOptions(),h=t.getGroups(),m=t.getOptions();let f=[];f=f.concat(Object.keys(p)),f=f.concat(Object.keys(r)),f=f.concat(Object.keys(o)),f=f.concat(Object.keys(m.default)),f=f.filter(C),f=Object.keys(f.reduce(((t,e)=>("_"!==e&&(t[e]=!0),t)),{}));const y=b(),x=s.cliui({width:y,wrap:!!y});if(!c)if(l.length)l.forEach((t=>{x.div(`${t[0].replace(/\$0/g,e)}`),t[1]&&x.div({text:`${t[1]}`,padding:[1,0,0,0]})})),x.div();else if(u.length){let t=null;t=o._?`${e} <${n("command")}>\n`:`${e} [${n("command")}]\n`,x.div(`${t}`)}if(u.length>1||1===u.length&&!u[0][2]){x.div(n("Commands:"));const s=t.getInternalMethods().getContext(),i=s.commands.length?`${s.commands.join(" ")} `:"";!0===t.getInternalMethods().getParserConfiguration()["sort-commands"]&&(u=u.sort(((t,e)=>t[0].localeCompare(e[0])))),u.forEach((t=>{const s=`${e} ${i}${t[0].replace(/^\$0 ?/,"")}`;x.span({text:s,padding:[0,2,0,2],width:v(u,y,`${e}${i}`)+4},{text:t[1]});const r=[];t[2]&&r.push(`[${n("default")}]`),t[3]&&t[3].length&&r.push(`[${n("aliases:")} ${t[3].join(", ")}]`),t[4]&&("string"==typeof t[4]?r.push(`[${n("deprecated: %s",t[4])}]`):r.push(`[${n("deprecated")}]`)),r.length?x.div({text:r.join(" "),padding:[0,0,0,2],align:"right"}):x.div()})),x.div()}const _=(Object.keys(m.alias)||[]).concat(Object.keys(t.parsed.newAliases)||[]);f=f.filter((e=>!t.parsed.newAliases[e]&&_.every((t=>-1===(m.alias[t]||[]).indexOf(e)))));const M=n("Options:");h[M]||(h[M]=[]),function(t,e,s,n){let i=[],r=null;Object.keys(s).forEach((t=>{i=i.concat(s[t])})),t.forEach((t=>{r=[t].concat(e[t]),r.some((t=>-1!==i.indexOf(t)))||s[n].push(t)}))}(f,m.alias,h,M);const k=t=>/^--/.test(I(t)),E=Object.keys(h).filter((t=>h[t].length>0)).map((t=>({groupName:t,normalizedKeys:h[t].filter(C).map((t=>{if(~_.indexOf(t))return t;for(let e,s=0;void 0!==(e=_[s]);s++)if(~(m.alias[e]||[]).indexOf(t))return e;return t}))}))).filter((({normalizedKeys:t})=>t.length>0)).map((({groupName:t,normalizedKeys:e})=>{const s=e.reduce(((e,s)=>(e[s]=[s].concat(m.alias[s]||[]).map((e=>t===i.getPositionalGroupName()?e:(/^[0-9]$/.test(e)?~m.boolean.indexOf(s)?"-":"--":e.length>1?"--":"-")+e)).sort(((t,e)=>k(t)===k(e)?0:k(t)?1:-1)).join(", "),e)),{});return{groupName:t,normalizedKeys:e,switches:s}}));if(E.filter((({groupName:t})=>t!==i.getPositionalGroupName())).some((({normalizedKeys:t,switches:e})=>!t.every((t=>k(e[t])))))&&E.filter((({groupName:t})=>t!==i.getPositionalGroupName())).forEach((({normalizedKeys:t,switches:e})=>{t.forEach((t=>{var s,n;k(e[t])&&(e[t]=(s=e[t],n="-x, ".length,P(s)?{text:s.text,indentation:s.indentation+n}:{text:s,indentation:n}))}))})),E.forEach((({groupName:t,normalizedKeys:e,switches:s})=>{x.div(t),e.forEach((t=>{const e=s[t];let o=p[t]||"",h=null;~o.lastIndexOf(O)&&(o=n(o.substring(O.length))),~m.boolean.indexOf(t)&&(h=`[${n("boolean")}]`),~m.count.indexOf(t)&&(h=`[${n("count")}]`),~m.string.indexOf(t)&&(h=`[${n("string")}]`),~m.normalize.indexOf(t)&&(h=`[${n("string")}]`),~m.array.indexOf(t)&&(h=`[${n("array")}]`),~m.number.indexOf(t)&&(h=`[${n("number")}]`);const l=[t in a?(c=a[t],"string"==typeof c?`[${n("deprecated: %s",c)}]`:`[${n("deprecated")}]`):null,h,t in r?`[${n("required")}]`:null,m.choices&&m.choices[t]?`[${n("choices:")} ${i.stringifiedValues(m.choices[t])}]`:null,j(m.default[t],m.defaultDescription[t])].filter(Boolean).join(" ");var c;x.span({text:I(e),padding:[0,2,0,2+A(e)],width:v(s,y)+4},o),l?x.div({text:l,padding:[0,0,0,2],align:"right"}):x.div()})),x.div()})),d.length&&(x.div(n("Examples:")),d.forEach((t=>{t[0]=t[0].replace(/\$0/g,e)})),d.forEach((t=>{""===t[1]?x.div({text:t[0],padding:[0,2,0,2]}):x.div({text:t[0],padding:[0,2,0,2],width:v(d,y)+4},{text:t[1]})})),x.div()),g.length>0){const t=g.map((t=>t.replace(/\$0/g,e))).join("\n");x.div(`${t}\n`)}return x.toString().replace(/\s*$/,"")},i.cacheHelpMessage=function(){w=this.help()},i.clearCachedHelpMessage=function(){w=void 0},i.hasCachedHelpMessage=function(){return!!w},i.showHelp=e=>{const s=t.getInternalMethods().getLoggerInstance();e||(e="error");("function"==typeof e?e:s[e])(i.help())},i.functionDescription=t=>["(",t.name?s.Parser.decamelize(t.name,"-"):n("generated-value"),")"].join(""),i.stringifiedValues=function(t,e){let s="";const n=e||", ",i=[].concat(t);return t&&i.length?(i.forEach((t=>{s.length&&(s+=n),s+=JSON.stringify(t)})),s):s};let x=null;i.version=t=>{x=t},i.showVersion=e=>{const s=t.getInternalMethods().getLoggerInstance();e||(e="error");("function"==typeof e?e:s[e])(x)},i.reset=function(t){return o=null,h=!1,l=[],c=!1,g=[],d=[],u=[],p=m(p,(e=>!t[e])),i};const _=[];return i.freeze=function(){_.push({failMessage:o,failureOutput:h,usages:l,usageDisabled:c,epilogs:g,examples:d,commands:u,descriptions:p})},i.unfreeze=function(){const t=_.pop();t&&({failMessage:o,failureOutput:h,usages:l,usageDisabled:c,epilogs:g,examples:d,commands:u,descriptions:p}=t)},i}function P(t){return"object"==typeof t}function A(t){return P(t)?t.indentation:0}function I(t){return P(t)?t.text:t}class N{constructor(t,e,s,n){var i,r,o;this.yargs=t,this.usage=e,this.command=s,this.shim=n,this.completionKey="get-yargs-completions",this.aliases=null,this.customCompletionFunction=null,this.zshShell=null!==(o=(null===(i=this.shim.getEnv("SHELL"))||void 0===i?void 0:i.includes("zsh"))||(null===(r=this.shim.getEnv("ZSH_NAME"))||void 0===r?void 0:r.includes("zsh")))&&void 0!==o&&o}defaultCompletion(t,e,s,n){const i=this.command.getCommandHandlers();for(let e=0,s=t.length;e<s;++e)if(i[t[e]]&&i[t[e]].builder){const s=i[t[e]].builder;if(k(s)){const t=this.yargs.getInternalMethods().reset();return s(t,!0),t.argv}}const r=[];this.commandCompletions(r,t,s),this.optionCompletions(r,t,e,s),n(null,r)}commandCompletions(t,e,s){const n=this.yargs.getInternalMethods().getContext().commands;s.match(/^-/)||n[n.length-1]===s||this.usage.getCommands().forEach((s=>{const n=o(s[0]).cmd;if(-1===e.indexOf(n))if(this.zshShell){const e=s[1]||"";t.push(n.replace(/:/g,"\\:")+":"+e)}else t.push(n)}))}optionCompletions(t,e,s,n){if(n.match(/^-/)||""===n&&0===t.length){const i=this.yargs.getOptions(),r=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[];Object.keys(i.key).forEach((o=>{const a=!!i.configuration["boolean-negation"]&&i.boolean.includes(o);r.includes(o)||this.argsContainKey(e,s,o,a)||(this.completeOptionKey(o,t,n),a&&i.default[o]&&this.completeOptionKey(`no-${o}`,t,n))}))}}argsContainKey(t,e,s,n){if(-1!==t.indexOf(`--${s}`))return!0;if(n&&-1!==t.indexOf(`--no-${s}`))return!0;if(this.aliases)for(const t of this.aliases[s])if(void 0!==e[t])return!0;return!1}completeOptionKey(t,e,s){const n=this.usage.getDescriptions(),i=!/^--/.test(s)&&(t=>/^[^0-9]$/.test(t))(t)?"-":"--";if(this.zshShell){const s=n[t]||"";e.push(i+`${t.replace(/:/g,"\\:")}:${s.replace("__yargsString__:","")}`)}else e.push(i+t)}customCompletion(t,e,s,n){if(u(this.customCompletionFunction,null,this.shim),this.customCompletionFunction.length<3){const t=this.customCompletionFunction(s,e);return d(t)?t.then((t=>{this.shim.process.nextTick((()=>{n(null,t)}))})).catch((t=>{this.shim.process.nextTick((()=>{n(t,void 0)}))})):n(null,t)}return function(t){return t.length>3}(this.customCompletionFunction)?this.customCompletionFunction(s,e,((i=n)=>this.defaultCompletion(t,e,s,i)),(t=>{n(null,t)})):this.customCompletionFunction(s,e,(t=>{n(null,t)}))}getCompletion(t,e){const s=t.length?t[t.length-1]:"",n=this.yargs.parse(t,!0),i=this.customCompletionFunction?n=>this.customCompletion(t,n,s,e):n=>this.defaultCompletion(t,n,s,e);return d(n)?n.then(i):i(n)}generateCompletionScript(t,e){let s=this.zshShell?'#compdef {{app_name}}\n###-begin-{{app_name}}-completions-###\n#\n# yargs command completion script\n#\n# Installation: {{app_path}} {{completion_command}} >> ~/.zshrc\n# or {{app_path}} {{completion_command}} >> ~/.zsh_profile on OSX.\n#\n_{{app_name}}_yargs_completions()\n{\n local reply\n local si=$IFS\n IFS=$\'\n\' reply=($(COMP_CWORD="$((CURRENT-1))" COMP_LINE="$BUFFER" COMP_POINT="$CURSOR" {{app_path}} --get-yargs-completions "${words[@]}"))\n IFS=$si\n _describe \'values\' reply\n}\ncompdef _{{app_name}}_yargs_completions {{app_name}}\n###-end-{{app_name}}-completions-###\n':'###-begin-{{app_name}}-completions-###\n#\n# yargs command completion script\n#\n# Installation: {{app_path}} {{completion_command}} >> ~/.bashrc\n# or {{app_path}} {{completion_command}} >> ~/.bash_profile on OSX.\n#\n_{{app_name}}_yargs_completions()\n{\n local cur_word args type_list\n\n cur_word="${COMP_WORDS[COMP_CWORD]}"\n args=("${COMP_WORDS[@]}")\n\n # ask yargs to generate completions.\n type_list=$({{app_path}} --get-yargs-completions "${args[@]}")\n\n COMPREPLY=( $(compgen -W "${type_list}" -- ${cur_word}) )\n\n # if no match was found, fall back to filename completion\n if [ ${#COMPREPLY[@]} -eq 0 ]; then\n COMPREPLY=()\n fi\n\n return 0\n}\ncomplete -o default -F _{{app_name}}_yargs_completions {{app_name}}\n###-end-{{app_name}}-completions-###\n';const n=this.shim.path.basename(t);return t.match(/\.js$/)&&(t=`./${t}`),s=s.replace(/{{app_name}}/g,n),s=s.replace(/{{completion_command}}/g,e),s.replace(/{{app_path}}/g,t)}registerFunction(t){this.customCompletionFunction=t}setParsed(t){this.aliases=t.aliases}}function D(t,e){if(0===t.length)return e.length;if(0===e.length)return t.length;const s=[];let n,i;for(n=0;n<=e.length;n++)s[n]=[n];for(i=0;i<=t.length;i++)s[0][i]=i;for(n=1;n<=e.length;n++)for(i=1;i<=t.length;i++)e.charAt(n-1)===t.charAt(i-1)?s[n][i]=s[n-1][i-1]:s[n][i]=Math.min(s[n-1][i-1]+1,Math.min(s[n][i-1]+1,s[n-1][i]+1));return s[e.length][t.length]}const z=["$0","--","_"];var q,H,F,U,W,L,V,R,T,G,B,K,Y,J,Z,X,Q,tt,et,st,nt,it,rt,ot,at,ht,lt,ct,dt,ut,pt,gt;const mt=Symbol("copyDoubleDash"),ft=Symbol("copyDoubleDash"),yt=Symbol("deleteFromParserHintObject"),bt=Symbol("freeze"),Ot=Symbol("getDollarZero"),vt=Symbol("getParserConfiguration"),wt=Symbol("guessLocale"),Ct=Symbol("guessVersion"),jt=Symbol("parsePositionalNumbers"),xt=Symbol("pkgUp"),_t=Symbol("populateParserHintArray"),Mt=Symbol("populateParserHintSingleValueDictionary"),kt=Symbol("populateParserHintArrayDictionary"),Et=Symbol("populateParserHintDictionary"),St=Symbol("sanitizeKey"),$t=Symbol("setKey"),Pt=Symbol("unfreeze"),At=Symbol("validateAsync"),It=Symbol("getCommandInstance"),Nt=Symbol("getContext"),Dt=Symbol("getHasOutput"),zt=Symbol("getLoggerInstance"),qt=Symbol("getParseContext"),Ht=Symbol("getUsageInstance"),Ft=Symbol("getValidationInstance"),Ut=Symbol("hasParseCallback"),Wt=Symbol("postProcess"),Lt=Symbol("rebase"),Vt=Symbol("reset"),Rt=Symbol("runYargsParserAndExecuteCommands"),Tt=Symbol("runValidation"),Gt=Symbol("setHasOutput");class Bt{constructor(t=[],e,s,n){this.customScriptName=!1,this.parsed=!1,q.set(this,void 0),H.set(this,void 0),F.set(this,{commands:[],fullCommands:[]}),U.set(this,null),W.set(this,null),L.set(this,"show-hidden"),V.set(this,null),R.set(this,!0),T.set(this,!0),G.set(this,[]),B.set(this,void 0),K.set(this,{}),Y.set(this,!1),J.set(this,null),Z.set(this,void 0),X.set(this,""),Q.set(this,void 0),tt.set(this,void 0),et.set(this,{}),st.set(this,null),nt.set(this,null),it.set(this,{}),rt.set(this,{}),ot.set(this,void 0),at.set(this,!1),ht.set(this,void 0),lt.set(this,!1),ct.set(this,!1),dt.set(this,!1),ut.set(this,void 0),pt.set(this,null),gt.set(this,void 0),v(this,ht,n),v(this,ot,t),v(this,H,e),v(this,tt,s),v(this,B,new w(this)),this.$0=this[Ot](),this[Vt](),v(this,q,O(this,q)),v(this,ut,O(this,ut)),v(this,gt,O(this,gt)),v(this,Q,O(this,Q)),O(this,Q).showHiddenOpt=O(this,L),v(this,Z,this[ft]())}addHelpOpt(t,e){return h("[string|boolean] [string]",[t,e],arguments.length),O(this,J)&&(this[yt](O(this,J)),v(this,J,null)),!1===t&&void 0===e||(v(this,J,"string"==typeof t?t:"help"),this.boolean(O(this,J)),this.describe(O(this,J),e||O(this,ut).deferY18nLookup("Show help"))),this}help(t,e){return this.addHelpOpt(t,e)}addShowHiddenOpt(t,e){if(h("[string|boolean] [string]",[t,e],arguments.length),!1===t&&void 0===e)return this;const s="string"==typeof t?t:O(this,L);return this.boolean(s),this.describe(s,e||O(this,ut).deferY18nLookup("Show hidden options")),O(this,Q).showHiddenOpt=s,this}showHidden(t,e){return this.addShowHiddenOpt(t,e)}alias(t,e){return h("<object|string|array> [string|array]",[t,e],arguments.length),this[kt](this.alias.bind(this),"alias",t,e),this}array(t){return h("<array|string>",[t],arguments.length),this[_t]("array",t),this}boolean(t){return h("<array|string>",[t],arguments.length),this[_t]("boolean",t),this}check(t,e){return h("<function> [boolean]",[t,e],arguments.length),this.middleware(((e,s)=>j((()=>t(e)),(s=>(s?("string"==typeof s||s instanceof Error)&&O(this,ut).fail(s.toString(),s):O(this,ut).fail(O(this,ht).y18n.__("Argument check failed: %s",t.toString())),e)),(t=>(O(this,ut).fail(t.message?t.message:t.toString(),t),e)))),!1,e),this}choices(t,e){return h("<object|string|array> [string|array]",[t,e],arguments.length),this[kt](this.choices.bind(this),"choices",t,e),this}coerce(t,s){if(h("<object|string|array> [function]",[t,s],arguments.length),Array.isArray(t)){if(!s)throw new e("coerce callback must be provided");for(const e of t)this.coerce(e,s);return this}if("object"==typeof t){for(const e of Object.keys(t))this.coerce(e,t[e]);return this}if(!s)throw new e("coerce callback must be provided");return O(this,Q).key[t]=!0,O(this,B).addCoerceMiddleware(((n,i)=>{let r;return j((()=>(r=i.getAliases(),s(n[t]))),(e=>{if(n[t]=e,r[t])for(const s of r[t])n[s]=e;return n}),(t=>{throw new e(t.message)}))}),t),this}conflicts(t,e){return h("<string|object> [string|array]",[t,e],arguments.length),O(this,gt).conflicts(t,e),this}config(t="config",e,s){return h("[object|string] [string|function] [function]",[t,e,s],arguments.length),"object"!=typeof t||Array.isArray(t)?("function"==typeof e&&(s=e,e=void 0),this.describe(t,e||O(this,ut).deferY18nLookup("Path to JSON config file")),(Array.isArray(t)?t:[t]).forEach((t=>{O(this,Q).config[t]=s||!0})),this):(t=i(t,O(this,H),this[vt]()["deep-merge-config"]||!1,O(this,ht)),O(this,Q).configObjects=(O(this,Q).configObjects||[]).concat(t),this)}completion(t,e,s){return h("[string] [string|boolean|function] [function]",[t,e,s],arguments.length),"function"==typeof e&&(s=e,e=void 0),v(this,W,t||O(this,W)||"completion"),e||!1===e||(e="generate completion script"),this.command(O(this,W),e),s&&O(this,U).registerFunction(s),this}command(t,e,s,n,i,r){return h("<string|array|object> [string|boolean] [function|object] [function] [array] [boolean|string]",[t,e,s,n,i,r],arguments.length),O(this,q).addHandler(t,e,s,n,i,r),this}commands(t,e,s,n,i,r){return this.command(t,e,s,n,i,r)}commandDir(t,e){h("<string> [object]",[t,e],arguments.length);const s=O(this,tt)||O(this,ht).require;return O(this,q).addDirectory(t,s,O(this,ht).getCallerFile(),e),this}count(t){return h("<array|string>",[t],arguments.length),this[_t]("count",t),this}default(t,e,s){return h("<object|string|array> [*] [string]",[t,e,s],arguments.length),s&&(p(t,O(this,ht)),O(this,Q).defaultDescription[t]=s),"function"==typeof e&&(p(t,O(this,ht)),O(this,Q).defaultDescription[t]||(O(this,Q).defaultDescription[t]=O(this,ut).functionDescription(e)),e=e.call()),this[Mt](this.default.bind(this),"default",t,e),this}defaults(t,e,s){return this.default(t,e,s)}demandCommand(t=1,e,s,n){return h("[number] [number|string] [string|null|undefined] [string|null|undefined]",[t,e,s,n],arguments.length),"number"!=typeof e&&(s=e,e=1/0),this.global("_",!1),O(this,Q).demandedCommands._={min:t,max:e,minMsg:s,maxMsg:n},this}demand(t,e,s){return Array.isArray(e)?(e.forEach((t=>{u(s,!0,O(this,ht)),this.demandOption(t,s)})),e=1/0):"number"!=typeof e&&(s=e,e=1/0),"number"==typeof t?(u(s,!0,O(this,ht)),this.demandCommand(t,e,s,s)):Array.isArray(t)?t.forEach((t=>{u(s,!0,O(this,ht)),this.demandOption(t,s)})):"string"==typeof s?this.demandOption(t,s):!0!==s&&void 0!==s||this.demandOption(t),this}demandOption(t,e){return h("<object|string|array> [string]",[t,e],arguments.length),this[Mt](this.demandOption.bind(this),"demandedOptions",t,e),this}deprecateOption(t,e){return h("<string> [string|boolean]",[t,e],arguments.length),O(this,Q).deprecatedOptions[t]=e,this}describe(t,e){return h("<object|string|array> [string]",[t,e],arguments.length),this[$t](t,!0),O(this,ut).describe(t,e),this}detectLocale(t){return h("<boolean>",[t],arguments.length),v(this,R,t),this}env(t){return h("[string|boolean]",[t],arguments.length),!1===t?delete O(this,Q).envPrefix:O(this,Q).envPrefix=t||"",this}epilogue(t){return h("<string>",[t],arguments.length),O(this,ut).epilog(t),this}epilog(t){return this.epilogue(t)}example(t,e){return h("<string|array> [string]",[t,e],arguments.length),Array.isArray(t)?t.forEach((t=>this.example(...t))):O(this,ut).example(t,e),this}exit(t,e){v(this,Y,!0),v(this,V,e),O(this,T)&&O(this,ht).process.exit(t)}exitProcess(t=!0){return h("[boolean]",[t],arguments.length),v(this,T,t),this}fail(t){if(h("<function|boolean>",[t],arguments.length),"boolean"==typeof t&&!1!==t)throw new e("Invalid first argument. Expected function or boolean 'false'");return O(this,ut).failFn(t),this}getAliases(){return this.parsed?this.parsed.aliases:{}}async getCompletion(t,e){return h("<array> [function]",[t,e],arguments.length),e?O(this,U).getCompletion(t,e):new Promise(((e,s)=>{O(this,U).getCompletion(t,((t,n)=>{t?s(t):e(n)}))}))}getDemandedOptions(){return h([],0),O(this,Q).demandedOptions}getDemandedCommands(){return h([],0),O(this,Q).demandedCommands}getDeprecatedOptions(){return h([],0),O(this,Q).deprecatedOptions}getDetectLocale(){return O(this,R)}getExitProcess(){return O(this,T)}getGroups(){return Object.assign({},O(this,K),O(this,rt))}getHelp(){if(v(this,Y,!0),!O(this,ut).hasCachedHelpMessage()){if(!this.parsed){const t=this[Rt](O(this,ot),void 0,void 0,0,!0);if(d(t))return t.then((()=>O(this,ut).help()))}const t=O(this,q).runDefaultBuilderOn(this);if(d(t))return t.then((()=>O(this,ut).help()))}return Promise.resolve(O(this,ut).help())}getOptions(){return O(this,Q)}getStrict(){return O(this,lt)}getStrictCommands(){return O(this,ct)}getStrictOptions(){return O(this,dt)}global(t,e){return h("<string|array> [boolean]",[t,e],arguments.length),t=[].concat(t),!1!==e?O(this,Q).local=O(this,Q).local.filter((e=>-1===t.indexOf(e))):t.forEach((t=>{-1===O(this,Q).local.indexOf(t)&&O(this,Q).local.push(t)})),this}group(t,e){h("<string|array> <string>",[t,e],arguments.length);const s=O(this,rt)[e]||O(this,K)[e];O(this,rt)[e]&&delete O(this,rt)[e];const n={};return O(this,K)[e]=(s||[]).concat(t).filter((t=>!n[t]&&(n[t]=!0))),this}hide(t){return h("<string>",[t],arguments.length),O(this,Q).hiddenOptions.push(t),this}implies(t,e){return h("<string|object> [number|string|array]",[t,e],arguments.length),O(this,gt).implies(t,e),this}locale(t){return h("[string]",[t],arguments.length),t?(v(this,R,!1),O(this,ht).y18n.setLocale(t),this):(this[wt](),O(this,ht).y18n.getLocale())}middleware(t,e,s){return O(this,B).addMiddleware(t,!!e,s)}nargs(t,e){return h("<string|object|array> [number]",[t,e],arguments.length),this[Mt](this.nargs.bind(this),"narg",t,e),this}normalize(t){return h("<array|string>",[t],arguments.length),this[_t]("normalize",t),this}number(t){return h("<array|string>",[t],arguments.length),this[_t]("number",t),this}option(t,e){if(h("<string|object> [object]",[t,e],arguments.length),"object"==typeof t)Object.keys(t).forEach((e=>{this.options(e,t[e])}));else{"object"!=typeof e&&(e={}),O(this,Q).key[t]=!0,e.alias&&this.alias(t,e.alias);const s=e.deprecate||e.deprecated;s&&this.deprecateOption(t,s);const n=e.demand||e.required||e.require;n&&this.demand(t,n),e.demandOption&&this.demandOption(t,"string"==typeof e.demandOption?e.demandOption:void 0),e.conflicts&&this.conflicts(t,e.conflicts),"default"in e&&this.default(t,e.default),void 0!==e.implies&&this.implies(t,e.implies),void 0!==e.nargs&&this.nargs(t,e.nargs),e.config&&this.config(t,e.configParser),e.normalize&&this.normalize(t),e.choices&&this.choices(t,e.choices),e.coerce&&this.coerce(t,e.coerce),e.group&&this.group(t,e.group),(e.boolean||"boolean"===e.type)&&(this.boolean(t),e.alias&&this.boolean(e.alias)),(e.array||"array"===e.type)&&(this.array(t),e.alias&&this.array(e.alias)),(e.number||"number"===e.type)&&(this.number(t),e.alias&&this.number(e.alias)),(e.string||"string"===e.type)&&(this.string(t),e.alias&&this.string(e.alias)),(e.count||"count"===e.type)&&this.count(t),"boolean"==typeof e.global&&this.global(t,e.global),e.defaultDescription&&(O(this,Q).defaultDescription[t]=e.defaultDescription),e.skipValidation&&this.skipValidation(t);const i=e.describe||e.description||e.desc;this.describe(t,i),e.hidden&&this.hide(t),e.requiresArg&&this.requiresArg(t)}return this}options(t,e){return this.option(t,e)}parse(t,e,s){h("[string|array] [function|boolean|object] [function]",[t,e,s],arguments.length),this[bt](),void 0===t&&(t=O(this,ot)),"object"==typeof e&&(v(this,nt,e),e=s),"function"==typeof e&&(v(this,st,e),e=!1),e||v(this,ot,t),O(this,st)&&v(this,T,!1);const n=this[Rt](t,!!e),i=this.parsed;return O(this,U).setParsed(this.parsed),d(n)?n.then((t=>(O(this,st)&&O(this,st).call(this,O(this,V),t,O(this,X)),t))).catch((t=>{throw O(this,st)&&O(this,st)(t,this.parsed.argv,O(this,X)),t})).finally((()=>{this[Pt](),this.parsed=i})):(O(this,st)&&O(this,st).call(this,O(this,V),n,O(this,X)),this[Pt](),this.parsed=i,n)}parseAsync(t,e,s){const n=this.parse(t,e,s);return d(n)?n:Promise.resolve(n)}parseSync(t,s,n){const i=this.parse(t,s,n);if(d(i))throw new e(".parseSync() must not be used with asynchronous builders, handlers, or middleware");return i}parserConfiguration(t){return h("<object>",[t],arguments.length),v(this,et,t),this}pkgConf(t,e){h("<string> [string]",[t,e],arguments.length);let s=null;const n=this[xt](e||O(this,H));return n[t]&&"object"==typeof n[t]&&(s=i(n[t],e||O(this,H),this[vt]()["deep-merge-config"]||!1,O(this,ht)),O(this,Q).configObjects=(O(this,Q).configObjects||[]).concat(s)),this}positional(t,e){h("<string> <object>",[t,e],arguments.length);const s=["default","defaultDescription","implies","normalize","choices","conflicts","coerce","type","describe","desc","description","alias"];e=m(e,((t,e)=>{let n=-1!==s.indexOf(t);return"type"===t&&-1===["string","number","boolean"].indexOf(e)&&(n=!1),n}));const n=O(this,F).fullCommands[O(this,F).fullCommands.length-1],i=n?O(this,q).cmdToParseOptions(n):{array:[],alias:{},default:{},demand:{}};return g(i).forEach((s=>{const n=i[s];Array.isArray(n)?-1!==n.indexOf(t)&&(e[s]=!0):n[t]&&!(s in e)&&(e[s]=n[t])})),this.group(t,O(this,ut).getPositionalGroupName()),this.option(t,e)}recommendCommands(t=!0){return h("[boolean]",[t],arguments.length),v(this,at,t),this}required(t,e,s){return this.demand(t,e,s)}require(t,e,s){return this.demand(t,e,s)}requiresArg(t){return h("<array|string|object> [number]",[t],arguments.length),"string"==typeof t&&O(this,Q).narg[t]||this[Mt](this.requiresArg.bind(this),"narg",t,NaN),this}showCompletionScript(t,e){return h("[string] [string]",[t,e],arguments.length),t=t||this.$0,O(this,Z).log(O(this,U).generateCompletionScript(t,e||O(this,W)||"completion")),this}showHelp(t){if(h("[string|function]",[t],arguments.length),v(this,Y,!0),!O(this,ut).hasCachedHelpMessage()){if(!this.parsed){const e=this[Rt](O(this,ot),void 0,void 0,0,!0);if(d(e))return e.then((()=>{O(this,ut).showHelp(t)})),this}const e=O(this,q).runDefaultBuilderOn(this);if(d(e))return e.then((()=>{O(this,ut).showHelp(t)})),this}return O(this,ut).showHelp(t),this}scriptName(t){return this.customScriptName=!0,this.$0=t,this}showHelpOnFail(t,e){return h("[boolean|string] [string]",[t,e],arguments.length),O(this,ut).showHelpOnFail(t,e),this}showVersion(t){return h("[string|function]",[t],arguments.length),O(this,ut).showVersion(t),this}skipValidation(t){return h("<array|string>",[t],arguments.length),this[_t]("skipValidation",t),this}strict(t){return h("[boolean]",[t],arguments.length),v(this,lt,!1!==t),this}strictCommands(t){return h("[boolean]",[t],arguments.length),v(this,ct,!1!==t),this}strictOptions(t){return h("[boolean]",[t],arguments.length),v(this,dt,!1!==t),this}string(t){return h("<array|string>",[t],arguments.length),this[_t]("string",t),this}terminalWidth(){return h([],0),O(this,ht).process.stdColumns}updateLocale(t){return this.updateStrings(t)}updateStrings(t){return h("<object>",[t],arguments.length),v(this,R,!1),O(this,ht).y18n.updateLocale(t),this}usage(t,s,n,i){if(h("<string|null|undefined> [string|boolean] [function|object] [function]",[t,s,n,i],arguments.length),void 0!==s){if(u(t,null,O(this,ht)),(t||"").match(/^\$0( |$)/))return this.command(t,s,n,i);throw new e(".usage() description must start with $0 if being used as alias for .command()")}return O(this,ut).usage(t),this}version(t,e,s){const n="version";if(h("[boolean|string] [string] [string]",[t,e,s],arguments.length),O(this,pt)&&(this[yt](O(this,pt)),O(this,ut).version(void 0),v(this,pt,null)),0===arguments.length)s=this[Ct](),t=n;else if(1===arguments.length){if(!1===t)return this;s=t,t=n}else 2===arguments.length&&(s=e,e=void 0);return v(this,pt,"string"==typeof t?t:n),e=e||O(this,ut).deferY18nLookup("Show version number"),O(this,ut).version(s||void 0),this.boolean(O(this,pt)),this.describe(O(this,pt),e),this}wrap(t){return h("<number|null|undefined>",[t],arguments.length),O(this,ut).wrap(t),this}[(q=new WeakMap,H=new WeakMap,F=new WeakMap,U=new WeakMap,W=new WeakMap,L=new WeakMap,V=new WeakMap,R=new WeakMap,T=new WeakMap,G=new WeakMap,B=new WeakMap,K=new WeakMap,Y=new WeakMap,J=new WeakMap,Z=new WeakMap,X=new WeakMap,Q=new WeakMap,tt=new WeakMap,et=new WeakMap,st=new WeakMap,nt=new WeakMap,it=new WeakMap,rt=new WeakMap,ot=new WeakMap,at=new WeakMap,ht=new WeakMap,lt=new WeakMap,ct=new WeakMap,dt=new WeakMap,ut=new WeakMap,pt=new WeakMap,gt=new WeakMap,mt)](t){if(!t._||!t["--"])return t;t._.push.apply(t._,t["--"]);try{delete t["--"]}catch(t){}return t}[ft](){return{log:(...t)=>{this[Ut]()||console.log(...t),v(this,Y,!0),O(this,X).length&&v(this,X,O(this,X)+"\n"),v(this,X,O(this,X)+t.join(" "))},error:(...t)=>{this[Ut]()||console.error(...t),v(this,Y,!0),O(this,X).length&&v(this,X,O(this,X)+"\n"),v(this,X,O(this,X)+t.join(" "))}}}[yt](t){g(O(this,Q)).forEach((e=>{if("configObjects"===e)return;const s=O(this,Q)[e];Array.isArray(s)?~s.indexOf(t)&&s.splice(s.indexOf(t),1):"object"==typeof s&&delete s[t]})),delete O(this,ut).getDescriptions()[t]}[bt](){O(this,G).push({options:O(this,Q),configObjects:O(this,Q).configObjects.slice(0),exitProcess:O(this,T),groups:O(this,K),strict:O(this,lt),strictCommands:O(this,ct),strictOptions:O(this,dt),completionCommand:O(this,W),output:O(this,X),exitError:O(this,V),hasOutput:O(this,Y),parsed:this.parsed,parseFn:O(this,st),parseContext:O(this,nt)}),O(this,ut).freeze(),O(this,gt).freeze(),O(this,q).freeze(),O(this,B).freeze()}[Ot](){let t,e="";return t=/\b(node|iojs|electron)(\.exe)?$/.test(O(this,ht).process.argv()[0])?O(this,ht).process.argv().slice(1,2):O(this,ht).process.argv().slice(0,1),e=t.map((t=>{const e=this[Lt](O(this,H),t);return t.match(/^(\/|([a-zA-Z]:)?\\)/)&&e.length<t.length?e:t})).join(" ").trim(),O(this,ht).getEnv("_")&&O(this,ht).getProcessArgvBin()===O(this,ht).getEnv("_")&&(e=O(this,ht).getEnv("_").replace(`${O(this,ht).path.dirname(O(this,ht).process.execPath())}/`,"")),e}[vt](){return O(this,et)}[wt](){if(!O(this,R))return;const t=O(this,ht).getEnv("LC_ALL")||O(this,ht).getEnv("LC_MESSAGES")||O(this,ht).getEnv("LANG")||O(this,ht).getEnv("LANGUAGE")||"en_US";this.locale(t.replace(/[.:].*/,""))}[Ct](){return this[xt]().version||"unknown"}[jt](t){const e=t["--"]?t["--"]:t._;for(let t,s=0;void 0!==(t=e[s]);s++)O(this,ht).Parser.looksLikeNumber(t)&&Number.isSafeInteger(Math.floor(parseFloat(`${t}`)))&&(e[s]=Number(t));return t}[xt](t){const e=t||"*";if(O(this,it)[e])return O(this,it)[e];let s={};try{let e=t||O(this,ht).mainFilename;!t&&O(this,ht).path.extname(e)&&(e=O(this,ht).path.dirname(e));const n=O(this,ht).findUp(e,((t,e)=>e.includes("package.json")?"package.json":void 0));u(n,void 0,O(this,ht)),s=JSON.parse(O(this,ht).readFileSync(n,"utf8"))}catch(t){}return O(this,it)[e]=s||{},O(this,it)[e]}[_t](t,e){(e=[].concat(e)).forEach((e=>{e=this[St](e),O(this,Q)[t].push(e)}))}[Mt](t,e,s,n){this[Et](t,e,s,n,((t,e,s)=>{O(this,Q)[t][e]=s}))}[kt](t,e,s,n){this[Et](t,e,s,n,((t,e,s)=>{O(this,Q)[t][e]=(O(this,Q)[t][e]||[]).concat(s)}))}[Et](t,e,s,n,i){if(Array.isArray(s))s.forEach((e=>{t(e,n)}));else if((t=>"object"==typeof t)(s))for(const e of g(s))t(e,s[e]);else i(e,this[St](s),n)}[St](t){return"__proto__"===t?"___proto___":t}[$t](t,e){return this[Mt](this[$t].bind(this),"key",t,e),this}[Pt](){var t,e,s,n,i,r,o,a,h,l,c,d;const p=O(this,G).pop();let g;u(p,void 0,O(this,ht)),t=this,e=this,s=this,n=this,i=this,r=this,o=this,a=this,h=this,l=this,c=this,d=this,({options:{set value(e){v(t,Q,e)}}.value,configObjects:g,exitProcess:{set value(t){v(e,T,t)}}.value,groups:{set value(t){v(s,K,t)}}.value,output:{set value(t){v(n,X,t)}}.value,exitError:{set value(t){v(i,V,t)}}.value,hasOutput:{set value(t){v(r,Y,t)}}.value,parsed:this.parsed,strict:{set value(t){v(o,lt,t)}}.value,strictCommands:{set value(t){v(a,ct,t)}}.value,strictOptions:{set value(t){v(h,dt,t)}}.value,completionCommand:{set value(t){v(l,W,t)}}.value,parseFn:{set value(t){v(c,st,t)}}.value,parseContext:{set value(t){v(d,nt,t)}}.value}=p),O(this,Q).configObjects=g,O(this,ut).unfreeze(),O(this,gt).unfreeze(),O(this,q).unfreeze(),O(this,B).unfreeze()}[At](t,e){return j(e,(e=>(t(e),e)))}getInternalMethods(){return{getCommandInstance:this[It].bind(this),getContext:this[Nt].bind(this),getHasOutput:this[Dt].bind(this),getLoggerInstance:this[zt].bind(this),getParseContext:this[qt].bind(this),getParserConfiguration:this[vt].bind(this),getUsageInstance:this[Ht].bind(this),getValidationInstance:this[Ft].bind(this),hasParseCallback:this[Ut].bind(this),postProcess:this[Wt].bind(this),reset:this[Vt].bind(this),runValidation:this[Tt].bind(this),runYargsParserAndExecuteCommands:this[Rt].bind(this),setHasOutput:this[Gt].bind(this)}}[It](){return O(this,q)}[Nt](){return O(this,F)}[Dt](){return O(this,Y)}[zt](){return O(this,Z)}[qt](){return O(this,nt)||{}}[Ht](){return O(this,ut)}[Ft](){return O(this,gt)}[Ut](){return!!O(this,st)}[Wt](t,e,s,n){if(s)return t;if(d(t))return t;e||(t=this[mt](t));return(this[vt]()["parse-positional-numbers"]||void 0===this[vt]()["parse-positional-numbers"])&&(t=this[jt](t)),n&&(t=C(t,this,O(this,B).getMiddleware(),!1)),t}[Vt](t={}){v(this,Q,O(this,Q)||{});const e={};e.local=O(this,Q).local?O(this,Q).local:[],e.configObjects=O(this,Q).configObjects?O(this,Q).configObjects:[];const s={};e.local.forEach((e=>{s[e]=!0,(t[e]||[]).forEach((t=>{s[t]=!0}))})),Object.assign(O(this,rt),Object.keys(O(this,K)).reduce(((t,e)=>{const n=O(this,K)[e].filter((t=>!(t in s)));return n.length>0&&(t[e]=n),t}),{})),v(this,K,{});return["array","boolean","string","skipValidation","count","normalize","number","hiddenOptions"].forEach((t=>{e[t]=(O(this,Q)[t]||[]).filter((t=>!s[t]))})),["narg","key","alias","default","defaultDescription","config","choices","demandedOptions","demandedCommands","deprecatedOptions"].forEach((t=>{e[t]=m(O(this,Q)[t],(t=>!s[t]))})),e.envPrefix=O(this,Q).envPrefix,v(this,Q,e),v(this,ut,O(this,ut)?O(this,ut).reset(s):$(this,O(this,ht))),v(this,gt,O(this,gt)?O(this,gt).reset(s):function(t,e,s){const n=s.y18n.__,i=s.y18n.__n,r={nonOptionCount:function(s){const n=t.getDemandedCommands(),r=s._.length+(s["--"]?s["--"].length:0)-t.getInternalMethods().getContext().commands.length;n._&&(r<n._.min||r>n._.max)&&(r<n._.min?void 0!==n._.minMsg?e.fail(n._.minMsg?n._.minMsg.replace(/\$0/g,r.toString()).replace(/\$1/,n._.min.toString()):null):e.fail(i("Not enough non-option arguments: got %s, need at least %s","Not enough non-option arguments: got %s, need at least %s",r,r.toString(),n._.min.toString())):r>n._.max&&(void 0!==n._.maxMsg?e.fail(n._.maxMsg?n._.maxMsg.replace(/\$0/g,r.toString()).replace(/\$1/,n._.max.toString()):null):e.fail(i("Too many non-option arguments: got %s, maximum of %s","Too many non-option arguments: got %s, maximum of %s",r,r.toString(),n._.max.toString()))))},positionalCount:function(t,s){s<t&&e.fail(i("Not enough non-option arguments: got %s, need at least %s","Not enough non-option arguments: got %s, need at least %s",s,s+"",t+""))},requiredArguments:function(t,s){let n=null;for(const e of Object.keys(s))Object.prototype.hasOwnProperty.call(t,e)&&void 0!==t[e]||(n=n||{},n[e]=s[e]);if(n){const t=[];for(const e of Object.keys(n)){const s=n[e];s&&t.indexOf(s)<0&&t.push(s)}const s=t.length?`\n${t.join("\n")}`:"";e.fail(i("Missing required argument: %s","Missing required arguments: %s",Object.keys(n).length,Object.keys(n).join(", ")+s))}},unknownArguments:function(s,n,o,a,h=!0){const l=t.getInternalMethods().getCommandInstance().getCommands(),c=[],d=t.getInternalMethods().getContext();Object.keys(s).forEach((e=>{-1!==z.indexOf(e)||Object.prototype.hasOwnProperty.call(o,e)||Object.prototype.hasOwnProperty.call(t.getInternalMethods().getParseContext(),e)||r.isValidAndSomeAliasIsNotNew(e,n)||c.push(e)})),h&&(d.commands.length>0||l.length>0||a)&&s._.slice(d.commands.length).forEach((t=>{-1===l.indexOf(""+t)&&c.push(""+t)})),c.length>0&&e.fail(i("Unknown argument: %s","Unknown arguments: %s",c.length,c.join(", ")))},unknownCommands:function(s){const n=t.getInternalMethods().getCommandInstance().getCommands(),r=[],o=t.getInternalMethods().getContext();return(o.commands.length>0||n.length>0)&&s._.slice(o.commands.length).forEach((t=>{-1===n.indexOf(""+t)&&r.push(""+t)})),r.length>0&&(e.fail(i("Unknown command: %s","Unknown commands: %s",r.length,r.join(", "))),!0)},isValidAndSomeAliasIsNotNew:function(e,s){if(!Object.prototype.hasOwnProperty.call(s,e))return!1;const n=t.parsed.newAliases;return[e,...s[e]].some((t=>!Object.prototype.hasOwnProperty.call(n,t)||!n[e]))},limitedChoices:function(s){const i=t.getOptions(),r={};if(!Object.keys(i.choices).length)return;Object.keys(s).forEach((t=>{-1===z.indexOf(t)&&Object.prototype.hasOwnProperty.call(i.choices,t)&&[].concat(s[t]).forEach((e=>{-1===i.choices[t].indexOf(e)&&void 0!==e&&(r[t]=(r[t]||[]).concat(e))}))}));const o=Object.keys(r);if(!o.length)return;let a=n("Invalid values:");o.forEach((t=>{a+=`\n ${n("Argument: %s, Given: %s, Choices: %s",t,e.stringifiedValues(r[t]),e.stringifiedValues(i.choices[t]))}`})),e.fail(a)}};let o={};function a(t,e){const s=Number(e);return"number"==typeof(e=isNaN(s)?e:s)?t._.length>=e:e.match(/^--no-.+/)?!t[e=e.match(/^--no-(.+)/)[1]]:t[e]}r.implies=function(e,n){h("<string|object> [array|number|string]",[e,n],arguments.length),"object"==typeof e?Object.keys(e).forEach((t=>{r.implies(t,e[t])})):(t.global(e),o[e]||(o[e]=[]),Array.isArray(n)?n.forEach((t=>r.implies(e,t))):(u(n,void 0,s),o[e].push(n)))},r.getImplied=function(){return o},r.implications=function(t){const s=[];if(Object.keys(o).forEach((e=>{const n=e;(o[e]||[]).forEach((e=>{let i=n;const r=e;i=a(t,i),e=a(t,e),i&&!e&&s.push(` ${n} -> ${r}`)}))})),s.length){let t=`${n("Implications failed:")}\n`;s.forEach((e=>{t+=e})),e.fail(t)}};let l={};r.conflicts=function(e,s){h("<string|object> [array|string]",[e,s],arguments.length),"object"==typeof e?Object.keys(e).forEach((t=>{r.conflicts(t,e[t])})):(t.global(e),l[e]||(l[e]=[]),Array.isArray(s)?s.forEach((t=>r.conflicts(e,t))):l[e].push(s))},r.getConflicting=()=>l,r.conflicting=function(t){Object.keys(t).forEach((s=>{l[s]&&l[s].forEach((i=>{i&&void 0!==t[s]&&void 0!==t[i]&&e.fail(n("Arguments %s and %s are mutually exclusive",s,i))}))}))},r.recommendCommands=function(t,s){s=s.sort(((t,e)=>e.length-t.length));let i=null,r=1/0;for(let e,n=0;void 0!==(e=s[n]);n++){const s=D(t,e);s<=3&&s<r&&(r=s,i=e)}i&&e.fail(n("Did you mean %s?",i))},r.reset=function(t){return o=m(o,(e=>!t[e])),l=m(l,(e=>!t[e])),r};const c=[];return r.freeze=function(){c.push({implied:o,conflicting:l})},r.unfreeze=function(){const t=c.pop();u(t,void 0,s),({implied:o,conflicting:l}=t)},r}(this,O(this,ut),O(this,ht))),v(this,q,O(this,q)?O(this,q).reset():function(t,e,s,n){return new _(t,e,s,n)}(O(this,ut),O(this,gt),O(this,B),O(this,ht))),O(this,U)||v(this,U,function(t,e,s,n){return new N(t,e,s,n)}(this,O(this,ut),O(this,q),O(this,ht))),O(this,B).reset(),v(this,W,null),v(this,X,""),v(this,V,null),v(this,Y,!1),this.parsed=!1,this}[Lt](t,e){return O(this,ht).path.relative(t,e)}[Rt](t,s,n,i=0,r=!1){let o=!!n||r;t=t||O(this,ot),O(this,Q).__=O(this,ht).y18n.__,O(this,Q).configuration=this[vt]();const a=!!O(this,Q).configuration["populate--"],h=Object.assign({},O(this,Q).configuration,{"populate--":!0}),l=O(this,ht).Parser.detailed(t,Object.assign({},O(this,Q),{configuration:{"parse-positional-numbers":!1,...h}})),c=Object.assign(l.argv,O(this,nt));let u;const p=l.aliases;let g=!1,m=!1;Object.keys(c).forEach((t=>{t===O(this,J)&&c[t]?g=!0:t===O(this,pt)&&c[t]&&(m=!0)})),c.$0=this.$0,this.parsed=l,0===i&&O(this,ut).clearCachedHelpMessage();try{if(this[wt](),s)return this[Wt](c,a,!!n,!1);if(O(this,J)){~[O(this,J)].concat(p[O(this,J)]||[]).filter((t=>t.length>1)).indexOf(""+c._[c._.length-1])&&(c._.pop(),g=!0)}const h=O(this,q).getCommands(),f=O(this,U).completionKey in c,y=g||f||r;if(c._.length){if(h.length){let t;for(let e,s=i||0;void 0!==c._[s];s++){if(e=String(c._[s]),~h.indexOf(e)&&e!==O(this,W)){const t=O(this,q).runCommand(e,this,l,s+1,r,g||m||r);return this[Wt](t,a,!!n,!1)}if(!t&&e!==O(this,W)){t=e;break}}!O(this,q).hasDefaultCommand()&&O(this,at)&&t&&!y&&O(this,gt).recommendCommands(t,h)}O(this,W)&&~c._.indexOf(O(this,W))&&!f&&(O(this,T)&&E(!0),this.showCompletionScript(),this.exit(0))}if(O(this,q).hasDefaultCommand()&&!y){const t=O(this,q).runCommand(null,this,l,0,r,g||m||r);return this[Wt](t,a,!!n,!1)}if(f){O(this,T)&&E(!0);const s=(t=[].concat(t)).slice(t.indexOf(`--${O(this,U).completionKey}`)+1);return O(this,U).getCompletion(s,((t,s)=>{if(t)throw new e(t.message);(s||[]).forEach((t=>{O(this,Z).log(t)})),this.exit(0)})),this[Wt](c,!a,!!n,!1)}if(O(this,Y)||(g?(O(this,T)&&E(!0),o=!0,this.showHelp("log"),this.exit(0)):m&&(O(this,T)&&E(!0),o=!0,O(this,ut).showVersion("log"),this.exit(0))),!o&&O(this,Q).skipValidation.length>0&&(o=Object.keys(c).some((t=>O(this,Q).skipValidation.indexOf(t)>=0&&!0===c[t]))),!o){if(l.error)throw new e(l.error.message);if(!f){const t=this[Tt](p,{},l.error);n||(u=C(c,this,O(this,B).getMiddleware(),!0)),u=this[At](t,null!=u?u:c),d(u)&&!n&&(u=u.then((()=>C(c,this,O(this,B).getMiddleware(),!1))))}}}catch(t){if(!(t instanceof e))throw t;O(this,ut).fail(t.message,t)}return this[Wt](null!=u?u:c,a,!!n,!0)}[Tt](t,s,n,i){t={...t},s={...s};const r={...this.getDemandedOptions()};return o=>{if(n)throw new e(n.message);O(this,gt).nonOptionCount(o),O(this,gt).requiredArguments(o,r);let a=!1;O(this,ct)&&(a=O(this,gt).unknownCommands(o)),O(this,lt)&&!a?O(this,gt).unknownArguments(o,t,s,!!i):O(this,dt)&&O(this,gt).unknownArguments(o,t,{},!1,!1),O(this,gt).limitedChoices(o),O(this,gt).implications(o),O(this,gt).conflicting(o)}}[Gt](){v(this,Y,!0)}}var Kt,Yt;const{readFileSync:Jt}=require("fs"),{inspect:Zt}=require("util"),{resolve:Xt}=require("path"),Qt=require("y18n"),te=require("yargs-parser");var ee,se={assert:{notStrictEqual:t.notStrictEqual,strictEqual:t.strictEqual},cliui:require("cliui"),findUp:require("escalade/sync"),getEnv:t=>process.env[t],getCallerFile:require("get-caller-file"),getProcessArgvBin:y,inspect:Zt,mainFilename:null!==(Yt=null===(Kt=null===require||void 0===require?void 0:require.main)||void 0===Kt?void 0:Kt.filename)&&void 0!==Yt?Yt:process.cwd(),Parser:te,path:require("path"),process:{argv:()=>process.argv,cwd:process.cwd,execPath:()=>process.execPath,exit:t=>{process.exit(t)},nextTick:process.nextTick,stdColumns:void 0!==process.stdout.columns?process.stdout.columns:null},readFileSync:Jt,require:require,requireDirectory:require("require-directory"),stringWidth:require("string-width"),y18n:Qt({directory:Xt(__dirname,"../locales"),updateFiles:!1})};const ne=(null===(ee=null===process||void 0===process?void 0:process.env)||void 0===ee?void 0:ee.YARGS_MIN_NODE_VERSION)?Number(process.env.YARGS_MIN_NODE_VERSION):12;if(process&&process.version){if(Number(process.version.match(/v([^.]+)/)[1])<ne)throw Error(`yargs supports a minimum Node.js version of ${ne}. Read our version support policy: https://github.com/yargs/yargs#supported-nodejs-versions`)}const ie=require("yargs-parser");var re,oe={applyExtends:i,cjsPlatformShim:se,Yargs:(re=se,(t=[],e=re.process.cwd(),s)=>{const n=new Bt(t,e,s,re);return Object.defineProperty(n,"argv",{get:()=>n.parse(),enumerable:!0}),n.help(),n.version(),n}),argsert:h,isPromise:d,objFilter:m,parseCommand:o,Parser:ie,processArgv:b,YError:e};module.exports=oe;
@@ -0,0 +1,62 @@
1
+ import { YError } from './yerror.js';
2
+ import { parseCommand } from './parse-command.js';
3
+ const positionName = ['first', 'second', 'third', 'fourth', 'fifth', 'sixth'];
4
+ export function argsert(arg1, arg2, arg3) {
5
+ function parseArgs() {
6
+ return typeof arg1 === 'object'
7
+ ? [{ demanded: [], optional: [] }, arg1, arg2]
8
+ : [
9
+ parseCommand(`cmd ${arg1}`),
10
+ arg2,
11
+ arg3,
12
+ ];
13
+ }
14
+ try {
15
+ let position = 0;
16
+ const [parsed, callerArguments, _length] = parseArgs();
17
+ const args = [].slice.call(callerArguments);
18
+ while (args.length && args[args.length - 1] === undefined)
19
+ args.pop();
20
+ const length = _length || args.length;
21
+ if (length < parsed.demanded.length) {
22
+ throw new YError(`Not enough arguments provided. Expected ${parsed.demanded.length} but received ${args.length}.`);
23
+ }
24
+ const totalCommands = parsed.demanded.length + parsed.optional.length;
25
+ if (length > totalCommands) {
26
+ throw new YError(`Too many arguments provided. Expected max ${totalCommands} but received ${length}.`);
27
+ }
28
+ parsed.demanded.forEach(demanded => {
29
+ const arg = args.shift();
30
+ const observedType = guessType(arg);
31
+ const matchingTypes = demanded.cmd.filter(type => type === observedType || type === '*');
32
+ if (matchingTypes.length === 0)
33
+ argumentTypeError(observedType, demanded.cmd, position);
34
+ position += 1;
35
+ });
36
+ parsed.optional.forEach(optional => {
37
+ if (args.length === 0)
38
+ return;
39
+ const arg = args.shift();
40
+ const observedType = guessType(arg);
41
+ const matchingTypes = optional.cmd.filter(type => type === observedType || type === '*');
42
+ if (matchingTypes.length === 0)
43
+ argumentTypeError(observedType, optional.cmd, position);
44
+ position += 1;
45
+ });
46
+ }
47
+ catch (err) {
48
+ console.warn(err.stack);
49
+ }
50
+ }
51
+ function guessType(arg) {
52
+ if (Array.isArray(arg)) {
53
+ return 'array';
54
+ }
55
+ else if (arg === null) {
56
+ return 'null';
57
+ }
58
+ return typeof arg;
59
+ }
60
+ function argumentTypeError(observedType, allowedTypes, position) {
61
+ throw new YError(`Invalid ${positionName[position] || 'manyith'} argument. Expected ${allowedTypes.join(' or ')} but received ${observedType}.`);
62
+ }
@@ -0,0 +1,436 @@
1
+ import { assertNotStrictEqual, } from './typings/common-types.js';
2
+ import { isPromise } from './utils/is-promise.js';
3
+ import { applyMiddleware, commandMiddlewareFactory, } from './middleware.js';
4
+ import { parseCommand } from './parse-command.js';
5
+ import { isYargsInstance, } from './yargs-factory.js';
6
+ import { maybeAsyncResult } from './utils/maybe-async-result.js';
7
+ import whichModule from './utils/which-module.js';
8
+ const DEFAULT_MARKER = /(^\*)|(^\$0)/;
9
+ export class CommandInstance {
10
+ constructor(usage, validation, globalMiddleware, shim) {
11
+ this.requireCache = new Set();
12
+ this.handlers = {};
13
+ this.aliasMap = {};
14
+ this.frozens = [];
15
+ this.shim = shim;
16
+ this.usage = usage;
17
+ this.globalMiddleware = globalMiddleware;
18
+ this.validation = validation;
19
+ }
20
+ addDirectory(dir, req, callerFile, opts) {
21
+ opts = opts || {};
22
+ if (typeof opts.recurse !== 'boolean')
23
+ opts.recurse = false;
24
+ if (!Array.isArray(opts.extensions))
25
+ opts.extensions = ['js'];
26
+ const parentVisit = typeof opts.visit === 'function' ? opts.visit : (o) => o;
27
+ opts.visit = (obj, joined, filename) => {
28
+ const visited = parentVisit(obj, joined, filename);
29
+ if (visited) {
30
+ if (this.requireCache.has(joined))
31
+ return visited;
32
+ else
33
+ this.requireCache.add(joined);
34
+ this.addHandler(visited);
35
+ }
36
+ return visited;
37
+ };
38
+ this.shim.requireDirectory({ require: req, filename: callerFile }, dir, opts);
39
+ }
40
+ addHandler(cmd, description, builder, handler, commandMiddleware, deprecated) {
41
+ let aliases = [];
42
+ const middlewares = commandMiddlewareFactory(commandMiddleware);
43
+ handler = handler || (() => { });
44
+ if (Array.isArray(cmd)) {
45
+ if (isCommandAndAliases(cmd)) {
46
+ [cmd, ...aliases] = cmd;
47
+ }
48
+ else {
49
+ for (const command of cmd) {
50
+ this.addHandler(command);
51
+ }
52
+ }
53
+ }
54
+ else if (isCommandHandlerDefinition(cmd)) {
55
+ let command = Array.isArray(cmd.command) || typeof cmd.command === 'string'
56
+ ? cmd.command
57
+ : this.moduleName(cmd);
58
+ if (cmd.aliases)
59
+ command = [].concat(command).concat(cmd.aliases);
60
+ this.addHandler(command, this.extractDesc(cmd), cmd.builder, cmd.handler, cmd.middlewares, cmd.deprecated);
61
+ return;
62
+ }
63
+ else if (isCommandBuilderDefinition(builder)) {
64
+ this.addHandler([cmd].concat(aliases), description, builder.builder, builder.handler, builder.middlewares, builder.deprecated);
65
+ return;
66
+ }
67
+ if (typeof cmd === 'string') {
68
+ const parsedCommand = parseCommand(cmd);
69
+ aliases = aliases.map(alias => parseCommand(alias).cmd);
70
+ let isDefault = false;
71
+ const parsedAliases = [parsedCommand.cmd].concat(aliases).filter(c => {
72
+ if (DEFAULT_MARKER.test(c)) {
73
+ isDefault = true;
74
+ return false;
75
+ }
76
+ return true;
77
+ });
78
+ if (parsedAliases.length === 0 && isDefault)
79
+ parsedAliases.push('$0');
80
+ if (isDefault) {
81
+ parsedCommand.cmd = parsedAliases[0];
82
+ aliases = parsedAliases.slice(1);
83
+ cmd = cmd.replace(DEFAULT_MARKER, parsedCommand.cmd);
84
+ }
85
+ aliases.forEach(alias => {
86
+ this.aliasMap[alias] = parsedCommand.cmd;
87
+ });
88
+ if (description !== false) {
89
+ this.usage.command(cmd, description, isDefault, aliases, deprecated);
90
+ }
91
+ this.handlers[parsedCommand.cmd] = {
92
+ original: cmd,
93
+ description,
94
+ handler,
95
+ builder: builder || {},
96
+ middlewares,
97
+ deprecated,
98
+ demanded: parsedCommand.demanded,
99
+ optional: parsedCommand.optional,
100
+ };
101
+ if (isDefault)
102
+ this.defaultCommand = this.handlers[parsedCommand.cmd];
103
+ }
104
+ }
105
+ getCommandHandlers() {
106
+ return this.handlers;
107
+ }
108
+ getCommands() {
109
+ return Object.keys(this.handlers).concat(Object.keys(this.aliasMap));
110
+ }
111
+ hasDefaultCommand() {
112
+ return !!this.defaultCommand;
113
+ }
114
+ runCommand(command, yargs, parsed, commandIndex, helpOnly, helpOrVersionSet) {
115
+ const commandHandler = this.handlers[command] ||
116
+ this.handlers[this.aliasMap[command]] ||
117
+ this.defaultCommand;
118
+ const currentContext = yargs.getInternalMethods().getContext();
119
+ const parentCommands = currentContext.commands.slice();
120
+ const isDefaultCommand = !command;
121
+ if (command) {
122
+ currentContext.commands.push(command);
123
+ currentContext.fullCommands.push(commandHandler.original);
124
+ }
125
+ const builderResult = this.applyBuilderUpdateUsageAndParse(isDefaultCommand, commandHandler, yargs, parsed.aliases, parentCommands, commandIndex, helpOnly, helpOrVersionSet);
126
+ if (isPromise(builderResult)) {
127
+ return builderResult.then(result => {
128
+ return this.applyMiddlewareAndGetResult(isDefaultCommand, commandHandler, result.innerArgv, currentContext, helpOnly, result.aliases, yargs);
129
+ });
130
+ }
131
+ else {
132
+ return this.applyMiddlewareAndGetResult(isDefaultCommand, commandHandler, builderResult.innerArgv, currentContext, helpOnly, builderResult.aliases, yargs);
133
+ }
134
+ }
135
+ applyBuilderUpdateUsageAndParse(isDefaultCommand, commandHandler, yargs, aliases, parentCommands, commandIndex, helpOnly, helpOrVersionSet) {
136
+ const builder = commandHandler.builder;
137
+ let innerYargs = yargs;
138
+ if (isCommandBuilderCallback(builder)) {
139
+ const builderOutput = builder(yargs.getInternalMethods().reset(aliases), helpOrVersionSet);
140
+ if (isPromise(builderOutput)) {
141
+ return builderOutput.then(output => {
142
+ innerYargs = isYargsInstance(output) ? output : yargs;
143
+ return this.parseAndUpdateUsage(isDefaultCommand, commandHandler, innerYargs, parentCommands, commandIndex, helpOnly);
144
+ });
145
+ }
146
+ }
147
+ else if (isCommandBuilderOptionDefinitions(builder)) {
148
+ innerYargs = yargs.getInternalMethods().reset(aliases);
149
+ Object.keys(commandHandler.builder).forEach(key => {
150
+ innerYargs.option(key, builder[key]);
151
+ });
152
+ }
153
+ return this.parseAndUpdateUsage(isDefaultCommand, commandHandler, innerYargs, parentCommands, commandIndex, helpOnly);
154
+ }
155
+ parseAndUpdateUsage(isDefaultCommand, commandHandler, innerYargs, parentCommands, commandIndex, helpOnly) {
156
+ if (isDefaultCommand)
157
+ innerYargs.getInternalMethods().getUsageInstance().unfreeze();
158
+ if (this.shouldUpdateUsage(innerYargs)) {
159
+ innerYargs
160
+ .getInternalMethods()
161
+ .getUsageInstance()
162
+ .usage(this.usageFromParentCommandsCommandHandler(parentCommands, commandHandler), commandHandler.description);
163
+ }
164
+ const innerArgv = innerYargs
165
+ .getInternalMethods()
166
+ .runYargsParserAndExecuteCommands(null, undefined, true, commandIndex, helpOnly);
167
+ if (isPromise(innerArgv)) {
168
+ return innerArgv.then(argv => {
169
+ return {
170
+ aliases: innerYargs.parsed.aliases,
171
+ innerArgv: argv,
172
+ };
173
+ });
174
+ }
175
+ else {
176
+ return {
177
+ aliases: innerYargs.parsed.aliases,
178
+ innerArgv: innerArgv,
179
+ };
180
+ }
181
+ }
182
+ shouldUpdateUsage(yargs) {
183
+ return (!yargs.getInternalMethods().getUsageInstance().getUsageDisabled() &&
184
+ yargs.getInternalMethods().getUsageInstance().getUsage().length === 0);
185
+ }
186
+ usageFromParentCommandsCommandHandler(parentCommands, commandHandler) {
187
+ const c = DEFAULT_MARKER.test(commandHandler.original)
188
+ ? commandHandler.original.replace(DEFAULT_MARKER, '').trim()
189
+ : commandHandler.original;
190
+ const pc = parentCommands.filter(c => {
191
+ return !DEFAULT_MARKER.test(c);
192
+ });
193
+ pc.push(c);
194
+ return `$0 ${pc.join(' ')}`;
195
+ }
196
+ applyMiddlewareAndGetResult(isDefaultCommand, commandHandler, innerArgv, currentContext, helpOnly, aliases, yargs) {
197
+ let positionalMap = {};
198
+ if (helpOnly)
199
+ return innerArgv;
200
+ if (!yargs.getInternalMethods().getHasOutput()) {
201
+ positionalMap = this.populatePositionals(commandHandler, innerArgv, currentContext, yargs);
202
+ }
203
+ const middlewares = this.globalMiddleware
204
+ .getMiddleware()
205
+ .slice(0)
206
+ .concat(commandHandler.middlewares);
207
+ innerArgv = applyMiddleware(innerArgv, yargs, middlewares, true);
208
+ if (!yargs.getInternalMethods().getHasOutput()) {
209
+ const validation = yargs
210
+ .getInternalMethods()
211
+ .runValidation(aliases, positionalMap, yargs.parsed.error, isDefaultCommand);
212
+ innerArgv = maybeAsyncResult(innerArgv, result => {
213
+ validation(result);
214
+ return result;
215
+ });
216
+ }
217
+ if (commandHandler.handler && !yargs.getInternalMethods().getHasOutput()) {
218
+ yargs.getInternalMethods().setHasOutput();
219
+ const populateDoubleDash = !!yargs.getOptions().configuration['populate--'];
220
+ yargs
221
+ .getInternalMethods()
222
+ .postProcess(innerArgv, populateDoubleDash, false, false);
223
+ innerArgv = applyMiddleware(innerArgv, yargs, middlewares, false);
224
+ innerArgv = maybeAsyncResult(innerArgv, result => {
225
+ const handlerResult = commandHandler.handler(result);
226
+ if (isPromise(handlerResult)) {
227
+ return handlerResult.then(() => result);
228
+ }
229
+ else {
230
+ return result;
231
+ }
232
+ });
233
+ if (!isDefaultCommand) {
234
+ yargs.getInternalMethods().getUsageInstance().cacheHelpMessage();
235
+ }
236
+ if (isPromise(innerArgv) &&
237
+ !yargs.getInternalMethods().hasParseCallback()) {
238
+ innerArgv.catch(error => {
239
+ try {
240
+ yargs.getInternalMethods().getUsageInstance().fail(null, error);
241
+ }
242
+ catch (_err) {
243
+ }
244
+ });
245
+ }
246
+ }
247
+ if (!isDefaultCommand) {
248
+ currentContext.commands.pop();
249
+ currentContext.fullCommands.pop();
250
+ }
251
+ return innerArgv;
252
+ }
253
+ populatePositionals(commandHandler, argv, context, yargs) {
254
+ argv._ = argv._.slice(context.commands.length);
255
+ const demanded = commandHandler.demanded.slice(0);
256
+ const optional = commandHandler.optional.slice(0);
257
+ const positionalMap = {};
258
+ this.validation.positionalCount(demanded.length, argv._.length);
259
+ while (demanded.length) {
260
+ const demand = demanded.shift();
261
+ this.populatePositional(demand, argv, positionalMap);
262
+ }
263
+ while (optional.length) {
264
+ const maybe = optional.shift();
265
+ this.populatePositional(maybe, argv, positionalMap);
266
+ }
267
+ argv._ = context.commands.concat(argv._.map(a => '' + a));
268
+ this.postProcessPositionals(argv, positionalMap, this.cmdToParseOptions(commandHandler.original), yargs);
269
+ return positionalMap;
270
+ }
271
+ populatePositional(positional, argv, positionalMap) {
272
+ const cmd = positional.cmd[0];
273
+ if (positional.variadic) {
274
+ positionalMap[cmd] = argv._.splice(0).map(String);
275
+ }
276
+ else {
277
+ if (argv._.length)
278
+ positionalMap[cmd] = [String(argv._.shift())];
279
+ }
280
+ }
281
+ cmdToParseOptions(cmdString) {
282
+ const parseOptions = {
283
+ array: [],
284
+ default: {},
285
+ alias: {},
286
+ demand: {},
287
+ };
288
+ const parsed = parseCommand(cmdString);
289
+ parsed.demanded.forEach(d => {
290
+ const [cmd, ...aliases] = d.cmd;
291
+ if (d.variadic) {
292
+ parseOptions.array.push(cmd);
293
+ parseOptions.default[cmd] = [];
294
+ }
295
+ parseOptions.alias[cmd] = aliases;
296
+ parseOptions.demand[cmd] = true;
297
+ });
298
+ parsed.optional.forEach(o => {
299
+ const [cmd, ...aliases] = o.cmd;
300
+ if (o.variadic) {
301
+ parseOptions.array.push(cmd);
302
+ parseOptions.default[cmd] = [];
303
+ }
304
+ parseOptions.alias[cmd] = aliases;
305
+ });
306
+ return parseOptions;
307
+ }
308
+ postProcessPositionals(argv, positionalMap, parseOptions, yargs) {
309
+ const options = Object.assign({}, yargs.getOptions());
310
+ options.default = Object.assign(parseOptions.default, options.default);
311
+ for (const key of Object.keys(parseOptions.alias)) {
312
+ options.alias[key] = (options.alias[key] || []).concat(parseOptions.alias[key]);
313
+ }
314
+ options.array = options.array.concat(parseOptions.array);
315
+ options.config = {};
316
+ const unparsed = [];
317
+ Object.keys(positionalMap).forEach(key => {
318
+ positionalMap[key].map(value => {
319
+ if (options.configuration['unknown-options-as-args'])
320
+ options.key[key] = true;
321
+ unparsed.push(`--${key}`);
322
+ unparsed.push(value);
323
+ });
324
+ });
325
+ if (!unparsed.length)
326
+ return;
327
+ const config = Object.assign({}, options.configuration, {
328
+ 'populate--': false,
329
+ });
330
+ const parsed = this.shim.Parser.detailed(unparsed, Object.assign({}, options, {
331
+ configuration: config,
332
+ }));
333
+ if (parsed.error) {
334
+ yargs
335
+ .getInternalMethods()
336
+ .getUsageInstance()
337
+ .fail(parsed.error.message, parsed.error);
338
+ }
339
+ else {
340
+ const positionalKeys = Object.keys(positionalMap);
341
+ Object.keys(positionalMap).forEach(key => {
342
+ positionalKeys.push(...parsed.aliases[key]);
343
+ });
344
+ Object.keys(parsed.argv).forEach(key => {
345
+ if (positionalKeys.indexOf(key) !== -1) {
346
+ if (!positionalMap[key])
347
+ positionalMap[key] = parsed.argv[key];
348
+ argv[key] = parsed.argv[key];
349
+ }
350
+ });
351
+ }
352
+ }
353
+ runDefaultBuilderOn(yargs) {
354
+ if (!this.defaultCommand)
355
+ return;
356
+ if (this.shouldUpdateUsage(yargs)) {
357
+ const commandString = DEFAULT_MARKER.test(this.defaultCommand.original)
358
+ ? this.defaultCommand.original
359
+ : this.defaultCommand.original.replace(/^[^[\]<>]*/, '$0 ');
360
+ yargs
361
+ .getInternalMethods()
362
+ .getUsageInstance()
363
+ .usage(commandString, this.defaultCommand.description);
364
+ }
365
+ const builder = this.defaultCommand.builder;
366
+ if (isCommandBuilderCallback(builder)) {
367
+ return builder(yargs, true);
368
+ }
369
+ else if (!isCommandBuilderDefinition(builder)) {
370
+ Object.keys(builder).forEach(key => {
371
+ yargs.option(key, builder[key]);
372
+ });
373
+ }
374
+ return undefined;
375
+ }
376
+ moduleName(obj) {
377
+ const mod = whichModule(obj);
378
+ if (!mod)
379
+ throw new Error(`No command name given for module: ${this.shim.inspect(obj)}`);
380
+ return this.commandFromFilename(mod.filename);
381
+ }
382
+ commandFromFilename(filename) {
383
+ return this.shim.path.basename(filename, this.shim.path.extname(filename));
384
+ }
385
+ extractDesc({ describe, description, desc }) {
386
+ for (const test of [describe, description, desc]) {
387
+ if (typeof test === 'string' || test === false)
388
+ return test;
389
+ assertNotStrictEqual(test, true, this.shim);
390
+ }
391
+ return false;
392
+ }
393
+ freeze() {
394
+ this.frozens.push({
395
+ handlers: this.handlers,
396
+ aliasMap: this.aliasMap,
397
+ defaultCommand: this.defaultCommand,
398
+ });
399
+ }
400
+ unfreeze() {
401
+ const frozen = this.frozens.pop();
402
+ assertNotStrictEqual(frozen, undefined, this.shim);
403
+ ({
404
+ handlers: this.handlers,
405
+ aliasMap: this.aliasMap,
406
+ defaultCommand: this.defaultCommand,
407
+ } = frozen);
408
+ }
409
+ reset() {
410
+ this.handlers = {};
411
+ this.aliasMap = {};
412
+ this.defaultCommand = undefined;
413
+ this.requireCache = new Set();
414
+ return this;
415
+ }
416
+ }
417
+ export function command(usage, validation, globalMiddleware, shim) {
418
+ return new CommandInstance(usage, validation, globalMiddleware, shim);
419
+ }
420
+ export function isCommandBuilderDefinition(builder) {
421
+ return (typeof builder === 'object' &&
422
+ !!builder.builder &&
423
+ typeof builder.handler === 'function');
424
+ }
425
+ function isCommandAndAliases(cmd) {
426
+ return cmd.every(c => typeof c === 'string');
427
+ }
428
+ export function isCommandBuilderCallback(builder) {
429
+ return typeof builder === 'function';
430
+ }
431
+ function isCommandBuilderOptionDefinitions(builder) {
432
+ return typeof builder === 'object';
433
+ }
434
+ export function isCommandHandlerDefinition(cmd) {
435
+ return typeof cmd === 'object' && !Array.isArray(cmd);
436
+ }