monitor-transfer-dsh 0.0.0-stage → 0.1.2
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.
- package/CHANGELOG.md +25 -0
- package/README.md +51 -2
- package/cordis.patch.yml +4 -0
- package/lib/client.js +381 -0
- package/lib/index.js +267 -0
- package/package.json +67 -3
- package/skill/SKILL.md +48 -0
- package/skill/tools/node_modules/.package-lock.json +163 -0
- package/skill/tools/node_modules/pg/LICENSE +21 -0
- package/skill/tools/node_modules/pg/README.md +96 -0
- package/skill/tools/node_modules/pg/esm/index.mjs +20 -0
- package/skill/tools/node_modules/pg/lib/client.js +846 -0
- package/skill/tools/node_modules/pg/lib/connection-parameters.js +184 -0
- package/skill/tools/node_modules/pg/lib/connection.js +250 -0
- package/skill/tools/node_modules/pg/lib/crypto/cert-signatures.js +122 -0
- package/skill/tools/node_modules/pg/lib/crypto/sasl.js +262 -0
- package/skill/tools/node_modules/pg/lib/crypto/utils.js +89 -0
- package/skill/tools/node_modules/pg/lib/defaults.js +94 -0
- package/skill/tools/node_modules/pg/lib/index.js +73 -0
- package/skill/tools/node_modules/pg/lib/native/client.js +428 -0
- package/skill/tools/node_modules/pg/lib/native/index.js +2 -0
- package/skill/tools/node_modules/pg/lib/native/query.js +167 -0
- package/skill/tools/node_modules/pg/lib/query.js +263 -0
- package/skill/tools/node_modules/pg/lib/result.js +109 -0
- package/skill/tools/node_modules/pg/lib/stream.js +83 -0
- package/skill/tools/node_modules/pg/lib/type-overrides.js +35 -0
- package/skill/tools/node_modules/pg/lib/utils.js +225 -0
- package/skill/tools/node_modules/pg/package.json +76 -0
- package/skill/tools/node_modules/pg-cloudflare/LICENSE +21 -0
- package/skill/tools/node_modules/pg-cloudflare/README.md +112 -0
- package/skill/tools/node_modules/pg-cloudflare/dist/empty.d.ts +2 -0
- package/skill/tools/node_modules/pg-cloudflare/dist/empty.js +6 -0
- package/skill/tools/node_modules/pg-cloudflare/dist/empty.js.map +1 -0
- package/skill/tools/node_modules/pg-cloudflare/dist/index.d.ts +29 -0
- package/skill/tools/node_modules/pg-cloudflare/dist/index.js +171 -0
- package/skill/tools/node_modules/pg-cloudflare/dist/index.js.map +1 -0
- package/skill/tools/node_modules/pg-cloudflare/esm/index.mjs +3 -0
- package/skill/tools/node_modules/pg-cloudflare/package.json +39 -0
- package/skill/tools/node_modules/pg-cloudflare/src/empty.ts +3 -0
- package/skill/tools/node_modules/pg-cloudflare/src/index.ts +187 -0
- package/skill/tools/node_modules/pg-cloudflare/src/types.d.ts +25 -0
- package/skill/tools/node_modules/pg-connection-string/LICENSE +21 -0
- package/skill/tools/node_modules/pg-connection-string/README.md +105 -0
- package/skill/tools/node_modules/pg-connection-string/esm/index.mjs +8 -0
- package/skill/tools/node_modules/pg-connection-string/index.d.ts +37 -0
- package/skill/tools/node_modules/pg-connection-string/index.js +237 -0
- package/skill/tools/node_modules/pg-connection-string/package.json +51 -0
- package/skill/tools/node_modules/pg-int8/LICENSE +13 -0
- package/skill/tools/node_modules/pg-int8/README.md +16 -0
- package/skill/tools/node_modules/pg-int8/index.js +100 -0
- package/skill/tools/node_modules/pg-int8/package.json +24 -0
- package/skill/tools/node_modules/pg-pool/LICENSE +21 -0
- package/skill/tools/node_modules/pg-pool/README.md +357 -0
- package/skill/tools/node_modules/pg-pool/esm/index.mjs +5 -0
- package/skill/tools/node_modules/pg-pool/index.js +517 -0
- package/skill/tools/node_modules/pg-pool/package.json +51 -0
- package/skill/tools/node_modules/pg-protocol/LICENSE +21 -0
- package/skill/tools/node_modules/pg-protocol/README.md +3 -0
- package/skill/tools/node_modules/pg-protocol/dist/b.d.ts +1 -0
- package/skill/tools/node_modules/pg-protocol/dist/b.js +23 -0
- package/skill/tools/node_modules/pg-protocol/dist/b.js.map +1 -0
- package/skill/tools/node_modules/pg-protocol/dist/buffer-reader.d.ts +14 -0
- package/skill/tools/node_modules/pg-protocol/dist/buffer-reader.js +55 -0
- package/skill/tools/node_modules/pg-protocol/dist/buffer-reader.js.map +1 -0
- package/skill/tools/node_modules/pg-protocol/dist/buffer-writer.d.ts +21 -0
- package/skill/tools/node_modules/pg-protocol/dist/buffer-writer.js +113 -0
- package/skill/tools/node_modules/pg-protocol/dist/buffer-writer.js.map +1 -0
- package/skill/tools/node_modules/pg-protocol/dist/inbound-parser.test.d.ts +1 -0
- package/skill/tools/node_modules/pg-protocol/dist/inbound-parser.test.js +538 -0
- package/skill/tools/node_modules/pg-protocol/dist/inbound-parser.test.js.map +1 -0
- package/skill/tools/node_modules/pg-protocol/dist/index.d.ts +5 -0
- package/skill/tools/node_modules/pg-protocol/dist/index.js +15 -0
- package/skill/tools/node_modules/pg-protocol/dist/index.js.map +1 -0
- package/skill/tools/node_modules/pg-protocol/dist/messages.d.ts +161 -0
- package/skill/tools/node_modules/pg-protocol/dist/messages.js +160 -0
- package/skill/tools/node_modules/pg-protocol/dist/messages.js.map +1 -0
- package/skill/tools/node_modules/pg-protocol/dist/outbound-serializer.test.d.ts +1 -0
- package/skill/tools/node_modules/pg-protocol/dist/outbound-serializer.test.js +325 -0
- package/skill/tools/node_modules/pg-protocol/dist/outbound-serializer.test.js.map +1 -0
- package/skill/tools/node_modules/pg-protocol/dist/parser.d.ts +22 -0
- package/skill/tools/node_modules/pg-protocol/dist/parser.js +325 -0
- package/skill/tools/node_modules/pg-protocol/dist/parser.js.map +1 -0
- package/skill/tools/node_modules/pg-protocol/dist/serializer.d.ts +42 -0
- package/skill/tools/node_modules/pg-protocol/dist/serializer.js +198 -0
- package/skill/tools/node_modules/pg-protocol/dist/serializer.js.map +1 -0
- package/skill/tools/node_modules/pg-protocol/esm/index.js +11 -0
- package/skill/tools/node_modules/pg-protocol/package.json +44 -0
- package/skill/tools/node_modules/pg-protocol/src/b.ts +25 -0
- package/skill/tools/node_modules/pg-protocol/src/buffer-reader.ts +58 -0
- package/skill/tools/node_modules/pg-protocol/src/buffer-writer.ts +120 -0
- package/skill/tools/node_modules/pg-protocol/src/inbound-parser.test.ts +585 -0
- package/skill/tools/node_modules/pg-protocol/src/index.ts +11 -0
- package/skill/tools/node_modules/pg-protocol/src/messages.ts +262 -0
- package/skill/tools/node_modules/pg-protocol/src/outbound-serializer.test.ts +356 -0
- package/skill/tools/node_modules/pg-protocol/src/parser.ts +414 -0
- package/skill/tools/node_modules/pg-protocol/src/serializer.ts +286 -0
- package/skill/tools/node_modules/pg-protocol/src/testing/buffer-list.ts +67 -0
- package/skill/tools/node_modules/pg-protocol/src/testing/test-buffers.ts +166 -0
- package/skill/tools/node_modules/pg-types/.travis.yml +7 -0
- package/skill/tools/node_modules/pg-types/Makefile +14 -0
- package/skill/tools/node_modules/pg-types/README.md +75 -0
- package/skill/tools/node_modules/pg-types/index.d.ts +137 -0
- package/skill/tools/node_modules/pg-types/index.js +47 -0
- package/skill/tools/node_modules/pg-types/index.test-d.ts +21 -0
- package/skill/tools/node_modules/pg-types/lib/arrayParser.js +11 -0
- package/skill/tools/node_modules/pg-types/lib/binaryParsers.js +257 -0
- package/skill/tools/node_modules/pg-types/lib/builtins.js +73 -0
- package/skill/tools/node_modules/pg-types/lib/textParsers.js +215 -0
- package/skill/tools/node_modules/pg-types/package.json +42 -0
- package/skill/tools/node_modules/pg-types/test/index.js +24 -0
- package/skill/tools/node_modules/pg-types/test/types.js +597 -0
- package/skill/tools/node_modules/pgpass/README.md +74 -0
- package/skill/tools/node_modules/pgpass/lib/helper.js +233 -0
- package/skill/tools/node_modules/pgpass/lib/index.js +23 -0
- package/skill/tools/node_modules/pgpass/package.json +41 -0
- package/skill/tools/node_modules/postgres-array/index.d.ts +4 -0
- package/skill/tools/node_modules/postgres-array/index.js +97 -0
- package/skill/tools/node_modules/postgres-array/license +21 -0
- package/skill/tools/node_modules/postgres-array/package.json +35 -0
- package/skill/tools/node_modules/postgres-array/readme.md +43 -0
- package/skill/tools/node_modules/postgres-bytea/index.js +33 -0
- package/skill/tools/node_modules/postgres-bytea/license +21 -0
- package/skill/tools/node_modules/postgres-bytea/package.json +34 -0
- package/skill/tools/node_modules/postgres-bytea/readme.md +34 -0
- package/skill/tools/node_modules/postgres-date/index.js +116 -0
- package/skill/tools/node_modules/postgres-date/license +21 -0
- package/skill/tools/node_modules/postgres-date/package.json +33 -0
- package/skill/tools/node_modules/postgres-date/readme.md +49 -0
- package/skill/tools/node_modules/postgres-interval/index.d.ts +20 -0
- package/skill/tools/node_modules/postgres-interval/index.js +125 -0
- package/skill/tools/node_modules/postgres-interval/license +21 -0
- package/skill/tools/node_modules/postgres-interval/package.json +36 -0
- package/skill/tools/node_modules/postgres-interval/readme.md +48 -0
- package/skill/tools/node_modules/split2/LICENSE +13 -0
- package/skill/tools/node_modules/split2/README.md +85 -0
- package/skill/tools/node_modules/split2/bench.js +27 -0
- package/skill/tools/node_modules/split2/index.js +141 -0
- package/skill/tools/node_modules/split2/package.json +39 -0
- package/skill/tools/node_modules/split2/test.js +409 -0
- package/skill/tools/node_modules/undici/LICENSE +21 -0
- package/skill/tools/node_modules/undici/README.md +828 -0
- package/skill/tools/node_modules/undici/docs/docs/api/Agent.md +291 -0
- package/skill/tools/node_modules/undici/docs/docs/api/BalancedPool.md +297 -0
- package/skill/tools/node_modules/undici/docs/docs/api/CacheStorage.md +188 -0
- package/skill/tools/node_modules/undici/docs/docs/api/CacheStore.md +375 -0
- package/skill/tools/node_modules/undici/docs/docs/api/Client.md +538 -0
- package/skill/tools/node_modules/undici/docs/docs/api/ClientStats.md +93 -0
- package/skill/tools/node_modules/undici/docs/docs/api/Connector.md +198 -0
- package/skill/tools/node_modules/undici/docs/docs/api/ContentType.md +97 -0
- package/skill/tools/node_modules/undici/docs/docs/api/Cookies.md +179 -0
- package/skill/tools/node_modules/undici/docs/docs/api/Debug.md +78 -0
- package/skill/tools/node_modules/undici/docs/docs/api/DiagnosticsChannel.md +518 -0
- package/skill/tools/node_modules/undici/docs/docs/api/Dispatcher.md +842 -0
- package/skill/tools/node_modules/undici/docs/docs/api/EnvHttpProxyAgent.md +171 -0
- package/skill/tools/node_modules/undici/docs/docs/api/Errors.md +624 -0
- package/skill/tools/node_modules/undici/docs/docs/api/EventSource.md +358 -0
- package/skill/tools/node_modules/undici/docs/docs/api/Fetch.md +721 -0
- package/skill/tools/node_modules/undici/docs/docs/api/GlobalInstallation.md +121 -0
- package/skill/tools/node_modules/undici/docs/docs/api/H2CClient.md +386 -0
- package/skill/tools/node_modules/undici/docs/docs/api/Interceptors.md +439 -0
- package/skill/tools/node_modules/undici/docs/docs/api/MockAgent.md +622 -0
- package/skill/tools/node_modules/undici/docs/docs/api/MockCallHistory.md +371 -0
- package/skill/tools/node_modules/undici/docs/docs/api/MockCallHistoryLog.md +206 -0
- package/skill/tools/node_modules/undici/docs/docs/api/MockClient.md +199 -0
- package/skill/tools/node_modules/undici/docs/docs/api/MockErrors.md +63 -0
- package/skill/tools/node_modules/undici/docs/docs/api/MockPool.md +618 -0
- package/skill/tools/node_modules/undici/docs/docs/api/Pool.md +278 -0
- package/skill/tools/node_modules/undici/docs/docs/api/PoolStats.md +141 -0
- package/skill/tools/node_modules/undici/docs/docs/api/ProxyAgent.md +248 -0
- package/skill/tools/node_modules/undici/docs/docs/api/RedirectHandler.md +279 -0
- package/skill/tools/node_modules/undici/docs/docs/api/RetryAgent.md +136 -0
- package/skill/tools/node_modules/undici/docs/docs/api/RetryHandler.md +200 -0
- package/skill/tools/node_modules/undici/docs/docs/api/RoundRobinPool.md +239 -0
- package/skill/tools/node_modules/undici/docs/docs/api/SnapshotAgent.md +361 -0
- package/skill/tools/node_modules/undici/docs/docs/api/Socks5ProxyAgent.md +256 -0
- package/skill/tools/node_modules/undici/docs/docs/api/Util.md +82 -0
- package/skill/tools/node_modules/undici/docs/docs/api/WebSocket.md +536 -0
- package/skill/tools/node_modules/undici/docs/docs/api/api-lifecycle.md +159 -0
- package/skill/tools/node_modules/undici/docs/docs/best-practices/client-certificate.md +66 -0
- package/skill/tools/node_modules/undici/docs/docs/best-practices/crawling.md +60 -0
- package/skill/tools/node_modules/undici/docs/docs/best-practices/migrating-from-v7-to-v8.md +233 -0
- package/skill/tools/node_modules/undici/docs/docs/best-practices/mocking-request.md +192 -0
- package/skill/tools/node_modules/undici/docs/docs/best-practices/proxy.md +129 -0
- package/skill/tools/node_modules/undici/docs/docs/best-practices/undici-vs-builtin-fetch.md +226 -0
- package/skill/tools/node_modules/undici/docs/docs/best-practices/writing-tests.md +65 -0
- package/skill/tools/node_modules/undici/docs/docs/getting-started.md +281 -0
- package/skill/tools/node_modules/undici/docs/docs/index.md +793 -0
- package/skill/tools/node_modules/undici/docs/docs/site.json +125 -0
- package/skill/tools/node_modules/undici/docs/docs/type-map.json +79 -0
- package/skill/tools/node_modules/undici/index-fetch.js +65 -0
- package/skill/tools/node_modules/undici/index.d.ts +3 -0
- package/skill/tools/node_modules/undici/index.js +236 -0
- package/skill/tools/node_modules/undici/lib/api/abort-signal.js +59 -0
- package/skill/tools/node_modules/undici/lib/api/api-connect.js +112 -0
- package/skill/tools/node_modules/undici/lib/api/api-pipeline.js +265 -0
- package/skill/tools/node_modules/undici/lib/api/api-request.js +244 -0
- package/skill/tools/node_modules/undici/lib/api/api-stream.js +270 -0
- package/skill/tools/node_modules/undici/lib/api/api-upgrade.js +121 -0
- package/skill/tools/node_modules/undici/lib/api/index.js +7 -0
- package/skill/tools/node_modules/undici/lib/api/readable.js +615 -0
- package/skill/tools/node_modules/undici/lib/cache/memory-cache-store.js +314 -0
- package/skill/tools/node_modules/undici/lib/cache/sqlite-cache-store.js +593 -0
- package/skill/tools/node_modules/undici/lib/core/connect.js +198 -0
- package/skill/tools/node_modules/undici/lib/core/constants.js +131 -0
- package/skill/tools/node_modules/undici/lib/core/diagnostics.js +227 -0
- package/skill/tools/node_modules/undici/lib/core/errors.js +534 -0
- package/skill/tools/node_modules/undici/lib/core/request.js +582 -0
- package/skill/tools/node_modules/undici/lib/core/socks5-client.js +422 -0
- package/skill/tools/node_modules/undici/lib/core/socks5-utils.js +212 -0
- package/skill/tools/node_modules/undici/lib/core/symbols.js +81 -0
- package/skill/tools/node_modules/undici/lib/core/tree.js +160 -0
- package/skill/tools/node_modules/undici/lib/core/util.js +1035 -0
- package/skill/tools/node_modules/undici/lib/dispatcher/agent.js +181 -0
- package/skill/tools/node_modules/undici/lib/dispatcher/balanced-pool.js +217 -0
- package/skill/tools/node_modules/undici/lib/dispatcher/client-h1.js +1846 -0
- package/skill/tools/node_modules/undici/lib/dispatcher/client-h2.js +1989 -0
- package/skill/tools/node_modules/undici/lib/dispatcher/client.js +749 -0
- package/skill/tools/node_modules/undici/lib/dispatcher/dispatcher-base.js +198 -0
- package/skill/tools/node_modules/undici/lib/dispatcher/dispatcher.js +58 -0
- package/skill/tools/node_modules/undici/lib/dispatcher/dispatcher1-wrapper.js +127 -0
- package/skill/tools/node_modules/undici/lib/dispatcher/env-http-proxy-agent.js +190 -0
- package/skill/tools/node_modules/undici/lib/dispatcher/fixed-queue.js +135 -0
- package/skill/tools/node_modules/undici/lib/dispatcher/h2c-client.js +51 -0
- package/skill/tools/node_modules/undici/lib/dispatcher/parser-h1.js +1065 -0
- package/skill/tools/node_modules/undici/lib/dispatcher/pool-base.js +347 -0
- package/skill/tools/node_modules/undici/lib/dispatcher/pool.js +229 -0
- package/skill/tools/node_modules/undici/lib/dispatcher/proxy-agent.js +418 -0
- package/skill/tools/node_modules/undici/lib/dispatcher/retry-agent.js +48 -0
- package/skill/tools/node_modules/undici/lib/dispatcher/round-robin-pool.js +169 -0
- package/skill/tools/node_modules/undici/lib/dispatcher/socks5-proxy-agent.js +350 -0
- package/skill/tools/node_modules/undici/lib/encoding/index.js +33 -0
- package/skill/tools/node_modules/undici/lib/global.js +82 -0
- package/skill/tools/node_modules/undici/lib/handler/cache-handler.js +1222 -0
- package/skill/tools/node_modules/undici/lib/handler/cache-revalidation-handler.js +134 -0
- package/skill/tools/node_modules/undici/lib/handler/decorator-handler.js +76 -0
- package/skill/tools/node_modules/undici/lib/handler/deduplication-handler.js +540 -0
- package/skill/tools/node_modules/undici/lib/handler/redirect-handler.js +284 -0
- package/skill/tools/node_modules/undici/lib/handler/retry-handler.js +686 -0
- package/skill/tools/node_modules/undici/lib/interceptor/cache.js +771 -0
- package/skill/tools/node_modules/undici/lib/interceptor/decompress.js +574 -0
- package/skill/tools/node_modules/undici/lib/interceptor/deduplicate.js +118 -0
- package/skill/tools/node_modules/undici/lib/interceptor/dns.js +593 -0
- package/skill/tools/node_modules/undici/lib/interceptor/dump.js +99 -0
- package/skill/tools/node_modules/undici/lib/interceptor/redirect.js +21 -0
- package/skill/tools/node_modules/undici/lib/interceptor/response-error.js +139 -0
- package/skill/tools/node_modules/undici/lib/interceptor/retry.js +19 -0
- package/skill/tools/node_modules/undici/lib/llhttp/constants.d.ts +195 -0
- package/skill/tools/node_modules/undici/lib/llhttp/constants.js +531 -0
- package/skill/tools/node_modules/undici/lib/llhttp/llhttp-wasm.js +15 -0
- package/skill/tools/node_modules/undici/lib/llhttp/llhttp_simd-wasm.js +15 -0
- package/skill/tools/node_modules/undici/lib/llhttp/utils.d.ts +2 -0
- package/skill/tools/node_modules/undici/lib/llhttp/utils.js +12 -0
- package/skill/tools/node_modules/undici/lib/milo/LICENSE.md +7 -0
- package/skill/tools/node_modules/undici/lib/milo/no-simd.js +1002 -0
- package/skill/tools/node_modules/undici/lib/milo/simd.js +1002 -0
- package/skill/tools/node_modules/undici/lib/mock/mock-agent.js +255 -0
- package/skill/tools/node_modules/undici/lib/mock/mock-call-history.js +248 -0
- package/skill/tools/node_modules/undici/lib/mock/mock-client.js +68 -0
- package/skill/tools/node_modules/undici/lib/mock/mock-errors.js +29 -0
- package/skill/tools/node_modules/undici/lib/mock/mock-interceptor.js +227 -0
- package/skill/tools/node_modules/undici/lib/mock/mock-pool.js +68 -0
- package/skill/tools/node_modules/undici/lib/mock/mock-symbols.js +32 -0
- package/skill/tools/node_modules/undici/lib/mock/mock-utils.js +730 -0
- package/skill/tools/node_modules/undici/lib/mock/pending-interceptors-formatter.js +43 -0
- package/skill/tools/node_modules/undici/lib/mock/snapshot-agent.js +371 -0
- package/skill/tools/node_modules/undici/lib/mock/snapshot-recorder.js +624 -0
- package/skill/tools/node_modules/undici/lib/mock/snapshot-utils.js +159 -0
- package/skill/tools/node_modules/undici/lib/util/cache.js +764 -0
- package/skill/tools/node_modules/undici/lib/util/date.js +670 -0
- package/skill/tools/node_modules/undici/lib/util/runtime-features.js +93 -0
- package/skill/tools/node_modules/undici/lib/util/stats.js +32 -0
- package/skill/tools/node_modules/undici/lib/util/timers.js +425 -0
- package/skill/tools/node_modules/undici/lib/web/cache/cache.js +871 -0
- package/skill/tools/node_modules/undici/lib/web/cache/cachestorage.js +158 -0
- package/skill/tools/node_modules/undici/lib/web/cache/util.js +45 -0
- package/skill/tools/node_modules/undici/lib/web/cookies/constants.js +12 -0
- package/skill/tools/node_modules/undici/lib/web/cookies/index.js +211 -0
- package/skill/tools/node_modules/undici/lib/web/cookies/parse.js +318 -0
- package/skill/tools/node_modules/undici/lib/web/cookies/util.js +371 -0
- package/skill/tools/node_modules/undici/lib/web/eventsource/eventsource-stream.js +575 -0
- package/skill/tools/node_modules/undici/lib/web/eventsource/eventsource.js +547 -0
- package/skill/tools/node_modules/undici/lib/web/eventsource/util.js +60 -0
- package/skill/tools/node_modules/undici/lib/web/fetch/LICENSE +21 -0
- package/skill/tools/node_modules/undici/lib/web/fetch/body.js +583 -0
- package/skill/tools/node_modules/undici/lib/web/fetch/constants.js +131 -0
- package/skill/tools/node_modules/undici/lib/web/fetch/data-url.js +596 -0
- package/skill/tools/node_modules/undici/lib/web/fetch/formdata-parser.js +594 -0
- package/skill/tools/node_modules/undici/lib/web/fetch/formdata.js +272 -0
- package/skill/tools/node_modules/undici/lib/web/fetch/global.js +40 -0
- package/skill/tools/node_modules/undici/lib/web/fetch/headers.js +722 -0
- package/skill/tools/node_modules/undici/lib/web/fetch/index.js +2451 -0
- package/skill/tools/node_modules/undici/lib/web/fetch/request.js +1117 -0
- package/skill/tools/node_modules/undici/lib/web/fetch/response.js +638 -0
- package/skill/tools/node_modules/undici/lib/web/fetch/util.js +1530 -0
- package/skill/tools/node_modules/undici/lib/web/infra/index.js +244 -0
- package/skill/tools/node_modules/undici/lib/web/subresource-integrity/Readme.md +9 -0
- package/skill/tools/node_modules/undici/lib/web/subresource-integrity/subresource-integrity.js +307 -0
- package/skill/tools/node_modules/undici/lib/web/webidl/index.js +992 -0
- package/skill/tools/node_modules/undici/lib/web/websocket/connection.js +350 -0
- package/skill/tools/node_modules/undici/lib/web/websocket/constants.js +126 -0
- package/skill/tools/node_modules/undici/lib/web/websocket/events.js +348 -0
- package/skill/tools/node_modules/undici/lib/web/websocket/frame.js +127 -0
- package/skill/tools/node_modules/undici/lib/web/websocket/permessage-deflate.js +105 -0
- package/skill/tools/node_modules/undici/lib/web/websocket/receiver.js +530 -0
- package/skill/tools/node_modules/undici/lib/web/websocket/sender.js +109 -0
- package/skill/tools/node_modules/undici/lib/web/websocket/stream/websocketerror.js +107 -0
- package/skill/tools/node_modules/undici/lib/web/websocket/stream/websocketstream.js +511 -0
- package/skill/tools/node_modules/undici/lib/web/websocket/util.js +347 -0
- package/skill/tools/node_modules/undici/lib/web/websocket/websocket.js +783 -0
- package/skill/tools/node_modules/undici/package.json +154 -0
- package/skill/tools/node_modules/undici/scripts/strip-comments.js +10 -0
- package/skill/tools/node_modules/undici/types/README.md +6 -0
- package/skill/tools/node_modules/undici/types/agent.d.ts +30 -0
- package/skill/tools/node_modules/undici/types/api.d.ts +43 -0
- package/skill/tools/node_modules/undici/types/balanced-pool.d.ts +30 -0
- package/skill/tools/node_modules/undici/types/cache-interceptor.d.ts +189 -0
- package/skill/tools/node_modules/undici/types/cache.d.ts +36 -0
- package/skill/tools/node_modules/undici/types/client-stats.d.ts +15 -0
- package/skill/tools/node_modules/undici/types/client.d.ts +190 -0
- package/skill/tools/node_modules/undici/types/connector.d.ts +37 -0
- package/skill/tools/node_modules/undici/types/content-type.d.ts +21 -0
- package/skill/tools/node_modules/undici/types/cookies.d.ts +30 -0
- package/skill/tools/node_modules/undici/types/diagnostics-channel.d.ts +75 -0
- package/skill/tools/node_modules/undici/types/dispatcher.d.ts +253 -0
- package/skill/tools/node_modules/undici/types/dispatcher1-wrapper.d.ts +7 -0
- package/skill/tools/node_modules/undici/types/env-http-proxy-agent.d.ts +22 -0
- package/skill/tools/node_modules/undici/types/errors.d.ts +202 -0
- package/skill/tools/node_modules/undici/types/eventsource.d.ts +66 -0
- package/skill/tools/node_modules/undici/types/fetch.d.ts +235 -0
- package/skill/tools/node_modules/undici/types/formdata.d.ts +108 -0
- package/skill/tools/node_modules/undici/types/global-dispatcher.d.ts +9 -0
- package/skill/tools/node_modules/undici/types/global-origin.d.ts +7 -0
- package/skill/tools/node_modules/undici/types/h2c-client.d.ts +73 -0
- package/skill/tools/node_modules/undici/types/handlers.d.ts +16 -0
- package/skill/tools/node_modules/undici/types/header.d.ts +165 -0
- package/skill/tools/node_modules/undici/types/index.d.ts +93 -0
- package/skill/tools/node_modules/undici/types/interceptors.d.ts +87 -0
- package/skill/tools/node_modules/undici/types/mock-agent.d.ts +69 -0
- package/skill/tools/node_modules/undici/types/mock-call-history.d.ts +111 -0
- package/skill/tools/node_modules/undici/types/mock-client.d.ts +27 -0
- package/skill/tools/node_modules/undici/types/mock-errors.d.ts +12 -0
- package/skill/tools/node_modules/undici/types/mock-interceptor.d.ts +98 -0
- package/skill/tools/node_modules/undici/types/mock-pool.d.ts +27 -0
- package/skill/tools/node_modules/undici/types/patch.d.ts +29 -0
- package/skill/tools/node_modules/undici/types/pool-stats.d.ts +19 -0
- package/skill/tools/node_modules/undici/types/pool.d.ts +39 -0
- package/skill/tools/node_modules/undici/types/proxy-agent.d.ts +36 -0
- package/skill/tools/node_modules/undici/types/readable.d.ts +68 -0
- package/skill/tools/node_modules/undici/types/retry-agent.d.ts +8 -0
- package/skill/tools/node_modules/undici/types/retry-handler.d.ts +125 -0
- package/skill/tools/node_modules/undici/types/round-robin-pool.d.ts +39 -0
- package/skill/tools/node_modules/undici/types/snapshot-agent.d.ts +113 -0
- package/skill/tools/node_modules/undici/types/socks5-proxy-agent.d.ts +27 -0
- package/skill/tools/node_modules/undici/types/util.d.ts +18 -0
- package/skill/tools/node_modules/undici/types/utility.d.ts +7 -0
- package/skill/tools/node_modules/undici/types/webidl.d.ts +352 -0
- package/skill/tools/node_modules/undici/types/websocket.d.ts +188 -0
- package/skill/tools/node_modules/xtend/.jshintrc +30 -0
- package/skill/tools/node_modules/xtend/LICENSE +20 -0
- package/skill/tools/node_modules/xtend/README.md +32 -0
- package/skill/tools/node_modules/xtend/immutable.js +19 -0
- package/skill/tools/node_modules/xtend/mutable.js +17 -0
- package/skill/tools/node_modules/xtend/package.json +55 -0
- package/skill/tools/node_modules/xtend/test.js +103 -0
- package/skill/tools/package-lock.json +172 -0
- package/skill/tools/package.json +9 -0
- package/skill/tools/transfer_core.js +414 -0
|
@@ -0,0 +1,538 @@
|
|
|
1
|
+
# Client
|
|
2
|
+
|
|
3
|
+
<!--introduced_in=v1.0.0-->
|
|
4
|
+
|
|
5
|
+
<!--type=module-->
|
|
6
|
+
|
|
7
|
+
<!-- source_link=lib/dispatcher/client.js -->
|
|
8
|
+
|
|
9
|
+
> Stability: 2 - Stable
|
|
10
|
+
|
|
11
|
+
A basic HTTP/1.1 client mapped on top of a single TCP/TLS connection. When the
|
|
12
|
+
server supports HTTP/2 and selects it during ALPN negotiation, the same
|
|
13
|
+
connection is used for HTTP/2. Pipelining is disabled by default.
|
|
14
|
+
|
|
15
|
+
`Client` extends [`Dispatcher`][] and is the lowest-level dispatcher in undici:
|
|
16
|
+
it manages exactly one origin over one connection. For pooling across multiple
|
|
17
|
+
connections use [`Pool`][], and for routing across multiple origins use
|
|
18
|
+
[`Agent`][]. Requests are not guaranteed to be dispatched in the order in which
|
|
19
|
+
they are invoked.
|
|
20
|
+
|
|
21
|
+
```mjs
|
|
22
|
+
import { Client } from 'undici'
|
|
23
|
+
|
|
24
|
+
const client = new Client('http://localhost:3000')
|
|
25
|
+
const { statusCode, body } = await client.request({ path: '/', method: 'GET' })
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Class: `Client`
|
|
29
|
+
|
|
30
|
+
<!-- YAML
|
|
31
|
+
added: v1.0.0
|
|
32
|
+
-->
|
|
33
|
+
|
|
34
|
+
* Extends: {Dispatcher}
|
|
35
|
+
|
|
36
|
+
### `new Client(url[, options])`
|
|
37
|
+
|
|
38
|
+
<!-- YAML
|
|
39
|
+
added: v1.0.0
|
|
40
|
+
-->
|
|
41
|
+
|
|
42
|
+
* `url` {URL|string} The origin to connect to. Only the protocol, hostname, and
|
|
43
|
+
port are used.
|
|
44
|
+
* `options` {Object} (optional)
|
|
45
|
+
* `bodyTimeout` {number|null} The timeout, in milliseconds, after which a
|
|
46
|
+
request times out while receiving body data. Monitors the time between
|
|
47
|
+
consecutive body chunks. Use `0` to disable it entirely. **Default:**
|
|
48
|
+
`300e3`.
|
|
49
|
+
* `headersTimeout` {number|null} The timeout, in milliseconds, the parser
|
|
50
|
+
waits to receive the complete HTTP headers before the request times out. Use
|
|
51
|
+
`0` to disable it entirely. **Default:** `300e3`.
|
|
52
|
+
HTTP/1.1 headers/body parser timeouts are not guaranteed to fire with exact
|
|
53
|
+
millisecond precision: delays up to 1000ms use native timers, while larger
|
|
54
|
+
delays use undici's lower-overhead fast timers with a target resolution
|
|
55
|
+
around 500ms.
|
|
56
|
+
* `connectTimeout` {number|null} The timeout, in milliseconds, for
|
|
57
|
+
establishing a socket connection. Use `0` to disable it entirely.
|
|
58
|
+
**Default:** `10e3`.
|
|
59
|
+
* `keepAliveTimeout` {number|null} The timeout, in milliseconds, after which a
|
|
60
|
+
socket with no active requests times out. Monitors the time between activity
|
|
61
|
+
on a connected socket. This value may be overridden by *keep-alive* hints
|
|
62
|
+
from the server. **Default:** `4e3`.
|
|
63
|
+
* `keepAliveMaxTimeout` {number|null} The maximum allowed `keepAliveTimeout`,
|
|
64
|
+
in milliseconds, when overridden by *keep-alive* hints from the server.
|
|
65
|
+
**Default:** `600e3`.
|
|
66
|
+
* `keepAliveTimeoutThreshold` {number|null} A number of milliseconds
|
|
67
|
+
subtracted from server *keep-alive* hints when overriding `keepAliveTimeout`,
|
|
68
|
+
to account for timing inaccuracies caused by e.g. transport latency.
|
|
69
|
+
**Default:** `2e3`.
|
|
70
|
+
* `maxHeaderSize` {number|null} The maximum length of request headers, in
|
|
71
|
+
bytes. **Default:** the value of Node.js' `--max-http-header-size` or
|
|
72
|
+
`16384` (16 KiB).
|
|
73
|
+
* `maxResponseSize` {number|null} The maximum length of a response body, in
|
|
74
|
+
bytes. Set to `-1` to disable it. **Default:** `-1`.
|
|
75
|
+
* `maxRequestsPerClient` {number|null} The maximum number of requests to send
|
|
76
|
+
over a single connection before the socket is reset. Use `0` to disable this
|
|
77
|
+
limit. **Default:** `null`.
|
|
78
|
+
* `localAddress` {string|null} The local IP address the socket should connect
|
|
79
|
+
from. **Default:** `null`.
|
|
80
|
+
* `pipelining` {number|null} The number of concurrent requests sent over the
|
|
81
|
+
single connection, per [RFC 7230, section 6.3.2][]. Only enable values
|
|
82
|
+
greater than `1` when the remote server is trusted. Set to `0` to disable
|
|
83
|
+
keep-alive connections. Has no effect once HTTP/2 is negotiated; see
|
|
84
|
+
`maxConcurrentStreams` for the HTTP/2 dispatch ceiling. **Default:** `1`.
|
|
85
|
+
* `connect` {Object|Function|null} Configures how connections are established.
|
|
86
|
+
Either a `ConnectOptions` object passed to the built-in
|
|
87
|
+
[`buildConnector`][] (every [`tls.connect()`][] option is accepted, plus the
|
|
88
|
+
fields below), or a custom connector function with the signature
|
|
89
|
+
`(options, callback)`. **Default:** `null`.
|
|
90
|
+
* `socketPath` {string|null} An IPC endpoint, either a Unix domain socket or
|
|
91
|
+
a Windows named pipe. **Default:** `null`.
|
|
92
|
+
* `maxCachedSessions` {number|null} The maximum number of cached TLS
|
|
93
|
+
sessions. Use `0` to disable TLS session caching. **Default:** `100`.
|
|
94
|
+
* `timeout` {number|null} The connection timeout, in milliseconds.
|
|
95
|
+
**Default:** `10e3`.
|
|
96
|
+
* `servername` {string|null} The TLS server name used for SNI.
|
|
97
|
+
* `keepAlive` {boolean|null} Whether TCP keep-alive is enabled on the socket.
|
|
98
|
+
**Default:** `true`.
|
|
99
|
+
* `keepAliveInitialDelay` {number|null} The TCP keep-alive interval for the
|
|
100
|
+
socket, in milliseconds. **Default:** `60000`.
|
|
101
|
+
* `strictContentLength` {boolean} Whether to throw when the request
|
|
102
|
+
`content-length` header does not match the length of the request body.
|
|
103
|
+
Disabling this exposes the application to HTTP request smuggling; only do so
|
|
104
|
+
in controlled environments where the request source is fully trusted.
|
|
105
|
+
**Default:** `true`.
|
|
106
|
+
* `autoSelectFamily` {boolean} Enables a family autodetection algorithm that
|
|
107
|
+
loosely implements section 5 of [RFC 8305][]. Ignored if unsupported by the
|
|
108
|
+
current Node.js version. **Default:** `false`.
|
|
109
|
+
* `autoSelectFamilyAttemptTimeout` {number} The time, in milliseconds, to wait
|
|
110
|
+
for a connection attempt to finish before trying the next address when
|
|
111
|
+
`autoSelectFamily` is enabled. **Default:** `250`.
|
|
112
|
+
* `allowH2` {boolean} Enables HTTP/2 support when the server assigns it a
|
|
113
|
+
higher priority through ALPN negotiation. **Default:** `true`.
|
|
114
|
+
* `useH2c` {boolean} _Deprecated: use h2Options.useH2c instead_ Enforces h2c (HTTP/2 cleartext) for non-HTTPS
|
|
115
|
+
connections. **Default:** `false`.
|
|
116
|
+
* `maxConcurrentStreams` {number} _Deprecated: use h2Options.useH2c instead_ The maximum number of concurrent HTTP/2
|
|
117
|
+
streams for a single session. Once h2 is negotiated this — not `pipelining`,
|
|
118
|
+
which is HTTP/1.1 only — is the ceiling used to dispatch in-flight requests.
|
|
119
|
+
The server's `SETTINGS_MAX_CONCURRENT_STREAMS` can lower this limit, but
|
|
120
|
+
not raise it. **Default:** `100`.
|
|
121
|
+
* `connectionWindowSize` {number} _Deprecated: use h2Options.connectionWindowSize instead_ The HTTP/2 connection-level flow-control
|
|
122
|
+
window size set via `ClientHttp2Session.setLocalWindowSize()`. Must be a
|
|
123
|
+
positive integer. **Default:** `524288`.
|
|
124
|
+
* `pingInterval` {number} _Deprecated: use h2Options.pingInterval instead_ The time interval, in milliseconds, between HTTP/2
|
|
125
|
+
PING frames. Set to `0` to disable PING frames. Applies only to HTTP/2
|
|
126
|
+
connections and emits a `ping` event on the client. **Default:** `60e3`.
|
|
127
|
+
* `h2Options` {object} Set of options for HTTP/2 sessions
|
|
128
|
+
* `useH2c` {boolean} Enforces h2c (HTTP/2 cleartext) for non-HTTPS
|
|
129
|
+
connections. **Default:** `false`.
|
|
130
|
+
* `maxConcurrentStreams` {number} The maximum number of concurrent HTTP/2
|
|
131
|
+
streams for a single session. Once h2 is negotiated this — not `pipelining`,
|
|
132
|
+
which is HTTP/1.1 only — is the ceiling used to dispatch in-flight requests.
|
|
133
|
+
The server's `SETTINGS_MAX_CONCURRENT_STREAMS` can lower this limit, but
|
|
134
|
+
not raise it. **Default:** `100`.
|
|
135
|
+
* `connectionWindowSize` {number} The HTTP/2 connection-level flow-control
|
|
136
|
+
window size set via `ClientHttp2Session.setLocalWindowSize()`. Must be a
|
|
137
|
+
positive integer. **Default:** `524288`.
|
|
138
|
+
* `pingInterval` {number} The time interval, in milliseconds, between HTTP/2
|
|
139
|
+
PING frames. Set to `0` to disable PING frames. Applies only to HTTP/2
|
|
140
|
+
connections and emits a `ping` event on the client. **Default:** `60e3`.
|
|
141
|
+
* `settings` {object} `SETTINGS` frame options. For full reference, take a
|
|
142
|
+
look to [HTTP/2#Settings Object](https://nodejs.org/api/http2.html#settings-object)
|
|
143
|
+
* `webSocket` {Object} (optional) WebSocket-specific configuration.
|
|
144
|
+
* `maxFragments` {number} The maximum number of fragments in a message. Set
|
|
145
|
+
to `0` to disable the limit. **Default:** `131072`.
|
|
146
|
+
* `maxPayloadSize` {number} The maximum allowed payload size, in bytes, for
|
|
147
|
+
WebSocket messages. Applied to uncompressed messages, compressed frame
|
|
148
|
+
payloads, and decompressed (`permessage-deflate`) messages. Set to `0` to
|
|
149
|
+
disable the limit. **Default:** `134217728`.
|
|
150
|
+
* `eventSource` {Object} (optional) EventSource-specific configuration.
|
|
151
|
+
* `maxEventSize` {number} The maximum total bytes of data and metadata
|
|
152
|
+
field values retained for a pending EventSource event. Each unfinished
|
|
153
|
+
line is separately limited to this value plus seven syntax bytes, before
|
|
154
|
+
its line ending arrives. The number of `data:` lines per event and input
|
|
155
|
+
chunks buffered for an unfinished line are each limited to
|
|
156
|
+
`min(131072, max(1024, floor(maxEventSize / 128)))` to bound object overhead.
|
|
157
|
+
Set to `0` to disable these limits.
|
|
158
|
+
**Default:** `buffer.kStringMaxLength`.
|
|
159
|
+
* Returns: {Client}
|
|
160
|
+
|
|
161
|
+
Instantiating a `Client` does not open a connection; the connection is
|
|
162
|
+
established lazily once a request is queued. Call `client.connect()` to connect
|
|
163
|
+
eagerly.
|
|
164
|
+
|
|
165
|
+
> Notes about HTTP/2:
|
|
166
|
+
>
|
|
167
|
+
> * Pseudo headers (`:path`, `:method`, `:scheme`, `:authority`) are attached
|
|
168
|
+
> automatically and overwrite any user-provided values.
|
|
169
|
+
> * The server must support HTTP/2 and select it during ALPN negotiation, and
|
|
170
|
+
> must not give HTTP/1.1 a higher priority than HTTP/2.
|
|
171
|
+
> * `PUSH` frames are not supported.
|
|
172
|
+
|
|
173
|
+
```mjs displayName="Basic instantiation"
|
|
174
|
+
import { Client } from 'undici'
|
|
175
|
+
|
|
176
|
+
const client = new Client('http://localhost:3000')
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
```mjs displayName="TLS options (object connector)"
|
|
180
|
+
import { Client } from 'undici'
|
|
181
|
+
import { readFileSync } from 'node:fs'
|
|
182
|
+
|
|
183
|
+
const client = new Client('https://localhost:3000', {
|
|
184
|
+
connect: {
|
|
185
|
+
rejectUnauthorized: false,
|
|
186
|
+
ca: readFileSync('./ca-cert.pem')
|
|
187
|
+
}
|
|
188
|
+
})
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
```mjs displayName="Unix domain socket"
|
|
192
|
+
import { Client } from 'undici'
|
|
193
|
+
|
|
194
|
+
const client = new Client('http://localhost:3000', {
|
|
195
|
+
connect: {
|
|
196
|
+
socketPath: '/var/run/docker.sock'
|
|
197
|
+
}
|
|
198
|
+
})
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
```mjs displayName="Custom DNS lookup"
|
|
202
|
+
import { Client } from 'undici'
|
|
203
|
+
import dns from 'node:dns'
|
|
204
|
+
|
|
205
|
+
const client = new Client('https://example.com', {
|
|
206
|
+
connect: {
|
|
207
|
+
lookup (hostname, options, callback) {
|
|
208
|
+
dns.lookup(hostname, { ...options, family: 4 }, callback)
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
})
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
```mjs displayName="Custom connector (function)"
|
|
215
|
+
import { Client, buildConnector } from 'undici'
|
|
216
|
+
|
|
217
|
+
const connector = buildConnector({ rejectUnauthorized: false })
|
|
218
|
+
const client = new Client('https://localhost:3000', {
|
|
219
|
+
connect (opts, cb) {
|
|
220
|
+
connector(opts, (err, socket) => {
|
|
221
|
+
if (err) {
|
|
222
|
+
cb(err)
|
|
223
|
+
} else {
|
|
224
|
+
cb(null, socket)
|
|
225
|
+
}
|
|
226
|
+
})
|
|
227
|
+
}
|
|
228
|
+
})
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
When a connector function is provided, undici wraps it to automatically inject
|
|
232
|
+
`socketPath` and `allowH2` into the `options` argument when those values are set
|
|
233
|
+
on the client. See [`Connector`][] for details on building custom connectors.
|
|
234
|
+
|
|
235
|
+
### `client.close([callback])`
|
|
236
|
+
|
|
237
|
+
<!-- YAML
|
|
238
|
+
added: v1.0.0
|
|
239
|
+
-->
|
|
240
|
+
|
|
241
|
+
Implements [`dispatcher.close([callback])`][]. Closes the client gracefully,
|
|
242
|
+
waiting for enqueued requests to complete before resolving.
|
|
243
|
+
|
|
244
|
+
### `client.destroy([error[, callback]])`
|
|
245
|
+
|
|
246
|
+
<!-- YAML
|
|
247
|
+
added: v1.0.0
|
|
248
|
+
-->
|
|
249
|
+
|
|
250
|
+
Implements [`dispatcher.destroy([error[, callback]])`][]. Destroys the client
|
|
251
|
+
abruptly, aborting all pending and running requests, and waits until the socket
|
|
252
|
+
is closed before invoking `callback` (or resolving the returned promise).
|
|
253
|
+
|
|
254
|
+
### `client.connect(options[, callback])`
|
|
255
|
+
|
|
256
|
+
<!-- YAML
|
|
257
|
+
added: v1.0.0
|
|
258
|
+
-->
|
|
259
|
+
|
|
260
|
+
* `options` {Object} The connect options, identical to
|
|
261
|
+
[`dispatcher.connect()`][] except that `origin` is omitted because the client
|
|
262
|
+
is bound to a single origin.
|
|
263
|
+
* `callback` {Function} (optional)
|
|
264
|
+
* Returns: {Promise|void} A promise when `callback` is not provided.
|
|
265
|
+
|
|
266
|
+
Starts a connection to the client's origin and tunnels a connection through it,
|
|
267
|
+
as defined by [`dispatcher.connect()`][].
|
|
268
|
+
|
|
269
|
+
### `client.dispatch(options, handlers)`
|
|
270
|
+
|
|
271
|
+
<!-- YAML
|
|
272
|
+
added: v1.0.0
|
|
273
|
+
-->
|
|
274
|
+
|
|
275
|
+
Implements [`dispatcher.dispatch(options, handler)`][]. This is the lowest-level
|
|
276
|
+
API used by all other request methods; prefer `client.request()` for most use
|
|
277
|
+
cases.
|
|
278
|
+
|
|
279
|
+
### `client.pipeline(options, handler)`
|
|
280
|
+
|
|
281
|
+
<!-- YAML
|
|
282
|
+
added: v1.0.0
|
|
283
|
+
-->
|
|
284
|
+
|
|
285
|
+
See [`dispatcher.pipeline(options, handler)`][]. Sends a request and returns a
|
|
286
|
+
{Duplex} stream that the request body is written to and the response body is
|
|
287
|
+
read from.
|
|
288
|
+
|
|
289
|
+
### `client.request(options[, callback])`
|
|
290
|
+
|
|
291
|
+
<!-- YAML
|
|
292
|
+
added: v1.0.0
|
|
293
|
+
-->
|
|
294
|
+
|
|
295
|
+
* `options` {Object}
|
|
296
|
+
* `callback` {Function} (optional)
|
|
297
|
+
* Returns: {Promise|void} A promise resolving to the response data when
|
|
298
|
+
`callback` is not provided.
|
|
299
|
+
|
|
300
|
+
See [`dispatcher.request(options[, callback])`][]. Performs an HTTP request and
|
|
301
|
+
returns its status code, headers, trailers, and a readable body stream.
|
|
302
|
+
|
|
303
|
+
```mjs
|
|
304
|
+
import { Client } from 'undici'
|
|
305
|
+
|
|
306
|
+
const client = new Client('http://localhost:3000')
|
|
307
|
+
const { statusCode, headers, body } = await client.request({
|
|
308
|
+
path: '/',
|
|
309
|
+
method: 'GET'
|
|
310
|
+
})
|
|
311
|
+
|
|
312
|
+
console.log(statusCode)
|
|
313
|
+
for await (const chunk of body) {
|
|
314
|
+
console.log(chunk.toString())
|
|
315
|
+
}
|
|
316
|
+
```
|
|
317
|
+
|
|
318
|
+
### `client.stream(options, factory[, callback])`
|
|
319
|
+
|
|
320
|
+
<!-- YAML
|
|
321
|
+
added: v1.0.0
|
|
322
|
+
-->
|
|
323
|
+
|
|
324
|
+
* `options` {Object}
|
|
325
|
+
* `factory` {Function} Returns a {Writable} the response body is piped into.
|
|
326
|
+
* `callback` {Function} (optional)
|
|
327
|
+
* Returns: {Promise|void} A promise when `callback` is not provided.
|
|
328
|
+
|
|
329
|
+
See [`dispatcher.stream(options, factory[, callback])`][]. A faster alternative
|
|
330
|
+
to `client.request()` when the destination of the response body is known in
|
|
331
|
+
advance.
|
|
332
|
+
|
|
333
|
+
### `client.upgrade(options[, callback])`
|
|
334
|
+
|
|
335
|
+
<!-- YAML
|
|
336
|
+
added: v1.0.0
|
|
337
|
+
-->
|
|
338
|
+
|
|
339
|
+
* `options` {Object}
|
|
340
|
+
* `callback` {Function} (optional)
|
|
341
|
+
* Returns: {Promise|void} A promise when `callback` is not provided.
|
|
342
|
+
|
|
343
|
+
See [`dispatcher.upgrade(options[, callback])`][]. Upgrades a connection to a
|
|
344
|
+
different protocol, such as for WebSocket or HTTP `CONNECT`.
|
|
345
|
+
|
|
346
|
+
### `client.closed`
|
|
347
|
+
|
|
348
|
+
<!-- YAML
|
|
349
|
+
added: v1.0.0
|
|
350
|
+
-->
|
|
351
|
+
|
|
352
|
+
* Type: {boolean}
|
|
353
|
+
|
|
354
|
+
`true` after `client.close()` has been called.
|
|
355
|
+
|
|
356
|
+
### `client.destroyed`
|
|
357
|
+
|
|
358
|
+
<!-- YAML
|
|
359
|
+
added: v1.0.0
|
|
360
|
+
-->
|
|
361
|
+
|
|
362
|
+
* Type: {boolean}
|
|
363
|
+
|
|
364
|
+
`true` after `client.destroy()` has been called, or after `client.close()` has
|
|
365
|
+
been called and the client shutdown has completed.
|
|
366
|
+
|
|
367
|
+
### `client.pipelining`
|
|
368
|
+
|
|
369
|
+
<!-- YAML
|
|
370
|
+
added: v1.0.0
|
|
371
|
+
-->
|
|
372
|
+
|
|
373
|
+
* Type: {number}
|
|
374
|
+
|
|
375
|
+
The pipelining factor. This property can be read and written to adjust the
|
|
376
|
+
number of concurrent requests sent over the connection. Only enable pipelining
|
|
377
|
+
with trusted remote servers.
|
|
378
|
+
|
|
379
|
+
### `client.stats`
|
|
380
|
+
|
|
381
|
+
<!-- YAML
|
|
382
|
+
added: v7.9.0
|
|
383
|
+
-->
|
|
384
|
+
|
|
385
|
+
* Type: {ClientStats}
|
|
386
|
+
|
|
387
|
+
Aggregate statistics for the client. See [`ClientStats`][].
|
|
388
|
+
|
|
389
|
+
### Event: `'connect'`
|
|
390
|
+
|
|
391
|
+
<!-- YAML
|
|
392
|
+
added: v1.0.0
|
|
393
|
+
-->
|
|
394
|
+
|
|
395
|
+
* `origin` {URL}
|
|
396
|
+
* `targets` {Array<Dispatcher>}
|
|
397
|
+
|
|
398
|
+
Emitted when a socket has been created and connected. The client connects once
|
|
399
|
+
`client.size > 0`. See [`Dispatcher` Event: `'connect'`][].
|
|
400
|
+
|
|
401
|
+
```mjs
|
|
402
|
+
import { createServer } from 'node:http'
|
|
403
|
+
import { Client } from 'undici'
|
|
404
|
+
import { once } from 'node:events'
|
|
405
|
+
|
|
406
|
+
const server = createServer((request, response) => {
|
|
407
|
+
response.end('Hello, World!')
|
|
408
|
+
}).listen()
|
|
409
|
+
|
|
410
|
+
await once(server, 'listening')
|
|
411
|
+
|
|
412
|
+
const client = new Client(`http://localhost:${server.address().port}`)
|
|
413
|
+
|
|
414
|
+
client.on('connect', (origin) => {
|
|
415
|
+
console.log(`Connected to ${origin}`)
|
|
416
|
+
})
|
|
417
|
+
|
|
418
|
+
const { body } = await client.request({ path: '/', method: 'GET' })
|
|
419
|
+
body.setEncoding('utf8')
|
|
420
|
+
body.on('data', console.log)
|
|
421
|
+
|
|
422
|
+
client.close()
|
|
423
|
+
server.close()
|
|
424
|
+
```
|
|
425
|
+
|
|
426
|
+
### Event: `'disconnect'`
|
|
427
|
+
|
|
428
|
+
<!-- YAML
|
|
429
|
+
added: v1.0.0
|
|
430
|
+
changes:
|
|
431
|
+
- version: v4.0.0
|
|
432
|
+
pr-url: https://github.com/nodejs/undici/pull/771
|
|
433
|
+
description: The event is only emitted if the client had previously
|
|
434
|
+
connected.
|
|
435
|
+
-->
|
|
436
|
+
|
|
437
|
+
* `origin` {URL}
|
|
438
|
+
* `targets` {Array<Dispatcher>}
|
|
439
|
+
* `error` {Error}
|
|
440
|
+
|
|
441
|
+
Emitted when a socket has disconnected. The `error` argument is the error that
|
|
442
|
+
caused the disconnection. The client reconnects if or once `client.size > 0`.
|
|
443
|
+
See [`Dispatcher` Event: `'disconnect'`][].
|
|
444
|
+
|
|
445
|
+
```mjs
|
|
446
|
+
import { createServer } from 'node:http'
|
|
447
|
+
import { Client } from 'undici'
|
|
448
|
+
import { once } from 'node:events'
|
|
449
|
+
|
|
450
|
+
const server = createServer((request, response) => {
|
|
451
|
+
response.destroy()
|
|
452
|
+
}).listen()
|
|
453
|
+
|
|
454
|
+
await once(server, 'listening')
|
|
455
|
+
|
|
456
|
+
const client = new Client(`http://localhost:${server.address().port}`)
|
|
457
|
+
|
|
458
|
+
client.on('disconnect', (origin) => {
|
|
459
|
+
console.log(`Disconnected from ${origin}`)
|
|
460
|
+
})
|
|
461
|
+
|
|
462
|
+
try {
|
|
463
|
+
await client.request({ path: '/', method: 'GET' })
|
|
464
|
+
} catch (error) {
|
|
465
|
+
console.error(error.message)
|
|
466
|
+
} finally {
|
|
467
|
+
client.close()
|
|
468
|
+
server.close()
|
|
469
|
+
}
|
|
470
|
+
```
|
|
471
|
+
|
|
472
|
+
### Event: `'drain'`
|
|
473
|
+
|
|
474
|
+
<!-- YAML
|
|
475
|
+
added: v1.0.0
|
|
476
|
+
-->
|
|
477
|
+
|
|
478
|
+
* `origin` {URL}
|
|
479
|
+
|
|
480
|
+
Emitted when the pipeline is no longer busy. See
|
|
481
|
+
[`Dispatcher` Event: `'drain'`][].
|
|
482
|
+
|
|
483
|
+
```mjs
|
|
484
|
+
import { createServer } from 'node:http'
|
|
485
|
+
import { Client } from 'undici'
|
|
486
|
+
import { once } from 'node:events'
|
|
487
|
+
|
|
488
|
+
const server = createServer((request, response) => {
|
|
489
|
+
response.end('Hello, World!')
|
|
490
|
+
}).listen()
|
|
491
|
+
|
|
492
|
+
await once(server, 'listening')
|
|
493
|
+
|
|
494
|
+
const client = new Client(`http://localhost:${server.address().port}`)
|
|
495
|
+
|
|
496
|
+
client.on('drain', () => {
|
|
497
|
+
console.log('drain event')
|
|
498
|
+
client.close()
|
|
499
|
+
server.close()
|
|
500
|
+
})
|
|
501
|
+
|
|
502
|
+
await Promise.all([
|
|
503
|
+
client.request({ path: '/', method: 'GET' }),
|
|
504
|
+
client.request({ path: '/', method: 'GET' }),
|
|
505
|
+
client.request({ path: '/', method: 'GET' })
|
|
506
|
+
])
|
|
507
|
+
```
|
|
508
|
+
|
|
509
|
+
### Event: `'error'`
|
|
510
|
+
|
|
511
|
+
<!-- YAML
|
|
512
|
+
added: v1.0.0
|
|
513
|
+
-->
|
|
514
|
+
|
|
515
|
+
* `error` {Error}
|
|
516
|
+
|
|
517
|
+
Emitted for user errors, such as throwing inside an `onResponseError` handler.
|
|
518
|
+
|
|
519
|
+
[RFC 7230, section 6.3.2]: https://tools.ietf.org/html/rfc7230#section-6.3.2
|
|
520
|
+
[RFC 8305]: https://tools.ietf.org/html/rfc8305#section-5
|
|
521
|
+
[`Agent`]: Agent.md#class-agent
|
|
522
|
+
[`ClientStats`]: ClientStats.md
|
|
523
|
+
[`Connector`]: Connector.md
|
|
524
|
+
[`Dispatcher` Event: `'connect'`]: Dispatcher.md#event-connect
|
|
525
|
+
[`Dispatcher` Event: `'disconnect'`]: Dispatcher.md#event-disconnect
|
|
526
|
+
[`Dispatcher` Event: `'drain'`]: Dispatcher.md#event-drain
|
|
527
|
+
[`Dispatcher`]: Dispatcher.md#class-dispatcher
|
|
528
|
+
[`Pool`]: Pool.md#class-pool
|
|
529
|
+
[`buildConnector`]: Connector.md
|
|
530
|
+
[`dispatcher.close([callback])`]: Dispatcher.md#dispatcherclosecallback
|
|
531
|
+
[`dispatcher.connect()`]: Dispatcher.md#dispatcherconnectoptions-callback
|
|
532
|
+
[`dispatcher.destroy([error[, callback]])`]: Dispatcher.md#dispatcherdestroyerror-callback
|
|
533
|
+
[`dispatcher.dispatch(options, handler)`]: Dispatcher.md#dispatcherdispatchoptions-handler
|
|
534
|
+
[`dispatcher.pipeline(options, handler)`]: Dispatcher.md#dispatcherpipelineoptions-handler
|
|
535
|
+
[`dispatcher.request(options[, callback])`]: Dispatcher.md#dispatcherrequestoptions-callback
|
|
536
|
+
[`dispatcher.stream(options, factory[, callback])`]: Dispatcher.md#dispatcherstreamoptions-factory-callback
|
|
537
|
+
[`dispatcher.upgrade(options[, callback])`]: Dispatcher.md#dispatcherupgradeoptions-callback
|
|
538
|
+
[`tls.connect()`]: https://nodejs.org/api/tls.html#tlsconnectoptions-callback
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# ClientStats
|
|
2
|
+
|
|
3
|
+
<!--introduced_in=v7.9.0-->
|
|
4
|
+
<!--type=module-->
|
|
5
|
+
<!-- source_link=lib/util/stats.js -->
|
|
6
|
+
|
|
7
|
+
> Stability: 2 - Stable
|
|
8
|
+
|
|
9
|
+
A `ClientStats` is a point-in-time snapshot of the connection and request
|
|
10
|
+
state of a single [`Client`][]. Instances are not created directly; a fresh
|
|
11
|
+
snapshot is produced each time the [`client.stats`][] getter is read.
|
|
12
|
+
|
|
13
|
+
```mjs
|
|
14
|
+
import { Client } from 'undici'
|
|
15
|
+
|
|
16
|
+
const client = new Client('http://localhost:3000')
|
|
17
|
+
const stats = client.stats
|
|
18
|
+
console.log(stats.connected, stats.running)
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
```cjs
|
|
22
|
+
const { Client } = require('undici')
|
|
23
|
+
|
|
24
|
+
const client = new Client('http://localhost:3000')
|
|
25
|
+
const stats = client.stats
|
|
26
|
+
console.log(stats.connected, stats.running)
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Class: `ClientStats`
|
|
30
|
+
|
|
31
|
+
<!-- YAML
|
|
32
|
+
added: v7.9.0
|
|
33
|
+
-->
|
|
34
|
+
|
|
35
|
+
Captures the connection and request counters of a [`Client`][] at the moment
|
|
36
|
+
the snapshot is taken. The values are read from the client at construction time
|
|
37
|
+
and do not update afterwards; read [`client.stats`][] again for current values.
|
|
38
|
+
|
|
39
|
+
### `new ClientStats(client)`
|
|
40
|
+
|
|
41
|
+
<!-- YAML
|
|
42
|
+
added: v7.9.0
|
|
43
|
+
-->
|
|
44
|
+
|
|
45
|
+
* `client` {Client} The client to read the statistics from.
|
|
46
|
+
|
|
47
|
+
Creates a snapshot from the supplied `client`. This constructor is used
|
|
48
|
+
internally by the [`client.stats`][] getter and is not normally invoked by
|
|
49
|
+
application code.
|
|
50
|
+
|
|
51
|
+
### `clientStats.connected`
|
|
52
|
+
|
|
53
|
+
<!-- YAML
|
|
54
|
+
added: v7.9.0
|
|
55
|
+
-->
|
|
56
|
+
|
|
57
|
+
* Type: {boolean}
|
|
58
|
+
|
|
59
|
+
`true` when the client currently has an open socket connection.
|
|
60
|
+
|
|
61
|
+
### `clientStats.pending`
|
|
62
|
+
|
|
63
|
+
<!-- YAML
|
|
64
|
+
added: v7.9.0
|
|
65
|
+
-->
|
|
66
|
+
|
|
67
|
+
* Type: {number}
|
|
68
|
+
|
|
69
|
+
Number of open socket connections of this client that do not have an active
|
|
70
|
+
request.
|
|
71
|
+
|
|
72
|
+
### `clientStats.running`
|
|
73
|
+
|
|
74
|
+
<!-- YAML
|
|
75
|
+
added: v7.9.0
|
|
76
|
+
-->
|
|
77
|
+
|
|
78
|
+
* Type: {number}
|
|
79
|
+
|
|
80
|
+
Number of currently active requests of this client.
|
|
81
|
+
|
|
82
|
+
### `clientStats.size`
|
|
83
|
+
|
|
84
|
+
<!-- YAML
|
|
85
|
+
added: v7.9.0
|
|
86
|
+
-->
|
|
87
|
+
|
|
88
|
+
* Type: {number}
|
|
89
|
+
|
|
90
|
+
Number of active, pending, or queued requests of this client.
|
|
91
|
+
|
|
92
|
+
[`Client`]: Client.md#class-client
|
|
93
|
+
[`client.stats`]: Client.md#clientstats
|