initial commit
This commit is contained in:
274
server/node_modules/gaxios/build/src/common.d.ts
generated
vendored
Normal file
274
server/node_modules/gaxios/build/src/common.d.ts
generated
vendored
Normal file
@@ -0,0 +1,274 @@
|
||||
import { Agent } from 'http';
|
||||
import { URL } from 'url';
|
||||
import { Readable } from 'stream';
|
||||
/**
|
||||
* Support `instanceof` operator for `GaxiosError`s in different versions of this library.
|
||||
*
|
||||
* @see {@link GaxiosError[Symbol.hasInstance]}
|
||||
*/
|
||||
export declare const GAXIOS_ERROR_SYMBOL: unique symbol;
|
||||
export declare class GaxiosError<T = any> extends Error {
|
||||
config: GaxiosOptions;
|
||||
response?: GaxiosResponse<T> | undefined;
|
||||
error?: (Error | NodeJS.ErrnoException) | undefined;
|
||||
/**
|
||||
* An Error code.
|
||||
* See {@link https://nodejs.org/api/errors.html#errorcode error.code}
|
||||
*
|
||||
* @example
|
||||
* 'ECONNRESET'
|
||||
*/
|
||||
code?: string;
|
||||
/**
|
||||
* An HTTP Status code.
|
||||
* See {@link https://developer.mozilla.org/en-US/docs/Web/API/Response/status Response: status property}
|
||||
*
|
||||
* @example
|
||||
* 500
|
||||
*/
|
||||
status?: number;
|
||||
/**
|
||||
* Support `instanceof` operator for `GaxiosError` across builds/duplicated files.
|
||||
*
|
||||
* @see {@link GAXIOS_ERROR_SYMBOL}
|
||||
* @see {@link GaxiosError[Symbol.hasInstance]}
|
||||
* @see {@link https://github.com/microsoft/TypeScript/issues/13965#issuecomment-278570200}
|
||||
* @see {@link https://stackoverflow.com/questions/46618852/require-and-instanceof}
|
||||
* @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/@@hasInstance#reverting_to_default_instanceof_behavior}
|
||||
*/
|
||||
[GAXIOS_ERROR_SYMBOL]: string;
|
||||
/**
|
||||
* Support `instanceof` operator for `GaxiosError` across builds/duplicated files.
|
||||
*
|
||||
* @see {@link GAXIOS_ERROR_SYMBOL}
|
||||
* @see {@link GaxiosError[GAXIOS_ERROR_SYMBOL]}
|
||||
*/
|
||||
static [Symbol.hasInstance](instance: unknown): boolean;
|
||||
constructor(message: string, config: GaxiosOptions, response?: GaxiosResponse<T> | undefined, error?: (Error | NodeJS.ErrnoException) | undefined);
|
||||
}
|
||||
export interface Headers {
|
||||
[index: string]: any;
|
||||
}
|
||||
export type GaxiosPromise<T = any> = Promise<GaxiosResponse<T>>;
|
||||
export interface GaxiosXMLHttpRequest {
|
||||
responseURL: string;
|
||||
}
|
||||
export interface GaxiosResponse<T = any> {
|
||||
config: GaxiosOptions;
|
||||
data: T;
|
||||
status: number;
|
||||
statusText: string;
|
||||
headers: Headers;
|
||||
request: GaxiosXMLHttpRequest;
|
||||
}
|
||||
export interface GaxiosMultipartOptions {
|
||||
headers: Headers;
|
||||
content: string | Readable;
|
||||
}
|
||||
/**
|
||||
* Request options that are used to form the request.
|
||||
*/
|
||||
export interface GaxiosOptions {
|
||||
/**
|
||||
* Optional method to override making the actual HTTP request. Useful
|
||||
* for writing tests.
|
||||
*/
|
||||
adapter?: <T = any>(options: GaxiosOptions, defaultAdapter: (options: GaxiosOptions) => GaxiosPromise<T>) => GaxiosPromise<T>;
|
||||
url?: string | URL;
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
baseUrl?: string;
|
||||
baseURL?: string | URL;
|
||||
method?: 'GET' | 'HEAD' | 'POST' | 'DELETE' | 'PUT' | 'CONNECT' | 'OPTIONS' | 'TRACE' | 'PATCH';
|
||||
headers?: Headers;
|
||||
data?: any;
|
||||
body?: any;
|
||||
/**
|
||||
* The maximum size of the http response content in bytes allowed.
|
||||
*/
|
||||
maxContentLength?: number;
|
||||
/**
|
||||
* The maximum number of redirects to follow. Defaults to 20.
|
||||
*/
|
||||
maxRedirects?: number;
|
||||
follow?: number;
|
||||
/**
|
||||
* A collection of parts to send as a `Content-Type: multipart/related` request.
|
||||
*/
|
||||
multipart?: GaxiosMultipartOptions[];
|
||||
params?: any;
|
||||
paramsSerializer?: (params: {
|
||||
[index: string]: string | number;
|
||||
}) => string;
|
||||
timeout?: number;
|
||||
/**
|
||||
* @deprecated ignored
|
||||
*/
|
||||
onUploadProgress?: (progressEvent: any) => void;
|
||||
responseType?: 'arraybuffer' | 'blob' | 'json' | 'text' | 'stream' | 'unknown';
|
||||
agent?: Agent | ((parsedUrl: URL) => Agent);
|
||||
validateStatus?: (status: number) => boolean;
|
||||
retryConfig?: RetryConfig;
|
||||
retry?: boolean;
|
||||
signal?: any;
|
||||
size?: number;
|
||||
/**
|
||||
* Implementation of `fetch` to use when making the API call. By default,
|
||||
* will use the browser context if available, and fall back to `node-fetch`
|
||||
* in node.js otherwise.
|
||||
*/
|
||||
fetchImplementation?: FetchImplementation;
|
||||
cert?: string;
|
||||
key?: string;
|
||||
/**
|
||||
* An optional proxy to use for requests.
|
||||
* Available via `process.env.HTTP_PROXY` and `process.env.HTTPS_PROXY` as well - with a preference for the this config option when multiple are available.
|
||||
* The {@link GaxiosOptions.agent `agent`} option overrides this.
|
||||
*
|
||||
* @see {@link GaxiosOptions.noProxy}
|
||||
* @see {@link GaxiosOptions.agent}
|
||||
*/
|
||||
proxy?: string | URL;
|
||||
/**
|
||||
* A list for excluding traffic for proxies.
|
||||
* Available via `process.env.NO_PROXY` as well as a common-separated list of strings - merged with any local `noProxy` rules.
|
||||
*
|
||||
* - When provided a string, it is matched by
|
||||
* - Wildcard `*.` and `.` matching are available. (e.g. `.example.com` or `*.example.com`)
|
||||
* - When provided a URL, it is matched by the `.origin` property.
|
||||
* - For example, requesting `https://example.com` with the following `noProxy`s would result in a no proxy use:
|
||||
* - new URL('https://example.com')
|
||||
* - new URL('https://example.com:443')
|
||||
* - The following would be used with a proxy:
|
||||
* - new URL('http://example.com:80')
|
||||
* - new URL('https://example.com:8443')
|
||||
* - When provided a regular expression it is used to match the stringified URL
|
||||
*
|
||||
* @see {@link GaxiosOptions.proxy}
|
||||
*/
|
||||
noProxy?: (string | URL | RegExp)[];
|
||||
/**
|
||||
* An experimental error redactor.
|
||||
*
|
||||
* @remarks
|
||||
*
|
||||
* This does not replace the requirement for an active Data Loss Prevention (DLP) provider. For DLP suggestions, see:
|
||||
* - https://cloud.google.com/sensitive-data-protection/docs/redacting-sensitive-data#dlp_deidentify_replace_infotype-nodejs
|
||||
* - https://cloud.google.com/sensitive-data-protection/docs/infotypes-reference#credentials_and_secrets
|
||||
*
|
||||
* @experimental
|
||||
*/
|
||||
errorRedactor?: typeof defaultErrorRedactor | false;
|
||||
}
|
||||
/**
|
||||
* A partial object of `GaxiosResponse` with only redactable keys
|
||||
*
|
||||
* @experimental
|
||||
*/
|
||||
export type RedactableGaxiosOptions = Pick<GaxiosOptions, 'body' | 'data' | 'headers' | 'url'>;
|
||||
/**
|
||||
* A partial object of `GaxiosResponse` with only redactable keys
|
||||
*
|
||||
* @experimental
|
||||
*/
|
||||
export type RedactableGaxiosResponse<T = any> = Pick<GaxiosResponse<T>, 'config' | 'data' | 'headers'>;
|
||||
/**
|
||||
* Configuration for the Gaxios `request` method.
|
||||
*/
|
||||
export interface RetryConfig {
|
||||
/**
|
||||
* The number of times to retry the request. Defaults to 3.
|
||||
*/
|
||||
retry?: number;
|
||||
/**
|
||||
* The number of retries already attempted.
|
||||
*/
|
||||
currentRetryAttempt?: number;
|
||||
/**
|
||||
* The amount of time to initially delay the retry, in ms. Defaults to 100ms.
|
||||
*/
|
||||
retryDelay?: number;
|
||||
/**
|
||||
* The HTTP Methods that will be automatically retried.
|
||||
* Defaults to ['GET','PUT','HEAD','OPTIONS','DELETE']
|
||||
*/
|
||||
httpMethodsToRetry?: string[];
|
||||
/**
|
||||
* The HTTP response status codes that will automatically be retried.
|
||||
* Defaults to: [[100, 199], [408, 408], [429, 429], [500, 599]]
|
||||
*/
|
||||
statusCodesToRetry?: number[][];
|
||||
/**
|
||||
* Function to invoke when a retry attempt is made.
|
||||
*/
|
||||
onRetryAttempt?: (err: GaxiosError) => Promise<void> | void;
|
||||
/**
|
||||
* Function to invoke which determines if you should retry
|
||||
*/
|
||||
shouldRetry?: (err: GaxiosError) => Promise<boolean> | boolean;
|
||||
/**
|
||||
* When there is no response, the number of retries to attempt. Defaults to 2.
|
||||
*/
|
||||
noResponseRetries?: number;
|
||||
/**
|
||||
* Function to invoke which returns a promise. After the promise resolves,
|
||||
* the retry will be triggered. If provided, this will be used in-place of
|
||||
* the `retryDelay`
|
||||
*/
|
||||
retryBackoff?: (err: GaxiosError, defaultBackoffMs: number) => Promise<void>;
|
||||
/**
|
||||
* Time that the initial request was made. Users should not set this directly.
|
||||
*/
|
||||
timeOfFirstRequest?: number;
|
||||
/**
|
||||
* The length of time to keep retrying in ms. The last sleep period will
|
||||
* be shortened as necessary, so that the last retry runs at deadline (and not
|
||||
* considerably beyond it). The total time starting from when the initial
|
||||
* request is sent, after which an error will be returned, regardless of the
|
||||
* retrying attempts made meanwhile. Defaults to Number.MAX_SAFE_INTEGER indicating to effectively
|
||||
* ignore totalTimeout.
|
||||
*/
|
||||
totalTimeout?: number;
|
||||
maxRetryDelay?: number;
|
||||
retryDelayMultiplier?: number;
|
||||
}
|
||||
export type FetchImplementation = (input: FetchRequestInfo, init?: FetchRequestInit) => Promise<FetchResponse>;
|
||||
export type FetchRequestInfo = any;
|
||||
export interface FetchResponse {
|
||||
readonly status: number;
|
||||
readonly statusText: string;
|
||||
readonly url: string;
|
||||
readonly body: unknown | null;
|
||||
arrayBuffer(): Promise<unknown>;
|
||||
blob(): Promise<unknown>;
|
||||
readonly headers: FetchHeaders;
|
||||
json(): Promise<any>;
|
||||
text(): Promise<string>;
|
||||
}
|
||||
export interface FetchRequestInit {
|
||||
method?: string;
|
||||
}
|
||||
export interface FetchHeaders {
|
||||
append(name: string, value: string): void;
|
||||
delete(name: string): void;
|
||||
get(name: string): string | null;
|
||||
has(name: string): boolean;
|
||||
set(name: string, value: string): void;
|
||||
forEach(callbackfn: (value: string, key: string) => void, thisArg?: any): void;
|
||||
}
|
||||
/**
|
||||
* An experimental error redactor.
|
||||
*
|
||||
* @param config Config to potentially redact properties of
|
||||
* @param response Config to potentially redact properties of
|
||||
*
|
||||
* @experimental
|
||||
*/
|
||||
export declare function defaultErrorRedactor<T = any>(data: {
|
||||
config?: RedactableGaxiosOptions;
|
||||
response?: RedactableGaxiosResponse<T>;
|
||||
}): {
|
||||
config?: RedactableGaxiosOptions;
|
||||
response?: RedactableGaxiosResponse<T>;
|
||||
};
|
||||
188
server/node_modules/gaxios/build/src/common.js
generated
vendored
Normal file
188
server/node_modules/gaxios/build/src/common.js
generated
vendored
Normal file
@@ -0,0 +1,188 @@
|
||||
"use strict";
|
||||
// Copyright 2018 Google LLC
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
var _a;
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.GaxiosError = exports.GAXIOS_ERROR_SYMBOL = void 0;
|
||||
exports.defaultErrorRedactor = defaultErrorRedactor;
|
||||
const url_1 = require("url");
|
||||
const util_1 = require("./util");
|
||||
const extend_1 = __importDefault(require("extend"));
|
||||
/**
|
||||
* Support `instanceof` operator for `GaxiosError`s in different versions of this library.
|
||||
*
|
||||
* @see {@link GaxiosError[Symbol.hasInstance]}
|
||||
*/
|
||||
exports.GAXIOS_ERROR_SYMBOL = Symbol.for(`${util_1.pkg.name}-gaxios-error`);
|
||||
/* eslint-disable-next-line @typescript-eslint/no-explicit-any */
|
||||
class GaxiosError extends Error {
|
||||
/**
|
||||
* Support `instanceof` operator for `GaxiosError` across builds/duplicated files.
|
||||
*
|
||||
* @see {@link GAXIOS_ERROR_SYMBOL}
|
||||
* @see {@link GaxiosError[GAXIOS_ERROR_SYMBOL]}
|
||||
*/
|
||||
static [(_a = exports.GAXIOS_ERROR_SYMBOL, Symbol.hasInstance)](instance) {
|
||||
if (instance &&
|
||||
typeof instance === 'object' &&
|
||||
exports.GAXIOS_ERROR_SYMBOL in instance &&
|
||||
instance[exports.GAXIOS_ERROR_SYMBOL] === util_1.pkg.version) {
|
||||
return true;
|
||||
}
|
||||
// fallback to native
|
||||
return Function.prototype[Symbol.hasInstance].call(GaxiosError, instance);
|
||||
}
|
||||
constructor(message, config, response, error) {
|
||||
var _b;
|
||||
super(message);
|
||||
this.config = config;
|
||||
this.response = response;
|
||||
this.error = error;
|
||||
/**
|
||||
* Support `instanceof` operator for `GaxiosError` across builds/duplicated files.
|
||||
*
|
||||
* @see {@link GAXIOS_ERROR_SYMBOL}
|
||||
* @see {@link GaxiosError[Symbol.hasInstance]}
|
||||
* @see {@link https://github.com/microsoft/TypeScript/issues/13965#issuecomment-278570200}
|
||||
* @see {@link https://stackoverflow.com/questions/46618852/require-and-instanceof}
|
||||
* @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Function/@@hasInstance#reverting_to_default_instanceof_behavior}
|
||||
*/
|
||||
this[_a] = util_1.pkg.version;
|
||||
// deep-copy config as we do not want to mutate
|
||||
// the existing config for future retries/use
|
||||
this.config = (0, extend_1.default)(true, {}, config);
|
||||
if (this.response) {
|
||||
this.response.config = (0, extend_1.default)(true, {}, this.response.config);
|
||||
}
|
||||
if (this.response) {
|
||||
try {
|
||||
this.response.data = translateData(this.config.responseType, (_b = this.response) === null || _b === void 0 ? void 0 : _b.data);
|
||||
}
|
||||
catch (_c) {
|
||||
// best effort - don't throw an error within an error
|
||||
// we could set `this.response.config.responseType = 'unknown'`, but
|
||||
// that would mutate future calls with this config object.
|
||||
}
|
||||
this.status = this.response.status;
|
||||
}
|
||||
if (error && 'code' in error && error.code) {
|
||||
this.code = error.code;
|
||||
}
|
||||
if (config.errorRedactor) {
|
||||
config.errorRedactor({
|
||||
config: this.config,
|
||||
response: this.response,
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
exports.GaxiosError = GaxiosError;
|
||||
function translateData(responseType, data) {
|
||||
switch (responseType) {
|
||||
case 'stream':
|
||||
return data;
|
||||
case 'json':
|
||||
return JSON.parse(JSON.stringify(data));
|
||||
case 'arraybuffer':
|
||||
return JSON.parse(Buffer.from(data).toString('utf8'));
|
||||
case 'blob':
|
||||
return JSON.parse(data.text());
|
||||
default:
|
||||
return data;
|
||||
}
|
||||
}
|
||||
/**
|
||||
* An experimental error redactor.
|
||||
*
|
||||
* @param config Config to potentially redact properties of
|
||||
* @param response Config to potentially redact properties of
|
||||
*
|
||||
* @experimental
|
||||
*/
|
||||
function defaultErrorRedactor(data) {
|
||||
const REDACT = '<<REDACTED> - See `errorRedactor` option in `gaxios` for configuration>.';
|
||||
function redactHeaders(headers) {
|
||||
if (!headers)
|
||||
return;
|
||||
for (const key of Object.keys(headers)) {
|
||||
// any casing of `Authentication`
|
||||
if (/^authentication$/i.test(key)) {
|
||||
headers[key] = REDACT;
|
||||
}
|
||||
// any casing of `Authorization`
|
||||
if (/^authorization$/i.test(key)) {
|
||||
headers[key] = REDACT;
|
||||
}
|
||||
// anything containing secret, such as 'client secret'
|
||||
if (/secret/i.test(key)) {
|
||||
headers[key] = REDACT;
|
||||
}
|
||||
}
|
||||
}
|
||||
function redactString(obj, key) {
|
||||
if (typeof obj === 'object' &&
|
||||
obj !== null &&
|
||||
typeof obj[key] === 'string') {
|
||||
const text = obj[key];
|
||||
if (/grant_type=/i.test(text) ||
|
||||
/assertion=/i.test(text) ||
|
||||
/secret/i.test(text)) {
|
||||
obj[key] = REDACT;
|
||||
}
|
||||
}
|
||||
}
|
||||
function redactObject(obj) {
|
||||
if (typeof obj === 'object' && obj !== null) {
|
||||
if ('grant_type' in obj) {
|
||||
obj['grant_type'] = REDACT;
|
||||
}
|
||||
if ('assertion' in obj) {
|
||||
obj['assertion'] = REDACT;
|
||||
}
|
||||
if ('client_secret' in obj) {
|
||||
obj['client_secret'] = REDACT;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (data.config) {
|
||||
redactHeaders(data.config.headers);
|
||||
redactString(data.config, 'data');
|
||||
redactObject(data.config.data);
|
||||
redactString(data.config, 'body');
|
||||
redactObject(data.config.body);
|
||||
try {
|
||||
const url = new url_1.URL('', data.config.url);
|
||||
if (url.searchParams.has('token')) {
|
||||
url.searchParams.set('token', REDACT);
|
||||
}
|
||||
if (url.searchParams.has('client_secret')) {
|
||||
url.searchParams.set('client_secret', REDACT);
|
||||
}
|
||||
data.config.url = url.toString();
|
||||
}
|
||||
catch (_b) {
|
||||
// ignore error - no need to parse an invalid URL
|
||||
}
|
||||
}
|
||||
if (data.response) {
|
||||
defaultErrorRedactor({ config: data.response.config });
|
||||
redactHeaders(data.response.headers);
|
||||
redactString(data.response, 'data');
|
||||
redactObject(data.response.data);
|
||||
}
|
||||
return data;
|
||||
}
|
||||
//# sourceMappingURL=common.js.map
|
||||
1
server/node_modules/gaxios/build/src/common.js.map
generated
vendored
Normal file
1
server/node_modules/gaxios/build/src/common.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../src/common.ts"],"names":[],"mappings":";AAAA,4BAA4B;AAC5B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,gDAAgD;AAChD,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;;;;;;AAwZjC,oDAiGC;AAtfD,6BAAwB;AAExB,iCAA2B;AAC3B,oDAA4B;AAG5B;;;;GAIG;AACU,QAAA,mBAAmB,GAAG,MAAM,CAAC,GAAG,CAAC,GAAG,UAAG,CAAC,IAAI,eAAe,CAAC,CAAC;AAE1E,i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Q,EAAE,MAAM,CAAC,CAAC;QACpC,YAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IACnC,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC"}
|
||||
62
server/node_modules/gaxios/build/src/gaxios.d.ts
generated
vendored
Normal file
62
server/node_modules/gaxios/build/src/gaxios.d.ts
generated
vendored
Normal file
@@ -0,0 +1,62 @@
|
||||
import { Agent } from 'http';
|
||||
import { URL } from 'url';
|
||||
import { GaxiosOptions, GaxiosPromise, GaxiosResponse } from './common';
|
||||
import { GaxiosInterceptorManager } from './interceptor';
|
||||
export declare class Gaxios {
|
||||
#private;
|
||||
protected agentCache: Map<string | URL, Agent | ((parsedUrl: URL) => Agent)>;
|
||||
/**
|
||||
* Default HTTP options that will be used for every HTTP request.
|
||||
*/
|
||||
defaults: GaxiosOptions;
|
||||
/**
|
||||
* Interceptors
|
||||
*/
|
||||
interceptors: {
|
||||
request: GaxiosInterceptorManager<GaxiosOptions>;
|
||||
response: GaxiosInterceptorManager<GaxiosResponse>;
|
||||
};
|
||||
/**
|
||||
* The Gaxios class is responsible for making HTTP requests.
|
||||
* @param defaults The default set of options to be used for this instance.
|
||||
*/
|
||||
constructor(defaults?: GaxiosOptions);
|
||||
/**
|
||||
* Perform an HTTP request with the given options.
|
||||
* @param opts Set of HTTP options that will be used for this HTTP request.
|
||||
*/
|
||||
request<T = any>(opts?: GaxiosOptions): GaxiosPromise<T>;
|
||||
private _defaultAdapter;
|
||||
/**
|
||||
* Internal, retryable version of the `request` method.
|
||||
* @param opts Set of HTTP options that will be used for this HTTP request.
|
||||
*/
|
||||
protected _request<T = any>(opts?: GaxiosOptions): GaxiosPromise<T>;
|
||||
private getResponseData;
|
||||
/**
|
||||
* By default, throw for any non-2xx status code
|
||||
* @param status status code from the HTTP response
|
||||
*/
|
||||
private validateStatus;
|
||||
/**
|
||||
* Encode a set of key/value pars into a querystring format (?foo=bar&baz=boo)
|
||||
* @param params key value pars to encode
|
||||
*/
|
||||
private paramsSerializer;
|
||||
private translateResponse;
|
||||
/**
|
||||
* Attempts to parse a response by looking at the Content-Type header.
|
||||
* @param {FetchResponse} response the HTTP response.
|
||||
* @returns {Promise<any>} a promise that resolves to the response data.
|
||||
*/
|
||||
private getResponseDataFromContentType;
|
||||
/**
|
||||
* Creates an async generator that yields the pieces of a multipart/related request body.
|
||||
* This implementation follows the spec: https://www.ietf.org/rfc/rfc2387.txt. However, recursive
|
||||
* multipart/related requests are not currently supported.
|
||||
*
|
||||
* @param {GaxioMultipartOptions[]} multipartOptions the pieces to turn into a multipart/related body.
|
||||
* @param {string} boundary the boundary string to be placed between each part.
|
||||
*/
|
||||
private getMultipartRequest;
|
||||
}
|
||||
480
server/node_modules/gaxios/build/src/gaxios.js
generated
vendored
Normal file
480
server/node_modules/gaxios/build/src/gaxios.js
generated
vendored
Normal file
@@ -0,0 +1,480 @@
|
||||
"use strict";
|
||||
// Copyright 2018 Google LLC
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
||||
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
||||
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
||||
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
||||
};
|
||||
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
||||
if (kind === "m") throw new TypeError("Private method is not writable");
|
||||
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
||||
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
||||
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
||||
};
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
var _Gaxios_instances, _a, _Gaxios_urlMayUseProxy, _Gaxios_applyRequestInterceptors, _Gaxios_applyResponseInterceptors, _Gaxios_prepareRequest, _Gaxios_proxyAgent, _Gaxios_getProxyAgent;
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.Gaxios = void 0;
|
||||
const extend_1 = __importDefault(require("extend"));
|
||||
const https_1 = require("https");
|
||||
const node_fetch_1 = __importDefault(require("node-fetch"));
|
||||
const querystring_1 = __importDefault(require("querystring"));
|
||||
const is_stream_1 = __importDefault(require("is-stream"));
|
||||
const url_1 = require("url");
|
||||
const common_1 = require("./common");
|
||||
const retry_1 = require("./retry");
|
||||
const stream_1 = require("stream");
|
||||
const uuid_1 = require("uuid");
|
||||
const interceptor_1 = require("./interceptor");
|
||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||
const fetch = hasFetch() ? window.fetch : node_fetch_1.default;
|
||||
function hasWindow() {
|
||||
return typeof window !== 'undefined' && !!window;
|
||||
}
|
||||
function hasFetch() {
|
||||
return hasWindow() && !!window.fetch;
|
||||
}
|
||||
function hasBuffer() {
|
||||
return typeof Buffer !== 'undefined';
|
||||
}
|
||||
function hasHeader(options, header) {
|
||||
return !!getHeader(options, header);
|
||||
}
|
||||
function getHeader(options, header) {
|
||||
header = header.toLowerCase();
|
||||
for (const key of Object.keys((options === null || options === void 0 ? void 0 : options.headers) || {})) {
|
||||
if (header === key.toLowerCase()) {
|
||||
return options.headers[key];
|
||||
}
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
class Gaxios {
|
||||
/**
|
||||
* The Gaxios class is responsible for making HTTP requests.
|
||||
* @param defaults The default set of options to be used for this instance.
|
||||
*/
|
||||
constructor(defaults) {
|
||||
_Gaxios_instances.add(this);
|
||||
this.agentCache = new Map();
|
||||
this.defaults = defaults || {};
|
||||
this.interceptors = {
|
||||
request: new interceptor_1.GaxiosInterceptorManager(),
|
||||
response: new interceptor_1.GaxiosInterceptorManager(),
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Perform an HTTP request with the given options.
|
||||
* @param opts Set of HTTP options that will be used for this HTTP request.
|
||||
*/
|
||||
async request(opts = {}) {
|
||||
opts = await __classPrivateFieldGet(this, _Gaxios_instances, "m", _Gaxios_prepareRequest).call(this, opts);
|
||||
opts = await __classPrivateFieldGet(this, _Gaxios_instances, "m", _Gaxios_applyRequestInterceptors).call(this, opts);
|
||||
return __classPrivateFieldGet(this, _Gaxios_instances, "m", _Gaxios_applyResponseInterceptors).call(this, this._request(opts));
|
||||
}
|
||||
async _defaultAdapter(opts) {
|
||||
const fetchImpl = opts.fetchImplementation || fetch;
|
||||
const res = (await fetchImpl(opts.url, opts));
|
||||
const data = await this.getResponseData(opts, res);
|
||||
return this.translateResponse(opts, res, data);
|
||||
}
|
||||
/**
|
||||
* Internal, retryable version of the `request` method.
|
||||
* @param opts Set of HTTP options that will be used for this HTTP request.
|
||||
*/
|
||||
async _request(opts = {}) {
|
||||
var _b;
|
||||
try {
|
||||
let translatedResponse;
|
||||
if (opts.adapter) {
|
||||
translatedResponse = await opts.adapter(opts, this._defaultAdapter.bind(this));
|
||||
}
|
||||
else {
|
||||
translatedResponse = await this._defaultAdapter(opts);
|
||||
}
|
||||
if (!opts.validateStatus(translatedResponse.status)) {
|
||||
if (opts.responseType === 'stream') {
|
||||
let response = '';
|
||||
await new Promise(resolve => {
|
||||
(translatedResponse === null || translatedResponse === void 0 ? void 0 : translatedResponse.data).on('data', chunk => {
|
||||
response += chunk;
|
||||
});
|
||||
(translatedResponse === null || translatedResponse === void 0 ? void 0 : translatedResponse.data).on('end', resolve);
|
||||
});
|
||||
translatedResponse.data = response;
|
||||
}
|
||||
throw new common_1.GaxiosError(`Request failed with status code ${translatedResponse.status}`, opts, translatedResponse);
|
||||
}
|
||||
return translatedResponse;
|
||||
}
|
||||
catch (e) {
|
||||
const err = e instanceof common_1.GaxiosError
|
||||
? e
|
||||
: new common_1.GaxiosError(e.message, opts, undefined, e);
|
||||
const { shouldRetry, config } = await (0, retry_1.getRetryConfig)(err);
|
||||
if (shouldRetry && config) {
|
||||
err.config.retryConfig.currentRetryAttempt =
|
||||
config.retryConfig.currentRetryAttempt;
|
||||
// The error's config could be redacted - therefore we only want to
|
||||
// copy the retry state over to the existing config
|
||||
opts.retryConfig = (_b = err.config) === null || _b === void 0 ? void 0 : _b.retryConfig;
|
||||
return this._request(opts);
|
||||
}
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
async getResponseData(opts, res) {
|
||||
switch (opts.responseType) {
|
||||
case 'stream':
|
||||
return res.body;
|
||||
case 'json': {
|
||||
let data = await res.text();
|
||||
try {
|
||||
data = JSON.parse(data);
|
||||
}
|
||||
catch (_b) {
|
||||
// continue
|
||||
}
|
||||
return data;
|
||||
}
|
||||
case 'arraybuffer':
|
||||
return res.arrayBuffer();
|
||||
case 'blob':
|
||||
return res.blob();
|
||||
case 'text':
|
||||
return res.text();
|
||||
default:
|
||||
return this.getResponseDataFromContentType(res);
|
||||
}
|
||||
}
|
||||
/**
|
||||
* By default, throw for any non-2xx status code
|
||||
* @param status status code from the HTTP response
|
||||
*/
|
||||
validateStatus(status) {
|
||||
return status >= 200 && status < 300;
|
||||
}
|
||||
/**
|
||||
* Encode a set of key/value pars into a querystring format (?foo=bar&baz=boo)
|
||||
* @param params key value pars to encode
|
||||
*/
|
||||
paramsSerializer(params) {
|
||||
return querystring_1.default.stringify(params);
|
||||
}
|
||||
translateResponse(opts, res, data) {
|
||||
// headers need to be converted from a map to an obj
|
||||
const headers = {};
|
||||
res.headers.forEach((value, key) => {
|
||||
headers[key] = value;
|
||||
});
|
||||
return {
|
||||
config: opts,
|
||||
data: data,
|
||||
headers,
|
||||
status: res.status,
|
||||
statusText: res.statusText,
|
||||
// XMLHttpRequestLike
|
||||
request: {
|
||||
responseURL: res.url,
|
||||
},
|
||||
};
|
||||
}
|
||||
/**
|
||||
* Attempts to parse a response by looking at the Content-Type header.
|
||||
* @param {FetchResponse} response the HTTP response.
|
||||
* @returns {Promise<any>} a promise that resolves to the response data.
|
||||
*/
|
||||
async getResponseDataFromContentType(response) {
|
||||
let contentType = response.headers.get('Content-Type');
|
||||
if (contentType === null) {
|
||||
// Maintain existing functionality by calling text()
|
||||
return response.text();
|
||||
}
|
||||
contentType = contentType.toLowerCase();
|
||||
if (contentType.includes('application/json')) {
|
||||
let data = await response.text();
|
||||
try {
|
||||
data = JSON.parse(data);
|
||||
}
|
||||
catch (_b) {
|
||||
// continue
|
||||
}
|
||||
return data;
|
||||
}
|
||||
else if (contentType.match(/^text\//)) {
|
||||
return response.text();
|
||||
}
|
||||
else {
|
||||
// If the content type is something not easily handled, just return the raw data (blob)
|
||||
return response.blob();
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Creates an async generator that yields the pieces of a multipart/related request body.
|
||||
* This implementation follows the spec: https://www.ietf.org/rfc/rfc2387.txt. However, recursive
|
||||
* multipart/related requests are not currently supported.
|
||||
*
|
||||
* @param {GaxioMultipartOptions[]} multipartOptions the pieces to turn into a multipart/related body.
|
||||
* @param {string} boundary the boundary string to be placed between each part.
|
||||
*/
|
||||
async *getMultipartRequest(multipartOptions, boundary) {
|
||||
const finale = `--${boundary}--`;
|
||||
for (const currentPart of multipartOptions) {
|
||||
const partContentType = currentPart.headers['Content-Type'] || 'application/octet-stream';
|
||||
const preamble = `--${boundary}\r\nContent-Type: ${partContentType}\r\n\r\n`;
|
||||
yield preamble;
|
||||
if (typeof currentPart.content === 'string') {
|
||||
yield currentPart.content;
|
||||
}
|
||||
else {
|
||||
yield* currentPart.content;
|
||||
}
|
||||
yield '\r\n';
|
||||
}
|
||||
yield finale;
|
||||
}
|
||||
}
|
||||
exports.Gaxios = Gaxios;
|
||||
_a = Gaxios, _Gaxios_instances = new WeakSet(), _Gaxios_urlMayUseProxy = function _Gaxios_urlMayUseProxy(url, noProxy = []) {
|
||||
var _b, _c;
|
||||
const candidate = new url_1.URL(url);
|
||||
const noProxyList = [...noProxy];
|
||||
const noProxyEnvList = ((_c = ((_b = process.env.NO_PROXY) !== null && _b !== void 0 ? _b : process.env.no_proxy)) === null || _c === void 0 ? void 0 : _c.split(',')) || [];
|
||||
for (const rule of noProxyEnvList) {
|
||||
noProxyList.push(rule.trim());
|
||||
}
|
||||
for (const rule of noProxyList) {
|
||||
// Match regex
|
||||
if (rule instanceof RegExp) {
|
||||
if (rule.test(candidate.toString())) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// Match URL
|
||||
else if (rule instanceof url_1.URL) {
|
||||
if (rule.origin === candidate.origin) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// Match string regex
|
||||
else if (rule.startsWith('*.') || rule.startsWith('.')) {
|
||||
const cleanedRule = rule.replace(/^\*\./, '.');
|
||||
if (candidate.hostname.endsWith(cleanedRule)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// Basic string match
|
||||
else if (rule === candidate.origin ||
|
||||
rule === candidate.hostname ||
|
||||
rule === candidate.href) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}, _Gaxios_applyRequestInterceptors =
|
||||
/**
|
||||
* Applies the request interceptors. The request interceptors are applied after the
|
||||
* call to prepareRequest is completed.
|
||||
*
|
||||
* @param {GaxiosOptions} options The current set of options.
|
||||
*
|
||||
* @returns {Promise<GaxiosOptions>} Promise that resolves to the set of options or response after interceptors are applied.
|
||||
*/
|
||||
async function _Gaxios_applyRequestInterceptors(options) {
|
||||
let promiseChain = Promise.resolve(options);
|
||||
for (const interceptor of this.interceptors.request.values()) {
|
||||
if (interceptor) {
|
||||
promiseChain = promiseChain.then(interceptor.resolved, interceptor.rejected);
|
||||
}
|
||||
}
|
||||
return promiseChain;
|
||||
}, _Gaxios_applyResponseInterceptors =
|
||||
/**
|
||||
* Applies the response interceptors. The response interceptors are applied after the
|
||||
* call to request is made.
|
||||
*
|
||||
* @param {GaxiosOptions} options The current set of options.
|
||||
*
|
||||
* @returns {Promise<GaxiosOptions>} Promise that resolves to the set of options or response after interceptors are applied.
|
||||
*/
|
||||
async function _Gaxios_applyResponseInterceptors(response) {
|
||||
let promiseChain = Promise.resolve(response);
|
||||
for (const interceptor of this.interceptors.response.values()) {
|
||||
if (interceptor) {
|
||||
promiseChain = promiseChain.then(interceptor.resolved, interceptor.rejected);
|
||||
}
|
||||
}
|
||||
return promiseChain;
|
||||
}, _Gaxios_prepareRequest =
|
||||
/**
|
||||
* Validates the options, merges them with defaults, and prepare request.
|
||||
*
|
||||
* @param options The original options passed from the client.
|
||||
* @returns Prepared options, ready to make a request
|
||||
*/
|
||||
async function _Gaxios_prepareRequest(options) {
|
||||
var _b, _c, _d, _e;
|
||||
const opts = (0, extend_1.default)(true, {}, this.defaults, options);
|
||||
if (!opts.url) {
|
||||
throw new Error('URL is required.');
|
||||
}
|
||||
// baseUrl has been deprecated, remove in 2.0
|
||||
const baseUrl = opts.baseUrl || opts.baseURL;
|
||||
if (baseUrl) {
|
||||
opts.url = baseUrl.toString() + opts.url;
|
||||
}
|
||||
opts.paramsSerializer = opts.paramsSerializer || this.paramsSerializer;
|
||||
if (opts.params && Object.keys(opts.params).length > 0) {
|
||||
let additionalQueryParams = opts.paramsSerializer(opts.params);
|
||||
if (additionalQueryParams.startsWith('?')) {
|
||||
additionalQueryParams = additionalQueryParams.slice(1);
|
||||
}
|
||||
const prefix = opts.url.toString().includes('?') ? '&' : '?';
|
||||
opts.url = opts.url + prefix + additionalQueryParams;
|
||||
}
|
||||
if (typeof options.maxContentLength === 'number') {
|
||||
opts.size = options.maxContentLength;
|
||||
}
|
||||
if (typeof options.maxRedirects === 'number') {
|
||||
opts.follow = options.maxRedirects;
|
||||
}
|
||||
opts.headers = opts.headers || {};
|
||||
if (opts.multipart === undefined && opts.data) {
|
||||
const isFormData = typeof FormData === 'undefined'
|
||||
? false
|
||||
: (opts === null || opts === void 0 ? void 0 : opts.data) instanceof FormData;
|
||||
if (is_stream_1.default.readable(opts.data)) {
|
||||
opts.body = opts.data;
|
||||
}
|
||||
else if (hasBuffer() && Buffer.isBuffer(opts.data)) {
|
||||
// Do not attempt to JSON.stringify() a Buffer:
|
||||
opts.body = opts.data;
|
||||
if (!hasHeader(opts, 'Content-Type')) {
|
||||
opts.headers['Content-Type'] = 'application/json';
|
||||
}
|
||||
}
|
||||
else if (typeof opts.data === 'object') {
|
||||
// If www-form-urlencoded content type has been set, but data is
|
||||
// provided as an object, serialize the content using querystring:
|
||||
if (!isFormData) {
|
||||
if (getHeader(opts, 'content-type') ===
|
||||
'application/x-www-form-urlencoded') {
|
||||
opts.body = opts.paramsSerializer(opts.data);
|
||||
}
|
||||
else {
|
||||
// } else if (!(opts.data instanceof FormData)) {
|
||||
if (!hasHeader(opts, 'Content-Type')) {
|
||||
opts.headers['Content-Type'] = 'application/json';
|
||||
}
|
||||
opts.body = JSON.stringify(opts.data);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
opts.body = opts.data;
|
||||
}
|
||||
}
|
||||
else if (opts.multipart && opts.multipart.length > 0) {
|
||||
// note: once the minimum version reaches Node 16,
|
||||
// this can be replaced with randomUUID() function from crypto
|
||||
// and the dependency on UUID removed
|
||||
const boundary = (0, uuid_1.v4)();
|
||||
opts.headers['Content-Type'] = `multipart/related; boundary=${boundary}`;
|
||||
const bodyStream = new stream_1.PassThrough();
|
||||
opts.body = bodyStream;
|
||||
(0, stream_1.pipeline)(this.getMultipartRequest(opts.multipart, boundary), bodyStream, () => { });
|
||||
}
|
||||
opts.validateStatus = opts.validateStatus || this.validateStatus;
|
||||
opts.responseType = opts.responseType || 'unknown';
|
||||
if (!opts.headers['Accept'] && opts.responseType === 'json') {
|
||||
opts.headers['Accept'] = 'application/json';
|
||||
}
|
||||
opts.method = opts.method || 'GET';
|
||||
const proxy = opts.proxy ||
|
||||
((_b = process === null || process === void 0 ? void 0 : process.env) === null || _b === void 0 ? void 0 : _b.HTTPS_PROXY) ||
|
||||
((_c = process === null || process === void 0 ? void 0 : process.env) === null || _c === void 0 ? void 0 : _c.https_proxy) ||
|
||||
((_d = process === null || process === void 0 ? void 0 : process.env) === null || _d === void 0 ? void 0 : _d.HTTP_PROXY) ||
|
||||
((_e = process === null || process === void 0 ? void 0 : process.env) === null || _e === void 0 ? void 0 : _e.http_proxy);
|
||||
const urlMayUseProxy = __classPrivateFieldGet(this, _Gaxios_instances, "m", _Gaxios_urlMayUseProxy).call(this, opts.url, opts.noProxy);
|
||||
if (opts.agent) {
|
||||
// don't do any of the following options - use the user-provided agent.
|
||||
}
|
||||
else if (proxy && urlMayUseProxy) {
|
||||
const HttpsProxyAgent = await __classPrivateFieldGet(_a, _a, "m", _Gaxios_getProxyAgent).call(_a);
|
||||
if (this.agentCache.has(proxy)) {
|
||||
opts.agent = this.agentCache.get(proxy);
|
||||
}
|
||||
else {
|
||||
opts.agent = new HttpsProxyAgent(proxy, {
|
||||
cert: opts.cert,
|
||||
key: opts.key,
|
||||
});
|
||||
this.agentCache.set(proxy, opts.agent);
|
||||
}
|
||||
}
|
||||
else if (opts.cert && opts.key) {
|
||||
// Configure client for mTLS
|
||||
if (this.agentCache.has(opts.key)) {
|
||||
opts.agent = this.agentCache.get(opts.key);
|
||||
}
|
||||
else {
|
||||
opts.agent = new https_1.Agent({
|
||||
cert: opts.cert,
|
||||
key: opts.key,
|
||||
});
|
||||
this.agentCache.set(opts.key, opts.agent);
|
||||
}
|
||||
}
|
||||
if (typeof opts.errorRedactor !== 'function' &&
|
||||
opts.errorRedactor !== false) {
|
||||
opts.errorRedactor = common_1.defaultErrorRedactor;
|
||||
}
|
||||
return opts;
|
||||
}, _Gaxios_getProxyAgent = async function _Gaxios_getProxyAgent() {
|
||||
__classPrivateFieldSet(this, _a, __classPrivateFieldGet(this, _a, "f", _Gaxios_proxyAgent) || (await Promise.resolve().then(() => __importStar(require('https-proxy-agent')))).HttpsProxyAgent, "f", _Gaxios_proxyAgent);
|
||||
return __classPrivateFieldGet(this, _a, "f", _Gaxios_proxyAgent);
|
||||
};
|
||||
/**
|
||||
* A cache for the lazily-loaded proxy agent.
|
||||
*
|
||||
* Should use {@link Gaxios[#getProxyAgent]} to retrieve.
|
||||
*/
|
||||
// using `import` to dynamically import the types here
|
||||
_Gaxios_proxyAgent = { value: void 0 };
|
||||
//# sourceMappingURL=gaxios.js.map
|
||||
1
server/node_modules/gaxios/build/src/gaxios.js.map
generated
vendored
Normal file
1
server/node_modules/gaxios/build/src/gaxios.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
15
server/node_modules/gaxios/build/src/index.d.ts
generated
vendored
Normal file
15
server/node_modules/gaxios/build/src/index.d.ts
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
import { GaxiosOptions } from './common';
|
||||
import { Gaxios } from './gaxios';
|
||||
export { GaxiosError, GaxiosPromise, GaxiosResponse, Headers, RetryConfig, } from './common';
|
||||
export { Gaxios, GaxiosOptions };
|
||||
export * from './interceptor';
|
||||
/**
|
||||
* The default instance used when the `request` method is directly
|
||||
* invoked.
|
||||
*/
|
||||
export declare const instance: Gaxios;
|
||||
/**
|
||||
* Make an HTTP request using the given options.
|
||||
* @param opts Options for the request
|
||||
*/
|
||||
export declare function request<T>(opts: GaxiosOptions): Promise<import("./common").GaxiosResponse<T>>;
|
||||
48
server/node_modules/gaxios/build/src/index.js
generated
vendored
Normal file
48
server/node_modules/gaxios/build/src/index.js
generated
vendored
Normal file
@@ -0,0 +1,48 @@
|
||||
"use strict";
|
||||
// Copyright 2018 Google LLC
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
||||
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.instance = exports.Gaxios = exports.GaxiosError = void 0;
|
||||
exports.request = request;
|
||||
const gaxios_1 = require("./gaxios");
|
||||
Object.defineProperty(exports, "Gaxios", { enumerable: true, get: function () { return gaxios_1.Gaxios; } });
|
||||
var common_1 = require("./common");
|
||||
Object.defineProperty(exports, "GaxiosError", { enumerable: true, get: function () { return common_1.GaxiosError; } });
|
||||
__exportStar(require("./interceptor"), exports);
|
||||
/**
|
||||
* The default instance used when the `request` method is directly
|
||||
* invoked.
|
||||
*/
|
||||
exports.instance = new gaxios_1.Gaxios();
|
||||
/**
|
||||
* Make an HTTP request using the given options.
|
||||
* @param opts Options for the request
|
||||
*/
|
||||
async function request(opts) {
|
||||
return exports.instance.request(opts);
|
||||
}
|
||||
//# sourceMappingURL=index.js.map
|
||||
1
server/node_modules/gaxios/build/src/index.js.map
generated
vendored
Normal file
1
server/node_modules/gaxios/build/src/index.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA,4BAA4B;AAC5B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,gDAAgD;AAChD,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;;;;;;;;;;;;;;;;AAyBjC,0BAEC;AAxBD,qCAAgC;AASxB,uFATA,eAAM,OASA;AAPd,mCAMkB;AALhB,qGAAA,WAAW,OAAA;AAOb,gDAA8B;AAE9B;;;GAGG;AACU,QAAA,QAAQ,GAAG,IAAI,eAAM,EAAE,CAAC;AAErC;;;GAGG;AACI,KAAK,UAAU,OAAO,CAAI,IAAmB;IAClD,OAAO,gBAAQ,CAAC,OAAO,CAAI,IAAI,CAAC,CAAC;AACnC,CAAC"}
|
||||
25
server/node_modules/gaxios/build/src/interceptor.d.ts
generated
vendored
Normal file
25
server/node_modules/gaxios/build/src/interceptor.d.ts
generated
vendored
Normal file
@@ -0,0 +1,25 @@
|
||||
import { GaxiosError, GaxiosOptions, GaxiosResponse } from './common';
|
||||
/**
|
||||
* Interceptors that can be run for requests or responses. These interceptors run asynchronously.
|
||||
*/
|
||||
export interface GaxiosInterceptor<T extends GaxiosOptions | GaxiosResponse> {
|
||||
/**
|
||||
* Function to be run when applying an interceptor.
|
||||
*
|
||||
* @param {T} configOrResponse The current configuration or response.
|
||||
* @returns {Promise<T>} Promise that resolves to the modified set of options or response.
|
||||
*/
|
||||
resolved?: (configOrResponse: T) => Promise<T>;
|
||||
/**
|
||||
* Function to be run if the previous call to resolved throws / rejects or the request results in an invalid status
|
||||
* as determined by the call to validateStatus.
|
||||
*
|
||||
* @param {GaxiosError} err The error thrown from the previously called resolved function.
|
||||
*/
|
||||
rejected?: (err: GaxiosError) => void;
|
||||
}
|
||||
/**
|
||||
* Class to manage collections of GaxiosInterceptors for both requests and responses.
|
||||
*/
|
||||
export declare class GaxiosInterceptorManager<T extends GaxiosOptions | GaxiosResponse> extends Set<GaxiosInterceptor<T> | null> {
|
||||
}
|
||||
22
server/node_modules/gaxios/build/src/interceptor.js
generated
vendored
Normal file
22
server/node_modules/gaxios/build/src/interceptor.js
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
"use strict";
|
||||
// Copyright 2024 Google LLC
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.GaxiosInterceptorManager = void 0;
|
||||
/**
|
||||
* Class to manage collections of GaxiosInterceptors for both requests and responses.
|
||||
*/
|
||||
class GaxiosInterceptorManager extends Set {
|
||||
}
|
||||
exports.GaxiosInterceptorManager = GaxiosInterceptorManager;
|
||||
//# sourceMappingURL=interceptor.js.map
|
||||
1
server/node_modules/gaxios/build/src/interceptor.js.map
generated
vendored
Normal file
1
server/node_modules/gaxios/build/src/interceptor.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"interceptor.js","sourceRoot":"","sources":["../../src/interceptor.ts"],"names":[],"mappings":";AAAA,4BAA4B;AAC5B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,gDAAgD;AAChD,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;;AAwBjC;;GAEG;AACH,MAAa,wBAEX,SAAQ,GAAgC;CAAG;AAF7C,4DAE6C"}
|
||||
8
server/node_modules/gaxios/build/src/retry.d.ts
generated
vendored
Normal file
8
server/node_modules/gaxios/build/src/retry.d.ts
generated
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
import { GaxiosError } from './common';
|
||||
export declare function getRetryConfig(err: GaxiosError): Promise<{
|
||||
shouldRetry: boolean;
|
||||
config?: undefined;
|
||||
} | {
|
||||
shouldRetry: boolean;
|
||||
config: import("./common").GaxiosOptions;
|
||||
}>;
|
||||
166
server/node_modules/gaxios/build/src/retry.js
generated
vendored
Normal file
166
server/node_modules/gaxios/build/src/retry.js
generated
vendored
Normal file
@@ -0,0 +1,166 @@
|
||||
"use strict";
|
||||
// Copyright 2018 Google LLC
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.getRetryConfig = getRetryConfig;
|
||||
async function getRetryConfig(err) {
|
||||
let config = getConfig(err);
|
||||
if (!err || !err.config || (!config && !err.config.retry)) {
|
||||
return { shouldRetry: false };
|
||||
}
|
||||
config = config || {};
|
||||
config.currentRetryAttempt = config.currentRetryAttempt || 0;
|
||||
config.retry =
|
||||
config.retry === undefined || config.retry === null ? 3 : config.retry;
|
||||
config.httpMethodsToRetry = config.httpMethodsToRetry || [
|
||||
'GET',
|
||||
'HEAD',
|
||||
'PUT',
|
||||
'OPTIONS',
|
||||
'DELETE',
|
||||
];
|
||||
config.noResponseRetries =
|
||||
config.noResponseRetries === undefined || config.noResponseRetries === null
|
||||
? 2
|
||||
: config.noResponseRetries;
|
||||
config.retryDelayMultiplier = config.retryDelayMultiplier
|
||||
? config.retryDelayMultiplier
|
||||
: 2;
|
||||
config.timeOfFirstRequest = config.timeOfFirstRequest
|
||||
? config.timeOfFirstRequest
|
||||
: Date.now();
|
||||
config.totalTimeout = config.totalTimeout
|
||||
? config.totalTimeout
|
||||
: Number.MAX_SAFE_INTEGER;
|
||||
config.maxRetryDelay = config.maxRetryDelay
|
||||
? config.maxRetryDelay
|
||||
: Number.MAX_SAFE_INTEGER;
|
||||
// If this wasn't in the list of status codes where we want
|
||||
// to automatically retry, return.
|
||||
const retryRanges = [
|
||||
// https://en.wikipedia.org/wiki/List_of_HTTP_status_codes
|
||||
// 1xx - Retry (Informational, request still processing)
|
||||
// 2xx - Do not retry (Success)
|
||||
// 3xx - Do not retry (Redirect)
|
||||
// 4xx - Do not retry (Client errors)
|
||||
// 408 - Retry ("Request Timeout")
|
||||
// 429 - Retry ("Too Many Requests")
|
||||
// 5xx - Retry (Server errors)
|
||||
[100, 199],
|
||||
[408, 408],
|
||||
[429, 429],
|
||||
[500, 599],
|
||||
];
|
||||
config.statusCodesToRetry = config.statusCodesToRetry || retryRanges;
|
||||
// Put the config back into the err
|
||||
err.config.retryConfig = config;
|
||||
// Determine if we should retry the request
|
||||
const shouldRetryFn = config.shouldRetry || shouldRetryRequest;
|
||||
if (!(await shouldRetryFn(err))) {
|
||||
return { shouldRetry: false, config: err.config };
|
||||
}
|
||||
const delay = getNextRetryDelay(config);
|
||||
// We're going to retry! Incremenent the counter.
|
||||
err.config.retryConfig.currentRetryAttempt += 1;
|
||||
// Create a promise that invokes the retry after the backOffDelay
|
||||
const backoff = config.retryBackoff
|
||||
? config.retryBackoff(err, delay)
|
||||
: new Promise(resolve => {
|
||||
setTimeout(resolve, delay);
|
||||
});
|
||||
// Notify the user if they added an `onRetryAttempt` handler
|
||||
if (config.onRetryAttempt) {
|
||||
config.onRetryAttempt(err);
|
||||
}
|
||||
// Return the promise in which recalls Gaxios to retry the request
|
||||
await backoff;
|
||||
return { shouldRetry: true, config: err.config };
|
||||
}
|
||||
/**
|
||||
* Determine based on config if we should retry the request.
|
||||
* @param err The GaxiosError passed to the interceptor.
|
||||
*/
|
||||
function shouldRetryRequest(err) {
|
||||
var _a;
|
||||
const config = getConfig(err);
|
||||
// node-fetch raises an AbortError if signaled:
|
||||
// https://github.com/bitinn/node-fetch#request-cancellation-with-abortsignal
|
||||
if (err.name === 'AbortError' || ((_a = err.error) === null || _a === void 0 ? void 0 : _a.name) === 'AbortError') {
|
||||
return false;
|
||||
}
|
||||
// If there's no config, or retries are disabled, return.
|
||||
if (!config || config.retry === 0) {
|
||||
return false;
|
||||
}
|
||||
// Check if this error has no response (ETIMEDOUT, ENOTFOUND, etc)
|
||||
if (!err.response &&
|
||||
(config.currentRetryAttempt || 0) >= config.noResponseRetries) {
|
||||
return false;
|
||||
}
|
||||
// Only retry with configured HttpMethods.
|
||||
if (!err.config.method ||
|
||||
config.httpMethodsToRetry.indexOf(err.config.method.toUpperCase()) < 0) {
|
||||
return false;
|
||||
}
|
||||
// If this wasn't in the list of status codes where we want
|
||||
// to automatically retry, return.
|
||||
if (err.response && err.response.status) {
|
||||
let isInRange = false;
|
||||
for (const [min, max] of config.statusCodesToRetry) {
|
||||
const status = err.response.status;
|
||||
if (status >= min && status <= max) {
|
||||
isInRange = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!isInRange) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
// If we are out of retry attempts, return
|
||||
config.currentRetryAttempt = config.currentRetryAttempt || 0;
|
||||
if (config.currentRetryAttempt >= config.retry) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
/**
|
||||
* Acquire the raxConfig object from an GaxiosError if available.
|
||||
* @param err The Gaxios error with a config object.
|
||||
*/
|
||||
function getConfig(err) {
|
||||
if (err && err.config && err.config.retryConfig) {
|
||||
return err.config.retryConfig;
|
||||
}
|
||||
return;
|
||||
}
|
||||
/**
|
||||
* Gets the delay to wait before the next retry.
|
||||
*
|
||||
* @param {RetryConfig} config The current set of retry options
|
||||
* @returns {number} the amount of ms to wait before the next retry attempt.
|
||||
*/
|
||||
function getNextRetryDelay(config) {
|
||||
var _a;
|
||||
// Calculate time to wait with exponential backoff.
|
||||
// If this is the first retry, look for a configured retryDelay.
|
||||
const retryDelay = config.currentRetryAttempt ? 0 : (_a = config.retryDelay) !== null && _a !== void 0 ? _a : 100;
|
||||
// Formula: retryDelay + ((retryDelayMultiplier^currentRetryAttempt - 1 / 2) * 1000)
|
||||
const calculatedDelay = retryDelay +
|
||||
((Math.pow(config.retryDelayMultiplier, config.currentRetryAttempt) - 1) /
|
||||
2) *
|
||||
1000;
|
||||
const maxAllowableDelay = config.totalTimeout - (Date.now() - config.timeOfFirstRequest);
|
||||
return Math.min(calculatedDelay, maxAllowableDelay, config.maxRetryDelay);
|
||||
}
|
||||
//# sourceMappingURL=retry.js.map
|
||||
1
server/node_modules/gaxios/build/src/retry.js.map
generated
vendored
Normal file
1
server/node_modules/gaxios/build/src/retry.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"retry.js","sourceRoot":"","sources":["../../src/retry.ts"],"names":[],"mappings":";AAAA,4BAA4B;AAC5B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,gDAAgD;AAChD,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;AAIjC,wCAgFC;AAhFM,KAAK,UAAU,cAAc,CAAC,GAAgB;IACnD,IAAI,MAAM,GAAG,SAAS,CAAC,GAAG,CAAC,CAAC;IAC5B,IAAI,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,IAAI,CAAC,CAAC,MAAM,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;QAC1D,OAAO,EAAC,WAAW,EAAE,KAAK,EAAC,CAAC;IAC9B,CAAC;IACD,MAAM,GAAG,MAAM,IAAI,EAAE,CAAC;IACtB,MAAM,CAAC,mBAAmB,GAAG,MAAM,CAAC,mBAAmB,IAAI,CAAC,CAAC;IAC7D,MAAM,CAAC,KAAK;QACV,MAAM,CAAC,KAAK,KAAK,SAAS,IAAI,MAAM,CAAC,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;IACzE,MAAM,CAAC,kBAAkB,GAAG,MAAM,CAAC,kBAAkB,IAAI;QACvD,KAAK;QACL,MAAM;QACN,KAAK;QACL,SAAS;QACT,QAAQ;KACT,CAAC;IACF,MAAM,CAAC,iBAAiB;QACtB,MAAM,CAAC,iBAAiB,KAAK,SAAS,IAAI,MAAM,CAAC,iBAAiB,KAAK,IAAI;YACzE,CAAC,CAAC,CAAC;YACH,CAAC,CAAC,MAAM,CAA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;IACnD,gEAAgE;IAChE,MAAM,UAAU,GAAG,MAAM,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,MAAA,MAAM,CAAC,UAAU,mCAAI,GAAG,CAAC;IAC7E,oFAAoF;IACpF,MAAM,eAAe,GACnB,UAAU;QACV,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,oBAAqB,EAAE,MAAM,CAAC,mBAAoB,CAAC,GAAG,CAAC,CAAC;YACxE,CAAC,CAAC;YACF,IAAI,CAAC;IACT,MAAM,iBAAiB,GACrB,MAAM,CAAC,YAAa,GAAG,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,MAAM,CAAC,kBAAmB,CAAC,CAAC;IAEnE,OAAO,IAAI,CAAC,GAAG,CAAC,eAAe,EAAE,iBAAiB,EAAE,MAAM,CAAC,aAAc,CAAC,CAAC;AAC7E,CAAC"}
|
||||
4
server/node_modules/gaxios/build/src/util.d.ts
generated
vendored
Normal file
4
server/node_modules/gaxios/build/src/util.d.ts
generated
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
export declare const pkg: {
|
||||
name: string;
|
||||
version: string;
|
||||
};
|
||||
17
server/node_modules/gaxios/build/src/util.js
generated
vendored
Normal file
17
server/node_modules/gaxios/build/src/util.js
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
"use strict";
|
||||
// Copyright 2023 Google LLC
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.pkg = void 0;
|
||||
exports.pkg = require('../../package.json');
|
||||
//# sourceMappingURL=util.js.map
|
||||
1
server/node_modules/gaxios/build/src/util.js.map
generated
vendored
Normal file
1
server/node_modules/gaxios/build/src/util.js.map
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"util.js","sourceRoot":"","sources":["../../src/util.ts"],"names":[],"mappings":";AAAA,4BAA4B;AAC5B,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,gDAAgD;AAChD,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;;;AAEpB,QAAA,GAAG,GAGZ,OAAO,CAAC,oBAAoB,CAAC,CAAC"}
|
||||
Reference in New Issue
Block a user