@prismer/sdk 2.0.7 → 2.2.55

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (387) hide show
  1. package/README.md +13 -7
  2. package/dist/chunk-R7POPVJR.mjs +35 -0
  3. package/dist/cli.js +59723 -8280
  4. package/dist/index.d.mts +724 -229
  5. package/dist/index.d.ts +724 -229
  6. package/dist/index.js +325 -23
  7. package/dist/index.mjs +324 -23
  8. package/dist/katex-OIP2Q473.mjs +14515 -0
  9. package/dist/pkf-schema.json +35 -0
  10. package/dist/pkf.d.mts +1 -0
  11. package/dist/pkf.d.ts +1 -0
  12. package/dist/pkf.js +48370 -0
  13. package/dist/pkf.mjs +33683 -0
  14. package/node_modules/@clack/core/CHANGELOG.md +249 -0
  15. package/node_modules/@clack/core/LICENSE +9 -0
  16. package/node_modules/@clack/core/README.md +22 -0
  17. package/node_modules/@clack/core/dist/index.cjs +15 -0
  18. package/node_modules/@clack/core/dist/index.cjs.map +1 -0
  19. package/node_modules/@clack/core/dist/index.d.cts +209 -0
  20. package/node_modules/@clack/core/dist/index.d.mts +209 -0
  21. package/node_modules/@clack/core/dist/index.d.ts +209 -0
  22. package/node_modules/@clack/core/dist/index.mjs +15 -0
  23. package/node_modules/@clack/core/dist/index.mjs.map +1 -0
  24. package/node_modules/@clack/core/package.json +62 -0
  25. package/node_modules/@clack/prompts/CHANGELOG.md +374 -0
  26. package/node_modules/@clack/prompts/LICENSE +9 -0
  27. package/node_modules/@clack/prompts/README.md +191 -0
  28. package/node_modules/@clack/prompts/dist/index.cjs +80 -0
  29. package/node_modules/@clack/prompts/dist/index.cjs.map +1 -0
  30. package/node_modules/@clack/prompts/dist/index.d.cts +151 -0
  31. package/node_modules/@clack/prompts/dist/index.d.mts +151 -0
  32. package/node_modules/@clack/prompts/dist/index.d.ts +151 -0
  33. package/node_modules/@clack/prompts/dist/index.mjs +80 -0
  34. package/node_modules/@clack/prompts/dist/index.mjs.map +1 -0
  35. package/node_modules/@clack/prompts/package.json +61 -0
  36. package/node_modules/@iarna/toml/LICENSE +14 -0
  37. package/node_modules/@iarna/toml/README.md +301 -0
  38. package/node_modules/@iarna/toml/index.d.ts +57 -0
  39. package/node_modules/@iarna/toml/lib/create-date.js +23 -0
  40. package/node_modules/@iarna/toml/lib/create-datetime-float.js +24 -0
  41. package/node_modules/@iarna/toml/lib/create-datetime.js +10 -0
  42. package/node_modules/@iarna/toml/lib/create-time.js +22 -0
  43. package/node_modules/@iarna/toml/lib/format-num.js +6 -0
  44. package/node_modules/@iarna/toml/lib/parser-debug.js +60 -0
  45. package/node_modules/@iarna/toml/lib/parser.js +127 -0
  46. package/node_modules/@iarna/toml/lib/toml-parser.js +1379 -0
  47. package/node_modules/@iarna/toml/package.json +82 -0
  48. package/node_modules/@iarna/toml/parse-async.js +30 -0
  49. package/node_modules/@iarna/toml/parse-pretty-error.js +33 -0
  50. package/node_modules/@iarna/toml/parse-stream.js +80 -0
  51. package/node_modules/@iarna/toml/parse-string.js +18 -0
  52. package/node_modules/@iarna/toml/parse.js +5 -0
  53. package/node_modules/@iarna/toml/stringify.js +296 -0
  54. package/node_modules/@iarna/toml/toml.js +3 -0
  55. package/node_modules/@prismer/aip-sdk/README.md +36 -0
  56. package/node_modules/@prismer/aip-sdk/dist/cli/chunk-LIJDUCHB.js +104 -0
  57. package/node_modules/@prismer/aip-sdk/dist/cli/chunk-QUQXZ2LD.js +99 -0
  58. package/node_modules/@prismer/aip-sdk/dist/cli/credentials-5GGZEJFG.js +56 -0
  59. package/node_modules/@prismer/aip-sdk/dist/cli/delegation-3J35VGBZ.js +64 -0
  60. package/node_modules/@prismer/aip-sdk/dist/cli/identity-LXVWKSVB.js +7 -0
  61. package/node_modules/@prismer/aip-sdk/dist/cli/index.js +259 -0
  62. package/node_modules/@prismer/aip-sdk/dist/cli/resolver-TGOPKW52.js +26 -0
  63. package/node_modules/@prismer/aip-sdk/dist/index.cjs +368 -0
  64. package/node_modules/@prismer/aip-sdk/dist/index.d.cts +174 -0
  65. package/node_modules/@prismer/aip-sdk/dist/index.d.ts +174 -0
  66. package/node_modules/@prismer/aip-sdk/dist/index.js +322 -0
  67. package/node_modules/@prismer/aip-sdk/package.json +53 -0
  68. package/node_modules/ansi-regex/index.d.ts +37 -0
  69. package/node_modules/ansi-regex/index.js +10 -0
  70. package/node_modules/ansi-regex/license +9 -0
  71. package/node_modules/ansi-regex/package.json +55 -0
  72. package/node_modules/ansi-regex/readme.md +78 -0
  73. package/node_modules/camelcase/index.d.ts +63 -0
  74. package/node_modules/camelcase/index.js +76 -0
  75. package/node_modules/camelcase/license +9 -0
  76. package/node_modules/camelcase/package.json +43 -0
  77. package/node_modules/camelcase/readme.md +99 -0
  78. package/node_modules/cliui/LICENSE.txt +14 -0
  79. package/node_modules/cliui/README.md +115 -0
  80. package/node_modules/cliui/index.js +354 -0
  81. package/node_modules/cliui/package.json +65 -0
  82. package/node_modules/color-convert/LICENSE +21 -0
  83. package/node_modules/color-convert/README.md +68 -0
  84. package/node_modules/color-convert/conversions.js +839 -0
  85. package/node_modules/color-convert/index.js +81 -0
  86. package/node_modules/color-convert/package.json +48 -0
  87. package/node_modules/color-convert/route.js +97 -0
  88. package/node_modules/color-name/LICENSE +8 -0
  89. package/node_modules/color-name/README.md +11 -0
  90. package/node_modules/color-name/index.js +152 -0
  91. package/node_modules/color-name/package.json +28 -0
  92. package/node_modules/commander/LICENSE +22 -0
  93. package/node_modules/commander/Readme.md +1157 -0
  94. package/node_modules/commander/esm.mjs +16 -0
  95. package/node_modules/commander/index.js +24 -0
  96. package/node_modules/commander/lib/argument.js +149 -0
  97. package/node_modules/commander/lib/command.js +2509 -0
  98. package/node_modules/commander/lib/error.js +39 -0
  99. package/node_modules/commander/lib/help.js +520 -0
  100. package/node_modules/commander/lib/option.js +330 -0
  101. package/node_modules/commander/lib/suggestSimilar.js +101 -0
  102. package/node_modules/commander/package-support.json +16 -0
  103. package/node_modules/commander/package.json +84 -0
  104. package/node_modules/commander/typings/esm.d.mts +3 -0
  105. package/node_modules/commander/typings/index.d.ts +969 -0
  106. package/node_modules/decamelize/index.js +13 -0
  107. package/node_modules/decamelize/license +21 -0
  108. package/node_modules/decamelize/package.json +38 -0
  109. package/node_modules/decamelize/readme.md +48 -0
  110. package/node_modules/dijkstrajs/.travis.yml +4 -0
  111. package/node_modules/dijkstrajs/CONTRIBUTING.md +8 -0
  112. package/node_modules/dijkstrajs/LICENSE.md +19 -0
  113. package/node_modules/dijkstrajs/README.md +18 -0
  114. package/node_modules/dijkstrajs/dijkstra.js +165 -0
  115. package/node_modules/dijkstrajs/package.json +60 -0
  116. package/node_modules/dijkstrajs/test/dijkstra.test.js +96 -0
  117. package/node_modules/emoji-regex/LICENSE-MIT.txt +20 -0
  118. package/node_modules/emoji-regex/README.md +73 -0
  119. package/node_modules/emoji-regex/es2015/index.js +6 -0
  120. package/node_modules/emoji-regex/es2015/text.js +6 -0
  121. package/node_modules/emoji-regex/index.d.ts +23 -0
  122. package/node_modules/emoji-regex/index.js +6 -0
  123. package/node_modules/emoji-regex/package.json +50 -0
  124. package/node_modules/emoji-regex/text.js +6 -0
  125. package/node_modules/find-up/index.d.ts +137 -0
  126. package/node_modules/find-up/index.js +89 -0
  127. package/node_modules/find-up/license +9 -0
  128. package/node_modules/find-up/package.json +53 -0
  129. package/node_modules/find-up/readme.md +156 -0
  130. package/node_modules/get-caller-file/LICENSE.md +6 -0
  131. package/node_modules/get-caller-file/README.md +41 -0
  132. package/node_modules/get-caller-file/index.d.ts +2 -0
  133. package/node_modules/get-caller-file/index.js +22 -0
  134. package/node_modules/get-caller-file/index.js.map +1 -0
  135. package/node_modules/get-caller-file/package.json +42 -0
  136. package/node_modules/is-fullwidth-code-point/index.d.ts +17 -0
  137. package/node_modules/is-fullwidth-code-point/index.js +50 -0
  138. package/node_modules/is-fullwidth-code-point/license +9 -0
  139. package/node_modules/is-fullwidth-code-point/package.json +42 -0
  140. package/node_modules/is-fullwidth-code-point/readme.md +39 -0
  141. package/node_modules/locate-path/index.d.ts +83 -0
  142. package/node_modules/locate-path/index.js +65 -0
  143. package/node_modules/locate-path/license +9 -0
  144. package/node_modules/locate-path/package.json +45 -0
  145. package/node_modules/locate-path/readme.md +122 -0
  146. package/node_modules/p-locate/index.d.ts +64 -0
  147. package/node_modules/p-locate/index.js +52 -0
  148. package/node_modules/p-locate/license +9 -0
  149. package/node_modules/p-locate/node_modules/p-limit/index.d.ts +38 -0
  150. package/node_modules/p-locate/node_modules/p-limit/index.js +57 -0
  151. package/node_modules/p-locate/node_modules/p-limit/license +9 -0
  152. package/node_modules/p-locate/node_modules/p-limit/package.json +52 -0
  153. package/node_modules/p-locate/node_modules/p-limit/readme.md +101 -0
  154. package/node_modules/p-locate/package.json +53 -0
  155. package/node_modules/p-locate/readme.md +90 -0
  156. package/node_modules/p-try/index.d.ts +39 -0
  157. package/node_modules/p-try/index.js +9 -0
  158. package/node_modules/p-try/license +9 -0
  159. package/node_modules/p-try/package.json +42 -0
  160. package/node_modules/p-try/readme.md +58 -0
  161. package/node_modules/path-exists/index.d.ts +28 -0
  162. package/node_modules/path-exists/index.js +23 -0
  163. package/node_modules/path-exists/license +9 -0
  164. package/node_modules/path-exists/package.json +39 -0
  165. package/node_modules/path-exists/readme.md +52 -0
  166. package/node_modules/picocolors/LICENSE +15 -0
  167. package/node_modules/picocolors/README.md +21 -0
  168. package/node_modules/picocolors/package.json +25 -0
  169. package/node_modules/picocolors/picocolors.browser.js +4 -0
  170. package/node_modules/picocolors/picocolors.d.ts +5 -0
  171. package/node_modules/picocolors/picocolors.js +75 -0
  172. package/node_modules/picocolors/types.d.ts +51 -0
  173. package/node_modules/pngjs/.eslintignore +2 -0
  174. package/node_modules/pngjs/.eslintrc.json +19 -0
  175. package/node_modules/pngjs/.prettierignore +3 -0
  176. package/node_modules/pngjs/LICENSE +20 -0
  177. package/node_modules/pngjs/README.md +429 -0
  178. package/node_modules/pngjs/browser.js +16096 -0
  179. package/node_modules/pngjs/coverage/lcov-report/base.css +354 -0
  180. package/node_modules/pngjs/coverage/lcov-report/bitmapper.js.html +881 -0
  181. package/node_modules/pngjs/coverage/lcov-report/bitpacker.js.html +554 -0
  182. package/node_modules/pngjs/coverage/lcov-report/block-navigation.js +77 -0
  183. package/node_modules/pngjs/coverage/lcov-report/chunkstream.js.html +647 -0
  184. package/node_modules/pngjs/coverage/lcov-report/constants.js.html +176 -0
  185. package/node_modules/pngjs/coverage/lcov-report/crc.js.html +200 -0
  186. package/node_modules/pngjs/coverage/lcov-report/favicon.png +0 -0
  187. package/node_modules/pngjs/coverage/lcov-report/filter-pack.js.html +593 -0
  188. package/node_modules/pngjs/coverage/lcov-report/filter-parse-async.js.html +152 -0
  189. package/node_modules/pngjs/coverage/lcov-report/filter-parse-sync.js.html +143 -0
  190. package/node_modules/pngjs/coverage/lcov-report/filter-parse.js.html +611 -0
  191. package/node_modules/pngjs/coverage/lcov-report/format-normaliser.js.html +359 -0
  192. package/node_modules/pngjs/coverage/lcov-report/index.html +426 -0
  193. package/node_modules/pngjs/coverage/lcov-report/interlace.js.html +365 -0
  194. package/node_modules/pngjs/coverage/lcov-report/packer-async.js.html +230 -0
  195. package/node_modules/pngjs/coverage/lcov-report/packer-sync.js.html +248 -0
  196. package/node_modules/pngjs/coverage/lcov-report/packer.js.html +467 -0
  197. package/node_modules/pngjs/coverage/lcov-report/paeth-predictor.js.html +128 -0
  198. package/node_modules/pngjs/coverage/lcov-report/parser-async.js.html +575 -0
  199. package/node_modules/pngjs/coverage/lcov-report/parser-sync.js.html +404 -0
  200. package/node_modules/pngjs/coverage/lcov-report/parser.js.html +950 -0
  201. package/node_modules/pngjs/coverage/lcov-report/png-sync.js.html +116 -0
  202. package/node_modules/pngjs/coverage/lcov-report/png.js.html +662 -0
  203. package/node_modules/pngjs/coverage/lcov-report/prettify.css +101 -0
  204. package/node_modules/pngjs/coverage/lcov-report/prettify.js +1007 -0
  205. package/node_modules/pngjs/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  206. package/node_modules/pngjs/coverage/lcov-report/sorter.js +169 -0
  207. package/node_modules/pngjs/coverage/lcov-report/sync-inflate.js.html +584 -0
  208. package/node_modules/pngjs/coverage/lcov-report/sync-reader.js.html +215 -0
  209. package/node_modules/pngjs/coverage/lcov.info +2177 -0
  210. package/node_modules/pngjs/lib/bitmapper.js +267 -0
  211. package/node_modules/pngjs/lib/bitpacker.js +158 -0
  212. package/node_modules/pngjs/lib/chunkstream.js +189 -0
  213. package/node_modules/pngjs/lib/constants.js +32 -0
  214. package/node_modules/pngjs/lib/crc.js +40 -0
  215. package/node_modules/pngjs/lib/filter-pack.js +171 -0
  216. package/node_modules/pngjs/lib/filter-parse-async.js +24 -0
  217. package/node_modules/pngjs/lib/filter-parse-sync.js +21 -0
  218. package/node_modules/pngjs/lib/filter-parse.js +177 -0
  219. package/node_modules/pngjs/lib/format-normaliser.js +93 -0
  220. package/node_modules/pngjs/lib/interlace.js +95 -0
  221. package/node_modules/pngjs/lib/packer-async.js +50 -0
  222. package/node_modules/pngjs/lib/packer-sync.js +56 -0
  223. package/node_modules/pngjs/lib/packer.js +129 -0
  224. package/node_modules/pngjs/lib/paeth-predictor.js +16 -0
  225. package/node_modules/pngjs/lib/parser-async.js +165 -0
  226. package/node_modules/pngjs/lib/parser-sync.js +108 -0
  227. package/node_modules/pngjs/lib/parser.js +290 -0
  228. package/node_modules/pngjs/lib/png-sync.js +12 -0
  229. package/node_modules/pngjs/lib/png.js +194 -0
  230. package/node_modules/pngjs/lib/sync-inflate.js +168 -0
  231. package/node_modules/pngjs/lib/sync-reader.js +45 -0
  232. package/node_modules/pngjs/package.json +73 -0
  233. package/node_modules/qrcode/README.md +770 -0
  234. package/node_modules/qrcode/bin/qrcode +159 -0
  235. package/node_modules/qrcode/helper/to-sjis-browser.js +2 -0
  236. package/node_modules/qrcode/helper/to-sjis.js +105 -0
  237. package/node_modules/qrcode/lib/browser.js +76 -0
  238. package/node_modules/qrcode/lib/can-promise.js +7 -0
  239. package/node_modules/qrcode/lib/core/alignment-pattern.js +83 -0
  240. package/node_modules/qrcode/lib/core/alphanumeric-data.js +59 -0
  241. package/node_modules/qrcode/lib/core/bit-buffer.js +37 -0
  242. package/node_modules/qrcode/lib/core/bit-matrix.js +65 -0
  243. package/node_modules/qrcode/lib/core/byte-data.js +30 -0
  244. package/node_modules/qrcode/lib/core/error-correction-code.js +135 -0
  245. package/node_modules/qrcode/lib/core/error-correction-level.js +50 -0
  246. package/node_modules/qrcode/lib/core/finder-pattern.js +22 -0
  247. package/node_modules/qrcode/lib/core/format-info.js +29 -0
  248. package/node_modules/qrcode/lib/core/galois-field.js +69 -0
  249. package/node_modules/qrcode/lib/core/kanji-data.js +54 -0
  250. package/node_modules/qrcode/lib/core/mask-pattern.js +234 -0
  251. package/node_modules/qrcode/lib/core/mode.js +167 -0
  252. package/node_modules/qrcode/lib/core/numeric-data.js +43 -0
  253. package/node_modules/qrcode/lib/core/polynomial.js +62 -0
  254. package/node_modules/qrcode/lib/core/qrcode.js +495 -0
  255. package/node_modules/qrcode/lib/core/reed-solomon-encoder.js +56 -0
  256. package/node_modules/qrcode/lib/core/regex.js +31 -0
  257. package/node_modules/qrcode/lib/core/segments.js +330 -0
  258. package/node_modules/qrcode/lib/core/utils.js +63 -0
  259. package/node_modules/qrcode/lib/core/version-check.js +9 -0
  260. package/node_modules/qrcode/lib/core/version.js +163 -0
  261. package/node_modules/qrcode/lib/index.js +12 -0
  262. package/node_modules/qrcode/lib/renderer/canvas.js +63 -0
  263. package/node_modules/qrcode/lib/renderer/png.js +78 -0
  264. package/node_modules/qrcode/lib/renderer/svg-tag.js +81 -0
  265. package/node_modules/qrcode/lib/renderer/svg.js +19 -0
  266. package/node_modules/qrcode/lib/renderer/terminal/terminal-small.js +85 -0
  267. package/node_modules/qrcode/lib/renderer/terminal/terminal.js +49 -0
  268. package/node_modules/qrcode/lib/renderer/terminal.js +9 -0
  269. package/node_modules/qrcode/lib/renderer/utf8.js +71 -0
  270. package/node_modules/qrcode/lib/renderer/utils.js +99 -0
  271. package/node_modules/qrcode/lib/server.js +138 -0
  272. package/node_modules/qrcode/license +10 -0
  273. package/node_modules/qrcode/package.json +77 -0
  274. package/node_modules/require-directory/.jshintrc +67 -0
  275. package/node_modules/require-directory/.npmignore +1 -0
  276. package/node_modules/require-directory/.travis.yml +3 -0
  277. package/node_modules/require-directory/LICENSE +22 -0
  278. package/node_modules/require-directory/README.markdown +184 -0
  279. package/node_modules/require-directory/index.js +86 -0
  280. package/node_modules/require-directory/package.json +40 -0
  281. package/node_modules/require-main-filename/LICENSE.txt +14 -0
  282. package/node_modules/require-main-filename/README.md +26 -0
  283. package/node_modules/require-main-filename/index.js +18 -0
  284. package/node_modules/require-main-filename/package.json +35 -0
  285. package/node_modules/set-blocking/LICENSE.txt +14 -0
  286. package/node_modules/set-blocking/README.md +31 -0
  287. package/node_modules/set-blocking/index.js +7 -0
  288. package/node_modules/set-blocking/package.json +42 -0
  289. package/node_modules/sisteransi/license +21 -0
  290. package/node_modules/sisteransi/package.json +34 -0
  291. package/node_modules/sisteransi/readme.md +113 -0
  292. package/node_modules/sisteransi/src/index.js +58 -0
  293. package/node_modules/sisteransi/src/sisteransi.d.ts +35 -0
  294. package/node_modules/string-width/index.d.ts +29 -0
  295. package/node_modules/string-width/index.js +47 -0
  296. package/node_modules/string-width/license +9 -0
  297. package/node_modules/string-width/package.json +56 -0
  298. package/node_modules/string-width/readme.md +50 -0
  299. package/node_modules/strip-ansi/index.d.ts +17 -0
  300. package/node_modules/strip-ansi/index.js +4 -0
  301. package/node_modules/strip-ansi/license +9 -0
  302. package/node_modules/strip-ansi/package.json +54 -0
  303. package/node_modules/strip-ansi/readme.md +46 -0
  304. package/node_modules/which-module/LICENSE +13 -0
  305. package/node_modules/which-module/README.md +58 -0
  306. package/node_modules/which-module/index.js +9 -0
  307. package/node_modules/which-module/package.json +41 -0
  308. package/node_modules/wrap-ansi/index.js +186 -0
  309. package/node_modules/wrap-ansi/license +9 -0
  310. package/node_modules/wrap-ansi/node_modules/ansi-styles/index.d.ts +345 -0
  311. package/node_modules/wrap-ansi/node_modules/ansi-styles/index.js +163 -0
  312. package/node_modules/wrap-ansi/node_modules/ansi-styles/license +9 -0
  313. package/node_modules/wrap-ansi/node_modules/ansi-styles/package.json +56 -0
  314. package/node_modules/wrap-ansi/node_modules/ansi-styles/readme.md +152 -0
  315. package/node_modules/wrap-ansi/package.json +61 -0
  316. package/node_modules/wrap-ansi/readme.md +97 -0
  317. package/node_modules/y18n/LICENSE +13 -0
  318. package/node_modules/y18n/README.md +109 -0
  319. package/node_modules/y18n/index.js +188 -0
  320. package/node_modules/y18n/package.json +39 -0
  321. package/node_modules/yargs/LICENSE +21 -0
  322. package/node_modules/yargs/README.md +140 -0
  323. package/node_modules/yargs/build/lib/apply-extends.d.ts +2 -0
  324. package/node_modules/yargs/build/lib/apply-extends.js +65 -0
  325. package/node_modules/yargs/build/lib/argsert.d.ts +2 -0
  326. package/node_modules/yargs/build/lib/argsert.js +65 -0
  327. package/node_modules/yargs/build/lib/command.d.ts +64 -0
  328. package/node_modules/yargs/build/lib/command.js +416 -0
  329. package/node_modules/yargs/build/lib/common-types.d.ts +36 -0
  330. package/node_modules/yargs/build/lib/common-types.js +25 -0
  331. package/node_modules/yargs/build/lib/completion-templates.d.ts +2 -0
  332. package/node_modules/yargs/build/lib/completion-templates.js +50 -0
  333. package/node_modules/yargs/build/lib/completion.d.ts +21 -0
  334. package/node_modules/yargs/build/lib/completion.js +135 -0
  335. package/node_modules/yargs/build/lib/is-promise.d.ts +1 -0
  336. package/node_modules/yargs/build/lib/is-promise.js +9 -0
  337. package/node_modules/yargs/build/lib/levenshtein.d.ts +1 -0
  338. package/node_modules/yargs/build/lib/levenshtein.js +58 -0
  339. package/node_modules/yargs/build/lib/middleware.d.ts +10 -0
  340. package/node_modules/yargs/build/lib/middleware.js +57 -0
  341. package/node_modules/yargs/build/lib/obj-filter.d.ts +1 -0
  342. package/node_modules/yargs/build/lib/obj-filter.js +14 -0
  343. package/node_modules/yargs/build/lib/parse-command.d.ts +11 -0
  344. package/node_modules/yargs/build/lib/parse-command.js +36 -0
  345. package/node_modules/yargs/build/lib/process-argv.d.ts +2 -0
  346. package/node_modules/yargs/build/lib/process-argv.js +31 -0
  347. package/node_modules/yargs/build/lib/usage.d.ts +49 -0
  348. package/node_modules/yargs/build/lib/usage.js +540 -0
  349. package/node_modules/yargs/build/lib/validation.d.ts +34 -0
  350. package/node_modules/yargs/build/lib/validation.js +330 -0
  351. package/node_modules/yargs/build/lib/yargs.d.ts +274 -0
  352. package/node_modules/yargs/build/lib/yargs.js +1190 -0
  353. package/node_modules/yargs/build/lib/yerror.d.ts +4 -0
  354. package/node_modules/yargs/build/lib/yerror.js +11 -0
  355. package/node_modules/yargs/index.js +40 -0
  356. package/node_modules/yargs/locales/be.json +46 -0
  357. package/node_modules/yargs/locales/de.json +46 -0
  358. package/node_modules/yargs/locales/en.json +51 -0
  359. package/node_modules/yargs/locales/es.json +46 -0
  360. package/node_modules/yargs/locales/fi.json +49 -0
  361. package/node_modules/yargs/locales/fr.json +53 -0
  362. package/node_modules/yargs/locales/hi.json +49 -0
  363. package/node_modules/yargs/locales/hu.json +46 -0
  364. package/node_modules/yargs/locales/id.json +50 -0
  365. package/node_modules/yargs/locales/it.json +46 -0
  366. package/node_modules/yargs/locales/ja.json +51 -0
  367. package/node_modules/yargs/locales/ko.json +49 -0
  368. package/node_modules/yargs/locales/nb.json +44 -0
  369. package/node_modules/yargs/locales/nl.json +49 -0
  370. package/node_modules/yargs/locales/nn.json +44 -0
  371. package/node_modules/yargs/locales/pirate.json +13 -0
  372. package/node_modules/yargs/locales/pl.json +49 -0
  373. package/node_modules/yargs/locales/pt.json +45 -0
  374. package/node_modules/yargs/locales/pt_BR.json +48 -0
  375. package/node_modules/yargs/locales/ru.json +46 -0
  376. package/node_modules/yargs/locales/th.json +46 -0
  377. package/node_modules/yargs/locales/tr.json +48 -0
  378. package/node_modules/yargs/locales/zh_CN.json +48 -0
  379. package/node_modules/yargs/locales/zh_TW.json +47 -0
  380. package/node_modules/yargs/package.json +92 -0
  381. package/node_modules/yargs/yargs.js +14 -0
  382. package/node_modules/yargs-parser/LICENSE.txt +14 -0
  383. package/node_modules/yargs-parser/README.md +449 -0
  384. package/node_modules/yargs-parser/index.js +1032 -0
  385. package/node_modules/yargs-parser/lib/tokenize-arg-string.js +40 -0
  386. package/node_modules/yargs-parser/package.json +46 -0
  387. package/package.json +28 -5
