@pnpm/exe 11.0.5 → 11.0.7
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/dist/node-gyp-bin/node-gyp +0 -0
- package/dist/node-gyp-bin/node-gyp.cmd +0 -0
- package/dist/node_modules/node-gyp/.release-please-manifest.json +1 -1
- package/dist/node_modules/node-gyp/bin/node-gyp.js +0 -0
- package/dist/node_modules/node-gyp/gyp/.release-please-manifest.json +1 -1
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/MSVSVersion.py +11 -3
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/__init__.py +2 -3
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs.py +1 -1
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja.py +2 -1
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja_test.py +26 -16
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/mac_tool.py +1 -1
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/msvs_emulation.py +1 -1
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/simple_copy.py +2 -2
- package/dist/node_modules/node-gyp/gyp/pylib/packaging/metadata.py +3 -20
- package/dist/node_modules/node-gyp/gyp/pylib/packaging/tags.py +2 -14
- package/dist/node_modules/node-gyp/gyp/pyproject.toml +5 -3
- package/dist/node_modules/node-gyp/lib/download.js +55 -8
- package/dist/node_modules/node-gyp/lib/find-visualstudio.js +1 -1
- package/dist/node_modules/node-gyp/lib/process-release.js +17 -19
- package/dist/node_modules/node-gyp/package.json +3 -3
- package/dist/node_modules/{safer-buffer → undici}/LICENSE +1 -1
- package/dist/node_modules/undici/index-fetch.js +35 -0
- package/dist/node_modules/undici/index.js +169 -0
- package/dist/node_modules/undici/lib/api/abort-signal.js +57 -0
- package/dist/node_modules/undici/lib/api/api-connect.js +108 -0
- package/dist/node_modules/undici/lib/api/api-pipeline.js +251 -0
- package/dist/node_modules/undici/lib/api/api-request.js +214 -0
- package/dist/node_modules/undici/lib/api/api-stream.js +220 -0
- package/dist/node_modules/undici/lib/api/api-upgrade.js +108 -0
- package/dist/node_modules/undici/lib/api/index.js +7 -0
- package/dist/node_modules/undici/lib/api/readable.js +385 -0
- package/dist/node_modules/undici/lib/api/util.js +93 -0
- package/dist/node_modules/undici/lib/core/connect.js +240 -0
- package/dist/node_modules/undici/lib/core/constants.js +118 -0
- package/dist/node_modules/undici/lib/core/diagnostics.js +202 -0
- package/dist/node_modules/undici/lib/core/errors.js +425 -0
- package/dist/node_modules/undici/lib/core/request.js +405 -0
- package/dist/node_modules/undici/lib/core/symbols.js +67 -0
- package/dist/node_modules/undici/lib/core/tree.js +152 -0
- package/dist/node_modules/undici/lib/core/util.js +719 -0
- package/dist/node_modules/undici/lib/dispatcher/agent.js +130 -0
- package/dist/node_modules/undici/lib/dispatcher/balanced-pool.js +209 -0
- package/dist/node_modules/undici/lib/dispatcher/client-h1.js +1370 -0
- package/dist/node_modules/undici/lib/dispatcher/client-h2.js +744 -0
- package/dist/node_modules/undici/lib/dispatcher/client.js +623 -0
- package/dist/node_modules/undici/lib/dispatcher/dispatcher-base.js +198 -0
- package/dist/node_modules/undici/lib/dispatcher/dispatcher.js +65 -0
- package/dist/node_modules/undici/lib/dispatcher/env-http-proxy-agent.js +160 -0
- package/dist/node_modules/undici/lib/dispatcher/fixed-queue.js +117 -0
- package/dist/node_modules/undici/lib/dispatcher/pool-base.js +194 -0
- package/dist/node_modules/undici/lib/dispatcher/pool-stats.js +34 -0
- package/dist/node_modules/undici/lib/dispatcher/pool.js +107 -0
- package/dist/node_modules/undici/lib/dispatcher/proxy-agent.js +274 -0
- package/dist/node_modules/undici/lib/dispatcher/retry-agent.js +35 -0
- package/dist/node_modules/undici/lib/global.js +32 -0
- package/dist/node_modules/undici/lib/handler/decorator-handler.js +44 -0
- package/dist/node_modules/undici/lib/handler/redirect-handler.js +232 -0
- package/dist/node_modules/undici/lib/handler/retry-handler.js +374 -0
- package/dist/node_modules/undici/lib/interceptor/dns.js +375 -0
- package/dist/node_modules/undici/lib/interceptor/dump.js +123 -0
- package/dist/node_modules/undici/lib/interceptor/redirect-interceptor.js +21 -0
- package/dist/node_modules/undici/lib/interceptor/redirect.js +24 -0
- package/dist/node_modules/undici/lib/interceptor/response-error.js +86 -0
- package/dist/node_modules/undici/lib/interceptor/retry.js +19 -0
- package/dist/node_modules/undici/lib/llhttp/.gitkeep +0 -0
- package/dist/node_modules/undici/lib/llhttp/constants.js +278 -0
- package/dist/node_modules/undici/lib/llhttp/llhttp-wasm.js +5 -0
- package/dist/node_modules/undici/lib/llhttp/llhttp_simd-wasm.js +5 -0
- package/dist/node_modules/undici/lib/llhttp/utils.js +15 -0
- package/dist/node_modules/undici/lib/mock/mock-agent.js +160 -0
- package/dist/node_modules/undici/lib/mock/mock-client.js +59 -0
- package/dist/node_modules/undici/lib/mock/mock-errors.js +28 -0
- package/dist/node_modules/undici/lib/mock/mock-interceptor.js +207 -0
- package/dist/node_modules/undici/lib/mock/mock-pool.js +59 -0
- package/dist/node_modules/undici/lib/mock/mock-symbols.js +23 -0
- package/dist/node_modules/undici/lib/mock/mock-utils.js +367 -0
- package/dist/node_modules/undici/lib/mock/pending-interceptors-formatter.js +43 -0
- package/dist/node_modules/undici/lib/mock/pluralizer.js +29 -0
- package/dist/node_modules/undici/lib/util/timers.js +423 -0
- package/dist/node_modules/undici/lib/web/cache/cache.js +859 -0
- package/dist/node_modules/undici/lib/web/cache/cachestorage.js +152 -0
- package/dist/node_modules/undici/lib/web/cache/symbols.js +5 -0
- package/dist/node_modules/undici/lib/web/cache/util.js +45 -0
- package/dist/node_modules/undici/lib/web/cookies/constants.js +12 -0
- package/dist/node_modules/undici/lib/web/cookies/index.js +184 -0
- package/dist/node_modules/undici/lib/web/cookies/parse.js +317 -0
- package/dist/node_modules/undici/lib/web/cookies/util.js +282 -0
- package/dist/node_modules/undici/lib/web/eventsource/eventsource-stream.js +398 -0
- package/dist/node_modules/undici/lib/web/eventsource/eventsource.js +480 -0
- package/dist/node_modules/undici/lib/web/eventsource/util.js +37 -0
- package/dist/node_modules/{@npmcli/redact → undici/lib/web/fetch}/LICENSE +1 -1
- package/dist/node_modules/undici/lib/web/fetch/body.js +529 -0
- package/dist/node_modules/undici/lib/web/fetch/constants.js +124 -0
- package/dist/node_modules/undici/lib/web/fetch/data-url.js +744 -0
- package/dist/node_modules/undici/lib/web/fetch/dispatcher-weakref.js +46 -0
- package/dist/node_modules/undici/lib/web/fetch/file.js +126 -0
- package/dist/node_modules/undici/lib/web/fetch/formdata-parser.js +474 -0
- package/dist/node_modules/undici/lib/web/fetch/formdata.js +252 -0
- package/dist/node_modules/undici/lib/web/fetch/global.js +40 -0
- package/dist/node_modules/undici/lib/web/fetch/headers.js +687 -0
- package/dist/node_modules/undici/lib/web/fetch/index.js +2272 -0
- package/dist/node_modules/undici/lib/web/fetch/request.js +1037 -0
- package/dist/node_modules/undici/lib/web/fetch/response.js +610 -0
- package/dist/node_modules/undici/lib/web/fetch/symbols.js +9 -0
- package/dist/node_modules/undici/lib/web/fetch/util.js +1632 -0
- package/dist/node_modules/undici/lib/web/fetch/webidl.js +695 -0
- package/dist/node_modules/undici/lib/web/fileapi/encoding.js +290 -0
- package/dist/node_modules/undici/lib/web/fileapi/filereader.js +344 -0
- package/dist/node_modules/undici/lib/web/fileapi/progressevent.js +78 -0
- package/dist/node_modules/undici/lib/web/fileapi/symbols.js +10 -0
- package/dist/node_modules/undici/lib/web/fileapi/util.js +391 -0
- package/dist/node_modules/undici/lib/web/websocket/connection.js +371 -0
- package/dist/node_modules/undici/lib/web/websocket/constants.js +66 -0
- package/dist/node_modules/undici/lib/web/websocket/events.js +329 -0
- package/dist/node_modules/undici/lib/web/websocket/frame.js +96 -0
- package/dist/node_modules/undici/lib/web/websocket/permessage-deflate.js +100 -0
- package/dist/node_modules/undici/lib/web/websocket/receiver.js +490 -0
- package/dist/node_modules/undici/lib/web/websocket/sender.js +104 -0
- package/dist/node_modules/undici/lib/web/websocket/symbols.js +12 -0
- package/dist/node_modules/undici/lib/web/websocket/util.js +322 -0
- package/dist/node_modules/undici/lib/web/websocket/websocket.js +592 -0
- package/dist/node_modules/undici/package.json +160 -0
- package/dist/node_modules/undici/scripts/strip-comments.js +8 -0
- package/dist/node_modules/yallist/package.json +51 -12
- package/dist/pnpm.mjs +5915 -5140
- package/dist/worker.js +70 -67
- package/package.json +21 -13
- package/setup.js +17 -3
- package/dist/node_modules/@gar/promise-retry/LICENSE +0 -20
- package/dist/node_modules/@gar/promise-retry/lib/index.js +0 -62
- package/dist/node_modules/@gar/promise-retry/lib/retry.js +0 -109
- package/dist/node_modules/@gar/promise-retry/package.json +0 -45
- package/dist/node_modules/@npmcli/agent/lib/agents.js +0 -206
- package/dist/node_modules/@npmcli/agent/lib/dns.js +0 -53
- package/dist/node_modules/@npmcli/agent/lib/errors.js +0 -61
- package/dist/node_modules/@npmcli/agent/lib/index.js +0 -56
- package/dist/node_modules/@npmcli/agent/lib/options.js +0 -86
- package/dist/node_modules/@npmcli/agent/lib/proxy.js +0 -88
- package/dist/node_modules/@npmcli/agent/package.json +0 -60
- package/dist/node_modules/@npmcli/fs/lib/common/get-options.js +0 -20
- package/dist/node_modules/@npmcli/fs/lib/common/node.js +0 -9
- package/dist/node_modules/@npmcli/fs/lib/cp/LICENSE +0 -15
- package/dist/node_modules/@npmcli/fs/lib/cp/errors.js +0 -129
- package/dist/node_modules/@npmcli/fs/lib/cp/index.js +0 -22
- package/dist/node_modules/@npmcli/fs/lib/cp/polyfill.js +0 -428
- package/dist/node_modules/@npmcli/fs/lib/index.js +0 -13
- package/dist/node_modules/@npmcli/fs/lib/move-file.js +0 -78
- package/dist/node_modules/@npmcli/fs/lib/readdir-scoped.js +0 -20
- package/dist/node_modules/@npmcli/fs/lib/with-temp-dir.js +0 -39
- package/dist/node_modules/@npmcli/fs/package.json +0 -54
- package/dist/node_modules/@npmcli/redact/lib/deep-map.js +0 -71
- package/dist/node_modules/@npmcli/redact/lib/error.js +0 -28
- package/dist/node_modules/@npmcli/redact/lib/index.js +0 -44
- package/dist/node_modules/@npmcli/redact/lib/matchers.js +0 -88
- package/dist/node_modules/@npmcli/redact/lib/server.js +0 -59
- package/dist/node_modules/@npmcli/redact/lib/utils.js +0 -202
- package/dist/node_modules/@npmcli/redact/package.json +0 -52
- package/dist/node_modules/agent-base/LICENSE +0 -22
- package/dist/node_modules/agent-base/dist/helpers.js +0 -66
- package/dist/node_modules/agent-base/dist/index.js +0 -178
- package/dist/node_modules/agent-base/package.json +0 -46
- package/dist/node_modules/balanced-match/dist/commonjs/index.js +0 -59
- package/dist/node_modules/balanced-match/dist/esm/index.js +0 -54
- package/dist/node_modules/balanced-match/package.json +0 -68
- package/dist/node_modules/brace-expansion/LICENSE +0 -23
- package/dist/node_modules/brace-expansion/dist/commonjs/index.js +0 -201
- package/dist/node_modules/brace-expansion/dist/commonjs/package.json +0 -3
- package/dist/node_modules/brace-expansion/dist/esm/index.js +0 -197
- package/dist/node_modules/brace-expansion/dist/esm/package.json +0 -3
- package/dist/node_modules/brace-expansion/package.json +0 -64
- package/dist/node_modules/cacache/lib/content/path.js +0 -29
- package/dist/node_modules/cacache/lib/content/read.js +0 -165
- package/dist/node_modules/cacache/lib/content/rm.js +0 -18
- package/dist/node_modules/cacache/lib/content/write.js +0 -206
- package/dist/node_modules/cacache/lib/entry-index.js +0 -336
- package/dist/node_modules/cacache/lib/get.js +0 -170
- package/dist/node_modules/cacache/lib/index.js +0 -42
- package/dist/node_modules/cacache/lib/memoization.js +0 -72
- package/dist/node_modules/cacache/lib/put.js +0 -80
- package/dist/node_modules/cacache/lib/rm.js +0 -31
- package/dist/node_modules/cacache/lib/util/glob.js +0 -7
- package/dist/node_modules/cacache/lib/util/hash-to-segments.js +0 -7
- package/dist/node_modules/cacache/lib/util/tmp.js +0 -32
- package/dist/node_modules/cacache/lib/verify.js +0 -258
- package/dist/node_modules/cacache/package.json +0 -81
- package/dist/node_modules/debug/LICENSE +0 -20
- package/dist/node_modules/debug/package.json +0 -64
- package/dist/node_modules/debug/src/browser.js +0 -272
- package/dist/node_modules/debug/src/common.js +0 -292
- package/dist/node_modules/debug/src/index.js +0 -10
- package/dist/node_modules/debug/src/node.js +0 -263
- package/dist/node_modules/fs-minipass/LICENSE +0 -15
- package/dist/node_modules/fs-minipass/lib/index.js +0 -443
- package/dist/node_modules/fs-minipass/package.json +0 -54
- package/dist/node_modules/glob/dist/commonjs/glob.js +0 -248
- package/dist/node_modules/glob/dist/commonjs/has-magic.js +0 -27
- package/dist/node_modules/glob/dist/commonjs/ignore.js +0 -119
- package/dist/node_modules/glob/dist/commonjs/index.js +0 -68
- package/dist/node_modules/glob/dist/commonjs/index.min.js +0 -4
- package/dist/node_modules/glob/dist/commonjs/package.json +0 -3
- package/dist/node_modules/glob/dist/commonjs/pattern.js +0 -223
- package/dist/node_modules/glob/dist/commonjs/processor.js +0 -301
- package/dist/node_modules/glob/dist/commonjs/walker.js +0 -387
- package/dist/node_modules/glob/dist/esm/glob.js +0 -244
- package/dist/node_modules/glob/dist/esm/has-magic.js +0 -23
- package/dist/node_modules/glob/dist/esm/ignore.js +0 -115
- package/dist/node_modules/glob/dist/esm/index.js +0 -55
- package/dist/node_modules/glob/dist/esm/index.min.js +0 -4
- package/dist/node_modules/glob/dist/esm/package.json +0 -3
- package/dist/node_modules/glob/dist/esm/pattern.js +0 -219
- package/dist/node_modules/glob/dist/esm/processor.js +0 -294
- package/dist/node_modules/glob/dist/esm/walker.js +0 -381
- package/dist/node_modules/glob/package.json +0 -98
- package/dist/node_modules/http-cache-semantics/LICENSE +0 -9
- package/dist/node_modules/http-cache-semantics/index.js +0 -928
- package/dist/node_modules/http-cache-semantics/package.json +0 -22
- package/dist/node_modules/http-proxy-agent/LICENSE +0 -22
- package/dist/node_modules/http-proxy-agent/dist/index.js +0 -148
- package/dist/node_modules/http-proxy-agent/package.json +0 -47
- package/dist/node_modules/https-proxy-agent/LICENSE +0 -22
- package/dist/node_modules/https-proxy-agent/dist/index.js +0 -180
- package/dist/node_modules/https-proxy-agent/dist/parse-proxy-response.js +0 -101
- package/dist/node_modules/https-proxy-agent/package.json +0 -50
- package/dist/node_modules/iconv-lite/LICENSE +0 -21
- package/dist/node_modules/iconv-lite/encodings/dbcs-codec.js +0 -532
- package/dist/node_modules/iconv-lite/encodings/dbcs-data.js +0 -185
- package/dist/node_modules/iconv-lite/encodings/index.js +0 -23
- package/dist/node_modules/iconv-lite/encodings/internal.js +0 -218
- package/dist/node_modules/iconv-lite/encodings/sbcs-codec.js +0 -75
- package/dist/node_modules/iconv-lite/encodings/sbcs-data-generated.js +0 -451
- package/dist/node_modules/iconv-lite/encodings/sbcs-data.js +0 -178
- package/dist/node_modules/iconv-lite/encodings/tables/big5-added.json +0 -122
- package/dist/node_modules/iconv-lite/encodings/tables/cp936.json +0 -264
- package/dist/node_modules/iconv-lite/encodings/tables/cp949.json +0 -273
- package/dist/node_modules/iconv-lite/encodings/tables/cp950.json +0 -177
- package/dist/node_modules/iconv-lite/encodings/tables/eucjp.json +0 -182
- package/dist/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json +0 -1
- package/dist/node_modules/iconv-lite/encodings/tables/gbk-added.json +0 -56
- package/dist/node_modules/iconv-lite/encodings/tables/shiftjis.json +0 -125
- package/dist/node_modules/iconv-lite/encodings/utf16.js +0 -187
- package/dist/node_modules/iconv-lite/encodings/utf32.js +0 -307
- package/dist/node_modules/iconv-lite/encodings/utf7.js +0 -283
- package/dist/node_modules/iconv-lite/lib/bom-handling.js +0 -48
- package/dist/node_modules/iconv-lite/lib/helpers/merge-exports.js +0 -13
- package/dist/node_modules/iconv-lite/lib/index.js +0 -182
- package/dist/node_modules/iconv-lite/lib/streams.js +0 -105
- package/dist/node_modules/iconv-lite/package.json +0 -70
- package/dist/node_modules/ip-address/LICENSE +0 -19
- package/dist/node_modules/ip-address/dist/address-error.js +0 -12
- package/dist/node_modules/ip-address/dist/common.js +0 -46
- package/dist/node_modules/ip-address/dist/ip-address.js +0 -35
- package/dist/node_modules/ip-address/dist/ipv4.js +0 -360
- package/dist/node_modules/ip-address/dist/ipv6.js +0 -1003
- package/dist/node_modules/ip-address/dist/v4/constants.js +0 -8
- package/dist/node_modules/ip-address/dist/v6/constants.js +0 -76
- package/dist/node_modules/ip-address/dist/v6/helpers.js +0 -45
- package/dist/node_modules/ip-address/dist/v6/regular-expressions.js +0 -95
- package/dist/node_modules/ip-address/package.json +0 -78
- package/dist/node_modules/lru-cache/dist/commonjs/diagnostics-channel.js +0 -10
- package/dist/node_modules/lru-cache/dist/commonjs/index.js +0 -1692
- package/dist/node_modules/lru-cache/dist/commonjs/index.min.js +0 -2
- package/dist/node_modules/lru-cache/dist/commonjs/package.json +0 -3
- package/dist/node_modules/lru-cache/dist/esm/browser/diagnostics-channel.js +0 -4
- package/dist/node_modules/lru-cache/dist/esm/browser/index.js +0 -1688
- package/dist/node_modules/lru-cache/dist/esm/browser/index.min.js +0 -2
- package/dist/node_modules/lru-cache/dist/esm/diagnostics-channel.js +0 -19
- package/dist/node_modules/lru-cache/dist/esm/index.js +0 -1688
- package/dist/node_modules/lru-cache/dist/esm/index.min.js +0 -2
- package/dist/node_modules/lru-cache/dist/esm/node/diagnostics-channel.js +0 -7
- package/dist/node_modules/lru-cache/dist/esm/node/index.js +0 -1688
- package/dist/node_modules/lru-cache/dist/esm/node/index.min.js +0 -2
- package/dist/node_modules/lru-cache/dist/esm/package.json +0 -3
- package/dist/node_modules/lru-cache/package.json +0 -126
- package/dist/node_modules/make-fetch-happen/LICENSE +0 -16
- package/dist/node_modules/make-fetch-happen/lib/cache/entry.js +0 -471
- package/dist/node_modules/make-fetch-happen/lib/cache/errors.js +0 -11
- package/dist/node_modules/make-fetch-happen/lib/cache/index.js +0 -49
- package/dist/node_modules/make-fetch-happen/lib/cache/key.js +0 -17
- package/dist/node_modules/make-fetch-happen/lib/cache/policy.js +0 -161
- package/dist/node_modules/make-fetch-happen/lib/fetch.js +0 -118
- package/dist/node_modules/make-fetch-happen/lib/index.js +0 -41
- package/dist/node_modules/make-fetch-happen/lib/options.js +0 -59
- package/dist/node_modules/make-fetch-happen/lib/pipeline.js +0 -41
- package/dist/node_modules/make-fetch-happen/lib/remote.js +0 -134
- package/dist/node_modules/make-fetch-happen/package.json +0 -75
- package/dist/node_modules/minimatch/dist/commonjs/assert-valid-pattern.js +0 -14
- package/dist/node_modules/minimatch/dist/commonjs/ast.js +0 -845
- package/dist/node_modules/minimatch/dist/commonjs/brace-expressions.js +0 -150
- package/dist/node_modules/minimatch/dist/commonjs/escape.js +0 -30
- package/dist/node_modules/minimatch/dist/commonjs/index.js +0 -1127
- package/dist/node_modules/minimatch/dist/commonjs/package.json +0 -3
- package/dist/node_modules/minimatch/dist/commonjs/unescape.js +0 -38
- package/dist/node_modules/minimatch/dist/esm/assert-valid-pattern.js +0 -10
- package/dist/node_modules/minimatch/dist/esm/ast.js +0 -841
- package/dist/node_modules/minimatch/dist/esm/brace-expressions.js +0 -146
- package/dist/node_modules/minimatch/dist/esm/escape.js +0 -26
- package/dist/node_modules/minimatch/dist/esm/index.js +0 -1114
- package/dist/node_modules/minimatch/dist/esm/package.json +0 -3
- package/dist/node_modules/minimatch/dist/esm/unescape.js +0 -34
- package/dist/node_modules/minimatch/package.json +0 -73
- package/dist/node_modules/minipass-collect/LICENSE +0 -15
- package/dist/node_modules/minipass-collect/index.js +0 -71
- package/dist/node_modules/minipass-collect/package.json +0 -30
- package/dist/node_modules/minipass-fetch/LICENSE +0 -28
- package/dist/node_modules/minipass-fetch/lib/abort-error.js +0 -17
- package/dist/node_modules/minipass-fetch/lib/blob.js +0 -97
- package/dist/node_modules/minipass-fetch/lib/body.js +0 -360
- package/dist/node_modules/minipass-fetch/lib/fetch-error.js +0 -32
- package/dist/node_modules/minipass-fetch/lib/headers.js +0 -267
- package/dist/node_modules/minipass-fetch/lib/index.js +0 -376
- package/dist/node_modules/minipass-fetch/lib/request.js +0 -282
- package/dist/node_modules/minipass-fetch/lib/response.js +0 -90
- package/dist/node_modules/minipass-fetch/package.json +0 -70
- package/dist/node_modules/minipass-flush/index.js +0 -39
- package/dist/node_modules/minipass-flush/node_modules/minipass/LICENSE +0 -15
- package/dist/node_modules/minipass-flush/node_modules/minipass/index.js +0 -649
- package/dist/node_modules/minipass-flush/node_modules/minipass/package.json +0 -56
- package/dist/node_modules/minipass-flush/package.json +0 -42
- package/dist/node_modules/minipass-pipeline/LICENSE +0 -15
- package/dist/node_modules/minipass-pipeline/index.js +0 -128
- package/dist/node_modules/minipass-pipeline/node_modules/minipass/LICENSE +0 -15
- package/dist/node_modules/minipass-pipeline/node_modules/minipass/index.js +0 -649
- package/dist/node_modules/minipass-pipeline/node_modules/minipass/package.json +0 -56
- package/dist/node_modules/minipass-pipeline/package.json +0 -29
- package/dist/node_modules/minipass-sized/LICENSE +0 -15
- package/dist/node_modules/minipass-sized/dist/commonjs/index.js +0 -69
- package/dist/node_modules/minipass-sized/dist/commonjs/package.json +0 -3
- package/dist/node_modules/minipass-sized/dist/esm/index.js +0 -64
- package/dist/node_modules/minipass-sized/dist/esm/package.json +0 -3
- package/dist/node_modules/minipass-sized/package.json +0 -69
- package/dist/node_modules/ms/index.js +0 -162
- package/dist/node_modules/ms/package.json +0 -38
- package/dist/node_modules/negotiator/LICENSE +0 -24
- package/dist/node_modules/negotiator/index.js +0 -83
- package/dist/node_modules/negotiator/lib/charset.js +0 -169
- package/dist/node_modules/negotiator/lib/encoding.js +0 -205
- package/dist/node_modules/negotiator/lib/language.js +0 -179
- package/dist/node_modules/negotiator/lib/mediaType.js +0 -294
- package/dist/node_modules/negotiator/package.json +0 -43
- package/dist/node_modules/p-map/index.js +0 -283
- package/dist/node_modules/p-map/license +0 -9
- package/dist/node_modules/p-map/package.json +0 -57
- package/dist/node_modules/path-scurry/dist/commonjs/index.js +0 -2018
- package/dist/node_modules/path-scurry/dist/commonjs/package.json +0 -3
- package/dist/node_modules/path-scurry/dist/esm/index.js +0 -1983
- package/dist/node_modules/path-scurry/dist/esm/package.json +0 -3
- package/dist/node_modules/path-scurry/package.json +0 -72
- package/dist/node_modules/safer-buffer/dangerous.js +0 -58
- package/dist/node_modules/safer-buffer/package.json +0 -34
- package/dist/node_modules/safer-buffer/safer.js +0 -77
- package/dist/node_modules/safer-buffer/tests.js +0 -406
- package/dist/node_modules/smart-buffer/.prettierrc.yaml +0 -5
- package/dist/node_modules/smart-buffer/LICENSE +0 -20
- package/dist/node_modules/smart-buffer/build/smartbuffer.js +0 -1233
- package/dist/node_modules/smart-buffer/build/utils.js +0 -108
- package/dist/node_modules/smart-buffer/package.json +0 -79
- package/dist/node_modules/socks/.eslintrc.cjs +0 -11
- package/dist/node_modules/socks/.prettierrc.yaml +0 -7
- package/dist/node_modules/socks/LICENSE +0 -20
- package/dist/node_modules/socks/build/client/socksclient.js +0 -793
- package/dist/node_modules/socks/build/common/constants.js +0 -108
- package/dist/node_modules/socks/build/common/helpers.js +0 -167
- package/dist/node_modules/socks/build/common/receivebuffer.js +0 -43
- package/dist/node_modules/socks/build/common/util.js +0 -25
- package/dist/node_modules/socks/build/index.js +0 -18
- package/dist/node_modules/socks/package.json +0 -58
- package/dist/node_modules/socks-proxy-agent/LICENSE +0 -22
- package/dist/node_modules/socks-proxy-agent/dist/index.js +0 -195
- package/dist/node_modules/socks-proxy-agent/package.json +0 -142
- package/dist/node_modules/ssri/lib/index.js +0 -550
- package/dist/node_modules/ssri/package.json +0 -66
- package/dist/node_modules/tar/node_modules/yallist/dist/commonjs/package.json +0 -3
- package/dist/node_modules/tar/node_modules/yallist/dist/esm/package.json +0 -3
- package/dist/node_modules/tar/node_modules/yallist/package.json +0 -68
- package/dist/node_modules/yallist/LICENSE +0 -15
- package/dist/node_modules/yallist/iterator.js +0 -8
- package/dist/node_modules/yallist/yallist.js +0 -426
- /package/dist/node_modules/{tar/node_modules/yallist → yallist}/dist/commonjs/index.js +0 -0
- /package/dist/node_modules/{balanced-match → yallist}/dist/commonjs/package.json +0 -0
- /package/dist/node_modules/{tar/node_modules/yallist → yallist}/dist/esm/index.js +0 -0
- /package/dist/node_modules/{balanced-match → yallist}/dist/esm/package.json +0 -0
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
class RetryOperation {
|
|
2
|
-
#attempts = 1
|
|
3
|
-
#cachedTimeouts = null
|
|
4
|
-
#errors = []
|
|
5
|
-
#fn = null
|
|
6
|
-
#maxRetryTime
|
|
7
|
-
#operationStart = null
|
|
8
|
-
#originalTimeouts
|
|
9
|
-
#timeouts
|
|
10
|
-
#timer = null
|
|
11
|
-
#unref
|
|
12
|
-
|
|
13
|
-
constructor (timeouts, options = {}) {
|
|
14
|
-
this.#originalTimeouts = [...timeouts]
|
|
15
|
-
this.#timeouts = [...timeouts]
|
|
16
|
-
this.#unref = options.unref
|
|
17
|
-
this.#maxRetryTime = options.maxRetryTime || Infinity
|
|
18
|
-
if (options.forever) {
|
|
19
|
-
this.#cachedTimeouts = [...this.#timeouts]
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
get timeouts () {
|
|
24
|
-
return [...this.#timeouts]
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
get errors () {
|
|
28
|
-
return [...this.#errors]
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
get attempts () {
|
|
32
|
-
return this.#attempts
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
get mainError () {
|
|
36
|
-
let mainError = null
|
|
37
|
-
if (this.#errors.length) {
|
|
38
|
-
let mainErrorCount = 0
|
|
39
|
-
const counts = {}
|
|
40
|
-
for (let i = 0; i < this.#errors.length; i++) {
|
|
41
|
-
const error = this.#errors[i]
|
|
42
|
-
const { message } = error
|
|
43
|
-
if (!counts[message]) {
|
|
44
|
-
counts[message] = 0
|
|
45
|
-
}
|
|
46
|
-
counts[message]++
|
|
47
|
-
|
|
48
|
-
if (counts[message] >= mainErrorCount) {
|
|
49
|
-
mainError = error
|
|
50
|
-
mainErrorCount = counts[message]
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
return mainError
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
reset () {
|
|
58
|
-
this.#attempts = 1
|
|
59
|
-
this.#timeouts = [...this.#originalTimeouts]
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
stop () {
|
|
63
|
-
if (this.#timer) {
|
|
64
|
-
clearTimeout(this.#timer)
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
this.#timeouts = []
|
|
68
|
-
this.#cachedTimeouts = null
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
retry (err) {
|
|
72
|
-
this.#errors.push(err)
|
|
73
|
-
if (new Date().getTime() - this.#operationStart >= this.#maxRetryTime) {
|
|
74
|
-
// XXX This puts the timeout error first, meaning it will never show as mainError, there may be no way to ever see this
|
|
75
|
-
this.#errors.unshift(new Error('RetryOperation timeout occurred'))
|
|
76
|
-
return false
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
let timeout = this.#timeouts.shift()
|
|
80
|
-
if (timeout === undefined) {
|
|
81
|
-
// We're out of timeouts, clear the last error and repeat the final timeout
|
|
82
|
-
if (this.#cachedTimeouts) {
|
|
83
|
-
this.#errors.pop()
|
|
84
|
-
timeout = this.#cachedTimeouts.at(-1)
|
|
85
|
-
} else {
|
|
86
|
-
return false
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
// TODO what if there already is a timer?
|
|
91
|
-
this.#timer = setTimeout(() => {
|
|
92
|
-
this.#attempts++
|
|
93
|
-
this.#fn(this.#attempts)
|
|
94
|
-
}, timeout)
|
|
95
|
-
|
|
96
|
-
if (this.#unref) {
|
|
97
|
-
this.#timer.unref()
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
return true
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
attempt (fn) {
|
|
104
|
-
this.#fn = fn
|
|
105
|
-
this.#operationStart = new Date().getTime()
|
|
106
|
-
this.#fn(this.#attempts)
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
module.exports = { RetryOperation }
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@gar/promise-retry",
|
|
3
|
-
"version": "1.0.3",
|
|
4
|
-
"description": "Retries a function that returns a promise, leveraging the power of the retry module.",
|
|
5
|
-
"main": "./lib/index.js",
|
|
6
|
-
"files": [
|
|
7
|
-
"lib"
|
|
8
|
-
],
|
|
9
|
-
"type": "commonjs",
|
|
10
|
-
"exports": {
|
|
11
|
-
".": [
|
|
12
|
-
{
|
|
13
|
-
"default": "./lib/index.js",
|
|
14
|
-
"types": "./lib/index.d.ts"
|
|
15
|
-
},
|
|
16
|
-
"./lib/index.js"
|
|
17
|
-
]
|
|
18
|
-
},
|
|
19
|
-
"scripts": {
|
|
20
|
-
"lint": "npx standard",
|
|
21
|
-
"lint:fix": "npx standard --fix",
|
|
22
|
-
"test": "node --test --experimental-test-coverage --test-coverage-lines=100 --test-coverage-functions=100 --test-coverage-branches=100",
|
|
23
|
-
"typelint": "npx -p typescript tsc ./lib/index.d.ts",
|
|
24
|
-
"posttest": "npm run lint",
|
|
25
|
-
"postlint": "npm run typelint"
|
|
26
|
-
},
|
|
27
|
-
"bugs": {
|
|
28
|
-
"url": "https://github.com/wraithgar/node-promise-retry/issues/"
|
|
29
|
-
},
|
|
30
|
-
"repository": {
|
|
31
|
-
"type": "git",
|
|
32
|
-
"url": "git://github.com/wraithgar/node-promise-retry.git"
|
|
33
|
-
},
|
|
34
|
-
"keywords": [
|
|
35
|
-
"retry",
|
|
36
|
-
"promise",
|
|
37
|
-
"backoff",
|
|
38
|
-
"repeat",
|
|
39
|
-
"replay"
|
|
40
|
-
],
|
|
41
|
-
"license": "MIT",
|
|
42
|
-
"engines": {
|
|
43
|
-
"node": "^20.17.0 || >=22.9.0"
|
|
44
|
-
}
|
|
45
|
-
}
|
|
@@ -1,206 +0,0 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
const net = require('net')
|
|
4
|
-
const tls = require('tls')
|
|
5
|
-
const { once } = require('events')
|
|
6
|
-
const timers = require('timers/promises')
|
|
7
|
-
const { normalizeOptions, cacheOptions } = require('./options')
|
|
8
|
-
const { getProxy, getProxyAgent, proxyCache } = require('./proxy.js')
|
|
9
|
-
const Errors = require('./errors.js')
|
|
10
|
-
const { Agent: AgentBase } = require('agent-base')
|
|
11
|
-
|
|
12
|
-
module.exports = class Agent extends AgentBase {
|
|
13
|
-
#options
|
|
14
|
-
#timeouts
|
|
15
|
-
#proxy
|
|
16
|
-
#noProxy
|
|
17
|
-
#ProxyAgent
|
|
18
|
-
|
|
19
|
-
constructor (options = {}) {
|
|
20
|
-
const { timeouts, proxy, noProxy, ...normalizedOptions } = normalizeOptions(options)
|
|
21
|
-
|
|
22
|
-
super(normalizedOptions)
|
|
23
|
-
|
|
24
|
-
this.#options = normalizedOptions
|
|
25
|
-
this.#timeouts = timeouts
|
|
26
|
-
|
|
27
|
-
if (proxy) {
|
|
28
|
-
this.#proxy = new URL(proxy)
|
|
29
|
-
this.#noProxy = noProxy
|
|
30
|
-
this.#ProxyAgent = getProxyAgent(proxy)
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
get proxy () {
|
|
35
|
-
return this.#proxy ? { url: this.#proxy } : {}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
#getProxy (options) {
|
|
39
|
-
if (!this.#proxy) {
|
|
40
|
-
return
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
const proxy = getProxy(`${options.protocol}//${options.host}:${options.port}`, {
|
|
44
|
-
proxy: this.#proxy,
|
|
45
|
-
noProxy: this.#noProxy,
|
|
46
|
-
})
|
|
47
|
-
|
|
48
|
-
if (!proxy) {
|
|
49
|
-
return
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
const cacheKey = cacheOptions({
|
|
53
|
-
...options,
|
|
54
|
-
...this.#options,
|
|
55
|
-
timeouts: this.#timeouts,
|
|
56
|
-
proxy,
|
|
57
|
-
})
|
|
58
|
-
|
|
59
|
-
if (proxyCache.has(cacheKey)) {
|
|
60
|
-
return proxyCache.get(cacheKey)
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
let ProxyAgent = this.#ProxyAgent
|
|
64
|
-
if (Array.isArray(ProxyAgent)) {
|
|
65
|
-
ProxyAgent = this.isSecureEndpoint(options) ? ProxyAgent[1] : ProxyAgent[0]
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
const proxyAgent = new ProxyAgent(proxy, {
|
|
69
|
-
...this.#options,
|
|
70
|
-
socketOptions: { family: this.#options.family },
|
|
71
|
-
})
|
|
72
|
-
proxyCache.set(cacheKey, proxyAgent)
|
|
73
|
-
|
|
74
|
-
return proxyAgent
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
// takes an array of promises and races them against the connection timeout
|
|
78
|
-
// which will throw the necessary error if it is hit. This will return the
|
|
79
|
-
// result of the promise race.
|
|
80
|
-
async #timeoutConnection ({ promises, options, timeout }, ac = new AbortController()) {
|
|
81
|
-
if (timeout) {
|
|
82
|
-
const connectionTimeout = timers.setTimeout(timeout, null, { signal: ac.signal })
|
|
83
|
-
.then(() => {
|
|
84
|
-
throw new Errors.ConnectionTimeoutError(`${options.host}:${options.port}`)
|
|
85
|
-
}).catch((err) => {
|
|
86
|
-
if (err.name === 'AbortError') {
|
|
87
|
-
return
|
|
88
|
-
}
|
|
89
|
-
throw err
|
|
90
|
-
})
|
|
91
|
-
promises.push(connectionTimeout)
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
let result
|
|
95
|
-
try {
|
|
96
|
-
result = await Promise.race(promises)
|
|
97
|
-
ac.abort()
|
|
98
|
-
} catch (err) {
|
|
99
|
-
ac.abort()
|
|
100
|
-
throw err
|
|
101
|
-
}
|
|
102
|
-
return result
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
async connect (request, options) {
|
|
106
|
-
// if the connection does not have its own lookup function
|
|
107
|
-
// set, then use the one from our options
|
|
108
|
-
options.lookup ??= this.#options.lookup
|
|
109
|
-
|
|
110
|
-
let socket
|
|
111
|
-
let timeout = this.#timeouts.connection
|
|
112
|
-
const isSecureEndpoint = this.isSecureEndpoint(options)
|
|
113
|
-
|
|
114
|
-
const proxy = this.#getProxy(options)
|
|
115
|
-
if (proxy) {
|
|
116
|
-
// some of the proxies will wait for the socket to fully connect before
|
|
117
|
-
// returning so we have to await this while also racing it against the
|
|
118
|
-
// connection timeout.
|
|
119
|
-
const start = Date.now()
|
|
120
|
-
socket = await this.#timeoutConnection({
|
|
121
|
-
options,
|
|
122
|
-
timeout,
|
|
123
|
-
promises: [proxy.connect(request, options)],
|
|
124
|
-
})
|
|
125
|
-
// see how much time proxy.connect took and subtract it from
|
|
126
|
-
// the timeout
|
|
127
|
-
if (timeout) {
|
|
128
|
-
timeout = timeout - (Date.now() - start)
|
|
129
|
-
}
|
|
130
|
-
} else {
|
|
131
|
-
socket = (isSecureEndpoint ? tls : net).connect(options)
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
socket.setKeepAlive(this.keepAlive, this.keepAliveMsecs)
|
|
135
|
-
socket.setNoDelay(this.keepAlive)
|
|
136
|
-
|
|
137
|
-
const abortController = new AbortController()
|
|
138
|
-
const { signal } = abortController
|
|
139
|
-
|
|
140
|
-
const connectPromise = socket[isSecureEndpoint ? 'secureConnecting' : 'connecting']
|
|
141
|
-
? once(socket, isSecureEndpoint ? 'secureConnect' : 'connect', { signal })
|
|
142
|
-
: Promise.resolve()
|
|
143
|
-
|
|
144
|
-
await this.#timeoutConnection({
|
|
145
|
-
options,
|
|
146
|
-
timeout,
|
|
147
|
-
promises: [
|
|
148
|
-
connectPromise,
|
|
149
|
-
once(socket, 'error', { signal }).then((err) => {
|
|
150
|
-
throw err[0]
|
|
151
|
-
}),
|
|
152
|
-
],
|
|
153
|
-
}, abortController)
|
|
154
|
-
|
|
155
|
-
if (this.#timeouts.idle) {
|
|
156
|
-
socket.setTimeout(this.#timeouts.idle, () => {
|
|
157
|
-
socket.destroy(new Errors.IdleTimeoutError(`${options.host}:${options.port}`))
|
|
158
|
-
})
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
return socket
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
addRequest (request, options) {
|
|
165
|
-
const proxy = this.#getProxy(options)
|
|
166
|
-
// it would be better to call proxy.addRequest here but this causes the
|
|
167
|
-
// http-proxy-agent to call its super.addRequest which causes the request
|
|
168
|
-
// to be added to the agent twice. since we only support 3 agents
|
|
169
|
-
// currently (see the required agents in proxy.js) we have manually
|
|
170
|
-
// checked that the only public methods we need to call are called in the
|
|
171
|
-
// next block. this could change in the future and presumably we would get
|
|
172
|
-
// failing tests until we have properly called the necessary methods on
|
|
173
|
-
// each of our proxy agents
|
|
174
|
-
if (proxy?.setRequestProps) {
|
|
175
|
-
proxy.setRequestProps(request, options)
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
request.setHeader('connection', this.keepAlive ? 'keep-alive' : 'close')
|
|
179
|
-
|
|
180
|
-
if (this.#timeouts.response) {
|
|
181
|
-
let responseTimeout
|
|
182
|
-
request.once('finish', () => {
|
|
183
|
-
setTimeout(() => {
|
|
184
|
-
request.destroy(new Errors.ResponseTimeoutError(request, this.#proxy))
|
|
185
|
-
}, this.#timeouts.response)
|
|
186
|
-
})
|
|
187
|
-
request.once('response', () => {
|
|
188
|
-
clearTimeout(responseTimeout)
|
|
189
|
-
})
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
if (this.#timeouts.transfer) {
|
|
193
|
-
let transferTimeout
|
|
194
|
-
request.once('response', (res) => {
|
|
195
|
-
setTimeout(() => {
|
|
196
|
-
res.destroy(new Errors.TransferTimeoutError(request, this.#proxy))
|
|
197
|
-
}, this.#timeouts.transfer)
|
|
198
|
-
res.once('close', () => {
|
|
199
|
-
clearTimeout(transferTimeout)
|
|
200
|
-
})
|
|
201
|
-
})
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
return super.addRequest(request, options)
|
|
205
|
-
}
|
|
206
|
-
}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
const { LRUCache } = require('lru-cache')
|
|
4
|
-
const dns = require('dns')
|
|
5
|
-
|
|
6
|
-
// this is a factory so that each request can have its own opts (i.e. ttl)
|
|
7
|
-
// while still sharing the cache across all requests
|
|
8
|
-
const cache = new LRUCache({ max: 50 })
|
|
9
|
-
|
|
10
|
-
const getOptions = ({
|
|
11
|
-
family = 0,
|
|
12
|
-
hints = dns.ADDRCONFIG,
|
|
13
|
-
all = false,
|
|
14
|
-
verbatim = undefined,
|
|
15
|
-
ttl = 5 * 60 * 1000,
|
|
16
|
-
lookup = dns.lookup,
|
|
17
|
-
}) => ({
|
|
18
|
-
// hints and lookup are returned since both are top level properties to (net|tls).connect
|
|
19
|
-
hints,
|
|
20
|
-
lookup: (hostname, ...args) => {
|
|
21
|
-
const callback = args.pop() // callback is always last arg
|
|
22
|
-
const lookupOptions = args[0] ?? {}
|
|
23
|
-
|
|
24
|
-
const options = {
|
|
25
|
-
family,
|
|
26
|
-
hints,
|
|
27
|
-
all,
|
|
28
|
-
verbatim,
|
|
29
|
-
...(typeof lookupOptions === 'number' ? { family: lookupOptions } : lookupOptions),
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
const key = JSON.stringify({ hostname, ...options })
|
|
33
|
-
|
|
34
|
-
if (cache.has(key)) {
|
|
35
|
-
const cached = cache.get(key)
|
|
36
|
-
return process.nextTick(callback, null, ...cached)
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
lookup(hostname, options, (err, ...result) => {
|
|
40
|
-
if (err) {
|
|
41
|
-
return callback(err)
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
cache.set(key, result, { ttl })
|
|
45
|
-
return callback(null, ...result)
|
|
46
|
-
})
|
|
47
|
-
},
|
|
48
|
-
})
|
|
49
|
-
|
|
50
|
-
module.exports = {
|
|
51
|
-
cache,
|
|
52
|
-
getOptions,
|
|
53
|
-
}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
class InvalidProxyProtocolError extends Error {
|
|
4
|
-
constructor (url) {
|
|
5
|
-
super(`Invalid protocol \`${url.protocol}\` connecting to proxy \`${url.host}\``)
|
|
6
|
-
this.code = 'EINVALIDPROXY'
|
|
7
|
-
this.proxy = url
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
class ConnectionTimeoutError extends Error {
|
|
12
|
-
constructor (host) {
|
|
13
|
-
super(`Timeout connecting to host \`${host}\``)
|
|
14
|
-
this.code = 'ECONNECTIONTIMEOUT'
|
|
15
|
-
this.host = host
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
class IdleTimeoutError extends Error {
|
|
20
|
-
constructor (host) {
|
|
21
|
-
super(`Idle timeout reached for host \`${host}\``)
|
|
22
|
-
this.code = 'EIDLETIMEOUT'
|
|
23
|
-
this.host = host
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
class ResponseTimeoutError extends Error {
|
|
28
|
-
constructor (request, proxy) {
|
|
29
|
-
let msg = 'Response timeout '
|
|
30
|
-
if (proxy) {
|
|
31
|
-
msg += `from proxy \`${proxy.host}\` `
|
|
32
|
-
}
|
|
33
|
-
msg += `connecting to host \`${request.host}\``
|
|
34
|
-
super(msg)
|
|
35
|
-
this.code = 'ERESPONSETIMEOUT'
|
|
36
|
-
this.proxy = proxy
|
|
37
|
-
this.request = request
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
class TransferTimeoutError extends Error {
|
|
42
|
-
constructor (request, proxy) {
|
|
43
|
-
let msg = 'Transfer timeout '
|
|
44
|
-
if (proxy) {
|
|
45
|
-
msg += `from proxy \`${proxy.host}\` `
|
|
46
|
-
}
|
|
47
|
-
msg += `for \`${request.host}\``
|
|
48
|
-
super(msg)
|
|
49
|
-
this.code = 'ETRANSFERTIMEOUT'
|
|
50
|
-
this.proxy = proxy
|
|
51
|
-
this.request = request
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
module.exports = {
|
|
56
|
-
InvalidProxyProtocolError,
|
|
57
|
-
ConnectionTimeoutError,
|
|
58
|
-
IdleTimeoutError,
|
|
59
|
-
ResponseTimeoutError,
|
|
60
|
-
TransferTimeoutError,
|
|
61
|
-
}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
const { LRUCache } = require('lru-cache')
|
|
4
|
-
const { normalizeOptions, cacheOptions } = require('./options')
|
|
5
|
-
const { getProxy, proxyCache } = require('./proxy.js')
|
|
6
|
-
const dns = require('./dns.js')
|
|
7
|
-
const Agent = require('./agents.js')
|
|
8
|
-
|
|
9
|
-
const agentCache = new LRUCache({ max: 20 })
|
|
10
|
-
|
|
11
|
-
const getAgent = (url, { agent, proxy, noProxy, ...options } = {}) => {
|
|
12
|
-
// false has meaning so this can't be a simple truthiness check
|
|
13
|
-
if (agent != null) {
|
|
14
|
-
return agent
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
url = new URL(url)
|
|
18
|
-
|
|
19
|
-
const proxyForUrl = getProxy(url, { proxy, noProxy })
|
|
20
|
-
const normalizedOptions = {
|
|
21
|
-
...normalizeOptions(options),
|
|
22
|
-
proxy: proxyForUrl,
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
const cacheKey = cacheOptions({
|
|
26
|
-
...normalizedOptions,
|
|
27
|
-
secureEndpoint: url.protocol === 'https:',
|
|
28
|
-
})
|
|
29
|
-
|
|
30
|
-
if (agentCache.has(cacheKey)) {
|
|
31
|
-
return agentCache.get(cacheKey)
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
const newAgent = new Agent(normalizedOptions)
|
|
35
|
-
agentCache.set(cacheKey, newAgent)
|
|
36
|
-
|
|
37
|
-
return newAgent
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
module.exports = {
|
|
41
|
-
getAgent,
|
|
42
|
-
Agent,
|
|
43
|
-
// these are exported for backwards compatability
|
|
44
|
-
HttpAgent: Agent,
|
|
45
|
-
HttpsAgent: Agent,
|
|
46
|
-
cache: {
|
|
47
|
-
proxy: proxyCache,
|
|
48
|
-
agent: agentCache,
|
|
49
|
-
dns: dns.cache,
|
|
50
|
-
clear: () => {
|
|
51
|
-
proxyCache.clear()
|
|
52
|
-
agentCache.clear()
|
|
53
|
-
dns.cache.clear()
|
|
54
|
-
},
|
|
55
|
-
},
|
|
56
|
-
}
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
const dns = require('./dns')
|
|
4
|
-
|
|
5
|
-
const normalizeOptions = (opts) => {
|
|
6
|
-
const family = parseInt(opts.family ?? '0', 10)
|
|
7
|
-
const keepAlive = opts.keepAlive ?? true
|
|
8
|
-
|
|
9
|
-
const normalized = {
|
|
10
|
-
// nodejs http agent options. these are all the defaults
|
|
11
|
-
// but kept here to increase the likelihood of cache hits
|
|
12
|
-
// https://nodejs.org/api/http.html#new-agentoptions
|
|
13
|
-
keepAliveMsecs: keepAlive ? 1000 : undefined,
|
|
14
|
-
maxSockets: opts.maxSockets ?? 15,
|
|
15
|
-
maxTotalSockets: Infinity,
|
|
16
|
-
maxFreeSockets: keepAlive ? 256 : undefined,
|
|
17
|
-
scheduling: 'fifo',
|
|
18
|
-
// then spread the rest of the options
|
|
19
|
-
...opts,
|
|
20
|
-
// we already set these to their defaults that we want
|
|
21
|
-
family,
|
|
22
|
-
keepAlive,
|
|
23
|
-
// our custom timeout options
|
|
24
|
-
timeouts: {
|
|
25
|
-
// the standard timeout option is mapped to our idle timeout
|
|
26
|
-
// and then deleted below
|
|
27
|
-
idle: opts.timeout ?? 0,
|
|
28
|
-
connection: 0,
|
|
29
|
-
response: 0,
|
|
30
|
-
transfer: 0,
|
|
31
|
-
...opts.timeouts,
|
|
32
|
-
},
|
|
33
|
-
// get the dns options that go at the top level of socket connection
|
|
34
|
-
...dns.getOptions({ family, ...opts.dns }),
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
// remove timeout since we already used it to set our own idle timeout
|
|
38
|
-
delete normalized.timeout
|
|
39
|
-
|
|
40
|
-
return normalized
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
const createKey = (obj) => {
|
|
44
|
-
let key = ''
|
|
45
|
-
const sorted = Object.entries(obj).sort((a, b) => a[0] - b[0])
|
|
46
|
-
for (let [k, v] of sorted) {
|
|
47
|
-
if (v == null) {
|
|
48
|
-
v = 'null'
|
|
49
|
-
} else if (v instanceof URL) {
|
|
50
|
-
v = v.toString()
|
|
51
|
-
} else if (typeof v === 'object') {
|
|
52
|
-
v = createKey(v)
|
|
53
|
-
}
|
|
54
|
-
key += `${k}:${v}:`
|
|
55
|
-
}
|
|
56
|
-
return key
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
const cacheOptions = ({ secureEndpoint, ...options }) => createKey({
|
|
60
|
-
secureEndpoint: !!secureEndpoint,
|
|
61
|
-
// socket connect options
|
|
62
|
-
family: options.family,
|
|
63
|
-
hints: options.hints,
|
|
64
|
-
localAddress: options.localAddress,
|
|
65
|
-
// tls specific connect options
|
|
66
|
-
strictSsl: secureEndpoint ? !!options.rejectUnauthorized : false,
|
|
67
|
-
ca: secureEndpoint ? options.ca : null,
|
|
68
|
-
cert: secureEndpoint ? options.cert : null,
|
|
69
|
-
key: secureEndpoint ? options.key : null,
|
|
70
|
-
// http agent options
|
|
71
|
-
keepAlive: options.keepAlive,
|
|
72
|
-
keepAliveMsecs: options.keepAliveMsecs,
|
|
73
|
-
maxSockets: options.maxSockets,
|
|
74
|
-
maxTotalSockets: options.maxTotalSockets,
|
|
75
|
-
maxFreeSockets: options.maxFreeSockets,
|
|
76
|
-
scheduling: options.scheduling,
|
|
77
|
-
// timeout options
|
|
78
|
-
timeouts: options.timeouts,
|
|
79
|
-
// proxy
|
|
80
|
-
proxy: options.proxy,
|
|
81
|
-
})
|
|
82
|
-
|
|
83
|
-
module.exports = {
|
|
84
|
-
normalizeOptions,
|
|
85
|
-
cacheOptions,
|
|
86
|
-
}
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
const { HttpProxyAgent } = require('http-proxy-agent')
|
|
4
|
-
const { HttpsProxyAgent } = require('https-proxy-agent')
|
|
5
|
-
const { SocksProxyAgent } = require('socks-proxy-agent')
|
|
6
|
-
const { LRUCache } = require('lru-cache')
|
|
7
|
-
const { InvalidProxyProtocolError } = require('./errors.js')
|
|
8
|
-
|
|
9
|
-
const PROXY_CACHE = new LRUCache({ max: 20 })
|
|
10
|
-
|
|
11
|
-
const SOCKS_PROTOCOLS = new Set(SocksProxyAgent.protocols)
|
|
12
|
-
|
|
13
|
-
const PROXY_ENV_KEYS = new Set(['https_proxy', 'http_proxy', 'proxy', 'no_proxy'])
|
|
14
|
-
|
|
15
|
-
const PROXY_ENV = Object.entries(process.env).reduce((acc, [key, value]) => {
|
|
16
|
-
key = key.toLowerCase()
|
|
17
|
-
if (PROXY_ENV_KEYS.has(key)) {
|
|
18
|
-
acc[key] = value
|
|
19
|
-
}
|
|
20
|
-
return acc
|
|
21
|
-
}, {})
|
|
22
|
-
|
|
23
|
-
const getProxyAgent = (url) => {
|
|
24
|
-
url = new URL(url)
|
|
25
|
-
|
|
26
|
-
const protocol = url.protocol.slice(0, -1)
|
|
27
|
-
if (SOCKS_PROTOCOLS.has(protocol)) {
|
|
28
|
-
return SocksProxyAgent
|
|
29
|
-
}
|
|
30
|
-
if (protocol === 'https' || protocol === 'http') {
|
|
31
|
-
return [HttpProxyAgent, HttpsProxyAgent]
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
throw new InvalidProxyProtocolError(url)
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
const isNoProxy = (url, noProxy) => {
|
|
38
|
-
if (typeof noProxy === 'string') {
|
|
39
|
-
noProxy = noProxy.split(',').map((p) => p.trim()).filter(Boolean)
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
if (!noProxy || !noProxy.length) {
|
|
43
|
-
return false
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
const hostSegments = url.hostname.split('.').reverse()
|
|
47
|
-
|
|
48
|
-
return noProxy.some((no) => {
|
|
49
|
-
const noSegments = no.split('.').filter(Boolean).reverse()
|
|
50
|
-
if (!noSegments.length) {
|
|
51
|
-
return false
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
for (let i = 0; i < noSegments.length; i++) {
|
|
55
|
-
if (hostSegments[i] !== noSegments[i]) {
|
|
56
|
-
return false
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
return true
|
|
61
|
-
})
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
const getProxy = (url, { proxy, noProxy }) => {
|
|
65
|
-
url = new URL(url)
|
|
66
|
-
|
|
67
|
-
if (!proxy) {
|
|
68
|
-
proxy = url.protocol === 'https:'
|
|
69
|
-
? PROXY_ENV.https_proxy
|
|
70
|
-
: PROXY_ENV.https_proxy || PROXY_ENV.http_proxy || PROXY_ENV.proxy
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
if (!noProxy) {
|
|
74
|
-
noProxy = PROXY_ENV.no_proxy
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
if (!proxy || isNoProxy(url, noProxy)) {
|
|
78
|
-
return null
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
return new URL(proxy)
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
module.exports = {
|
|
85
|
-
getProxyAgent,
|
|
86
|
-
getProxy,
|
|
87
|
-
proxyCache: PROXY_CACHE,
|
|
88
|
-
}
|