diff --git a/__mocks__/superagent.js b/__mocks__/superagent.js deleted file mode 100644 index 6452fe70..00000000 --- a/__mocks__/superagent.js +++ /dev/null @@ -1,81 +0,0 @@ -'use strict'; - -//mock for superagent - __mocks__/superagent.js - -var mockDelay; -var mockError; -var mockResponse = { - status() { - return 200; - }, - ok() { - return true; - }, - get: jest.fn(), - toError: jest.fn() -}; - -var Request = { - put() { - return this; - }, - del() { - return this; - }, - post() { - return this; - }, - get() { - return this; - }, - send() { - return this; - }, - query() { - return this; - }, - field() { - return this; - }, - set() { - return this; - }, - accept() { - return this; - }, - timeout() { - return this; - }, - end: jest.fn().mockImplementation(function(callback) { - if (mockDelay) { - this.delayTimer = setTimeout(callback, 0, mockError, mockResponse); - return; - } - - callback(mockError, mockResponse); - }), - //expose helper methods for tests to set - __setMockDelay(boolValue) { - mockDelay = boolValue; - }, - __setMockResponse(mockRes) { - mockResponse = mockRes; - }, - __setMockError(mockErr) { - mockError = mockErr; - }, - __reset() { - this.__setMockResponse({ - status() { - return 200; - }, - ok() { - return true; - } - }); - this.__setMockError(null); - this.__setMockDelay(false); - } -}; - -module.exports = Request; diff --git a/__tests__/authentication-request.js b/__tests__/authentication-request.js index 6ef3ec38..eee6876a 100644 --- a/__tests__/authentication-request.js +++ b/__tests__/authentication-request.js @@ -1,26 +1,26 @@ -var AuthenticationRequest = require('../src/authentication-request'); +var AuthenticationRequest = require("../src/authentication-request"); -describe('Create Authentication Requests', () => { - test('Should use default settings if none are supplied', () => { +describe("Create Authentication Requests", () => { + test("Should use default settings if none are supplied", () => { var request = AuthenticationRequest.builder().build(); - expect(request.getHost()).toBe('accounts.spotify.com'); + expect(request.getHost()).toBe("accounts.spotify.com"); expect(request.getPort()).toBe(443); - expect(request.getScheme()).toBe('https'); + expect(request.getScheme()).toBe("https"); expect(request.getHeaders()).toBeFalsy(); expect(request.getPath()).toBeFalsy(); expect(request.getQueryParameters()).toBeFalsy(); expect(request.getBodyParameters()).toBeFalsy(); }); - test('Can overwrite one of the default parameters', () => { + test("Can overwrite one of the default parameters", () => { var request = AuthenticationRequest.builder() - .withHost('such.host.wow') + .withHost("such.host.wow") .build(); - expect(request.getHost()).toBe('such.host.wow'); + expect(request.getHost()).toBe("such.host.wow"); expect(request.getPort()).toBe(443); - expect(request.getScheme()).toBe('https'); + expect(request.getScheme()).toBe("https"); expect(request.getHeaders()).toBeFalsy(); expect(request.getPath()).toBeFalsy(); expect(request.getQueryParameters()).toBeFalsy(); diff --git a/__tests__/base-request.js b/__tests__/base-request.js index ff9f0402..9e32545d 100644 --- a/__tests__/base-request.js +++ b/__tests__/base-request.js @@ -1,182 +1,180 @@ -var Request = require('../src/base-request'); +var Request = require("../src/base-request"); -describe('Create Requests', () => { - test('Should create host, port, and scheme', () => { +describe("Create Requests", () => { + test("Should create host, port, and scheme", () => { var request = Request.builder() - .withHost('such.api.wow') + .withHost("such.api.wow") .withPort(1337) - .withScheme('http') + .withScheme("http") .build(); - expect(request.getHost()).toBe('such.api.wow'); + expect(request.getHost()).toBe("such.api.wow"); expect(request.getPort()).toBe(1337); - expect(request.getScheme()).toBe('http'); + expect(request.getScheme()).toBe("http"); }); - test('Should add query parameters', () => { + test("Should add query parameters", () => { var request = Request.builder() - .withHost('such.api.wow') + .withHost("such.api.wow") .withPort(1337) - .withScheme('http') + .withScheme("http") .withQueryParameters({ oneParameter: 1, anotherParameter: true, - thirdParameter: 'hello' + thirdParameter: "hello", }) .build(); expect(request.getQueryParameters().oneParameter).toBe(1); expect(request.getQueryParameters().anotherParameter).toBe(true); - expect(request.getQueryParameters().thirdParameter).toBe('hello'); + expect(request.getQueryParameters().thirdParameter).toBe("hello"); }); - test('Should add query parameters (multiple calls)', () => { + test("Should add query parameters (multiple calls)", () => { var request = Request.builder() - .withHost('such.api.wow') + .withHost("such.api.wow") .withPort(1337) - .withScheme('http') + .withScheme("http") .withQueryParameters({ oneParameter: 1, - anotherParameter: true + anotherParameter: true, }) .withQueryParameters({ - thirdParameter: 'hello' + thirdParameter: "hello", }) .build(); expect(request.getQueryParameters().oneParameter).toBe(1); expect(request.getQueryParameters().anotherParameter).toBe(true); - expect(request.getQueryParameters().thirdParameter).toBe('hello'); + expect(request.getQueryParameters().thirdParameter).toBe("hello"); }); - test('Should add query parameters (combine calls)', () => { + test("Should add query parameters (combine calls)", () => { var request = Request.builder() - .withHost('such.api.wow') + .withHost("such.api.wow") .withPort(1337) - .withScheme('http') + .withScheme("http") .withQueryParameters( { oneParameter: 1, - anotherParameter: true + anotherParameter: true, }, { - thirdParameter: 'hello' + thirdParameter: "hello", } ) .build(); expect(request.getQueryParameters().oneParameter).toBe(1); expect(request.getQueryParameters().anotherParameter).toBe(true); - expect(request.getQueryParameters().thirdParameter).toBe('hello'); + expect(request.getQueryParameters().thirdParameter).toBe("hello"); }); - test('Should add body parameters', () => { + test("Should add body parameters", () => { var request = Request.builder() - .withHost('such.api.wow') + .withHost("such.api.wow") .withPort(1337) - .withScheme('http') + .withScheme("http") .withBodyParameters({ one: 1, two: true, - three: 'world' + three: "world", }) .build(); expect(request.getBodyParameters().one).toBe(1); expect(request.getBodyParameters().two).toBe(true); - expect(request.getBodyParameters().three).toBe('world'); + expect(request.getBodyParameters().three).toBe("world"); }); - test('Should add array to body parameters', () => { + test("Should add array to body parameters", () => { var request = Request.builder() - .withHost('such.api.wow') + .withHost("such.api.wow") .withPort(1337) - .withScheme('http') - .withBodyParameters(['3VNWq8rTnQG6fM1eldSpZ0']) + .withScheme("http") + .withBodyParameters(["3VNWq8rTnQG6fM1eldSpZ0"]) .build(); - expect(request.getBodyParameters()).toEqual(['3VNWq8rTnQG6fM1eldSpZ0']); + expect(request.getBodyParameters()).toEqual(["3VNWq8rTnQG6fM1eldSpZ0"]); }); - test('Should add header parameters', () => { + test("Should add header parameters", () => { var request = Request.builder() - .withHost('such.api.wow') + .withHost("such.api.wow") .withPort(1337) - .withScheme('http') + .withScheme("http") .withHeaders({ - Authorization: 'Basic WOOP', - 'Content-Type': 'application/lol' + Authorization: "Basic WOOP", + "Content-Type": "application/lol", }) .build(); - expect(request.getHeaders().Authorization).toBe('Basic WOOP'); - expect(request.getHeaders()['Content-Type']).toBe('application/lol'); + expect(request.getHeaders().Authorization).toBe("Basic WOOP"); + expect(request.getHeaders()["Content-Type"]).toBe("application/lol"); }); - test('Should add path', () => { + test("Should add path", () => { var request = Request.builder() - .withHost('such.api.wow') + .withHost("such.api.wow") .withPort(1337) - .withPath('/v1/users/meriosweg') + .withPath("/v1/users/meriosweg") .build(); - expect(request.getPath()).toBe('/v1/users/meriosweg'); + expect(request.getPath()).toBe("/v1/users/meriosweg"); }); - test('Should build URI', () => { + test("Should build URI", () => { var request = Request.builder() - .withHost('such.api.wow') - .withScheme('https') + .withHost("such.api.wow") + .withScheme("https") .withPort(1337) - .withPath('/v1/users/meriosweg') + .withPath("/v1/users/meriosweg") .build(); expect(request.getURI()).toBe( - 'https://such.api.wow:1337/v1/users/meriosweg' + "https://such.api.wow:1337/v1/users/meriosweg" ); }); - test('Should construct empty query paramaters string', () => { - var request = Request.builder() - .withQueryParameters({}) - .build(); + test("Should construct empty query paramaters string", () => { + var request = Request.builder().withQueryParameters({}).build(); expect(request.getQueryParameterString()).toBeFalsy(); }); - test('Should construct query paramaters string for one parameter', () => { + test("Should construct query paramaters string for one parameter", () => { var request = Request.builder() .withQueryParameters({ - one: 1 + one: 1, }) .build(); - expect(request.getQueryParameterString()).toBe('?one=1'); + expect(request.getQueryParameterString()).toBe("?one=1"); }); - test('Should construct query paramaters string for multiple parameters', () => { + test("Should construct query paramaters string for multiple parameters", () => { var request = Request.builder() .withQueryParameters({ one: 1, two: true, - three: 'world' + three: "world", }) .build(); expect(request.getQueryParameterString()).toBe( - '?one=1&two=true&three=world' + "?one=1&two=true&three=world" ); }); - test('Should construct query paramaters string and exclude undefined values', () => { + test("Should construct query paramaters string and exclude undefined values", () => { var request = Request.builder() .withQueryParameters({ one: 1, two: undefined, - three: 'world' + three: "world", }) .build(); - expect(request.getQueryParameterString()).toBe('?one=1&three=world'); + expect(request.getQueryParameterString()).toBe("?one=1&three=world"); }); }); diff --git a/__tests__/http-manager.js b/__tests__/http-manager.js index 60d3ebdd..5527f90f 100644 --- a/__tests__/http-manager.js +++ b/__tests__/http-manager.js @@ -1,221 +1,237 @@ -var Request = require('../src/base-request'), - superagent = require('superagent'), - { - TimeoutError, - WebapiError, - WebapiRegularError, - WebapiAuthenticationError, - WebapiPlayerError - } = require('../src/response-error'); - -var HttpManager = require('../src/http-manager'); +var Request = require("../src/base-request"), + { + TimeoutError, + WebapiError, + WebapiRegularError, + WebapiAuthenticationError, + WebapiPlayerError, + } = require("../src/response-error"); + +var HttpManager = require("../src/http-manager"); var request = Request.builder() - .withHost('such.api.wow') + .withHost("such.api.wow") .withPort(1337) - .withScheme('http') + .withScheme("http") .build(); -describe('Make requests', () => { +describe("Make requests", () => { + beforeEach(() => { + fetch.resetMocks(); + }); afterEach(() => { - superagent.__reset(); jest.restoreAllMocks(); }); - test('Should make a successful GET request', done => { - superagent.__setMockResponse({ - statusCode: 200, - headers: { 'Content-Type' : 'application/json' }, - body: 'some data' - }); + test("Should make a successful GET request", (done) => { + fetch.mockResponse(async () => ({ + body: JSON.stringify("some data"), + status: 200, + headers: { "content-type": "application/json" }, + })); - HttpManager.get(request, function(error, result) { - expect(result.body).toBe('some data'); + HttpManager.get(request, function (error, result) { + expect(result.body).toBe("some data"); expect(result.statusCode).toBe(200); - expect(result.headers['Content-Type']).toBe('application/json'); - + expect(result.headers.get("Content-Type")).toBe("application/json"); done(error); }); }); - test('Should process an error of unknown type', done => { - superagent.__setMockError({ - response : { - body: 'GET request error', - headers : {}, - statusCode: 400 - } - }); + test("Should process an error of unknown type", (done) => { + fetch.mockResponse(async () => ({ + body: JSON.stringify("GET request error"), + headers: {}, + status: 400, + })); - HttpManager.get(request, function(error, result) { + HttpManager.get(request, function (error, result) { expect(error).toBeInstanceOf(WebapiError); - expect(error.message).toBe('GET request error'); + expect(error.message).toBe("GET request error"); + expect(result).toBeFalsy(); done(); }); }); - test('Should process an error of regular type', done => { - superagent.__setMockError({ - response : { - body : { - error: { - status : 400, - message : 'There is a problem in your request' - }, - }, - headers : {}, - statusCode : 400 - } - }); + test("Should process an error of regular type", (done) => { + fetch.mockResponse(async () => ({ + body: JSON.stringify({ + error: { + status: 400, + message: "There is a problem in your request", + }, + }), + headers: {}, + status: 400, + })); - HttpManager.get(request, function(error) { + HttpManager.get(request, function (error) { expect(error).toBeInstanceOf(WebapiRegularError); - expect(error.message).toBe('An error occurred while communicating with Spotify\'s Web API.\nDetails: There is a problem in your request.'); + expect(error.message).toBe( + "An error occurred while communicating with Spotify's Web API.\nDetails: There is a problem in your request." + ); done(); }); }); - test('Should process an error of player type', done => { - superagent.__setMockError({ - response: { - body: { - error : { - message: 'Detailed Web API Error message', - status: 400, - reason: 'You messed up!' - } + test("Should process an error of player type", (done) => { + fetch.mockResponse(async () => ({ + body: JSON.stringify({ + error: { + message: "Detailed Web API Error message", + status: 400, + reason: "You messed up!", }, - statusCode : 400, - headers : [] - } - }); + }), + status: 400, + headers: {}, + })); - HttpManager.get(request, function(error) { + HttpManager.get(request, function (error) { expect(error).toBeInstanceOf(WebapiPlayerError); - expect(error.message).toBe('An error occurred while communicating with Spotify\'s Web API.\nDetails: Detailed Web API Error message You messed up!.'); - expect(error.body.error.reason).toBe('You messed up!'); - expect(error.body.error.message).toBe('Detailed Web API Error message'); + expect(error.message).toBe( + "An error occurred while communicating with Spotify's Web API.\nDetails: Detailed Web API Error message You messed up!." + ); + expect(error.body.error.reason).toBe("You messed up!"); + expect(error.body.error.message).toBe("Detailed Web API Error message"); done(); }); }); - test('should process error of authentication type', done => { - superagent.__setMockError({ - response : { - body : { - error: 'invalid_client', - error_description : 'Invalid client' - }, - headers: { 'Content-Type' : 'application/json'}, - statusCode : 400 - } - }); - - HttpManager.get(request, function(error) { + test("should process error of authentication type", (done) => { + fetch.mockResponse(async () => ({ + body: JSON.stringify({ + error: "invalid_client", + error_description: "Invalid client", + }), + headers: { "Content-Type": "application/json" }, + status: 400, + })); + + HttpManager.get(request, function (error) { expect(error).toBeInstanceOf(WebapiAuthenticationError); expect(error.statusCode).toBe(400); - expect(error.headers['Content-Type']).toBe('application/json'); - expect(error.message).toBe('An authentication error occurred while communicating with Spotify\'s Web API.\nDetails: invalid_client Invalid client.'); + expect(error.headers.get("Content-Type")).toBe("application/json"); + expect(error.message).toBe( + "An authentication error occurred while communicating with Spotify's Web API.\nDetails: invalid_client Invalid client." + ); done(); }); - }); - test('should process error of authentication type with missing description', done => { - superagent.__setMockError({ - response : { - body : { - error: 'invalid_client' - }, - headers: { 'Content-Type' : 'application/json'}, - statusCode : 400 - } - }); + test("should process error of authentication type with missing description", (done) => { + fetch.mockResponse(async () => ({ + body: JSON.stringify({ + error: "invalid_client", + }), + headers: { "Content-Type": "application/json" }, + status: 400, + })); - HttpManager.get(request, function(error) { + HttpManager.get(request, function (error) { expect(error).toBeInstanceOf(WebapiAuthenticationError); - expect(error.message).toBe('An authentication error occurred while communicating with Spotify\'s Web API.\nDetails: invalid_client.'); + expect(error.message).toBe( + "An authentication error occurred while communicating with Spotify's Web API.\nDetails: invalid_client." + ); done(); }); - }); - test('Should get Retry Headers', done => { - superagent.__setMockError({ - response: { - body: { - error : { - message: 'Rate limit exceeded', - status : 429 - } + test("Should get Retry Headers", (done) => { + fetch.mockResponse(async () => ({ + body: JSON.stringify({ + error: { + message: "Rate limit exceeded", + status: 429, }, - statusCode : 429, - headers : { 'Retry-After' : '5' } - } - }); + }), + status: 429, + headers: { "Retry-After": "5" }, + })); - HttpManager.get(request, function(error) { + HttpManager.get(request, function (error) { expect(error).toBeInstanceOf(WebapiRegularError); - expect(error.body.error.message).toBe('Rate limit exceeded'); - expect(error.headers['Retry-After']).toBe('5'); - expect(error.message).toBe('An error occurred while communicating with Spotify\'s Web API.\nDetails: Rate limit exceeded.') + expect(error.body.error.message).toBe("Rate limit exceeded"); + expect(error.headers.get("Retry-After")).toBe("5"); + expect(error.message).toBe( + "An error occurred while communicating with Spotify's Web API.\nDetails: Rate limit exceeded." + ); done(); }); }); - test('Should make a successful POST request', done => { - superagent.__setMockResponse({ + test("Should make a successful POST request", (done) => { + fetch.mockResponse(async () => ({ status: 200, - data: 'some data' - }); + body: JSON.stringify("some data"), + })); - HttpManager.post(request, function(error) { + HttpManager.post(request, function (error, response) { + expect(response.body).toBe("some data"); done(error); }); }); - test('Should make a successful PUT request', done => { - superagent.__setMockResponse({ + test("Should make a successful PUT request", (done) => { + fetch.mockResponse(async () => ({ status: 200, - data: 'some data' - }); + body: JSON.stringify("some data"), + })); - HttpManager.put(request, function(error) { + HttpManager.put(request, function (error, response) { + expect(response.body).toBe("some data"); done(error); }); }); - test('Should make a successful DELETE request', done => { - superagent.__setMockResponse({ + test("Should make a successful DELETE request", (done) => { + fetch.mockResponse(async () => ({ status: 200, - data: 'some data' - }); + body: JSON.stringify("some data"), + })); - HttpManager.del(request, function(error) { + HttpManager.del(request, function (error, response) { + expect(response.body).toBe("some data"); done(error); }); }); - test('Should handle timeouts', done => { - superagent.__setMockError({ - timeout: true - }); - - HttpManager.get(request, function(error) { + test("Should handle timeouts", (done) => { + fetch.mockResponse( + async () => + new Promise((resolve) => + setTimeout( + () => + resolve({ + status: 204, + }), + 100 + ) + ) + ); + + var timeoutRequest = Request.builder() + .withHost("such.api.wow") + .withPort(1337) + .withScheme("http") + .withTimeout(10) + .build(); + + HttpManager.get(timeoutRequest, function (error) { + console.log(error); expect(error).toBeInstanceOf(TimeoutError); done(); }); }); - test('Should handle arbitrary exceptions', done => { - superagent.__setMockError(new Error('ops')); + test("Should handle arbitrary exceptions", (done) => { + fetch.mockReject(new Error("ops")); - HttpManager.get(request, function(error) { + HttpManager.get(request, function (error) { expect(error).toBeInstanceOf(Error); done(); }); }); }); - diff --git a/__tests__/response-error.js b/__tests__/response-error.js index 45d63bb1..09f333a3 100644 --- a/__tests__/response-error.js +++ b/__tests__/response-error.js @@ -1,107 +1,121 @@ -const { TimeoutError, WebapiError, WebapiRegularError, WebapiAuthenticationError, WebapiPlayerError } = require("../src/response-error"); - -describe('Test error classes', () => { - - test('Timeout', done => { - let error = new TimeoutError(); - - expect(error.name).toBe('TimeoutError'); - expect(error.message).toBe('A timeout occurred while communicating with Spotify\'s Web API.'); - done(); - }); - - test('WebapiError', done => { - const body = { - success : false - }, - headers = { - 'Content-Type' : 'application/json', - 'X-Experimental' : false - }, - statusCode = 400, - message = 'An unfortunate error occurred.'; - - let error = new WebapiError(body, headers, statusCode, message); - - expect(error.name).toBe('WebapiError'); - expect(error.body).toBe(body); - expect(error.headers).toBe(headers); - expect(error.statusCode).toBe(statusCode); - expect(error.message).toBe(message); - - done(); - }); - - test('WebapiRegularError', done => { - const body = { - error : { - message : 'Not found', - status : 404 - } - }, - headers = { - 'Content-Type' : 'application/json', - 'X-Experimental' : true - }, - statusCode = 404, - message = 'An error occurred while communicating with Spotify\'s Web API.\nDetails: Not found.'; - - let error = new WebapiRegularError(body, headers, statusCode, message); - - expect(error.name).toBe('WebapiRegularError'); - expect(error.body).toBe(body); - expect(error.headers).toBe(headers); - expect(error.statusCode).toBe(statusCode); - expect(error.message).toBe(message); - - done(); - }); - - test('WebapiAuthenticationError', done => { - const body = { - error : 'invalid client id', - error_description : 'Invalid Client ID' - }, - headers = { - 'Content-Type' : 'application/json' - }, - statusCode = 400, - message = 'An authentication error occurred while communicating with Spotify\'s Web API.\nDetails: invalid client id Invalid Client ID.'; - - let error = new WebapiAuthenticationError(body, headers, statusCode, message); - - expect(error.name).toBe('WebapiAuthenticationError'); - expect(error.body).toBe(body); - expect(error.headers).toBe(headers); - expect(error.statusCode).toBe(statusCode); - expect(error.message).toBe(message); - - done(); - }); - - test('WebapiPlayerError', done => { - const body = { - error : { - message : 'Not allowed to shuffle', - status : 403, - reason : 'Not premium' - } +const { + TimeoutError, + WebapiError, + WebapiRegularError, + WebapiAuthenticationError, + WebapiPlayerError, +} = require("../src/response-error"); + +describe("Test error classes", () => { + test("Timeout", (done) => { + let error = new TimeoutError(); + + expect(error.name).toBe("TimeoutError"); + expect(error.message).toBe( + "A timeout occurred while communicating with Spotify's Web API." + ); + done(); + }); + + test("WebapiError", (done) => { + const body = { + success: false, + }, + headers = { + "Content-Type": "application/json", + "X-Experimental": false, + }, + statusCode = 400, + message = "An unfortunate error occurred."; + + let error = new WebapiError(body, headers, statusCode, message); + + expect(error.name).toBe("WebapiError"); + expect(error.body).toBe(body); + expect(error.headers).toBe(headers); + expect(error.statusCode).toBe(statusCode); + expect(error.message).toBe(message); + + done(); + }); + + test("WebapiRegularError", (done) => { + const body = { + error: { + message: "Not found", + status: 404, }, - headers = { - 'Content-Type' : 'application/json' + }, + headers = { + "Content-Type": "application/json", + "X-Experimental": true, + }, + statusCode = 404, + message = + "An error occurred while communicating with Spotify's Web API.\nDetails: Not found."; + + let error = new WebapiRegularError(body, headers, statusCode, message); + + expect(error.name).toBe("WebapiRegularError"); + expect(error.body).toBe(body); + expect(error.headers).toBe(headers); + expect(error.statusCode).toBe(statusCode); + expect(error.message).toBe(message); + + done(); + }); + + test("WebapiAuthenticationError", (done) => { + const body = { + error: "invalid client id", + error_description: "Invalid Client ID", + }, + headers = { + "Content-Type": "application/json", + }, + statusCode = 400, + message = + "An authentication error occurred while communicating with Spotify's Web API.\nDetails: invalid client id Invalid Client ID."; + + let error = new WebapiAuthenticationError( + body, + headers, + statusCode, + message + ); + + expect(error.name).toBe("WebapiAuthenticationError"); + expect(error.body).toBe(body); + expect(error.headers).toBe(headers); + expect(error.statusCode).toBe(statusCode); + expect(error.message).toBe(message); + + done(); + }); + + test("WebapiPlayerError", (done) => { + const body = { + error: { + message: "Not allowed to shuffle", + status: 403, + reason: "Not premium", }, - statusCode = 403, - message = 'An error occurred while communicating with Spotify\'s Web API.\nDetails: Not allowed to shuffle Not premium.'; - - let error = new WebapiPlayerError(body, headers, statusCode, message); - - expect(error.name).toBe('WebapiPlayerError'); - expect(error.body).toBe(body); - expect(error.headers).toBe(headers); - expect(error.statusCode).toBe(statusCode); - expect(error.message).toBe(message); - - done(); - }); - -}); \ No newline at end of file + }, + headers = { + "Content-Type": "application/json", + }, + statusCode = 403, + message = + "An error occurred while communicating with Spotify's Web API.\nDetails: Not allowed to shuffle Not premium."; + + let error = new WebapiPlayerError(body, headers, statusCode, message); + + expect(error.name).toBe("WebapiPlayerError"); + expect(error.body).toBe(body); + expect(error.headers).toBe(headers); + expect(error.statusCode).toBe(statusCode); + expect(error.message).toBe(message); + + done(); + }); +}); diff --git a/__tests__/spotify-web-api.js b/__tests__/spotify-web-api.js index 8222a0d4..ba84dcd0 100644 --- a/__tests__/spotify-web-api.js +++ b/__tests__/spotify-web-api.js @@ -1,36 +1,20 @@ -const { stub } = require('sinon'); -var superagent = require('superagent'), - HttpManager = require('../src/http-manager'), - sinon = require('sinon'), - SpotifyWebApi = require('../src/server'), - { TimeoutError, - WebapiError, - WebapiRegularError, - WebapiAuthenticationError, - WebapiPlayerError - } = require('../src/response-error'); - -('use strict'); - -describe('Spotify Web API', () => { - beforeEach(done => { - done(); - }); +"use strict"; - afterEach(done => { - if (typeof HttpManager._makeRequest.restore == 'function') { - HttpManager._makeRequest.restore(); - } +var SpotifyWebApi = require("../src/server"); + +describe("Spotify Web API", () => { + beforeEach((done) => { + fetch.resetMocks(); done(); }); - test('should set clientId, clientSecret and redirectUri', () => { + test("should set clientId, clientSecret and redirectUri", () => { var credentials = { - clientId: 'someClientId', - clientSecret: 'someClientSecret', - redirectUri: 'myRedirectUri', - accessToken: 'mySuperNiceAccessToken', - refreshToken: 'iCanEvenSaveMyAccessToken' + clientId: "someClientId", + clientSecret: "someClientSecret", + redirectUri: "myRedirectUri", + accessToken: "mySuperNiceAccessToken", + refreshToken: "iCanEvenSaveMyAccessToken", }; var api = new SpotifyWebApi(credentials); @@ -41,312 +25,323 @@ describe('Spotify Web API', () => { expect(api.getCredentials().accessToken).toBe(credentials.accessToken); expect(api.getCredentials().refreshToken).toBe(credentials.refreshToken); }); - - test('response should contain body, headers and status code', done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - callback(null, { - body: { uri: 'spotify:track:3Qm86XLflmIXVm1wcwkgDK' }, - headers: { 'cache-control': 'public, max-age=7200' }, - statusCode: 200 - }); - }); + + test("response should contain body, headers and status code", (done) => { + fetch.mockResponse(async () => ({ + body: JSON.stringify({ uri: "spotify:track:3Qm86XLflmIXVm1wcwkgDK" }), + headers: { "cache-control": "public, max-age=7200" }, + status: 200, + })); var api = new SpotifyWebApi(); - api.getTrack('3Qm86XLflmIXVm1wcwkgDK').then( + api.getTrack("3Qm86XLflmIXVm1wcwkgDK").then( function(data) { - expect(data.body.uri).toBe('spotify:track:3Qm86XLflmIXVm1wcwkgDK'); + expect(data.body.uri).toBe("spotify:track:3Qm86XLflmIXVm1wcwkgDK"); expect(data.statusCode).toBe(200); - expect(data.headers['cache-control']).toBe('public, max-age=7200'); + expect(data.headers.get("cache-control")).toBe("public, max-age=7200"); done(); }, function(err) { - done(new Error('Test failed!')); + done(new Error("Test failed!")); } ); }); - test('should retrieve track metadata', done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.get); - expect(uri).toBe( - 'https://api.spotify.com/v1/tracks/3Qm86XLflmIXVm1wcwkgDK' + test("should retrieve track metadata", (done) => { + fetch.mockResponse(async (req) => { + expect(req.url).toBe( + "https://api.spotify.com/v1/tracks/3Qm86XLflmIXVm1wcwkgDK" ); - expect(options.data).toBeFalsy(); - callback(null, {}); + expect(req.method).toBe("GET"); + + return { + status: 200, + body: JSON.stringify({ uri: "spotify:track:3Qm86XLflmIXVm1wcwkgDK" }), + headers: { + "content-type": "application/json", + }, + }; }); var api = new SpotifyWebApi(); - api.getTrack('3Qm86XLflmIXVm1wcwkgDK').then( + api.getTrack("3Qm86XLflmIXVm1wcwkgDK").then( function(data) { done(); }, function(err) { - done(new Error('Test failed!')); + done(err); } ); }); - test('error response should contain body, headers and status code', done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.get); - expect(uri).toBe( - 'https://api.spotify.com/v1/tracks/3Qm86XLflmIXVm1wcwkgDK' + test("error response should contain body, headers and status code", (done) => { + fetch.mockResponse(async (req) => { + expect(req.url).toBe( + "https://api.spotify.com/v1/tracks/3Qm86XLflmIXVm1wcwkgDK" ); - expect(options.data).toBeFalsy(); - callback(new WebapiRegularError( - { - error : { - message : 'Do NOT do that again!', - status : 400 - } - }, - { - 'Content-Type' : 'application/json' + expect(req.method).toBe("GET"); + + return { + status: 400, + body: JSON.stringify({ + error: { + message: "Do NOT do that again!", + status: 400, + }, + }), + headers: { + "content-type": "application/json", }, - 400 - )); + }; }); var api = new SpotifyWebApi(); - api.getTrack('3Qm86XLflmIXVm1wcwkgDK').then( + api.getTrack("3Qm86XLflmIXVm1wcwkgDK").then( function(data) { - done(new Error('Test failed!')); + done(new Error("Test failed!")); }, function(err) { - expect(err.body.error.message).toBe('Do NOT do that again!'); + expect(err.body.error.message).toBe("Do NOT do that again!"); expect(err.body.error.status).toBe(400); - expect(err.headers['Content-Type']).toBe('application/json'); + expect(err.headers.get("Content-Type")).toBe("application/json"); expect(err.statusCode).toBe(400); done(); } ); }); - test('should get track for Swedish market', done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.get); - expect(uri).toBe( - 'https://api.spotify.com/v1/tracks/3Qm86XLflmIXVm1wcwkgDK' + test("should get track for Swedish market", (done) => { + fetch.mockResponse(async (req) => { + expect(req.url).toBe( + "https://api.spotify.com/v1/tracks/3Qm86XLflmIXVm1wcwkgDK?market=SE" ); - expect(options.query.market).toBe('SE'); - expect(options.data).toBeFalsy(); - callback(); + expect(req.method).toBe("GET"); + expect(req.body).toBeFalsy(); + + return { + status: 200, + headers: { + "content-type": "application/json", + }, + body: JSON.stringify({ uri: "spotify:track:3Qm86XLflmIXVm1wcwkgDK" }), + }; }); var api = new SpotifyWebApi(); - api.getTrack('3Qm86XLflmIXVm1wcwkgDK', { market: 'SE' }).then( + api.getTrack("3Qm86XLflmIXVm1wcwkgDK", { market: "SE" }).then( function(data) { done(); }, function(err) { - done(new Error('Test failed!')); + done(err); } ); }); - test('should retrieve track metadata using callback', done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.get); - expect(uri).toBe( - 'https://api.spotify.com/v1/tracks/3Qm86XLflmIXVm1wcwkgDK' + test("should retrieve track metadata using callback", (done) => { + fetch.mockResponse(async (req) => { + expect(req.url).toBe( + "https://api.spotify.com/v1/tracks/3Qm86XLflmIXVm1wcwkgDK" ); - expect(options.data).toBeFalsy(); - callback(); + expect(req.method).toBe("GET"); + expect(req.body).toBeFalsy(); + + return { + status: 200, + headers: { + "content-type": "application/json", + }, + body: JSON.stringify({ uri: "spotify:track:3Qm86XLflmIXVm1wcwkgDK" }), + }; }); var api = new SpotifyWebApi(); - api.getTrack('3Qm86XLflmIXVm1wcwkgDK', {}, function(err, data) { + api.getTrack("3Qm86XLflmIXVm1wcwkgDK", {}, function(err, data) { expect(err).toBeFalsy(); done(err); }); }); - test('should retrieve metadata for several tracks', done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.get); - expect(uri).toBe('https://api.spotify.com/v1/tracks'); - expect(options.query.ids).toBe( - '0eGsygTp906u18L0Oimnem,1lDWb6b6ieDQ2xT7ewTC3G' + test("should retrieve metadata for several tracks", (done) => { + fetch.mockResponse(async (req) => { + const url = new URL(req.url); + expect(url.pathname).toBe("/v1/tracks"); + expect(url.searchParams.get("ids")).toBe( + "0eGsygTp906u18L0Oimnem,1lDWb6b6ieDQ2xT7ewTC3G" ); - expect(options.data).toBeFalsy(); - callback(); + expect(req.method).toBe("GET"); + expect(req.body).toBeFalsy(); + + return { + status: 200, + headers: { + "content-type": "application/json", + }, + body: JSON.stringify([ + { uri: "spotify:track:0eGsygTp906u18L0Oimnem" }, + { uri: "spotify:track:1lDWb6b6ieDQ2xT7ewTC3G" }, + ]), + }; }); var api = new SpotifyWebApi(); - api.getTracks(['0eGsygTp906u18L0Oimnem', '1lDWb6b6ieDQ2xT7ewTC3G']).then( + api.getTracks(["0eGsygTp906u18L0Oimnem", "1lDWb6b6ieDQ2xT7ewTC3G"]).then( function(data) { done(); }, function(err) { - done(new Error('Test failed!')); + done(err); } ); }); - test('should retrieve metadata for an album', done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.get); - expect(uri).toBe( - 'https://api.spotify.com/v1/albums/0sNOF9WDwhWunNAHPD3Baj' + test("should retrieve metadata for an album", (done) => { + fetch.mockResponse(async (req) => { + expect(req.url).toBe( + "https://api.spotify.com/v1/albums/0sNOF9WDwhWunNAHPD3Baj" ); - expect(options.data).toBeFalsy(); - callback(null, { - body: { uri: 'spotify:album:0sNOF9WDwhWunNAHPD3Baj' }, - statusCode: 200 - }); + expect(req.method).toBe("GET"); + expect(req.body).toBeFalsy(); + + return { + status: 200, + headers: { + "content-type": "application/json", + }, + body: JSON.stringify({ + uri: "spotify:album:0sNOF9WDwhWunNAHPD3Baj", + }), + }; }); var api = new SpotifyWebApi(); - api.getAlbum('0sNOF9WDwhWunNAHPD3Baj').then( + api.getAlbum("0sNOF9WDwhWunNAHPD3Baj").then( function(data) { done(); }, function(err) { - done(new Error('Test failed!')); + done(err); } ); }); - test('should retrieve metadata for an album for a market ', done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.get); - expect(uri).toBe( - 'https://api.spotify.com/v1/albums/0sNOF9WDwhWunNAHPD3Baj' + test("should retrieve metadata for an album for a market ", (done) => { + fetch.mockResponse(async (req) => { + expect(req.url).toBe( + "https://api.spotify.com/v1/albums/0sNOF9WDwhWunNAHPD3Baj?market=SE" ); - expect(options.data).toBeFalsy(); - expect(options.query.market).toBe('SE'); - callback(null, { - body: { uri: 'spotify:album:0sNOF9WDwhWunNAHPD3Baj' }, - statusCode: 200 - }); + expect(req.method).toBe("GET"); + expect(req.body).toBeFalsy(); + + return { + status: 200, + headers: { + "content-type": "application/json", + }, + body: JSON.stringify({ + uri: "spotify:album:0sNOF9WDwhWunNAHPD3Baj", + }), + }; }); var api = new SpotifyWebApi(); - api.getAlbum('0sNOF9WDwhWunNAHPD3Baj', { market: 'SE' }).then( + api.getAlbum("0sNOF9WDwhWunNAHPD3Baj", { market: "SE" }).then( function(data) { done(); }, function(err) { - done(new Error('Test failed!')); + done(new Error("Test failed!")); } ); }); - test('should retrieve metadata for an album using callback', done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.get); - expect(uri).toBe( - 'https://api.spotify.com/v1/albums/0sNOF9WDwhWunNAHPD3Baj' + test("should retrieve metadata for an album using callback", (done) => { + fetch.mockResponse(async (req) => { + expect(req.url).toBe( + "https://api.spotify.com/v1/albums/0sNOF9WDwhWunNAHPD3Baj" ); - expect(options.data).toBeFalsy(); - callback(null, {}); + expect(req.method).toBe("GET"); + expect(req.body).toBeFalsy(); + + return { + status: 200, + headers: { + "content-type": "application/json", + }, + body: JSON.stringify({ + uri: "spotify:album:0sNOF9WDwhWunNAHPD3Baj", + }), + }; }); var api = new SpotifyWebApi(); - api.getAlbum('0sNOF9WDwhWunNAHPD3Baj', {}, function(err, data) { + api.getAlbum("0sNOF9WDwhWunNAHPD3Baj", {}, function(err, data) { done(err); }); }); - test('should retrieve metadata for several albums', done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.get); - expect(uri).toBe('https://api.spotify.com/v1/albums'); - expect(options.query.ids).toBe( - '41MnTivkwTO3UUJ8DrqEJJ,6JWc4iAiJ9FjyK0B59ABb4' + test("should retrieve metadata for several albums", (done) => { + fetch.mockResponse(async (req) => { + const url = new URL(req.url); + expect(url.pathname).toBe("/v1/albums"); + expect(url.searchParams.get("ids")).toBe( + "41MnTivkwTO3UUJ8DrqEJJ,6JWc4iAiJ9FjyK0B59ABb4" ); - expect(options.data).toBeFalsy(); - callback(null, {}); + expect(req.method).toBe("GET"); + expect(req.body).toBeFalsy(); + + return { + status: 200, + headers: { + "content-type": "application/json", + }, + body: JSON.stringify({ + albums: [ + { uri: "spotify:album:41MnTivkwTO3UUJ8DrqEJJ" }, + { uri: "spotify:album:6JWc4iAiJ9FjyK0B59ABb4" }, + ], + }), + }; }); var api = new SpotifyWebApi(); - api.getAlbums(['41MnTivkwTO3UUJ8DrqEJJ', '6JWc4iAiJ9FjyK0B59ABb4']).then( + api.getAlbums(["41MnTivkwTO3UUJ8DrqEJJ", "6JWc4iAiJ9FjyK0B59ABb4"]).then( function(data) { done(); }, function(err) { - done(new Error('Test failed!')); + done(err); } ); }); - test('should retrieve metadata for several albums using callback', done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.get); - expect(uri).toBe('https://api.spotify.com/v1/albums'); - expect(options.query.ids).toBe( - '41MnTivkwTO3UUJ8DrqEJJ,6JWc4iAiJ9FjyK0B59ABb4' + test("should retrieve metadata for several albums using callback", (done) => { + fetch.mockResponse(async (req) => { + const url = new URL(req.url); + expect(url.pathname).toBe("/v1/albums"); + expect(url.searchParams.get("ids")).toBe( + "41MnTivkwTO3UUJ8DrqEJJ,6JWc4iAiJ9FjyK0B59ABb4" ); - expect(options.data).toBeFalsy(); - callback(null, { - body: { - albums: [ - { uri: 'spotify:album:41MnTivkwTO3UUJ8DrqEJJ' }, - { uri: 'spotify:album:6JWc4iAiJ9FjyK0B59ABb4' } - ] + expect(req.method).toBe("GET"); + expect(req.body).toBeFalsy(); + + return { + status: 200, + headers: { + "content-type": "application/json", }, - statusCode: 200 - }); + body: JSON.stringify({ + albums: [ + { uri: "spotify:album:41MnTivkwTO3UUJ8DrqEJJ" }, + { uri: "spotify:album:6JWc4iAiJ9FjyK0B59ABb4" }, + ], + }), + }; }); var api = new SpotifyWebApi(); api.getAlbums( - ['41MnTivkwTO3UUJ8DrqEJJ', '6JWc4iAiJ9FjyK0B59ABb4'], + ["41MnTivkwTO3UUJ8DrqEJJ", "6JWc4iAiJ9FjyK0B59ABb4"], {}, function(err, data) { done(err); @@ -354,25 +349,25 @@ describe('Spotify Web API', () => { ); }); - test('should retrieve metadata for an artist', done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.get); - expect(uri).toBe( - 'https://api.spotify.com/v1/artists/0LcJLqbBmaGUft1e9Mm8HV' + test("should retrieve metadata for an artist", (done) => { + fetch.mockResponse(async (req) => { + expect(req.url).toBe( + "https://api.spotify.com/v1/artists/0LcJLqbBmaGUft1e9Mm8HV" ); - expect(options.data).toBeFalsy(); - callback(null, { - body: { uri: 'spotify:artist:0LcJLqbBmaGUft1e9Mm8HV' } - }); + expect(req.method).toBe("GET"); + expect(req.body).toBeFalsy(); + + return { + status: 200, + headers: { + "content-type": "application/json", + }, + body: JSON.stringify({ uri: "spotify:artist:0LcJLqbBmaGUft1e9Mm8HV" }), + }; }); var api = new SpotifyWebApi(); - api.getArtist('0LcJLqbBmaGUft1e9Mm8HV').then( + api.getArtist("0LcJLqbBmaGUft1e9Mm8HV").then( function(data) { done(); }, @@ -382,62 +377,62 @@ describe('Spotify Web API', () => { ); }); - test('should retrieve metadata for an artist using callback', done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.get); - expect(uri).toBe( - 'https://api.spotify.com/v1/artists/0LcJLqbBmaGUft1e9Mm8HV' + test("should retrieve metadata for an artist using callback", (done) => { + fetch.mockResponse(async (req) => { + expect(req.url).toBe( + "https://api.spotify.com/v1/artists/0LcJLqbBmaGUft1e9Mm8HV" ); - expect(options.data).toBeFalsy(); - callback(null, { - body: { uri: 'spotify:artist:0LcJLqbBmaGUft1e9Mm8HV' } - }); + expect(req.method).toBe("GET"); + expect(req.body).toBeFalsy(); + + return { + status: 200, + headers: { + "content-type": "application/json", + }, + body: JSON.stringify({ uri: "spotify:artist:0LcJLqbBmaGUft1e9Mm8HV" }), + }; }); var api = new SpotifyWebApi(); - api.getArtist('0LcJLqbBmaGUft1e9Mm8HV', function(err, data) { + api.getArtist("0LcJLqbBmaGUft1e9Mm8HV", function(err, data) { expect(err).toBeFalsy(); done(); }); }); - test('should retrieve metadata for several artists', done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.get); - expect(uri).toBe('https://api.spotify.com/v1/artists'); - expect(options.query.ids).toBe( - '0oSGxfWSnnOXhD2fKuz2Gy,3dBVyJ7JuOMt4GE9607Qin' + test("should retrieve metadata for several artists", (done) => { + fetch.mockResponse(async (req) => { + const url = new URL(req.url); + expect(url.pathname).toBe("/v1/artists"); + expect(url.searchParams.get("ids")).toBe( + "0oSGxfWSnnOXhD2fKuz2Gy,3dBVyJ7JuOMt4GE9607Qin" ); - expect(options.data).toBeFalsy(); - callback(null, { - body: { - artists: [ - { uri: 'spotify:artist:0oSGxfWSnnOXhD2fKuz2Gy' }, - { uri: 'spotify:artist:3dBVyJ7JuOMt4GE9607Qin' } - ] + expect(req.method).toBe("GET"); + expect(req.body).toBeFalsy(); + + return { + status: 200, + headers: { + "content-type": "application/json", }, - statusCode: 200 - }); + body: JSON.stringify({ + artists: [ + { uri: "spotify:artist:0oSGxfWSnnOXhD2fKuz2Gy" }, + { uri: "spotify:artist:3dBVyJ7JuOMt4GE9607Qin" }, + ], + }), + }; }); var api = new SpotifyWebApi(); - api.getArtists(['0oSGxfWSnnOXhD2fKuz2Gy', '3dBVyJ7JuOMt4GE9607Qin']).then( + api.getArtists(["0oSGxfWSnnOXhD2fKuz2Gy", "3dBVyJ7JuOMt4GE9607Qin"]).then( function(data) { expect(data.body.artists[0].uri).toBe( - 'spotify:artist:0oSGxfWSnnOXhD2fKuz2Gy' + "spotify:artist:0oSGxfWSnnOXhD2fKuz2Gy" ); expect(data.body.artists[1].uri).toBe( - 'spotify:artist:3dBVyJ7JuOMt4GE9607Qin' + "spotify:artist:3dBVyJ7JuOMt4GE9607Qin" ); expect(data.statusCode).toBe(200); done(); @@ -448,40 +443,40 @@ describe('Spotify Web API', () => { ); }); - test('should retrieve metadata for several artists using callback', done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.get); - expect(uri).toBe('https://api.spotify.com/v1/artists'); - expect(options.query.ids).toBe( - '0oSGxfWSnnOXhD2fKuz2Gy,3dBVyJ7JuOMt4GE9607Qin' + test("should retrieve metadata for several artists using callback", (done) => { + fetch.mockResponse(async (req) => { + const url = new URL(req.url); + expect(url.pathname).toBe("/v1/artists"); + expect(url.searchParams.get("ids")).toBe( + "0oSGxfWSnnOXhD2fKuz2Gy,3dBVyJ7JuOMt4GE9607Qin" ); - expect(options.data).toBeFalsy(); - callback(null, { - body: { - artists: [ - { uri: 'spotify:artist:0oSGxfWSnnOXhD2fKuz2Gy' }, - { uri: 'spotify:artist:3dBVyJ7JuOMt4GE9607Qin' } - ] + expect(req.method).toBe("GET"); + expect(req.body).toBeFalsy(); + + return { + status: 200, + headers: { + "content-type": "application/json", }, - statusCode: 200 - }); + body: JSON.stringify({ + artists: [ + { uri: "spotify:artist:0oSGxfWSnnOXhD2fKuz2Gy" }, + { uri: "spotify:artist:3dBVyJ7JuOMt4GE9607Qin" }, + ], + }), + }; }); var api = new SpotifyWebApi(); api.getArtists( - ['0oSGxfWSnnOXhD2fKuz2Gy', '3dBVyJ7JuOMt4GE9607Qin'], + ["0oSGxfWSnnOXhD2fKuz2Gy", "3dBVyJ7JuOMt4GE9607Qin"], function(err, data) { expect(err).toBeFalsy(); expect(data.body.artists[0].uri).toBe( - 'spotify:artist:0oSGxfWSnnOXhD2fKuz2Gy' + "spotify:artist:0oSGxfWSnnOXhD2fKuz2Gy" ); expect(data.body.artists[1].uri).toBe( - 'spotify:artist:3dBVyJ7JuOMt4GE9607Qin' + "spotify:artist:3dBVyJ7JuOMt4GE9607Qin" ); expect(data.statusCode).toBe(200); done(); @@ -489,44 +484,40 @@ describe('Spotify Web API', () => { ); }); - test('should search for an album using limit and offset', done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.get); - expect(uri).toBe('https://api.spotify.com/v1/search/'); - expect(options.query).toEqual({ - limit: 3, - offset: 2, - q: 'The Best of Keane', - type: 'album' - }); - expect(options.data).toBeFalsy(); - callback(null, { - body: { - albums: { - href: - 'https://api.spotify.com/v1/search?q=The+Best+of+Keane&offset=2&limit=3&type=album' - } - }, + test("should search for an album using limit and offset", (done) => { + fetch.mockResponse(async (req) => { + const url = new URL(req.url); + expect(url.pathname).toBe("/v1/search/"); + expect(url.searchParams.get("q")).toBe("The Best of Keane"); + expect(url.searchParams.get("type")).toBe("album"); + expect(url.searchParams.get("limit")).toBe("3"); + expect(url.searchParams.get("offset")).toBe("2"); + expect(req.method).toBe("GET"); + expect(req.body).toBeFalsy(); + + return { + status: 200, headers: { - test: 'value' + "content-type": "application/json", + test: "value", }, - statusCode: 200 - }); + body: JSON.stringify({ + albums: { + href: + "https://api.spotify.com/v1/search?q=The+Best+of+Keane&offset=2&limit=3&type=album", + }, + }), + }; }); var api = new SpotifyWebApi(); - api.searchAlbums('The Best of Keane', { limit: 3, offset: 2 }).then( + api.searchAlbums("The Best of Keane", { limit: 3, offset: 2 }).then( function(data) { expect(data.body.albums.href).toBe( - 'https://api.spotify.com/v1/search?q=The+Best+of+Keane&offset=2&limit=3&type=album' + "https://api.spotify.com/v1/search?q=The+Best+of+Keane&offset=2&limit=3&type=album" ); expect(data.statusCode).toBe(200); - expect('value').toBe(data.headers.test); + expect(data.headers.get("test")).toBe("value"); done(); }, function(err) { @@ -536,76 +527,77 @@ describe('Spotify Web API', () => { ); }); - test('should search for an album using limit and offset using callback', done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.get); - expect(uri).toBe('https://api.spotify.com/v1/search/'); - expect(options.query).toEqual({ - limit: 3, - offset: 2, - q: 'The Best of Keane', - type: 'album' - }); - expect(options.data).toBeFalsy(); - callback(null, { - body: { + test("should search for an album using limit and offset using callback", (done) => { + fetch.mockResponse(async (req) => { + const url = new URL(req.url); + expect(url.pathname).toBe("/v1/search/"); + expect(url.searchParams.get("q")).toBe("The Best of Keane"); + expect(url.searchParams.get("type")).toBe("album"); + expect(url.searchParams.get("limit")).toBe("3"); + expect(url.searchParams.get("offset")).toBe("2"); + expect(req.method).toBe("GET"); + expect(req.body).toBeFalsy(); + + return { + status: 200, + headers: { + "content-type": "application/json", + test: "value", + }, + body: JSON.stringify({ albums: { href: - 'https://api.spotify.com/v1/search?q=The+Best+of+Keane&offset=2&limit=3&type=album' - } - } - }); + "https://api.spotify.com/v1/search?q=The+Best+of+Keane&offset=2&limit=3&type=album", + }, + }), + }; }); var api = new SpotifyWebApi(); - api.searchAlbums('The Best of Keane', { limit: 3, offset: 2 }, function( - err, - data - ) { - expect(err).toBeFalsy(); - expect(data.body.albums.href).toBe( - 'https://api.spotify.com/v1/search?q=The+Best+of+Keane&offset=2&limit=3&type=album' - ); - done(); - }); + api.searchAlbums( + "The Best of Keane", + { limit: 3, offset: 2 }, + function(err, data) { + expect(err).toBeFalsy(); + expect(data.body.albums.href).toBe( + "https://api.spotify.com/v1/search?q=The+Best+of+Keane&offset=2&limit=3&type=album" + ); + done(); + } + ); }); - test('should search for playlists', done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.get); - expect(uri).toBe('https://api.spotify.com/v1/search/'); - expect(options.query).toEqual({ - limit: 1, - offset: 0, - q: 'workout', - type: 'playlist' - }); - expect(options.data).toBeFalsy(); - callback(null, { - body: { + test("should search for playlists", (done) => { + fetch.mockResponse(async (req) => { + const url = new URL(req.url); + expect(url.pathname).toBe("/v1/search/"); + expect(url.searchParams.get("q")).toBe("workout"); + expect(url.searchParams.get("type")).toBe("playlist"); + expect(url.searchParams.get("limit")).toBe("1"); + expect(url.searchParams.get("offset")).toBe("0"); + expect(req.method).toBe("GET"); + expect(req.body).toBeFalsy(); + + return { + status: 200, + headers: { + "content-type": "application/json", + test: "value", + }, + body: JSON.stringify({ playlists: { href: - 'https://api.spotify.com/v1/search?q=workout&offset=0&limit=1&type=playlist' - } - } - }); + "https://api.spotify.com/v1/search?q=workout&offset=0&limit=1&type=playlist", + }, + }), + }; }); var api = new SpotifyWebApi(); - api.searchPlaylists('workout', { limit: 1, offset: 0 }).then( + api.searchPlaylists("workout", { limit: 1, offset: 0 }).then( function(data) { expect(data.body.playlists.href).toBe( - 'https://api.spotify.com/v1/search?q=workout&offset=0&limit=1&type=playlist' + "https://api.spotify.com/v1/search?q=workout&offset=0&limit=1&type=playlist" ); done(); }, @@ -616,37 +608,37 @@ describe('Spotify Web API', () => { ); }); - test('should search for an artist using limit and offset', done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.get); - expect(uri).toBe('https://api.spotify.com/v1/search/'); - expect(options.query).toEqual({ - limit: 5, - offset: 1, - q: 'David Bowie', - type: 'artist' - }); - expect(options.data).toBeFalsy(); - callback(null, { - body: { + test("should search for an artist using limit and offset", (done) => { + fetch.mockResponse(async (req) => { + const url = new URL(req.url); + expect(url.pathname).toBe("/v1/search/"); + expect(url.searchParams.get("q")).toBe("David Bowie"); + expect(url.searchParams.get("type")).toBe("artist"); + expect(url.searchParams.get("limit")).toBe("5"); + expect(url.searchParams.get("offset")).toBe("1"); + expect(req.method).toBe("GET"); + expect(req.body).toBeFalsy(); + + return { + status: 200, + headers: { + "content-type": "application/json", + test: "value", + }, + body: JSON.stringify({ artists: { href: - 'https://api.spotify.com/v1/search?q=David+Bowie&offset=1&limit=5&type=artist' - } - } - }); + "https://api.spotify.com/v1/search?q=David+Bowie&offset=1&limit=5&type=artist", + }, + }), + }; }); var api = new SpotifyWebApi(); - api.searchArtists('David Bowie', { limit: 5, offset: 1 }).then( + api.searchArtists("David Bowie", { limit: 5, offset: 1 }).then( function(data) { expect(data.body.artists.href).toBe( - 'https://api.spotify.com/v1/search?q=David+Bowie&offset=1&limit=5&type=artist' + "https://api.spotify.com/v1/search?q=David+Bowie&offset=1&limit=5&type=artist" ); done(); }, @@ -656,76 +648,77 @@ describe('Spotify Web API', () => { ); }); - test('should search for an artist using limit and offset using callback', done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.get); - expect(uri).toBe('https://api.spotify.com/v1/search/'); - expect(options.query).toEqual({ - limit: 5, - offset: 1, - q: 'David Bowie', - type: 'artist' - }); - expect(options.data).toBeFalsy(); - callback(null, { - body: { + test("should search for an artist using limit and offset using callback", (done) => { + fetch.mockResponse(async (req) => { + const url = new URL(req.url); + expect(url.pathname).toBe("/v1/search/"); + expect(url.searchParams.get("q")).toBe("David Bowie"); + expect(url.searchParams.get("type")).toBe("artist"); + expect(url.searchParams.get("limit")).toBe("5"); + expect(url.searchParams.get("offset")).toBe("1"); + expect(req.method).toBe("GET"); + expect(req.body).toBeFalsy(); + + return { + status: 200, + headers: { + "content-type": "application/json", + test: "value", + }, + body: JSON.stringify({ artists: { href: - 'https://api.spotify.com/v1/search?q=David+Bowie&offset=1&limit=5&type=artist' - } - } - }); + "https://api.spotify.com/v1/search?q=David+Bowie&offset=1&limit=5&type=artist", + }, + }), + }; }); var api = new SpotifyWebApi(); - api.searchArtists('David Bowie', { limit: 5, offset: 1 }, function( - err, - data - ) { - expect(err).toBeFalsy(); - expect(data.body.artists.href).toBe( - 'https://api.spotify.com/v1/search?q=David+Bowie&offset=1&limit=5&type=artist' - ); - done(); - }); + api.searchArtists( + "David Bowie", + { limit: 5, offset: 1 }, + function(err, data) { + expect(err).toBeFalsy(); + expect(data.body.artists.href).toBe( + "https://api.spotify.com/v1/search?q=David+Bowie&offset=1&limit=5&type=artist" + ); + done(); + } + ); }); - test('should search for a track using limit and offset', done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.get); - expect(uri).toBe('https://api.spotify.com/v1/search/'); - expect(options.query).toEqual({ - limit: 3, - offset: 2, - q: 'Mr. Brightside', - type: 'track' - }); - expect(options.data).toBeFalsy(); - callback(null, { - body: { + test("should search for a track using limit and offset", (done) => { + fetch.mockResponse(async (req) => { + const url = new URL(req.url); + expect(url.pathname).toBe("/v1/search/"); + expect(url.searchParams.get("q")).toBe("Mr. Brightside"); + expect(url.searchParams.get("type")).toBe("track"); + expect(url.searchParams.get("limit")).toBe("3"); + expect(url.searchParams.get("offset")).toBe("2"); + expect(req.method).toBe("GET"); + expect(req.body).toBeFalsy(); + + return { + status: 200, + headers: { + "content-type": "application/json", + test: "value", + }, + body: JSON.stringify({ tracks: { href: - 'https://api.spotify.com/v1/search?q=Mr.+Brightside&offset=2&limit=3&type=track' - } - } - }); + "https://api.spotify.com/v1/search?q=Mr.+Brightside&offset=2&limit=3&type=track", + }, + }), + }; }); var api = new SpotifyWebApi(); - api.searchTracks('Mr. Brightside', { limit: 3, offset: 2 }).then( + api.searchTracks("Mr. Brightside", { limit: 3, offset: 2 }).then( function(data) { expect(data.body.tracks.href).toBe( - 'https://api.spotify.com/v1/search?q=Mr.+Brightside&offset=2&limit=3&type=track' + "https://api.spotify.com/v1/search?q=Mr.+Brightside&offset=2&limit=3&type=track" ); done(); }, @@ -736,124 +729,122 @@ describe('Spotify Web API', () => { ); }); - test('should search for a track using limit and offset using callback', done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.get); - expect(uri).toBe('https://api.spotify.com/v1/search/'); - expect(options.query).toEqual({ - limit: 3, - offset: 2, - q: 'Mr. Brightside', - type: 'track' - }); - expect(options.data).toBeFalsy(); - callback(null, { - body: { + test("should search for a track using limit and offset using callback", (done) => { + fetch.mockResponse(async (req) => { + const url = new URL(req.url); + expect(url.pathname).toBe("/v1/search/"); + expect(url.searchParams.get("q")).toBe("Mr. Brightside"); + expect(url.searchParams.get("type")).toBe("track"); + expect(url.searchParams.get("limit")).toBe("3"); + expect(url.searchParams.get("offset")).toBe("2"); + expect(req.method).toBe("GET"); + expect(req.body).toBeFalsy(); + + return { + status: 200, + headers: { + "content-type": "application/json", + test: "value", + }, + body: JSON.stringify({ tracks: { href: - 'https://api.spotify.com/v1/search?q=Mr.+Brightside&offset=2&limit=3&type=track' - } - } - }); + "https://api.spotify.com/v1/search?q=Mr.+Brightside&offset=2&limit=3&type=track", + }, + }), + }; }); var api = new SpotifyWebApi(); - api.searchTracks('Mr. Brightside', { limit: 3, offset: 2 }, function( - err, - data - ) { - expect(err).toBeFalsy(); - expect(data.body.tracks.href).toBe( - 'https://api.spotify.com/v1/search?q=Mr.+Brightside&offset=2&limit=3&type=track' - ); - done(); - }); + api.searchTracks( + "Mr. Brightside", + { limit: 3, offset: 2 }, + function(err, data) { + expect(err).toBeFalsy(); + expect(data.body.tracks.href).toBe( + "https://api.spotify.com/v1/search?q=Mr.+Brightside&offset=2&limit=3&type=track" + ); + done(); + } + ); }); - test('should search for several types using callback', done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.get); - expect(uri).toBe('https://api.spotify.com/v1/search/'); - expect(options.query).toEqual({ - limit: 3, - offset: 2, - q: 'Mr. Brightside', - type: 'track,album' - }); - expect(options.data).toBeFalsy(); - callback(null, { - body: { + test("should search for several types using callback", (done) => { + fetch.mockResponse(async (req) => { + const url = new URL(req.url); + expect(url.pathname).toBe("/v1/search/"); + expect(url.searchParams.get("q")).toBe("Mr. Brightside"); + expect(url.searchParams.get("type")).toBe("track,album"); + expect(url.searchParams.get("limit")).toBe("3"); + expect(url.searchParams.get("offset")).toBe("2"); + expect(req.method).toBe("GET"); + expect(req.body).toBeFalsy(); + + return { + status: 200, + headers: { + "content-type": "application/json", + test: "value", + }, + body: JSON.stringify({ tracks: { href: - 'https://api.spotify.com/v1/search?q=Mr.+Brightside&offset=2&limit=3&type=track,album' - } - } - }); + "https://api.spotify.com/v1/search?q=Mr.+Brightside&offset=2&limit=3&type=track,album", + }, + }), + }; }); var api = new SpotifyWebApi(); api.search( - 'Mr. Brightside', - ['track', 'album'], + "Mr. Brightside", + ["track", "album"], { limit: 3, offset: 2 }, function(err, data) { expect(err).toBeFalsy(); expect(data.body.tracks.href).toBe( - 'https://api.spotify.com/v1/search?q=Mr.+Brightside&offset=2&limit=3&type=track,album' + "https://api.spotify.com/v1/search?q=Mr.+Brightside&offset=2&limit=3&type=track,album" ); done(); } ); }); - test('should get artists albums', done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.get); - expect(uri).toBe( - 'https://api.spotify.com/v1/artists/0oSGxfWSnnOXhD2fKuz2Gy/albums' - ); - expect(options.query).toEqual({ - album_type: 'album', - country: 'GB', - limit: 2, - offset: 5 - }); - expect(options.data).toBeFalsy(); - callback(null, { - body: { + test("should get artists albums", (done) => { + fetch.mockResponse(async (req) => { + const url = new URL(req.url); + expect(req.method).toBe("GET"); + expect(url.pathname).toBe("/v1/artists/0oSGxfWSnnOXhD2fKuz2Gy/albums"); + expect(url.searchParams.get("album_type")).toBe("album"); + expect(url.searchParams.get("country")).toBe("GB"); + expect(url.searchParams.get("limit")).toBe("2"); + expect(url.searchParams.get("offset")).toBe("5"); + expect(req.body).toBeFalsy(); + + return { + status: 200, + headers: { + "content-type": "application/json", + }, + body: JSON.stringify({ href: - 'https://api.spotify.com/v1/artists/0oSGxfWSnnOXhD2fKuz2Gy/albums?offset=5&limit=2&album_type=album&market=GB' - } - }); + "https://api.spotify.com/v1/artists/0oSGxfWSnnOXhD2fKuz2Gy/albums?offset=5&limit=2&album_type=album&market=GB", + }), + }; }); var api = new SpotifyWebApi(); api - .getArtistAlbums('0oSGxfWSnnOXhD2fKuz2Gy', { - album_type: 'album', - country: 'GB', + .getArtistAlbums("0oSGxfWSnnOXhD2fKuz2Gy", { + album_type: "album", + country: "GB", limit: 2, - offset: 5 + offset: 5, }) .then( function(data) { expect(data.body.href).toBe( - 'https://api.spotify.com/v1/artists/0oSGxfWSnnOXhD2fKuz2Gy/albums?offset=5&limit=2&album_type=album&market=GB' + "https://api.spotify.com/v1/artists/0oSGxfWSnnOXhD2fKuz2Gy/albums?offset=5&limit=2&album_type=album&market=GB" ); done(); }, @@ -864,75 +855,69 @@ describe('Spotify Web API', () => { ); }); - test('should get artists albums using callback', done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.get); - expect(uri).toBe( - 'https://api.spotify.com/v1/artists/0oSGxfWSnnOXhD2fKuz2Gy/albums' - ); - expect(options.query).toEqual({ - album_type: 'album', - country: 'GB', - limit: 2, - offset: 5 - }); - expect(options.data).toBeFalsy(); - callback(null, { - body: { + test("should get artists albums using callback", (done) => { + fetch.mockResponse(async (req) => { + const url = new URL(req.url); + expect(req.method).toBe("GET"); + expect(url.pathname).toBe("/v1/artists/0oSGxfWSnnOXhD2fKuz2Gy/albums"); + expect(url.searchParams.get("album_type")).toBe("album"); + expect(url.searchParams.get("country")).toBe("GB"); + expect(url.searchParams.get("limit")).toBe("2"); + expect(url.searchParams.get("offset")).toBe("5"); + expect(req.body).toBeFalsy(); + + return { + status: 200, + headers: { + "content-type": "application/json", + }, + body: JSON.stringify({ href: - 'https://api.spotify.com/v1/artists/0oSGxfWSnnOXhD2fKuz2Gy/albums?offset=5&limit=2&album_type=album&market=GB' - } - }); + "https://api.spotify.com/v1/artists/0oSGxfWSnnOXhD2fKuz2Gy/albums?offset=5&limit=2&album_type=album&market=GB", + }), + }; }); var api = new SpotifyWebApi(); api.getArtistAlbums( - '0oSGxfWSnnOXhD2fKuz2Gy', - { album_type: 'album', country: 'GB', limit: 2, offset: 5 }, + "0oSGxfWSnnOXhD2fKuz2Gy", + { album_type: "album", country: "GB", limit: 2, offset: 5 }, function(err, data) { expect(err).toBeFalsy(); expect(data.body.href).toBe( - 'https://api.spotify.com/v1/artists/0oSGxfWSnnOXhD2fKuz2Gy/albums?offset=5&limit=2&album_type=album&market=GB' + "https://api.spotify.com/v1/artists/0oSGxfWSnnOXhD2fKuz2Gy/albums?offset=5&limit=2&album_type=album&market=GB" ); done(); } ); }); - test('should get tracks from album', done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.get); - expect(uri).toBe( - 'https://api.spotify.com/v1/albums/41MnTivkwTO3UUJ8DrqEJJ/tracks' - ); - expect(options.query).toEqual({ - offset: 1, - limit: 5 - }); - expect(options.data).toBeFalsy(); - callback(null, { - body: { + test("should get tracks from album", (done) => { + fetch.mockResponse(async (req) => { + const url = new URL(req.url); + expect(req.method).toBe("GET"); + expect(url.pathname).toBe("/v1/albums/41MnTivkwTO3UUJ8DrqEJJ/tracks"); + expect(url.searchParams.get("limit")).toBe("5"); + expect(url.searchParams.get("offset")).toBe("1"); + expect(req.body).toBeFalsy(); + + return { + status: 200, + headers: { + "content-type": "application/json", + }, + body: JSON.stringify({ href: - 'https://api.spotify.com/v1/albums/41MnTivkwTO3UUJ8DrqEJJ/tracks?offset=1&limit=5' - } - }); + "https://api.spotify.com/v1/albums/41MnTivkwTO3UUJ8DrqEJJ/tracks?offset=1&limit=5", + }), + }; }); var api = new SpotifyWebApi(); - api.getAlbumTracks('41MnTivkwTO3UUJ8DrqEJJ', { limit: 5, offset: 1 }).then( + api.getAlbumTracks("41MnTivkwTO3UUJ8DrqEJJ", { limit: 5, offset: 1 }).then( function(data) { expect(data.body.href).toBe( - 'https://api.spotify.com/v1/albums/41MnTivkwTO3UUJ8DrqEJJ/tracks?offset=1&limit=5' + "https://api.spotify.com/v1/albums/41MnTivkwTO3UUJ8DrqEJJ/tracks?offset=1&limit=5" ); done(); }, @@ -942,65 +927,66 @@ describe('Spotify Web API', () => { ); }); - test('should get tracks from album using callback', done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.get); - expect(uri).toBe( - 'https://api.spotify.com/v1/albums/41MnTivkwTO3UUJ8DrqEJJ/tracks' - ); - expect(options.query).toEqual({ - offset: 1, - limit: 5 - }); - expect(options.data).toBeFalsy(); - callback(null, { - body: { + test("should get tracks from album using callback", (done) => { + fetch.mockResponse(async (req) => { + const url = new URL(req.url); + expect(req.method).toBe("GET"); + expect(url.pathname).toBe("/v1/albums/41MnTivkwTO3UUJ8DrqEJJ/tracks"); + expect(url.searchParams.get("limit")).toBe("5"); + expect(url.searchParams.get("offset")).toBe("1"); + expect(req.body).toBeFalsy(); + + return { + status: 200, + headers: { + "content-type": "application/json", + }, + body: JSON.stringify({ href: - 'https://api.spotify.com/v1/albums/41MnTivkwTO3UUJ8DrqEJJ/tracks?offset=1&limit=5' - } - }); + "https://api.spotify.com/v1/albums/41MnTivkwTO3UUJ8DrqEJJ/tracks?offset=1&limit=5", + }), + }; }); var api = new SpotifyWebApi(); api.getAlbumTracks( - '41MnTivkwTO3UUJ8DrqEJJ', + "41MnTivkwTO3UUJ8DrqEJJ", { limit: 5, offset: 1 }, function(err, data) { expect(err).toBeFalsy(); expect(data.body.href).toEqual( - 'https://api.spotify.com/v1/albums/41MnTivkwTO3UUJ8DrqEJJ/tracks?offset=1&limit=5' + "https://api.spotify.com/v1/albums/41MnTivkwTO3UUJ8DrqEJJ/tracks?offset=1&limit=5" ); done(); } ); }); - test('should get top tracks for artist', done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.get); - expect(uri).toBe( - 'https://api.spotify.com/v1/artists/0oSGxfWSnnOXhD2fKuz2Gy/top-tracks' + test("should get top tracks for artist", (done) => { + fetch.mockResponse(async (req) => { + const url = new URL(req.url); + expect(req.method).toBe("GET"); + expect(url.pathname).toBe( + "/v1/artists/0oSGxfWSnnOXhD2fKuz2Gy/top-tracks" ); - expect(options.query).toEqual({ - country: 'GB' - }); - expect(options.data).toBeFalsy(); - callback(); + expect(url.searchParams.get("country")).toBe("GB"); + expect(req.body).toBeFalsy(); + + return { + status: 200, + headers: { + "content-type": "application/json", + }, + body: JSON.stringify({ + href: + "https://api.spotify.com/v1/artists/0oSGxfWSnnOXhD2fKuz2Gy/top-tracks?country=GB", + }), + }; }); var api = new SpotifyWebApi(); - api.getArtistTopTracks('0oSGxfWSnnOXhD2fKuz2Gy', 'GB').then( + api.getArtistTopTracks("0oSGxfWSnnOXhD2fKuz2Gy", "GB").then( function(data) { done(); }, @@ -1010,54 +996,62 @@ describe('Spotify Web API', () => { ); }); - test('should get top tracks for artist', done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.get); - expect(uri).toBe( - 'https://api.spotify.com/v1/artists/0oSGxfWSnnOXhD2fKuz2Gy/top-tracks' + test("should get top tracks for artist", (done) => { + fetch.mockResponse(async (req) => { + const url = new URL(req.url); + expect(req.method).toBe("GET"); + expect(url.pathname).toBe( + "/v1/artists/0oSGxfWSnnOXhD2fKuz2Gy/top-tracks" ); - expect(options.query).toEqual({ - country: 'GB' - }); - expect(options.data).toBeFalsy(); - callback(); + expect(url.searchParams.get("country")).toBe("GB"); + expect(req.body).toBeFalsy(); + + return { + status: 200, + headers: { + "content-type": "application/json", + }, + body: JSON.stringify({ + href: + "https://api.spotify.com/v1/artists/0oSGxfWSnnOXhD2fKuz2Gy/top-tracks?country=GB", + }), + }; }); var api = new SpotifyWebApi(); - api.getArtistTopTracks('0oSGxfWSnnOXhD2fKuz2Gy', 'GB', function(err, data) { - expect(err).toBeFalsy(); - done(); - }); + api.getArtistTopTracks( + "0oSGxfWSnnOXhD2fKuz2Gy", + "GB", + function(err, data) { + expect(err).toBeFalsy(); + done(); + } + ); }); - test('should get similar artists', done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.get); - expect(uri).toBe( - 'https://api.spotify.com/v1/artists/0qeei9KQnptjwb8MgkqEoy/related-artists' + test("should get similar artists", (done) => { + fetch.mockResponse(async (req) => { + expect(req.method).toBe("GET"); + expect(req.url).toBe( + "https://api.spotify.com/v1/artists/0qeei9KQnptjwb8MgkqEoy/related-artists" ); - expect(options.data).toBeFalsy(); - callback(null, { - body: { - artists: [{}] - } - }); + expect(req.body).toBeFalsy(); + + return { + status: 200, + headers: { + "content-type": "application/json", + }, + body: JSON.stringify({ + artists: [{}], + }), + }; }); var api = new SpotifyWebApi(); - api.getArtistRelatedArtists('0qeei9KQnptjwb8MgkqEoy').then( + api.getArtistRelatedArtists("0qeei9KQnptjwb8MgkqEoy").then( function(data) { expect(data.body.artists).toBeTruthy(); done(); @@ -1068,55 +1062,55 @@ describe('Spotify Web API', () => { ); }); - test('should get similar artists using callback', done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.get); - expect(uri).toBe( - 'https://api.spotify.com/v1/artists/0qeei9KQnptjwb8MgkqEoy/related-artists' + test("should get similar artists using callback", (done) => { + fetch.mockResponse(async (req) => { + expect(req.method).toBe("GET"); + expect(req.url).toBe( + "https://api.spotify.com/v1/artists/0qeei9KQnptjwb8MgkqEoy/related-artists" ); - expect(options.data).toBeFalsy(); - callback(null, { - body: { - artists: [{}] - } - }); + expect(req.body).toBeFalsy(); + + return { + status: 200, + headers: { + "content-type": "application/json", + }, + body: JSON.stringify({ + artists: [{}], + }), + }; }); var api = new SpotifyWebApi(); - api.getArtistRelatedArtists('0qeei9KQnptjwb8MgkqEoy', function(err, data) { + api.getArtistRelatedArtists("0qeei9KQnptjwb8MgkqEoy", function(err, data) { expect(data.body.artists).toBeTruthy(); done(); }); }); - test('should get a user', done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.get); - expect(uri).toBe('https://api.spotify.com/v1/users/petteralexis'); - expect(options.data).toBeFalsy(); - callback(null, { - body: { - uri: 'spotify:user:petteralexis' - } - }); + test("should get a user", (done) => { + fetch.mockResponse(async (req) => { + expect(req.method).toBe("GET"); + expect(req.url).toBe("https://api.spotify.com/v1/users/petteralexis"); + expect(req.body).toBeFalsy(); + + return { + status: 200, + headers: { + "content-type": "application/json", + }, + body: JSON.stringify({ + uri: "spotify:user:petteralexis", + }), + }; }); var api = new SpotifyWebApi(); - api.getUser('petteralexis').then( + api.getUser("petteralexis").then( function(data) { - expect('spotify:user:petteralexis').toBe(data.body.uri); + expect("spotify:user:petteralexis").toBe(data.body.uri); done(); }, function(err) { @@ -1125,28 +1119,28 @@ describe('Spotify Web API', () => { ); }); - test("should get a user with a '#' character and encode it properly", done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.get); - expect(uri).toBe('https://api.spotify.com/v1/users/%23matze23'); - expect(options.data).toBeFalsy(); - callback(null, { - body: { - uri: 'spotify:user:%23matze23' - } - }); + test("should get a user with a '#' character and encode it properly", (done) => { + fetch.mockResponse(async (req) => { + expect(req.method).toBe("GET"); + expect(req.url).toBe("https://api.spotify.com/v1/users/%23matze23"); + expect(req.body).toBeFalsy(); + + return { + status: 200, + headers: { + "content-type": "application/json", + }, + body: JSON.stringify({ + uri: "spotify:user:%23matze23", + }), + }; }); var api = new SpotifyWebApi(); - api.getUser('#matze23').then( + api.getUser("#matze23").then( function(data) { - expect('spotify:user:%23matze23').toBe(data.body.uri); + expect("spotify:user:%23matze23").toBe(data.body.uri); done(); }, function(err) { @@ -1155,152 +1149,154 @@ describe('Spotify Web API', () => { ); }); - test('should get a user using callback', done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.get); - expect(uri).toBe('https://api.spotify.com/v1/users/petteralexis'); - expect(options.data).toBeFalsy(); - callback(null, { - body: { - uri: 'spotify:user:petteralexis' - } - }); + test("should get a user using callback", (done) => { + fetch.mockResponse(async (req) => { + expect(req.method).toBe("GET"); + expect(req.url).toBe("https://api.spotify.com/v1/users/petteralexis"); + expect(req.body).toBeFalsy(); + + return { + status: 200, + headers: { + "content-type": "application/json", + }, + body: JSON.stringify({ + uri: "spotify:user:petteralexis", + }), + }; }); var api = new SpotifyWebApi(); - api.getUser('petteralexis', function(err, data) { - expect('spotify:user:petteralexis').toBe(data.body.uri); + api.getUser("petteralexis", function(err, data) { + expect("spotify:user:petteralexis").toBe(data.body.uri); done(); }); }); - test("should get the authenticated user's information", done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.get); - expect(uri).toBe('https://api.spotify.com/v1/me'); - expect(options.headers).toEqual({ - Authorization: 'Bearer someAccessToken' - }); - callback(null, { - body: { - uri: 'spotify:user:thelinmichael' - } - }); + test("should get the authenticated user's information", (done) => { + fetch.mockResponse(async (req) => { + expect(req.method).toBe("GET"); + expect(req.url).toBe("https://api.spotify.com/v1/me"); + expect(req.headers.get("authorization")).toBe("Bearer someAccessToken"); + expect(req.body).toBeFalsy(); + + return { + status: 200, + headers: { + "content-type": "application/json", + }, + body: JSON.stringify({ + uri: "spotify:user:thelinmichael", + }), + }; }); var api = new SpotifyWebApi({ - accessToken: 'someAccessToken' + accessToken: "someAccessToken", }); api.getMe().then(function(data) { - expect('spotify:user:thelinmichael').toBe(data.body.uri); + expect("spotify:user:thelinmichael").toBe(data.body.uri); done(); }); }); - test("should get the authenticated user's information with accesstoken set on the api object", done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.get); - expect(uri).toBe('https://api.spotify.com/v1/me'); - expect(options.headers).toEqual({ - Authorization: 'Bearer someAccessToken' - }); - callback(null, { - body: { - uri: 'spotify:user:thelinmichael' - } - }); + test("should get the authenticated user's information with accesstoken set on the api object", (done) => { + fetch.mockResponse(async (req) => { + expect(req.method).toBe("GET"); + expect(req.url).toBe("https://api.spotify.com/v1/me"); + expect(req.headers.get("authorization")).toBe("Bearer someAccessToken"); + expect(req.body).toBeFalsy(); + + return { + status: 200, + headers: { + "content-type": "application/json", + }, + body: JSON.stringify({ + uri: "spotify:user:thelinmichael", + }), + }; }); var api = new SpotifyWebApi(); - api.setAccessToken('someAccessToken'); + api.setAccessToken("someAccessToken"); api.getMe().then(function(data) { - expect('spotify:user:thelinmichael').toBe(data.body.uri); + expect("spotify:user:thelinmichael").toBe(data.body.uri); done(); }); }); - test('should get a users playlists', done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.get); - expect(uri).toBe( - 'https://api.spotify.com/v1/users/thelinmichael/playlists' + test("should get a users playlists", (done) => { + fetch.mockResponse(async (req) => { + expect(req.method).toBe("GET"); + expect(req.url).toBe( + "https://api.spotify.com/v1/users/thelinmichael/playlists" + ); + expect(req.headers.get("authorization")).toBe( + "Bearer myVeryLongAccessToken" ); - expect(options.query).toBeFalsy(); - callback(null, { - body: { + expect(req.body).toBeFalsy(); + + return { + status: 200, + headers: { + "content-type": "application/json", + }, + body: JSON.stringify({ items: [ { - uri: 'spotify:user:thelinmichael:playlist:5ieJqeLJjjI8iJWaxeBLuK' + uri: "spotify:user:thelinmichael:playlist:5ieJqeLJjjI8iJWaxeBLuK", }, { - uri: 'spotify:user:thelinmichael:playlist:3EsfV6XzCHU8SPNdbnFogK' - } - ] - }, - statusCode: 200 - }); + uri: "spotify:user:thelinmichael:playlist:3EsfV6XzCHU8SPNdbnFogK", + }, + ], + }), + }; }); var api = new SpotifyWebApi(); - api.setAccessToken('myVeryLongAccessToken'); + api.setAccessToken("myVeryLongAccessToken"); - api.getUserPlaylists('thelinmichael').then(function(data) { + api.getUserPlaylists("thelinmichael").then(function(data) { expect(2).toBe(data.body.items.length); expect(data.statusCode).toBe(200); done(); }); }); - test('should get the current users playlists', done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.get); - expect(uri).toBe('https://api.spotify.com/v1/me/playlists'); - expect(options.query).toBeFalsy(); - callback(null, { - body: { + test("should get the current users playlists", (done) => { + fetch.mockResponse(async (req) => { + expect(req.method).toBe("GET"); + expect(req.url).toBe("https://api.spotify.com/v1/me/playlists"); + expect(req.headers.get("authorization")).toBe( + "Bearer myVeryLongAccessToken" + ); + expect(req.body).toBeFalsy(); + + return { + status: 200, + headers: { + "content-type": "application/json", + }, + body: JSON.stringify({ items: [ { - uri: 'spotify:user:thelinmichael:playlist:5ieJqeLJjjI8iJWaxeBLuK' + uri: "spotify:user:thelinmichael:playlist:5ieJqeLJjjI8iJWaxeBLuK", }, { - uri: 'spotify:user:thelinmichael:playlist:3EsfV6XzCHU8SPNdbnFogK' - } - ] - }, - statusCode: 200 - }); + uri: "spotify:user:thelinmichael:playlist:3EsfV6XzCHU8SPNdbnFogK", + }, + ], + }), + }; }); var api = new SpotifyWebApi(); - api.setAccessToken('myVeryLongAccessToken'); + api.setAccessToken("myVeryLongAccessToken"); api.getUserPlaylists().then(function(data) { expect(2).toBe(data.body.items.length); @@ -1309,33 +1305,38 @@ describe('Spotify Web API', () => { }); }); - test('should get the current users playlists with options', done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.get); - expect(uri).toBe('https://api.spotify.com/v1/me/playlists'); - expect(options.query).toEqual({ limit: 27, offset: 7 }); - callback(null, { - body: { + test("should get the current users playlists with options", (done) => { + fetch.mockResponse(async (req) => { + const url = new URL(req.url); + expect(req.method).toBe("GET"); + expect(url.pathname).toBe("/v1/me/playlists"); + expect(url.searchParams.get("limit")).toBe("27"); + expect(url.searchParams.get("offset")).toBe("7"); + expect(req.headers.get("authorization")).toBe( + "Bearer myVeryLongAccessToken" + ); + expect(req.body).toBeFalsy(); + + return { + status: 200, + headers: { + "content-type": "application/json", + }, + body: JSON.stringify({ items: [ { - uri: 'spotify:user:thelinmichael:playlist:5ieJqeLJjjI8iJWaxeBLuK' + uri: "spotify:user:thelinmichael:playlist:5ieJqeLJjjI8iJWaxeBLuK", }, { - uri: 'spotify:user:thelinmichael:playlist:3EsfV6XzCHU8SPNdbnFogK' - } - ] - }, - statusCode: 200 - }); + uri: "spotify:user:thelinmichael:playlist:3EsfV6XzCHU8SPNdbnFogK", + }, + ], + }), + }; }); var api = new SpotifyWebApi(); - api.setAccessToken('myVeryLongAccessToken'); + api.setAccessToken("myVeryLongAccessToken"); api.getUserPlaylists({ limit: 27, offset: 7 }).then(function(data) { expect(2).toBe(data.body.items.length); @@ -1344,135 +1345,142 @@ describe('Spotify Web API', () => { }); }); - test('should get a playlist', done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.get); - expect(uri).toBe( - 'https://api.spotify.com/v1/playlists/5ieJqeLJjjI8iJWaxeBLuK' + test("should get a playlist", (done) => { + fetch.mockResponse(async (req) => { + expect(req.method).toBe("GET"); + expect(req.url).toBe( + "https://api.spotify.com/v1/playlists/5ieJqeLJjjI8iJWaxeBLuK" ); - expect(options.query).toBeFalsy(); - callback(null, { - body: { - uri: 'spotify:playlist:5ieJqeLJjjI8iJWaxeBLuK' + expect(req.headers.get("authorization")).toBe( + "Bearer myVeryVeryLongAccessToken" + ); + expect(req.body).toBeFalsy(); + + return { + status: 200, + headers: { + "content-type": "application/json", }, - statusCode: 200 - }); + body: JSON.stringify({ + uri: "spotify:playlist:5ieJqeLJjjI8iJWaxeBLuK", + }), + }; }); var api = new SpotifyWebApi(); - api.setAccessToken('myVeryVeryLongAccessToken'); + api.setAccessToken("myVeryVeryLongAccessToken"); - api.getPlaylist('5ieJqeLJjjI8iJWaxeBLuK', {}, function(err, data) { - expect(data.body.uri).toBe('spotify:playlist:5ieJqeLJjjI8iJWaxeBLuK'); + api.getPlaylist("5ieJqeLJjjI8iJWaxeBLuK", {}, function(err, data) { + expect(data.body.uri).toBe("spotify:playlist:5ieJqeLJjjI8iJWaxeBLuK"); expect(data.statusCode).toBe(200); done(); }); }); - test('should create a playlist', function(done) { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.post); - expect(uri).toBe( - 'https://api.spotify.com/v1/me/playlists' - ); - expect(JSON.parse(options.data)).toEqual({ - name: 'My Cool Playlist' - }); - expect(options.headers['Content-Type']).toBe('application/json'); - expect(options.query).toBeFalsy(); - callback(null, { - body: { name: 'My Cool Playlist' }, - statusCode: 200 - }); + test("should create a playlist", function(done) { + fetch.mockResponse(async (req) => { + expect(req.method).toBe("POST"); + expect(req.url).toBe("https://api.spotify.com/v1/me/playlists"); + expect(req.headers.get("authorization")).toBe("Bearer long-access-token"); + expect(req.headers.get("content-type")).toBe("application/json"); + expect(JSON.parse(JSON.parse(req.body)).name).toBe("My Cool Playlist"); + + return { + status: 200, + headers: { + "content-type": "application/json", + }, + body: JSON.stringify({ + name: "My Cool Playlist", + }), + }; }); var api = new SpotifyWebApi(); - api.setAccessToken('long-access-token'); + api.setAccessToken("long-access-token"); - api - .createPlaylist('My Cool Playlist') - .then( - function(data) { - expect(data.body.name).toBe('My Cool Playlist'); - expect(data.statusCode).toBe(200); - done(); - }, - function(err) { - console.log(err.error); - done(err); - } - ); + api.createPlaylist("My Cool Playlist").then( + function(data) { + expect(data.body.name).toBe("My Cool Playlist"); + expect(data.statusCode).toBe(200); + done(); + }, + function(err) { + console.log(err.error); + done(err); + } + ); }); - test('should create a private playlist using callback', done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.post); - expect(uri).toBe( - 'https://api.spotify.com/v1/me/playlists' - ); - expect(JSON.parse(options.data)).toEqual({ - name: 'My Cool Playlist', - description: 'It\'s really cool', - public: false + test("should create a private playlist using callback", (done) => { + fetch.mockResponse(async (req) => { + expect(req.method).toBe("POST"); + expect(req.url).toBe("https://api.spotify.com/v1/me/playlists"); + expect(req.headers.get("content-type")).toBe("application/json"); + expect(JSON.parse(JSON.parse(req.body))).toEqual({ + name: "My Cool Playlist", + description: "It's really cool", + public: false, }); - expect(options.headers['Content-Type']).toBe('application/json'); - expect(options.query).toBeFalsy(); - callback(null, {}); + + return { + status: 200, + headers: { + "content-type": "application/json", + }, + body: JSON.stringify({ + name: "My Cool Playlist", + description: "It's really cool", + public: false, + }), + }; }); var api = new SpotifyWebApi(); api.createPlaylist( - 'My Cool Playlist', - { description: 'It\'s really cool', public: false }, + "My Cool Playlist", + { description: "It's really cool", public: false }, function(err, data) { done(err); } ); }); - test('should change playlist details', done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.put); - expect(uri).toBe( - 'https://api.spotify.com/v1/playlists/5ieJqeLJjjI8iJWaxeBLuK' + test("should change playlist details", (done) => { + fetch.mockResponse(async (req) => { + expect(req.method).toBe("PUT"); + expect(req.url).toBe( + "https://api.spotify.com/v1/playlists/5ieJqeLJjjI8iJWaxeBLuK" ); - expect(JSON.parse(options.data)).toEqual({ + expect(req.headers.get("content-type")).toBe("application/json"); + expect(JSON.parse(JSON.parse(req.body))).toEqual({ name: - 'This is a new name for my Cool Playlist, and will become private', - public: false + "This is a new name for my Cool Playlist, and will become private", + public: false, }); - expect(options.headers['Content-Type']).toBe('application/json'); - expect(options.query).toBeFalsy(); - callback(null, { statusCode: 200 }); + + return { + status: 200, + headers: { + "content-type": "application/json", + }, + body: JSON.stringify({ + name: + "This is a new name for my Cool Playlist, and will become private", + public: false, + }), + }; }); var api = new SpotifyWebApi(); - api.setAccessToken('long-access-token'); + api.setAccessToken("long-access-token"); - api.changePlaylistDetails('5ieJqeLJjjI8iJWaxeBLuK', { - name: 'This is a new name for my Cool Playlist, and will become private', - public: false + api + .changePlaylistDetails("5ieJqeLJjjI8iJWaxeBLuK", { + name: + "This is a new name for my Cool Playlist, and will become private", + public: false, }) .then(function(data) { expect(data.statusCode).toBe(200); @@ -1480,31 +1488,38 @@ describe('Spotify Web API', () => { }); }); - test('should add tracks to playlist', done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.post); - expect(uri).toBe( - 'https://api.spotify.com/v1/playlists/5ieJqeLJjjI8iJWaxeBLuK/tracks' + test("should add tracks to playlist", (done) => { + fetch.mockResponse(async (req) => { + expect(req.method).toBe("POST"); + expect(req.url).toBe( + "https://api.spotify.com/v1/playlists/5ieJqeLJjjI8iJWaxeBLuK/tracks" ); - expect(options.query).toBeFalsy(); - expect(JSON.parse(options.data)['uris']).toBeInstanceOf(Array); - expect(JSON.parse(options.data)['uris']).toHaveLength(2); - expect(options.headers['Content-Type']).toBe('application/json'); - callback(null, { body: { snapshot_id: 'aSnapshotId' }, statusCode: 201 }); + expect(req.headers.get("content-type")).toBe("application/json"); + expect(JSON.parse(JSON.parse(req.body))).toEqual({ + uris: [ + "spotify:track:4iV5W9uYEdYUVa79Axb7Rh", + "spotify:track:1301WleyT98MSxVHPZCA6M", + ], + }); + + return { + status: 201, + headers: { + "content-type": "application/json", + }, + body: JSON.stringify({ + snapshot_id: "aSnapshotId", + }), + }; }); var api = new SpotifyWebApi(); - api.setAccessToken('long-access-token'); + api.setAccessToken("long-access-token"); api - .addTracksToPlaylist('5ieJqeLJjjI8iJWaxeBLuK', [ - 'spotify:track:4iV5W9uYEdYUVa79Axb7Rh', - 'spotify:track:1301WleyT98MSxVHPZCA6M' + .addTracksToPlaylist("5ieJqeLJjjI8iJWaxeBLuK", [ + "spotify:track:4iV5W9uYEdYUVa79Axb7Rh", + "spotify:track:1301WleyT98MSxVHPZCA6M", ]) .then(function(data) { expect(201).toBe(data.statusCode); @@ -1512,35 +1527,43 @@ describe('Spotify Web API', () => { }); }); - test('should add tracks to playlist with specified index', done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.post); - expect(JSON.parse(options.data)['uris']).toBeInstanceOf(Array); - expect(JSON.parse(options.data)['uris']).toHaveLength(2); - expect(options.query).toEqual({ - position: 10 + test("should add tracks to playlist with specified index", (done) => { + fetch.mockResponse(async (req) => { + const url = new URL(req.url); + expect(req.method).toBe("POST"); + expect(url.pathname).toBe("/v1/playlists/5ieJqeLJjjI8iJWaxeBLuK/tracks"); + expect(req.headers.get("content-type")).toBe("application/json"); + expect(JSON.parse(JSON.parse(req.body))).toEqual({ + uris: [ + "spotify:track:4iV5W9uYEdYUVa79Axb7Rh", + "spotify:track:1301WleyT98MSxVHPZCA6M", + ], }); - expect(options.headers['Content-Type']).toBe('application/json'); - callback(null, { body: { snapshot_id: 'aSnapshotId' }, statusCode: 201 }); + expect(url.searchParams.get("position")).toEqual("10"); + + return { + status: 201, + headers: { + "content-type": "application/json", + }, + body: JSON.stringify({ + snapshot_id: "aSnapshotId", + }), + }; }); var api = new SpotifyWebApi(); - api.setAccessToken('long-access-token'); + api.setAccessToken("long-access-token"); api .addTracksToPlaylist( - '5ieJqeLJjjI8iJWaxeBLuK', + "5ieJqeLJjjI8iJWaxeBLuK", [ - 'spotify:track:4iV5W9uYEdYUVa79Axb7Rh', - 'spotify:track:1301WleyT98MSxVHPZCA6M' + "spotify:track:4iV5W9uYEdYUVa79Axb7Rh", + "spotify:track:1301WleyT98MSxVHPZCA6M", ], { - position: 10 + position: 10, } ) .then(function(data) { @@ -1549,83 +1572,91 @@ describe('Spotify Web API', () => { }); /* Get a Playlist's Items */ - test('should get a playlist items', done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.get); - expect(uri).toBe('https://api.spotify.com/v1/playlists/3iV5W9uYEdYUVa79Axb7Rh/tracks'); - expect(options.query).toEqual({ - limit: 5, - offset: 1, - market: 'SE', - additional_types : 'episode', - fields : 'total' - }); - callback(null, { - body: {} - }); + test("should get a playlist items", (done) => { + fetch.mockResponse(async (req) => { + const url = new URL(req.url); + expect(req.method).toBe("GET"); + expect(url.pathname).toBe("/v1/playlists/3iV5W9uYEdYUVa79Axb7Rh/tracks"); + expect(url.searchParams.get("limit")).toEqual("5"); + expect(url.searchParams.get("offset")).toEqual("1"); + expect(url.searchParams.get("market")).toEqual("SE"); + expect(url.searchParams.get("additional_types")).toEqual("episode"); + expect(url.searchParams.get("fields")).toEqual("total"); + expect(req.body).toBeFalsy(); + + return { + status: 200, + headers: { + "content-type": "application/json", + }, + body: JSON.stringify({}), + }; }); var api = new SpotifyWebApi(); - api.getPlaylistTracks('3iV5W9uYEdYUVa79Axb7Rh', { limit: 5, offset: 1, market: 'SE', additional_types: 'episode', fields : 'total' }).then(function(data) { - done(); - }); + api + .getPlaylistTracks("3iV5W9uYEdYUVa79Axb7Rh", { + limit: 5, + offset: 1, + market: "SE", + additional_types: "episode", + fields: "total", + }) + .then(function(data) { + done(); + }); }); /* Upload a Custom Playlist Cover Image */ - test('should upload custom playlist cover image', done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.put); - expect(uri).toBe('https://api.spotify.com/v1/playlists/3iV5W9uYEdYUVa79Axb7Rh/images'); - expect(options.headers['Content-Type']).toBe('image/jpeg'); - expect(options.data).toEqual('longbase64uri'); - - callback(null, { - body: {} - }); + test("should upload custom playlist cover image", (done) => { + fetch.mockResponse(async (req) => { + const url = new URL(req.url); + expect(req.method).toBe("PUT"); + expect(url.pathname).toBe("/v1/playlists/3iV5W9uYEdYUVa79Axb7Rh/images"); + expect(req.headers.get("content-type")).toBe("image/jpeg"); + expect(String(req.body)).toContain("longbase64uri"); + + return { + status: 202, + headers: { + "content-type": "application/json", + }, + body: JSON.stringify({}), + }; }); var api = new SpotifyWebApi(); - api.uploadCustomPlaylistCoverImage('3iV5W9uYEdYUVa79Axb7Rh', 'longbase64uri').then(function(data) { - done(); - }); + api + .uploadCustomPlaylistCoverImage("3iV5W9uYEdYUVa79Axb7Rh", "longbase64uri") + .then(function(data) { + done(); + }); }); - test("should get user's top artists", done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.get); - expect(uri).toBe('https://api.spotify.com/v1/me/top/artists'); - expect(options.query).toEqual({ - limit: 5 - }); - expect(options.headers).toEqual({ - Authorization: 'Bearer someAccessToken' - }); - callback(null, { - body: { - items: [] - } - }); + test("should get user's top artists", (done) => { + fetch.mockResponse(async (req) => { + const url = new URL(req.url); + expect(req.method).toBe("GET"); + expect(url.pathname).toBe("/v1/me/top/artists"); + expect(url.searchParams.get("limit")).toEqual("5"); + expect(req.body).toBeFalsy(); + expect(req.headers.get("authorization")).toBe("Bearer someAccessToken"); + + return { + status: 200, + headers: { + "content-type": "application/json", + }, + body: JSON.stringify({ + items: [], + }), + }; }); var api = new SpotifyWebApi({ - accessToken: 'someAccessToken' + accessToken: "someAccessToken", }); api.getMyTopArtists({ limit: 5 }).then(function(data) { @@ -1634,30 +1665,28 @@ describe('Spotify Web API', () => { }); }); - test("should get user's top tracks", done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.get); - expect(uri).toBe('https://api.spotify.com/v1/me/top/tracks'); - expect(options.query).toEqual({ - limit: 5 - }); - expect(options.headers).toEqual({ - Authorization: 'Bearer someAccessToken' - }); - callback(null, { - body: { - items: [] - } - }); + test("should get user's top tracks", (done) => { + fetch.mockResponse(async (req) => { + const url = new URL(req.url); + expect(req.method).toBe("GET"); + expect(url.pathname).toBe("/v1/me/top/tracks"); + expect(url.searchParams.get("limit")).toEqual("5"); + expect(req.body).toBeFalsy(); + expect(req.headers.get("authorization")).toBe("Bearer someAccessToken"); + + return { + status: 200, + headers: { + "content-type": "application/json", + }, + body: JSON.stringify({ + items: [], + }), + }; }); var api = new SpotifyWebApi({ - accessToken: 'someAccessToken' + accessToken: "someAccessToken", }); api.getMyTopTracks({ limit: 5 }).then(function(data) { @@ -1666,53 +1695,55 @@ describe('Spotify Web API', () => { }); }); - test("should get user\'s currently playing track", done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.get); - expect(uri).toBe('https://api.spotify.com/v1/me/player/currently-playing'); - expect(options.query).toStrictEqual({ market: 'NO' }); - expect(options.headers).toEqual({ Authorization: 'Bearer someAccessToken' }); - callback(null, {}); + test("should get user's currently playing track", (done) => { + fetch.mockResponse(async (req) => { + const url = new URL(req.url); + expect(req.method).toBe("GET"); + expect(url.pathname).toBe("/v1/me/player/currently-playing"); + expect(url.searchParams.get("market")).toEqual("NO"); + expect(req.body).toBeFalsy(); + expect(req.headers.get("authorization")).toBe("Bearer someAccessToken"); + + return { + status: 200, + headers: { + "content-type": "application/json", + }, + body: JSON.stringify({}), + }; }); var api = new SpotifyWebApi({ - accessToken: 'someAccessToken' + accessToken: "someAccessToken", }); - api.getMyCurrentPlayingTrack({ market: 'NO' }).then(function(data, err) { + api.getMyCurrentPlayingTrack({ market: "NO" }).then(function(data, err) { done(err); }); }); - test("should get user's recently played tracks:", done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.get); - expect(uri).toBe('https://api.spotify.com/v1/me/player/recently-played'); - expect(options.query).toEqual({ - limit: 5 - }); - expect(options.headers).toEqual({ - Authorization: 'Bearer someAccessToken' - }); - callback(null, { - body: { - items: [] - } - }); + test("should get user's recently played tracks:", (done) => { + fetch.mockResponse(async (req) => { + const url = new URL(req.url); + expect(req.method).toBe("GET"); + expect(url.pathname).toBe("/v1/me/player/recently-played"); + expect(url.searchParams.get("limit")).toEqual("5"); + expect(req.body).toBeFalsy(); + expect(req.headers.get("authorization")).toBe("Bearer someAccessToken"); + + return { + status: 200, + headers: { + "content-type": "application/json", + }, + body: JSON.stringify({ + items: [], + }), + }; }); var api = new SpotifyWebApi({ - accessToken: 'someAccessToken' + accessToken: "someAccessToken", }); api.getMyRecentlyPlayedTracks({ limit: 5 }).then(function(data) { @@ -1721,52 +1752,51 @@ describe('Spotify Web API', () => { }); }); - test("should add songs to the user's queue:", done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.post); - expect(uri).toBe('https://api.spotify.com/v1/me/player/queue'); - expect(options.query).toEqual({ - uri: 'spotify:track:2jpDioAB9tlYXMdXDK3BGl' - }); - expect(options.headers).toEqual({ - Authorization: 'Bearer someAccessToken' - }); - callback(null, null); + test("should add songs to the user's queue", (done) => { + fetch.mockResponse(async (req) => { + const url = new URL(req.url); + expect(req.method).toBe("POST"); + expect(url.pathname).toBe("/v1/me/player/queue"); + expect(url.searchParams.get("uri")).toEqual( + "spotify:track:2jpDioAB9tlYXMdXDK3BGl" + ); + expect(req.body).toBeFalsy(); + expect(req.headers.get("authorization")).toBe("Bearer someAccessToken"); + + return { + status: 204, + }; }); var api = new SpotifyWebApi({ - accessToken: 'someAccessToken' + accessToken: "someAccessToken", }); - api.addToQueue('spotify:track:2jpDioAB9tlYXMdXDK3BGl').then(done); + api + .addToQueue("spotify:track:2jpDioAB9tlYXMdXDK3BGl") + .then((data, err) => done(err)); }); - test("should get user's devices:", done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.get); - expect(uri).toBe('https://api.spotify.com/v1/me/player/devices'); - expect(options.headers).toEqual({ - Authorization: 'Bearer someAccessToken' - }); - callback(null, { - body: { - devices: [] - } - }); + test("should get user's devices", (done) => { + fetch.mockResponse(async (req) => { + const url = new URL(req.url); + expect(req.method).toBe("GET"); + expect(url.pathname).toBe("/v1/me/player/devices"); + expect(req.headers.get("authorization")).toBe("Bearer someAccessToken"); + + return { + status: 200, + headers: { + "content-type": "application/json", + }, + body: JSON.stringify({ + devices: [], + }), + }; }); var api = new SpotifyWebApi({ - accessToken: 'someAccessToken' + accessToken: "someAccessToken", }); api.getMyDevices().then(function(data) { @@ -1775,65 +1805,60 @@ describe('Spotify Web API', () => { }); }); - test("should get user's current playback status:", done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.get); - expect(uri).toBe('https://api.spotify.com/v1/me/player'); - expect(options.query).toEqual({ - market: 'GB' - }); - expect(options.headers).toEqual({ - Authorization: 'Bearer someAccessToken' - }); - callback(null, { - body: { - device: {} - } - }); + test("should get user's current playback status", (done) => { + fetch.mockResponse(async (req) => { + const url = new URL(req.url); + expect(req.method).toBe("GET"); + expect(url.pathname).toBe("/v1/me/player"); + expect(url.searchParams.get("market")).toEqual("GB"); + expect(req.headers.get("authorization")).toBe("Bearer someAccessToken"); + + return { + status: 200, + headers: { + "content-type": "application/json", + }, + body: JSON.stringify({ + device: {}, + }), + }; }); var api = new SpotifyWebApi({ - accessToken: 'someAccessToken' + accessToken: "someAccessToken", }); - api.getMyCurrentPlaybackState({ market: 'GB' }).then(function(data) { + api.getMyCurrentPlaybackState({ market: "GB" }).then(function(data) { expect(data.body.device).toBeTruthy(); done(); }); }); - test("should transfer the user's playback", done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.put); - expect(uri).toBe('https://api.spotify.com/v1/me/player'); - expect(JSON.parse(options.data)).toEqual({ - device_ids : ['my-device-id'], - play: true + test("should transfer the user's playback", (done) => { + fetch.mockResponse(async (req) => { + expect(req.method).toBe("PUT"); + expect(req.url).toBe("https://api.spotify.com/v1/me/player"); + expect(req.headers.get("authorization")).toBe("Bearer myAccessToken"); + expect(req.headers.get("content-type")).toBe("application/json"); + expect(JSON.parse(JSON.parse(req.body))).toEqual({ + device_ids: ["my-device-id"], + play: true, }); - expect(options.query).toBeFalsy(); - expect(options.headers['Content-Type']).toBe('application/json'); - callback(); + + return { + status: 204, + }; }); - var accessToken = 'myAccessToken'; + var accessToken = "myAccessToken"; var api = new SpotifyWebApi({ - accessToken: accessToken + accessToken: accessToken, }); api - .transferMyPlayback(['my-device-id'], { - play: true + .transferMyPlayback(["my-device-id"], { + play: true, }) .then( function(data) { @@ -1846,60 +1871,54 @@ describe('Spotify Web API', () => { ); }); - test("should transfer the user's playback without using options", done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.put); - expect(uri).toBe('https://api.spotify.com/v1/me/player'); - expect(JSON.parse(options.data)).toEqual({ - device_ids : ['my-device-id'] + test("should transfer the user's playback without using options", (done) => { + fetch.mockResponse(async (req) => { + expect(req.method).toBe("PUT"); + expect(req.url).toBe("https://api.spotify.com/v1/me/player"); + expect(req.headers.get("authorization")).toBe("Bearer myAccessToken"); + expect(req.headers.get("content-type")).toBe("application/json"); + expect(JSON.parse(JSON.parse(req.body))).toEqual({ + device_ids: ["my-device-id"], }); - expect(options.query).toBeFalsy(); - expect(options.headers['Content-Type']).toBe('application/json'); - callback(); + + return { + status: 204, + }; }); - var accessToken = 'myAccessToken'; + var accessToken = "myAccessToken"; var api = new SpotifyWebApi({ - accessToken: accessToken + accessToken: accessToken, }); - api - .transferMyPlayback(['my-device-id']) - .then( - function(data) { - done(); - }, - function(err) { - console.log(err); - done(err); - } - ); + api.transferMyPlayback(["my-device-id"]).then( + function(data) { + done(); + }, + function(err) { + console.log(err); + done(err); + } + ); }); - test("should resume the user's playback", done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.put); - expect(uri).toBe('https://api.spotify.com/v1/me/player/play'); - expect(options.query).toBeFalsy(); - expect(options.headers['Content-Type']).toBe('application/json'); - callback(); + test("should resume the user's playback", (done) => { + fetch.mockResponse(async (req) => { + expect(req.method).toBe("PUT"); + expect(req.url).toBe("https://api.spotify.com/v1/me/player/play"); + expect(req.headers.get("authorization")).toBe("Bearer myAccessToken"); + expect(req.headers.get("content-type")).toBe("application/json"); + + return { + status: 204, + }; }); - var accessToken = 'myAccessToken'; + var accessToken = "myAccessToken"; var api = new SpotifyWebApi({ - accessToken: accessToken + accessToken: accessToken, }); api.play().then( @@ -1913,37 +1932,37 @@ describe('Spotify Web API', () => { ); }); - test("should resume the user's playback with options", done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.put); - expect(uri).toBe('https://api.spotify.com/v1/me/player/play'); - expect(options.query).toEqual({ device_id: 'my_device_id' }); - expect(options.headers['Content-Type']).toBe('application/json'); - expect(JSON.parse(options.data)).toEqual({ - context_uri: 'my_context', + test("should resume the user's playback with options", (done) => { + fetch.mockResponse(async (req) => { + const url = new URL(req.url); + expect(req.method).toBe("PUT"); + expect(url.pathname).toBe("/v1/me/player/play"); + expect(url.searchParams.get("device_id")).toBe("my_device_id"); + expect(req.headers.get("authorization")).toBe("Bearer myAccessToken"); + expect(req.headers.get("content-type")).toBe("application/json"); + expect(JSON.parse(JSON.parse(req.body))).toEqual({ + context_uri: "my_context", offset: { - position: 5 - } + position: 5, + }, }); - callback(); + + return { + status: 204, + }; }); - var accessToken = 'myAccessToken'; + var accessToken = "myAccessToken"; var api = new SpotifyWebApi({ - accessToken: accessToken + accessToken: accessToken, }); api .play({ - device_id: 'my_device_id', - context_uri: 'my_context', - offset: { position: 5 } + device_id: "my_device_id", + context_uri: "my_context", + offset: { position: 5 }, }) .then( function(data) { @@ -1956,23 +1975,22 @@ describe('Spotify Web API', () => { ); }); - test("should pause the user's playback", done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.put); - expect(uri).toBe('https://api.spotify.com/v1/me/player/pause'); - expect(options.query).toBeFalsy(); - callback(); + test("should pause the user's playback", (done) => { + fetch.mockResponse(async (req) => { + expect(req.method).toBe("PUT"); + expect(req.url).toBe("https://api.spotify.com/v1/me/player/pause"); + expect(req.headers.get("authorization")).toBe("Bearer myAccessToken"); + expect(req.headers.get("content-type")).toBe("application/json"); + + return { + status: 204, + }; }); - var accessToken = 'myAccessToken'; + var accessToken = "myAccessToken"; var api = new SpotifyWebApi({ - accessToken: accessToken + accessToken: accessToken, }); api.pause().then( @@ -1986,26 +2004,27 @@ describe('Spotify Web API', () => { ); }); - test("should pause the user's playback with options", done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.put); - expect(uri).toBe('https://api.spotify.com/v1/me/player/pause'); - expect(options.query).toEqual({ device_id: 'my_device_id' }); - callback(); + test("should pause the user's playback with options", (done) => { + fetch.mockResponse(async (req) => { + const url = new URL(req.url); + expect(req.method).toBe("PUT"); + expect(url.pathname).toBe("/v1/me/player/pause"); + expect(url.searchParams.get("device_id")).toBe("my_device_id"); + expect(req.headers.get("authorization")).toBe("Bearer myAccessToken"); + expect(req.headers.get("content-type")).toBe("application/json"); + + return { + status: 204, + }; }); - var accessToken = 'myAccessToken'; + var accessToken = "myAccessToken"; var api = new SpotifyWebApi({ - accessToken: accessToken + accessToken: accessToken, }); - api.pause({ device_id: 'my_device_id' }).then( + api.pause({ device_id: "my_device_id" }).then( function(data) { done(); }, @@ -2016,23 +2035,21 @@ describe('Spotify Web API', () => { ); }); - test("should skip the user's playback to next track", done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.post); - expect(uri).toBe('https://api.spotify.com/v1/me/player/next'); - expect(options.query).toBeFalsy(); - callback(); + test("should skip the user's playback to next track", (done) => { + fetch.mockResponse(async (req) => { + expect(req.method).toBe("POST"); + expect(req.url).toBe("https://api.spotify.com/v1/me/player/next"); + expect(req.headers.get("authorization")).toBe("Bearer myAccessToken"); + + return { + status: 204, + }; }); - var accessToken = 'myAccessToken'; + var accessToken = "myAccessToken"; var api = new SpotifyWebApi({ - accessToken: accessToken + accessToken: accessToken, }); api.skipToNext().then( @@ -2040,29 +2057,26 @@ describe('Spotify Web API', () => { done(); }, function(err) { - console.log(err); done(err); } ); }); - test("should skip the user's playback to previous track", done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.post); - expect(uri).toBe('https://api.spotify.com/v1/me/player/previous'); - expect(options.query).toBeFalsy(); - callback(); + test("should skip the user's playback to previous track", (done) => { + fetch.mockResponse(async (req) => { + expect(req.method).toBe("POST"); + expect(req.url).toBe("https://api.spotify.com/v1/me/player/previous"); + expect(req.headers.get("authorization")).toBe("Bearer myAccessToken"); + + return { + status: 204, + }; }); - var accessToken = 'myAccessToken'; + var accessToken = "myAccessToken"; var api = new SpotifyWebApi({ - accessToken: accessToken + accessToken: accessToken, }); api.skipToPrevious().then( @@ -2076,64 +2090,59 @@ describe('Spotify Web API', () => { ); }); - test("should set the user's playback repeat mode", done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.put); - expect(uri).toBe('https://api.spotify.com/v1/me/player/repeat'); - expect(options.query).toBeTruthy(); - expect(options.query.state).toEqual('off'); - expect(options.query.device_id).toEqual('some-device-id'); - expect(options.body).toBeFalsy(); - callback(); + test("should set the user's playback repeat mode", (done) => { + fetch.mockResponse(async (req) => { + const url = new URL(req.url); + expect(req.method).toBe("PUT"); + expect(url.pathname).toBe("/v1/me/player/repeat"); + expect(url.searchParams.get("state")).toBe("off"); + expect(url.searchParams.get("device_id")).toBe("some-device-id"); + expect(req.headers.get("authorization")).toBe("Bearer myAccessToken"); + expect(req.body).toBeFalsy(); + + return { + status: 204, + }; }); - var accessToken = 'myAccessToken'; + var accessToken = "myAccessToken"; var api = new SpotifyWebApi({ - accessToken: accessToken + accessToken: accessToken, }); - api.setRepeat('off', { device_id: 'some-device-id' }).then( + api.setRepeat("off", { device_id: "some-device-id" }).then( function(data) { done(); }, function(err) { - console.log(err); done(err); } ); }); - test("should set the user's playback repeat mode without given device", done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.put); - expect(uri).toBe('https://api.spotify.com/v1/me/player/repeat'); - expect(options.query).toBeTruthy(); - expect(options.query.state).toEqual('context'); - expect(options.query.device_id).toBeFalsy(); - expect(options.body).toBeFalsy(); - expect(options.headers.Authorization).toBe('Bearer myAccessToken'); - expect(options.headers['Content-Type']).toBeFalsy(); - callback(); - }); - - var accessToken = 'myAccessToken'; + test("should set the user's playback repeat mode without given device", (done) => { + fetch.mockResponse(async (req) => { + const url = new URL(req.url); + expect(req.method).toBe("PUT"); + expect(url.pathname).toBe("/v1/me/player/repeat"); + expect(url.searchParams.get("state")).toBe("context"); + expect(url.searchParams.get("device_id")).toBeFalsy(); + expect(req.headers.get("authorization")).toBe("Bearer myAccessToken"); + expect(req.body).toBeFalsy(); + + return { + status: 204, + }; + }); + + var accessToken = "myAccessToken"; var api = new SpotifyWebApi({ - accessToken: accessToken + accessToken: accessToken, }); - api.setRepeat('context', {}).then( + api.setRepeat("context", {}).then( function(data) { done(); }, @@ -2144,29 +2153,28 @@ describe('Spotify Web API', () => { ); }); - test("should set the user's playback shuffle mode with device", done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.put); - expect(uri).toBe('https://api.spotify.com/v1/me/player/shuffle'); - expect(options.query).toBeTruthy(); - expect(options.query.state).toEqual(true) - expect(options.query.device_id).toEqual('my-device'); - expect(options.body).toBeFalsy(); - callback(); + test("should set the user's playback shuffle mode with device", (done) => { + fetch.mockResponse(async (req) => { + const url = new URL(req.url); + expect(req.method).toBe("PUT"); + expect(url.pathname).toBe("/v1/me/player/shuffle"); + expect(url.searchParams.get("state")).toBe("true"); + expect(url.searchParams.get("device_id")).toBe("my-device"); + expect(req.headers.get("authorization")).toBe("Bearer myAccessToken"); + expect(req.body).toBeFalsy(); + + return { + status: 204, + }; }); - var accessToken = 'myAccessToken'; + var accessToken = "myAccessToken"; var api = new SpotifyWebApi({ - accessToken: accessToken + accessToken: accessToken, }); - api.setShuffle(true, { device_id : 'my-device' }).then( + api.setShuffle(true, { device_id: "my-device" }).then( function(data) { done(); }, @@ -2176,25 +2184,25 @@ describe('Spotify Web API', () => { ); }); - test("should set the user's playback shuffle mode without device id", done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.put); - expect(uri).toBe('https://api.spotify.com/v1/me/player/shuffle'); - expect(options.query).toBeTruthy(); - expect(options.query.state).toEqual(false) - expect(options.body).toBeFalsy(); - callback(); + test("should set the user's playback shuffle mode without device id", (done) => { + fetch.mockResponse(async (req) => { + const url = new URL(req.url); + expect(req.method).toBe("PUT"); + expect(url.pathname).toBe("/v1/me/player/shuffle"); + expect(url.searchParams.get("state")).toBe("false"); + expect(url.searchParams.get("device_id")).toBeFalsy(); + expect(req.headers.get("authorization")).toBe("Bearer myAccessToken"); + expect(req.body).toBeFalsy(); + + return { + status: 204, + }; }); - var accessToken = 'myAccessToken'; + var accessToken = "myAccessToken"; var api = new SpotifyWebApi({ - accessToken: accessToken + accessToken: accessToken, }); api.setShuffle(false).then( @@ -2202,32 +2210,30 @@ describe('Spotify Web API', () => { done(); }, function(err) { - console.log(err); done(err); } ); }); - test("should set the user's playback volume without device id", done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.put); - expect(uri).toBe('https://api.spotify.com/v1/me/player/volume'); - expect(options.query).toEqual({ - volume_percent: 75 - }); - expect(options.body).toBeFalsy(); - callback(); + test("should set the user's playback volume without device id", (done) => { + fetch.mockResponse(async (req) => { + const url = new URL(req.url); + expect(req.method).toBe("PUT"); + expect(url.pathname).toBe("/v1/me/player/volume"); + expect(url.searchParams.get("volume_percent")).toBe("75"); + expect(url.searchParams.get("device_id")).toBeFalsy(); + expect(req.headers.get("authorization")).toBe("Bearer myAccessToken"); + expect(req.body).toBeFalsy(); + + return { + status: 204, + }; }); - var accessToken = 'myAccessToken'; + var accessToken = "myAccessToken"; var api = new SpotifyWebApi({ - accessToken: accessToken + accessToken: accessToken, }); api.setVolume(75).then( @@ -2235,64 +2241,61 @@ describe('Spotify Web API', () => { done(); }, function(err) { - console.log(err); done(err); } ); }); - test("should set the user's playback volume", done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.put); - expect(uri).toBe('https://api.spotify.com/v1/me/player/volume'); - expect(options.query).toEqual({ - volume_percent: 80, - device_id: 'my_device_id' - }); - expect(options.body).toBeFalsy(); - callback(); + test("should set the user's playback volume", (done) => { + fetch.mockResponse(async (req) => { + const url = new URL(req.url); + expect(req.method).toBe("PUT"); + expect(url.pathname).toBe("/v1/me/player/volume"); + expect(url.searchParams.get("volume_percent")).toBe("80"); + expect(url.searchParams.get("device_id")).toBe("my_device_id"); + expect(req.headers.get("authorization")).toBe("Bearer myAccessToken"); + expect(req.body).toBeFalsy(); + + return { + status: 204, + }; }); - var accessToken = 'myAccessToken'; + var accessToken = "myAccessToken"; var api = new SpotifyWebApi({ - accessToken: accessToken + accessToken: accessToken, }); - api.setVolume(80, { device_id: 'my_device_id' }).then( + api.setVolume(80, { device_id: "my_device_id" }).then( function(data) { done(); }, function(err) { - console.log(err); done(err); } ); }); - test('should seek', done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.put); - expect(uri).toBe('https://api.spotify.com/v1/me/player/seek'); - expect(options.query).toEqual({ position_ms: 2000 }); - expect(options.body).toBeFalsy(); - callback(); + test("should seek", (done) => { + fetch.mockResponse(async (req) => { + const url = new URL(req.url); + expect(req.method).toBe("PUT"); + expect(url.pathname).toBe("/v1/me/player/seek"); + expect(url.searchParams.get("position_ms")).toBe("2000"); + expect(url.searchParams.get("device_id")).toBeFalsy(); + expect(req.headers.get("authorization")).toBe("Bearer myAccessToken"); + expect(req.body).toBeFalsy(); + + return { + status: 204, + }; }); - var accessToken = 'myAccessToken'; + var accessToken = "myAccessToken"; var api = new SpotifyWebApi({ - accessToken: accessToken + accessToken: accessToken, }); api.seek(2000).then( @@ -2300,286 +2303,289 @@ describe('Spotify Web API', () => { done(); }, function(err) { - console.log(err); done(err); } ); }); - test('should seek on a certain device', done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.put); - expect(uri).toBe('https://api.spotify.com/v1/me/player/seek'); - expect(options.query).toEqual({ - position_ms: 2000, - device_id: 'my_device_id' - }); - expect(options.body).toBeFalsy(); - callback(); + test("should seek on a certain device", (done) => { + fetch.mockResponse(async (req) => { + const url = new URL(req.url); + expect(req.method).toBe("PUT"); + expect(url.pathname).toBe("/v1/me/player/seek"); + expect(url.searchParams.get("position_ms")).toBe("2000"); + expect(url.searchParams.get("device_id")).toBe("my_device_id"); + expect(req.headers.get("authorization")).toBe("Bearer myAccessToken"); + expect(req.body).toBeFalsy(); + + return { + status: 204, + }; }); - var accessToken = 'myAccessToken'; + var accessToken = "myAccessToken"; var api = new SpotifyWebApi({ - accessToken: accessToken + accessToken: accessToken, }); - api.seek(2000, { device_id: 'my_device_id' }).then( + api.seek(2000, { device_id: "my_device_id" }).then( function(data) { done(); }, function(err) { - console.log(err); done(err); } ); }); - test('should remove tracks in the users library', done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.del); - expect(JSON.parse(options.data)).toEqual({ - ids: ['3VNWq8rTnQG6fM1eldSpZ0'] + test("should remove tracks in the users library", (done) => { + fetch.mockResponse(async (req) => { + expect(req.method).toBe("DELETE"); + expect(req.url).toBe("https://api.spotify.com/v1/me/tracks"); + expect(req.headers.get("authorization")).toBe("Bearer myAccessToken"); + expect(JSON.parse(JSON.parse(req.body))).toEqual({ + ids: ["3VNWq8rTnQG6fM1eldSpZ0"], }); - expect(uri).toBe('https://api.spotify.com/v1/me/tracks'); - expect(options.query).toBeFalsy(); - expect(options.headers['Content-Type']).toBe('application/json'); - callback(); + + return { + status: 204, + }; }); - var accessToken = 'myAccessToken'; + var accessToken = "myAccessToken"; var api = new SpotifyWebApi({ - accessToken: accessToken + accessToken: accessToken, }); - api.removeFromMySavedTracks(['3VNWq8rTnQG6fM1eldSpZ0']).then( + api.removeFromMySavedTracks(["3VNWq8rTnQG6fM1eldSpZ0"]).then( function(data) { done(); }, function(err) { - console.log(err); done(err); } ); }); /* Get My Saved Tracks */ - test('should get tracks in the user\' library', done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.get); - expect(options.data).toBeFalsy(); - expect(uri).toBe('https://api.spotify.com/v1/me/tracks'); - expect(options.query.limit).toBe(1); - expect(options.query.offset).toBe(3); - expect(options.query.market).toBe('SE'); - expect(options.headers['Content-Type']).toBeFalsy(); - expect(options.headers.Authorization).toBe('Bearer myAccessToken'); - callback(); - }); - - var accessToken = 'myAccessToken'; + test("should get tracks in the user' library", (done) => { + fetch.mockResponse(async (req) => { + const url = new URL(req.url); + expect(req.method).toBe("GET"); + expect(url.pathname).toBe("/v1/me/tracks"); + expect(url.searchParams.get("limit")).toBe("1"); + expect(url.searchParams.get("offset")).toBe("3"); + expect(url.searchParams.get("market")).toBe("SE"); + expect(req.headers.get("authorization")).toBe("Bearer myAccessToken"); + + return { + status: 200, + headers: { + "content-type": "application/json", + }, + body: JSON.stringify({ + items: [], + }), + }; + }); + + var accessToken = "myAccessToken"; var api = new SpotifyWebApi({ - accessToken: accessToken + accessToken: accessToken, }); - api.getMySavedTracks({ market : 'SE', limit: 1, offset: 3}).then( + api.getMySavedTracks({ market: "SE", limit: 1, offset: 3 }).then( function(data) { done(); }, function(err) { - console.log(err); done(err); } ); }); - /* Check if Track is in User\'s Saved Tracks */ - test('should check if track is in user\'s library', done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.get); - expect(uri).toBe('https://api.spotify.com/v1/me/tracks/contains'); - expect(options.data).toBeFalsy(); - expect(options.query.ids).toBe('27cZdqrQiKt3IT00338dws,37cZdqrQiKt3IT00338dzs') - expect(options.headers['Content-Type']).toBeFalsy(); - expect(options.headers.Authorization).toBe('Bearer myAccessToken'); - callback(); + /* Check if Track is in User's Saved Tracks */ + test("should check if track is in user's library", (done) => { + fetch.mockResponse(async (req) => { + const url = new URL(req.url); + expect(req.method).toBe("GET"); + expect(url.pathname).toBe("/v1/me/tracks/contains"); + expect(url.searchParams.get("ids")).toBe( + "27cZdqrQiKt3IT00338dws,37cZdqrQiKt3IT00338dzs" + ); + expect(req.headers.get("authorization")).toBe("Bearer myAccessToken"); + + return { + status: 200, + headers: { + "content-type": "application/json", + }, + body: JSON.stringify([false, true]), + }; }); - var accessToken = 'myAccessToken'; + var accessToken = "myAccessToken"; var api = new SpotifyWebApi({ - accessToken: accessToken + accessToken: accessToken, }); - api.containsMySavedTracks(['27cZdqrQiKt3IT00338dws', '37cZdqrQiKt3IT00338dzs']).then( - function(data) { - done(); - }, - function(err) { - console.log(err); - done(err); - } - ); + api + .containsMySavedTracks([ + "27cZdqrQiKt3IT00338dws", + "37cZdqrQiKt3IT00338dzs", + ]) + .then( + function(data) { + done(); + }, + function(err) { + done(err); + } + ); }); - test('should remove albums in the users library', done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.del); - expect(JSON.parse(options.data)).toEqual(['27cZdqrQiKt3IT00338dws']); - expect(uri).toBe('https://api.spotify.com/v1/me/albums'); - expect(options.headers['Content-Type']).toBe('application/json'); - expect(options.query).toBeFalsy(); - callback(); + test("should remove albums in the users library", (done) => { + fetch.mockResponse(async (req) => { + expect(req.method).toBe("DELETE"); + expect(req.url).toBe("https://api.spotify.com/v1/me/albums"); + expect(req.headers.get("authorization")).toBe("Bearer myAccessToken"); + expect(JSON.parse(JSON.parse(req.body))).toEqual([ + "27cZdqrQiKt3IT00338dws", + ]); + + return { + status: 204, + }; }); - var accessToken = 'myAccessToken'; + var accessToken = "myAccessToken"; var api = new SpotifyWebApi({ - accessToken: accessToken + accessToken: accessToken, }); - api.removeFromMySavedAlbums(['27cZdqrQiKt3IT00338dws']).then( + api.removeFromMySavedAlbums(["27cZdqrQiKt3IT00338dws"]).then( function(data) { done(); }, function(err) { - console.log(err); done(err); } ); }); - test('should add albums to the users library', done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.put); - expect(JSON.parse(options.data)).toEqual(['27cZdqrQiKt3IT00338dws']); - expect(uri).toBe('https://api.spotify.com/v1/me/albums'); - expect(options.query).toBeFalsy(); - expect(options.headers.Authorization).toBe('Bearer myAccessToken'); - expect(options.headers['Content-Type']).toBe('application/json'); - callback(); + test("should add albums to the users library", (done) => { + fetch.mockResponse(async (req) => { + expect(req.method).toBe("PUT"); + expect(req.url).toBe("https://api.spotify.com/v1/me/albums"); + expect(req.headers.get("authorization")).toBe("Bearer myAccessToken"); + expect(req.headers.get("content-type")).toBe("application/json"); + expect(JSON.parse(JSON.parse(req.body))).toEqual([ + "4iV5W9uYEdYUVa79Axb7Rh", + "1301WleyT98MSxVHPZCA6M", + ]); + + return { + status: 200, + }; }); - var accessToken = 'myAccessToken'; + var accessToken = "myAccessToken"; var api = new SpotifyWebApi({ - accessToken: accessToken + accessToken: accessToken, }); - api.addToMySavedAlbums(['27cZdqrQiKt3IT00338dws']).then( - function(data) { - done(); - }, - function(err) { - console.log(err); - done(err); - } - ); + api + .addToMySavedAlbums(["4iV5W9uYEdYUVa79Axb7Rh", "1301WleyT98MSxVHPZCA6M"]) + .then( + function(data) { + done(); + }, + function(err) { + done(err); + } + ); }); - test('should get albums in the users library', done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.get); - expect(uri).toBe('https://api.spotify.com/v1/me/albums'); - expect(options.headers.Authorization).toBe('Bearer myAccessToken'); - expect(options.query.limit).toBe(2); - expect(options.query.offset).toBe(1); - callback(null, { - body: { - href: 'https://api.spotify.com/v1/me/albums?offset=1&limit=2', + test("should get albums in the users library", (done) => { + fetch.mockResponse(async (req) => { + const url = new URL(req.url); + expect(req.method).toBe("GET"); + expect(url.pathname).toBe("/v1/me/albums"); + expect(url.searchParams.get("limit")).toBe("2"); + expect(url.searchParams.get("offset")).toBe("1"); + expect(req.headers.get("authorization")).toBe("Bearer myAccessToken"); + + return { + status: 200, + headers: { + "content-type": "application/json", + }, + body: JSON.stringify({ + href: "https://api.spotify.com/v1/me/albums?offset=1&limit=2", items: [ - { added_at: '2014-07-08T18:18:33Z', album: { name: 'Album!' } } - ] - } - }); + { added_at: "2014-07-08T18:18:33Z", album: { name: "Album!" } }, + ], + }), + }; }); - var accessToken = 'myAccessToken'; + var accessToken = "myAccessToken"; var api = new SpotifyWebApi({ - accessToken: accessToken + accessToken: accessToken, }); api .getMySavedAlbums({ limit: 2, - offset: 1 + offset: 1, }) .then( function(data) { expect(data.body.href).toBe( - 'https://api.spotify.com/v1/me/albums?offset=1&limit=2' + "https://api.spotify.com/v1/me/albums?offset=1&limit=2" ); - expect(data.body.items[0]['added_at']).toBe('2014-07-08T18:18:33Z'); + expect(data.body.items[0]["added_at"]).toBe("2014-07-08T18:18:33Z"); done(); }, function(err) { - console.log(err); done(err); } ); }); - test('should determine if an album is in the users library', done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.get); - expect(uri).toBe('https://api.spotify.com/v1/me/albums/contains'); - expect(options.headers.Authorization).toBe('Bearer myAccessToken'); - expect(options.query.ids).toBe('27cZdqrQiKt3IT00338dws'); - callback(null, { body: [true] }); + test("should determine if an album is in the users library", (done) => { + fetch.mockResponse(async (req) => { + const url = new URL(req.url); + expect(req.method).toBe("GET"); + expect(url.pathname).toBe("/v1/me/albums/contains"); + expect(url.searchParams.get("ids")).toBe("27cZdqrQiKt3IT00338dws"); + expect(req.headers.get("authorization")).toBe("Bearer myAccessToken"); + + return { + status: 200, + headers: { + "content-type": "application/json", + }, + body: JSON.stringify([true]), + }; }); - var accessToken = 'myAccessToken'; + var accessToken = "myAccessToken"; var api = new SpotifyWebApi({ - accessToken: accessToken + accessToken: accessToken, }); - api.containsMySavedAlbums(['27cZdqrQiKt3IT00338dws']).then( + api.containsMySavedAlbums(["27cZdqrQiKt3IT00338dws"]).then( function(data) { expect(Object.prototype.toString.call(data.body)).toBe( - '[object Array]' + "[object Array]" ); expect(data.body.length).toBe(1); expect(data.body[0]).toBe(true); @@ -2592,164 +2598,151 @@ describe('Spotify Web API', () => { ); }); - test('should follow a playlist', done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.put); - expect(JSON.parse(options.data)).toEqual({ public: false }); - expect(options.query).toBeFalsy(); - expect(uri).toBe( - 'https://api.spotify.com/v1/playlists/7p9EIC2KW0NNkTEOnTUZJl/followers' + test("should follow a playlist", (done) => { + fetch.mockResponse(async (req) => { + expect(req.method).toBe("PUT"); + expect(req.url).toBe( + "https://api.spotify.com/v1/playlists/7p9EIC2KW0NNkTEOnTUZJl/followers" ); - expect(options.headers['Content-Type']).toBe('application/json'); - callback(); + expect(req.headers.get("authorization")).toBe("Bearer myAccessToken"); + expect(req.headers.get("content-type")).toBe("application/json"); + expect(JSON.parse(JSON.parse(req.body))).toEqual({ + public: false, + }); + + return { + status: 200, + }; }); - var accessToken = 'myAccessToken'; + var accessToken = "myAccessToken"; var api = new SpotifyWebApi({ - accessToken: accessToken + accessToken: accessToken, }); api - .followPlaylist('7p9EIC2KW0NNkTEOnTUZJl', { - public: false + .followPlaylist("7p9EIC2KW0NNkTEOnTUZJl", { + public: false, }) .then( function(data) { done(); }, function(err) { - console.log(err); done(err); } ); }); - test('should unfollow a playlist', done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.del); - expect(options.data).toBeFalsy(); - expect(options.query).toBeFalsy(); - expect(uri).toBe( - 'https://api.spotify.com/v1/playlists/7p9EIC2KW0NNkTEOnTUZJl/followers' + test("should unfollow a playlist", (done) => { + fetch.mockResponse(async (req) => { + expect(req.method).toBe("DELETE"); + expect(req.url).toBe( + "https://api.spotify.com/v1/playlists/7p9EIC2KW0NNkTEOnTUZJl/followers" ); - callback(); + expect(req.headers.get("authorization")).toBe("Bearer myAccessToken"); + expect(req.body).toBeFalsy(); + + return { + status: 200, + }; }); - var accessToken = 'myAccessToken'; + var accessToken = "myAccessToken"; var api = new SpotifyWebApi({ - accessToken: accessToken + accessToken: accessToken, }); - api.unfollowPlaylist('7p9EIC2KW0NNkTEOnTUZJl').then( + api.unfollowPlaylist("7p9EIC2KW0NNkTEOnTUZJl").then( function(data) { done(); }, function(err) { - console.log(err); done(err); } ); }); - test('should follow several users', done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.put); - expect(uri).toBe('https://api.spotify.com/v1/me/following'); - expect(options.query).toEqual({ - type: 'user', - ids: 'thelinmichael,wizzler' - }); - expect(options.data).toBeFalsy(); - callback(); + test("should follow several users", (done) => { + fetch.mockResponse(async (req) => { + const url = new URL(req.url); + expect(req.method).toBe("PUT"); + expect(url.pathname).toBe("/v1/me/following"); + expect(url.searchParams.get("type")).toBe("user"); + expect(url.searchParams.get("ids")).toBe("thelinmichael,wizzler"); + expect(req.headers.get("authorization")).toBe("Bearer myAccessToken"); + + return { + status: 200, + }; }); - var accessToken = 'myAccessToken'; + var accessToken = "myAccessToken"; var api = new SpotifyWebApi({ - accessToken: accessToken + accessToken: accessToken, }); - api.followUsers(['thelinmichael', 'wizzler']).then( + api.followUsers(["thelinmichael", "wizzler"]).then( function(data) { done(); }, function(err) { - console.log(err); done(err); } ); }); - test('should follow several users using callback', done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.put); - expect(uri).toBe('https://api.spotify.com/v1/me/following'); - expect(options.query).toEqual({ - type: 'user', - ids: 'thelinmichael,wizzler' - }); - expect(options.data).toBeFalsy(); - callback(); + test("should follow several users using callback", (done) => { + fetch.mockResponse(async (req) => { + const url = new URL(req.url); + expect(req.method).toBe("PUT"); + expect(url.pathname).toBe("/v1/me/following"); + expect(url.searchParams.get("type")).toBe("user"); + expect(url.searchParams.get("ids")).toBe("thelinmichael,wizzler"); + expect(req.headers.get("authorization")).toBe("Bearer myAccessToken"); + + return { + status: 200, + }; }); - var accessToken = 'myAccessToken'; + var accessToken = "myAccessToken"; var api = new SpotifyWebApi({ - accessToken: accessToken + accessToken: accessToken, }); - api.followUsers(['thelinmichael', 'wizzler'], function(err, data) { + api.followUsers(["thelinmichael", "wizzler"], function(err, data) { expect(err).toBeFalsy(); done(); }); }); - test('should follow several artists', done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.put); - expect(uri).toBe('https://api.spotify.com/v1/me/following'); - expect(options.query).toEqual({ - type: 'artist', - ids: '137W8MRPWKqSmrBGDBFSop' - }); - expect(options.data).toBeFalsy(); - callback(); + test("should follow several artists", (done) => { + fetch.mockResponse(async (req) => { + const url = new URL(req.url); + expect(req.method).toBe("PUT"); + expect(url.pathname).toBe("/v1/me/following"); + expect(url.searchParams.get("type")).toBe("artist"); + expect(url.searchParams.get("ids")).toBe("137W8MRPWKqSmrBGDBFSop"); + expect(req.headers.get("authorization")).toBe("Bearer myAccessToken"); + expect(req.body).toBeFalsy(); + + return { + status: 200, + }; }); - var accessToken = 'myAccessToken'; + var accessToken = "myAccessToken"; var api = new SpotifyWebApi({ - accessToken: accessToken + accessToken: accessToken, }); - api.followArtists(['137W8MRPWKqSmrBGDBFSop']).then( + api.followArtists(["137W8MRPWKqSmrBGDBFSop"]).then( function(data) { done(); }, @@ -2760,183 +2753,167 @@ describe('Spotify Web API', () => { ); }); - test('should follow several artists using callback', done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.put); - expect(uri).toBe('https://api.spotify.com/v1/me/following'); - expect(options.query).toEqual({ - type: 'artist', - ids: '137W8MRPWKqSmrBGDBFSop' - }); - expect(options.data).toBeFalsy(); - callback(); + test("should follow several artists using callback", (done) => { + fetch.mockResponse(async (req) => { + const url = new URL(req.url); + expect(req.method).toBe("PUT"); + expect(url.pathname).toBe("/v1/me/following"); + expect(url.searchParams.get("type")).toBe("artist"); + expect(url.searchParams.get("ids")).toBe("137W8MRPWKqSmrBGDBFSop"); + expect(req.headers.get("authorization")).toBe("Bearer myAccessToken"); + expect(req.body).toBeFalsy(); + + return { + status: 200, + }; }); - var accessToken = 'myAccessToken'; + var accessToken = "myAccessToken"; var api = new SpotifyWebApi({ - accessToken: accessToken + accessToken: accessToken, }); - api.followArtists(['137W8MRPWKqSmrBGDBFSop'], function(err, data) { + api.followArtists(["137W8MRPWKqSmrBGDBFSop"], function(err, data) { done(); }); }); - test('should unfollow several users', done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.del); - expect(uri).toBe('https://api.spotify.com/v1/me/following'); - expect(options.query).toEqual({ - type: 'user', - ids: 'thelinmichael,wizzler' - }); - expect(options.data).toBeFalsy(); - callback(); + test("should unfollow several users", (done) => { + fetch.mockResponse(async (req) => { + const url = new URL(req.url); + expect(req.method).toBe("DELETE"); + expect(url.pathname).toBe("/v1/me/following"); + expect(url.searchParams.get("type")).toBe("user"); + expect(url.searchParams.get("ids")).toBe("thelinmichael,wizzler"); + expect(req.body).toBeFalsy(); + + return { + status: 200, + }; }); - var accessToken = 'myAccessToken'; + var accessToken = "myAccessToken"; var api = new SpotifyWebApi({ - accessToken: accessToken + accessToken: accessToken, }); - api.unfollowUsers(['thelinmichael', 'wizzler']).then( + api.unfollowUsers(["thelinmichael", "wizzler"]).then( function(data) { done(); }, function(err) { - console.log(err); done(err); } ); }); - test('should unfollow several users using callback', done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.del); - expect(uri).toBe('https://api.spotify.com/v1/me/following'); - expect(options.query).toEqual({ - type: 'user', - ids: 'thelinmichael,wizzler' - }); - expect(options.data).toBeFalsy(); - callback(); + test("should unfollow several users using callback", (done) => { + fetch.mockResponse(async (req) => { + const url = new URL(req.url); + expect(req.method).toBe("DELETE"); + expect(url.pathname).toBe("/v1/me/following"); + expect(url.searchParams.get("type")).toBe("user"); + expect(url.searchParams.get("ids")).toBe("thelinmichael,wizzler"); + expect(req.body).toBeFalsy(); + + return { + status: 200, + }; }); - var accessToken = 'myAccessToken'; + var accessToken = "myAccessToken"; var api = new SpotifyWebApi({ - accessToken: accessToken + accessToken: accessToken, }); - api.unfollowUsers(['thelinmichael', 'wizzler'], function(err, data) { - done(); + api.unfollowUsers(["thelinmichael", "wizzler"], function(err, data) { + done(err); }); }); - test('should unfollow several artists', done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.del); - expect(uri).toBe('https://api.spotify.com/v1/me/following'); - expect(options.query).toEqual({ - type: 'artist', - ids: '137W8MRPWKqSmrBGDBFSop' - }); - expect(options.data).toBeFalsy(); - callback(); + test("should unfollow several artists", (done) => { + fetch.mockResponse(async (req) => { + const url = new URL(req.url); + expect(req.method).toBe("DELETE"); + expect(url.pathname).toBe("/v1/me/following"); + expect(url.searchParams.get("type")).toBe("artist"); + expect(url.searchParams.get("ids")).toBe("137W8MRPWKqSmrBGDBFSop"); + expect(req.body).toBeFalsy(); + + return { + status: 200, + }; }); - var accessToken = 'myAccessToken'; + var accessToken = "myAccessToken"; var api = new SpotifyWebApi({ - accessToken: accessToken + accessToken: accessToken, }); - api.unfollowArtists(['137W8MRPWKqSmrBGDBFSop']).then( + api.unfollowArtists(["137W8MRPWKqSmrBGDBFSop"]).then( function(data) { done(); }, function(err) { - console.log(err); done(err); } ); }); - test('should unfollow several artists using callback', done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.del); - expect(uri).toBe('https://api.spotify.com/v1/me/following'); - expect(options.query).toEqual({ - type: 'artist', - ids: '137W8MRPWKqSmrBGDBFSop' - }); - expect(options.data).toBeFalsy(); - callback(null, { statusCode: 200 }); + test("should unfollow several artists using callback", (done) => { + fetch.mockResponse(async (req) => { + const url = new URL(req.url); + expect(req.method).toBe("DELETE"); + expect(url.pathname).toBe("/v1/me/following"); + expect(url.searchParams.get("type")).toBe("artist"); + expect(url.searchParams.get("ids")).toBe("137W8MRPWKqSmrBGDBFSop"); + expect(req.body).toBeFalsy(); + + return { + status: 200, + }; }); - var accessToken = 'myAccessToken'; + var accessToken = "myAccessToken"; var api = new SpotifyWebApi({ - accessToken: accessToken + accessToken: accessToken, }); - api.unfollowArtists(['137W8MRPWKqSmrBGDBFSop'], function(err, data) { + api.unfollowArtists(["137W8MRPWKqSmrBGDBFSop"], function(err, data) { expect(data.statusCode).toBe(200); done(); }); }); - test('should check whether the current user follows several other users', done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.get); - expect(uri).toBe('https://api.spotify.com/v1/me/following/contains'); - expect(options.query).toEqual({ - type: 'user', - ids: 'thelinmichael,wizzler' - }); - expect(options.data).toBeFalsy(); - callback(null, { body: [true, false] }); + test("should check whether the current user follows several other users", (done) => { + fetch.mockResponse(async (req) => { + const url = new URL(req.url); + expect(req.method).toBe("GET"); + expect(url.pathname).toBe("/v1/me/following/contains"); + expect(url.searchParams.get("type")).toBe("user"); + expect(url.searchParams.get("ids")).toBe("thelinmichael,wizzler"); + + return { + status: 200, + headers: { + "content-type": "application/json", + }, + body: JSON.stringify([true, false]), + }; }); - var accessToken = 'myAccessToken'; + var accessToken = "myAccessToken"; var api = new SpotifyWebApi({ - accessToken: accessToken + accessToken: accessToken, }); - api.isFollowingUsers(['thelinmichael', 'wizzler']).then( + api.isFollowingUsers(["thelinmichael", "wizzler"]).then( function(data) { expect(data.body).toEqual([true, false]); done(); @@ -2948,60 +2925,60 @@ describe('Spotify Web API', () => { ); }); - test('should check whether the current user follows several other users using callback', done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.get); - expect(uri).toBe('https://api.spotify.com/v1/me/following/contains'); - expect(options.query).toEqual({ - type: 'user', - ids: 'thelinmichael,wizzler' - }); - expect(options.data).toBeFalsy(); - callback(null, { body: [true, false] }); + test("should check whether the current user follows several other users using callback", (done) => { + fetch.mockResponse(async (req) => { + const url = new URL(req.url); + expect(req.method).toBe("GET"); + expect(url.pathname).toBe("/v1/me/following/contains"); + expect(url.searchParams.get("type")).toBe("user"); + expect(url.searchParams.get("ids")).toBe("thelinmichael,wizzler"); + + return { + status: 200, + headers: { + "content-type": "application/json", + }, + body: JSON.stringify([true, false]), + }; }); - var accessToken = 'myAccessToken'; + var accessToken = "myAccessToken"; var api = new SpotifyWebApi({ - accessToken: accessToken + accessToken: accessToken, }); - api.isFollowingUsers(['thelinmichael', 'wizzler'], function(err, data) { + api.isFollowingUsers(["thelinmichael", "wizzler"], function(err, data) { expect(err).toBeFalsy(); expect(data.body).toEqual([true, false]); done(); }); }); - test('should check whether the current user follows several artists', done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.get); - expect(uri).toBe('https://api.spotify.com/v1/me/following/contains'); - expect(options.query).toEqual({ - type: 'artist', - ids: '137W8MRPWKqSmrBGDBFSop' - }); - expect(options.data).toBeFalsy(); - callback(null, { body: [false] }); + test("should check whether the current user follows several artists", (done) => { + fetch.mockResponse(async (req) => { + const url = new URL(req.url); + expect(req.method).toBe("GET"); + expect(url.pathname).toBe("/v1/me/following/contains"); + expect(url.searchParams.get("type")).toBe("artist"); + expect(url.searchParams.get("ids")).toBe("137W8MRPWKqSmrBGDBFSop"); + + return { + status: 200, + headers: { + "content-type": "application/json", + }, + body: JSON.stringify([false]), + }; }); - var accessToken = 'myAccessToken'; + var accessToken = "myAccessToken"; var api = new SpotifyWebApi({ - accessToken: accessToken + accessToken: accessToken, }); - api.isFollowingArtists(['137W8MRPWKqSmrBGDBFSop']).then( + api.isFollowingArtists(["137W8MRPWKqSmrBGDBFSop"]).then( function(data) { expect(data.body).toEqual([false]); done(); @@ -3013,61 +2990,59 @@ describe('Spotify Web API', () => { ); }); - test('should check whether the current user follows several artists using callback', done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.get); - expect(uri).toBe('https://api.spotify.com/v1/me/following/contains'); - expect(options.query).toEqual({ - type: 'artist', - ids: '137W8MRPWKqSmrBGDBFSop' - }); - expect(options.data).toBeFalsy(); - callback(null, { body: [false] }); + test("should check whether the current user follows several artists using callback", (done) => { + fetch.mockResponse(async (req) => { + const url = new URL(req.url); + expect(req.method).toBe("GET"); + expect(url.pathname).toBe("/v1/me/following/contains"); + expect(url.searchParams.get("type")).toBe("artist"); + expect(url.searchParams.get("ids")).toBe("137W8MRPWKqSmrBGDBFSop"); + + return { + status: 200, + headers: { + "content-type": "application/json", + }, + body: JSON.stringify([false]), + }; }); - var accessToken = 'myAccessToken'; + var accessToken = "myAccessToken"; var api = new SpotifyWebApi({ - accessToken: accessToken + accessToken: accessToken, }); - api.isFollowingArtists(['137W8MRPWKqSmrBGDBFSop'], function(err, data) { + api.isFollowingArtists(["137W8MRPWKqSmrBGDBFSop"], function(err, data) { expect(err).toBeFalsy(); expect(data.body).toEqual([false]); done(); }); }); - test("should get a user's followed artists using callback", done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.get); - expect(uri).toBe('https://api.spotify.com/v1/me/following'); - expect(options.query).toEqual({ - type: 'artist', - after: '6tbXwhqy3WAFqanusCLvEU', - limit: 3 - }); - expect(options.data).toBeFalsy(); - callback(null, { body: { artists: { items: [] } } }); + test("should get a user's followed artists", (done) => { + fetch.mockResponse(async (req) => { + const url = new URL(req.url); + expect(req.method).toBe("GET"); + expect(url.pathname).toBe("/v1/me/following"); + expect(url.searchParams.get("type")).toBe("artist"); + expect(url.searchParams.get("after")).toBe("6tbXwhqy3WAFqanusCLvEU"); + expect(url.searchParams.get("limit")).toBe("3"); + + return { + status: 200, + headers: { "Content-Type": "application/json" }, + body: JSON.stringify({ artists: { items: [] } }), + }; }); - var accessToken = 'myAccessToken'; + var accessToken = "myAccessToken"; var api = new SpotifyWebApi({ - accessToken: accessToken + accessToken: accessToken, }); - api.getFollowedArtists({ after: '6tbXwhqy3WAFqanusCLvEU', limit: 3 }).then( + api.getFollowedArtists({ after: "6tbXwhqy3WAFqanusCLvEU", limit: 3 }).then( function(data) { expect(data.body.artists).toBeTruthy(); done(); @@ -3078,32 +3053,30 @@ describe('Spotify Web API', () => { ); }); - test("should get a user's followed artists using callback", done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.get); - expect(uri).toBe('https://api.spotify.com/v1/me/following'); - expect(options.query).toEqual({ - type: 'artist', - after: '6tbXwhqy3WAFqanusCLvEU', - limit: 3 - }); - expect(options.data).toBeFalsy(); - callback(null, { body: { artists: { items: [] } } }); + test("should get a user's followed artists using callback", (done) => { + fetch.mockResponse(async (req) => { + const url = new URL(req.url); + expect(req.method).toBe("GET"); + expect(url.pathname).toBe("/v1/me/following"); + expect(url.searchParams.get("type")).toBe("artist"); + expect(url.searchParams.get("after")).toBe("6tbXwhqy3WAFqanusCLvEU"); + expect(url.searchParams.get("limit")).toBe("3"); + + return { + status: 200, + headers: { "Content-Type": "application/json" }, + body: JSON.stringify({ artists: { items: [] } }), + }; }); - var accessToken = 'myAccessToken'; + var accessToken = "myAccessToken"; var api = new SpotifyWebApi({ - accessToken: accessToken + accessToken: accessToken, }); api.getFollowedArtists( - { after: '6tbXwhqy3WAFqanusCLvEU', limit: 3 }, + { after: "6tbXwhqy3WAFqanusCLvEU", limit: 3 }, function(err, data) { expect(err).toBeFalsy(); expect(data.body.artists).toBeTruthy(); @@ -3112,34 +3085,34 @@ describe('Spotify Web API', () => { ); }); - test('should check whether users follows a playlist', done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.get); - expect(uri).toBe( - 'https://api.spotify.com/v1/users/spotify_germany/playlists/2nKFnGNFvHX9hG5Kv7Bm3G/followers/contains' + test("should check whether users follows a playlist", (done) => { + fetch.mockResponse(async (req) => { + const url = new URL(req.url); + expect(req.method).toBe("GET"); + expect(url.pathname).toBe( + "/v1/users/spotify_germany/playlists/2nKFnGNFvHX9hG5Kv7Bm3G/followers/contains" ); - expect(options.query).toEqual({ - ids: 'thelinmichael,ella' - }); - expect(options.data).toBeFalsy(); - callback(null, { body: [true, false] }); + expect(url.searchParams.get("ids")).toBe("thelinmichael,ella"); + + return { + status: 200, + headers: { + "content-type": "application/json", + }, + body: JSON.stringify([true, false]), + }; }); - var accessToken = 'myAccessToken'; + var accessToken = "myAccessToken"; var api = new SpotifyWebApi({ - accessToken: accessToken + accessToken: accessToken, }); api - .areFollowingPlaylist('spotify_germany', '2nKFnGNFvHX9hG5Kv7Bm3G', [ - 'thelinmichael', - 'ella' + .areFollowingPlaylist("spotify_germany", "2nKFnGNFvHX9hG5Kv7Bm3G", [ + "thelinmichael", + "ella", ]) .then( function(data) { @@ -3153,32 +3126,40 @@ describe('Spotify Web API', () => { ); }); - test('should add tracks to playlist', done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.post); - expect(uri).toBe( - 'https://api.spotify.com/v1/playlists/5ieJqeLJjjI8iJWaxeBLuK/tracks' + test("should add tracks to playlist", (done) => { + fetch.mockResponse(async (req) => { + expect(req.method).toBe("POST"); + expect(req.url).toBe( + "https://api.spotify.com/v1/playlists/5ieJqeLJjjI8iJWaxeBLuK/tracks" ); - expect(options.query).toBeFalsy(); - expect(JSON.parse(options.data)['uris']).toBeInstanceOf(Array); - expect(JSON.parse(options.data)['uris']).toHaveLength(2); - expect(options.headers.Authorization).toBe('Bearer long-access-token'); - expect(options.headers['Content-Type']).toBe('application/json'); - callback(); + expect(req.headers.get("Authorization")).toBe("Bearer long-access-token"); + expect(req.headers.get("Content-Type")).toBe("application/json"); + const body = JSON.parse(JSON.parse(req.body)); + expect(body).toEqual({ + uris: [ + "spotify:track:4iV5W9uYEdYUVa79Axb7Rh", + "spotify:track:1301WleyT98MSxVHPZCA6M", + ], + }); + + return { + status: 200, + headers: { + "content-type": "application/json", + }, + body: JSON.stringify({ + snapshot_id: "abc", + }), + }; }); var api = new SpotifyWebApi(); - api.setAccessToken('long-access-token'); + api.setAccessToken("long-access-token"); api - .addTracksToPlaylist('5ieJqeLJjjI8iJWaxeBLuK', [ - 'spotify:track:4iV5W9uYEdYUVa79Axb7Rh', - 'spotify:track:1301WleyT98MSxVHPZCA6M' + .addTracksToPlaylist("5ieJqeLJjjI8iJWaxeBLuK", [ + "spotify:track:4iV5W9uYEdYUVa79Axb7Rh", + "spotify:track:1301WleyT98MSxVHPZCA6M", ]) .then( function(data) { @@ -3191,33 +3172,41 @@ describe('Spotify Web API', () => { ); }); - test('should add tracks to playlist using callback', done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.post); - expect(uri).toBe( - 'https://api.spotify.com/v1/playlists/5ieJqeLJjjI8iJWaxeBLuK/tracks' + test("should add tracks to playlist using callback", (done) => { + fetch.mockResponse(async (req) => { + expect(req.method).toBe("POST"); + expect(req.url).toBe( + "https://api.spotify.com/v1/playlists/5ieJqeLJjjI8iJWaxeBLuK/tracks" ); - expect(options.query).toBeFalsy(); - expect(JSON.parse(options.data)['uris']).toBeInstanceOf(Array); - expect(JSON.parse(options.data)['uris']).toHaveLength(2); - expect(options.headers.Authorization).toBe('Bearer long-access-token'); - expect(options.headers['Content-Type']).toBe('application/json'); - callback(); + expect(req.headers.get("Authorization")).toBe("Bearer long-access-token"); + expect(req.headers.get("Content-Type")).toBe("application/json"); + const body = JSON.parse(JSON.parse(req.body)); + expect(body).toEqual({ + uris: [ + "spotify:track:4iV5W9uYEdYUVa79Axb7Rh", + "spotify:track:1301WleyT98MSxVHPZCA6M", + ], + }); + + return { + status: 200, + headers: { + "content-type": "application/json", + }, + body: JSON.stringify({ + snapshot_id: "abc", + }), + }; }); var api = new SpotifyWebApi(); - api.setAccessToken('long-access-token'); + api.setAccessToken("long-access-token"); api.addTracksToPlaylist( - '5ieJqeLJjjI8iJWaxeBLuK', + "5ieJqeLJjjI8iJWaxeBLuK", [ - 'spotify:track:4iV5W9uYEdYUVa79Axb7Rh', - 'spotify:track:1301WleyT98MSxVHPZCA6M' + "spotify:track:4iV5W9uYEdYUVa79Axb7Rh", + "spotify:track:1301WleyT98MSxVHPZCA6M", ], null, function(err, data) { @@ -3226,35 +3215,40 @@ describe('Spotify Web API', () => { ); }); - test('should remove tracks from a playlist by position', done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(uri).toBe( - 'https://api.spotify.com/v1/playlists/5ieJqeLJjjI8iJWaxeBLuK/tracks' + test("should remove tracks from a playlist by position", (done) => { + fetch.mockResponse(async (req) => { + expect(req.method).toBe("DELETE"); + expect(req.url).toBe( + "https://api.spotify.com/v1/playlists/5ieJqeLJjjI8iJWaxeBLuK/tracks" ); - expect(method).toBe(superagent.del); - expect(options.query).toBeFalsy(); - var body = JSON.parse(options.data); - expect(body.positions[0]).toBe(0); - expect(body['snapshot_id']).toBe( - '0wD+DKCUxiSR/WY8lF3fiCTb7Z8X4ifTUtqn8rO82O4Mvi5wsX8BsLj7IbIpLVM9' - ); - expect(options.headers['Content-Type']).toBe('application/json'); - expect(options.headers['Authorization']).toBe('Bearer long-access-token'); - callback(); + expect(req.headers.get("Authorization")).toBe("Bearer long-access-token"); + expect(req.headers.get("Content-Type")).toBe("application/json"); + const body = JSON.parse(JSON.parse(req.body)); + + expect(body).toEqual({ + positions: [0, 2], + snapshot_id: + "0wD+DKCUxiSR/WY8lF3fiCTb7Z8X4ifTUtqn8rO82O4Mvi5wsX8BsLj7IbIpLVM9", + }); + + return { + status: 200, + headers: { + "content-type": "application/json", + }, + body: JSON.stringify({ + snapshot_id: "abc", + }), + }; }); var api = new SpotifyWebApi(); - api.setAccessToken('long-access-token'); + api.setAccessToken("long-access-token"); api.removeTracksFromPlaylistByPosition( - '5ieJqeLJjjI8iJWaxeBLuK', + "5ieJqeLJjjI8iJWaxeBLuK", [0, 2], - '0wD+DKCUxiSR/WY8lF3fiCTb7Z8X4ifTUtqn8rO82O4Mvi5wsX8BsLj7IbIpLVM9', + "0wD+DKCUxiSR/WY8lF3fiCTb7Z8X4ifTUtqn8rO82O4Mvi5wsX8BsLj7IbIpLVM9", function(err, data) { if (err) { done(err); @@ -3264,112 +3258,137 @@ describe('Spotify Web API', () => { } ); }); - - test('should remove tracks from a playlist by uri', done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(uri).toBe( - 'https://api.spotify.com/v1/playlists/5ieJqeLJjjI8iJWaxeBLuK/tracks' - ); - expect(method).toBe(superagent.del); - expect(options.query).toBeFalsy(); - var body = JSON.parse(options.data); - expect(body.tracks[0]).toStrictEqual({ uri : 'spotify:track:491rM2JN8KvmV6p0oDDuJT', positions : [3]}); - expect(body['snapshot_id']).toBe( - '0wD+DKCUxiSR/WY8lF3fiCTb7Z8X4ifTUtqn8rO82O4Mvi5wsX8BsLj7IbIpLVM9' + test("should remove tracks from a playlist by uri", (done) => { + fetch.mockResponse(async (req) => { + expect(req.method).toBe("DELETE"); + expect(req.url).toBe( + "https://api.spotify.com/v1/playlists/5ieJqeLJjjI8iJWaxeBLuK/tracks" ); - expect(options.headers['Content-Type']).toBe('application/json'); - expect(options.headers['Authorization']).toBe('Bearer long-access-token'); - - callback(); + expect(req.headers.get("Authorization")).toBe("Bearer long-access-token"); + expect(req.headers.get("Content-Type")).toBe("application/json"); + const body = JSON.parse(JSON.parse(req.body)); + + expect(body).toEqual({ + tracks: [ + { + uri: "spotify:track:491rM2JN8KvmV6p0oDDuJT", + positions: [3], + }, + ], + snapshot_id: + "0wD+DKCUxiSR/WY8lF3fiCTb7Z8X4ifTUtqn8rO82O4Mvi5wsX8BsLj7IbIpLVM9", + }); + + return { + status: 200, + headers: { + "content-type": "application/json", + }, + body: JSON.stringify({ + snapshot_id: "abc", + }), + }; }); var api = new SpotifyWebApi(); - api.setAccessToken('long-access-token'); + api.setAccessToken("long-access-token"); api.removeTracksFromPlaylist( - '5ieJqeLJjjI8iJWaxeBLuK', - [ { uri: 'spotify:track:491rM2JN8KvmV6p0oDDuJT', positions: [3] }], - { 'snapshot_id' : '0wD+DKCUxiSR/WY8lF3fiCTb7Z8X4ifTUtqn8rO82O4Mvi5wsX8BsLj7IbIpLVM9' }, + "5ieJqeLJjjI8iJWaxeBLuK", + [{ uri: "spotify:track:491rM2JN8KvmV6p0oDDuJT", positions: [3] }], + { + snapshot_id: + "0wD+DKCUxiSR/WY8lF3fiCTb7Z8X4ifTUtqn8rO82O4Mvi5wsX8BsLj7IbIpLVM9", + }, function(err, data) { done(err); } ); }); - test('should replace tracks from a playlist', done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(uri).toBe( - 'https://api.spotify.com/v1/playlists/5ieJqeLJjjI8iJWaxeBLuK/tracks' + test("should replace tracks from a playlist", (done) => { + fetch.mockResponse(async (req) => { + expect(req.method).toBe("PUT"); + expect(req.url).toBe( + "https://api.spotify.com/v1/playlists/5ieJqeLJjjI8iJWaxeBLuK/tracks" ); - expect(method).toBe(superagent.put); - expect(options.query).toBeFalsy(); + expect(req.headers.get("Content-Type")).toBe("application/json"); + expect(req.headers.get("Authorization")).toBe("Bearer long-access-token"); + const body = JSON.parse(JSON.parse(req.body)); + + expect(body).toEqual({ + uris: [ + "spotify:track:491rM2JN8KvmV6p0oDDuJT", + "spotify:track:5erahPIwlq1PvuYRGtVIuG", + ], + }); - var body = JSON.parse(options.data); - expect(body.uris[0]).toStrictEqual('spotify:track:491rM2JN8KvmV6p0oDDuJT'); - expect(body.uris[1]).toStrictEqual('spotify:track:5erahPIwlq1PvuYRGtVIuG'); - expect(options.headers['Content-Type']).toBe('application/json'); - expect(options.headers['Authorization']).toBe('Bearer long-access-token'); - - callback(); + return { + status: 200, + headers: { + "content-type": "application/json", + }, + body: JSON.stringify({ + snapshot_id: "abc", + }), + }; }); var api = new SpotifyWebApi(); - api.setAccessToken('long-access-token'); + api.setAccessToken("long-access-token"); api.replaceTracksInPlaylist( - '5ieJqeLJjjI8iJWaxeBLuK', - ['spotify:track:491rM2JN8KvmV6p0oDDuJT', 'spotify:track:5erahPIwlq1PvuYRGtVIuG'], + "5ieJqeLJjjI8iJWaxeBLuK", + [ + "spotify:track:491rM2JN8KvmV6p0oDDuJT", + "spotify:track:5erahPIwlq1PvuYRGtVIuG", + ], function(err, data) { done(err); } ); }); - test('should reorder tracks from a playlist by position', done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.put); - expect(uri).toBe( - 'https://api.spotify.com/v1/playlists/5ieJqeLJjjI8iJWaxeBLuK/tracks' + test("should reorder tracks from a playlist by position", (done) => { + fetch.mockResponse(async (req) => { + expect(req.method).toBe("PUT"); + expect(req.url).toBe( + "https://api.spotify.com/v1/playlists/5ieJqeLJjjI8iJWaxeBLuK/tracks" ); - expect(options.query).toBeFalsy(); - expect(JSON.parse(options.data)['range_start']).toBe(5); - expect(JSON.parse(options.data)['range_length']).toBe(1); - expect(JSON.parse(options.data)['insert_before']).toBe(1512); - expect(JSON.parse(options.data)['snapshot_id']).toBe( - '0wD+DKCUxiSR/WY8lF3fiCTb7Z8X4ifTUtqn8rO82O4Mvi5wsX8BsLj7IbIpLVM9' - ); - expect(options.headers.Authorization).toBe('Bearer long-access-token'); - expect(options.headers['Content-Type']).toBe('application/json'); - callback(); + expect(req.headers.get("authorization")).toBe("Bearer long-access-token"); + expect(req.headers.get("content-type")).toBe("application/json"); + const body = JSON.parse(JSON.parse(req.body)); + expect(body).toEqual({ + range_start: 5, + range_length: 1, + insert_before: 1512, + snapshot_id: + "0wD+DKCUxiSR/WY8lF3fiCTb7Z8X4ifTUtqn8rO82O4Mvi5wsX8BsLj7IbIpLVM9", + }); + + return { + status: 200, + headers: { + "content-type": "application/json", + }, + body: JSON.stringify({ + snapshot_id: "abc", + }), + }; }); var api = new SpotifyWebApi(); - api.setAccessToken('long-access-token'); + api.setAccessToken("long-access-token"); var options = { snapshot_id: - '0wD+DKCUxiSR/WY8lF3fiCTb7Z8X4ifTUtqn8rO82O4Mvi5wsX8BsLj7IbIpLVM9', - range_length: 1 + "0wD+DKCUxiSR/WY8lF3fiCTb7Z8X4ifTUtqn8rO82O4Mvi5wsX8BsLj7IbIpLVM9", + range_length: 1, }; api.reorderTracksInPlaylist( - '5ieJqeLJjjI8iJWaxeBLuK', + "5ieJqeLJjjI8iJWaxeBLuK", 5, 1512, options, @@ -3383,31 +3402,28 @@ describe('Spotify Web API', () => { ); }); - test('should add tracks to the users library', done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.put); - expect(JSON.parse(options.data)).toEqual({ - ids: ['3VNWq8rTnQG6fM1eldSpZ0'] + test("should add tracks to the users library", (done) => { + fetch.mockResponse(async (req) => { + expect(req.method).toBe("PUT"); + expect(req.url).toBe("https://api.spotify.com/v1/me/tracks"); + expect(req.headers.get("authorization")).toBe("Bearer myAccessToken"); + expect(req.headers.get("content-type")).toBe("application/json"); + expect(JSON.parse(JSON.parse(req.body))).toEqual({ + ids: ["3VNWq8rTnQG6fM1eldSpZ0"], }); - expect(uri).toBe('https://api.spotify.com/v1/me/tracks'); - expect(options.query).toBeFalsy(); - expect(options.headers.Authorization).toBe('Bearer myAccessToken'); - expect(options.headers['Content-Type']).toBe('application/json'); - callback(); + + return { + status: 200, + }; }); - var accessToken = 'myAccessToken'; + var accessToken = "myAccessToken"; var api = new SpotifyWebApi({ - accessToken: accessToken + accessToken: accessToken, }); - api.addToMySavedTracks(['3VNWq8rTnQG6fM1eldSpZ0']).then( + api.addToMySavedTracks(["3VNWq8rTnQG6fM1eldSpZ0"]).then( function(data) { done(); }, @@ -3418,130 +3434,73 @@ describe('Spotify Web API', () => { ); }); - test('should add tracks to the users library using callback', done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.put); - expect(JSON.parse(options.data)).toEqual({ - ids: ['3VNWq8rTnQG6fM1eldSpZ0'] + test("should add tracks to the users library using callback", (done) => { + fetch.mockResponse(async (req) => { + expect(req.method).toBe("PUT"); + expect(req.url).toBe("https://api.spotify.com/v1/me/tracks"); + expect(req.headers.get("authorization")).toBe("Bearer myAccessToken"); + expect(req.headers.get("content-type")).toBe("application/json"); + expect(JSON.parse(req.body)).toEqual({ + ids: ["3VNWq8rTnQG6fM1eldSpZ0"], }); - expect(uri).toBe('https://api.spotify.com/v1/me/tracks'); - expect(options.query).toBeFalsy(); - expect(options.headers.Authorization).toBe('Bearer myAccessToken'); - expect(options.headers['Content-Type']).toBe('application/json'); - callback(); + + return { + status: 200, + }; }); - var accessToken = 'myAccessToken'; + var accessToken = "myAccessToken"; var api = new SpotifyWebApi({ - accessToken: accessToken + accessToken: accessToken, }); - api.addToMySavedTracks(['3VNWq8rTnQG6fM1eldSpZ0'], function(err, data) { + api.addToMySavedTracks(["3VNWq8rTnQG6fM1eldSpZ0"], function(err, data) { done(); }); }); - test('should get new releases', done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.get); - expect(uri).toBe('https://api.spotify.com/v1/browse/new-releases'); - expect(options.query).toEqual({ - limit: 5, - offset: 0, - country: 'SE' - }); - expect(options.headers.Authorization).toBe('Bearer myAccessToken'); - callback(null, { - body: { - albums: { - href: - 'https://api.spotify.com/v1/browse/new-releases?country=SE&offset=0&limit=5', - items: [{}, {}, {}, {}, {}] - } - } - }); - }); - - var accessToken = 'myAccessToken'; - - var api = new SpotifyWebApi({ - accessToken: accessToken - }); + test("should get new releases", (done) => { + fetch.mockResponse(async (req) => { + const url = new URL(req.url); + expect(req.method).toBe("GET"); + expect(url.pathname).toBe("/v1/browse/new-releases"); + expect(url.searchParams.get("limit")).toBe("5"); + expect(url.searchParams.get("offset")).toBe("0"); + expect(url.searchParams.get("country")).toBe("SE"); + expect(req.headers.get("authorization")).toBe("Bearer myAccessToken"); - api - .getNewReleases({ - limit: 5, - offset: 0, - country: 'SE' - }) - .then( - function(data) { - expect(data.body.albums.href).toBe( - 'https://api.spotify.com/v1/browse/new-releases?country=SE&offset=0&limit=5' - ); - expect(data.body.albums.items.length).toBe(5); - done(); + return { + status: 200, + headers: { + "content-type": "application/json", }, - function(err) { - done(err); - } - ); - }); - - test('should get new releases', done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.get); - expect(uri).toBe('https://api.spotify.com/v1/browse/new-releases'); - expect(options.query).toEqual({ - limit: 5, - offset: 0, - country: 'SE' - }); - expect(options.headers.Authorization).toBe('Bearer myAccessToken'); - callback(null, { - body: { + body: JSON.stringify({ albums: { href: - 'https://api.spotify.com/v1/browse/new-releases?country=SE&offset=0&limit=5', - items: [{}, {}, {}, {}, {}] - } - }, - statusCode: 200 - }); + "https://api.spotify.com/v1/browse/new-releases?country=SE&offset=0&limit=5", + items: [{}, {}, {}, {}, {}], + }, + }), + }; }); - var accessToken = 'myAccessToken'; + var accessToken = "myAccessToken"; var api = new SpotifyWebApi({ - accessToken: accessToken + accessToken: accessToken, }); api.getNewReleases( { limit: 5, offset: 0, - country: 'SE' + country: "SE", }, function(err, data) { expect(err).toBeFalsy(); expect(data.body.albums.href).toBe( - 'https://api.spotify.com/v1/browse/new-releases?country=SE&offset=0&limit=5' + "https://api.spotify.com/v1/browse/new-releases?country=SE&offset=0&limit=5" ); expect(data.body.albums.items.length).toBe(5); expect(data.statusCode).toBe(200); @@ -3550,53 +3509,51 @@ describe('Spotify Web API', () => { ); }); - test('should get featured playlists', done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.get); - expect(uri).toBe('https://api.spotify.com/v1/browse/featured-playlists'); - expect(options.query).toEqual({ - limit: 3, - offset: 1, - country: 'SE', - locale: 'sv_SE', - timestamp: '2014-10-23T09:00:00' - }); - expect(options.headers.Authorization).toBe('Bearer myAccessToken'); - callback(null, { - body: { + test("should get featured playlists", (done) => { + fetch.mockResponse(async (req) => { + const url = new URL(req.url); + expect(req.method).toBe("GET"); + expect(url.pathname).toBe("/v1/browse/featured-playlists"); + expect(url.searchParams.get("country")).toBe("SE"); + expect(url.searchParams.get("locale")).toBe("sv_SE"); + expect(url.searchParams.get("timestamp")).toBe("2014-10-23T09:00:00"); + expect(url.searchParams.get("offset")).toBe("1"); + expect(url.searchParams.get("limit")).toBe("3"); + expect(req.headers.get("authorization")).toBe("Bearer myAccessToken"); + + return { + status: 200, + headers: { + "content-type": "application/json", + }, + body: JSON.stringify({ playlists: { href: - 'https://api.spotify.com/v1/browse/featured-playlists?country=SE&locale=sv_SE×tamp=2014-10-23T09:00:00&offset=1&limit=3', - items: [{}, {}, {}] - } - }, - statusCode: 200 - }); + "https://api.spotify.com/v1/browse/featured-playlists?country=SE&locale=sv_SE×tamp=2014-10-23T09:00:00&offset=1&limit=3", + items: [{}, {}, {}], + }, + }), + }; }); - var accessToken = 'myAccessToken'; + var accessToken = "myAccessToken"; var api = new SpotifyWebApi({ - accessToken: accessToken + accessToken: accessToken, }); api .getFeaturedPlaylists({ limit: 3, offset: 1, - country: 'SE', - locale: 'sv_SE', - timestamp: '2014-10-23T09:00:00' + country: "SE", + locale: "sv_SE", + timestamp: "2014-10-23T09:00:00", }) .then( function(data) { expect(data.body.playlists.href).toBe( - 'https://api.spotify.com/v1/browse/featured-playlists?country=SE&locale=sv_SE×tamp=2014-10-23T09:00:00&offset=1&limit=3' + "https://api.spotify.com/v1/browse/featured-playlists?country=SE&locale=sv_SE×tamp=2014-10-23T09:00:00&offset=1&limit=3" ); expect(data.body.playlists.items.length).toBe(3); expect(data.statusCode).toBe(200); @@ -3609,53 +3566,50 @@ describe('Spotify Web API', () => { ); }); - test('should get featured playlists using callback', done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.get); - expect(uri).toBe('https://api.spotify.com/v1/browse/featured-playlists'); - expect(options.query).toEqual({ - limit: 3, - offset: 1, - country: 'SE', - locale: 'sv_SE', - timestamp: '2014-10-23T09:00:00' - }); - expect(options.headers.Authorization).toBe('Bearer myAccessToken'); - callback(null, { - body: { + test("should get featured playlists using callback", (done) => { + fetch.mockResponse(async (req) => { + const url = new URL(req.url); + expect(req.method).toBe("GET"); + expect(url.pathname).toBe("/v1/browse/featured-playlists"); + expect(url.searchParams.get("limit")).toBe("3"); + expect(url.searchParams.get("offset")).toBe("1"); + expect(url.searchParams.get("country")).toBe("SE"); + expect(url.searchParams.get("locale")).toBe("sv_SE"); + expect(url.searchParams.get("timestamp")).toBe("2014-10-23T09:00:00"); + + return { + status: 200, + headers: { + "content-type": "application/json", + }, + body: JSON.stringify({ playlists: { href: - 'https://api.spotify.com/v1/browse/featured-playlists?country=SE&locale=sv_SE×tamp=2014-10-23T09:00:00&offset=1&limit=3', - items: [{}, {}, {}] - } - }, - statusCode: 200 - }); + "https://api.spotify.com/v1/browse/featured-playlists?country=SE&locale=sv_SE×tamp=2014-10-23T09:00:00&offset=1&limit=3", + items: [{}, {}, {}], + }, + }), + }; }); - var accessToken = 'myAccessToken'; + var accessToken = "myAccessToken"; var api = new SpotifyWebApi({ - accessToken: accessToken + accessToken: accessToken, }); api.getFeaturedPlaylists( { limit: 3, offset: 1, - country: 'SE', - locale: 'sv_SE', - timestamp: '2014-10-23T09:00:00' + country: "SE", + locale: "sv_SE", + timestamp: "2014-10-23T09:00:00", }, function(err, data) { expect(err).toBeFalsy(); expect(data.body.playlists.href).toBe( - 'https://api.spotify.com/v1/browse/featured-playlists?country=SE&locale=sv_SE×tamp=2014-10-23T09:00:00&offset=1&limit=3' + "https://api.spotify.com/v1/browse/featured-playlists?country=SE&locale=sv_SE×tamp=2014-10-23T09:00:00&offset=1&limit=3" ); expect(data.body.playlists.items.length).toBe(3); expect(data.statusCode).toBe(200); @@ -3664,53 +3618,51 @@ describe('Spotify Web API', () => { ); }); - test('should get browse categories', done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.get); - expect(uri).toBe('https://api.spotify.com/v1/browse/categories'); - expect(options.query).toEqual({ - limit: 2, - offset: 4, - country: 'SE', - locale: 'sv_SE' - }); - expect(options.headers.Authorization).toBe('Bearer myAccessToken'); - callback(null, { - body: { - items: [ - { href: 'https://api.spotify.com/v1/browse/categories/party' }, - { href: 'https://api.spotify.com/v1/browse/categories/pop' } - ] + test("should get browse categories", (done) => { + fetch.mockResponse(async (req) => { + const url = new URL(req.url); + expect(req.method).toBe("GET"); + expect(url.pathname).toBe("/v1/browse/categories"); + expect(url.searchParams.get("limit")).toBe("2"); + expect(url.searchParams.get("offset")).toBe("4"); + expect(url.searchParams.get("country")).toBe("SE"); + expect(url.searchParams.get("locale")).toBe("sv_SE"); + expect(req.headers.get("authorization")).toBe("Bearer myAccessToken"); + + return { + status: 200, + headers: { + "content-type": "application/json", }, - statusCode: 200 - }); + body: JSON.stringify({ + items: [ + { href: "https://api.spotify.com/v1/browse/categories/party" }, + { href: "https://api.spotify.com/v1/browse/categories/pop" }, + ], + }), + }; }); - var accessToken = 'myAccessToken'; + var accessToken = "myAccessToken"; var api = new SpotifyWebApi({ - accessToken: accessToken + accessToken: accessToken, }); api.getCategories( { limit: 2, offset: 4, - country: 'SE', - locale: 'sv_SE' + country: "SE", + locale: "sv_SE", }, function(err, data) { expect(err).toBeFalsy(); expect(data.body.items[0].href).toBe( - 'https://api.spotify.com/v1/browse/categories/party' + "https://api.spotify.com/v1/browse/categories/party" ); expect(data.body.items[1].href).toBe( - 'https://api.spotify.com/v1/browse/categories/pop' + "https://api.spotify.com/v1/browse/categories/pop" ); expect(data.body.items.length).toBe(2); expect(data.statusCode).toBe(200); @@ -3719,109 +3671,103 @@ describe('Spotify Web API', () => { ); }); - test('should get a browse category', done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.get); - expect(uri).toBe('https://api.spotify.com/v1/browse/categories/party'); - expect(options.query).toEqual({ - country: 'SE', - locale: 'sv_SE' - }); - expect(options.headers.Authorization).toBe('Bearer myAccessToken'); - callback(null, { - body: { - href: 'https://api.spotify.com/v1/browse/categories/party', - name: 'Party' + test("should get a browse category", (done) => { + fetch.mockResponse(async (req) => { + const url = new URL(req.url); + expect(req.method).toBe("GET"); + expect(url.pathname).toBe("/v1/browse/categories/party"); + expect(url.searchParams.get("country")).toBe("SE"); + expect(url.searchParams.get("locale")).toBe("sv_SE"); + expect(req.headers.get("authorization")).toBe("Bearer myAccessToken"); + + return { + status: 200, + headers: { + "content-type": "application/json", }, - statusCode: 200 - }); + body: JSON.stringify({ + href: "https://api.spotify.com/v1/browse/categories/party", + name: "Party", + }), + }; }); - var accessToken = 'myAccessToken'; + var accessToken = "myAccessToken"; var api = new SpotifyWebApi({ - accessToken: accessToken + accessToken: accessToken, }); api.getCategory( - 'party', + "party", { - country: 'SE', - locale: 'sv_SE' + country: "SE", + locale: "sv_SE", }, function(err, data) { expect(err).toBeFalsy(); expect(data.body.href).toBe( - 'https://api.spotify.com/v1/browse/categories/party' + "https://api.spotify.com/v1/browse/categories/party" ); - expect(data.body.name).toBe('Party'); + expect(data.body.name).toBe("Party"); expect(data.statusCode).toBe(200); done(); } ); }); - test('should get a playlists for a browse category', done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.get); - expect(uri).toBe( - 'https://api.spotify.com/v1/browse/categories/party/playlists' - ); - expect(options.query).toEqual({ - country: 'SE', - limit: 2, - offset: 1 - }); - expect(options.headers.Authorization).toBe('Bearer myAccessToken'); - callback(null, { - body: { + test("should get a playlists for a browse category", (done) => { + fetch.mockResponse(async (req) => { + const url = new URL(req.url); + expect(req.method).toBe("GET"); + expect(url.pathname).toBe("/v1/browse/categories/party/playlists"); + expect(url.searchParams.get("country")).toBe("SE"); + expect(url.searchParams.get("limit")).toBe("2"); + expect(url.searchParams.get("offset")).toBe("1"); + expect(req.headers.get("authorization")).toBe("Bearer myAccessToken"); + + return { + status: 200, + headers: { + "content-type": "application/json", + }, + body: JSON.stringify({ playlists: { items: [ { href: - 'https://api.spotify.com/v1/users/spotifybrazilian/playlists/4k7EZPI3uKMz4aRRrLVfen' + "https://api.spotify.com/v1/users/spotifybrazilian/playlists/4k7EZPI3uKMz4aRRrLVfen", }, { href: - 'https://api.spotify.com/v1/users/spotifybrazilian/playlists/4HZh0C9y80GzHDbHZyX770' - } - ] - } - }, - statusCode: 200 - }); + "https://api.spotify.com/v1/users/spotifybrazilian/playlists/4HZh0C9y80GzHDbHZyX770", + }, + ], + }, + }), + }; }); - var accessToken = 'myAccessToken'; + var accessToken = "myAccessToken"; var api = new SpotifyWebApi({ - accessToken: accessToken + accessToken: accessToken, }); api.getPlaylistsForCategory( - 'party', + "party", { - country: 'SE', + country: "SE", limit: 2, - offset: 1 + offset: 1, }, function(err, data) { expect(err).toBeFalsy(); expect(data.body.playlists.items[0].href).toBe( - 'https://api.spotify.com/v1/users/spotifybrazilian/playlists/4k7EZPI3uKMz4aRRrLVfen' + "https://api.spotify.com/v1/users/spotifybrazilian/playlists/4k7EZPI3uKMz4aRRrLVfen" ); expect(data.body.playlists.items[1].href).toBe( - 'https://api.spotify.com/v1/users/spotifybrazilian/playlists/4HZh0C9y80GzHDbHZyX770' + "https://api.spotify.com/v1/users/spotifybrazilian/playlists/4HZh0C9y80GzHDbHZyX770" ); expect(data.body.playlists.items.length).toBe(2); expect(data.statusCode).toBe(200); @@ -3830,28 +3776,25 @@ describe('Spotify Web API', () => { ); }); - test('should get the audio analysis for a track', done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.get); - expect(uri).toBe( - 'https://api.spotify.com/v1/audio-analysis/3Qm86XLflmIXVm1wcwkgDK' + test("should get the audio analysis for a track", (done) => { + fetch.mockResponse(async (req) => { + expect(req.method).toBe("GET"); + expect(req.url).toBe( + "https://api.spotify.com/v1/audio-analysis/3Qm86XLflmIXVm1wcwkgDK" ); - expect(options.query).toBeFalsy(); - expect(options.data).toBeFalsy(); - callback(null, { - body: { - } - }); + + return { + status: 200, + headers: { + "content-type": "application/json", + }, + body: JSON.stringify({}), + }; }); var api = new SpotifyWebApi(); - api.getAudioAnalysisForTrack('3Qm86XLflmIXVm1wcwkgDK').then( + api.getAudioAnalysisForTrack("3Qm86XLflmIXVm1wcwkgDK").then( function(data) { done(); }, @@ -3861,30 +3804,28 @@ describe('Spotify Web API', () => { ); }); - test('should get the audio features for a track', done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.get); - expect(uri).toBe( - 'https://api.spotify.com/v1/audio-features/3Qm86XLflmIXVm1wcwkgDK' + test("should get the audio features for a track", (done) => { + fetch.mockResponse(async (req) => { + expect(req.method).toBe("GET"); + expect(req.url).toBe( + "https://api.spotify.com/v1/audio-features/3Qm86XLflmIXVm1wcwkgDK" ); - expect(options.query).toBeFalsy(); - expect(options.data).toBeFalsy(); - callback(null, { - body: { + + return { + status: 200, + headers: { + "content-type": "application/json", + }, + body: JSON.stringify({ danceability: 20, - energy: 0 - } - }); + energy: 0, + }), + }; }); var api = new SpotifyWebApi(); - api.getAudioFeaturesForTrack('3Qm86XLflmIXVm1wcwkgDK').then( + api.getAudioFeaturesForTrack("3Qm86XLflmIXVm1wcwkgDK").then( function(data) { expect(data.body.danceability).toBe(20); done(); @@ -3895,32 +3836,32 @@ describe('Spotify Web API', () => { ); }); - test('should get the audio features for a several tracks', done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.get); - expect(uri).toBe('https://api.spotify.com/v1/audio-features'); - expect(options.query).toEqual({ - ids: '3Qm86XLflmIXVm1wcwkgDK,1lDWb6b6ieDQ2xT7ewTC3G' - }); - expect(options.data).toBeFalsy(); - callback(null, { - body: { - audio_features: [] - } - }); + test("should get the audio features for a several tracks", (done) => { + fetch.mockResponse(async (req) => { + const url = new URL(req.url); + expect(req.method).toBe("GET"); + expect(url.pathname).toBe("/v1/audio-features"); + expect(url.searchParams.get("ids")).toBe( + "3Qm86XLflmIXVm1wcwkgDK,1lDWb6b6ieDQ2xT7ewTC3G" + ); + + return { + status: 200, + headers: { + "content-type": "application/json", + }, + body: JSON.stringify({ + audio_features: [], + }), + }; }); var api = new SpotifyWebApi(); api .getAudioFeaturesForTracks([ - '3Qm86XLflmIXVm1wcwkgDK', - '1lDWb6b6ieDQ2xT7ewTC3G' + "3Qm86XLflmIXVm1wcwkgDK", + "1lDWb6b6ieDQ2xT7ewTC3G", ]) .then( function(data) { @@ -3933,29 +3874,29 @@ describe('Spotify Web API', () => { ); }); - test('should get recommendations', done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.get); - expect(uri).toBe('https://api.spotify.com/v1/recommendations'); - expect(options.query).toEqual({ - min_energy: 0.4, - market: 'ES', - seed_artists: '6mfK6Q2tzLMEchAr0e9Uzu,4DYFVNKZ1uixa6SQTvzQwJ', - limit: 5, - min_popularity: 50 - }); - expect(options.data).toBeFalsy(); - callback(null, { - body: { + test("should get recommendations", (done) => { + fetch.mockResponse(async (req) => { + const url = new URL(req.url); + expect(req.method).toBe("GET"); + expect(url.pathname).toBe("/v1/recommendations"); + expect(url.searchParams.get("min_energy")).toBe("0.4"); + expect(url.searchParams.get("market")).toBe("ES"); + expect(url.searchParams.get("seed_artists")).toBe( + "6mfK6Q2tzLMEchAr0e9Uzu,4DYFVNKZ1uixa6SQTvzQwJ" + ); + expect(url.searchParams.get("limit")).toBe("5"); + expect(url.searchParams.get("min_popularity")).toBe("50"); + + return { + status: 200, + headers: { + "content-type": "application/json", + }, + body: JSON.stringify({ tracks: [{}], - seeds: [{}] - } - }); + seeds: [{}], + }), + }; }); var api = new SpotifyWebApi(); @@ -3963,10 +3904,10 @@ describe('Spotify Web API', () => { api .getRecommendations({ min_energy: 0.4, - market: 'ES', - seed_artists: '6mfK6Q2tzLMEchAr0e9Uzu,4DYFVNKZ1uixa6SQTvzQwJ', + market: "ES", + seed_artists: "6mfK6Q2tzLMEchAr0e9Uzu,4DYFVNKZ1uixa6SQTvzQwJ", limit: 5, - min_popularity: 50 + min_popularity: 50, }) .then( function(data) { @@ -3979,29 +3920,29 @@ describe('Spotify Web API', () => { ); }); - test('should get recommendations using an array of seeds', done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.get); - expect(uri).toBe('https://api.spotify.com/v1/recommendations'); - expect(options.query).toEqual({ - min_energy: 0.4, - market: 'ES', - seed_artists: '6mfK6Q2tzLMEchAr0e9Uzu,4DYFVNKZ1uixa6SQTvzQwJ', - limit: 5, - min_popularity: 50 - }); - expect(options.data).toBeFalsy(); - callback(null, { - body: { + test("should get recommendations using an array of seeds", (done) => { + fetch.mockResponse(async (req) => { + const url = new URL(req.url); + expect(req.method).toBe("GET"); + expect(url.pathname).toBe("/v1/recommendations"); + expect(url.searchParams.get("min_energy")).toBe("0.4"); + expect(url.searchParams.get("market")).toBe("ES"); + expect(url.searchParams.get("seed_artists")).toBe( + "6mfK6Q2tzLMEchAr0e9Uzu,4DYFVNKZ1uixa6SQTvzQwJ" + ); + expect(url.searchParams.get("limit")).toBe("5"); + expect(url.searchParams.get("min_popularity")).toBe("50"); + + return { + status: 200, + headers: { + "content-type": "application/json", + }, + body: JSON.stringify({ tracks: [{}], - seeds: [{}] - } - }); + seeds: [{}], + }), + }; }); var api = new SpotifyWebApi(); @@ -4009,10 +3950,10 @@ describe('Spotify Web API', () => { api .getRecommendations({ min_energy: 0.4, - market: 'ES', - seed_artists: ['6mfK6Q2tzLMEchAr0e9Uzu', '4DYFVNKZ1uixa6SQTvzQwJ'], + market: "ES", + seed_artists: ["6mfK6Q2tzLMEchAr0e9Uzu", "4DYFVNKZ1uixa6SQTvzQwJ"], limit: 5, - min_popularity: 50 + min_popularity: 50, }) .then( function(data) { @@ -4025,24 +3966,22 @@ describe('Spotify Web API', () => { ); }); - test('should get available genre seeds', done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.get); - expect(uri).toBe( - 'https://api.spotify.com/v1/recommendations/available-genre-seeds' + test("should get available genre seeds", (done) => { + fetch.mockResponse(async (req) => { + expect(req.method).toBe("GET"); + expect(req.url).toBe( + "https://api.spotify.com/v1/recommendations/available-genre-seeds" ); - expect(options.query).toBeFalsy(); - expect(options.data).toBeFalsy(); - callback(null, { - body: { - genres: [] - } - }); + + return { + status: 200, + headers: { + "content-type": "application/json", + }, + body: JSON.stringify({ + genres: [], + }), + }; }); var api = new SpotifyWebApi(); @@ -4063,27 +4002,23 @@ describe('Spotify Web API', () => { */ /* Get a Show */ - test('should get a show', done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.get); - expect(uri).toBe( - 'https://api.spotify.com/v1/shows/123' - ); - expect(options.query.market).toBe('SE'); + test("should get a show", (done) => { + fetch.mockResponse(async (req) => { + const url = new URL(req.url); + expect(req.method).toBe("GET"); + expect(url.pathname).toBe("/v1/shows/123"); + expect(url.searchParams.get("market")).toBe("SE"); - callback(null, { - statusCode: 200 - }) + return { + status: 200, + headers: { "Content-Type": "application/json" }, + body: JSON.stringify({}), + }; }); var api = new SpotifyWebApi(); - api.getShow('123', { market: 'SE' }).then( + api.getShow("123", { market: "SE" }).then( function(data) { done(); }, @@ -4094,27 +4029,26 @@ describe('Spotify Web API', () => { }); /* Look up several shows */ - test('should get several shows', done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.get); - expect(uri).toBe( - 'https://api.spotify.com/v1/shows' - ); - expect(options.query.market).toBe('SE'); - expect(options.query.ids).toBe('1,2,3'); - callback(null, { - statusCode: 200 - }) + test("should get several shows", (done) => { + fetch.mockResponse(async (req) => { + const url = new URL(req.url); + expect(req.method).toBe("GET"); + expect(url.pathname).toBe("/v1/shows"); + expect(url.searchParams.get("ids")).toBe("1,2,3"); + expect(url.searchParams.get("market")).toBe("SE"); + + return { + status: 200, + headers: { + "content-type": "application/json", + }, + body: JSON.stringify([true, false, false]), + }; }); var api = new SpotifyWebApi(); - api.getShows(['1', '2', '3'], { market: 'SE' }).then( + api.getShows(["1", "2", "3"], { market: "SE" }).then( function(data) { done(); }, @@ -4125,27 +4059,25 @@ describe('Spotify Web API', () => { }); /* Check if one or more shows is already saved in the current Spotify user’s “Your Music” library. */ - test('should see that show is already saved by user', done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.get); - expect(uri).toBe( - 'https://api.spotify.com/v1/me/shows/contains' - ); - expect(options.query.ids).toBe('1,2,3'); - callback(null, { - body: [ true, false, false ], - statusCode: 200 - }) + test("should see that show is already saved by user", (done) => { + fetch.mockResponse(async (req) => { + const url = new URL(req.url); + expect(req.method).toBe("GET"); + expect(url.pathname).toBe("/v1/me/shows/contains"); + expect(url.searchParams.get("ids")).toBe("1,2,3"); + + return { + status: 200, + headers: { + "content-type": "application/json", + }, + body: JSON.stringify([true, false, false]), + }; }); var api = new SpotifyWebApi(); - api.containsMySavedShows(['1', '2', '3']).then( + api.containsMySavedShows(["1", "2", "3"]).then( function(data) { done(); }, @@ -4156,28 +4088,24 @@ describe('Spotify Web API', () => { }); /* Remove from user\'s saved shows. */ - test('should remove from user\'s saved shows', done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.del); - expect(uri).toBe( - 'https://api.spotify.com/v1/me/shows' - ); - expect(JSON.parse(options.data)).toStrictEqual(["1","2","3"]); - expect(options.query).toBeFalsy(); - expect(options.headers.Authorization).toEqual('Bearer longtoken'); - expect(options.headers['Content-Type']).toEqual('application/json'); - callback(null, {}) + test("should remove from user's saved shows", (done) => { + fetch.mockResponse(async (req) => { + const url = new URL(req.url); + expect(req.method).toBe("DELETE"); + expect(url.pathname).toBe("/v1/me/shows"); + expect(url.searchParams.get("ids")).toBe("1,2,3"); + expect(req.headers.get("Authorization")).toEqual("Bearer longtoken"); + expect(req.headers.get("Content-Type")).toEqual("application/json"); + + return { + status: 200, + }; }); var api = new SpotifyWebApi(); - api.setAccessToken('longtoken'); + api.setAccessToken("longtoken"); - api.removeFromMySavedShows(['1', '2', '3']).then( + api.removeFromMySavedShows(["1", "2", "3"]).then( function(data) { done(); }, @@ -4187,29 +4115,24 @@ describe('Spotify Web API', () => { ); }); - /* Add to user\'s saved shows. */ - test('should remove from user\'s saved shows', done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.put); - expect(uri).toBe( - 'https://api.spotify.com/v1/me/shows' - ); - expect(JSON.parse(options.data)).toStrictEqual(["1","2","3"]); - expect(options.query).toBeFalsy(); - expect(options.headers.Authorization).toEqual('Bearer longtoken'); - expect(options.headers['Content-Type']).toEqual('application/json'); - callback(null, {}) + /* Add to user's saved shows. */ + test("should add to user's saved shows", (done) => { + fetch.mockResponse(async (req) => { + expect(req.method).toBe("PUT"); + expect(req.url).toBe("https://api.spotify.com/v1/me/shows"); + expect(JSON.parse(JSON.parse(req.body))).toEqual(["1", "2", "3"]); + expect(req.headers.get("Authorization")).toEqual("Bearer longtoken"); + expect(req.headers.get("Content-Type")).toEqual("application/json"); + + return { + status: 200, + }; }); var api = new SpotifyWebApi(); - api.setAccessToken('longtoken'); + api.setAccessToken("longtoken"); - api.addToMySavedShows(['1', '2', '3']).then( + api.addToMySavedShows(["1", "2", "3"]).then( function(data) { done(); }, @@ -4219,31 +4142,27 @@ describe('Spotify Web API', () => { ); }); - /* Get user\'s saved shows. */ - test('should remove from user\'s saved shows', done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.get); - expect(uri).toBe( - 'https://api.spotify.com/v1/me/shows' - ); - expect(options.data).toBeFalsy(); - expect(options.query.limit).toBe(1); - expect(options.query.offset).toBe(2); - expect(options.query.market).toBe('DK'); - expect(options.headers.Authorization).toEqual('Bearer longtoken'); - expect(options.headers['Content-Type']).toBeFalsy(); - callback(null, {}) + /* Get user's saved shows. */ + test("should remove from user's saved shows", (done) => { + fetch.mockResponse(async (req) => { + const url = new URL(req.url); + expect(req.method).toBe("GET"); + expect(url.pathname).toBe("/v1/me/shows"); + expect(url.searchParams.get("market")).toBe("DK"); + expect(url.searchParams.get("limit")).toBe("1"); + expect(url.searchParams.get("offset")).toBe("2"); + expect(req.headers.get("Authorization")).toEqual("Bearer longtoken"); + expect(req.headers.get("Content-Type")).toBeFalsy(); + + return { + status: 200, + }; }); var api = new SpotifyWebApi(); - api.setAccessToken('longtoken'); + api.setAccessToken("longtoken"); - api.getMySavedShows({ market: 'DK', limit: 1, offset: 2}).then( + api.getMySavedShows({ market: "DK", limit: 1, offset: 2 }).then( function(data) { done(); }, @@ -4253,31 +4172,28 @@ describe('Spotify Web API', () => { ); }); - /* Get the episodes of an show. */ - test('should retrieve the episodes of a show', done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.get); - expect(uri).toBe( - 'https://api.spotify.com/v1/shows/123/episodes' - ); - expect(options.query.market).toBe('SE'); - expect(options.query.limit).toBe(1); - expect(options.query.offset).toBe(2); - callback(null, { - body: {}, - statusCode: 200 - }) + test("should retrieve the episodes of a show", (done) => { + fetch.mockResponse(async (req) => { + const url = new URL(req.url); + expect(req.method).toBe("GET"); + expect(url.pathname).toBe("/v1/shows/123/episodes"); + expect(url.searchParams.get("market")).toBe("SE"); + expect(url.searchParams.get("limit")).toBe("1"); + expect(url.searchParams.get("offset")).toBe("2"); + + return { + status: 200, + headers: { + "content-type": "application/json", + }, + body: JSON.stringify({}), + }; }); var api = new SpotifyWebApi(); - api.getShowEpisodes('123', { 'market' : 'SE', 'limit' : 1, 'offset': 2}).then( + api.getShowEpisodes("123", { market: "SE", limit: 1, offset: 2 }).then( function(data) { done(); }, @@ -4288,31 +4204,29 @@ describe('Spotify Web API', () => { }); /* Search for a show. */ - test('should search for a show', done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.get); - expect(uri).toBe( - 'https://api.spotify.com/v1/search/' - ); - expect(options.query.q).toBe('kvartal'); - expect(options.query.type).toBe('show'); - expect(options.query.market).toBe('SE'); - expect(options.query.limit).toBe(3); - expect(options.query.offset).toBe(1); - callback(null, { - body: {}, - statusCode: 200 - }) + test("should search for a show", (done) => { + fetch.mockResponse(async (req) => { + const url = new URL(req.url); + expect(req.method).toBe("GET"); + expect(url.pathname).toBe("/v1/search/"); + expect(url.searchParams.get("q")).toBe("kvartal"); + expect(url.searchParams.get("type")).toBe("show"); + expect(url.searchParams.get("market")).toBe("SE"); + expect(url.searchParams.get("limit")).toBe("3"); + expect(url.searchParams.get("offset")).toBe("1"); + + return { + status: 200, + headers: { + "content-type": "application/json", + }, + body: JSON.stringify({}), + }; }); var api = new SpotifyWebApi(); - api.searchShows('kvartal', { 'market' : 'SE', 'limit' : 3, 'offset': 1}).then( + api.searchShows("kvartal", { market: "SE", limit: 3, offset: 1 }).then( function(data) { done(); }, @@ -4323,62 +4237,62 @@ describe('Spotify Web API', () => { }); /* Search for an episode. */ - test('should search for an episode', done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.get); - expect(uri).toBe( - 'https://api.spotify.com/v1/search/' - ); - expect(options.query.q).toBe('hanif bali'); - expect(options.query.type).toBe('episode'); - expect(options.query.market).toBe('UK'); - expect(options.query.limit).toBe(10); - expect(options.query.offset).toBe(11); - callback(null, { - body: {}, - statusCode: 200 - }) + test("should search for an episode", (done) => { + fetch.mockResponse(async (req) => { + const url = new URL(req.url); + expect(req.method).toBe("GET"); + expect(url.pathname).toBe("/v1/search/"); + expect(url.searchParams.get("q")).toBe("hanif bali"); + expect(url.searchParams.get("type")).toBe("episode"); + expect(url.searchParams.get("market")).toBe("UK"); + expect(url.searchParams.get("limit")).toBe("10"); + expect(url.searchParams.get("offset")).toBe("11"); + + return { + status: 200, + headers: { + "content-type": "application/json", + }, + body: JSON.stringify({}), + }; }); var api = new SpotifyWebApi(); - api.searchEpisodes('hanif bali', { 'market' : 'UK', 'limit' : 10, 'offset': 11}).then( - function(data) { - done(); - }, - function(err) { - done(err); - } - ); + api + .searchEpisodes("hanif bali", { market: "UK", limit: 10, offset: 11 }) + .then( + function(data) { + done(); + }, + function(err) { + done(err); + } + ); }); /* Look up an episode. */ - test('should look up an episode', done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.get); - expect(uri).toBe( - 'https://api.spotify.com/v1/episodes/3Qm86XLflmIXVm1wcwkgDK' + test("should look up an episode", (done) => { + fetch.mockResponse(async (req) => { + expect(req.method).toBe("GET"); + expect(req.url).toBe( + "https://api.spotify.com/v1/episodes/3Qm86XLflmIXVm1wcwkgDK?market=NO" ); - expect(options.query.market).toBe('NO'); - callback(null, { - body: {}, - statusCode: 200 - }) + + return { + status: 200, + headers: { + "content-type": "application/json", + }, + body: JSON.stringify({ + id: "3Qm86XLflmIXVm1wcwkgDK", + }), + }; }); var api = new SpotifyWebApi(); - api.getEpisode('3Qm86XLflmIXVm1wcwkgDK', { 'market' : 'NO' }).then( + api.getEpisode("3Qm86XLflmIXVm1wcwkgDK", { market: "NO" }).then( function(data) { done(); }, @@ -4388,124 +4302,135 @@ describe('Spotify Web API', () => { ); }); - /* Look up several episodes */ - test('should get several episodes', done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.get); - expect(uri).toBe( - 'https://api.spotify.com/v1/episodes' + /* Look up several episodes */ + test("should get several episodes", (done) => { + fetch.mockResponse(async (req) => { + const url = new URL(req.url); + expect(req.method).toBe("GET"); + expect(url.pathname).toBe("/v1/episodes"); + expect(url.searchParams.get("market")).toBe("DK"); + expect(url.searchParams.get("ids")).toBe( + "3Qm86XLflmIXVm1wcwkgDK,66m86XLflmIXVm1wcwkg66" ); - expect(options.query.market).toBe('DK'); - expect(options.query.ids).toBe('3Qm86XLflmIXVm1wcwkgDK,66m86XLflmIXVm1wcwkg66'); - callback(null, { - statusCode: 200 - }) + + return { + status: 200, + headers: { + "Content-Type": "application/json", + }, + body: JSON.stringify({ + episodes: [ + { uri: "3Qm86XLflmIXVm1wcwkgDK" }, + { uri: "66m86XLflmIXVm1wcwkg66" }, + ], + }), + }; }); var api = new SpotifyWebApi(); - api.getEpisodes(['3Qm86XLflmIXVm1wcwkgDK', '66m86XLflmIXVm1wcwkg66'], { market: 'DK' }).then( - function(data) { - done(); - }, - function(err) { - done(err); - } - ); + api + .getEpisodes(["3Qm86XLflmIXVm1wcwkgDK", "66m86XLflmIXVm1wcwkg66"], { + market: "DK", + }) + .then( + function(data) { + done(); + }, + function(err) { + done(err); + } + ); }); /** * Authentication/Authorization */ - - test('should ignore entire show_dialog param if it is not included', () => { - var scopes = ['user-read-private', 'user-read-email'], - redirectUri = 'https://example.com/callback', - clientId = '5fe01282e44241328a84e7c5cc169165', - state = 'some-state-of-my-choice'; + + test("should ignore entire show_dialog param if it is not included", () => { + var scopes = ["user-read-private", "user-read-email"], + redirectUri = "https://example.com/callback", + clientId = "5fe01282e44241328a84e7c5cc169165", + state = "some-state-of-my-choice"; var api = new SpotifyWebApi({ clientId: clientId, - redirectUri: redirectUri + redirectUri: redirectUri, }); var authorizeURL = api.createAuthorizeURL(scopes, state); expect(authorizeURL).toBe( - 'https://accounts.spotify.com/authorize?client_id=5fe01282e44241328a84e7c5cc169165&response_type=code&redirect_uri=https://example.com/callback&scope=user-read-private%20user-read-email&state=some-state-of-my-choice' + "https://accounts.spotify.com/authorize?client_id=5fe01282e44241328a84e7c5cc169165&response_type=code&redirect_uri=https://example.com/callback&scope=user-read-private%20user-read-email&state=some-state-of-my-choice" ); }); - test('should create authorization URL with code based authentication', () => { - var scopes = ['user-read-private', 'user-read-email'], - redirectUri = 'https://example.com/callback', - clientId = '5fe01282e44241328a84e7c5cc169165', - state = 'some-state-of-my-choice', + test("should create authorization URL with code based authentication", () => { + var scopes = ["user-read-private", "user-read-email"], + redirectUri = "https://example.com/callback", + clientId = "5fe01282e44241328a84e7c5cc169165", + state = "some-state-of-my-choice", showDialog = true; var api = new SpotifyWebApi({ clientId: clientId, - redirectUri: redirectUri + redirectUri: redirectUri, }); var authorizeURL = api.createAuthorizeURL(scopes, state, showDialog); expect(authorizeURL).toBe( - 'https://accounts.spotify.com/authorize?client_id=5fe01282e44241328a84e7c5cc169165&response_type=code&redirect_uri=https://example.com/callback&scope=user-read-private%20user-read-email&state=some-state-of-my-choice&show_dialog=true' + "https://accounts.spotify.com/authorize?client_id=5fe01282e44241328a84e7c5cc169165&response_type=code&redirect_uri=https://example.com/callback&scope=user-read-private%20user-read-email&state=some-state-of-my-choice&show_dialog=true" ); }); - - test('should create authorization URL with token based authentication', () => { - var scopes = ['user-read-private', 'user-read-email'], - redirectUri = 'https://example.com/callback', - clientId = '5fe01282e44241328a84e7c5cc169165', - state = 'some-state-of-my-choice', + + test("should create authorization URL with token based authentication", () => { + var scopes = ["user-read-private", "user-read-email"], + redirectUri = "https://example.com/callback", + clientId = "5fe01282e44241328a84e7c5cc169165", + state = "some-state-of-my-choice", showDialog = true, - responseType = 'token' + responseType = "token"; var api = new SpotifyWebApi({ clientId: clientId, - redirectUri: redirectUri + redirectUri: redirectUri, }); - var authorizeURL = api.createAuthorizeURL(scopes, state, showDialog, responseType); + var authorizeURL = api.createAuthorizeURL( + scopes, + state, + showDialog, + responseType + ); expect(authorizeURL).toBe( - 'https://accounts.spotify.com/authorize?client_id=5fe01282e44241328a84e7c5cc169165&response_type=token&redirect_uri=https://example.com/callback&scope=user-read-private%20user-read-email&state=some-state-of-my-choice&show_dialog=true' + "https://accounts.spotify.com/authorize?client_id=5fe01282e44241328a84e7c5cc169165&response_type=token&redirect_uri=https://example.com/callback&scope=user-read-private%20user-read-email&state=some-state-of-my-choice&show_dialog=true" ); }); - + /* Client credentials */ - test('should retrieve an access token using the client credentials flow', function(done) { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.post); - expect(uri).toBe( - 'https://accounts.spotify.com/api/token' + test("should retrieve an access token using the client credentials flow", function(done) { + fetch.mockResponse(async (req) => { + expect(req.method).toBe("POST"); + expect(req.url).toBe("https://accounts.spotify.com/api/token"); + expect(req.headers.get("authorization")).toBe( + "Basic c29tZUNsaWVudElkOnNvbWVDbGllbnRTZWNyZXQ=" ); - expect(options.data.grant_type).toBe('client_credentials'); - expect(options.headers).toStrictEqual({ - Authorization: "Basic c29tZUNsaWVudElkOnNvbWVDbGllbnRTZWNyZXQ=", - 'Content-Type' : 'application/x-www-form-urlencoded' - }); - callback(null, { - statusCode: 200 - }) + expect(req.headers.get("content-type")).toBe( + "application/x-www-form-urlencoded" + ); + expect(req.body.toString()).toBe("grant_type=client_credentials"); + + return { + status: 200, + }; }); - var clientId = 'someClientId', - clientSecret = 'someClientSecret'; + var clientId = "someClientId", + clientSecret = "someClientSecret"; var api = new SpotifyWebApi({ clientId: clientId, - clientSecret: clientSecret + clientSecret: clientSecret, }); api.clientCredentialsGrant().then( @@ -4518,124 +4443,118 @@ describe('Spotify Web API', () => { ); }); - test('should retrieve an access token using the authorization code flow', function(done) { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.post); - expect(uri).toBe( - 'https://accounts.spotify.com/api/token' + test("should retrieve an access token using the authorization code flow", function(done) { + fetch.mockResponse(async (req) => { + expect(req.method).toBe("POST"); + expect(req.url).toBe("https://accounts.spotify.com/api/token"); + expect(req.headers.get("content-type")).toBe( + "application/x-www-form-urlencoded" ); - expect(options.data.grant_type).toBe('authorization_code'); - expect(options.data.redirect_uri).toBe('http://www.michaelthelin.se/test-callback'); - expect(options.data.code).toBe('mySuperLongCode'); - expect(options.data.client_id).toBe('someClientId'); - expect(options.data.client_secret).toBe('someClientSecret'); - expect(options.headers['Content-Type']).toBe('application/x-www-form-urlencoded'); - callback(null, { - statusCode: 200 - }) + expect(new URLSearchParams(String(req.body)).toString()).toBe( + new URLSearchParams({ + grant_type: "authorization_code", + redirect_uri: "http://www.michaelthelin.se/test-callback", + code: "mySuperLongCode", + client_id: "someClientId", + client_secret: "someClientSecret", + }).toString() + ); + + return { + status: 200, + }; }); var credentials = { - clientId: 'someClientId', - clientSecret: 'someClientSecret', - redirectUri: 'http://www.michaelthelin.se/test-callback' + clientId: "someClientId", + clientSecret: "someClientSecret", + redirectUri: "http://www.michaelthelin.se/test-callback", }; var api = new SpotifyWebApi(credentials); - api.authorizationCodeGrant('mySuperLongCode').then( + api.authorizationCodeGrant("mySuperLongCode").then( function(data) { done(); }, function(err) { - console.log(err); done(err); } ); }); - test('should refresh token', function(done) { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.post); - expect(uri).toBe( - 'https://accounts.spotify.com/api/token' + test("should refresh token", function(done) { + fetch.mockResponse(async (req) => { + expect(req.method).toBe("POST"); + expect(req.url).toBe("https://accounts.spotify.com/api/token"); + expect(req.headers.get("Content-Type")).toBe( + "application/x-www-form-urlencoded" ); - expect(options.headers['Content-Type']).toBe('application/x-www-form-urlencoded'); - expect(options.data.grant_type).toBe('refresh_token'); - expect(options.data.refresh_token).toBe('myRefreshToken'); - callback(null, { - statusCode: 200 - }) + expect(String(req.body)).toEqual( + "grant_type=refresh_token&refresh_token=myRefreshToken" + ); + + return { + status: 200, + }; }); var api = new SpotifyWebApi(); - api.setRefreshToken('myRefreshToken'); + api.setRefreshToken("myRefreshToken"); api.refreshAccessToken().then( function(data) { done(); }, function(err) { - console.log(err); done(err); } ); }); - test('should refresh an access token', done => { - sinon.stub(HttpManager, '_makeRequest').callsFake(function( - method, - options, - uri, - callback - ) { - expect(method).toBe(superagent.post); - expect(uri).toBe('https://accounts.spotify.com/api/token'); - expect(options.data).toEqual({ - grant_type: 'refresh_token', - refresh_token: 'someLongRefreshToken' - }); - expect(options.query).toBeFalsy(); - expect(options.headers).toEqual({ - Authorization: 'Basic c29tZUNsaWVudElkOnNvbWVDbGllbnRTZWNyZXQ=', - 'Content-Type': 'application/x-www-form-urlencoded' - }); - callback(null, { - body: { - access_token: 'NgCXRK...MzYjw', - token_type: 'Bearer', - expires_in: 3600, - refresh_token: 'NgAagA...Um_SHo' + test("should refresh an access token", (done) => { + fetch.mockResponse(async (req) => { + expect(req.method).toBe("POST"); + expect(req.url).toBe("https://accounts.spotify.com/api/token"); + expect(req.headers.get("Content-Type")).toBe( + "application/x-www-form-urlencoded" + ); + expect(req.headers.get("authorization")).toBe( + "Basic c29tZUNsaWVudElkOnNvbWVDbGllbnRTZWNyZXQ=" + ); + expect(String(req.body)).toEqual( + "grant_type=refresh_token&refresh_token=someLongRefreshToken" + ); + + return { + status: 200, + headers: { + "content-type": "application/json", }, - statusCode: 200 - }); + body: JSON.stringify({ + access_token: "NgCXRK...MzYjw", + token_type: "Bearer", + expires_in: 3600, + refresh_token: "NgAagA...Um_SHo", + }), + }; }); - var clientId = 'someClientId'; - var clientSecret = 'someClientSecret'; - var refreshToken = 'someLongRefreshToken'; + var clientId = "someClientId"; + var clientSecret = "someClientSecret"; + var refreshToken = "someLongRefreshToken"; var api = new SpotifyWebApi({ clientId: clientId, clientSecret: clientSecret, - refreshToken: refreshToken + refreshToken: refreshToken, }); - api.refreshAccessToken().then(function(data) { - done(); + api.refreshAccessToken().then(function(data, err) { + done(err); }); }); - test('should set, get and reset credentials', function(done) { + test("should set, get and reset credentials", function(done) { var api = new SpotifyWebApi(); expect(api.getAccessToken()).toBeFalsy(); @@ -4645,23 +4564,23 @@ describe('Spotify Web API', () => { expect(api.getClientSecret()).toBeFalsy(); api.setCredentials({ - accessToken : 'my-access-token', - refreshToken : 'my-refresh-token', - redirectUri : 'my-redirect-uri', - clientSecret : 'my-client-secret', - clientId : 'my-client-id' + accessToken: "my-access-token", + refreshToken: "my-refresh-token", + redirectUri: "my-redirect-uri", + clientSecret: "my-client-secret", + clientId: "my-client-id", }); - expect(api.getAccessToken()).toBe('my-access-token'); - expect(api.getRefreshToken()).toBe('my-refresh-token'); - expect(api.getRedirectURI()).toBe('my-redirect-uri'); - expect(api.getClientSecret()).toBe('my-client-secret'); - expect(api.getClientId()).toBe('my-client-id'); + expect(api.getAccessToken()).toBe("my-access-token"); + expect(api.getRefreshToken()).toBe("my-refresh-token"); + expect(api.getRedirectURI()).toBe("my-redirect-uri"); + expect(api.getClientSecret()).toBe("my-client-secret"); + expect(api.getClientId()).toBe("my-client-id"); api.resetAccessToken(); expect(api.getAccessToken()).toBeFalsy(); - expect(api.getRefreshToken()).toBe('my-refresh-token'); + expect(api.getRefreshToken()).toBe("my-refresh-token"); api.resetRefreshToken(); api.resetRedirectURI(); @@ -4669,25 +4588,24 @@ describe('Spotify Web API', () => { expect(api.getRefreshToken()).toBeFalsy(); expect(api.getRedirectURI()).toBeFalsy(); - api.setRedirectURI('my-redirect-uri'); - expect(api.getRedirectURI()).toBe('my-redirect-uri'); + api.setRedirectURI("my-redirect-uri"); + expect(api.getRedirectURI()).toBe("my-redirect-uri"); api.resetClientId(); expect(api.getClientId()).toBeFalsy(); - api.setClientId('woopwoop'); - expect(api.getClientId()).toBe('woopwoop'); + api.setClientId("woopwoop"); + expect(api.getClientId()).toBe("woopwoop"); api.resetClientSecret(); expect(api.getClientSecret()).toBeFalsy(); - api.setClientSecret('aNewClientSecret'); - expect(api.getClientSecret()).toBe('aNewClientSecret'); + api.setClientSecret("aNewClientSecret"); + expect(api.getClientSecret()).toBe("aNewClientSecret"); api.resetCredentials(); expect(api.getRedirectURI()).toBeFalsy(); done(); }); - }); diff --git a/__tests__/webapi-request.js b/__tests__/webapi-request.js index 99955ab0..e0fcde2d 100644 --- a/__tests__/webapi-request.js +++ b/__tests__/webapi-request.js @@ -1,26 +1,26 @@ -var WebApiRequest = require('../src/webapi-request'); +var WebApiRequest = require("../src/webapi-request"); -describe('Create Web Api Requests', () => { - test('Should use default settings if none are supplied', () => { - var request = WebApiRequest.builder('token').build(); +describe("Create Web Api Requests", () => { + test("Should use default settings if none are supplied", () => { + var request = WebApiRequest.builder("token").build(); - expect(request.getHost()).toBe('api.spotify.com'); + expect(request.getHost()).toBe("api.spotify.com"); expect(request.getPort()).toBe(443); - expect(request.getScheme()).toBe('https'); + expect(request.getScheme()).toBe("https"); expect(request.getHeaders().Authorization).toBeTruthy(); expect(request.getPath()).toBeFalsy(); expect(request.getQueryParameters()).toBeFalsy(); expect(request.getBodyParameters()).toBeFalsy(); }); - test('Can overwrite one of the default parameters', () => { - var request = WebApiRequest.builder('token') - .withHost('such.host.wow') + test("Can overwrite one of the default parameters", () => { + var request = WebApiRequest.builder("token") + .withHost("such.host.wow") .build(); - expect(request.getHost()).toBe('such.host.wow'); + expect(request.getHost()).toBe("such.host.wow"); expect(request.getPort()).toBe(443); - expect(request.getScheme()).toBe('https'); + expect(request.getScheme()).toBe("https"); expect(request.getHeaders().Authorization).toBeTruthy(); expect(request.getPath()).toBeFalsy(); expect(request.getQueryParameters()).toBeFalsy(); diff --git a/package-lock.json b/package-lock.json index d105ece2..bcc3621a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,8 +1,7439 @@ { "name": "spotify-web-api-node", - "version": "5.0.1", - "lockfileVersion": 1, + "version": "5.0.2", + "lockfileVersion": 2, "requires": true, + "packages": { + "": { + "name": "spotify-web-api-node", + "version": "5.0.2", + "license": "MIT", + "devDependencies": { + "coveralls": "^3.1.0", + "husky": "^4.3.0", + "jest": "^26.6.3", + "jest-fetch-mock": "^3.0.3", + "jest-resolve": "^26.6.2", + "lint-staged": "^10.4.0", + "prettier": "^2.1.2" + } + }, + "node_modules/@babel/code-frame": { + "version": "7.12.11", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.11.tgz", + "integrity": "sha512-Zt1yodBx1UcyiePMSkWnU4hPqhwq7hGi2nFL1LeA3EUl+q2LQx16MISgJ0+z7dnmgvP9QtIleuETGOiOH1RcIw==", + "dev": true, + "dependencies": { + "@babel/highlight": "^7.10.4" + } + }, + "node_modules/@babel/core": { + "version": "7.12.10", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.12.10.tgz", + "integrity": "sha512-eTAlQKq65zHfkHZV0sIVODCPGVgoo1HdBlbSLi9CqOzuZanMv2ihzY+4paiKr1mH+XmYESMAmJ/dpZ68eN6d8w==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.10.4", + "@babel/generator": "^7.12.10", + "@babel/helper-module-transforms": "^7.12.1", + "@babel/helpers": "^7.12.5", + "@babel/parser": "^7.12.10", + "@babel/template": "^7.12.7", + "@babel/traverse": "^7.12.10", + "@babel/types": "^7.12.10", + "convert-source-map": "^1.7.0", + "debug": "^4.1.0", + "gensync": "^1.0.0-beta.1", + "json5": "^2.1.2", + "lodash": "^4.17.19", + "semver": "^5.4.1", + "source-map": "^0.5.0" + }, + "engines": { + "node": ">=6.9.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/babel" + } + }, + "node_modules/@babel/core/node_modules/semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true, + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/@babel/core/node_modules/source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/@babel/generator": { + "version": "7.12.11", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.12.11.tgz", + "integrity": "sha512-Ggg6WPOJtSi8yYQvLVjG8F/TlpWDlKx0OpS4Kt+xMQPs5OaGYWy+v1A+1TvxI6sAMGZpKWWoAQ1DaeQbImlItA==", + "dev": true, + "dependencies": { + "@babel/types": "^7.12.11", + "jsesc": "^2.5.1", + "source-map": "^0.5.0" + } + }, + "node_modules/@babel/generator/node_modules/source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/@babel/helper-function-name": { + "version": "7.12.11", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.12.11.tgz", + "integrity": "sha512-AtQKjtYNolKNi6nNNVLQ27CP6D9oFR6bq/HPYSizlzbp7uC1M59XJe8L+0uXjbIaZaUJF99ruHqVGiKXU/7ybA==", + "dev": true, + "dependencies": { + "@babel/helper-get-function-arity": "^7.12.10", + "@babel/template": "^7.12.7", + "@babel/types": "^7.12.11" + } + }, + "node_modules/@babel/helper-get-function-arity": { + "version": "7.12.10", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.12.10.tgz", + "integrity": "sha512-mm0n5BPjR06wh9mPQaDdXWDoll/j5UpCAPl1x8fS71GHm7HA6Ua2V4ylG1Ju8lvcTOietbPNNPaSilKj+pj+Ag==", + "dev": true, + "dependencies": { + "@babel/types": "^7.12.10" + } + }, + "node_modules/@babel/helper-member-expression-to-functions": { + "version": "7.12.7", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.12.7.tgz", + "integrity": "sha512-DCsuPyeWxeHgh1Dus7APn7iza42i/qXqiFPWyBDdOFtvS581JQePsc1F/nD+fHrcswhLlRc2UpYS1NwERxZhHw==", + "dev": true, + "dependencies": { + "@babel/types": "^7.12.7" + } + }, + "node_modules/@babel/helper-module-imports": { + "version": "7.12.5", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.12.5.tgz", + "integrity": "sha512-SR713Ogqg6++uexFRORf/+nPXMmWIn80TALu0uaFb+iQIUoR7bOC7zBWyzBs5b3tBBJXuyD0cRu1F15GyzjOWA==", + "dev": true, + "dependencies": { + "@babel/types": "^7.12.5" + } + }, + "node_modules/@babel/helper-module-transforms": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.12.1.tgz", + "integrity": "sha512-QQzehgFAZ2bbISiCpmVGfiGux8YVFXQ0abBic2Envhej22DVXV9nCFaS5hIQbkyo1AdGb+gNME2TSh3hYJVV/w==", + "dev": true, + "dependencies": { + "@babel/helper-module-imports": "^7.12.1", + "@babel/helper-replace-supers": "^7.12.1", + "@babel/helper-simple-access": "^7.12.1", + "@babel/helper-split-export-declaration": "^7.11.0", + "@babel/helper-validator-identifier": "^7.10.4", + "@babel/template": "^7.10.4", + "@babel/traverse": "^7.12.1", + "@babel/types": "^7.12.1", + "lodash": "^4.17.19" + } + }, + "node_modules/@babel/helper-optimise-call-expression": { + "version": "7.12.10", + "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.12.10.tgz", + "integrity": "sha512-4tpbU0SrSTjjt65UMWSrUOPZTsgvPgGG4S8QSTNHacKzpS51IVWGDj0yCwyeZND/i+LSN2g/O63jEXEWm49sYQ==", + "dev": true, + "dependencies": { + "@babel/types": "^7.12.10" + } + }, + "node_modules/@babel/helper-plugin-utils": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.10.4.tgz", + "integrity": "sha512-O4KCvQA6lLiMU9l2eawBPMf1xPP8xPfB3iEQw150hOVTqj/rfXz0ThTb4HEzqQfs2Bmo5Ay8BzxfzVtBrr9dVg==", + "dev": true + }, + "node_modules/@babel/helper-replace-supers": { + "version": "7.12.11", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.12.11.tgz", + "integrity": "sha512-q+w1cqmhL7R0FNzth/PLLp2N+scXEK/L2AHbXUyydxp828F4FEa5WcVoqui9vFRiHDQErj9Zof8azP32uGVTRA==", + "dev": true, + "dependencies": { + "@babel/helper-member-expression-to-functions": "^7.12.7", + "@babel/helper-optimise-call-expression": "^7.12.10", + "@babel/traverse": "^7.12.10", + "@babel/types": "^7.12.11" + } + }, + "node_modules/@babel/helper-simple-access": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.12.1.tgz", + "integrity": "sha512-OxBp7pMrjVewSSC8fXDFrHrBcJATOOFssZwv16F3/6Xtc138GHybBfPbm9kfiqQHKhYQrlamWILwlDCeyMFEaA==", + "dev": true, + "dependencies": { + "@babel/types": "^7.12.1" + } + }, + "node_modules/@babel/helper-split-export-declaration": { + "version": "7.12.11", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.12.11.tgz", + "integrity": "sha512-LsIVN8j48gHgwzfocYUSkO/hjYAOJqlpJEc7tGXcIm4cubjVUf8LGW6eWRyxEu7gA25q02p0rQUWoCI33HNS5g==", + "dev": true, + "dependencies": { + "@babel/types": "^7.12.11" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.12.11", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.12.11.tgz", + "integrity": "sha512-np/lG3uARFybkoHokJUmf1QfEvRVCPbmQeUQpKow5cQ3xWrV9i3rUHodKDJPQfTVX61qKi+UdYk8kik84n7XOw==", + "dev": true + }, + "node_modules/@babel/helpers": { + "version": "7.12.5", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.12.5.tgz", + "integrity": "sha512-lgKGMQlKqA8meJqKsW6rUnc4MdUk35Ln0ATDqdM1a/UpARODdI4j5Y5lVfUScnSNkJcdCRAaWkspykNoFg9sJA==", + "dev": true, + "dependencies": { + "@babel/template": "^7.10.4", + "@babel/traverse": "^7.12.5", + "@babel/types": "^7.12.5" + } + }, + "node_modules/@babel/highlight": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.10.4.tgz", + "integrity": "sha512-i6rgnR/YgPEQzZZnbTHHuZdlE8qyoBNalD6F+q4vAFlcMEcqmkoG+mPqJYJCo63qPf74+Y1UZsl3l6f7/RIkmA==", + "dev": true, + "dependencies": { + "@babel/helper-validator-identifier": "^7.10.4", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + } + }, + "node_modules/@babel/highlight/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/highlight/node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/highlight/node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/@babel/highlight/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, + "node_modules/@babel/highlight/node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/highlight/node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/parser": { + "version": "7.12.11", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.12.11.tgz", + "integrity": "sha512-N3UxG+uuF4CMYoNj8AhnbAcJF0PiuJ9KHuy1lQmkYsxTer/MAH9UBNHsBoAX/4s6NvlDD047No8mYVGGzLL4hg==", + "dev": true, + "bin": { + "parser": "bin/babel-parser.js" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@babel/plugin-syntax-async-generators": { + "version": "7.8.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz", + "integrity": "sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-bigint": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-bigint/-/plugin-syntax-bigint-7.8.3.tgz", + "integrity": "sha512-wnTnFlG+YxQm3vDxpGE57Pj0srRU4sHE/mDkt1qv2YJJSeUAec2ma4WLUnUPeKjyrfntVwe/N6dCXpU+zL3Npg==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-class-properties": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.1.tgz", + "integrity": "sha512-U40A76x5gTwmESz+qiqssqmeEsKvcSyvtgktrm0uzcARAmM9I1jR221f6Oq+GmHrcD+LvZDag1UTOTe2fL3TeA==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.10.4" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-import-meta": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-meta/-/plugin-syntax-import-meta-7.10.4.tgz", + "integrity": "sha512-Yqfm+XDx0+Prh3VSeEQCPU81yC+JWZ2pDPFSS4ZdpfZhp4MkFMaDC1UqseovEKwSUpnIL7+vK+Clp7bfh0iD7g==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.10.4" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-json-strings": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz", + "integrity": "sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-logical-assignment-operators": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz", + "integrity": "sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.10.4" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-nullish-coalescing-operator": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz", + "integrity": "sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-numeric-separator": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz", + "integrity": "sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.10.4" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-object-rest-spread": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz", + "integrity": "sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-optional-catch-binding": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz", + "integrity": "sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-optional-chaining": { + "version": "7.8.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz", + "integrity": "sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.8.0" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/plugin-syntax-top-level-await": { + "version": "7.12.1", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.12.1.tgz", + "integrity": "sha512-i7ooMZFS+a/Om0crxZodrTzNEPJHZrlMVGMTEpFAj6rYY/bKCddB0Dk/YxfPuYXOopuhKk/e1jV6h+WUU9XN3A==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.10.4" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@babel/template": { + "version": "7.12.7", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.12.7.tgz", + "integrity": "sha512-GkDzmHS6GV7ZeXfJZ0tLRBhZcMcY0/Lnb+eEbXDBfCAcZCjrZKe6p3J4we/D24O9Y8enxWAg1cWwof59yLh2ow==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.10.4", + "@babel/parser": "^7.12.7", + "@babel/types": "^7.12.7" + } + }, + "node_modules/@babel/traverse": { + "version": "7.12.12", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.12.12.tgz", + "integrity": "sha512-s88i0X0lPy45RrLM8b9mz8RPH5FqO9G9p7ti59cToE44xFm1Q+Pjh5Gq4SXBbtb88X7Uy7pexeqRIQDDMNkL0w==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.12.11", + "@babel/generator": "^7.12.11", + "@babel/helper-function-name": "^7.12.11", + "@babel/helper-split-export-declaration": "^7.12.11", + "@babel/parser": "^7.12.11", + "@babel/types": "^7.12.12", + "debug": "^4.1.0", + "globals": "^11.1.0", + "lodash": "^4.17.19" + } + }, + "node_modules/@babel/types": { + "version": "7.12.12", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.12.12.tgz", + "integrity": "sha512-lnIX7piTxOH22xE7fDXDbSHg9MM1/6ORnafpJmov5rs0kX5g4BZxeXNJLXsMRiO0U5Rb8/FvMS6xlTnTHvxonQ==", + "dev": true, + "dependencies": { + "@babel/helper-validator-identifier": "^7.12.11", + "lodash": "^4.17.19", + "to-fast-properties": "^2.0.0" + } + }, + "node_modules/@bcoe/v8-coverage": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz", + "integrity": "sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==", + "dev": true + }, + "node_modules/@cnakazawa/watch": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@cnakazawa/watch/-/watch-1.0.4.tgz", + "integrity": "sha512-v9kIhKwjeZThiWrLmj0y17CWoyddASLj9O2yvbZkbvw/N3rWOYy9zkV66ursAoVr0mV15bL8g0c4QZUE6cdDoQ==", + "dev": true, + "dependencies": { + "exec-sh": "^0.3.2", + "minimist": "^1.2.0" + }, + "bin": { + "watch": "cli.js" + }, + "engines": { + "node": ">=0.1.95" + } + }, + "node_modules/@istanbuljs/load-nyc-config": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", + "integrity": "sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==", + "dev": true, + "dependencies": { + "camelcase": "^5.3.1", + "find-up": "^4.1.0", + "get-package-type": "^0.1.0", + "js-yaml": "^3.13.1", + "resolve-from": "^5.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@istanbuljs/load-nyc-config/node_modules/find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "dependencies": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@istanbuljs/load-nyc-config/node_modules/locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "dependencies": { + "p-locate": "^4.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@istanbuljs/load-nyc-config/node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@istanbuljs/load-nyc-config/node_modules/p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "dependencies": { + "p-limit": "^2.2.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@istanbuljs/load-nyc-config/node_modules/resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/@istanbuljs/schema": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.2.tgz", + "integrity": "sha512-tsAQNx32a8CoFhjhijUIhI4kccIAgmGhy8LZMZgGfmXcpMbPRUqn5LWmgRttILi6yeGmBJd2xsPkFMs0PzgPCw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/@jest/console": { + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/@jest/console/-/console-26.6.2.tgz", + "integrity": "sha512-IY1R2i2aLsLr7Id3S6p2BA82GNWryt4oSvEXLAKc+L2zdi89dSkE8xC1C+0kpATG4JhBJREnQOH7/zmccM2B0g==", + "dev": true, + "dependencies": { + "@jest/types": "^26.6.2", + "@types/node": "*", + "chalk": "^4.0.0", + "jest-message-util": "^26.6.2", + "jest-util": "^26.6.2", + "slash": "^3.0.0" + }, + "engines": { + "node": ">= 10.14.2" + } + }, + "node_modules/@jest/core": { + "version": "26.6.3", + "resolved": "https://registry.npmjs.org/@jest/core/-/core-26.6.3.tgz", + "integrity": "sha512-xvV1kKbhfUqFVuZ8Cyo+JPpipAHHAV3kcDBftiduK8EICXmTFddryy3P7NfZt8Pv37rA9nEJBKCCkglCPt/Xjw==", + "dev": true, + "dependencies": { + "@jest/console": "^26.6.2", + "@jest/reporters": "^26.6.2", + "@jest/test-result": "^26.6.2", + "@jest/transform": "^26.6.2", + "@jest/types": "^26.6.2", + "@types/node": "*", + "ansi-escapes": "^4.2.1", + "chalk": "^4.0.0", + "exit": "^0.1.2", + "graceful-fs": "^4.2.4", + "jest-changed-files": "^26.6.2", + "jest-config": "^26.6.3", + "jest-haste-map": "^26.6.2", + "jest-message-util": "^26.6.2", + "jest-regex-util": "^26.0.0", + "jest-resolve": "^26.6.2", + "jest-resolve-dependencies": "^26.6.3", + "jest-runner": "^26.6.3", + "jest-runtime": "^26.6.3", + "jest-snapshot": "^26.6.2", + "jest-util": "^26.6.2", + "jest-validate": "^26.6.2", + "jest-watcher": "^26.6.2", + "micromatch": "^4.0.2", + "p-each-series": "^2.1.0", + "rimraf": "^3.0.0", + "slash": "^3.0.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">= 10.14.2" + } + }, + "node_modules/@jest/environment": { + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-26.6.2.tgz", + "integrity": "sha512-nFy+fHl28zUrRsCeMB61VDThV1pVTtlEokBRgqPrcT1JNq4yRNIyTHfyht6PqtUvY9IsuLGTrbG8kPXjSZIZwA==", + "dev": true, + "dependencies": { + "@jest/fake-timers": "^26.6.2", + "@jest/types": "^26.6.2", + "@types/node": "*", + "jest-mock": "^26.6.2" + }, + "engines": { + "node": ">= 10.14.2" + } + }, + "node_modules/@jest/fake-timers": { + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-26.6.2.tgz", + "integrity": "sha512-14Uleatt7jdzefLPYM3KLcnUl1ZNikaKq34enpb5XG9i81JpppDb5muZvonvKyrl7ftEHkKS5L5/eB/kxJ+bvA==", + "dev": true, + "dependencies": { + "@jest/types": "^26.6.2", + "@sinonjs/fake-timers": "^6.0.1", + "@types/node": "*", + "jest-message-util": "^26.6.2", + "jest-mock": "^26.6.2", + "jest-util": "^26.6.2" + }, + "engines": { + "node": ">= 10.14.2" + } + }, + "node_modules/@jest/globals": { + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/@jest/globals/-/globals-26.6.2.tgz", + "integrity": "sha512-85Ltnm7HlB/KesBUuALwQ68YTU72w9H2xW9FjZ1eL1U3lhtefjjl5c2MiUbpXt/i6LaPRvoOFJ22yCBSfQ0JIA==", + "dev": true, + "dependencies": { + "@jest/environment": "^26.6.2", + "@jest/types": "^26.6.2", + "expect": "^26.6.2" + }, + "engines": { + "node": ">= 10.14.2" + } + }, + "node_modules/@jest/reporters": { + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-26.6.2.tgz", + "integrity": "sha512-h2bW53APG4HvkOnVMo8q3QXa6pcaNt1HkwVsOPMBV6LD/q9oSpxNSYZQYkAnjdMjrJ86UuYeLo+aEZClV6opnw==", + "dev": true, + "dependencies": { + "@bcoe/v8-coverage": "^0.2.3", + "@jest/console": "^26.6.2", + "@jest/test-result": "^26.6.2", + "@jest/transform": "^26.6.2", + "@jest/types": "^26.6.2", + "chalk": "^4.0.0", + "collect-v8-coverage": "^1.0.0", + "exit": "^0.1.2", + "glob": "^7.1.2", + "graceful-fs": "^4.2.4", + "istanbul-lib-coverage": "^3.0.0", + "istanbul-lib-instrument": "^4.0.3", + "istanbul-lib-report": "^3.0.0", + "istanbul-lib-source-maps": "^4.0.0", + "istanbul-reports": "^3.0.2", + "jest-haste-map": "^26.6.2", + "jest-resolve": "^26.6.2", + "jest-util": "^26.6.2", + "jest-worker": "^26.6.2", + "slash": "^3.0.0", + "source-map": "^0.6.0", + "string-length": "^4.0.1", + "terminal-link": "^2.0.0", + "v8-to-istanbul": "^7.0.0" + }, + "engines": { + "node": ">= 10.14.2" + }, + "optionalDependencies": { + "node-notifier": "^8.0.0" + } + }, + "node_modules/@jest/source-map": { + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/@jest/source-map/-/source-map-26.6.2.tgz", + "integrity": "sha512-YwYcCwAnNmOVsZ8mr3GfnzdXDAl4LaenZP5z+G0c8bzC9/dugL8zRmxZzdoTl4IaS3CryS1uWnROLPFmb6lVvA==", + "dev": true, + "dependencies": { + "callsites": "^3.0.0", + "graceful-fs": "^4.2.4", + "source-map": "^0.6.0" + }, + "engines": { + "node": ">= 10.14.2" + } + }, + "node_modules/@jest/test-result": { + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-26.6.2.tgz", + "integrity": "sha512-5O7H5c/7YlojphYNrK02LlDIV2GNPYisKwHm2QTKjNZeEzezCbwYs9swJySv2UfPMyZ0VdsmMv7jIlD/IKYQpQ==", + "dev": true, + "dependencies": { + "@jest/console": "^26.6.2", + "@jest/types": "^26.6.2", + "@types/istanbul-lib-coverage": "^2.0.0", + "collect-v8-coverage": "^1.0.0" + }, + "engines": { + "node": ">= 10.14.2" + } + }, + "node_modules/@jest/test-sequencer": { + "version": "26.6.3", + "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-26.6.3.tgz", + "integrity": "sha512-YHlVIjP5nfEyjlrSr8t/YdNfU/1XEt7c5b4OxcXCjyRhjzLYu/rO69/WHPuYcbCWkz8kAeZVZp2N2+IOLLEPGw==", + "dev": true, + "dependencies": { + "@jest/test-result": "^26.6.2", + "graceful-fs": "^4.2.4", + "jest-haste-map": "^26.6.2", + "jest-runner": "^26.6.3", + "jest-runtime": "^26.6.3" + }, + "engines": { + "node": ">= 10.14.2" + } + }, + "node_modules/@jest/transform": { + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-26.6.2.tgz", + "integrity": "sha512-E9JjhUgNzvuQ+vVAL21vlyfy12gP0GhazGgJC4h6qUt1jSdUXGWJ1wfu/X7Sd8etSgxV4ovT1pb9v5D6QW4XgA==", + "dev": true, + "dependencies": { + "@babel/core": "^7.1.0", + "@jest/types": "^26.6.2", + "babel-plugin-istanbul": "^6.0.0", + "chalk": "^4.0.0", + "convert-source-map": "^1.4.0", + "fast-json-stable-stringify": "^2.0.0", + "graceful-fs": "^4.2.4", + "jest-haste-map": "^26.6.2", + "jest-regex-util": "^26.0.0", + "jest-util": "^26.6.2", + "micromatch": "^4.0.2", + "pirates": "^4.0.1", + "slash": "^3.0.0", + "source-map": "^0.6.1", + "write-file-atomic": "^3.0.0" + }, + "engines": { + "node": ">= 10.14.2" + } + }, + "node_modules/@jest/types": { + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-26.6.2.tgz", + "integrity": "sha512-fC6QCp7Sc5sX6g8Tvbmj4XUTbyrik0akgRy03yjXbQaBWWNWGE7SGtJk98m0N8nzegD/7SggrUlivxo5ax4KWQ==", + "dev": true, + "dependencies": { + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^3.0.0", + "@types/node": "*", + "@types/yargs": "^15.0.0", + "chalk": "^4.0.0" + }, + "engines": { + "node": ">= 10.14.2" + } + }, + "node_modules/@mapbox/node-pre-gyp": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/@mapbox/node-pre-gyp/-/node-pre-gyp-1.0.10.tgz", + "integrity": "sha512-4ySo4CjzStuprMwk35H5pPbkymjv1SF3jGLj6rAHp/xT/RF7TL7bd9CTm1xDY49K2qF7jmR/g7k+SkLETP6opA==", + "dev": true, + "optional": true, + "peer": true, + "dependencies": { + "detect-libc": "^2.0.0", + "https-proxy-agent": "^5.0.0", + "make-dir": "^3.1.0", + "node-fetch": "^2.6.7", + "nopt": "^5.0.0", + "npmlog": "^5.0.1", + "rimraf": "^3.0.2", + "semver": "^7.3.5", + "tar": "^6.1.11" + }, + "bin": { + "node-pre-gyp": "bin/node-pre-gyp" + } + }, + "node_modules/@sinonjs/commons": { + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.8.2.tgz", + "integrity": "sha512-sruwd86RJHdsVf/AtBoijDmUqJp3B6hF/DGC23C+JaegnDHaZyewCjoVGTdg3J0uz3Zs7NnIT05OBOmML72lQw==", + "dev": true, + "dependencies": { + "type-detect": "4.0.8" + } + }, + "node_modules/@sinonjs/fake-timers": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-6.0.1.tgz", + "integrity": "sha512-MZPUxrmFubI36XS1DI3qmI0YdN1gks62JtFZvxR67ljjSNCeK6U08Zx4msEWOXuofgqUt6zPHSi1H9fbjR/NRA==", + "dev": true, + "dependencies": { + "@sinonjs/commons": "^1.7.0" + } + }, + "node_modules/@types/babel__core": { + "version": "7.1.12", + "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.1.12.tgz", + "integrity": "sha512-wMTHiiTiBAAPebqaPiPDLFA4LYPKr6Ph0Xq/6rq1Ur3v66HXyG+clfR9CNETkD7MQS8ZHvpQOtA53DLws5WAEQ==", + "dev": true, + "dependencies": { + "@babel/parser": "^7.1.0", + "@babel/types": "^7.0.0", + "@types/babel__generator": "*", + "@types/babel__template": "*", + "@types/babel__traverse": "*" + } + }, + "node_modules/@types/babel__generator": { + "version": "7.6.2", + "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.6.2.tgz", + "integrity": "sha512-MdSJnBjl+bdwkLskZ3NGFp9YcXGx5ggLpQQPqtgakVhsWK0hTtNYhjpZLlWQTviGTvF8at+Bvli3jV7faPdgeQ==", + "dev": true, + "dependencies": { + "@babel/types": "^7.0.0" + } + }, + "node_modules/@types/babel__template": { + "version": "7.4.0", + "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.4.0.tgz", + "integrity": "sha512-NTPErx4/FiPCGScH7foPyr+/1Dkzkni+rHiYHHoTjvwou7AQzJkNeD60A9CXRy+ZEN2B1bggmkTMCDb+Mv5k+A==", + "dev": true, + "dependencies": { + "@babel/parser": "^7.1.0", + "@babel/types": "^7.0.0" + } + }, + "node_modules/@types/babel__traverse": { + "version": "7.11.0", + "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.11.0.tgz", + "integrity": "sha512-kSjgDMZONiIfSH1Nxcr5JIRMwUetDki63FSQfpTCz8ogF3Ulqm8+mr5f78dUYs6vMiB6gBusQqfQmBvHZj/lwg==", + "dev": true, + "dependencies": { + "@babel/types": "^7.3.0" + } + }, + "node_modules/@types/graceful-fs": { + "version": "4.1.4", + "resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.4.tgz", + "integrity": "sha512-mWA/4zFQhfvOA8zWkXobwJvBD7vzcxgrOQ0J5CH1votGqdq9m7+FwtGaqyCZqC3NyyBkc9z4m+iry4LlqcMWJg==", + "dev": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/istanbul-lib-coverage": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.3.tgz", + "integrity": "sha512-sz7iLqvVUg1gIedBOvlkxPlc8/uVzyS5OwGz1cKjXzkl3FpL3al0crU8YGU1WoHkxn0Wxbw5tyi6hvzJKNzFsw==", + "dev": true + }, + "node_modules/@types/istanbul-lib-report": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz", + "integrity": "sha512-plGgXAPfVKFoYfa9NpYDAkseG+g6Jr294RqeqcqDixSbU34MZVJRi/P+7Y8GDpzkEwLaGZZOpKIEmeVZNtKsrg==", + "dev": true, + "dependencies": { + "@types/istanbul-lib-coverage": "*" + } + }, + "node_modules/@types/istanbul-reports": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-3.0.0.tgz", + "integrity": "sha512-nwKNbvnwJ2/mndE9ItP/zc2TCzw6uuodnF4EHYWD+gCQDVBuRQL5UzbZD0/ezy1iKsFU2ZQiDqg4M9dN4+wZgA==", + "dev": true, + "dependencies": { + "@types/istanbul-lib-report": "*" + } + }, + "node_modules/@types/node": { + "version": "14.14.22", + "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.22.tgz", + "integrity": "sha512-g+f/qj/cNcqKkc3tFqlXOYjrmZA+jNBiDzbP3kH+B+otKFqAdPgVTGP1IeKRdMml/aE69as5S4FqtxAbl+LaMw==", + "dev": true + }, + "node_modules/@types/normalize-package-data": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.0.tgz", + "integrity": "sha512-f5j5b/Gf71L+dbqxIpQ4Z2WlmI/mPJ0fOkGGmFgtb6sAu97EPczzbS3/tJKxmcYDj55OX6ssqwDAWOHIYDRDGA==", + "dev": true + }, + "node_modules/@types/parse-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==", + "dev": true + }, + "node_modules/@types/prettier": { + "version": "2.1.6", + "resolved": "https://registry.npmjs.org/@types/prettier/-/prettier-2.1.6.tgz", + "integrity": "sha512-6gOkRe7OIioWAXfnO/2lFiv+SJichKVSys1mSsgyrYHSEjk8Ctv4tSR/Odvnu+HWlH2C8j53dahU03XmQdd5fA==", + "dev": true + }, + "node_modules/@types/stack-utils": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.0.tgz", + "integrity": "sha512-RJJrrySY7A8havqpGObOB4W92QXKJo63/jFLLgpvOtsGUqbQZ9Sbgl35KMm1DjC6j7AvmmU2bIno+3IyEaemaw==", + "dev": true + }, + "node_modules/@types/yargs": { + "version": "15.0.12", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-15.0.12.tgz", + "integrity": "sha512-f+fD/fQAo3BCbCDlrUpznF1A5Zp9rB0noS5vnoormHSIPFKL0Z2DcUJ3Gxp5ytH4uLRNxy7AwYUC9exZzqGMAw==", + "dev": true, + "dependencies": { + "@types/yargs-parser": "*" + } + }, + "node_modules/@types/yargs-parser": { + "version": "20.2.0", + "resolved": "https://registry.npmjs.org/@types/yargs-parser/-/yargs-parser-20.2.0.tgz", + "integrity": "sha512-37RSHht+gzzgYeobbG+KWryeAW8J33Nhr69cjTqSYymXVZEN9NbRYWoYlRtDhHKPVT1FyNKwaTPC1NynKZpzRA==", + "dev": true + }, + "node_modules/abab": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/abab/-/abab-2.0.5.tgz", + "integrity": "sha512-9IK9EadsbHo6jLWIpxpR6pL0sazTXV6+SQv25ZB+F7Bj9mJNaOc4nCRabwd5M/JwmUa8idz6Eci6eKfJryPs6Q==", + "dev": true + }, + "node_modules/abbrev": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", + "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", + "dev": true, + "optional": true, + "peer": true + }, + "node_modules/acorn": { + "version": "7.4.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.1.tgz", + "integrity": "sha512-nQyp0o1/mNdbTO1PO6kHkwSrmgZ0MT/jCCpNiwbUjGoRN4dlBhqJtoQuCnEOKzgTVwg0ZWiCoQy6SxMebQVh8A==", + "dev": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-globals": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-6.0.0.tgz", + "integrity": "sha512-ZQl7LOWaF5ePqqcX4hLuv/bLXYQNfNWw2c0/yX/TsPRKamzHcTGQnlCjHT3TsmkOUVEPS3crCxiPfdzE/Trlhg==", + "dev": true, + "dependencies": { + "acorn": "^7.1.1", + "acorn-walk": "^7.1.1" + } + }, + "node_modules/acorn-walk": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-7.2.0.tgz", + "integrity": "sha512-OPdCF6GsMIP+Az+aWfAAOEt2/+iVDKE7oy6lJ098aoe59oAmK76qV6Gw60SbZ8jHuG2wH058GF4pLFbYamYrVA==", + "dev": true, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/agent-base": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "dev": true, + "optional": true, + "peer": true, + "dependencies": { + "debug": "4" + }, + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/aggregate-error": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", + "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", + "dev": true, + "dependencies": { + "clean-stack": "^2.0.0", + "indent-string": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ansi-colors": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", + "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/ansi-escapes": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.1.tgz", + "integrity": "sha512-JWF7ocqNrp8u9oqpgV+wH5ftbt+cfvv+PTjOvKLT3AdYly/LmORARfEVT1iyjwN+4MqE5UmVKoAdIBqeoCHgLA==", + "dev": true, + "dependencies": { + "type-fest": "^0.11.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ansi-escapes/node_modules/type-fest": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.11.0.tgz", + "integrity": "sha512-OdjXJxnCN1AvyLSzeKIgXTXxV+99ZuXl3Hpo9XpJAv9MBcHrrJOQ5kV7ypXOuQie+AmWG25hLbiKdwYTifzcfQ==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/anymatch": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.1.tgz", + "integrity": "sha512-mM8522psRCqzV+6LhomX5wgp25YVibjh8Wj23I5RPkPppSVSjyKD2A2mBJmWGa+KN7f2D6LNh9jkBCeyLktzjg==", + "dev": true, + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/aproba": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/aproba/-/aproba-2.0.0.tgz", + "integrity": "sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==", + "dev": true, + "optional": true, + "peer": true + }, + "node_modules/are-we-there-yet": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-2.0.0.tgz", + "integrity": "sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw==", + "dev": true, + "optional": true, + "peer": true, + "dependencies": { + "delegates": "^1.0.0", + "readable-stream": "^3.6.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "dependencies": { + "sprintf-js": "~1.0.2" + } + }, + "node_modules/arr-diff": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", + "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/arr-flatten": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", + "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/arr-union": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", + "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/array-unique": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", + "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/asn1": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", + "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", + "dev": true, + "dependencies": { + "safer-buffer": "~2.1.0" + } + }, + "node_modules/assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "dev": true, + "engines": { + "node": ">=0.8" + } + }, + "node_modules/assign-symbols": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", + "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/astral-regex": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", + "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", + "dev": true + }, + "node_modules/atob": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", + "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==", + "dev": true, + "bin": { + "atob": "bin/atob.js" + }, + "engines": { + "node": ">= 4.5.0" + } + }, + "node_modules/aws-sign2": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", + "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=", + "dev": true, + "engines": { + "node": "*" + } + }, + "node_modules/aws4": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.11.0.tgz", + "integrity": "sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA==", + "dev": true + }, + "node_modules/babel-jest": { + "version": "26.6.3", + "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-26.6.3.tgz", + "integrity": "sha512-pl4Q+GAVOHwvjrck6jKjvmGhnO3jHX/xuB9d27f+EJZ/6k+6nMuPjorrYp7s++bKKdANwzElBWnLWaObvTnaZA==", + "dev": true, + "dependencies": { + "@jest/transform": "^26.6.2", + "@jest/types": "^26.6.2", + "@types/babel__core": "^7.1.7", + "babel-plugin-istanbul": "^6.0.0", + "babel-preset-jest": "^26.6.2", + "chalk": "^4.0.0", + "graceful-fs": "^4.2.4", + "slash": "^3.0.0" + }, + "engines": { + "node": ">= 10.14.2" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/babel-plugin-istanbul": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-6.0.0.tgz", + "integrity": "sha512-AF55rZXpe7trmEylbaE1Gv54wn6rwU03aptvRoVIGP8YykoSxqdVLV1TfwflBCE/QtHmqtP8SWlTENqbK8GCSQ==", + "dev": true, + "dependencies": { + "@babel/helper-plugin-utils": "^7.0.0", + "@istanbuljs/load-nyc-config": "^1.0.0", + "@istanbuljs/schema": "^0.1.2", + "istanbul-lib-instrument": "^4.0.0", + "test-exclude": "^6.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/babel-plugin-jest-hoist": { + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-26.6.2.tgz", + "integrity": "sha512-PO9t0697lNTmcEHH69mdtYiOIkkOlj9fySqfO3K1eCcdISevLAE0xY59VLLUj0SoiPiTX/JU2CYFpILydUa5Lw==", + "dev": true, + "dependencies": { + "@babel/template": "^7.3.3", + "@babel/types": "^7.3.3", + "@types/babel__core": "^7.0.0", + "@types/babel__traverse": "^7.0.6" + }, + "engines": { + "node": ">= 10.14.2" + } + }, + "node_modules/babel-preset-current-node-syntax": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.0.1.tgz", + "integrity": "sha512-M7LQ0bxarkxQoN+vz5aJPsLBn77n8QgTFmo8WK0/44auK2xlCXrYcUxHFxgU7qW5Yzw/CjmLRK2uJzaCd7LvqQ==", + "dev": true, + "dependencies": { + "@babel/plugin-syntax-async-generators": "^7.8.4", + "@babel/plugin-syntax-bigint": "^7.8.3", + "@babel/plugin-syntax-class-properties": "^7.8.3", + "@babel/plugin-syntax-import-meta": "^7.8.3", + "@babel/plugin-syntax-json-strings": "^7.8.3", + "@babel/plugin-syntax-logical-assignment-operators": "^7.8.3", + "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3", + "@babel/plugin-syntax-numeric-separator": "^7.8.3", + "@babel/plugin-syntax-object-rest-spread": "^7.8.3", + "@babel/plugin-syntax-optional-catch-binding": "^7.8.3", + "@babel/plugin-syntax-optional-chaining": "^7.8.3", + "@babel/plugin-syntax-top-level-await": "^7.8.3" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/babel-preset-jest": { + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-26.6.2.tgz", + "integrity": "sha512-YvdtlVm9t3k777c5NPQIv6cxFFFapys25HiUmuSgHwIZhfifweR5c5Sf5nwE3MAbfu327CYSvps8Yx6ANLyleQ==", + "dev": true, + "dependencies": { + "babel-plugin-jest-hoist": "^26.6.2", + "babel-preset-current-node-syntax": "^1.0.0" + }, + "engines": { + "node": ">= 10.14.2" + }, + "peerDependencies": { + "@babel/core": "^7.0.0" + } + }, + "node_modules/balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "dev": true + }, + "node_modules/base": { + "version": "0.11.2", + "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", + "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", + "dev": true, + "dependencies": { + "cache-base": "^1.0.1", + "class-utils": "^0.3.5", + "component-emitter": "^1.2.1", + "define-property": "^1.0.0", + "isobject": "^3.0.1", + "mixin-deep": "^1.2.0", + "pascalcase": "^0.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/base/node_modules/define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "dependencies": { + "is-descriptor": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/base/node_modules/is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "dependencies": { + "kind-of": "^6.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/base/node_modules/is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "dependencies": { + "kind-of": "^6.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/base/node_modules/is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "dependencies": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/base/node_modules/is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "dev": true, + "dependencies": { + "is-plain-object": "^2.0.4" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/base/node_modules/mixin-deep": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz", + "integrity": "sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA==", + "dev": true, + "dependencies": { + "for-in": "^1.0.2", + "is-extendable": "^1.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/bcrypt-pbkdf": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", + "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", + "dev": true, + "dependencies": { + "tweetnacl": "^0.14.3" + } + }, + "node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "dependencies": { + "fill-range": "^7.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/browser-process-hrtime": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/browser-process-hrtime/-/browser-process-hrtime-1.0.0.tgz", + "integrity": "sha512-9o5UecI3GhkpM6DrXr69PblIuWxPKk9Y0jHBRhdocZ2y7YECBFCsHm79Pr3OyR2AvjhDkabFJaDJMYRazHgsow==", + "dev": true + }, + "node_modules/bser": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/bser/-/bser-2.1.1.tgz", + "integrity": "sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ==", + "dev": true, + "dependencies": { + "node-int64": "^0.4.0" + } + }, + "node_modules/buffer-from": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", + "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", + "dev": true + }, + "node_modules/bufferutil": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/bufferutil/-/bufferutil-4.0.3.tgz", + "integrity": "sha512-yEYTwGndELGvfXsImMBLop58eaGW+YdONi1fNjTINSY98tmMmFijBG6WXgdkfuLNt4imzQNtIE+eBp1PVpMCSw==", + "dev": true, + "hasInstallScript": true, + "optional": true, + "peer": true, + "dependencies": { + "node-gyp-build": "^4.2.0" + } + }, + "node_modules/cache-base": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", + "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", + "dev": true, + "dependencies": { + "collection-visit": "^1.0.0", + "component-emitter": "^1.2.1", + "get-value": "^2.0.6", + "has-value": "^1.0.0", + "isobject": "^3.0.1", + "set-value": "^2.0.0", + "to-object-path": "^0.3.0", + "union-value": "^1.0.0", + "unset-value": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/cache-base/node_modules/extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "dependencies": { + "is-extendable": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/cache-base/node_modules/set-value": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz", + "integrity": "sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==", + "dev": true, + "dependencies": { + "extend-shallow": "^2.0.1", + "is-extendable": "^0.1.1", + "is-plain-object": "^2.0.3", + "split-string": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/canvas": { + "version": "2.11.2", + "resolved": "https://registry.npmjs.org/canvas/-/canvas-2.11.2.tgz", + "integrity": "sha512-ItanGBMrmRV7Py2Z+Xhs7cT+FNt5K0vPL4p9EZ/UX/Mu7hFbkxSjKF2KVtPwX7UYWp7dRKnrTvReflgrItJbdw==", + "dev": true, + "hasInstallScript": true, + "optional": true, + "peer": true, + "dependencies": { + "@mapbox/node-pre-gyp": "^1.0.0", + "nan": "^2.17.0", + "simple-get": "^3.0.3" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/capture-exit": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/capture-exit/-/capture-exit-2.0.0.tgz", + "integrity": "sha512-PiT/hQmTonHhl/HFGN+Lx3JJUznrVYJ3+AQsnthneZbvW7x+f08Tk7yLJTLEOUvBTbduLeeBkxEaYXUOUrRq6g==", + "dev": true, + "dependencies": { + "rsvp": "^4.8.4" + }, + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "node_modules/caseless": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", + "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=", + "dev": true + }, + "node_modules/chalk": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", + "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/char-regex": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/char-regex/-/char-regex-1.0.2.tgz", + "integrity": "sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/chownr": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", + "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==", + "dev": true, + "optional": true, + "peer": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/ci-info": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz", + "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==", + "dev": true + }, + "node_modules/cjs-module-lexer": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-0.6.0.tgz", + "integrity": "sha512-uc2Vix1frTfnuzxxu1Hp4ktSvM3QaI4oXl4ZUqL1wjTu/BGki9TrCWoqLTg/drR1KwAEarXuRFCG2Svr1GxPFw==", + "dev": true + }, + "node_modules/class-utils": { + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", + "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", + "dev": true, + "dependencies": { + "arr-union": "^3.1.0", + "define-property": "^0.2.5", + "isobject": "^3.0.0", + "static-extend": "^0.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/class-utils/node_modules/define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "dependencies": { + "is-descriptor": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/clean-stack": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", + "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/cli-cursor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", + "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==", + "dev": true, + "dependencies": { + "restore-cursor": "^3.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/cli-truncate": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cli-truncate/-/cli-truncate-2.1.0.tgz", + "integrity": "sha512-n8fOixwDD6b/ObinzTrp1ZKFzbgvKZvuz/TvejnLn1aQfC6r52XEx85FmuC+3HI+JM7coBRXUvNqEU2PHVrHpg==", + "dev": true, + "dependencies": { + "slice-ansi": "^3.0.0", + "string-width": "^4.2.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/cliui": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", + "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", + "dev": true, + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^6.2.0" + } + }, + "node_modules/co": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", + "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=", + "dev": true, + "engines": { + "iojs": ">= 1.0.0", + "node": ">= 0.12.0" + } + }, + "node_modules/collect-v8-coverage": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/collect-v8-coverage/-/collect-v8-coverage-1.0.1.tgz", + "integrity": "sha512-iBPtljfCNcTKNAto0KEtDfZ3qzjJvqE3aTGZsbhjSBlorqpXJlaWWtPO35D+ZImoC3KWejX64o+yPGxhWSTzfg==", + "dev": true + }, + "node_modules/collection-visit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", + "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=", + "dev": true, + "dependencies": { + "map-visit": "^1.0.0", + "object-visit": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/color-support": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz", + "integrity": "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==", + "dev": true, + "optional": true, + "peer": true, + "bin": { + "color-support": "bin.js" + } + }, + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dev": true, + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/commander": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-6.2.1.tgz", + "integrity": "sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA==", + "dev": true, + "engines": { + "node": ">= 6" + } + }, + "node_modules/compare-versions": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/compare-versions/-/compare-versions-3.6.0.tgz", + "integrity": "sha512-W6Af2Iw1z4CB7q4uU4hv646dW9GQuBM+YpC0UvUCWSD8w90SJjp+ujJuXaEMtAXBtSqGfMPuFOVn4/+FlaqfBA==", + "dev": true + }, + "node_modules/component-emitter": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", + "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==", + "dev": true + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "dev": true + }, + "node_modules/console-control-strings": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", + "integrity": "sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==", + "dev": true, + "optional": true, + "peer": true + }, + "node_modules/convert-source-map": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.7.0.tgz", + "integrity": "sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA==", + "dev": true, + "dependencies": { + "safe-buffer": "~5.1.1" + } + }, + "node_modules/convert-source-map/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, + "node_modules/copy-descriptor": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", + "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", + "dev": true + }, + "node_modules/cosmiconfig": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.0.0.tgz", + "integrity": "sha512-pondGvTuVYDk++upghXJabWzL6Kxu6f26ljFw64Swq9v6sQPUL3EUlVDV56diOjpCayKihL6hVe8exIACU4XcA==", + "dev": true, + "dependencies": { + "@types/parse-json": "^4.0.0", + "import-fresh": "^3.2.1", + "parse-json": "^5.0.0", + "path-type": "^4.0.0", + "yaml": "^1.10.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/coveralls": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/coveralls/-/coveralls-3.1.0.tgz", + "integrity": "sha512-sHxOu2ELzW8/NC1UP5XVLbZDzO4S3VxfFye3XYCznopHy02YjNkHcj5bKaVw2O7hVaBdBjEdQGpie4II1mWhuQ==", + "dev": true, + "dependencies": { + "js-yaml": "^3.13.1", + "lcov-parse": "^1.0.0", + "log-driver": "^1.2.7", + "minimist": "^1.2.5", + "request": "^2.88.2" + }, + "bin": { + "coveralls": "bin/coveralls.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/cross-fetch": { + "version": "3.1.6", + "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.1.6.tgz", + "integrity": "sha512-riRvo06crlE8HiqOwIpQhxwdOk4fOeR7FVM/wXoxchFEqMNUjvbs3bfo4OTgMEMHzppd4DxFBDbyySj8Cv781g==", + "dev": true, + "dependencies": { + "node-fetch": "^2.6.11" + } + }, + "node_modules/cross-spawn": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "dev": true, + "dependencies": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + }, + "engines": { + "node": ">=4.8" + } + }, + "node_modules/cross-spawn/node_modules/semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true, + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/cssom": { + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.4.4.tgz", + "integrity": "sha512-p3pvU7r1MyyqbTk+WbNJIgJjG2VmTIaB10rI93LzVPrmDJKkzKYMtxxyAvQXR/NS6otuzveI7+7BBq3SjBS2mw==", + "dev": true + }, + "node_modules/cssstyle": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-2.3.0.tgz", + "integrity": "sha512-AZL67abkUzIuvcHqk7c09cezpGNcxUxU4Ioi/05xHk4DQeTkWmGYftIE6ctU6AEt+Gn4n1lDStOtj7FKycP71A==", + "dev": true, + "dependencies": { + "cssom": "~0.3.6" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/cssstyle/node_modules/cssom": { + "version": "0.3.8", + "resolved": "https://registry.npmjs.org/cssom/-/cssom-0.3.8.tgz", + "integrity": "sha512-b0tGHbfegbhPJpxpiBPU2sCkigAqtM9O121le6bbOlgyV+NyGyCmVfJ6QW9eRjz8CpNfWEOYBIMIGRYkLwsIYg==", + "dev": true + }, + "node_modules/dashdash": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", + "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", + "dev": true, + "dependencies": { + "assert-plus": "^1.0.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/data-urls": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/data-urls/-/data-urls-2.0.0.tgz", + "integrity": "sha512-X5eWTSXO/BJmpdIKCRuKUgSCgAN0OwliVK3yPKbwIWU1Tdw5BRajxlzMidvh+gwko9AfQ9zIj52pzF91Q3YAvQ==", + "dev": true, + "dependencies": { + "abab": "^2.0.3", + "whatwg-mimetype": "^2.3.0", + "whatwg-url": "^8.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/debug": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", + "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", + "dev": true, + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/decimal.js": { + "version": "10.2.1", + "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.2.1.tgz", + "integrity": "sha512-KaL7+6Fw6i5A2XSnsbhm/6B+NuEA7TZ4vqxnd5tXz9sbKtrN9Srj8ab4vKVdK8YAqZO9P1kg45Y6YLoduPf+kw==", + "dev": true + }, + "node_modules/decode-uri-component": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", + "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=", + "dev": true, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/decompress-response": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-4.2.1.tgz", + "integrity": "sha512-jOSne2qbyE+/r8G1VU+G/82LBs2Fs4LAsTiLSHOCOMZQl2OKZ6i8i4IyHemTe+/yIXOtTcRQMzPcgyhoFlqPkw==", + "dev": true, + "optional": true, + "peer": true, + "dependencies": { + "mimic-response": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/dedent": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/dedent/-/dedent-0.7.0.tgz", + "integrity": "sha1-JJXduvbrh0q7Dhvp3yLS5aVEMmw=", + "dev": true + }, + "node_modules/deep-is": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", + "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", + "dev": true + }, + "node_modules/deepmerge": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.2.2.tgz", + "integrity": "sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/define-property": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", + "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", + "dev": true, + "dependencies": { + "is-descriptor": "^1.0.2", + "isobject": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/define-property/node_modules/is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "dependencies": { + "kind-of": "^6.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/define-property/node_modules/is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "dependencies": { + "kind-of": "^6.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/define-property/node_modules/is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "dependencies": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", + "dev": true, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/delegates": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", + "integrity": "sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==", + "dev": true, + "optional": true, + "peer": true + }, + "node_modules/detect-libc": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.1.tgz", + "integrity": "sha512-463v3ZeIrcWtdgIg6vI6XUncguvr2TnGl4SzDXinkt9mSLpBJKXT3mW6xT3VQdDN11+WVs29pgvivTc4Lp8v+w==", + "dev": true, + "optional": true, + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/detect-newline": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-3.1.0.tgz", + "integrity": "sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/diff-sequences": { + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-26.6.2.tgz", + "integrity": "sha512-Mv/TDa3nZ9sbc5soK+OoA74BsS3mL37yixCvUAQkiuA4Wz6YtwP/K47n2rv2ovzHZvoiQeA5FTQOschKkEwB0Q==", + "dev": true, + "engines": { + "node": ">= 10.14.2" + } + }, + "node_modules/domexception": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/domexception/-/domexception-2.0.1.tgz", + "integrity": "sha512-yxJ2mFy/sibVQlu5qHjOkf9J3K6zgmCxgJ94u2EdvDOV09H+32LtRswEcUsmUWN72pVLOEnTSRaIVVzVQgS0dg==", + "dev": true, + "dependencies": { + "webidl-conversions": "^5.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/domexception/node_modules/webidl-conversions": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-5.0.0.tgz", + "integrity": "sha512-VlZwKPCkYKxQgeSbH5EyngOmRp7Ww7I9rQLERETtf5ofd9pGeswWiOtogpEO850jziPRarreGxn5QIiTqpb2wA==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/ecc-jsbn": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", + "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", + "dev": true, + "dependencies": { + "jsbn": "~0.1.0", + "safer-buffer": "^2.1.0" + } + }, + "node_modules/emittery": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/emittery/-/emittery-0.7.2.tgz", + "integrity": "sha512-A8OG5SR/ij3SsJdWDJdkkSYUjQdCUx6APQXem0SaEePBSRg4eymGYwBkKo1Y6DU+af/Jn2dBQqDBvjnr9Vi8nQ==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sindresorhus/emittery?sponsor=1" + } + }, + "node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "node_modules/end-of-stream": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", + "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", + "dev": true, + "dependencies": { + "once": "^1.4.0" + } + }, + "node_modules/enquirer": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz", + "integrity": "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==", + "dev": true, + "dependencies": { + "ansi-colors": "^4.1.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "dev": true, + "dependencies": { + "is-arrayish": "^0.2.1" + } + }, + "node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/escodegen": { + "version": "1.14.3", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.14.3.tgz", + "integrity": "sha512-qFcX0XJkdg+PB3xjZZG/wKSuT1PnQWx57+TVSjIMmILd2yC/6ByYElPwJnslDsuWuSAp4AwJGumarAAmJch5Kw==", + "dev": true, + "dependencies": { + "esprima": "^4.0.1", + "estraverse": "^4.2.0", + "esutils": "^2.0.2", + "optionator": "^0.8.1" + }, + "bin": { + "escodegen": "bin/escodegen.js", + "esgenerate": "bin/esgenerate.js" + }, + "engines": { + "node": ">=4.0" + }, + "optionalDependencies": { + "source-map": "~0.6.1" + } + }, + "node_modules/esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true, + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/exec-sh": { + "version": "0.3.4", + "resolved": "https://registry.npmjs.org/exec-sh/-/exec-sh-0.3.4.tgz", + "integrity": "sha512-sEFIkc61v75sWeOe72qyrqg2Qg0OuLESziUDk/O/z2qgS15y2gWVFrI6f2Qn/qw/0/NCfCEsmNA4zOjkwEZT1A==", + "dev": true + }, + "node_modules/execa": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz", + "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==", + "dev": true, + "dependencies": { + "cross-spawn": "^6.0.0", + "get-stream": "^4.0.0", + "is-stream": "^1.1.0", + "npm-run-path": "^2.0.0", + "p-finally": "^1.0.0", + "signal-exit": "^3.0.0", + "strip-eof": "^1.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/exit": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/exit/-/exit-0.1.2.tgz", + "integrity": "sha1-BjJjj42HfMghB9MKD/8aF8uhzQw=", + "dev": true, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/expand-brackets": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", + "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", + "dev": true, + "dependencies": { + "debug": "^2.3.3", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "posix-character-classes": "^0.1.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/expand-brackets/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/expand-brackets/node_modules/define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "dependencies": { + "is-descriptor": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/expand-brackets/node_modules/extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "dependencies": { + "is-extendable": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/expand-brackets/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "node_modules/expect": { + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/expect/-/expect-26.6.2.tgz", + "integrity": "sha512-9/hlOBkQl2l/PLHJx6JjoDF6xPKcJEsUlWKb23rKE7KzeDqUZKXKNMW27KIue5JMdBV9HgmoJPcc8HtO85t9IA==", + "dev": true, + "dependencies": { + "@jest/types": "^26.6.2", + "ansi-styles": "^4.0.0", + "jest-get-type": "^26.3.0", + "jest-matcher-utils": "^26.6.2", + "jest-message-util": "^26.6.2", + "jest-regex-util": "^26.0.0" + }, + "engines": { + "node": ">= 10.14.2" + } + }, + "node_modules/extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", + "dev": true + }, + "node_modules/extend-shallow": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", + "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", + "dev": true, + "dependencies": { + "assign-symbols": "^1.0.0", + "is-extendable": "^1.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/extend-shallow/node_modules/is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "dev": true, + "dependencies": { + "is-plain-object": "^2.0.4" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/extglob": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", + "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", + "dev": true, + "dependencies": { + "array-unique": "^0.3.2", + "define-property": "^1.0.0", + "expand-brackets": "^2.1.4", + "extend-shallow": "^2.0.1", + "fragment-cache": "^0.2.1", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/extglob/node_modules/define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "dependencies": { + "is-descriptor": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/extglob/node_modules/extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "dependencies": { + "is-extendable": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/extglob/node_modules/is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "dependencies": { + "kind-of": "^6.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/extglob/node_modules/is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "dependencies": { + "kind-of": "^6.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/extglob/node_modules/is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "dependencies": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/extsprintf": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", + "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=", + "dev": true, + "engines": [ + "node >=0.6.0" + ] + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true + }, + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true + }, + "node_modules/fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", + "dev": true + }, + "node_modules/fb-watchman": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.1.tgz", + "integrity": "sha512-DkPJKQeY6kKwmuMretBhr7G6Vodr7bFwDYTXIkfG1gjvNpaxBTQV3PbXg6bR1c1UP4jPOX0jHUbbHANL9vRjVg==", + "dev": true, + "dependencies": { + "bser": "2.1.1" + } + }, + "node_modules/figures": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", + "integrity": "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==", + "dev": true, + "dependencies": { + "escape-string-regexp": "^1.0.5" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/find-versions": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/find-versions/-/find-versions-4.0.0.tgz", + "integrity": "sha512-wgpWy002tA+wgmO27buH/9KzyEOQnKsG/R0yrcjPT9BOFm0zRBVQbZ95nRGXWMywS8YR5knRbpohio0bcJABxQ==", + "dev": true, + "dependencies": { + "semver-regex": "^3.1.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/for-in": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", + "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/forever-agent": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", + "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", + "dev": true, + "engines": { + "node": "*" + } + }, + "node_modules/fragment-cache": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", + "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", + "dev": true, + "dependencies": { + "map-cache": "^0.2.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/fs-minipass": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", + "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==", + "dev": true, + "optional": true, + "peer": true, + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/fs-minipass/node_modules/minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "dev": true, + "optional": true, + "peer": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "node_modules/fsevents": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.1.tgz", + "integrity": "sha512-YR47Eg4hChJGAB1O3yEAOkGO+rlzutoICGqGo9EZ4lKWokzZRSyIW1QmTzqjtw8MJdj9srP869CuWw/hyzSiBw==", + "dev": true, + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true + }, + "node_modules/gauge": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/gauge/-/gauge-3.0.2.tgz", + "integrity": "sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q==", + "dev": true, + "optional": true, + "peer": true, + "dependencies": { + "aproba": "^1.0.3 || ^2.0.0", + "color-support": "^1.1.2", + "console-control-strings": "^1.0.0", + "has-unicode": "^2.0.1", + "object-assign": "^4.1.1", + "signal-exit": "^3.0.0", + "string-width": "^4.2.3", + "strip-ansi": "^6.0.1", + "wide-align": "^1.1.2" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/gensync": { + "version": "1.0.0-beta.2", + "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", + "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", + "dev": true, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true, + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "node_modules/get-own-enumerable-property-symbols": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/get-own-enumerable-property-symbols/-/get-own-enumerable-property-symbols-3.0.2.tgz", + "integrity": "sha512-I0UBV/XOz1XkIJHEUDMZAbzCThU/H8DxmSfmdGcKPnVhu2VfFqr34jr9777IyaTYvxjedWhqVIilEDsCdP5G6g==", + "dev": true + }, + "node_modules/get-package-type": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", + "integrity": "sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==", + "dev": true, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/get-stream": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", + "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", + "dev": true, + "dependencies": { + "pump": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/get-value": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", + "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/getpass": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", + "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", + "dev": true, + "dependencies": { + "assert-plus": "^1.0.0" + } + }, + "node_modules/glob": { + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/globals": { + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", + "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==", + "dev": true + }, + "node_modules/growly": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/growly/-/growly-1.3.0.tgz", + "integrity": "sha1-8QdIy+dq+WS3yWyTxrzCivEgwIE=", + "dev": true, + "optional": true + }, + "node_modules/har-schema": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", + "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/har-validator": { + "version": "5.1.5", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.5.tgz", + "integrity": "sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==", + "deprecated": "this library is no longer supported", + "dev": true, + "dependencies": { + "ajv": "^6.12.3", + "har-schema": "^2.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dev": true, + "dependencies": { + "function-bind": "^1.1.1" + }, + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/has-unicode": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", + "integrity": "sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==", + "dev": true, + "optional": true, + "peer": true + }, + "node_modules/has-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", + "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", + "dev": true, + "dependencies": { + "get-value": "^2.0.6", + "has-values": "^1.0.0", + "isobject": "^3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/has-values": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz", + "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=", + "dev": true, + "dependencies": { + "is-number": "^3.0.0", + "kind-of": "^4.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/has-values/node_modules/is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, + "dependencies": { + "kind-of": "^3.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/has-values/node_modules/is-number/node_modules/kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "dependencies": { + "is-buffer": "^1.1.5" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/has-values/node_modules/kind-of": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", + "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", + "dev": true, + "dependencies": { + "is-buffer": "^1.1.5" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/hosted-git-info": { + "version": "2.8.8", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", + "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", + "dev": true + }, + "node_modules/html-encoding-sniffer": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-2.0.1.tgz", + "integrity": "sha512-D5JbOMBIR/TVZkubHT+OyT2705QvogUW4IBn6nHd756OwieSF9aDYFj4dv6HHEVGYbHaLETa3WggZYWWMyy3ZQ==", + "dev": true, + "dependencies": { + "whatwg-encoding": "^1.0.5" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/html-escaper": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", + "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", + "dev": true + }, + "node_modules/http-signature": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", + "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", + "dev": true, + "dependencies": { + "assert-plus": "^1.0.0", + "jsprim": "^1.2.2", + "sshpk": "^1.7.0" + }, + "engines": { + "node": ">=0.8", + "npm": ">=1.3.7" + } + }, + "node_modules/https-proxy-agent": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", + "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", + "dev": true, + "optional": true, + "peer": true, + "dependencies": { + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/human-signals": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-1.1.1.tgz", + "integrity": "sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw==", + "dev": true, + "engines": { + "node": ">=8.12.0" + } + }, + "node_modules/husky": { + "version": "4.3.8", + "resolved": "https://registry.npmjs.org/husky/-/husky-4.3.8.tgz", + "integrity": "sha512-LCqqsB0PzJQ/AlCgfrfzRe3e3+NvmefAdKQhRYpxS4u6clblBoDdzzvHi8fmxKRzvMxPY/1WZWzomPZww0Anow==", + "dev": true, + "hasInstallScript": true, + "dependencies": { + "chalk": "^4.0.0", + "ci-info": "^2.0.0", + "compare-versions": "^3.6.0", + "cosmiconfig": "^7.0.0", + "find-versions": "^4.0.0", + "opencollective-postinstall": "^2.0.2", + "pkg-dir": "^5.0.0", + "please-upgrade-node": "^3.2.0", + "slash": "^3.0.0", + "which-pm-runs": "^1.0.0" + }, + "bin": { + "husky-run": "bin/run.js", + "husky-upgrade": "lib/upgrader/bin.js" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/husky" + } + }, + "node_modules/iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "dev": true, + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/import-fresh": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", + "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", + "dev": true, + "dependencies": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/import-local": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.0.2.tgz", + "integrity": "sha512-vjL3+w0oulAVZ0hBHnxa/Nm5TAurf9YLQJDhqRZyqb+VKGOB6LU8t9H1Nr5CIo16vh9XfJTOoHwU0B71S557gA==", + "dev": true, + "dependencies": { + "pkg-dir": "^4.2.0", + "resolve-cwd": "^3.0.0" + }, + "bin": { + "import-local-fixture": "fixtures/cli.js" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/import-local/node_modules/find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "dependencies": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/import-local/node_modules/locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "dependencies": { + "p-locate": "^4.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/import-local/node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/import-local/node_modules/p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "dependencies": { + "p-limit": "^2.2.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/import-local/node_modules/pkg-dir": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", + "dev": true, + "dependencies": { + "find-up": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "dev": true, + "engines": { + "node": ">=0.8.19" + } + }, + "node_modules/indent-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "node_modules/ip-regex": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/ip-regex/-/ip-regex-2.1.0.tgz", + "integrity": "sha1-+ni/XS5pE8kRzp+BnuUUa7bYROk=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "dev": true, + "dependencies": { + "kind-of": "^3.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-accessor-descriptor/node_modules/kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "dependencies": { + "is-buffer": "^1.1.5" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", + "dev": true + }, + "node_modules/is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true + }, + "node_modules/is-ci": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-2.0.0.tgz", + "integrity": "sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w==", + "dev": true, + "dependencies": { + "ci-info": "^2.0.0" + }, + "bin": { + "is-ci": "bin.js" + } + }, + "node_modules/is-core-module": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.2.0.tgz", + "integrity": "sha512-XRAfAdyyY5F5cOXn7hYQDqh2Xmii+DEfIcQGxK/uNwMHhIkPWO0g8msXcbzLe+MpGoR951MlqM/2iIlU4vKDdQ==", + "dev": true, + "dependencies": { + "has": "^1.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "dev": true, + "dependencies": { + "kind-of": "^3.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-data-descriptor/node_modules/kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "dependencies": { + "is-buffer": "^1.1.5" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "dev": true, + "dependencies": { + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-descriptor/node_modules/kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-docker": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.1.1.tgz", + "integrity": "sha512-ZOoqiXfEwtGknTiuDEy8pN2CfE3TxMHprvNer1mXiqwkOT77Rw3YVrUQ52EqAOU3QAWDQ+bQdx7HJzrv7LS2Hw==", + "dev": true, + "optional": true, + "bin": { + "is-docker": "cli.js" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-generator-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-generator-fn/-/is-generator-fn-2.1.0.tgz", + "integrity": "sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/is-obj": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz", + "integrity": "sha1-PkcprB9f3gJc19g6iW2rn09n2w8=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-plain-object": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "dev": true, + "dependencies": { + "isobject": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-potential-custom-element-name": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.0.tgz", + "integrity": "sha1-DFLlS8yjkbssSUsh6GJtczbG45c=", + "dev": true + }, + "node_modules/is-regexp": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-regexp/-/is-regexp-1.0.0.tgz", + "integrity": "sha1-/S2INUXEa6xaYz57mgnof6LLUGk=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-stream": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", + "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", + "dev": true + }, + "node_modules/is-windows": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", + "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-wsl": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz", + "integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==", + "dev": true, + "optional": true, + "dependencies": { + "is-docker": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, + "node_modules/isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/isstream": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", + "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", + "dev": true + }, + "node_modules/istanbul-lib-coverage": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.0.0.tgz", + "integrity": "sha512-UiUIqxMgRDET6eR+o5HbfRYP1l0hqkWOs7vNxC/mggutCMUIhWMm8gAHb8tHlyfD3/l6rlgNA5cKdDzEAf6hEg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/istanbul-lib-instrument": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-4.0.3.tgz", + "integrity": "sha512-BXgQl9kf4WTCPCCpmFGoJkz/+uhvm7h7PFKUYxh7qarQd3ER33vHG//qaE8eN25l07YqZPpHXU9I09l/RD5aGQ==", + "dev": true, + "dependencies": { + "@babel/core": "^7.7.5", + "@istanbuljs/schema": "^0.1.2", + "istanbul-lib-coverage": "^3.0.0", + "semver": "^6.3.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/istanbul-lib-instrument/node_modules/semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/istanbul-lib-report": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz", + "integrity": "sha512-wcdi+uAKzfiGT2abPpKZ0hSU1rGQjUQnLvtY5MpQ7QCTahD3VODhcu4wcfY1YtkGaDD5yuydOLINXsfbus9ROw==", + "dev": true, + "dependencies": { + "istanbul-lib-coverage": "^3.0.0", + "make-dir": "^3.0.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/istanbul-lib-source-maps": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.0.tgz", + "integrity": "sha512-c16LpFRkR8vQXyHZ5nLpY35JZtzj1PQY1iZmesUbf1FZHbIupcWfjgOXBY9YHkLEQ6puz1u4Dgj6qmU/DisrZg==", + "dev": true, + "dependencies": { + "debug": "^4.1.1", + "istanbul-lib-coverage": "^3.0.0", + "source-map": "^0.6.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/istanbul-reports": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.0.2.tgz", + "integrity": "sha512-9tZvz7AiR3PEDNGiV9vIouQ/EAcqMXFmkcA1CDFTwOB98OZVDL0PH9glHotf5Ugp6GCOTypfzGWI/OqjWNCRUw==", + "dev": true, + "dependencies": { + "html-escaper": "^2.0.0", + "istanbul-lib-report": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/jest": { + "version": "26.6.3", + "resolved": "https://registry.npmjs.org/jest/-/jest-26.6.3.tgz", + "integrity": "sha512-lGS5PXGAzR4RF7V5+XObhqz2KZIDUA1yD0DG6pBVmy10eh0ZIXQImRuzocsI/N2XZ1GrLFwTS27In2i2jlpq1Q==", + "dev": true, + "dependencies": { + "@jest/core": "^26.6.3", + "import-local": "^3.0.2", + "jest-cli": "^26.6.3" + }, + "bin": { + "jest": "bin/jest.js" + }, + "engines": { + "node": ">= 10.14.2" + } + }, + "node_modules/jest-changed-files": { + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-26.6.2.tgz", + "integrity": "sha512-fDS7szLcY9sCtIip8Fjry9oGf3I2ht/QT21bAHm5Dmf0mD4X3ReNUf17y+bO6fR8WgbIZTlbyG1ak/53cbRzKQ==", + "dev": true, + "dependencies": { + "@jest/types": "^26.6.2", + "execa": "^4.0.0", + "throat": "^5.0.0" + }, + "engines": { + "node": ">= 10.14.2" + } + }, + "node_modules/jest-changed-files/node_modules/cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/jest-changed-files/node_modules/execa": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-4.1.0.tgz", + "integrity": "sha512-j5W0//W7f8UxAn8hXVnwG8tLwdiUy4FJLcSupCg6maBYZDpyBvTApK7KyuI4bKj8KOh1r2YH+6ucuYtJv1bTZA==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.0", + "get-stream": "^5.0.0", + "human-signals": "^1.1.1", + "is-stream": "^2.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^4.0.0", + "onetime": "^5.1.0", + "signal-exit": "^3.0.2", + "strip-final-newline": "^2.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" + } + }, + "node_modules/jest-changed-files/node_modules/get-stream": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", + "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", + "dev": true, + "dependencies": { + "pump": "^3.0.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/jest-changed-files/node_modules/is-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz", + "integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/jest-changed-files/node_modules/npm-run-path": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", + "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", + "dev": true, + "dependencies": { + "path-key": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/jest-changed-files/node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/jest-changed-files/node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/jest-changed-files/node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/jest-changed-files/node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/jest-config": { + "version": "26.6.3", + "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-26.6.3.tgz", + "integrity": "sha512-t5qdIj/bCj2j7NFVHb2nFB4aUdfucDn3JRKgrZnplb8nieAirAzRSHP8uDEd+qV6ygzg9Pz4YG7UTJf94LPSyg==", + "dev": true, + "dependencies": { + "@babel/core": "^7.1.0", + "@jest/test-sequencer": "^26.6.3", + "@jest/types": "^26.6.2", + "babel-jest": "^26.6.3", + "chalk": "^4.0.0", + "deepmerge": "^4.2.2", + "glob": "^7.1.1", + "graceful-fs": "^4.2.4", + "jest-environment-jsdom": "^26.6.2", + "jest-environment-node": "^26.6.2", + "jest-get-type": "^26.3.0", + "jest-jasmine2": "^26.6.3", + "jest-regex-util": "^26.0.0", + "jest-resolve": "^26.6.2", + "jest-util": "^26.6.2", + "jest-validate": "^26.6.2", + "micromatch": "^4.0.2", + "pretty-format": "^26.6.2" + }, + "engines": { + "node": ">= 10.14.2" + }, + "peerDependencies": { + "ts-node": ">=9.0.0" + }, + "peerDependenciesMeta": { + "ts-node": { + "optional": true + } + } + }, + "node_modules/jest-diff": { + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-26.6.2.tgz", + "integrity": "sha512-6m+9Z3Gv9wN0WFVasqjCL/06+EFCMTqDEUl/b87HYK2rAPTyfz4ZIuSlPhY51PIQRWx5TaxeF1qmXKe9gfN3sA==", + "dev": true, + "dependencies": { + "chalk": "^4.0.0", + "diff-sequences": "^26.6.2", + "jest-get-type": "^26.3.0", + "pretty-format": "^26.6.2" + }, + "engines": { + "node": ">= 10.14.2" + } + }, + "node_modules/jest-docblock": { + "version": "26.0.0", + "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-26.0.0.tgz", + "integrity": "sha512-RDZ4Iz3QbtRWycd8bUEPxQsTlYazfYn/h5R65Fc6gOfwozFhoImx+affzky/FFBuqISPTqjXomoIGJVKBWoo0w==", + "dev": true, + "dependencies": { + "detect-newline": "^3.0.0" + }, + "engines": { + "node": ">= 10.14.2" + } + }, + "node_modules/jest-each": { + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-26.6.2.tgz", + "integrity": "sha512-Mer/f0KaATbjl8MCJ+0GEpNdqmnVmDYqCTJYTvoo7rqmRiDllmp2AYN+06F93nXcY3ur9ShIjS+CO/uD+BbH4A==", + "dev": true, + "dependencies": { + "@jest/types": "^26.6.2", + "chalk": "^4.0.0", + "jest-get-type": "^26.3.0", + "jest-util": "^26.6.2", + "pretty-format": "^26.6.2" + }, + "engines": { + "node": ">= 10.14.2" + } + }, + "node_modules/jest-environment-jsdom": { + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/jest-environment-jsdom/-/jest-environment-jsdom-26.6.2.tgz", + "integrity": "sha512-jgPqCruTlt3Kwqg5/WVFyHIOJHsiAvhcp2qiR2QQstuG9yWox5+iHpU3ZrcBxW14T4fe5Z68jAfLRh7joCSP2Q==", + "dev": true, + "dependencies": { + "@jest/environment": "^26.6.2", + "@jest/fake-timers": "^26.6.2", + "@jest/types": "^26.6.2", + "@types/node": "*", + "jest-mock": "^26.6.2", + "jest-util": "^26.6.2", + "jsdom": "^16.4.0" + }, + "engines": { + "node": ">= 10.14.2" + } + }, + "node_modules/jest-environment-node": { + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-26.6.2.tgz", + "integrity": "sha512-zhtMio3Exty18dy8ee8eJ9kjnRyZC1N4C1Nt/VShN1apyXc8rWGtJ9lI7vqiWcyyXS4BVSEn9lxAM2D+07/Tag==", + "dev": true, + "dependencies": { + "@jest/environment": "^26.6.2", + "@jest/fake-timers": "^26.6.2", + "@jest/types": "^26.6.2", + "@types/node": "*", + "jest-mock": "^26.6.2", + "jest-util": "^26.6.2" + }, + "engines": { + "node": ">= 10.14.2" + } + }, + "node_modules/jest-fetch-mock": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/jest-fetch-mock/-/jest-fetch-mock-3.0.3.tgz", + "integrity": "sha512-Ux1nWprtLrdrH4XwE7O7InRY6psIi3GOsqNESJgMJ+M5cv4A8Lh7SN9d2V2kKRZ8ebAfcd1LNyZguAOb6JiDqw==", + "dev": true, + "dependencies": { + "cross-fetch": "^3.0.4", + "promise-polyfill": "^8.1.3" + } + }, + "node_modules/jest-get-type": { + "version": "26.3.0", + "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-26.3.0.tgz", + "integrity": "sha512-TpfaviN1R2pQWkIihlfEanwOXK0zcxrKEE4MlU6Tn7keoXdN6/3gK/xl0yEh8DOunn5pOVGKf8hB4R9gVh04ig==", + "dev": true, + "engines": { + "node": ">= 10.14.2" + } + }, + "node_modules/jest-haste-map": { + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-26.6.2.tgz", + "integrity": "sha512-easWIJXIw71B2RdR8kgqpjQrbMRWQBgiBwXYEhtGUTaX+doCjBheluShdDMeR8IMfJiTqH4+zfhtg29apJf/8w==", + "dev": true, + "dependencies": { + "@jest/types": "^26.6.2", + "@types/graceful-fs": "^4.1.2", + "@types/node": "*", + "anymatch": "^3.0.3", + "fb-watchman": "^2.0.0", + "graceful-fs": "^4.2.4", + "jest-regex-util": "^26.0.0", + "jest-serializer": "^26.6.2", + "jest-util": "^26.6.2", + "jest-worker": "^26.6.2", + "micromatch": "^4.0.2", + "sane": "^4.0.3", + "walker": "^1.0.7" + }, + "engines": { + "node": ">= 10.14.2" + }, + "optionalDependencies": { + "fsevents": "^2.1.2" + } + }, + "node_modules/jest-jasmine2": { + "version": "26.6.3", + "resolved": "https://registry.npmjs.org/jest-jasmine2/-/jest-jasmine2-26.6.3.tgz", + "integrity": "sha512-kPKUrQtc8aYwBV7CqBg5pu+tmYXlvFlSFYn18ev4gPFtrRzB15N2gW/Roew3187q2w2eHuu0MU9TJz6w0/nPEg==", + "dev": true, + "dependencies": { + "@babel/traverse": "^7.1.0", + "@jest/environment": "^26.6.2", + "@jest/source-map": "^26.6.2", + "@jest/test-result": "^26.6.2", + "@jest/types": "^26.6.2", + "@types/node": "*", + "chalk": "^4.0.0", + "co": "^4.6.0", + "expect": "^26.6.2", + "is-generator-fn": "^2.0.0", + "jest-each": "^26.6.2", + "jest-matcher-utils": "^26.6.2", + "jest-message-util": "^26.6.2", + "jest-runtime": "^26.6.3", + "jest-snapshot": "^26.6.2", + "jest-util": "^26.6.2", + "pretty-format": "^26.6.2", + "throat": "^5.0.0" + }, + "engines": { + "node": ">= 10.14.2" + } + }, + "node_modules/jest-leak-detector": { + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-26.6.2.tgz", + "integrity": "sha512-i4xlXpsVSMeKvg2cEKdfhh0H39qlJlP5Ex1yQxwF9ubahboQYMgTtz5oML35AVA3B4Eu+YsmwaiKVev9KCvLxg==", + "dev": true, + "dependencies": { + "jest-get-type": "^26.3.0", + "pretty-format": "^26.6.2" + }, + "engines": { + "node": ">= 10.14.2" + } + }, + "node_modules/jest-matcher-utils": { + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-26.6.2.tgz", + "integrity": "sha512-llnc8vQgYcNqDrqRDXWwMr9i7rS5XFiCwvh6DTP7Jqa2mqpcCBBlpCbn+trkG0KNhPu/h8rzyBkriOtBstvWhw==", + "dev": true, + "dependencies": { + "chalk": "^4.0.0", + "jest-diff": "^26.6.2", + "jest-get-type": "^26.3.0", + "pretty-format": "^26.6.2" + }, + "engines": { + "node": ">= 10.14.2" + } + }, + "node_modules/jest-message-util": { + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-26.6.2.tgz", + "integrity": "sha512-rGiLePzQ3AzwUshu2+Rn+UMFk0pHN58sOG+IaJbk5Jxuqo3NYO1U2/MIR4S1sKgsoYSXSzdtSa0TgrmtUwEbmA==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.0.0", + "@jest/types": "^26.6.2", + "@types/stack-utils": "^2.0.0", + "chalk": "^4.0.0", + "graceful-fs": "^4.2.4", + "micromatch": "^4.0.2", + "pretty-format": "^26.6.2", + "slash": "^3.0.0", + "stack-utils": "^2.0.2" + }, + "engines": { + "node": ">= 10.14.2" + } + }, + "node_modules/jest-mock": { + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-26.6.2.tgz", + "integrity": "sha512-YyFjePHHp1LzpzYcmgqkJ0nm0gg/lJx2aZFzFy1S6eUqNjXsOqTK10zNRff2dNfssgokjkG65OlWNcIlgd3zew==", + "dev": true, + "dependencies": { + "@jest/types": "^26.6.2", + "@types/node": "*" + }, + "engines": { + "node": ">= 10.14.2" + } + }, + "node_modules/jest-pnp-resolver": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/jest-pnp-resolver/-/jest-pnp-resolver-1.2.2.tgz", + "integrity": "sha512-olV41bKSMm8BdnuMsewT4jqlZ8+3TCARAXjZGT9jcoSnrfUnRCqnMoF9XEeoWjbzObpqF9dRhHQj0Xb9QdF6/w==", + "dev": true, + "engines": { + "node": ">=6" + }, + "peerDependencies": { + "jest-resolve": "*" + }, + "peerDependenciesMeta": { + "jest-resolve": { + "optional": true + } + } + }, + "node_modules/jest-regex-util": { + "version": "26.0.0", + "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-26.0.0.tgz", + "integrity": "sha512-Gv3ZIs/nA48/Zvjrl34bf+oD76JHiGDUxNOVgUjh3j890sblXryjY4rss71fPtD/njchl6PSE2hIhvyWa1eT0A==", + "dev": true, + "engines": { + "node": ">= 10.14.2" + } + }, + "node_modules/jest-resolve": { + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-26.6.2.tgz", + "integrity": "sha512-sOxsZOq25mT1wRsfHcbtkInS+Ek7Q8jCHUB0ZUTP0tc/c41QHriU/NunqMfCUWsL4H3MHpvQD4QR9kSYhS7UvQ==", + "dev": true, + "dependencies": { + "@jest/types": "^26.6.2", + "chalk": "^4.0.0", + "graceful-fs": "^4.2.4", + "jest-pnp-resolver": "^1.2.2", + "jest-util": "^26.6.2", + "read-pkg-up": "^7.0.1", + "resolve": "^1.18.1", + "slash": "^3.0.0" + }, + "engines": { + "node": ">= 10.14.2" + } + }, + "node_modules/jest-resolve-dependencies": { + "version": "26.6.3", + "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-26.6.3.tgz", + "integrity": "sha512-pVwUjJkxbhe4RY8QEWzN3vns2kqyuldKpxlxJlzEYfKSvY6/bMvxoFrYYzUO1Gx28yKWN37qyV7rIoIp2h8fTg==", + "dev": true, + "dependencies": { + "@jest/types": "^26.6.2", + "jest-regex-util": "^26.0.0", + "jest-snapshot": "^26.6.2" + }, + "engines": { + "node": ">= 10.14.2" + } + }, + "node_modules/jest-runner": { + "version": "26.6.3", + "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-26.6.3.tgz", + "integrity": "sha512-atgKpRHnaA2OvByG/HpGA4g6CSPS/1LK0jK3gATJAoptC1ojltpmVlYC3TYgdmGp+GLuhzpH30Gvs36szSL2JQ==", + "dev": true, + "dependencies": { + "@jest/console": "^26.6.2", + "@jest/environment": "^26.6.2", + "@jest/test-result": "^26.6.2", + "@jest/types": "^26.6.2", + "@types/node": "*", + "chalk": "^4.0.0", + "emittery": "^0.7.1", + "exit": "^0.1.2", + "graceful-fs": "^4.2.4", + "jest-config": "^26.6.3", + "jest-docblock": "^26.0.0", + "jest-haste-map": "^26.6.2", + "jest-leak-detector": "^26.6.2", + "jest-message-util": "^26.6.2", + "jest-resolve": "^26.6.2", + "jest-runtime": "^26.6.3", + "jest-util": "^26.6.2", + "jest-worker": "^26.6.2", + "source-map-support": "^0.5.6", + "throat": "^5.0.0" + }, + "engines": { + "node": ">= 10.14.2" + } + }, + "node_modules/jest-runtime": { + "version": "26.6.3", + "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-26.6.3.tgz", + "integrity": "sha512-lrzyR3N8sacTAMeonbqpnSka1dHNux2uk0qqDXVkMv2c/A3wYnvQ4EXuI013Y6+gSKSCxdaczvf4HF0mVXHRdw==", + "dev": true, + "dependencies": { + "@jest/console": "^26.6.2", + "@jest/environment": "^26.6.2", + "@jest/fake-timers": "^26.6.2", + "@jest/globals": "^26.6.2", + "@jest/source-map": "^26.6.2", + "@jest/test-result": "^26.6.2", + "@jest/transform": "^26.6.2", + "@jest/types": "^26.6.2", + "@types/yargs": "^15.0.0", + "chalk": "^4.0.0", + "cjs-module-lexer": "^0.6.0", + "collect-v8-coverage": "^1.0.0", + "exit": "^0.1.2", + "glob": "^7.1.3", + "graceful-fs": "^4.2.4", + "jest-config": "^26.6.3", + "jest-haste-map": "^26.6.2", + "jest-message-util": "^26.6.2", + "jest-mock": "^26.6.2", + "jest-regex-util": "^26.0.0", + "jest-resolve": "^26.6.2", + "jest-snapshot": "^26.6.2", + "jest-util": "^26.6.2", + "jest-validate": "^26.6.2", + "slash": "^3.0.0", + "strip-bom": "^4.0.0", + "yargs": "^15.4.1" + }, + "bin": { + "jest-runtime": "bin/jest-runtime.js" + }, + "engines": { + "node": ">= 10.14.2" + } + }, + "node_modules/jest-serializer": { + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/jest-serializer/-/jest-serializer-26.6.2.tgz", + "integrity": "sha512-S5wqyz0DXnNJPd/xfIzZ5Xnp1HrJWBczg8mMfMpN78OJ5eDxXyf+Ygld9wX1DnUWbIbhM1YDY95NjR4CBXkb2g==", + "dev": true, + "dependencies": { + "@types/node": "*", + "graceful-fs": "^4.2.4" + }, + "engines": { + "node": ">= 10.14.2" + } + }, + "node_modules/jest-snapshot": { + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-26.6.2.tgz", + "integrity": "sha512-OLhxz05EzUtsAmOMzuupt1lHYXCNib0ECyuZ/PZOx9TrZcC8vL0x+DUG3TL+GLX3yHG45e6YGjIm0XwDc3q3og==", + "dev": true, + "dependencies": { + "@babel/types": "^7.0.0", + "@jest/types": "^26.6.2", + "@types/babel__traverse": "^7.0.4", + "@types/prettier": "^2.0.0", + "chalk": "^4.0.0", + "expect": "^26.6.2", + "graceful-fs": "^4.2.4", + "jest-diff": "^26.6.2", + "jest-get-type": "^26.3.0", + "jest-haste-map": "^26.6.2", + "jest-matcher-utils": "^26.6.2", + "jest-message-util": "^26.6.2", + "jest-resolve": "^26.6.2", + "natural-compare": "^1.4.0", + "pretty-format": "^26.6.2", + "semver": "^7.3.2" + }, + "engines": { + "node": ">= 10.14.2" + } + }, + "node_modules/jest-util": { + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-26.6.2.tgz", + "integrity": "sha512-MDW0fKfsn0OI7MS7Euz6h8HNDXVQ0gaM9uW6RjfDmd1DAFcaxX9OqIakHIqhbnmF08Cf2DLDG+ulq8YQQ0Lp0Q==", + "dev": true, + "dependencies": { + "@jest/types": "^26.6.2", + "@types/node": "*", + "chalk": "^4.0.0", + "graceful-fs": "^4.2.4", + "is-ci": "^2.0.0", + "micromatch": "^4.0.2" + }, + "engines": { + "node": ">= 10.14.2" + } + }, + "node_modules/jest-validate": { + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-26.6.2.tgz", + "integrity": "sha512-NEYZ9Aeyj0i5rQqbq+tpIOom0YS1u2MVu6+euBsvpgIme+FOfRmoC4R5p0JiAUpaFvFy24xgrpMknarR/93XjQ==", + "dev": true, + "dependencies": { + "@jest/types": "^26.6.2", + "camelcase": "^6.0.0", + "chalk": "^4.0.0", + "jest-get-type": "^26.3.0", + "leven": "^3.1.0", + "pretty-format": "^26.6.2" + }, + "engines": { + "node": ">= 10.14.2" + } + }, + "node_modules/jest-validate/node_modules/camelcase": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.2.0.tgz", + "integrity": "sha512-c7wVvbw3f37nuobQNtgsgG9POC9qMbNuMQmTCqZv23b6MIz0fcYpBiOlv9gEN/hdLdnZTDQhg6e9Dq5M1vKvfg==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/jest-watcher": { + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-26.6.2.tgz", + "integrity": "sha512-WKJob0P/Em2csiVthsI68p6aGKTIcsfjH9Gsx1f0A3Italz43e3ho0geSAVsmj09RWOELP1AZ/DXyJgOgDKxXQ==", + "dev": true, + "dependencies": { + "@jest/test-result": "^26.6.2", + "@jest/types": "^26.6.2", + "@types/node": "*", + "ansi-escapes": "^4.2.1", + "chalk": "^4.0.0", + "jest-util": "^26.6.2", + "string-length": "^4.0.1" + }, + "engines": { + "node": ">= 10.14.2" + } + }, + "node_modules/jest-worker": { + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-26.6.2.tgz", + "integrity": "sha512-KWYVV1c4i+jbMpaBC+U++4Va0cp8OisU185o73T1vo99hqi7w8tSJfUXYswwqqrjzwxa6KpRK54WhPvwf5w6PQ==", + "dev": true, + "dependencies": { + "@types/node": "*", + "merge-stream": "^2.0.0", + "supports-color": "^7.0.0" + }, + "engines": { + "node": ">= 10.13.0" + } + }, + "node_modules/jest/node_modules/jest-cli": { + "version": "26.6.3", + "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-26.6.3.tgz", + "integrity": "sha512-GF9noBSa9t08pSyl3CY4frMrqp+aQXFGFkf5hEPbh/pIUFYWMK6ZLTfbmadxJVcJrdRoChlWQsA2VkJcDFK8hg==", + "dev": true, + "dependencies": { + "@jest/core": "^26.6.3", + "@jest/test-result": "^26.6.2", + "@jest/types": "^26.6.2", + "chalk": "^4.0.0", + "exit": "^0.1.2", + "graceful-fs": "^4.2.4", + "import-local": "^3.0.2", + "is-ci": "^2.0.0", + "jest-config": "^26.6.3", + "jest-util": "^26.6.2", + "jest-validate": "^26.6.2", + "prompts": "^2.0.1", + "yargs": "^15.4.1" + }, + "bin": { + "jest": "bin/jest.js" + }, + "engines": { + "node": ">= 10.14.2" + } + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, + "node_modules/js-yaml": { + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", + "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", + "dev": true, + "dependencies": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/jsbn": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", + "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", + "dev": true + }, + "node_modules/jsdom": { + "version": "16.4.0", + "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-16.4.0.tgz", + "integrity": "sha512-lYMm3wYdgPhrl7pDcRmvzPhhrGVBeVhPIqeHjzeiHN3DFmD1RBpbExbi8vU7BJdH8VAZYovR8DMt0PNNDM7k8w==", + "dev": true, + "dependencies": { + "abab": "^2.0.3", + "acorn": "^7.1.1", + "acorn-globals": "^6.0.0", + "cssom": "^0.4.4", + "cssstyle": "^2.2.0", + "data-urls": "^2.0.0", + "decimal.js": "^10.2.0", + "domexception": "^2.0.1", + "escodegen": "^1.14.1", + "html-encoding-sniffer": "^2.0.1", + "is-potential-custom-element-name": "^1.0.0", + "nwsapi": "^2.2.0", + "parse5": "5.1.1", + "request": "^2.88.2", + "request-promise-native": "^1.0.8", + "saxes": "^5.0.0", + "symbol-tree": "^3.2.4", + "tough-cookie": "^3.0.1", + "w3c-hr-time": "^1.0.2", + "w3c-xmlserializer": "^2.0.0", + "webidl-conversions": "^6.1.0", + "whatwg-encoding": "^1.0.5", + "whatwg-mimetype": "^2.3.0", + "whatwg-url": "^8.0.0", + "ws": "^7.2.3", + "xml-name-validator": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "peerDependencies": { + "canvas": "^2.5.0" + }, + "peerDependenciesMeta": { + "canvas": { + "optional": true + } + } + }, + "node_modules/jsdom/node_modules/tough-cookie": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-3.0.1.tgz", + "integrity": "sha512-yQyJ0u4pZsv9D4clxO69OEjLWYw+jbgspjTue4lTQZLfV0c5l1VmK2y1JK8E9ahdpltPOaAThPcp5nKPUgSnsg==", + "dev": true, + "dependencies": { + "ip-regex": "^2.1.0", + "psl": "^1.1.28", + "punycode": "^2.1.1" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/jsesc": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", + "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", + "dev": true, + "bin": { + "jsesc": "bin/jsesc" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/json-parse-even-better-errors": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", + "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", + "dev": true + }, + "node_modules/json-schema": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", + "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=", + "dev": true + }, + "node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "node_modules/json-stringify-safe": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", + "dev": true + }, + "node_modules/json5": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.1.3.tgz", + "integrity": "sha512-KXPvOm8K9IJKFM0bmdn8QXh7udDh1g/giieX0NLCaMnb4hEiVFqnop2ImTXCc5e0/oHz3LTqmHGtExn5hfMkOA==", + "dev": true, + "dependencies": { + "minimist": "^1.2.5" + }, + "bin": { + "json5": "lib/cli.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/jsprim": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", + "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", + "dev": true, + "engines": [ + "node >=0.6.0" + ], + "dependencies": { + "assert-plus": "1.0.0", + "extsprintf": "1.3.0", + "json-schema": "0.2.3", + "verror": "1.10.0" + } + }, + "node_modules/kind-of": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/kleur": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", + "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/lcov-parse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/lcov-parse/-/lcov-parse-1.0.0.tgz", + "integrity": "sha1-6w1GtUER68VhrLTECO+TY73I9+A=", + "dev": true, + "bin": { + "lcov-parse": "bin/cli.js" + } + }, + "node_modules/leven": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz", + "integrity": "sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/levn": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", + "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", + "dev": true, + "dependencies": { + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/lines-and-columns": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.1.6.tgz", + "integrity": "sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA=", + "dev": true + }, + "node_modules/lint-staged": { + "version": "10.5.3", + "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-10.5.3.tgz", + "integrity": "sha512-TanwFfuqUBLufxCc3RUtFEkFraSPNR3WzWcGF39R3f2J7S9+iF9W0KTVLfSy09lYGmZS5NDCxjNvhGMSJyFCWg==", + "dev": true, + "dependencies": { + "chalk": "^4.1.0", + "cli-truncate": "^2.1.0", + "commander": "^6.2.0", + "cosmiconfig": "^7.0.0", + "debug": "^4.2.0", + "dedent": "^0.7.0", + "enquirer": "^2.3.6", + "execa": "^4.1.0", + "listr2": "^3.2.2", + "log-symbols": "^4.0.0", + "micromatch": "^4.0.2", + "normalize-path": "^3.0.0", + "please-upgrade-node": "^3.2.0", + "string-argv": "0.3.1", + "stringify-object": "^3.3.0" + }, + "bin": { + "lint-staged": "bin/lint-staged.js" + }, + "funding": { + "url": "https://opencollective.com/lint-staged" + } + }, + "node_modules/lint-staged/node_modules/cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/lint-staged/node_modules/execa": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-4.1.0.tgz", + "integrity": "sha512-j5W0//W7f8UxAn8hXVnwG8tLwdiUy4FJLcSupCg6maBYZDpyBvTApK7KyuI4bKj8KOh1r2YH+6ucuYtJv1bTZA==", + "dev": true, + "dependencies": { + "cross-spawn": "^7.0.0", + "get-stream": "^5.0.0", + "human-signals": "^1.1.1", + "is-stream": "^2.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^4.0.0", + "onetime": "^5.1.0", + "signal-exit": "^3.0.2", + "strip-final-newline": "^2.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" + } + }, + "node_modules/lint-staged/node_modules/get-stream": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", + "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", + "dev": true, + "dependencies": { + "pump": "^3.0.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/lint-staged/node_modules/is-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz", + "integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/lint-staged/node_modules/npm-run-path": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", + "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", + "dev": true, + "dependencies": { + "path-key": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/lint-staged/node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/lint-staged/node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/lint-staged/node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/lint-staged/node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/listr2": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/listr2/-/listr2-3.3.0.tgz", + "integrity": "sha512-G9IFI/m65icgVlifS0wMQnvn35/8VJGzEb3crpE4NnaegQYQOn/wP7yqi9TTJQ/eoxme4UaPbffBK1XqKP/DOg==", + "dev": true, + "dependencies": { + "chalk": "^4.1.0", + "cli-truncate": "^2.1.0", + "figures": "^3.2.0", + "indent-string": "^4.0.0", + "log-update": "^4.0.0", + "p-map": "^4.0.0", + "rxjs": "^6.6.3", + "through": "^2.3.8", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "enquirer": ">= 2.3.0 < 3" + } + }, + "node_modules/listr2/node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/lodash": { + "version": "4.17.20", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", + "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==", + "dev": true + }, + "node_modules/lodash.sortby": { + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/lodash.sortby/-/lodash.sortby-4.7.0.tgz", + "integrity": "sha1-7dFMgk4sycHgsKG0K7UhBRakJDg=", + "dev": true + }, + "node_modules/log-driver": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/log-driver/-/log-driver-1.2.7.tgz", + "integrity": "sha512-U7KCmLdqsGHBLeWqYlFA0V0Sl6P08EE1ZrmA9cxjUE0WVqT9qnyVDPz1kzpFEP0jdJuFnasWIfSd7fsaNXkpbg==", + "dev": true, + "engines": { + "node": ">=0.8.6" + } + }, + "node_modules/log-symbols": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.0.0.tgz", + "integrity": "sha512-FN8JBzLx6CzeMrB0tg6pqlGU1wCrXW+ZXGH481kfsBqer0hToTIiHdjH4Mq8xJUbvATujKCvaREGWpGUionraA==", + "dev": true, + "dependencies": { + "chalk": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/log-update": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/log-update/-/log-update-4.0.0.tgz", + "integrity": "sha512-9fkkDevMefjg0mmzWFBW8YkFP91OrizzkW3diF7CpG+S2EYdy4+TVfGwz1zeF8x7hCx1ovSPTOE9Ngib74qqUg==", + "dev": true, + "dependencies": { + "ansi-escapes": "^4.3.0", + "cli-cursor": "^3.1.0", + "slice-ansi": "^4.0.0", + "wrap-ansi": "^6.2.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/log-update/node_modules/slice-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", + "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.0.0", + "astral-regex": "^2.0.0", + "is-fullwidth-code-point": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/slice-ansi?sponsor=1" + } + }, + "node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/make-dir": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", + "dev": true, + "dependencies": { + "semver": "^6.0.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/make-dir/node_modules/semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true, + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/makeerror": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/makeerror/-/makeerror-1.0.11.tgz", + "integrity": "sha1-4BpckQnyr3lmDk6LlYd5AYT1qWw=", + "dev": true, + "dependencies": { + "tmpl": "1.0.x" + } + }, + "node_modules/map-cache": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", + "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/map-visit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", + "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", + "dev": true, + "dependencies": { + "object-visit": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/merge-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", + "dev": true + }, + "node_modules/micromatch": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.2.tgz", + "integrity": "sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q==", + "dev": true, + "dependencies": { + "braces": "^3.0.1", + "picomatch": "^2.0.5" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/mime-db": { + "version": "1.45.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.45.0.tgz", + "integrity": "sha512-CkqLUxUk15hofLoLyljJSrukZi8mAtgd+yE5uO4tqRZsdsAJKv0O+rFMhVDRJgozy+yG6md5KwuXhD4ocIoP+w==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.28", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.28.tgz", + "integrity": "sha512-0TO2yJ5YHYr7M2zzT7gDU1tbwHxEUWBCLt0lscSNpcdAfFyJOVEpRYNS7EXVcTLNj/25QO8gulHC5JtTzSE2UQ==", + "dev": true, + "dependencies": { + "mime-db": "1.45.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/mimic-response": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-2.1.0.tgz", + "integrity": "sha512-wXqjST+SLt7R009ySCglWBCFpjUygmCIfD790/kVbiGmUgfYGuB14PiTd5DwVxSV4NcYHjzMkoj5LjQZwTQLEA==", + "dev": true, + "optional": true, + "peer": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "dev": true + }, + "node_modules/minipass": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz", + "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==", + "dev": true, + "optional": true, + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/minizlib": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz", + "integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==", + "dev": true, + "optional": true, + "peer": true, + "dependencies": { + "minipass": "^3.0.0", + "yallist": "^4.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/minizlib/node_modules/minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "dev": true, + "optional": true, + "peer": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "dev": true, + "optional": true, + "peer": true, + "bin": { + "mkdirp": "bin/cmd.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "node_modules/nan": { + "version": "2.17.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.17.0.tgz", + "integrity": "sha512-2ZTgtl0nJsO0KQCjEpxcIr5D+Yv90plTitZt9JBfQvVJDS5seMl3FOvsh3+9CoYWXf/1l5OaZzzF6nDm4cagaQ==", + "dev": true, + "optional": true, + "peer": true + }, + "node_modules/nanomatch": { + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", + "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==", + "dev": true, + "dependencies": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "fragment-cache": "^0.2.1", + "is-windows": "^1.0.2", + "kind-of": "^6.0.2", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", + "dev": true + }, + "node_modules/nice-try": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", + "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", + "dev": true + }, + "node_modules/node-fetch": { + "version": "2.6.11", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.11.tgz", + "integrity": "sha512-4I6pdBY1EthSqDmJkiNk3JIT8cswwR9nfeW/cPdUagJYEQG7R95WRH74wpz7ma8Gh/9dI9FP+OU+0E4FvtA55w==", + "dev": true, + "dependencies": { + "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } + } + }, + "node_modules/node-fetch/node_modules/tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", + "dev": true + }, + "node_modules/node-fetch/node_modules/webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", + "dev": true + }, + "node_modules/node-fetch/node_modules/whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "dev": true, + "dependencies": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, + "node_modules/node-gyp-build": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.2.3.tgz", + "integrity": "sha512-MN6ZpzmfNCRM+3t57PTJHgHyw/h4OWnZ6mR8P5j/uZtqQr46RRuDE/P+g3n0YR/AiYXeWixZZzaip77gdICfRg==", + "dev": true, + "optional": true, + "peer": true, + "bin": { + "node-gyp-build": "bin.js", + "node-gyp-build-optional": "optional.js", + "node-gyp-build-test": "build-test.js" + } + }, + "node_modules/node-int64": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", + "integrity": "sha1-h6kGXNs1XTGC2PlM4RGIuCXGijs=", + "dev": true + }, + "node_modules/node-modules-regexp": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/node-modules-regexp/-/node-modules-regexp-1.0.0.tgz", + "integrity": "sha1-jZ2+KJZKSsVxLpExZCEHxx6Q7EA=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/node-notifier": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/node-notifier/-/node-notifier-8.0.1.tgz", + "integrity": "sha512-BvEXF+UmsnAfYfoapKM9nGxnP+Wn7P91YfXmrKnfcYCx6VBeoN5Ez5Ogck6I8Bi5k4RlpqRYaw75pAwzX9OphA==", + "dev": true, + "optional": true, + "dependencies": { + "growly": "^1.3.0", + "is-wsl": "^2.2.0", + "semver": "^7.3.2", + "shellwords": "^0.1.1", + "uuid": "^8.3.0", + "which": "^2.0.2" + } + }, + "node_modules/node-notifier/node_modules/uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "dev": true, + "optional": true, + "bin": { + "uuid": "dist/bin/uuid" + } + }, + "node_modules/node-notifier/node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "optional": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/nopt": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz", + "integrity": "sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==", + "dev": true, + "optional": true, + "peer": true, + "dependencies": { + "abbrev": "1" + }, + "bin": { + "nopt": "bin/nopt.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/normalize-package-data": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "dev": true, + "dependencies": { + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + } + }, + "node_modules/normalize-package-data/node_modules/semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "dev": true, + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/npm-run-path": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", + "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", + "dev": true, + "dependencies": { + "path-key": "^2.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/npmlog": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-5.0.1.tgz", + "integrity": "sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw==", + "dev": true, + "optional": true, + "peer": true, + "dependencies": { + "are-we-there-yet": "^2.0.0", + "console-control-strings": "^1.1.0", + "gauge": "^3.0.0", + "set-blocking": "^2.0.0" + } + }, + "node_modules/nwsapi": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.0.tgz", + "integrity": "sha512-h2AatdwYH+JHiZpv7pt/gSX1XoRGb7L/qSIeuqA6GwYoF9w1vP1cw42TO0aI2pNyshRK5893hNSl+1//vHK7hQ==", + "dev": true + }, + "node_modules/oauth-sign": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", + "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", + "dev": true, + "engines": { + "node": "*" + } + }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "dev": true, + "optional": true, + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-copy": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", + "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", + "dev": true, + "dependencies": { + "copy-descriptor": "^0.1.0", + "define-property": "^0.2.5", + "kind-of": "^3.0.3" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-copy/node_modules/define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "dependencies": { + "is-descriptor": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-copy/node_modules/kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "dependencies": { + "is-buffer": "^1.1.5" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-visit": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", + "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", + "dev": true, + "dependencies": { + "isobject": "^3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object.pick": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", + "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", + "dev": true, + "dependencies": { + "isobject": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/onetime": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", + "dev": true, + "dependencies": { + "mimic-fn": "^2.1.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/opencollective-postinstall": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/opencollective-postinstall/-/opencollective-postinstall-2.0.3.tgz", + "integrity": "sha512-8AV/sCtuzUeTo8gQK5qDZzARrulB3egtLzFgteqB2tcT4Mw7B8Kt7JcDHmltjz6FOAHsvTevk70gZEbhM4ZS9Q==", + "dev": true, + "bin": { + "opencollective-postinstall": "index.js" + } + }, + "node_modules/optionator": { + "version": "0.8.3", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", + "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", + "dev": true, + "dependencies": { + "deep-is": "~0.1.3", + "fast-levenshtein": "~2.0.6", + "levn": "~0.3.0", + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2", + "word-wrap": "~1.2.3" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/p-each-series": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-each-series/-/p-each-series-2.2.0.tgz", + "integrity": "sha512-ycIL2+1V32th+8scbpTvyHNaHe02z0sjgh91XXjAk+ZeXoPN4Z46DVUnzdso0aX4KckKw0FNNFHdjZ2UsZvxiA==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-finally": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", + "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-map": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-4.0.0.tgz", + "integrity": "sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==", + "dev": true, + "dependencies": { + "aggregate-error": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "dependencies": { + "callsites": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/parse-json": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", + "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", + "dev": true, + "dependencies": { + "@babel/code-frame": "^7.0.0", + "error-ex": "^1.3.1", + "json-parse-even-better-errors": "^2.3.0", + "lines-and-columns": "^1.1.6" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/parse5": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-5.1.1.tgz", + "integrity": "sha512-ugq4DFI0Ptb+WWjAdOK16+u/nHfiIrcE+sh8kZMaM0WllQKLI9rOUq6c2b7cwPkXdzfQESqvoqK6ug7U/Yyzug==", + "dev": true + }, + "node_modules/pascalcase": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", + "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/path-parse": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", + "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", + "dev": true + }, + "node_modules/path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/performance-now": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", + "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", + "dev": true + }, + "node_modules/picomatch": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", + "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==", + "dev": true, + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/pirates": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.1.tgz", + "integrity": "sha512-WuNqLTbMI3tmfef2TKxlQmAiLHKtFhlsCZnPIpuv2Ow0RDVO8lfy1Opf4NUzlMXLjPl+Men7AuVdX6TA+s+uGA==", + "dev": true, + "dependencies": { + "node-modules-regexp": "^1.0.0" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/pkg-dir": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-5.0.0.tgz", + "integrity": "sha512-NPE8TDbzl/3YQYY7CSS228s3g2ollTFnc+Qi3tqmqJp9Vg2ovUpixcJEo2HJScN2Ez+kEaal6y70c0ehqJBJeA==", + "dev": true, + "dependencies": { + "find-up": "^5.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/please-upgrade-node": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/please-upgrade-node/-/please-upgrade-node-3.2.0.tgz", + "integrity": "sha512-gQR3WpIgNIKwBMVLkpMUeR3e1/E1y42bqDQZfql+kDeXd8COYfM8PQA4X6y7a8u9Ua9FHmsrrmirW2vHs45hWg==", + "dev": true, + "dependencies": { + "semver-compare": "^1.0.0" + } + }, + "node_modules/posix-character-classes": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", + "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/prelude-ls": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", + "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", + "dev": true, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/prettier": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.2.1.tgz", + "integrity": "sha512-PqyhM2yCjg/oKkFPtTGUojv7gnZAoG80ttl45O6x2Ug/rMJw4wcc9k6aaf2hibP7BGVCCM33gZoGjyvt9mm16Q==", + "dev": true, + "bin": { + "prettier": "bin-prettier.js" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/pretty-format": { + "version": "26.6.2", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-26.6.2.tgz", + "integrity": "sha512-7AeGuCYNGmycyQbCqd/3PWH4eOoX/OiCa0uphp57NVTeAGdJGaAliecxwBDHYQCIvrW7aDBZCYeNTP/WX69mkg==", + "dev": true, + "dependencies": { + "@jest/types": "^26.6.2", + "ansi-regex": "^5.0.0", + "ansi-styles": "^4.0.0", + "react-is": "^17.0.1" + }, + "engines": { + "node": ">= 10" + } + }, + "node_modules/promise-polyfill": { + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/promise-polyfill/-/promise-polyfill-8.3.0.tgz", + "integrity": "sha512-H5oELycFml5yto/atYqmjyigJoAo3+OXwolYiH7OfQuYlAqhxNvTfiNMbV9hsC6Yp83yE5r2KTVmtrG6R9i6Pg==", + "dev": true + }, + "node_modules/prompts": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.4.0.tgz", + "integrity": "sha512-awZAKrk3vN6CroQukBL+R9051a4R3zCZBlJm/HBfrSZ8iTpYix3VX1vU4mveiLpiwmOJT4wokTF9m6HUk4KqWQ==", + "dev": true, + "dependencies": { + "kleur": "^3.0.3", + "sisteransi": "^1.0.5" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/psl": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz", + "integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==", + "dev": true + }, + "node_modules/pump": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", + "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "dev": true, + "dependencies": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "node_modules/punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/react-is": { + "version": "17.0.1", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.1.tgz", + "integrity": "sha512-NAnt2iGDXohE5LI7uBnLnqvLQMtzhkiAOLXTmv+qnF9Ky7xAPcX8Up/xWIhxvLVGJvuLiNc4xQLtuqDRzb4fSA==", + "dev": true + }, + "node_modules/read-pkg": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz", + "integrity": "sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==", + "dev": true, + "dependencies": { + "@types/normalize-package-data": "^2.4.0", + "normalize-package-data": "^2.5.0", + "parse-json": "^5.0.0", + "type-fest": "^0.6.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/read-pkg-up": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-7.0.1.tgz", + "integrity": "sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==", + "dev": true, + "dependencies": { + "find-up": "^4.1.0", + "read-pkg": "^5.2.0", + "type-fest": "^0.8.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/read-pkg-up/node_modules/find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "dependencies": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/read-pkg-up/node_modules/locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "dependencies": { + "p-locate": "^4.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/read-pkg-up/node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/read-pkg-up/node_modules/p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "dependencies": { + "p-limit": "^2.2.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/read-pkg/node_modules/type-fest": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.6.0.tgz", + "integrity": "sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "dev": true, + "optional": true, + "peer": true, + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/regex-not": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", + "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", + "dev": true, + "dependencies": { + "extend-shallow": "^3.0.2", + "safe-regex": "^1.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/remove-trailing-separator": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", + "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", + "dev": true + }, + "node_modules/repeat-element": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.3.tgz", + "integrity": "sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/repeat-string": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", + "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", + "dev": true, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/request": { + "version": "2.88.2", + "resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz", + "integrity": "sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==", + "deprecated": "request has been deprecated, see https://github.com/request/request/issues/3142", + "dev": true, + "dependencies": { + "aws-sign2": "~0.7.0", + "aws4": "^1.8.0", + "caseless": "~0.12.0", + "combined-stream": "~1.0.6", + "extend": "~3.0.2", + "forever-agent": "~0.6.1", + "form-data": "~2.3.2", + "har-validator": "~5.1.3", + "http-signature": "~1.2.0", + "is-typedarray": "~1.0.0", + "isstream": "~0.1.2", + "json-stringify-safe": "~5.0.1", + "mime-types": "~2.1.19", + "oauth-sign": "~0.9.0", + "performance-now": "^2.1.0", + "qs": "~6.5.2", + "safe-buffer": "^5.1.2", + "tough-cookie": "~2.5.0", + "tunnel-agent": "^0.6.0", + "uuid": "^3.3.2" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/request-promise-core": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/request-promise-core/-/request-promise-core-1.1.4.tgz", + "integrity": "sha512-TTbAfBBRdWD7aNNOoVOBH4pN/KigV6LyapYNNlAPA8JwbovRti1E88m3sYAwsLi5ryhPKsE9APwnjFTgdUjTpw==", + "dev": true, + "dependencies": { + "lodash": "^4.17.19" + }, + "engines": { + "node": ">=0.10.0" + }, + "peerDependencies": { + "request": "^2.34" + } + }, + "node_modules/request-promise-native": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/request-promise-native/-/request-promise-native-1.0.9.tgz", + "integrity": "sha512-wcW+sIUiWnKgNY0dqCpOZkUbF/I+YPi+f09JZIDa39Ec+q82CpSYniDp+ISgTTbKmnpJWASeJBPZmoxH84wt3g==", + "deprecated": "request-promise-native has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142", + "dev": true, + "dependencies": { + "request-promise-core": "1.1.4", + "stealthy-require": "^1.1.1", + "tough-cookie": "^2.3.3" + }, + "engines": { + "node": ">=0.12.0" + }, + "peerDependencies": { + "request": "^2.34" + } + }, + "node_modules/request/node_modules/form-data": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", + "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", + "dev": true, + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.6", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 0.12" + } + }, + "node_modules/request/node_modules/qs": { + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", + "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==", + "dev": true, + "engines": { + "node": ">=0.6" + } + }, + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/require-main-filename": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", + "dev": true + }, + "node_modules/resolve": { + "version": "1.19.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.19.0.tgz", + "integrity": "sha512-rArEXAgsBG4UgRGcynxWIWKFvh/XZCcS8UJdHhwy91zwAvCZIbcs+vAbflgBnNjYMs/i/i+/Ux6IZhML1yPvxg==", + "dev": true, + "dependencies": { + "is-core-module": "^2.1.0", + "path-parse": "^1.0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/resolve-cwd": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-3.0.0.tgz", + "integrity": "sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==", + "dev": true, + "dependencies": { + "resolve-from": "^5.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/resolve-cwd/node_modules/resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/resolve-url": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", + "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", + "deprecated": "https://github.com/lydell/resolve-url#deprecated", + "dev": true + }, + "node_modules/restore-cursor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", + "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==", + "dev": true, + "dependencies": { + "onetime": "^5.1.0", + "signal-exit": "^3.0.2" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/ret": { + "version": "0.1.15", + "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", + "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", + "dev": true, + "engines": { + "node": ">=0.12" + } + }, + "node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/rsvp": { + "version": "4.8.5", + "resolved": "https://registry.npmjs.org/rsvp/-/rsvp-4.8.5.tgz", + "integrity": "sha512-nfMOlASu9OnRJo1mbEk2cz0D56a1MBNrJ7orjRZQG10XDyuvwksKbuXNp6qa+kbn839HwjwhBzhFmdsaEAfauA==", + "dev": true, + "engines": { + "node": "6.* || >= 7.*" + } + }, + "node_modules/rxjs": { + "version": "6.6.3", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.3.tgz", + "integrity": "sha512-trsQc+xYYXZ3urjOiJOuCOa5N3jAZ3eiSpQB5hIT8zGlL2QfnHLJ2r7GMkBGuIausdJN1OneaI6gQlsqNHHmZQ==", + "dev": true, + "dependencies": { + "tslib": "^1.9.0" + }, + "engines": { + "npm": ">=2.0.0" + } + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/safe-regex": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", + "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", + "dev": true, + "dependencies": { + "ret": "~0.1.10" + } + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true + }, + "node_modules/sane": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/sane/-/sane-4.1.0.tgz", + "integrity": "sha512-hhbzAgTIX8O7SHfp2c8/kREfEn4qO/9q8C9beyY6+tvZ87EpoZ3i1RIEvp27YBswnNbY9mWd6paKVmKbAgLfZA==", + "deprecated": "some dependency vulnerabilities fixed, support for node < 10 dropped, and newer ECMAScript syntax/features added", + "dev": true, + "dependencies": { + "@cnakazawa/watch": "^1.0.3", + "anymatch": "^2.0.0", + "capture-exit": "^2.0.0", + "exec-sh": "^0.3.2", + "execa": "^1.0.0", + "fb-watchman": "^2.0.0", + "micromatch": "^3.1.4", + "minimist": "^1.1.1", + "walker": "~1.0.5" + }, + "bin": { + "sane": "src/cli.js" + }, + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "node_modules/sane/node_modules/anymatch": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-2.0.0.tgz", + "integrity": "sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw==", + "dev": true, + "dependencies": { + "micromatch": "^3.1.4", + "normalize-path": "^2.1.1" + } + }, + "node_modules/sane/node_modules/braces": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", + "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", + "dev": true, + "dependencies": { + "arr-flatten": "^1.1.0", + "array-unique": "^0.3.2", + "extend-shallow": "^2.0.1", + "fill-range": "^4.0.0", + "isobject": "^3.0.1", + "repeat-element": "^1.1.2", + "snapdragon": "^0.8.1", + "snapdragon-node": "^2.0.1", + "split-string": "^3.0.2", + "to-regex": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/sane/node_modules/braces/node_modules/extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "dependencies": { + "is-extendable": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/sane/node_modules/fill-range": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", + "dev": true, + "dependencies": { + "extend-shallow": "^2.0.1", + "is-number": "^3.0.0", + "repeat-string": "^1.6.1", + "to-regex-range": "^2.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/sane/node_modules/fill-range/node_modules/extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "dependencies": { + "is-extendable": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/sane/node_modules/is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, + "dependencies": { + "kind-of": "^3.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/sane/node_modules/is-number/node_modules/kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "dependencies": { + "is-buffer": "^1.1.5" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/sane/node_modules/micromatch": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "dev": true, + "dependencies": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "braces": "^2.3.1", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "extglob": "^2.0.4", + "fragment-cache": "^0.2.1", + "kind-of": "^6.0.2", + "nanomatch": "^1.2.9", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/sane/node_modules/normalize-path": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", + "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", + "dev": true, + "dependencies": { + "remove-trailing-separator": "^1.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/sane/node_modules/to-regex-range": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", + "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", + "dev": true, + "dependencies": { + "is-number": "^3.0.0", + "repeat-string": "^1.6.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/saxes": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/saxes/-/saxes-5.0.1.tgz", + "integrity": "sha512-5LBh1Tls8c9xgGjw3QrMwETmTMVk0oFgvrFSvWx62llR2hcEInrKNZ2GZCCuuy2lvWrdl5jhbpeqc5hRYKFOcw==", + "dev": true, + "dependencies": { + "xmlchars": "^2.2.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/semver": { + "version": "7.5.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.1.tgz", + "integrity": "sha512-Wvss5ivl8TMRZXXESstBA4uR5iXgEN/VC5/sOcuXdVLzcdkz4HWetIoRfG5gb5X+ij/G9rw9YoGn3QoQ8OCSpw==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/semver-compare": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/semver-compare/-/semver-compare-1.0.0.tgz", + "integrity": "sha1-De4hahyUGrN+nvsXiPavxf9VN/w=", + "dev": true + }, + "node_modules/semver-regex": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/semver-regex/-/semver-regex-3.1.2.tgz", + "integrity": "sha512-bXWyL6EAKOJa81XG1OZ/Yyuq+oT0b2YLlxx7c+mrdYPaPbnj6WgVULXhinMIeZGufuUBu/eVRqXEhiv4imfwxA==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", + "dev": true + }, + "node_modules/shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "dev": true, + "dependencies": { + "shebang-regex": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/shellwords": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/shellwords/-/shellwords-0.1.1.tgz", + "integrity": "sha512-vFwSUfQvqybiICwZY5+DAWIPLKsWO31Q91JSKl3UYv+K5c2QRPzn0qzec6QPu1Qc9eHYItiP3NdJqNVqetYAww==", + "dev": true, + "optional": true + }, + "node_modules/signal-exit": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz", + "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==", + "dev": true + }, + "node_modules/simple-concat": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz", + "integrity": "sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "optional": true, + "peer": true + }, + "node_modules/simple-get": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-3.1.0.tgz", + "integrity": "sha512-bCR6cP+aTdScaQCnQKbPKtJOKDp/hj9EDLJo3Nw4y1QksqaovlW/bnptB6/c1e+qmNIDHRK+oXFDdEqBT8WzUA==", + "dev": true, + "optional": true, + "peer": true, + "dependencies": { + "decompress-response": "^4.2.0", + "once": "^1.3.1", + "simple-concat": "^1.0.0" + } + }, + "node_modules/sisteransi": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", + "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==", + "dev": true + }, + "node_modules/slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/slice-ansi": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-3.0.0.tgz", + "integrity": "sha512-pSyv7bSTC7ig9Dcgbw9AuRNUb5k5V6oDudjZoMBSr13qpLBG7tB+zgCkARjq7xIUgdz5P1Qe8u+rSGdouOOIyQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.0.0", + "astral-regex": "^2.0.0", + "is-fullwidth-code-point": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/snapdragon": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", + "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", + "dev": true, + "dependencies": { + "base": "^0.11.1", + "debug": "^2.2.0", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "map-cache": "^0.2.2", + "source-map": "^0.5.6", + "source-map-resolve": "^0.5.0", + "use": "^3.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/snapdragon-node": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz", + "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", + "dev": true, + "dependencies": { + "define-property": "^1.0.0", + "isobject": "^3.0.0", + "snapdragon-util": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/snapdragon-node/node_modules/define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "dependencies": { + "is-descriptor": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/snapdragon-node/node_modules/is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "dependencies": { + "kind-of": "^6.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/snapdragon-node/node_modules/is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "dependencies": { + "kind-of": "^6.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/snapdragon-node/node_modules/is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "dependencies": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/snapdragon-util": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", + "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", + "dev": true, + "dependencies": { + "kind-of": "^3.2.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/snapdragon-util/node_modules/kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "dependencies": { + "is-buffer": "^1.1.5" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/snapdragon/node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/snapdragon/node_modules/define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "dependencies": { + "is-descriptor": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/snapdragon/node_modules/extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "dependencies": { + "is-extendable": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/snapdragon/node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "node_modules/snapdragon/node_modules/source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/source-map-resolve": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.3.tgz", + "integrity": "sha512-Htz+RnsXWk5+P2slx5Jh3Q66vhQj1Cllm0zvnaY98+NFx+Dv2CF/f5O/t8x+KaNdrdIAsruNzoh/KpialbqAnw==", + "deprecated": "See https://github.com/lydell/source-map-resolve#deprecated", + "dev": true, + "dependencies": { + "atob": "^2.1.2", + "decode-uri-component": "^0.2.0", + "resolve-url": "^0.2.1", + "source-map-url": "^0.4.0", + "urix": "^0.1.0" + } + }, + "node_modules/source-map-support": { + "version": "0.5.19", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz", + "integrity": "sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==", + "dev": true, + "dependencies": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, + "node_modules/source-map-url": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz", + "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=", + "deprecated": "See https://github.com/lydell/source-map-url#deprecated", + "dev": true + }, + "node_modules/spdx-correct": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz", + "integrity": "sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==", + "dev": true, + "dependencies": { + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" + } + }, + "node_modules/spdx-exceptions": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", + "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==", + "dev": true + }, + "node_modules/spdx-expression-parse": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", + "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", + "dev": true, + "dependencies": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, + "node_modules/spdx-license-ids": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.7.tgz", + "integrity": "sha512-U+MTEOO0AiDzxwFvoa4JVnMV6mZlJKk2sBLt90s7G0Gd0Mlknc7kxEn3nuDPNZRta7O2uy8oLcZLVT+4sqNZHQ==", + "dev": true + }, + "node_modules/split-string": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", + "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", + "dev": true, + "dependencies": { + "extend-shallow": "^3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", + "dev": true + }, + "node_modules/sshpk": { + "version": "1.16.1", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz", + "integrity": "sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==", + "dev": true, + "dependencies": { + "asn1": "~0.2.3", + "assert-plus": "^1.0.0", + "bcrypt-pbkdf": "^1.0.0", + "dashdash": "^1.12.0", + "ecc-jsbn": "~0.1.1", + "getpass": "^0.1.1", + "jsbn": "~0.1.0", + "safer-buffer": "^2.0.2", + "tweetnacl": "~0.14.0" + }, + "bin": { + "sshpk-conv": "bin/sshpk-conv", + "sshpk-sign": "bin/sshpk-sign", + "sshpk-verify": "bin/sshpk-verify" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/stack-utils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-2.0.3.tgz", + "integrity": "sha512-gL//fkxfWUsIlFL2Tl42Cl6+HFALEaB1FU76I/Fy+oZjRreP7OPMXFlGbxM7NQsI0ZpUfw76sHnv0WNYuTb7Iw==", + "dev": true, + "dependencies": { + "escape-string-regexp": "^2.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/stack-utils/node_modules/escape-string-regexp": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", + "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/static-extend": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", + "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", + "dev": true, + "dependencies": { + "define-property": "^0.2.5", + "object-copy": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/static-extend/node_modules/define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "dependencies": { + "is-descriptor": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/stealthy-require": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/stealthy-require/-/stealthy-require-1.1.1.tgz", + "integrity": "sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "dev": true, + "optional": true, + "peer": true, + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, + "node_modules/string-argv": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/string-argv/-/string-argv-0.3.1.tgz", + "integrity": "sha512-a1uQGz7IyVy9YwhqjZIZu1c8JO8dNIe20xBmSS6qu9kv++k3JGzCVmprbNN5Kn+BgzD5E7YYwg1CcjuJMRNsvg==", + "dev": true, + "engines": { + "node": ">=0.6.19" + } + }, + "node_modules/string-length": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/string-length/-/string-length-4.0.1.tgz", + "integrity": "sha512-PKyXUd0LK0ePjSOnWn34V2uD6acUWev9uy0Ft05k0E8xRW+SKcA0F7eMr7h5xlzfn+4O3N+55rduYyet3Jk+jw==", + "dev": true, + "dependencies": { + "char-regex": "^1.0.2", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/stringify-object": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/stringify-object/-/stringify-object-3.3.0.tgz", + "integrity": "sha512-rHqiFh1elqCQ9WPLIC8I0Q/g/wj5J1eMkyoiD6eoQApWHP0FtlK7rqnhmabL5VUY9JQCcqwwvlOaSuutekgyrw==", + "dev": true, + "dependencies": { + "get-own-enumerable-property-symbols": "^3.0.0", + "is-obj": "^1.0.1", + "is-regexp": "^1.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-bom": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", + "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-eof": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", + "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/strip-final-newline": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", + "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/supports-hyperlinks": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/supports-hyperlinks/-/supports-hyperlinks-2.1.0.tgz", + "integrity": "sha512-zoE5/e+dnEijk6ASB6/qrK+oYdm2do1hjoLWrqUC/8WEIW1gbxFcKuBof7sW8ArN6e+AYvsE8HBGiVRWL/F5CA==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0", + "supports-color": "^7.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/symbol-tree": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/symbol-tree/-/symbol-tree-3.2.4.tgz", + "integrity": "sha512-9QNk5KwDF+Bvz+PyObkmSYjI5ksVUYtjW7AU22r2NKcfLJcXp96hkDWU3+XndOsUb+AQ9QhfzfCT2O+CNWT5Tw==", + "dev": true + }, + "node_modules/tar": { + "version": "6.1.15", + "resolved": "https://registry.npmjs.org/tar/-/tar-6.1.15.tgz", + "integrity": "sha512-/zKt9UyngnxIT/EAGYuxaMYgOIJiP81ab9ZfkILq4oNLPFX50qyYmu7jRj9qeXoxmJHjGlbH0+cm2uy1WCs10A==", + "dev": true, + "optional": true, + "peer": true, + "dependencies": { + "chownr": "^2.0.0", + "fs-minipass": "^2.0.0", + "minipass": "^5.0.0", + "minizlib": "^2.1.1", + "mkdirp": "^1.0.3", + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/terminal-link": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/terminal-link/-/terminal-link-2.1.1.tgz", + "integrity": "sha512-un0FmiRUQNr5PJqy9kP7c40F5BOfpGlYTrxonDChEZB7pzZxRNp/bt+ymiy9/npwXya9KH99nJ/GXFIiUkYGFQ==", + "dev": true, + "dependencies": { + "ansi-escapes": "^4.2.1", + "supports-hyperlinks": "^2.0.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/test-exclude": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", + "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==", + "dev": true, + "dependencies": { + "@istanbuljs/schema": "^0.1.2", + "glob": "^7.1.4", + "minimatch": "^3.0.4" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/throat": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/throat/-/throat-5.0.0.tgz", + "integrity": "sha512-fcwX4mndzpLQKBS1DVYhGAcYaYt7vsHNIvQV+WXMvnow5cgjPphq5CaayLaGsjRdSCKZFNGt7/GYAuXaNOiYCA==", + "dev": true + }, + "node_modules/through": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", + "dev": true + }, + "node_modules/tmpl": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.4.tgz", + "integrity": "sha1-I2QN17QtAEM5ERQIIOXPRA5SHdE=", + "dev": true + }, + "node_modules/to-fast-properties": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", + "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/to-object-path": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", + "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", + "dev": true, + "dependencies": { + "kind-of": "^3.0.2" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/to-object-path/node_modules/kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "dependencies": { + "is-buffer": "^1.1.5" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/to-regex": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz", + "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", + "dev": true, + "dependencies": { + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "regex-not": "^1.0.2", + "safe-regex": "^1.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/tough-cookie": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", + "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==", + "dev": true, + "dependencies": { + "psl": "^1.1.28", + "punycode": "^2.1.1" + }, + "engines": { + "node": ">=0.8" + } + }, + "node_modules/tr46": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-2.0.2.tgz", + "integrity": "sha512-3n1qG+/5kg+jrbTzwAykB5yRYtQCTqOGKq5U5PE3b0a1/mzo6snDhjGS0zJVJunO0NrT3Dg1MLy5TjWP/UJppg==", + "dev": true, + "dependencies": { + "punycode": "^2.1.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true + }, + "node_modules/tunnel-agent": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", + "dev": true, + "dependencies": { + "safe-buffer": "^5.0.1" + }, + "engines": { + "node": "*" + } + }, + "node_modules/tweetnacl": { + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", + "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", + "dev": true + }, + "node_modules/type-check": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", + "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", + "dev": true, + "dependencies": { + "prelude-ls": "~1.1.2" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/type-detect": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", + "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/type-fest": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/typedarray-to-buffer": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", + "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==", + "dev": true, + "dependencies": { + "is-typedarray": "^1.0.0" + } + }, + "node_modules/union-value": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz", + "integrity": "sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==", + "dev": true, + "dependencies": { + "arr-union": "^3.1.0", + "get-value": "^2.0.6", + "is-extendable": "^0.1.1", + "set-value": "^2.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/union-value/node_modules/extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "dependencies": { + "is-extendable": "^0.1.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/union-value/node_modules/set-value": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz", + "integrity": "sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==", + "dev": true, + "dependencies": { + "extend-shallow": "^2.0.1", + "is-extendable": "^0.1.1", + "is-plain-object": "^2.0.3", + "split-string": "^3.0.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/unset-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", + "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", + "dev": true, + "dependencies": { + "has-value": "^0.3.1", + "isobject": "^3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/unset-value/node_modules/has-value": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz", + "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=", + "dev": true, + "dependencies": { + "get-value": "^2.0.3", + "has-values": "^0.1.4", + "isobject": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/unset-value/node_modules/has-value/node_modules/isobject": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", + "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", + "dev": true, + "dependencies": { + "isarray": "1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/unset-value/node_modules/has-values": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz", + "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/urix": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", + "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", + "deprecated": "Please see https://github.com/lydell/urix#deprecated", + "dev": true + }, + "node_modules/use": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", + "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/utf-8-validate": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-5.0.4.tgz", + "integrity": "sha512-MEF05cPSq3AwJ2C7B7sHAA6i53vONoZbMGX8My5auEVm6W+dJ2Jd/TZPyGJ5CH42V2XtbI5FD28HeHeqlPzZ3Q==", + "dev": true, + "hasInstallScript": true, + "optional": true, + "peer": true, + "dependencies": { + "node-gyp-build": "^4.2.0" + } + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "dev": true, + "optional": true, + "peer": true + }, + "node_modules/uuid": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", + "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", + "deprecated": "Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.", + "dev": true, + "bin": { + "uuid": "bin/uuid" + } + }, + "node_modules/v8-to-istanbul": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/v8-to-istanbul/-/v8-to-istanbul-7.1.0.tgz", + "integrity": "sha512-uXUVqNUCLa0AH1vuVxzi+MI4RfxEOKt9pBgKwHbgH7st8Kv2P1m+jvWNnektzBh5QShF3ODgKmUFCf38LnVz1g==", + "dev": true, + "dependencies": { + "@types/istanbul-lib-coverage": "^2.0.1", + "convert-source-map": "^1.6.0", + "source-map": "^0.7.3" + }, + "engines": { + "node": ">=10.10.0" + } + }, + "node_modules/v8-to-istanbul/node_modules/source-map": { + "version": "0.7.3", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz", + "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/validate-npm-package-license": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "dev": true, + "dependencies": { + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" + } + }, + "node_modules/verror": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", + "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", + "dev": true, + "engines": [ + "node >=0.6.0" + ], + "dependencies": { + "assert-plus": "^1.0.0", + "core-util-is": "1.0.2", + "extsprintf": "^1.2.0" + } + }, + "node_modules/w3c-hr-time": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz", + "integrity": "sha512-z8P5DvDNjKDoFIHK7q8r8lackT6l+jo/Ye3HOle7l9nICP9lf1Ci25fy9vHd0JOWewkIFzXIEig3TdKT7JQ5fQ==", + "deprecated": "Use your platform's native performance.now() and performance.timeOrigin.", + "dev": true, + "dependencies": { + "browser-process-hrtime": "^1.0.0" + } + }, + "node_modules/w3c-xmlserializer": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/w3c-xmlserializer/-/w3c-xmlserializer-2.0.0.tgz", + "integrity": "sha512-4tzD0mF8iSiMiNs30BiLO3EpfGLZUT2MSX/G+o7ZywDzliWQ3OPtTZ0PTC3B3ca1UAf4cJMHB+2Bf56EriJuRA==", + "dev": true, + "dependencies": { + "xml-name-validator": "^3.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/walker": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/walker/-/walker-1.0.7.tgz", + "integrity": "sha1-L3+bj9ENZ3JisYqITijRlhjgKPs=", + "dev": true, + "dependencies": { + "makeerror": "1.0.x" + } + }, + "node_modules/webidl-conversions": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-6.1.0.tgz", + "integrity": "sha512-qBIvFLGiBpLjfwmYAaHPXsn+ho5xZnGvyGvsarywGNc8VyQJUMHJ8OBKGGrPER0okBeMDaan4mNBlgBROxuI8w==", + "dev": true, + "engines": { + "node": ">=10.4" + } + }, + "node_modules/whatwg-encoding": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-1.0.5.tgz", + "integrity": "sha512-b5lim54JOPN9HtzvK9HFXvBma/rnfFeqsic0hSpjtDbVxR3dJKLc+KB4V6GgiGOvl7CY/KNh8rxSo9DKQrnUEw==", + "dev": true, + "dependencies": { + "iconv-lite": "0.4.24" + } + }, + "node_modules/whatwg-mimetype": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz", + "integrity": "sha512-M4yMwr6mAnQz76TbJm914+gPpB/nCwvZbJU28cUD6dR004SAxDLOOSUaB1JDRqLtaOV/vi0IC5lEAGFgrjGv/g==", + "dev": true + }, + "node_modules/whatwg-url": { + "version": "8.4.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-8.4.0.tgz", + "integrity": "sha512-vwTUFf6V4zhcPkWp/4CQPr1TW9Ml6SF4lVyaIMBdJw5i6qUUJ1QWM4Z6YYVkfka0OUIzVo/0aNtGVGk256IKWw==", + "dev": true, + "dependencies": { + "lodash.sortby": "^4.7.0", + "tr46": "^2.0.2", + "webidl-conversions": "^6.1.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "which": "bin/which" + } + }, + "node_modules/which-module": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", + "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", + "dev": true + }, + "node_modules/which-pm-runs": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/which-pm-runs/-/which-pm-runs-1.0.0.tgz", + "integrity": "sha1-Zws6+8VS4LVd9rd4DKdGFfI60cs=", + "dev": true + }, + "node_modules/wide-align": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.5.tgz", + "integrity": "sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==", + "dev": true, + "optional": true, + "peer": true, + "dependencies": { + "string-width": "^1.0.2 || 2 || 3 || 4" + } + }, + "node_modules/word-wrap": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", + "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "dev": true + }, + "node_modules/write-file-atomic": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz", + "integrity": "sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q==", + "dev": true, + "dependencies": { + "imurmurhash": "^0.1.4", + "is-typedarray": "^1.0.0", + "signal-exit": "^3.0.2", + "typedarray-to-buffer": "^3.1.5" + } + }, + "node_modules/ws": { + "version": "7.4.2", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.4.2.tgz", + "integrity": "sha512-T4tewALS3+qsrpGI/8dqNMLIVdq/g/85U98HPMa6F0m6xTbvhXU6RCQLqPH3+SlomNV/LdY6RXEbBpMH6EOJnA==", + "dev": true, + "engines": { + "node": ">=8.3.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": "^5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, + "node_modules/xml-name-validator": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-3.0.0.tgz", + "integrity": "sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw==", + "dev": true + }, + "node_modules/xmlchars": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz", + "integrity": "sha512-JZnDKK8B0RCDw84FNdDAIpZK+JuJw+s7Lz8nksI7SIuU3UXJJslUthsi+uWBUYOwPFwW7W7PRLRfUKpxjtjFCw==", + "dev": true + }, + "node_modules/y18n": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.1.tgz", + "integrity": "sha512-wNcy4NvjMYL8gogWWYAO7ZFWFfHcbdbE57tZO8e4cbpj8tfUcwrwqSl3ad8HxpYWCdXcJUCeKKZS62Av1affwQ==", + "dev": true + }, + "node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true + }, + "node_modules/yaml": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.0.tgz", + "integrity": "sha512-yr2icI4glYaNG+KWONODapy2/jDdMSDnrONSjblABjD9B4Z5LgiircSt8m8sRZFNi08kG9Sm0uSHtEmP3zaEGg==", + "dev": true, + "engines": { + "node": ">= 6" + } + }, + "node_modules/yargs": { + "version": "15.4.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", + "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", + "dev": true, + "dependencies": { + "cliui": "^6.0.0", + "decamelize": "^1.2.0", + "find-up": "^4.1.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^4.2.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^18.1.2" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/yargs-parser": { + "version": "18.1.3", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", + "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", + "dev": true, + "dependencies": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/yargs/node_modules/find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "dependencies": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/yargs/node_modules/locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "dependencies": { + "p-locate": "^4.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/yargs/node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/yargs/node_modules/p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "dependencies": { + "p-limit": "^2.2.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + } + }, "dependencies": { "@babel/code-frame": { "version": "7.12.11", @@ -530,32 +7961,6 @@ "rimraf": "^3.0.0", "slash": "^3.0.0", "strip-ansi": "^6.0.0" - }, - "dependencies": { - "ansi-regex": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", - "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", - "dev": true - }, - "rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "dev": true, - "requires": { - "glob": "^7.1.3" - } - }, - "strip-ansi": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", - "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", - "dev": true, - "requires": { - "ansi-regex": "^5.0.0" - } - } } }, "@jest/environment": { @@ -700,6 +8105,25 @@ "chalk": "^4.0.0" } }, + "@mapbox/node-pre-gyp": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/@mapbox/node-pre-gyp/-/node-pre-gyp-1.0.10.tgz", + "integrity": "sha512-4ySo4CjzStuprMwk35H5pPbkymjv1SF3jGLj6rAHp/xT/RF7TL7bd9CTm1xDY49K2qF7jmR/g7k+SkLETP6opA==", + "dev": true, + "optional": true, + "peer": true, + "requires": { + "detect-libc": "^2.0.0", + "https-proxy-agent": "^5.0.0", + "make-dir": "^3.1.0", + "node-fetch": "^2.6.7", + "nopt": "^5.0.0", + "npmlog": "^5.0.1", + "rimraf": "^3.0.2", + "semver": "^7.3.5", + "tar": "^6.1.11" + } + }, "@sinonjs/commons": { "version": "1.8.2", "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.8.2.tgz", @@ -718,23 +8142,6 @@ "@sinonjs/commons": "^1.7.0" } }, - "@sinonjs/samsam": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/@sinonjs/samsam/-/samsam-5.3.1.tgz", - "integrity": "sha512-1Hc0b1TtyfBu8ixF/tpfSHTVWKwCBLY4QJbkgnE7HcwyvT2xArDxb4K7dMgqRm3szI+LJbzmW/s4xxEhv6hwDg==", - "dev": true, - "requires": { - "@sinonjs/commons": "^1.6.0", - "lodash.get": "^4.4.2", - "type-detect": "^4.0.8" - } - }, - "@sinonjs/text-encoding": { - "version": "0.7.1", - "resolved": "https://registry.npmjs.org/@sinonjs/text-encoding/-/text-encoding-0.7.1.tgz", - "integrity": "sha512-+iTbntw2IZPb/anVDbypzfQa+ay64MW0Zo8aJ8gZPWMMK6/OubMVb6lUPMagqjOPnmtauXnFCACVl3O7ogjeqQ==", - "dev": true - }, "@types/babel__core": { "version": "7.1.12", "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.1.12.tgz", @@ -864,7 +8271,9 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", - "dev": true + "dev": true, + "optional": true, + "peer": true }, "acorn": { "version": "7.4.1", @@ -888,6 +8297,17 @@ "integrity": "sha512-OPdCF6GsMIP+Az+aWfAAOEt2/+iVDKE7oy6lJ098aoe59oAmK76qV6Gw60SbZ8jHuG2wH058GF4pLFbYamYrVA==", "dev": true }, + "agent-base": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "dev": true, + "optional": true, + "peer": true, + "requires": { + "debug": "4" + } + }, "aggregate-error": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", @@ -934,9 +8354,9 @@ } }, "ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true }, "ansi-styles": { @@ -959,51 +8379,23 @@ } }, "aproba": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", - "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", - "dev": true + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/aproba/-/aproba-2.0.0.tgz", + "integrity": "sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==", + "dev": true, + "optional": true, + "peer": true }, "are-we-there-yet": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz", - "integrity": "sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-2.0.0.tgz", + "integrity": "sha512-Ci/qENmwHnsYo9xKIcUJN5LeDKdJ6R1Z1j9V/J5wyq8nh/mYPEpIKJbBZXtZjG04HiK7zV/p6Vs9952MrMeUIw==", "dev": true, + "optional": true, + "peer": true, "requires": { "delegates": "^1.0.0", - "readable-stream": "^2.0.6" - }, - "dependencies": { - "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", - "dev": true - }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - } + "readable-stream": "^3.6.0" } }, "argparse": { @@ -1069,7 +8461,8 @@ "asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", + "dev": true }, "atob": { "version": "2.1.2", @@ -1294,6 +8687,8 @@ "resolved": "https://registry.npmjs.org/bufferutil/-/bufferutil-4.0.3.tgz", "integrity": "sha512-yEYTwGndELGvfXsImMBLop58eaGW+YdONi1fNjTINSY98tmMmFijBG6WXgdkfuLNt4imzQNtIE+eBp1PVpMCSw==", "dev": true, + "optional": true, + "peer": true, "requires": { "node-gyp-build": "^4.2.0" } @@ -1351,13 +8746,15 @@ "dev": true }, "canvas": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/canvas/-/canvas-2.6.1.tgz", - "integrity": "sha512-S98rKsPcuhfTcYbtF53UIJhcbgIAK533d1kJKMwsMwAIFgfd58MOyxRud3kktlzWiEkFliaJtvyZCBtud/XVEA==", + "version": "2.11.2", + "resolved": "https://registry.npmjs.org/canvas/-/canvas-2.11.2.tgz", + "integrity": "sha512-ItanGBMrmRV7Py2Z+Xhs7cT+FNt5K0vPL4p9EZ/UX/Mu7hFbkxSjKF2KVtPwX7UYWp7dRKnrTvReflgrItJbdw==", "dev": true, + "optional": true, + "peer": true, "requires": { - "nan": "^2.14.0", - "node-pre-gyp": "^0.11.0", + "@mapbox/node-pre-gyp": "^1.0.0", + "nan": "^2.17.0", "simple-get": "^3.0.3" } }, @@ -1393,10 +8790,12 @@ "dev": true }, "chownr": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", - "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==", - "dev": true + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", + "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==", + "dev": true, + "optional": true, + "peer": true }, "ci-info": { "version": "2.0.0", @@ -1456,40 +8855,6 @@ "requires": { "slice-ansi": "^3.0.0", "string-width": "^4.2.0" - }, - "dependencies": { - "ansi-regex": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", - "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true - }, - "string-width": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", - "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", - "dev": true, - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.0" - } - }, - "strip-ansi": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", - "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", - "dev": true, - "requires": { - "ansi-regex": "^5.0.0" - } - } } }, "cliui": { @@ -1501,40 +8866,6 @@ "string-width": "^4.2.0", "strip-ansi": "^6.0.0", "wrap-ansi": "^6.2.0" - }, - "dependencies": { - "ansi-regex": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", - "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true - }, - "string-width": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", - "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", - "dev": true, - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.0" - } - }, - "strip-ansi": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", - "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", - "dev": true, - "requires": { - "ansi-regex": "^5.0.0" - } - } } }, "co": { @@ -1543,12 +8874,6 @@ "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=", "dev": true }, - "code-point-at": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", - "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", - "dev": true - }, "collect-v8-coverage": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/collect-v8-coverage/-/collect-v8-coverage-1.0.1.tgz", @@ -1580,10 +8905,19 @@ "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, + "color-support": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz", + "integrity": "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==", + "dev": true, + "optional": true, + "peer": true + }, "combined-stream": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dev": true, "requires": { "delayed-stream": "~1.0.0" } @@ -1603,7 +8937,8 @@ "component-emitter": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", - "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==" + "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==", + "dev": true }, "concat-map": { "version": "0.0.1", @@ -1614,8 +8949,10 @@ "console-control-strings": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", - "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=", - "dev": true + "integrity": "sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==", + "dev": true, + "optional": true, + "peer": true }, "convert-source-map": { "version": "1.7.0", @@ -1634,11 +8971,6 @@ } } }, - "cookiejar": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/cookiejar/-/cookiejar-2.1.2.tgz", - "integrity": "sha512-Mw+adcfzPxcPeI+0WlvRrr/3lGVO0bD75SxX6811cxSh1Wbxx7xZBGK1eVtDf6si8rg2lhnUjsVLMFMfbRIuwA==" - }, "copy-descriptor": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", @@ -1677,6 +9009,15 @@ "request": "^2.88.2" } }, + "cross-fetch": { + "version": "3.1.6", + "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.1.6.tgz", + "integrity": "sha512-riRvo06crlE8HiqOwIpQhxwdOk4fOeR7FVM/wXoxchFEqMNUjvbs3bfo4OTgMEMHzppd4DxFBDbyySj8Cv781g==", + "dev": true, + "requires": { + "node-fetch": "^2.6.11" + } + }, "cross-spawn": { "version": "6.0.5", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", @@ -1745,6 +9086,7 @@ "version": "4.3.1", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", + "dev": true, "requires": { "ms": "2.1.2" } @@ -1772,6 +9114,8 @@ "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-4.2.1.tgz", "integrity": "sha512-jOSne2qbyE+/r8G1VU+G/82LBs2Fs4LAsTiLSHOCOMZQl2OKZ6i8i4IyHemTe+/yIXOtTcRQMzPcgyhoFlqPkw==", "dev": true, + "optional": true, + "peer": true, "requires": { "mimic-response": "^2.0.0" } @@ -1782,12 +9126,6 @@ "integrity": "sha1-JJXduvbrh0q7Dhvp3yLS5aVEMmw=", "dev": true }, - "deep-extend": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", - "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", - "dev": true - }, "deep-is": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", @@ -1844,19 +9182,24 @@ "delayed-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", + "dev": true }, "delegates": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", - "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=", - "dev": true + "integrity": "sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==", + "dev": true, + "optional": true, + "peer": true }, "detect-libc": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz", - "integrity": "sha1-+hN8S9aY7fVc1c0CrFWfkaTEups=", - "dev": true + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.1.tgz", + "integrity": "sha512-463v3ZeIrcWtdgIg6vI6XUncguvr2TnGl4SzDXinkt9mSLpBJKXT3mW6xT3VQdDN11+WVs29pgvivTc4Lp8v+w==", + "dev": true, + "optional": true, + "peer": true }, "detect-newline": { "version": "3.1.0", @@ -1864,12 +9207,6 @@ "integrity": "sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA==", "dev": true }, - "diff": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", - "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", - "dev": true - }, "diff-sequences": { "version": "26.6.2", "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-26.6.2.tgz", @@ -2186,11 +9523,6 @@ "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", "dev": true }, - "fast-safe-stringify": { - "version": "2.0.7", - "resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.0.7.tgz", - "integrity": "sha512-Utm6CdzT+6xsDk2m8S6uL8VHxNwI6Jub+e9NYTcAms28T84pTa25GJQV9j0CY0N1rM8hK4x6grpF2BQf+2qwVA==" - }, "fb-watchman": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/fb-watchman/-/fb-watchman-2.0.1.tgz", @@ -2249,21 +9581,6 @@ "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", "dev": true }, - "form-data": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.0.tgz", - "integrity": "sha512-CKMFDglpbMi6PyN+brwB9Q/GOw0eAnsrEZDgcsH5Krhz5Od/haKHAX0NmQfha2zPPz0JpWzA7GJHGSnvCRLWsg==", - "requires": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", - "mime-types": "^2.1.12" - } - }, - "formidable": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/formidable/-/formidable-1.2.2.tgz", - "integrity": "sha512-V8gLm+41I/8kguQ4/o1D3RIHRmhYFG4pnNyonvua+40rqcEmT4+V71yaZ3B457xbbgCsCfjSPi65u/W6vK1U5Q==" - }, "fragment-cache": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", @@ -2274,12 +9591,27 @@ } }, "fs-minipass": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-1.2.7.tgz", - "integrity": "sha512-GWSSJGFy4e9GUeCcbIkED+bgAoFyj7XF1mV8rma3QW4NIqX9Kyx79N/PF61H5udOV3aY1IaMLs6pGbH71nlCTA==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", + "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==", "dev": true, + "optional": true, + "peer": true, "requires": { - "minipass": "^2.6.0" + "minipass": "^3.0.0" + }, + "dependencies": { + "minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "dev": true, + "optional": true, + "peer": true, + "requires": { + "yallist": "^4.0.0" + } + } } }, "fs.realpath": { @@ -2302,19 +9634,22 @@ "dev": true }, "gauge": { - "version": "2.7.4", - "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", - "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/gauge/-/gauge-3.0.2.tgz", + "integrity": "sha512-+5J6MS/5XksCuXq++uFRsnUd7Ovu1XenbeuIuNRJxYWjgQbPuFhT14lAvsWfqfAmnwluf1OwMjz39HjfLPci0Q==", "dev": true, + "optional": true, + "peer": true, "requires": { - "aproba": "^1.0.3", + "aproba": "^1.0.3 || ^2.0.0", + "color-support": "^1.1.2", "console-control-strings": "^1.0.0", - "has-unicode": "^2.0.0", - "object-assign": "^4.1.0", + "has-unicode": "^2.0.1", + "object-assign": "^4.1.1", "signal-exit": "^3.0.0", - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1", - "wide-align": "^1.1.0" + "string-width": "^4.2.3", + "strip-ansi": "^6.0.1", + "wide-align": "^1.1.2" } }, "gensync": { @@ -2432,8 +9767,10 @@ "has-unicode": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", - "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=", - "dev": true + "integrity": "sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==", + "dev": true, + "optional": true, + "peer": true }, "has-value": { "version": "1.0.0", @@ -2519,6 +9856,18 @@ "sshpk": "^1.7.0" } }, + "https-proxy-agent": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", + "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", + "dev": true, + "optional": true, + "peer": true, + "requires": { + "agent-base": "6", + "debug": "4" + } + }, "human-signals": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-1.1.1.tgz", @@ -2552,15 +9901,6 @@ "safer-buffer": ">= 2.1.2 < 3" } }, - "ignore-walk": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/ignore-walk/-/ignore-walk-3.0.3.tgz", - "integrity": "sha512-m7o6xuOaT1aqheYHKf8W6J5pYH85ZI9w077erOzLje3JsB1gkafkAhHHY19dqjulgIZHFm32Cp5uNZgcQqdJKw==", - "dev": true, - "requires": { - "minimatch": "^3.0.4" - } - }, "import-fresh": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", @@ -2654,12 +9994,7 @@ "inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" - }, - "ini": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ini/-/ini-2.0.0.tgz", - "integrity": "sha512-7PnF4oN3CvZF23ADhA5wRaYEQpJ8qygSkbtTXWBeXWXmEVRXK+1ITciHWwHhsjv1TmW0MgacIv6hEi5pX5NQdA==", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", "dev": true }, "ip-regex": { @@ -2771,13 +10106,10 @@ "dev": true }, "is-fullwidth-code-point": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", - "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", - "dev": true, - "requires": { - "number-is-nan": "^1.0.0" - } + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true }, "is-generator-fn": { "version": "2.1.0", @@ -3146,6 +10478,16 @@ "jest-util": "^26.6.2" } }, + "jest-fetch-mock": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/jest-fetch-mock/-/jest-fetch-mock-3.0.3.tgz", + "integrity": "sha512-Ux1nWprtLrdrH4XwE7O7InRY6psIi3GOsqNESJgMJ+M5cv4A8Lh7SN9d2V2kKRZ8ebAfcd1LNyZguAOb6JiDqw==", + "dev": true, + "requires": { + "cross-fetch": "^3.0.4", + "promise-polyfill": "^8.1.3" + } + }, "jest-get-type": { "version": "26.3.0", "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-26.3.0.tgz", @@ -3253,7 +10595,8 @@ "version": "1.2.2", "resolved": "https://registry.npmjs.org/jest-pnp-resolver/-/jest-pnp-resolver-1.2.2.tgz", "integrity": "sha512-olV41bKSMm8BdnuMsewT4jqlZ8+3TCARAXjZGT9jcoSnrfUnRCqnMoF9XEeoWjbzObpqF9dRhHQj0Xb9QdF6/w==", - "dev": true + "dev": true, + "requires": {} }, "jest-regex-util": { "version": "26.0.0", @@ -3567,12 +10910,6 @@ "verror": "1.10.0" } }, - "just-extend": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/just-extend/-/just-extend-4.1.1.tgz", - "integrity": "sha512-aWgeGFW67BP3e5181Ep1Fv2v8z//iBJfrvyTnq8wG86vEESwmonn1zPBJ0VfmT9CJq2FIT0VsETtrNFm2a+SHA==", - "dev": true - }, "kind-of": { "version": "6.0.3", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", @@ -3737,38 +11074,6 @@ "wrap-ansi": "^7.0.0" }, "dependencies": { - "ansi-regex": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", - "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true - }, - "string-width": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", - "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", - "dev": true, - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.0" - } - }, - "strip-ansi": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", - "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", - "dev": true, - "requires": { - "ansi-regex": "^5.0.0" - } - }, "wrap-ansi": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", @@ -3797,12 +11102,6 @@ "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==", "dev": true }, - "lodash.get": { - "version": "4.4.2", - "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", - "integrity": "sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=", - "dev": true - }, "lodash.sortby": { "version": "4.7.0", "resolved": "https://registry.npmjs.org/lodash.sortby/-/lodash.sortby-4.7.0.tgz", @@ -3836,12 +11135,6 @@ "wrap-ansi": "^6.2.0" }, "dependencies": { - "is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true - }, "slice-ansi": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", @@ -3859,6 +11152,7 @@ "version": "6.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dev": true, "requires": { "yallist": "^4.0.0" } @@ -3908,12 +11202,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", - "dev": true - }, - "methods": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", - "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=" + "dev": true }, "micromatch": { "version": "4.0.2", @@ -3925,20 +11214,17 @@ "picomatch": "^2.0.5" } }, - "mime": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/mime/-/mime-2.5.0.tgz", - "integrity": "sha512-ft3WayFSFUVBuJj7BMLKAQcSlItKtfjsKDDsii3rqFDAZ7t11zRe8ASw/GlmivGwVUYtwkQrxiGGpL6gFvB0ag==" - }, "mime-db": { "version": "1.45.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.45.0.tgz", - "integrity": "sha512-CkqLUxUk15hofLoLyljJSrukZi8mAtgd+yE5uO4tqRZsdsAJKv0O+rFMhVDRJgozy+yG6md5KwuXhD4ocIoP+w==" + "integrity": "sha512-CkqLUxUk15hofLoLyljJSrukZi8mAtgd+yE5uO4tqRZsdsAJKv0O+rFMhVDRJgozy+yG6md5KwuXhD4ocIoP+w==", + "dev": true }, "mime-types": { "version": "2.1.28", "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.28.tgz", "integrity": "sha512-0TO2yJ5YHYr7M2zzT7gDU1tbwHxEUWBCLt0lscSNpcdAfFyJOVEpRYNS7EXVcTLNj/25QO8gulHC5JtTzSE2UQ==", + "dev": true, "requires": { "mime-db": "1.45.0" } @@ -3953,7 +11239,9 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-2.1.0.tgz", "integrity": "sha512-wXqjST+SLt7R009ySCglWBCFpjUygmCIfD790/kVbiGmUgfYGuB14PiTd5DwVxSV4NcYHjzMkoj5LjQZwTQLEA==", - "dev": true + "dev": true, + "optional": true, + "peer": true }, "minimatch": { "version": "3.0.4", @@ -3971,57 +11259,59 @@ "dev": true }, "minipass": { - "version": "2.9.0", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-2.9.0.tgz", - "integrity": "sha512-wxfUjg9WebH+CUDX/CdbRlh5SmfZiy/hpkxaRI16Y9W56Pa75sWgd/rvFilSgrauD9NyFymP/+JFV3KwzIsJeg==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz", + "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==", "dev": true, - "requires": { - "safe-buffer": "^5.1.2", - "yallist": "^3.0.0" - }, - "dependencies": { - "yallist": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", - "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", - "dev": true - } - } + "optional": true, + "peer": true }, "minizlib": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-1.3.3.tgz", - "integrity": "sha512-6ZYMOEnmVsdCeTJVE0W9ZD+pVnE8h9Hma/iOwwRDsdQoePpoX56/8B6z3P9VNwppJuBKNRuFDRNRqRWexT9G9Q==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz", + "integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==", "dev": true, + "optional": true, + "peer": true, "requires": { - "minipass": "^2.9.0" + "minipass": "^3.0.0", + "yallist": "^4.0.0" + }, + "dependencies": { + "minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "dev": true, + "optional": true, + "peer": true, + "requires": { + "yallist": "^4.0.0" + } + } } }, - "mixin-deep": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-2.0.1.tgz", - "integrity": "sha512-imbHQNRglyaplMmjBLL3V5R6Bfq5oM+ivds3SKgc6oRtzErEnBUUc5No11Z2pilkUvl42gJvi285xTNswcKCMA==", - "dev": true - }, "mkdirp": { - "version": "0.5.5", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", - "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", "dev": true, - "requires": { - "minimist": "^1.2.5" - } + "optional": true, + "peer": true }, "ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true }, "nan": { - "version": "2.14.2", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.2.tgz", - "integrity": "sha512-M2ufzIiINKCuDfBSAUr1vWQ+vuVcA9kqx8JJUsbQi6yf1uGRyb7HfpdfUr5qLXf3B/t8dPvcjhKMmlfnP47EzQ==", - "dev": true + "version": "2.17.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.17.0.tgz", + "integrity": "sha512-2ZTgtl0nJsO0KQCjEpxcIr5D+Yv90plTitZt9JBfQvVJDS5seMl3FOvsh3+9CoYWXf/1l5OaZzzF6nDm4cagaQ==", + "dev": true, + "optional": true, + "peer": true }, "nanomatch": { "version": "1.2.13", @@ -4048,52 +11338,52 @@ "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", "dev": true }, - "needle": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/needle/-/needle-2.6.0.tgz", - "integrity": "sha512-KKYdza4heMsEfSWD7VPUIz3zX2XDwOyX2d+geb4vrERZMT5RMU6ujjaD+I5Yr54uZxQ2w6XRTAhHBbSCyovZBg==", - "dev": true, - "requires": { - "debug": "^3.2.6", - "iconv-lite": "^0.4.4", - "sax": "^1.2.4" - }, - "dependencies": { - "debug": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", - "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", - "dev": true, - "requires": { - "ms": "^2.1.1" - } - } - } - }, "nice-try": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", "dev": true }, - "nise": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/nise/-/nise-4.0.4.tgz", - "integrity": "sha512-bTTRUNlemx6deJa+ZyoCUTRvH3liK5+N6VQZ4NIw90AgDXY6iPnsqplNFf6STcj+ePk0H/xqxnP75Lr0J0Fq3A==", + "node-fetch": { + "version": "2.6.11", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.11.tgz", + "integrity": "sha512-4I6pdBY1EthSqDmJkiNk3JIT8cswwR9nfeW/cPdUagJYEQG7R95WRH74wpz7ma8Gh/9dI9FP+OU+0E4FvtA55w==", "dev": true, "requires": { - "@sinonjs/commons": "^1.7.0", - "@sinonjs/fake-timers": "^6.0.0", - "@sinonjs/text-encoding": "^0.7.1", - "just-extend": "^4.0.2", - "path-to-regexp": "^1.7.0" + "whatwg-url": "^5.0.0" + }, + "dependencies": { + "tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", + "dev": true + }, + "webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", + "dev": true + }, + "whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "dev": true, + "requires": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + } } }, "node-gyp-build": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.2.3.tgz", "integrity": "sha512-MN6ZpzmfNCRM+3t57PTJHgHyw/h4OWnZ6mR8P5j/uZtqQr46RRuDE/P+g3n0YR/AiYXeWixZZzaip77gdICfRg==", - "dev": true + "dev": true, + "optional": true, + "peer": true }, "node-int64": { "version": "0.4.0", @@ -4141,40 +11431,15 @@ } } }, - "node-pre-gyp": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/node-pre-gyp/-/node-pre-gyp-0.11.0.tgz", - "integrity": "sha512-TwWAOZb0j7e9eGaf9esRx3ZcLaE5tQ2lvYy1pb5IAaG1a2e2Kv5Lms1Y4hpj+ciXJRofIxxlt5haeQ/2ANeE0Q==", - "dev": true, - "requires": { - "detect-libc": "^1.0.2", - "mkdirp": "^0.5.1", - "needle": "^2.2.1", - "nopt": "^4.0.1", - "npm-packlist": "^1.1.6", - "npmlog": "^4.0.2", - "rc": "^1.2.7", - "rimraf": "^2.6.1", - "semver": "^5.3.0", - "tar": "^4" - }, - "dependencies": { - "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "dev": true - } - } - }, "nopt": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.3.tgz", - "integrity": "sha512-CvaGwVMztSMJLOeXPrez7fyfObdZqNUK1cPAEzLHrTybIua9pMdmmPR5YwtfNftIOMv3DPUhFaxsZMNTQO20Kg==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz", + "integrity": "sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==", "dev": true, + "optional": true, + "peer": true, "requires": { - "abbrev": "1", - "osenv": "^0.1.4" + "abbrev": "1" } }, "normalize-package-data": { @@ -4203,32 +11468,6 @@ "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", "dev": true }, - "npm-bundled": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/npm-bundled/-/npm-bundled-1.1.1.tgz", - "integrity": "sha512-gqkfgGePhTpAEgUsGEgcq1rqPXA+tv/aVBlgEzfXwA1yiUJF7xtEt3CtVwOjNYQOVknDk0F20w58Fnm3EtG0fA==", - "dev": true, - "requires": { - "npm-normalize-package-bin": "^1.0.1" - } - }, - "npm-normalize-package-bin": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/npm-normalize-package-bin/-/npm-normalize-package-bin-1.0.1.tgz", - "integrity": "sha512-EPfafl6JL5/rU+ot6P3gRSCpPDW5VmIzX959Ob1+ySFUuuYHWHekXpwdUZcKP5C+DS4GEtdJluwBjnsNDl+fSA==", - "dev": true - }, - "npm-packlist": { - "version": "1.4.8", - "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-1.4.8.tgz", - "integrity": "sha512-5+AZgwru5IevF5ZdnFglB5wNlHG1AOOuw28WhUq8/8emhBmLv6jX5by4WJCh7lW0uSYZYS6DXqIsyZVIXRZU9A==", - "dev": true, - "requires": { - "ignore-walk": "^3.0.1", - "npm-bundled": "^1.0.1", - "npm-normalize-package-bin": "^1.0.1" - } - }, "npm-run-path": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", @@ -4239,23 +11478,19 @@ } }, "npmlog": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz", - "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-5.0.1.tgz", + "integrity": "sha512-AqZtDUWOMKs1G/8lwylVjrdYgqA4d9nu8hc+0gzRxlDb1I10+FHBGMXs6aiQHFdCUUlqH99MUMuLfzWDNDtfxw==", "dev": true, + "optional": true, + "peer": true, "requires": { - "are-we-there-yet": "~1.1.2", - "console-control-strings": "~1.1.0", - "gauge": "~2.7.3", - "set-blocking": "~2.0.0" + "are-we-there-yet": "^2.0.0", + "console-control-strings": "^1.1.0", + "gauge": "^3.0.0", + "set-blocking": "^2.0.0" } }, - "number-is-nan": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", - "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", - "dev": true - }, "nwsapi": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.0.tgz", @@ -4271,8 +11506,10 @@ "object-assign": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", - "dev": true + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "dev": true, + "optional": true, + "peer": true }, "object-copy": { "version": "0.1.0", @@ -4361,28 +11598,6 @@ "word-wrap": "~1.2.3" } }, - "os-homedir": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", - "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", - "dev": true - }, - "os-tmpdir": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", - "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", - "dev": true - }, - "osenv": { - "version": "0.1.5", - "resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz", - "integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==", - "dev": true, - "requires": { - "os-homedir": "^1.0.0", - "os-tmpdir": "^1.0.0" - } - }, "p-each-series": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/p-each-series/-/p-each-series-2.2.0.tgz", @@ -4485,23 +11700,6 @@ "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", "dev": true }, - "path-to-regexp": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.8.0.tgz", - "integrity": "sha512-n43JRhlUKUAlibEJhPeir1ncUID16QnEjNpwzNdO3Lm4ywrBpBZ5oLD0I6br9evr1Y9JTqwRtAh7JLoOzAQdVA==", - "dev": true, - "requires": { - "isarray": "0.0.1" - }, - "dependencies": { - "isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", - "dev": true - } - } - }, "path-type": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", @@ -4575,20 +11773,12 @@ "ansi-regex": "^5.0.0", "ansi-styles": "^4.0.0", "react-is": "^17.0.1" - }, - "dependencies": { - "ansi-regex": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", - "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", - "dev": true - } } }, - "process-nextick-args": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", - "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", + "promise-polyfill": { + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/promise-polyfill/-/promise-polyfill-8.3.0.tgz", + "integrity": "sha512-H5oELycFml5yto/atYqmjyigJoAo3+OXwolYiH7OfQuYlAqhxNvTfiNMbV9hsC6Yp83yE5r2KTVmtrG6R9i6Pg==", "dev": true }, "prompts": { @@ -4623,31 +11813,6 @@ "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", "dev": true }, - "qs": { - "version": "6.9.6", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.9.6.tgz", - "integrity": "sha512-TIRk4aqYLNoJUbd+g2lEdz5kLWIuTMRagAXxl78Q0RiVjAOugHmeKNGdd3cwo/ktpf9aL9epCfFqWDEKysUlLQ==" - }, - "rc": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", - "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", - "dev": true, - "requires": { - "deep-extend": "^0.6.0", - "ini": "~1.3.0", - "minimist": "^1.2.0", - "strip-json-comments": "~2.0.1" - }, - "dependencies": { - "ini": { - "version": "1.3.8", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", - "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", - "dev": true - } - } - }, "react-is": { "version": "17.0.1", "resolved": "https://registry.npmjs.org/react-is/-/react-is-17.0.1.tgz", @@ -4728,6 +11893,9 @@ "version": "3.6.0", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "dev": true, + "optional": true, + "peer": true, "requires": { "inherits": "^2.0.3", "string_decoder": "^1.1.1", @@ -4897,9 +12065,9 @@ "dev": true }, "rimraf": { - "version": "2.7.1", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", - "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", "dev": true, "requires": { "glob": "^7.1.3" @@ -4923,7 +12091,8 @@ "safe-buffer": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true }, "safe-regex": { "version": "1.1.0", @@ -5081,12 +12250,6 @@ } } }, - "sax": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", - "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==", - "dev": true - }, "saxes": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/saxes/-/saxes-5.0.1.tgz", @@ -5097,9 +12260,10 @@ } }, "semver": { - "version": "7.3.4", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.4.tgz", - "integrity": "sha512-tCfb2WLjqFAtXn4KEdxIhalnRtoKFN7nAwj0B3ZXCbQloV2tq5eDbcTmT68JJD3nRJq24/XgxtQKFIpQdtvmVw==", + "version": "7.5.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.1.tgz", + "integrity": "sha512-Wvss5ivl8TMRZXXESstBA4uR5iXgEN/VC5/sOcuXdVLzcdkz4HWetIoRfG5gb5X+ij/G9rw9YoGn3QoQ8OCSpw==", + "dev": true, "requires": { "lru-cache": "^6.0.0" } @@ -5122,15 +12286,6 @@ "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", "dev": true }, - "set-value": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/set-value/-/set-value-3.0.2.tgz", - "integrity": "sha512-npjkVoz+ank0zjlV9F47Fdbjfj/PfXyVhZvGALWsyIYU/qrMzpi6avjKW3/7KeSU2Df3I46BrN1xOI1+6vW0hA==", - "dev": true, - "requires": { - "is-plain-object": "^2.0.4" - } - }, "shebang-command": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", @@ -5163,33 +12318,23 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz", "integrity": "sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==", - "dev": true + "dev": true, + "optional": true, + "peer": true }, "simple-get": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-3.1.0.tgz", "integrity": "sha512-bCR6cP+aTdScaQCnQKbPKtJOKDp/hj9EDLJo3Nw4y1QksqaovlW/bnptB6/c1e+qmNIDHRK+oXFDdEqBT8WzUA==", "dev": true, + "optional": true, + "peer": true, "requires": { "decompress-response": "^4.2.0", "once": "^1.3.1", "simple-concat": "^1.0.0" } }, - "sinon": { - "version": "9.2.4", - "resolved": "https://registry.npmjs.org/sinon/-/sinon-9.2.4.tgz", - "integrity": "sha512-zljcULZQsJxVra28qIAL6ow1Z9tpattkCTEJR4RBP3TGc00FcttsP5pK284Nas5WjMZU5Yzy3kAIp3B3KRf5Yg==", - "dev": true, - "requires": { - "@sinonjs/commons": "^1.8.1", - "@sinonjs/fake-timers": "^6.0.1", - "@sinonjs/samsam": "^5.3.1", - "diff": "^4.0.2", - "nise": "^4.0.4", - "supports-color": "^7.1.0" - } - }, "sisteransi": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", @@ -5211,14 +12356,6 @@ "ansi-styles": "^4.0.0", "astral-regex": "^2.0.0", "is-fullwidth-code-point": "^3.0.0" - }, - "dependencies": { - "is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true - } } }, "snapdragon": { @@ -5492,6 +12629,17 @@ "integrity": "sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks=", "dev": true }, + "string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "dev": true, + "optional": true, + "peer": true, + "requires": { + "safe-buffer": "~5.2.0" + } + }, "string-argv": { "version": "0.3.1", "resolved": "https://registry.npmjs.org/string-argv/-/string-argv-0.3.1.tgz", @@ -5506,42 +12654,17 @@ "requires": { "char-regex": "^1.0.2", "strip-ansi": "^6.0.0" - }, - "dependencies": { - "ansi-regex": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", - "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", - "dev": true - }, - "strip-ansi": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", - "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", - "dev": true, - "requires": { - "ansi-regex": "^5.0.0" - } - } } }, "string-width": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", "dev": true, "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" - } - }, - "string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "requires": { - "safe-buffer": "~5.2.0" + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" } }, "stringify-object": { @@ -5556,12 +12679,12 @@ } }, "strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", "dev": true, "requires": { - "ansi-regex": "^2.0.0" + "ansi-regex": "^5.0.1" } }, "strip-bom": { @@ -5582,30 +12705,6 @@ "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", "dev": true }, - "strip-json-comments": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", - "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", - "dev": true - }, - "superagent": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/superagent/-/superagent-6.1.0.tgz", - "integrity": "sha512-OUDHEssirmplo3F+1HWKUrUjvnQuA+nZI6i/JJBdXb5eq9IyEQwPyPpqND+SSsxf6TygpBEkUjISVRN4/VOpeg==", - "requires": { - "component-emitter": "^1.3.0", - "cookiejar": "^2.1.2", - "debug": "^4.1.1", - "fast-safe-stringify": "^2.0.7", - "form-data": "^3.0.0", - "formidable": "^1.2.2", - "methods": "^1.1.2", - "mime": "^2.4.6", - "qs": "^6.9.4", - "readable-stream": "^3.6.0", - "semver": "^7.3.2" - } - }, "supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", @@ -5632,26 +12731,19 @@ "dev": true }, "tar": { - "version": "4.4.13", - "resolved": "https://registry.npmjs.org/tar/-/tar-4.4.13.tgz", - "integrity": "sha512-w2VwSrBoHa5BsSyH+KxEqeQBAllHhccyMFVHtGtdMpF4W7IRWfZjFiQceJPChOeTsSDVUpER2T8FA93pr0L+QA==", + "version": "6.1.15", + "resolved": "https://registry.npmjs.org/tar/-/tar-6.1.15.tgz", + "integrity": "sha512-/zKt9UyngnxIT/EAGYuxaMYgOIJiP81ab9ZfkILq4oNLPFX50qyYmu7jRj9qeXoxmJHjGlbH0+cm2uy1WCs10A==", "dev": true, + "optional": true, + "peer": true, "requires": { - "chownr": "^1.1.1", - "fs-minipass": "^1.2.5", - "minipass": "^2.8.6", - "minizlib": "^1.2.1", - "mkdirp": "^0.5.0", - "safe-buffer": "^5.1.2", - "yallist": "^3.0.3" - }, - "dependencies": { - "yallist": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", - "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", - "dev": true - } + "chownr": "^2.0.0", + "fs-minipass": "^2.0.0", + "minipass": "^5.0.0", + "minizlib": "^2.1.1", + "mkdirp": "^1.0.3", + "yallist": "^4.0.0" } }, "terminal-link": { @@ -5911,6 +13003,8 @@ "resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-5.0.4.tgz", "integrity": "sha512-MEF05cPSq3AwJ2C7B7sHAA6i53vONoZbMGX8My5auEVm6W+dJ2Jd/TZPyGJ5CH42V2XtbI5FD28HeHeqlPzZ3Q==", "dev": true, + "optional": true, + "peer": true, "requires": { "node-gyp-build": "^4.2.0" } @@ -5918,7 +13012,10 @@ "util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "dev": true, + "optional": true, + "peer": true }, "uuid": { "version": "3.4.0", @@ -6047,12 +13144,14 @@ "dev": true }, "wide-align": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", - "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.5.tgz", + "integrity": "sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==", "dev": true, + "optional": true, + "peer": true, "requires": { - "string-width": "^1.0.2 || 2" + "string-width": "^1.0.2 || 2 || 3 || 4" } }, "word-wrap": { @@ -6070,40 +13169,6 @@ "ansi-styles": "^4.0.0", "string-width": "^4.1.0", "strip-ansi": "^6.0.0" - }, - "dependencies": { - "ansi-regex": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", - "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", - "dev": true - }, - "is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true - }, - "string-width": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", - "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", - "dev": true, - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.0" - } - }, - "strip-ansi": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", - "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", - "dev": true, - "requires": { - "ansi-regex": "^5.0.0" - } - } } }, "wrappy": { @@ -6128,7 +13193,8 @@ "version": "7.4.2", "resolved": "https://registry.npmjs.org/ws/-/ws-7.4.2.tgz", "integrity": "sha512-T4tewALS3+qsrpGI/8dqNMLIVdq/g/85U98HPMa6F0m6xTbvhXU6RCQLqPH3+SlomNV/LdY6RXEbBpMH6EOJnA==", - "dev": true + "dev": true, + "requires": {} }, "xml-name-validator": { "version": "3.0.0", @@ -6151,7 +13217,8 @@ "yallist": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "dev": true }, "yaml": { "version": "1.10.0", @@ -6178,12 +13245,6 @@ "yargs-parser": "^18.1.2" }, "dependencies": { - "ansi-regex": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", - "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", - "dev": true - }, "find-up": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", @@ -6194,12 +13255,6 @@ "path-exists": "^4.0.0" } }, - "is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "dev": true - }, "locate-path": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", @@ -6226,26 +13281,6 @@ "requires": { "p-limit": "^2.2.0" } - }, - "string-width": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", - "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", - "dev": true, - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.0" - } - }, - "strip-ansi": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", - "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", - "dev": true, - "requires": { - "ansi-regex": "^5.0.0" - } } } }, diff --git a/package.json b/package.json index 72f6feb2..9bdde4f0 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,10 @@ }, "jest": { "verbose": true, - "testURL": "http://localhost/" + "testURL": "http://localhost/", + "setupFiles": [ + "./setupJest.js" + ] }, "lint-staged": { "*.{js,json,css,md}": [ @@ -31,24 +34,15 @@ "git add" ] }, - "dependencies": { - "superagent": "^6.1.0" - }, + "dependencies": {}, "devDependencies": { "coveralls": "^3.1.0", "husky": "^4.3.0", "jest": "^26.6.3", - "lint-staged": "^10.4.0", - "prettier": "^2.1.2", - "sinon": "^9.0.3", - "canvas": "^2.6.1", - "bufferutil": "^4.0.1", - "utf-8-validate": "^5.0.2", + "jest-fetch-mock": "^3.0.3", "jest-resolve": "^26.6.2", - "minimist": "^1.2.5", - "set-value": ">=2.0.1", - "mixin-deep": ">=1.3.2", - "ini": ">=1.3.6" + "lint-staged": "^10.4.0", + "prettier": "^2.1.2" }, "keywords": [ "spotify", diff --git a/setupJest.js b/setupJest.js new file mode 100644 index 00000000..96bccd4a --- /dev/null +++ b/setupJest.js @@ -0,0 +1 @@ +require("jest-fetch-mock").enableMocks(); diff --git a/src/authentication-request.js b/src/authentication-request.js index 6d574a26..d31b4dd6 100644 --- a/src/authentication-request.js +++ b/src/authentication-request.js @@ -1,12 +1,12 @@ -'use strict'; +"use strict"; -var Request = require('./base-request'); +var Request = require("./base-request"); -var DEFAULT_HOST = 'accounts.spotify.com', +var DEFAULT_HOST = "accounts.spotify.com", DEFAULT_PORT = 443, - DEFAULT_SCHEME = 'https'; + DEFAULT_SCHEME = "https"; -module.exports.builder = function() { +module.exports.builder = function () { return Request.builder() .withHost(DEFAULT_HOST) .withPort(DEFAULT_PORT) diff --git a/src/base-request.js b/src/base-request.js index ed8d946f..3d55f295 100644 --- a/src/base-request.js +++ b/src/base-request.js @@ -1,8 +1,8 @@ -'use strict'; +"use strict"; -var Request = function(builder) { +var Request = function (builder) { if (!builder) { - throw new Error('No builder supplied to constructor'); + throw new Error("No builder supplied to constructor"); } this.host = builder.host; @@ -12,42 +12,45 @@ var Request = function(builder) { this.bodyParameters = builder.bodyParameters; this.headers = builder.headers; this.path = builder.path; + this.timeout = builder.timeout; }; -Request.prototype._getter = function(key) { - return function() { +Request.prototype._getter = function (key) { + return function () { return this[key]; }; }; -Request.prototype.getHost = Request.prototype._getter('host'); +Request.prototype.getHost = Request.prototype._getter("host"); -Request.prototype.getPort = Request.prototype._getter('port'); +Request.prototype.getPort = Request.prototype._getter("port"); -Request.prototype.getScheme = Request.prototype._getter('scheme'); +Request.prototype.getScheme = Request.prototype._getter("scheme"); -Request.prototype.getPath = Request.prototype._getter('path'); +Request.prototype.getPath = Request.prototype._getter("path"); Request.prototype.getQueryParameters = Request.prototype._getter( - 'queryParameters' + "queryParameters" ); Request.prototype.getBodyParameters = Request.prototype._getter( - 'bodyParameters' + "bodyParameters" ); -Request.prototype.getHeaders = Request.prototype._getter('headers'); +Request.prototype.getHeaders = Request.prototype._getter("headers"); -Request.prototype.getURI = function() { +Request.prototype.getTimeout = Request.prototype._getter("timeout"); + +Request.prototype.getURI = function () { if (!this.scheme || !this.host || !this.port) { - throw new Error('Missing components necessary to construct URI'); + throw new Error("Missing components necessary to construct URI"); } - var uri = this.scheme + '://' + this.host; + var uri = this.scheme + "://" + this.host; if ( - (this.scheme === 'http' && this.port !== 80) || - (this.scheme === 'https' && this.port !== 443) + (this.scheme === "http" && this.port !== 80) || + (this.scheme === "https" && this.port !== 443) ) { - uri += ':' + this.port; + uri += ":" + this.port; } if (this.path) { uri += this.path; @@ -55,7 +58,7 @@ Request.prototype.getURI = function() { return uri; }; -Request.prototype.getURL = function() { +Request.prototype.getURL = function () { var uri = this.getURI(); if (this.getQueryParameters()) { return uri + this.getQueryParameterString(this.getQueryParameters()); @@ -64,32 +67,32 @@ Request.prototype.getURL = function() { } }; -Request.prototype.getQueryParameterString = function() { +Request.prototype.getQueryParameterString = function () { var queryParameters = this.getQueryParameters(); if (queryParameters) { return ( - '?' + + "?" + Object.keys(queryParameters) - .filter(function(key) { + .filter(function (key) { return queryParameters[key] !== undefined; }) - .map(function(key) { - return key + '=' + queryParameters[key]; + .map(function (key) { + return key + "=" + queryParameters[key]; }) - .join('&') + .join("&") ); } }; -Request.prototype.execute = function(method, callback) { +Request.prototype.execute = function (method, callback) { if (callback) { method(this, callback); return; } var _self = this; - return new Promise(function(resolve, reject) { - method(_self, function(error, result) { + return new Promise(function (resolve, reject) { + method(_self, function (error, result) { if (error) { reject(error); } else { @@ -99,55 +102,57 @@ Request.prototype.execute = function(method, callback) { }); }; -var Builder = function() {}; +var Builder = function () {}; -Builder.prototype._setter = function(key) { - return function(value) { +Builder.prototype._setter = function (key) { + return function (value) { this[key] = value; return this; }; }; -Builder.prototype.withHost = Builder.prototype._setter('host'); +Builder.prototype.withHost = Builder.prototype._setter("host"); -Builder.prototype.withPort = Builder.prototype._setter('port'); +Builder.prototype.withPort = Builder.prototype._setter("port"); -Builder.prototype.withScheme = Builder.prototype._setter('scheme'); +Builder.prototype.withScheme = Builder.prototype._setter("scheme"); -Builder.prototype.withPath = Builder.prototype._setter('path'); +Builder.prototype.withPath = Builder.prototype._setter("path"); -Builder.prototype._assigner = function(key) { - return function() { +Builder.prototype._assigner = function (key) { + return function () { for (var i = 0; i < arguments.length; i++) { this[key] = this._assign(this[key], arguments[i]); } - + return this; }; }; Builder.prototype.withQueryParameters = Builder.prototype._assigner( - 'queryParameters' + "queryParameters" ); Builder.prototype.withBodyParameters = Builder.prototype._assigner( - 'bodyParameters' + "bodyParameters" ); -Builder.prototype.withHeaders = Builder.prototype._assigner('headers'); +Builder.prototype.withHeaders = Builder.prototype._assigner("headers"); + +Builder.prototype.withTimeout = Builder.prototype._setter("timeout"); -Builder.prototype.withAuth = function(accessToken) { +Builder.prototype.withAuth = function (accessToken) { if (accessToken) { - this.withHeaders({ Authorization: 'Bearer ' + accessToken }); + this.withHeaders({ Authorization: "Bearer " + accessToken }); } return this; }; -Builder.prototype._assign = function(src, obj) { +Builder.prototype._assign = function (src, obj) { if (obj && Array.isArray(obj)) { return obj; } - if (obj && typeof obj === 'string') { + if (obj && typeof obj === "string") { return obj; } if (obj && Object.keys(obj).length > 0) { @@ -156,10 +161,10 @@ Builder.prototype._assign = function(src, obj) { return src; }; -Builder.prototype.build = function() { +Builder.prototype.build = function () { return new Request(this); }; -module.exports.builder = function() { +module.exports.builder = function () { return new Builder(); }; diff --git a/src/client.js b/src/client.js index e5a547ee..be6617f7 100644 --- a/src/client.js +++ b/src/client.js @@ -1 +1 @@ -module.exports = require('./spotify-web-api'); +module.exports = require("./spotify-web-api"); diff --git a/src/http-manager.js b/src/http-manager.js index 6c3991fa..ac842dd6 100644 --- a/src/http-manager.js +++ b/src/http-manager.js @@ -1,24 +1,29 @@ -'use strict'; +"use strict"; -var superagent = require('superagent'), - { TimeoutError, - WebapiError, - WebapiRegularError, - WebapiAuthenticationError, - WebapiPlayerError - } = require('./response-error'); +var { + TimeoutError, + WebapiError, + WebapiRegularError, + WebapiAuthenticationError, + WebapiPlayerError, +} = require("./response-error"); var HttpManager = {}; /* Create superagent options from the base request */ -var _getParametersFromRequest = function(request) { +var _getParametersFromRequest = function (request) { var options = {}; if (request.getQueryParameters()) { - options.query = request.getQueryParameters(); + options.query = new URLSearchParams( + request.getQueryParameters() + ).toString(); } - if (request.getHeaders() && request.getHeaders()['Content-Type'] === 'application/json') { + if ( + request.getHeaders() && + request.getHeaders()["Content-Type"] === "application/json" + ) { options.data = JSON.stringify(request.getBodyParameters()); } else if (request.getBodyParameters()) { options.data = request.getBodyParameters(); @@ -27,59 +32,90 @@ var _getParametersFromRequest = function(request) { if (request.getHeaders()) { options.headers = request.getHeaders(); } + + if (request.getTimeout()) { + options.timeout = request.getTimeout(); + } + return options; }; -var _toError = function(response) { - if (typeof response.body === 'object' && response.body.error && typeof response.body.error === 'object' && response.body.error.reason) { - return new WebapiPlayerError(response.body, response.headers, response.statusCode); +/** + * @param {Response} response + */ +var _toError = async function (response) { + const body = await response.json(); + + if ( + typeof body === "object" && + typeof body.error === "object" && + typeof body.error.reason === "string" + ) { + return new WebapiPlayerError(body, response.headers, response.status); } - if (typeof response.body === 'object' && response.body.error && typeof response.body.error === 'object') { - return new WebapiRegularError(response.body, response.headers, response.statusCode); + if (typeof body === "object" && typeof body.error === "object") { + return new WebapiRegularError(body, response.headers, response.status); } - if (typeof response.body === 'object' && response.body.error && typeof response.body.error === 'string') { - return new WebapiAuthenticationError(response.body, response.headers, response.statusCode); + if (typeof body === "object" && typeof body.error === "string") { + return new WebapiAuthenticationError( + body, + response.headers, + response.status + ); } - + /* Other type of error, or unhandled Web API error format */ - return new WebapiError(response.body, response.headers, response.statusCode, response.body); + return new WebapiError(body, response.headers, response.status, body); }; /* Make the request to the Web API */ -HttpManager._makeRequest = function(method, options, uri, callback) { - var req = method.bind(superagent)(uri); +HttpManager._makeRequest = function (method, options, uri, callback) { + const headers = new Headers(options.headers || {}); + let serializationMethod = JSON.stringify; - if (options.query) { - req.query(options.query); + if (headers.get("Content-Type") === "application/x-www-form-urlencoded") { + serializationMethod = (d) => new URLSearchParams(d); } - if (options.headers) { - req.set(options.headers); - } + const controller = new AbortController(); + let timeoutId; - if (options.data) { - req.send(options.data); + if (options.timeout) { + setTimeout(() => { + controller.abort(); + }, options.timeout); } - req.end(function(err, response) { - if (err) { - if (err.timeout) { - return callback(new TimeoutError()); - } else if (err.response) { - return callback(_toError(err.response)); - } else { - return callback(err); + fetch(uri + (options.query ? "?" + options.query : ""), { + method, + headers, + body: options.data ? serializationMethod(options.data) : undefined, + signal: controller.signal, + }) + .then(async (resp) => { + clearTimeout(timeoutId); + + if (!resp.ok) { + return callback(await _toError(resp)); + } + + return callback(null, { + body: await resp.json().catch(() => null), + headers: resp.headers, + statusCode: resp.status, + }); + }) + .catch((err) => { + if (controller.signal.aborted) { + return callback( + new TimeoutError(`request took longer than ${options.timeout}ms`) + ); } - } - return callback(null, { - body: response.body, - headers: response.headers, - statusCode: response.statusCode + return callback(err); }); - }); }; /** @@ -87,9 +123,9 @@ HttpManager._makeRequest = function(method, options, uri, callback) { * @param {BaseRequest} The request. * @param {Function} The callback function. */ -HttpManager.get = function(request, callback) { +HttpManager.get = function (request, callback) { var options = _getParametersFromRequest(request); - var method = superagent.get; + var method = "GET"; HttpManager._makeRequest(method, options, request.getURI(), callback); }; @@ -99,9 +135,9 @@ HttpManager.get = function(request, callback) { * @param {BaseRequest} The request. * @param {Function} The callback function. */ -HttpManager.post = function(request, callback) { +HttpManager.post = function (request, callback) { var options = _getParametersFromRequest(request); - var method = superagent.post; + var method = "POST"; HttpManager._makeRequest(method, options, request.getURI(), callback); }; @@ -111,9 +147,9 @@ HttpManager.post = function(request, callback) { * @param {BaseRequest} The request. * @param {Function} The callback function. */ -HttpManager.del = function(request, callback) { +HttpManager.del = function (request, callback) { var options = _getParametersFromRequest(request); - var method = superagent.del; + var method = "DELETE"; HttpManager._makeRequest(method, options, request.getURI(), callback); }; @@ -123,11 +159,11 @@ HttpManager.del = function(request, callback) { * @param {BaseRequest} The request. * @param {Function} The callback function. */ -HttpManager.put = function(request, callback) { +HttpManager.put = function (request, callback) { var options = _getParametersFromRequest(request); - var method = superagent.put; + var method = "PUT"; HttpManager._makeRequest(method, options, request.getURI(), callback); }; -module.exports = HttpManager; \ No newline at end of file +module.exports = HttpManager; diff --git a/src/spotify-web-api.js b/src/spotify-web-api.js index 2a756da8..dd2b806e 100644 --- a/src/spotify-web-api.js +++ b/src/spotify-web-api.js @@ -1,15 +1,15 @@ -'use strict'; +"use strict"; -var AuthenticationRequest = require('./authentication-request'), - WebApiRequest = require('./webapi-request'), - HttpManager = require('./http-manager'); +var AuthenticationRequest = require("./authentication-request"), + WebApiRequest = require("./webapi-request"), + HttpManager = require("./http-manager"); function SpotifyWebApi(credentials) { this._credentials = credentials || {}; } SpotifyWebApi.prototype = { - setCredentials: function(credentials) { + setCredentials: function (credentials) { for (var key in credentials) { if (credentials.hasOwnProperty(key)) { this._credentials[key] = credentials[key]; @@ -17,80 +17,80 @@ SpotifyWebApi.prototype = { } }, - getCredentials: function() { + getCredentials: function () { return this._credentials; }, - resetCredentials: function() { + resetCredentials: function () { this._credentials = null; }, - setClientId: function(clientId) { - this._setCredential('clientId', clientId); + setClientId: function (clientId) { + this._setCredential("clientId", clientId); }, - setClientSecret: function(clientSecret) { - this._setCredential('clientSecret', clientSecret); + setClientSecret: function (clientSecret) { + this._setCredential("clientSecret", clientSecret); }, - setAccessToken: function(accessToken) { - this._setCredential('accessToken', accessToken); + setAccessToken: function (accessToken) { + this._setCredential("accessToken", accessToken); }, - setRefreshToken: function(refreshToken) { - this._setCredential('refreshToken', refreshToken); + setRefreshToken: function (refreshToken) { + this._setCredential("refreshToken", refreshToken); }, - setRedirectURI: function(redirectUri) { - this._setCredential('redirectUri', redirectUri); + setRedirectURI: function (redirectUri) { + this._setCredential("redirectUri", redirectUri); }, - getRedirectURI: function() { - return this._getCredential('redirectUri'); + getRedirectURI: function () { + return this._getCredential("redirectUri"); }, - getClientId: function() { - return this._getCredential('clientId'); + getClientId: function () { + return this._getCredential("clientId"); }, - getClientSecret: function() { - return this._getCredential('clientSecret'); + getClientSecret: function () { + return this._getCredential("clientSecret"); }, - getAccessToken: function() { - return this._getCredential('accessToken'); + getAccessToken: function () { + return this._getCredential("accessToken"); }, - getRefreshToken: function() { - return this._getCredential('refreshToken'); + getRefreshToken: function () { + return this._getCredential("refreshToken"); }, - resetClientId: function() { - this._resetCredential('clientId'); + resetClientId: function () { + this._resetCredential("clientId"); }, - resetClientSecret: function() { - this._resetCredential('clientSecret'); + resetClientSecret: function () { + this._resetCredential("clientSecret"); }, - resetAccessToken: function() { - this._resetCredential('accessToken'); + resetAccessToken: function () { + this._resetCredential("accessToken"); }, - resetRefreshToken: function() { - this._resetCredential('refreshToken'); + resetRefreshToken: function () { + this._resetCredential("refreshToken"); }, - resetRedirectURI: function() { - this._resetCredential('redirectUri'); + resetRedirectURI: function () { + this._resetCredential("redirectUri"); }, - _setCredential: function(credentialKey, value) { + _setCredential: function (credentialKey, value) { this._credentials = this._credentials || {}; this._credentials[credentialKey] = value; }, - _getCredential: function(credentialKey) { + _getCredential: function (credentialKey) { if (!this._credentials) { return; } else { @@ -98,7 +98,7 @@ SpotifyWebApi.prototype = { } }, - _resetCredential: function(credentialKey) { + _resetCredential: function (credentialKey) { if (!this._credentials) { return; } else { @@ -115,9 +115,9 @@ SpotifyWebApi.prototype = { * @returns {Promise|undefined} A promise that if successful, returns an object containing information * about the track. Not returned if a callback is given. */ - getTrack: function(trackId, options, callback) { + getTrack: function (trackId, options, callback) { return WebApiRequest.builder(this.getAccessToken()) - .withPath('/v1/tracks/' + trackId) + .withPath("/v1/tracks/" + trackId) .withQueryParameters(options) .build() .execute(HttpManager.get, callback); @@ -132,12 +132,12 @@ SpotifyWebApi.prototype = { * @returns {Promise|undefined} A promise that if successful, returns an object containing information * about the artists. Not returned if a callback is given. */ - getTracks: function(trackIds, options, callback) { + getTracks: function (trackIds, options, callback) { return WebApiRequest.builder(this.getAccessToken()) - .withPath('/v1/tracks') + .withPath("/v1/tracks") .withQueryParameters( { - ids: trackIds.join(',') + ids: trackIds.join(","), }, options ) @@ -154,9 +154,9 @@ SpotifyWebApi.prototype = { * @returns {Promise|undefined} A promise that if successful, returns an object containing information * about the album. Not returned if a callback is given. */ - getAlbum: function(albumId, options, callback) { + getAlbum: function (albumId, options, callback) { return WebApiRequest.builder(this.getAccessToken()) - .withPath('/v1/albums/' + albumId) + .withPath("/v1/albums/" + albumId) .withQueryParameters(options) .build() .execute(HttpManager.get, callback); @@ -171,12 +171,12 @@ SpotifyWebApi.prototype = { * @returns {Promise|undefined} A promise that if successful, returns an object containing information * about the albums. Not returned if a callback is given. */ - getAlbums: function(albumIds, options, callback) { + getAlbums: function (albumIds, options, callback) { return WebApiRequest.builder(this.getAccessToken()) - .withPath('/v1/albums') + .withPath("/v1/albums") .withQueryParameters( { - ids: albumIds.join(',') + ids: albumIds.join(","), }, options ) @@ -192,9 +192,9 @@ SpotifyWebApi.prototype = { * @returns {Promise|undefined} A promise that if successful, returns an object containing information * about the artist. Not returned if a callback is given. */ - getArtist: function(artistId, callback) { + getArtist: function (artistId, callback) { return WebApiRequest.builder(this.getAccessToken()) - .withPath('/v1/artists/' + artistId) + .withPath("/v1/artists/" + artistId) .build() .execute(HttpManager.get, callback); }, @@ -207,11 +207,11 @@ SpotifyWebApi.prototype = { * @returns {Promise|undefined} A promise that if successful, returns an object containing information * about the artists. Not returned if a callback is given. */ - getArtists: function(artistIds, callback) { + getArtists: function (artistIds, callback) { return WebApiRequest.builder(this.getAccessToken()) - .withPath('/v1/artists') + .withPath("/v1/artists") .withQueryParameters({ - ids: artistIds.join(',') + ids: artistIds.join(","), }) .build() .execute(HttpManager.get, callback); @@ -229,13 +229,13 @@ SpotifyWebApi.prototype = { * search results. The result is paginated. If the promise is rejected, * it contains an error object. Not returned if a callback is given. */ - search: function(query, types, options, callback) { + search: function (query, types, options, callback) { return WebApiRequest.builder(this.getAccessToken()) - .withPath('/v1/search/') + .withPath("/v1/search/") .withQueryParameters( { - type: types.join(','), - q: query + type: types.join(","), + q: query, }, options ) @@ -253,8 +253,8 @@ SpotifyWebApi.prototype = { * search results. The result is paginated. If the promise is rejected, * it contains an error object. Not returned if a callback is given. */ - searchAlbums: function(query, options, callback) { - return this.search(query, ['album'], options, callback); + searchAlbums: function (query, options, callback) { + return this.search(query, ["album"], options, callback); }, /** @@ -267,8 +267,8 @@ SpotifyWebApi.prototype = { * search results. The result is paginated. If the promise is rejected, * it contains an error object. Not returned if a callback is given. */ - searchArtists: function(query, options, callback) { - return this.search(query, ['artist'], options, callback); + searchArtists: function (query, options, callback) { + return this.search(query, ["artist"], options, callback); }, /** @@ -281,8 +281,8 @@ SpotifyWebApi.prototype = { * search results. The result is paginated. If the promise is rejected, * it contains an error object. Not returned if a callback is given. */ - searchTracks: function(query, options, callback) { - return this.search(query, ['track'], options, callback); + searchTracks: function (query, options, callback) { + return this.search(query, ["track"], options, callback); }, /** @@ -295,8 +295,8 @@ SpotifyWebApi.prototype = { * search results. The result is paginated. If the promise is rejected, * it contains an error object. Not returned if a callback is given. */ - searchPlaylists: function(query, options, callback) { - return this.search(query, ['playlist'], options, callback); + searchPlaylists: function (query, options, callback) { + return this.search(query, ["playlist"], options, callback); }, /** @@ -309,9 +309,9 @@ SpotifyWebApi.prototype = { * for the given artist. The result is paginated. If the promise is rejected, * it contains an error object. Not returned if a callback is given. */ - getArtistAlbums: function(artistId, options, callback) { + getArtistAlbums: function (artistId, options, callback) { return WebApiRequest.builder(this.getAccessToken()) - .withPath('/v1/artists/' + artistId + '/albums') + .withPath("/v1/artists/" + artistId + "/albums") .withQueryParameters(options) .build() .execute(HttpManager.get, callback); @@ -327,9 +327,9 @@ SpotifyWebApi.prototype = { * tracks in the album. The result is paginated. If the promise is rejected. * it contains an error object. Not returned if a callback is given. */ - getAlbumTracks: function(albumId, options, callback) { + getAlbumTracks: function (albumId, options, callback) { return WebApiRequest.builder(this.getAccessToken()) - .withPath('/v1/albums/' + albumId + '/tracks') + .withPath("/v1/albums/" + albumId + "/tracks") .withQueryParameters(options) .build() .execute(HttpManager.get, callback); @@ -345,11 +345,11 @@ SpotifyWebApi.prototype = { * artist's top tracks in the given country. If the promise is rejected, * it contains an error object. Not returned if a callback is given. */ - getArtistTopTracks: function(artistId, country, callback) { + getArtistTopTracks: function (artistId, country, callback) { return WebApiRequest.builder(this.getAccessToken()) - .withPath('/v1/artists/' + artistId + '/top-tracks') + .withPath("/v1/artists/" + artistId + "/top-tracks") .withQueryParameters({ - country: country + country: country, }) .build() .execute(HttpManager.get, callback); @@ -363,9 +363,9 @@ SpotifyWebApi.prototype = { * @returns {Promise|undefined} A promise that if successful, returns an object containing the * related artists. If the promise is rejected, it contains an error object. Not returned if a callback is given. */ - getArtistRelatedArtists: function(artistId, callback) { + getArtistRelatedArtists: function (artistId, callback) { return WebApiRequest.builder(this.getAccessToken()) - .withPath('/v1/artists/' + artistId + '/related-artists') + .withPath("/v1/artists/" + artistId + "/related-artists") .build() .execute(HttpManager.get, callback); }, @@ -379,9 +379,9 @@ SpotifyWebApi.prototype = { * containing information about the user. If the promise is * rejected, it contains an error object. Not returned if a callback is given. */ - getUser: function(userId, callback) { + getUser: function (userId, callback) { return WebApiRequest.builder(this.getAccessToken()) - .withPath('/v1/users/' + encodeURIComponent(userId)) + .withPath("/v1/users/" + encodeURIComponent(userId)) .build() .execute(HttpManager.get, callback); }, @@ -395,9 +395,9 @@ SpotifyWebApi.prototype = { * depends on the permissions given by the user. If the promise is * rejected, it contains an error object. Not returned if a callback is given. */ - getMe: function(callback) { + getMe: function (callback) { return WebApiRequest.builder(this.getAccessToken()) - .withPath('/v1/me') + .withPath("/v1/me") .build() .execute(HttpManager.get, callback); }, @@ -413,16 +413,16 @@ SpotifyWebApi.prototype = { * @returns {Promise|undefined} A promise that if successful, resolves to an object containing * a list of playlists. If rejected, it contains an error object. Not returned if a callback is given. */ - getUserPlaylists: function(userId, options, callback) { + getUserPlaylists: function (userId, options, callback) { var path; - if (typeof userId === 'string') { - path = '/v1/users/' + encodeURIComponent(userId) + '/playlists'; - } else if (typeof userId === 'object') { + if (typeof userId === "string") { + path = "/v1/users/" + encodeURIComponent(userId) + "/playlists"; + } else if (typeof userId === "object") { callback = options; options = userId; - path = '/v1/me/playlists'; + path = "/v1/me/playlists"; } /* undefined */ else { - path = '/v1/me/playlists'; + path = "/v1/me/playlists"; } return WebApiRequest.builder(this.getAccessToken()) @@ -441,9 +441,9 @@ SpotifyWebApi.prototype = { * @returns {Promise|undefined} A promise that if successful, resolves to an object containing * the playlist. If rejected, it contains an error object. Not returned if a callback is given. */ - getPlaylist: function(playlistId, options, callback) { + getPlaylist: function (playlistId, options, callback) { return WebApiRequest.builder(this.getAccessToken()) - .withPath('/v1/playlists/' + playlistId) + .withPath("/v1/playlists/" + playlistId) .withQueryParameters(options) .build() .execute(HttpManager.get, callback); @@ -458,9 +458,9 @@ SpotifyWebApi.prototype = { * @returns {Promise|undefined} A promise that if successful, resolves to an object that containing * the tracks in the playlist. If rejected, it contains an error object. Not returned if a callback is given. */ - getPlaylistTracks: function(playlistId, options, callback) { + getPlaylistTracks: function (playlistId, options, callback) { return WebApiRequest.builder(this.getAccessToken()) - .withPath('/v1/playlists/' + playlistId + '/tracks') + .withPath("/v1/playlists/" + playlistId + "/tracks") .withQueryParameters(options) .build() .execute(HttpManager.get, callback); @@ -475,13 +475,16 @@ SpotifyWebApi.prototype = { * @returns {Promise|undefined} A promise that if successful, resolves to an object containing information about the * created playlist. If rejected, it contains an error object. Not returned if a callback is given. */ - createPlaylist: function(name, options, callback) { + createPlaylist: function (name, options, callback) { return WebApiRequest.builder(this.getAccessToken()) - .withPath('/v1/me/playlists') - .withHeaders({ 'Content-Type': 'application/json' }) - .withBodyParameters({ - name : name, - }, options) + .withPath("/v1/me/playlists") + .withHeaders({ "Content-Type": "application/json" }) + .withBodyParameters( + { + name: name, + }, + options + ) .build() .execute(HttpManager.post, callback); }, @@ -494,10 +497,10 @@ SpotifyWebApi.prototype = { * @returns {Promise|undefined} A promise that if successful, simply resolves to an empty object. If rejected, * it contains an error object. Not returned if a callback is given. */ - followPlaylist: function(playlistId, options, callback) { + followPlaylist: function (playlistId, options, callback) { return WebApiRequest.builder(this.getAccessToken()) - .withPath('/v1/playlists/' + playlistId + '/followers') - .withHeaders({ 'Content-Type': 'application/json' }) + .withPath("/v1/playlists/" + playlistId + "/followers") + .withHeaders({ "Content-Type": "application/json" }) .withBodyParameters(options) .build() .execute(HttpManager.put, callback); @@ -510,9 +513,9 @@ SpotifyWebApi.prototype = { * @returns {Promise|undefined} A promise that if successful, simply resolves to an empty object. If rejected, * it contains an error object. Not returned if a callback is given. */ - unfollowPlaylist: function(playlistId, callback) { + unfollowPlaylist: function (playlistId, callback) { return WebApiRequest.builder(this.getAccessToken()) - .withPath('/v1/playlists/' + playlistId + '/followers') + .withPath("/v1/playlists/" + playlistId + "/followers") .build() .execute(HttpManager.del, callback); }, @@ -526,10 +529,10 @@ SpotifyWebApi.prototype = { * @returns {Promise|undefined} A promise that if successful, simply resolves to an empty object. If rejected, * it contains an error object. Not returned if a callback is given. */ - changePlaylistDetails: function(playlistId, options, callback) { + changePlaylistDetails: function (playlistId, options, callback) { return WebApiRequest.builder(this.getAccessToken()) - .withPath('/v1/playlists/' + playlistId) - .withHeaders({ 'Content-Type': 'application/json' }) + .withPath("/v1/playlists/" + playlistId) + .withHeaders({ "Content-Type": "application/json" }) .withBodyParameters(options) .build() .execute(HttpManager.put, callback); @@ -544,33 +547,33 @@ SpotifyWebApi.prototype = { * @returns {Promise|undefined} A promise that if successful, simply resolves to an empty object. If rejected, * it contains an error object. Not returned if a callback is given. */ - uploadCustomPlaylistCoverImage: function(playlistId, base64URI, callback) { + uploadCustomPlaylistCoverImage: function (playlistId, base64URI, callback) { return WebApiRequest.builder(this.getAccessToken()) - .withPath('/v1/playlists/' + playlistId + '/images') - .withHeaders({ 'Content-Type': 'image/jpeg' }) + .withPath("/v1/playlists/" + playlistId + "/images") + .withHeaders({ "Content-Type": "image/jpeg" }) .withBodyParameters(base64URI) .build() .execute(HttpManager.put, callback); }, /** - * Add tracks to a playlist. - * @param {string} playlistId The playlist's ID - * @param {string[]} tracks URIs of the tracks to add to the playlist. - * @param {Object} [options] Options, position being the only one. - * @param {requestCallback} [callback] Optional callback method to be called instead of the promise. - * @example addTracksToPlaylist('3EsfV6XzCHU8SPNdbnFogK', - '["spotify:track:4iV5W9uYEdYUVa79Axb7Rh", "spotify:track:1301WleyT98MSxVHPZCA6M"]').then(...) - * @returns {Promise|undefined} A promise that if successful returns an object containing a snapshot_id. If rejected, - * it contains an error object. Not returned if a callback is given. - */ - addTracksToPlaylist: function(playlistId, tracks, options, callback) { + * Add tracks to a playlist. + * @param {string} playlistId The playlist's ID + * @param {string[]} tracks URIs of the tracks to add to the playlist. + * @param {Object} [options] Options, position being the only one. + * @param {requestCallback} [callback] Optional callback method to be called instead of the promise. + * @example addTracksToPlaylist('3EsfV6XzCHU8SPNdbnFogK', + '["spotify:track:4iV5W9uYEdYUVa79Axb7Rh", "spotify:track:1301WleyT98MSxVHPZCA6M"]').then(...) + * @returns {Promise|undefined} A promise that if successful returns an object containing a snapshot_id. If rejected, + * it contains an error object. Not returned if a callback is given. + */ + addTracksToPlaylist: function (playlistId, tracks, options, callback) { return WebApiRequest.builder(this.getAccessToken()) - .withPath('/v1/playlists/' + playlistId + '/tracks') - .withHeaders({ 'Content-Type': 'application/json' }) + .withPath("/v1/playlists/" + playlistId + "/tracks") + .withHeaders({ "Content-Type": "application/json" }) .withQueryParameters(options) .withBodyParameters({ - uris: tracks + uris: tracks, }) .build() .execute(HttpManager.post, callback); @@ -586,14 +589,14 @@ SpotifyWebApi.prototype = { * @returns {Promise|undefined} A promise that if successful returns an object containing a snapshot_id. If rejected, * it contains an error object. Not returned if a callback is given. */ - removeTracksFromPlaylist: function(playlistId, tracks, options, callback) { + removeTracksFromPlaylist: function (playlistId, tracks, options, callback) { return WebApiRequest.builder(this.getAccessToken()) - .withPath('/v1/playlists/' + playlistId + '/tracks') - .withHeaders({ 'Content-Type': 'application/json' }) + .withPath("/v1/playlists/" + playlistId + "/tracks") + .withHeaders({ "Content-Type": "application/json" }) .withBodyParameters( { - tracks: tracks - }, + tracks: tracks, + }, options ) .build() @@ -609,18 +612,18 @@ SpotifyWebApi.prototype = { * @returns {Promise|undefined} A promise that if successful returns an object containing a snapshot_id. If rejected, * it contains an error object. Not returned if a callback is given. */ - removeTracksFromPlaylistByPosition: function( + removeTracksFromPlaylistByPosition: function ( playlistId, positions, snapshotId, callback ) { return WebApiRequest.builder(this.getAccessToken()) - .withPath('/v1/playlists/' + playlistId + '/tracks') - .withHeaders({ 'Content-Type': 'application/json' }) + .withPath("/v1/playlists/" + playlistId + "/tracks") + .withHeaders({ "Content-Type": "application/json" }) .withBodyParameters({ positions: positions, - snapshot_id: snapshotId + snapshot_id: snapshotId, }) .build() .execute(HttpManager.del, callback); @@ -634,12 +637,12 @@ SpotifyWebApi.prototype = { * @returns {Promise|undefined} A promise that if successful returns an empty object. If rejected, * it contains an error object. Not returned if a callback is given. */ - replaceTracksInPlaylist: function(playlistId, uris, callback) { + replaceTracksInPlaylist: function (playlistId, uris, callback) { return WebApiRequest.builder(this.getAccessToken()) - .withPath('/v1/playlists/' + playlistId + '/tracks') - .withHeaders({ 'Content-Type': 'application/json' }) + .withPath("/v1/playlists/" + playlistId + "/tracks") + .withHeaders({ "Content-Type": "application/json" }) .withBodyParameters({ - uris: uris + uris: uris, }) .build() .execute(HttpManager.put, callback); @@ -655,7 +658,7 @@ SpotifyWebApi.prototype = { * @returns {Promise|undefined} A promise that if successful returns an object containing a snapshot_id. If rejected, * it contains an error object. Not returned if a callback is given. */ - reorderTracksInPlaylist: function( + reorderTracksInPlaylist: function ( playlistId, rangeStart, insertBefore, @@ -663,12 +666,12 @@ SpotifyWebApi.prototype = { callback ) { return WebApiRequest.builder(this.getAccessToken()) - .withPath('/v1/playlists/' + playlistId + '/tracks') - .withHeaders({ 'Content-Type': 'application/json' }) + .withPath("/v1/playlists/" + playlistId + "/tracks") + .withHeaders({ "Content-Type": "application/json" }) .withBodyParameters( { range_start: rangeStart, - insert_before: insertBefore + insert_before: insertBefore, }, options ) @@ -685,9 +688,9 @@ SpotifyWebApi.prototype = { * containing information about the audio features. If the promise is * rejected, it contains an error object. Not returned if a callback is given. */ - getAudioFeaturesForTrack: function(trackId, callback) { + getAudioFeaturesForTrack: function (trackId, callback) { return WebApiRequest.builder(this.getAccessToken()) - .withPath('/v1/audio-features/' + trackId) + .withPath("/v1/audio-features/" + trackId) .build() .execute(HttpManager.get, callback); }, @@ -701,9 +704,9 @@ SpotifyWebApi.prototype = { * containing information about the audio analysis. If the promise is * rejected, it contains an error object. Not returned if a callback is given. */ - getAudioAnalysisForTrack: function(trackId, callback) { + getAudioAnalysisForTrack: function (trackId, callback) { return WebApiRequest.builder(this.getAccessToken()) - .withPath('/v1/audio-analysis/' + trackId) + .withPath("/v1/audio-analysis/" + trackId) .build() .execute(HttpManager.get, callback); }, @@ -717,11 +720,11 @@ SpotifyWebApi.prototype = { * containing information about the audio features for the tracks. If the promise is * rejected, it contains an error object. Not returned if a callback is given. */ - getAudioFeaturesForTracks: function(trackIds, callback) { + getAudioFeaturesForTracks: function (trackIds, callback) { return WebApiRequest.builder(this.getAccessToken()) - .withPath('/v1/audio-features') + .withPath("/v1/audio-features") .withQueryParameters({ - ids: trackIds.join(',') + ids: trackIds.join(","), }) .build() .execute(HttpManager.get, callback); @@ -735,16 +738,16 @@ SpotifyWebApi.prototype = { * @returns {Promise|undefined} A promise that if successful, resolves to an object containing * a list of tracks and a list of seeds. If rejected, it contains an error object. Not returned if a callback is given. */ - getRecommendations: function(options, callback) { + getRecommendations: function (options, callback) { var _opts = {}; - var optionsOfTypeArray = ['seed_artists', 'seed_genres', 'seed_tracks']; + var optionsOfTypeArray = ["seed_artists", "seed_genres", "seed_tracks"]; for (var option in options) { if (options.hasOwnProperty(option)) { if ( optionsOfTypeArray.indexOf(option) !== -1 && - Object.prototype.toString.call(options[option]) === '[object Array]' + Object.prototype.toString.call(options[option]) === "[object Array]" ) { - _opts[option] = options[option].join(','); + _opts[option] = options[option].join(","); } else { _opts[option] = options[option]; } @@ -752,7 +755,7 @@ SpotifyWebApi.prototype = { } return WebApiRequest.builder(this.getAccessToken()) - .withPath('/v1/recommendations') + .withPath("/v1/recommendations") .withQueryParameters(_opts) .build() .execute(HttpManager.get, callback); @@ -766,9 +769,9 @@ SpotifyWebApi.prototype = { * a list of available genres to be used as seeds for recommendations. * If rejected, it contains an error object. Not returned if a callback is given. */ - getAvailableGenreSeeds: function(callback) { + getAvailableGenreSeeds: function (callback) { return WebApiRequest.builder(this.getAccessToken()) - .withPath('/v1/recommendations/available-genre-seeds') + .withPath("/v1/recommendations/available-genre-seeds") .build() .execute(HttpManager.get, callback); }, @@ -780,9 +783,9 @@ SpotifyWebApi.prototype = { * @returns {Promise|undefined} A promise that if successful, resolves to an object containing a paging object which in turn contains * playlist track objects. Not returned if a callback is given. */ - getMySavedTracks: function(options, callback) { + getMySavedTracks: function (options, callback) { return WebApiRequest.builder(this.getAccessToken()) - .withPath('/v1/me/tracks') + .withPath("/v1/me/tracks") .withQueryParameters(options) .build() .execute(HttpManager.get, callback); @@ -797,11 +800,11 @@ SpotifyWebApi.prototype = { * The boolean value of true indicates that the track is part of the user's library, otherwise false. * Not returned if a callback is given. */ - containsMySavedTracks: function(trackIds, callback) { + containsMySavedTracks: function (trackIds, callback) { return WebApiRequest.builder(this.getAccessToken()) - .withPath('/v1/me/tracks/contains') + .withPath("/v1/me/tracks/contains") .withQueryParameters({ - ids: trackIds.join(',') + ids: trackIds.join(","), }) .build() .execute(HttpManager.get, callback); @@ -814,10 +817,10 @@ SpotifyWebApi.prototype = { * @returns {Promise|undefined} A promise that if successful returns null, otherwise an error. * Not returned if a callback is given. */ - removeFromMySavedTracks: function(trackIds, callback) { + removeFromMySavedTracks: function (trackIds, callback) { return WebApiRequest.builder(this.getAccessToken()) - .withPath('/v1/me/tracks') - .withHeaders({ 'Content-Type': 'application/json' }) + .withPath("/v1/me/tracks") + .withHeaders({ "Content-Type": "application/json" }) .withBodyParameters({ ids: trackIds }) .build() .execute(HttpManager.del, callback); @@ -829,10 +832,10 @@ SpotifyWebApi.prototype = { * @param {requestCallback} [callback] Optional callback method to be called instead of the promise. * @returns {Promise|undefined} A promise that if successful returns null, otherwise an error. Not returned if a callback is given. */ - addToMySavedTracks: function(trackIds, callback) { + addToMySavedTracks: function (trackIds, callback) { return WebApiRequest.builder(this.getAccessToken()) - .withPath('/v1/me/tracks') - .withHeaders({ 'Content-Type': 'application/json' }) + .withPath("/v1/me/tracks") + .withHeaders({ "Content-Type": "application/json" }) .withBodyParameters({ ids: trackIds }) .build() .execute(HttpManager.put, callback); @@ -845,10 +848,10 @@ SpotifyWebApi.prototype = { * @returns {Promise|undefined} A promise that if successful returns null, otherwise an error. * Not returned if a callback is given. */ - removeFromMySavedAlbums: function(albumIds, callback) { + removeFromMySavedAlbums: function (albumIds, callback) { return WebApiRequest.builder(this.getAccessToken()) - .withPath('/v1/me/albums') - .withHeaders({ 'Content-Type': 'application/json' }) + .withPath("/v1/me/albums") + .withHeaders({ "Content-Type": "application/json" }) .withBodyParameters(albumIds) .build() .execute(HttpManager.del, callback); @@ -860,10 +863,10 @@ SpotifyWebApi.prototype = { * @param {requestCallback} [callback] Optional callback method to be called instead of the promise. * @returns {Promise|undefined} A promise that if successful returns null, otherwise an error. Not returned if a callback is given. */ - addToMySavedAlbums: function(albumIds, callback) { + addToMySavedAlbums: function (albumIds, callback) { return WebApiRequest.builder(this.getAccessToken()) - .withPath('/v1/me/albums') - .withHeaders({ 'Content-Type': 'application/json' }) + .withPath("/v1/me/albums") + .withHeaders({ "Content-Type": "application/json" }) .withBodyParameters(albumIds) .build() .execute(HttpManager.put, callback); @@ -876,9 +879,9 @@ SpotifyWebApi.prototype = { * @returns {Promise|undefined} A promise that if successful, resolves to an object containing a paging object which in turn contains * playlist album objects. Not returned if a callback is given. */ - getMySavedAlbums: function(options, callback) { + getMySavedAlbums: function (options, callback) { return WebApiRequest.builder(this.getAccessToken()) - .withPath('/v1/me/albums') + .withPath("/v1/me/albums") .withQueryParameters(options) .build() .execute(HttpManager.get, callback); @@ -893,11 +896,11 @@ SpotifyWebApi.prototype = { * The boolean value of true indicates that the album is part of the user's library, otherwise false. * Not returned if a callback is given. */ - containsMySavedAlbums: function(albumIds, callback) { + containsMySavedAlbums: function (albumIds, callback) { return WebApiRequest.builder(this.getAccessToken()) - .withPath('/v1/me/albums/contains') + .withPath("/v1/me/albums/contains") .withQueryParameters({ - ids: albumIds.join(',') + ids: albumIds.join(","), }) .build() .execute(HttpManager.get, callback); @@ -910,9 +913,9 @@ SpotifyWebApi.prototype = { * @returns {Promise|undefined} A promise that if successful, resolves into a paging object of artists, * otherwise an error. Not returned if a callback is given. */ - getMyTopArtists: function(options, callback) { + getMyTopArtists: function (options, callback) { return WebApiRequest.builder(this.getAccessToken()) - .withPath('/v1/me/top/artists') + .withPath("/v1/me/top/artists") .withQueryParameters(options) .build() .execute(HttpManager.get, callback); @@ -925,9 +928,9 @@ SpotifyWebApi.prototype = { * @returns {Promise|undefined} A promise that if successful, resolves into a paging object of tracks, * otherwise an error. Not returned if a callback is given. */ - getMyTopTracks: function(options, callback) { + getMyTopTracks: function (options, callback) { return WebApiRequest.builder(this.getAccessToken()) - .withPath('/v1/me/top/tracks') + .withPath("/v1/me/top/tracks") .withQueryParameters(options) .build() .execute(HttpManager.get, callback); @@ -941,9 +944,9 @@ SpotifyWebApi.prototype = { * otherwise an error. Not returned if a callback is given. Note that the response will be empty * in case the user has enabled private session. */ - getMyRecentlyPlayedTracks: function(options, callback) { + getMyRecentlyPlayedTracks: function (options, callback) { return WebApiRequest.builder(this.getAccessToken()) - .withPath('/v1/me/player/recently-played') + .withPath("/v1/me/player/recently-played") .withQueryParameters(options) .build() .execute(HttpManager.get, callback); @@ -957,12 +960,12 @@ SpotifyWebApi.prototype = { * @returns {Promise|undefined} A promise that if successful, resolves into a paging object of tracks, * otherwise an error. Not returned if a callback is given. */ - addToQueue: function(uri, options, callback) { + addToQueue: function (uri, options, callback) { return WebApiRequest.builder(this.getAccessToken()) - .withPath('/v1/me/player/queue') + .withPath("/v1/me/player/queue") .withQueryParameters( { - uri: uri + uri: uri, }, options ) @@ -970,16 +973,15 @@ SpotifyWebApi.prototype = { .execute(HttpManager.post, callback); }, - - /** + /** * Get the Current User's Available Devices * @param {requestCallback} [callback] Optional callback method to be called instead of the promise. * @returns {Promise|undefined} A promise that if successful, resolves into an array of device objects, * otherwise an error. Not returned if a callback is given. */ - getMyDevices: function(callback) { + getMyDevices: function (callback) { return WebApiRequest.builder(this.getAccessToken()) - .withPath('/v1/me/player/devices') + .withPath("/v1/me/player/devices") .build() .execute(HttpManager.get, callback); }, @@ -991,9 +993,9 @@ SpotifyWebApi.prototype = { * @returns {Promise|undefined} A promise that if successful, resolves into a paging object of tracks, * otherwise an error. Not returned if a callback is given. */ - getMyCurrentPlayingTrack: function(options, callback) { + getMyCurrentPlayingTrack: function (options, callback) { return WebApiRequest.builder(this.getAccessToken()) - .withPath('/v1/me/player/currently-playing') + .withPath("/v1/me/player/currently-playing") .withQueryParameters(options) .build() .execute(HttpManager.get, callback); @@ -1006,9 +1008,9 @@ SpotifyWebApi.prototype = { * @returns {Promise|undefined} A promise that if successful, resolves into a paging object of tracks, * otherwise an error. Not returned if a callback is given. */ - getMyCurrentPlaybackState: function(options, callback) { + getMyCurrentPlaybackState: function (options, callback) { return WebApiRequest.builder(this.getAccessToken()) - .withPath('/v1/me/player') + .withPath("/v1/me/player") .withQueryParameters(options) .build() .execute(HttpManager.get, callback); @@ -1016,17 +1018,17 @@ SpotifyWebApi.prototype = { /** * Transfer a User's Playback - * @param {string[]} [deviceIds] An _array_ containing a device ID on which playback should be started/transferred. + * @param {string[]} [deviceIds] An _array_ containing a device ID on which playback should be started/transferred. * (NOTE: The API is currently only supporting a single device ID.) * @param {Object} [options] Options, the only one being 'play'. * @param {requestCallback} [callback] Optional callback method to be called instead of the promise. * @returns {Promise|undefined} A promise that if successful, resolves into an empty response, * otherwise an error. Not returned if a callback is given. */ - transferMyPlayback: function(deviceIds, options, callback) { + transferMyPlayback: function (deviceIds, options, callback) { return WebApiRequest.builder(this.getAccessToken()) - .withPath('/v1/me/player') - .withHeaders({ 'Content-Type': 'application/json' }) + .withPath("/v1/me/player") + .withHeaders({ "Content-Type": "application/json" }) .withBodyParameters( { device_ids: deviceIds, @@ -1045,22 +1047,22 @@ SpotifyWebApi.prototype = { * @returns {Promise|undefined} A promise that if successful, resolves into an empty response, * otherwise an error. Not returned if a callback is given. */ - play: function(options, callback) { + play: function (options, callback) { /*jshint camelcase: false */ var _options = options || {}; var queryParams = _options.device_id ? { device_id: _options.device_id } : null; var postData = {}; - ['context_uri', 'uris', 'offset', 'position_ms'].forEach(function(field) { + ["context_uri", "uris", "offset", "position_ms"].forEach(function (field) { if (field in _options) { postData[field] = _options[field]; } }); return WebApiRequest.builder(this.getAccessToken()) - .withPath('/v1/me/player/play') + .withPath("/v1/me/player/play") .withQueryParameters(queryParams) - .withHeaders({ 'Content-Type': 'application/json' }) + .withHeaders({ "Content-Type": "application/json" }) .withBodyParameters(postData) .build() .execute(HttpManager.put, callback); @@ -1074,15 +1076,15 @@ SpotifyWebApi.prototype = { * @returns {Promise|undefined} A promise that if successful, resolves into an empty response, * otherwise an error. Not returned if a callback is given. */ - pause: function(options, callback) { + pause: function (options, callback) { return ( WebApiRequest.builder(this.getAccessToken()) - .withPath('/v1/me/player/pause') + .withPath("/v1/me/player/pause") /*jshint camelcase: false */ .withQueryParameters( options && options.device_id ? { device_id: options.device_id } : null ) - .withHeaders({ 'Content-Type': 'application/json' }) + .withHeaders({ "Content-Type": "application/json" }) .build() .execute(HttpManager.put, callback) ); @@ -1096,9 +1098,9 @@ SpotifyWebApi.prototype = { * @returns {Promise|undefined} A promise that if successful, resolves into an empty response, * otherwise an error. Not returned if a callback is given. */ - skipToPrevious: function(options, callback) { + skipToPrevious: function (options, callback) { return WebApiRequest.builder(this.getAccessToken()) - .withPath('/v1/me/player/previous') + .withPath("/v1/me/player/previous") .withQueryParameters( options && options.device_id ? { device_id: options.device_id } : null ) @@ -1114,9 +1116,9 @@ SpotifyWebApi.prototype = { * @returns {Promise|undefined} A promise that if successful, resolves into an empty response, * otherwise an error. Not returned if a callback is given. */ - skipToNext: function(options, callback) { + skipToNext: function (options, callback) { return WebApiRequest.builder(this.getAccessToken()) - .withPath('/v1/me/player/next') + .withPath("/v1/me/player/next") .withQueryParameters( options && options.device_id ? { device_id: options.device_id } : null ) @@ -1133,17 +1135,17 @@ SpotifyWebApi.prototype = { * one is the error object (null if no error), and the second is the value if the request succeeded. * @return {Object} Null if a callback is provided, a `Promise` object otherwise */ - seek: function(positionMs, options, callback) { + seek: function (positionMs, options, callback) { var params = { /* jshint camelcase: false */ - position_ms: positionMs + position_ms: positionMs, }; - if (options && 'device_id' in options) { + if (options && "device_id" in options) { /* jshint camelcase: false */ params.device_id = options.device_id; } return WebApiRequest.builder(this.getAccessToken()) - .withPath('/v1/me/player/seek') + .withPath("/v1/me/player/seek") .withQueryParameters(params) .build() .execute(HttpManager.put, callback); @@ -1158,16 +1160,16 @@ SpotifyWebApi.prototype = { * @returns {Promise|undefined} A promise that if successful, resolves into an empty response, * otherwise an error. Not returned if a callback is given. */ - setRepeat: function(state, options, callback) { + setRepeat: function (state, options, callback) { var params = { - state: state + state: state, }; - if (options && 'device_id' in options) { + if (options && "device_id" in options) { /* jshint camelcase: false */ params.device_id = options.device_id; } return WebApiRequest.builder(this.getAccessToken()) - .withPath('/v1/me/player/repeat') + .withPath("/v1/me/player/repeat") .withQueryParameters(params) .build() .execute(HttpManager.put, callback); @@ -1175,23 +1177,23 @@ SpotifyWebApi.prototype = { /** * Set Shuffle Mode On The Current User's Playback - * @param {boolean} [state] State + * @param {boolean} [state] State * @param {Object} [options] Options, being device_id. If left empty will target the user's currently active device. * @param {requestCallback} [callback] Optional callback method to be called instead of the promise. * @example setShuffle({state: 'false'}).then(...) * @returns {Promise|undefined} A promise that if successful, resolves into an empty response, * otherwise an error. Not returned if a callback is given. */ - setShuffle: function(state, options, callback) { + setShuffle: function (state, options, callback) { var params = { - state: state + state: state, }; - if (options && 'device_id' in options) { + if (options && "device_id" in options) { /* jshint camelcase: false */ params.device_id = options.device_id; } return WebApiRequest.builder(this.getAccessToken()) - .withPath('/v1/me/player/shuffle') + .withPath("/v1/me/player/shuffle") .withQueryParameters(params) .build() .execute(HttpManager.put, callback); @@ -1205,17 +1207,17 @@ SpotifyWebApi.prototype = { * one is the error object (null if no error), and the second is the value if the request succeeded. * @return {Object} Null if a callback is provided, a `Promise` object otherwise */ - setVolume: function(volumePercent, options, callback) { + setVolume: function (volumePercent, options, callback) { var params = { /* jshint camelcase: false */ - volume_percent: volumePercent + volume_percent: volumePercent, }; - if (options && 'device_id' in options) { + if (options && "device_id" in options) { /* jshint camelcase: false */ params.device_id = options.device_id; } return WebApiRequest.builder(this.getAccessToken()) - .withPath('/v1/me/player/volume') + .withPath("/v1/me/player/volume") .withQueryParameters(params) .build() .execute(HttpManager.put, callback); @@ -1229,12 +1231,12 @@ SpotifyWebApi.prototype = { * @returns {Promise|undefined} A promise that if successful, simply resolves to an empty object. If rejected, * it contains an error object. Not returned if a callback is given. */ - followUsers: function(userIds, callback) { + followUsers: function (userIds, callback) { return WebApiRequest.builder(this.getAccessToken()) - .withPath('/v1/me/following') + .withPath("/v1/me/following") .withQueryParameters({ - ids: userIds.join(','), - type: 'user' + ids: userIds.join(","), + type: "user", }) .build() .execute(HttpManager.put, callback); @@ -1248,12 +1250,12 @@ SpotifyWebApi.prototype = { * @returns {Promise|undefined} A promise that if successful, simply resolves to an empty object. If rejected, * it contains an error object. Not returned if a callback is given. */ - followArtists: function(artistIds, callback) { + followArtists: function (artistIds, callback) { return WebApiRequest.builder(this.getAccessToken()) - .withPath('/v1/me/following') + .withPath("/v1/me/following") .withQueryParameters({ - ids: artistIds.join(','), - type: 'artist' + ids: artistIds.join(","), + type: "artist", }) .build() .execute(HttpManager.put, callback); @@ -1267,12 +1269,12 @@ SpotifyWebApi.prototype = { * @returns {Promise|undefined} A promise that if successful, simply resolves to an empty object. If rejected, * it contains an error object. Not returned if a callback is given. */ - unfollowUsers: function(userIds, callback) { + unfollowUsers: function (userIds, callback) { return WebApiRequest.builder(this.getAccessToken()) - .withPath('/v1/me/following') + .withPath("/v1/me/following") .withQueryParameters({ - ids: userIds.join(','), - type: 'user' + ids: userIds.join(","), + type: "user", }) .build() .execute(HttpManager.del, callback); @@ -1286,12 +1288,12 @@ SpotifyWebApi.prototype = { * @returns {Promise|undefined} A promise that if successful, simply resolves to an empty object. If rejected, * it contains an error object. Not returned if a callback is given. */ - unfollowArtists: function(artistIds, callback) { + unfollowArtists: function (artistIds, callback) { return WebApiRequest.builder(this.getAccessToken()) - .withPath('/v1/me/following') + .withPath("/v1/me/following") .withQueryParameters({ - ids: artistIds.join(','), - type: 'artist' + ids: artistIds.join(","), + type: "artist", }) .build() .execute(HttpManager.del, callback); @@ -1307,12 +1309,12 @@ SpotifyWebApi.prototype = { * The boolean value of true indicates that the user is following that user, otherwise is not. * Not returned if a callback is given. */ - isFollowingUsers: function(userIds, callback) { + isFollowingUsers: function (userIds, callback) { return WebApiRequest.builder(this.getAccessToken()) - .withPath('/v1/me/following/contains') + .withPath("/v1/me/following/contains") .withQueryParameters({ - ids: userIds.join(','), - type: 'user' + ids: userIds.join(","), + type: "user", }) .build() .execute(HttpManager.get, callback); @@ -1325,12 +1327,12 @@ SpotifyWebApi.prototype = { * @returns {Promise|undefined} A promise that if successful, resolves to an object containing a paging object which contains * album objects. Not returned if a callback is given. */ - getFollowedArtists: function(options, callback) { + getFollowedArtists: function (options, callback) { return WebApiRequest.builder(this.getAccessToken()) - .withPath('/v1/me/following') + .withPath("/v1/me/following") .withQueryParameters( { - type: 'artist' + type: "artist", }, options ) @@ -1347,17 +1349,17 @@ SpotifyWebApi.prototype = { * @returns {Promise|undefined} A promise that if successful returns an array of booleans. If rejected, * it contains an error object. Not returned if a callback is given. */ - areFollowingPlaylist: function(userId, playlistId, followerIds, callback) { + areFollowingPlaylist: function (userId, playlistId, followerIds, callback) { return WebApiRequest.builder(this.getAccessToken()) .withPath( - '/v1/users/' + + "/v1/users/" + encodeURIComponent(userId) + - '/playlists/' + + "/playlists/" + playlistId + - '/followers/contains' + "/followers/contains" ) .withQueryParameters({ - ids: followerIds.join(',') + ids: followerIds.join(","), }) .build() .execute(HttpManager.get, callback); @@ -1373,12 +1375,12 @@ SpotifyWebApi.prototype = { * The boolean value of true indicates that the user is following that artist, otherwise is not. * Not returned if a callback is given. */ - isFollowingArtists: function(artistIds, callback) { + isFollowingArtists: function (artistIds, callback) { return WebApiRequest.builder(this.getAccessToken()) - .withPath('/v1/me/following/contains') + .withPath("/v1/me/following/contains") .withQueryParameters({ - ids: artistIds.join(','), - type: 'artist' + ids: artistIds.join(","), + type: "artist", }) .build() .execute(HttpManager.get, callback); @@ -1391,9 +1393,9 @@ SpotifyWebApi.prototype = { * @returns {Promise|undefined} A promise that if successful, resolves to an object containing a paging object which contains * album objects. Not returned if a callback is given. */ - getNewReleases: function(options, callback) { + getNewReleases: function (options, callback) { return WebApiRequest.builder(this.getAccessToken()) - .withPath('/v1/browse/new-releases') + .withPath("/v1/browse/new-releases") .withQueryParameters(options) .build() .execute(HttpManager.get, callback); @@ -1406,9 +1408,9 @@ SpotifyWebApi.prototype = { * @returns {Promise|undefined} A promise that if successful, resolves to an object containing a paging object which contains * featured playlists. Not returned if a callback is given. */ - getFeaturedPlaylists: function(options, callback) { + getFeaturedPlaylists: function (options, callback) { return WebApiRequest.builder(this.getAccessToken()) - .withPath('/v1/browse/featured-playlists') + .withPath("/v1/browse/featured-playlists") .withQueryParameters(options) .build() .execute(HttpManager.get, callback); @@ -1421,9 +1423,9 @@ SpotifyWebApi.prototype = { * @returns {Promise|undefined} A promise that if successful, resolves to an object containing a paging object of categories. * Not returned if a callback is given. */ - getCategories: function(options, callback) { + getCategories: function (options, callback) { return WebApiRequest.builder(this.getAccessToken()) - .withPath('/v1/browse/categories') + .withPath("/v1/browse/categories") .withQueryParameters(options) .build() .execute(HttpManager.get, callback); @@ -1437,9 +1439,9 @@ SpotifyWebApi.prototype = { * @returns {Promise|undefined} A promise that if successful, resolves to an object containing a category object. * Not returned if a callback is given. */ - getCategory: function(categoryId, options, callback) { + getCategory: function (categoryId, options, callback) { return WebApiRequest.builder(this.getAccessToken()) - .withPath('/v1/browse/categories/' + categoryId) + .withPath("/v1/browse/categories/" + categoryId) .withQueryParameters(options) .build() .execute(HttpManager.get, callback); @@ -1453,9 +1455,9 @@ SpotifyWebApi.prototype = { * @returns {Promise|undefined} A promise that if successful, resolves to a paging object containing simple playlists. * Not returned if a callback is given. */ - getPlaylistsForCategory: function(categoryId, options, callback) { + getPlaylistsForCategory: function (categoryId, options, callback) { return WebApiRequest.builder(this.getAccessToken()) - .withPath('/v1/browse/categories/' + categoryId + '/playlists') + .withPath("/v1/browse/categories/" + categoryId + "/playlists") .withQueryParameters(options) .build() .execute(HttpManager.get, callback); @@ -1470,12 +1472,12 @@ SpotifyWebApi.prototype = { * @returns {Promise|undefined} A promise that if successful, returns an object containing information * about the show. Not returned if a callback is given. */ - getShow: function(showId, options, callback) { + getShow: function (showId, options, callback) { return WebApiRequest.builder(this.getAccessToken()) - .withPath('/v1/shows/' + showId) - .withQueryParameters(options) - .build() - .execute(HttpManager.get, callback); + .withPath("/v1/shows/" + showId) + .withQueryParameters(options) + .build() + .execute(HttpManager.get, callback); }, /** @@ -1487,12 +1489,12 @@ SpotifyWebApi.prototype = { * @returns {Promise|undefined} A promise that if successful, returns an object containing information * about the shows. Not returned if a callback is given. */ - getShows: function(showIds, options, callback) { + getShows: function (showIds, options, callback) { return WebApiRequest.builder(this.getAccessToken()) - .withPath('/v1/shows') + .withPath("/v1/shows") .withQueryParameters( { - ids: showIds.join(',') + ids: showIds.join(","), }, options ) @@ -1509,11 +1511,11 @@ SpotifyWebApi.prototype = { * The boolean value of true indicates that the show is part of the user's library, otherwise false. * Not returned if a callback is given. */ - containsMySavedShows: function(showIds, callback) { + containsMySavedShows: function (showIds, callback) { return WebApiRequest.builder(this.getAccessToken()) - .withPath('/v1/me/shows/contains') + .withPath("/v1/me/shows/contains") .withQueryParameters({ - ids: showIds.join(',') + ids: showIds.join(","), }) .build() .execute(HttpManager.get, callback); @@ -1526,11 +1528,13 @@ SpotifyWebApi.prototype = { * @returns {Promise|undefined} A promise that if successful returns null, otherwise an error. * Not returned if a callback is given. */ - removeFromMySavedShows: function(showIds, callback) { + removeFromMySavedShows: function (showIds, callback) { return WebApiRequest.builder(this.getAccessToken()) - .withPath('/v1/me/shows') - .withHeaders({ 'Content-Type': 'application/json' }) - .withBodyParameters(showIds) + .withPath("/v1/me/shows") + .withHeaders({ "Content-Type": "application/json" }) + .withQueryParameters({ + ids: showIds.join(","), + }) .build() .execute(HttpManager.del, callback); }, @@ -1541,10 +1545,10 @@ SpotifyWebApi.prototype = { * @param {requestCallback} [callback] Optional callback method to be called instead of the promise. * @returns {Promise|undefined} A promise that if successful returns null, otherwise an error. Not returned if a callback is given. */ - addToMySavedShows: function(showIds, callback) { + addToMySavedShows: function (showIds, callback) { return WebApiRequest.builder(this.getAccessToken()) - .withPath('/v1/me/shows') - .withHeaders({ 'Content-Type': 'application/json' }) + .withPath("/v1/me/shows") + .withHeaders({ "Content-Type": "application/json" }) .withBodyParameters(showIds) .build() .execute(HttpManager.put, callback); @@ -1557,9 +1561,9 @@ SpotifyWebApi.prototype = { * @returns {Promise|undefined} A promise that if successful, resolves to an object containing a paging object which in turn contains * playlist show objects. Not returned if a callback is given. */ - getMySavedShows: function(options, callback) { + getMySavedShows: function (options, callback) { return WebApiRequest.builder(this.getAccessToken()) - .withPath('/v1/me/shows') + .withPath("/v1/me/shows") .withQueryParameters(options) .build() .execute(HttpManager.get, callback); @@ -1575,9 +1579,9 @@ SpotifyWebApi.prototype = { * episodes in the album. The result is paginated. If the promise is rejected. * it contains an error object. Not returned if a callback is given. */ - getShowEpisodes: function(showId, options, callback) { + getShowEpisodes: function (showId, options, callback) { return WebApiRequest.builder(this.getAccessToken()) - .withPath('/v1/shows/' + showId + '/episodes') + .withPath("/v1/shows/" + showId + "/episodes") .withQueryParameters(options) .build() .execute(HttpManager.get, callback); @@ -1593,8 +1597,8 @@ SpotifyWebApi.prototype = { * search results. The result is paginated. If the promise is rejected, * it contains an error object. Not returned if a callback is given. */ - searchShows: function(query, options, callback) { - return this.search(query, ['show'], options, callback); + searchShows: function (query, options, callback) { + return this.search(query, ["show"], options, callback); }, /** @@ -1607,11 +1611,11 @@ SpotifyWebApi.prototype = { * search results. The result is paginated. If the promise is rejected, * it contains an error object. Not returned if a callback is given. */ - searchEpisodes: function(query, options, callback) { - return this.search(query, ['episode'], options, callback); + searchEpisodes: function (query, options, callback) { + return this.search(query, ["episode"], options, callback); }, - /** + /** * Look up an episode. * @param {string} episodeId The episode's ID. * @param {Object} [options] The possible options, currently only market. @@ -1620,9 +1624,9 @@ SpotifyWebApi.prototype = { * @returns {Promise|undefined} A promise that if successful, returns an object containing information * about the episode. Not returned if a callback is given. */ - getEpisode: function(episodeId, options, callback) { + getEpisode: function (episodeId, options, callback) { return WebApiRequest.builder(this.getAccessToken()) - .withPath('/v1/episodes/' + episodeId) + .withPath("/v1/episodes/" + episodeId) .withQueryParameters(options) .build() .execute(HttpManager.get, callback); @@ -1637,12 +1641,12 @@ SpotifyWebApi.prototype = { * @returns {Promise|undefined} A promise that if successful, returns an object containing information * about the episodes. Not returned if a callback is given. */ - getEpisodes: function(episodeIds, options, callback) { + getEpisodes: function (episodeIds, options, callback) { return WebApiRequest.builder(this.getAccessToken()) - .withPath('/v1/episodes') + .withPath("/v1/episodes") .withQueryParameters( { - ids: episodeIds.join(',') + ids: episodeIds.join(","), }, options ) @@ -1651,7 +1655,7 @@ SpotifyWebApi.prototype = { }, }; -SpotifyWebApi._addMethods = function(methods) { +SpotifyWebApi._addMethods = function (methods) { for (var i in methods) { if (methods.hasOwnProperty(i)) { this.prototype[i] = methods[i];