game_dig 0.0.1 → 0.2.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.
- checksums.yaml +4 -4
- data/.gitignore +3 -1
- data/CHANGELOG.md +13 -0
- data/README.md +89 -26
- data/Rakefile +8 -0
- data/cli/pry_nodo.rb +5 -0
- data/game_dig.gemspec +21 -14
- data/lib/custom_errors/cli_not_found.rb +4 -0
- data/lib/custom_errors/error.rb +4 -0
- data/lib/game_dig/helper.rb +51 -0
- data/lib/game_dig/node/gamedig-example.js +17 -0
- data/lib/game_dig/node/node_modules/.bin/fxparser +1 -0
- data/lib/game_dig/node/node_modules/.bin/gamedig +1 -0
- data/lib/game_dig/node/node_modules/.bin/seek-bunzip +1 -0
- data/lib/game_dig/node/node_modules/.bin/seek-table +1 -0
- data/lib/game_dig/node/node_modules/.yarn-integrity +73 -0
- data/lib/game_dig/node/node_modules/@sindresorhus/is/dist/index.d.ts +246 -0
- data/lib/game_dig/node/node_modules/@sindresorhus/is/dist/index.js +454 -0
- data/lib/game_dig/node/node_modules/@sindresorhus/is/dist/types.d.ts +32 -0
- data/lib/game_dig/node/node_modules/@sindresorhus/is/dist/types.js +2 -0
- data/lib/game_dig/node/node_modules/@sindresorhus/is/license +9 -0
- data/lib/game_dig/node/node_modules/@sindresorhus/is/package.json +76 -0
- data/lib/game_dig/node/node_modules/@sindresorhus/is/readme.md +698 -0
- data/lib/game_dig/node/node_modules/@szmarczak/http-timer/LICENSE +21 -0
- data/lib/game_dig/node/node_modules/@szmarczak/http-timer/README.md +93 -0
- data/lib/game_dig/node/node_modules/@szmarczak/http-timer/dist/source/index.d.ts +32 -0
- data/lib/game_dig/node/node_modules/@szmarczak/http-timer/dist/source/index.js +106 -0
- data/lib/game_dig/node/node_modules/@szmarczak/http-timer/package.json +89 -0
- data/lib/game_dig/node/node_modules/@types/http-cache-semantics/LICENSE +21 -0
- data/lib/game_dig/node/node_modules/@types/http-cache-semantics/README.md +15 -0
- data/lib/game_dig/node/node_modules/@types/http-cache-semantics/index.d.ts +165 -0
- data/lib/game_dig/node/node_modules/@types/http-cache-semantics/package.json +25 -0
- data/lib/game_dig/node/node_modules/any-promise/.jshintrc +4 -0
- data/lib/game_dig/node/node_modules/any-promise/.npmignore +7 -0
- data/lib/game_dig/node/node_modules/any-promise/LICENSE +19 -0
- data/lib/game_dig/node/node_modules/any-promise/README.md +161 -0
- data/lib/game_dig/node/node_modules/any-promise/implementation.d.ts +3 -0
- data/lib/game_dig/node/node_modules/any-promise/implementation.js +1 -0
- data/lib/game_dig/node/node_modules/any-promise/index.d.ts +73 -0
- data/lib/game_dig/node/node_modules/any-promise/index.js +1 -0
- data/lib/game_dig/node/node_modules/any-promise/loader.js +78 -0
- data/lib/game_dig/node/node_modules/any-promise/optional.js +6 -0
- data/lib/game_dig/node/node_modules/any-promise/package.json +45 -0
- data/lib/game_dig/node/node_modules/any-promise/register/bluebird.d.ts +1 -0
- data/lib/game_dig/node/node_modules/any-promise/register/bluebird.js +2 -0
- data/lib/game_dig/node/node_modules/any-promise/register/es6-promise.d.ts +1 -0
- data/lib/game_dig/node/node_modules/any-promise/register/es6-promise.js +2 -0
- data/lib/game_dig/node/node_modules/any-promise/register/lie.d.ts +1 -0
- data/lib/game_dig/node/node_modules/any-promise/register/lie.js +2 -0
- data/lib/game_dig/node/node_modules/any-promise/register/native-promise-only.d.ts +1 -0
- data/lib/game_dig/node/node_modules/any-promise/register/native-promise-only.js +2 -0
- data/lib/game_dig/node/node_modules/any-promise/register/pinkie.d.ts +1 -0
- data/lib/game_dig/node/node_modules/any-promise/register/pinkie.js +2 -0
- data/lib/game_dig/node/node_modules/any-promise/register/promise.d.ts +1 -0
- data/lib/game_dig/node/node_modules/any-promise/register/promise.js +2 -0
- data/lib/game_dig/node/node_modules/any-promise/register/q.d.ts +1 -0
- data/lib/game_dig/node/node_modules/any-promise/register/q.js +2 -0
- data/lib/game_dig/node/node_modules/any-promise/register/rsvp.d.ts +1 -0
- data/lib/game_dig/node/node_modules/any-promise/register/rsvp.js +2 -0
- data/lib/game_dig/node/node_modules/any-promise/register/vow.d.ts +1 -0
- data/lib/game_dig/node/node_modules/any-promise/register/vow.js +2 -0
- data/lib/game_dig/node/node_modules/any-promise/register/when.d.ts +1 -0
- data/lib/game_dig/node/node_modules/any-promise/register/when.js +2 -0
- data/lib/game_dig/node/node_modules/any-promise/register-shim.js +18 -0
- data/lib/game_dig/node/node_modules/any-promise/register.d.ts +17 -0
- data/lib/game_dig/node/node_modules/any-promise/register.js +94 -0
- data/lib/game_dig/node/node_modules/barse/.npmignore +2 -0
- data/lib/game_dig/node/node_modules/barse/.travis.yml +4 -0
- data/lib/game_dig/node/node_modules/barse/README.md +138 -0
- data/lib/game_dig/node/node_modules/barse/example/complete.js +34 -0
- data/lib/game_dig/node/node_modules/barse/example/next.js +21 -0
- data/lib/game_dig/node/node_modules/barse/index.js +282 -0
- data/lib/game_dig/node/node_modules/barse/node_modules/readable-stream/.npmignore +5 -0
- data/lib/game_dig/node/node_modules/barse/node_modules/readable-stream/LICENSE +18 -0
- data/lib/game_dig/node/node_modules/barse/node_modules/readable-stream/README.md +15 -0
- data/lib/game_dig/node/node_modules/barse/node_modules/readable-stream/duplex.js +1 -0
- data/lib/game_dig/node/node_modules/barse/node_modules/readable-stream/lib/_stream_duplex.js +89 -0
- data/lib/game_dig/node/node_modules/barse/node_modules/readable-stream/lib/_stream_passthrough.js +46 -0
- data/lib/game_dig/node/node_modules/barse/node_modules/readable-stream/lib/_stream_readable.js +982 -0
- data/lib/game_dig/node/node_modules/barse/node_modules/readable-stream/lib/_stream_transform.js +210 -0
- data/lib/game_dig/node/node_modules/barse/node_modules/readable-stream/lib/_stream_writable.js +386 -0
- data/lib/game_dig/node/node_modules/barse/node_modules/readable-stream/package.json +32 -0
- data/lib/game_dig/node/node_modules/barse/node_modules/readable-stream/passthrough.js +1 -0
- data/lib/game_dig/node/node_modules/barse/node_modules/readable-stream/readable.js +11 -0
- data/lib/game_dig/node/node_modules/barse/node_modules/readable-stream/transform.js +1 -0
- data/lib/game_dig/node/node_modules/barse/node_modules/readable-stream/writable.js +1 -0
- data/lib/game_dig/node/node_modules/barse/package.json +48 -0
- data/lib/game_dig/node/node_modules/barse/test/integration.js +37 -0
- data/lib/game_dig/node/node_modules/barse/test/loop.js +36 -0
- data/lib/game_dig/node/node_modules/barse/test/next.js +34 -0
- data/lib/game_dig/node/node_modules/barse/test/scope.js +18 -0
- data/lib/game_dig/node/node_modules/barse/test/string.js +33 -0
- data/lib/game_dig/node/node_modules/barse/test/vars.js +20 -0
- data/lib/game_dig/node/node_modules/cacheable-lookup/LICENSE +21 -0
- data/lib/game_dig/node/node_modules/cacheable-lookup/README.md +245 -0
- data/lib/game_dig/node/node_modules/cacheable-lookup/index.d.ts +144 -0
- data/lib/game_dig/node/node_modules/cacheable-lookup/package.json +61 -0
- data/lib/game_dig/node/node_modules/cacheable-lookup/source/index.js +452 -0
- data/lib/game_dig/node/node_modules/cacheable-request/README.md +335 -0
- data/lib/game_dig/node/node_modules/cacheable-request/dist/index.d.ts +17 -0
- data/lib/game_dig/node/node_modules/cacheable-request/dist/index.d.ts.map +1 -0
- data/lib/game_dig/node/node_modules/cacheable-request/dist/index.js +275 -0
- data/lib/game_dig/node/node_modules/cacheable-request/dist/index.js.map +1 -0
- data/lib/game_dig/node/node_modules/cacheable-request/dist/types.d.ts +106 -0
- data/lib/game_dig/node/node_modules/cacheable-request/dist/types.d.ts.map +1 -0
- data/lib/game_dig/node/node_modules/cacheable-request/dist/types.js +19 -0
- data/lib/game_dig/node/node_modules/cacheable-request/dist/types.js.map +1 -0
- data/lib/game_dig/node/node_modules/cacheable-request/node_modules/mimic-response/index.d.ts +29 -0
- data/lib/game_dig/node/node_modules/cacheable-request/node_modules/mimic-response/index.js +75 -0
- data/lib/game_dig/node/node_modules/cacheable-request/node_modules/mimic-response/license +9 -0
- data/lib/game_dig/node/node_modules/cacheable-request/node_modules/mimic-response/package.json +44 -0
- data/lib/game_dig/node/node_modules/cacheable-request/node_modules/mimic-response/readme.md +78 -0
- data/lib/game_dig/node/node_modules/cacheable-request/package.json +121 -0
- data/lib/game_dig/node/node_modules/commander/CHANGELOG.md +361 -0
- data/lib/game_dig/node/node_modules/commander/LICENSE +22 -0
- data/lib/game_dig/node/node_modules/commander/Readme.md +791 -0
- data/lib/game_dig/node/node_modules/commander/index.js +1881 -0
- data/lib/game_dig/node/node_modules/commander/package.json +51 -0
- data/lib/game_dig/node/node_modules/commander/typings/index.d.ts +410 -0
- data/lib/game_dig/node/node_modules/core-util-is/LICENSE +19 -0
- data/lib/game_dig/node/node_modules/core-util-is/README.md +3 -0
- data/lib/game_dig/node/node_modules/core-util-is/lib/util.js +107 -0
- data/lib/game_dig/node/node_modules/core-util-is/package.json +38 -0
- data/lib/game_dig/node/node_modules/decompress-response/index.d.ts +22 -0
- data/lib/game_dig/node/node_modules/decompress-response/index.js +58 -0
- data/lib/game_dig/node/node_modules/decompress-response/license +9 -0
- data/lib/game_dig/node/node_modules/decompress-response/package.json +56 -0
- data/lib/game_dig/node/node_modules/decompress-response/readme.md +48 -0
- data/lib/game_dig/node/node_modules/defer-to-connect/LICENSE +21 -0
- data/lib/game_dig/node/node_modules/defer-to-connect/README.md +38 -0
- data/lib/game_dig/node/node_modules/defer-to-connect/dist/source/index.d.ts +10 -0
- data/lib/game_dig/node/node_modules/defer-to-connect/dist/source/index.js +47 -0
- data/lib/game_dig/node/node_modules/defer-to-connect/package.json +71 -0
- data/lib/game_dig/node/node_modules/emitter-component/History.md +35 -0
- data/lib/game_dig/node/node_modules/emitter-component/Makefile +7 -0
- data/lib/game_dig/node/node_modules/emitter-component/Readme.md +70 -0
- data/lib/game_dig/node/node_modules/emitter-component/bower.json +21 -0
- data/lib/game_dig/node/node_modules/emitter-component/component.json +9 -0
- data/lib/game_dig/node/node_modules/emitter-component/index.js +164 -0
- data/lib/game_dig/node/node_modules/emitter-component/package.json +19 -0
- data/lib/game_dig/node/node_modules/emitter-component/test/emitter.js +195 -0
- data/lib/game_dig/node/node_modules/event-to-promise/LICENSE +14 -0
- data/lib/game_dig/node/node_modules/event-to-promise/README.md +180 -0
- data/lib/game_dig/node/node_modules/event-to-promise/index.js +106 -0
- data/lib/game_dig/node/node_modules/event-to-promise/package.json +35 -0
- data/lib/game_dig/node/node_modules/fast-xml-parser/CHANGELOG.md +671 -0
- data/lib/game_dig/node/node_modules/fast-xml-parser/LICENSE +21 -0
- data/lib/game_dig/node/node_modules/fast-xml-parser/README.md +223 -0
- data/lib/game_dig/node/node_modules/fast-xml-parser/lib/fxbuilder.min.js +2 -0
- data/lib/game_dig/node/node_modules/fast-xml-parser/lib/fxbuilder.min.js.map +1 -0
- data/lib/game_dig/node/node_modules/fast-xml-parser/lib/fxp.cjs +1 -0
- data/lib/game_dig/node/node_modules/fast-xml-parser/lib/fxp.d.cts +458 -0
- data/lib/game_dig/node/node_modules/fast-xml-parser/lib/fxp.min.js +2 -0
- data/lib/game_dig/node/node_modules/fast-xml-parser/lib/fxp.min.js.map +1 -0
- data/lib/game_dig/node/node_modules/fast-xml-parser/lib/fxparser.min.js +2 -0
- data/lib/game_dig/node/node_modules/fast-xml-parser/lib/fxparser.min.js.map +1 -0
- data/lib/game_dig/node/node_modules/fast-xml-parser/lib/fxvalidator.min.js +2 -0
- data/lib/game_dig/node/node_modules/fast-xml-parser/lib/fxvalidator.min.js.map +1 -0
- data/lib/game_dig/node/node_modules/fast-xml-parser/package.json +90 -0
- data/lib/game_dig/node/node_modules/fast-xml-parser/src/cli/cli.js +97 -0
- data/lib/game_dig/node/node_modules/fast-xml-parser/src/cli/man.js +17 -0
- data/lib/game_dig/node/node_modules/fast-xml-parser/src/cli/read.js +43 -0
- data/lib/game_dig/node/node_modules/fast-xml-parser/src/fxp.d.ts +445 -0
- data/lib/game_dig/node/node_modules/fast-xml-parser/src/fxp.js +14 -0
- data/lib/game_dig/node/node_modules/fast-xml-parser/src/ignoreAttributes.js +18 -0
- data/lib/game_dig/node/node_modules/fast-xml-parser/src/util.js +68 -0
- data/lib/game_dig/node/node_modules/fast-xml-parser/src/v6/CharsSymbol.js +16 -0
- data/lib/game_dig/node/node_modules/fast-xml-parser/src/v6/EntitiesParser.js +104 -0
- data/lib/game_dig/node/node_modules/fast-xml-parser/src/v6/OptionsBuilder.js +61 -0
- data/lib/game_dig/node/node_modules/fast-xml-parser/src/v6/OutputBuilders/BaseOutputBuilder.js +69 -0
- data/lib/game_dig/node/node_modules/fast-xml-parser/src/v6/OutputBuilders/JsArrBuilder.js +103 -0
- data/lib/game_dig/node/node_modules/fast-xml-parser/src/v6/OutputBuilders/JsMinArrBuilder.js +100 -0
- data/lib/game_dig/node/node_modules/fast-xml-parser/src/v6/OutputBuilders/JsObjBuilder.js +154 -0
- data/lib/game_dig/node/node_modules/fast-xml-parser/src/v6/OutputBuilders/ParserOptionsBuilder.js +94 -0
- data/lib/game_dig/node/node_modules/fast-xml-parser/src/v6/Report.js +0 -0
- data/lib/game_dig/node/node_modules/fast-xml-parser/src/v6/TagPath.js +81 -0
- data/lib/game_dig/node/node_modules/fast-xml-parser/src/v6/TagPathMatcher.js +13 -0
- data/lib/game_dig/node/node_modules/fast-xml-parser/src/v6/XMLParser.js +83 -0
- data/lib/game_dig/node/node_modules/fast-xml-parser/src/v6/Xml2JsParser.js +235 -0
- data/lib/game_dig/node/node_modules/fast-xml-parser/src/v6/XmlPartReader.js +210 -0
- data/lib/game_dig/node/node_modules/fast-xml-parser/src/v6/XmlSpecialTagsReader.js +111 -0
- data/lib/game_dig/node/node_modules/fast-xml-parser/src/v6/inputSource/BufferSource.js +116 -0
- data/lib/game_dig/node/node_modules/fast-xml-parser/src/v6/inputSource/StringSource.js +121 -0
- data/lib/game_dig/node/node_modules/fast-xml-parser/src/v6/valueParsers/EntitiesParser.js +105 -0
- data/lib/game_dig/node/node_modules/fast-xml-parser/src/v6/valueParsers/booleanParser.js +22 -0
- data/lib/game_dig/node/node_modules/fast-xml-parser/src/v6/valueParsers/booleanParserExt.js +19 -0
- data/lib/game_dig/node/node_modules/fast-xml-parser/src/v6/valueParsers/currency.js +38 -0
- data/lib/game_dig/node/node_modules/fast-xml-parser/src/v6/valueParsers/join.js +13 -0
- data/lib/game_dig/node/node_modules/fast-xml-parser/src/v6/valueParsers/number.js +14 -0
- data/lib/game_dig/node/node_modules/fast-xml-parser/src/v6/valueParsers/trim.js +6 -0
- data/lib/game_dig/node/node_modules/fast-xml-parser/src/validator.js +425 -0
- data/lib/game_dig/node/node_modules/fast-xml-parser/src/xmlbuilder/json2xml.js +285 -0
- data/lib/game_dig/node/node_modules/fast-xml-parser/src/xmlbuilder/orderedJs2Xml.js +134 -0
- data/lib/game_dig/node/node_modules/fast-xml-parser/src/xmlbuilder/prettifyJs2Xml.js +0 -0
- data/lib/game_dig/node/node_modules/fast-xml-parser/src/xmlparser/DocTypeReader.js +369 -0
- data/lib/game_dig/node/node_modules/fast-xml-parser/src/xmlparser/OptionsBuilder.js +46 -0
- data/lib/game_dig/node/node_modules/fast-xml-parser/src/xmlparser/OrderedObjParser.js +606 -0
- data/lib/game_dig/node/node_modules/fast-xml-parser/src/xmlparser/XMLParser.js +71 -0
- data/lib/game_dig/node/node_modules/fast-xml-parser/src/xmlparser/node2json.js +119 -0
- data/lib/game_dig/node/node_modules/fast-xml-parser/src/xmlparser/xmlNode.js +40 -0
- data/lib/game_dig/node/node_modules/form-data-encoder/@type/FileLike.d.ts +23 -0
- data/lib/game_dig/node/node_modules/form-data-encoder/@type/FormDataEncoder.d.ts +169 -0
- data/lib/game_dig/node/node_modules/form-data-encoder/@type/FormDataLike.d.ts +40 -0
- data/lib/game_dig/node/node_modules/form-data-encoder/@type/index.d.ts +5 -0
- data/lib/game_dig/node/node_modules/form-data-encoder/@type/util/Headers.d.ts +8 -0
- data/lib/game_dig/node/node_modules/form-data-encoder/@type/util/createBoundary.d.ts +12 -0
- data/lib/game_dig/node/node_modules/form-data-encoder/@type/util/escapeName.d.ts +10 -0
- data/lib/game_dig/node/node_modules/form-data-encoder/@type/util/getStreamIterator.d.ts +6 -0
- data/lib/game_dig/node/node_modules/form-data-encoder/@type/util/isFile.d.ts +34 -0
- data/lib/game_dig/node/node_modules/form-data-encoder/@type/util/isFormData.d.ts +7 -0
- data/lib/game_dig/node/node_modules/form-data-encoder/@type/util/isFunction.d.ts +6 -0
- data/lib/game_dig/node/node_modules/form-data-encoder/@type/util/isPlainObject.d.ts +1 -0
- data/lib/game_dig/node/node_modules/form-data-encoder/@type/util/normalizeValue.d.ts +10 -0
- data/lib/game_dig/node/node_modules/form-data-encoder/@type/util/proxyHeaders.d.ts +2 -0
- data/lib/game_dig/node/node_modules/form-data-encoder/lib/FileLike.js +1 -0
- data/lib/game_dig/node/node_modules/form-data-encoder/lib/FormDataEncoder.js +134 -0
- data/lib/game_dig/node/node_modules/form-data-encoder/lib/FormDataLike.js +1 -0
- data/lib/game_dig/node/node_modules/form-data-encoder/lib/index.js +5 -0
- data/lib/game_dig/node/node_modules/form-data-encoder/lib/util/Headers.js +1 -0
- data/lib/game_dig/node/node_modules/form-data-encoder/lib/util/createBoundary.js +9 -0
- data/lib/game_dig/node/node_modules/form-data-encoder/lib/util/escapeName.js +4 -0
- data/lib/game_dig/node/node_modules/form-data-encoder/lib/util/getStreamIterator.js +21 -0
- data/lib/game_dig/node/node_modules/form-data-encoder/lib/util/isFile.js +8 -0
- data/lib/game_dig/node/node_modules/form-data-encoder/lib/util/isFormData.js +8 -0
- data/lib/game_dig/node/node_modules/form-data-encoder/lib/util/isFunction.js +1 -0
- data/lib/game_dig/node/node_modules/form-data-encoder/lib/util/isPlainObject.js +12 -0
- data/lib/game_dig/node/node_modules/form-data-encoder/lib/util/normalizeValue.js +8 -0
- data/lib/game_dig/node/node_modules/form-data-encoder/lib/util/proxyHeaders.js +14 -0
- data/lib/game_dig/node/node_modules/form-data-encoder/license +21 -0
- data/lib/game_dig/node/node_modules/form-data-encoder/package.json +70 -0
- data/lib/game_dig/node/node_modules/form-data-encoder/readme.md +368 -0
- data/lib/game_dig/node/node_modules/gamedig/GAMES_LIST.md +563 -0
- data/lib/game_dig/node/node_modules/gamedig/LICENSE +21 -0
- data/lib/game_dig/node/node_modules/gamedig/README.md +155 -0
- data/lib/game_dig/node/node_modules/gamedig/bin/gamedig.js +64 -0
- data/lib/game_dig/node/node_modules/gamedig/dist/index.cjs +18075 -0
- data/lib/game_dig/node/node_modules/gamedig/lib/DnsResolver.js +80 -0
- data/lib/game_dig/node/node_modules/gamedig/lib/GlobalUdpSocket.js +69 -0
- data/lib/game_dig/node/node_modules/gamedig/lib/HexUtil.js +20 -0
- data/lib/game_dig/node/node_modules/gamedig/lib/Logger.js +45 -0
- data/lib/game_dig/node/node_modules/gamedig/lib/Promises.js +18 -0
- data/lib/game_dig/node/node_modules/gamedig/lib/ProtocolResolver.js +7 -0
- data/lib/game_dig/node/node_modules/gamedig/lib/QueryRunner.js +122 -0
- data/lib/game_dig/node/node_modules/gamedig/lib/Results.js +36 -0
- data/lib/game_dig/node/node_modules/gamedig/lib/game-resolver.js +27 -0
- data/lib/game_dig/node/node_modules/gamedig/lib/gamedig.js +23 -0
- data/lib/game_dig/node/node_modules/gamedig/lib/games.js +3458 -0
- data/lib/game_dig/node/node_modules/gamedig/lib/index.js +5 -0
- data/lib/game_dig/node/node_modules/gamedig/lib/reader.js +172 -0
- data/lib/game_dig/node/node_modules/gamedig/node_modules/.bin/fxparser +1 -0
- data/lib/game_dig/node/node_modules/gamedig/node_modules/.bin/seek-bunzip +1 -0
- data/lib/game_dig/node/node_modules/gamedig/node_modules/.bin/seek-table +1 -0
- data/lib/game_dig/node/node_modules/gamedig/package.json +80 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/altvmp.js +63 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/armagetron.js +65 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/asa.js +18 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/ase.js +45 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/assettocorsa.js +41 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/battlefield.js +167 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/beammp.js +46 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/beammpmaster.js +17 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/brokeprotocol.js +13 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/brokeprotocolmaster.js +418 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/buildandshoot.js +42 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/core.js +369 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/cs2d.js +65 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/dayz.js +196 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/discord.js +29 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/doom3.js +149 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/eco.js +22 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/eldewrito.js +22 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/epic.js +153 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/factorio.js +24 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/farmingsimulator.js +69 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/ffow.js +38 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/fivem.js +35 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/gamespy1.js +182 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/gamespy2.js +142 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/gamespy3.js +198 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/geneshift.js +46 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/goldsrc.js +8 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/gtasao.js +8 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/hawakening.js +13 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/hawakeningmaster.js +718 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/hexen2.js +14 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/index.js +85 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/jc2mp.js +18 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/kspdmp.js +28 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/mafia2mp.js +42 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/mafia2online.js +9 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/minecraft.js +107 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/minecraftbedrock.js +73 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/minecraftvanilla.js +86 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/minetest.js +39 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/mumble.js +39 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/mumbleping.js +25 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/nadeo.js +85 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/openttd.js +164 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/palworld.js +32 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/quake1.js +14 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/quake2.js +90 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/quake3.js +28 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/ragemp.js +49 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/renegadex.js +232 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/renegadexmaster.js +21 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/renown.js +20 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/rfactor.js +69 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/samp.js +105 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/satisfactory.js +106 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/savage2.js +25 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/scpsl.js +54 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/sdtd.js +109 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/soldat.js +45 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/squad.js +20 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/starmade.js +67 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/starsiege.js +10 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/teamspeak2.js +72 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/teamspeak3.js +70 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/terraria.js +27 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/theisleevrima.js +19 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/toxikk.js +122 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/tribes1.js +153 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/tribes1master.js +80 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/unreal2.js +151 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/ut3.js +45 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/valve.js +472 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/vcmp.js +10 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/ventrilo.js +238 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/vintagestory.js +24 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/vintagestorymaster.js +17 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/warsow.js +13 -0
- data/lib/game_dig/node/node_modules/gamedig/protocols/xonotic.js +16 -0
- data/lib/game_dig/node/node_modules/gbxremote/.editorconfig +15 -0
- data/lib/game_dig/node/node_modules/gbxremote/.npmignore +5 -0
- data/lib/game_dig/node/node_modules/gbxremote/LICENSE +23 -0
- data/lib/game_dig/node/node_modules/gbxremote/README.md +196 -0
- data/lib/game_dig/node/node_modules/gbxremote/lib/client.js +214 -0
- data/lib/game_dig/node/node_modules/gbxremote/lib/gbxremote.js +18 -0
- data/lib/game_dig/node/node_modules/gbxremote/package.json +55 -0
- data/lib/game_dig/node/node_modules/get-stream/buffer-stream.js +52 -0
- data/lib/game_dig/node/node_modules/get-stream/index.d.ts +105 -0
- data/lib/game_dig/node/node_modules/get-stream/index.js +61 -0
- data/lib/game_dig/node/node_modules/get-stream/license +9 -0
- data/lib/game_dig/node/node_modules/get-stream/package.json +47 -0
- data/lib/game_dig/node/node_modules/get-stream/readme.md +124 -0
- data/lib/game_dig/node/node_modules/got/dist/source/as-promise/index.d.ts +3 -0
- data/lib/game_dig/node/node_modules/got/dist/source/as-promise/index.js +158 -0
- data/lib/game_dig/node/node_modules/got/dist/source/as-promise/types.d.ts +38 -0
- data/lib/game_dig/node/node_modules/got/dist/source/as-promise/types.js +17 -0
- data/lib/game_dig/node/node_modules/got/dist/source/core/calculate-retry-delay.d.ts +4 -0
- data/lib/game_dig/node/node_modules/got/dist/source/core/calculate-retry-delay.js +29 -0
- data/lib/game_dig/node/node_modules/got/dist/source/core/errors.d.ts +90 -0
- data/lib/game_dig/node/node_modules/got/dist/source/core/errors.js +178 -0
- data/lib/game_dig/node/node_modules/got/dist/source/core/index.d.ts +190 -0
- data/lib/game_dig/node/node_modules/got/dist/source/core/index.js +1126 -0
- data/lib/game_dig/node/node_modules/got/dist/source/core/options.d.ts +1253 -0
- data/lib/game_dig/node/node_modules/got/dist/source/core/options.js +1653 -0
- data/lib/game_dig/node/node_modules/got/dist/source/core/parse-link-header.d.ts +4 -0
- data/lib/game_dig/node/node_modules/got/dist/source/core/parse-link-header.js +33 -0
- data/lib/game_dig/node/node_modules/got/dist/source/core/response.d.ts +109 -0
- data/lib/game_dig/node/node_modules/got/dist/source/core/response.js +39 -0
- data/lib/game_dig/node/node_modules/got/dist/source/core/timed-out.d.ts +30 -0
- data/lib/game_dig/node/node_modules/got/dist/source/core/timed-out.js +138 -0
- data/lib/game_dig/node/node_modules/got/dist/source/core/utils/get-body-size.d.ts +3 -0
- data/lib/game_dig/node/node_modules/got/dist/source/core/utils/get-body-size.js +22 -0
- data/lib/game_dig/node/node_modules/got/dist/source/core/utils/is-client-request.d.ts +5 -0
- data/lib/game_dig/node/node_modules/got/dist/source/core/utils/is-client-request.js +4 -0
- data/lib/game_dig/node/node_modules/got/dist/source/core/utils/is-form-data.d.ts +8 -0
- data/lib/game_dig/node/node_modules/got/dist/source/core/utils/is-form-data.js +4 -0
- data/lib/game_dig/node/node_modules/got/dist/source/core/utils/is-unix-socket-url.d.ts +2 -0
- data/lib/game_dig/node/node_modules/got/dist/source/core/utils/is-unix-socket-url.js +4 -0
- data/lib/game_dig/node/node_modules/got/dist/source/core/utils/options-to-url.d.ts +13 -0
- data/lib/game_dig/node/node_modules/got/dist/source/core/utils/options-to-url.js +48 -0
- data/lib/game_dig/node/node_modules/got/dist/source/core/utils/proxy-events.d.ts +3 -0
- data/lib/game_dig/node/node_modules/got/dist/source/core/utils/proxy-events.js +15 -0
- data/lib/game_dig/node/node_modules/got/dist/source/core/utils/unhandle.d.ts +11 -0
- data/lib/game_dig/node/node_modules/got/dist/source/core/utils/unhandle.js +20 -0
- data/lib/game_dig/node/node_modules/got/dist/source/core/utils/url-to-options.d.ts +15 -0
- data/lib/game_dig/node/node_modules/got/dist/source/core/utils/url-to-options.js +22 -0
- data/lib/game_dig/node/node_modules/got/dist/source/core/utils/weakable-map.d.ts +8 -0
- data/lib/game_dig/node/node_modules/got/dist/source/core/utils/weakable-map.js +38 -0
- data/lib/game_dig/node/node_modules/got/dist/source/create.d.ts +3 -0
- data/lib/game_dig/node/node_modules/got/dist/source/create.js +187 -0
- data/lib/game_dig/node/node_modules/got/dist/source/index.d.ts +15 -0
- data/lib/game_dig/node/node_modules/got/dist/source/index.js +20 -0
- data/lib/game_dig/node/node_modules/got/dist/source/types.d.ts +262 -0
- data/lib/game_dig/node/node_modules/got/dist/source/types.js +1 -0
- data/lib/game_dig/node/node_modules/got/license +9 -0
- data/lib/game_dig/node/node_modules/got/package.json +155 -0
- data/lib/game_dig/node/node_modules/got/readme.md +527 -0
- data/lib/game_dig/node/node_modules/http-cache-semantics/LICENSE +9 -0
- data/lib/game_dig/node/node_modules/http-cache-semantics/README.md +268 -0
- data/lib/game_dig/node/node_modules/http-cache-semantics/index.js +928 -0
- data/lib/game_dig/node/node_modules/http-cache-semantics/package.json +22 -0
- data/lib/game_dig/node/node_modules/http2-wrapper/LICENSE +21 -0
- data/lib/game_dig/node/node_modules/http2-wrapper/README.md +459 -0
- data/lib/game_dig/node/node_modules/http2-wrapper/index.d.ts +141 -0
- data/lib/game_dig/node/node_modules/http2-wrapper/package.json +81 -0
- data/lib/game_dig/node/node_modules/http2-wrapper/source/agent.js +796 -0
- data/lib/game_dig/node/node_modules/http2-wrapper/source/auto.js +225 -0
- data/lib/game_dig/node/node_modules/http2-wrapper/source/client-request.js +563 -0
- data/lib/game_dig/node/node_modules/http2-wrapper/source/incoming-message.js +73 -0
- data/lib/game_dig/node/node_modules/http2-wrapper/source/index.js +50 -0
- data/lib/game_dig/node/node_modules/http2-wrapper/source/proxies/get-auth-headers.js +17 -0
- data/lib/game_dig/node/node_modules/http2-wrapper/source/proxies/h1-over-h2.js +90 -0
- data/lib/game_dig/node/node_modules/http2-wrapper/source/proxies/h2-over-h1.js +48 -0
- data/lib/game_dig/node/node_modules/http2-wrapper/source/proxies/h2-over-h2.js +32 -0
- data/lib/game_dig/node/node_modules/http2-wrapper/source/proxies/h2-over-hx.js +40 -0
- data/lib/game_dig/node/node_modules/http2-wrapper/source/proxies/initialize.js +21 -0
- data/lib/game_dig/node/node_modules/http2-wrapper/source/proxies/unexpected-status-code-error.js +11 -0
- data/lib/game_dig/node/node_modules/http2-wrapper/source/utils/calculate-server-name.js +29 -0
- data/lib/game_dig/node/node_modules/http2-wrapper/source/utils/check-type.js +20 -0
- data/lib/game_dig/node/node_modules/http2-wrapper/source/utils/delay-async-destroy.js +33 -0
- data/lib/game_dig/node/node_modules/http2-wrapper/source/utils/errors.js +51 -0
- data/lib/game_dig/node/node_modules/http2-wrapper/source/utils/is-request-pseudo-header.js +13 -0
- data/lib/game_dig/node/node_modules/http2-wrapper/source/utils/js-stream-socket.js +8 -0
- data/lib/game_dig/node/node_modules/http2-wrapper/source/utils/proxy-events.js +7 -0
- data/lib/game_dig/node/node_modules/http2-wrapper/source/utils/proxy-socket-handler.js +102 -0
- data/lib/game_dig/node/node_modules/http2-wrapper/source/utils/validate-header-name.js +11 -0
- data/lib/game_dig/node/node_modules/http2-wrapper/source/utils/validate-header-value.js +17 -0
- data/lib/game_dig/node/node_modules/iconv-lite/Changelog.md +236 -0
- data/lib/game_dig/node/node_modules/iconv-lite/LICENSE +21 -0
- data/lib/game_dig/node/node_modules/iconv-lite/README.md +138 -0
- data/lib/game_dig/node/node_modules/iconv-lite/encodings/dbcs-codec.js +532 -0
- data/lib/game_dig/node/node_modules/iconv-lite/encodings/dbcs-data.js +185 -0
- data/lib/game_dig/node/node_modules/iconv-lite/encodings/index.js +23 -0
- data/lib/game_dig/node/node_modules/iconv-lite/encodings/internal.js +218 -0
- data/lib/game_dig/node/node_modules/iconv-lite/encodings/sbcs-codec.js +75 -0
- data/lib/game_dig/node/node_modules/iconv-lite/encodings/sbcs-data-generated.js +451 -0
- data/lib/game_dig/node/node_modules/iconv-lite/encodings/sbcs-data.js +178 -0
- data/lib/game_dig/node/node_modules/iconv-lite/encodings/tables/big5-added.json +122 -0
- data/lib/game_dig/node/node_modules/iconv-lite/encodings/tables/cp936.json +264 -0
- data/lib/game_dig/node/node_modules/iconv-lite/encodings/tables/cp949.json +273 -0
- data/lib/game_dig/node/node_modules/iconv-lite/encodings/tables/cp950.json +177 -0
- data/lib/game_dig/node/node_modules/iconv-lite/encodings/tables/eucjp.json +182 -0
- data/lib/game_dig/node/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json +1 -0
- data/lib/game_dig/node/node_modules/iconv-lite/encodings/tables/gbk-added.json +56 -0
- data/lib/game_dig/node/node_modules/iconv-lite/encodings/tables/shiftjis.json +125 -0
- data/lib/game_dig/node/node_modules/iconv-lite/encodings/utf16.js +187 -0
- data/lib/game_dig/node/node_modules/iconv-lite/encodings/utf32.js +307 -0
- data/lib/game_dig/node/node_modules/iconv-lite/encodings/utf7.js +283 -0
- data/lib/game_dig/node/node_modules/iconv-lite/lib/bom-handling.js +48 -0
- data/lib/game_dig/node/node_modules/iconv-lite/lib/helpers/merge-exports.js +13 -0
- data/lib/game_dig/node/node_modules/iconv-lite/lib/index.d.ts +41 -0
- data/lib/game_dig/node/node_modules/iconv-lite/lib/index.js +183 -0
- data/lib/game_dig/node/node_modules/iconv-lite/lib/streams.js +105 -0
- data/lib/game_dig/node/node_modules/iconv-lite/package.json +59 -0
- data/lib/game_dig/node/node_modules/inherits/LICENSE +16 -0
- data/lib/game_dig/node/node_modules/inherits/README.md +42 -0
- data/lib/game_dig/node/node_modules/inherits/inherits.js +9 -0
- data/lib/game_dig/node/node_modules/inherits/inherits_browser.js +27 -0
- data/lib/game_dig/node/node_modules/inherits/package.json +29 -0
- data/lib/game_dig/node/node_modules/isarray/README.md +54 -0
- data/lib/game_dig/node/node_modules/isarray/build/build.js +209 -0
- data/lib/game_dig/node/node_modules/isarray/component.json +19 -0
- data/lib/game_dig/node/node_modules/isarray/index.js +3 -0
- data/lib/game_dig/node/node_modules/isarray/package.json +25 -0
- data/lib/game_dig/node/node_modules/json-buffer/.travis.yml +3 -0
- data/lib/game_dig/node/node_modules/json-buffer/LICENSE +22 -0
- data/lib/game_dig/node/node_modules/json-buffer/README.md +24 -0
- data/lib/game_dig/node/node_modules/json-buffer/index.js +58 -0
- data/lib/game_dig/node/node_modules/json-buffer/package.json +34 -0
- data/lib/game_dig/node/node_modules/json-buffer/test/index.js +63 -0
- data/lib/game_dig/node/node_modules/keyv/README.md +429 -0
- data/lib/game_dig/node/node_modules/keyv/package.json +57 -0
- data/lib/game_dig/node/node_modules/keyv/src/index.d.ts +112 -0
- data/lib/game_dig/node/node_modules/keyv/src/index.js +259 -0
- data/lib/game_dig/node/node_modules/long/LICENSE +202 -0
- data/lib/game_dig/node/node_modules/long/README.md +286 -0
- data/lib/game_dig/node/node_modules/long/index.d.ts +2 -0
- data/lib/game_dig/node/node_modules/long/index.js +1581 -0
- data/lib/game_dig/node/node_modules/long/package.json +58 -0
- data/lib/game_dig/node/node_modules/long/types.d.ts +474 -0
- data/lib/game_dig/node/node_modules/long/umd/index.d.ts +3 -0
- data/lib/game_dig/node/node_modules/long/umd/index.js +1622 -0
- data/lib/game_dig/node/node_modules/long/umd/package.json +3 -0
- data/lib/game_dig/node/node_modules/long/umd/types.d.ts +474 -0
- data/lib/game_dig/node/node_modules/lowercase-keys/index.d.ts +14 -0
- data/lib/game_dig/node/node_modules/lowercase-keys/index.js +3 -0
- data/lib/game_dig/node/node_modules/lowercase-keys/license +9 -0
- data/lib/game_dig/node/node_modules/lowercase-keys/package.json +41 -0
- data/lib/game_dig/node/node_modules/lowercase-keys/readme.md +32 -0
- data/lib/game_dig/node/node_modules/mimic-response/index.d.ts +17 -0
- data/lib/game_dig/node/node_modules/mimic-response/index.js +77 -0
- data/lib/game_dig/node/node_modules/mimic-response/license +9 -0
- data/lib/game_dig/node/node_modules/mimic-response/package.json +42 -0
- data/lib/game_dig/node/node_modules/mimic-response/readme.md +78 -0
- data/lib/game_dig/node/node_modules/minimist/.eslintrc +29 -0
- data/lib/game_dig/node/node_modules/minimist/.github/FUNDING.yml +12 -0
- data/lib/game_dig/node/node_modules/minimist/.nycrc +14 -0
- data/lib/game_dig/node/node_modules/minimist/CHANGELOG.md +298 -0
- data/lib/game_dig/node/node_modules/minimist/LICENSE +18 -0
- data/lib/game_dig/node/node_modules/minimist/README.md +121 -0
- data/lib/game_dig/node/node_modules/minimist/example/parse.js +4 -0
- data/lib/game_dig/node/node_modules/minimist/index.js +263 -0
- data/lib/game_dig/node/node_modules/minimist/package.json +75 -0
- data/lib/game_dig/node/node_modules/minimist/test/all_bool.js +34 -0
- data/lib/game_dig/node/node_modules/minimist/test/bool.js +177 -0
- data/lib/game_dig/node/node_modules/minimist/test/dash.js +43 -0
- data/lib/game_dig/node/node_modules/minimist/test/default_bool.js +37 -0
- data/lib/game_dig/node/node_modules/minimist/test/dotted.js +24 -0
- data/lib/game_dig/node/node_modules/minimist/test/kv_short.js +32 -0
- data/lib/game_dig/node/node_modules/minimist/test/long.js +33 -0
- data/lib/game_dig/node/node_modules/minimist/test/num.js +38 -0
- data/lib/game_dig/node/node_modules/minimist/test/parse.js +209 -0
- data/lib/game_dig/node/node_modules/minimist/test/parse_modified.js +11 -0
- data/lib/game_dig/node/node_modules/minimist/test/proto.js +64 -0
- data/lib/game_dig/node/node_modules/minimist/test/short.js +69 -0
- data/lib/game_dig/node/node_modules/minimist/test/stop_early.js +17 -0
- data/lib/game_dig/node/node_modules/minimist/test/unknown.js +104 -0
- data/lib/game_dig/node/node_modules/minimist/test/whitespace.js +10 -0
- data/lib/game_dig/node/node_modules/net/LICENSE +19 -0
- data/lib/game_dig/node/node_modules/net/README.md +0 -0
- data/lib/game_dig/node/node_modules/net/index.js +28 -0
- data/lib/game_dig/node/node_modules/net/package.json +17 -0
- data/lib/game_dig/node/node_modules/net/test.js +6 -0
- data/lib/game_dig/node/node_modules/normalize-url/index.d.ts +342 -0
- data/lib/game_dig/node/node_modules/normalize-url/index.js +308 -0
- data/lib/game_dig/node/node_modules/normalize-url/license +9 -0
- data/lib/game_dig/node/node_modules/normalize-url/package.json +57 -0
- data/lib/game_dig/node/node_modules/normalize-url/readme.md +347 -0
- data/lib/game_dig/node/node_modules/p-cancelable/index.d.ts +168 -0
- data/lib/game_dig/node/node_modules/p-cancelable/index.js +110 -0
- data/lib/game_dig/node/node_modules/p-cancelable/license +9 -0
- data/lib/game_dig/node/node_modules/p-cancelable/package.json +50 -0
- data/lib/game_dig/node/node_modules/p-cancelable/readme.md +152 -0
- data/lib/game_dig/node/node_modules/process-nextick-args/index.js +45 -0
- data/lib/game_dig/node/node_modules/process-nextick-args/license.md +19 -0
- data/lib/game_dig/node/node_modules/process-nextick-args/package.json +25 -0
- data/lib/game_dig/node/node_modules/process-nextick-args/readme.md +18 -0
- data/lib/game_dig/node/node_modules/quick-lru/index.d.ts +97 -0
- data/lib/game_dig/node/node_modules/quick-lru/index.js +123 -0
- data/lib/game_dig/node/node_modules/quick-lru/license +9 -0
- data/lib/game_dig/node/node_modules/quick-lru/package.json +43 -0
- data/lib/game_dig/node/node_modules/quick-lru/readme.md +111 -0
- data/lib/game_dig/node/node_modules/readable-stream/.travis.yml +34 -0
- data/lib/game_dig/node/node_modules/readable-stream/CONTRIBUTING.md +38 -0
- data/lib/game_dig/node/node_modules/readable-stream/GOVERNANCE.md +136 -0
- data/lib/game_dig/node/node_modules/readable-stream/LICENSE +47 -0
- data/lib/game_dig/node/node_modules/readable-stream/README.md +58 -0
- data/lib/game_dig/node/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md +60 -0
- data/lib/game_dig/node/node_modules/readable-stream/duplex-browser.js +1 -0
- data/lib/game_dig/node/node_modules/readable-stream/duplex.js +1 -0
- data/lib/game_dig/node/node_modules/readable-stream/lib/_stream_duplex.js +131 -0
- data/lib/game_dig/node/node_modules/readable-stream/lib/_stream_passthrough.js +47 -0
- data/lib/game_dig/node/node_modules/readable-stream/lib/_stream_readable.js +1019 -0
- data/lib/game_dig/node/node_modules/readable-stream/lib/_stream_transform.js +214 -0
- data/lib/game_dig/node/node_modules/readable-stream/lib/_stream_writable.js +685 -0
- data/lib/game_dig/node/node_modules/readable-stream/lib/internal/streams/BufferList.js +78 -0
- data/lib/game_dig/node/node_modules/readable-stream/lib/internal/streams/destroy.js +84 -0
- data/lib/game_dig/node/node_modules/readable-stream/lib/internal/streams/stream-browser.js +1 -0
- data/lib/game_dig/node/node_modules/readable-stream/lib/internal/streams/stream.js +1 -0
- data/lib/game_dig/node/node_modules/readable-stream/node_modules/isarray/.npmignore +1 -0
- data/lib/game_dig/node/node_modules/readable-stream/node_modules/isarray/.travis.yml +4 -0
- data/lib/game_dig/node/node_modules/readable-stream/node_modules/isarray/Makefile +6 -0
- data/lib/game_dig/node/node_modules/readable-stream/node_modules/isarray/README.md +60 -0
- data/lib/game_dig/node/node_modules/readable-stream/node_modules/isarray/component.json +19 -0
- data/lib/game_dig/node/node_modules/readable-stream/node_modules/isarray/index.js +5 -0
- data/lib/game_dig/node/node_modules/readable-stream/node_modules/isarray/package.json +45 -0
- data/lib/game_dig/node/node_modules/readable-stream/node_modules/isarray/test.js +20 -0
- data/lib/game_dig/node/node_modules/readable-stream/node_modules/string_decoder/.travis.yml +50 -0
- data/lib/game_dig/node/node_modules/readable-stream/node_modules/string_decoder/LICENSE +48 -0
- data/lib/game_dig/node/node_modules/readable-stream/node_modules/string_decoder/README.md +47 -0
- data/lib/game_dig/node/node_modules/readable-stream/node_modules/string_decoder/lib/string_decoder.js +296 -0
- data/lib/game_dig/node/node_modules/readable-stream/node_modules/string_decoder/package.json +31 -0
- data/lib/game_dig/node/node_modules/readable-stream/package.json +52 -0
- data/lib/game_dig/node/node_modules/readable-stream/passthrough.js +1 -0
- data/lib/game_dig/node/node_modules/readable-stream/readable-browser.js +7 -0
- data/lib/game_dig/node/node_modules/readable-stream/readable.js +19 -0
- data/lib/game_dig/node/node_modules/readable-stream/transform.js +1 -0
- data/lib/game_dig/node/node_modules/readable-stream/writable-browser.js +1 -0
- data/lib/game_dig/node/node_modules/readable-stream/writable.js +8 -0
- data/lib/game_dig/node/node_modules/resolve-alpn/LICENSE +22 -0
- data/lib/game_dig/node/node_modules/resolve-alpn/README.md +60 -0
- data/lib/game_dig/node/node_modules/resolve-alpn/index.js +43 -0
- data/lib/game_dig/node/node_modules/resolve-alpn/package.json +34 -0
- data/lib/game_dig/node/node_modules/responselike/LICENSE +19 -0
- data/lib/game_dig/node/node_modules/responselike/README.md +77 -0
- data/lib/game_dig/node/node_modules/responselike/index.d.ts +86 -0
- data/lib/game_dig/node/node_modules/responselike/index.js +39 -0
- data/lib/game_dig/node/node_modules/responselike/license +10 -0
- data/lib/game_dig/node/node_modules/responselike/package.json +39 -0
- data/lib/game_dig/node/node_modules/responselike/readme.md +75 -0
- data/lib/game_dig/node/node_modules/safe-buffer/LICENSE +21 -0
- data/lib/game_dig/node/node_modules/safe-buffer/README.md +584 -0
- data/lib/game_dig/node/node_modules/safe-buffer/index.d.ts +187 -0
- data/lib/game_dig/node/node_modules/safe-buffer/index.js +62 -0
- data/lib/game_dig/node/node_modules/safe-buffer/package.json +37 -0
- data/lib/game_dig/node/node_modules/safer-buffer/LICENSE +21 -0
- data/lib/game_dig/node/node_modules/safer-buffer/Porting-Buffer.md +268 -0
- data/lib/game_dig/node/node_modules/safer-buffer/Readme.md +156 -0
- data/lib/game_dig/node/node_modules/safer-buffer/dangerous.js +58 -0
- data/lib/game_dig/node/node_modules/safer-buffer/package.json +34 -0
- data/lib/game_dig/node/node_modules/safer-buffer/safer.js +77 -0
- data/lib/game_dig/node/node_modules/safer-buffer/tests.js +406 -0
- data/lib/game_dig/node/node_modules/sax/LICENSE +41 -0
- data/lib/game_dig/node/node_modules/sax/README.md +225 -0
- data/lib/game_dig/node/node_modules/sax/lib/sax.js +1565 -0
- data/lib/game_dig/node/node_modules/sax/package.json +25 -0
- data/lib/game_dig/node/node_modules/seek-bzip/LICENSE +26 -0
- data/lib/game_dig/node/node_modules/seek-bzip/README.md +185 -0
- data/lib/game_dig/node/node_modules/seek-bzip/bin/seek-bunzip +129 -0
- data/lib/game_dig/node/node_modules/seek-bzip/bin/seek-bzip-table +71 -0
- data/lib/game_dig/node/node_modules/seek-bzip/lib/bitreader.js +94 -0
- data/lib/game_dig/node/node_modules/seek-bzip/lib/crc32.js +104 -0
- data/lib/game_dig/node/node_modules/seek-bzip/lib/index.js +605 -0
- data/lib/game_dig/node/node_modules/seek-bzip/lib/stream.js +42 -0
- data/lib/game_dig/node/node_modules/seek-bzip/package.json +34 -0
- data/lib/game_dig/node/node_modules/stream/.npmignore +3 -0
- data/lib/game_dig/node/node_modules/stream/Makefile +11 -0
- data/lib/game_dig/node/node_modules/stream/README.md +59 -0
- data/lib/game_dig/node/node_modules/stream/component.json +19 -0
- data/lib/game_dig/node/node_modules/stream/index.js +115 -0
- data/lib/game_dig/node/node_modules/stream/package.json +25 -0
- data/lib/game_dig/node/node_modules/stream/test.html +173 -0
- data/lib/game_dig/node/node_modules/string-to-stream/LICENSE +20 -0
- data/lib/game_dig/node/node_modules/string-to-stream/README.md +34 -0
- data/lib/game_dig/node/node_modules/string-to-stream/index.js +23 -0
- data/lib/game_dig/node/node_modules/string-to-stream/package.json +53 -0
- data/lib/game_dig/node/node_modules/string_decoder/.npmignore +2 -0
- data/lib/game_dig/node/node_modules/string_decoder/LICENSE +20 -0
- data/lib/game_dig/node/node_modules/string_decoder/README.md +7 -0
- data/lib/game_dig/node/node_modules/string_decoder/index.js +221 -0
- data/lib/game_dig/node/node_modules/string_decoder/package.json +25 -0
- data/lib/game_dig/node/node_modules/strnum/.github/SECURITY.md +5 -0
- data/lib/game_dig/node/node_modules/strnum/.vscode/launch.json +25 -0
- data/lib/game_dig/node/node_modules/strnum/CHANGELOG.md +33 -0
- data/lib/game_dig/node/node_modules/strnum/LICENSE +21 -0
- data/lib/game_dig/node/node_modules/strnum/README.md +97 -0
- data/lib/game_dig/node/node_modules/strnum/algo.stflow +84 -0
- data/lib/game_dig/node/node_modules/strnum/package.json +31 -0
- data/lib/game_dig/node/node_modules/strnum/strnum.js +129 -0
- data/lib/game_dig/node/node_modules/strnum/strnum.test.js +173 -0
- data/lib/game_dig/node/node_modules/strnum/test.js +9 -0
- data/lib/game_dig/node/node_modules/telnet-client/LICENSE +8 -0
- data/lib/game_dig/node/node_modules/telnet-client/README.md +363 -0
- data/lib/game_dig/node/node_modules/telnet-client/lib/index.d.ts +92 -0
- data/lib/game_dig/node/node_modules/telnet-client/lib/index.js +506 -0
- data/lib/game_dig/node/node_modules/telnet-client/lib/index.js.map +1 -0
- data/lib/game_dig/node/node_modules/telnet-client/lib/utils.d.ts +15 -0
- data/lib/game_dig/node/node_modules/telnet-client/lib/utils.js +34 -0
- data/lib/game_dig/node/node_modules/telnet-client/lib/utils.js.map +1 -0
- data/lib/game_dig/node/node_modules/telnet-client/package.json +103 -0
- data/lib/game_dig/node/node_modules/util-deprecate/History.md +16 -0
- data/lib/game_dig/node/node_modules/util-deprecate/LICENSE +24 -0
- data/lib/game_dig/node/node_modules/util-deprecate/README.md +53 -0
- data/lib/game_dig/node/node_modules/util-deprecate/browser.js +67 -0
- data/lib/game_dig/node/node_modules/util-deprecate/node.js +6 -0
- data/lib/game_dig/node/node_modules/util-deprecate/package.json +27 -0
- data/lib/game_dig/node/node_modules/varint/README.md +53 -0
- data/lib/game_dig/node/node_modules/varint/bench.js +57 -0
- data/lib/game_dig/node/node_modules/varint/decode.js +29 -0
- data/lib/game_dig/node/node_modules/varint/encode.js +30 -0
- data/lib/game_dig/node/node_modules/varint/index.js +5 -0
- data/lib/game_dig/node/node_modules/varint/length.js +25 -0
- data/lib/game_dig/node/node_modules/varint/package.json +24 -0
- data/lib/game_dig/node/node_modules/varint/test.js +156 -0
- data/lib/game_dig/node/node_modules/xmlbuilder/.npmignore +5 -0
- data/lib/game_dig/node/node_modules/xmlbuilder/CHANGELOG.md +395 -0
- data/lib/game_dig/node/node_modules/xmlbuilder/LICENSE +21 -0
- data/lib/game_dig/node/node_modules/xmlbuilder/README.md +85 -0
- data/lib/game_dig/node/node_modules/xmlbuilder/lib/Utility.js +139 -0
- data/lib/game_dig/node/node_modules/xmlbuilder/lib/XMLAttribute.js +31 -0
- data/lib/game_dig/node/node_modules/xmlbuilder/lib/XMLCData.js +32 -0
- data/lib/game_dig/node/node_modules/xmlbuilder/lib/XMLComment.js +32 -0
- data/lib/game_dig/node/node_modules/xmlbuilder/lib/XMLDTDAttList.js +50 -0
- data/lib/game_dig/node/node_modules/xmlbuilder/lib/XMLDTDElement.js +35 -0
- data/lib/game_dig/node/node_modules/xmlbuilder/lib/XMLDTDEntity.js +56 -0
- data/lib/game_dig/node/node_modules/xmlbuilder/lib/XMLDTDNotation.js +37 -0
- data/lib/game_dig/node/node_modules/xmlbuilder/lib/XMLDeclaration.js +40 -0
- data/lib/game_dig/node/node_modules/xmlbuilder/lib/XMLDocType.js +107 -0
- data/lib/game_dig/node/node_modules/xmlbuilder/lib/XMLDocument.js +48 -0
- data/lib/game_dig/node/node_modules/xmlbuilder/lib/XMLDocumentCB.js +402 -0
- data/lib/game_dig/node/node_modules/xmlbuilder/lib/XMLElement.js +111 -0
- data/lib/game_dig/node/node_modules/xmlbuilder/lib/XMLNode.js +432 -0
- data/lib/game_dig/node/node_modules/xmlbuilder/lib/XMLProcessingInstruction.js +35 -0
- data/lib/game_dig/node/node_modules/xmlbuilder/lib/XMLRaw.js +32 -0
- data/lib/game_dig/node/node_modules/xmlbuilder/lib/XMLStreamWriter.js +278 -0
- data/lib/game_dig/node/node_modules/xmlbuilder/lib/XMLStringWriter.js +302 -0
- data/lib/game_dig/node/node_modules/xmlbuilder/lib/XMLStringifier.js +192 -0
- data/lib/game_dig/node/node_modules/xmlbuilder/lib/XMLText.js +32 -0
- data/lib/game_dig/node/node_modules/xmlbuilder/lib/XMLWriterBase.js +68 -0
- data/lib/game_dig/node/node_modules/xmlbuilder/lib/index.js +53 -0
- data/lib/game_dig/node/node_modules/xmlbuilder/package.json +37 -0
- data/lib/game_dig/node/node_modules/xmlrpc/.idea/date_formatter.js +77 -0
- data/lib/game_dig/node/node_modules/xmlrpc/.npmignore +5 -0
- data/lib/game_dig/node/node_modules/xmlrpc/.travis.yml +6 -0
- data/lib/game_dig/node/node_modules/xmlrpc/HISTORY.md +129 -0
- data/lib/game_dig/node/node_modules/xmlrpc/LICENSE +23 -0
- data/lib/game_dig/node/node_modules/xmlrpc/README.md +235 -0
- data/lib/game_dig/node/node_modules/xmlrpc/lib/client.js +177 -0
- data/lib/game_dig/node/node_modules/xmlrpc/lib/cookies.js +111 -0
- data/lib/game_dig/node/node_modules/xmlrpc/lib/customtype.js +10 -0
- data/lib/game_dig/node/node_modules/xmlrpc/lib/date_formatter.js +188 -0
- data/lib/game_dig/node/node_modules/xmlrpc/lib/deserializer.js +324 -0
- data/lib/game_dig/node/node_modules/xmlrpc/lib/serializer.js +202 -0
- data/lib/game_dig/node/node_modules/xmlrpc/lib/server.js +78 -0
- data/lib/game_dig/node/node_modules/xmlrpc/lib/xmlrpc.js +65 -0
- data/lib/game_dig/node/node_modules/xmlrpc/package.json +35 -0
- data/lib/game_dig/node/node_modules/xmlrpc/tmp/client.js +28 -0
- data/lib/game_dig/node/node_modules/xmlrpc/tmp/server.crt +13 -0
- data/lib/game_dig/node/node_modules/xmlrpc/tmp/server.csr +11 -0
- data/lib/game_dig/node/node_modules/xmlrpc/tmp/server.js +10 -0
- data/lib/game_dig/node/node_modules/xmlrpc/tmp/server.key +15 -0
- data/lib/game_dig/node/node_modules/xmlrpc/tmp/server.key.org +18 -0
- data/lib/game_dig/node/package.json +8 -0
- data/lib/game_dig/node/yarn.lock +359 -0
- data/lib/game_dig/nodo.rb +54 -0
- data/lib/game_dig/query_result.rb +71 -0
- data/lib/game_dig/version.rb +1 -1
- data/lib/game_dig.rb +78 -45
- metadata +742 -11
- data/lib/custom_errors/game_dig_cli_not_found.rb +0 -2
- data/lib/custom_errors/game_dig_error.rb +0 -2
|
@@ -0,0 +1,1126 @@
|
|
|
1
|
+
import process from 'node:process';
|
|
2
|
+
import { Buffer } from 'node:buffer';
|
|
3
|
+
import { Duplex } from 'node:stream';
|
|
4
|
+
import http, { ServerResponse } from 'node:http';
|
|
5
|
+
import timer from '@szmarczak/http-timer';
|
|
6
|
+
import CacheableRequest, { CacheError as CacheableCacheError, } from 'cacheable-request';
|
|
7
|
+
import decompressResponse from 'decompress-response';
|
|
8
|
+
import is from '@sindresorhus/is';
|
|
9
|
+
import getStream from 'get-stream';
|
|
10
|
+
import { FormDataEncoder, isFormData as isFormDataLike } from 'form-data-encoder';
|
|
11
|
+
import getBodySize from './utils/get-body-size.js';
|
|
12
|
+
import isFormData from './utils/is-form-data.js';
|
|
13
|
+
import proxyEvents from './utils/proxy-events.js';
|
|
14
|
+
import timedOut, { TimeoutError as TimedOutTimeoutError } from './timed-out.js';
|
|
15
|
+
import urlToOptions from './utils/url-to-options.js';
|
|
16
|
+
import WeakableMap from './utils/weakable-map.js';
|
|
17
|
+
import calculateRetryDelay from './calculate-retry-delay.js';
|
|
18
|
+
import Options from './options.js';
|
|
19
|
+
import { isResponseOk } from './response.js';
|
|
20
|
+
import isClientRequest from './utils/is-client-request.js';
|
|
21
|
+
import isUnixSocketURL from './utils/is-unix-socket-url.js';
|
|
22
|
+
import { RequestError, ReadError, MaxRedirectsError, HTTPError, TimeoutError, UploadError, CacheError, AbortError, } from './errors.js';
|
|
23
|
+
const { buffer: getStreamAsBuffer } = getStream;
|
|
24
|
+
const supportsBrotli = is.string(process.versions.brotli);
|
|
25
|
+
const methodsWithoutBody = new Set(['GET', 'HEAD']);
|
|
26
|
+
const cacheableStore = new WeakableMap();
|
|
27
|
+
const redirectCodes = new Set([300, 301, 302, 303, 304, 307, 308]);
|
|
28
|
+
const proxiedRequestEvents = [
|
|
29
|
+
'socket',
|
|
30
|
+
'connect',
|
|
31
|
+
'continue',
|
|
32
|
+
'information',
|
|
33
|
+
'upgrade',
|
|
34
|
+
];
|
|
35
|
+
const noop = () => { };
|
|
36
|
+
export default class Request extends Duplex {
|
|
37
|
+
constructor(url, options, defaults) {
|
|
38
|
+
super({
|
|
39
|
+
// Don't destroy immediately, as the error may be emitted on unsuccessful retry
|
|
40
|
+
autoDestroy: false,
|
|
41
|
+
// It needs to be zero because we're just proxying the data to another stream
|
|
42
|
+
highWaterMark: 0,
|
|
43
|
+
});
|
|
44
|
+
// @ts-expect-error - Ignoring for now.
|
|
45
|
+
Object.defineProperty(this, 'constructor', {
|
|
46
|
+
enumerable: true,
|
|
47
|
+
configurable: true,
|
|
48
|
+
writable: true,
|
|
49
|
+
value: void 0
|
|
50
|
+
});
|
|
51
|
+
Object.defineProperty(this, "_noPipe", {
|
|
52
|
+
enumerable: true,
|
|
53
|
+
configurable: true,
|
|
54
|
+
writable: true,
|
|
55
|
+
value: void 0
|
|
56
|
+
});
|
|
57
|
+
// @ts-expect-error https://github.com/microsoft/TypeScript/issues/9568
|
|
58
|
+
Object.defineProperty(this, "options", {
|
|
59
|
+
enumerable: true,
|
|
60
|
+
configurable: true,
|
|
61
|
+
writable: true,
|
|
62
|
+
value: void 0
|
|
63
|
+
});
|
|
64
|
+
Object.defineProperty(this, "response", {
|
|
65
|
+
enumerable: true,
|
|
66
|
+
configurable: true,
|
|
67
|
+
writable: true,
|
|
68
|
+
value: void 0
|
|
69
|
+
});
|
|
70
|
+
Object.defineProperty(this, "requestUrl", {
|
|
71
|
+
enumerable: true,
|
|
72
|
+
configurable: true,
|
|
73
|
+
writable: true,
|
|
74
|
+
value: void 0
|
|
75
|
+
});
|
|
76
|
+
Object.defineProperty(this, "redirectUrls", {
|
|
77
|
+
enumerable: true,
|
|
78
|
+
configurable: true,
|
|
79
|
+
writable: true,
|
|
80
|
+
value: void 0
|
|
81
|
+
});
|
|
82
|
+
Object.defineProperty(this, "retryCount", {
|
|
83
|
+
enumerable: true,
|
|
84
|
+
configurable: true,
|
|
85
|
+
writable: true,
|
|
86
|
+
value: void 0
|
|
87
|
+
});
|
|
88
|
+
Object.defineProperty(this, "_stopRetry", {
|
|
89
|
+
enumerable: true,
|
|
90
|
+
configurable: true,
|
|
91
|
+
writable: true,
|
|
92
|
+
value: void 0
|
|
93
|
+
});
|
|
94
|
+
Object.defineProperty(this, "_downloadedSize", {
|
|
95
|
+
enumerable: true,
|
|
96
|
+
configurable: true,
|
|
97
|
+
writable: true,
|
|
98
|
+
value: void 0
|
|
99
|
+
});
|
|
100
|
+
Object.defineProperty(this, "_uploadedSize", {
|
|
101
|
+
enumerable: true,
|
|
102
|
+
configurable: true,
|
|
103
|
+
writable: true,
|
|
104
|
+
value: void 0
|
|
105
|
+
});
|
|
106
|
+
Object.defineProperty(this, "_stopReading", {
|
|
107
|
+
enumerable: true,
|
|
108
|
+
configurable: true,
|
|
109
|
+
writable: true,
|
|
110
|
+
value: void 0
|
|
111
|
+
});
|
|
112
|
+
Object.defineProperty(this, "_pipedServerResponses", {
|
|
113
|
+
enumerable: true,
|
|
114
|
+
configurable: true,
|
|
115
|
+
writable: true,
|
|
116
|
+
value: void 0
|
|
117
|
+
});
|
|
118
|
+
Object.defineProperty(this, "_request", {
|
|
119
|
+
enumerable: true,
|
|
120
|
+
configurable: true,
|
|
121
|
+
writable: true,
|
|
122
|
+
value: void 0
|
|
123
|
+
});
|
|
124
|
+
Object.defineProperty(this, "_responseSize", {
|
|
125
|
+
enumerable: true,
|
|
126
|
+
configurable: true,
|
|
127
|
+
writable: true,
|
|
128
|
+
value: void 0
|
|
129
|
+
});
|
|
130
|
+
Object.defineProperty(this, "_bodySize", {
|
|
131
|
+
enumerable: true,
|
|
132
|
+
configurable: true,
|
|
133
|
+
writable: true,
|
|
134
|
+
value: void 0
|
|
135
|
+
});
|
|
136
|
+
Object.defineProperty(this, "_unproxyEvents", {
|
|
137
|
+
enumerable: true,
|
|
138
|
+
configurable: true,
|
|
139
|
+
writable: true,
|
|
140
|
+
value: void 0
|
|
141
|
+
});
|
|
142
|
+
Object.defineProperty(this, "_isFromCache", {
|
|
143
|
+
enumerable: true,
|
|
144
|
+
configurable: true,
|
|
145
|
+
writable: true,
|
|
146
|
+
value: void 0
|
|
147
|
+
});
|
|
148
|
+
Object.defineProperty(this, "_cannotHaveBody", {
|
|
149
|
+
enumerable: true,
|
|
150
|
+
configurable: true,
|
|
151
|
+
writable: true,
|
|
152
|
+
value: void 0
|
|
153
|
+
});
|
|
154
|
+
Object.defineProperty(this, "_triggerRead", {
|
|
155
|
+
enumerable: true,
|
|
156
|
+
configurable: true,
|
|
157
|
+
writable: true,
|
|
158
|
+
value: void 0
|
|
159
|
+
});
|
|
160
|
+
Object.defineProperty(this, "_cancelTimeouts", {
|
|
161
|
+
enumerable: true,
|
|
162
|
+
configurable: true,
|
|
163
|
+
writable: true,
|
|
164
|
+
value: void 0
|
|
165
|
+
});
|
|
166
|
+
Object.defineProperty(this, "_removeListeners", {
|
|
167
|
+
enumerable: true,
|
|
168
|
+
configurable: true,
|
|
169
|
+
writable: true,
|
|
170
|
+
value: void 0
|
|
171
|
+
});
|
|
172
|
+
Object.defineProperty(this, "_nativeResponse", {
|
|
173
|
+
enumerable: true,
|
|
174
|
+
configurable: true,
|
|
175
|
+
writable: true,
|
|
176
|
+
value: void 0
|
|
177
|
+
});
|
|
178
|
+
Object.defineProperty(this, "_flushed", {
|
|
179
|
+
enumerable: true,
|
|
180
|
+
configurable: true,
|
|
181
|
+
writable: true,
|
|
182
|
+
value: void 0
|
|
183
|
+
});
|
|
184
|
+
Object.defineProperty(this, "_aborted", {
|
|
185
|
+
enumerable: true,
|
|
186
|
+
configurable: true,
|
|
187
|
+
writable: true,
|
|
188
|
+
value: void 0
|
|
189
|
+
});
|
|
190
|
+
// We need this because `this._request` if `undefined` when using cache
|
|
191
|
+
Object.defineProperty(this, "_requestInitialized", {
|
|
192
|
+
enumerable: true,
|
|
193
|
+
configurable: true,
|
|
194
|
+
writable: true,
|
|
195
|
+
value: void 0
|
|
196
|
+
});
|
|
197
|
+
this._downloadedSize = 0;
|
|
198
|
+
this._uploadedSize = 0;
|
|
199
|
+
this._stopReading = false;
|
|
200
|
+
this._pipedServerResponses = new Set();
|
|
201
|
+
this._cannotHaveBody = false;
|
|
202
|
+
this._unproxyEvents = noop;
|
|
203
|
+
this._triggerRead = false;
|
|
204
|
+
this._cancelTimeouts = noop;
|
|
205
|
+
this._removeListeners = noop;
|
|
206
|
+
this._jobs = [];
|
|
207
|
+
this._flushed = false;
|
|
208
|
+
this._requestInitialized = false;
|
|
209
|
+
this._aborted = false;
|
|
210
|
+
this.redirectUrls = [];
|
|
211
|
+
this.retryCount = 0;
|
|
212
|
+
this._stopRetry = noop;
|
|
213
|
+
this.on('pipe', (source) => {
|
|
214
|
+
if (source?.headers) {
|
|
215
|
+
Object.assign(this.options.headers, source.headers);
|
|
216
|
+
}
|
|
217
|
+
});
|
|
218
|
+
this.on('newListener', event => {
|
|
219
|
+
if (event === 'retry' && this.listenerCount('retry') > 0) {
|
|
220
|
+
throw new Error('A retry listener has been attached already.');
|
|
221
|
+
}
|
|
222
|
+
});
|
|
223
|
+
try {
|
|
224
|
+
this.options = new Options(url, options, defaults);
|
|
225
|
+
if (!this.options.url) {
|
|
226
|
+
if (this.options.prefixUrl === '') {
|
|
227
|
+
throw new TypeError('Missing `url` property');
|
|
228
|
+
}
|
|
229
|
+
this.options.url = '';
|
|
230
|
+
}
|
|
231
|
+
this.requestUrl = this.options.url;
|
|
232
|
+
}
|
|
233
|
+
catch (error) {
|
|
234
|
+
const { options } = error;
|
|
235
|
+
if (options) {
|
|
236
|
+
this.options = options;
|
|
237
|
+
}
|
|
238
|
+
this.flush = async () => {
|
|
239
|
+
this.flush = async () => { };
|
|
240
|
+
this.destroy(error);
|
|
241
|
+
};
|
|
242
|
+
return;
|
|
243
|
+
}
|
|
244
|
+
// Important! If you replace `body` in a handler with another stream, make sure it's readable first.
|
|
245
|
+
// The below is run only once.
|
|
246
|
+
const { body } = this.options;
|
|
247
|
+
if (is.nodeStream(body)) {
|
|
248
|
+
body.once('error', error => {
|
|
249
|
+
if (this._flushed) {
|
|
250
|
+
this._beforeError(new UploadError(error, this));
|
|
251
|
+
}
|
|
252
|
+
else {
|
|
253
|
+
this.flush = async () => {
|
|
254
|
+
this.flush = async () => { };
|
|
255
|
+
this._beforeError(new UploadError(error, this));
|
|
256
|
+
};
|
|
257
|
+
}
|
|
258
|
+
});
|
|
259
|
+
}
|
|
260
|
+
if (this.options.signal) {
|
|
261
|
+
const abort = () => {
|
|
262
|
+
this.destroy(new AbortError(this));
|
|
263
|
+
};
|
|
264
|
+
if (this.options.signal.aborted) {
|
|
265
|
+
abort();
|
|
266
|
+
}
|
|
267
|
+
else {
|
|
268
|
+
this.options.signal.addEventListener('abort', abort);
|
|
269
|
+
this._removeListeners = () => {
|
|
270
|
+
this.options.signal?.removeEventListener('abort', abort);
|
|
271
|
+
};
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
async flush() {
|
|
276
|
+
if (this._flushed) {
|
|
277
|
+
return;
|
|
278
|
+
}
|
|
279
|
+
this._flushed = true;
|
|
280
|
+
try {
|
|
281
|
+
await this._finalizeBody();
|
|
282
|
+
if (this.destroyed) {
|
|
283
|
+
return;
|
|
284
|
+
}
|
|
285
|
+
await this._makeRequest();
|
|
286
|
+
if (this.destroyed) {
|
|
287
|
+
this._request?.destroy();
|
|
288
|
+
return;
|
|
289
|
+
}
|
|
290
|
+
// Queued writes etc.
|
|
291
|
+
for (const job of this._jobs) {
|
|
292
|
+
job();
|
|
293
|
+
}
|
|
294
|
+
// Prevent memory leak
|
|
295
|
+
this._jobs.length = 0;
|
|
296
|
+
this._requestInitialized = true;
|
|
297
|
+
}
|
|
298
|
+
catch (error) {
|
|
299
|
+
this._beforeError(error);
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
_beforeError(error) {
|
|
303
|
+
if (this._stopReading) {
|
|
304
|
+
return;
|
|
305
|
+
}
|
|
306
|
+
const { response, options } = this;
|
|
307
|
+
const attemptCount = this.retryCount + (error.name === 'RetryError' ? 0 : 1);
|
|
308
|
+
this._stopReading = true;
|
|
309
|
+
if (!(error instanceof RequestError)) {
|
|
310
|
+
error = new RequestError(error.message, error, this);
|
|
311
|
+
}
|
|
312
|
+
const typedError = error;
|
|
313
|
+
void (async () => {
|
|
314
|
+
// Node.js parser is really weird.
|
|
315
|
+
// It emits post-request Parse Errors on the same instance as previous request. WTF.
|
|
316
|
+
// Therefore we need to check if it has been destroyed as well.
|
|
317
|
+
//
|
|
318
|
+
// Furthermore, Node.js 16 `response.destroy()` doesn't immediately destroy the socket,
|
|
319
|
+
// but makes the response unreadable. So we additionally need to check `response.readable`.
|
|
320
|
+
if (response?.readable && !response.rawBody && !this._request?.socket?.destroyed) {
|
|
321
|
+
// @types/node has incorrect typings. `setEncoding` accepts `null` as well.
|
|
322
|
+
response.setEncoding(this.readableEncoding);
|
|
323
|
+
const success = await this._setRawBody(response);
|
|
324
|
+
if (success) {
|
|
325
|
+
response.body = response.rawBody.toString();
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
if (this.listenerCount('retry') !== 0) {
|
|
329
|
+
let backoff;
|
|
330
|
+
try {
|
|
331
|
+
let retryAfter;
|
|
332
|
+
if (response && 'retry-after' in response.headers) {
|
|
333
|
+
retryAfter = Number(response.headers['retry-after']);
|
|
334
|
+
if (Number.isNaN(retryAfter)) {
|
|
335
|
+
retryAfter = Date.parse(response.headers['retry-after']) - Date.now();
|
|
336
|
+
if (retryAfter <= 0) {
|
|
337
|
+
retryAfter = 1;
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
else {
|
|
341
|
+
retryAfter *= 1000;
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
const retryOptions = options.retry;
|
|
345
|
+
backoff = await retryOptions.calculateDelay({
|
|
346
|
+
attemptCount,
|
|
347
|
+
retryOptions,
|
|
348
|
+
error: typedError,
|
|
349
|
+
retryAfter,
|
|
350
|
+
computedValue: calculateRetryDelay({
|
|
351
|
+
attemptCount,
|
|
352
|
+
retryOptions,
|
|
353
|
+
error: typedError,
|
|
354
|
+
retryAfter,
|
|
355
|
+
computedValue: retryOptions.maxRetryAfter ?? options.timeout.request ?? Number.POSITIVE_INFINITY,
|
|
356
|
+
}),
|
|
357
|
+
});
|
|
358
|
+
}
|
|
359
|
+
catch (error_) {
|
|
360
|
+
void this._error(new RequestError(error_.message, error_, this));
|
|
361
|
+
return;
|
|
362
|
+
}
|
|
363
|
+
if (backoff) {
|
|
364
|
+
await new Promise(resolve => {
|
|
365
|
+
const timeout = setTimeout(resolve, backoff);
|
|
366
|
+
this._stopRetry = () => {
|
|
367
|
+
clearTimeout(timeout);
|
|
368
|
+
resolve();
|
|
369
|
+
};
|
|
370
|
+
});
|
|
371
|
+
// Something forced us to abort the retry
|
|
372
|
+
if (this.destroyed) {
|
|
373
|
+
return;
|
|
374
|
+
}
|
|
375
|
+
try {
|
|
376
|
+
for (const hook of this.options.hooks.beforeRetry) {
|
|
377
|
+
// eslint-disable-next-line no-await-in-loop
|
|
378
|
+
await hook(typedError, this.retryCount + 1);
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
catch (error_) {
|
|
382
|
+
void this._error(new RequestError(error_.message, error, this));
|
|
383
|
+
return;
|
|
384
|
+
}
|
|
385
|
+
// Something forced us to abort the retry
|
|
386
|
+
if (this.destroyed) {
|
|
387
|
+
return;
|
|
388
|
+
}
|
|
389
|
+
this.destroy();
|
|
390
|
+
this.emit('retry', this.retryCount + 1, error, (updatedOptions) => {
|
|
391
|
+
const request = new Request(options.url, updatedOptions, options);
|
|
392
|
+
request.retryCount = this.retryCount + 1;
|
|
393
|
+
process.nextTick(() => {
|
|
394
|
+
void request.flush();
|
|
395
|
+
});
|
|
396
|
+
return request;
|
|
397
|
+
});
|
|
398
|
+
return;
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
|
+
void this._error(typedError);
|
|
402
|
+
})();
|
|
403
|
+
}
|
|
404
|
+
_read() {
|
|
405
|
+
this._triggerRead = true;
|
|
406
|
+
const { response } = this;
|
|
407
|
+
if (response && !this._stopReading) {
|
|
408
|
+
// We cannot put this in the `if` above
|
|
409
|
+
// because `.read()` also triggers the `end` event
|
|
410
|
+
if (response.readableLength) {
|
|
411
|
+
this._triggerRead = false;
|
|
412
|
+
}
|
|
413
|
+
let data;
|
|
414
|
+
while ((data = response.read()) !== null) {
|
|
415
|
+
this._downloadedSize += data.length; // eslint-disable-line @typescript-eslint/restrict-plus-operands
|
|
416
|
+
const progress = this.downloadProgress;
|
|
417
|
+
if (progress.percent < 1) {
|
|
418
|
+
this.emit('downloadProgress', progress);
|
|
419
|
+
}
|
|
420
|
+
this.push(data);
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
_write(chunk, encoding, callback) {
|
|
425
|
+
const write = () => {
|
|
426
|
+
this._writeRequest(chunk, encoding, callback);
|
|
427
|
+
};
|
|
428
|
+
if (this._requestInitialized) {
|
|
429
|
+
write();
|
|
430
|
+
}
|
|
431
|
+
else {
|
|
432
|
+
this._jobs.push(write);
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
_final(callback) {
|
|
436
|
+
const endRequest = () => {
|
|
437
|
+
// We need to check if `this._request` is present,
|
|
438
|
+
// because it isn't when we use cache.
|
|
439
|
+
if (!this._request || this._request.destroyed) {
|
|
440
|
+
callback();
|
|
441
|
+
return;
|
|
442
|
+
}
|
|
443
|
+
this._request.end((error) => {
|
|
444
|
+
// The request has been destroyed before `_final` finished.
|
|
445
|
+
// See https://github.com/nodejs/node/issues/39356
|
|
446
|
+
if (this._request._writableState?.errored) {
|
|
447
|
+
return;
|
|
448
|
+
}
|
|
449
|
+
if (!error) {
|
|
450
|
+
this._bodySize = this._uploadedSize;
|
|
451
|
+
this.emit('uploadProgress', this.uploadProgress);
|
|
452
|
+
this._request.emit('upload-complete');
|
|
453
|
+
}
|
|
454
|
+
callback(error);
|
|
455
|
+
});
|
|
456
|
+
};
|
|
457
|
+
if (this._requestInitialized) {
|
|
458
|
+
endRequest();
|
|
459
|
+
}
|
|
460
|
+
else {
|
|
461
|
+
this._jobs.push(endRequest);
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
_destroy(error, callback) {
|
|
465
|
+
this._stopReading = true;
|
|
466
|
+
this.flush = async () => { };
|
|
467
|
+
// Prevent further retries
|
|
468
|
+
this._stopRetry();
|
|
469
|
+
this._cancelTimeouts();
|
|
470
|
+
this._removeListeners();
|
|
471
|
+
if (this.options) {
|
|
472
|
+
const { body } = this.options;
|
|
473
|
+
if (is.nodeStream(body)) {
|
|
474
|
+
body.destroy();
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
if (this._request) {
|
|
478
|
+
this._request.destroy();
|
|
479
|
+
}
|
|
480
|
+
if (error !== null && !is.undefined(error) && !(error instanceof RequestError)) {
|
|
481
|
+
error = new RequestError(error.message, error, this);
|
|
482
|
+
}
|
|
483
|
+
callback(error);
|
|
484
|
+
}
|
|
485
|
+
pipe(destination, options) {
|
|
486
|
+
if (destination instanceof ServerResponse) {
|
|
487
|
+
this._pipedServerResponses.add(destination);
|
|
488
|
+
}
|
|
489
|
+
return super.pipe(destination, options);
|
|
490
|
+
}
|
|
491
|
+
unpipe(destination) {
|
|
492
|
+
if (destination instanceof ServerResponse) {
|
|
493
|
+
this._pipedServerResponses.delete(destination);
|
|
494
|
+
}
|
|
495
|
+
super.unpipe(destination);
|
|
496
|
+
return this;
|
|
497
|
+
}
|
|
498
|
+
async _finalizeBody() {
|
|
499
|
+
const { options } = this;
|
|
500
|
+
const { headers } = options;
|
|
501
|
+
const isForm = !is.undefined(options.form);
|
|
502
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
503
|
+
const isJSON = !is.undefined(options.json);
|
|
504
|
+
const isBody = !is.undefined(options.body);
|
|
505
|
+
const cannotHaveBody = methodsWithoutBody.has(options.method) && !(options.method === 'GET' && options.allowGetBody);
|
|
506
|
+
this._cannotHaveBody = cannotHaveBody;
|
|
507
|
+
if (isForm || isJSON || isBody) {
|
|
508
|
+
if (cannotHaveBody) {
|
|
509
|
+
throw new TypeError(`The \`${options.method}\` method cannot be used with a body`);
|
|
510
|
+
}
|
|
511
|
+
// Serialize body
|
|
512
|
+
const noContentType = !is.string(headers['content-type']);
|
|
513
|
+
if (isBody) {
|
|
514
|
+
// Body is spec-compliant FormData
|
|
515
|
+
if (isFormDataLike(options.body)) {
|
|
516
|
+
const encoder = new FormDataEncoder(options.body);
|
|
517
|
+
if (noContentType) {
|
|
518
|
+
headers['content-type'] = encoder.headers['Content-Type'];
|
|
519
|
+
}
|
|
520
|
+
if ('Content-Length' in encoder.headers) {
|
|
521
|
+
headers['content-length'] = encoder.headers['Content-Length'];
|
|
522
|
+
}
|
|
523
|
+
options.body = encoder.encode();
|
|
524
|
+
}
|
|
525
|
+
// Special case for https://github.com/form-data/form-data
|
|
526
|
+
if (isFormData(options.body) && noContentType) {
|
|
527
|
+
headers['content-type'] = `multipart/form-data; boundary=${options.body.getBoundary()}`;
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
else if (isForm) {
|
|
531
|
+
if (noContentType) {
|
|
532
|
+
headers['content-type'] = 'application/x-www-form-urlencoded';
|
|
533
|
+
}
|
|
534
|
+
const { form } = options;
|
|
535
|
+
options.form = undefined;
|
|
536
|
+
options.body = (new URLSearchParams(form)).toString();
|
|
537
|
+
}
|
|
538
|
+
else {
|
|
539
|
+
if (noContentType) {
|
|
540
|
+
headers['content-type'] = 'application/json';
|
|
541
|
+
}
|
|
542
|
+
const { json } = options;
|
|
543
|
+
options.json = undefined;
|
|
544
|
+
options.body = options.stringifyJson(json);
|
|
545
|
+
}
|
|
546
|
+
const uploadBodySize = await getBodySize(options.body, options.headers);
|
|
547
|
+
// See https://tools.ietf.org/html/rfc7230#section-3.3.2
|
|
548
|
+
// A user agent SHOULD send a Content-Length in a request message when
|
|
549
|
+
// no Transfer-Encoding is sent and the request method defines a meaning
|
|
550
|
+
// for an enclosed payload body. For example, a Content-Length header
|
|
551
|
+
// field is normally sent in a POST request even when the value is 0
|
|
552
|
+
// (indicating an empty payload body). A user agent SHOULD NOT send a
|
|
553
|
+
// Content-Length header field when the request message does not contain
|
|
554
|
+
// a payload body and the method semantics do not anticipate such a
|
|
555
|
+
// body.
|
|
556
|
+
if (is.undefined(headers['content-length']) && is.undefined(headers['transfer-encoding']) && !cannotHaveBody && !is.undefined(uploadBodySize)) {
|
|
557
|
+
headers['content-length'] = String(uploadBodySize);
|
|
558
|
+
}
|
|
559
|
+
}
|
|
560
|
+
if (options.responseType === 'json' && !('accept' in options.headers)) {
|
|
561
|
+
options.headers.accept = 'application/json';
|
|
562
|
+
}
|
|
563
|
+
this._bodySize = Number(headers['content-length']) || undefined;
|
|
564
|
+
}
|
|
565
|
+
async _onResponseBase(response) {
|
|
566
|
+
// This will be called e.g. when using cache so we need to check if this request has been aborted.
|
|
567
|
+
if (this.isAborted) {
|
|
568
|
+
return;
|
|
569
|
+
}
|
|
570
|
+
const { options } = this;
|
|
571
|
+
const { url } = options;
|
|
572
|
+
this._nativeResponse = response;
|
|
573
|
+
if (options.decompress) {
|
|
574
|
+
response = decompressResponse(response);
|
|
575
|
+
}
|
|
576
|
+
const statusCode = response.statusCode;
|
|
577
|
+
const typedResponse = response;
|
|
578
|
+
typedResponse.statusMessage = typedResponse.statusMessage ?? http.STATUS_CODES[statusCode];
|
|
579
|
+
typedResponse.url = options.url.toString();
|
|
580
|
+
typedResponse.requestUrl = this.requestUrl;
|
|
581
|
+
typedResponse.redirectUrls = this.redirectUrls;
|
|
582
|
+
typedResponse.request = this;
|
|
583
|
+
typedResponse.isFromCache = this._nativeResponse.fromCache ?? false;
|
|
584
|
+
typedResponse.ip = this.ip;
|
|
585
|
+
typedResponse.retryCount = this.retryCount;
|
|
586
|
+
typedResponse.ok = isResponseOk(typedResponse);
|
|
587
|
+
this._isFromCache = typedResponse.isFromCache;
|
|
588
|
+
this._responseSize = Number(response.headers['content-length']) || undefined;
|
|
589
|
+
this.response = typedResponse;
|
|
590
|
+
response.once('end', () => {
|
|
591
|
+
this._responseSize = this._downloadedSize;
|
|
592
|
+
this.emit('downloadProgress', this.downloadProgress);
|
|
593
|
+
});
|
|
594
|
+
response.once('error', (error) => {
|
|
595
|
+
this._aborted = true;
|
|
596
|
+
// Force clean-up, because some packages don't do this.
|
|
597
|
+
// TODO: Fix decompress-response
|
|
598
|
+
response.destroy();
|
|
599
|
+
this._beforeError(new ReadError(error, this));
|
|
600
|
+
});
|
|
601
|
+
response.once('aborted', () => {
|
|
602
|
+
this._aborted = true;
|
|
603
|
+
this._beforeError(new ReadError({
|
|
604
|
+
name: 'Error',
|
|
605
|
+
message: 'The server aborted pending request',
|
|
606
|
+
code: 'ECONNRESET',
|
|
607
|
+
}, this));
|
|
608
|
+
});
|
|
609
|
+
this.emit('downloadProgress', this.downloadProgress);
|
|
610
|
+
const rawCookies = response.headers['set-cookie'];
|
|
611
|
+
if (is.object(options.cookieJar) && rawCookies) {
|
|
612
|
+
let promises = rawCookies.map(async (rawCookie) => options.cookieJar.setCookie(rawCookie, url.toString()));
|
|
613
|
+
if (options.ignoreInvalidCookies) {
|
|
614
|
+
promises = promises.map(async (promise) => {
|
|
615
|
+
try {
|
|
616
|
+
await promise;
|
|
617
|
+
}
|
|
618
|
+
catch { }
|
|
619
|
+
});
|
|
620
|
+
}
|
|
621
|
+
try {
|
|
622
|
+
await Promise.all(promises);
|
|
623
|
+
}
|
|
624
|
+
catch (error) {
|
|
625
|
+
this._beforeError(error);
|
|
626
|
+
return;
|
|
627
|
+
}
|
|
628
|
+
}
|
|
629
|
+
// The above is running a promise, therefore we need to check if this request has been aborted yet again.
|
|
630
|
+
if (this.isAborted) {
|
|
631
|
+
return;
|
|
632
|
+
}
|
|
633
|
+
if (options.followRedirect && response.headers.location && redirectCodes.has(statusCode)) {
|
|
634
|
+
// We're being redirected, we don't care about the response.
|
|
635
|
+
// It'd be best to abort the request, but we can't because
|
|
636
|
+
// we would have to sacrifice the TCP connection. We don't want that.
|
|
637
|
+
response.resume();
|
|
638
|
+
this._cancelTimeouts();
|
|
639
|
+
this._unproxyEvents();
|
|
640
|
+
if (this.redirectUrls.length >= options.maxRedirects) {
|
|
641
|
+
this._beforeError(new MaxRedirectsError(this));
|
|
642
|
+
return;
|
|
643
|
+
}
|
|
644
|
+
this._request = undefined;
|
|
645
|
+
const updatedOptions = new Options(undefined, undefined, this.options);
|
|
646
|
+
const serverRequestedGet = statusCode === 303 && updatedOptions.method !== 'GET' && updatedOptions.method !== 'HEAD';
|
|
647
|
+
const canRewrite = statusCode !== 307 && statusCode !== 308;
|
|
648
|
+
const userRequestedGet = updatedOptions.methodRewriting && canRewrite;
|
|
649
|
+
if (serverRequestedGet || userRequestedGet) {
|
|
650
|
+
updatedOptions.method = 'GET';
|
|
651
|
+
updatedOptions.body = undefined;
|
|
652
|
+
updatedOptions.json = undefined;
|
|
653
|
+
updatedOptions.form = undefined;
|
|
654
|
+
delete updatedOptions.headers['content-length'];
|
|
655
|
+
}
|
|
656
|
+
try {
|
|
657
|
+
// We need this in order to support UTF-8
|
|
658
|
+
const redirectBuffer = Buffer.from(response.headers.location, 'binary').toString();
|
|
659
|
+
const redirectUrl = new URL(redirectBuffer, url);
|
|
660
|
+
if (!isUnixSocketURL(url) && isUnixSocketURL(redirectUrl)) {
|
|
661
|
+
this._beforeError(new RequestError('Cannot redirect to UNIX socket', {}, this));
|
|
662
|
+
return;
|
|
663
|
+
}
|
|
664
|
+
// Redirecting to a different site, clear sensitive data.
|
|
665
|
+
if (redirectUrl.hostname !== url.hostname || redirectUrl.port !== url.port) {
|
|
666
|
+
if ('host' in updatedOptions.headers) {
|
|
667
|
+
delete updatedOptions.headers.host;
|
|
668
|
+
}
|
|
669
|
+
if ('cookie' in updatedOptions.headers) {
|
|
670
|
+
delete updatedOptions.headers.cookie;
|
|
671
|
+
}
|
|
672
|
+
if ('authorization' in updatedOptions.headers) {
|
|
673
|
+
delete updatedOptions.headers.authorization;
|
|
674
|
+
}
|
|
675
|
+
if (updatedOptions.username || updatedOptions.password) {
|
|
676
|
+
updatedOptions.username = '';
|
|
677
|
+
updatedOptions.password = '';
|
|
678
|
+
}
|
|
679
|
+
}
|
|
680
|
+
else {
|
|
681
|
+
redirectUrl.username = updatedOptions.username;
|
|
682
|
+
redirectUrl.password = updatedOptions.password;
|
|
683
|
+
}
|
|
684
|
+
this.redirectUrls.push(redirectUrl);
|
|
685
|
+
updatedOptions.prefixUrl = '';
|
|
686
|
+
updatedOptions.url = redirectUrl;
|
|
687
|
+
for (const hook of updatedOptions.hooks.beforeRedirect) {
|
|
688
|
+
// eslint-disable-next-line no-await-in-loop
|
|
689
|
+
await hook(updatedOptions, typedResponse);
|
|
690
|
+
}
|
|
691
|
+
this.emit('redirect', updatedOptions, typedResponse);
|
|
692
|
+
this.options = updatedOptions;
|
|
693
|
+
await this._makeRequest();
|
|
694
|
+
}
|
|
695
|
+
catch (error) {
|
|
696
|
+
this._beforeError(error);
|
|
697
|
+
return;
|
|
698
|
+
}
|
|
699
|
+
return;
|
|
700
|
+
}
|
|
701
|
+
// `HTTPError`s always have `error.response.body` defined.
|
|
702
|
+
// Therefore we cannot retry if `options.throwHttpErrors` is false.
|
|
703
|
+
// On the last retry, if `options.throwHttpErrors` is false, we would need to return the body,
|
|
704
|
+
// but that wouldn't be possible since the body would be already read in `error.response.body`.
|
|
705
|
+
if (options.isStream && options.throwHttpErrors && !isResponseOk(typedResponse)) {
|
|
706
|
+
this._beforeError(new HTTPError(typedResponse));
|
|
707
|
+
return;
|
|
708
|
+
}
|
|
709
|
+
response.on('readable', () => {
|
|
710
|
+
if (this._triggerRead) {
|
|
711
|
+
this._read();
|
|
712
|
+
}
|
|
713
|
+
});
|
|
714
|
+
this.on('resume', () => {
|
|
715
|
+
response.resume();
|
|
716
|
+
});
|
|
717
|
+
this.on('pause', () => {
|
|
718
|
+
response.pause();
|
|
719
|
+
});
|
|
720
|
+
response.once('end', () => {
|
|
721
|
+
this.push(null);
|
|
722
|
+
});
|
|
723
|
+
if (this._noPipe) {
|
|
724
|
+
const success = await this._setRawBody();
|
|
725
|
+
if (success) {
|
|
726
|
+
this.emit('response', response);
|
|
727
|
+
}
|
|
728
|
+
return;
|
|
729
|
+
}
|
|
730
|
+
this.emit('response', response);
|
|
731
|
+
for (const destination of this._pipedServerResponses) {
|
|
732
|
+
if (destination.headersSent) {
|
|
733
|
+
continue;
|
|
734
|
+
}
|
|
735
|
+
// eslint-disable-next-line guard-for-in
|
|
736
|
+
for (const key in response.headers) {
|
|
737
|
+
const isAllowed = options.decompress ? key !== 'content-encoding' : true;
|
|
738
|
+
const value = response.headers[key];
|
|
739
|
+
if (isAllowed) {
|
|
740
|
+
destination.setHeader(key, value);
|
|
741
|
+
}
|
|
742
|
+
}
|
|
743
|
+
destination.statusCode = statusCode;
|
|
744
|
+
}
|
|
745
|
+
}
|
|
746
|
+
async _setRawBody(from = this) {
|
|
747
|
+
if (from.readableEnded) {
|
|
748
|
+
return false;
|
|
749
|
+
}
|
|
750
|
+
try {
|
|
751
|
+
// Errors are emitted via the `error` event
|
|
752
|
+
const rawBody = await getStreamAsBuffer(from);
|
|
753
|
+
// TODO: Switch to this:
|
|
754
|
+
// let rawBody = await from.toArray();
|
|
755
|
+
// rawBody = Buffer.concat(rawBody);
|
|
756
|
+
// On retry Request is destroyed with no error, therefore the above will successfully resolve.
|
|
757
|
+
// So in order to check if this was really successfull, we need to check if it has been properly ended.
|
|
758
|
+
if (!this.isAborted) {
|
|
759
|
+
this.response.rawBody = rawBody;
|
|
760
|
+
return true;
|
|
761
|
+
}
|
|
762
|
+
}
|
|
763
|
+
catch { }
|
|
764
|
+
return false;
|
|
765
|
+
}
|
|
766
|
+
async _onResponse(response) {
|
|
767
|
+
try {
|
|
768
|
+
await this._onResponseBase(response);
|
|
769
|
+
}
|
|
770
|
+
catch (error) {
|
|
771
|
+
/* istanbul ignore next: better safe than sorry */
|
|
772
|
+
this._beforeError(error);
|
|
773
|
+
}
|
|
774
|
+
}
|
|
775
|
+
_onRequest(request) {
|
|
776
|
+
const { options } = this;
|
|
777
|
+
const { timeout, url } = options;
|
|
778
|
+
timer(request);
|
|
779
|
+
if (this.options.http2) {
|
|
780
|
+
// Unset stream timeout, as the `timeout` option was used only for connection timeout.
|
|
781
|
+
request.setTimeout(0);
|
|
782
|
+
}
|
|
783
|
+
this._cancelTimeouts = timedOut(request, timeout, url);
|
|
784
|
+
const responseEventName = options.cache ? 'cacheableResponse' : 'response';
|
|
785
|
+
request.once(responseEventName, (response) => {
|
|
786
|
+
void this._onResponse(response);
|
|
787
|
+
});
|
|
788
|
+
request.once('error', (error) => {
|
|
789
|
+
this._aborted = true;
|
|
790
|
+
// Force clean-up, because some packages (e.g. nock) don't do this.
|
|
791
|
+
request.destroy();
|
|
792
|
+
error = error instanceof TimedOutTimeoutError ? new TimeoutError(error, this.timings, this) : new RequestError(error.message, error, this);
|
|
793
|
+
this._beforeError(error);
|
|
794
|
+
});
|
|
795
|
+
this._unproxyEvents = proxyEvents(request, this, proxiedRequestEvents);
|
|
796
|
+
this._request = request;
|
|
797
|
+
this.emit('uploadProgress', this.uploadProgress);
|
|
798
|
+
this._sendBody();
|
|
799
|
+
this.emit('request', request);
|
|
800
|
+
}
|
|
801
|
+
async _asyncWrite(chunk) {
|
|
802
|
+
return new Promise((resolve, reject) => {
|
|
803
|
+
super.write(chunk, error => {
|
|
804
|
+
if (error) {
|
|
805
|
+
reject(error);
|
|
806
|
+
return;
|
|
807
|
+
}
|
|
808
|
+
resolve();
|
|
809
|
+
});
|
|
810
|
+
});
|
|
811
|
+
}
|
|
812
|
+
_sendBody() {
|
|
813
|
+
// Send body
|
|
814
|
+
const { body } = this.options;
|
|
815
|
+
const currentRequest = this.redirectUrls.length === 0 ? this : this._request ?? this;
|
|
816
|
+
if (is.nodeStream(body)) {
|
|
817
|
+
body.pipe(currentRequest);
|
|
818
|
+
}
|
|
819
|
+
else if (is.generator(body) || is.asyncGenerator(body)) {
|
|
820
|
+
(async () => {
|
|
821
|
+
try {
|
|
822
|
+
for await (const chunk of body) {
|
|
823
|
+
await this._asyncWrite(chunk);
|
|
824
|
+
}
|
|
825
|
+
super.end();
|
|
826
|
+
}
|
|
827
|
+
catch (error) {
|
|
828
|
+
this._beforeError(error);
|
|
829
|
+
}
|
|
830
|
+
})();
|
|
831
|
+
}
|
|
832
|
+
else if (!is.undefined(body)) {
|
|
833
|
+
this._writeRequest(body, undefined, () => { });
|
|
834
|
+
currentRequest.end();
|
|
835
|
+
}
|
|
836
|
+
else if (this._cannotHaveBody || this._noPipe) {
|
|
837
|
+
currentRequest.end();
|
|
838
|
+
}
|
|
839
|
+
}
|
|
840
|
+
_prepareCache(cache) {
|
|
841
|
+
if (!cacheableStore.has(cache)) {
|
|
842
|
+
const cacheableRequest = new CacheableRequest(((requestOptions, handler) => {
|
|
843
|
+
const result = requestOptions._request(requestOptions, handler);
|
|
844
|
+
// TODO: remove this when `cacheable-request` supports async request functions.
|
|
845
|
+
if (is.promise(result)) {
|
|
846
|
+
// We only need to implement the error handler in order to support HTTP2 caching.
|
|
847
|
+
// The result will be a promise anyway.
|
|
848
|
+
// @ts-expect-error ignore
|
|
849
|
+
result.once = (event, handler) => {
|
|
850
|
+
if (event === 'error') {
|
|
851
|
+
(async () => {
|
|
852
|
+
try {
|
|
853
|
+
await result;
|
|
854
|
+
}
|
|
855
|
+
catch (error) {
|
|
856
|
+
handler(error);
|
|
857
|
+
}
|
|
858
|
+
})();
|
|
859
|
+
}
|
|
860
|
+
else if (event === 'abort') {
|
|
861
|
+
// The empty catch is needed here in case when
|
|
862
|
+
// it rejects before it's `await`ed in `_makeRequest`.
|
|
863
|
+
(async () => {
|
|
864
|
+
try {
|
|
865
|
+
const request = (await result);
|
|
866
|
+
request.once('abort', handler);
|
|
867
|
+
}
|
|
868
|
+
catch { }
|
|
869
|
+
})();
|
|
870
|
+
}
|
|
871
|
+
else {
|
|
872
|
+
/* istanbul ignore next: safety check */
|
|
873
|
+
throw new Error(`Unknown HTTP2 promise event: ${event}`);
|
|
874
|
+
}
|
|
875
|
+
return result;
|
|
876
|
+
};
|
|
877
|
+
}
|
|
878
|
+
return result;
|
|
879
|
+
}), cache);
|
|
880
|
+
cacheableStore.set(cache, cacheableRequest.request());
|
|
881
|
+
}
|
|
882
|
+
}
|
|
883
|
+
async _createCacheableRequest(url, options) {
|
|
884
|
+
return new Promise((resolve, reject) => {
|
|
885
|
+
// TODO: Remove `utils/url-to-options.ts` when `cacheable-request` is fixed
|
|
886
|
+
Object.assign(options, urlToOptions(url));
|
|
887
|
+
let request;
|
|
888
|
+
// TODO: Fix `cacheable-response`. This is ugly.
|
|
889
|
+
const cacheRequest = cacheableStore.get(options.cache)(options, async (response) => {
|
|
890
|
+
response._readableState.autoDestroy = false;
|
|
891
|
+
if (request) {
|
|
892
|
+
const fix = () => {
|
|
893
|
+
if (response.req) {
|
|
894
|
+
response.complete = response.req.res.complete;
|
|
895
|
+
}
|
|
896
|
+
};
|
|
897
|
+
response.prependOnceListener('end', fix);
|
|
898
|
+
fix();
|
|
899
|
+
(await request).emit('cacheableResponse', response);
|
|
900
|
+
}
|
|
901
|
+
resolve(response);
|
|
902
|
+
});
|
|
903
|
+
cacheRequest.once('error', reject);
|
|
904
|
+
cacheRequest.once('request', async (requestOrPromise) => {
|
|
905
|
+
request = requestOrPromise;
|
|
906
|
+
resolve(request);
|
|
907
|
+
});
|
|
908
|
+
});
|
|
909
|
+
}
|
|
910
|
+
async _makeRequest() {
|
|
911
|
+
const { options } = this;
|
|
912
|
+
const { headers, username, password } = options;
|
|
913
|
+
const cookieJar = options.cookieJar;
|
|
914
|
+
for (const key in headers) {
|
|
915
|
+
if (is.undefined(headers[key])) {
|
|
916
|
+
// eslint-disable-next-line @typescript-eslint/no-dynamic-delete
|
|
917
|
+
delete headers[key];
|
|
918
|
+
}
|
|
919
|
+
else if (is.null_(headers[key])) {
|
|
920
|
+
throw new TypeError(`Use \`undefined\` instead of \`null\` to delete the \`${key}\` header`);
|
|
921
|
+
}
|
|
922
|
+
}
|
|
923
|
+
if (options.decompress && is.undefined(headers['accept-encoding'])) {
|
|
924
|
+
headers['accept-encoding'] = supportsBrotli ? 'gzip, deflate, br' : 'gzip, deflate';
|
|
925
|
+
}
|
|
926
|
+
if (username || password) {
|
|
927
|
+
const credentials = Buffer.from(`${username}:${password}`).toString('base64');
|
|
928
|
+
headers.authorization = `Basic ${credentials}`;
|
|
929
|
+
}
|
|
930
|
+
// Set cookies
|
|
931
|
+
if (cookieJar) {
|
|
932
|
+
const cookieString = await cookieJar.getCookieString(options.url.toString());
|
|
933
|
+
if (is.nonEmptyString(cookieString)) {
|
|
934
|
+
headers.cookie = cookieString;
|
|
935
|
+
}
|
|
936
|
+
}
|
|
937
|
+
// Reset `prefixUrl`
|
|
938
|
+
options.prefixUrl = '';
|
|
939
|
+
let request;
|
|
940
|
+
for (const hook of options.hooks.beforeRequest) {
|
|
941
|
+
// eslint-disable-next-line no-await-in-loop
|
|
942
|
+
const result = await hook(options);
|
|
943
|
+
if (!is.undefined(result)) {
|
|
944
|
+
// @ts-expect-error Skip the type mismatch to support abstract responses
|
|
945
|
+
request = () => result;
|
|
946
|
+
break;
|
|
947
|
+
}
|
|
948
|
+
}
|
|
949
|
+
if (!request) {
|
|
950
|
+
request = options.getRequestFunction();
|
|
951
|
+
}
|
|
952
|
+
const url = options.url;
|
|
953
|
+
this._requestOptions = options.createNativeRequestOptions();
|
|
954
|
+
if (options.cache) {
|
|
955
|
+
this._requestOptions._request = request;
|
|
956
|
+
this._requestOptions.cache = options.cache;
|
|
957
|
+
this._requestOptions.body = options.body;
|
|
958
|
+
this._prepareCache(options.cache);
|
|
959
|
+
}
|
|
960
|
+
// Cache support
|
|
961
|
+
const fn = options.cache ? this._createCacheableRequest : request;
|
|
962
|
+
try {
|
|
963
|
+
// We can't do `await fn(...)`,
|
|
964
|
+
// because stream `error` event can be emitted before `Promise.resolve()`.
|
|
965
|
+
let requestOrResponse = fn(url, this._requestOptions);
|
|
966
|
+
if (is.promise(requestOrResponse)) {
|
|
967
|
+
requestOrResponse = await requestOrResponse;
|
|
968
|
+
}
|
|
969
|
+
// Fallback
|
|
970
|
+
if (is.undefined(requestOrResponse)) {
|
|
971
|
+
requestOrResponse = options.getFallbackRequestFunction()(url, this._requestOptions);
|
|
972
|
+
if (is.promise(requestOrResponse)) {
|
|
973
|
+
requestOrResponse = await requestOrResponse;
|
|
974
|
+
}
|
|
975
|
+
}
|
|
976
|
+
if (isClientRequest(requestOrResponse)) {
|
|
977
|
+
this._onRequest(requestOrResponse);
|
|
978
|
+
}
|
|
979
|
+
else if (this.writable) {
|
|
980
|
+
this.once('finish', () => {
|
|
981
|
+
void this._onResponse(requestOrResponse);
|
|
982
|
+
});
|
|
983
|
+
this._sendBody();
|
|
984
|
+
}
|
|
985
|
+
else {
|
|
986
|
+
void this._onResponse(requestOrResponse);
|
|
987
|
+
}
|
|
988
|
+
}
|
|
989
|
+
catch (error) {
|
|
990
|
+
if (error instanceof CacheableCacheError) {
|
|
991
|
+
throw new CacheError(error, this);
|
|
992
|
+
}
|
|
993
|
+
throw error;
|
|
994
|
+
}
|
|
995
|
+
}
|
|
996
|
+
async _error(error) {
|
|
997
|
+
try {
|
|
998
|
+
if (error instanceof HTTPError && !this.options.throwHttpErrors) {
|
|
999
|
+
// This branch can be reached only when using the Promise API
|
|
1000
|
+
// Skip calling the hooks on purpose.
|
|
1001
|
+
// See https://github.com/sindresorhus/got/issues/2103
|
|
1002
|
+
}
|
|
1003
|
+
else {
|
|
1004
|
+
for (const hook of this.options.hooks.beforeError) {
|
|
1005
|
+
// eslint-disable-next-line no-await-in-loop
|
|
1006
|
+
error = await hook(error);
|
|
1007
|
+
}
|
|
1008
|
+
}
|
|
1009
|
+
}
|
|
1010
|
+
catch (error_) {
|
|
1011
|
+
error = new RequestError(error_.message, error_, this);
|
|
1012
|
+
}
|
|
1013
|
+
this.destroy(error);
|
|
1014
|
+
}
|
|
1015
|
+
_writeRequest(chunk, encoding, callback) {
|
|
1016
|
+
if (!this._request || this._request.destroyed) {
|
|
1017
|
+
// Probably the `ClientRequest` instance will throw
|
|
1018
|
+
return;
|
|
1019
|
+
}
|
|
1020
|
+
this._request.write(chunk, encoding, (error) => {
|
|
1021
|
+
// The `!destroyed` check is required to prevent `uploadProgress` being emitted after the stream was destroyed
|
|
1022
|
+
if (!error && !this._request.destroyed) {
|
|
1023
|
+
this._uploadedSize += Buffer.byteLength(chunk, encoding);
|
|
1024
|
+
const progress = this.uploadProgress;
|
|
1025
|
+
if (progress.percent < 1) {
|
|
1026
|
+
this.emit('uploadProgress', progress);
|
|
1027
|
+
}
|
|
1028
|
+
}
|
|
1029
|
+
callback(error);
|
|
1030
|
+
});
|
|
1031
|
+
}
|
|
1032
|
+
/**
|
|
1033
|
+
The remote IP address.
|
|
1034
|
+
*/
|
|
1035
|
+
get ip() {
|
|
1036
|
+
return this.socket?.remoteAddress;
|
|
1037
|
+
}
|
|
1038
|
+
/**
|
|
1039
|
+
Indicates whether the request has been aborted or not.
|
|
1040
|
+
*/
|
|
1041
|
+
get isAborted() {
|
|
1042
|
+
return this._aborted;
|
|
1043
|
+
}
|
|
1044
|
+
get socket() {
|
|
1045
|
+
return this._request?.socket ?? undefined;
|
|
1046
|
+
}
|
|
1047
|
+
/**
|
|
1048
|
+
Progress event for downloading (receiving a response).
|
|
1049
|
+
*/
|
|
1050
|
+
get downloadProgress() {
|
|
1051
|
+
let percent;
|
|
1052
|
+
if (this._responseSize) {
|
|
1053
|
+
percent = this._downloadedSize / this._responseSize;
|
|
1054
|
+
}
|
|
1055
|
+
else if (this._responseSize === this._downloadedSize) {
|
|
1056
|
+
percent = 1;
|
|
1057
|
+
}
|
|
1058
|
+
else {
|
|
1059
|
+
percent = 0;
|
|
1060
|
+
}
|
|
1061
|
+
return {
|
|
1062
|
+
percent,
|
|
1063
|
+
transferred: this._downloadedSize,
|
|
1064
|
+
total: this._responseSize,
|
|
1065
|
+
};
|
|
1066
|
+
}
|
|
1067
|
+
/**
|
|
1068
|
+
Progress event for uploading (sending a request).
|
|
1069
|
+
*/
|
|
1070
|
+
get uploadProgress() {
|
|
1071
|
+
let percent;
|
|
1072
|
+
if (this._bodySize) {
|
|
1073
|
+
percent = this._uploadedSize / this._bodySize;
|
|
1074
|
+
}
|
|
1075
|
+
else if (this._bodySize === this._uploadedSize) {
|
|
1076
|
+
percent = 1;
|
|
1077
|
+
}
|
|
1078
|
+
else {
|
|
1079
|
+
percent = 0;
|
|
1080
|
+
}
|
|
1081
|
+
return {
|
|
1082
|
+
percent,
|
|
1083
|
+
transferred: this._uploadedSize,
|
|
1084
|
+
total: this._bodySize,
|
|
1085
|
+
};
|
|
1086
|
+
}
|
|
1087
|
+
/**
|
|
1088
|
+
The object contains the following properties:
|
|
1089
|
+
|
|
1090
|
+
- `start` - Time when the request started.
|
|
1091
|
+
- `socket` - Time when a socket was assigned to the request.
|
|
1092
|
+
- `lookup` - Time when the DNS lookup finished.
|
|
1093
|
+
- `connect` - Time when the socket successfully connected.
|
|
1094
|
+
- `secureConnect` - Time when the socket securely connected.
|
|
1095
|
+
- `upload` - Time when the request finished uploading.
|
|
1096
|
+
- `response` - Time when the request fired `response` event.
|
|
1097
|
+
- `end` - Time when the response fired `end` event.
|
|
1098
|
+
- `error` - Time when the request fired `error` event.
|
|
1099
|
+
- `abort` - Time when the request fired `abort` event.
|
|
1100
|
+
- `phases`
|
|
1101
|
+
- `wait` - `timings.socket - timings.start`
|
|
1102
|
+
- `dns` - `timings.lookup - timings.socket`
|
|
1103
|
+
- `tcp` - `timings.connect - timings.lookup`
|
|
1104
|
+
- `tls` - `timings.secureConnect - timings.connect`
|
|
1105
|
+
- `request` - `timings.upload - (timings.secureConnect || timings.connect)`
|
|
1106
|
+
- `firstByte` - `timings.response - timings.upload`
|
|
1107
|
+
- `download` - `timings.end - timings.response`
|
|
1108
|
+
- `total` - `(timings.end || timings.error || timings.abort) - timings.start`
|
|
1109
|
+
|
|
1110
|
+
If something has not been measured yet, it will be `undefined`.
|
|
1111
|
+
|
|
1112
|
+
__Note__: The time is a `number` representing the milliseconds elapsed since the UNIX epoch.
|
|
1113
|
+
*/
|
|
1114
|
+
get timings() {
|
|
1115
|
+
return this._request?.timings;
|
|
1116
|
+
}
|
|
1117
|
+
/**
|
|
1118
|
+
Whether the response was retrieved from the cache.
|
|
1119
|
+
*/
|
|
1120
|
+
get isFromCache() {
|
|
1121
|
+
return this._isFromCache;
|
|
1122
|
+
}
|
|
1123
|
+
get reusedSocket() {
|
|
1124
|
+
return this._request?.reusedSocket;
|
|
1125
|
+
}
|
|
1126
|
+
}
|