@nocobase/plugin-idp-oauth 2.1.0-alpha.17 → 2.1.0-alpha.18

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 (214) hide show
  1. package/build.config.ts +1 -1
  2. package/dist/externalVersion.js +4 -4
  3. package/dist/node_modules/light-my-request/package.json +1 -1
  4. package/dist/node_modules/undici/LICENSE +21 -0
  5. package/dist/node_modules/undici/README.md +741 -0
  6. package/dist/node_modules/undici/docs/docs/api/Agent.md +84 -0
  7. package/dist/node_modules/undici/docs/docs/api/BalancedPool.md +99 -0
  8. package/dist/node_modules/undici/docs/docs/api/CacheStorage.md +30 -0
  9. package/dist/node_modules/undici/docs/docs/api/CacheStore.md +164 -0
  10. package/dist/node_modules/undici/docs/docs/api/Client.md +285 -0
  11. package/dist/node_modules/undici/docs/docs/api/ClientStats.md +27 -0
  12. package/dist/node_modules/undici/docs/docs/api/Connector.md +115 -0
  13. package/dist/node_modules/undici/docs/docs/api/ContentType.md +57 -0
  14. package/dist/node_modules/undici/docs/docs/api/Cookies.md +101 -0
  15. package/dist/node_modules/undici/docs/docs/api/Debug.md +62 -0
  16. package/dist/node_modules/undici/docs/docs/api/DiagnosticsChannel.md +315 -0
  17. package/dist/node_modules/undici/docs/docs/api/Dispatcher.md +1392 -0
  18. package/dist/node_modules/undici/docs/docs/api/EnvHttpProxyAgent.md +159 -0
  19. package/dist/node_modules/undici/docs/docs/api/Errors.md +49 -0
  20. package/dist/node_modules/undici/docs/docs/api/EventSource.md +45 -0
  21. package/dist/node_modules/undici/docs/docs/api/Fetch.md +60 -0
  22. package/dist/node_modules/undici/docs/docs/api/GlobalInstallation.md +139 -0
  23. package/dist/node_modules/undici/docs/docs/api/H2CClient.md +263 -0
  24. package/dist/node_modules/undici/docs/docs/api/MockAgent.md +603 -0
  25. package/dist/node_modules/undici/docs/docs/api/MockCallHistory.md +197 -0
  26. package/dist/node_modules/undici/docs/docs/api/MockCallHistoryLog.md +43 -0
  27. package/dist/node_modules/undici/docs/docs/api/MockClient.md +81 -0
  28. package/dist/node_modules/undici/docs/docs/api/MockErrors.md +12 -0
  29. package/dist/node_modules/undici/docs/docs/api/MockPool.md +555 -0
  30. package/dist/node_modules/undici/docs/docs/api/Pool.md +84 -0
  31. package/dist/node_modules/undici/docs/docs/api/PoolStats.md +35 -0
  32. package/dist/node_modules/undici/docs/docs/api/ProxyAgent.md +229 -0
  33. package/dist/node_modules/undici/docs/docs/api/RedirectHandler.md +93 -0
  34. package/dist/node_modules/undici/docs/docs/api/RetryAgent.md +50 -0
  35. package/dist/node_modules/undici/docs/docs/api/RetryHandler.md +118 -0
  36. package/dist/node_modules/undici/docs/docs/api/RoundRobinPool.md +145 -0
  37. package/dist/node_modules/undici/docs/docs/api/SnapshotAgent.md +616 -0
  38. package/dist/node_modules/undici/docs/docs/api/Socks5ProxyAgent.md +274 -0
  39. package/dist/node_modules/undici/docs/docs/api/Util.md +25 -0
  40. package/dist/node_modules/undici/docs/docs/api/WebSocket.md +141 -0
  41. package/dist/node_modules/undici/docs/docs/api/api-lifecycle.md +91 -0
  42. package/dist/node_modules/undici/docs/docs/best-practices/client-certificate.md +64 -0
  43. package/dist/node_modules/undici/docs/docs/best-practices/crawling.md +58 -0
  44. package/dist/node_modules/undici/docs/docs/best-practices/mocking-request.md +190 -0
  45. package/dist/node_modules/undici/docs/docs/best-practices/proxy.md +127 -0
  46. package/dist/node_modules/undici/docs/docs/best-practices/undici-vs-builtin-fetch.md +224 -0
  47. package/dist/node_modules/undici/docs/docs/best-practices/writing-tests.md +63 -0
  48. package/dist/node_modules/undici/index-fetch.js +65 -0
  49. package/dist/node_modules/undici/index.d.ts +3 -0
  50. package/dist/node_modules/undici/index.js +234 -0
  51. package/dist/node_modules/undici/lib/api/abort-signal.js +59 -0
  52. package/dist/node_modules/undici/lib/api/api-connect.js +110 -0
  53. package/dist/node_modules/undici/lib/api/api-pipeline.js +252 -0
  54. package/dist/node_modules/undici/lib/api/api-request.js +214 -0
  55. package/dist/node_modules/undici/lib/api/api-stream.js +209 -0
  56. package/dist/node_modules/undici/lib/api/api-upgrade.js +111 -0
  57. package/dist/node_modules/undici/lib/api/index.js +7 -0
  58. package/dist/node_modules/undici/lib/api/readable.js +580 -0
  59. package/dist/node_modules/undici/lib/cache/memory-cache-store.js +234 -0
  60. package/dist/node_modules/undici/lib/cache/sqlite-cache-store.js +461 -0
  61. package/dist/node_modules/undici/lib/core/connect.js +137 -0
  62. package/dist/node_modules/undici/lib/core/constants.js +143 -0
  63. package/dist/node_modules/undici/lib/core/diagnostics.js +227 -0
  64. package/dist/node_modules/undici/lib/core/errors.js +477 -0
  65. package/dist/node_modules/undici/lib/core/request.js +438 -0
  66. package/dist/node_modules/undici/lib/core/socks5-client.js +407 -0
  67. package/dist/node_modules/undici/lib/core/socks5-utils.js +203 -0
  68. package/dist/node_modules/undici/lib/core/symbols.js +75 -0
  69. package/dist/node_modules/undici/lib/core/tree.js +160 -0
  70. package/dist/node_modules/undici/lib/core/util.js +992 -0
  71. package/dist/node_modules/undici/lib/dispatcher/agent.js +158 -0
  72. package/dist/node_modules/undici/lib/dispatcher/balanced-pool.js +219 -0
  73. package/dist/node_modules/undici/lib/dispatcher/client-h1.js +1610 -0
  74. package/dist/node_modules/undici/lib/dispatcher/client-h2.js +995 -0
  75. package/dist/node_modules/undici/lib/dispatcher/client.js +659 -0
  76. package/dist/node_modules/undici/lib/dispatcher/dispatcher-base.js +165 -0
  77. package/dist/node_modules/undici/lib/dispatcher/dispatcher.js +48 -0
  78. package/dist/node_modules/undici/lib/dispatcher/env-http-proxy-agent.js +146 -0
  79. package/dist/node_modules/undici/lib/dispatcher/fixed-queue.js +135 -0
  80. package/dist/node_modules/undici/lib/dispatcher/h2c-client.js +51 -0
  81. package/dist/node_modules/undici/lib/dispatcher/pool-base.js +214 -0
  82. package/dist/node_modules/undici/lib/dispatcher/pool.js +118 -0
  83. package/dist/node_modules/undici/lib/dispatcher/proxy-agent.js +318 -0
  84. package/dist/node_modules/undici/lib/dispatcher/retry-agent.js +35 -0
  85. package/dist/node_modules/undici/lib/dispatcher/round-robin-pool.js +137 -0
  86. package/dist/node_modules/undici/lib/dispatcher/socks5-proxy-agent.js +249 -0
  87. package/dist/node_modules/undici/lib/encoding/index.js +33 -0
  88. package/dist/node_modules/undici/lib/global.js +50 -0
  89. package/dist/node_modules/undici/lib/handler/cache-handler.js +578 -0
  90. package/dist/node_modules/undici/lib/handler/cache-revalidation-handler.js +124 -0
  91. package/dist/node_modules/undici/lib/handler/decorator-handler.js +67 -0
  92. package/dist/node_modules/undici/lib/handler/deduplication-handler.js +460 -0
  93. package/dist/node_modules/undici/lib/handler/redirect-handler.js +238 -0
  94. package/dist/node_modules/undici/lib/handler/retry-handler.js +394 -0
  95. package/dist/node_modules/undici/lib/handler/unwrap-handler.js +100 -0
  96. package/dist/node_modules/undici/lib/handler/wrap-handler.js +105 -0
  97. package/dist/node_modules/undici/lib/interceptor/cache.js +495 -0
  98. package/dist/node_modules/undici/lib/interceptor/decompress.js +259 -0
  99. package/dist/node_modules/undici/lib/interceptor/deduplicate.js +117 -0
  100. package/dist/node_modules/undici/lib/interceptor/dns.js +571 -0
  101. package/dist/node_modules/undici/lib/interceptor/dump.js +112 -0
  102. package/dist/node_modules/undici/lib/interceptor/redirect.js +21 -0
  103. package/dist/node_modules/undici/lib/interceptor/response-error.js +95 -0
  104. package/dist/node_modules/undici/lib/interceptor/retry.js +19 -0
  105. package/dist/node_modules/undici/lib/llhttp/.gitkeep +0 -0
  106. package/dist/node_modules/undici/lib/llhttp/constants.d.ts +195 -0
  107. package/dist/node_modules/undici/lib/llhttp/constants.js +531 -0
  108. package/dist/node_modules/undici/lib/llhttp/llhttp-wasm.js +15 -0
  109. package/dist/node_modules/undici/lib/llhttp/llhttp_simd-wasm.js +15 -0
  110. package/dist/node_modules/undici/lib/llhttp/utils.d.ts +2 -0
  111. package/dist/node_modules/undici/lib/llhttp/utils.js +12 -0
  112. package/dist/node_modules/undici/lib/mock/mock-agent.js +232 -0
  113. package/dist/node_modules/undici/lib/mock/mock-call-history.js +248 -0
  114. package/dist/node_modules/undici/lib/mock/mock-client.js +68 -0
  115. package/dist/node_modules/undici/lib/mock/mock-errors.js +29 -0
  116. package/dist/node_modules/undici/lib/mock/mock-interceptor.js +209 -0
  117. package/dist/node_modules/undici/lib/mock/mock-pool.js +68 -0
  118. package/dist/node_modules/undici/lib/mock/mock-symbols.js +32 -0
  119. package/dist/node_modules/undici/lib/mock/mock-utils.js +486 -0
  120. package/dist/node_modules/undici/lib/mock/pending-interceptors-formatter.js +43 -0
  121. package/dist/node_modules/undici/lib/mock/snapshot-agent.js +353 -0
  122. package/dist/node_modules/undici/lib/mock/snapshot-recorder.js +588 -0
  123. package/dist/node_modules/undici/lib/mock/snapshot-utils.js +158 -0
  124. package/dist/node_modules/undici/lib/util/cache.js +407 -0
  125. package/dist/node_modules/undici/lib/util/date.js +653 -0
  126. package/dist/node_modules/undici/lib/util/promise.js +28 -0
  127. package/dist/node_modules/undici/lib/util/runtime-features.js +124 -0
  128. package/dist/node_modules/undici/lib/util/stats.js +32 -0
  129. package/dist/node_modules/undici/lib/util/timers.js +425 -0
  130. package/dist/node_modules/undici/lib/web/cache/cache.js +864 -0
  131. package/dist/node_modules/undici/lib/web/cache/cachestorage.js +152 -0
  132. package/dist/node_modules/undici/lib/web/cache/util.js +45 -0
  133. package/dist/node_modules/undici/lib/web/cookies/constants.js +12 -0
  134. package/dist/node_modules/undici/lib/web/cookies/index.js +199 -0
  135. package/dist/node_modules/undici/lib/web/cookies/parse.js +322 -0
  136. package/dist/node_modules/undici/lib/web/cookies/util.js +282 -0
  137. package/dist/node_modules/undici/lib/web/eventsource/eventsource-stream.js +399 -0
  138. package/dist/node_modules/undici/lib/web/eventsource/eventsource.js +501 -0
  139. package/dist/node_modules/undici/lib/web/eventsource/util.js +29 -0
  140. package/dist/node_modules/undici/lib/web/fetch/LICENSE +21 -0
  141. package/dist/node_modules/undici/lib/web/fetch/body.js +509 -0
  142. package/dist/node_modules/undici/lib/web/fetch/constants.js +131 -0
  143. package/dist/node_modules/undici/lib/web/fetch/data-url.js +596 -0
  144. package/dist/node_modules/undici/lib/web/fetch/formdata-parser.js +575 -0
  145. package/dist/node_modules/undici/lib/web/fetch/formdata.js +259 -0
  146. package/dist/node_modules/undici/lib/web/fetch/global.js +40 -0
  147. package/dist/node_modules/undici/lib/web/fetch/headers.js +719 -0
  148. package/dist/node_modules/undici/lib/web/fetch/index.js +2397 -0
  149. package/dist/node_modules/undici/lib/web/fetch/request.js +1115 -0
  150. package/dist/node_modules/undici/lib/web/fetch/response.js +641 -0
  151. package/dist/node_modules/undici/lib/web/fetch/util.js +1520 -0
  152. package/dist/node_modules/undici/lib/web/infra/index.js +229 -0
  153. package/dist/node_modules/undici/lib/web/subresource-integrity/Readme.md +9 -0
  154. package/dist/node_modules/undici/lib/web/subresource-integrity/subresource-integrity.js +307 -0
  155. package/dist/node_modules/undici/lib/web/webidl/index.js +1006 -0
  156. package/dist/node_modules/undici/lib/web/websocket/connection.js +329 -0
  157. package/dist/node_modules/undici/lib/web/websocket/constants.js +126 -0
  158. package/dist/node_modules/undici/lib/web/websocket/events.js +331 -0
  159. package/dist/node_modules/undici/lib/web/websocket/frame.js +133 -0
  160. package/dist/node_modules/undici/lib/web/websocket/permessage-deflate.js +118 -0
  161. package/dist/node_modules/undici/lib/web/websocket/receiver.js +450 -0
  162. package/dist/node_modules/undici/lib/web/websocket/sender.js +109 -0
  163. package/dist/node_modules/undici/lib/web/websocket/stream/websocketerror.js +104 -0
  164. package/dist/node_modules/undici/lib/web/websocket/stream/websocketstream.js +497 -0
  165. package/dist/node_modules/undici/lib/web/websocket/util.js +347 -0
  166. package/dist/node_modules/undici/lib/web/websocket/websocket.js +751 -0
  167. package/dist/node_modules/undici/package.json +152 -0
  168. package/dist/node_modules/undici/scripts/strip-comments.js +10 -0
  169. package/dist/node_modules/undici/types/README.md +6 -0
  170. package/dist/node_modules/undici/types/agent.d.ts +32 -0
  171. package/dist/node_modules/undici/types/api.d.ts +43 -0
  172. package/dist/node_modules/undici/types/balanced-pool.d.ts +30 -0
  173. package/dist/node_modules/undici/types/cache-interceptor.d.ts +179 -0
  174. package/dist/node_modules/undici/types/cache.d.ts +36 -0
  175. package/dist/node_modules/undici/types/client-stats.d.ts +15 -0
  176. package/dist/node_modules/undici/types/client.d.ts +123 -0
  177. package/dist/node_modules/undici/types/connector.d.ts +36 -0
  178. package/dist/node_modules/undici/types/content-type.d.ts +21 -0
  179. package/dist/node_modules/undici/types/cookies.d.ts +30 -0
  180. package/dist/node_modules/undici/types/diagnostics-channel.d.ts +74 -0
  181. package/dist/node_modules/undici/types/dispatcher.d.ts +273 -0
  182. package/dist/node_modules/undici/types/env-http-proxy-agent.d.ts +22 -0
  183. package/dist/node_modules/undici/types/errors.d.ts +177 -0
  184. package/dist/node_modules/undici/types/eventsource.d.ts +66 -0
  185. package/dist/node_modules/undici/types/fetch.d.ts +231 -0
  186. package/dist/node_modules/undici/types/formdata.d.ts +114 -0
  187. package/dist/node_modules/undici/types/global-dispatcher.d.ts +9 -0
  188. package/dist/node_modules/undici/types/global-origin.d.ts +7 -0
  189. package/dist/node_modules/undici/types/h2c-client.d.ts +73 -0
  190. package/dist/node_modules/undici/types/handlers.d.ts +14 -0
  191. package/dist/node_modules/undici/types/header.d.ts +160 -0
  192. package/dist/node_modules/undici/types/index.d.ts +91 -0
  193. package/dist/node_modules/undici/types/interceptors.d.ts +80 -0
  194. package/dist/node_modules/undici/types/mock-agent.d.ts +68 -0
  195. package/dist/node_modules/undici/types/mock-call-history.d.ts +111 -0
  196. package/dist/node_modules/undici/types/mock-client.d.ts +27 -0
  197. package/dist/node_modules/undici/types/mock-errors.d.ts +12 -0
  198. package/dist/node_modules/undici/types/mock-interceptor.d.ts +94 -0
  199. package/dist/node_modules/undici/types/mock-pool.d.ts +27 -0
  200. package/dist/node_modules/undici/types/patch.d.ts +29 -0
  201. package/dist/node_modules/undici/types/pool-stats.d.ts +19 -0
  202. package/dist/node_modules/undici/types/pool.d.ts +41 -0
  203. package/dist/node_modules/undici/types/proxy-agent.d.ts +29 -0
  204. package/dist/node_modules/undici/types/readable.d.ts +68 -0
  205. package/dist/node_modules/undici/types/retry-agent.d.ts +8 -0
  206. package/dist/node_modules/undici/types/retry-handler.d.ts +125 -0
  207. package/dist/node_modules/undici/types/round-robin-pool.d.ts +41 -0
  208. package/dist/node_modules/undici/types/snapshot-agent.d.ts +109 -0
  209. package/dist/node_modules/undici/types/socks5-proxy-agent.d.ts +25 -0
  210. package/dist/node_modules/undici/types/util.d.ts +18 -0
  211. package/dist/node_modules/undici/types/utility.d.ts +7 -0
  212. package/dist/node_modules/undici/types/webidl.d.ts +347 -0
  213. package/dist/node_modules/undici/types/websocket.d.ts +188 -0
  214. package/package.json +2 -2
