ali-skills 0.0.21 → 0.0.22

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 (633) hide show
  1. package/node_modules/@ali/cli-skills/dist/cli.mjs +1214 -287
  2. package/node_modules/@ali/cli-skills/package.json +5 -2
  3. package/node_modules/@ali/o2-open-client/.editorconfig +11 -0
  4. package/node_modules/@ali/o2-open-client/README.md +80 -0
  5. package/node_modules/@ali/o2-open-client/abc.json +8 -0
  6. package/node_modules/@ali/o2-open-client/es/browser/ee.d.ts +23 -0
  7. package/node_modules/@ali/o2-open-client/es/browser/ee.js +82 -0
  8. package/node_modules/@ali/o2-open-client/es/browser/entry.d.ts +32 -0
  9. package/node_modules/@ali/o2-open-client/es/browser/entry.js +306 -0
  10. package/node_modules/@ali/o2-open-client/es/browser/escape.d.ts +12 -0
  11. package/node_modules/@ali/o2-open-client/es/browser/escape.js +178 -0
  12. package/node_modules/@ali/o2-open-client/es/browser/fetch.d.ts +1 -0
  13. package/node_modules/@ali/o2-open-client/es/browser/fetch.js +14 -0
  14. package/node_modules/@ali/o2-open-client/es/browser/index.d.ts +1 -0
  15. package/node_modules/@ali/o2-open-client/es/browser/index.js +1 -0
  16. package/node_modules/@ali/o2-open-client/es/common/constant.d.ts +42 -0
  17. package/node_modules/@ali/o2-open-client/es/common/constant.js +53 -0
  18. package/node_modules/@ali/o2-open-client/es/common/format.d.ts +14 -0
  19. package/node_modules/@ali/o2-open-client/es/common/format.js +43 -0
  20. package/node_modules/@ali/o2-open-client/es/common/service-meta.d.ts +33 -0
  21. package/node_modules/@ali/o2-open-client/es/common/service-meta.js +33 -0
  22. package/node_modules/@ali/o2-open-client/es/index.d.ts +1 -0
  23. package/node_modules/@ali/o2-open-client/es/index.js +8 -0
  24. package/node_modules/@ali/o2-open-client/es/node/config.d.ts +47 -0
  25. package/node_modules/@ali/o2-open-client/es/node/config.js +188 -0
  26. package/node_modules/@ali/o2-open-client/es/node/escape.d.ts +22 -0
  27. package/node_modules/@ali/o2-open-client/es/node/escape.js +131 -0
  28. package/node_modules/@ali/o2-open-client/es/node/help.d.ts +10 -0
  29. package/node_modules/@ali/o2-open-client/es/node/help.js +96 -0
  30. package/node_modules/@ali/o2-open-client/es/node/index.d.ts +48 -0
  31. package/node_modules/@ali/o2-open-client/es/node/index.js +247 -0
  32. package/node_modules/@ali/o2-open-client/es/node/token-handler.d.ts +1 -0
  33. package/node_modules/@ali/o2-open-client/es/node/token-handler.js +21 -0
  34. package/node_modules/@ali/o2-open-client/lib/browser/ee.d.ts +23 -0
  35. package/node_modules/@ali/o2-open-client/lib/browser/ee.js +86 -0
  36. package/node_modules/@ali/o2-open-client/lib/browser/entry.d.ts +32 -0
  37. package/node_modules/@ali/o2-open-client/lib/browser/entry.js +310 -0
  38. package/node_modules/@ali/o2-open-client/lib/browser/escape.d.ts +12 -0
  39. package/node_modules/@ali/o2-open-client/lib/browser/escape.js +185 -0
  40. package/node_modules/@ali/o2-open-client/lib/browser/fetch.d.ts +1 -0
  41. package/node_modules/@ali/o2-open-client/lib/browser/fetch.js +18 -0
  42. package/node_modules/@ali/o2-open-client/lib/common/constant.d.ts +42 -0
  43. package/node_modules/@ali/o2-open-client/lib/common/constant.js +56 -0
  44. package/node_modules/@ali/o2-open-client/lib/common/format.d.ts +14 -0
  45. package/node_modules/@ali/o2-open-client/lib/common/format.js +48 -0
  46. package/node_modules/@ali/o2-open-client/lib/common/service-meta.d.ts +33 -0
  47. package/node_modules/@ali/o2-open-client/lib/common/service-meta.js +36 -0
  48. package/node_modules/@ali/o2-open-client/lib/index.d.ts +1 -0
  49. package/node_modules/@ali/o2-open-client/lib/index.js +20 -0
  50. package/node_modules/@ali/o2-open-client/lib/node/config.d.ts +47 -0
  51. package/node_modules/@ali/o2-open-client/lib/node/config.js +192 -0
  52. package/node_modules/@ali/o2-open-client/lib/node/escape.d.ts +22 -0
  53. package/node_modules/@ali/o2-open-client/lib/node/escape.js +137 -0
  54. package/node_modules/@ali/o2-open-client/lib/node/help.d.ts +10 -0
  55. package/node_modules/@ali/o2-open-client/lib/node/help.js +100 -0
  56. package/node_modules/@ali/o2-open-client/lib/node/index.d.ts +48 -0
  57. package/node_modules/@ali/o2-open-client/lib/node/index.js +250 -0
  58. package/node_modules/@ali/o2-open-client/lib/node/token-handler.d.ts +1 -0
  59. package/node_modules/@ali/o2-open-client/lib/node/token-handler.js +25 -0
  60. package/node_modules/@ali/o2-open-client/package.json +46 -0
  61. package/node_modules/@ali/o2-open-client/playwright.config.ts +54 -0
  62. package/node_modules/@ali/o2-open-client/tsconfig.es.json +31 -0
  63. package/node_modules/@ali/o2-open-client/tsconfig.json +31 -0
  64. package/node_modules/@ali/o2-open-client/tsx2doc.config.js +5 -0
  65. package/node_modules/@ali/o2-open-client/typings/index.d.ts +36 -0
  66. package/node_modules/@types/node/LICENSE +21 -0
  67. package/node_modules/@types/node/README.md +15 -0
  68. package/node_modules/@types/node/assert/strict.d.ts +8 -0
  69. package/node_modules/@types/node/assert.d.ts +1062 -0
  70. package/node_modules/@types/node/async_hooks.d.ts +605 -0
  71. package/node_modules/@types/node/buffer.buffer.d.ts +471 -0
  72. package/node_modules/@types/node/buffer.d.ts +1936 -0
  73. package/node_modules/@types/node/child_process.d.ts +1475 -0
  74. package/node_modules/@types/node/cluster.d.ts +577 -0
  75. package/node_modules/@types/node/compatibility/disposable.d.ts +16 -0
  76. package/node_modules/@types/node/compatibility/index.d.ts +9 -0
  77. package/node_modules/@types/node/compatibility/indexable.d.ts +20 -0
  78. package/node_modules/@types/node/compatibility/iterators.d.ts +21 -0
  79. package/node_modules/@types/node/console.d.ts +452 -0
  80. package/node_modules/@types/node/constants.d.ts +21 -0
  81. package/node_modules/@types/node/crypto.d.ts +4590 -0
  82. package/node_modules/@types/node/dgram.d.ts +597 -0
  83. package/node_modules/@types/node/diagnostics_channel.d.ts +578 -0
  84. package/node_modules/@types/node/dns/promises.d.ts +479 -0
  85. package/node_modules/@types/node/dns.d.ts +871 -0
  86. package/node_modules/@types/node/domain.d.ts +170 -0
  87. package/node_modules/@types/node/events.d.ts +977 -0
  88. package/node_modules/@types/node/fs/promises.d.ts +1270 -0
  89. package/node_modules/@types/node/fs.d.ts +4375 -0
  90. package/node_modules/@types/node/globals.d.ts +172 -0
  91. package/node_modules/@types/node/globals.typedarray.d.ts +38 -0
  92. package/node_modules/@types/node/http.d.ts +2049 -0
  93. package/node_modules/@types/node/http2.d.ts +2631 -0
  94. package/node_modules/@types/node/https.d.ts +578 -0
  95. package/node_modules/@types/node/index.d.ts +93 -0
  96. package/node_modules/@types/node/inspector.generated.d.ts +3966 -0
  97. package/node_modules/@types/node/module.d.ts +539 -0
  98. package/node_modules/@types/node/net.d.ts +1031 -0
  99. package/node_modules/@types/node/os.d.ts +506 -0
  100. package/node_modules/@types/node/package.json +140 -0
  101. package/node_modules/@types/node/path.d.ts +200 -0
  102. package/node_modules/@types/node/perf_hooks.d.ts +961 -0
  103. package/node_modules/@types/node/process.d.ts +1961 -0
  104. package/node_modules/@types/node/punycode.d.ts +117 -0
  105. package/node_modules/@types/node/querystring.d.ts +152 -0
  106. package/node_modules/@types/node/readline/promises.d.ts +162 -0
  107. package/node_modules/@types/node/readline.d.ts +589 -0
  108. package/node_modules/@types/node/repl.d.ts +430 -0
  109. package/node_modules/@types/node/sea.d.ts +153 -0
  110. package/node_modules/@types/node/stream/consumers.d.ts +38 -0
  111. package/node_modules/@types/node/stream/promises.d.ts +90 -0
  112. package/node_modules/@types/node/stream/web.d.ts +533 -0
  113. package/node_modules/@types/node/stream.d.ts +1698 -0
  114. package/node_modules/@types/node/string_decoder.d.ts +67 -0
  115. package/node_modules/@types/node/test.d.ts +1787 -0
  116. package/node_modules/@types/node/timers/promises.d.ts +108 -0
  117. package/node_modules/@types/node/timers.d.ts +286 -0
  118. package/node_modules/@types/node/tls.d.ts +1259 -0
  119. package/node_modules/@types/node/trace_events.d.ts +197 -0
  120. package/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +468 -0
  121. package/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +34 -0
  122. package/node_modules/@types/node/ts5.6/index.d.ts +93 -0
  123. package/node_modules/@types/node/tty.d.ts +208 -0
  124. package/node_modules/@types/node/url.d.ts +964 -0
  125. package/node_modules/@types/node/util.d.ts +2331 -0
  126. package/node_modules/@types/node/v8.d.ts +809 -0
  127. package/node_modules/@types/node/vm.d.ts +1001 -0
  128. package/node_modules/@types/node/wasi.d.ts +181 -0
  129. package/node_modules/@types/node/web-globals/abortcontroller.d.ts +34 -0
  130. package/node_modules/@types/node/web-globals/domexception.d.ts +68 -0
  131. package/node_modules/@types/node/web-globals/events.d.ts +97 -0
  132. package/node_modules/@types/node/web-globals/fetch.d.ts +55 -0
  133. package/node_modules/@types/node/worker_threads.d.ts +715 -0
  134. package/node_modules/@types/node/zlib.d.ts +598 -0
  135. package/node_modules/ansi-styles/index.d.ts +345 -0
  136. package/node_modules/ansi-styles/index.js +163 -0
  137. package/node_modules/ansi-styles/license +9 -0
  138. package/node_modules/ansi-styles/package.json +56 -0
  139. package/node_modules/ansi-styles/readme.md +152 -0
  140. package/node_modules/await-event/LICENSE +22 -0
  141. package/node_modules/await-event/README.md +48 -0
  142. package/node_modules/await-event/index.js +13 -0
  143. package/node_modules/await-event/package.json +33 -0
  144. package/node_modules/await-first/LICENSE +21 -0
  145. package/node_modules/await-first/README.md +80 -0
  146. package/node_modules/await-first/lib/index.js +21 -0
  147. package/node_modules/await-first/package.json +49 -0
  148. package/node_modules/byte/LICENSE.txt +21 -0
  149. package/node_modules/byte/README.md +207 -0
  150. package/node_modules/byte/lib/byte.js +635 -0
  151. package/node_modules/byte/lib/number.js +82 -0
  152. package/node_modules/byte/package.json +61 -0
  153. package/node_modules/chalk/index.d.ts +415 -0
  154. package/node_modules/chalk/license +9 -0
  155. package/node_modules/chalk/package.json +68 -0
  156. package/node_modules/chalk/readme.md +341 -0
  157. package/node_modules/chalk/source/index.js +229 -0
  158. package/node_modules/chalk/source/templates.js +134 -0
  159. package/node_modules/chalk/source/util.js +39 -0
  160. package/node_modules/circular-json-for-egg/LICENSE.txt +19 -0
  161. package/node_modules/circular-json-for-egg/README.md +148 -0
  162. package/node_modules/circular-json-for-egg/build/circular-json.amd.js +2 -0
  163. package/node_modules/circular-json-for-egg/build/circular-json.js +2 -0
  164. package/node_modules/circular-json-for-egg/build/circular-json.max.amd.js +210 -0
  165. package/node_modules/circular-json-for-egg/build/circular-json.max.js +210 -0
  166. package/node_modules/circular-json-for-egg/build/circular-json.node.js +207 -0
  167. package/node_modules/circular-json-for-egg/package.json +42 -0
  168. package/node_modules/cluster-client/LICENSE +21 -0
  169. package/node_modules/cluster-client/README.md +319 -0
  170. package/node_modules/cluster-client/index.js +66 -0
  171. package/node_modules/cluster-client/lib/api_client.js +74 -0
  172. package/node_modules/cluster-client/lib/connection.js +180 -0
  173. package/node_modules/cluster-client/lib/const.js +5 -0
  174. package/node_modules/cluster-client/lib/default_logger.js +11 -0
  175. package/node_modules/cluster-client/lib/default_transcode.js +6 -0
  176. package/node_modules/cluster-client/lib/follower.js +331 -0
  177. package/node_modules/cluster-client/lib/index.js +213 -0
  178. package/node_modules/cluster-client/lib/leader.js +437 -0
  179. package/node_modules/cluster-client/lib/protocol/byte_buffer.js +8 -0
  180. package/node_modules/cluster-client/lib/protocol/packet.js +103 -0
  181. package/node_modules/cluster-client/lib/protocol/request.js +17 -0
  182. package/node_modules/cluster-client/lib/protocol/response.js +14 -0
  183. package/node_modules/cluster-client/lib/server.js +256 -0
  184. package/node_modules/cluster-client/lib/symbol.js +20 -0
  185. package/node_modules/cluster-client/lib/utils.js +103 -0
  186. package/node_modules/cluster-client/lib/wrapper/base.js +210 -0
  187. package/node_modules/cluster-client/lib/wrapper/cluster.js +57 -0
  188. package/node_modules/cluster-client/lib/wrapper/single.js +192 -0
  189. package/node_modules/cluster-client/package.json +60 -0
  190. package/node_modules/co/LICENSE +22 -0
  191. package/node_modules/co/Readme.md +212 -0
  192. package/node_modules/co/index.js +237 -0
  193. package/node_modules/co/package.json +34 -0
  194. package/node_modules/color-convert/LICENSE +21 -0
  195. package/node_modules/color-convert/README.md +68 -0
  196. package/node_modules/color-convert/conversions.js +839 -0
  197. package/node_modules/color-convert/index.js +81 -0
  198. package/node_modules/color-convert/package.json +48 -0
  199. package/node_modules/color-convert/route.js +97 -0
  200. package/node_modules/color-name/LICENSE +8 -0
  201. package/node_modules/color-name/README.md +11 -0
  202. package/node_modules/color-name/index.js +152 -0
  203. package/node_modules/color-name/package.json +28 -0
  204. package/node_modules/core-util-is/LICENSE +19 -0
  205. package/node_modules/core-util-is/README.md +3 -0
  206. package/node_modules/core-util-is/lib/util.js +107 -0
  207. package/node_modules/core-util-is/package.json +38 -0
  208. package/node_modules/debug/LICENSE +20 -0
  209. package/node_modules/debug/README.md +481 -0
  210. package/node_modules/debug/package.json +64 -0
  211. package/node_modules/debug/src/browser.js +272 -0
  212. package/node_modules/debug/src/common.js +292 -0
  213. package/node_modules/debug/src/index.js +10 -0
  214. package/node_modules/debug/src/node.js +263 -0
  215. package/node_modules/depd/History.md +103 -0
  216. package/node_modules/depd/LICENSE +22 -0
  217. package/node_modules/depd/Readme.md +280 -0
  218. package/node_modules/depd/index.js +538 -0
  219. package/node_modules/depd/lib/browser/index.js +77 -0
  220. package/node_modules/depd/package.json +45 -0
  221. package/node_modules/ee-first/LICENSE +22 -0
  222. package/node_modules/ee-first/README.md +80 -0
  223. package/node_modules/ee-first/index.js +95 -0
  224. package/node_modules/ee-first/package.json +29 -0
  225. package/node_modules/egg-errors/LICENSE +21 -0
  226. package/node_modules/egg-errors/README.md +259 -0
  227. package/node_modules/egg-errors/lib/base.d.ts +10 -0
  228. package/node_modules/egg-errors/lib/base.js +28 -0
  229. package/node_modules/egg-errors/lib/base_error.d.ts +6 -0
  230. package/node_modules/egg-errors/lib/base_error.js +13 -0
  231. package/node_modules/egg-errors/lib/base_exception.d.ts +6 -0
  232. package/node_modules/egg-errors/lib/base_exception.js +13 -0
  233. package/node_modules/egg-errors/lib/error.d.ts +6 -0
  234. package/node_modules/egg-errors/lib/error.js +13 -0
  235. package/node_modules/egg-errors/lib/error_options.d.ts +5 -0
  236. package/node_modules/egg-errors/lib/error_options.js +6 -0
  237. package/node_modules/egg-errors/lib/error_type.d.ts +6 -0
  238. package/node_modules/egg-errors/lib/error_type.js +10 -0
  239. package/node_modules/egg-errors/lib/exception.d.ts +6 -0
  240. package/node_modules/egg-errors/lib/exception.js +13 -0
  241. package/node_modules/egg-errors/lib/framework/formatter.d.ts +6 -0
  242. package/node_modules/egg-errors/lib/framework/formatter.js +29 -0
  243. package/node_modules/egg-errors/lib/framework/framework_base_error.d.ts +10 -0
  244. package/node_modules/egg-errors/lib/framework/framework_base_error.js +32 -0
  245. package/node_modules/egg-errors/lib/http/400.d.ts +5 -0
  246. package/node_modules/egg-errors/lib/http/400.js +13 -0
  247. package/node_modules/egg-errors/lib/http/401.d.ts +5 -0
  248. package/node_modules/egg-errors/lib/http/401.js +13 -0
  249. package/node_modules/egg-errors/lib/http/402.d.ts +5 -0
  250. package/node_modules/egg-errors/lib/http/402.js +13 -0
  251. package/node_modules/egg-errors/lib/http/403.d.ts +5 -0
  252. package/node_modules/egg-errors/lib/http/403.js +13 -0
  253. package/node_modules/egg-errors/lib/http/404.d.ts +5 -0
  254. package/node_modules/egg-errors/lib/http/404.js +13 -0
  255. package/node_modules/egg-errors/lib/http/405.d.ts +5 -0
  256. package/node_modules/egg-errors/lib/http/405.js +13 -0
  257. package/node_modules/egg-errors/lib/http/406.d.ts +5 -0
  258. package/node_modules/egg-errors/lib/http/406.js +13 -0
  259. package/node_modules/egg-errors/lib/http/407.d.ts +5 -0
  260. package/node_modules/egg-errors/lib/http/407.js +13 -0
  261. package/node_modules/egg-errors/lib/http/408.d.ts +5 -0
  262. package/node_modules/egg-errors/lib/http/408.js +13 -0
  263. package/node_modules/egg-errors/lib/http/409.d.ts +5 -0
  264. package/node_modules/egg-errors/lib/http/409.js +13 -0
  265. package/node_modules/egg-errors/lib/http/410.d.ts +5 -0
  266. package/node_modules/egg-errors/lib/http/410.js +13 -0
  267. package/node_modules/egg-errors/lib/http/411.d.ts +5 -0
  268. package/node_modules/egg-errors/lib/http/411.js +13 -0
  269. package/node_modules/egg-errors/lib/http/412.d.ts +5 -0
  270. package/node_modules/egg-errors/lib/http/412.js +13 -0
  271. package/node_modules/egg-errors/lib/http/413.d.ts +5 -0
  272. package/node_modules/egg-errors/lib/http/413.js +13 -0
  273. package/node_modules/egg-errors/lib/http/414.d.ts +5 -0
  274. package/node_modules/egg-errors/lib/http/414.js +13 -0
  275. package/node_modules/egg-errors/lib/http/415.d.ts +5 -0
  276. package/node_modules/egg-errors/lib/http/415.js +13 -0
  277. package/node_modules/egg-errors/lib/http/416.d.ts +5 -0
  278. package/node_modules/egg-errors/lib/http/416.js +13 -0
  279. package/node_modules/egg-errors/lib/http/417.d.ts +5 -0
  280. package/node_modules/egg-errors/lib/http/417.js +13 -0
  281. package/node_modules/egg-errors/lib/http/418.d.ts +5 -0
  282. package/node_modules/egg-errors/lib/http/418.js +13 -0
  283. package/node_modules/egg-errors/lib/http/421.d.ts +5 -0
  284. package/node_modules/egg-errors/lib/http/421.js +13 -0
  285. package/node_modules/egg-errors/lib/http/422.d.ts +5 -0
  286. package/node_modules/egg-errors/lib/http/422.js +13 -0
  287. package/node_modules/egg-errors/lib/http/423.d.ts +5 -0
  288. package/node_modules/egg-errors/lib/http/423.js +13 -0
  289. package/node_modules/egg-errors/lib/http/424.d.ts +5 -0
  290. package/node_modules/egg-errors/lib/http/424.js +13 -0
  291. package/node_modules/egg-errors/lib/http/425.d.ts +5 -0
  292. package/node_modules/egg-errors/lib/http/425.js +13 -0
  293. package/node_modules/egg-errors/lib/http/426.d.ts +5 -0
  294. package/node_modules/egg-errors/lib/http/426.js +13 -0
  295. package/node_modules/egg-errors/lib/http/428.d.ts +5 -0
  296. package/node_modules/egg-errors/lib/http/428.js +13 -0
  297. package/node_modules/egg-errors/lib/http/429.d.ts +5 -0
  298. package/node_modules/egg-errors/lib/http/429.js +13 -0
  299. package/node_modules/egg-errors/lib/http/431.d.ts +5 -0
  300. package/node_modules/egg-errors/lib/http/431.js +13 -0
  301. package/node_modules/egg-errors/lib/http/451.d.ts +5 -0
  302. package/node_modules/egg-errors/lib/http/451.js +13 -0
  303. package/node_modules/egg-errors/lib/http/500.d.ts +5 -0
  304. package/node_modules/egg-errors/lib/http/500.js +13 -0
  305. package/node_modules/egg-errors/lib/http/501.d.ts +5 -0
  306. package/node_modules/egg-errors/lib/http/501.js +13 -0
  307. package/node_modules/egg-errors/lib/http/502.d.ts +5 -0
  308. package/node_modules/egg-errors/lib/http/502.js +13 -0
  309. package/node_modules/egg-errors/lib/http/503.d.ts +5 -0
  310. package/node_modules/egg-errors/lib/http/503.js +13 -0
  311. package/node_modules/egg-errors/lib/http/504.d.ts +5 -0
  312. package/node_modules/egg-errors/lib/http/504.js +13 -0
  313. package/node_modules/egg-errors/lib/http/505.d.ts +5 -0
  314. package/node_modules/egg-errors/lib/http/505.js +13 -0
  315. package/node_modules/egg-errors/lib/http/506.d.ts +5 -0
  316. package/node_modules/egg-errors/lib/http/506.js +13 -0
  317. package/node_modules/egg-errors/lib/http/507.d.ts +5 -0
  318. package/node_modules/egg-errors/lib/http/507.js +13 -0
  319. package/node_modules/egg-errors/lib/http/508.d.ts +5 -0
  320. package/node_modules/egg-errors/lib/http/508.js +13 -0
  321. package/node_modules/egg-errors/lib/http/509.d.ts +5 -0
  322. package/node_modules/egg-errors/lib/http/509.js +13 -0
  323. package/node_modules/egg-errors/lib/http/510.d.ts +5 -0
  324. package/node_modules/egg-errors/lib/http/510.js +13 -0
  325. package/node_modules/egg-errors/lib/http/511.d.ts +5 -0
  326. package/node_modules/egg-errors/lib/http/511.js +13 -0
  327. package/node_modules/egg-errors/lib/http/http_error.d.ts +10 -0
  328. package/node_modules/egg-errors/lib/http/http_error.js +13 -0
  329. package/node_modules/egg-errors/lib/http/http_error_options.d.ts +6 -0
  330. package/node_modules/egg-errors/lib/http/http_error_options.js +7 -0
  331. package/node_modules/egg-errors/lib/http/http_header.d.ts +3 -0
  332. package/node_modules/egg-errors/lib/http/http_header.js +3 -0
  333. package/node_modules/egg-errors/lib/index.d.ts +50 -0
  334. package/node_modules/egg-errors/lib/index.js +149 -0
  335. package/node_modules/egg-errors/package.json +49 -0
  336. package/node_modules/egg-logger/LICENSE +21 -0
  337. package/node_modules/egg-logger/README.md +128 -0
  338. package/node_modules/egg-logger/README.zh-CN.md +125 -0
  339. package/node_modules/egg-logger/index.d.ts +233 -0
  340. package/node_modules/egg-logger/index.js +18 -0
  341. package/node_modules/egg-logger/lib/egg/console_logger.js +36 -0
  342. package/node_modules/egg-logger/lib/egg/context_logger.js +43 -0
  343. package/node_modules/egg-logger/lib/egg/custom_logger.js +10 -0
  344. package/node_modules/egg-logger/lib/egg/error_logger.js +31 -0
  345. package/node_modules/egg-logger/lib/egg/logger.js +128 -0
  346. package/node_modules/egg-logger/lib/egg/loggers.js +163 -0
  347. package/node_modules/egg-logger/lib/level.js +34 -0
  348. package/node_modules/egg-logger/lib/logger.js +170 -0
  349. package/node_modules/egg-logger/lib/transports/console.js +52 -0
  350. package/node_modules/egg-logger/lib/transports/file.js +134 -0
  351. package/node_modules/egg-logger/lib/transports/file_buffer.js +113 -0
  352. package/node_modules/egg-logger/lib/transports/transport.js +129 -0
  353. package/node_modules/egg-logger/lib/utils.js +296 -0
  354. package/node_modules/egg-logger/package.json +54 -0
  355. package/node_modules/escape-html/LICENSE +24 -0
  356. package/node_modules/escape-html/Readme.md +43 -0
  357. package/node_modules/escape-html/index.js +78 -0
  358. package/node_modules/escape-html/package.json +24 -0
  359. package/node_modules/extend-shallow/LICENSE +21 -0
  360. package/node_modules/extend-shallow/README.md +61 -0
  361. package/node_modules/extend-shallow/index.js +33 -0
  362. package/node_modules/extend-shallow/package.json +56 -0
  363. package/node_modules/has-flag/index.d.ts +39 -0
  364. package/node_modules/has-flag/index.js +8 -0
  365. package/node_modules/has-flag/license +9 -0
  366. package/node_modules/has-flag/package.json +46 -0
  367. package/node_modules/has-flag/readme.md +89 -0
  368. package/node_modules/heartbeats/.eslintrc +151 -0
  369. package/node_modules/heartbeats/.npmignore +28 -0
  370. package/node_modules/heartbeats/.travis.yml +10 -0
  371. package/node_modules/heartbeats/LICENSE +21 -0
  372. package/node_modules/heartbeats/README.md +323 -0
  373. package/node_modules/heartbeats/lib/beatevent.js +35 -0
  374. package/node_modules/heartbeats/lib/heart.js +178 -0
  375. package/node_modules/heartbeats/lib/pulse.js +39 -0
  376. package/node_modules/heartbeats/main.js +34 -0
  377. package/node_modules/heartbeats/package.json +39 -0
  378. package/node_modules/heartbeats/test/benchmark.js +138 -0
  379. package/node_modules/heartbeats/test/spawn.js +16 -0
  380. package/node_modules/heartbeats/test/test.js +158 -0
  381. package/node_modules/httpx/README.md +96 -0
  382. package/node_modules/httpx/lib/index.d.ts +31 -0
  383. package/node_modules/httpx/lib/index.js +396 -0
  384. package/node_modules/httpx/package.json +36 -0
  385. package/node_modules/iconv-lite/.github/dependabot.yml +11 -0
  386. package/node_modules/iconv-lite/.idea/codeStyles/Project.xml +47 -0
  387. package/node_modules/iconv-lite/.idea/codeStyles/codeStyleConfig.xml +5 -0
  388. package/node_modules/iconv-lite/.idea/iconv-lite.iml +12 -0
  389. package/node_modules/iconv-lite/.idea/inspectionProfiles/Project_Default.xml +6 -0
  390. package/node_modules/iconv-lite/.idea/modules.xml +8 -0
  391. package/node_modules/iconv-lite/.idea/vcs.xml +6 -0
  392. package/node_modules/iconv-lite/Changelog.md +212 -0
  393. package/node_modules/iconv-lite/LICENSE +21 -0
  394. package/node_modules/iconv-lite/README.md +130 -0
  395. package/node_modules/iconv-lite/encodings/dbcs-codec.js +597 -0
  396. package/node_modules/iconv-lite/encodings/dbcs-data.js +188 -0
  397. package/node_modules/iconv-lite/encodings/index.js +23 -0
  398. package/node_modules/iconv-lite/encodings/internal.js +198 -0
  399. package/node_modules/iconv-lite/encodings/sbcs-codec.js +72 -0
  400. package/node_modules/iconv-lite/encodings/sbcs-data-generated.js +451 -0
  401. package/node_modules/iconv-lite/encodings/sbcs-data.js +179 -0
  402. package/node_modules/iconv-lite/encodings/tables/big5-added.json +122 -0
  403. package/node_modules/iconv-lite/encodings/tables/cp936.json +264 -0
  404. package/node_modules/iconv-lite/encodings/tables/cp949.json +273 -0
  405. package/node_modules/iconv-lite/encodings/tables/cp950.json +177 -0
  406. package/node_modules/iconv-lite/encodings/tables/eucjp.json +182 -0
  407. package/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json +1 -0
  408. package/node_modules/iconv-lite/encodings/tables/gbk-added.json +56 -0
  409. package/node_modules/iconv-lite/encodings/tables/shiftjis.json +125 -0
  410. package/node_modules/iconv-lite/encodings/utf16.js +197 -0
  411. package/node_modules/iconv-lite/encodings/utf32.js +319 -0
  412. package/node_modules/iconv-lite/encodings/utf7.js +290 -0
  413. package/node_modules/iconv-lite/lib/bom-handling.js +52 -0
  414. package/node_modules/iconv-lite/lib/index.d.ts +41 -0
  415. package/node_modules/iconv-lite/lib/index.js +180 -0
  416. package/node_modules/iconv-lite/lib/streams.js +109 -0
  417. package/node_modules/iconv-lite/package.json +44 -0
  418. package/node_modules/ip/README.md +90 -0
  419. package/node_modules/ip/lib/ip.js +496 -0
  420. package/node_modules/ip/package.json +25 -0
  421. package/node_modules/is-class-hotfix/.editorconfig +23 -0
  422. package/node_modules/is-class-hotfix/.gitattributes +2 -0
  423. package/node_modules/is-class-hotfix/CHANGELOG.md +7 -0
  424. package/node_modules/is-class-hotfix/LICENSE.md +21 -0
  425. package/node_modules/is-class-hotfix/README.md +35 -0
  426. package/node_modules/is-class-hotfix/bower.json +24 -0
  427. package/node_modules/is-class-hotfix/is-class.js +28 -0
  428. package/node_modules/is-class-hotfix/package.json +31 -0
  429. package/node_modules/is-class-hotfix/test/babel-class.js +27 -0
  430. package/node_modules/is-class-hotfix/test/is-class.js +31 -0
  431. package/node_modules/is-extendable/LICENSE +21 -0
  432. package/node_modules/is-extendable/README.md +72 -0
  433. package/node_modules/is-extendable/index.js +13 -0
  434. package/node_modules/is-extendable/package.json +51 -0
  435. package/node_modules/is-type-of/LICENSE +21 -0
  436. package/node_modules/is-type-of/README.md +105 -0
  437. package/node_modules/is-type-of/index.d.ts +65 -0
  438. package/node_modules/is-type-of/index.js +125 -0
  439. package/node_modules/is-type-of/package.json +45 -0
  440. package/node_modules/isstream/.jshintrc +59 -0
  441. package/node_modules/isstream/.npmignore +1 -0
  442. package/node_modules/isstream/.travis.yml +12 -0
  443. package/node_modules/isstream/LICENSE.md +11 -0
  444. package/node_modules/isstream/README.md +66 -0
  445. package/node_modules/isstream/isstream.js +27 -0
  446. package/node_modules/isstream/package.json +33 -0
  447. package/node_modules/isstream/test.js +168 -0
  448. package/node_modules/json-stringify-safe/.npmignore +1 -0
  449. package/node_modules/json-stringify-safe/CHANGELOG.md +14 -0
  450. package/node_modules/json-stringify-safe/LICENSE +15 -0
  451. package/node_modules/json-stringify-safe/Makefile +35 -0
  452. package/node_modules/json-stringify-safe/README.md +52 -0
  453. package/node_modules/json-stringify-safe/package.json +31 -0
  454. package/node_modules/json-stringify-safe/stringify.js +27 -0
  455. package/node_modules/json-stringify-safe/test/mocha.opts +2 -0
  456. package/node_modules/json-stringify-safe/test/stringify_test.js +246 -0
  457. package/node_modules/kitx/LICENSE +21 -0
  458. package/node_modules/kitx/README.md +35 -0
  459. package/node_modules/kitx/lib/index.d.ts +45 -0
  460. package/node_modules/kitx/lib/index.js +289 -0
  461. package/node_modules/kitx/package.json +41 -0
  462. package/node_modules/long/LICENSE +202 -0
  463. package/node_modules/long/README.md +246 -0
  464. package/node_modules/long/dist/long.js +2 -0
  465. package/node_modules/long/dist/long.js.map +1 -0
  466. package/node_modules/long/index.js +1 -0
  467. package/node_modules/long/package.json +34 -0
  468. package/node_modules/long/src/long.js +1323 -0
  469. package/node_modules/ms/index.js +162 -0
  470. package/node_modules/ms/license.md +21 -0
  471. package/node_modules/ms/package.json +38 -0
  472. package/node_modules/ms/readme.md +59 -0
  473. package/node_modules/p-timeout/index.d.ts +113 -0
  474. package/node_modules/p-timeout/index.js +71 -0
  475. package/node_modules/p-timeout/license +9 -0
  476. package/node_modules/p-timeout/package.json +44 -0
  477. package/node_modules/p-timeout/readme.md +117 -0
  478. package/node_modules/safer-buffer/LICENSE +21 -0
  479. package/node_modules/safer-buffer/Porting-Buffer.md +268 -0
  480. package/node_modules/safer-buffer/Readme.md +156 -0
  481. package/node_modules/safer-buffer/dangerous.js +58 -0
  482. package/node_modules/safer-buffer/package.json +34 -0
  483. package/node_modules/safer-buffer/safer.js +77 -0
  484. package/node_modules/safer-buffer/tests.js +406 -0
  485. package/node_modules/sdk-base/LICENSE +21 -0
  486. package/node_modules/sdk-base/README.md +165 -0
  487. package/node_modules/sdk-base/index.d.ts +29 -0
  488. package/node_modules/sdk-base/index.js +251 -0
  489. package/node_modules/sdk-base/package.json +54 -0
  490. package/node_modules/serialize-json/LICENSE +21 -0
  491. package/node_modules/serialize-json/README.md +74 -0
  492. package/node_modules/serialize-json/lib/decoder.js +190 -0
  493. package/node_modules/serialize-json/lib/encoder.js +200 -0
  494. package/node_modules/serialize-json/lib/index.js +15 -0
  495. package/node_modules/serialize-json/package.json +53 -0
  496. package/node_modules/supports-color/browser.js +5 -0
  497. package/node_modules/supports-color/index.js +135 -0
  498. package/node_modules/supports-color/license +9 -0
  499. package/node_modules/supports-color/package.json +53 -0
  500. package/node_modules/supports-color/readme.md +76 -0
  501. package/node_modules/tcp-base/LICENSE +21 -0
  502. package/node_modules/tcp-base/README.md +134 -0
  503. package/node_modules/tcp-base/lib/base.js +456 -0
  504. package/node_modules/tcp-base/package.json +44 -0
  505. package/node_modules/undici-types/LICENSE +21 -0
  506. package/node_modules/undici-types/README.md +6 -0
  507. package/node_modules/undici-types/agent.d.ts +31 -0
  508. package/node_modules/undici-types/api.d.ts +43 -0
  509. package/node_modules/undici-types/balanced-pool.d.ts +29 -0
  510. package/node_modules/undici-types/cache.d.ts +36 -0
  511. package/node_modules/undici-types/client.d.ts +108 -0
  512. package/node_modules/undici-types/connector.d.ts +34 -0
  513. package/node_modules/undici-types/content-type.d.ts +21 -0
  514. package/node_modules/undici-types/cookies.d.ts +28 -0
  515. package/node_modules/undici-types/diagnostics-channel.d.ts +66 -0
  516. package/node_modules/undici-types/dispatcher.d.ts +256 -0
  517. package/node_modules/undici-types/env-http-proxy-agent.d.ts +21 -0
  518. package/node_modules/undici-types/errors.d.ts +149 -0
  519. package/node_modules/undici-types/eventsource.d.ts +61 -0
  520. package/node_modules/undici-types/fetch.d.ts +209 -0
  521. package/node_modules/undici-types/file.d.ts +39 -0
  522. package/node_modules/undici-types/filereader.d.ts +54 -0
  523. package/node_modules/undici-types/formdata.d.ts +108 -0
  524. package/node_modules/undici-types/global-dispatcher.d.ts +9 -0
  525. package/node_modules/undici-types/global-origin.d.ts +7 -0
  526. package/node_modules/undici-types/handlers.d.ts +15 -0
  527. package/node_modules/undici-types/header.d.ts +4 -0
  528. package/node_modules/undici-types/index.d.ts +71 -0
  529. package/node_modules/undici-types/interceptors.d.ts +17 -0
  530. package/node_modules/undici-types/mock-agent.d.ts +50 -0
  531. package/node_modules/undici-types/mock-client.d.ts +25 -0
  532. package/node_modules/undici-types/mock-errors.d.ts +12 -0
  533. package/node_modules/undici-types/mock-interceptor.d.ts +93 -0
  534. package/node_modules/undici-types/mock-pool.d.ts +25 -0
  535. package/node_modules/undici-types/package.json +55 -0
  536. package/node_modules/undici-types/patch.d.ts +33 -0
  537. package/node_modules/undici-types/pool-stats.d.ts +19 -0
  538. package/node_modules/undici-types/pool.d.ts +39 -0
  539. package/node_modules/undici-types/proxy-agent.d.ts +28 -0
  540. package/node_modules/undici-types/readable.d.ts +65 -0
  541. package/node_modules/undici-types/retry-agent.d.ts +8 -0
  542. package/node_modules/undici-types/retry-handler.d.ts +116 -0
  543. package/node_modules/undici-types/util.d.ts +18 -0
  544. package/node_modules/undici-types/webidl.d.ts +228 -0
  545. package/node_modules/undici-types/websocket.d.ts +150 -0
  546. package/node_modules/unescape/LICENSE +21 -0
  547. package/node_modules/unescape/README.md +134 -0
  548. package/node_modules/unescape/index.js +103 -0
  549. package/node_modules/unescape/package.json +67 -0
  550. package/node_modules/utility/LICENSE.txt +21 -0
  551. package/node_modules/utility/README.md +370 -0
  552. package/node_modules/utility/dist/commonjs/array.d.ts +11 -0
  553. package/node_modules/utility/dist/commonjs/array.js +46 -0
  554. package/node_modules/utility/dist/commonjs/crypto.d.ts +86 -0
  555. package/node_modules/utility/dist/commonjs/crypto.js +159 -0
  556. package/node_modules/utility/dist/commonjs/date.d.ts +63 -0
  557. package/node_modules/utility/dist/commonjs/date.js +219 -0
  558. package/node_modules/utility/dist/commonjs/fs.d.ts +6 -0
  559. package/node_modules/utility/dist/commonjs/fs.js +20 -0
  560. package/node_modules/utility/dist/commonjs/function.d.ts +12 -0
  561. package/node_modules/utility/dist/commonjs/function.js +35 -0
  562. package/node_modules/utility/dist/commonjs/index.d.ts +12 -0
  563. package/node_modules/utility/dist/commonjs/index.js +29 -0
  564. package/node_modules/utility/dist/commonjs/json.d.ts +14 -0
  565. package/node_modules/utility/dist/commonjs/json.js +41 -0
  566. package/node_modules/utility/dist/commonjs/number.d.ts +24 -0
  567. package/node_modules/utility/dist/commonjs/number.js +66 -0
  568. package/node_modules/utility/dist/commonjs/object.d.ts +20 -0
  569. package/node_modules/utility/dist/commonjs/object.js +73 -0
  570. package/node_modules/utility/dist/commonjs/optimize.d.ts +21 -0
  571. package/node_modules/utility/dist/commonjs/optimize.js +60 -0
  572. package/node_modules/utility/dist/commonjs/package.json +3 -0
  573. package/node_modules/utility/dist/commonjs/string.d.ts +29 -0
  574. package/node_modules/utility/dist/commonjs/string.js +126 -0
  575. package/node_modules/utility/dist/commonjs/timeout.d.ts +6 -0
  576. package/node_modules/utility/dist/commonjs/timeout.js +34 -0
  577. package/node_modules/utility/dist/commonjs/web.d.ts +29 -0
  578. package/node_modules/utility/dist/commonjs/web.js +61 -0
  579. package/node_modules/utility/dist/esm/array.d.ts +11 -0
  580. package/node_modules/utility/dist/esm/array.js +42 -0
  581. package/node_modules/utility/dist/esm/crypto.d.ts +86 -0
  582. package/node_modules/utility/dist/esm/crypto.js +146 -0
  583. package/node_modules/utility/dist/esm/date.d.ts +63 -0
  584. package/node_modules/utility/dist/esm/date.js +204 -0
  585. package/node_modules/utility/dist/esm/fs.d.ts +6 -0
  586. package/node_modules/utility/dist/esm/fs.js +17 -0
  587. package/node_modules/utility/dist/esm/function.d.ts +12 -0
  588. package/node_modules/utility/dist/esm/function.js +28 -0
  589. package/node_modules/utility/dist/esm/index.d.ts +12 -0
  590. package/node_modules/utility/dist/esm/index.js +13 -0
  591. package/node_modules/utility/dist/esm/json.d.ts +14 -0
  592. package/node_modules/utility/dist/esm/json.js +34 -0
  593. package/node_modules/utility/dist/esm/number.d.ts +24 -0
  594. package/node_modules/utility/dist/esm/number.js +60 -0
  595. package/node_modules/utility/dist/esm/object.d.ts +20 -0
  596. package/node_modules/utility/dist/esm/object.js +67 -0
  597. package/node_modules/utility/dist/esm/optimize.d.ts +21 -0
  598. package/node_modules/utility/dist/esm/optimize.js +54 -0
  599. package/node_modules/utility/dist/esm/package.json +3 -0
  600. package/node_modules/utility/dist/esm/string.d.ts +29 -0
  601. package/node_modules/utility/dist/esm/string.js +118 -0
  602. package/node_modules/utility/dist/esm/timeout.d.ts +6 -0
  603. package/node_modules/utility/dist/esm/timeout.js +28 -0
  604. package/node_modules/utility/dist/esm/web.d.ts +29 -0
  605. package/node_modules/utility/dist/esm/web.js +52 -0
  606. package/node_modules/utility/dist/package.json +4 -0
  607. package/node_modules/utility/package.json +85 -0
  608. package/node_modules/utility/src/array.ts +44 -0
  609. package/node_modules/utility/src/crypto.ts +160 -0
  610. package/node_modules/utility/src/date.ts +232 -0
  611. package/node_modules/utility/src/fs.ts +17 -0
  612. package/node_modules/utility/src/function.ts +30 -0
  613. package/node_modules/utility/src/index.ts +12 -0
  614. package/node_modules/utility/src/json.ts +48 -0
  615. package/node_modules/utility/src/number.ts +63 -0
  616. package/node_modules/utility/src/object.ts +72 -0
  617. package/node_modules/utility/src/optimize.ts +62 -0
  618. package/node_modules/utility/src/string.ts +132 -0
  619. package/node_modules/utility/src/timeout.ts +37 -0
  620. package/node_modules/utility/src/web.ts +53 -0
  621. package/node_modules/ylru/LICENSE +25 -0
  622. package/node_modules/ylru/README.md +120 -0
  623. package/node_modules/ylru/dist/commonjs/index.d.ts +21 -0
  624. package/node_modules/ylru/dist/commonjs/index.js +112 -0
  625. package/node_modules/ylru/dist/commonjs/package.json +3 -0
  626. package/node_modules/ylru/dist/esm/index.d.ts +21 -0
  627. package/node_modules/ylru/dist/esm/index.js +108 -0
  628. package/node_modules/ylru/dist/esm/package.json +3 -0
  629. package/node_modules/ylru/package.json +71 -0
  630. package/node_modules/ylru/src/index.ts +124 -0
  631. package/package.json +2 -2
  632. package/node_modules/@ali/cli-skills/dist/_chunks/libs/abort-controller.mjs +0 -424
  633. package/node_modules/@ali/cli-skills/dist/_chunks/libs/archiver.mjs +0 -19586
