@pnpm/exe 11.0.0-dev.1003 → 11.0.0-rc.0
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 +6 -0
- package/dist/node-gyp-bin/node-gyp.cmd +5 -0
- package/dist/node_modules/@gar/promise-retry/LICENSE +20 -0
- package/dist/node_modules/@gar/promise-retry/lib/index.js +62 -0
- package/dist/node_modules/@gar/promise-retry/lib/retry.js +109 -0
- package/dist/node_modules/@gar/promise-retry/package.json +45 -0
- package/dist/node_modules/@isaacs/fs-minipass/LICENSE +15 -0
- package/dist/node_modules/@isaacs/fs-minipass/dist/commonjs/index.js +430 -0
- package/dist/node_modules/@isaacs/fs-minipass/dist/commonjs/package.json +3 -0
- package/dist/node_modules/@isaacs/fs-minipass/dist/esm/index.js +420 -0
- package/dist/node_modules/@isaacs/fs-minipass/dist/esm/package.json +3 -0
- package/dist/node_modules/@isaacs/fs-minipass/package.json +72 -0
- package/dist/node_modules/@npmcli/agent/lib/agents.js +206 -0
- package/dist/node_modules/@npmcli/agent/lib/dns.js +53 -0
- package/dist/node_modules/@npmcli/agent/lib/errors.js +61 -0
- package/dist/node_modules/@npmcli/agent/lib/index.js +56 -0
- package/dist/node_modules/@npmcli/agent/lib/options.js +86 -0
- package/dist/node_modules/@npmcli/agent/lib/proxy.js +88 -0
- package/dist/node_modules/@npmcli/agent/package.json +60 -0
- package/dist/node_modules/@npmcli/fs/lib/common/get-options.js +20 -0
- package/dist/node_modules/@npmcli/fs/lib/common/node.js +9 -0
- package/dist/node_modules/@npmcli/fs/lib/cp/LICENSE +15 -0
- package/dist/node_modules/@npmcli/fs/lib/cp/errors.js +129 -0
- package/dist/node_modules/@npmcli/fs/lib/cp/index.js +22 -0
- package/dist/node_modules/@npmcli/fs/lib/cp/polyfill.js +428 -0
- package/dist/node_modules/@npmcli/fs/lib/index.js +13 -0
- package/dist/node_modules/@npmcli/fs/lib/move-file.js +78 -0
- package/dist/node_modules/@npmcli/fs/lib/readdir-scoped.js +20 -0
- package/dist/node_modules/@npmcli/fs/lib/with-temp-dir.js +39 -0
- package/dist/node_modules/@npmcli/fs/package.json +54 -0
- package/dist/node_modules/@npmcli/redact/LICENSE +21 -0
- package/dist/node_modules/@npmcli/redact/lib/deep-map.js +71 -0
- package/dist/node_modules/@npmcli/redact/lib/error.js +28 -0
- package/dist/node_modules/@npmcli/redact/lib/index.js +44 -0
- package/dist/node_modules/@npmcli/redact/lib/matchers.js +88 -0
- package/dist/node_modules/@npmcli/redact/lib/server.js +59 -0
- package/dist/node_modules/@npmcli/redact/lib/utils.js +202 -0
- package/dist/node_modules/@npmcli/redact/package.json +52 -0
- package/dist/node_modules/abbrev/LICENSE +46 -0
- package/dist/node_modules/abbrev/lib/index.js +53 -0
- package/dist/node_modules/abbrev/package.json +41 -0
- package/dist/node_modules/agent-base/LICENSE +22 -0
- package/dist/node_modules/agent-base/dist/helpers.js +66 -0
- package/dist/node_modules/agent-base/dist/index.js +178 -0
- package/dist/node_modules/agent-base/package.json +46 -0
- package/dist/node_modules/balanced-match/dist/commonjs/index.js +59 -0
- package/dist/node_modules/balanced-match/dist/commonjs/package.json +3 -0
- package/dist/node_modules/balanced-match/dist/esm/index.js +54 -0
- package/dist/node_modules/balanced-match/dist/esm/package.json +3 -0
- package/dist/node_modules/balanced-match/package.json +68 -0
- package/dist/node_modules/brace-expansion/LICENSE +23 -0
- package/dist/node_modules/brace-expansion/dist/commonjs/index.js +201 -0
- package/dist/node_modules/brace-expansion/dist/commonjs/package.json +3 -0
- package/dist/node_modules/brace-expansion/dist/esm/index.js +197 -0
- package/dist/node_modules/brace-expansion/dist/esm/package.json +3 -0
- package/dist/node_modules/brace-expansion/package.json +64 -0
- package/dist/node_modules/cacache/lib/content/path.js +29 -0
- package/dist/node_modules/cacache/lib/content/read.js +165 -0
- package/dist/node_modules/cacache/lib/content/rm.js +18 -0
- package/dist/node_modules/cacache/lib/content/write.js +206 -0
- package/dist/node_modules/cacache/lib/entry-index.js +336 -0
- package/dist/node_modules/cacache/lib/get.js +170 -0
- package/dist/node_modules/cacache/lib/index.js +42 -0
- package/dist/node_modules/cacache/lib/memoization.js +72 -0
- package/dist/node_modules/cacache/lib/put.js +80 -0
- package/dist/node_modules/cacache/lib/rm.js +31 -0
- package/dist/node_modules/cacache/lib/util/glob.js +7 -0
- package/dist/node_modules/cacache/lib/util/hash-to-segments.js +7 -0
- package/dist/node_modules/cacache/lib/util/tmp.js +32 -0
- package/dist/node_modules/cacache/lib/verify.js +258 -0
- package/dist/node_modules/cacache/package.json +81 -0
- package/dist/node_modules/chownr/dist/commonjs/index.js +93 -0
- package/dist/node_modules/chownr/dist/commonjs/package.json +3 -0
- package/dist/node_modules/chownr/dist/esm/index.js +85 -0
- package/dist/node_modules/chownr/dist/esm/package.json +3 -0
- package/dist/node_modules/chownr/package.json +69 -0
- package/dist/node_modules/debug/LICENSE +20 -0
- package/dist/node_modules/debug/package.json +64 -0
- package/dist/node_modules/debug/src/browser.js +272 -0
- package/dist/node_modules/debug/src/common.js +292 -0
- package/dist/node_modules/debug/src/index.js +10 -0
- package/dist/node_modules/debug/src/node.js +263 -0
- package/dist/node_modules/env-paths/index.js +74 -0
- package/dist/node_modules/env-paths/license +9 -0
- package/dist/node_modules/env-paths/package.json +45 -0
- package/dist/node_modules/exponential-backoff/LICENSE +202 -0
- package/dist/node_modules/exponential-backoff/dist/backoff.js +124 -0
- package/dist/node_modules/exponential-backoff/dist/delay/always/always.delay.js +25 -0
- package/dist/node_modules/exponential-backoff/dist/delay/delay.base.js +45 -0
- package/dist/node_modules/exponential-backoff/dist/delay/delay.factory.js +17 -0
- package/dist/node_modules/exponential-backoff/dist/delay/delay.interface.js +3 -0
- package/dist/node_modules/exponential-backoff/dist/delay/skip-first/skip-first.delay.js +82 -0
- package/dist/node_modules/exponential-backoff/dist/jitter/full/full.jitter.js +8 -0
- package/dist/node_modules/exponential-backoff/dist/jitter/jitter.factory.js +15 -0
- package/dist/node_modules/exponential-backoff/dist/jitter/no/no.jitter.js +7 -0
- package/dist/node_modules/exponential-backoff/dist/options.js +31 -0
- package/dist/node_modules/exponential-backoff/package.json +62 -0
- package/dist/node_modules/fdir/LICENSE +7 -0
- package/dist/node_modules/fdir/dist/index.cjs +588 -0
- package/dist/node_modules/fdir/dist/index.d.cts +155 -0
- package/dist/node_modules/fdir/dist/index.d.mts +155 -0
- package/dist/node_modules/fdir/dist/index.mjs +570 -0
- package/dist/node_modules/fdir/package.json +103 -0
- package/dist/node_modules/fs-minipass/LICENSE +15 -0
- package/dist/node_modules/fs-minipass/lib/index.js +443 -0
- package/dist/node_modules/fs-minipass/package.json +54 -0
- package/dist/node_modules/glob/dist/commonjs/glob.js +248 -0
- package/dist/node_modules/glob/dist/commonjs/has-magic.js +27 -0
- package/dist/node_modules/glob/dist/commonjs/ignore.js +119 -0
- package/dist/node_modules/glob/dist/commonjs/index.js +68 -0
- package/dist/node_modules/glob/dist/commonjs/index.min.js +4 -0
- package/dist/node_modules/glob/dist/commonjs/package.json +3 -0
- package/dist/node_modules/glob/dist/commonjs/pattern.js +223 -0
- package/dist/node_modules/glob/dist/commonjs/processor.js +301 -0
- package/dist/node_modules/glob/dist/commonjs/walker.js +387 -0
- package/dist/node_modules/glob/dist/esm/glob.js +244 -0
- package/dist/node_modules/glob/dist/esm/has-magic.js +23 -0
- package/dist/node_modules/glob/dist/esm/ignore.js +115 -0
- package/dist/node_modules/glob/dist/esm/index.js +55 -0
- package/dist/node_modules/glob/dist/esm/index.min.js +4 -0
- package/dist/node_modules/glob/dist/esm/package.json +3 -0
- package/dist/node_modules/glob/dist/esm/pattern.js +219 -0
- package/dist/node_modules/glob/dist/esm/processor.js +294 -0
- package/dist/node_modules/glob/dist/esm/walker.js +381 -0
- package/dist/node_modules/glob/package.json +98 -0
- package/dist/node_modules/graceful-fs/LICENSE +15 -0
- package/dist/node_modules/graceful-fs/clone.js +23 -0
- package/dist/node_modules/graceful-fs/graceful-fs.js +448 -0
- package/dist/node_modules/graceful-fs/legacy-streams.js +118 -0
- package/dist/node_modules/graceful-fs/package.json +53 -0
- package/dist/node_modules/graceful-fs/polyfills.js +355 -0
- package/dist/node_modules/http-cache-semantics/LICENSE +9 -0
- package/dist/node_modules/http-cache-semantics/index.js +928 -0
- package/dist/node_modules/http-cache-semantics/package.json +22 -0
- package/dist/node_modules/http-proxy-agent/LICENSE +22 -0
- package/dist/node_modules/http-proxy-agent/dist/index.js +148 -0
- package/dist/node_modules/http-proxy-agent/package.json +47 -0
- package/dist/node_modules/https-proxy-agent/LICENSE +22 -0
- package/dist/node_modules/https-proxy-agent/dist/index.js +180 -0
- package/dist/node_modules/https-proxy-agent/dist/parse-proxy-response.js +101 -0
- package/dist/node_modules/https-proxy-agent/package.json +50 -0
- package/dist/node_modules/iconv-lite/LICENSE +21 -0
- package/dist/node_modules/iconv-lite/encodings/dbcs-codec.js +532 -0
- package/dist/node_modules/iconv-lite/encodings/dbcs-data.js +185 -0
- package/dist/node_modules/iconv-lite/encodings/index.js +23 -0
- package/dist/node_modules/iconv-lite/encodings/internal.js +218 -0
- package/dist/node_modules/iconv-lite/encodings/sbcs-codec.js +75 -0
- package/dist/node_modules/iconv-lite/encodings/sbcs-data-generated.js +451 -0
- package/dist/node_modules/iconv-lite/encodings/sbcs-data.js +178 -0
- package/dist/node_modules/iconv-lite/encodings/tables/big5-added.json +122 -0
- package/dist/node_modules/iconv-lite/encodings/tables/cp936.json +264 -0
- package/dist/node_modules/iconv-lite/encodings/tables/cp949.json +273 -0
- package/dist/node_modules/iconv-lite/encodings/tables/cp950.json +177 -0
- package/dist/node_modules/iconv-lite/encodings/tables/eucjp.json +182 -0
- package/dist/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json +1 -0
- package/dist/node_modules/iconv-lite/encodings/tables/gbk-added.json +56 -0
- package/dist/node_modules/iconv-lite/encodings/tables/shiftjis.json +125 -0
- package/dist/node_modules/iconv-lite/encodings/utf16.js +187 -0
- package/dist/node_modules/iconv-lite/encodings/utf32.js +307 -0
- package/dist/node_modules/iconv-lite/encodings/utf7.js +283 -0
- package/dist/node_modules/iconv-lite/lib/bom-handling.js +48 -0
- package/dist/node_modules/iconv-lite/lib/helpers/merge-exports.js +13 -0
- package/dist/node_modules/iconv-lite/lib/index.js +182 -0
- package/dist/node_modules/iconv-lite/lib/streams.js +105 -0
- package/dist/node_modules/iconv-lite/package.json +70 -0
- package/dist/node_modules/ip-address/LICENSE +19 -0
- package/dist/node_modules/ip-address/dist/address-error.js +12 -0
- package/dist/node_modules/ip-address/dist/common.js +46 -0
- package/dist/node_modules/ip-address/dist/ip-address.js +35 -0
- package/dist/node_modules/ip-address/dist/ipv4.js +360 -0
- package/dist/node_modules/ip-address/dist/ipv6.js +1003 -0
- package/dist/node_modules/ip-address/dist/v4/constants.js +8 -0
- package/dist/node_modules/ip-address/dist/v6/constants.js +76 -0
- package/dist/node_modules/ip-address/dist/v6/helpers.js +45 -0
- package/dist/node_modules/ip-address/dist/v6/regular-expressions.js +95 -0
- package/dist/node_modules/ip-address/package.json +78 -0
- package/dist/node_modules/isexe/dist/commonjs/index.js +56 -0
- package/dist/node_modules/isexe/dist/commonjs/index.min.js +2 -0
- package/dist/node_modules/isexe/dist/commonjs/options.js +3 -0
- package/dist/node_modules/isexe/dist/commonjs/package.json +3 -0
- package/dist/node_modules/isexe/dist/commonjs/posix.js +67 -0
- package/dist/node_modules/isexe/dist/commonjs/win32.js +63 -0
- package/dist/node_modules/isexe/dist/esm/index.js +16 -0
- package/dist/node_modules/isexe/dist/esm/index.min.js +2 -0
- package/dist/node_modules/isexe/dist/esm/options.js +2 -0
- package/dist/node_modules/isexe/dist/esm/package.json +3 -0
- package/dist/node_modules/isexe/dist/esm/posix.js +62 -0
- package/dist/node_modules/isexe/dist/esm/win32.js +58 -0
- package/dist/node_modules/isexe/package.json +78 -0
- package/dist/node_modules/lru-cache/dist/commonjs/index.js +1595 -0
- package/dist/node_modules/lru-cache/dist/commonjs/index.min.js +2 -0
- package/dist/node_modules/lru-cache/dist/commonjs/package.json +3 -0
- package/dist/node_modules/lru-cache/dist/esm/index.js +1591 -0
- package/dist/node_modules/lru-cache/dist/esm/index.min.js +2 -0
- package/dist/node_modules/lru-cache/dist/esm/package.json +3 -0
- package/dist/node_modules/lru-cache/package.json +93 -0
- package/dist/node_modules/make-fetch-happen/LICENSE +16 -0
- package/dist/node_modules/make-fetch-happen/lib/cache/entry.js +471 -0
- package/dist/node_modules/make-fetch-happen/lib/cache/errors.js +11 -0
- package/dist/node_modules/make-fetch-happen/lib/cache/index.js +49 -0
- package/dist/node_modules/make-fetch-happen/lib/cache/key.js +17 -0
- package/dist/node_modules/make-fetch-happen/lib/cache/policy.js +161 -0
- package/dist/node_modules/make-fetch-happen/lib/fetch.js +118 -0
- package/dist/node_modules/make-fetch-happen/lib/index.js +41 -0
- package/dist/node_modules/make-fetch-happen/lib/options.js +59 -0
- package/dist/node_modules/make-fetch-happen/lib/pipeline.js +41 -0
- package/dist/node_modules/make-fetch-happen/lib/remote.js +134 -0
- package/dist/node_modules/make-fetch-happen/package.json +75 -0
- package/dist/node_modules/minimatch/dist/commonjs/assert-valid-pattern.js +14 -0
- package/dist/node_modules/minimatch/dist/commonjs/ast.js +846 -0
- package/dist/node_modules/minimatch/dist/commonjs/brace-expressions.js +150 -0
- package/dist/node_modules/minimatch/dist/commonjs/escape.js +30 -0
- package/dist/node_modules/minimatch/dist/commonjs/index.js +1121 -0
- package/dist/node_modules/minimatch/dist/commonjs/package.json +3 -0
- package/dist/node_modules/minimatch/dist/commonjs/unescape.js +38 -0
- package/dist/node_modules/minimatch/dist/esm/assert-valid-pattern.js +10 -0
- package/dist/node_modules/minimatch/dist/esm/ast.js +842 -0
- package/dist/node_modules/minimatch/dist/esm/brace-expressions.js +146 -0
- package/dist/node_modules/minimatch/dist/esm/escape.js +26 -0
- package/dist/node_modules/minimatch/dist/esm/index.js +1108 -0
- package/dist/node_modules/minimatch/dist/esm/package.json +3 -0
- package/dist/node_modules/minimatch/dist/esm/unescape.js +34 -0
- package/dist/node_modules/minimatch/package.json +67 -0
- package/dist/node_modules/minipass/dist/commonjs/index.js +1038 -0
- package/dist/node_modules/minipass/dist/commonjs/package.json +3 -0
- package/dist/node_modules/minipass/dist/esm/index.js +1020 -0
- package/dist/node_modules/minipass/dist/esm/package.json +3 -0
- package/dist/node_modules/minipass/package.json +77 -0
- package/dist/node_modules/minipass-collect/LICENSE +15 -0
- package/dist/node_modules/minipass-collect/index.js +71 -0
- package/dist/node_modules/minipass-collect/package.json +30 -0
- package/dist/node_modules/minipass-fetch/LICENSE +28 -0
- package/dist/node_modules/minipass-fetch/lib/abort-error.js +17 -0
- package/dist/node_modules/minipass-fetch/lib/blob.js +97 -0
- package/dist/node_modules/minipass-fetch/lib/body.js +360 -0
- package/dist/node_modules/minipass-fetch/lib/fetch-error.js +32 -0
- package/dist/node_modules/minipass-fetch/lib/headers.js +267 -0
- package/dist/node_modules/minipass-fetch/lib/index.js +376 -0
- package/dist/node_modules/minipass-fetch/lib/request.js +282 -0
- package/dist/node_modules/minipass-fetch/lib/response.js +90 -0
- package/dist/node_modules/minipass-fetch/package.json +70 -0
- package/dist/node_modules/minipass-flush/LICENSE +15 -0
- package/dist/node_modules/minipass-flush/index.js +39 -0
- package/dist/node_modules/minipass-flush/node_modules/minipass/LICENSE +15 -0
- package/dist/node_modules/minipass-flush/node_modules/minipass/index.js +649 -0
- package/dist/node_modules/minipass-flush/node_modules/minipass/package.json +56 -0
- package/dist/node_modules/minipass-flush/package.json +39 -0
- package/dist/node_modules/minipass-pipeline/LICENSE +15 -0
- package/dist/node_modules/minipass-pipeline/index.js +128 -0
- package/dist/node_modules/minipass-pipeline/node_modules/minipass/LICENSE +15 -0
- package/dist/node_modules/minipass-pipeline/node_modules/minipass/index.js +649 -0
- package/dist/node_modules/minipass-pipeline/node_modules/minipass/package.json +56 -0
- package/dist/node_modules/minipass-pipeline/package.json +29 -0
- package/dist/node_modules/minipass-sized/LICENSE +15 -0
- package/dist/node_modules/minipass-sized/dist/commonjs/index.js +69 -0
- package/dist/node_modules/minipass-sized/dist/commonjs/package.json +3 -0
- package/dist/node_modules/minipass-sized/dist/esm/index.js +64 -0
- package/dist/node_modules/minipass-sized/dist/esm/package.json +3 -0
- package/dist/node_modules/minipass-sized/package.json +69 -0
- package/dist/node_modules/minizlib/LICENSE +26 -0
- package/dist/node_modules/minizlib/dist/commonjs/constants.js +123 -0
- package/dist/node_modules/minizlib/dist/commonjs/index.js +416 -0
- package/dist/node_modules/minizlib/dist/commonjs/package.json +3 -0
- package/dist/node_modules/minizlib/dist/esm/constants.js +117 -0
- package/dist/node_modules/minizlib/dist/esm/index.js +363 -0
- package/dist/node_modules/minizlib/dist/esm/package.json +3 -0
- package/dist/node_modules/minizlib/package.json +80 -0
- package/dist/node_modules/ms/index.js +162 -0
- package/dist/node_modules/ms/package.json +38 -0
- package/dist/node_modules/negotiator/LICENSE +24 -0
- package/dist/node_modules/negotiator/index.js +83 -0
- package/dist/node_modules/negotiator/lib/charset.js +169 -0
- package/dist/node_modules/negotiator/lib/encoding.js +205 -0
- package/dist/node_modules/negotiator/lib/language.js +179 -0
- package/dist/node_modules/negotiator/lib/mediaType.js +294 -0
- package/dist/node_modules/negotiator/package.json +43 -0
- package/dist/node_modules/node-gyp/.release-please-manifest.json +3 -0
- package/dist/node_modules/node-gyp/LICENSE +24 -0
- package/dist/node_modules/node-gyp/addon.gypi +204 -0
- package/dist/node_modules/node-gyp/bin/node-gyp.js +145 -0
- package/dist/node_modules/node-gyp/eslint.config.js +3 -0
- package/dist/node_modules/node-gyp/gyp/.release-please-manifest.json +3 -0
- package/dist/node_modules/node-gyp/gyp/LICENSE +28 -0
- package/dist/node_modules/node-gyp/gyp/data/ninja/build.ninja +4 -0
- package/dist/node_modules/node-gyp/gyp/data/win/large-pdb-shim.cc +12 -0
- package/dist/node_modules/node-gyp/gyp/gyp +8 -0
- package/dist/node_modules/node-gyp/gyp/gyp.bat +5 -0
- package/dist/node_modules/node-gyp/gyp/gyp_main.py +45 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/MSVSNew.py +365 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/MSVSProject.py +206 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings.py +1283 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/MSVSSettings_test.py +1545 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/MSVSToolFile.py +59 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/MSVSUserFile.py +152 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/MSVSUtil.py +270 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/MSVSVersion.py +599 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/__init__.py +707 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/common.py +725 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/common_test.py +186 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/easy_xml.py +170 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/easy_xml_test.py +113 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/flock_tool.py +55 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/__init__.py +0 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/analyzer.py +805 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/android.py +1169 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/cmake.py +1316 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/compile_commands_json.py +128 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/dump_dependency_json.py +104 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/eclipse.py +461 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/gypd.py +88 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/gypsh.py +55 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py +2755 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs.py +3970 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs_test.py +44 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja.py +2956 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/ninja_test.py +67 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/xcode.py +1389 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/generator/xcode_test.py +26 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/input.py +3097 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/input_test.py +99 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/mac_tool.py +765 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/msvs_emulation.py +1255 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/ninja_syntax.py +174 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/simple_copy.py +61 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/win_tool.py +371 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py +1936 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation_test.py +54 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/xcode_ninja.py +301 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/xcodeproj_file.py +3180 -0
- package/dist/node_modules/node-gyp/gyp/pylib/gyp/xml_fix.py +64 -0
- package/dist/node_modules/node-gyp/gyp/pylib/packaging/LICENSE +3 -0
- package/dist/node_modules/node-gyp/gyp/pylib/packaging/LICENSE.APACHE +177 -0
- package/dist/node_modules/node-gyp/gyp/pylib/packaging/LICENSE.BSD +23 -0
- package/dist/node_modules/node-gyp/gyp/pylib/packaging/__init__.py +15 -0
- package/dist/node_modules/node-gyp/gyp/pylib/packaging/_elffile.py +107 -0
- package/dist/node_modules/node-gyp/gyp/pylib/packaging/_manylinux.py +252 -0
- package/dist/node_modules/node-gyp/gyp/pylib/packaging/_musllinux.py +83 -0
- package/dist/node_modules/node-gyp/gyp/pylib/packaging/_parser.py +359 -0
- package/dist/node_modules/node-gyp/gyp/pylib/packaging/_structures.py +61 -0
- package/dist/node_modules/node-gyp/gyp/pylib/packaging/_tokenizer.py +192 -0
- package/dist/node_modules/node-gyp/gyp/pylib/packaging/markers.py +251 -0
- package/dist/node_modules/node-gyp/gyp/pylib/packaging/metadata.py +824 -0
- package/dist/node_modules/node-gyp/gyp/pylib/packaging/py.typed +0 -0
- package/dist/node_modules/node-gyp/gyp/pylib/packaging/requirements.py +90 -0
- package/dist/node_modules/node-gyp/gyp/pylib/packaging/specifiers.py +1030 -0
- package/dist/node_modules/node-gyp/gyp/pylib/packaging/tags.py +553 -0
- package/dist/node_modules/node-gyp/gyp/pylib/packaging/utils.py +172 -0
- package/dist/node_modules/node-gyp/gyp/pylib/packaging/version.py +563 -0
- package/dist/node_modules/node-gyp/gyp/pyproject.toml +114 -0
- package/dist/node_modules/node-gyp/gyp/release-please-config.json +11 -0
- package/dist/node_modules/node-gyp/gyp/test_gyp.py +260 -0
- package/dist/node_modules/node-gyp/lib/Find-VisualStudio.cs +250 -0
- package/dist/node_modules/node-gyp/lib/build.js +230 -0
- package/dist/node_modules/node-gyp/lib/clean.js +15 -0
- package/dist/node_modules/node-gyp/lib/configure.js +328 -0
- package/dist/node_modules/node-gyp/lib/create-config-gypi.js +153 -0
- package/dist/node_modules/node-gyp/lib/download.js +39 -0
- package/dist/node_modules/node-gyp/lib/find-node-directory.js +63 -0
- package/dist/node_modules/node-gyp/lib/find-python.js +304 -0
- package/dist/node_modules/node-gyp/lib/find-visualstudio.js +606 -0
- package/dist/node_modules/node-gyp/lib/install.js +411 -0
- package/dist/node_modules/node-gyp/lib/list.js +26 -0
- package/dist/node_modules/node-gyp/lib/log.js +168 -0
- package/dist/node_modules/node-gyp/lib/node-gyp.js +199 -0
- package/dist/node_modules/node-gyp/lib/process-release.js +146 -0
- package/dist/node_modules/node-gyp/lib/rebuild.js +12 -0
- package/dist/node_modules/node-gyp/lib/remove.js +43 -0
- package/dist/node_modules/node-gyp/lib/util.js +81 -0
- package/dist/node_modules/node-gyp/macOS_Catalina_acid_test.sh +21 -0
- package/dist/node_modules/node-gyp/package.json +52 -0
- package/dist/node_modules/node-gyp/release-please-config.json +40 -0
- package/dist/node_modules/node-gyp/src/win_delay_load_hook.cc +41 -0
- package/dist/node_modules/nopt/LICENSE +15 -0
- package/dist/node_modules/nopt/bin/nopt.js +29 -0
- package/dist/node_modules/nopt/lib/debug.js +5 -0
- package/dist/node_modules/nopt/lib/nopt-lib.js +514 -0
- package/dist/node_modules/nopt/lib/nopt.js +34 -0
- package/dist/node_modules/nopt/lib/type-defs.js +91 -0
- package/dist/node_modules/nopt/package.json +52 -0
- package/dist/node_modules/p-map/index.js +283 -0
- package/dist/node_modules/p-map/license +9 -0
- package/dist/node_modules/p-map/package.json +57 -0
- package/dist/node_modules/path-scurry/dist/commonjs/index.js +2018 -0
- package/dist/node_modules/path-scurry/dist/commonjs/package.json +3 -0
- package/dist/node_modules/path-scurry/dist/esm/index.js +1983 -0
- package/dist/node_modules/path-scurry/dist/esm/package.json +3 -0
- package/dist/node_modules/path-scurry/package.json +72 -0
- package/dist/node_modules/picomatch/LICENSE +21 -0
- package/dist/node_modules/picomatch/index.js +17 -0
- package/dist/node_modules/picomatch/lib/constants.js +184 -0
- package/dist/node_modules/picomatch/lib/parse.js +1386 -0
- package/dist/node_modules/picomatch/lib/picomatch.js +349 -0
- package/dist/node_modules/picomatch/lib/scan.js +391 -0
- package/dist/node_modules/picomatch/lib/utils.js +72 -0
- package/dist/node_modules/picomatch/package.json +82 -0
- package/dist/node_modules/picomatch/posix.js +3 -0
- package/dist/node_modules/proc-log/LICENSE +15 -0
- package/dist/node_modules/proc-log/lib/index.js +158 -0
- package/dist/node_modules/proc-log/package.json +46 -0
- package/dist/node_modules/safer-buffer/LICENSE +21 -0
- package/dist/node_modules/safer-buffer/dangerous.js +58 -0
- package/dist/node_modules/safer-buffer/package.json +34 -0
- package/dist/node_modules/safer-buffer/safer.js +77 -0
- package/dist/node_modules/safer-buffer/tests.js +406 -0
- package/dist/node_modules/semver/LICENSE +15 -0
- package/dist/node_modules/semver/bin/semver.js +191 -0
- package/dist/node_modules/semver/classes/comparator.js +143 -0
- package/dist/node_modules/semver/classes/index.js +7 -0
- package/dist/node_modules/semver/classes/range.js +557 -0
- package/dist/node_modules/semver/classes/semver.js +333 -0
- package/dist/node_modules/semver/functions/clean.js +8 -0
- package/dist/node_modules/semver/functions/cmp.js +54 -0
- package/dist/node_modules/semver/functions/coerce.js +62 -0
- package/dist/node_modules/semver/functions/compare-build.js +9 -0
- package/dist/node_modules/semver/functions/compare-loose.js +5 -0
- package/dist/node_modules/semver/functions/compare.js +7 -0
- package/dist/node_modules/semver/functions/diff.js +60 -0
- package/dist/node_modules/semver/functions/eq.js +5 -0
- package/dist/node_modules/semver/functions/gt.js +5 -0
- package/dist/node_modules/semver/functions/gte.js +5 -0
- package/dist/node_modules/semver/functions/inc.js +21 -0
- package/dist/node_modules/semver/functions/lt.js +5 -0
- package/dist/node_modules/semver/functions/lte.js +5 -0
- package/dist/node_modules/semver/functions/major.js +5 -0
- package/dist/node_modules/semver/functions/minor.js +5 -0
- package/dist/node_modules/semver/functions/neq.js +5 -0
- package/dist/node_modules/semver/functions/parse.js +18 -0
- package/dist/node_modules/semver/functions/patch.js +5 -0
- package/dist/node_modules/semver/functions/prerelease.js +8 -0
- package/dist/node_modules/semver/functions/rcompare.js +5 -0
- package/dist/node_modules/semver/functions/rsort.js +5 -0
- package/dist/node_modules/semver/functions/satisfies.js +12 -0
- package/dist/node_modules/semver/functions/sort.js +5 -0
- package/dist/node_modules/semver/functions/valid.js +8 -0
- package/dist/node_modules/semver/index.js +91 -0
- package/dist/node_modules/semver/internal/constants.js +37 -0
- package/dist/node_modules/semver/internal/debug.js +11 -0
- package/dist/node_modules/semver/internal/identifiers.js +29 -0
- package/dist/node_modules/semver/internal/lrucache.js +42 -0
- package/dist/node_modules/semver/internal/parse-options.js +17 -0
- package/dist/node_modules/semver/internal/re.js +223 -0
- package/dist/node_modules/semver/package.json +78 -0
- package/dist/node_modules/semver/preload.js +4 -0
- package/dist/node_modules/semver/range.bnf +16 -0
- package/dist/node_modules/semver/ranges/gtr.js +6 -0
- package/dist/node_modules/semver/ranges/intersects.js +9 -0
- package/dist/node_modules/semver/ranges/ltr.js +6 -0
- package/dist/node_modules/semver/ranges/max-satisfying.js +27 -0
- package/dist/node_modules/semver/ranges/min-satisfying.js +26 -0
- package/dist/node_modules/semver/ranges/min-version.js +63 -0
- package/dist/node_modules/semver/ranges/outside.js +82 -0
- package/dist/node_modules/semver/ranges/simplify.js +49 -0
- package/dist/node_modules/semver/ranges/subset.js +249 -0
- package/dist/node_modules/semver/ranges/to-comparators.js +10 -0
- package/dist/node_modules/semver/ranges/valid.js +13 -0
- package/dist/node_modules/smart-buffer/.prettierrc.yaml +5 -0
- package/dist/node_modules/smart-buffer/LICENSE +20 -0
- package/dist/node_modules/smart-buffer/build/smartbuffer.js +1233 -0
- package/dist/node_modules/smart-buffer/build/utils.js +108 -0
- package/dist/node_modules/smart-buffer/package.json +79 -0
- package/dist/node_modules/socks/.eslintrc.cjs +11 -0
- package/dist/node_modules/socks/.prettierrc.yaml +7 -0
- package/dist/node_modules/socks/LICENSE +20 -0
- package/dist/node_modules/socks/build/client/socksclient.js +793 -0
- package/dist/node_modules/socks/build/common/constants.js +108 -0
- package/dist/node_modules/socks/build/common/helpers.js +167 -0
- package/dist/node_modules/socks/build/common/receivebuffer.js +43 -0
- package/dist/node_modules/socks/build/common/util.js +25 -0
- package/dist/node_modules/socks/build/index.js +18 -0
- package/dist/node_modules/socks/package.json +58 -0
- package/dist/node_modules/socks-proxy-agent/LICENSE +22 -0
- package/dist/node_modules/socks-proxy-agent/dist/index.js +195 -0
- package/dist/node_modules/socks-proxy-agent/package.json +142 -0
- package/dist/node_modules/ssri/lib/index.js +550 -0
- package/dist/node_modules/ssri/package.json +66 -0
- package/dist/node_modules/tar/dist/commonjs/create.js +82 -0
- package/dist/node_modules/tar/dist/commonjs/cwd-error.js +18 -0
- package/dist/node_modules/tar/dist/commonjs/extract.js +88 -0
- package/dist/node_modules/tar/dist/commonjs/get-write-flag.js +32 -0
- package/dist/node_modules/tar/dist/commonjs/header.js +312 -0
- package/dist/node_modules/tar/dist/commonjs/index.js +64 -0
- package/dist/node_modules/tar/dist/commonjs/index.min.js +4 -0
- package/dist/node_modules/tar/dist/commonjs/large-numbers.js +99 -0
- package/dist/node_modules/tar/dist/commonjs/list.js +145 -0
- package/dist/node_modules/tar/dist/commonjs/make-command.js +52 -0
- package/dist/node_modules/tar/dist/commonjs/mkdir.js +187 -0
- package/dist/node_modules/tar/dist/commonjs/mode-fix.js +29 -0
- package/dist/node_modules/tar/dist/commonjs/normalize-unicode.js +38 -0
- package/dist/node_modules/tar/dist/commonjs/normalize-windows-path.js +12 -0
- package/dist/node_modules/tar/dist/commonjs/options.js +66 -0
- package/dist/node_modules/tar/dist/commonjs/pack.js +511 -0
- package/dist/node_modules/tar/dist/commonjs/package.json +3 -0
- package/dist/node_modules/tar/dist/commonjs/parse.js +610 -0
- package/dist/node_modules/tar/dist/commonjs/path-reservations.js +170 -0
- package/dist/node_modules/tar/dist/commonjs/pax.js +158 -0
- package/dist/node_modules/tar/dist/commonjs/process-umask.js +7 -0
- package/dist/node_modules/tar/dist/commonjs/read-entry.js +136 -0
- package/dist/node_modules/tar/dist/commonjs/replace.js +227 -0
- package/dist/node_modules/tar/dist/commonjs/strip-absolute-path.js +29 -0
- package/dist/node_modules/tar/dist/commonjs/strip-trailing-slashes.js +18 -0
- package/dist/node_modules/tar/dist/commonjs/symlink-error.js +19 -0
- package/dist/node_modules/tar/dist/commonjs/types.js +50 -0
- package/dist/node_modules/tar/dist/commonjs/unpack.js +932 -0
- package/dist/node_modules/tar/dist/commonjs/update.js +33 -0
- package/dist/node_modules/tar/dist/commonjs/warn-method.js +31 -0
- package/dist/node_modules/tar/dist/commonjs/winchars.js +14 -0
- package/dist/node_modules/tar/dist/commonjs/write-entry.js +698 -0
- package/dist/node_modules/tar/dist/esm/create.js +76 -0
- package/dist/node_modules/tar/dist/esm/cwd-error.js +14 -0
- package/dist/node_modules/tar/dist/esm/extract.js +49 -0
- package/dist/node_modules/tar/dist/esm/get-write-flag.js +26 -0
- package/dist/node_modules/tar/dist/esm/header.js +275 -0
- package/dist/node_modules/tar/dist/esm/index.js +20 -0
- package/dist/node_modules/tar/dist/esm/index.min.js +4 -0
- package/dist/node_modules/tar/dist/esm/large-numbers.js +94 -0
- package/dist/node_modules/tar/dist/esm/list.js +105 -0
- package/dist/node_modules/tar/dist/esm/make-command.js +48 -0
- package/dist/node_modules/tar/dist/esm/mkdir.js +179 -0
- package/dist/node_modules/tar/dist/esm/mode-fix.js +25 -0
- package/dist/node_modules/tar/dist/esm/normalize-unicode.js +34 -0
- package/dist/node_modules/tar/dist/esm/normalize-windows-path.js +9 -0
- package/dist/node_modules/tar/dist/esm/options.js +54 -0
- package/dist/node_modules/tar/dist/esm/pack.js +469 -0
- package/dist/node_modules/tar/dist/esm/package.json +3 -0
- package/dist/node_modules/tar/dist/esm/parse.js +606 -0
- package/dist/node_modules/tar/dist/esm/path-reservations.js +166 -0
- package/dist/node_modules/tar/dist/esm/pax.js +154 -0
- package/dist/node_modules/tar/dist/esm/process-umask.js +3 -0
- package/dist/node_modules/tar/dist/esm/read-entry.js +132 -0
- package/dist/node_modules/tar/dist/esm/replace.js +221 -0
- package/dist/node_modules/tar/dist/esm/strip-absolute-path.js +25 -0
- package/dist/node_modules/tar/dist/esm/strip-trailing-slashes.js +14 -0
- package/dist/node_modules/tar/dist/esm/symlink-error.js +15 -0
- package/dist/node_modules/tar/dist/esm/types.js +45 -0
- package/dist/node_modules/tar/dist/esm/unpack.js +891 -0
- package/dist/node_modules/tar/dist/esm/update.js +30 -0
- package/dist/node_modules/tar/dist/esm/warn-method.js +27 -0
- package/dist/node_modules/tar/dist/esm/winchars.js +9 -0
- package/dist/node_modules/tar/dist/esm/write-entry.js +656 -0
- package/dist/node_modules/tar/node_modules/yallist/dist/commonjs/index.js +384 -0
- package/dist/node_modules/tar/node_modules/yallist/dist/commonjs/package.json +3 -0
- package/dist/node_modules/tar/node_modules/yallist/dist/esm/index.js +379 -0
- package/dist/node_modules/tar/node_modules/yallist/dist/esm/package.json +3 -0
- package/dist/node_modules/tar/node_modules/yallist/package.json +68 -0
- package/dist/node_modules/tar/package.json +297 -0
- package/dist/node_modules/tinyglobby/LICENSE +21 -0
- package/dist/node_modules/tinyglobby/dist/index.cjs +350 -0
- package/dist/node_modules/tinyglobby/dist/index.d.cts +147 -0
- package/dist/node_modules/tinyglobby/dist/index.d.mts +147 -0
- package/dist/node_modules/tinyglobby/dist/index.mjs +318 -0
- package/dist/node_modules/tinyglobby/package.json +73 -0
- package/{LICENSE → dist/node_modules/v8-compile-cache/LICENSE} +1 -2
- package/dist/node_modules/v8-compile-cache/package.json +34 -0
- package/dist/node_modules/v8-compile-cache/v8-compile-cache.js +373 -0
- package/dist/node_modules/which/LICENSE +15 -0
- package/dist/node_modules/which/bin/which.js +52 -0
- package/dist/node_modules/which/lib/index.js +111 -0
- package/dist/node_modules/which/package.json +52 -0
- package/dist/node_modules/yallist/LICENSE +15 -0
- package/dist/node_modules/yallist/iterator.js +8 -0
- package/dist/node_modules/yallist/package.json +29 -0
- package/dist/node_modules/yallist/yallist.js +426 -0
- package/dist/pnpm.mjs +266382 -0
- package/dist/pnpmrc +2 -0
- package/dist/templates/completion.bash +31 -0
- package/dist/templates/completion.fish +22 -0
- package/dist/templates/completion.ps1 +193 -0
- package/dist/templates/completion.zsh +27 -0
- package/dist/vendor/fastlist-0.3.0-x64.exe +0 -0
- package/dist/vendor/fastlist-0.3.0-x86.exe +0 -0
- package/dist/worker.js +10958 -0
- package/package.json +34 -12
- package/pn +2 -0
- package/pn.cmd +2 -0
- package/pn.ps1 +1 -0
- package/pnpx +2 -0
- package/pnpx.cmd +2 -0
- package/pnpx.ps1 +1 -0
- package/pnx +2 -0
- package/pnx.cmd +2 -0
- package/pnx.ps1 +1 -0
- package/prepare.js +26 -3
- package/setup.js +22 -11
- package/CHANGELOG.md +0 -15
|
@@ -0,0 +1,376 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
const { URL } = require('url')
|
|
3
|
+
const http = require('http')
|
|
4
|
+
const https = require('https')
|
|
5
|
+
const zlib = require('minizlib')
|
|
6
|
+
const { Minipass } = require('minipass')
|
|
7
|
+
|
|
8
|
+
const Body = require('./body.js')
|
|
9
|
+
const { writeToStream, getTotalBytes } = Body
|
|
10
|
+
const Response = require('./response.js')
|
|
11
|
+
const Headers = require('./headers.js')
|
|
12
|
+
const { createHeadersLenient } = Headers
|
|
13
|
+
const Request = require('./request.js')
|
|
14
|
+
const { getNodeRequestOptions } = Request
|
|
15
|
+
const FetchError = require('./fetch-error.js')
|
|
16
|
+
const AbortError = require('./abort-error.js')
|
|
17
|
+
|
|
18
|
+
// XXX this should really be split up and unit-ized for easier testing
|
|
19
|
+
// and better DRY implementation of data/http request aborting
|
|
20
|
+
const fetch = async (url, opts) => {
|
|
21
|
+
if (/^data:/.test(url)) {
|
|
22
|
+
const request = new Request(url, opts)
|
|
23
|
+
// delay 1 promise tick so that the consumer can abort right away
|
|
24
|
+
return Promise.resolve().then(() => new Promise((resolve, reject) => {
|
|
25
|
+
let type, data
|
|
26
|
+
try {
|
|
27
|
+
const { pathname, search } = new URL(url)
|
|
28
|
+
const split = pathname.split(',')
|
|
29
|
+
if (split.length < 2) {
|
|
30
|
+
throw new Error('invalid data: URI')
|
|
31
|
+
}
|
|
32
|
+
const mime = split.shift()
|
|
33
|
+
const base64 = /;base64$/.test(mime)
|
|
34
|
+
type = base64 ? mime.slice(0, -1 * ';base64'.length) : mime
|
|
35
|
+
const rawData = decodeURIComponent(split.join(',') + search)
|
|
36
|
+
data = base64 ? Buffer.from(rawData, 'base64') : Buffer.from(rawData)
|
|
37
|
+
} catch (er) {
|
|
38
|
+
return reject(new FetchError(`[${request.method}] ${
|
|
39
|
+
request.url} invalid URL, ${er.message}`, 'system', er))
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const { signal } = request
|
|
43
|
+
if (signal && signal.aborted) {
|
|
44
|
+
return reject(new AbortError('The user aborted a request.'))
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
const headers = { 'Content-Length': data.length }
|
|
48
|
+
if (type) {
|
|
49
|
+
headers['Content-Type'] = type
|
|
50
|
+
}
|
|
51
|
+
return resolve(new Response(data, { headers }))
|
|
52
|
+
}))
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
return new Promise((resolve, reject) => {
|
|
56
|
+
// build request object
|
|
57
|
+
const request = new Request(url, opts)
|
|
58
|
+
let options
|
|
59
|
+
try {
|
|
60
|
+
options = getNodeRequestOptions(request)
|
|
61
|
+
} catch (er) {
|
|
62
|
+
return reject(er)
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
const send = (options.protocol === 'https:' ? https : http).request
|
|
66
|
+
const { signal } = request
|
|
67
|
+
let response = null
|
|
68
|
+
const abort = () => {
|
|
69
|
+
const error = new AbortError('The user aborted a request.')
|
|
70
|
+
reject(error)
|
|
71
|
+
if (Minipass.isStream(request.body) &&
|
|
72
|
+
typeof request.body.destroy === 'function') {
|
|
73
|
+
request.body.destroy(error)
|
|
74
|
+
}
|
|
75
|
+
if (response && response.body) {
|
|
76
|
+
response.body.emit('error', error)
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
if (signal && signal.aborted) {
|
|
81
|
+
return abort()
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
const abortAndFinalize = () => {
|
|
85
|
+
abort()
|
|
86
|
+
finalize()
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
const finalize = () => {
|
|
90
|
+
req.abort()
|
|
91
|
+
if (signal) {
|
|
92
|
+
signal.removeEventListener('abort', abortAndFinalize)
|
|
93
|
+
}
|
|
94
|
+
clearTimeout(reqTimeout)
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
// send request
|
|
98
|
+
const req = send(options)
|
|
99
|
+
|
|
100
|
+
if (signal) {
|
|
101
|
+
signal.addEventListener('abort', abortAndFinalize)
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
let reqTimeout = null
|
|
105
|
+
if (request.timeout) {
|
|
106
|
+
req.once('socket', () => {
|
|
107
|
+
reqTimeout = setTimeout(() => {
|
|
108
|
+
reject(new FetchError(`network timeout at: ${
|
|
109
|
+
request.url}`, 'request-timeout'))
|
|
110
|
+
finalize()
|
|
111
|
+
}, request.timeout)
|
|
112
|
+
})
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
req.on('error', er => {
|
|
116
|
+
// if a 'response' event is emitted before the 'error' event, then by the
|
|
117
|
+
// time this handler is run it's too late to reject the Promise for the
|
|
118
|
+
// response. instead, we forward the error event to the response stream
|
|
119
|
+
// so that the error will surface to the user when they try to consume
|
|
120
|
+
// the body. this is done as a side effect of aborting the request except
|
|
121
|
+
// for in windows, where we must forward the event manually, otherwise
|
|
122
|
+
// there is no longer a ref'd socket attached to the request and the
|
|
123
|
+
// stream never ends so the event loop runs out of work and the process
|
|
124
|
+
// exits without warning.
|
|
125
|
+
// coverage skipped here due to the difficulty in testing
|
|
126
|
+
// istanbul ignore next
|
|
127
|
+
if (req.res) {
|
|
128
|
+
req.res.emit('error', er)
|
|
129
|
+
}
|
|
130
|
+
reject(new FetchError(`request to ${request.url} failed, reason: ${
|
|
131
|
+
er.message}`, 'system', er))
|
|
132
|
+
finalize()
|
|
133
|
+
})
|
|
134
|
+
|
|
135
|
+
req.on('response', res => {
|
|
136
|
+
clearTimeout(reqTimeout)
|
|
137
|
+
|
|
138
|
+
const headers = createHeadersLenient(res.headers)
|
|
139
|
+
|
|
140
|
+
// HTTP fetch step 5
|
|
141
|
+
if (fetch.isRedirect(res.statusCode)) {
|
|
142
|
+
// HTTP fetch step 5.2
|
|
143
|
+
const location = headers.get('Location')
|
|
144
|
+
|
|
145
|
+
// HTTP fetch step 5.3
|
|
146
|
+
let locationURL = null
|
|
147
|
+
try {
|
|
148
|
+
locationURL = location === null ? null : new URL(location, request.url).toString()
|
|
149
|
+
} catch {
|
|
150
|
+
// error here can only be invalid URL in Location: header
|
|
151
|
+
// do not throw when options.redirect == manual
|
|
152
|
+
// let the user extract the errorneous redirect URL
|
|
153
|
+
if (request.redirect !== 'manual') {
|
|
154
|
+
/* eslint-disable-next-line max-len */
|
|
155
|
+
reject(new FetchError(`uri requested responds with an invalid redirect URL: ${location}`, 'invalid-redirect'))
|
|
156
|
+
finalize()
|
|
157
|
+
return
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
// HTTP fetch step 5.5
|
|
162
|
+
if (request.redirect === 'error') {
|
|
163
|
+
reject(new FetchError('uri requested responds with a redirect, ' +
|
|
164
|
+
`redirect mode is set to error: ${request.url}`, 'no-redirect'))
|
|
165
|
+
finalize()
|
|
166
|
+
return
|
|
167
|
+
} else if (request.redirect === 'manual') {
|
|
168
|
+
// node-fetch-specific step: make manual redirect a bit easier to
|
|
169
|
+
// use by setting the Location header value to the resolved URL.
|
|
170
|
+
if (locationURL !== null) {
|
|
171
|
+
// handle corrupted header
|
|
172
|
+
try {
|
|
173
|
+
headers.set('Location', locationURL)
|
|
174
|
+
} catch (err) {
|
|
175
|
+
/* istanbul ignore next: nodejs server prevent invalid
|
|
176
|
+
response headers, we can't test this through normal
|
|
177
|
+
request */
|
|
178
|
+
reject(err)
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
} else if (request.redirect === 'follow' && locationURL !== null) {
|
|
182
|
+
// HTTP-redirect fetch step 5
|
|
183
|
+
if (request.counter >= request.follow) {
|
|
184
|
+
reject(new FetchError(`maximum redirect reached at: ${
|
|
185
|
+
request.url}`, 'max-redirect'))
|
|
186
|
+
finalize()
|
|
187
|
+
return
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
// HTTP-redirect fetch step 9
|
|
191
|
+
if (res.statusCode !== 303 &&
|
|
192
|
+
request.body &&
|
|
193
|
+
getTotalBytes(request) === null) {
|
|
194
|
+
reject(new FetchError(
|
|
195
|
+
'Cannot follow redirect with body being a readable stream',
|
|
196
|
+
'unsupported-redirect'
|
|
197
|
+
))
|
|
198
|
+
finalize()
|
|
199
|
+
return
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
// Update host due to redirection
|
|
203
|
+
request.headers.set('host', (new URL(locationURL)).host)
|
|
204
|
+
|
|
205
|
+
// HTTP-redirect fetch step 6 (counter increment)
|
|
206
|
+
// Create a new Request object.
|
|
207
|
+
const requestOpts = {
|
|
208
|
+
headers: new Headers(request.headers),
|
|
209
|
+
follow: request.follow,
|
|
210
|
+
counter: request.counter + 1,
|
|
211
|
+
agent: request.agent,
|
|
212
|
+
compress: request.compress,
|
|
213
|
+
method: request.method,
|
|
214
|
+
body: request.body,
|
|
215
|
+
signal: request.signal,
|
|
216
|
+
timeout: request.timeout,
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
// if the redirect is to a new hostname, strip the authorization and cookie headers
|
|
220
|
+
const parsedOriginal = new URL(request.url)
|
|
221
|
+
const parsedRedirect = new URL(locationURL)
|
|
222
|
+
if (parsedOriginal.hostname !== parsedRedirect.hostname) {
|
|
223
|
+
requestOpts.headers.delete('authorization')
|
|
224
|
+
requestOpts.headers.delete('cookie')
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
// HTTP-redirect fetch step 11
|
|
228
|
+
if (res.statusCode === 303 || (
|
|
229
|
+
(res.statusCode === 301 || res.statusCode === 302) &&
|
|
230
|
+
request.method === 'POST'
|
|
231
|
+
)) {
|
|
232
|
+
requestOpts.method = 'GET'
|
|
233
|
+
requestOpts.body = undefined
|
|
234
|
+
requestOpts.headers.delete('content-length')
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
// HTTP-redirect fetch step 15
|
|
238
|
+
resolve(fetch(new Request(locationURL, requestOpts)))
|
|
239
|
+
finalize()
|
|
240
|
+
return
|
|
241
|
+
}
|
|
242
|
+
} // end if(isRedirect)
|
|
243
|
+
|
|
244
|
+
// prepare response
|
|
245
|
+
res.once('end', () =>
|
|
246
|
+
signal && signal.removeEventListener('abort', abortAndFinalize))
|
|
247
|
+
|
|
248
|
+
const body = new Minipass()
|
|
249
|
+
// if an error occurs, either on the response stream itself, on one of the
|
|
250
|
+
// decoder streams, or a response length timeout from the Body class, we
|
|
251
|
+
// forward the error through to our internal body stream. If we see an
|
|
252
|
+
// error event on that, we call finalize to abort the request and ensure
|
|
253
|
+
// we don't leave a socket believing a request is in flight.
|
|
254
|
+
// this is difficult to test, so lacks specific coverage.
|
|
255
|
+
body.on('error', finalize)
|
|
256
|
+
// exceedingly rare that the stream would have an error,
|
|
257
|
+
// but just in case we proxy it to the stream in use.
|
|
258
|
+
res.on('error', /* istanbul ignore next */ er => body.emit('error', er))
|
|
259
|
+
res.on('data', (chunk) => body.write(chunk))
|
|
260
|
+
res.on('end', () => body.end())
|
|
261
|
+
|
|
262
|
+
const responseOptions = {
|
|
263
|
+
url: request.url,
|
|
264
|
+
status: res.statusCode,
|
|
265
|
+
statusText: res.statusMessage,
|
|
266
|
+
headers: headers,
|
|
267
|
+
size: request.size,
|
|
268
|
+
timeout: request.timeout,
|
|
269
|
+
counter: request.counter,
|
|
270
|
+
trailer: new Promise(resolveTrailer =>
|
|
271
|
+
res.on('end', () => resolveTrailer(createHeadersLenient(res.trailers)))),
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
// HTTP-network fetch step 12.1.1.3
|
|
275
|
+
const codings = headers.get('Content-Encoding')
|
|
276
|
+
|
|
277
|
+
// HTTP-network fetch step 12.1.1.4: handle content codings
|
|
278
|
+
|
|
279
|
+
// in following scenarios we ignore compression support
|
|
280
|
+
// 1. compression support is disabled
|
|
281
|
+
// 2. HEAD request
|
|
282
|
+
// 3. no Content-Encoding header
|
|
283
|
+
// 4. no content response (204)
|
|
284
|
+
// 5. content not modified response (304)
|
|
285
|
+
if (!request.compress ||
|
|
286
|
+
request.method === 'HEAD' ||
|
|
287
|
+
codings === null ||
|
|
288
|
+
res.statusCode === 204 ||
|
|
289
|
+
res.statusCode === 304) {
|
|
290
|
+
response = new Response(body, responseOptions)
|
|
291
|
+
resolve(response)
|
|
292
|
+
return
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
// Be less strict when decoding compressed responses, since sometimes
|
|
296
|
+
// servers send slightly invalid responses that are still accepted
|
|
297
|
+
// by common browsers.
|
|
298
|
+
// Always using Z_SYNC_FLUSH is what cURL does.
|
|
299
|
+
const zlibOptions = {
|
|
300
|
+
flush: zlib.constants.Z_SYNC_FLUSH,
|
|
301
|
+
finishFlush: zlib.constants.Z_SYNC_FLUSH,
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
// for gzip
|
|
305
|
+
if (codings === 'gzip' || codings === 'x-gzip') {
|
|
306
|
+
const unzip = new zlib.Gunzip(zlibOptions)
|
|
307
|
+
response = new Response(
|
|
308
|
+
// exceedingly rare that the stream would have an error,
|
|
309
|
+
// but just in case we proxy it to the stream in use.
|
|
310
|
+
body.on('error', /* istanbul ignore next */ er => unzip.emit('error', er)).pipe(unzip),
|
|
311
|
+
responseOptions
|
|
312
|
+
)
|
|
313
|
+
resolve(response)
|
|
314
|
+
return
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
// for deflate
|
|
318
|
+
if (codings === 'deflate' || codings === 'x-deflate') {
|
|
319
|
+
// handle the infamous raw deflate response from old servers
|
|
320
|
+
// a hack for old IIS and Apache servers
|
|
321
|
+
res.once('data', chunk => {
|
|
322
|
+
// see http://stackoverflow.com/questions/37519828
|
|
323
|
+
const decoder = (chunk[0] & 0x0F) === 0x08
|
|
324
|
+
? new zlib.Inflate()
|
|
325
|
+
: new zlib.InflateRaw()
|
|
326
|
+
// exceedingly rare that the stream would have an error,
|
|
327
|
+
// but just in case we proxy it to the stream in use.
|
|
328
|
+
body.on('error', /* istanbul ignore next */ er => decoder.emit('error', er)).pipe(decoder)
|
|
329
|
+
response = new Response(decoder, responseOptions)
|
|
330
|
+
resolve(response)
|
|
331
|
+
})
|
|
332
|
+
return
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
// for br
|
|
336
|
+
if (codings === 'br') {
|
|
337
|
+
// ignoring coverage so tests don't have to fake support (or lack of) for brotli
|
|
338
|
+
// istanbul ignore next
|
|
339
|
+
try {
|
|
340
|
+
var decoder = new zlib.BrotliDecompress()
|
|
341
|
+
} catch (err) {
|
|
342
|
+
reject(err)
|
|
343
|
+
finalize()
|
|
344
|
+
return
|
|
345
|
+
}
|
|
346
|
+
// exceedingly rare that the stream would have an error,
|
|
347
|
+
// but just in case we proxy it to the stream in use.
|
|
348
|
+
body.on('error', /* istanbul ignore next */ er => decoder.emit('error', er)).pipe(decoder)
|
|
349
|
+
response = new Response(decoder, responseOptions)
|
|
350
|
+
resolve(response)
|
|
351
|
+
return
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
// otherwise, use response as-is
|
|
355
|
+
response = new Response(body, responseOptions)
|
|
356
|
+
resolve(response)
|
|
357
|
+
})
|
|
358
|
+
|
|
359
|
+
writeToStream(req, request)
|
|
360
|
+
})
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
module.exports = fetch
|
|
364
|
+
|
|
365
|
+
fetch.isRedirect = code =>
|
|
366
|
+
code === 301 ||
|
|
367
|
+
code === 302 ||
|
|
368
|
+
code === 303 ||
|
|
369
|
+
code === 307 ||
|
|
370
|
+
code === 308
|
|
371
|
+
|
|
372
|
+
fetch.Headers = Headers
|
|
373
|
+
fetch.Request = Request
|
|
374
|
+
fetch.Response = Response
|
|
375
|
+
fetch.FetchError = FetchError
|
|
376
|
+
fetch.AbortError = AbortError
|
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
'use strict'
|
|
2
|
+
const { URL } = require('url')
|
|
3
|
+
const { Minipass } = require('minipass')
|
|
4
|
+
const Headers = require('./headers.js')
|
|
5
|
+
const { exportNodeCompatibleHeaders } = Headers
|
|
6
|
+
const Body = require('./body.js')
|
|
7
|
+
const { clone, extractContentType, getTotalBytes } = Body
|
|
8
|
+
|
|
9
|
+
const version = require('../package.json').version
|
|
10
|
+
const defaultUserAgent =
|
|
11
|
+
`minipass-fetch/${version} (+https://github.com/isaacs/minipass-fetch)`
|
|
12
|
+
|
|
13
|
+
const INTERNALS = Symbol('Request internals')
|
|
14
|
+
|
|
15
|
+
const isRequest = input =>
|
|
16
|
+
typeof input === 'object' && typeof input[INTERNALS] === 'object'
|
|
17
|
+
|
|
18
|
+
const isAbortSignal = signal => {
|
|
19
|
+
const proto = (
|
|
20
|
+
signal
|
|
21
|
+
&& typeof signal === 'object'
|
|
22
|
+
&& Object.getPrototypeOf(signal)
|
|
23
|
+
)
|
|
24
|
+
return !!(proto && proto.constructor.name === 'AbortSignal')
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
class Request extends Body {
|
|
28
|
+
constructor (input, init = {}) {
|
|
29
|
+
const parsedURL = isRequest(input) ? new URL(input.url)
|
|
30
|
+
: input && input.href ? new URL(input.href)
|
|
31
|
+
: new URL(`${input}`)
|
|
32
|
+
|
|
33
|
+
if (isRequest(input)) {
|
|
34
|
+
init = { ...input[INTERNALS], ...init }
|
|
35
|
+
} else if (!input || typeof input === 'string') {
|
|
36
|
+
input = {}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
const method = (init.method || input.method || 'GET').toUpperCase()
|
|
40
|
+
const isGETHEAD = method === 'GET' || method === 'HEAD'
|
|
41
|
+
|
|
42
|
+
if ((init.body !== null && init.body !== undefined ||
|
|
43
|
+
isRequest(input) && input.body !== null) && isGETHEAD) {
|
|
44
|
+
throw new TypeError('Request with GET/HEAD method cannot have body')
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
const inputBody = init.body !== null && init.body !== undefined ? init.body
|
|
48
|
+
: isRequest(input) && input.body !== null ? clone(input)
|
|
49
|
+
: null
|
|
50
|
+
|
|
51
|
+
super(inputBody, {
|
|
52
|
+
timeout: init.timeout || input.timeout || 0,
|
|
53
|
+
size: init.size || input.size || 0,
|
|
54
|
+
})
|
|
55
|
+
|
|
56
|
+
const headers = new Headers(init.headers || input.headers || {})
|
|
57
|
+
|
|
58
|
+
if (inputBody !== null && inputBody !== undefined &&
|
|
59
|
+
!headers.has('Content-Type')) {
|
|
60
|
+
const contentType = extractContentType(inputBody)
|
|
61
|
+
if (contentType) {
|
|
62
|
+
headers.append('Content-Type', contentType)
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
const signal = 'signal' in init ? init.signal
|
|
67
|
+
: null
|
|
68
|
+
|
|
69
|
+
if (signal !== null && signal !== undefined && !isAbortSignal(signal)) {
|
|
70
|
+
throw new TypeError('Expected signal must be an instanceof AbortSignal')
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
// TLS specific options that are handled by node
|
|
74
|
+
const {
|
|
75
|
+
ca,
|
|
76
|
+
cert,
|
|
77
|
+
ciphers,
|
|
78
|
+
clientCertEngine,
|
|
79
|
+
crl,
|
|
80
|
+
dhparam,
|
|
81
|
+
ecdhCurve,
|
|
82
|
+
family,
|
|
83
|
+
honorCipherOrder,
|
|
84
|
+
key,
|
|
85
|
+
passphrase,
|
|
86
|
+
pfx,
|
|
87
|
+
rejectUnauthorized = process.env.NODE_TLS_REJECT_UNAUTHORIZED !== '0',
|
|
88
|
+
secureOptions,
|
|
89
|
+
secureProtocol,
|
|
90
|
+
servername,
|
|
91
|
+
sessionIdContext,
|
|
92
|
+
} = init
|
|
93
|
+
|
|
94
|
+
this[INTERNALS] = {
|
|
95
|
+
method,
|
|
96
|
+
redirect: init.redirect || input.redirect || 'follow',
|
|
97
|
+
headers,
|
|
98
|
+
parsedURL,
|
|
99
|
+
signal,
|
|
100
|
+
ca,
|
|
101
|
+
cert,
|
|
102
|
+
ciphers,
|
|
103
|
+
clientCertEngine,
|
|
104
|
+
crl,
|
|
105
|
+
dhparam,
|
|
106
|
+
ecdhCurve,
|
|
107
|
+
family,
|
|
108
|
+
honorCipherOrder,
|
|
109
|
+
key,
|
|
110
|
+
passphrase,
|
|
111
|
+
pfx,
|
|
112
|
+
rejectUnauthorized,
|
|
113
|
+
secureOptions,
|
|
114
|
+
secureProtocol,
|
|
115
|
+
servername,
|
|
116
|
+
sessionIdContext,
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
// node-fetch-only options
|
|
120
|
+
this.follow = init.follow !== undefined ? init.follow
|
|
121
|
+
: input.follow !== undefined ? input.follow
|
|
122
|
+
: 20
|
|
123
|
+
this.compress = init.compress !== undefined ? init.compress
|
|
124
|
+
: input.compress !== undefined ? input.compress
|
|
125
|
+
: true
|
|
126
|
+
this.counter = init.counter || input.counter || 0
|
|
127
|
+
this.agent = init.agent || input.agent
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
get method () {
|
|
131
|
+
return this[INTERNALS].method
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
get url () {
|
|
135
|
+
return this[INTERNALS].parsedURL.toString()
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
get headers () {
|
|
139
|
+
return this[INTERNALS].headers
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
get redirect () {
|
|
143
|
+
return this[INTERNALS].redirect
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
get signal () {
|
|
147
|
+
return this[INTERNALS].signal
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
clone () {
|
|
151
|
+
return new Request(this)
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
get [Symbol.toStringTag] () {
|
|
155
|
+
return 'Request'
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
static getNodeRequestOptions (request) {
|
|
159
|
+
const parsedURL = request[INTERNALS].parsedURL
|
|
160
|
+
const headers = new Headers(request[INTERNALS].headers)
|
|
161
|
+
|
|
162
|
+
// fetch step 1.3
|
|
163
|
+
if (!headers.has('Accept')) {
|
|
164
|
+
headers.set('Accept', '*/*')
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
// Basic fetch
|
|
168
|
+
if (!/^https?:$/.test(parsedURL.protocol)) {
|
|
169
|
+
throw new TypeError('Only HTTP(S) protocols are supported')
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
if (request.signal &&
|
|
173
|
+
Minipass.isStream(request.body) &&
|
|
174
|
+
typeof request.body.destroy !== 'function') {
|
|
175
|
+
throw new Error(
|
|
176
|
+
'Cancellation of streamed requests with AbortSignal is not supported')
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
// HTTP-network-or-cache fetch steps 2.4-2.7
|
|
180
|
+
const contentLengthValue =
|
|
181
|
+
(request.body === null || request.body === undefined) &&
|
|
182
|
+
/^(POST|PUT)$/i.test(request.method) ? '0'
|
|
183
|
+
: request.body !== null && request.body !== undefined
|
|
184
|
+
? getTotalBytes(request)
|
|
185
|
+
: null
|
|
186
|
+
|
|
187
|
+
if (contentLengthValue) {
|
|
188
|
+
headers.set('Content-Length', contentLengthValue + '')
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
// HTTP-network-or-cache fetch step 2.11
|
|
192
|
+
if (!headers.has('User-Agent')) {
|
|
193
|
+
headers.set('User-Agent', defaultUserAgent)
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
// HTTP-network-or-cache fetch step 2.15
|
|
197
|
+
if (request.compress && !headers.has('Accept-Encoding')) {
|
|
198
|
+
headers.set('Accept-Encoding', 'gzip,deflate')
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
const agent = typeof request.agent === 'function'
|
|
202
|
+
? request.agent(parsedURL)
|
|
203
|
+
: request.agent
|
|
204
|
+
|
|
205
|
+
if (!headers.has('Connection') && !agent) {
|
|
206
|
+
headers.set('Connection', 'close')
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
// TLS specific options that are handled by node
|
|
210
|
+
const {
|
|
211
|
+
ca,
|
|
212
|
+
cert,
|
|
213
|
+
ciphers,
|
|
214
|
+
clientCertEngine,
|
|
215
|
+
crl,
|
|
216
|
+
dhparam,
|
|
217
|
+
ecdhCurve,
|
|
218
|
+
family,
|
|
219
|
+
honorCipherOrder,
|
|
220
|
+
key,
|
|
221
|
+
passphrase,
|
|
222
|
+
pfx,
|
|
223
|
+
rejectUnauthorized,
|
|
224
|
+
secureOptions,
|
|
225
|
+
secureProtocol,
|
|
226
|
+
servername,
|
|
227
|
+
sessionIdContext,
|
|
228
|
+
} = request[INTERNALS]
|
|
229
|
+
|
|
230
|
+
// HTTP-network fetch step 4.2
|
|
231
|
+
// chunked encoding is handled by Node.js
|
|
232
|
+
|
|
233
|
+
// we cannot spread parsedURL directly, so we have to read each property one-by-one
|
|
234
|
+
// and map them to the equivalent https?.request() method options
|
|
235
|
+
const urlProps = {
|
|
236
|
+
auth: parsedURL.username || parsedURL.password
|
|
237
|
+
? `${parsedURL.username}:${parsedURL.password}`
|
|
238
|
+
: '',
|
|
239
|
+
host: parsedURL.host,
|
|
240
|
+
hostname: parsedURL.hostname,
|
|
241
|
+
path: `${parsedURL.pathname}${parsedURL.search}`,
|
|
242
|
+
port: parsedURL.port,
|
|
243
|
+
protocol: parsedURL.protocol,
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
return {
|
|
247
|
+
...urlProps,
|
|
248
|
+
method: request.method,
|
|
249
|
+
headers: exportNodeCompatibleHeaders(headers),
|
|
250
|
+
agent,
|
|
251
|
+
ca,
|
|
252
|
+
cert,
|
|
253
|
+
ciphers,
|
|
254
|
+
clientCertEngine,
|
|
255
|
+
crl,
|
|
256
|
+
dhparam,
|
|
257
|
+
ecdhCurve,
|
|
258
|
+
family,
|
|
259
|
+
honorCipherOrder,
|
|
260
|
+
key,
|
|
261
|
+
passphrase,
|
|
262
|
+
pfx,
|
|
263
|
+
rejectUnauthorized,
|
|
264
|
+
secureOptions,
|
|
265
|
+
secureProtocol,
|
|
266
|
+
servername,
|
|
267
|
+
sessionIdContext,
|
|
268
|
+
timeout: request.timeout,
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
module.exports = Request
|
|
274
|
+
|
|
275
|
+
Object.defineProperties(Request.prototype, {
|
|
276
|
+
method: { enumerable: true },
|
|
277
|
+
url: { enumerable: true },
|
|
278
|
+
headers: { enumerable: true },
|
|
279
|
+
redirect: { enumerable: true },
|
|
280
|
+
clone: { enumerable: true },
|
|
281
|
+
signal: { enumerable: true },
|
|
282
|
+
})
|