@openclaw/feishu 2026.6.8 → 2026.6.9-beta.1

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 (281) hide show
  1. package/dist/api.js +78 -23
  2. package/dist/{channel-DwygSth-.js → channel-C9mW5kaS.js} +2 -2
  3. package/dist/channel-plugin-api.js +1 -1
  4. package/dist/{channel.runtime-CrqKcXaU.js → channel.runtime-BgUhHAja.js} +3 -3
  5. package/dist/{drive-8o3Omlnd.js → drive-9UfpmY27.js} +15 -2
  6. package/dist/{monitor-_1eNsUVp.js → monitor-BayUOr_U.js} +1 -1
  7. package/dist/{monitor.account-BhoLA1Y0.js → monitor.account-DzZWj0ob.js} +92 -48
  8. package/dist/{send-B3kteMF8.js → send-BozRcrbz.js} +32 -24
  9. package/dist/setup-api.js +1 -1
  10. package/node_modules/@protobufjs/aspromise/LICENSE +26 -0
  11. package/node_modules/@protobufjs/aspromise/README.md +13 -0
  12. package/node_modules/{protobufjs/src/util/aspromise.d.ts → @protobufjs/aspromise/index.d.ts} +13 -13
  13. package/node_modules/{protobufjs/src/util/aspromise.js → @protobufjs/aspromise/index.js} +52 -52
  14. package/node_modules/@protobufjs/aspromise/package.json +21 -0
  15. package/node_modules/@protobufjs/aspromise/tests/index.js +130 -0
  16. package/node_modules/@protobufjs/base64/LICENSE +26 -0
  17. package/node_modules/@protobufjs/base64/README.md +19 -0
  18. package/node_modules/{protobufjs/src/util/base64.d.ts → @protobufjs/base64/index.d.ts} +32 -32
  19. package/node_modules/{protobufjs/src/util/base64.js → @protobufjs/base64/index.js} +139 -146
  20. package/node_modules/@protobufjs/base64/package.json +21 -0
  21. package/node_modules/@protobufjs/base64/tests/index.js +46 -0
  22. package/node_modules/@protobufjs/codegen/LICENSE +26 -0
  23. package/node_modules/@protobufjs/codegen/README.md +49 -0
  24. package/node_modules/{protobufjs/src/util/codegen.d.ts → @protobufjs/codegen/index.d.ts} +31 -31
  25. package/node_modules/{protobufjs/src/util/codegen.js → @protobufjs/codegen/index.js} +112 -113
  26. package/node_modules/@protobufjs/codegen/package.json +13 -0
  27. package/node_modules/@protobufjs/codegen/tests/index.js +13 -0
  28. package/node_modules/@protobufjs/eventemitter/CHANGELOG.md +8 -0
  29. package/node_modules/@protobufjs/eventemitter/LICENSE +26 -0
  30. package/node_modules/@protobufjs/eventemitter/README.md +22 -0
  31. package/node_modules/{protobufjs/src/util/eventemitter.d.ts → @protobufjs/eventemitter/index.d.ts} +45 -45
  32. package/node_modules/{protobufjs/src/util/eventemitter.js → @protobufjs/eventemitter/index.js} +86 -86
  33. package/node_modules/@protobufjs/eventemitter/package.json +21 -0
  34. package/node_modules/@protobufjs/eventemitter/tests/index.js +83 -0
  35. package/node_modules/@protobufjs/fetch/CHANGELOG.md +8 -0
  36. package/node_modules/@protobufjs/fetch/LICENSE +26 -0
  37. package/node_modules/@protobufjs/fetch/README.md +13 -0
  38. package/node_modules/{protobufjs/src/util/fetch.d.ts → @protobufjs/fetch/index.d.ts} +56 -56
  39. package/node_modules/{protobufjs/src/util/fetch.js → @protobufjs/fetch/index.js} +112 -112
  40. package/node_modules/@protobufjs/fetch/package.json +27 -0
  41. package/node_modules/@protobufjs/fetch/tests/data/file.txt +1 -0
  42. package/node_modules/@protobufjs/fetch/tests/index.js +158 -0
  43. package/node_modules/@protobufjs/fetch/util/fs.js +11 -0
  44. package/node_modules/@protobufjs/float/LICENSE +26 -0
  45. package/node_modules/@protobufjs/float/README.md +102 -0
  46. package/node_modules/@protobufjs/float/bench/index.js +87 -0
  47. package/node_modules/@protobufjs/float/bench/suite.js +46 -0
  48. package/node_modules/{protobufjs/src/util/float.js → @protobufjs/float/index.js} +335 -335
  49. package/node_modules/@protobufjs/float/package.json +26 -0
  50. package/node_modules/@protobufjs/float/tests/index.js +100 -0
  51. package/node_modules/@protobufjs/inquire/CHANGELOG.md +8 -0
  52. package/node_modules/@protobufjs/inquire/LICENSE +26 -0
  53. package/node_modules/@protobufjs/inquire/README.md +13 -0
  54. package/node_modules/{protobufjs/src/util/inquire.d.ts → @protobufjs/inquire/index.d.ts} +10 -10
  55. package/node_modules/{protobufjs/src/util/inquire.js → @protobufjs/inquire/index.js} +38 -38
  56. package/node_modules/@protobufjs/inquire/package.json +21 -0
  57. package/node_modules/@protobufjs/inquire/tests/data/array.js +1 -0
  58. package/node_modules/@protobufjs/inquire/tests/data/emptyArray.js +1 -0
  59. package/node_modules/@protobufjs/inquire/tests/data/emptyObject.js +1 -0
  60. package/node_modules/@protobufjs/inquire/tests/data/object.js +1 -0
  61. package/node_modules/@protobufjs/inquire/tests/index.js +20 -0
  62. package/node_modules/@protobufjs/path/LICENSE +26 -0
  63. package/node_modules/@protobufjs/path/README.md +19 -0
  64. package/node_modules/{protobufjs/src/util/path.d.ts → @protobufjs/path/index.d.ts} +22 -22
  65. package/node_modules/{protobufjs/src/util/path.js → @protobufjs/path/index.js} +65 -72
  66. package/node_modules/@protobufjs/path/package.json +21 -0
  67. package/node_modules/@protobufjs/path/tests/index.js +60 -0
  68. package/node_modules/@protobufjs/pool/.npmignore +3 -0
  69. package/node_modules/@protobufjs/pool/LICENSE +26 -0
  70. package/node_modules/@protobufjs/pool/README.md +13 -0
  71. package/node_modules/{protobufjs/src/util/pool.d.ts → @protobufjs/pool/index.d.ts} +32 -32
  72. package/node_modules/{protobufjs/src/util/pool.js → @protobufjs/pool/index.js} +48 -48
  73. package/node_modules/@protobufjs/pool/package.json +21 -0
  74. package/node_modules/@protobufjs/pool/tests/index.js +33 -0
  75. package/node_modules/@protobufjs/utf8/LICENSE +26 -0
  76. package/node_modules/@protobufjs/utf8/README.md +20 -0
  77. package/node_modules/{protobufjs/src/util/utf8.d.ts → @protobufjs/utf8/index.d.ts} +24 -24
  78. package/node_modules/{protobufjs/src/util/utf8.js → @protobufjs/utf8/index.js} +104 -130
  79. package/node_modules/@protobufjs/utf8/package.json +21 -0
  80. package/node_modules/@protobufjs/utf8/tests/data/surrogate_pair_bug.txt +207 -0
  81. package/node_modules/@protobufjs/utf8/tests/data/utf8.txt +216 -0
  82. package/node_modules/@protobufjs/utf8/tests/index.js +74 -0
  83. package/node_modules/@types/node/LICENSE +21 -0
  84. package/node_modules/@types/node/README.md +15 -0
  85. package/node_modules/@types/node/assert/strict.d.ts +59 -0
  86. package/node_modules/@types/node/assert.d.ts +950 -0
  87. package/node_modules/@types/node/async_hooks.d.ts +711 -0
  88. package/node_modules/@types/node/buffer.buffer.d.ts +466 -0
  89. package/node_modules/@types/node/buffer.d.ts +1765 -0
  90. package/node_modules/@types/node/child_process.d.ts +1366 -0
  91. package/node_modules/@types/node/cluster.d.ts +432 -0
  92. package/node_modules/@types/node/compatibility/iterators.d.ts +21 -0
  93. package/node_modules/@types/node/console.d.ts +93 -0
  94. package/node_modules/@types/node/constants.d.ts +14 -0
  95. package/node_modules/@types/node/crypto.d.ts +4058 -0
  96. package/node_modules/@types/node/dgram.d.ts +537 -0
  97. package/node_modules/@types/node/diagnostics_channel.d.ts +552 -0
  98. package/node_modules/@types/node/dns/promises.d.ts +497 -0
  99. package/node_modules/@types/node/dns.d.ts +876 -0
  100. package/node_modules/@types/node/domain.d.ts +150 -0
  101. package/node_modules/@types/node/events.d.ts +1008 -0
  102. package/node_modules/@types/node/fs/promises.d.ts +1468 -0
  103. package/node_modules/@types/node/fs.d.ts +4780 -0
  104. package/node_modules/@types/node/globals.d.ts +150 -0
  105. package/node_modules/@types/node/globals.typedarray.d.ts +101 -0
  106. package/node_modules/@types/node/http.d.ts +2147 -0
  107. package/node_modules/@types/node/http2.d.ts +2485 -0
  108. package/node_modules/@types/node/https.d.ts +400 -0
  109. package/node_modules/@types/node/index.d.ts +117 -0
  110. package/node_modules/@types/node/inspector/promises.d.ts +35 -0
  111. package/node_modules/@types/node/inspector.d.ts +264 -0
  112. package/node_modules/@types/node/inspector.generated.d.ts +4406 -0
  113. package/node_modules/@types/node/module.d.ts +755 -0
  114. package/node_modules/@types/node/net.d.ts +970 -0
  115. package/node_modules/@types/node/os.d.ts +498 -0
  116. package/node_modules/@types/node/package.json +155 -0
  117. package/node_modules/@types/node/path/posix.d.ts +8 -0
  118. package/node_modules/@types/node/path/win32.d.ts +8 -0
  119. package/node_modules/@types/node/path.d.ts +178 -0
  120. package/node_modules/@types/node/perf_hooks.d.ts +612 -0
  121. package/node_modules/@types/node/process.d.ts +2204 -0
  122. package/node_modules/@types/node/punycode.d.ts +89 -0
  123. package/node_modules/@types/node/querystring.d.ts +139 -0
  124. package/node_modules/@types/node/quic.d.ts +897 -0
  125. package/node_modules/@types/node/readline/promises.d.ts +158 -0
  126. package/node_modules/@types/node/readline.d.ts +507 -0
  127. package/node_modules/@types/node/repl.d.ts +420 -0
  128. package/node_modules/@types/node/sea.d.ts +47 -0
  129. package/node_modules/@types/node/sqlite.d.ts +1068 -0
  130. package/node_modules/@types/node/stream/consumers.d.ts +114 -0
  131. package/node_modules/@types/node/stream/iter.d.ts +301 -0
  132. package/node_modules/@types/node/stream/promises.d.ts +211 -0
  133. package/node_modules/@types/node/stream/web.d.ts +300 -0
  134. package/node_modules/@types/node/stream.d.ts +1774 -0
  135. package/node_modules/@types/node/string_decoder.d.ts +27 -0
  136. package/node_modules/@types/node/test/reporters.d.ts +59 -0
  137. package/node_modules/@types/node/test.d.ts +2279 -0
  138. package/node_modules/@types/node/timers/promises.d.ts +93 -0
  139. package/node_modules/@types/node/timers.d.ts +149 -0
  140. package/node_modules/@types/node/tls.d.ts +1193 -0
  141. package/node_modules/@types/node/trace_events.d.ts +103 -0
  142. package/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +462 -0
  143. package/node_modules/@types/node/ts5.6/compatibility/float16array.d.ts +71 -0
  144. package/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +36 -0
  145. package/node_modules/@types/node/ts5.6/index.d.ts +119 -0
  146. package/node_modules/@types/node/ts5.7/compatibility/float16array.d.ts +72 -0
  147. package/node_modules/@types/node/ts5.7/index.d.ts +119 -0
  148. package/node_modules/@types/node/tty.d.ts +225 -0
  149. package/node_modules/@types/node/url.d.ts +556 -0
  150. package/node_modules/@types/node/util/types.d.ts +558 -0
  151. package/node_modules/@types/node/util.d.ts +1677 -0
  152. package/node_modules/@types/node/v8.d.ts +980 -0
  153. package/node_modules/@types/node/vm.d.ts +1136 -0
  154. package/node_modules/@types/node/wasi.d.ts +131 -0
  155. package/node_modules/@types/node/web-globals/abortcontroller.d.ts +59 -0
  156. package/node_modules/@types/node/web-globals/blob.d.ts +23 -0
  157. package/node_modules/@types/node/web-globals/console.d.ts +9 -0
  158. package/node_modules/@types/node/web-globals/crypto.d.ts +39 -0
  159. package/node_modules/@types/node/web-globals/domexception.d.ts +68 -0
  160. package/node_modules/@types/node/web-globals/encoding.d.ts +11 -0
  161. package/node_modules/@types/node/web-globals/events.d.ts +106 -0
  162. package/node_modules/@types/node/web-globals/fetch.d.ts +69 -0
  163. package/node_modules/@types/node/web-globals/importmeta.d.ts +13 -0
  164. package/node_modules/@types/node/web-globals/messaging.d.ts +23 -0
  165. package/node_modules/@types/node/web-globals/navigator.d.ts +25 -0
  166. package/node_modules/@types/node/web-globals/performance.d.ts +45 -0
  167. package/node_modules/@types/node/web-globals/storage.d.ts +24 -0
  168. package/node_modules/@types/node/web-globals/streams.d.ts +115 -0
  169. package/node_modules/@types/node/web-globals/timers.d.ts +44 -0
  170. package/node_modules/@types/node/web-globals/url.d.ts +24 -0
  171. package/node_modules/@types/node/worker_threads.d.ts +671 -0
  172. package/node_modules/@types/node/zlib/iter.d.ts +131 -0
  173. package/node_modules/@types/node/zlib.d.ts +589 -0
  174. package/node_modules/protobufjs/README.md +556 -263
  175. package/node_modules/protobufjs/dist/light/protobuf.js +1569 -1919
  176. package/node_modules/protobufjs/dist/light/protobuf.js.map +1 -1
  177. package/node_modules/protobufjs/dist/light/protobuf.min.js +3 -3
  178. package/node_modules/protobufjs/dist/light/protobuf.min.js.map +1 -1
  179. package/node_modules/protobufjs/dist/minimal/protobuf.js +906 -1132
  180. package/node_modules/protobufjs/dist/minimal/protobuf.js.map +1 -1
  181. package/node_modules/protobufjs/dist/minimal/protobuf.min.js +3 -3
  182. package/node_modules/protobufjs/dist/minimal/protobuf.min.js.map +1 -1
  183. package/node_modules/protobufjs/dist/protobuf.js +1576 -1993
  184. package/node_modules/protobufjs/dist/protobuf.js.map +1 -1
  185. package/node_modules/protobufjs/dist/protobuf.min.js +3 -3
  186. package/node_modules/protobufjs/dist/protobuf.min.js.map +1 -1
  187. package/node_modules/protobufjs/ext/descriptor/README.md +70 -3
  188. package/node_modules/protobufjs/ext/descriptor/index.d.ts +193 -0
  189. package/node_modules/protobufjs/ext/descriptor/index.js +1185 -1
  190. package/node_modules/protobufjs/ext/descriptor/test.js +54 -0
  191. package/node_modules/protobufjs/index.d.ts +720 -834
  192. package/node_modules/protobufjs/package.json +44 -20
  193. package/node_modules/protobufjs/src/converter.js +36 -60
  194. package/node_modules/protobufjs/src/decoder.js +53 -124
  195. package/node_modules/protobufjs/src/encoder.js +2 -10
  196. package/node_modules/protobufjs/src/enum.js +3 -8
  197. package/node_modules/protobufjs/src/field.js +11 -13
  198. package/node_modules/protobufjs/src/index-light.js +1 -1
  199. package/node_modules/protobufjs/src/mapfield.js +0 -1
  200. package/node_modules/protobufjs/src/message.js +11 -5
  201. package/node_modules/protobufjs/src/method.js +4 -5
  202. package/node_modules/protobufjs/src/namespace.js +3 -10
  203. package/node_modules/protobufjs/src/object.js +20 -20
  204. package/node_modules/protobufjs/src/oneof.js +0 -3
  205. package/node_modules/protobufjs/src/parse.js +16 -78
  206. package/node_modules/protobufjs/src/reader.js +31 -136
  207. package/node_modules/protobufjs/src/reader_buffer.js +3 -24
  208. package/node_modules/protobufjs/src/root.js +3 -7
  209. package/node_modules/protobufjs/src/roots.js +1 -1
  210. package/node_modules/protobufjs/src/service.js +6 -13
  211. package/node_modules/protobufjs/src/tokenize.js +1 -6
  212. package/node_modules/protobufjs/src/type.js +30 -44
  213. package/node_modules/protobufjs/src/typescript.jsdoc +15 -0
  214. package/node_modules/protobufjs/src/util/minimal.js +12 -36
  215. package/node_modules/protobufjs/src/util.js +17 -6
  216. package/node_modules/protobufjs/src/verifier.js +6 -6
  217. package/node_modules/protobufjs/src/wrappers.js +1 -0
  218. package/node_modules/protobufjs/src/writer.js +16 -42
  219. package/node_modules/protobufjs/src/writer_buffer.js +1 -18
  220. package/node_modules/protobufjs/tsconfig.json +5 -3
  221. package/node_modules/undici-types/LICENSE +21 -0
  222. package/node_modules/undici-types/README.md +6 -0
  223. package/node_modules/undici-types/agent.d.ts +32 -0
  224. package/node_modules/undici-types/api.d.ts +43 -0
  225. package/node_modules/undici-types/balanced-pool.d.ts +30 -0
  226. package/node_modules/undici-types/cache-interceptor.d.ts +179 -0
  227. package/node_modules/undici-types/cache.d.ts +36 -0
  228. package/node_modules/undici-types/client-stats.d.ts +15 -0
  229. package/node_modules/undici-types/client.d.ts +123 -0
  230. package/node_modules/undici-types/connector.d.ts +36 -0
  231. package/node_modules/undici-types/content-type.d.ts +21 -0
  232. package/node_modules/undici-types/cookies.d.ts +30 -0
  233. package/node_modules/undici-types/diagnostics-channel.d.ts +74 -0
  234. package/node_modules/undici-types/dispatcher.d.ts +279 -0
  235. package/node_modules/undici-types/env-http-proxy-agent.d.ts +22 -0
  236. package/node_modules/undici-types/errors.d.ts +177 -0
  237. package/node_modules/undici-types/eventsource.d.ts +66 -0
  238. package/node_modules/undici-types/fetch.d.ts +211 -0
  239. package/node_modules/undici-types/formdata.d.ts +108 -0
  240. package/node_modules/undici-types/global-dispatcher.d.ts +9 -0
  241. package/node_modules/undici-types/global-origin.d.ts +7 -0
  242. package/node_modules/undici-types/h2c-client.d.ts +73 -0
  243. package/node_modules/undici-types/handlers.d.ts +15 -0
  244. package/node_modules/undici-types/header.d.ts +160 -0
  245. package/node_modules/undici-types/index.d.ts +91 -0
  246. package/node_modules/undici-types/interceptors.d.ts +80 -0
  247. package/node_modules/undici-types/mock-agent.d.ts +68 -0
  248. package/node_modules/undici-types/mock-call-history.d.ts +111 -0
  249. package/node_modules/undici-types/mock-client.d.ts +27 -0
  250. package/node_modules/undici-types/mock-errors.d.ts +12 -0
  251. package/node_modules/undici-types/mock-interceptor.d.ts +94 -0
  252. package/node_modules/undici-types/mock-pool.d.ts +27 -0
  253. package/node_modules/undici-types/package.json +55 -0
  254. package/node_modules/undici-types/patch.d.ts +29 -0
  255. package/node_modules/undici-types/pool-stats.d.ts +19 -0
  256. package/node_modules/undici-types/pool.d.ts +41 -0
  257. package/node_modules/undici-types/proxy-agent.d.ts +29 -0
  258. package/node_modules/undici-types/readable.d.ts +68 -0
  259. package/node_modules/undici-types/retry-agent.d.ts +8 -0
  260. package/node_modules/undici-types/retry-handler.d.ts +125 -0
  261. package/node_modules/undici-types/round-robin-pool.d.ts +41 -0
  262. package/node_modules/undici-types/snapshot-agent.d.ts +109 -0
  263. package/node_modules/undici-types/socks5-proxy-agent.d.ts +25 -0
  264. package/node_modules/undici-types/util.d.ts +18 -0
  265. package/node_modules/undici-types/utility.d.ts +7 -0
  266. package/node_modules/undici-types/webidl.d.ts +347 -0
  267. package/node_modules/undici-types/websocket.d.ts +188 -0
  268. package/npm-shrinkwrap.json +95 -6
  269. package/package.json +4 -4
  270. package/skills/feishu-wiki/SKILL.md +10 -1
  271. package/node_modules/protobufjs/ext/README.md +0 -81
  272. package/node_modules/protobufjs/ext/descriptor.d.ts +0 -86
  273. package/node_modules/protobufjs/ext/descriptor.generated.d.ts +0 -409
  274. package/node_modules/protobufjs/ext/descriptor.js +0 -1266
  275. package/node_modules/protobufjs/ext/textformat.d.ts +0 -19
  276. package/node_modules/protobufjs/ext/textformat.generated.d.ts +0 -11
  277. package/node_modules/protobufjs/ext/textformat.js +0 -1235
  278. package/node_modules/protobufjs/google/protobuf/compiler/plugin.json +0 -126
  279. package/node_modules/protobufjs/google/protobuf/compiler/plugin.proto +0 -47
  280. package/node_modules/protobufjs/src/typescript.js +0 -25
  281. /package/node_modules/{protobufjs/src/util/float.d.ts → @protobufjs/float/index.d.ts} +0 -0
