From 8853448b85c826cb4366565a31e0fc44ae1e869f Mon Sep 17 00:00:00 2001 From: Daniel Freytag Date: Tue, 26 Jul 2022 09:06:02 +0200 Subject: [PATCH 1/2] chore: merge `frytg/undici-wrapper` into this package --- CHANGELOG.md | 3 + package.json | 11 +- packages/undici/README.md | 43 +++++- packages/undici/_options.js | 13 ++ packages/undici/convertReadableStream.js | 18 +++ packages/undici/index.js | 8 +- packages/undici/request.js | 77 +++++++++++ yarn.lock | 165 +++++++++++++++++++---- 8 files changed, 300 insertions(+), 38 deletions(-) create mode 100644 packages/undici/_options.js create mode 100644 packages/undici/convertReadableStream.js create mode 100644 packages/undici/request.js diff --git a/CHANGELOG.md b/CHANGELOG.md index ea9e8ea..a9232c4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,9 @@ by [**SWR Audio Lab**](https://lab.swr.de/) ## Changelog +- 2022-07-26 - v1.0.10-beta + - chore: merge `frytg/undici-wrapper` into this package + - 2022-07-06 - v1.0.9-beta - chore: update undici to v0.1.0 (with fix for `undici.request` instead of `Pool`) diff --git a/package.json b/package.json index 96b430d..fd05a1e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@swrlab/utils", - "version": "1.0.9-beta", + "version": "1.0.10-beta", "description": "Wrapping common SWR Audio Lab utils", "main": "./src/index.js", "engines": { @@ -22,18 +22,19 @@ "license": "MIT", "private": false, "dependencies": { - "@google-cloud/storage": "6.2.2", - "aws-sdk": "2.1168.0", + "@google-cloud/storage": "^6.2.3", + "abort-controller": "^3.0.0", + "aws-sdk": "^2.1181.0", "chai": "^4.3.6", "node-crc": "rafaelmaeuer/node-crc#v2.0.15", - "undici-wrapper": "frytg/undici-wrapper#v0.1.0", + "undici": "^5.8.0", "uuid": "8.3.2" }, "devDependencies": { "@swrlab/eslint-plugin-swr": "0.1.2", "@swrlab/swr-prettier-config": "0.1.2", "dotenv": "^16.0.1", - "eslint": "^8.19.0", + "eslint": "^8.20.0", "eslint-plugin-json": "^3.1.0", "mocha": "^10.0.0", "prettier": "^2.7.1" diff --git a/packages/undici/README.md b/packages/undici/README.md index 28c47f9..8a8fb7d 100644 --- a/packages/undici/README.md +++ b/packages/undici/README.md @@ -1,12 +1,15 @@ # SWR Audio Lab / Undici -Please see [github/undici-wrapper](https://github.com/frytg/undici-wrapper) for the full configuration options. +See [undici.nodejs.org](https://undici.nodejs.org) for the full Undici configuration and usage. - [SWR Audio Lab / Undici](#swr-audio-lab--undici) - [Import](#import) + - [Request](#request) ## Import +Basic import: + ```js // load request handler const undici = require('@swrlab/utils/packages/undici') @@ -14,3 +17,41 @@ const undici = require('@swrlab/utils/packages/undici') // export handler module.exports = undici() ``` + +Import with Datadog tracer enabled: + +```js +// add tracing +const tracer = process.env.DD_TRACE_ENABLED === 'true' ? require('../tracer') : null + +// load request handler +const undici = require('@swrlab/utils/packages/undici') + +// export handler +module.exports = undici(tracer) +``` + +## Request + +Simple request: + +```js +const data = await undici(someApiUrl) +``` + +Advanced usage: + +```js +const data = await undici(someApiUrl, { + method: 'GET', + timeout: 6e3, + reject: false, + maxRedirections: 5 +}) +``` + +You can also use object desctructuring for easy access to the output: + +```js +const { headers, statusCode, json } = await undici(someApiUrl) +``` diff --git a/packages/undici/_options.js b/packages/undici/_options.js new file mode 100644 index 0000000..3672e72 --- /dev/null +++ b/packages/undici/_options.js @@ -0,0 +1,13 @@ +// load config +const { name, version } = require('../../package.json') + +const userAgent = `${name.replace('@', '')}/${version}` + +module.exports = { + keepAliveTimeout: 30e3, + headersTimeout: 0, + bodyTimeout: 0, + headers: { + 'user-agent': process.env.USER_AGENT || userAgent, + }, +} diff --git a/packages/undici/convertReadableStream.js b/packages/undici/convertReadableStream.js new file mode 100644 index 0000000..ddb5ca5 --- /dev/null +++ b/packages/undici/convertReadableStream.js @@ -0,0 +1,18 @@ +// provide util to confert readable stream to buffer +module.exports = async (readable) => { + // create output details + let string = '' + const chunks = [] + + // handle each chunk + for await (const chunk of readable) { + string += chunk + chunks.push(chunk) + } + + // reformat buffer + const buffer = Buffer.concat(chunks) + + // return data + return { string, buffer } +} diff --git a/packages/undici/index.js b/packages/undici/index.js index 87debee..c6daa22 100644 --- a/packages/undici/index.js +++ b/packages/undici/index.js @@ -1,5 +1,5 @@ -// load request handler -const undici = require('undici-wrapper') +// load utils +const request = require('./request') -// export handler -module.exports = undici +// export handler with tracing, if enabled +module.exports = (tracer) => tracer?.wrap('undici.request', request) || request diff --git a/packages/undici/request.js b/packages/undici/request.js new file mode 100644 index 0000000..13ad419 --- /dev/null +++ b/packages/undici/request.js @@ -0,0 +1,77 @@ +/* eslint-disable prefer-promise-reject-errors */ + +// load node utils +const undici = require('undici') +const AbortController = require('abort-controller') + +// fetch options and utils +const _options = require('./_options') +const convertReadableStream = require('./convertReadableStream') + +const DEFAULT_TIMEOUT = 7e3 + +module.exports = async (url, options) => { + // use controller for timeouts + const abortController = new AbortController() + const abortTimeout = setTimeout(() => { + abortController.abort() + }, options?.timeout || DEFAULT_TIMEOUT) + + // calculcate redirect + const maxRedirections = + options?.maxRedirections !== null && options?.maxRedirections !== undefined + ? options.maxRedirections + : 5 + + // prepare options + const requestOptions = { + ..._options, + method: options?.method || 'GET', + body: options?.body || undefined, + signal: abortController.signal, + maxRedirections, + } + if (options?.headers) requestOptions.headers = { ...requestOptions.headers, ...options.headers } + + // make actual request + const { statusCode, headers, trailers, body } = await undici.request(url, requestOptions) + + // remove timeout since request finished beforehand + clearTimeout(abortTimeout) + + // set ok + const ok = statusCode >= 200 && statusCode < 300 + if (!ok && (!options || options?.reject !== false)) return Promise.reject({ statusCode, ok, headers, url }) + + // turn stream into string + const { string, buffer } = await convertReadableStream(body) + + // detect/ set redirect + const redirect = + statusCode >= 300 && statusCode < 400 && headers.location ? new URL(headers.location, url) : null + + // fetch header vars + const contentType = headers['content-type'] + + // parse json if set + let json + try { + json = contentType?.indexOf('application/json') !== -1 ? JSON.parse(string) : null + } catch (error) { + json = null + } + + // return data + return Promise.resolve({ + statusCode, + ok, + redirect, + headers, + contentType, + trailers, + body, + string, + buffer, + json, + }) +} diff --git a/yarn.lock b/yarn.lock index a3ac3b6..bdb2c38 100644 --- a/yarn.lock +++ b/yarn.lock @@ -227,10 +227,10 @@ resolved "https://registry.yarnpkg.com/@google-cloud/promisify/-/promisify-3.0.0.tgz#5cd6941fc30c4acac18051706aa5af96069bd3e3" integrity sha512-91ArYvRgXWb73YvEOBMmOcJc0bDRs5yiVHnqkwoG0f3nm7nZuipllz6e7BvFESBvjkDTBC0zMD8QxedUwNLc1A== -"@google-cloud/storage@6.2.2": - version "6.2.2" - resolved "https://registry.yarnpkg.com/@google-cloud/storage/-/storage-6.2.2.tgz#1fd3ee85e5fea55a9696c98769d097b28ff4d775" - integrity sha512-KhAOxmGfmELKKn6cdvgGfAi/YBLi19hI1jX3QI7xQmbeajSFMgUKrIPbbyfMIxQPOEQ9vG0MQX1uganlA/HTRA== +"@google-cloud/storage@^6.2.3": + version "6.2.3" + resolved "https://registry.yarnpkg.com/@google-cloud/storage/-/storage-6.2.3.tgz#e3dae8708488cf2e0e4fbf0488083d9d279ee097" + integrity sha512-UJqn3Ln8wFBPLuwBaNu3PlhzQDL3EKKfP1+3mzLRQhcFqgpBSMPLDgAXxc6e9S0l0kqsi4GOuAA7fA+l/VAMjQ== dependencies: "@google-cloud/paginator" "^3.0.7" "@google-cloud/projectify" "^3.0.0" @@ -456,10 +456,15 @@ async-retry@^1.3.3: dependencies: retry "0.13.1" -aws-sdk@2.1168.0: - version "2.1168.0" - resolved "https://registry.yarnpkg.com/aws-sdk/-/aws-sdk-2.1168.0.tgz#7936459edee0c999065f1ecf2ef0bea89ea056c1" - integrity sha512-9+WYoYTHHjLqeWdSSLbNpmc/NgnZpX4LGiyYjXenh4WNRBXshXI0XioTK8BQgDscVzB978EJV8kG1nZGE3USzw== +available-typed-arrays@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz#92f95616501069d07d10edb2fc37d3e1c65123b7" + integrity sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw== + +aws-sdk@^2.1181.0: + version "2.1181.0" + resolved "https://registry.yarnpkg.com/aws-sdk/-/aws-sdk-2.1181.0.tgz#6ec2997881ae3df76e56d7150fc2992f12ce43dc" + integrity sha512-AAHSknRFAIjXBA/XNAL7gS79agr1LbS0oGimOJqJauGSJfWNaOpDc7z6OLNUQqGa5Joc3maD5QJcSKp1Pm/deQ== dependencies: buffer "4.9.2" events "1.1.1" @@ -468,6 +473,7 @@ aws-sdk@2.1168.0: querystring "0.2.0" sax "1.2.1" url "0.10.3" + util "^0.12.4" uuid "8.0.0" xml2js "0.4.19" @@ -820,6 +826,35 @@ error-ex@^1.3.1: dependencies: is-arrayish "^0.2.1" +es-abstract@^1.19.0, es-abstract@^1.20.0: + version "1.20.1" + resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.20.1.tgz#027292cd6ef44bd12b1913b828116f54787d1814" + integrity sha512-WEm2oBhfoI2sImeM4OF2zE2V3BYdSF+KnSi9Sidz51fQHd7+JuF8Xgcj9/0o+OWeIeIS/MiuNnlruQrJf16GQA== + dependencies: + call-bind "^1.0.2" + es-to-primitive "^1.2.1" + function-bind "^1.1.1" + function.prototype.name "^1.1.5" + get-intrinsic "^1.1.1" + get-symbol-description "^1.0.0" + has "^1.0.3" + has-property-descriptors "^1.0.0" + has-symbols "^1.0.3" + internal-slot "^1.0.3" + is-callable "^1.2.4" + is-negative-zero "^2.0.2" + is-regex "^1.1.4" + is-shared-array-buffer "^1.0.2" + is-string "^1.0.7" + is-weakref "^1.0.2" + object-inspect "^1.12.0" + object-keys "^1.1.1" + object.assign "^4.1.2" + regexp.prototype.flags "^1.4.3" + string.prototype.trimend "^1.0.5" + string.prototype.trimstart "^1.0.5" + unbox-primitive "^1.0.2" + es-abstract@^1.19.1, es-abstract@^1.19.2, es-abstract@^1.19.5: version "1.19.5" resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.19.5.tgz#a2cb01eb87f724e815b278b0dd0d00f36ca9a7f1" @@ -1038,10 +1073,10 @@ eslint-visitor-keys@^3.3.0: resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz#f6480fa6b1f30efe2d1968aa8ac745b862469826" integrity sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA== -eslint@^8.19.0: - version "8.19.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.19.0.tgz#7342a3cbc4fbc5c106a1eefe0fd0b50b6b1a7d28" - integrity sha512-SXOPj3x9VKvPe81TjjUJCYlV4oJjQw68Uek+AM0X4p+33dj2HY5bpTZOgnQHcG2eAm1mtCU9uNMnJi7exU/kYw== +eslint@^8.20.0: + version "8.20.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.20.0.tgz#048ac56aa18529967da8354a478be4ec0a2bc81b" + integrity sha512-d4ixhz5SKCa1D6SCPrivP7yYVi7nyD6A4vs6HIAul9ujBzcEmZVM3/0NN/yu5nKhmO1wjp5xQ46iRfmDGlOviA== dependencies: "@eslint/eslintrc" "^1.3.0" "@humanwhocodes/config-array" "^0.9.2" @@ -1221,6 +1256,13 @@ flatted@^3.1.0: resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.5.tgz#76c8584f4fc843db64702a6bd04ab7a8bd666da3" integrity sha512-WIWGi2L3DyTUvUrwRKgGi9TwxQMUEqPOPQBVi71R96jZXJdFskXEmf54BoZaS1kknGODoIGASGEzBUYdyMCBJg== +for-each@^0.3.3: + version "0.3.3" + resolved "https://registry.yarnpkg.com/for-each/-/for-each-0.3.3.tgz#69b447e88a0a5d32c3e7084f3f1710034b21376e" + integrity sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw== + dependencies: + is-callable "^1.1.3" + fs.realpath@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" @@ -1236,11 +1278,26 @@ function-bind@^1.1.1: resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== +function.prototype.name@^1.1.5: + version "1.1.5" + resolved "https://registry.yarnpkg.com/function.prototype.name/-/function.prototype.name-1.1.5.tgz#cce0505fe1ffb80503e6f9e46cc64e46a12a9621" + integrity sha512-uN7m/BzVKQnCUF/iW8jYea67v++2u7m5UgENbHRtdDVclOUP+FMPlCNdmk0h/ysGyo2tavMJEDqJAkJdRa1vMA== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.3" + es-abstract "^1.19.0" + functions-have-names "^1.2.2" + functional-red-black-tree@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz#1b0ab3bd553b2a0d6399d29c0e3ea0b252078327" integrity sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc= +functions-have-names@^1.2.2: + version "1.2.3" + resolved "https://registry.yarnpkg.com/functions-have-names/-/functions-have-names-1.2.3.tgz#0404fe4ee2ba2f607f0e0ec3c80bae994133b834" + integrity sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ== + gaxios@^4.0.0: version "4.3.3" resolved "https://registry.yarnpkg.com/gaxios/-/gaxios-4.3.3.tgz#d44bdefe52d34b6435cc41214fdb160b64abfc22" @@ -1495,6 +1552,14 @@ internal-slot@^1.0.3: has "^1.0.3" side-channel "^1.0.4" +is-arguments@^1.0.4: + version "1.1.1" + resolved "https://registry.yarnpkg.com/is-arguments/-/is-arguments-1.1.1.tgz#15b3f88fda01f2a97fec84ca761a560f123efa9b" + integrity sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA== + dependencies: + call-bind "^1.0.2" + has-tostringtag "^1.0.0" + is-arrayish@^0.2.1: version "0.2.1" resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" @@ -1529,7 +1594,7 @@ is-builtin-module@^3.1.0: dependencies: builtin-modules "^3.0.0" -is-callable@^1.1.4, is-callable@^1.2.4: +is-callable@^1.1.3, is-callable@^1.1.4, is-callable@^1.2.4: version "1.2.4" resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.4.tgz#47301d58dd0259407865547853df6d61fe471945" integrity sha512-nsuwtxZfMX67Oryl9LCQ+upnC0Z0BgpwntpS89m1H/TLF0zNfzfLMV/9Wa/6MZsj0acpEjAO0KF1xT6ZdLl95w== @@ -1558,6 +1623,13 @@ is-fullwidth-code-point@^3.0.0: resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d" integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg== +is-generator-function@^1.0.7: + version "1.0.10" + resolved "https://registry.yarnpkg.com/is-generator-function/-/is-generator-function-1.0.10.tgz#f1558baf1ac17e0deea7c0415c438351ff2b3c72" + integrity sha512-jsEjy9l3yiXEQ+PsXdmBwEPcOxaXWLspKdplFUVI9vq1iZgIekeC0L167qeu86czQaxed3q/Uzuw0swL0irL8A== + dependencies: + has-tostringtag "^1.0.0" + is-glob@^4.0.0, is-glob@^4.0.1, is-glob@^4.0.3, is-glob@~4.0.1: version "4.0.3" resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" @@ -1621,6 +1693,17 @@ is-symbol@^1.0.2, is-symbol@^1.0.3: dependencies: has-symbols "^1.0.2" +is-typed-array@^1.1.3, is-typed-array@^1.1.9: + version "1.1.9" + resolved "https://registry.yarnpkg.com/is-typed-array/-/is-typed-array-1.1.9.tgz#246d77d2871e7d9f5aeb1d54b9f52c71329ece67" + integrity sha512-kfrlnTTn8pZkfpJMUgYD7YZ3qzeJgWUn8XfVYBARc4wnmNOmLbmuuaAs3q5fvB0UJOn6yHAKaGTPM7d6ezoD/A== + dependencies: + available-typed-arrays "^1.0.5" + call-bind "^1.0.2" + es-abstract "^1.20.0" + for-each "^0.3.3" + has-tostringtag "^1.0.0" + is-unicode-supported@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz#3f26c76a809593b52bfa2ecb5710ed2779b522a7" @@ -2188,6 +2271,15 @@ regexp-tree@^0.1.23, regexp-tree@~0.1.1: resolved "https://registry.yarnpkg.com/regexp-tree/-/regexp-tree-0.1.24.tgz#3d6fa238450a4d66e5bc9c4c14bb720e2196829d" integrity sha512-s2aEVuLhvnVJW6s/iPgEGK6R+/xngd2jNQ+xy4bXNDKxZKJH6jpPHY6kVeVv1IeLCHgswRj+Kl3ELaDjG6V1iw== +regexp.prototype.flags@^1.4.3: + version "1.4.3" + resolved "https://registry.yarnpkg.com/regexp.prototype.flags/-/regexp.prototype.flags-1.4.3.tgz#87cab30f80f66660181a3bb7bf5981a872b367ac" + integrity sha512-fjggEOO3slI6Wvgjwflkc4NFRCTZAu5CnNfBd5qOMYhWdn67nJBBu34/TkD++eeFmd8C9r9jfXJ27+nSiRkSUA== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.3" + functions-have-names "^1.2.2" + regexpp@^3.2.0: version "3.2.0" resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-3.2.0.tgz#0425a2768d8f23bad70ca4b90461fa2f1213e1b2" @@ -2237,7 +2329,7 @@ rimraf@^3.0.2: dependencies: glob "^7.1.3" -safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@~5.2.0: +safe-buffer@^5.0.1, safe-buffer@^5.1.0, safe-buffer@^5.1.2, safe-buffer@~5.2.0: version "5.2.1" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== @@ -2356,7 +2448,7 @@ string-width@^4.1.0, string-width@^4.2.0: is-fullwidth-code-point "^3.0.0" strip-ansi "^6.0.1" -string.prototype.trimend@^1.0.4: +string.prototype.trimend@^1.0.4, string.prototype.trimend@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/string.prototype.trimend/-/string.prototype.trimend-1.0.5.tgz#914a65baaab25fbdd4ee291ca7dde57e869cb8d0" integrity sha512-I7RGvmjV4pJ7O3kdf+LXFpVfdNOxtCW/2C8f6jNiW4+PQchwxkCDzlk1/7p+Wl4bqFIZeF47qAHXLuHHWKAxog== @@ -2365,7 +2457,7 @@ string.prototype.trimend@^1.0.4: define-properties "^1.1.4" es-abstract "^1.19.5" -string.prototype.trimstart@^1.0.4: +string.prototype.trimstart@^1.0.4, string.prototype.trimstart@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/string.prototype.trimstart/-/string.prototype.trimstart-1.0.5.tgz#5466d93ba58cfa2134839f81d7f42437e8c01fef" integrity sha512-THx16TJCGlsN0o6dl2o6ncWUsdgnLRSA23rRE5pyGBw/mLr3Ej/R2LaqCtgP8VNMGZsvMWnf9ooZPyY2bHvUFg== @@ -2499,7 +2591,7 @@ type-fest@^0.8.1: resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.8.1.tgz#09e249ebde851d3b1e48d27c105444667f17b83d" integrity sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA== -unbox-primitive@^1.0.1: +unbox-primitive@^1.0.1, unbox-primitive@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/unbox-primitive/-/unbox-primitive-1.0.2.tgz#29032021057d5e6cdbd08c5129c226dff8ed6f9e" integrity sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw== @@ -2509,17 +2601,10 @@ unbox-primitive@^1.0.1: has-symbols "^1.0.3" which-boxed-primitive "^1.0.2" -undici-wrapper@frytg/undici-wrapper#v0.1.0: - version "0.1.0" - resolved "https://codeload.github.com/frytg/undici-wrapper/tar.gz/506951ce6f0595d0a37aa5c72bd26e73cf0ac0bd" - dependencies: - abort-controller "^3.0.0" - undici "^5.6.0" - -undici@^5.6.0: - version "5.6.0" - resolved "https://registry.yarnpkg.com/undici/-/undici-5.6.0.tgz#3fd695d4454970bae3d151326ee4ab645b8d1962" - integrity sha512-mc+8SY1fXubTrdx4CXDkeFFGV8lI3Tq4I/70U1V8Z6g4iscGII0uLO7CPnDt56bXEbvaKwo2T2+VrteWbZiXiQ== +undici@^5.8.0: + version "5.8.0" + resolved "https://registry.yarnpkg.com/undici/-/undici-5.8.0.tgz#dec9a8ccd90e5a1d81d43c0eab6503146d649a4f" + integrity sha512-1F7Vtcez5w/LwH2G2tGnFIihuWUlc58YidwLiCv+jR2Z50x0tNXpRRw7eOIJ+GvqCqIkg9SB7NWAJ/T9TLfv8Q== uri-js@^4.2.2: version "4.4.1" @@ -2541,6 +2626,18 @@ util-deprecate@^1.0.1: resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8= +util@^0.12.4: + version "0.12.4" + resolved "https://registry.yarnpkg.com/util/-/util-0.12.4.tgz#66121a31420df8f01ca0c464be15dfa1d1850253" + integrity sha512-bxZ9qtSlGUWSOy9Qa9Xgk11kSslpuZwaxCg4sNIDj6FLucDab2JxnHwyNTCpHMtK1MjoQiWQ6DiUMZYbSrO+Sw== + dependencies: + inherits "^2.0.3" + is-arguments "^1.0.4" + is-generator-function "^1.0.7" + is-typed-array "^1.1.3" + safe-buffer "^5.1.2" + which-typed-array "^1.1.2" + uuid@8.0.0: version "8.0.0" resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.0.0.tgz#bc6ccf91b5ff0ac07bbcdbf1c7c4e150db4dbb6c" @@ -2632,6 +2729,18 @@ which-boxed-primitive@^1.0.2: is-string "^1.0.5" is-symbol "^1.0.3" +which-typed-array@^1.1.2: + version "1.1.8" + resolved "https://registry.yarnpkg.com/which-typed-array/-/which-typed-array-1.1.8.tgz#0cfd53401a6f334d90ed1125754a42ed663eb01f" + integrity sha512-Jn4e5PItbcAHyLoRDwvPj1ypu27DJbtdYXUa5zsinrUx77Uvfb0cXwwnGMTn7cjUfhhqgVQnVJCwF+7cgU7tpw== + dependencies: + available-typed-arrays "^1.0.5" + call-bind "^1.0.2" + es-abstract "^1.20.0" + for-each "^0.3.3" + has-tostringtag "^1.0.0" + is-typed-array "^1.1.9" + which@^2.0.1: version "2.0.2" resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" From e40b952bed21f8997e29e7ceb70c080e61a7d9ef Mon Sep 17 00:00:00 2001 From: Daniel Freytag Date: Tue, 26 Jul 2022 09:22:44 +0200 Subject: [PATCH 2/2] fix: lint issue --- utils/undici/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utils/undici/index.js b/utils/undici/index.js index 9a67801..d69334c 100644 --- a/utils/undici/index.js +++ b/utils/undici/index.js @@ -7,7 +7,7 @@ */ // load request handler -const undici = require('undici-wrapper') +const undici = require('../../packages/undici/index') // export handler module.exports = undici()