@@ -0,0 +1,162 @@
1
+ /**
2
+ * Helpers.
3
+ */
4
+
5
+ var s = 1000;
6
+ var m = s * 60;
7
+ var h = m * 60;
8
+ var d = h * 24;
9
+ var w = d * 7;
10
+ var y = d * 365.25;
11
+
12
+ /**
13
+ * Parse or format the given `val`.
14
+ *
15
+ * Options:
16
+ *
17
+ * - `long` verbose formatting [false]
18
+ *
19
+ * @param {String|Number} val
20
+ * @param {Object} [options]
21
+ * @throws {Error} throw an error if val is not a non-empty string or a number
22
+ * @return {String|Number}
23
+ * @api public
24
+ */
25
+
26
+ module.exports = function (val, options) {
27
+ options = options || {};
28
+ var type = typeof val;
29
+ if (type === 'string' && val.length > 0) {
30
+ return parse(val);
31
+ } else if (type === 'number' && isFinite(val)) {
32
+ return options.long ? fmtLong(val) : fmtShort(val);
33
+ }
34
+ throw new Error(
35
+ 'val is not a non-empty string or a valid number. val=' +
36
+ JSON.stringify(val)
37
+ );
38
+ };
39
+
40
+ /**
41
+ * Parse the given `str` and return milliseconds.
42
+ *
43
+ * @param {String} str
44
+ * @return {Number}
45
+ * @api private
46
+ */
47
+
48
+ function parse(str) {
49
+ str = String(str);
50
+ if (str.length > 100) {
51
+ return;
52
+ }
53
+ var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
54
+ str
55
+ );
56
+ if (!match) {
57
+ return;
58
+ }
59
+ var n = parseFloat(match[1]);
60
+ var type = (match[2] || 'ms').toLowerCase();
61
+ switch (type) {
62
+ case 'years':
63
+ case 'year':
64
+ case 'yrs':
65
+ case 'yr':
66
+ case 'y':
67
+ return n * y;
68
+ case 'weeks':
69
+ case 'week':
70
+ case 'w':
71
+ return n * w;
72
+ case 'days':
73
+ case 'day':
74
+ case 'd':
75
+ return n * d;
76
+ case 'hours':
77
+ case 'hour':
78
+ case 'hrs':
79
+ case 'hr':
80
+ case 'h':
81
+ return n * h;
82
+ case 'minutes':
83
+ case 'minute':
84
+ case 'mins':
85
+ case 'min':
86
+ case 'm':
87
+ return n * m;
88
+ case 'seconds':
89
+ case 'second':
90
+ case 'secs':
91
+ case 'sec':
92
+ case 's':
93
+ return n * s;
94
+ case 'milliseconds':
95
+ case 'millisecond':
96
+ case 'msecs':
97
+ case 'msec':
98
+ case 'ms':
99
+ return n;
100
+ default:
101
+ return undefined;
102
+ }
103
+ }
104
+
105
+ /**
106
+ * Short format for `ms`.
107
+ *
108
+ * @param {Number} ms
109
+ * @return {String}
110
+ * @api private
111
+ */
112
+
113
+ function fmtShort(ms) {
114
+ var msAbs = Math.abs(ms);
115
+ if (msAbs >= d) {
116
+ return Math.round(ms / d) + 'd';
117
+ }
118
+ if (msAbs >= h) {
119
+ return Math.round(ms / h) + 'h';
120
+ }
121
+ if (msAbs >= m) {
122
+ return Math.round(ms / m) + 'm';
123
+ }
124
+ if (msAbs >= s) {
125
+ return Math.round(ms / s) + 's';
126
+ }
127
+ return ms + 'ms';
128
+ }
129
+
130
+ /**
131
+ * Long format for `ms`.
132
+ *
133
+ * @param {Number} ms
134
+ * @return {String}
135
+ * @api private
136
+ */
137
+
138
+ function fmtLong(ms) {
139
+ var msAbs = Math.abs(ms);
140
+ if (msAbs >= d) {
141
+ return plural(ms, msAbs, d, 'day');
142
+ }
143
+ if (msAbs >= h) {
144
+ return plural(ms, msAbs, h, 'hour');
145
+ }
146
+ if (msAbs >= m) {
147
+ return plural(ms, msAbs, m, 'minute');
148
+ }
149
+ if (msAbs >= s) {
150
+ return plural(ms, msAbs, s, 'second');
151
+ }
152
+ return ms + ' ms';
153
+ }
154
+
155
+ /**
156
+ * Pluralization helper.
157
+ */
158
+
159
+ function plural(ms, msAbs, n, name) {
160
+ var isPlural = msAbs >= n * 1.5;
161
+ return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');
162
+ }
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2020 Vercel, Inc.
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 all
13
+ 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 THE
21
+ SOFTWARE.
@@ -0,0 +1,38 @@
1
+ {
2
+ "name": "ms",
3
+ "version": "2.1.3",
4
+ "description": "Tiny millisecond conversion utility",
5
+ "repository": "vercel/ms",
6
+ "main": "./index",
7
+ "files": [
8
+ "index.js"
9
+ ],
10
+ "scripts": {
11
+ "precommit": "lint-staged",
12
+ "lint": "eslint lib/* bin/*",
13
+ "test": "mocha tests.js"
14
+ },
15
+ "eslintConfig": {
16
+ "extends": "eslint:recommended",
17
+ "env": {
18
+ "node": true,
19
+ "es6": true
20
+ }
21
+ },
22
+ "lint-staged": {
23
+ "*.js": [
24
+ "npm run lint",
25
+ "prettier --single-quote --write",
26
+ "git add"
27
+ ]
28
+ },
29
+ "license": "MIT",
30
+ "devDependencies": {
31
+ "eslint": "4.18.2",
32
+ "expect.js": "0.3.1",
33
+ "husky": "0.14.3",
34
+ "lint-staged": "5.0.0",
35
+ "mocha": "4.0.1",
36
+ "prettier": "2.0.5"
37
+ }
38
+ }
@@ -0,0 +1,59 @@
1
+ # ms
2
+
3
+ ![CI](https://github.com/vercel/ms/workflows/CI/badge.svg)
4
+
5
+ Use this package to easily convert various time formats to milliseconds.
6
+
7
+ ## Examples
8
+
9
+ ```js
10
+ ms('2 days') // 172800000
11
+ ms('1d') // 86400000
12
+ ms('10h') // 36000000
13
+ ms('2.5 hrs') // 9000000
14
+ ms('2h') // 7200000
15
+ ms('1m') // 60000
16
+ ms('5s') // 5000
17
+ ms('1y') // 31557600000
18
+ ms('100') // 100
19
+ ms('-3 days') // -259200000
20
+ ms('-1h') // -3600000
21
+ ms('-200') // -200
22
+ ```
23
+
24
+ ### Convert from Milliseconds
25
+
26
+ ```js
27
+ ms(60000) // "1m"
28
+ ms(2 * 60000) // "2m"
29
+ ms(-3 * 60000) // "-3m"
30
+ ms(ms('10 hours')) // "10h"
31
+ ```
32
+
33
+ ### Time Format Written-Out
34
+
35
+ ```js
36
+ ms(60000, { long: true }) // "1 minute"
37
+ ms(2 * 60000, { long: true }) // "2 minutes"
38
+ ms(-3 * 60000, { long: true }) // "-3 minutes"
39
+ ms(ms('10 hours'), { long: true }) // "10 hours"
40
+ ```
41
+
42
+ ## Features
43
+
44
+ - Works both in [Node.js](https://nodejs.org) and in the browser
45
+ - If a number is supplied to `ms`, a string with a unit is returned
46
+ - If a string that contains the number is supplied, it returns it as a number (e.g.: it returns `100` for `'100'`)
47
+ - If you pass a string with a number and a valid unit, the number of equivalent milliseconds is returned
48
+
49
+ ## Related Packages
50
+
51
+ - [ms.macro](https://github.com/knpwrs/ms.macro) - Run `ms` as a macro at build-time.
52
+
53
+ ## Caught a Bug?
54
+
55
+ 1. [Fork](https://help.github.com/articles/fork-a-repo/) this repository to your own GitHub account and then [clone](https://help.github.com/articles/cloning-a-repository/) it to your local device
56
+ 2. Link the package to the global module directory: `npm link`
57
+ 3. Within the module you want to test your local development instance of ms, just link it to the dependencies: `npm link ms`. Instead of the default one from npm, Node.js will now use your clone of ms!
58
+
59
+ As always, you can run the tests using: `npm test`
@@ -0,0 +1,113 @@
1
+ declare class TimeoutErrorClass extends Error {
2
+ readonly name: 'TimeoutError';
3
+ constructor(message?: string);
4
+ }
5
+
6
+ declare namespace pTimeout {
7
+ type TimeoutError = TimeoutErrorClass;
8
+
9
+ type Options = {
10
+ /**
11
+ Custom implementations for the `setTimeout` and `clearTimeout` functions.
12
+
13
+ Useful for testing purposes, in particular to work around [`sinon.useFakeTimers()`](https://sinonjs.org/releases/latest/fake-timers/).
14
+
15
+ @example
16
+ ```
17
+ import pTimeout = require('p-timeout');
18
+ import sinon = require('sinon');
19
+
20
+ (async () => {
21
+ const originalSetTimeout = setTimeout;
22
+ const originalClearTimeout = clearTimeout;
23
+
24
+ sinon.useFakeTimers();
25
+
26
+ // Use `pTimeout` without being affected by `sinon.useFakeTimers()`:
27
+ await pTimeout(doSomething(), 2000, undefined, {
28
+ customTimers: {
29
+ setTimeout: originalSetTimeout,
30
+ clearTimeout: originalClearTimeout
31
+ }
32
+ });
33
+ })();
34
+ ```
35
+ */
36
+ readonly customTimers?: {
37
+ setTimeout: typeof global.setTimeout;
38
+ clearTimeout: typeof global.clearTimeout;
39
+ };
40
+ };
41
+ }
42
+
43
+ interface ClearablePromise<T> extends Promise<T>{
44
+ /**
45
+ Clear the timeout.
46
+ */
47
+ clear: () => void;
48
+ }
49
+
50
+ declare const pTimeout: {
51
+ TimeoutError: typeof TimeoutErrorClass;
52
+
53
+ default: typeof pTimeout;
54
+
55
+ /**
56
+ Timeout a promise after a specified amount of time.
57
+
58
+ If you pass in a cancelable promise, specifically a promise with a `.cancel()` method, that method will be called when the `pTimeout` promise times out.
59
+
60
+ @param input - Promise to decorate.
61
+ @param milliseconds - Milliseconds before timing out.
62
+ @param message - Specify a custom error message or error. If you do a custom error, it's recommended to sub-class `pTimeout.TimeoutError`. Default: `'Promise timed out after 50 milliseconds'`.
63
+ @returns A decorated `input` that times out after `milliseconds` time. It has a `.clear()` method that clears the timeout.
64
+
65
+ @example
66
+ ```
67
+ import delay = require('delay');
68
+ import pTimeout = require('p-timeout');
69
+
70
+ const delayedPromise = delay(200);
71
+
72
+ pTimeout(delayedPromise, 50).then(() => 'foo');
73
+ //=> [TimeoutError: Promise timed out after 50 milliseconds]
74
+ ```
75
+ */
76
+ <ValueType>(
77
+ input: PromiseLike<ValueType>,
78
+ milliseconds: number,
79
+ message?: string | Error,
80
+ options?: pTimeout.Options
81
+ ): ClearablePromise<ValueType>;
82
+
83
+ /**
84
+ Timeout a promise after a specified amount of time.
85
+
86
+ If you pass in a cancelable promise, specifically a promise with a `.cancel()` method, that method will be called when the `pTimeout` promise times out.
87
+
88
+ @param input - Promise to decorate.
89
+ @param milliseconds - Milliseconds before timing out. Passing `Infinity` will cause it to never time out.
90
+ @param fallback - Do something other than rejecting with an error on timeout. You could for example retry.
91
+ @returns A decorated `input` that times out after `milliseconds` time. It has a `.clear()` method that clears the timeout.
92
+
93
+ @example
94
+ ```
95
+ import delay = require('delay');
96
+ import pTimeout = require('p-timeout');
97
+
98
+ const delayedPromise = () => delay(200);
99
+
100
+ pTimeout(delayedPromise(), 50, () => {
101
+ return pTimeout(delayedPromise(), 300);
102
+ });
103
+ ```
104
+ */
105
+ <ValueType, ReturnType>(
106
+ input: PromiseLike<ValueType>,
107
+ milliseconds: number,
108
+ fallback: () => ReturnType | Promise<ReturnType>,
109
+ options?: pTimeout.Options
110
+ ): ClearablePromise<ValueType | ReturnType>;
111
+ };
112
+
113
+ export = pTimeout;
@@ -0,0 +1,71 @@
1
+ 'use strict';
2
+
3
+ class TimeoutError extends Error {
4
+ constructor(message) {
5
+ super(message);
6
+ this.name = 'TimeoutError';
7
+ }
8
+ }
9
+
10
+ const pTimeout = (promise, milliseconds, fallback, options) => {
11
+ let timer;
12
+ const cancelablePromise = new Promise((resolve, reject) => {
13
+ if (typeof milliseconds !== 'number' || milliseconds < 0) {
14
+ throw new TypeError('Expected `milliseconds` to be a positive number');
15
+ }
16
+
17
+ if (milliseconds === Infinity) {
18
+ resolve(promise);
19
+ return;
20
+ }
21
+
22
+ options = {
23
+ customTimers: {setTimeout, clearTimeout},
24
+ ...options
25
+ };
26
+
27
+ timer = options.customTimers.setTimeout.call(undefined, () => {
28
+ if (typeof fallback === 'function') {
29
+ try {
30
+ resolve(fallback());
31
+ } catch (error) {
32
+ reject(error);
33
+ }
34
+
35
+ return;
36
+ }
37
+
38
+ const message = typeof fallback === 'string' ? fallback : `Promise timed out after ${milliseconds} milliseconds`;
39
+ const timeoutError = fallback instanceof Error ? fallback : new TimeoutError(message);
40
+
41
+ if (typeof promise.cancel === 'function') {
42
+ promise.cancel();
43
+ }
44
+
45
+ reject(timeoutError);
46
+ }, milliseconds);
47
+
48
+ (async () => {
49
+ try {
50
+ resolve(await promise);
51
+ } catch (error) {
52
+ reject(error);
53
+ } finally {
54
+ options.customTimers.clearTimeout.call(undefined, timer);
55
+ }
56
+ })();
57
+ });
58
+
59
+ cancelablePromise.clear = () => {
60
+ clearTimeout(timer);
61
+ timer = undefined;
62
+ };
63
+
64
+ return cancelablePromise;
65
+ };
66
+
67
+ module.exports = pTimeout;
68
+ // TODO: Remove this for the next major release
69
+ module.exports.default = pTimeout;
70
+
71
+ module.exports.TimeoutError = TimeoutError;
@@ -0,0 +1,9 @@
1
+ MIT License
2
+
3
+ Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
+
7
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,44 @@
1
+ {
2
+ "name": "p-timeout",
3
+ "version": "4.1.0",
4
+ "description": "Timeout a promise after a specified amount of time",
5
+ "license": "MIT",
6
+ "repository": "sindresorhus/p-timeout",
7
+ "author": {
8
+ "name": "Sindre Sorhus",
9
+ "email": "sindresorhus@gmail.com",
10
+ "url": "https://sindresorhus.com"
11
+ },
12
+ "engines": {
13
+ "node": ">=10"
14
+ },
15
+ "scripts": {
16
+ "test": "xo && ava && tsd"
17
+ },
18
+ "files": [
19
+ "index.js",
20
+ "index.d.ts"
21
+ ],
22
+ "keywords": [
23
+ "promise",
24
+ "timeout",
25
+ "error",
26
+ "invalidate",
27
+ "async",
28
+ "await",
29
+ "promises",
30
+ "time",
31
+ "out",
32
+ "cancel",
33
+ "bluebird"
34
+ ],
35
+ "devDependencies": {
36
+ "ava": "^2.4.0",
37
+ "delay": "^4.4.0",
38
+ "p-cancelable": "^2.0.0",
39
+ "tsd": "^0.13.1",
40
+ "xo": "^0.35.0",
41
+ "in-range": "^2.0.0",
42
+ "time-span": "^4.0.0"
43
+ }
44
+ }
@@ -0,0 +1,117 @@
1
+ # p-timeout
2
+
3
+ > Timeout a promise after a specified amount of time
4
+
5
+ ## Install
6
+
7
+ ```
8
+ $ npm install p-timeout
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ```js
14
+ const delay = require('delay');
15
+ const pTimeout = require('p-timeout');
16
+
17
+ const delayedPromise = delay(200);
18
+
19
+ pTimeout(delayedPromise, 50).then(() => 'foo');
20
+ //=> [TimeoutError: Promise timed out after 50 milliseconds]
21
+ ```
22
+
23
+ ## API
24
+
25
+ ### pTimeout(input, milliseconds, message?, options?)
26
+ ### pTimeout(input, milliseconds, fallback?, options?)
27
+
28
+ Returns a decorated `input` that times out after `milliseconds` time. It has a `.clear()` method that clears the timeout.
29
+
30
+ If you pass in a cancelable promise, specifically a promise with a `.cancel()` method, that method will be called when the `pTimeout` promise times out.
31
+
32
+ #### input
33
+
34
+ Type: `Promise`
35
+
36
+ Promise to decorate.
37
+
38
+ #### milliseconds
39
+
40
+ Type: `number`
41
+
42
+ Milliseconds before timing out.
43
+
44
+ Passing `Infinity` will cause it to never time out.
45
+
46
+ #### message
47
+
48
+ Type: `string | Error`\
49
+ Default: `'Promise timed out after 50 milliseconds'`
50
+
51
+ Specify a custom error message or error.
52
+
53
+ If you do a custom error, it's recommended to sub-class `pTimeout.TimeoutError`.
54
+
55
+ #### fallback
56
+
57
+ Type: `Function`
58
+
59
+ Do something other than rejecting with an error on timeout.
60
+
61
+ You could for example retry:
62
+
63
+ ```js
64
+ const delay = require('delay');
65
+ const pTimeout = require('p-timeout');
66
+
67
+ const delayedPromise = () => delay(200);
68
+
69
+ pTimeout(delayedPromise(), 50, () => {
70
+ return pTimeout(delayedPromise(), 300);
71
+ });
72
+ ```
73
+
74
+ #### options
75
+
76
+ Type: `object`
77
+
78
+ ##### customTimers
79
+
80
+ Type: `object` with function properties `setTimeout` and `clearTimeout`
81
+
82
+ Custom implementations for the `setTimeout` and `clearTimeout` functions.
83
+
84
+ Useful for testing purposes, in particular to work around [`sinon.useFakeTimers()`](https://sinonjs.org/releases/latest/fake-timers/).
85
+
86
+ Example:
87
+
88
+ ```js
89
+ const pTimeout = require('p-timeout');
90
+ const sinon = require('sinon');
91
+
92
+ (async () => {
93
+ const originalSetTimeout = setTimeout;
94
+ const originalClearTimeout = clearTimeout;
95
+
96
+ sinon.useFakeTimers();
97
+
98
+ // Use `pTimeout` without being affected by `sinon.useFakeTimers()`:
99
+ await pTimeout(doSomething(), 2000, undefined, {
100
+ customTimers: {
101
+ setTimeout: originalSetTimeout,
102
+ clearTimeout: originalClearTimeout
103
+ }
104
+ });
105
+ })();
106
+ ```
107
+
108
+ ### pTimeout.TimeoutError
109
+
110
+ Exposed for instance checking and sub-classing.
111
+
112
+ ## Related
113
+
114
+ - [delay](https://github.com/sindresorhus/delay) - Delay a promise a specified amount of time
115
+ - [p-min-delay](https://github.com/sindresorhus/p-min-delay) - Delay a promise a minimum amount of time
116
+ - [p-retry](https://github.com/sindresorhus/p-retry) - Retry a promise-returning function
117
+ - [More…](https://github.com/sindresorhus/promise-fun)
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2018 Nikita Skovoroda <chalkerx@gmail.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 all
13
+ 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 THE
21
+ SOFTWARE.