@@ -0,0 +1,84 @@
1
+ # Agent
2
+
3
+ Extends: `undici.Dispatcher`
4
+
5
+ Agent allows dispatching requests against multiple different origins.
6
+
7
+ Requests are not guaranteed to be dispatched in order of invocation.
8
+
9
+ ## `new undici.Agent([options])`
10
+
11
+ Arguments:
12
+
13
+ * **options** `AgentOptions` (optional)
14
+
15
+ Returns: `Agent`
16
+
17
+ ### Parameter: `AgentOptions`
18
+
19
+ Extends: [`PoolOptions`](/docs/docs/api/Pool.md#parameter-pooloptions)
20
+
21
+ * **factory** `(origin: URL, opts: Object) => Dispatcher` - Default: `(origin, opts) => new Pool(origin, opts)`
22
+ * **maxOrigins** `number` (optional) - Default: `Infinity` - Limits the total number of origins that can receive requests at a time, throwing an `MaxOriginsReachedError` error when attempting to dispatch when the max is reached. If `Infinity`, no limit is enforced.
23
+
24
+ ## Instance Properties
25
+
26
+ ### `Agent.closed`
27
+
28
+ Implements [Client.closed](/docs/docs/api/Client.md#clientclosed)
29
+
30
+ ### `Agent.destroyed`
31
+
32
+ Implements [Client.destroyed](/docs/docs/api/Client.md#clientdestroyed)
33
+
34
+ ## Instance Methods
35
+
36
+ ### `Agent.close([callback])`
37
+
38
+ Implements [`Dispatcher.close([callback])`](/docs/docs/api/Dispatcher.md#dispatcherclosecallback-promise).
39
+
40
+ ### `Agent.destroy([error, callback])`
41
+
42
+ Implements [`Dispatcher.destroy([error, callback])`](/docs/docs/api/Dispatcher.md#dispatcherdestroyerror-callback-promise).
43
+
44
+ ### `Agent.dispatch(options, handler: AgentDispatchOptions)`
45
+
46
+ Implements [`Dispatcher.dispatch(options, handler)`](/docs/docs/api/Dispatcher.md#dispatcherdispatchoptions-handler).
47
+
48
+ #### Parameter: `AgentDispatchOptions`
49
+
50
+ Extends: [`DispatchOptions`](/docs/docs/api/Dispatcher.md#parameter-dispatchoptions)
51
+
52
+ * **origin** `string | URL`
53
+
54
+ Implements [`Dispatcher.destroy([error, callback])`](/docs/docs/api/Dispatcher.md#dispatcherdestroyerror-callback-promise).
55
+
56
+ ### `Agent.connect(options[, callback])`
57
+
58
+ See [`Dispatcher.connect(options[, callback])`](/docs/docs/api/Dispatcher.md#dispatcherconnectoptions-callback).
59
+
60
+ ### `Agent.dispatch(options, handler)`
61
+
62
+ Implements [`Dispatcher.dispatch(options, handler)`](/docs/docs/api/Dispatcher.md#dispatcherdispatchoptions-handler).
63
+
64
+ ### `Agent.pipeline(options, handler)`
65
+
66
+ See [`Dispatcher.pipeline(options, handler)`](/docs/docs/api/Dispatcher.md#dispatcherpipelineoptions-handler).
67
+
68
+ ### `Agent.request(options[, callback])`
69
+
70
+ See [`Dispatcher.request(options [, callback])`](/docs/docs/api/Dispatcher.md#dispatcherrequestoptions-callback).
71
+
72
+ ### `Agent.stream(options, factory[, callback])`
73
+
74
+ See [`Dispatcher.stream(options, factory[, callback])`](/docs/docs/api/Dispatcher.md#dispatcherstreamoptions-factory-callback).
75
+
76
+ ### `Agent.upgrade(options[, callback])`
77
+
78
+ See [`Dispatcher.upgrade(options[, callback])`](/docs/docs/api/Dispatcher.md#dispatcherupgradeoptions-callback).
79
+
80
+ ### `Agent.stats()`
81
+
82
+ Returns an object of stats by origin in the format of `Record<string, TClientStats | TPoolStats>`
83
+
84
+ See [`PoolStats`](/docs/docs/api/PoolStats.md) and [`ClientStats`](/docs/docs/api/ClientStats.md).
@@ -0,0 +1,99 @@
1
+ # Class: BalancedPool
2
+
3
+ Extends: `undici.Dispatcher`
4
+
5
+ A pool of [Pool](/docs/docs/api/Pool.md) instances connected to multiple upstreams.
6
+
7
+ Requests are not guaranteed to be dispatched in order of invocation.
8
+
9
+ ## `new BalancedPool(upstreams [, options])`
10
+
11
+ Arguments:
12
+
13
+ * **upstreams** `URL | string | string[]` - It should only include the **protocol, hostname, and port**.
14
+ * **options** `BalancedPoolOptions` (optional)
15
+
16
+ ### Parameter: `BalancedPoolOptions`
17
+
18
+ Extends: [`PoolOptions`](/docs/docs/api/Pool.md#parameter-pooloptions)
19
+
20
+ * **factory** `(origin: URL, opts: Object) => Dispatcher` - Default: `(origin, opts) => new Pool(origin, opts)`
21
+
22
+ The `PoolOptions` are passed to each of the `Pool` instances being created.
23
+ ## Instance Properties
24
+
25
+ ### `BalancedPool.upstreams`
26
+
27
+ Returns an array of upstreams that were previously added.
28
+
29
+ ### `BalancedPool.closed`
30
+
31
+ Implements [Client.closed](/docs/docs/api/Client.md#clientclosed)
32
+
33
+ ### `BalancedPool.destroyed`
34
+
35
+ Implements [Client.destroyed](/docs/docs/api/Client.md#clientdestroyed)
36
+
37
+ ### `Pool.stats`
38
+
39
+ Returns [`PoolStats`](/docs/docs/api/PoolStats.md) instance for this pool.
40
+
41
+ ## Instance Methods
42
+
43
+ ### `BalancedPool.addUpstream(upstream)`
44
+
45
+ Add an upstream.
46
+
47
+ Arguments:
48
+
49
+ * **upstream** `string` - It should only include the **protocol, hostname, and port**.
50
+
51
+ ### `BalancedPool.removeUpstream(upstream)`
52
+
53
+ Removes an upstream that was previously added.
54
+
55
+ ### `BalancedPool.close([callback])`
56
+
57
+ Implements [`Dispatcher.close([callback])`](/docs/docs/api/Dispatcher.md#dispatcherclosecallback-promise).
58
+
59
+ ### `BalancedPool.destroy([error, callback])`
60
+
61
+ Implements [`Dispatcher.destroy([error, callback])`](/docs/docs/api/Dispatcher.md#dispatcherdestroyerror-callback-promise).
62
+
63
+ ### `BalancedPool.connect(options[, callback])`
64
+
65
+ See [`Dispatcher.connect(options[, callback])`](/docs/docs/api/Dispatcher.md#dispatcherconnectoptions-callback).
66
+
67
+ ### `BalancedPool.dispatch(options, handlers)`
68
+
69
+ Implements [`Dispatcher.dispatch(options, handlers)`](/docs/docs/api/Dispatcher.md#dispatcherdispatchoptions-handler).
70
+
71
+ ### `BalancedPool.pipeline(options, handler)`
72
+
73
+ See [`Dispatcher.pipeline(options, handler)`](/docs/docs/api/Dispatcher.md#dispatcherpipelineoptions-handler).
74
+
75
+ ### `BalancedPool.request(options[, callback])`
76
+
77
+ See [`Dispatcher.request(options [, callback])`](/docs/docs/api/Dispatcher.md#dispatcherrequestoptions-callback).
78
+
79
+ ### `BalancedPool.stream(options, factory[, callback])`
80
+
81
+ See [`Dispatcher.stream(options, factory[, callback])`](/docs/docs/api/Dispatcher.md#dispatcherstreamoptions-factory-callback).
82
+
83
+ ### `BalancedPool.upgrade(options[, callback])`
84
+
85
+ See [`Dispatcher.upgrade(options[, callback])`](/docs/docs/api/Dispatcher.md#dispatcherupgradeoptions-callback).
86
+
87
+ ## Instance Events
88
+
89
+ ### Event: `'connect'`
90
+
91
+ See [Dispatcher Event: `'connect'`](/docs/docs/api/Dispatcher.md#event-connect).
92
+
93
+ ### Event: `'disconnect'`
94
+
95
+ See [Dispatcher Event: `'disconnect'`](/docs/docs/api/Dispatcher.md#event-disconnect).
96
+
97
+ ### Event: `'drain'`
98
+
99
+ See [Dispatcher Event: `'drain'`](/docs/docs/api/Dispatcher.md#event-drain).
@@ -0,0 +1,30 @@
1
+ # CacheStorage
2
+
3
+ Undici exposes a W3C spec-compliant implementation of [CacheStorage](https://developer.mozilla.org/en-US/docs/Web/API/CacheStorage) and [Cache](https://developer.mozilla.org/en-US/docs/Web/API/Cache).
4
+
5
+ ## Opening a Cache
6
+
7
+ Undici exports a top-level CacheStorage instance. You can open a new Cache, or duplicate a Cache with an existing name, by using `CacheStorage.prototype.open`. If you open a Cache with the same name as an already-existing Cache, its list of cached Responses will be shared between both instances.
8
+
9
+ ```mjs
10
+ import { caches } from 'undici'
11
+
12
+ const cache_1 = await caches.open('v1')
13
+ const cache_2 = await caches.open('v1')
14
+
15
+ // Although .open() creates a new instance,
16
+ assert(cache_1 !== cache_2)
17
+ // The same Response is matched in both.
18
+ assert.deepStrictEqual(await cache_1.match('/req'), await cache_2.match('/req'))
19
+ ```
20
+
21
+ ## Deleting a Cache
22
+
23
+ If a Cache is deleted, the cached Responses/Requests can still be used.
24
+
25
+ ```mjs
26
+ const response = await cache_1.match('/req')
27
+ await caches.delete('v1')
28
+
29
+ await response.text() // the Response's body
30
+ ```
@@ -0,0 +1,164 @@
1
+ # Cache Store
2
+
3
+ A Cache Store is responsible for storing and retrieving cached responses.
4
+ It is also responsible for deciding which specific response to use based off of
5
+ a response's `Vary` header (if present). It is expected to be compliant with
6
+ [RFC-9111](https://www.rfc-editor.org/rfc/rfc9111.html).
7
+
8
+ ## Pre-built Cache Stores
9
+
10
+ ### `MemoryCacheStore`
11
+
12
+ The `MemoryCacheStore` stores the responses in-memory.
13
+
14
+ **Options**
15
+
16
+ - `maxSize` - The maximum total size in bytes of all stored responses. Default `104857600` (100MB).
17
+ - `maxCount` - The maximum amount of responses to store. Default `1024`.
18
+ - `maxEntrySize` - The maximum size in bytes that a response's body can be. If a response's body is greater than or equal to this, the response will not be cached. Default `5242880` (5MB).
19
+
20
+ ### Getters
21
+
22
+ #### `MemoryCacheStore.size`
23
+
24
+ Returns the current total size in bytes of all stored responses.
25
+
26
+ ### Methods
27
+
28
+ #### `MemoryCacheStore.isFull()`
29
+
30
+ Returns a boolean indicating whether the cache has reached its maximum size or count.
31
+
32
+ ### Events
33
+
34
+ #### `'maxSizeExceeded'`
35
+
36
+ Emitted when the cache exceeds its maximum size or count limits. The event payload contains `size`, `maxSize`, `count`, and `maxCount` properties.
37
+
38
+
39
+ ### `SqliteCacheStore`
40
+
41
+ The `SqliteCacheStore` stores the responses in a SQLite database.
42
+ Under the hood, it uses Node.js' [`node:sqlite`](https://nodejs.org/api/sqlite.html) api.
43
+ The `SqliteCacheStore` is only exposed if the `node:sqlite` api is present.
44
+
45
+ **Options**
46
+
47
+ - `location` - The location of the SQLite database to use. Default `:memory:`.
48
+ - `maxCount` - The maximum number of entries to store in the database. Default `Infinity`.
49
+ - `maxEntrySize` - The maximum size in bytes that a response's body can be. If a response's body is greater than or equal to this, the response will not be cached. Default `Infinity`.
50
+
51
+ ## Defining a Custom Cache Store
52
+
53
+ The store must implement the following functions:
54
+
55
+ ### Getter: `isFull`
56
+
57
+ Optional. This tells the cache interceptor if the store is full or not. If this is true,
58
+ the cache interceptor will not attempt to cache the response.
59
+
60
+ ### Function: `get`
61
+
62
+ Parameters:
63
+
64
+ * **req** `Dispatcher.RequestOptions` - Incoming request
65
+
66
+ Returns: `GetResult | Promise<GetResult | undefined> | undefined` - If the request is cached, the cached response is returned. If the request's method is anything other than HEAD, the response is also returned.
67
+ If the request isn't cached, `undefined` is returned.
68
+
69
+ The `get` method may return a `Promise` for async cache stores (e.g. Redis-backed or remote stores). The cache interceptor handles both synchronous and asynchronous return values, including in revalidation paths (304 Not Modified handling and stale-while-revalidate background revalidation).
70
+
71
+ Response properties:
72
+
73
+ * **response** `CacheValue` - The cached response data.
74
+ * **body** `Readable | Iterable<Buffer> | undefined` - The response's body. This can be an array of `Buffer` chunks (with a `.values()` method) or a `Readable` stream. Both formats are supported in all code paths, including 304 revalidation.
75
+
76
+ ### Function: `createWriteStream`
77
+
78
+ Parameters:
79
+
80
+ * **req** `Dispatcher.RequestOptions` - Incoming request
81
+ * **value** `CacheValue` - Response to store
82
+
83
+ Returns: `Writable | undefined` - If the store is full, return `undefined`. Otherwise, return a writable so that the cache interceptor can stream the body and trailers to the store.
84
+
85
+ ## `CacheValue`
86
+
87
+ This is an interface containing the majority of a response's data (minus the body).
88
+
89
+ ### Property `statusCode`
90
+
91
+ `number` - The response's HTTP status code.
92
+
93
+ ### Property `statusMessage`
94
+
95
+ `string` - The response's HTTP status message.
96
+
97
+ ### Property `rawHeaders`
98
+
99
+ `Buffer[]` - The response's headers.
100
+
101
+ ### Property `vary`
102
+
103
+ `Record<string, string | string[] | null> | undefined` - The headers defined by the response's `Vary` header
104
+ and their respective values for later comparison. Values are `null` when the
105
+ header specified in `Vary` was not present in the original request. These `null`
106
+ values are automatically filtered out during revalidation so they are not sent
107
+ as request headers.
108
+
109
+ For example, for a response like
110
+ ```
111
+ Vary: content-encoding, accepts
112
+ content-encoding: utf8
113
+ accepts: application/json
114
+ ```
115
+
116
+ This would be
117
+ ```js
118
+ {
119
+ 'content-encoding': 'utf8',
120
+ accepts: 'application/json'
121
+ }
122
+ ```
123
+
124
+ If the original request did not include the `accepts` header:
125
+ ```js
126
+ {
127
+ 'content-encoding': 'utf8',
128
+ accepts: null
129
+ }
130
+ ```
131
+
132
+ ### Property `cachedAt`
133
+
134
+ `number` - Time in millis that this value was cached.
135
+
136
+ ### Property `staleAt`
137
+
138
+ `number` - Time in millis that this value is considered stale.
139
+
140
+ ### Property `deleteAt`
141
+
142
+ `number` - Time in millis that this value is to be deleted from the cache. This
143
+ is either the same sa staleAt or the `max-stale` caching directive.
144
+
145
+ The store must not return a response after the time defined in this property.
146
+
147
+ ## `CacheStoreReadable`
148
+
149
+ This extends Node's [`Readable`](https://nodejs.org/api/stream.html#class-streamreadable)
150
+ and defines extra properties relevant to the cache interceptor.
151
+
152
+ ### Getter: `value`
153
+
154
+ The response's [`CacheStoreValue`](/docs/docs/api/CacheStore.md#cachestorevalue)
155
+
156
+ ## `CacheStoreWriteable`
157
+
158
+ This extends Node's [`Writable`](https://nodejs.org/api/stream.html#class-streamwritable)
159
+ and defines extra properties relevant to the cache interceptor.
160
+
161
+ ### Setter: `rawTrailers`
162
+
163
+ If the response has trailers, the cache interceptor will pass them to the cache
164
+ interceptor through this method.
@@ -0,0 +1,285 @@
1
+ # Class: Client
2
+
3
+ Extends: `undici.Dispatcher`
4
+
5
+ A basic HTTP/1.1 client, mapped on top a single TCP/TLS connection. Pipelining is disabled by default.
6
+
7
+ Requests are not guaranteed to be dispatched in order of invocation.
8
+
9
+ ## `new Client(url[, options])`
10
+
11
+ Arguments:
12
+
13
+ * **url** `URL | string` - Should only include the **protocol, hostname, and port**.
14
+ * **options** `ClientOptions` (optional)
15
+
16
+ Returns: `Client`
17
+
18
+ ### Parameter: `ClientOptions`
19
+
20
+ * **bodyTimeout** `number | null` (optional) - Default: `300e3` - The timeout after which a request will time out, in milliseconds. Monitors time between receiving body data. Use `0` to disable it entirely. Defaults to 300 seconds. Please note the `timeout` will be reset if you keep writing data to the socket everytime.
21
+ * **headersTimeout** `number | null` (optional) - Default: `300e3` - The amount of time, in milliseconds, the parser will wait to receive the complete HTTP headers while not sending the request. Defaults to 300 seconds.
22
+ * **keepAliveMaxTimeout** `number | null` (optional) - Default: `600e3` - The maximum allowed `keepAliveTimeout`, in milliseconds, when overridden by *keep-alive* hints from the server. Defaults to 10 minutes.
23
+ * **keepAliveTimeout** `number | null` (optional) - Default: `4e3` - The timeout, in milliseconds, after which a socket without active requests will time out. Monitors time between activity on a connected socket. This value may be overridden by *keep-alive* hints from the server. See [MDN: HTTP - Headers - Keep-Alive directives](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Keep-Alive#directives) for more details. Defaults to 4 seconds.
24
+ * **keepAliveTimeoutThreshold** `number | null` (optional) - Default: `2e3` - A number of milliseconds subtracted from server *keep-alive* hints when overriding `keepAliveTimeout` to account for timing inaccuracies caused by e.g. transport latency. Defaults to 2 seconds.
25
+ * **maxHeaderSize** `number | null` (optional) - Default: `--max-http-header-size` or `16384` - The maximum length of request headers in bytes. Defaults to Node.js' --max-http-header-size or 16KiB.
26
+ * **maxResponseSize** `number | null` (optional) - Default: `-1` - The maximum length of response body in bytes. Set to `-1` to disable.
27
+ * **pipelining** `number | null` (optional) - Default: `1` - The amount of concurrent requests to be sent over the single TCP/TLS connection according to [RFC7230](https://tools.ietf.org/html/rfc7230#section-6.3.2). Carefully consider your workload and environment before enabling concurrent requests as pipelining may reduce performance if used incorrectly. Pipelining is sensitive to network stack settings as well as head of line blocking caused by e.g. long running requests. Set to `0` to disable keep-alive connections.
28
+ * **connect** `ConnectOptions | Function | null` (optional) - Default: `null`.
29
+ * **strictContentLength** `Boolean` (optional) - Default: `true` - Whether to treat request content length mismatches as errors. If true, an error is thrown when the request content-length header doesn't match the length of the request body. **Security Warning:** Disabling this option can expose your application to HTTP Request Smuggling attacks, where mismatched content-length headers cause servers and proxies to interpret request boundaries differently. This can lead to cache poisoning, credential hijacking, and bypassing security controls. Only disable this in controlled environments where you fully trust the request source.
30
+ * **autoSelectFamily**: `boolean` (optional) - Default: depends on local Node version, on Node 18.13.0 and above is `false`. Enables a family autodetection algorithm that loosely implements section 5 of [RFC 8305](https://tools.ietf.org/html/rfc8305#section-5). See [here](https://nodejs.org/api/net.html#socketconnectoptions-connectlistener) for more details. This option is ignored if not supported by the current Node version.
31
+ * **autoSelectFamilyAttemptTimeout**: `number` - Default: depends on local Node version, on Node 18.13.0 and above is `250`. The amount of time in milliseconds to wait for a connection attempt to finish before trying the next address when using the `autoSelectFamily` option. See [here](https://nodejs.org/api/net.html#socketconnectoptions-connectlistener) for more details.
32
+ * **allowH2**: `boolean` - Default: `false`. Enables support for H2 if the server has assigned bigger priority to it through ALPN negotiation.
33
+ * **useH2c**: `boolean` - Default: `false`. Enforces h2c for non-https connections.
34
+ * **maxConcurrentStreams**: `number` - Default: `100`. Dictates the maximum number of concurrent streams for a single H2 session. It can be overridden by a SETTINGS remote frame.
35
+ * **initialWindowSize**: `number` (optional) - Default: `262144` (256KB). Sets the HTTP/2 stream-level flow-control window size (SETTINGS_INITIAL_WINDOW_SIZE). Must be a positive integer greater than 0. This default is higher than Node.js core's default (65535 bytes) to improve throughput, Node's choice is very conservative for current high-bandwith networks. See [RFC 7540 Section 6.9.2](https://datatracker.ietf.org/doc/html/rfc7540#section-6.9.2) for more details.
36
+ * **connectionWindowSize**: `number` (optional) - Default `524288` (512KB). Sets the HTTP/2 connection-level flow-control window size using `ClientHttp2Session.setLocalWindowSize()`. Must be a positive integer greater than 0. This provides better flow control for the entire connection across multiple streams. See [Node.js HTTP/2 documentation](https://nodejs.org/api/http2.html#clienthttp2sessionsetlocalwindowsize) for more details.
37
+ * **pingInterval**: `number` - Default: `60e3`. The time interval in milliseconds between PING frames sent to the server. Set to `0` to disable PING frames. This is only applicable for HTTP/2 connections. This will emit a `ping` event on the client with the duration of the ping in milliseconds.
38
+
39
+ > **Notes about HTTP/2**
40
+ > - It only works under TLS connections. h2c is not supported.
41
+ > - The server must support HTTP/2 and choose it as the protocol during the ALPN negotiation.
42
+ > - The server must not have a bigger priority for HTTP/1.1 than HTTP/2.
43
+ > - Pseudo headers are automatically attached to the request. If you try to set them, they will be overwritten.
44
+ > - The `:path` header is automatically set to the request path.
45
+ > - The `:method` header is automatically set to the request method.
46
+ > - The `:scheme` header is automatically set to the request scheme.
47
+ > - The `:authority` header is automatically set to the request `host[:port]`.
48
+ > - `PUSH` frames are yet not supported.
49
+
50
+ #### Parameter: `ConnectOptions`
51
+
52
+ Every Tls option, see [here](https://nodejs.org/api/tls.html#tls_tls_connect_options_callback).
53
+ Furthermore, the following options can be passed:
54
+
55
+ * **socketPath** `string | null` (optional) - Default: `null` - An IPC endpoint, either Unix domain socket or Windows named pipe.
56
+ * **maxCachedSessions** `number | null` (optional) - Default: `100` - Maximum number of TLS cached sessions. Use 0 to disable TLS session caching. Default: 100.
57
+ * **timeout** `number | null` (optional) - In milliseconds, Default `10e3`.
58
+ * **servername** `string | null` (optional)
59
+ * **keepAlive** `boolean | null` (optional) - Default: `true` - TCP keep-alive enabled
60
+ * **keepAliveInitialDelay** `number | null` (optional) - Default: `60000` - TCP keep-alive interval for the socket in milliseconds
61
+
62
+ ### Example - Basic Client instantiation
63
+
64
+ This will instantiate the undici Client, but it will not connect to the origin until something is queued. Consider using `client.connect` to prematurely connect to the origin, or just call `client.request`.
65
+
66
+ ```js
67
+ 'use strict'
68
+ import { Client } from 'undici'
69
+
70
+ const client = new Client('http://localhost:3000')
71
+ ```
72
+
73
+ ### Example - Custom connector
74
+
75
+ This will allow you to perform some additional check on the socket that will be used for the next request.
76
+
77
+ ```js
78
+ 'use strict'
79
+ import { Client, buildConnector } from 'undici'
80
+
81
+ const connector = buildConnector({ rejectUnauthorized: false })
82
+ const client = new Client('https://localhost:3000', {
83
+ connect (opts, cb) {
84
+ connector(opts, (err, socket) => {
85
+ if (err) {
86
+ cb(err)
87
+ } else if (/* assertion */) {
88
+ socket.destroy()
89
+ cb(new Error('kaboom'))
90
+ } else {
91
+ cb(null, socket)
92
+ }
93
+ })
94
+ }
95
+ })
96
+ ```
97
+
98
+ ## Instance Methods
99
+
100
+ ### `Client.close([callback])`
101
+
102
+ Implements [`Dispatcher.close([callback])`](/docs/docs/api/Dispatcher.md#dispatcherclosecallback-promise).
103
+
104
+ ### `Client.destroy([error, callback])`
105
+
106
+ Implements [`Dispatcher.destroy([error, callback])`](/docs/docs/api/Dispatcher.md#dispatcherdestroyerror-callback-promise).
107
+
108
+ Waits until socket is closed before invoking the callback (or returning a promise if no callback is provided).
109
+
110
+ ### `Client.connect(options[, callback])`
111
+
112
+ See [`Dispatcher.connect(options[, callback])`](/docs/docs/api/Dispatcher.md#dispatcherconnectoptions-callback).
113
+
114
+ ### `Client.dispatch(options, handlers)`
115
+
116
+ Implements [`Dispatcher.dispatch(options, handlers)`](/docs/docs/api/Dispatcher.md#dispatcherdispatchoptions-handler).
117
+
118
+ ### `Client.pipeline(options, handler)`
119
+
120
+ See [`Dispatcher.pipeline(options, handler)`](/docs/docs/api/Dispatcher.md#dispatcherpipelineoptions-handler).
121
+
122
+ ### `Client.request(options[, callback])`
123
+
124
+ See [`Dispatcher.request(options [, callback])`](/docs/docs/api/Dispatcher.md#dispatcherrequestoptions-callback).
125
+
126
+ ### `Client.stream(options, factory[, callback])`
127
+
128
+ See [`Dispatcher.stream(options, factory[, callback])`](/docs/docs/api/Dispatcher.md#dispatcherstreamoptions-factory-callback).
129
+
130
+ ### `Client.upgrade(options[, callback])`
131
+
132
+ See [`Dispatcher.upgrade(options[, callback])`](/docs/docs/api/Dispatcher.md#dispatcherupgradeoptions-callback).
133
+
134
+ ## Instance Properties
135
+
136
+ ### `Client.closed`
137
+
138
+ * `boolean`
139
+
140
+ `true` after `client.close()` has been called.
141
+
142
+ ### `Client.destroyed`
143
+
144
+ * `boolean`
145
+
146
+ `true` after `client.destroyed()` has been called or `client.close()` has been called and the client shutdown has completed.
147
+
148
+ ### `Client.pipelining`
149
+
150
+ * `number`
151
+
152
+ Property to get and set the pipelining factor.
153
+
154
+ ## Instance Events
155
+
156
+ ### Event: `'connect'`
157
+
158
+ See [Dispatcher Event: `'connect'`](/docs/docs/api/Dispatcher.md#event-connect).
159
+
160
+ Parameters:
161
+
162
+ * **origin** `URL`
163
+ * **targets** `Array<Dispatcher>`
164
+
165
+ Emitted when a socket has been created and connected. The client will connect once `client.size > 0`.
166
+
167
+ #### Example - Client connect event
168
+
169
+ ```js
170
+ import { createServer } from 'http'
171
+ import { Client } from 'undici'
172
+ import { once } from 'events'
173
+
174
+ const server = createServer((request, response) => {
175
+ response.end('Hello, World!')
176
+ }).listen()
177
+
178
+ await once(server, 'listening')
179
+
180
+ const client = new Client(`http://localhost:${server.address().port}`)
181
+
182
+ client.on('connect', (origin) => {
183
+ console.log(`Connected to ${origin}`) // should print before the request body statement
184
+ })
185
+
186
+ try {
187
+ const { body } = await client.request({
188
+ path: '/',
189
+ method: 'GET'
190
+ })
191
+ body.setEncoding('utf-8')
192
+ body.on('data', console.log)
193
+ client.close()
194
+ server.close()
195
+ } catch (error) {
196
+ console.error(error)
197
+ client.close()
198
+ server.close()
199
+ }
200
+ ```
201
+
202
+ ### Event: `'disconnect'`
203
+
204
+ See [Dispatcher Event: `'disconnect'`](/docs/docs/api/Dispatcher.md#event-disconnect).
205
+
206
+ Parameters:
207
+
208
+ * **origin** `URL`
209
+ * **targets** `Array<Dispatcher>`
210
+ * **error** `Error`
211
+
212
+ Emitted when socket has disconnected. The error argument of the event is the error which caused the socket to disconnect. The client will reconnect if or once `client.size > 0`.
213
+
214
+ #### Example - Client disconnect event
215
+
216
+ ```js
217
+ import { createServer } from 'http'
218
+ import { Client } from 'undici'
219
+ import { once } from 'events'
220
+
221
+ const server = createServer((request, response) => {
222
+ response.destroy()
223
+ }).listen()
224
+
225
+ await once(server, 'listening')
226
+
227
+ const client = new Client(`http://localhost:${server.address().port}`)
228
+
229
+ client.on('disconnect', (origin) => {
230
+ console.log(`Disconnected from ${origin}`)
231
+ })
232
+
233
+ try {
234
+ await client.request({
235
+ path: '/',
236
+ method: 'GET'
237
+ })
238
+ } catch (error) {
239
+ console.error(error.message)
240
+ client.close()
241
+ server.close()
242
+ }
243
+ ```
244
+
245
+ ### Event: `'drain'`
246
+
247
+ Emitted when pipeline is no longer busy.
248
+
249
+ See [Dispatcher Event: `'drain'`](/docs/docs/api/Dispatcher.md#event-drain).
250
+
251
+ #### Example - Client drain event
252
+
253
+ ```js
254
+ import { createServer } from 'http'
255
+ import { Client } from 'undici'
256
+ import { once } from 'events'
257
+
258
+ const server = createServer((request, response) => {
259
+ response.end('Hello, World!')
260
+ }).listen()
261
+
262
+ await once(server, 'listening')
263
+
264
+ const client = new Client(`http://localhost:${server.address().port}`)
265
+
266
+ client.on('drain', () => {
267
+ console.log('drain event')
268
+ client.close()
269
+ server.close()
270
+ })
271
+
272
+ const requests = [
273
+ client.request({ path: '/', method: 'GET' }),
274
+ client.request({ path: '/', method: 'GET' }),
275
+ client.request({ path: '/', method: 'GET' })
276
+ ]
277
+
278
+ await Promise.all(requests)
279
+
280
+ console.log('requests completed')
281
+ ```
282
+
283
+ ### Event: `'error'`
284
+
285
+ Invoked for users errors such as throwing in the `onError` handler.
@@ -0,0 +1,27 @@
1
+ # Class: ClientStats
2
+
3
+ Stats for a [Client](/docs/docs/api/Client.md).
4
+
5
+ ## `new ClientStats(client)`
6
+
7
+ Arguments:
8
+
9
+ * **client** `Client` - Client from which to return stats.
10
+
11
+ ## Instance Properties
12
+
13
+ ### `ClientStats.connected`
14
+
15
+ Boolean if socket as open connection by this client.
16
+
17
+ ### `ClientStats.pending`
18
+
19
+ Number of pending requests of this client.
20
+
21
+ ### `ClientStats.running`
22
+
23
+ Number of currently active requests across this client.
24
+
25
+ ### `ClientStats.size`
26
+
27
+ Number of active, pending, or queued requests of this clients.