@@ -0,0 +1,55 @@
1
+ {
2
+ "name": "undici-types",
3
+ "version": "7.24.6",
4
+ "description": "A stand-alone types package for Undici",
5
+ "homepage": "https://undici.nodejs.org",
6
+ "bugs": {
7
+ "url": "https://github.com/nodejs/undici/issues"
8
+ },
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "git+https://github.com/nodejs/undici.git"
12
+ },
13
+ "license": "MIT",
14
+ "types": "index.d.ts",
15
+ "files": [
16
+ "*.d.ts"
17
+ ],
18
+ "contributors": [
19
+ {
20
+ "name": "Daniele Belardi",
21
+ "url": "https://github.com/dnlup",
22
+ "author": true
23
+ },
24
+ {
25
+ "name": "Ethan Arrowood",
26
+ "url": "https://github.com/ethan-arrowood",
27
+ "author": true
28
+ },
29
+ {
30
+ "name": "Matteo Collina",
31
+ "url": "https://github.com/mcollina",
32
+ "author": true
33
+ },
34
+ {
35
+ "name": "Matthew Aitken",
36
+ "url": "https://github.com/KhafraDev",
37
+ "author": true
38
+ },
39
+ {
40
+ "name": "Robert Nagy",
41
+ "url": "https://github.com/ronag",
42
+ "author": true
43
+ },
44
+ {
45
+ "name": "Szymon Marczak",
46
+ "url": "https://github.com/szmarczak",
47
+ "author": true
48
+ },
49
+ {
50
+ "name": "Tomas Della Vedova",
51
+ "url": "https://github.com/delvedor",
52
+ "author": true
53
+ }
54
+ ]
55
+ }
@@ -0,0 +1,29 @@
1
+ /// <reference types="node" />
2
+
3
+ // See https://github.com/nodejs/undici/issues/1740
4
+
5
+ export interface EventInit {
6
+ bubbles?: boolean
7
+ cancelable?: boolean
8
+ composed?: boolean
9
+ }
10
+
11
+ export interface EventListenerOptions {
12
+ capture?: boolean
13
+ }
14
+
15
+ export interface AddEventListenerOptions extends EventListenerOptions {
16
+ once?: boolean
17
+ passive?: boolean
18
+ signal?: AbortSignal
19
+ }
20
+
21
+ export type EventListenerOrEventListenerObject = EventListener | EventListenerObject
22
+
23
+ export interface EventListenerObject {
24
+ handleEvent (object: Event): void
25
+ }
26
+
27
+ export interface EventListener {
28
+ (evt: Event): void
29
+ }
@@ -0,0 +1,19 @@
1
+ import Pool from './pool'
2
+
3
+ export default PoolStats
4
+
5
+ declare class PoolStats {
6
+ constructor (pool: Pool)
7
+ /** Number of open socket connections in this pool. */
8
+ connected: number
9
+ /** Number of open socket connections in this pool that do not have an active request. */
10
+ free: number
11
+ /** Number of pending requests across all clients in this pool. */
12
+ pending: number
13
+ /** Number of queued requests across all clients in this pool. */
14
+ queued: number
15
+ /** Number of currently active requests across all clients in this pool. */
16
+ running: number
17
+ /** Number of active, pending, or queued requests across all clients in this pool. */
18
+ size: number
19
+ }
@@ -0,0 +1,41 @@
1
+ import Client from './client'
2
+ import TPoolStats from './pool-stats'
3
+ import { URL } from 'node:url'
4
+ import Dispatcher from './dispatcher'
5
+
6
+ export default Pool
7
+
8
+ type PoolConnectOptions = Omit<Dispatcher.ConnectOptions, 'origin'>
9
+
10
+ declare class Pool extends Dispatcher {
11
+ constructor (url: string | URL, options?: Pool.Options)
12
+ /** `true` after `pool.close()` has been called. */
13
+ closed: boolean
14
+ /** `true` after `pool.destroyed()` has been called or `pool.close()` has been called and the pool shutdown has completed. */
15
+ destroyed: boolean
16
+ /** Aggregate stats for a Pool. */
17
+ readonly stats: TPoolStats
18
+
19
+ // Override dispatcher APIs.
20
+ override connect (
21
+ options: PoolConnectOptions
22
+ ): Promise<Dispatcher.ConnectData>
23
+ override connect (
24
+ options: PoolConnectOptions,
25
+ callback: (err: Error | null, data: Dispatcher.ConnectData) => void
26
+ ): void
27
+ }
28
+
29
+ declare namespace Pool {
30
+ export type PoolStats = TPoolStats
31
+ export interface Options extends Client.Options {
32
+ /** Default: `(origin, opts) => new Client(origin, opts)`. */
33
+ factory?(origin: URL, opts: object): Dispatcher;
34
+ /** The max number of clients to create. `null` if no limit. Default `null`. */
35
+ connections?: number | null;
36
+ /** The amount of time before a client is removed from the pool and closed. `null` if no time limit. Default `null` */
37
+ clientTtl?: number | null;
38
+
39
+ interceptors?: { Pool?: readonly Dispatcher.DispatchInterceptor[] } & Client.Options['interceptors']
40
+ }
41
+ }
@@ -0,0 +1,29 @@
1
+ import Agent from './agent'
2
+ import buildConnector from './connector'
3
+ import Dispatcher from './dispatcher'
4
+ import { IncomingHttpHeaders } from './header'
5
+
6
+ export default ProxyAgent
7
+
8
+ declare class ProxyAgent extends Dispatcher {
9
+ constructor (options: ProxyAgent.Options | string)
10
+
11
+ dispatch (options: Agent.DispatchOptions, handler: Dispatcher.DispatchHandler): boolean
12
+ close (): Promise<void>
13
+ }
14
+
15
+ declare namespace ProxyAgent {
16
+ export interface Options extends Agent.Options {
17
+ uri: string;
18
+ /**
19
+ * @deprecated use opts.token
20
+ */
21
+ auth?: string;
22
+ token?: string;
23
+ headers?: IncomingHttpHeaders;
24
+ requestTls?: buildConnector.BuildOptions;
25
+ proxyTls?: buildConnector.BuildOptions;
26
+ clientFactory?(origin: URL, opts: object): Dispatcher;
27
+ proxyTunnel?: boolean;
28
+ }
29
+ }
@@ -0,0 +1,68 @@
1
+ import { Readable } from 'node:stream'
2
+ import { Blob } from 'node:buffer'
3
+
4
+ export default BodyReadable
5
+
6
+ declare class BodyReadable extends Readable {
7
+ constructor (opts: {
8
+ resume: (this: Readable, size: number) => void | null;
9
+ abort: () => void | null;
10
+ contentType?: string;
11
+ contentLength?: number;
12
+ highWaterMark?: number;
13
+ })
14
+
15
+ /** Consumes and returns the body as a string
16
+ * https://fetch.spec.whatwg.org/#dom-body-text
17
+ */
18
+ text (): Promise<string>
19
+
20
+ /** Consumes and returns the body as a JavaScript Object
21
+ * https://fetch.spec.whatwg.org/#dom-body-json
22
+ */
23
+ json (): Promise<unknown>
24
+
25
+ /** Consumes and returns the body as a Blob
26
+ * https://fetch.spec.whatwg.org/#dom-body-blob
27
+ */
28
+ blob (): Promise<Blob>
29
+
30
+ /** Consumes and returns the body as an Uint8Array
31
+ * https://fetch.spec.whatwg.org/#dom-body-bytes
32
+ */
33
+ bytes (): Promise<Uint8Array>
34
+
35
+ /** Consumes and returns the body as an ArrayBuffer
36
+ * https://fetch.spec.whatwg.org/#dom-body-arraybuffer
37
+ */
38
+ arrayBuffer (): Promise<ArrayBuffer>
39
+
40
+ /** Not implemented
41
+ *
42
+ * https://fetch.spec.whatwg.org/#dom-body-formdata
43
+ */
44
+ formData (): Promise<never>
45
+
46
+ /** Returns true if the body is not null and the body has been consumed
47
+ *
48
+ * Otherwise, returns false
49
+ *
50
+ * https://fetch.spec.whatwg.org/#dom-body-bodyused
51
+ */
52
+ readonly bodyUsed: boolean
53
+
54
+ /**
55
+ * If body is null, it should return null as the body
56
+ *
57
+ * If body is not null, should return the body as a ReadableStream
58
+ *
59
+ * https://fetch.spec.whatwg.org/#dom-body-body
60
+ */
61
+ readonly body: never | undefined
62
+
63
+ /** Dumps the response body by reading `limit` number of bytes.
64
+ * @param opts.limit Number of bytes to read (optional) - Default: 131072
65
+ * @param opts.signal AbortSignal to cancel the operation (optional)
66
+ */
67
+ dump (opts?: { limit: number; signal?: AbortSignal }): Promise<void>
68
+ }
@@ -0,0 +1,8 @@
1
+ import Dispatcher from './dispatcher'
2
+ import RetryHandler from './retry-handler'
3
+
4
+ export default RetryAgent
5
+
6
+ declare class RetryAgent extends Dispatcher {
7
+ constructor (dispatcher: Dispatcher, options?: RetryHandler.RetryOptions)
8
+ }
@@ -0,0 +1,125 @@
1
+ import Dispatcher from './dispatcher'
2
+
3
+ export default RetryHandler
4
+
5
+ declare class RetryHandler implements Dispatcher.DispatchHandler {
6
+ constructor (
7
+ options: Dispatcher.DispatchOptions & {
8
+ retryOptions?: RetryHandler.RetryOptions;
9
+ },
10
+ retryHandlers: RetryHandler.RetryHandlers
11
+ )
12
+ }
13
+
14
+ declare namespace RetryHandler {
15
+ export type RetryState = { counter: number; }
16
+
17
+ export type RetryContext = {
18
+ state: RetryState;
19
+ opts: Dispatcher.DispatchOptions & {
20
+ retryOptions?: RetryHandler.RetryOptions;
21
+ };
22
+ }
23
+
24
+ export type OnRetryCallback = (result?: Error | null) => void
25
+
26
+ export type RetryCallback = (
27
+ err: Error,
28
+ context: {
29
+ state: RetryState;
30
+ opts: Dispatcher.DispatchOptions & {
31
+ retryOptions?: RetryHandler.RetryOptions;
32
+ };
33
+ },
34
+ callback: OnRetryCallback
35
+ ) => void
36
+
37
+ export interface RetryOptions {
38
+ /**
39
+ * If true, the retry handler will throw an error if the request fails,
40
+ * this will prevent the folling handlers from being called, and will destroy the socket.
41
+ *
42
+ * @type {boolean}
43
+ * @memberof RetryOptions
44
+ * @default true
45
+ */
46
+ throwOnError?: boolean;
47
+ /**
48
+ * Callback to be invoked on every retry iteration.
49
+ * It receives the error, current state of the retry object and the options object
50
+ * passed when instantiating the retry handler.
51
+ *
52
+ * @type {RetryCallback}
53
+ * @memberof RetryOptions
54
+ */
55
+ retry?: RetryCallback;
56
+ /**
57
+ * Maximum number of retries to allow.
58
+ *
59
+ * @type {number}
60
+ * @memberof RetryOptions
61
+ * @default 5
62
+ */
63
+ maxRetries?: number;
64
+ /**
65
+ * Max number of milliseconds allow between retries
66
+ *
67
+ * @type {number}
68
+ * @memberof RetryOptions
69
+ * @default 30000
70
+ */
71
+ maxTimeout?: number;
72
+ /**
73
+ * Initial number of milliseconds to wait before retrying for the first time.
74
+ *
75
+ * @type {number}
76
+ * @memberof RetryOptions
77
+ * @default 500
78
+ */
79
+ minTimeout?: number;
80
+ /**
81
+ * Factior to multiply the timeout factor between retries.
82
+ *
83
+ * @type {number}
84
+ * @memberof RetryOptions
85
+ * @default 2
86
+ */
87
+ timeoutFactor?: number;
88
+ /**
89
+ * It enables to automatically infer timeout between retries based on the `Retry-After` header.
90
+ *
91
+ * @type {boolean}
92
+ * @memberof RetryOptions
93
+ * @default true
94
+ */
95
+ retryAfter?: boolean;
96
+ /**
97
+ * HTTP methods to retry.
98
+ *
99
+ * @type {Dispatcher.HttpMethod[]}
100
+ * @memberof RetryOptions
101
+ * @default ['GET', 'HEAD', 'OPTIONS', 'PUT', 'DELETE', 'TRACE'],
102
+ */
103
+ methods?: Dispatcher.HttpMethod[];
104
+ /**
105
+ * Error codes to be retried. e.g. `ECONNRESET`, `ENOTFOUND`, `ETIMEDOUT`, `ECONNREFUSED`, etc.
106
+ *
107
+ * @type {string[]}
108
+ * @default ['ECONNRESET','ECONNREFUSED','ENOTFOUND','ENETDOWN','ENETUNREACH','EHOSTDOWN','EHOSTUNREACH','EPIPE']
109
+ */
110
+ errorCodes?: string[];
111
+ /**
112
+ * HTTP status codes to be retried.
113
+ *
114
+ * @type {number[]}
115
+ * @memberof RetryOptions
116
+ * @default [500, 502, 503, 504, 429],
117
+ */
118
+ statusCodes?: number[];
119
+ }
120
+
121
+ export interface RetryHandlers {
122
+ dispatch: Dispatcher['dispatch'];
123
+ handler: Dispatcher.DispatchHandler;
124
+ }
125
+ }
@@ -0,0 +1,41 @@
1
+ import Client from './client'
2
+ import TPoolStats from './pool-stats'
3
+ import { URL } from 'node:url'
4
+ import Dispatcher from './dispatcher'
5
+
6
+ export default RoundRobinPool
7
+
8
+ type RoundRobinPoolConnectOptions = Omit<Dispatcher.ConnectOptions, 'origin'>
9
+
10
+ declare class RoundRobinPool extends Dispatcher {
11
+ constructor (url: string | URL, options?: RoundRobinPool.Options)
12
+ /** `true` after `pool.close()` has been called. */
13
+ closed: boolean
14
+ /** `true` after `pool.destroyed()` has been called or `pool.close()` has been called and the pool shutdown has completed. */
15
+ destroyed: boolean
16
+ /** Aggregate stats for a RoundRobinPool. */
17
+ readonly stats: TPoolStats
18
+
19
+ // Override dispatcher APIs.
20
+ override connect (
21
+ options: RoundRobinPoolConnectOptions
22
+ ): Promise<Dispatcher.ConnectData>
23
+ override connect (
24
+ options: RoundRobinPoolConnectOptions,
25
+ callback: (err: Error | null, data: Dispatcher.ConnectData) => void
26
+ ): void
27
+ }
28
+
29
+ declare namespace RoundRobinPool {
30
+ export type RoundRobinPoolStats = TPoolStats
31
+ export interface Options extends Client.Options {
32
+ /** Default: `(origin, opts) => new Client(origin, opts)`. */
33
+ factory?(origin: URL, opts: object): Dispatcher;
34
+ /** The max number of clients to create. `null` if no limit. Default `null`. */
35
+ connections?: number | null;
36
+ /** The amount of time before a client is removed from the pool and closed. `null` if no time limit. Default `null` */
37
+ clientTtl?: number | null;
38
+
39
+ interceptors?: { RoundRobinPool?: readonly Dispatcher.DispatchInterceptor[] } & Client.Options['interceptors']
40
+ }
41
+ }
@@ -0,0 +1,109 @@
1
+ import MockAgent from './mock-agent'
2
+
3
+ declare class SnapshotRecorder {
4
+ constructor (options?: SnapshotRecorder.Options)
5
+
6
+ record (requestOpts: any, response: any): Promise<void>
7
+ findSnapshot (requestOpts: any): SnapshotRecorder.Snapshot | undefined
8
+ loadSnapshots (filePath?: string): Promise<void>
9
+ saveSnapshots (filePath?: string): Promise<void>
10
+ clear (): void
11
+ getSnapshots (): SnapshotRecorder.Snapshot[]
12
+ size (): number
13
+ resetCallCounts (): void
14
+ deleteSnapshot (requestOpts: any): boolean
15
+ getSnapshotInfo (requestOpts: any): SnapshotRecorder.SnapshotInfo | null
16
+ replaceSnapshots (snapshotData: SnapshotRecorder.SnapshotData[]): void
17
+ destroy (): void
18
+ }
19
+
20
+ declare namespace SnapshotRecorder {
21
+ type SnapshotRecorderMode = 'record' | 'playback' | 'update'
22
+
23
+ export interface Options {
24
+ snapshotPath?: string
25
+ mode?: SnapshotRecorderMode
26
+ maxSnapshots?: number
27
+ autoFlush?: boolean
28
+ flushInterval?: number
29
+ matchHeaders?: string[]
30
+ ignoreHeaders?: string[]
31
+ excludeHeaders?: string[]
32
+ matchBody?: boolean
33
+ matchQuery?: boolean
34
+ caseSensitive?: boolean
35
+ shouldRecord?: (requestOpts: any) => boolean
36
+ shouldPlayback?: (requestOpts: any) => boolean
37
+ excludeUrls?: (string | RegExp)[]
38
+ }
39
+
40
+ export interface Snapshot {
41
+ request: {
42
+ method: string
43
+ url: string
44
+ headers: Record<string, string>
45
+ body?: string
46
+ }
47
+ responses: {
48
+ statusCode: number
49
+ headers: Record<string, string>
50
+ body: string
51
+ trailers: Record<string, string>
52
+ }[]
53
+ callCount: number
54
+ timestamp: string
55
+ }
56
+
57
+ export interface SnapshotInfo {
58
+ hash: string
59
+ request: {
60
+ method: string
61
+ url: string
62
+ headers: Record<string, string>
63
+ body?: string
64
+ }
65
+ responseCount: number
66
+ callCount: number
67
+ timestamp: string
68
+ }
69
+
70
+ export interface SnapshotData {
71
+ hash: string
72
+ snapshot: Snapshot
73
+ }
74
+ }
75
+
76
+ declare class SnapshotAgent extends MockAgent {
77
+ constructor (options?: SnapshotAgent.Options)
78
+
79
+ saveSnapshots (filePath?: string): Promise<void>
80
+ loadSnapshots (filePath?: string): Promise<void>
81
+ getRecorder (): SnapshotRecorder
82
+ getMode (): SnapshotRecorder.SnapshotRecorderMode
83
+ clearSnapshots (): void
84
+ resetCallCounts (): void
85
+ deleteSnapshot (requestOpts: any): boolean
86
+ getSnapshotInfo (requestOpts: any): SnapshotRecorder.SnapshotInfo | null
87
+ replaceSnapshots (snapshotData: SnapshotRecorder.SnapshotData[]): void
88
+ }
89
+
90
+ declare namespace SnapshotAgent {
91
+ export interface Options extends MockAgent.Options {
92
+ mode?: SnapshotRecorder.SnapshotRecorderMode
93
+ snapshotPath?: string
94
+ maxSnapshots?: number
95
+ autoFlush?: boolean
96
+ flushInterval?: number
97
+ matchHeaders?: string[]
98
+ ignoreHeaders?: string[]
99
+ excludeHeaders?: string[]
100
+ matchBody?: boolean
101
+ matchQuery?: boolean
102
+ caseSensitive?: boolean
103
+ shouldRecord?: (requestOpts: any) => boolean
104
+ shouldPlayback?: (requestOpts: any) => boolean
105
+ excludeUrls?: (string | RegExp)[]
106
+ }
107
+ }
108
+
109
+ export { SnapshotAgent, SnapshotRecorder }
@@ -0,0 +1,25 @@
1
+ import Dispatcher from './dispatcher'
2
+ import buildConnector from './connector'
3
+ import { IncomingHttpHeaders } from './header'
4
+ import Pool from './pool'
5
+
6
+ export default Socks5ProxyAgent
7
+
8
+ declare class Socks5ProxyAgent extends Dispatcher {
9
+ constructor (proxyUrl: string | URL, options?: Socks5ProxyAgent.Options)
10
+ }
11
+
12
+ declare namespace Socks5ProxyAgent {
13
+ export interface Options extends Pool.Options {
14
+ /** Additional headers to send with the proxy connection */
15
+ headers?: IncomingHttpHeaders;
16
+ /** SOCKS5 proxy username for authentication */
17
+ username?: string;
18
+ /** SOCKS5 proxy password for authentication */
19
+ password?: string;
20
+ /** Custom connector function for proxy connection */
21
+ connect?: buildConnector.connector;
22
+ /** TLS options for the proxy connection (for SOCKS5 over TLS) */
23
+ proxyTls?: buildConnector.BuildOptions;
24
+ }
25
+ }
@@ -0,0 +1,18 @@
1
+ export namespace util {
2
+ /**
3
+ * Retrieves a header name and returns its lowercase value.
4
+ * @param value Header name
5
+ */
6
+ export function headerNameToString (value: string | Buffer): string
7
+
8
+ /**
9
+ * Receives a header object and returns the parsed value.
10
+ * @param headers Header object
11
+ * @param obj Object to specify a proxy object. Used to assign parsed values.
12
+ * @returns If `obj` is specified, it is equivalent to `obj`.
13
+ */
14
+ export function parseHeaders (
15
+ headers: (Buffer | string | (Buffer | string)[])[],
16
+ obj?: Record<string, string | string[]>
17
+ ): Record<string, string | string[]>
18
+ }
@@ -0,0 +1,7 @@
1
+ type AutocompletePrimitiveBaseType<T> =
2
+ T extends string ? string :
3
+ T extends number ? number :
4
+ T extends boolean ? boolean :
5
+ never
6
+
7
+ export type Autocomplete<T> = T | (AutocompletePrimitiveBaseType<T> & Record<never, never>)