@@ -0,0 +1,188 @@
1
+ var fs = require('fs')
2
+ var path = require('path')
3
+ var util = require('util')
4
+
5
+ function Y18N (opts) {
6
+ // configurable options.
7
+ opts = opts || {}
8
+ this.directory = opts.directory || './locales'
9
+ this.updateFiles = typeof opts.updateFiles === 'boolean' ? opts.updateFiles : true
10
+ this.locale = opts.locale || 'en'
11
+ this.fallbackToLanguage = typeof opts.fallbackToLanguage === 'boolean' ? opts.fallbackToLanguage : true
12
+
13
+ // internal stuff.
14
+ this.cache = Object.create(null)
15
+ this.writeQueue = []
16
+ }
17
+
18
+ Y18N.prototype.__ = function () {
19
+ if (typeof arguments[0] !== 'string') {
20
+ return this._taggedLiteral.apply(this, arguments)
21
+ }
22
+ var args = Array.prototype.slice.call(arguments)
23
+ var str = args.shift()
24
+ var cb = function () {} // start with noop.
25
+
26
+ if (typeof args[args.length - 1] === 'function') cb = args.pop()
27
+ cb = cb || function () {} // noop.
28
+
29
+ if (!this.cache[this.locale]) this._readLocaleFile()
30
+
31
+ // we've observed a new string, update the language file.
32
+ if (!this.cache[this.locale][str] && this.updateFiles) {
33
+ this.cache[this.locale][str] = str
34
+
35
+ // include the current directory and locale,
36
+ // since these values could change before the
37
+ // write is performed.
38
+ this._enqueueWrite([this.directory, this.locale, cb])
39
+ } else {
40
+ cb()
41
+ }
42
+
43
+ return util.format.apply(util, [this.cache[this.locale][str] || str].concat(args))
44
+ }
45
+
46
+ Y18N.prototype._taggedLiteral = function (parts) {
47
+ var args = arguments
48
+ var str = ''
49
+ parts.forEach(function (part, i) {
50
+ var arg = args[i + 1]
51
+ str += part
52
+ if (typeof arg !== 'undefined') {
53
+ str += '%s'
54
+ }
55
+ })
56
+ return this.__.apply(null, [str].concat([].slice.call(arguments, 1)))
57
+ }
58
+
59
+ Y18N.prototype._enqueueWrite = function (work) {
60
+ this.writeQueue.push(work)
61
+ if (this.writeQueue.length === 1) this._processWriteQueue()
62
+ }
63
+
64
+ Y18N.prototype._processWriteQueue = function () {
65
+ var _this = this
66
+ var work = this.writeQueue[0]
67
+
68
+ // destructure the enqueued work.
69
+ var directory = work[0]
70
+ var locale = work[1]
71
+ var cb = work[2]
72
+
73
+ var languageFile = this._resolveLocaleFile(directory, locale)
74
+ var serializedLocale = JSON.stringify(this.cache[locale], null, 2)
75
+
76
+ fs.writeFile(languageFile, serializedLocale, 'utf-8', function (err) {
77
+ _this.writeQueue.shift()
78
+ if (_this.writeQueue.length > 0) _this._processWriteQueue()
79
+ cb(err)
80
+ })
81
+ }
82
+
83
+ Y18N.prototype._readLocaleFile = function () {
84
+ var localeLookup = {}
85
+ var languageFile = this._resolveLocaleFile(this.directory, this.locale)
86
+
87
+ try {
88
+ localeLookup = JSON.parse(fs.readFileSync(languageFile, 'utf-8'))
89
+ } catch (err) {
90
+ if (err instanceof SyntaxError) {
91
+ err.message = 'syntax error in ' + languageFile
92
+ }
93
+
94
+ if (err.code === 'ENOENT') localeLookup = {}
95
+ else throw err
96
+ }
97
+
98
+ this.cache[this.locale] = localeLookup
99
+ }
100
+
101
+ Y18N.prototype._resolveLocaleFile = function (directory, locale) {
102
+ var file = path.resolve(directory, './', locale + '.json')
103
+ if (this.fallbackToLanguage && !this._fileExistsSync(file) && ~locale.lastIndexOf('_')) {
104
+ // attempt fallback to language only
105
+ var languageFile = path.resolve(directory, './', locale.split('_')[0] + '.json')
106
+ if (this._fileExistsSync(languageFile)) file = languageFile
107
+ }
108
+ return file
109
+ }
110
+
111
+ // this only exists because fs.existsSync() "will be deprecated"
112
+ // see https://nodejs.org/api/fs.html#fs_fs_existssync_path
113
+ Y18N.prototype._fileExistsSync = function (file) {
114
+ try {
115
+ return fs.statSync(file).isFile()
116
+ } catch (err) {
117
+ return false
118
+ }
119
+ }
120
+
121
+ Y18N.prototype.__n = function () {
122
+ var args = Array.prototype.slice.call(arguments)
123
+ var singular = args.shift()
124
+ var plural = args.shift()
125
+ var quantity = args.shift()
126
+
127
+ var cb = function () {} // start with noop.
128
+ if (typeof args[args.length - 1] === 'function') cb = args.pop()
129
+
130
+ if (!this.cache[this.locale]) this._readLocaleFile()
131
+
132
+ var str = quantity === 1 ? singular : plural
133
+ if (this.cache[this.locale][singular]) {
134
+ str = this.cache[this.locale][singular][quantity === 1 ? 'one' : 'other']
135
+ }
136
+
137
+ // we've observed a new string, update the language file.
138
+ if (!this.cache[this.locale][singular] && this.updateFiles) {
139
+ this.cache[this.locale][singular] = {
140
+ one: singular,
141
+ other: plural
142
+ }
143
+
144
+ // include the current directory and locale,
145
+ // since these values could change before the
146
+ // write is performed.
147
+ this._enqueueWrite([this.directory, this.locale, cb])
148
+ } else {
149
+ cb()
150
+ }
151
+
152
+ // if a %d placeholder is provided, add quantity
153
+ // to the arguments expanded by util.format.
154
+ var values = [str]
155
+ if (~str.indexOf('%d')) values.push(quantity)
156
+
157
+ return util.format.apply(util, values.concat(args))
158
+ }
159
+
160
+ Y18N.prototype.setLocale = function (locale) {
161
+ this.locale = locale
162
+ }
163
+
164
+ Y18N.prototype.getLocale = function () {
165
+ return this.locale
166
+ }
167
+
168
+ Y18N.prototype.updateLocale = function (obj) {
169
+ if (!this.cache[this.locale]) this._readLocaleFile()
170
+
171
+ for (var key in obj) {
172
+ this.cache[this.locale][key] = obj[key]
173
+ }
174
+ }
175
+
176
+ module.exports = function (opts) {
177
+ var y18n = new Y18N(opts)
178
+
179
+ // bind all functions to y18n, so that
180
+ // they can be used in isolation.
181
+ for (var key in y18n) {
182
+ if (typeof y18n[key] === 'function') {
183
+ y18n[key] = y18n[key].bind(y18n)
184
+ }
185
+ }
186
+
187
+ return y18n
188
+ }
@@ -0,0 +1,39 @@
1
+ {
2
+ "name": "y18n",
3
+ "version": "4.0.3",
4
+ "description": "the bare-bones internationalization library used by yargs",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "pretest": "standard",
8
+ "test": "nyc mocha",
9
+ "coverage": "nyc report --reporter=text-lcov | coveralls",
10
+ "release": "standard-version"
11
+ },
12
+ "repository": {
13
+ "type": "git",
14
+ "url": "git@github.com:yargs/y18n.git"
15
+ },
16
+ "files": [
17
+ "index.js"
18
+ ],
19
+ "keywords": [
20
+ "i18n",
21
+ "internationalization",
22
+ "yargs"
23
+ ],
24
+ "author": "Ben Coe <ben@npmjs.com>",
25
+ "license": "ISC",
26
+ "bugs": {
27
+ "url": "https://github.com/yargs/y18n/issues"
28
+ },
29
+ "homepage": "https://github.com/yargs/y18n",
30
+ "devDependencies": {
31
+ "chai": "^4.0.1",
32
+ "coveralls": "^3.0.0",
33
+ "mocha": "^4.0.1",
34
+ "nyc": "^11.0.1",
35
+ "rimraf": "^2.5.0",
36
+ "standard": "^10.0.0-beta.0",
37
+ "standard-version": "^4.2.0"
38
+ }
39
+ }
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright 2010 James Halliday (mail@substack.net); Modified work Copyright 2014 Contributors (ben@npmjs.com)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -0,0 +1,140 @@
1
+ <p align="center">
2
+ <img width="250" src="/yargs-logo.png">
3
+ </p>
4
+ <h1 align="center"> Yargs </h1>
5
+ <p align="center">
6
+ <b >Yargs be a node.js library fer hearties tryin' ter parse optstrings</b>
7
+ </p>
8
+
9
+ <br>
10
+
11
+ [![Build Status][travis-image]][travis-url]
12
+ [![NPM version][npm-image]][npm-url]
13
+ [![js-standard-style][standard-image]][standard-url]
14
+ [![Coverage][coverage-image]][coverage-url]
15
+ [![Conventional Commits][conventional-commits-image]][conventional-commits-url]
16
+ [![Slack][slack-image]][slack-url]
17
+
18
+ ## Description :
19
+ Yargs helps you build interactive command line tools, by parsing arguments and generating an elegant user interface.
20
+
21
+ It gives you:
22
+
23
+ * commands and (grouped) options (`my-program.js serve --port=5000`).
24
+ * a dynamically generated help menu based on your arguments.
25
+
26
+ > <img width="400" src="/screen.png">
27
+
28
+ * bash-completion shortcuts for commands and options.
29
+ * and [tons more](/docs/api.md).
30
+
31
+ ## Installation
32
+
33
+ Stable version:
34
+ ```bash
35
+ npm i yargs
36
+ ```
37
+
38
+ Bleeding edge version with the most recent features:
39
+ ```bash
40
+ npm i yargs@next
41
+ ```
42
+
43
+ ## Usage :
44
+
45
+ ### Simple Example
46
+
47
+ ```javascript
48
+ #!/usr/bin/env node
49
+ const {argv} = require('yargs')
50
+
51
+ if (argv.ships > 3 && argv.distance < 53.5) {
52
+ console.log('Plunder more riffiwobbles!')
53
+ } else {
54
+ console.log('Retreat from the xupptumblers!')
55
+ }
56
+ ```
57
+
58
+ ```bash
59
+ $ ./plunder.js --ships=4 --distance=22
60
+ Plunder more riffiwobbles!
61
+
62
+ $ ./plunder.js --ships 12 --distance 98.7
63
+ Retreat from the xupptumblers!
64
+ ```
65
+
66
+ ### Complex Example
67
+
68
+ ```javascript
69
+ #!/usr/bin/env node
70
+ require('yargs') // eslint-disable-line
71
+ .command('serve [port]', 'start the server', (yargs) => {
72
+ yargs
73
+ .positional('port', {
74
+ describe: 'port to bind on',
75
+ default: 5000
76
+ })
77
+ }, (argv) => {
78
+ if (argv.verbose) console.info(`start server on :${argv.port}`)
79
+ serve(argv.port)
80
+ })
81
+ .option('verbose', {
82
+ alias: 'v',
83
+ type: 'boolean',
84
+ description: 'Run with verbose logging'
85
+ })
86
+ .argv
87
+ ```
88
+
89
+ Run the example above with `--help` to see the help for the application.
90
+
91
+ ## TypeScript
92
+
93
+ yargs has type definitions at [@types/yargs][type-definitions].
94
+
95
+ ```
96
+ npm i @types/yargs --save-dev
97
+ ```
98
+
99
+ See usage examples in [docs](/docs/typescript.md).
100
+
101
+ ## Webpack
102
+
103
+ See usage examples of yargs with webpack in [docs](/docs/webpack.md).
104
+
105
+ ## Community :
106
+
107
+ Having problems? want to contribute? join our [community slack](http://devtoolscommunity.herokuapp.com).
108
+
109
+ ## Documentation :
110
+
111
+ ### Table of Contents
112
+
113
+ * [Yargs' API](/docs/api.md)
114
+ * [Examples](/docs/examples.md)
115
+ * [Parsing Tricks](/docs/tricks.md)
116
+ * [Stop the Parser](/docs/tricks.md#stop)
117
+ * [Negating Boolean Arguments](/docs/tricks.md#negate)
118
+ * [Numbers](/docs/tricks.md#numbers)
119
+ * [Arrays](/docs/tricks.md#arrays)
120
+ * [Objects](/docs/tricks.md#objects)
121
+ * [Quotes](/docs/tricks.md#quotes)
122
+ * [Advanced Topics](/docs/advanced.md)
123
+ * [Composing Your App Using Commands](/docs/advanced.md#commands)
124
+ * [Building Configurable CLI Apps](/docs/advanced.md#configuration)
125
+ * [Customizing Yargs' Parser](/docs/advanced.md#customizing)
126
+ * [Contributing](/contributing.md)
127
+
128
+ [travis-url]: https://travis-ci.org/yargs/yargs
129
+ [travis-image]: https://img.shields.io/travis/yargs/yargs/master.svg
130
+ [npm-url]: https://www.npmjs.com/package/yargs
131
+ [npm-image]: https://img.shields.io/npm/v/yargs.svg
132
+ [standard-image]: https://img.shields.io/badge/code%20style-standard-brightgreen.svg
133
+ [standard-url]: http://standardjs.com/
134
+ [conventional-commits-image]: https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg
135
+ [conventional-commits-url]: https://conventionalcommits.org/
136
+ [slack-image]: http://devtoolscommunity.herokuapp.com/badge.svg
137
+ [slack-url]: http://devtoolscommunity.herokuapp.com
138
+ [type-definitions]: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/yargs
139
+ [coverage-image]: https://img.shields.io/nycrc/yargs/yargs
140
+ [coverage-url]: https://github.com/yargs/yargs/blob/master/.nycrc
@@ -0,0 +1,2 @@
1
+ import { Dictionary } from './common-types';
2
+ export declare function applyExtends(config: Dictionary, cwd: string, mergeExtends?: boolean): Dictionary;
@@ -0,0 +1,65 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.applyExtends = void 0;
4
+ const fs = require("fs");
5
+ const path = require("path");
6
+ const yerror_1 = require("./yerror");
7
+ let previouslyVisitedConfigs = [];
8
+ function checkForCircularExtends(cfgPath) {
9
+ if (previouslyVisitedConfigs.indexOf(cfgPath) > -1) {
10
+ throw new yerror_1.YError(`Circular extended configurations: '${cfgPath}'.`);
11
+ }
12
+ }
13
+ function getPathToDefaultConfig(cwd, pathToExtend) {
14
+ return path.resolve(cwd, pathToExtend);
15
+ }
16
+ function mergeDeep(config1, config2) {
17
+ const target = {};
18
+ function isObject(obj) {
19
+ return obj && typeof obj === 'object' && !Array.isArray(obj);
20
+ }
21
+ Object.assign(target, config1);
22
+ for (const key of Object.keys(config2)) {
23
+ if (isObject(config2[key]) && isObject(target[key])) {
24
+ target[key] = mergeDeep(config1[key], config2[key]);
25
+ }
26
+ else {
27
+ target[key] = config2[key];
28
+ }
29
+ }
30
+ return target;
31
+ }
32
+ function applyExtends(config, cwd, mergeExtends = false) {
33
+ let defaultConfig = {};
34
+ if (Object.prototype.hasOwnProperty.call(config, 'extends')) {
35
+ if (typeof config.extends !== 'string')
36
+ return defaultConfig;
37
+ const isPath = /\.json|\..*rc$/.test(config.extends);
38
+ let pathToDefault = null;
39
+ if (!isPath) {
40
+ try {
41
+ pathToDefault = require.resolve(config.extends);
42
+ }
43
+ catch (err) {
44
+ // most likely this simply isn't a module.
45
+ }
46
+ }
47
+ else {
48
+ pathToDefault = getPathToDefaultConfig(cwd, config.extends);
49
+ }
50
+ // maybe the module uses key for some other reason,
51
+ // err on side of caution.
52
+ if (!pathToDefault && !isPath)
53
+ return config;
54
+ if (!pathToDefault)
55
+ throw new yerror_1.YError(`Unable to find extended config '${config.extends}' in '${cwd}'.`);
56
+ checkForCircularExtends(pathToDefault);
57
+ previouslyVisitedConfigs.push(pathToDefault);
58
+ defaultConfig = isPath ? JSON.parse(fs.readFileSync(pathToDefault, 'utf8')) : require(config.extends);
59
+ delete config.extends;
60
+ defaultConfig = applyExtends(defaultConfig, path.dirname(pathToDefault), mergeExtends);
61
+ }
62
+ previouslyVisitedConfigs = [];
63
+ return mergeExtends ? mergeDeep(defaultConfig, config) : Object.assign({}, defaultConfig, config);
64
+ }
65
+ exports.applyExtends = applyExtends;
@@ -0,0 +1,2 @@
1
+ export declare function argsert(callerArguments: any[], length?: number): void;
2
+ export declare function argsert(expected: string, callerArguments: any[], length?: number): void;
@@ -0,0 +1,65 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.argsert = void 0;
4
+ const yerror_1 = require("./yerror");
5
+ const parse_command_1 = require("./parse-command");
6
+ const positionName = ['first', 'second', 'third', 'fourth', 'fifth', 'sixth'];
7
+ function argsert(arg1, arg2, arg3) {
8
+ function parseArgs() {
9
+ return typeof arg1 === 'object'
10
+ ? [{ demanded: [], optional: [] }, arg1, arg2]
11
+ : [parse_command_1.parseCommand(`cmd ${arg1}`), arg2, arg3];
12
+ }
13
+ // TODO: should this eventually raise an exception.
14
+ try {
15
+ // preface the argument description with "cmd", so
16
+ // that we can run it through yargs' command parser.
17
+ let position = 0;
18
+ let [parsed, callerArguments, length] = parseArgs();
19
+ const args = [].slice.call(callerArguments);
20
+ while (args.length && args[args.length - 1] === undefined)
21
+ args.pop();
22
+ length = length || args.length;
23
+ if (length < parsed.demanded.length) {
24
+ throw new yerror_1.YError(`Not enough arguments provided. Expected ${parsed.demanded.length} but received ${args.length}.`);
25
+ }
26
+ const totalCommands = parsed.demanded.length + parsed.optional.length;
27
+ if (length > totalCommands) {
28
+ throw new yerror_1.YError(`Too many arguments provided. Expected max ${totalCommands} but received ${length}.`);
29
+ }
30
+ parsed.demanded.forEach((demanded) => {
31
+ const arg = args.shift();
32
+ const observedType = guessType(arg);
33
+ const matchingTypes = demanded.cmd.filter(type => type === observedType || type === '*');
34
+ if (matchingTypes.length === 0)
35
+ argumentTypeError(observedType, demanded.cmd, position);
36
+ position += 1;
37
+ });
38
+ parsed.optional.forEach((optional) => {
39
+ if (args.length === 0)
40
+ return;
41
+ const arg = args.shift();
42
+ const observedType = guessType(arg);
43
+ const matchingTypes = optional.cmd.filter(type => type === observedType || type === '*');
44
+ if (matchingTypes.length === 0)
45
+ argumentTypeError(observedType, optional.cmd, position);
46
+ position += 1;
47
+ });
48
+ }
49
+ catch (err) {
50
+ console.warn(err.stack);
51
+ }
52
+ }
53
+ exports.argsert = argsert;
54
+ function guessType(arg) {
55
+ if (Array.isArray(arg)) {
56
+ return 'array';
57
+ }
58
+ else if (arg === null) {
59
+ return 'null';
60
+ }
61
+ return typeof arg;
62
+ }
63
+ function argumentTypeError(observedType, allowedTypes, position) {
64
+ throw new yerror_1.YError(`Invalid ${positionName[position] || 'manyith'} argument. Expected ${allowedTypes.join(' or ')} but received ${observedType}.`);
65
+ }
@@ -0,0 +1,64 @@
1
+ /// <reference types="node" />
2
+ import { Dictionary } from './common-types';
3
+ import { Middleware } from './middleware';
4
+ import { Positional } from './parse-command';
5
+ import { RequireDirectoryOptions } from 'require-directory';
6
+ import { UsageInstance } from './usage';
7
+ import { ValidationInstance } from './validation';
8
+ import { YargsInstance, Options, OptionDefinition, Context, Arguments, DetailedArguments } from './yargs';
9
+ export declare function command(yargs: YargsInstance, usage: UsageInstance, validation: ValidationInstance, globalMiddleware?: Middleware[]): CommandInstance;
10
+ /** Instance of the command module. */
11
+ export interface CommandInstance {
12
+ addDirectory(dir: string, context: Context, req: NodeRequireFunction, callerFile: string, opts?: RequireDirectoryOptions<any>): void;
13
+ addHandler(handler: CommandHandlerDefinition): void;
14
+ addHandler(cmd: string | string[], description: CommandHandler['description'], builder?: CommandBuilderDefinition | CommandBuilder, handler?: CommandHandlerCallback, commandMiddleware?: Middleware[], deprecated?: boolean): void;
15
+ cmdToParseOptions(cmdString: string): Positionals;
16
+ freeze(): void;
17
+ getCommandHandlers(): Dictionary<CommandHandler>;
18
+ getCommands(): string[];
19
+ hasDefaultCommand(): boolean;
20
+ reset(): CommandInstance;
21
+ runCommand(command: string | null, yargs: YargsInstance, parsed: DetailedArguments, commandIndex?: number): Arguments | Promise<Arguments>;
22
+ runDefaultBuilderOn(yargs: YargsInstance): void;
23
+ unfreeze(): void;
24
+ }
25
+ export interface CommandHandlerDefinition extends Partial<Pick<CommandHandler, 'deprecated' | 'description' | 'handler' | 'middlewares'>> {
26
+ aliases?: string[];
27
+ builder?: CommandBuilder | CommandBuilderDefinition;
28
+ command?: string | string[];
29
+ desc?: CommandHandler['description'];
30
+ describe?: CommandHandler['description'];
31
+ }
32
+ export declare function isCommandHandlerDefinition(cmd: string | string[] | CommandHandlerDefinition): cmd is CommandHandlerDefinition;
33
+ export interface CommandBuilderDefinition {
34
+ builder?: CommandBuilder;
35
+ deprecated?: boolean;
36
+ handler: CommandHandlerCallback;
37
+ middlewares?: Middleware[];
38
+ }
39
+ export declare function isCommandBuilderDefinition(builder?: CommandBuilder | CommandBuilderDefinition): builder is CommandBuilderDefinition;
40
+ export interface CommandHandlerCallback {
41
+ (argv: Arguments): any;
42
+ }
43
+ export interface CommandHandler {
44
+ builder: CommandBuilder;
45
+ demanded: Positional[];
46
+ deprecated?: boolean;
47
+ description?: string | false;
48
+ handler: CommandHandlerCallback;
49
+ middlewares: Middleware[];
50
+ optional: Positional[];
51
+ original: string;
52
+ }
53
+ export declare type CommandBuilder = CommandBuilderCallback | Dictionary<OptionDefinition>;
54
+ interface CommandBuilderCallback {
55
+ (y: YargsInstance): YargsInstance | void;
56
+ }
57
+ export declare function isCommandBuilderCallback(builder: CommandBuilder): builder is CommandBuilderCallback;
58
+ interface Positionals extends Pick<Options, 'alias' | 'array' | 'default'> {
59
+ demand: Dictionary<boolean>;
60
+ }
61
+ export interface FinishCommandHandler {
62
+ (handlerResult: any): any;
63
+ }
64
+ export {};