From 13b8351f2580a2f084897379ff52b4c3301d6478 Mon Sep 17 00:00:00 2001 From: Valentin Agachi Date: Thu, 6 Apr 2023 19:46:49 +0100 Subject: [PATCH] feat: Use axios for HTTP requests (#78) --- jest.config.ts | 1 + jest.setup.ts | 3 + package.json | 2 +- src/__tests__/coupons.test.ts | 2 +- src/__tests__/orders.test.ts | 2 +- src/__tests__/products.test.ts | 6 +- src/__tests__/subscriptions.test.ts | 16 +- src/__tests__/transactions.test.ts | 4 +- src/__tests__/users.test.ts | 6 +- src/__tests__/webhooks.test.ts | 2 +- src/sdk.ts | 25 ++- tests/cjs/index.js | 2 +- tests/esm/index.js | 2 +- utils/nock.ts | 2 +- yarn.lock | 235 +++++++--------------------- 15 files changed, 95 insertions(+), 215 deletions(-) create mode 100644 jest.setup.ts diff --git a/jest.config.ts b/jest.config.ts index e2d3cbf..f13e74b 100644 --- a/jest.config.ts +++ b/jest.config.ts @@ -2,6 +2,7 @@ import type { Config } from 'jest'; const config: Config = { preset: 'ts-jest', + setupFilesAfterEnv: ['/jest.setup.ts'], testEnvironment: 'node', }; diff --git a/jest.setup.ts b/jest.setup.ts new file mode 100644 index 0000000..aedfc5f --- /dev/null +++ b/jest.setup.ts @@ -0,0 +1,3 @@ +import nock from 'nock'; + +nock.disableNetConnect(); diff --git a/package.json b/package.json index b827a5d..025b32a 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,7 @@ "test:watch": "jest --watch" }, "dependencies": { - "got": "^10.2.0" + "axios": "1.3.5" }, "devDependencies": { "@types/jest": "29.5.0", diff --git a/src/__tests__/coupons.test.ts b/src/__tests__/coupons.test.ts index 582e834..5190d4b 100644 --- a/src/__tests__/coupons.test.ts +++ b/src/__tests__/coupons.test.ts @@ -59,7 +59,7 @@ describe('coupons methods', () => { const scope = nock().post(path, expectedBody).reply(400, DEFAULT_ERROR); await expect(instance.getProductCoupons(productID)).rejects.toThrow( - 'Response code 400' + 'Request failed with status code 400' ); expect(scope.isDone()).toBeTruthy(); diff --git a/src/__tests__/orders.test.ts b/src/__tests__/orders.test.ts index 10467b6..d2d7cb2 100644 --- a/src/__tests__/orders.test.ts +++ b/src/__tests__/orders.test.ts @@ -84,7 +84,7 @@ describe('orders methods', () => { const scope = nock().get(path).reply(400, DEFAULT_ERROR); await expect(instance.getOrderDetails(checkoutId)).rejects.toThrow( - 'Response code 400' + 'Request failed with status code 400' ); expect(scope.isDone()).toBeTruthy(); diff --git a/src/__tests__/products.test.ts b/src/__tests__/products.test.ts index 3866ec3..9b2aed9 100644 --- a/src/__tests__/products.test.ts +++ b/src/__tests__/products.test.ts @@ -60,7 +60,9 @@ describe('products methods', () => { test('rejects on error response', async () => { const scope = nock().post(path, EXPECTED_BODY).reply(400, DEFAULT_ERROR); - await expect(instance.getProducts()).rejects.toThrow('Response code 400'); + await expect(instance.getProducts()).rejects.toThrow( + 'Request failed with status code 400' + ); expect(scope.isDone()).toBeTruthy(); }); @@ -69,7 +71,7 @@ describe('products methods', () => { const scope = nock().post(path, EXPECTED_BODY).reply(200, DEFAULT_ERROR); await expect(instance.getProducts()).rejects.toThrow( - 'Request http://test.paddle.com/product/get_products returned an error!' + 'Request https://test.paddle.com/product/get_products returned an error!' ); expect(scope.isDone()).toBeTruthy(); diff --git a/src/__tests__/subscriptions.test.ts b/src/__tests__/subscriptions.test.ts index 73a23d0..39e43fc 100644 --- a/src/__tests__/subscriptions.test.ts +++ b/src/__tests__/subscriptions.test.ts @@ -79,7 +79,7 @@ describe('subscription methods', () => { const scope = nock().post(path, EXPECTED_BODY).reply(400, DEFAULT_ERROR); await expect(instance.getSubscriptionPlans()).rejects.toThrow( - 'Response code 400' + 'Request failed with status code 400' ); expect(scope.isDone()).toBeTruthy(); @@ -136,7 +136,7 @@ describe('subscription methods', () => { const scope = nock().post(path, expectedBody).reply(400, DEFAULT_ERROR); await expect(instance.getSubscriptionPlan(PLAN_ID)).rejects.toThrow( - 'Response code 400' + 'Request failed with status code 400' ); expect(scope.isDone()).toBeTruthy(); @@ -190,7 +190,7 @@ describe('subscription methods', () => { const scope = nock().post(path, expectedBody).reply(400, DEFAULT_ERROR); await expect(instance.getUsers({ planID: PLAN_ID })).rejects.toThrow( - 'Response code 400' + 'Request failed with status code 400' ); expect(scope.isDone()).toBeTruthy(); @@ -234,7 +234,7 @@ describe('subscription methods', () => { const scope = nock().post(path, expectedBody).reply(400, DEFAULT_ERROR); await expect(instance.getSubscriptionPayments(PLAN_ID)).rejects.toThrow( - 'Response code 400' + 'Request failed with status code 400' ); expect(scope.isDone()).toBeTruthy(); @@ -276,7 +276,7 @@ describe('subscription methods', () => { await expect( instance.reschedulePayment(PAYMENT_ID, NEW_PAYMENT_DATE) - ).rejects.toThrow('Response code 400'); + ).rejects.toThrow('Request failed with status code 400'); expect(scope.isDone()).toBeTruthy(); }); @@ -382,7 +382,7 @@ describe('subscription methods', () => { await expect( instance.updateSubscription(SUBSCRIPTION_ID, { planID: PLAN_ID }) - ).rejects.toThrow('Response code 400'); + ).rejects.toThrow('Request failed with status code 400'); expect(scope.isDone()).toBeTruthy(); }); @@ -414,7 +414,7 @@ describe('subscription methods', () => { await expect( instance.cancelSubscription(SUBSCRIPTION_ID) - ).rejects.toThrow('Response code 400'); + ).rejects.toThrow('Request failed with status code 400'); expect(scope.isDone()).toBeTruthy(); }); @@ -479,7 +479,7 @@ describe('subscription methods', () => { await expect( instance.createSubscriptionModifier(SUBSCRIPTION_ID, 10) - ).rejects.toThrow('Response code 400'); + ).rejects.toThrow('Request failed with status code 400'); expect(scope.isDone()).toBeTruthy(); }); diff --git a/src/__tests__/transactions.test.ts b/src/__tests__/transactions.test.ts index e0fa645..aa6cea5 100644 --- a/src/__tests__/transactions.test.ts +++ b/src/__tests__/transactions.test.ts @@ -96,7 +96,7 @@ describe('transactions methods', () => { const scope = nock().post(path, EXPECTED_BODY).reply(400, DEFAULT_ERROR); await expect(instance.getUserTransactions(123)).rejects.toThrow( - 'Response code 400' + 'Request failed with status code 400' ); expect(scope.isDone()).toBeTruthy(); @@ -106,7 +106,7 @@ describe('transactions methods', () => { const scope = nock().post(path, EXPECTED_BODY).reply(200, DEFAULT_ERROR); await expect(instance.getUserTransactions(123)).rejects.toThrow( - 'Request http://test.paddle.com/user/123/transactions returned an error!' + 'Request https://test.paddle.com/user/123/transactions returned an error!' ); expect(scope.isDone()).toBeTruthy(); diff --git a/src/__tests__/users.test.ts b/src/__tests__/users.test.ts index 2cff6ef..8f08c4b 100644 --- a/src/__tests__/users.test.ts +++ b/src/__tests__/users.test.ts @@ -73,7 +73,9 @@ describe('users methods', () => { test('rejects on error response', async () => { const scope = nock().post(path, expectedBody).reply(400, DEFAULT_ERROR); - await expect(instance.getUsers()).rejects.toThrow('Response code 400'); + await expect(instance.getUsers()).rejects.toThrow( + 'Request failed with status code 400' + ); expect(scope.isDone()).toBeTruthy(); }); @@ -82,7 +84,7 @@ describe('users methods', () => { const scope = nock().post(path, expectedBody).reply(200, DEFAULT_ERROR); await expect(instance.getUsers()).rejects.toThrow( - 'Request http://test.paddle.com/subscription/users returned an error!' + 'Request https://test.paddle.com/subscription/users returned an error!' ); expect(scope.isDone()).toBeTruthy(); diff --git a/src/__tests__/webhooks.test.ts b/src/__tests__/webhooks.test.ts index 4d7839f..5e56edb 100644 --- a/src/__tests__/webhooks.test.ts +++ b/src/__tests__/webhooks.test.ts @@ -97,7 +97,7 @@ describe('webhooks methods', () => { const scope = nock().post(path, EXPECTED_BODY).reply(400, DEFAULT_ERROR); await expect(instance.getWebhooksHistory()).rejects.toThrow( - 'Response code 400' + 'Request failed with status code 400' ); expect(scope.isDone()).toBeTruthy(); diff --git a/src/sdk.ts b/src/sdk.ts index b1d633f..fa55729 100644 --- a/src/sdk.ts +++ b/src/sdk.ts @@ -1,8 +1,7 @@ import crypto from 'crypto'; -import got from 'got'; +import axios, { AxiosRequestConfig } from 'axios'; import serialize from './serialize'; -import { OptionsOfDefaultResponseBody } from 'got/dist/source/create'; import { CreateSubscriptionModifierBody, CreateSubscriptionModifierResponse, @@ -495,16 +494,14 @@ s * @example * @param {object} options * @param {object} [options.body] - body parameters / object * @param {object} [options.headers] - header parameters - * @param {boolean} [options.form] - form parameter (ref: got package) - * @param {boolean} [options.json] - json parameter (ref: got package) + * @param {boolean} [options.form] - serialize the data object to urlencoded format */ private async _request( path: string, { - body, + body: requestBody, headers, form = true, - json = false, checkoutAPI = false, }: { body?: TBody; @@ -518,29 +515,25 @@ s * @example // Requests to Checkout API are using only GET, const method = checkoutAPI ? 'GET' : 'POST'; - const fullBody = { + const fullRequestBody = { vendor_id: this.vendorID, vendor_auth_code: this.apiKey, - ...body, + ...requestBody, }; - const options: OptionsOfDefaultResponseBody = { + const options: AxiosRequestConfig = { headers: { 'User-Agent': `paddle-sdk/${VERSION} (https://github.com/avaly/paddle-sdk)`, + ...(form && { 'Content-Type': 'application/x-www-form-urlencoded' }), ...(headers || {}), }, method, }; if (method !== 'GET') { - if (form) { - options.form = fullBody; - } - if (json) { - options.json = fullBody; - } + options.data = fullRequestBody; } - const data = await got(url, options).json>(); + const { data } = await axios>(url, options); if ('success' in data && typeof data.success === 'boolean') { if (data.success) { diff --git a/tests/cjs/index.js b/tests/cjs/index.js index fee7f85..99f4655 100644 --- a/tests/cjs/index.js +++ b/tests/cjs/index.js @@ -2,7 +2,7 @@ const assert = require('assert'); const nock = require('nock'); const { PaddleSDK } = require('paddle-sdk'); -const SERVER = 'http://test.paddle.com'; +const SERVER = 'https://test.paddle.com'; async function run() { // https://paddle.com/docs/api-list-products diff --git a/tests/esm/index.js b/tests/esm/index.js index 5cdda7e..3c91fa4 100644 --- a/tests/esm/index.js +++ b/tests/esm/index.js @@ -2,7 +2,7 @@ import assert from 'assert'; import nock from 'nock'; import { PaddleSDK } from 'paddle-sdk'; -const SERVER = 'http://test.paddle.com'; +const SERVER = 'https://test.paddle.com'; async function run() { // https://paddle.com/docs/api-list-products diff --git a/utils/nock.ts b/utils/nock.ts index 5842379..f382593 100644 --- a/utils/nock.ts +++ b/utils/nock.ts @@ -1,6 +1,6 @@ import nock from 'nock'; -export const SERVER = 'http://test.paddle.com'; +export const SERVER = 'https://test.paddle.com'; export default function getNock() { return nock(SERVER, { diff --git a/yarn.lock b/yarn.lock index f531f18..484cabd 100644 --- a/yarn.lock +++ b/yarn.lock @@ -669,11 +669,6 @@ resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.25.21.tgz#763b05a4b472c93a8db29b2c3e359d55b29ce272" integrity sha512-gFukHN4t8K4+wVC+ECqeqwzBDeFeTzBXroBTqE6vcWrQGbEUpHO7LYdG0f4xnvYq4VOEwITSlHlp0JBAIFMS/g== -"@sindresorhus/is@^1.0.0": - version "1.2.0" - resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-1.2.0.tgz#63ce3638cb85231f3704164c90a18ef816da3fb7" - integrity sha512-mwhXGkRV5dlvQc4EgPDxDxO6WuMBVymGFd1CA+2Y+z5dG9MNspoQ+AWjl/Ld1MnpCL8AKbosZlDVohqcIwuWsw== - "@sinonjs/commons@^2.0.0": version "2.0.0" resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-2.0.0.tgz#fd4ca5b063554307e8327b4564bd56d3b73924a3" @@ -688,13 +683,6 @@ dependencies: "@sinonjs/commons" "^2.0.0" -"@szmarczak/http-timer@^3.1.1": - version "3.1.1" - resolved "https://registry.yarnpkg.com/@szmarczak/http-timer/-/http-timer-3.1.1.tgz#8b876acd14a4f36ad274468910ee858241e356ad" - integrity sha512-F7vS53bV9NXT+mmYFeSBr2nXaOI1h6qxdlLDVP+4CPG/c60MMStT7aaqYD2TSNWob1DA3GH9ikFY0UW31bUsWA== - dependencies: - defer-to-connect "^1.1.1" - "@tsconfig/node10@^1.0.7": version "1.0.9" resolved "https://registry.yarnpkg.com/@tsconfig/node10/-/node10-1.0.9.tgz#df4907fc07a886922637b15e02d4cebc4c0021b2" @@ -748,16 +736,6 @@ dependencies: "@babel/types" "^7.3.0" -"@types/cacheable-request@^6.0.1": - version "6.0.1" - resolved "https://registry.yarnpkg.com/@types/cacheable-request/-/cacheable-request-6.0.1.tgz#5d22f3dded1fd3a84c0bbeb5039a7419c2c91976" - integrity sha512-ykFq2zmBGOCbpIXtoVbz4SKY5QriWPh3AjyU4G74RYbtt5yOc5OfaY75ftjg7mikMOla1CTGpX3lLbuJh8DTrQ== - dependencies: - "@types/http-cache-semantics" "*" - "@types/keyv" "*" - "@types/node" "*" - "@types/responselike" "*" - "@types/graceful-fs@^4.1.3": version "4.1.6" resolved "https://registry.yarnpkg.com/@types/graceful-fs/-/graceful-fs-4.1.6.tgz#e14b2576a1c25026b7f02ede1de3b84c3a1efeae" @@ -765,11 +743,6 @@ dependencies: "@types/node" "*" -"@types/http-cache-semantics@*": - version "4.0.0" - resolved "https://registry.yarnpkg.com/@types/http-cache-semantics/-/http-cache-semantics-4.0.0.tgz#9140779736aa2655635ee756e2467d787cfe8a2a" - integrity sha512-c3Xy026kOF7QOTn00hbIllV1dLR9hG9NkSrLQgCVs8NF6sBU+VGWjD3wLPhmh1TYAc7ugCFsvHYMN4VcBN1U1A== - "@types/istanbul-lib-coverage@*", "@types/istanbul-lib-coverage@^2.0.0", "@types/istanbul-lib-coverage@^2.0.1": version "2.0.4" resolved "https://registry.yarnpkg.com/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.4.tgz#8467d4b3c087805d63580480890791277ce35c44" @@ -802,13 +775,6 @@ resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.11.tgz#d421b6c527a3037f7c84433fd2c4229e016863d3" integrity sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ== -"@types/keyv@*": - version "3.1.1" - resolved "https://registry.yarnpkg.com/@types/keyv/-/keyv-3.1.1.tgz#e45a45324fca9dab716ab1230ee249c9fb52cfa7" - integrity sha512-MPtoySlAZQ37VoLaPcTHCu1RWJ4llDkULYZIzOYxlhxBqYPB0RsRlmMU0R6tahtFe27mIdkHV+551ZWV4PLmVw== - dependencies: - "@types/node" "*" - "@types/minimist@^1.2.0": version "1.2.2" resolved "https://registry.yarnpkg.com/@types/minimist/-/minimist-1.2.2.tgz#ee771e2ba4b3dc5b372935d549fd9617bf345b8c" @@ -834,13 +800,6 @@ resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.7.2.tgz#6c2324641cc4ba050a8c710b2b251b377581fbf0" integrity sha512-KufADq8uQqo1pYKVIYzfKbJfBAc0sOeXqGbFaSpv8MRmC/zXgowNZmFcbngndGk922QDmOASEXUZCaY48gs4cg== -"@types/responselike@*": - version "1.0.0" - resolved "https://registry.yarnpkg.com/@types/responselike/-/responselike-1.0.0.tgz#251f4fe7d154d2bad125abe1b429b23afd262e29" - integrity sha512-85Y2BjiufFzaMIlvJDvTTB8Fxl2xfLo4HgmHzVBz08w4wDePCTjYw66PdrolO0kzli3yam/YCgRufyo1DdQVTA== - dependencies: - "@types/node" "*" - "@types/semver@^7.3.12": version "7.3.13" resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.3.13.tgz#da4bfd73f49bd541d28920ab0e2bf0ee80f71c91" @@ -1085,6 +1044,20 @@ astral-regex@^2.0.0: resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-2.0.0.tgz#483143c567aeed4785759c0865786dc77d7d2e31" integrity sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ== +asynckit@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" + integrity sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q== + +axios@1.3.5: + version "1.3.5" + resolved "https://registry.yarnpkg.com/axios/-/axios-1.3.5.tgz#e07209b39a0d11848e3e341fa087acd71dadc542" + integrity sha512-glL/PvG/E+xCWwV8S6nCHcrfg1exGx7vxyUIivIA1iL7BIh6bePylCfVHwp6k13ao7SATxB6imau2kqY+I67kw== + dependencies: + follow-redirects "^1.15.0" + form-data "^4.0.0" + proxy-from-env "^1.1.0" + babel-jest@^29.5.0: version "29.5.0" resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-29.5.0.tgz#3fe3ddb109198e78b1c88f9ebdecd5e4fc2f50a5" @@ -1200,26 +1173,6 @@ buffer-from@^1.0.0: resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef" integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A== -cacheable-lookup@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/cacheable-lookup/-/cacheable-lookup-0.2.1.tgz#f474ae2c686667d7ea08c43409ad31b2b31b26c2" - integrity sha512-BQ8MRjxJASEq2q+w0SusPU3B054gS278K8sj58QCLMZIso5qG05+MdCdmXxuyVlfvI8h4bPsNOavVUauVCGxrg== - dependencies: - keyv "^3.1.0" - -cacheable-request@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/cacheable-request/-/cacheable-request-7.0.0.tgz#12421aa084e943ec81eac8c93e56af90c624788a" - integrity sha512-UVG4gMn3WjnAeFBBx7RFoprgOANIAkMwN5Dta6ONmfSwrCxfm0Ip7g0mIBxIRJZX9aDsoID0Ry3dU5Pr0csKKA== - dependencies: - clone-response "^1.0.2" - get-stream "^5.1.0" - http-cache-semantics "^4.0.0" - keyv "^3.0.0" - lowercase-keys "^2.0.0" - normalize-url "^4.1.0" - responselike "^2.0.0" - callsites@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" @@ -1349,13 +1302,6 @@ cliui@^8.0.1: strip-ansi "^6.0.1" wrap-ansi "^7.0.0" -clone-response@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/clone-response/-/clone-response-1.0.2.tgz#d1dc973920314df67fbeb94223b4ee350239e96b" - integrity sha1-0dyXOSAxTfZ/vrlCI7TuNQI56Ws= - dependencies: - mimic-response "^1.0.0" - co@^4.6.0: version "4.6.0" resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184" @@ -1392,6 +1338,13 @@ colors@~0.6.0-1: version "0.6.2" resolved "https://registry.yarnpkg.com/colors/-/colors-0.6.2.tgz#2423fe6678ac0c5dae8852e5d0e5be08c997abcc" +combined-stream@^1.0.8: + version "1.0.8" + resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" + integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg== + dependencies: + delayed-stream "~1.0.0" + commander@^10.0.0: version "10.0.0" resolved "https://registry.yarnpkg.com/commander/-/commander-10.0.0.tgz#71797971162cd3cf65f0b9d24eb28f8d303acdf1" @@ -1649,13 +1602,6 @@ decamelize@^1.1.0: resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" integrity sha1-9lNNFRSCabIDUue+4m9QH5oZEpA= -decompress-response@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/decompress-response/-/decompress-response-5.0.0.tgz#7849396e80e3d1eba8cb2f75ef4930f76461cb0f" - integrity sha512-TLZWWybuxWgoW7Lykv+gq9xvzOsUjQ9tF09Tj6NSTYGMTCHNXzrPnD6Hi+TgZq19PyTAGH4Ll/NIM/eTGglnMw== - dependencies: - mimic-response "^2.0.0" - dedent@^0.7.0: version "0.7.0" resolved "https://registry.yarnpkg.com/dedent/-/dedent-0.7.0.tgz#2495ddbaf6eb874abb0e1be9df22d2e5a544326c" @@ -1677,10 +1623,10 @@ deepmerge@^4.2.2: resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-4.3.0.tgz#65491893ec47756d44719ae520e0e2609233b59b" integrity sha512-z2wJZXrmeHdvYJp/Ux55wIjqo81G5Bp4c+oELTW+7ar6SogWHajt5a9gO3s3IDaGSAXjDk0vlQKN3rms8ab3og== -defer-to-connect@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/defer-to-connect/-/defer-to-connect-1.1.1.tgz#88ae694b93f67b81815a2c8c769aef6574ac8f2f" - integrity sha512-J7thop4u3mRTkYRQ+Vpfwy2G5Ehoy82I14+14W4YMDLKdWloI9gSzRbV30s/NckQGVJtPkWNcW4oMAUigTdqiQ== +delayed-stream@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" + integrity sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ== detect-indent@^6.0.0: version "6.1.0" @@ -1736,10 +1682,6 @@ dotgitignore@^2.1.0: find-up "^3.0.0" minimatch "^3.0.4" -duplexer3@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/duplexer3/-/duplexer3-0.1.4.tgz#ee01dd1cac0ed3cbc7fdbea37dc0a8f1ce002ce2" - eastasianwidth@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/eastasianwidth/-/eastasianwidth-0.2.0.tgz#696ce2ec0aa0e6ea93a397ffcf24aa7840c827cb" @@ -1765,13 +1707,6 @@ emoji-regex@^9.2.2: resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-9.2.2.tgz#840c8803b0d8047f4ff0cf963176b32d4ef3ed72" integrity sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg== -end-of-stream@^1.1.0: - version "1.4.1" - resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.1.tgz#ed29634d19baba463b6ce6b80a37213eab71ec43" - integrity sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q== - dependencies: - once "^1.4.0" - error-ex@^1.3.1: version "1.3.1" resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.1.tgz#f855a86ce61adc4e8621c3cda21e7a7612c3a8dc" @@ -2075,6 +2010,20 @@ flatted@^3.1.0: resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.7.tgz#609f39207cb614b89d0765b477cb2d437fbf9787" integrity sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ== +follow-redirects@^1.15.0: + version "1.15.2" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.2.tgz#b460864144ba63f2681096f274c4e57026da2c13" + integrity sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA== + +form-data@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.0.tgz#93919daeaf361ee529584b9b31664dc12c9fa452" + integrity sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww== + dependencies: + asynckit "^0.4.0" + combined-stream "^1.0.8" + mime-types "^2.1.12" + fs.realpath@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" @@ -2119,13 +2068,6 @@ get-pkg-repo@^4.0.0: through2 "^2.0.0" yargs "^16.2.0" -get-stream@^5.0.0, get-stream@^5.1.0: - version "5.1.0" - resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-5.1.0.tgz#01203cdc92597f9b909067c3e656cc1f4d3c4dc9" - integrity sha512-EXr1FOzrzTfGeL0gQdeFEvOMm2mzMOglyiOXSTpPC+iAjAKftbr3jpCMWynogwYnM+eSj9sHGc6wjIcDvYiygw== - dependencies: - pump "^3.0.0" - get-stream@^6.0.0, get-stream@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-6.0.1.tgz#a262d8eef67aced57c2852ad6167526a43cbf7b7" @@ -2213,26 +2155,6 @@ globby@^11.1.0: merge2 "^1.4.1" slash "^3.0.0" -got@^10.2.0: - version "10.2.0" - resolved "https://registry.yarnpkg.com/got/-/got-10.2.0.tgz#c7d54e5b41881e5c64952a4013986af12dbab47f" - integrity sha512-X14b2uo+20s+HrJz9qyUmGNdIyYbRUZNE05fUz0aS4eXp1l82oUvsvFcMjwY3D25zgWwittqEQWEia0XqSlzzw== - dependencies: - "@sindresorhus/is" "^1.0.0" - "@szmarczak/http-timer" "^3.1.1" - "@types/cacheable-request" "^6.0.1" - cacheable-lookup "^0.2.1" - cacheable-request "^7.0.0" - decompress-response "^5.0.0" - duplexer3 "^0.1.4" - get-stream "^5.0.0" - lowercase-keys "^2.0.0" - mimic-response "^2.0.0" - p-cancelable "^2.0.0" - responselike "^2.0.0" - to-readable-stream "^2.0.0" - type-fest "^0.8.0" - graceful-fs@^4.1.2, graceful-fs@^4.2.9: version "4.2.10" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.10.tgz#147d3a006da4ca3ce14728c7aefc287c367d7a6c" @@ -2294,11 +2216,6 @@ html-escaper@^2.0.0: resolved "https://registry.yarnpkg.com/html-escaper/-/html-escaper-2.0.2.tgz#dfd60027da36a36dfcbe236262c00a5822681453" integrity sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg== -http-cache-semantics@^4.0.0: - version "4.1.1" - resolved "https://registry.yarnpkg.com/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz#abe02fcb2985460bf0323be664436ec3476a6d5a" - integrity sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ== - human-signals@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-2.1.0.tgz#dc91fcba42e4d06e4abaed33b3e7a3c02f514ea0" @@ -2928,10 +2845,6 @@ jsesc@^2.5.1: resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.2.tgz#80564d2e483dacf6e8ef209650a67df3f0c283a4" integrity sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA== -json-buffer@3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/json-buffer/-/json-buffer-3.0.0.tgz#5b1f397afc75d677bde8bcfc0e47e1f9a3d9a898" - json-parse-better-errors@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz#bb867cfb3450e69107c131d1c514bab3dc8bcaa9" @@ -2969,13 +2882,6 @@ jsonparse@^1.2.0: version "1.3.1" resolved "https://registry.yarnpkg.com/jsonparse/-/jsonparse-1.3.1.tgz#3f4dae4a91fac315f71062f8521cc239f1366280" -keyv@^3.0.0, keyv@^3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/keyv/-/keyv-3.1.0.tgz#ecc228486f69991e49e9476485a5be1e8fc5c4d9" - integrity sha512-9ykJ/46SN/9KPM/sichzQ7OvXyGDYKGTaDlKMGCAlg2UK8KRy4jb0d8sFc+0Tt0YYnThq8X2RZgCg74RPxgcVA== - dependencies: - json-buffer "3.0.0" - kind-of@^6.0.3: version "6.0.3" resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.3.tgz#07c05034a6c349fa06e24fa35aa76db4580ce4dd" @@ -3111,11 +3017,6 @@ log-update@^4.0.0: slice-ansi "^4.0.0" wrap-ansi "^6.2.0" -lowercase-keys@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-2.0.0.tgz#2603e78b7b4b0006cbca2fbcc8a3202558ac9479" - integrity sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA== - lru-cache@^5.1.1: version "5.1.1" resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-5.1.1.tgz#1da27e6710271947695daf6848e847f01d84b920" @@ -3208,6 +3109,18 @@ micromatch@^4.0.4, micromatch@^4.0.5: braces "^3.0.2" picomatch "^2.3.1" +mime-db@1.52.0: + version "1.52.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.52.0.tgz#bbabcdc02859f4987301c856e3387ce5ec43bf70" + integrity sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg== + +mime-types@^2.1.12: + version "2.1.35" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.35.tgz#381a871b62a734450660ae3deee44813f70d959a" + integrity sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw== + dependencies: + mime-db "1.52.0" + mimic-fn@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" @@ -3218,15 +3131,6 @@ mimic-fn@^4.0.0: resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-4.0.0.tgz#60a90550d5cb0b239cca65d893b1a53b29871ecc" integrity sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw== -mimic-response@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-1.0.0.tgz#df3d3652a73fded6b9b0b24146e6fd052353458e" - -mimic-response@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-2.0.0.tgz#996a51c60adf12cb8a87d7fb8ef24c2f3d5ebb46" - integrity sha512-8ilDoEapqA4uQ3TwS0jakGONKXVJqpy+RpM+3b7pLdOjghCrEiGp9SRkFbUHAmZW9vdnrENWHjaweIoTIJExSQ== - min-indent@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/min-indent/-/min-indent-1.0.1.tgz#a63f681673b30571fbe8bc25686ae746eefa9869" @@ -3336,11 +3240,6 @@ normalize-path@^3.0.0: resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== -normalize-url@^4.1.0: - version "4.5.1" - resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-4.5.1.tgz#0dd90cf1288ee1d1313b87081c9a5932ee48518a" - integrity sha512-9UZCFRHQdNrfTpGg8+1INIg93B6zE0aXMVFkw1WFwvO4SlZywU6aLg5Of0Ap/PgcbSw4LNxvMWXMeugwMCX0AA== - npm-run-path@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-4.0.1.tgz#b7ecd1e5ed53da8e37a55e1c2269e0b97ed748ea" @@ -3360,7 +3259,7 @@ object-inspect@^1.12.3: resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.12.3.tgz#ba62dffd67ee256c8c086dfae69e016cd1f198b9" integrity sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g== -once@^1.3.0, once@^1.3.1, once@^1.4.0: +once@^1.3.0: version "1.4.0" resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" dependencies: @@ -3392,11 +3291,6 @@ optionator@^0.9.1: type-check "^0.4.0" word-wrap "^1.2.3" -p-cancelable@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/p-cancelable/-/p-cancelable-2.0.0.tgz#4a3740f5bdaf5ed5d7c3e34882c6fb5d6b266a6e" - integrity sha512-wvPXDmbMmu2ksjkB4Z3nZWTSkJEb9lqVdMaCKpZUGJG9TMiNp9XcbG3fn9fPKjem04fJMJnXoyFPk2FmgiaiNg== - p-limit@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.1.0.tgz#b07ff2d9a5d88bec806035895a2bab66a27988bc" @@ -3605,13 +3499,10 @@ propagate@^2.0.0: resolved "https://registry.yarnpkg.com/propagate/-/propagate-2.0.1.tgz#40cdedab18085c792334e64f0ac17256d38f9a45" integrity sha512-vGrhOavPSTz4QVNuBNdcNXePNdNMaO1xj9yBeH1ScQPjk/rhg9sSlCXPhMkFuaNNW/syTvYqsnbIJxMBfRbbag== -pump@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/pump/-/pump-3.0.0.tgz#b4a2116815bde2f4e1ea602354e8c75565107a64" - integrity sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww== - dependencies: - end-of-stream "^1.1.0" - once "^1.3.1" +proxy-from-env@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/proxy-from-env/-/proxy-from-env-1.1.0.tgz#e102f16ca355424865755d2c9e8ea4f24d58c3e2" + integrity sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg== punycode@^2.1.0: version "2.1.1" @@ -3739,13 +3630,6 @@ resolve@^1.10.0, resolve@^1.20.0: path-parse "^1.0.7" supports-preserve-symlinks-flag "^1.0.0" -responselike@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/responselike/-/responselike-2.0.0.tgz#26391bcc3174f750f9a79eacc40a12a5c42d7723" - integrity sha512-xH48u3FTB9VsZw7R+vvgaKeLKzT6jOogbQhEe/jewwnZgzPcnyWui2Av6JpoYZF/91uueC+lqhWqeURw5/qhCw== - dependencies: - lowercase-keys "^2.0.0" - restore-cursor@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-3.1.0.tgz#39f67c54b3a7a58cea5236d95cf0034239631f7e" @@ -4110,11 +3994,6 @@ to-fast-properties@^2.0.0: resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e" integrity sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4= -to-readable-stream@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/to-readable-stream/-/to-readable-stream-2.1.0.tgz#82880316121bea662cdc226adb30addb50cb06e8" - integrity sha512-o3Qa6DGg1CEXshSdvWNX2sN4QHqg03SPq7U6jPXRahlQdl5dK8oXjkU/2/sGrnOZKeGV1zLSO8qPwyKklPPE7w== - to-regex-range@^5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" @@ -4209,7 +4088,7 @@ type-fest@^0.6.0: resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.6.0.tgz#8d2a2370d3df886eb5c90ada1c5bf6188acf838b" integrity sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg== -type-fest@^0.8.0, type-fest@^0.8.1: +type-fest@^0.8.1: version "0.8.1" resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.8.1.tgz#09e249ebde851d3b1e48d27c105444667f17b83d" integrity sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==